From 107407b44b428e3cc32073f34fa215a64f5fda3b Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Wed, 7 May 2025 13:13:33 +0200 Subject: [PATCH] rebase: update replaced k8s.io modules to v0.33.0 Signed-off-by: Niels de Vos --- e2e/go.mod | 56 +- e2e/go.sum | 126 +- .../github.com/NYTimes/gziphandler/.gitignore | 1 - .../NYTimes/gziphandler/.travis.yml | 10 - .../NYTimes/gziphandler/CODE_OF_CONDUCT.md | 75 - .../NYTimes/gziphandler/CONTRIBUTING.md | 30 - .../github.com/NYTimes/gziphandler/LICENSE | 201 - .../github.com/NYTimes/gziphandler/README.md | 56 - .../github.com/NYTimes/gziphandler/gzip.go | 532 - .../NYTimes/gziphandler/gzip_go18.go | 43 - .../containers/v1/containers_grpc.pb.go | 2 + .../containers/v1/containers_ttrpc.pb.go | 174 + .../api/services/tasks/v1/tasks_grpc.pb.go | 2 + .../api/services/tasks/v1/tasks_ttrpc.pb.go | 301 + .../services/version/v1/version_grpc.pb.go | 2 + .../services/version/v1/version_ttrpc.pb.go | 45 + .../containerd/api/types/event.pb.go | 209 + .../containerd/api/types/event.proto | 33 + .../containerd/api/types/introspection.pb.go | 375 + .../containerd/api/types/introspection.proto | 46 + .../containerd/api/types/platform.pb.go | 22 +- .../containerd/api/types/platform.proto | 1 + .../containerd/api/types/platform_helpers.go | 49 + .../containerd/api/types/sandbox.pb.go | 51 +- .../containerd/api/types/sandbox.proto | 5 +- .../github.com/containerd/errdefs/errors.go | 439 +- .../github.com/containerd/errdefs/grpc.go | 147 - .../containerd/errdefs/pkg}/LICENSE | 17 +- .../containerd/errdefs/pkg/errgrpc/grpc.go | 353 + .../errdefs/pkg/internal/cause/cause.go | 33 + .../errdefs/pkg/internal/types/collapsible.go | 57 + .../github.com/containerd/errdefs/resolve.go | 147 + .../github.com/containerd/ttrpc/channel.go | 8 +- .../github.com/containerd/ttrpc/errors.go | 48 +- .../containerd/typeurl/v2/.gitignore | 2 + .../btree => containerd/typeurl/v2}/LICENSE | 17 +- .../containerd/typeurl/v2/README.md | 26 + .../github.com/containerd/typeurl/v2/doc.go | 83 + .../github.com/containerd/typeurl/v2/types.go | 307 + .../containerd/typeurl/v2/types_gogo.go | 68 + .../github.com/coreos/go-semver/LICENSE | 202 - e2e/vendor/github.com/coreos/go-semver/NOTICE | 5 - .../coreos/go-semver/semver/semver.go | 296 - .../coreos/go-semver/semver/sort.go | 38 - .../coreos/go-systemd/v22/daemon/sdnotify.go | 84 - .../coreos/go-systemd/v22/daemon/watchdog.go | 73 - .../coreos/go-systemd/v22/journal/journal.go | 46 - .../go-systemd/v22/journal/journal_unix.go | 267 - .../go-systemd/v22/journal/journal_windows.go | 43 - .../cyphar/filepath-securejoin/CHANGELOG.md | 82 +- .../cyphar/filepath-securejoin/VERSION | 2 +- .../gocompat_errors_go120.go | 18 + .../gocompat_errors_unsupported.go | 38 + .../gocompat_generics_go121.go | 32 + .../gocompat_generics_unsupported.go | 124 + .../cyphar/filepath-securejoin/join.go | 49 +- .../filepath-securejoin/lookup_linux.go | 3 +- .../cyphar/filepath-securejoin/mkdir_linux.go | 65 +- .../filepath-securejoin/openat2_linux.go | 3 +- .../filepath-securejoin/procfs_linux.go | 30 +- e2e/vendor/github.com/golang/protobuf/AUTHORS | 3 - .../github.com/golang/protobuf/CONTRIBUTORS | 3 - e2e/vendor/github.com/golang/protobuf/LICENSE | 28 - .../golang/protobuf/proto/buffer.go | 324 - .../golang/protobuf/proto/defaults.go | 63 - .../golang/protobuf/proto/deprecated.go | 113 - .../golang/protobuf/proto/discard.go | 58 - .../golang/protobuf/proto/extensions.go | 356 - .../golang/protobuf/proto/properties.go | 306 - .../github.com/golang/protobuf/proto/proto.go | 167 - .../golang/protobuf/proto/registry.go | 317 - .../golang/protobuf/proto/text_decode.go | 801 - .../golang/protobuf/proto/text_encode.go | 560 - .../github.com/golang/protobuf/proto/wire.go | 78 - .../golang/protobuf/proto/wrappers.go | 34 - e2e/vendor/github.com/google/btree/README.md | 10 - e2e/vendor/github.com/google/btree/btree.go | 893 - .../github.com/google/btree/btree_generic.go | 1083 - .../cadvisor/container/common/helpers.go | 2 +- .../cadvisor/container/containerd/client.go | 8 +- .../cadvisor/container/containerd/handler.go | 2 +- .../google/cadvisor/container/crio/handler.go | 2 +- .../google/cadvisor/container/factory.go | 2 + .../container/libcontainer/handler.go | 35 +- .../container/libcontainer/helpers.go | 15 +- .../google/cadvisor/container/raw/handler.go | 2 +- .../google/cadvisor/info/v1/container.go | 26 +- .../google/cadvisor/manager/manager.go | 6 +- .../google/cadvisor/resctrl/collector.go | 171 - .../google/cadvisor/resctrl/factory.go | 58 + .../google/cadvisor/resctrl/manager.go | 79 - .../google/cadvisor/resctrl/utils.go | 369 - .../cadvisor/utils/cpuload/netlink/netlink.go | 8 +- .../go-grpc-prometheus/.gitignore | 201 - .../go-grpc-prometheus/.travis.yml | 25 - .../go-grpc-prometheus/CHANGELOG.md | 24 - .../grpc-ecosystem/go-grpc-prometheus/LICENSE | 201 - .../go-grpc-prometheus/README.md | 247 - .../go-grpc-prometheus/client.go | 39 - .../go-grpc-prometheus/client_metrics.go | 170 - .../go-grpc-prometheus/client_reporter.go | 46 - .../go-grpc-prometheus/makefile | 16 - .../go-grpc-prometheus/metric_options.go | 41 - .../go-grpc-prometheus/server.go | 48 - .../go-grpc-prometheus/server_metrics.go | 185 - .../go-grpc-prometheus/server_reporter.go | 46 - .../grpc-ecosystem/go-grpc-prometheus/util.go | 50 - .../opencontainers/cgroups/CODEOWNERS | 1 + .../opencontainers/cgroups/CONTRIBUTING.md | 150 + .../opencontainers/cgroups/GOVERNANCE.md | 63 + .../opencontainers/cgroups}/LICENSE | 0 .../opencontainers/cgroups/MAINTAINERS | 8 + .../cgroups/MAINTAINERS_GUIDE.md | 92 + .../opencontainers/cgroups/README.md | 11 + .../opencontainers/cgroups/RELEASES.md | 51 + .../libcontainer => }/cgroups/cgroups.go | 16 +- .../config_blkio_device.go} | 2 +- .../config_hugepages.go} | 2 +- .../config_ifprio_map.go} | 2 +- .../config_linux.go} | 4 +- .../rdma.go => cgroups/config_rdma.go} | 2 +- .../config_unsupported.go} | 2 +- .../devices/config}/device.go | 2 +- .../cgroups/devices/config/mknod_unix.go | 14 + .../{runc/libcontainer => }/cgroups/file.go | 18 +- .../libcontainer => }/cgroups/fs/blkio.go | 7 +- .../{runc/libcontainer => }/cgroups/fs/cpu.go | 11 +- .../libcontainer => }/cgroups/fs/cpuacct.go | 38 +- .../libcontainer => }/cgroups/fs/cpuset.go | 101 +- .../libcontainer => }/cgroups/fs/devices.go | 7 +- .../libcontainer => }/cgroups/fs/error.go | 2 +- .../libcontainer => }/cgroups/fs/freezer.go | 39 +- .../{runc/libcontainer => }/cgroups/fs/fs.go | 25 +- .../libcontainer => }/cgroups/fs/hugetlb.go | 9 +- .../libcontainer => }/cgroups/fs/memory.go | 11 +- .../libcontainer => }/cgroups/fs/name.go | 7 +- .../libcontainer => }/cgroups/fs/net_cls.go | 7 +- .../libcontainer => }/cgroups/fs/net_prio.go | 7 +- .../libcontainer => }/cgroups/fs/paths.go | 25 +- .../cgroups/fs/perf_event.go | 7 +- .../libcontainer => }/cgroups/fs/pids.go | 9 +- .../libcontainer => }/cgroups/fs/rdma.go | 9 +- .../libcontainer => }/cgroups/fs2/cpu.go | 11 +- .../libcontainer => }/cgroups/fs2/cpuset.go | 7 +- .../libcontainer => }/cgroups/fs2/create.go | 13 +- .../cgroups/fs2/defaultpath.go | 44 +- .../libcontainer => }/cgroups/fs2/freezer.go | 43 +- .../libcontainer => }/cgroups/fs2/fs2.go | 28 +- .../libcontainer => }/cgroups/fs2/hugetlb.go | 9 +- .../{runc/libcontainer => }/cgroups/fs2/io.go | 7 +- .../libcontainer => }/cgroups/fs2/memory.go | 9 +- .../libcontainer => }/cgroups/fs2/misc.go | 4 +- .../libcontainer => }/cgroups/fs2/pids.go | 9 +- .../libcontainer => }/cgroups/fs2/psi.go | 16 +- .../cgroups/fscommon/rdma.go | 19 +- .../cgroups/fscommon/utils.go | 33 +- .../libcontainer => }/cgroups/getallpids.go | 0 .../cgroups/internal/path/path.go | 52 + .../libcontainer => }/cgroups/manager/new.go | 13 +- .../{runc/libcontainer => }/cgroups/stats.go | 0 .../cgroups/systemd/common.go | 11 +- .../cgroups/systemd/cpuset.go | 0 .../libcontainer => }/cgroups/systemd/dbus.go | 0 .../cgroups/systemd/devices.go | 8 +- .../libcontainer => }/cgroups/systemd/user.go | 3 +- .../libcontainer => }/cgroups/systemd/v1.go | 35 +- .../libcontainer => }/cgroups/systemd/v2.go | 19 +- .../{runc/libcontainer => }/cgroups/utils.go | 32 +- .../libcontainer => }/cgroups/v1_utils.go | 0 .../{runc => image-spec}/LICENSE | 2 +- .../image-spec/specs-go/v1/annotations.go | 62 + .../image-spec/specs-go/v1/config.go | 111 + .../image-spec/specs-go/v1/descriptor.go | 80 + .../image-spec/specs-go/v1/index.go | 38 + .../image-spec/specs-go/v1/layout.go | 32 + .../image-spec/specs-go/v1/manifest.go | 41 + .../image-spec/specs-go/v1/mediatype.go | 85 + .../image-spec/specs-go/version.go} | 33 +- .../image-spec/specs-go/versioned.go} | 19 +- .../github.com/opencontainers/runc/NOTICE | 17 - .../runc/libcontainer/configs/config.go | 508 - .../runc/libcontainer/configs/config_linux.go | 97 - .../libcontainer/configs/configs_fuzzer.go | 9 - .../runc/libcontainer/configs/intelrdt.go | 16 - .../runc/libcontainer/configs/mount.go | 7 - .../runc/libcontainer/configs/mount_linux.go | 66 - .../libcontainer/configs/mount_unsupported.go | 9 - .../runc/libcontainer/configs/namespaces.go | 5 - .../libcontainer/configs/namespaces_linux.go | 133 - .../configs/namespaces_syscall.go | 45 - .../configs/namespaces_syscall_unsupported.go | 13 - .../configs/namespaces_unsupported.go | 7 - .../runc/libcontainer/configs/network.go | 75 - .../runc/libcontainer/devices/device_unix.go | 119 - .../runc/libcontainer/intelrdt/cmt.go | 23 - .../runc/libcontainer/intelrdt/intelrdt.go | 681 - .../runc/libcontainer/intelrdt/mbm.go | 31 - .../runc/libcontainer/intelrdt/monitoring.go | 83 - .../runc/libcontainer/intelrdt/stats.go | 57 - .../runc/libcontainer/utils/cmsg.go | 119 - .../runc/libcontainer/utils/utils.go | 115 - .../runc/libcontainer/utils/utils_unix.go | 363 - .../go.etcd.io/etcd/api/v3/authpb/auth.pb.go | 1158 - .../go.etcd.io/etcd/api/v3/authpb/auth.proto | 42 - .../etcd/api/v3/etcdserverpb/etcdserver.pb.go | 1002 - .../etcd/api/v3/etcdserverpb/etcdserver.proto | 34 - .../api/v3/etcdserverpb/raft_internal.pb.go | 2673 -- .../api/v3/etcdserverpb/raft_internal.proto | 81 - .../v3/etcdserverpb/raft_internal_stringer.go | 183 - .../etcd/api/v3/etcdserverpb/rpc.pb.go | 25862 ---------------- .../etcd/api/v3/etcdserverpb/rpc.proto | 1199 - .../etcd/api/v3/membershippb/membership.pb.go | 1454 - .../etcd/api/v3/membershippb/membership.proto | 43 - .../go.etcd.io/etcd/api/v3/mvccpb/kv.pb.go | 798 - .../go.etcd.io/etcd/api/v3/mvccpb/kv.proto | 49 - .../etcd/api/v3/v3rpc/rpctypes/doc.go | 16 - .../etcd/api/v3/v3rpc/rpctypes/error.go | 267 - .../etcd/api/v3/v3rpc/rpctypes/md.go | 22 - .../api/v3/v3rpc/rpctypes/metadatafields.go | 20 - .../go.etcd.io/etcd/api/v3/version/version.go | 56 - .../go.etcd.io/etcd/client/pkg/v3/LICENSE | 202 - .../etcd/client/pkg/v3/fileutil/dir_unix.go | 28 - .../client/pkg/v3/fileutil/dir_windows.go | 52 - .../etcd/client/pkg/v3/fileutil/doc.go | 16 - .../etcd/client/pkg/v3/fileutil/filereader.go | 60 - .../etcd/client/pkg/v3/fileutil/fileutil.go | 168 - .../etcd/client/pkg/v3/fileutil/lock.go | 26 - .../etcd/client/pkg/v3/fileutil/lock_flock.go | 50 - .../etcd/client/pkg/v3/fileutil/lock_linux.go | 93 - .../etcd/client/pkg/v3/fileutil/lock_plan9.go | 45 - .../client/pkg/v3/fileutil/lock_solaris.go | 63 - .../etcd/client/pkg/v3/fileutil/lock_unix.go | 30 - .../client/pkg/v3/fileutil/lock_windows.go | 126 - .../client/pkg/v3/fileutil/preallocate.go | 54 - .../pkg/v3/fileutil/preallocate_darwin.go | 67 - .../pkg/v3/fileutil/preallocate_unix.go | 50 - .../etcd/client/pkg/v3/fileutil/purge.go | 112 - .../etcd/client/pkg/v3/fileutil/read_dir.go | 70 - .../etcd/client/pkg/v3/fileutil/sync.go | 30 - .../client/pkg/v3/fileutil/sync_darwin.go | 39 - .../etcd/client/pkg/v3/fileutil/sync_linux.go | 35 - .../etcd/client/pkg/v3/logutil/doc.go | 16 - .../etcd/client/pkg/v3/logutil/log_level.go | 30 - .../etcd/client/pkg/v3/logutil/zap.go | 108 - .../etcd/client/pkg/v3/logutil/zap_journal.go | 93 - .../etcd/client/pkg/v3/systemd/doc.go | 16 - .../etcd/client/pkg/v3/systemd/journal.go | 29 - .../client/pkg/v3/tlsutil/cipher_suites.go | 56 - .../etcd/client/pkg/v3/tlsutil/doc.go | 16 - .../etcd/client/pkg/v3/tlsutil/tlsutil.go | 73 - .../etcd/client/pkg/v3/tlsutil/versions.go | 47 - .../etcd/client/pkg/v3/transport/doc.go | 17 - .../pkg/v3/transport/keepalive_listener.go | 116 - .../transport/keepalive_listener_openbsd.go | 26 - .../v3/transport/keepalive_listener_unix.go | 24 - .../client/pkg/v3/transport/limit_listen.go | 86 - .../etcd/client/pkg/v3/transport/listener.go | 638 - .../client/pkg/v3/transport/listener_opts.go | 76 - .../client/pkg/v3/transport/listener_tls.go | 272 - .../etcd/client/pkg/v3/transport/sockopt.go | 45 - .../pkg/v3/transport/sockopt_solaris.go | 35 - .../client/pkg/v3/transport/sockopt_unix.go | 36 - .../pkg/v3/transport/sockopt_windows.go | 19 - .../client/pkg/v3/transport/timeout_conn.go | 44 - .../client/pkg/v3/transport/timeout_dialer.go | 36 - .../pkg/v3/transport/timeout_listener.go | 45 - .../pkg/v3/transport/timeout_transport.go | 51 - .../etcd/client/pkg/v3/transport/tls.go | 52 - .../etcd/client/pkg/v3/transport/transport.go | 77 - .../client/pkg/v3/transport/unix_listener.go | 40 - .../etcd/client/pkg/v3/types/doc.go | 17 - .../go.etcd.io/etcd/client/pkg/v3/types/id.go | 39 - .../etcd/client/pkg/v3/types/set.go | 195 - .../etcd/client/pkg/v3/types/slice.go | 22 - .../etcd/client/pkg/v3/types/urls.go | 87 - .../etcd/client/pkg/v3/types/urlsmap.go | 107 - e2e/vendor/go.etcd.io/etcd/client/v3/LICENSE | 202 - .../go.etcd.io/etcd/client/v3/README.md | 85 - e2e/vendor/go.etcd.io/etcd/client/v3/auth.go | 236 - .../go.etcd.io/etcd/client/v3/client.go | 629 - .../go.etcd.io/etcd/client/v3/cluster.go | 141 - .../go.etcd.io/etcd/client/v3/compact_op.go | 51 - .../go.etcd.io/etcd/client/v3/compare.go | 140 - .../go.etcd.io/etcd/client/v3/config.go | 101 - .../etcd/client/v3/credentials/credentials.go | 131 - e2e/vendor/go.etcd.io/etcd/client/v3/ctx.go | 50 - e2e/vendor/go.etcd.io/etcd/client/v3/doc.go | 106 - .../client/v3/internal/endpoint/endpoint.go | 134 - .../client/v3/internal/resolver/resolver.go | 74 - .../etcd/client/v3/kubernetes/client.go | 136 - .../etcd/client/v3/kubernetes/interface.go | 140 - e2e/vendor/go.etcd.io/etcd/client/v3/kv.go | 177 - e2e/vendor/go.etcd.io/etcd/client/v3/lease.go | 617 - .../go.etcd.io/etcd/client/v3/logger.go | 59 - .../go.etcd.io/etcd/client/v3/maintenance.go | 255 - e2e/vendor/go.etcd.io/etcd/client/v3/op.go | 583 - .../go.etcd.io/etcd/client/v3/options.go | 69 - e2e/vendor/go.etcd.io/etcd/client/v3/retry.go | 306 - .../etcd/client/v3/retry_interceptor.go | 445 - e2e/vendor/go.etcd.io/etcd/client/v3/txn.go | 150 - e2e/vendor/go.etcd.io/etcd/client/v3/utils.go | 31 - e2e/vendor/go.etcd.io/etcd/client/v3/watch.go | 1042 - .../otel/semconv/internal/http.go | 327 - .../otel/semconv/v1.12.0/README.md | 3 - .../otel/semconv/v1.12.0/doc.go | 9 - .../otel/semconv/v1.12.0/exception.go | 9 - .../otel/semconv/v1.12.0/http.go | 103 - .../otel/semconv/v1.12.0/resource.go | 1031 - .../otel/semconv/v1.12.0/schema.go | 9 - .../otel/semconv/v1.12.0/trace.go | 1693 - e2e/vendor/go.uber.org/multierr/.codecov.yml | 15 - e2e/vendor/go.uber.org/multierr/.gitignore | 4 - e2e/vendor/go.uber.org/multierr/CHANGELOG.md | 95 - e2e/vendor/go.uber.org/multierr/LICENSE.txt | 19 - e2e/vendor/go.uber.org/multierr/Makefile | 38 - e2e/vendor/go.uber.org/multierr/README.md | 43 - e2e/vendor/go.uber.org/multierr/error.go | 646 - .../go.uber.org/multierr/error_post_go120.go | 48 - .../go.uber.org/multierr/error_pre_go120.go | 79 - e2e/vendor/go.uber.org/zap/.codecov.yml | 17 - e2e/vendor/go.uber.org/zap/.gitignore | 32 - e2e/vendor/go.uber.org/zap/.golangci.yml | 77 - e2e/vendor/go.uber.org/zap/.readme.tmpl | 117 - e2e/vendor/go.uber.org/zap/CHANGELOG.md | 687 - e2e/vendor/go.uber.org/zap/CODE_OF_CONDUCT.md | 75 - e2e/vendor/go.uber.org/zap/CONTRIBUTING.md | 70 - e2e/vendor/go.uber.org/zap/FAQ.md | 164 - e2e/vendor/go.uber.org/zap/LICENSE | 19 - e2e/vendor/go.uber.org/zap/Makefile | 76 - e2e/vendor/go.uber.org/zap/README.md | 149 - e2e/vendor/go.uber.org/zap/array.go | 447 - e2e/vendor/go.uber.org/zap/buffer/buffer.go | 146 - e2e/vendor/go.uber.org/zap/buffer/pool.go | 53 - e2e/vendor/go.uber.org/zap/checklicense.sh | 17 - e2e/vendor/go.uber.org/zap/config.go | 330 - e2e/vendor/go.uber.org/zap/doc.go | 117 - e2e/vendor/go.uber.org/zap/encoder.go | 79 - e2e/vendor/go.uber.org/zap/error.go | 82 - e2e/vendor/go.uber.org/zap/field.go | 615 - e2e/vendor/go.uber.org/zap/flag.go | 39 - e2e/vendor/go.uber.org/zap/glide.yaml | 34 - e2e/vendor/go.uber.org/zap/global.go | 169 - e2e/vendor/go.uber.org/zap/http_handler.go | 140 - .../zap/internal/bufferpool/bufferpool.go | 31 - .../go.uber.org/zap/internal/color/color.go | 44 - .../go.uber.org/zap/internal/exit/exit.go | 66 - .../go.uber.org/zap/internal/level_enabler.go | 37 - .../go.uber.org/zap/internal/pool/pool.go | 58 - .../zap/internal/stacktrace/stack.go | 181 - e2e/vendor/go.uber.org/zap/level.go | 153 - e2e/vendor/go.uber.org/zap/logger.go | 435 - e2e/vendor/go.uber.org/zap/options.go | 182 - e2e/vendor/go.uber.org/zap/sink.go | 180 - e2e/vendor/go.uber.org/zap/sugar.go | 476 - e2e/vendor/go.uber.org/zap/time.go | 27 - e2e/vendor/go.uber.org/zap/writer.go | 98 - .../zap/zapcore/buffered_write_syncer.go | 219 - e2e/vendor/go.uber.org/zap/zapcore/clock.go | 48 - .../zap/zapcore/console_encoder.go | 157 - e2e/vendor/go.uber.org/zap/zapcore/core.go | 122 - e2e/vendor/go.uber.org/zap/zapcore/doc.go | 24 - e2e/vendor/go.uber.org/zap/zapcore/encoder.go | 466 - e2e/vendor/go.uber.org/zap/zapcore/entry.go | 298 - e2e/vendor/go.uber.org/zap/zapcore/error.go | 136 - e2e/vendor/go.uber.org/zap/zapcore/field.go | 233 - e2e/vendor/go.uber.org/zap/zapcore/hook.go | 77 - .../go.uber.org/zap/zapcore/increase_level.go | 75 - .../go.uber.org/zap/zapcore/json_encoder.go | 583 - .../go.uber.org/zap/zapcore/lazy_with.go | 54 - e2e/vendor/go.uber.org/zap/zapcore/level.go | 229 - .../go.uber.org/zap/zapcore/level_strings.go | 46 - .../go.uber.org/zap/zapcore/marshaler.go | 61 - .../go.uber.org/zap/zapcore/memory_encoder.go | 179 - .../zap/zapcore/reflected_encoder.go | 41 - e2e/vendor/go.uber.org/zap/zapcore/sampler.go | 229 - e2e/vendor/go.uber.org/zap/zapcore/tee.go | 96 - .../go.uber.org/zap/zapcore/write_syncer.go | 122 - e2e/vendor/go.uber.org/zap/zapgrpc/zapgrpc.go | 243 - .../golang.org/x/crypto/cryptobyte/asn1.go | 825 - .../x/crypto/cryptobyte/asn1/asn1.go | 46 - .../golang.org/x/crypto/cryptobyte/builder.go | 350 - .../golang.org/x/crypto/cryptobyte/string.go | 183 - e2e/vendor/golang.org/x/crypto/hkdf/hkdf.go | 95 - .../x/crypto/nacl/secretbox/secretbox.go | 173 - .../x/crypto/salsa20/salsa/hsalsa20.go | 146 - .../x/crypto/salsa20/salsa/salsa208.go | 201 - .../x/crypto/salsa20/salsa/salsa20_amd64.go | 23 - .../x/crypto/salsa20/salsa/salsa20_amd64.s | 880 - .../x/crypto/salsa20/salsa/salsa20_noasm.go | 14 - .../x/crypto/salsa20/salsa/salsa20_ref.go | 233 - .../api/annotations/annotations.pb.go | 119 - .../googleapis/api/annotations/client.pb.go | 2103 -- .../api/annotations/field_behavior.pb.go | 266 - .../api/annotations/field_info.pb.go | 392 - .../googleapis/api/annotations/http.pb.go | 774 - .../googleapis/api/annotations/resource.pb.go | 659 - .../googleapis/api/annotations/routing.pb.go | 693 - .../googleapis/api/launch_stage.pb.go | 203 - .../grpc/resolver/manual/manual.go | 130 - .../natefinch/lumberjack.v2/.gitignore | 23 - .../natefinch/lumberjack.v2/.travis.yml | 11 - .../gopkg.in/natefinch/lumberjack.v2/LICENSE | 21 - .../natefinch/lumberjack.v2/README.md | 179 - .../gopkg.in/natefinch/lumberjack.v2/chown.go | 11 - .../natefinch/lumberjack.v2/chown_linux.go | 19 - .../natefinch/lumberjack.v2/lumberjack.go | 541 - e2e/vendor/k8s.io/api/admission/v1/doc.go | 2 +- .../k8s.io/api/admission/v1beta1/doc.go | 2 +- .../api/admissionregistration/v1/doc.go | 2 +- .../api/admissionregistration/v1alpha1/doc.go | 2 +- .../v1alpha1/generated.proto | 13 +- .../admissionregistration/v1alpha1/types.go | 23 +- .../v1alpha1/types_swagger_doc_generated.go | 8 +- .../api/admissionregistration/v1beta1/doc.go | 2 +- e2e/vendor/k8s.io/api/apidiscovery/v2/doc.go | 2 +- .../k8s.io/api/apidiscovery/v2beta1/doc.go | 2 +- .../api/apiserverinternal/v1alpha1/doc.go | 2 +- e2e/vendor/k8s.io/api/apps/v1/doc.go | 2 +- e2e/vendor/k8s.io/api/apps/v1/generated.pb.go | 336 +- e2e/vendor/k8s.io/api/apps/v1/generated.proto | 41 +- e2e/vendor/k8s.io/api/apps/v1/types.go | 41 +- .../apps/v1/types_swagger_doc_generated.go | 24 +- .../api/apps/v1/zz_generated.deepcopy.go | 10 + e2e/vendor/k8s.io/api/apps/v1beta1/doc.go | 2 +- .../k8s.io/api/apps/v1beta1/generated.pb.go | 286 +- .../k8s.io/api/apps/v1beta1/generated.proto | 22 +- e2e/vendor/k8s.io/api/apps/v1beta1/types.go | 22 +- .../v1beta1/types_swagger_doc_generated.go | 15 +- .../api/apps/v1beta1/zz_generated.deepcopy.go | 5 + e2e/vendor/k8s.io/api/apps/v1beta2/doc.go | 2 +- .../k8s.io/api/apps/v1beta2/generated.pb.go | 352 +- .../k8s.io/api/apps/v1beta2/generated.proto | 41 +- e2e/vendor/k8s.io/api/apps/v1beta2/types.go | 41 +- .../v1beta2/types_swagger_doc_generated.go | 24 +- .../api/apps/v1beta2/zz_generated.deepcopy.go | 10 + .../k8s.io/api/authentication/v1/doc.go | 2 +- .../k8s.io/api/authentication/v1alpha1/doc.go | 2 +- .../k8s.io/api/authentication/v1beta1/doc.go | 2 +- e2e/vendor/k8s.io/api/authorization/v1/doc.go | 2 +- .../k8s.io/api/authorization/v1beta1/doc.go | 2 +- e2e/vendor/k8s.io/api/autoscaling/v1/doc.go | 2 +- e2e/vendor/k8s.io/api/autoscaling/v2/doc.go | 2 +- .../k8s.io/api/autoscaling/v2/generated.pb.go | 272 +- .../k8s.io/api/autoscaling/v2/generated.proto | 30 +- e2e/vendor/k8s.io/api/autoscaling/v2/types.go | 30 +- .../v2/types_swagger_doc_generated.go | 5 +- .../autoscaling/v2/zz_generated.deepcopy.go | 5 + .../k8s.io/api/autoscaling/v2beta1/doc.go | 2 +- .../k8s.io/api/autoscaling/v2beta2/doc.go | 2 +- e2e/vendor/k8s.io/api/batch/v1/doc.go | 2 +- .../k8s.io/api/batch/v1/generated.proto | 10 - e2e/vendor/k8s.io/api/batch/v1/types.go | 15 - .../batch/v1/types_swagger_doc_generated.go | 10 +- e2e/vendor/k8s.io/api/batch/v1beta1/doc.go | 2 +- e2e/vendor/k8s.io/api/certificates/v1/doc.go | 2 +- .../k8s.io/api/certificates/v1alpha1/doc.go | 2 +- .../k8s.io/api/certificates/v1beta1/doc.go | 2 +- .../api/certificates/v1beta1/generated.pb.go | 761 +- .../api/certificates/v1beta1/generated.proto | 73 + .../api/certificates/v1beta1/register.go | 2 + .../k8s.io/api/certificates/v1beta1/types.go | 85 + .../v1beta1/types_swagger_doc_generated.go | 30 + .../v1beta1/zz_generated.deepcopy.go | 76 + .../zz_generated.prerelease-lifecycle.go | 36 + e2e/vendor/k8s.io/api/coordination/v1/doc.go | 2 +- .../k8s.io/api/coordination/v1alpha2/doc.go | 2 +- .../api/coordination/v1alpha2/generated.proto | 2 - .../k8s.io/api/coordination/v1alpha2/types.go | 2 - .../v1alpha2/types_swagger_doc_generated.go | 2 +- .../k8s.io/api/coordination/v1beta1/doc.go | 2 +- .../api/coordination/v1beta1/generated.pb.go | 915 +- .../api/coordination/v1beta1/generated.proto | 69 + .../api/coordination/v1beta1/register.go | 2 + .../k8s.io/api/coordination/v1beta1/types.go | 73 + .../v1beta1/types_swagger_doc_generated.go | 34 + .../v1beta1/zz_generated.deepcopy.go | 84 + .../zz_generated.prerelease-lifecycle.go | 36 + e2e/vendor/k8s.io/api/core/v1/doc.go | 2 +- e2e/vendor/k8s.io/api/core/v1/generated.pb.go | 2599 +- e2e/vendor/k8s.io/api/core/v1/generated.proto | 77 +- e2e/vendor/k8s.io/api/core/v1/lifecycle.go | 24 + e2e/vendor/k8s.io/api/core/v1/types.go | 201 +- .../core/v1/types_swagger_doc_generated.go | 50 +- .../api/core/v1/zz_generated.deepcopy.go | 38 +- e2e/vendor/k8s.io/api/discovery/v1/doc.go | 2 +- .../k8s.io/api/discovery/v1/generated.pb.go | 336 +- .../k8s.io/api/discovery/v1/generated.proto | 78 +- e2e/vendor/k8s.io/api/discovery/v1/types.go | 78 +- .../v1/types_swagger_doc_generated.go | 28 +- .../api/discovery/v1/zz_generated.deepcopy.go | 21 + .../k8s.io/api/discovery/v1beta1/doc.go | 2 +- .../api/discovery/v1beta1/generated.pb.go | 329 +- .../api/discovery/v1beta1/generated.proto | 13 + .../k8s.io/api/discovery/v1beta1/types.go | 13 + .../v1beta1/types_swagger_doc_generated.go | 10 + .../v1beta1/zz_generated.deepcopy.go | 21 + e2e/vendor/k8s.io/api/events/v1/doc.go | 2 +- e2e/vendor/k8s.io/api/events/v1beta1/doc.go | 2 +- .../k8s.io/api/extensions/v1beta1/doc.go | 2 +- .../api/extensions/v1beta1/generated.pb.go | 418 +- .../api/extensions/v1beta1/generated.proto | 40 +- .../k8s.io/api/extensions/v1beta1/types.go | 40 +- .../v1beta1/types_swagger_doc_generated.go | 24 +- .../v1beta1/zz_generated.deepcopy.go | 10 + e2e/vendor/k8s.io/api/flowcontrol/v1/doc.go | 2 +- .../k8s.io/api/flowcontrol/v1beta1/doc.go | 2 +- .../k8s.io/api/flowcontrol/v1beta2/doc.go | 2 +- .../k8s.io/api/flowcontrol/v1beta3/doc.go | 2 +- .../k8s.io/api/imagepolicy/v1alpha1/doc.go | 2 +- e2e/vendor/k8s.io/api/networking/v1/doc.go | 2 +- .../k8s.io/api/networking/v1/generated.pb.go | 1997 +- .../k8s.io/api/networking/v1/generated.proto | 109 + .../k8s.io/api/networking/v1/register.go | 4 + e2e/vendor/k8s.io/api/networking/v1/types.go | 130 + .../v1/types_swagger_doc_generated.go | 80 + .../api/networking/v1/well_known_labels.go | 33 + .../networking/v1/zz_generated.deepcopy.go | 202 + .../v1/zz_generated.prerelease-lifecycle.go | 24 + .../k8s.io/api/networking/v1alpha1/doc.go | 2 +- .../k8s.io/api/networking/v1beta1/doc.go | 2 +- e2e/vendor/k8s.io/api/node/v1/doc.go | 2 +- e2e/vendor/k8s.io/api/node/v1alpha1/doc.go | 2 +- e2e/vendor/k8s.io/api/node/v1beta1/doc.go | 2 +- e2e/vendor/k8s.io/api/policy/v1/doc.go | 2 +- .../k8s.io/api/policy/v1/generated.proto | 3 - e2e/vendor/k8s.io/api/policy/v1/types.go | 3 - .../policy/v1/types_swagger_doc_generated.go | 2 +- e2e/vendor/k8s.io/api/policy/v1beta1/doc.go | 2 +- .../k8s.io/api/policy/v1beta1/generated.proto | 3 - e2e/vendor/k8s.io/api/policy/v1beta1/types.go | 3 - .../v1beta1/types_swagger_doc_generated.go | 2 +- e2e/vendor/k8s.io/api/rbac/v1/doc.go | 2 +- e2e/vendor/k8s.io/api/rbac/v1alpha1/doc.go | 2 +- e2e/vendor/k8s.io/api/rbac/v1beta1/doc.go | 2 +- .../k8s.io/api/resource/v1alpha3/doc.go | 2 +- .../api/resource/v1alpha3/generated.pb.go | 3757 ++- .../api/resource/v1alpha3/generated.proto | 514 +- .../k8s.io/api/resource/v1alpha3/register.go | 2 + .../k8s.io/api/resource/v1alpha3/types.go | 629 +- .../v1alpha3/types_swagger_doc_generated.go | 165 +- .../v1alpha3/zz_generated.deepcopy.go | 327 +- .../zz_generated.prerelease-lifecycle.go | 36 + .../resource/v1beta1/devicetaint.go} | 23 +- e2e/vendor/k8s.io/api/resource/v1beta1/doc.go | 2 +- .../api/resource/v1beta1/generated.pb.go | 2724 +- .../api/resource/v1beta1/generated.proto | 428 +- .../k8s.io/api/resource/v1beta1/types.go | 534 +- .../v1beta1/types_swagger_doc_generated.go | 124 +- .../resource/v1beta1/zz_generated.deepcopy.go | 202 +- .../resource/v1beta2/devicetaint.go} | 31 +- .../v1beta1 => api/resource/v1beta2}/doc.go | 12 +- .../api/resource/v1beta2/generated.pb.go | 11047 +++++++ .../api/resource/v1beta2/generated.proto | 1278 + .../v1 => api/resource/v1beta2}/register.go | 36 +- .../k8s.io/api/resource/v1beta2/types.go | 1552 + .../v1beta2/types_swagger_doc_generated.go | 464 + .../resource/v1beta2/zz_generated.deepcopy.go | 1092 + .../zz_generated.prerelease-lifecycle.go | 166 + e2e/vendor/k8s.io/api/scheduling/v1/doc.go | 2 +- .../k8s.io/api/scheduling/v1alpha1/doc.go | 2 +- .../k8s.io/api/scheduling/v1beta1/doc.go | 2 +- e2e/vendor/k8s.io/api/storage/v1/doc.go | 2 +- .../k8s.io/api/storage/v1/generated.pb.go | 271 +- .../k8s.io/api/storage/v1/generated.proto | 22 + e2e/vendor/k8s.io/api/storage/v1/types.go | 22 + .../storage/v1/types_swagger_doc_generated.go | 26 +- .../api/storage/v1/zz_generated.deepcopy.go | 10 + e2e/vendor/k8s.io/api/storage/v1alpha1/doc.go | 2 +- .../api/storage/v1alpha1/generated.pb.go | 160 +- .../api/storage/v1alpha1/generated.proto | 8 + .../k8s.io/api/storage/v1alpha1/types.go | 8 + .../v1alpha1/types_swagger_doc_generated.go | 7 +- .../storage/v1alpha1/zz_generated.deepcopy.go | 5 + e2e/vendor/k8s.io/api/storage/v1beta1/doc.go | 2 +- .../api/storage/v1beta1/generated.pb.go | 280 +- .../api/storage/v1beta1/generated.proto | 22 + .../k8s.io/api/storage/v1beta1/types.go | 22 + .../v1beta1/types_swagger_doc_generated.go | 26 +- .../storage/v1beta1/zz_generated.deepcopy.go | 10 + .../api/storagemigration/v1alpha1/doc.go | 2 +- .../pkg/apis/apiextensions/doc.go | 2 +- .../pkg/apis/apiextensions/v1/doc.go | 2 +- .../pkg/features/kube_features.go | 1 + .../k8s.io/apimachinery/pkg/api/safe/safe.go | 37 + .../apimachinery/pkg/api/validate/README.md | 64 + .../pkg/api/validate/common.go} | 13 +- .../api/validate/constraints/constraints.go} | 29 +- .../pkg/api/validate/content/errors.go} | 16 +- .../apimachinery/pkg/api/validate/doc.go | 50 + .../apimachinery/pkg/api/validate/each.go | 83 + .../pkg/api/validate/immutable.go | 60 + .../validation.go => api/validate/limits.go} | 26 +- .../apimachinery/pkg/api/validate/required.go | 133 + .../apimachinery/pkg/api/validate/subfield.go | 41 + .../pkg/api/validate/testing.go} | 22 +- .../k8s.io/apimachinery/pkg/apis/asn1/oid.go | 43 - .../apimachinery/pkg/util/waitgroup/doc.go | 19 - .../util/waitgroup/ratelimited_waitgroup.go | 134 - .../pkg/util/waitgroup/waitgroup.go | 57 - .../plugin/authorizer/caching_authorizer.go | 155 - .../plugin/namespace/lifecycle/admission.go | 233 - .../plugin/policy/generic/accessor.go | 43 - .../plugin/policy/generic/interfaces.go | 67 - .../admission/plugin/policy/generic/plugin.go | 221 - .../policy/generic/policy_dispatcher.go | 417 - .../plugin/policy/generic/policy_matcher.go | 108 - .../plugin/policy/generic/policy_source.go | 493 - .../policy/generic/policy_test_context.go | 626 - .../policy/internal/generic/controller.go | 283 - .../plugin/policy/internal/generic/doc.go | 29 - .../policy/internal/generic/informer.go | 40 - .../policy/internal/generic/interface.go | 62 - .../plugin/policy/internal/generic/lister.go | 100 - .../plugin/policy/matching/matching.go | 200 - .../plugin/policy/mutating/accessor.go | 144 - .../plugin/policy/mutating/compilation.go | 81 - .../plugin/policy/mutating/dispatcher.go | 295 - .../plugin/policy/mutating/patch/interface.go | 45 - .../policy/mutating/patch/json_patch.go | 192 - .../plugin/policy/mutating/patch/smd.go | 217 - .../policy/mutating/patch/typeconverter.go | 187 - .../plugin/policy/mutating/plugin.go | 151 - .../policy/mutating/reinvocationcontext.go | 76 - .../plugin/policy/validating/accessor.go | 86 - .../plugin/policy/validating/dispatcher.go | 420 - .../plugin/policy/validating/errors.go | 38 - .../plugin/policy/validating/interface.go | 95 - .../plugin/policy/validating/message.go | 36 - .../policy/validating/metrics/metrics.go | 122 - .../plugin/policy/validating/plugin.go | 211 - .../policy/validating/policy_decision.go | 87 - .../plugin/policy/validating/typechecking.go | 489 - .../plugin/policy/validating/validator.go | 249 - .../plugin/webhook/validating/dispatcher.go | 333 - .../plugin/webhook/validating/doc.go | 19 - .../plugin/webhook/validating/plugin.go | 67 - .../pkg/apis/apidiscovery/v2/conversion.go | 226 - .../pkg/apis/apidiscovery/v2/register.go | 39 - .../apis/apiserver/validation/validation.go | 821 - .../validation/validation_encryption.go | 451 - .../pkg/apis/audit/install/install.go | 33 - .../pkg/apis/audit/validation/validation.go | 133 - .../pkg/apis/flowcontrol/bootstrap/default.go | 577 - .../apiserver/pkg/audit/policy/checker.go | 239 - .../apiserver/pkg/audit/policy/reader.go | 101 - .../k8s.io/apiserver/pkg/audit/policy/util.go | 68 - .../authenticator/audagnostic.go | 90 - .../authentication/authenticator/audiences.go | 63 - .../authenticator/interfaces.go | 65 - .../authenticatorfactory/delegating.go | 128 - .../authenticatorfactory/loopback.go | 29 - .../authenticatorfactory/metrics.go | 69 - .../authenticatorfactory/requestheader.go | 39 - .../pkg/authentication/cel/compile.go | 161 - .../pkg/authentication/cel/interface.go | 148 - .../pkg/authentication/cel/mapper.go | 97 - .../group/authenticated_group_adder.go | 66 - .../pkg/authentication/group/group_adder.go | 57 - .../authentication/group/token_group_adder.go | 57 - .../request/anonymous/anonymous.go | 62 - .../request/bearertoken/bearertoken.go | 76 - .../request/headerrequest/requestheader.go | 218 - .../headerrequest/requestheader_controller.go | 356 - .../pkg/authentication/request/union/union.go | 71 - .../request/websocket/protocol.go | 108 - .../pkg/authentication/request/x509/doc.go | 19 - .../request/x509/verify_options.go | 71 - .../pkg/authentication/request/x509/x509.go | 332 - .../token/cache/cache_simple.go | 49 - .../token/cache/cache_striped.go | 60 - .../token/cache/cached_token_authenticator.go | 318 - .../pkg/authentication/token/cache/stats.go | 126 - .../token/tokenfile/tokenfile.go | 99 - .../authorizerfactory/builtin.go | 95 - .../authorizerfactory/delegating.go | 69 - .../authorizerfactory/metrics.go | 82 - .../pkg/authorization/cel/compile.go | 336 - .../pkg/authorization/cel/interface.go | 41 - .../pkg/authorization/cel/matcher.go | 91 - .../pkg/authorization/cel/metrics.go | 120 - .../apiserver/pkg/authorization/path/doc.go | 18 - .../apiserver/pkg/authorization/path/path.go | 68 - .../pkg/authorization/union/union.go | 106 - .../apiserver/pkg/cel/openapi/adaptor.go | 229 - .../apiserver/pkg/cel/openapi/extensions.go | 107 - .../k8s.io/apiserver/pkg/endpoints/OWNERS | 2 - .../pkg/endpoints/deprecation/deprecation.go | 134 - .../apiserver/pkg/endpoints/discovery/OWNERS | 5 - .../pkg/endpoints/discovery/addresses.go | 72 - .../endpoints/discovery/aggregated/etag.go | 85 - .../endpoints/discovery/aggregated/fake.go | 175 - .../endpoints/discovery/aggregated/handler.go | 577 - .../endpoints/discovery/aggregated/metrics.go | 36 - .../discovery/aggregated/negotiation.go | 49 - .../endpoints/discovery/aggregated/wrapper.go | 77 - .../pkg/endpoints/discovery/group.go | 73 - .../pkg/endpoints/discovery/legacy.go | 80 - .../apiserver/pkg/endpoints/discovery/root.go | 161 - .../endpoints/discovery/storageversionhash.go | 36 - .../apiserver/pkg/endpoints/discovery/util.go | 110 - .../pkg/endpoints/discovery/version.go | 83 - .../endpoints/filterlatency/filterlatency.go | 111 - .../apiserver/pkg/endpoints/filters/OWNERS | 6 - .../apiserver/pkg/endpoints/filters/audit.go | 263 - .../pkg/endpoints/filters/audit_init.go | 65 - .../pkg/endpoints/filters/authentication.go | 170 - .../pkg/endpoints/filters/authn_audit.go | 87 - .../pkg/endpoints/filters/authorization.go | 153 - .../pkg/endpoints/filters/cachecontrol.go | 33 - .../apiserver/pkg/endpoints/filters/doc.go | 21 - .../pkg/endpoints/filters/impersonation.go | 274 - .../pkg/endpoints/filters/metrics.go | 161 - .../filters/mux_discovery_complete.go | 64 - .../pkg/endpoints/filters/request_deadline.go | 177 - .../filters/request_received_time.go | 40 - .../pkg/endpoints/filters/requestinfo.go | 41 - .../pkg/endpoints/filters/storageversion.go | 121 - .../apiserver/pkg/endpoints/filters/traces.go | 92 - .../pkg/endpoints/filters/warning.go | 133 - .../pkg/endpoints/filters/webhook_duration.go | 79 - .../apiserver/pkg/endpoints/groupversion.go | 147 - .../pkg/endpoints/handlers/create.go | 284 - .../pkg/endpoints/handlers/delete.go | 422 - .../apiserver/pkg/endpoints/handlers/doc.go | 18 - .../endpoints/handlers/fieldmanager/OWNERS | 6 - .../handlers/fieldmanager/admission.go | 90 - .../handlers/fieldmanager/endpoints.yaml | 7018 ----- .../handlers/fieldmanager/equality.go | 226 - .../endpoints/handlers/fieldmanager/node.yaml | 261 - .../endpoints/handlers/fieldmanager/pod.yaml | 121 - .../endpoints/handlers/finisher/finisher.go | 176 - .../apiserver/pkg/endpoints/handlers/get.go | 341 - .../pkg/endpoints/handlers/helpers.go | 231 - .../pkg/endpoints/handlers/metrics/OWNERS | 4 - .../pkg/endpoints/handlers/metrics/metrics.go | 63 - .../apiserver/pkg/endpoints/handlers/namer.go | 85 - .../pkg/endpoints/handlers/negotiation/doc.go | 18 - .../endpoints/handlers/negotiation/errors.go | 99 - .../handlers/negotiation/negotiate.go | 269 - .../apiserver/pkg/endpoints/handlers/patch.go | 827 - .../pkg/endpoints/handlers/response.go | 583 - .../endpoints/handlers/responsewriters/doc.go | 18 - .../handlers/responsewriters/errors.go | 84 - .../handlers/responsewriters/status.go | 83 - .../handlers/responsewriters/writers.go | 409 - .../apiserver/pkg/endpoints/handlers/rest.go | 472 - .../pkg/endpoints/handlers/trace_util.go | 42 - .../pkg/endpoints/handlers/update.go | 296 - .../apiserver/pkg/endpoints/handlers/watch.go | 386 - .../apiserver/pkg/endpoints/installer.go | 1349 - .../pkg/endpoints/warning/warning.go | 39 - .../apiserver/pkg/registry/generic/OWNERS | 19 - .../apiserver/pkg/registry/generic/doc.go | 19 - .../apiserver/pkg/registry/generic/matcher.go | 52 - .../apiserver/pkg/registry/generic/options.go | 60 - .../generic/registry/corrupt_obj_deleter.go | 128 - .../generic/registry/decorated_watcher.go | 91 - .../pkg/registry/generic/registry/dryrun.go | 123 - .../generic/registry/storage_factory.go | 98 - .../pkg/registry/generic/registry/store.go | 1714 - .../pkg/registry/generic/storage_decorator.go | 58 - .../k8s.io/apiserver/pkg/registry/rest/OWNERS | 17 - .../apiserver/pkg/registry/rest/create.go | 223 - .../pkg/registry/rest/create_update.go | 72 - .../apiserver/pkg/registry/rest/delete.go | 215 - .../k8s.io/apiserver/pkg/registry/rest/doc.go | 18 - .../apiserver/pkg/registry/rest/meta.go | 84 - .../apiserver/pkg/registry/rest/rest.go | 416 - .../apiserver/pkg/registry/rest/table.go | 105 - .../apiserver/pkg/registry/rest/update.go | 295 - .../apiserver/pkg/registry/rest/validate.go | 321 - .../k8s.io/apiserver/pkg/server/config.go | 1201 - .../apiserver/pkg/server/config_selfclient.go | 97 - .../apiserver/pkg/server/deleted_kinds.go | 350 - .../pkg/server/deprecated_insecure_serving.go | 97 - .../server/dynamiccertificates/cert_key.go | 59 - .../server/dynamiccertificates/client_ca.go | 69 - .../configmap_cafile_content.go | 277 - .../dynamic_cafile_content.go | 294 - .../dynamic_serving_content.go | 236 - .../dynamic_sni_content.go | 49 - .../server/dynamiccertificates/interfaces.go | 68 - .../dynamiccertificates/named_certificates.go | 91 - .../dynamiccertificates/static_content.go | 120 - .../server/dynamiccertificates/tlsconfig.go | 287 - .../dynamiccertificates/union_content.go | 105 - .../pkg/server/dynamiccertificates/util.go | 66 - .../apiserver/pkg/server/filters/OWNERS | 5 - .../pkg/server/filters/content_type.go | 28 - .../apiserver/pkg/server/filters/cors.go | 130 - .../apiserver/pkg/server/filters/doc.go | 19 - .../apiserver/pkg/server/filters/goaway.go | 84 - .../apiserver/pkg/server/filters/hsts.go | 40 - .../pkg/server/filters/longrunning.go | 41 - .../pkg/server/filters/maxinflight.go | 222 - .../server/filters/priority-and-fairness.go | 426 - .../apiserver/pkg/server/filters/timeout.go | 308 - .../apiserver/pkg/server/filters/waitgroup.go | 97 - .../pkg/server/filters/watch_termination.go | 62 - .../pkg/server/filters/with_retry_after.go | 130 - .../apiserver/pkg/server/filters/wrap.go | 75 - .../apiserver/pkg/server/genericapiserver.go | 1080 - .../k8s.io/apiserver/pkg/server/handler.go | 189 - .../k8s.io/apiserver/pkg/server/healthz.go | 167 - .../k8s.io/apiserver/pkg/server/hooks.go | 246 - .../apiserver/pkg/server/lifecycle_signals.go | 198 - .../k8s.io/apiserver/pkg/server/mux/OWNERS | 4 - .../k8s.io/apiserver/pkg/server/mux/doc.go | 18 - .../apiserver/pkg/server/mux/pathrecorder.go | 281 - .../apiserver/pkg/server/options/OWNERS | 15 - .../apiserver/pkg/server/options/admission.go | 255 - .../pkg/server/options/api_enablement.go | 125 - .../apiserver/pkg/server/options/audit.go | 612 - .../pkg/server/options/authentication.go | 497 - .../authentication_dynamic_request_header.go | 80 - .../pkg/server/options/authorization.go | 243 - .../apiserver/pkg/server/options/coreapi.go | 90 - .../apiserver/pkg/server/options/doc.go | 21 - .../pkg/server/options/egress_selector.go | 93 - .../server/options/encryptionconfig/OWNERS | 8 - .../server/options/encryptionconfig/config.go | 1089 - .../encryptionconfig/controller/controller.go | 288 - .../encryptionconfig/metrics/metrics.go | 131 - .../apiserver/pkg/server/options/etcd.go | 520 - .../apiserver/pkg/server/options/feature.go | 98 - .../pkg/server/options/recommended.go | 164 - .../pkg/server/options/server_run_options.go | 414 - .../apiserver/pkg/server/options/serving.go | 422 - .../pkg/server/options/serving_unix.go | 44 - .../pkg/server/options/serving_windows.go | 35 - .../server/options/serving_with_loopback.go | 91 - .../apiserver/pkg/server/options/tracing.go | 166 - .../k8s.io/apiserver/pkg/server/plugins.go | 36 - .../pkg/server/resourceconfig/doc.go | 18 - .../pkg/server/resourceconfig/helpers.go | 300 - .../k8s.io/apiserver/pkg/server/routes/OWNERS | 4 - .../pkg/server/routes/debugsocket.go | 82 - .../k8s.io/apiserver/pkg/server/routes/doc.go | 18 - .../apiserver/pkg/server/routes/flags.go | 127 - .../apiserver/pkg/server/routes/index.go | 69 - .../apiserver/pkg/server/routes/metrics.go | 57 - .../apiserver/pkg/server/routes/openapi.go | 77 - .../apiserver/pkg/server/routes/profiling.go | 43 - .../apiserver/pkg/server/routes/version.go | 57 - .../apiserver/pkg/server/secure_serving.go | 307 - .../k8s.io/apiserver/pkg/server/signal.go | 69 - .../apiserver/pkg/server/signal_windows.go | 23 - .../apiserver/pkg/server/storage/doc.go | 18 - .../pkg/server/storage/resource_config.go | 206 - .../storage/resource_encoding_config.go | 217 - .../pkg/server/storage/storage_codec.go | 103 - .../pkg/server/storage/storage_factory.go | 372 - .../pkg/server/storage_readiness_hook.go | 91 - .../pkg/storage/cacher/cache_watcher.go | 545 - .../apiserver/pkg/storage/cacher/cacher.go | 1408 - .../pkg/storage/cacher/caching_object.go | 412 - .../apiserver/pkg/storage/cacher/delegator.go | 437 - .../pkg/storage/cacher/delegator/interface.go | 113 - .../pkg/storage/cacher/lister_watcher.go | 89 - .../pkg/storage/cacher/metrics/OWNERS | 8 - .../pkg/storage/cacher/metrics/metrics.go | 233 - .../storage/cacher/progress/watch_progress.go | 129 - .../apiserver/pkg/storage/cacher/ready.go | 195 - .../apiserver/pkg/storage/cacher/store.go | 135 - .../pkg/storage/cacher/store_btree.go | 505 - .../pkg/storage/cacher/time_budget.go | 102 - .../apiserver/pkg/storage/cacher/util.go | 56 - .../pkg/storage/cacher/watch_cache.go | 860 - .../storage/cacher/watch_cache_interval.go | 255 - .../apiserver/pkg/storage/errors/doc.go | 18 - .../apiserver/pkg/storage/errors/storage.go | 128 - .../k8s.io/apiserver/pkg/storage/etcd3/OWNERS | 7 - .../apiserver/pkg/storage/etcd3/compact.go | 162 - .../pkg/storage/etcd3/corrupt_obj_deleter.go | 270 - .../apiserver/pkg/storage/etcd3/decoder.go | 94 - .../apiserver/pkg/storage/etcd3/errors.go | 89 - .../apiserver/pkg/storage/etcd3/event.go | 82 - .../pkg/storage/etcd3/healthcheck.go | 41 - .../pkg/storage/etcd3/latency_tracker.go | 107 - .../pkg/storage/etcd3/lease_manager.go | 131 - .../apiserver/pkg/storage/etcd3/logger.go | 90 - .../pkg/storage/etcd3/metrics/OWNERS | 4 - .../pkg/storage/etcd3/metrics/metrics.go | 309 - .../apiserver/pkg/storage/etcd3/store.go | 1084 - .../apiserver/pkg/storage/etcd3/watcher.go | 748 - .../feature/feature_support_checker.go | 172 - .../pkg/storage/storagebackend/OWNERS | 5 - .../pkg/storage/storagebackend/config.go | 127 - .../storage/storagebackend/factory/etcd3.go | 503 - .../storage/storagebackend/factory/factory.go | 93 - .../k8s.io/apiserver/pkg/storage/value/OWNERS | 8 - .../pkg/storage/value/encrypt/aes/aes.go | 273 - .../value/encrypt/aes/aes_extended_nonce.go | 186 - .../pkg/storage/value/encrypt/aes/cache.go | 91 - .../value/encrypt/envelope/envelope.go | 202 - .../value/encrypt/envelope/grpc_service.go | 162 - .../value/encrypt/envelope/kmsv2/cache.go | 112 - .../value/encrypt/envelope/kmsv2/envelope.go | 528 - .../encrypt/envelope/kmsv2/grpc_service.go | 154 - .../value/encrypt/envelope/kmsv2/v2/OWNERS | 9 - .../value/encrypt/envelope/kmsv2/v2/api.pb.go | 186 - .../value/encrypt/envelope/kmsv2/v2/api.proto | 60 - .../value/encrypt/envelope/kmsv2/v2/v2.go | 18 - .../value/encrypt/envelope/metrics/metrics.go | 322 - .../value/encrypt/identity/identity.go | 57 - .../value/encrypt/secretbox/secretbox.go | 70 - .../apiserver/pkg/storage/value/metrics.go | 162 - .../pkg/storage/value/transformer.go | 221 - .../apiserver/pkg/storageversion/OWNERS | 5 - .../apiserver/pkg/storageversion/manager.go | 301 - .../apiserver/pkg/storageversion/updater.go | 197 - .../apiserver/pkg/util/apihelpers/helpers.go | 118 - .../apiserver/pkg/util/dryrun/dryrun.go | 22 - .../apiserver/pkg/util/flowcontrol/OWNERS | 15 - .../pkg/util/flowcontrol/apf_context.go | 93 - .../pkg/util/flowcontrol/apf_controller.go | 1162 - .../util/flowcontrol/apf_controller_debug.go | 271 - .../pkg/util/flowcontrol/apf_filter.go | 203 - .../pkg/util/flowcontrol/conc_alloc.go | 257 - .../pkg/util/flowcontrol/debug/dump.go | 66 - .../flowcontrol/dropped_requests_tracker.go | 234 - .../fairqueuing/eventclock/interface.go | 47 - .../fairqueuing/eventclock/real.go | 44 - .../flowcontrol/fairqueuing/integrator.go | 191 - .../util/flowcontrol/fairqueuing/interface.go | 141 - .../fairqueuing/promise/interface.go | 34 - .../fairqueuing/promise/promise.go | 71 - .../flowcontrol/fairqueuing/queueset/doc.go | 119 - .../fairqueuing/queueset/fifo_list.go | 156 - .../fairqueuing/queueset/queueset.go | 1029 - .../flowcontrol/fairqueuing/queueset/types.go | 218 - .../pkg/util/flowcontrol/format/formatting.go | 231 - .../pkg/util/flowcontrol/formatting.go | 40 - .../pkg/util/flowcontrol/max_seats.go | 66 - .../pkg/util/flowcontrol/metrics/interface.go | 67 - .../pkg/util/flowcontrol/metrics/metrics.go | 632 - .../metrics/timing_ratio_histogram.go | 226 - .../util/flowcontrol/metrics/union_gauge.go | 56 - .../flowcontrol/metrics/vec_element_pair.go | 25 - .../pkg/util/flowcontrol/request/config.go | 93 - .../request/list_work_estimator.go | 162 - .../request/mutating_work_estimator.go | 157 - .../request/object_count_tracker.go | 169 - .../util/flowcontrol/request/seat_seconds.go | 65 - .../pkg/util/flowcontrol/request/width.go | 129 - .../apiserver/pkg/util/flowcontrol/rule.go | 203 - .../pkg/util/flowcontrol/watch_tracker.go | 233 - .../apiserver/pkg/util/flushwriter/doc.go | 19 - .../apiserver/pkg/util/flushwriter/writer.go | 53 - .../pkg/util/peerproxy/metrics/metrics.go | 61 - .../util/shufflesharding/shufflesharding.go | 107 - .../apiserver/pkg/validation/metrics.go | 88 - .../plugin/pkg/audit/buffered/buffered.go | 290 - .../plugin/pkg/audit/buffered/doc.go | 19 - .../apiserver/plugin/pkg/audit/log/backend.go | 104 - .../plugin/pkg/audit/truncate/doc.go | 19 - .../plugin/pkg/audit/truncate/truncate.go | 165 - .../plugin/pkg/audit/webhook/webhook.go | 146 - .../authenticator/token/webhook/metrics.go | 35 - .../authenticator/token/webhook/webhook.go | 327 - .../plugin/pkg/authorizer/webhook/gencerts.sh | 102 - .../pkg/authorizer/webhook/metrics/metrics.go | 166 - .../plugin/pkg/authorizer/webhook/webhook.go | 605 - .../client-go/applyconfigurations/OWNERS | 1 + .../apps/v1/deploymentstatus.go | 9 + .../apps/v1/replicasetstatus.go | 9 + .../apps/v1beta1/deploymentstatus.go | 9 + .../apps/v1beta2/deploymentstatus.go | 9 + .../apps/v1beta2/replicasetstatus.go | 9 + .../autoscaling/v2/hpascalingrules.go | 10 + .../v1beta1/clustertrustbundle.go | 253 + .../v1beta1/clustertrustbundlespec.go | 48 + .../coordination/v1beta1/leasecandidate.go | 255 + .../v1beta1/leasecandidatespec.go | 89 + .../core/v1/containerstatus.go | 9 + .../applyconfigurations/core/v1/lifecycle.go | 17 +- .../core/v1/nodeswapstatus.go | 39 + .../core/v1/nodesysteminfo.go | 29 +- .../core/v1/podcondition.go | 9 + .../applyconfigurations/core/v1/podstatus.go | 9 + .../discovery/v1/endpointhints.go | 14 + .../discovery/v1/fornode.go | 39 + .../discovery/v1beta1/endpointhints.go | 14 + .../discovery/v1beta1/fornode.go | 39 + .../client-go/applyconfigurations/doc.go | 2 +- .../extensions/v1beta1/deploymentstatus.go | 9 + .../extensions/v1beta1/replicasetstatus.go | 9 + .../applyconfigurations/internal/internal.go | 1150 + .../networking/v1/ipaddress.go | 253 + .../networking/v1/ipaddressspec.go | 39 + .../networking/v1/parentreference.go | 66 + .../networking/v1/servicecidr.go | 262 + .../networking/v1/servicecidrspec.go | 41 + .../networking/v1/servicecidrstatus.go | 48 + .../resource/v1alpha3/basicdevice.go | 60 +- .../resource/v1alpha3/counter.go | 43 + .../resource/v1alpha3/counterset.go | 54 + .../v1alpha3/devicecounterconsumption.go | 54 + .../resource/v1alpha3/devicerequest.go | 28 + .../v1alpha3/devicerequestallocationresult.go | 24 +- .../resource/v1alpha3/devicesubrequest.go | 98 + .../resource/v1alpha3/devicetaint.go | 71 + .../resource/v1alpha3/devicetaintrule.go | 253 + .../resource/v1alpha3/devicetaintrulespec.go | 48 + .../resource/v1alpha3/devicetaintselector.go | 80 + .../resource/v1alpha3/devicetoleration.go | 79 + .../resource/v1alpha3/resourceslicespec.go | 35 +- .../resource/v1beta1/basicdevice.go | 60 +- .../resource/v1beta1/counter.go | 43 + .../resource/v1beta1/counterset.go | 54 + .../v1beta1/devicecounterconsumption.go | 54 + .../resource/v1beta1/devicerequest.go | 28 + .../v1beta1/devicerequestallocationresult.go | 24 +- .../resource/v1beta1/devicesubrequest.go | 98 + .../resource/v1beta1/devicetaint.go | 71 + .../resource/v1beta1/devicetoleration.go | 79 + .../resource/v1beta1/resourceslicespec.go | 35 +- .../resource/v1beta2/allocateddevicestatus.go | 94 + .../resource/v1beta2/allocationresult.go | 52 + .../resource/v1beta2/celdeviceselector.go | 39 + .../resource/v1beta2/counter.go | 43 + .../resource/v1beta2/counterset.go | 54 + .../resource/v1beta2/device.go | 129 + .../v1beta2/deviceallocationconfiguration.go | 63 + .../v1beta2/deviceallocationresult.go | 58 + .../resource/v1beta2/deviceattribute.go | 66 + .../resource/v1beta2/devicecapacity.go | 43 + .../resource/v1beta2/deviceclaim.go | 72 + .../v1beta2/deviceclaimconfiguration.go | 50 + .../resource/v1beta2/deviceclass.go | 253 + .../v1beta2/deviceclassconfiguration.go | 39 + .../resource/v1beta2/deviceclassspec.go | 58 + .../resource/v1beta2/deviceconfiguration.go | 39 + .../resource/v1beta2/deviceconstraint.go | 54 + .../v1beta2/devicecounterconsumption.go | 54 + .../resource/v1beta2/devicerequest.go | 62 + .../v1beta2/devicerequestallocationresult.go | 89 + .../resource/v1beta2/deviceselector.go | 39 + .../resource/v1beta2/devicesubrequest.go | 98 + .../resource/v1beta2/devicetaint.go | 71 + .../resource/v1beta2/devicetoleration.go | 79 + .../resource/v1beta2/exactdevicerequest.go | 98 + .../resource/v1beta2/networkdevicedata.go | 59 + .../v1beta2/opaquedeviceconfiguration.go | 52 + .../resource/v1beta2/resourceclaim.go | 264 + .../v1beta2/resourceclaimconsumerreference.go | 70 + .../resource/v1beta2/resourceclaimspec.go | 39 + .../resource/v1beta2/resourceclaimstatus.go | 67 + .../resource/v1beta2/resourceclaimtemplate.go | 255 + .../v1beta2/resourceclaimtemplatespec.go | 194 + .../resource/v1beta2/resourcepool.go | 57 + .../resource/v1beta2/resourceslice.go | 253 + .../resource/v1beta2/resourceslicespec.go | 116 + .../storage/v1/csidriverspec.go | 25 +- .../storage/v1/volumeerror.go | 13 +- .../storage/v1alpha1/volumeerror.go | 13 +- .../storage/v1beta1/csidriverspec.go | 25 +- .../storage/v1beta1/volumeerror.go | 13 +- .../client-go/applyconfigurations/utils.go | 132 + .../discovery/aggregated_discovery.go | 2 +- .../client-go/discovery/discovery_client.go | 3 +- e2e/vendor/k8s.io/client-go/discovery/doc.go | 2 +- .../dynamic/dynamicinformer/informer.go | 16 +- .../k8s.io/client-go/dynamic/fake/simple.go | 539 - .../client-go/features/known_features.go | 7 + e2e/vendor/k8s.io/client-go/gentype/fake.go | 1 + .../v1/mutatingwebhookconfiguration.go | 16 +- .../v1/validatingadmissionpolicy.go | 16 +- .../v1/validatingadmissionpolicybinding.go | 16 +- .../v1/validatingwebhookconfiguration.go | 16 +- .../v1alpha1/mutatingadmissionpolicy.go | 16 +- .../mutatingadmissionpolicybinding.go | 16 +- .../v1alpha1/validatingadmissionpolicy.go | 16 +- .../validatingadmissionpolicybinding.go | 16 +- .../v1beta1/mutatingwebhookconfiguration.go | 16 +- .../v1beta1/validatingadmissionpolicy.go | 16 +- .../validatingadmissionpolicybinding.go | 16 +- .../v1beta1/validatingwebhookconfiguration.go | 16 +- .../v1alpha1/storageversion.go | 16 +- .../informers/apps/v1/controllerrevision.go | 16 +- .../client-go/informers/apps/v1/daemonset.go | 16 +- .../client-go/informers/apps/v1/deployment.go | 16 +- .../client-go/informers/apps/v1/replicaset.go | 16 +- .../informers/apps/v1/statefulset.go | 16 +- .../apps/v1beta1/controllerrevision.go | 16 +- .../informers/apps/v1beta1/deployment.go | 16 +- .../informers/apps/v1beta1/statefulset.go | 16 +- .../apps/v1beta2/controllerrevision.go | 16 +- .../informers/apps/v1beta2/daemonset.go | 16 +- .../informers/apps/v1beta2/deployment.go | 16 +- .../informers/apps/v1beta2/replicaset.go | 16 +- .../informers/apps/v1beta2/statefulset.go | 16 +- .../autoscaling/v1/horizontalpodautoscaler.go | 16 +- .../autoscaling/v2/horizontalpodautoscaler.go | 16 +- .../v2beta1/horizontalpodautoscaler.go | 16 +- .../v2beta2/horizontalpodautoscaler.go | 16 +- .../client-go/informers/batch/v1/cronjob.go | 16 +- .../client-go/informers/batch/v1/job.go | 16 +- .../informers/batch/v1beta1/cronjob.go | 16 +- .../v1/certificatesigningrequest.go | 16 +- .../v1alpha1/clustertrustbundle.go | 16 +- .../v1beta1/certificatesigningrequest.go | 16 +- .../v1beta1/clustertrustbundle.go | 101 + .../certificates/v1beta1/interface.go | 7 + .../informers/coordination/v1/lease.go | 16 +- .../coordination/v1alpha2/leasecandidate.go | 16 +- .../coordination/v1beta1/interface.go | 7 + .../informers/coordination/v1beta1/lease.go | 16 +- .../coordination/v1beta1/leasecandidate.go | 102 + .../informers/core/v1/componentstatus.go | 16 +- .../client-go/informers/core/v1/configmap.go | 16 +- .../client-go/informers/core/v1/endpoints.go | 16 +- .../client-go/informers/core/v1/event.go | 16 +- .../client-go/informers/core/v1/limitrange.go | 16 +- .../client-go/informers/core/v1/namespace.go | 16 +- .../client-go/informers/core/v1/node.go | 16 +- .../informers/core/v1/persistentvolume.go | 16 +- .../core/v1/persistentvolumeclaim.go | 16 +- .../k8s.io/client-go/informers/core/v1/pod.go | 16 +- .../informers/core/v1/podtemplate.go | 16 +- .../core/v1/replicationcontroller.go | 16 +- .../informers/core/v1/resourcequota.go | 16 +- .../client-go/informers/core/v1/secret.go | 16 +- .../client-go/informers/core/v1/service.go | 16 +- .../informers/core/v1/serviceaccount.go | 16 +- .../informers/discovery/v1/endpointslice.go | 16 +- .../discovery/v1beta1/endpointslice.go | 16 +- e2e/vendor/k8s.io/client-go/informers/doc.go | 2 +- .../client-go/informers/events/v1/event.go | 16 +- .../informers/events/v1beta1/event.go | 16 +- .../informers/extensions/v1beta1/daemonset.go | 16 +- .../extensions/v1beta1/deployment.go | 16 +- .../informers/extensions/v1beta1/ingress.go | 16 +- .../extensions/v1beta1/networkpolicy.go | 16 +- .../extensions/v1beta1/replicaset.go | 16 +- .../informers/flowcontrol/v1/flowschema.go | 16 +- .../v1/prioritylevelconfiguration.go | 16 +- .../flowcontrol/v1beta1/flowschema.go | 16 +- .../v1beta1/prioritylevelconfiguration.go | 16 +- .../flowcontrol/v1beta2/flowschema.go | 16 +- .../v1beta2/prioritylevelconfiguration.go | 16 +- .../flowcontrol/v1beta3/flowschema.go | 16 +- .../v1beta3/prioritylevelconfiguration.go | 16 +- .../k8s.io/client-go/informers/generic.go | 21 + .../informers/networking/v1/ingress.go | 16 +- .../informers/networking/v1/ingressclass.go | 16 +- .../informers/networking/v1/interface.go | 14 + .../informers/networking/v1/ipaddress.go | 101 + .../informers/networking/v1/networkpolicy.go | 16 +- .../informers/networking/v1/servicecidr.go | 101 + .../networking/v1alpha1/ipaddress.go | 16 +- .../networking/v1alpha1/servicecidr.go | 16 +- .../informers/networking/v1beta1/ingress.go | 16 +- .../networking/v1beta1/ingressclass.go | 16 +- .../informers/networking/v1beta1/ipaddress.go | 16 +- .../networking/v1beta1/servicecidr.go | 16 +- .../informers/node/v1/runtimeclass.go | 16 +- .../informers/node/v1alpha1/runtimeclass.go | 16 +- .../informers/node/v1beta1/runtimeclass.go | 16 +- .../policy/v1/poddisruptionbudget.go | 16 +- .../policy/v1beta1/poddisruptionbudget.go | 16 +- .../informers/rbac/v1/clusterrole.go | 16 +- .../informers/rbac/v1/clusterrolebinding.go | 16 +- .../client-go/informers/rbac/v1/role.go | 16 +- .../informers/rbac/v1/rolebinding.go | 16 +- .../informers/rbac/v1alpha1/clusterrole.go | 16 +- .../rbac/v1alpha1/clusterrolebinding.go | 16 +- .../client-go/informers/rbac/v1alpha1/role.go | 16 +- .../informers/rbac/v1alpha1/rolebinding.go | 16 +- .../informers/rbac/v1beta1/clusterrole.go | 16 +- .../rbac/v1beta1/clusterrolebinding.go | 16 +- .../client-go/informers/rbac/v1beta1/role.go | 16 +- .../informers/rbac/v1beta1/rolebinding.go | 16 +- .../client-go/informers/resource/interface.go | 8 + .../resource/v1alpha3/deviceclass.go | 16 +- .../resource/v1alpha3/devicetaintrule.go | 101 + .../informers/resource/v1alpha3/interface.go | 7 + .../resource/v1alpha3/resourceclaim.go | 16 +- .../v1alpha3/resourceclaimtemplate.go | 16 +- .../resource/v1alpha3/resourceslice.go | 16 +- .../informers/resource/v1beta1/deviceclass.go | 16 +- .../resource/v1beta1/resourceclaim.go | 16 +- .../resource/v1beta1/resourceclaimtemplate.go | 16 +- .../resource/v1beta1/resourceslice.go | 16 +- .../informers/resource/v1beta2/deviceclass.go | 101 + .../informers/resource/v1beta2/interface.go | 66 + .../resource/v1beta2/resourceclaim.go | 102 + .../resource/v1beta2/resourceclaimtemplate.go | 102 + .../resource/v1beta2/resourceslice.go | 101 + .../informers/scheduling/v1/priorityclass.go | 16 +- .../scheduling/v1alpha1/priorityclass.go | 16 +- .../scheduling/v1beta1/priorityclass.go | 16 +- .../informers/storage/v1/csidriver.go | 16 +- .../client-go/informers/storage/v1/csinode.go | 16 +- .../storage/v1/csistoragecapacity.go | 16 +- .../informers/storage/v1/storageclass.go | 16 +- .../informers/storage/v1/volumeattachment.go | 16 +- .../storage/v1alpha1/csistoragecapacity.go | 16 +- .../storage/v1alpha1/volumeattachment.go | 16 +- .../storage/v1alpha1/volumeattributesclass.go | 16 +- .../informers/storage/v1beta1/csidriver.go | 16 +- .../informers/storage/v1beta1/csinode.go | 16 +- .../storage/v1beta1/csistoragecapacity.go | 16 +- .../informers/storage/v1beta1/storageclass.go | 16 +- .../storage/v1beta1/volumeattachment.go | 16 +- .../storage/v1beta1/volumeattributesclass.go | 16 +- .../v1alpha1/storageversionmigration.go | 16 +- .../k8s.io/client-go/kubernetes/clientset.go | 13 + e2e/vendor/k8s.io/client-go/kubernetes/doc.go | 2 +- .../kubernetes/fake/clientset_generated.go | 20 +- .../client-go/kubernetes/fake/register.go | 2 + .../k8s.io/client-go/kubernetes/import.go | 2 +- .../client-go/kubernetes/scheme/register.go | 2 + .../v1/admissionregistration_client.go | 12 +- .../v1alpha1/admissionregistration_client.go | 12 +- .../v1beta1/admissionregistration_client.go | 12 +- .../v1alpha1/apiserverinternal_client.go | 12 +- .../kubernetes/typed/apps/v1/apps_client.go | 12 +- .../typed/apps/v1beta1/apps_client.go | 12 +- .../typed/apps/v1beta2/apps_client.go | 12 +- .../v1/authentication_client.go | 12 +- .../v1alpha1/authentication_client.go | 12 +- .../v1beta1/authentication_client.go | 12 +- .../authorization/v1/authorization_client.go | 12 +- .../v1beta1/authorization_client.go | 12 +- .../autoscaling/v1/autoscaling_client.go | 12 +- .../autoscaling/v2/autoscaling_client.go | 12 +- .../autoscaling/v2beta1/autoscaling_client.go | 12 +- .../autoscaling/v2beta2/autoscaling_client.go | 12 +- .../kubernetes/typed/batch/v1/batch_client.go | 12 +- .../typed/batch/v1beta1/batch_client.go | 12 +- .../certificates/v1/certificates_client.go | 12 +- .../v1alpha1/certificates_client.go | 12 +- .../v1beta1/certificates_client.go | 17 +- .../v1beta1/clustertrustbundle.go | 73 + .../v1beta1/fake/fake_certificates_client.go | 4 + .../v1beta1/fake/fake_clustertrustbundle.go | 53 + .../v1beta1/generated_expansion.go | 2 + .../coordination/v1/coordination_client.go | 12 +- .../v1alpha2/coordination_client.go | 12 +- .../v1beta1/coordination_client.go | 17 +- .../v1beta1/fake/fake_coordination_client.go | 4 + .../v1beta1/fake/fake_leasecandidate.go | 53 + .../v1beta1/generated_expansion.go | 2 + .../coordination/v1beta1/leasecandidate.go | 71 + .../kubernetes/typed/core/v1/core_client.go | 12 +- .../typed/core/v1/event_expansion.go | 65 +- .../core/v1/fake/fake_event_expansion.go | 29 + .../typed/discovery/v1/discovery_client.go | 12 +- .../discovery/v1beta1/discovery_client.go | 12 +- .../typed/events/v1/events_client.go | 12 +- .../typed/events/v1beta1/event_expansion.go | 6 +- .../typed/events/v1beta1/events_client.go | 12 +- .../extensions/v1beta1/extensions_client.go | 12 +- .../flowcontrol/v1/flowcontrol_client.go | 12 +- .../flowcontrol/v1beta1/flowcontrol_client.go | 12 +- .../flowcontrol/v1beta2/flowcontrol_client.go | 12 +- .../flowcontrol/v1beta3/flowcontrol_client.go | 12 +- .../networking/v1/fake/fake_ipaddress.go | 49 + .../v1/fake/fake_networking_client.go | 8 + .../networking/v1/fake/fake_servicecidr.go | 49 + .../networking/v1/generated_expansion.go | 4 + .../typed/networking/v1/ipaddress.go | 71 + .../typed/networking/v1/networking_client.go | 22 +- .../typed/networking/v1/servicecidr.go | 75 + .../networking/v1alpha1/networking_client.go | 12 +- .../networking/v1beta1/networking_client.go | 12 +- .../kubernetes/typed/node/v1/node_client.go | 12 +- .../typed/node/v1alpha1/node_client.go | 12 +- .../typed/node/v1beta1/node_client.go | 12 +- .../typed/policy/v1/policy_client.go | 12 +- .../typed/policy/v1beta1/policy_client.go | 12 +- .../kubernetes/typed/rbac/v1/rbac_client.go | 12 +- .../typed/rbac/v1alpha1/rbac_client.go | 12 +- .../typed/rbac/v1beta1/rbac_client.go | 12 +- .../resource/v1alpha3/devicetaintrule.go | 71 + .../v1alpha3/fake/fake_devicetaintrule.go | 53 + .../v1alpha3/fake/fake_resource_client.go | 4 + .../resource/v1alpha3/generated_expansion.go | 2 + .../resource/v1alpha3/resource_client.go | 17 +- .../typed/resource/v1beta1/resource_client.go | 12 +- .../typed/resource/v1beta2/deviceclass.go | 71 + .../kubernetes/typed/resource/v1beta2}/doc.go | 8 +- .../typed/resource/v1beta2/fake}/doc.go | 7 +- .../resource/v1beta2/fake/fake_deviceclass.go | 51 + .../v1beta2/fake/fake_resource_client.go | 52 + .../v1beta2/fake/fake_resourceclaim.go | 53 + .../fake/fake_resourceclaimtemplate.go | 53 + .../v1beta2/fake/fake_resourceslice.go | 53 + .../resource/v1beta2/generated_expansion.go} | 20 +- .../typed/resource/v1beta2/resource_client.go | 116 + .../typed/resource/v1beta2/resourceclaim.go | 75 + .../resource/v1beta2/resourceclaimtemplate.go | 71 + .../typed/resource/v1beta2/resourceslice.go | 71 + .../typed/scheduling/v1/scheduling_client.go | 12 +- .../scheduling/v1alpha1/scheduling_client.go | 12 +- .../scheduling/v1beta1/scheduling_client.go | 12 +- .../typed/storage/v1/storage_client.go | 12 +- .../typed/storage/v1alpha1/storage_client.go | 12 +- .../typed/storage/v1beta1/storage_client.go | 12 +- .../v1alpha1/storagemigration_client.go | 12 +- .../v1beta1/clustertrustbundle.go | 48 + .../v1beta1/expansion_generated.go | 4 + .../v1beta1/expansion_generated.go | 8 + .../coordination/v1beta1/leasecandidate.go | 70 + e2e/vendor/k8s.io/client-go/listers/doc.go | 2 +- .../networking/v1/expansion_generated.go | 8 + .../listers/networking/v1/ipaddress.go | 48 + .../listers/networking/v1/servicecidr.go | 48 + .../resource/v1alpha3/devicetaintrule.go | 48 + .../resource/v1alpha3/expansion_generated.go | 4 + .../listers/resource/v1beta2/deviceclass.go | 48 + .../resource/v1beta2/expansion_generated.go | 43 + .../listers/resource/v1beta2/resourceclaim.go | 70 + .../resource/v1beta2/resourceclaimtemplate.go | 70 + .../listers/resource/v1beta2/resourceslice.go | 48 + .../pkg/apis/clientauthentication/doc.go | 2 +- .../pkg/apis/clientauthentication/v1/doc.go | 2 +- .../apis/clientauthentication/v1beta1/doc.go | 2 +- .../k8s.io/client-go/pkg/version/doc.go | 2 +- .../k8s.io/client-go/rest/.mockery.yaml | 10 + e2e/vendor/k8s.io/client-go/rest/client.go | 6 +- e2e/vendor/k8s.io/client-go/rest/config.go | 85 +- e2e/vendor/k8s.io/client-go/rest/plugin.go | 7 +- e2e/vendor/k8s.io/client-go/rest/request.go | 138 +- .../k8s.io/client-go/rest/urlbackoff.go | 101 +- e2e/vendor/k8s.io/client-go/rest/warnings.go | 57 +- .../k8s.io/client-go/rest/with_retry.go | 12 +- e2e/vendor/k8s.io/client-go/scale/doc.go | 2 +- .../client-go/scale/scheme/appsint/doc.go | 2 +- .../client-go/scale/scheme/appsv1beta1/doc.go | 2 +- .../client-go/scale/scheme/appsv1beta2/doc.go | 2 +- .../scale/scheme/autoscalingv1/doc.go | 2 +- .../k8s.io/client-go/scale/scheme/doc.go | 2 +- .../scale/scheme/extensionsint/doc.go | 2 +- .../scale/scheme/extensionsv1beta1/doc.go | 2 +- .../client-go/tools/cache/controller.go | 84 +- .../client-go/tools/cache/delta_fifo.go | 125 +- .../k8s.io/client-go/tools/cache/doc.go | 2 +- .../k8s.io/client-go/tools/cache/fifo.go | 97 +- .../k8s.io/client-go/tools/cache/listers.go | 7 +- .../k8s.io/client-go/tools/cache/listwatch.go | 174 +- .../client-go/tools/cache/mutation_cache.go | 8 +- .../tools/cache/mutation_detector.go | 1 + .../k8s.io/client-go/tools/cache/reflector.go | 238 +- .../client-go/tools/cache/shared_informer.go | 194 +- .../client-go/tools/cache/the_real_fifo.go | 407 + .../client-go/tools/clientcmd/api/doc.go | 2 +- .../client-go/tools/clientcmd/api/v1/doc.go | 2 +- .../k8s.io/client-go/tools/clientcmd/doc.go | 2 +- .../k8s.io/client-go/tools/events/doc.go | 2 +- .../client-go/tools/events/event_recorder.go | 2 +- .../k8s.io/client-go/tools/portforward/doc.go | 2 +- .../k8s.io/client-go/tools/record/doc.go | 2 +- .../k8s.io/client-go/tools/record/event.go | 2 +- .../client-go/tools/record/util/util.go | 17 + .../client-go/tools/remotecommand/doc.go | 2 +- .../tools/remotecommand/errorstream.go | 2 +- .../tools/remotecommand/websocket.go | 19 +- .../client-go/tools/watch/informerwatcher.go | 18 +- .../client-go/tools/watch/retrywatcher.go | 103 +- .../k8s.io/client-go/tools/watch/until.go | 6 +- .../k8s.io/client-go/transport/cache.go | 8 +- .../client-go/transport/cert_rotation.go | 17 +- .../client-go/transport/round_trippers.go | 196 +- .../client-go/transport/token_source.go | 5 +- .../k8s.io/client-go/transport/transport.go | 2 +- e2e/vendor/k8s.io/client-go/util/cert/cert.go | 48 +- .../data_consistency_detector.go | 2 +- .../client-go/util/flowcontrol/backoff.go | 5 +- .../util/workqueue/delaying_queue.go | 19 +- .../k8s.io/client-go/util/workqueue/doc.go | 2 +- .../client-go/util/workqueue/parallelizer.go | 2 +- .../k8s.io/cloud-provider/CONTRIBUTING.md | 9 - e2e/vendor/k8s.io/cloud-provider/OWNERS | 30 - e2e/vendor/k8s.io/cloud-provider/README.md | 33 - .../k8s.io/cloud-provider/SECURITY_CONTACTS | 20 - .../cloud-provider/app/config/config.go | 83 - e2e/vendor/k8s.io/cloud-provider/cloud.go | 335 - .../k8s.io/cloud-provider/code-of-conduct.md | 3 - .../cloud-provider/config/install/install.go | 44 - .../k8s.io/cloud-provider/config/register.go | 42 - .../k8s.io/cloud-provider/config/types.go | 103 - .../config/v1alpha1/conversion.go | 49 - .../config/v1alpha1/defaults.go | 71 - .../cloud-provider/config/v1alpha1/doc.go | 32 - .../config/v1alpha1/register.go | 52 - .../cloud-provider/config/v1alpha1/types.go | 101 - .../v1alpha1/zz_generated.conversion.go | 206 - .../config/v1alpha1/zz_generated.deepcopy.go | 119 - .../config/v1alpha1/zz_generated.defaults.go | 41 - .../config/zz_generated.deepcopy.go | 114 - .../controllers/node/config/types.go | 24 - .../node/config/v1alpha1/conversion.go | 39 - .../node/config/v1alpha1/defaults.go | 23 - .../controllers/node/config/v1alpha1/doc.go | 21 - .../node/config/v1alpha1/register.go | 31 - .../controllers/node/config/v1alpha1/types.go | 24 - .../v1alpha1/zz_generated.conversion.go | 58 - .../config/v1alpha1/zz_generated.deepcopy.go | 38 - .../controllers/service/config/OWNERS | 14 - .../controllers/service/config/doc.go | 19 - .../controllers/service/config/types.go | 25 - .../service/config/v1alpha1/conversion.go | 39 - .../service/config/v1alpha1/defaults.go | 32 - .../service/config/v1alpha1/doc.go | 21 - .../service/config/v1alpha1/register.go | 31 - .../service/config/v1alpha1/types.go | 25 - .../v1alpha1/zz_generated.conversion.go | 58 - .../config/v1alpha1/zz_generated.deepcopy.go | 38 - .../service/config/zz_generated.deepcopy.go | 38 - e2e/vendor/k8s.io/cloud-provider/doc.go | 18 - .../cloud-provider/names/controller_names.go | 69 - .../cloud-provider/options/cloudprovider.go | 54 - .../cloud-provider/options/kubecloudshared.go | 110 - .../cloud-provider/options/nodecontroller.go | 62 - .../k8s.io/cloud-provider/options/options.go | 308 - .../options/servicecontroller.go | 57 - .../k8s.io/cloud-provider/options/webhook.go | 210 - e2e/vendor/k8s.io/cloud-provider/plugins.go | 136 - .../config/options/leaderelectionconfig.go | 52 - .../metrics/features/kube_features.go | 45 - .../metrics/prometheus/workqueue/metrics.go | 137 - .../component-base/zpages/flagz/flagreader.go | 52 - .../component-base/zpages/flagz/flagz.go | 102 - .../zpages/httputil/httputil.go | 54 - .../k8s.io/controller-manager/config/OWNERS | 14 - .../controller-manager/config/register.go | 46 - .../k8s.io/controller-manager/config/types.go | 82 - .../config/v1/conversion.go | 82 - .../controller-manager/config/v1/doc.go | 20 - .../controller-manager/config/v1/types.go | 47 - .../config/v1/zz_generated.deepcopy.go | 72 - .../config/v1alpha1/conversion.go | 39 - .../config/v1alpha1/defaults.go | 51 - .../controller-manager/config/v1alpha1/doc.go | 23 - .../config/v1alpha1/register.go | 48 - .../config/v1alpha1/types.go | 81 - .../v1alpha1/zz_generated.conversion.go | 161 - .../config/v1alpha1/zz_generated.deepcopy.go | 99 - .../config/v1beta1/register.go | 48 - .../config/v1beta1/types.go | 51 - .../config/v1beta1/zz_generated.conversion.go | 106 - .../config/v1beta1/zz_generated.deepcopy.go | 72 - .../config/zz_generated.deepcopy.go | 99 - .../controller-manager/options/debugging.go | 72 - .../controller-manager/options/generic.go | 140 - .../pkg/clientbuilder/client_builder.go | 102 - .../clientbuilder/client_builder_dynamic.go | 271 - .../pkg/features/register/register.go | 27 - .../pkg/leadermigration/config/config.go | 109 - .../pkg/leadermigration/config/default.go | 40 - .../pkg/leadermigration/options/options.go | 85 - .../cri-api/pkg/apis/runtime/v1/api.pb.go | 2932 +- .../cri-api/pkg/apis/runtime/v1/api.proto | 154 +- .../k8s.io/cri-api/pkg/apis/services.go | 8 +- .../k8s.io/cri-client/pkg/remote_runtime.go | 17 + .../dynamic-resource-allocation/api/types.go | 53 +- .../api/zz_generated.conversion.go | 213 +- .../dynamic-resource-allocation/cel/cache.go | 4 +- .../cel/compile.go | 161 +- .../internal/queue/fifo.go | 112 + .../resourceclaim/devicetoleration.go | 53 + .../resourceclaim/resourceclaim.go | 35 + .../resourceslice/tracker/tracker.go | 798 + .../structured/allocator.go | 768 +- .../structured/pools.go | 73 +- e2e/vendor/k8s.io/kms/apis/v1beta1/api.pb.go | 510 - e2e/vendor/k8s.io/kms/apis/v1beta1/api.proto | 77 - e2e/vendor/k8s.io/kms/apis/v2/api.pb.go | 554 - e2e/vendor/k8s.io/kms/apis/v2/api.proto | 90 - e2e/vendor/k8s.io/kms/apis/v2/v2.go | 18 - .../k8s.io/kms/pkg/service/grpc_service.go | 131 - .../k8s.io/kms/pkg/service/interface.go | 50 - e2e/vendor/k8s.io/kms/pkg/util/util.go | 54 - .../k8s.io/kube-openapi/pkg/builder/doc.go | 20 - .../kube-openapi/pkg/builder/openapi.go | 468 - .../kube-openapi/pkg/builder/parameters.go | 259 - .../k8s.io/kube-openapi/pkg/builder/util.go | 61 - .../kube-openapi/pkg/builder3/openapi.go | 498 - .../k8s.io/kube-openapi/pkg/builder3/util.go | 52 - .../kube-openapi/pkg/builder3/util/util.go | 51 - .../pkg/common/restfuladapter/adapter.go | 15 - .../common/restfuladapter/param_adapter.go | 54 - .../restfuladapter/response_error_adapter.go | 25 - .../common/restfuladapter/route_adapter.go | 68 - .../restfuladapter/webservice_adapter.go | 34 - .../pkg/handler/default_pruning.go | 208 - .../kube-openapi/pkg/handler/handler.go | 202 - .../kube-openapi/pkg/schemamutation/walker.go | 519 - .../k8s.io/kube-scheduler/config/v1/doc.go | 2 +- .../config/v1/types_pluginargs.go | 10 +- .../k8s.io/kube-scheduler/extender/v1/doc.go | 2 +- .../kubelet/pkg/apis/stats/v1alpha1/types.go | 45 + .../kubernetes/pkg/api/service/warnings.go | 52 +- .../k8s.io/kubernetes/pkg/api/v1/pod/util.go | 30 + .../k8s.io/kubernetes/pkg/apis/apps/doc.go | 2 +- .../k8s.io/kubernetes/pkg/apis/apps/types.go | 34 +- .../pkg/apis/apps/zz_generated.deepcopy.go | 10 + .../pkg/apis/autoscaling/annotations.go | 8 + .../kubernetes/pkg/apis/autoscaling/doc.go | 2 +- .../pkg/apis/autoscaling/helpers.go | 10 +- .../kubernetes/pkg/apis/autoscaling/types.go | 31 +- .../apis/autoscaling/zz_generated.deepcopy.go | 5 + .../k8s.io/kubernetes/pkg/apis/batch/doc.go | 2 +- .../k8s.io/kubernetes/pkg/apis/batch/types.go | 11 - .../k8s.io/kubernetes/pkg/apis/core/doc.go | 2 +- .../pkg/apis/core/helper/helpers.go | 26 + .../k8s.io/kubernetes/pkg/apis/core/types.go | 184 +- .../kubernetes/pkg/apis/core/v1/conversion.go | 8 +- .../kubernetes/pkg/apis/core/v1/defaults.go | 77 +- .../k8s.io/kubernetes/pkg/apis/core/v1/doc.go | 4 +- .../apis/core/v1/zz_generated.conversion.go | 48 +- .../pkg/apis/core/v1/zz_generated.defaults.go | 4 + .../apis/core/v1/zz_generated.validations.go | 112 + .../pkg/apis/core/validation/doc.go | 2 +- .../pkg/apis/core/validation/validation.go | 628 +- .../pkg/apis/core/zz_generated.deepcopy.go | 43 +- .../kubernetes/pkg/apis/extensions/doc.go | 2 +- .../kubernetes/pkg/apis/networking/doc.go | 2 +- .../kubernetes/pkg/apis/scheduling/doc.go | 2 +- .../k8s.io/kubernetes/pkg/capabilities/doc.go | 2 +- .../kubernetes/pkg/cluster/ports/doc.go | 19 - .../kubernetes/pkg/cluster/ports/ports.go | 54 - .../pkg/controller/controller_utils.go | 73 +- .../deployment/util/deployment_util.go | 20 + .../k8s.io/kubernetes/pkg/controller/doc.go | 2 +- .../pkg/credentialprovider}/OWNERS | 4 +- .../pkg/credentialprovider/config.go | 319 + .../pkg/credentialprovider}/doc.go | 5 +- .../pkg/credentialprovider/keyring.go | 367 + .../pkg/credentialprovider/provider.go | 113 + .../kubernetes/pkg/features/client_adapter.go | 2 +- .../kubernetes/pkg/features/kube_features.go | 1170 +- .../pkg/features/versioned_kube_features.go | 841 - .../k8s.io/kubernetes/pkg/fieldpath/doc.go | 2 +- .../kubernetes/pkg/kubelet/apis/config/doc.go | 2 +- .../pkg/kubelet/apis/config/register.go | 2 + .../pkg/kubelet/apis/config/types.go | 200 +- .../apis/config/zz_generated.deepcopy.go | 162 + .../kubelet/apis/podresources/server_v1.go | 30 +- .../pkg/kubelet/cadvisor/cadvisor_linux.go | 6 + .../kubernetes/pkg/kubelet/cadvisor/doc.go | 2 +- .../k8s.io/kubernetes/pkg/kubelet/cm/OWNERS | 1 + .../pkg/kubelet/cm/cgroup_manager_linux.go | 25 +- .../pkg/kubelet/cm/cgroup_v1_manager_linux.go | 4 +- .../pkg/kubelet/cm/cgroup_v2_manager_linux.go | 18 +- .../pkg/kubelet/cm/container_manager.go | 62 +- .../pkg/kubelet/cm/container_manager_linux.go | 24 +- .../pkg/kubelet/cm/container_manager_stub.go | 8 + .../kubelet/cm/container_manager_windows.go | 12 +- .../kubelet/cm/containermap/container_map.go | 7 +- .../kubelet/cm/cpumanager/cpu_assignment.go | 7 +- .../pkg/kubelet/cm/cpumanager/cpu_manager.go | 4 +- .../kubelet/cm/cpumanager/policy_options.go | 8 +- .../kubelet/cm/cpumanager/policy_static.go | 116 +- .../cm/cpumanager/state/state_checkpoint.go | 10 +- .../cm/cpumanager/topology/alignment.go | 78 + .../pkg/kubelet/cm/cpumanager/topology/doc.go | 2 +- .../cm/cpumanager/topology/topology.go | 9 + .../pkg/kubelet/cm/devicemanager/manager.go | 44 +- .../cm/devicemanager/plugin/v1beta1/client.go | 2 + .../devicemanager/plugin/v1beta1/handler.go | 9 +- .../cm/devicemanager/plugin/v1beta1/server.go | 11 +- .../kubelet/cm/devicemanager/pod_devices.go | 6 +- .../cm/devicemanager/topology_hints.go | 16 +- .../k8s.io/kubernetes/pkg/kubelet/cm/doc.go | 2 +- .../kubernetes/pkg/kubelet/cm/dra/manager.go | 15 +- .../kubelet/cm/dra/plugin/plugins_store.go | 59 +- .../pkg/kubelet/cm/dra/plugin/registration.go | 124 +- .../pkg/kubelet/cm/fake_container_manager.go | 8 + .../pkg/kubelet/cm/helpers_linux.go | 2 +- .../cm/memorymanager/memory_manager.go | 11 +- .../kubelet/cm/memorymanager/policy_static.go | 43 +- .../memorymanager/state/state_checkpoint.go | 10 +- .../cm/memorymanager/state/state_mem.go | 1 + .../kubelet/cm/pod_container_manager_linux.go | 11 +- .../kubelet/cm/qos_container_manager_linux.go | 2 +- .../topologymanager/fake_topology_manager.go | 2 +- .../cm/topologymanager/policy_options.go | 4 +- .../cm/topologymanager/scope_container.go | 6 +- .../kubelet/cm/topologymanager/scope_pod.go | 7 +- .../cm/topologymanager/topology_manager.go | 12 + .../pkg/kubelet/cm/util/cgroups_linux.go | 2 +- .../kubernetes/pkg/kubelet/config/config.go | 1 + .../kubernetes/pkg/kubelet/config/defaults.go | 1 + .../kubernetes/pkg/kubelet/config/doc.go | 2 +- .../pkg/kubelet/container/helpers.go | 25 + .../pkg/kubelet/container/runtime.go | 19 +- .../pkg/kubelet/container/sync_result.go | 4 + .../kubernetes/pkg/kubelet/events/event.go | 1 + .../kubernetes/pkg/kubelet/lifecycle/doc.go | 2 +- .../pkg/kubelet/lifecycle/predicate.go | 72 +- .../kubernetes/pkg/kubelet/metrics/metrics.go | 70 +- .../cache/actual_state_of_world.go | 1 + .../pkg/kubelet/pluginmanager/cache/types.go | 2 +- .../pkg/kubelet/qos}/doc.go | 11 +- .../kubernetes/pkg/kubelet/qos/helpers.go | 71 + .../kubernetes/pkg/kubelet/qos/policy.go | 135 + .../pkg/kubelet/status/fake_status_manager.go | 98 - .../kubernetes/pkg/kubelet/status/generate.go | 127 +- .../pkg/kubelet/status/state/checkpoint.go | 80 - .../pkg/kubelet/status/state/state.go | 60 - .../kubelet/status/state/state_checkpoint.go | 200 - .../pkg/kubelet/status/state/state_mem.go | 128 - .../pkg/kubelet/status/status_manager.go | 246 +- .../kubernetes/pkg/kubelet/types/constants.go | 6 +- .../kubernetes/pkg/kubelet/types/doc.go | 2 +- .../pkg/kubelet/types/pod_status.go | 2 + .../k8s.io/kubernetes/pkg/kubelet/util/doc.go | 2 +- .../kubernetes/pkg/kubelet/util/store/doc.go | 2 +- .../kubernetes/pkg/kubelet/util/util_linux.go | 2 +- .../kubernetes/pkg/kubelet/winstats/doc.go | 2 +- e2e/vendor/k8s.io/kubernetes/pkg/probe/doc.go | 2 +- .../pkg/scheduler/apis/config/doc.go | 2 +- .../scheduler/apis/config/types_pluginargs.go | 2 +- .../pkg/scheduler/apis/config/v1/defaults.go | 6 +- .../pkg/scheduler/apis/config/v1/doc.go | 2 +- .../validation/validation_pluginargs.go | 8 +- .../pkg/scheduler/backend/cache/cache.go | 8 + .../scheduler/backend/queue/active_queue.go | 107 +- .../scheduler/backend/queue/backoff_queue.go | 405 + .../pkg/scheduler/backend/queue/nominator.go | 6 +- .../backend/queue/scheduling_queue.go | 276 +- .../kubernetes/pkg/scheduler/eventhandlers.go | 27 +- .../pkg/scheduler/framework/events.go | 4 +- .../pkg/scheduler/framework/interface.go | 10 +- .../pkg/scheduler/framework/listers.go | 9 +- .../framework/parallelize/parallelism.go | 27 +- .../defaultpreemption/default_preemption.go | 6 +- .../plugins/dynamicresources/dra_manager.go | 12 +- .../dynamicresources/dynamicresources.go | 115 +- .../framework/plugins/feature/feature.go | 7 +- .../plugins/imagelocality/image_locality.go | 8 +- .../plugins/interpodaffinity/filtering.go | 85 +- .../plugins/interpodaffinity/plugin.go | 66 +- .../plugins/interpodaffinity/scoring.go | 10 +- .../plugins/nodeaffinity/node_affinity.go | 10 +- .../framework/plugins/nodeports/node_ports.go | 2 +- .../noderesources/balanced_allocation.go | 30 +- .../framework/plugins/noderesources/fit.go | 11 +- .../noderesources/resource_allocation.go | 19 +- .../plugins/noderesources/test_util.go | 2 +- .../nodeunschedulable/node_unschedulable.go | 2 +- .../framework/plugins/nodevolumelimits/csi.go | 108 +- .../plugins/nodevolumelimits/utils.go | 6 +- .../plugins/podtopologyspread/common.go | 5 - .../plugins/podtopologyspread/filtering.go | 136 +- .../plugins/podtopologyspread/plugin.go | 4 +- .../plugins/podtopologyspread/scoring.go | 38 +- .../scheduler/framework/plugins/registry.go | 7 +- .../tainttoleration/taint_toleration.go | 11 +- .../framework/plugins/volumebinding/binder.go | 104 +- .../plugins/volumebinding/volume_binding.go | 74 +- .../framework/preemption/preemption.go | 13 +- .../scheduler/framework/runtime/framework.go | 17 +- .../framework/runtime/instrumented_plugins.go | 4 +- .../pkg/scheduler/framework/types.go | 106 +- .../pkg/scheduler/metrics/metrics.go | 37 +- .../pkg/scheduler/profile/profile.go | 2 +- .../kubernetes/pkg/scheduler/schedule_one.go | 37 +- .../kubernetes/pkg/scheduler/scheduler.go | 32 +- .../kubernetes/pkg/securitycontext/doc.go | 2 +- .../pkg/util/filesystem/defaultfs.go | 2 +- .../pkg/util/filesystem/util_windows.go | 22 +- .../kubernetes/pkg/util/kernel/constants.go | 4 - .../k8s.io/kubernetes/pkg/util/oom/doc.go | 2 +- .../k8s.io/kubernetes/pkg/volume/doc.go | 2 +- .../kubernetes/pkg/volume/metrics_block.go | 2 +- .../kubernetes/pkg/volume/metrics_errors.go | 4 + .../kubernetes/pkg/volume/metrics_statfs.go | 2 +- .../k8s.io/kubernetes/pkg/volume/plugins.go | 58 +- .../k8s.io/kubernetes/pkg/volume/util/doc.go | 2 +- .../pkg/volume/util/fs/fs_windows.go | 5 + .../pkg/volume/util/hostutil/hostutil.go | 6 - .../volume/util/hostutil/hostutil_linux.go | 10 +- .../volume/util/hostutil/hostutil_windows.go | 9 - .../pkg/volume/util/subpath/subpath_linux.go | 14 +- .../util/subpath/subpath_unsupported.go | 7 - .../volume/util/subpath/subpath_windows.go | 17 +- .../volumepathhandler/volume_path_handler.go | 7 +- .../k8s.io/kubernetes/pkg/volume/volume.go | 17 + .../kubernetes/pkg/volume/volume_linux.go | 107 +- .../pkg/volume/volume_unsupported.go | 12 +- .../test/e2e/framework/.import-restrictions | 1 - .../kubernetes/test/e2e/framework/OWNERS | 3 +- .../test/e2e/framework/ginkgowrapper.go | 101 +- .../test/e2e/framework/node/helper.go | 13 +- .../test/e2e/framework/pod/create.go | 3 +- .../kubernetes/test/e2e/framework/pod/dial.go | 15 + .../test/e2e/framework/pod/exec_util.go | 67 +- .../test/e2e/framework/pod/output/output.go | 2 +- .../test/e2e/framework/pod/resize.go | 324 +- .../test/e2e/framework/pod/resource.go | 38 +- .../test/e2e/framework/pod/utils.go | 129 +- .../kubernetes/test/e2e/framework/pod/wait.go | 81 +- .../kubernetes/test/e2e/framework/pv/wait.go | 39 + .../kubernetes/test/e2e/framework/ssh/ssh.go | 2 +- .../kubernetes/test/e2e/framework/util.go | 119 +- .../test/e2e/framework/volume/fixtures.go | 87 +- .../test/e2e/storage/podlogs/podlogs.go | 2 +- .../test/e2e/storage/utils/local.go | 7 +- .../test/e2e/storage/utils/utils.go | 89 +- .../storage/utils/volume_group_snapshot.go | 7 +- .../dra/dra-test-driver-proxy.yaml | 41 +- ...age.k8s.io_volumegroupsnapshotclasses.yaml | 4 +- ...ge.k8s.io_volumegroupsnapshotcontents.yaml | 73 +- ...t.storage.k8s.io_volumegroupsnapshots.yaml | 40 +- .../csi-hostpath-plugin.yaml | 16 +- .../run_group_snapshot_e2e.sh | 8 +- .../storage-csi/gce-pd/node_ds.yaml | 4 +- .../hostpath/csi-hostpath-plugin.yaml | 4 +- .../hostpath/csi-hostpath-testing.yaml | 2 +- .../storage-csi/mock/csi-mock-driver.yaml | 2 +- .../storage-csi/mock/csi-mock-proxy.yaml | 4 +- .../kubernetes/test/utils/image/manifest.go | 4 +- .../k8s.io/utils/clock/testing/fake_clock.go | 362 - .../clock/testing/simple_interval_clock.go | 44 - e2e/vendor/k8s.io/utils/nsenter/OWNERS | 10 - e2e/vendor/k8s.io/utils/nsenter/README.md | 4 - e2e/vendor/k8s.io/utils/nsenter/nsenter.go | 264 - .../utils/nsenter/nsenter_unsupported.go | 80 - e2e/vendor/modules.txt | 338 +- 1723 files changed, 65035 insertions(+), 175239 deletions(-) delete mode 100644 e2e/vendor/github.com/NYTimes/gziphandler/.gitignore delete mode 100644 e2e/vendor/github.com/NYTimes/gziphandler/.travis.yml delete mode 100644 e2e/vendor/github.com/NYTimes/gziphandler/CODE_OF_CONDUCT.md delete mode 100644 e2e/vendor/github.com/NYTimes/gziphandler/CONTRIBUTING.md delete mode 100644 e2e/vendor/github.com/NYTimes/gziphandler/LICENSE delete mode 100644 e2e/vendor/github.com/NYTimes/gziphandler/README.md delete mode 100644 e2e/vendor/github.com/NYTimes/gziphandler/gzip.go delete mode 100644 e2e/vendor/github.com/NYTimes/gziphandler/gzip_go18.go create mode 100644 e2e/vendor/github.com/containerd/containerd/api/services/containers/v1/containers_ttrpc.pb.go create mode 100644 e2e/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks_ttrpc.pb.go create mode 100644 e2e/vendor/github.com/containerd/containerd/api/services/version/v1/version_ttrpc.pb.go create mode 100644 e2e/vendor/github.com/containerd/containerd/api/types/event.pb.go create mode 100644 e2e/vendor/github.com/containerd/containerd/api/types/event.proto create mode 100644 e2e/vendor/github.com/containerd/containerd/api/types/introspection.pb.go create mode 100644 e2e/vendor/github.com/containerd/containerd/api/types/introspection.proto create mode 100644 e2e/vendor/github.com/containerd/containerd/api/types/platform_helpers.go delete mode 100644 e2e/vendor/github.com/containerd/errdefs/grpc.go rename e2e/vendor/{go.etcd.io/etcd/api/v3 => github.com/containerd/errdefs/pkg}/LICENSE (93%) create mode 100644 e2e/vendor/github.com/containerd/errdefs/pkg/errgrpc/grpc.go create mode 100644 e2e/vendor/github.com/containerd/errdefs/pkg/internal/cause/cause.go create mode 100644 e2e/vendor/github.com/containerd/errdefs/pkg/internal/types/collapsible.go create mode 100644 e2e/vendor/github.com/containerd/errdefs/resolve.go create mode 100644 e2e/vendor/github.com/containerd/typeurl/v2/.gitignore rename e2e/vendor/github.com/{google/btree => containerd/typeurl/v2}/LICENSE (93%) create mode 100644 e2e/vendor/github.com/containerd/typeurl/v2/README.md create mode 100644 e2e/vendor/github.com/containerd/typeurl/v2/doc.go create mode 100644 e2e/vendor/github.com/containerd/typeurl/v2/types.go create mode 100644 e2e/vendor/github.com/containerd/typeurl/v2/types_gogo.go delete mode 100644 e2e/vendor/github.com/coreos/go-semver/LICENSE delete mode 100644 e2e/vendor/github.com/coreos/go-semver/NOTICE delete mode 100644 e2e/vendor/github.com/coreos/go-semver/semver/semver.go delete mode 100644 e2e/vendor/github.com/coreos/go-semver/semver/sort.go delete mode 100644 e2e/vendor/github.com/coreos/go-systemd/v22/daemon/sdnotify.go delete mode 100644 e2e/vendor/github.com/coreos/go-systemd/v22/daemon/watchdog.go delete mode 100644 e2e/vendor/github.com/coreos/go-systemd/v22/journal/journal.go delete mode 100644 e2e/vendor/github.com/coreos/go-systemd/v22/journal/journal_unix.go delete mode 100644 e2e/vendor/github.com/coreos/go-systemd/v22/journal/journal_windows.go create mode 100644 e2e/vendor/github.com/cyphar/filepath-securejoin/gocompat_errors_go120.go create mode 100644 e2e/vendor/github.com/cyphar/filepath-securejoin/gocompat_errors_unsupported.go create mode 100644 e2e/vendor/github.com/cyphar/filepath-securejoin/gocompat_generics_go121.go create mode 100644 e2e/vendor/github.com/cyphar/filepath-securejoin/gocompat_generics_unsupported.go delete mode 100644 e2e/vendor/github.com/golang/protobuf/AUTHORS delete mode 100644 e2e/vendor/github.com/golang/protobuf/CONTRIBUTORS delete mode 100644 e2e/vendor/github.com/golang/protobuf/LICENSE delete mode 100644 e2e/vendor/github.com/golang/protobuf/proto/buffer.go delete mode 100644 e2e/vendor/github.com/golang/protobuf/proto/defaults.go delete mode 100644 e2e/vendor/github.com/golang/protobuf/proto/deprecated.go delete mode 100644 e2e/vendor/github.com/golang/protobuf/proto/discard.go delete mode 100644 e2e/vendor/github.com/golang/protobuf/proto/extensions.go delete mode 100644 e2e/vendor/github.com/golang/protobuf/proto/properties.go delete mode 100644 e2e/vendor/github.com/golang/protobuf/proto/proto.go delete mode 100644 e2e/vendor/github.com/golang/protobuf/proto/registry.go delete mode 100644 e2e/vendor/github.com/golang/protobuf/proto/text_decode.go delete mode 100644 e2e/vendor/github.com/golang/protobuf/proto/text_encode.go delete mode 100644 e2e/vendor/github.com/golang/protobuf/proto/wire.go delete mode 100644 e2e/vendor/github.com/golang/protobuf/proto/wrappers.go delete mode 100644 e2e/vendor/github.com/google/btree/README.md delete mode 100644 e2e/vendor/github.com/google/btree/btree.go delete mode 100644 e2e/vendor/github.com/google/btree/btree_generic.go delete mode 100644 e2e/vendor/github.com/google/cadvisor/resctrl/collector.go create mode 100644 e2e/vendor/github.com/google/cadvisor/resctrl/factory.go delete mode 100644 e2e/vendor/github.com/google/cadvisor/resctrl/manager.go delete mode 100644 e2e/vendor/github.com/google/cadvisor/resctrl/utils.go delete mode 100644 e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/.gitignore delete mode 100644 e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/.travis.yml delete mode 100644 e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/CHANGELOG.md delete mode 100644 e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/LICENSE delete mode 100644 e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/README.md delete mode 100644 e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client.go delete mode 100644 e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client_metrics.go delete mode 100644 e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client_reporter.go delete mode 100644 e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/makefile delete mode 100644 e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/metric_options.go delete mode 100644 e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server.go delete mode 100644 e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_metrics.go delete mode 100644 e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_reporter.go delete mode 100644 e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/util.go create mode 100644 e2e/vendor/github.com/opencontainers/cgroups/CODEOWNERS create mode 100644 e2e/vendor/github.com/opencontainers/cgroups/CONTRIBUTING.md create mode 100644 e2e/vendor/github.com/opencontainers/cgroups/GOVERNANCE.md rename e2e/vendor/{k8s.io/kms => github.com/opencontainers/cgroups}/LICENSE (100%) create mode 100644 e2e/vendor/github.com/opencontainers/cgroups/MAINTAINERS create mode 100644 e2e/vendor/github.com/opencontainers/cgroups/MAINTAINERS_GUIDE.md create mode 100644 e2e/vendor/github.com/opencontainers/cgroups/README.md create mode 100644 e2e/vendor/github.com/opencontainers/cgroups/RELEASES.md rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/cgroups.go (84%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer/configs/blkio_device.go => cgroups/config_blkio_device.go} (99%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer/configs/hugepage_limit.go => cgroups/config_hugepages.go} (91%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer/configs/interface_priority_map.go => cgroups/config_ifprio_map.go} (93%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer/configs/cgroup_linux.go => cgroups/config_linux.go} (98%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer/configs/rdma.go => cgroups/config_rdma.go} (95%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer/configs/cgroup_unsupported.go => cgroups/config_unsupported.go} (92%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer/devices => cgroups/devices/config}/device.go (99%) create mode 100644 e2e/vendor/github.com/opencontainers/cgroups/devices/config/mknod_unix.go rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/file.go (92%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs/blkio.go (97%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs/cpu.go (92%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs/cpuacct.go (74%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs/cpuset.go (67%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs/devices.go (71%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs/error.go (84%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs/freezer.go (79%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs/fs.go (89%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs/hugetlb.go (83%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs/memory.go (96%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs/name.go (60%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs/net_cls.go (64%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs/net_prio.go (64%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs/paths.go (82%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs/perf_event.go (53%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs/pids.go (77%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs/rdma.go (50%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs2/cpu.go (90%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs2/cpuset.go (64%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs2/create.go (91%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs2/defaultpath.go (57%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs2/freezer.go (71%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs2/fs2.go (91%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs2/hugetlb.go (81%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs2/io.go (95%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs2/memory.go (95%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs2/misc.go (87%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs2/pids.go (84%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fs2/psi.go (82%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fscommon/rdma.go (86%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/fscommon/utils.go (79%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/getallpids.go (100%) create mode 100644 e2e/vendor/github.com/opencontainers/cgroups/internal/path/path.go rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/manager/new.go (83%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/stats.go (100%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/systemd/common.go (96%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/systemd/cpuset.go (100%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/systemd/dbus.go (100%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/systemd/devices.go (89%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/systemd/user.go (96%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/systemd/v1.go (90%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/systemd/v2.go (96%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/utils.go (92%) rename e2e/vendor/github.com/opencontainers/{runc/libcontainer => }/cgroups/v1_utils.go (100%) rename e2e/vendor/github.com/opencontainers/{runc => image-spec}/LICENSE (99%) create mode 100644 e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/annotations.go create mode 100644 e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/config.go create mode 100644 e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/descriptor.go create mode 100644 e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/index.go create mode 100644 e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/layout.go create mode 100644 e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/manifest.go create mode 100644 e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/mediatype.go rename e2e/vendor/{go.etcd.io/etcd/client/v3/sort.go => github.com/opencontainers/image-spec/specs-go/version.go} (50%) rename e2e/vendor/{go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_unsupported.go => github.com/opencontainers/image-spec/specs-go/versioned.go} (59%) delete mode 100644 e2e/vendor/github.com/opencontainers/runc/NOTICE delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/config.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/config_linux.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/configs_fuzzer.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/intelrdt.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/mount.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/mount_linux.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/mount_unsupported.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_linux.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_syscall.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_syscall_unsupported.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_unsupported.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/network.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/devices/device_unix.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/cmt.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/intelrdt.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/mbm.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/monitoring.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/stats.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/utils/cmsg.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/utils/utils.go delete mode 100644 e2e/vendor/github.com/opencontainers/runc/libcontainer/utils/utils_unix.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/api/v3/authpb/auth.pb.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/api/v3/authpb/auth.proto delete mode 100644 e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/etcdserver.pb.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/etcdserver.proto delete mode 100644 e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/raft_internal.pb.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/raft_internal.proto delete mode 100644 e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/raft_internal_stringer.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/rpc.pb.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/rpc.proto delete mode 100644 e2e/vendor/go.etcd.io/etcd/api/v3/membershippb/membership.pb.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/api/v3/membershippb/membership.proto delete mode 100644 e2e/vendor/go.etcd.io/etcd/api/v3/mvccpb/kv.pb.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/api/v3/mvccpb/kv.proto delete mode 100644 e2e/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/doc.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/error.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/md.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/metadatafields.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/api/v3/version/version.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/LICENSE delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/dir_unix.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/dir_windows.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/doc.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/filereader.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/fileutil.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_flock.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_linux.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_plan9.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_solaris.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_unix.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_windows.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_darwin.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_unix.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/purge.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/read_dir.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync_darwin.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync_linux.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/doc.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/log_level.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/zap.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/zap_journal.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/systemd/doc.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/systemd/journal.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/cipher_suites.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/doc.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/tlsutil.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/versions.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/doc.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener_openbsd.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener_unix.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/limit_listen.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_opts.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_tls.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt_solaris.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt_unix.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt_windows.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_conn.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_dialer.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_listener.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_transport.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/tls.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/transport.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/unix_listener.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/doc.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/id.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/set.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/slice.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/urls.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/urlsmap.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/LICENSE delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/README.md delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/auth.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/client.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/cluster.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/compact_op.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/compare.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/config.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/credentials/credentials.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/ctx.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/doc.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/internal/endpoint/endpoint.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/internal/resolver/resolver.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/kubernetes/client.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/kubernetes/interface.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/kv.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/lease.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/logger.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/maintenance.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/op.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/options.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/retry.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/retry_interceptor.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/txn.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/utils.go delete mode 100644 e2e/vendor/go.etcd.io/etcd/client/v3/watch.go delete mode 100644 e2e/vendor/go.opentelemetry.io/otel/semconv/internal/http.go delete mode 100644 e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/README.md delete mode 100644 e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/doc.go delete mode 100644 e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/exception.go delete mode 100644 e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/http.go delete mode 100644 e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/resource.go delete mode 100644 e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/schema.go delete mode 100644 e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/trace.go delete mode 100644 e2e/vendor/go.uber.org/multierr/.codecov.yml delete mode 100644 e2e/vendor/go.uber.org/multierr/.gitignore delete mode 100644 e2e/vendor/go.uber.org/multierr/CHANGELOG.md delete mode 100644 e2e/vendor/go.uber.org/multierr/LICENSE.txt delete mode 100644 e2e/vendor/go.uber.org/multierr/Makefile delete mode 100644 e2e/vendor/go.uber.org/multierr/README.md delete mode 100644 e2e/vendor/go.uber.org/multierr/error.go delete mode 100644 e2e/vendor/go.uber.org/multierr/error_post_go120.go delete mode 100644 e2e/vendor/go.uber.org/multierr/error_pre_go120.go delete mode 100644 e2e/vendor/go.uber.org/zap/.codecov.yml delete mode 100644 e2e/vendor/go.uber.org/zap/.gitignore delete mode 100644 e2e/vendor/go.uber.org/zap/.golangci.yml delete mode 100644 e2e/vendor/go.uber.org/zap/.readme.tmpl delete mode 100644 e2e/vendor/go.uber.org/zap/CHANGELOG.md delete mode 100644 e2e/vendor/go.uber.org/zap/CODE_OF_CONDUCT.md delete mode 100644 e2e/vendor/go.uber.org/zap/CONTRIBUTING.md delete mode 100644 e2e/vendor/go.uber.org/zap/FAQ.md delete mode 100644 e2e/vendor/go.uber.org/zap/LICENSE delete mode 100644 e2e/vendor/go.uber.org/zap/Makefile delete mode 100644 e2e/vendor/go.uber.org/zap/README.md delete mode 100644 e2e/vendor/go.uber.org/zap/array.go delete mode 100644 e2e/vendor/go.uber.org/zap/buffer/buffer.go delete mode 100644 e2e/vendor/go.uber.org/zap/buffer/pool.go delete mode 100644 e2e/vendor/go.uber.org/zap/checklicense.sh delete mode 100644 e2e/vendor/go.uber.org/zap/config.go delete mode 100644 e2e/vendor/go.uber.org/zap/doc.go delete mode 100644 e2e/vendor/go.uber.org/zap/encoder.go delete mode 100644 e2e/vendor/go.uber.org/zap/error.go delete mode 100644 e2e/vendor/go.uber.org/zap/field.go delete mode 100644 e2e/vendor/go.uber.org/zap/flag.go delete mode 100644 e2e/vendor/go.uber.org/zap/glide.yaml delete mode 100644 e2e/vendor/go.uber.org/zap/global.go delete mode 100644 e2e/vendor/go.uber.org/zap/http_handler.go delete mode 100644 e2e/vendor/go.uber.org/zap/internal/bufferpool/bufferpool.go delete mode 100644 e2e/vendor/go.uber.org/zap/internal/color/color.go delete mode 100644 e2e/vendor/go.uber.org/zap/internal/exit/exit.go delete mode 100644 e2e/vendor/go.uber.org/zap/internal/level_enabler.go delete mode 100644 e2e/vendor/go.uber.org/zap/internal/pool/pool.go delete mode 100644 e2e/vendor/go.uber.org/zap/internal/stacktrace/stack.go delete mode 100644 e2e/vendor/go.uber.org/zap/level.go delete mode 100644 e2e/vendor/go.uber.org/zap/logger.go delete mode 100644 e2e/vendor/go.uber.org/zap/options.go delete mode 100644 e2e/vendor/go.uber.org/zap/sink.go delete mode 100644 e2e/vendor/go.uber.org/zap/sugar.go delete mode 100644 e2e/vendor/go.uber.org/zap/time.go delete mode 100644 e2e/vendor/go.uber.org/zap/writer.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/buffered_write_syncer.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/clock.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/console_encoder.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/core.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/doc.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/encoder.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/entry.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/error.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/field.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/hook.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/increase_level.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/json_encoder.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/lazy_with.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/level.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/level_strings.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/marshaler.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/memory_encoder.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/reflected_encoder.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/sampler.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/tee.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapcore/write_syncer.go delete mode 100644 e2e/vendor/go.uber.org/zap/zapgrpc/zapgrpc.go delete mode 100644 e2e/vendor/golang.org/x/crypto/cryptobyte/asn1.go delete mode 100644 e2e/vendor/golang.org/x/crypto/cryptobyte/asn1/asn1.go delete mode 100644 e2e/vendor/golang.org/x/crypto/cryptobyte/builder.go delete mode 100644 e2e/vendor/golang.org/x/crypto/cryptobyte/string.go delete mode 100644 e2e/vendor/golang.org/x/crypto/hkdf/hkdf.go delete mode 100644 e2e/vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go delete mode 100644 e2e/vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go delete mode 100644 e2e/vendor/golang.org/x/crypto/salsa20/salsa/salsa208.go delete mode 100644 e2e/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go delete mode 100644 e2e/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s delete mode 100644 e2e/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_noasm.go delete mode 100644 e2e/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_ref.go delete mode 100644 e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go delete mode 100644 e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go delete mode 100644 e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go delete mode 100644 e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/field_info.pb.go delete mode 100644 e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go delete mode 100644 e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go delete mode 100644 e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/routing.pb.go delete mode 100644 e2e/vendor/google.golang.org/genproto/googleapis/api/launch_stage.pb.go delete mode 100644 e2e/vendor/google.golang.org/grpc/resolver/manual/manual.go delete mode 100644 e2e/vendor/gopkg.in/natefinch/lumberjack.v2/.gitignore delete mode 100644 e2e/vendor/gopkg.in/natefinch/lumberjack.v2/.travis.yml delete mode 100644 e2e/vendor/gopkg.in/natefinch/lumberjack.v2/LICENSE delete mode 100644 e2e/vendor/gopkg.in/natefinch/lumberjack.v2/README.md delete mode 100644 e2e/vendor/gopkg.in/natefinch/lumberjack.v2/chown.go delete mode 100644 e2e/vendor/gopkg.in/natefinch/lumberjack.v2/chown_linux.go delete mode 100644 e2e/vendor/gopkg.in/natefinch/lumberjack.v2/lumberjack.go create mode 100644 e2e/vendor/k8s.io/api/networking/v1/well_known_labels.go rename e2e/vendor/k8s.io/{kms/apis/v1beta1/v1beta1.go => api/resource/v1beta1/devicetaint.go} (51%) rename e2e/vendor/k8s.io/{apiserver/pkg/admission/plugin/policy/validating/metrics/errors.go => api/resource/v1beta2/devicetaint.go} (50%) rename e2e/vendor/k8s.io/{controller-manager/config/v1beta1 => api/resource/v1beta2}/doc.go (73%) create mode 100644 e2e/vendor/k8s.io/api/resource/v1beta2/generated.pb.go create mode 100644 e2e/vendor/k8s.io/api/resource/v1beta2/generated.proto rename e2e/vendor/k8s.io/{controller-manager/config/v1 => api/resource/v1beta2}/register.go (55%) create mode 100644 e2e/vendor/k8s.io/api/resource/v1beta2/types.go create mode 100644 e2e/vendor/k8s.io/api/resource/v1beta2/types_swagger_doc_generated.go create mode 100644 e2e/vendor/k8s.io/api/resource/v1beta2/zz_generated.deepcopy.go create mode 100644 e2e/vendor/k8s.io/api/resource/v1beta2/zz_generated.prerelease-lifecycle.go create mode 100644 e2e/vendor/k8s.io/apimachinery/pkg/api/safe/safe.go create mode 100644 e2e/vendor/k8s.io/apimachinery/pkg/api/validate/README.md rename e2e/vendor/k8s.io/{apiserver/pkg/apis/apidiscovery/v2/doc.go => apimachinery/pkg/api/validate/common.go} (60%) rename e2e/vendor/k8s.io/{apiserver/pkg/admission/plugin/policy/validating/initializer.go => apimachinery/pkg/api/validate/constraints/constraints.go} (54%) rename e2e/vendor/k8s.io/{cloud-provider/ports.go => apimachinery/pkg/api/validate/content/errors.go} (65%) create mode 100644 e2e/vendor/k8s.io/apimachinery/pkg/api/validate/doc.go create mode 100644 e2e/vendor/k8s.io/apimachinery/pkg/api/validate/each.go create mode 100644 e2e/vendor/k8s.io/apimachinery/pkg/api/validate/immutable.go rename e2e/vendor/k8s.io/apimachinery/pkg/{apis/meta/v1beta1/validation/validation.go => api/validate/limits.go} (50%) create mode 100644 e2e/vendor/k8s.io/apimachinery/pkg/api/validate/required.go create mode 100644 e2e/vendor/k8s.io/apimachinery/pkg/api/validate/subfield.go rename e2e/vendor/k8s.io/{apiserver/pkg/registry/generic/registry/doc.go => apimachinery/pkg/api/validate/testing.go} (53%) delete mode 100644 e2e/vendor/k8s.io/apimachinery/pkg/apis/asn1/oid.go delete mode 100644 e2e/vendor/k8s.io/apimachinery/pkg/util/waitgroup/doc.go delete mode 100644 e2e/vendor/k8s.io/apimachinery/pkg/util/waitgroup/ratelimited_waitgroup.go delete mode 100644 e2e/vendor/k8s.io/apimachinery/pkg/util/waitgroup/waitgroup.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/authorizer/caching_authorizer.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle/admission.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/accessor.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/interfaces.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/plugin.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_dispatcher.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_matcher.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_source.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_test_context.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/controller.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/informer.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/interface.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/lister.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/matching/matching.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/accessor.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/compilation.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/dispatcher.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/patch/interface.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/patch/json_patch.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/patch/smd.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/patch/typeconverter.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/plugin.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/reinvocationcontext.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/accessor.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/dispatcher.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/errors.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/interface.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/message.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/metrics/metrics.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/plugin.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/policy_decision.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/typechecking.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/validator.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/dispatcher.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/plugin.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/apis/apidiscovery/v2/conversion.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/apis/apidiscovery/v2/register.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/apis/apiserver/validation/validation.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/apis/apiserver/validation/validation_encryption.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/apis/audit/install/install.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/apis/audit/validation/validation.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap/default.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/audit/policy/checker.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/audit/policy/reader.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/audit/policy/util.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/authenticator/audagnostic.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/authenticator/audiences.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/authenticator/interfaces.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/delegating.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/loopback.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/metrics.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/authenticatorfactory/requestheader.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/cel/compile.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/cel/interface.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/cel/mapper.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/group/authenticated_group_adder.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/group/group_adder.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/group/token_group_adder.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/request/anonymous/anonymous.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/request/bearertoken/bearertoken.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/request/headerrequest/requestheader.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/request/headerrequest/requestheader_controller.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/request/union/union.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/request/websocket/protocol.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/request/x509/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/request/x509/verify_options.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/request/x509/x509.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/token/cache/cache_simple.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/token/cache/cache_striped.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/token/cache/stats.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authentication/token/tokenfile/tokenfile.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authorization/authorizerfactory/builtin.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authorization/authorizerfactory/delegating.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authorization/authorizerfactory/metrics.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authorization/cel/compile.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authorization/cel/interface.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authorization/cel/matcher.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authorization/cel/metrics.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authorization/path/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authorization/path/path.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/authorization/union/union.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/cel/openapi/adaptor.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/cel/openapi/extensions.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/OWNERS delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/deprecation/deprecation.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/discovery/OWNERS delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/discovery/addresses.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/etag.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/fake.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/handler.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/metrics.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/negotiation.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/wrapper.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/discovery/group.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/discovery/legacy.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/discovery/root.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/discovery/storageversionhash.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/discovery/util.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/discovery/version.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/filterlatency/filterlatency.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/filters/OWNERS delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/filters/audit.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/filters/audit_init.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/filters/authentication.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/filters/authn_audit.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/filters/authorization.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/filters/cachecontrol.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/filters/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/filters/impersonation.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/filters/metrics.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/filters/mux_discovery_complete.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/filters/request_deadline.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/filters/request_received_time.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/filters/requestinfo.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/filters/storageversion.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/filters/traces.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/filters/warning.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/filters/webhook_duration.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/groupversion.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/create.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/delete.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/OWNERS delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/admission.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/endpoints.yaml delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/equality.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/node.yaml delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/pod.yaml delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/finisher/finisher.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/get.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/helpers.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/metrics/OWNERS delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/metrics/metrics.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/namer.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/errors.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/negotiation/negotiate.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/patch.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/response.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/responsewriters/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/responsewriters/errors.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/responsewriters/status.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/responsewriters/writers.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/rest.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/trace_util.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/update.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/handlers/watch.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/installer.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/endpoints/warning/warning.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/registry/generic/OWNERS delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/registry/generic/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/registry/generic/matcher.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/registry/generic/options.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/registry/generic/registry/corrupt_obj_deleter.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/registry/generic/registry/decorated_watcher.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/registry/generic/registry/dryrun.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/registry/generic/registry/storage_factory.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/registry/generic/storage_decorator.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/registry/rest/OWNERS delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/registry/rest/create.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/registry/rest/create_update.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/registry/rest/delete.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/registry/rest/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/registry/rest/meta.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/registry/rest/rest.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/registry/rest/table.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/registry/rest/update.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/registry/rest/validate.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/config.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/config_selfclient.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/deleted_kinds.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/deprecated_insecure_serving.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/cert_key.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/client_ca.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/configmap_cafile_content.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_cafile_content.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_serving_content.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/dynamic_sni_content.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/interfaces.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/named_certificates.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/static_content.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/tlsconfig.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/union_content.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/dynamiccertificates/util.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/filters/OWNERS delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/filters/content_type.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/filters/cors.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/filters/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/filters/goaway.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/filters/hsts.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/filters/longrunning.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/filters/maxinflight.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/filters/priority-and-fairness.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/filters/timeout.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/filters/waitgroup.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/filters/watch_termination.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/filters/with_retry_after.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/filters/wrap.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/genericapiserver.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/handler.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/healthz.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/hooks.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/lifecycle_signals.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/mux/OWNERS delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/mux/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/mux/pathrecorder.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/OWNERS delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/admission.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/api_enablement.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/audit.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/authentication.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/authentication_dynamic_request_header.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/authorization.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/coreapi.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/egress_selector.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/OWNERS delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/config.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/controller/controller.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/metrics/metrics.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/etcd.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/feature.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/recommended.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/server_run_options.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/serving.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/serving_unix.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/serving_windows.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/serving_with_loopback.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/options/tracing.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/plugins.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/resourceconfig/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/resourceconfig/helpers.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/routes/OWNERS delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/routes/debugsocket.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/routes/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/routes/flags.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/routes/index.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/routes/metrics.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/routes/openapi.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/routes/profiling.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/routes/version.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/secure_serving.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/signal.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/signal_windows.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/storage/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/storage/resource_config.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/storage/resource_encoding_config.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/storage/storage_codec.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/storage/storage_factory.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/server/storage_readiness_hook.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/cache_watcher.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/cacher.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/caching_object.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/delegator.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/delegator/interface.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/lister_watcher.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/metrics/OWNERS delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/metrics/metrics.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/progress/watch_progress.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/ready.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/store.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/store_btree.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/time_budget.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/util.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_cache.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_cache_interval.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/errors/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/errors/storage.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/OWNERS delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/compact.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/corrupt_obj_deleter.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/decoder.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/errors.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/event.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/healthcheck.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/latency_tracker.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/lease_manager.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/logger.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/metrics/OWNERS delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/store.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/feature/feature_support_checker.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/storagebackend/OWNERS delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/storagebackend/config.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/factory.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/value/OWNERS delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/aes.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/aes_extended_nonce.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/cache.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/cache.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/envelope.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/grpc_service.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/v2/OWNERS delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/v2/api.pb.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/v2/api.proto delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/v2/v2.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/metrics/metrics.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/identity/identity.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/secretbox/secretbox.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/value/metrics.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storage/value/transformer.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storageversion/OWNERS delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storageversion/manager.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/storageversion/updater.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/apihelpers/helpers.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/dryrun/dryrun.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/OWNERS delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_context.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_controller.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_controller_debug.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_filter.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/conc_alloc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/debug/dump.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/dropped_requests_tracker.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/eventclock/interface.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/eventclock/real.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/integrator.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/interface.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/promise/interface.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/promise/promise.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/fifo_list.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/queueset.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/types.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/format/formatting.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/formatting.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/max_seats.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/interface.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/metrics.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/timing_ratio_histogram.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/union_gauge.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/vec_element_pair.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/config.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/list_work_estimator.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/mutating_work_estimator.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/object_count_tracker.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/seat_seconds.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/width.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/rule.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/watch_tracker.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flushwriter/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/flushwriter/writer.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/peerproxy/metrics/metrics.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/util/shufflesharding/shufflesharding.go delete mode 100644 e2e/vendor/k8s.io/apiserver/pkg/validation/metrics.go delete mode 100644 e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/buffered.go delete mode 100644 e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/log/backend.go delete mode 100644 e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/truncate/doc.go delete mode 100644 e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/truncate/truncate.go delete mode 100644 e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook.go delete mode 100644 e2e/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/metrics.go delete mode 100644 e2e/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/webhook.go delete mode 100644 e2e/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/gencerts.sh delete mode 100644 e2e/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/metrics/metrics.go delete mode 100644 e2e/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/clustertrustbundle.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/clustertrustbundlespec.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasecandidate.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasecandidatespec.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodeswapstatus.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/fornode.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/fornode.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ipaddress.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ipaddressspec.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/parentreference.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidr.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidrspec.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidrstatus.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/counter.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/counterset.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicecounterconsumption.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicesubrequest.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaint.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaintrule.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaintrulespec.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaintselector.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetoleration.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/counter.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/counterset.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicecounterconsumption.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicesubrequest.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicetaint.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicetoleration.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/allocateddevicestatus.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/allocationresult.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/celdeviceselector.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/counter.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/counterset.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/device.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceallocationconfiguration.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceallocationresult.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceattribute.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicecapacity.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclaim.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclaimconfiguration.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclass.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclassconfiguration.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclassspec.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceconfiguration.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceconstraint.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicecounterconsumption.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicerequest.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicerequestallocationresult.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceselector.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicesubrequest.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicetaint.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicetoleration.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/exactdevicerequest.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/networkdevicedata.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/opaquedeviceconfiguration.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaim.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimconsumerreference.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimspec.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimstatus.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimtemplate.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimtemplatespec.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourcepool.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceslice.go create mode 100644 e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceslicespec.go delete mode 100644 e2e/vendor/k8s.io/client-go/dynamic/fake/simple.go create mode 100644 e2e/vendor/k8s.io/client-go/informers/certificates/v1beta1/clustertrustbundle.go create mode 100644 e2e/vendor/k8s.io/client-go/informers/coordination/v1beta1/leasecandidate.go create mode 100644 e2e/vendor/k8s.io/client-go/informers/networking/v1/ipaddress.go create mode 100644 e2e/vendor/k8s.io/client-go/informers/networking/v1/servicecidr.go create mode 100644 e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/devicetaintrule.go create mode 100644 e2e/vendor/k8s.io/client-go/informers/resource/v1beta2/deviceclass.go create mode 100644 e2e/vendor/k8s.io/client-go/informers/resource/v1beta2/interface.go create mode 100644 e2e/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceclaim.go create mode 100644 e2e/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceclaimtemplate.go create mode 100644 e2e/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceslice.go create mode 100644 e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/clustertrustbundle.go create mode 100644 e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_clustertrustbundle.go create mode 100644 e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_leasecandidate.go create mode 100644 e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/leasecandidate.go create mode 100644 e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_ipaddress.go create mode 100644 e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_servicecidr.go create mode 100644 e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/ipaddress.go create mode 100644 e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/servicecidr.go create mode 100644 e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/devicetaintrule.go create mode 100644 e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_devicetaintrule.go create mode 100644 e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/deviceclass.go rename e2e/vendor/k8s.io/{cloud-provider/config => client-go/kubernetes/typed/resource/v1beta2}/doc.go (77%) rename e2e/vendor/k8s.io/{controller-manager/config => client-go/kubernetes/typed/resource/v1beta2/fake}/doc.go (78%) create mode 100644 e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_deviceclass.go create mode 100644 e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_resource_client.go create mode 100644 e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_resourceclaim.go create mode 100644 e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_resourceclaimtemplate.go create mode 100644 e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_resourceslice.go rename e2e/vendor/k8s.io/{apiserver/pkg/server/signal_posix.go => client-go/kubernetes/typed/resource/v1beta2/generated_expansion.go} (67%) create mode 100644 e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/resource_client.go create mode 100644 e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/resourceclaim.go create mode 100644 e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/resourceclaimtemplate.go create mode 100644 e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/resourceslice.go create mode 100644 e2e/vendor/k8s.io/client-go/listers/certificates/v1beta1/clustertrustbundle.go create mode 100644 e2e/vendor/k8s.io/client-go/listers/coordination/v1beta1/leasecandidate.go create mode 100644 e2e/vendor/k8s.io/client-go/listers/networking/v1/ipaddress.go create mode 100644 e2e/vendor/k8s.io/client-go/listers/networking/v1/servicecidr.go create mode 100644 e2e/vendor/k8s.io/client-go/listers/resource/v1alpha3/devicetaintrule.go create mode 100644 e2e/vendor/k8s.io/client-go/listers/resource/v1beta2/deviceclass.go create mode 100644 e2e/vendor/k8s.io/client-go/listers/resource/v1beta2/expansion_generated.go create mode 100644 e2e/vendor/k8s.io/client-go/listers/resource/v1beta2/resourceclaim.go create mode 100644 e2e/vendor/k8s.io/client-go/listers/resource/v1beta2/resourceclaimtemplate.go create mode 100644 e2e/vendor/k8s.io/client-go/listers/resource/v1beta2/resourceslice.go create mode 100644 e2e/vendor/k8s.io/client-go/rest/.mockery.yaml create mode 100644 e2e/vendor/k8s.io/client-go/tools/cache/the_real_fifo.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/CONTRIBUTING.md delete mode 100644 e2e/vendor/k8s.io/cloud-provider/OWNERS delete mode 100644 e2e/vendor/k8s.io/cloud-provider/README.md delete mode 100644 e2e/vendor/k8s.io/cloud-provider/SECURITY_CONTACTS delete mode 100644 e2e/vendor/k8s.io/cloud-provider/app/config/config.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/cloud.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/code-of-conduct.md delete mode 100644 e2e/vendor/k8s.io/cloud-provider/config/install/install.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/config/register.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/config/types.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/conversion.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/defaults.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/doc.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/register.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/types.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/zz_generated.conversion.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/zz_generated.deepcopy.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/zz_generated.defaults.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/config/zz_generated.deepcopy.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/controllers/node/config/types.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/conversion.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/defaults.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/doc.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/register.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/types.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/zz_generated.conversion.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/zz_generated.deepcopy.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/controllers/service/config/OWNERS delete mode 100644 e2e/vendor/k8s.io/cloud-provider/controllers/service/config/doc.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/controllers/service/config/types.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/conversion.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/defaults.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/doc.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/register.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/types.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/zz_generated.conversion.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/zz_generated.deepcopy.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/controllers/service/config/zz_generated.deepcopy.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/doc.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/names/controller_names.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/options/cloudprovider.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/options/kubecloudshared.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/options/nodecontroller.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/options/options.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/options/servicecontroller.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/options/webhook.go delete mode 100644 e2e/vendor/k8s.io/cloud-provider/plugins.go delete mode 100644 e2e/vendor/k8s.io/component-base/config/options/leaderelectionconfig.go delete mode 100644 e2e/vendor/k8s.io/component-base/metrics/features/kube_features.go delete mode 100644 e2e/vendor/k8s.io/component-base/metrics/prometheus/workqueue/metrics.go delete mode 100644 e2e/vendor/k8s.io/component-base/zpages/flagz/flagreader.go delete mode 100644 e2e/vendor/k8s.io/component-base/zpages/flagz/flagz.go delete mode 100644 e2e/vendor/k8s.io/component-base/zpages/httputil/httputil.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/config/OWNERS delete mode 100644 e2e/vendor/k8s.io/controller-manager/config/register.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/config/types.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/config/v1/conversion.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/config/v1/doc.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/config/v1/types.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/config/v1/zz_generated.deepcopy.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/config/v1alpha1/conversion.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/config/v1alpha1/defaults.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/config/v1alpha1/doc.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/config/v1alpha1/register.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/config/v1alpha1/types.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/config/v1alpha1/zz_generated.conversion.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/config/v1alpha1/zz_generated.deepcopy.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/config/v1beta1/register.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/config/v1beta1/types.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/config/v1beta1/zz_generated.conversion.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/config/v1beta1/zz_generated.deepcopy.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/config/zz_generated.deepcopy.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/options/debugging.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/options/generic.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/pkg/clientbuilder/client_builder.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/pkg/clientbuilder/client_builder_dynamic.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/pkg/features/register/register.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/pkg/leadermigration/config/config.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/pkg/leadermigration/config/default.go delete mode 100644 e2e/vendor/k8s.io/controller-manager/pkg/leadermigration/options/options.go create mode 100644 e2e/vendor/k8s.io/dynamic-resource-allocation/internal/queue/fifo.go create mode 100644 e2e/vendor/k8s.io/dynamic-resource-allocation/resourceclaim/devicetoleration.go create mode 100644 e2e/vendor/k8s.io/dynamic-resource-allocation/resourceslice/tracker/tracker.go delete mode 100644 e2e/vendor/k8s.io/kms/apis/v1beta1/api.pb.go delete mode 100644 e2e/vendor/k8s.io/kms/apis/v1beta1/api.proto delete mode 100644 e2e/vendor/k8s.io/kms/apis/v2/api.pb.go delete mode 100644 e2e/vendor/k8s.io/kms/apis/v2/api.proto delete mode 100644 e2e/vendor/k8s.io/kms/apis/v2/v2.go delete mode 100644 e2e/vendor/k8s.io/kms/pkg/service/grpc_service.go delete mode 100644 e2e/vendor/k8s.io/kms/pkg/service/interface.go delete mode 100644 e2e/vendor/k8s.io/kms/pkg/util/util.go delete mode 100644 e2e/vendor/k8s.io/kube-openapi/pkg/builder/doc.go delete mode 100644 e2e/vendor/k8s.io/kube-openapi/pkg/builder/openapi.go delete mode 100644 e2e/vendor/k8s.io/kube-openapi/pkg/builder/parameters.go delete mode 100644 e2e/vendor/k8s.io/kube-openapi/pkg/builder/util.go delete mode 100644 e2e/vendor/k8s.io/kube-openapi/pkg/builder3/openapi.go delete mode 100644 e2e/vendor/k8s.io/kube-openapi/pkg/builder3/util.go delete mode 100644 e2e/vendor/k8s.io/kube-openapi/pkg/builder3/util/util.go delete mode 100644 e2e/vendor/k8s.io/kube-openapi/pkg/common/restfuladapter/adapter.go delete mode 100644 e2e/vendor/k8s.io/kube-openapi/pkg/common/restfuladapter/param_adapter.go delete mode 100644 e2e/vendor/k8s.io/kube-openapi/pkg/common/restfuladapter/response_error_adapter.go delete mode 100644 e2e/vendor/k8s.io/kube-openapi/pkg/common/restfuladapter/route_adapter.go delete mode 100644 e2e/vendor/k8s.io/kube-openapi/pkg/common/restfuladapter/webservice_adapter.go delete mode 100644 e2e/vendor/k8s.io/kube-openapi/pkg/handler/default_pruning.go delete mode 100644 e2e/vendor/k8s.io/kube-openapi/pkg/handler/handler.go delete mode 100644 e2e/vendor/k8s.io/kube-openapi/pkg/schemamutation/walker.go create mode 100644 e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.validations.go delete mode 100644 e2e/vendor/k8s.io/kubernetes/pkg/cluster/ports/doc.go delete mode 100644 e2e/vendor/k8s.io/kubernetes/pkg/cluster/ports/ports.go rename e2e/vendor/k8s.io/{apiserver/pkg/authentication/request/x509 => kubernetes/pkg/credentialprovider}/OWNERS (55%) create mode 100644 e2e/vendor/k8s.io/kubernetes/pkg/credentialprovider/config.go rename e2e/vendor/k8s.io/{apiserver/pkg/endpoints => kubernetes/pkg/credentialprovider}/doc.go (77%) create mode 100644 e2e/vendor/k8s.io/kubernetes/pkg/credentialprovider/keyring.go create mode 100644 e2e/vendor/k8s.io/kubernetes/pkg/credentialprovider/provider.go delete mode 100644 e2e/vendor/k8s.io/kubernetes/pkg/features/versioned_kube_features.go create mode 100644 e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/topology/alignment.go rename e2e/vendor/k8s.io/{apiserver/pkg/server => kubernetes/pkg/kubelet/qos}/doc.go (53%) create mode 100644 e2e/vendor/k8s.io/kubernetes/pkg/kubelet/qos/helpers.go create mode 100644 e2e/vendor/k8s.io/kubernetes/pkg/kubelet/qos/policy.go delete mode 100644 e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/fake_status_manager.go delete mode 100644 e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/state/checkpoint.go delete mode 100644 e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/state/state.go delete mode 100644 e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/state/state_checkpoint.go delete mode 100644 e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/state/state_mem.go create mode 100644 e2e/vendor/k8s.io/kubernetes/pkg/scheduler/backend/queue/backoff_queue.go delete mode 100644 e2e/vendor/k8s.io/utils/clock/testing/fake_clock.go delete mode 100644 e2e/vendor/k8s.io/utils/clock/testing/simple_interval_clock.go delete mode 100644 e2e/vendor/k8s.io/utils/nsenter/OWNERS delete mode 100644 e2e/vendor/k8s.io/utils/nsenter/README.md delete mode 100644 e2e/vendor/k8s.io/utils/nsenter/nsenter.go delete mode 100644 e2e/vendor/k8s.io/utils/nsenter/nsenter_unsupported.go diff --git a/e2e/go.mod b/e2e/go.mod index 5531ab8ae..512360297 100644 --- a/e2e/go.mod +++ b/e2e/go.mod @@ -1,7 +1,8 @@ module github.com/ceph/ceph-csi/e2e -go 1.23.1 -toolchain go1.24.1 +go 1.24.0 + +toolchain go1.24.2 // my own dependencies replace ( @@ -19,20 +20,20 @@ require ( k8s.io/apimachinery v0.33.0 k8s.io/client-go v12.0.0+incompatible k8s.io/cloud-provider v0.33.0 - k8s.io/kubernetes v1.32.3 + k8s.io/kubernetes v1.33.0 k8s.io/pod-security-admission v0.33.0 ) replace ( - k8s.io/api => k8s.io/api v0.32.2 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.32.2 - k8s.io/client-go => k8s.io/client-go v0.32.2 - k8s.io/cri-client => k8s.io/cri-client v0.32.2 - k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.32.2 - k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.32.2 - k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.32.2 - k8s.io/kubectl => k8s.io/kubectl v0.32.2 - k8s.io/kubelet => k8s.io/kubelet v0.32.2 + k8s.io/api => k8s.io/api v0.33.0 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.33.0 + k8s.io/client-go => k8s.io/client-go v0.33.0 + k8s.io/cri-client => k8s.io/cri-client v0.33.0 + k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.33.0 + k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.33.0 + k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.33.0 + k8s.io/kubectl => k8s.io/kubectl v0.33.0 + k8s.io/kubelet => k8s.io/kubelet v0.33.0 ) require github.com/ceph/ceph-csi v2.0.1+incompatible @@ -41,19 +42,19 @@ require ( cel.dev/expr v0.20.0 // indirect github.com/JeffAshton/win_pdh v0.0.0-20161109143554-76bb4ee9f0ab // indirect github.com/Microsoft/go-winio v0.6.2 // indirect - github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/antlr4-go/antlr/v4 v4.13.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/containerd/containerd/api v1.7.19 // indirect - github.com/containerd/errdefs v0.1.0 // indirect + github.com/containerd/containerd/api v1.8.0 // indirect + github.com/containerd/errdefs v1.0.0 // indirect + github.com/containerd/errdefs/pkg v0.3.0 // indirect github.com/containerd/log v0.1.0 // indirect - github.com/containerd/ttrpc v1.2.5 // indirect - github.com/coreos/go-semver v0.3.1 // indirect + github.com/containerd/ttrpc v1.2.6 // indirect + github.com/containerd/typeurl/v2 v2.2.2 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect - github.com/cyphar/filepath-securejoin v0.3.4 // indirect + github.com/cyphar/filepath-securejoin v0.4.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/distribution/reference v0.6.0 // indirect github.com/docker/go-units v0.5.0 // indirect @@ -70,16 +71,13 @@ require ( github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.4 // indirect - github.com/google/btree v1.1.3 // indirect - github.com/google/cadvisor v0.51.0 // indirect + github.com/google/cadvisor v0.52.1 // indirect github.com/google/cel-go v0.23.2 // indirect github.com/google/gnostic-models v0.6.9 // indirect github.com/google/go-cmp v0.7.0 // indirect github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect @@ -95,8 +93,9 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect + github.com/opencontainers/cgroups v0.0.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/runc v1.2.1 // indirect + github.com/opencontainers/image-spec v1.1.1 // indirect github.com/opencontainers/runtime-spec v1.2.0 // indirect github.com/opencontainers/selinux v1.11.1 // indirect github.com/pkg/errors v0.9.1 // indirect @@ -109,9 +108,6 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect github.com/x448/float16 v0.8.4 // indirect - go.etcd.io/etcd/api/v3 v3.5.21 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.5.21 // indirect - go.etcd.io/etcd/client/v3 v3.5.21 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect @@ -123,8 +119,6 @@ require ( go.opentelemetry.io/otel/trace v1.34.0 // indirect go.opentelemetry.io/proto/otlp v1.4.0 // indirect go.uber.org/automaxprocs v1.6.0 // indirect - go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.27.0 // indirect golang.org/x/crypto v0.37.0 // indirect golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect golang.org/x/net v0.39.0 // indirect @@ -141,23 +135,21 @@ require ( google.golang.org/protobuf v1.36.6 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.32.1 // indirect k8s.io/apiserver v0.33.0 // indirect k8s.io/component-base v0.33.0 // indirect k8s.io/component-helpers v0.33.0 // indirect k8s.io/controller-manager v0.33.0 // indirect - k8s.io/cri-api v0.32.2 // indirect + k8s.io/cri-api v0.33.0 // indirect k8s.io/cri-client v0.0.0 // indirect k8s.io/csi-translation-lib v0.32.2 // indirect k8s.io/dynamic-resource-allocation v0.0.0 // indirect k8s.io/klog/v2 v2.130.1 // indirect - k8s.io/kms v0.33.0 // indirect k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect k8s.io/kube-scheduler v0.0.0 // indirect k8s.io/kubectl v0.0.0 // indirect - k8s.io/kubelet v0.32.2 // indirect + k8s.io/kubelet v0.33.0 // indirect k8s.io/mount-utils v0.32.2 // indirect k8s.io/utils v0.0.0-20241210054802-24370beab758 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect diff --git a/e2e/go.sum b/e2e/go.sum index 05b6b1a07..6b246b61f 100644 --- a/e2e/go.sum +++ b/e2e/go.sum @@ -4,8 +4,6 @@ github.com/JeffAshton/win_pdh v0.0.0-20161109143554-76bb4ee9f0ab h1:UKkYhof1njT1 github.com/JeffAshton/win_pdh v0.0.0-20161109143554-76bb4ee9f0ab/go.mod h1:3VYc5hodBMJ5+l/7J4xAyMeuM2PNuepvHlGs8yilUCA= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= -github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= @@ -18,23 +16,23 @@ github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK3 github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/containerd/containerd/api v1.7.19 h1:VWbJL+8Ap4Ju2mx9c9qS1uFSB1OVYr5JJrW2yT5vFoA= -github.com/containerd/containerd/api v1.7.19/go.mod h1:fwGavl3LNwAV5ilJ0sbrABL44AQxmNjDRcwheXDb6Ig= -github.com/containerd/errdefs v0.1.0 h1:m0wCRBiu1WJT/Fr+iOoQHMQS/eP5myQ8lCv4Dz5ZURM= -github.com/containerd/errdefs v0.1.0/go.mod h1:YgWiiHtLmSeBrvpw+UfPijzbLaB77mEG1WwJTDETIV0= +github.com/containerd/containerd/api v1.8.0 h1:hVTNJKR8fMc/2Tiw60ZRijntNMd1U+JVMyTRdsD2bS0= +github.com/containerd/containerd/api v1.8.0/go.mod h1:dFv4lt6S20wTu/hMcP4350RL87qPWLVa/OHOwmmdnYc= +github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= +github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= +github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE= +github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= -github.com/containerd/ttrpc v1.2.5 h1:IFckT1EFQoFBMG4c3sMdT8EP3/aKfumK1msY+Ze4oLU= -github.com/containerd/ttrpc v1.2.5/go.mod h1:YCXHsb32f+Sq5/72xHubdiJRQY9inL4a4ZQrAbN1q9o= -github.com/containerd/typeurl/v2 v2.2.0 h1:6NBDbQzr7I5LHgp34xAXYF5DOTQDn05X58lsPEmzLso= -github.com/containerd/typeurl/v2 v2.2.0/go.mod h1:8XOOxnyatxSWuG8OfsZXVnAF4iZfedjS/8UHSPJnX4g= -github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= -github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= +github.com/containerd/ttrpc v1.2.6 h1:zG+Kn5EZ6MUYCS1t2Hmt2J4tMVaLSFEJVOraDQwNPC4= +github.com/containerd/ttrpc v1.2.6/go.mod h1:YCXHsb32f+Sq5/72xHubdiJRQY9inL4a4ZQrAbN1q9o= +github.com/containerd/typeurl/v2 v2.2.2 h1:3jN/k2ysKuPCsln5Qv8bzR9cxal8XjkxPogJfSNO31k= +github.com/containerd/typeurl/v2 v2.2.2/go.mod h1:95ljDnPfD3bAbDJRugOiShd/DlAAsxGtUBhJxIn7SCk= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cyphar/filepath-securejoin v0.3.4 h1:VBWugsJh2ZxJmLFSM06/0qzQyiQX2Qs0ViKrUAcqdZ8= -github.com/cyphar/filepath-securejoin v0.3.4/go.mod h1:8s/MCNJREmFK0H02MF6Ihv1nakJe4L/w3WZLHNkvlYM= +github.com/cyphar/filepath-securejoin v0.4.1 h1:JyxxyPEaktOD+GAnqIqTf9A8tHyAG22rowi7HkoSU1s= +github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -47,8 +45,6 @@ github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= -github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU= github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/euank/go-kmsg-parser v2.0.0+incompatible h1:cHD53+PLQuuQyLZeriD1V/esuG4MuU0Pjs5y6iknohY= @@ -79,14 +75,10 @@ github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI= -github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= -github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/cadvisor v0.51.0 h1:BspqSPdZoLKrnvuZNOvM/KiJ/A+RdixwagN20n+2H8k= -github.com/google/cadvisor v0.51.0/go.mod h1:czGE/c/P/i0QFpVNKTFrIEzord9Y10YfpwuaSWXELc0= +github.com/google/cadvisor v0.52.1 h1:sC8SZ6jio9ds+P2dk51bgbeYeufxo55n0X3tmrpA9as= +github.com/google/cadvisor v0.52.1/go.mod h1:OAhPcx1nOm5YwMh/JhpUOMKyv1YKLRtS9KgzWPndHmA= github.com/google/cel-go v0.23.2 h1:UdEe3CvQh3Nv+E/j9r1Y//WO0K0cSyD7/y0bzyLIMI4= github.com/google/cel-go v0.23.2/go.mod h1:52Pb6QsDbC5kvgxvZhiL9QX1oZEkcUF/ZqaPx1J5Wwo= github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw= @@ -95,26 +87,16 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8= github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= -github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= -github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 h1:TmHmbvxPmaegwhDubVz0lICL0J5Ka2vwTzhoePEXsGE= github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0/go.mod h1:qztMSjm835F2bXf+5HKAPIS5qsmQDqZna/PgVt4rWtI= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4= -github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -158,12 +140,12 @@ github.com/onsi/ginkgo/v2 v2.23.4 h1:ktYTpKJAVZnDT4VjxSbiBenUjmlL/5QkBEocaWXiQus github.com/onsi/ginkgo/v2 v2.23.4/go.mod h1:Bt66ApGPBFzHyR+JO10Zbt0Gsp4uWxu5mIOTusL46e8= github.com/onsi/gomega v1.37.0 h1:CdEG8g0S133B4OswTDC/5XPSzE1OeP29QOioj2PID2Y= github.com/onsi/gomega v1.37.0/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU4KU0= +github.com/opencontainers/cgroups v0.0.1 h1:MXjMkkFpKv6kpuirUa4USFBas573sSAY082B4CiHEVA= +github.com/opencontainers/cgroups v0.0.1/go.mod h1:s8lktyhlGUqM7OSRL5P7eAW6Wb+kWPNvt4qvVfzA5vs= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= -github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= -github.com/opencontainers/runc v1.2.1 h1:mQkmeFSUxqFaVmvIn1VQPeQIKpHFya5R07aJw0DKQa8= -github.com/opencontainers/runc v1.2.1/go.mod h1:/PXzF0h531HTMsYQnmxXkBD7YaGShm/2zcRB79dksUc= +github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= +github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk= github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.11.1 h1:nHFvthhM0qY8/m+vfhJylliSshm8G1jJ2jDMcgULaH8= @@ -188,8 +170,6 @@ github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWN github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= -github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -208,30 +188,10 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE= -github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= -github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510 h1:S2dVYn90KE98chqDkyE9Z4N61UnQd+KOfgp5Iu53llk= -github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0= -go.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I= -go.etcd.io/etcd/api/v3 v3.5.21 h1:A6O2/JDb3tvHhiIz3xf9nJ7REHvtEFJJ3veW3FbCnS8= -go.etcd.io/etcd/api/v3 v3.5.21/go.mod h1:c3aH5wcvXv/9dqIw2Y810LDXJfhSYdHQ0vxmP3CCHVY= -go.etcd.io/etcd/client/pkg/v3 v3.5.21 h1:lPBu71Y7osQmzlflM9OfeIV2JlmpBjqBNlLtcoBqUTc= -go.etcd.io/etcd/client/pkg/v3 v3.5.21/go.mod h1:BgqT/IXPjK9NkeSDjbzwsHySX3yIle2+ndz28nVsjUs= -go.etcd.io/etcd/client/v2 v2.305.21 h1:eLiFfexc2mE+pTLz9WwnoEsX5JTTpLCYVivKkmVXIRA= -go.etcd.io/etcd/client/v2 v2.305.21/go.mod h1:OKkn4hlYNf43hpjEM3Ke3aRdUkhSl8xjKjSf8eCq2J8= -go.etcd.io/etcd/client/v3 v3.5.21 h1:T6b1Ow6fNjOLOtM0xSoKNQt1ASPCLWrF9XMHcH9pEyY= -go.etcd.io/etcd/client/v3 v3.5.21/go.mod h1:mFYy67IOqmbRf/kRUvsHixzo3iG+1OF2W2+jVIQRAnU= -go.etcd.io/etcd/pkg/v3 v3.5.21 h1:jUItxeKyrDuVuWhdh0HtjUANwyuzcb7/FAeUfABmQsk= -go.etcd.io/etcd/pkg/v3 v3.5.21/go.mod h1:wpZx8Egv1g4y+N7JAsqi2zoUiBIUWznLjqJbylDjWgU= -go.etcd.io/etcd/raft/v3 v3.5.21 h1:dOmE0mT55dIUsX77TKBLq+RgyumsQuYeiRQnW/ylugk= -go.etcd.io/etcd/raft/v3 v3.5.21/go.mod h1:fmcuY5R2SNkklU4+fKVBQi2biVp5vafMrWUEj4TJ4Cs= -go.etcd.io/etcd/server/v3 v3.5.21 h1:9w0/k12majtgarGmlMVuhwXRI2ob3/d1Ik3X5TKo0yU= -go.etcd.io/etcd/server/v3 v3.5.21/go.mod h1:G1mOzdwuzKT1VRL7SqRchli/qcFrtLBTAQ4lV20sXXo= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 h1:PS8wXpbyaDJQ2VDHHncMe9Vct0Zn1fEjpsjrLxGJoSc= @@ -308,8 +268,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ= -google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a h1:nwKuGPlUAt+aR+pcrkfFRrTU1BVrSmYyYMxYbUIVHr0= google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a/go.mod h1:3kWAYMk1I75K4vykHtKt2ycnOgpA6974V7bREqbsenU= google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a h1:51aaUVRocpvUOSQKM6Q7VuoaktNIaMCLuhZB6DKksq4= @@ -325,21 +283,19 @@ gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSP gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= -gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.32.2 h1:bZrMLEkgizC24G9eViHGOPbW+aRo9duEISRIJKfdJuw= -k8s.io/api v0.32.2/go.mod h1:hKlhk4x1sJyYnHENsrdCWw31FEmCijNGPJO5WzHiJ6Y= -k8s.io/apiextensions-apiserver v0.32.2 h1:2YMk285jWMk2188V2AERy5yDwBYrjgWYggscghPCvV4= -k8s.io/apiextensions-apiserver v0.32.2/go.mod h1:GPwf8sph7YlJT3H6aKUWtd0E+oyShk/YHWQHf/OOgCA= +k8s.io/api v0.33.0 h1:yTgZVn1XEe6opVpP1FylmNrIFWuDqe2H0V8CT5gxfIU= +k8s.io/api v0.33.0/go.mod h1:CTO61ECK/KU7haa3qq8sarQ0biLq2ju405IZAd9zsiM= +k8s.io/apiextensions-apiserver v0.33.0 h1:d2qpYL7Mngbsc1taA4IjJPRJ9ilnsXIrndH+r9IimOs= +k8s.io/apiextensions-apiserver v0.33.0/go.mod h1:VeJ8u9dEEN+tbETo+lFkwaaZPg6uFKLGj5vyNEwwSzc= k8s.io/apimachinery v0.33.0 h1:1a6kHrJxb2hs4t8EE5wuR/WxKDwGN1FKH3JvDtA0CIQ= k8s.io/apimachinery v0.33.0/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM= k8s.io/apiserver v0.33.0 h1:QqcM6c+qEEjkOODHppFXRiw/cE2zP85704YrQ9YaBbc= k8s.io/apiserver v0.33.0/go.mod h1:EixYOit0YTxt8zrO2kBU7ixAtxFce9gKGq367nFmqI8= -k8s.io/client-go v0.32.2 h1:4dYCD4Nz+9RApM2b/3BtVvBHw54QjMFUl1OLcJG5yOA= -k8s.io/client-go v0.32.2/go.mod h1:fpZ4oJXclZ3r2nDOv+Ux3XcJutfrwjKTCHz2H3sww94= +k8s.io/client-go v0.33.0 h1:UASR0sAYVUzs2kYuKn/ZakZlcs2bEHaizrrHUZg0G98= +k8s.io/client-go v0.33.0/go.mod h1:kGkd+l/gNGg8GYWAPr0xF1rRKvVWvzh9vmZAMXtaKOg= k8s.io/cloud-provider v0.33.0 h1:nVU2Q9QK7O50yaNx+pE61oDPqflsSsKygN43f5js9+I= k8s.io/cloud-provider v0.33.0/go.mod h1:2reyEBbsimZJKHF325vxLBD5fcJGNeJHeLjJ+jGM8Qg= k8s.io/component-base v0.33.0 h1:Ot4PyJI+0JAD9covDhwLp9UNkUja209OzsJ4FzScBNk= @@ -348,28 +304,26 @@ k8s.io/component-helpers v0.33.0 h1:0AdW0A0mIgljLgtG0hJDdJl52PPqTrtMgOgtm/9i/Ys= k8s.io/component-helpers v0.33.0/go.mod h1:9SRiXfLldPw9lEEuSsapMtvT8j/h1JyFFapbtybwKvU= k8s.io/controller-manager v0.33.0 h1:O9LnTjffOe62d66gMcKLuPXsBjY5sqETWEIzg+DVL8w= k8s.io/controller-manager v0.33.0/go.mod h1:vQwAQnroav4+UyE2acW1Rj6CSsHPzr2/018kgRLYqlI= -k8s.io/cri-api v0.32.2 h1:7DuaOHpOcXweZeBUbRdK0iCroxctGp73VwgrA0u7kho= -k8s.io/cri-api v0.32.2/go.mod h1:DCzMuTh2padoinefWME0G678Mc3QFbLMF2vEweGzBAI= -k8s.io/cri-client v0.32.2 h1:vjowJUyu14IbmifqCKJHE9rK/BPSfkXvltqN42W1Zuo= -k8s.io/cri-client v0.32.2/go.mod h1:fRZhmmZW16Qviln8hfy+e8dd2wP/n9B6TiGxLE3zBe0= -k8s.io/csi-translation-lib v0.32.2 h1:aLzAyaoJUc5rgtLi8Xd4No1tet6UpvUsGIgRoGnPSSE= -k8s.io/csi-translation-lib v0.32.2/go.mod h1:PlOKan6Vc0G6a+giQbm36plJ+E1LH+GPRLAVMQMSMcY= -k8s.io/dynamic-resource-allocation v0.32.2 h1:6wP8/GGvhhvTJLrzwPSoMJDnspmosFj1CKmfrAH6m5U= -k8s.io/dynamic-resource-allocation v0.32.2/go.mod h1:+3qnQfvikLHVZrdZ0/gYkRiV96weUR9j7+Ph3Ui/hYU= +k8s.io/cri-api v0.33.0 h1:YyGNgWmuSREqFPlP3XCstlHLilYdW898KwtKoaTYwBs= +k8s.io/cri-api v0.33.0/go.mod h1:OLQvT45OpIA+tv91ZrpuFIGY+Y2Ho23poS7n115Aocs= +k8s.io/cri-client v0.33.0 h1:NLB4SKWQqJ2jPtbbdKFY2gEEw/GKSKifSqUf4m/SwSs= +k8s.io/cri-client v0.33.0/go.mod h1:ZIbzmm5ByB0cz0nc5qUlgKZwi1KivOGVXgearqF27cU= +k8s.io/csi-translation-lib v0.33.0 h1:kW3xVPCTXmHmK5v/8PEVZCUZSdNRndiQat0SbN31qEM= +k8s.io/csi-translation-lib v0.33.0/go.mod h1:Ldx85t1WxFStKQ2p5Xaimv39IkTc7/m8yNMkt8MlyoQ= +k8s.io/dynamic-resource-allocation v0.33.0 h1:/b04omcFsLBf2vqh/t1aXhj8fs2eHgKIZzUS/y3Z2qo= +k8s.io/dynamic-resource-allocation v0.33.0/go.mod h1:BHw7vU8bheqj6sdz31gETuvjQkNOcEleBTnrJ9j8vA8= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kms v0.33.0 h1:fhQSW/vyaWDhMp0vDuO/sLg2RlGZf4F77beSXcB4/eE= -k8s.io/kms v0.33.0/go.mod h1:C1I8mjFFBNzfUZXYt9FZVJ8MJl7ynFbGgZFbBzkBJ3E= k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUyGcf03XZEP0ZIKgKj35LS4= k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff/go.mod h1:5jIi+8yX4RIb8wk3XwBo5Pq2ccx4FP10ohkbSKCZoK8= -k8s.io/kube-scheduler v0.32.2 h1:vBm6iIjWaD10OPmtkt/503LTKvrN8dWVceeBcpKj/ns= -k8s.io/kube-scheduler v0.32.2/go.mod h1:dD5yuYpnsCfgZmzvncUNPdvXGJXA1hw3gXq7DH3+aCQ= -k8s.io/kubectl v0.32.2 h1:TAkag6+XfSBgkqK9I7ZvwtF0WVtUAvK8ZqTt+5zi1Us= -k8s.io/kubectl v0.32.2/go.mod h1:+h/NQFSPxiDZYX/WZaWw9fwYezGLISP0ud8nQKg+3g8= -k8s.io/kubelet v0.32.2 h1:WFTSYdt3BB1aTApDuKNI16x/4MYqqX8WBBBBh3KupDg= -k8s.io/kubelet v0.32.2/go.mod h1:cC1ms5RS+lu0ckVr6AviCQXHLSPKEBC3D5oaCBdTGkI= -k8s.io/kubernetes v1.32.3 h1:2A58BlNME8NwsMawmnM6InYo3Jf35Nw5G79q46kXwoA= -k8s.io/kubernetes v1.32.3/go.mod h1:GvhiBeolvSRzBpFlgM0z/Bbu3Oxs9w3P6XfEgYaMi8k= +k8s.io/kube-scheduler v0.33.0 h1:G5psn7ynB5Vjfo0ia8uz32Gv46TRa5RgTq4PTm+yjR0= +k8s.io/kube-scheduler v0.33.0/go.mod h1:I+0aqwJ3G9f9pyfKfoN5b0uP9M6MinNpxXRlCXkM17E= +k8s.io/kubectl v0.33.0 h1:HiRb1yqibBSCqic4pRZP+viiOBAnIdwYDpzUFejs07g= +k8s.io/kubectl v0.33.0/go.mod h1:gAlGBuS1Jq1fYZ9AjGWbI/5Vk3M/VW2DK4g10Fpyn/0= +k8s.io/kubelet v0.33.0 h1:4pJA2Ge6Rp0kDNV76KH7pTBiaV2T1a1874QHMcubuSU= +k8s.io/kubelet v0.33.0/go.mod h1:iDnxbJQMy9DUNaML5L/WUlt3uJtNLWh7ZAe0JSp4Yi0= +k8s.io/kubernetes v1.33.0 h1:BP5Y5yIzUZVeBuE/ESZvnw6TNxjXbLsCckIkljE+R0U= +k8s.io/kubernetes v1.33.0/go.mod h1:2nWuPk0seE4+6sd0x60wQ6rYEXcV7SoeMbU0YbFm/5k= k8s.io/mount-utils v0.32.2 h1:aDwp+ucWiVnDr/LpRg88/dsXf/vm6gI1VZkYH3+3+Vw= k8s.io/mount-utils v0.32.2/go.mod h1:Kun5c2svjAPx0nnvJKYQWhfeNW+O0EpzHgRhDcYoSY0= k8s.io/pod-security-admission v0.33.0 h1:di/iicB5plCq+iQeqgf2s1N5DOSzTDiOOv5OiAbuYWE= diff --git a/e2e/vendor/github.com/NYTimes/gziphandler/.gitignore b/e2e/vendor/github.com/NYTimes/gziphandler/.gitignore deleted file mode 100644 index 1377554eb..000000000 --- a/e2e/vendor/github.com/NYTimes/gziphandler/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.swp diff --git a/e2e/vendor/github.com/NYTimes/gziphandler/.travis.yml b/e2e/vendor/github.com/NYTimes/gziphandler/.travis.yml deleted file mode 100644 index 94dfae362..000000000 --- a/e2e/vendor/github.com/NYTimes/gziphandler/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: go -go: - - 1.x - - tip -env: - - GO111MODULE=on -install: - - go mod download -script: - - go test -race -v diff --git a/e2e/vendor/github.com/NYTimes/gziphandler/CODE_OF_CONDUCT.md b/e2e/vendor/github.com/NYTimes/gziphandler/CODE_OF_CONDUCT.md deleted file mode 100644 index cdbca194c..000000000 --- a/e2e/vendor/github.com/NYTimes/gziphandler/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -layout: code-of-conduct -version: v1.0 ---- - -This code of conduct outlines our expectations for participants within the **NYTimes/gziphandler** community, as well as steps to reporting unacceptable behavior. We are committed to providing a welcoming and inspiring community for all and expect our code of conduct to be honored. Anyone who violates this code of conduct may be banned from the community. - -Our open source community strives to: - -* **Be friendly and patient.** -* **Be welcoming**: We strive to be a community that welcomes and supports people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, colour, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability. -* **Be considerate**: Your work will be used by other people, and you in turn will depend on the work of others. Any decision you take will affect users and colleagues, and you should take those consequences into account when making decisions. Remember that we're a world-wide community, so you might not be communicating in someone else's primary language. -* **Be respectful**: Not all of us will agree all the time, but disagreement is no excuse for poor behavior and poor manners. We might all experience some frustration now and then, but we cannot allow that frustration to turn into a personal attack. It’s important to remember that a community where people feel uncomfortable or threatened is not a productive one. -* **Be careful in the words that we choose**: we are a community of professionals, and we conduct ourselves professionally. Be kind to others. Do not insult or put down other participants. Harassment and other exclusionary behavior aren't acceptable. -* **Try to understand why we disagree**: Disagreements, both social and technical, happen all the time. It is important that we resolve disagreements and differing views constructively. Remember that we’re different. The strength of our community comes from its diversity, people from a wide range of backgrounds. Different people have different perspectives on issues. Being unable to understand why someone holds a viewpoint doesn’t mean that they’re wrong. Don’t forget that it is human to err and blaming each other doesn’t get us anywhere. Instead, focus on helping to resolve issues and learning from mistakes. - -## Definitions - -Harassment includes, but is not limited to: - -- Offensive comments related to gender, gender identity and expression, sexual orientation, disability, mental illness, neuro(a)typicality, physical appearance, body size, race, age, regional discrimination, political or religious affiliation -- Unwelcome comments regarding a person’s lifestyle choices and practices, including those related to food, health, parenting, drugs, and employment -- Deliberate misgendering. This includes deadnaming or persistently using a pronoun that does not correctly reflect a person's gender identity. You must address people by the name they give you when not addressing them by their username or handle -- Physical contact and simulated physical contact (eg, textual descriptions like “*hug*” or “*backrub*”) without consent or after a request to stop -- Threats of violence, both physical and psychological -- Incitement of violence towards any individual, including encouraging a person to commit suicide or to engage in self-harm -- Deliberate intimidation -- Stalking or following -- Harassing photography or recording, including logging online activity for harassment purposes -- Sustained disruption of discussion -- Unwelcome sexual attention, including gratuitous or off-topic sexual images or behaviour -- Pattern of inappropriate social contact, such as requesting/assuming inappropriate levels of intimacy with others -- Continued one-on-one communication after requests to cease -- Deliberate “outing” of any aspect of a person’s identity without their consent except as necessary to protect others from intentional abuse -- Publication of non-harassing private communication - -Our open source community prioritizes marginalized people’s safety over privileged people’s comfort. We will not act on complaints regarding: - -- ‘Reverse’ -isms, including ‘reverse racism,’ ‘reverse sexism,’ and ‘cisphobia’ -- Reasonable communication of boundaries, such as “leave me alone,” “go away,” or “I’m not discussing this with you” -- Refusal to explain or debate social justice concepts -- Communicating in a ‘tone’ you don’t find congenial -- Criticizing racist, sexist, cissexist, or otherwise oppressive behavior or assumptions - - -### Diversity Statement - -We encourage everyone to participate and are committed to building a community for all. Although we will fail at times, we seek to treat everyone both as fairly and equally as possible. Whenever a participant has made a mistake, we expect them to take responsibility for it. If someone has been harmed or offended, it is our responsibility to listen carefully and respectfully, and do our best to right the wrong. - -Although this list cannot be exhaustive, we explicitly honor diversity in age, gender, gender identity or expression, culture, ethnicity, language, national origin, political beliefs, profession, race, religion, sexual orientation, socioeconomic status, and technical ability. We will not tolerate discrimination based on any of the protected -characteristics above, including participants with disabilities. - -### Reporting Issues - -If you experience or witness unacceptable behavior—or have any other concerns—please report it by contacting us via **code@nytimes.com**. All reports will be handled with discretion. In your report please include: - -- Your contact information. -- Names (real, nicknames, or pseudonyms) of any individuals involved. If there are additional witnesses, please -include them as well. Your account of what occurred, and if you believe the incident is ongoing. If there is a publicly available record (e.g. a mailing list archive or a public IRC logger), please include a link. -- Any additional information that may be helpful. - -After filing a report, a representative will contact you personally, review the incident, follow up with any additional questions, and make a decision as to how to respond. If the person who is harassing you is part of the response team, they will recuse themselves from handling your incident. If the complaint originates from a member of the response team, it will be handled by a different member of the response team. We will respect confidentiality requests for the purpose of protecting victims of abuse. - -### Attribution & Acknowledgements - -We all stand on the shoulders of giants across many open source communities. We'd like to thank the communities and projects that established code of conducts and diversity statements as our inspiration: - -* [Django](https://www.djangoproject.com/conduct/reporting/) -* [Python](https://www.python.org/community/diversity/) -* [Ubuntu](http://www.ubuntu.com/about/about-ubuntu/conduct) -* [Contributor Covenant](http://contributor-covenant.org/) -* [Geek Feminism](http://geekfeminism.org/about/code-of-conduct/) -* [Citizen Code of Conduct](http://citizencodeofconduct.org/) - -This Code of Conduct was based on https://github.com/todogroup/opencodeofconduct diff --git a/e2e/vendor/github.com/NYTimes/gziphandler/CONTRIBUTING.md b/e2e/vendor/github.com/NYTimes/gziphandler/CONTRIBUTING.md deleted file mode 100644 index b89a9eb4f..000000000 --- a/e2e/vendor/github.com/NYTimes/gziphandler/CONTRIBUTING.md +++ /dev/null @@ -1,30 +0,0 @@ -# Contributing to NYTimes/gziphandler - -This is an open source project started by handful of developers at The New York Times and open to the entire Go community. - -We really appreciate your help! - -## Filing issues - -When filing an issue, make sure to answer these five questions: - -1. What version of Go are you using (`go version`)? -2. What operating system and processor architecture are you using? -3. What did you do? -4. What did you expect to see? -5. What did you see instead? - -## Contributing code - -Before submitting changes, please follow these guidelines: - -1. Check the open issues and pull requests for existing discussions. -2. Open an issue to discuss a new feature. -3. Write tests. -4. Make sure code follows the ['Go Code Review Comments'](https://github.com/golang/go/wiki/CodeReviewComments). -5. Make sure your changes pass `go test`. -6. Make sure the entire test suite passes locally and on Travis CI. -7. Open a Pull Request. -8. [Squash your commits](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html) after receiving feedback and add a [great commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). - -Unless otherwise noted, the gziphandler source files are distributed under the Apache 2.0-style license found in the LICENSE.md file. diff --git a/e2e/vendor/github.com/NYTimes/gziphandler/LICENSE b/e2e/vendor/github.com/NYTimes/gziphandler/LICENSE deleted file mode 100644 index df6192d36..000000000 --- a/e2e/vendor/github.com/NYTimes/gziphandler/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2016-2017 The New York Times Company - - 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/e2e/vendor/github.com/NYTimes/gziphandler/README.md b/e2e/vendor/github.com/NYTimes/gziphandler/README.md deleted file mode 100644 index 6259acaca..000000000 --- a/e2e/vendor/github.com/NYTimes/gziphandler/README.md +++ /dev/null @@ -1,56 +0,0 @@ -Gzip Handler -============ - -This is a tiny Go package which wraps HTTP handlers to transparently gzip the -response body, for clients which support it. Although it's usually simpler to -leave that to a reverse proxy (like nginx or Varnish), this package is useful -when that's undesirable. - -## Install -```bash -go get -u github.com/NYTimes/gziphandler -``` - -## Usage - -Call `GzipHandler` with any handler (an object which implements the -`http.Handler` interface), and it'll return a new handler which gzips the -response. For example: - -```go -package main - -import ( - "io" - "net/http" - "github.com/NYTimes/gziphandler" -) - -func main() { - withoutGz := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - io.WriteString(w, "Hello, World") - }) - - withGz := gziphandler.GzipHandler(withoutGz) - - http.Handle("/", withGz) - http.ListenAndServe("0.0.0.0:8000", nil) -} -``` - - -## Documentation - -The docs can be found at [godoc.org][docs], as usual. - - -## License - -[Apache 2.0][license]. - - - - -[docs]: https://godoc.org/github.com/NYTimes/gziphandler -[license]: https://github.com/NYTimes/gziphandler/blob/master/LICENSE diff --git a/e2e/vendor/github.com/NYTimes/gziphandler/gzip.go b/e2e/vendor/github.com/NYTimes/gziphandler/gzip.go deleted file mode 100644 index c112bbdf8..000000000 --- a/e2e/vendor/github.com/NYTimes/gziphandler/gzip.go +++ /dev/null @@ -1,532 +0,0 @@ -package gziphandler // import "github.com/NYTimes/gziphandler" - -import ( - "bufio" - "compress/gzip" - "fmt" - "io" - "mime" - "net" - "net/http" - "strconv" - "strings" - "sync" -) - -const ( - vary = "Vary" - acceptEncoding = "Accept-Encoding" - contentEncoding = "Content-Encoding" - contentType = "Content-Type" - contentLength = "Content-Length" -) - -type codings map[string]float64 - -const ( - // DefaultQValue is the default qvalue to assign to an encoding if no explicit qvalue is set. - // This is actually kind of ambiguous in RFC 2616, so hopefully it's correct. - // The examples seem to indicate that it is. - DefaultQValue = 1.0 - - // DefaultMinSize is the default minimum size until we enable gzip compression. - // 1500 bytes is the MTU size for the internet since that is the largest size allowed at the network layer. - // If you take a file that is 1300 bytes and compress it to 800 bytes, it’s still transmitted in that same 1500 byte packet regardless, so you’ve gained nothing. - // That being the case, you should restrict the gzip compression to files with a size greater than a single packet, 1400 bytes (1.4KB) is a safe value. - DefaultMinSize = 1400 -) - -// gzipWriterPools stores a sync.Pool for each compression level for reuse of -// gzip.Writers. Use poolIndex to covert a compression level to an index into -// gzipWriterPools. -var gzipWriterPools [gzip.BestCompression - gzip.BestSpeed + 2]*sync.Pool - -func init() { - for i := gzip.BestSpeed; i <= gzip.BestCompression; i++ { - addLevelPool(i) - } - addLevelPool(gzip.DefaultCompression) -} - -// poolIndex maps a compression level to its index into gzipWriterPools. It -// assumes that level is a valid gzip compression level. -func poolIndex(level int) int { - // gzip.DefaultCompression == -1, so we need to treat it special. - if level == gzip.DefaultCompression { - return gzip.BestCompression - gzip.BestSpeed + 1 - } - return level - gzip.BestSpeed -} - -func addLevelPool(level int) { - gzipWriterPools[poolIndex(level)] = &sync.Pool{ - New: func() interface{} { - // NewWriterLevel only returns error on a bad level, we are guaranteeing - // that this will be a valid level so it is okay to ignore the returned - // error. - w, _ := gzip.NewWriterLevel(nil, level) - return w - }, - } -} - -// GzipResponseWriter provides an http.ResponseWriter interface, which gzips -// bytes before writing them to the underlying response. This doesn't close the -// writers, so don't forget to do that. -// It can be configured to skip response smaller than minSize. -type GzipResponseWriter struct { - http.ResponseWriter - index int // Index for gzipWriterPools. - gw *gzip.Writer - - code int // Saves the WriteHeader value. - - minSize int // Specifed the minimum response size to gzip. If the response length is bigger than this value, it is compressed. - buf []byte // Holds the first part of the write before reaching the minSize or the end of the write. - ignore bool // If true, then we immediately passthru writes to the underlying ResponseWriter. - - contentTypes []parsedContentType // Only compress if the response is one of these content-types. All are accepted if empty. -} - -type GzipResponseWriterWithCloseNotify struct { - *GzipResponseWriter -} - -func (w GzipResponseWriterWithCloseNotify) CloseNotify() <-chan bool { - return w.ResponseWriter.(http.CloseNotifier).CloseNotify() -} - -// Write appends data to the gzip writer. -func (w *GzipResponseWriter) Write(b []byte) (int, error) { - // GZIP responseWriter is initialized. Use the GZIP responseWriter. - if w.gw != nil { - return w.gw.Write(b) - } - - // If we have already decided not to use GZIP, immediately passthrough. - if w.ignore { - return w.ResponseWriter.Write(b) - } - - // Save the write into a buffer for later use in GZIP responseWriter (if content is long enough) or at close with regular responseWriter. - // On the first write, w.buf changes from nil to a valid slice - w.buf = append(w.buf, b...) - - var ( - cl, _ = strconv.Atoi(w.Header().Get(contentLength)) - ct = w.Header().Get(contentType) - ce = w.Header().Get(contentEncoding) - ) - // Only continue if they didn't already choose an encoding or a known unhandled content length or type. - if ce == "" && (cl == 0 || cl >= w.minSize) && (ct == "" || handleContentType(w.contentTypes, ct)) { - // If the current buffer is less than minSize and a Content-Length isn't set, then wait until we have more data. - if len(w.buf) < w.minSize && cl == 0 { - return len(b), nil - } - // If the Content-Length is larger than minSize or the current buffer is larger than minSize, then continue. - if cl >= w.minSize || len(w.buf) >= w.minSize { - // If a Content-Type wasn't specified, infer it from the current buffer. - if ct == "" { - ct = http.DetectContentType(w.buf) - w.Header().Set(contentType, ct) - } - // If the Content-Type is acceptable to GZIP, initialize the GZIP writer. - if handleContentType(w.contentTypes, ct) { - if err := w.startGzip(); err != nil { - return 0, err - } - return len(b), nil - } - } - } - // If we got here, we should not GZIP this response. - if err := w.startPlain(); err != nil { - return 0, err - } - return len(b), nil -} - -// startGzip initializes a GZIP writer and writes the buffer. -func (w *GzipResponseWriter) startGzip() error { - // Set the GZIP header. - w.Header().Set(contentEncoding, "gzip") - - // if the Content-Length is already set, then calls to Write on gzip - // will fail to set the Content-Length header since its already set - // See: https://github.com/golang/go/issues/14975. - w.Header().Del(contentLength) - - // Write the header to gzip response. - if w.code != 0 { - w.ResponseWriter.WriteHeader(w.code) - // Ensure that no other WriteHeader's happen - w.code = 0 - } - - // Initialize and flush the buffer into the gzip response if there are any bytes. - // If there aren't any, we shouldn't initialize it yet because on Close it will - // write the gzip header even if nothing was ever written. - if len(w.buf) > 0 { - // Initialize the GZIP response. - w.init() - n, err := w.gw.Write(w.buf) - - // This should never happen (per io.Writer docs), but if the write didn't - // accept the entire buffer but returned no specific error, we have no clue - // what's going on, so abort just to be safe. - if err == nil && n < len(w.buf) { - err = io.ErrShortWrite - } - return err - } - return nil -} - -// startPlain writes to sent bytes and buffer the underlying ResponseWriter without gzip. -func (w *GzipResponseWriter) startPlain() error { - if w.code != 0 { - w.ResponseWriter.WriteHeader(w.code) - // Ensure that no other WriteHeader's happen - w.code = 0 - } - w.ignore = true - // If Write was never called then don't call Write on the underlying ResponseWriter. - if w.buf == nil { - return nil - } - n, err := w.ResponseWriter.Write(w.buf) - w.buf = nil - // This should never happen (per io.Writer docs), but if the write didn't - // accept the entire buffer but returned no specific error, we have no clue - // what's going on, so abort just to be safe. - if err == nil && n < len(w.buf) { - err = io.ErrShortWrite - } - return err -} - -// WriteHeader just saves the response code until close or GZIP effective writes. -func (w *GzipResponseWriter) WriteHeader(code int) { - if w.code == 0 { - w.code = code - } -} - -// init graps a new gzip writer from the gzipWriterPool and writes the correct -// content encoding header. -func (w *GzipResponseWriter) init() { - // Bytes written during ServeHTTP are redirected to this gzip writer - // before being written to the underlying response. - gzw := gzipWriterPools[w.index].Get().(*gzip.Writer) - gzw.Reset(w.ResponseWriter) - w.gw = gzw -} - -// Close will close the gzip.Writer and will put it back in the gzipWriterPool. -func (w *GzipResponseWriter) Close() error { - if w.ignore { - return nil - } - - if w.gw == nil { - // GZIP not triggered yet, write out regular response. - err := w.startPlain() - // Returns the error if any at write. - if err != nil { - err = fmt.Errorf("gziphandler: write to regular responseWriter at close gets error: %q", err.Error()) - } - return err - } - - err := w.gw.Close() - gzipWriterPools[w.index].Put(w.gw) - w.gw = nil - return err -} - -// Flush flushes the underlying *gzip.Writer and then the underlying -// http.ResponseWriter if it is an http.Flusher. This makes GzipResponseWriter -// an http.Flusher. -func (w *GzipResponseWriter) Flush() { - if w.gw == nil && !w.ignore { - // Only flush once startGzip or startPlain has been called. - // - // Flush is thus a no-op until we're certain whether a plain - // or gzipped response will be served. - return - } - - if w.gw != nil { - w.gw.Flush() - } - - if fw, ok := w.ResponseWriter.(http.Flusher); ok { - fw.Flush() - } -} - -// Hijack implements http.Hijacker. If the underlying ResponseWriter is a -// Hijacker, its Hijack method is returned. Otherwise an error is returned. -func (w *GzipResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { - if hj, ok := w.ResponseWriter.(http.Hijacker); ok { - return hj.Hijack() - } - return nil, nil, fmt.Errorf("http.Hijacker interface is not supported") -} - -// verify Hijacker interface implementation -var _ http.Hijacker = &GzipResponseWriter{} - -// MustNewGzipLevelHandler behaves just like NewGzipLevelHandler except that in -// an error case it panics rather than returning an error. -func MustNewGzipLevelHandler(level int) func(http.Handler) http.Handler { - wrap, err := NewGzipLevelHandler(level) - if err != nil { - panic(err) - } - return wrap -} - -// NewGzipLevelHandler returns a wrapper function (often known as middleware) -// which can be used to wrap an HTTP handler to transparently gzip the response -// body if the client supports it (via the Accept-Encoding header). Responses will -// be encoded at the given gzip compression level. An error will be returned only -// if an invalid gzip compression level is given, so if one can ensure the level -// is valid, the returned error can be safely ignored. -func NewGzipLevelHandler(level int) (func(http.Handler) http.Handler, error) { - return NewGzipLevelAndMinSize(level, DefaultMinSize) -} - -// NewGzipLevelAndMinSize behave as NewGzipLevelHandler except it let the caller -// specify the minimum size before compression. -func NewGzipLevelAndMinSize(level, minSize int) (func(http.Handler) http.Handler, error) { - return GzipHandlerWithOpts(CompressionLevel(level), MinSize(minSize)) -} - -func GzipHandlerWithOpts(opts ...option) (func(http.Handler) http.Handler, error) { - c := &config{ - level: gzip.DefaultCompression, - minSize: DefaultMinSize, - } - - for _, o := range opts { - o(c) - } - - if err := c.validate(); err != nil { - return nil, err - } - - return func(h http.Handler) http.Handler { - index := poolIndex(c.level) - - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Add(vary, acceptEncoding) - if acceptsGzip(r) { - gw := &GzipResponseWriter{ - ResponseWriter: w, - index: index, - minSize: c.minSize, - contentTypes: c.contentTypes, - } - defer gw.Close() - - if _, ok := w.(http.CloseNotifier); ok { - gwcn := GzipResponseWriterWithCloseNotify{gw} - h.ServeHTTP(gwcn, r) - } else { - h.ServeHTTP(gw, r) - } - - } else { - h.ServeHTTP(w, r) - } - }) - }, nil -} - -// Parsed representation of one of the inputs to ContentTypes. -// See https://golang.org/pkg/mime/#ParseMediaType -type parsedContentType struct { - mediaType string - params map[string]string -} - -// equals returns whether this content type matches another content type. -func (pct parsedContentType) equals(mediaType string, params map[string]string) bool { - if pct.mediaType != mediaType { - return false - } - // if pct has no params, don't care about other's params - if len(pct.params) == 0 { - return true - } - - // if pct has any params, they must be identical to other's. - if len(pct.params) != len(params) { - return false - } - for k, v := range pct.params { - if w, ok := params[k]; !ok || v != w { - return false - } - } - return true -} - -// Used for functional configuration. -type config struct { - minSize int - level int - contentTypes []parsedContentType -} - -func (c *config) validate() error { - if c.level != gzip.DefaultCompression && (c.level < gzip.BestSpeed || c.level > gzip.BestCompression) { - return fmt.Errorf("invalid compression level requested: %d", c.level) - } - - if c.minSize < 0 { - return fmt.Errorf("minimum size must be more than zero") - } - - return nil -} - -type option func(c *config) - -func MinSize(size int) option { - return func(c *config) { - c.minSize = size - } -} - -func CompressionLevel(level int) option { - return func(c *config) { - c.level = level - } -} - -// ContentTypes specifies a list of content types to compare -// the Content-Type header to before compressing. If none -// match, the response will be returned as-is. -// -// Content types are compared in a case-insensitive, whitespace-ignored -// manner. -// -// A MIME type without any other directive will match a content type -// that has the same MIME type, regardless of that content type's other -// directives. I.e., "text/html" will match both "text/html" and -// "text/html; charset=utf-8". -// -// A MIME type with any other directive will only match a content type -// that has the same MIME type and other directives. I.e., -// "text/html; charset=utf-8" will only match "text/html; charset=utf-8". -// -// By default, responses are gzipped regardless of -// Content-Type. -func ContentTypes(types []string) option { - return func(c *config) { - c.contentTypes = []parsedContentType{} - for _, v := range types { - mediaType, params, err := mime.ParseMediaType(v) - if err == nil { - c.contentTypes = append(c.contentTypes, parsedContentType{mediaType, params}) - } - } - } -} - -// GzipHandler wraps an HTTP handler, to transparently gzip the response body if -// the client supports it (via the Accept-Encoding header). This will compress at -// the default compression level. -func GzipHandler(h http.Handler) http.Handler { - wrapper, _ := NewGzipLevelHandler(gzip.DefaultCompression) - return wrapper(h) -} - -// acceptsGzip returns true if the given HTTP request indicates that it will -// accept a gzipped response. -func acceptsGzip(r *http.Request) bool { - acceptedEncodings, _ := parseEncodings(r.Header.Get(acceptEncoding)) - return acceptedEncodings["gzip"] > 0.0 -} - -// returns true if we've been configured to compress the specific content type. -func handleContentType(contentTypes []parsedContentType, ct string) bool { - // If contentTypes is empty we handle all content types. - if len(contentTypes) == 0 { - return true - } - - mediaType, params, err := mime.ParseMediaType(ct) - if err != nil { - return false - } - - for _, c := range contentTypes { - if c.equals(mediaType, params) { - return true - } - } - - return false -} - -// parseEncodings attempts to parse a list of codings, per RFC 2616, as might -// appear in an Accept-Encoding header. It returns a map of content-codings to -// quality values, and an error containing the errors encountered. It's probably -// safe to ignore those, because silently ignoring errors is how the internet -// works. -// -// See: http://tools.ietf.org/html/rfc2616#section-14.3. -func parseEncodings(s string) (codings, error) { - c := make(codings) - var e []string - - for _, ss := range strings.Split(s, ",") { - coding, qvalue, err := parseCoding(ss) - - if err != nil { - e = append(e, err.Error()) - } else { - c[coding] = qvalue - } - } - - // TODO (adammck): Use a proper multi-error struct, so the individual errors - // can be extracted if anyone cares. - if len(e) > 0 { - return c, fmt.Errorf("errors while parsing encodings: %s", strings.Join(e, ", ")) - } - - return c, nil -} - -// parseCoding parses a single conding (content-coding with an optional qvalue), -// as might appear in an Accept-Encoding header. It attempts to forgive minor -// formatting errors. -func parseCoding(s string) (coding string, qvalue float64, err error) { - for n, part := range strings.Split(s, ";") { - part = strings.TrimSpace(part) - qvalue = DefaultQValue - - if n == 0 { - coding = strings.ToLower(part) - } else if strings.HasPrefix(part, "q=") { - qvalue, err = strconv.ParseFloat(strings.TrimPrefix(part, "q="), 64) - - if qvalue < 0.0 { - qvalue = 0.0 - } else if qvalue > 1.0 { - qvalue = 1.0 - } - } - } - - if coding == "" { - err = fmt.Errorf("empty content-coding") - } - - return -} diff --git a/e2e/vendor/github.com/NYTimes/gziphandler/gzip_go18.go b/e2e/vendor/github.com/NYTimes/gziphandler/gzip_go18.go deleted file mode 100644 index fa9665b7e..000000000 --- a/e2e/vendor/github.com/NYTimes/gziphandler/gzip_go18.go +++ /dev/null @@ -1,43 +0,0 @@ -// +build go1.8 - -package gziphandler - -import "net/http" - -// Push initiates an HTTP/2 server push. -// Push returns ErrNotSupported if the client has disabled push or if push -// is not supported on the underlying connection. -func (w *GzipResponseWriter) Push(target string, opts *http.PushOptions) error { - pusher, ok := w.ResponseWriter.(http.Pusher) - if ok && pusher != nil { - return pusher.Push(target, setAcceptEncodingForPushOptions(opts)) - } - return http.ErrNotSupported -} - -// setAcceptEncodingForPushOptions sets "Accept-Encoding" : "gzip" for PushOptions without overriding existing headers. -func setAcceptEncodingForPushOptions(opts *http.PushOptions) *http.PushOptions { - - if opts == nil { - opts = &http.PushOptions{ - Header: http.Header{ - acceptEncoding: []string{"gzip"}, - }, - } - return opts - } - - if opts.Header == nil { - opts.Header = http.Header{ - acceptEncoding: []string{"gzip"}, - } - return opts - } - - if encoding := opts.Header.Get(acceptEncoding); encoding == "" { - opts.Header.Add(acceptEncoding, "gzip") - return opts - } - - return opts -} diff --git a/e2e/vendor/github.com/containerd/containerd/api/services/containers/v1/containers_grpc.pb.go b/e2e/vendor/github.com/containerd/containerd/api/services/containers/v1/containers_grpc.pb.go index 701e5c1eb..93dab77d1 100644 --- a/e2e/vendor/github.com/containerd/containerd/api/services/containers/v1/containers_grpc.pb.go +++ b/e2e/vendor/github.com/containerd/containerd/api/services/containers/v1/containers_grpc.pb.go @@ -1,3 +1,5 @@ +//go:build !no_grpc + // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 diff --git a/e2e/vendor/github.com/containerd/containerd/api/services/containers/v1/containers_ttrpc.pb.go b/e2e/vendor/github.com/containerd/containerd/api/services/containers/v1/containers_ttrpc.pb.go new file mode 100644 index 000000000..8090011df --- /dev/null +++ b/e2e/vendor/github.com/containerd/containerd/api/services/containers/v1/containers_ttrpc.pb.go @@ -0,0 +1,174 @@ +// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. +// source: github.com/containerd/containerd/api/services/containers/v1/containers.proto +package containers + +import ( + context "context" + ttrpc "github.com/containerd/ttrpc" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +type TTRPCContainersService interface { + Get(context.Context, *GetContainerRequest) (*GetContainerResponse, error) + List(context.Context, *ListContainersRequest) (*ListContainersResponse, error) + ListStream(context.Context, *ListContainersRequest, TTRPCContainers_ListStreamServer) error + Create(context.Context, *CreateContainerRequest) (*CreateContainerResponse, error) + Update(context.Context, *UpdateContainerRequest) (*UpdateContainerResponse, error) + Delete(context.Context, *DeleteContainerRequest) (*emptypb.Empty, error) +} + +type TTRPCContainers_ListStreamServer interface { + Send(*ListContainerMessage) error + ttrpc.StreamServer +} + +type ttrpccontainersListStreamServer struct { + ttrpc.StreamServer +} + +func (x *ttrpccontainersListStreamServer) Send(m *ListContainerMessage) error { + return x.StreamServer.SendMsg(m) +} + +func RegisterTTRPCContainersService(srv *ttrpc.Server, svc TTRPCContainersService) { + srv.RegisterService("containerd.services.containers.v1.Containers", &ttrpc.ServiceDesc{ + Methods: map[string]ttrpc.Method{ + "Get": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req GetContainerRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Get(ctx, &req) + }, + "List": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req ListContainersRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.List(ctx, &req) + }, + "Create": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req CreateContainerRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Create(ctx, &req) + }, + "Update": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req UpdateContainerRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Update(ctx, &req) + }, + "Delete": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req DeleteContainerRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Delete(ctx, &req) + }, + }, + Streams: map[string]ttrpc.Stream{ + "ListStream": { + Handler: func(ctx context.Context, stream ttrpc.StreamServer) (interface{}, error) { + m := new(ListContainersRequest) + if err := stream.RecvMsg(m); err != nil { + return nil, err + } + return nil, svc.ListStream(ctx, m, &ttrpccontainersListStreamServer{stream}) + }, + StreamingClient: false, + StreamingServer: true, + }, + }, + }) +} + +type TTRPCContainersClient interface { + Get(context.Context, *GetContainerRequest) (*GetContainerResponse, error) + List(context.Context, *ListContainersRequest) (*ListContainersResponse, error) + ListStream(context.Context, *ListContainersRequest) (TTRPCContainers_ListStreamClient, error) + Create(context.Context, *CreateContainerRequest) (*CreateContainerResponse, error) + Update(context.Context, *UpdateContainerRequest) (*UpdateContainerResponse, error) + Delete(context.Context, *DeleteContainerRequest) (*emptypb.Empty, error) +} + +type ttrpccontainersClient struct { + client *ttrpc.Client +} + +func NewTTRPCContainersClient(client *ttrpc.Client) TTRPCContainersClient { + return &ttrpccontainersClient{ + client: client, + } +} + +func (c *ttrpccontainersClient) Get(ctx context.Context, req *GetContainerRequest) (*GetContainerResponse, error) { + var resp GetContainerResponse + if err := c.client.Call(ctx, "containerd.services.containers.v1.Containers", "Get", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpccontainersClient) List(ctx context.Context, req *ListContainersRequest) (*ListContainersResponse, error) { + var resp ListContainersResponse + if err := c.client.Call(ctx, "containerd.services.containers.v1.Containers", "List", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpccontainersClient) ListStream(ctx context.Context, req *ListContainersRequest) (TTRPCContainers_ListStreamClient, error) { + stream, err := c.client.NewStream(ctx, &ttrpc.StreamDesc{ + StreamingClient: false, + StreamingServer: true, + }, "containerd.services.containers.v1.Containers", "ListStream", req) + if err != nil { + return nil, err + } + x := &ttrpccontainersListStreamClient{stream} + return x, nil +} + +type TTRPCContainers_ListStreamClient interface { + Recv() (*ListContainerMessage, error) + ttrpc.ClientStream +} + +type ttrpccontainersListStreamClient struct { + ttrpc.ClientStream +} + +func (x *ttrpccontainersListStreamClient) Recv() (*ListContainerMessage, error) { + m := new(ListContainerMessage) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *ttrpccontainersClient) Create(ctx context.Context, req *CreateContainerRequest) (*CreateContainerResponse, error) { + var resp CreateContainerResponse + if err := c.client.Call(ctx, "containerd.services.containers.v1.Containers", "Create", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpccontainersClient) Update(ctx context.Context, req *UpdateContainerRequest) (*UpdateContainerResponse, error) { + var resp UpdateContainerResponse + if err := c.client.Call(ctx, "containerd.services.containers.v1.Containers", "Update", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpccontainersClient) Delete(ctx context.Context, req *DeleteContainerRequest) (*emptypb.Empty, error) { + var resp emptypb.Empty + if err := c.client.Call(ctx, "containerd.services.containers.v1.Containers", "Delete", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} diff --git a/e2e/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks_grpc.pb.go b/e2e/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks_grpc.pb.go index 3fd4057e9..1bc23522a 100644 --- a/e2e/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks_grpc.pb.go +++ b/e2e/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks_grpc.pb.go @@ -1,3 +1,5 @@ +//go:build !no_grpc + // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 diff --git a/e2e/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks_ttrpc.pb.go b/e2e/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks_ttrpc.pb.go new file mode 100644 index 000000000..859eec58e --- /dev/null +++ b/e2e/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks_ttrpc.pb.go @@ -0,0 +1,301 @@ +// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. +// source: github.com/containerd/containerd/api/services/tasks/v1/tasks.proto +package tasks + +import ( + context "context" + ttrpc "github.com/containerd/ttrpc" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +type TTRPCTasksService interface { + Create(context.Context, *CreateTaskRequest) (*CreateTaskResponse, error) + Start(context.Context, *StartRequest) (*StartResponse, error) + Delete(context.Context, *DeleteTaskRequest) (*DeleteResponse, error) + DeleteProcess(context.Context, *DeleteProcessRequest) (*DeleteResponse, error) + Get(context.Context, *GetRequest) (*GetResponse, error) + List(context.Context, *ListTasksRequest) (*ListTasksResponse, error) + Kill(context.Context, *KillRequest) (*emptypb.Empty, error) + Exec(context.Context, *ExecProcessRequest) (*emptypb.Empty, error) + ResizePty(context.Context, *ResizePtyRequest) (*emptypb.Empty, error) + CloseIO(context.Context, *CloseIORequest) (*emptypb.Empty, error) + Pause(context.Context, *PauseTaskRequest) (*emptypb.Empty, error) + Resume(context.Context, *ResumeTaskRequest) (*emptypb.Empty, error) + ListPids(context.Context, *ListPidsRequest) (*ListPidsResponse, error) + Checkpoint(context.Context, *CheckpointTaskRequest) (*CheckpointTaskResponse, error) + Update(context.Context, *UpdateTaskRequest) (*emptypb.Empty, error) + Metrics(context.Context, *MetricsRequest) (*MetricsResponse, error) + Wait(context.Context, *WaitRequest) (*WaitResponse, error) +} + +func RegisterTTRPCTasksService(srv *ttrpc.Server, svc TTRPCTasksService) { + srv.RegisterService("containerd.services.tasks.v1.Tasks", &ttrpc.ServiceDesc{ + Methods: map[string]ttrpc.Method{ + "Create": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req CreateTaskRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Create(ctx, &req) + }, + "Start": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req StartRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Start(ctx, &req) + }, + "Delete": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req DeleteTaskRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Delete(ctx, &req) + }, + "DeleteProcess": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req DeleteProcessRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.DeleteProcess(ctx, &req) + }, + "Get": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req GetRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Get(ctx, &req) + }, + "List": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req ListTasksRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.List(ctx, &req) + }, + "Kill": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req KillRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Kill(ctx, &req) + }, + "Exec": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req ExecProcessRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Exec(ctx, &req) + }, + "ResizePty": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req ResizePtyRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.ResizePty(ctx, &req) + }, + "CloseIO": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req CloseIORequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.CloseIO(ctx, &req) + }, + "Pause": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req PauseTaskRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Pause(ctx, &req) + }, + "Resume": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req ResumeTaskRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Resume(ctx, &req) + }, + "ListPids": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req ListPidsRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.ListPids(ctx, &req) + }, + "Checkpoint": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req CheckpointTaskRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Checkpoint(ctx, &req) + }, + "Update": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req UpdateTaskRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Update(ctx, &req) + }, + "Metrics": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req MetricsRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Metrics(ctx, &req) + }, + "Wait": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req WaitRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Wait(ctx, &req) + }, + }, + }) +} + +type ttrpctasksClient struct { + client *ttrpc.Client +} + +func NewTTRPCTasksClient(client *ttrpc.Client) TTRPCTasksService { + return &ttrpctasksClient{ + client: client, + } +} + +func (c *ttrpctasksClient) Create(ctx context.Context, req *CreateTaskRequest) (*CreateTaskResponse, error) { + var resp CreateTaskResponse + if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Create", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpctasksClient) Start(ctx context.Context, req *StartRequest) (*StartResponse, error) { + var resp StartResponse + if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Start", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpctasksClient) Delete(ctx context.Context, req *DeleteTaskRequest) (*DeleteResponse, error) { + var resp DeleteResponse + if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Delete", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpctasksClient) DeleteProcess(ctx context.Context, req *DeleteProcessRequest) (*DeleteResponse, error) { + var resp DeleteResponse + if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "DeleteProcess", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpctasksClient) Get(ctx context.Context, req *GetRequest) (*GetResponse, error) { + var resp GetResponse + if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Get", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpctasksClient) List(ctx context.Context, req *ListTasksRequest) (*ListTasksResponse, error) { + var resp ListTasksResponse + if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "List", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpctasksClient) Kill(ctx context.Context, req *KillRequest) (*emptypb.Empty, error) { + var resp emptypb.Empty + if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Kill", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpctasksClient) Exec(ctx context.Context, req *ExecProcessRequest) (*emptypb.Empty, error) { + var resp emptypb.Empty + if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Exec", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpctasksClient) ResizePty(ctx context.Context, req *ResizePtyRequest) (*emptypb.Empty, error) { + var resp emptypb.Empty + if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "ResizePty", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpctasksClient) CloseIO(ctx context.Context, req *CloseIORequest) (*emptypb.Empty, error) { + var resp emptypb.Empty + if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "CloseIO", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpctasksClient) Pause(ctx context.Context, req *PauseTaskRequest) (*emptypb.Empty, error) { + var resp emptypb.Empty + if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Pause", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpctasksClient) Resume(ctx context.Context, req *ResumeTaskRequest) (*emptypb.Empty, error) { + var resp emptypb.Empty + if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Resume", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpctasksClient) ListPids(ctx context.Context, req *ListPidsRequest) (*ListPidsResponse, error) { + var resp ListPidsResponse + if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "ListPids", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpctasksClient) Checkpoint(ctx context.Context, req *CheckpointTaskRequest) (*CheckpointTaskResponse, error) { + var resp CheckpointTaskResponse + if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Checkpoint", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpctasksClient) Update(ctx context.Context, req *UpdateTaskRequest) (*emptypb.Empty, error) { + var resp emptypb.Empty + if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Update", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpctasksClient) Metrics(ctx context.Context, req *MetricsRequest) (*MetricsResponse, error) { + var resp MetricsResponse + if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Metrics", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *ttrpctasksClient) Wait(ctx context.Context, req *WaitRequest) (*WaitResponse, error) { + var resp WaitResponse + if err := c.client.Call(ctx, "containerd.services.tasks.v1.Tasks", "Wait", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} diff --git a/e2e/vendor/github.com/containerd/containerd/api/services/version/v1/version_grpc.pb.go b/e2e/vendor/github.com/containerd/containerd/api/services/version/v1/version_grpc.pb.go index 4070fd834..e96eddefb 100644 --- a/e2e/vendor/github.com/containerd/containerd/api/services/version/v1/version_grpc.pb.go +++ b/e2e/vendor/github.com/containerd/containerd/api/services/version/v1/version_grpc.pb.go @@ -1,3 +1,5 @@ +//go:build !no_grpc + // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 diff --git a/e2e/vendor/github.com/containerd/containerd/api/services/version/v1/version_ttrpc.pb.go b/e2e/vendor/github.com/containerd/containerd/api/services/version/v1/version_ttrpc.pb.go new file mode 100644 index 000000000..c284f14e7 --- /dev/null +++ b/e2e/vendor/github.com/containerd/containerd/api/services/version/v1/version_ttrpc.pb.go @@ -0,0 +1,45 @@ +// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. +// source: github.com/containerd/containerd/api/services/version/v1/version.proto +package version + +import ( + context "context" + ttrpc "github.com/containerd/ttrpc" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +type TTRPCVersionService interface { + Version(context.Context, *emptypb.Empty) (*VersionResponse, error) +} + +func RegisterTTRPCVersionService(srv *ttrpc.Server, svc TTRPCVersionService) { + srv.RegisterService("containerd.services.version.v1.Version", &ttrpc.ServiceDesc{ + Methods: map[string]ttrpc.Method{ + "Version": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req emptypb.Empty + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Version(ctx, &req) + }, + }, + }) +} + +type ttrpcversionClient struct { + client *ttrpc.Client +} + +func NewTTRPCVersionClient(client *ttrpc.Client) TTRPCVersionService { + return &ttrpcversionClient{ + client: client, + } +} + +func (c *ttrpcversionClient) Version(ctx context.Context, req *emptypb.Empty) (*VersionResponse, error) { + var resp VersionResponse + if err := c.client.Call(ctx, "containerd.services.version.v1.Version", "Version", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} diff --git a/e2e/vendor/github.com/containerd/containerd/api/types/event.pb.go b/e2e/vendor/github.com/containerd/containerd/api/types/event.pb.go new file mode 100644 index 000000000..6ebe1e26d --- /dev/null +++ b/e2e/vendor/github.com/containerd/containerd/api/types/event.pb.go @@ -0,0 +1,209 @@ +// +//Copyright The containerd Authors. +// +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.20.1 +// source: github.com/containerd/containerd/api/types/event.proto + +package types + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Envelope struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + Topic string `protobuf:"bytes,3,opt,name=topic,proto3" json:"topic,omitempty"` + Event *anypb.Any `protobuf:"bytes,4,opt,name=event,proto3" json:"event,omitempty"` +} + +func (x *Envelope) Reset() { + *x = Envelope{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_containerd_containerd_api_types_event_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Envelope) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Envelope) ProtoMessage() {} + +func (x *Envelope) ProtoReflect() protoreflect.Message { + mi := &file_github_com_containerd_containerd_api_types_event_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Envelope.ProtoReflect.Descriptor instead. +func (*Envelope) Descriptor() ([]byte, []int) { + return file_github_com_containerd_containerd_api_types_event_proto_rawDescGZIP(), []int{0} +} + +func (x *Envelope) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +func (x *Envelope) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *Envelope) GetTopic() string { + if x != nil { + return x.Topic + } + return "" +} + +func (x *Envelope) GetEvent() *anypb.Any { + if x != nil { + return x.Event + } + return nil +} + +var File_github_com_containerd_containerd_api_types_event_proto protoreflect.FileDescriptor + +var file_github_com_containerd_containerd_api_types_event_proto_rawDesc = []byte{ + 0x0a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x3a, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x70, 0x61, 0x74, 0x68, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0xaa, 0x01, 0x0a, 0x08, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, + 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x2a, 0x0a, + 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, + 0x6e, 0x79, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3a, 0x04, 0x80, 0xb9, 0x1f, 0x01, 0x42, + 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_github_com_containerd_containerd_api_types_event_proto_rawDescOnce sync.Once + file_github_com_containerd_containerd_api_types_event_proto_rawDescData = file_github_com_containerd_containerd_api_types_event_proto_rawDesc +) + +func file_github_com_containerd_containerd_api_types_event_proto_rawDescGZIP() []byte { + file_github_com_containerd_containerd_api_types_event_proto_rawDescOnce.Do(func() { + file_github_com_containerd_containerd_api_types_event_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_types_event_proto_rawDescData) + }) + return file_github_com_containerd_containerd_api_types_event_proto_rawDescData +} + +var file_github_com_containerd_containerd_api_types_event_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_github_com_containerd_containerd_api_types_event_proto_goTypes = []interface{}{ + (*Envelope)(nil), // 0: containerd.types.Envelope + (*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp + (*anypb.Any)(nil), // 2: google.protobuf.Any +} +var file_github_com_containerd_containerd_api_types_event_proto_depIdxs = []int32{ + 1, // 0: containerd.types.Envelope.timestamp:type_name -> google.protobuf.Timestamp + 2, // 1: containerd.types.Envelope.event:type_name -> google.protobuf.Any + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_github_com_containerd_containerd_api_types_event_proto_init() } +func file_github_com_containerd_containerd_api_types_event_proto_init() { + if File_github_com_containerd_containerd_api_types_event_proto != nil { + return + } + file_github_com_containerd_containerd_api_types_fieldpath_proto_init() + if !protoimpl.UnsafeEnabled { + file_github_com_containerd_containerd_api_types_event_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Envelope); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_github_com_containerd_containerd_api_types_event_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_github_com_containerd_containerd_api_types_event_proto_goTypes, + DependencyIndexes: file_github_com_containerd_containerd_api_types_event_proto_depIdxs, + MessageInfos: file_github_com_containerd_containerd_api_types_event_proto_msgTypes, + }.Build() + File_github_com_containerd_containerd_api_types_event_proto = out.File + file_github_com_containerd_containerd_api_types_event_proto_rawDesc = nil + file_github_com_containerd_containerd_api_types_event_proto_goTypes = nil + file_github_com_containerd_containerd_api_types_event_proto_depIdxs = nil +} diff --git a/e2e/vendor/github.com/containerd/containerd/api/types/event.proto b/e2e/vendor/github.com/containerd/containerd/api/types/event.proto new file mode 100644 index 000000000..a73bc9d45 --- /dev/null +++ b/e2e/vendor/github.com/containerd/containerd/api/types/event.proto @@ -0,0 +1,33 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +syntax = "proto3"; + +package containerd.types; + +import "github.com/containerd/containerd/api/types/fieldpath.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/containerd/containerd/api/types;types"; + +message Envelope { + option (containerd.types.fieldpath) = true; + google.protobuf.Timestamp timestamp = 1; + string namespace = 2; + string topic = 3; + google.protobuf.Any event = 4; +} diff --git a/e2e/vendor/github.com/containerd/containerd/api/types/introspection.pb.go b/e2e/vendor/github.com/containerd/containerd/api/types/introspection.pb.go new file mode 100644 index 000000000..2f9c2ac44 --- /dev/null +++ b/e2e/vendor/github.com/containerd/containerd/api/types/introspection.pb.go @@ -0,0 +1,375 @@ +// +//Copyright The containerd Authors. +// +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.20.1 +// source: github.com/containerd/containerd/api/types/introspection.proto + +package types + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type RuntimeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RuntimePath string `protobuf:"bytes,1,opt,name=runtime_path,json=runtimePath,proto3" json:"runtime_path,omitempty"` + // Options correspond to CreateTaskRequest.options. + // This is needed to pass the runc binary path, etc. + Options *anypb.Any `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` +} + +func (x *RuntimeRequest) Reset() { + *x = RuntimeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_containerd_containerd_api_types_introspection_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RuntimeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RuntimeRequest) ProtoMessage() {} + +func (x *RuntimeRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_containerd_containerd_api_types_introspection_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RuntimeRequest.ProtoReflect.Descriptor instead. +func (*RuntimeRequest) Descriptor() ([]byte, []int) { + return file_github_com_containerd_containerd_api_types_introspection_proto_rawDescGZIP(), []int{0} +} + +func (x *RuntimeRequest) GetRuntimePath() string { + if x != nil { + return x.RuntimePath + } + return "" +} + +func (x *RuntimeRequest) GetOptions() *anypb.Any { + if x != nil { + return x.Options + } + return nil +} + +type RuntimeVersion struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + Revision string `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"` +} + +func (x *RuntimeVersion) Reset() { + *x = RuntimeVersion{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_containerd_containerd_api_types_introspection_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RuntimeVersion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RuntimeVersion) ProtoMessage() {} + +func (x *RuntimeVersion) ProtoReflect() protoreflect.Message { + mi := &file_github_com_containerd_containerd_api_types_introspection_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RuntimeVersion.ProtoReflect.Descriptor instead. +func (*RuntimeVersion) Descriptor() ([]byte, []int) { + return file_github_com_containerd_containerd_api_types_introspection_proto_rawDescGZIP(), []int{1} +} + +func (x *RuntimeVersion) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *RuntimeVersion) GetRevision() string { + if x != nil { + return x.Revision + } + return "" +} + +type RuntimeInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Version *RuntimeVersion `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + // Options correspond to RuntimeInfoRequest.Options (contains runc binary path, etc.) + Options *anypb.Any `protobuf:"bytes,3,opt,name=options,proto3" json:"options,omitempty"` + // OCI-compatible runtimes should use https://github.com/opencontainers/runtime-spec/blob/main/features.md + Features *anypb.Any `protobuf:"bytes,4,opt,name=features,proto3" json:"features,omitempty"` + // Annotations of the shim. Irrelevant to features.Annotations. + Annotations map[string]string `protobuf:"bytes,5,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *RuntimeInfo) Reset() { + *x = RuntimeInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_containerd_containerd_api_types_introspection_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RuntimeInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RuntimeInfo) ProtoMessage() {} + +func (x *RuntimeInfo) ProtoReflect() protoreflect.Message { + mi := &file_github_com_containerd_containerd_api_types_introspection_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RuntimeInfo.ProtoReflect.Descriptor instead. +func (*RuntimeInfo) Descriptor() ([]byte, []int) { + return file_github_com_containerd_containerd_api_types_introspection_proto_rawDescGZIP(), []int{2} +} + +func (x *RuntimeInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *RuntimeInfo) GetVersion() *RuntimeVersion { + if x != nil { + return x.Version + } + return nil +} + +func (x *RuntimeInfo) GetOptions() *anypb.Any { + if x != nil { + return x.Options + } + return nil +} + +func (x *RuntimeInfo) GetFeatures() *anypb.Any { + if x != nil { + return x.Features + } + return nil +} + +func (x *RuntimeInfo) GetAnnotations() map[string]string { + if x != nil { + return x.Annotations + } + return nil +} + +var File_github_com_containerd_containerd_api_types_introspection_proto protoreflect.FileDescriptor + +var file_github_com_containerd_containerd_api_types_introspection_proto_rawDesc = []byte{ + 0x0a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x69, 0x6e, 0x74, + 0x72, 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x63, 0x0a, + 0x0e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x21, 0x0a, 0x0c, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x50, 0x61, + 0x74, 0x68, 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x22, 0x46, 0x0a, 0x0e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, + 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xd1, 0x02, 0x0a, 0x0b, 0x52, + 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3a, + 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x20, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, + 0x79, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x08, 0x66, 0x65, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, + 0x6e, 0x79, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x50, 0x0a, 0x0b, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x3e, + 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x32, + 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_github_com_containerd_containerd_api_types_introspection_proto_rawDescOnce sync.Once + file_github_com_containerd_containerd_api_types_introspection_proto_rawDescData = file_github_com_containerd_containerd_api_types_introspection_proto_rawDesc +) + +func file_github_com_containerd_containerd_api_types_introspection_proto_rawDescGZIP() []byte { + file_github_com_containerd_containerd_api_types_introspection_proto_rawDescOnce.Do(func() { + file_github_com_containerd_containerd_api_types_introspection_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_types_introspection_proto_rawDescData) + }) + return file_github_com_containerd_containerd_api_types_introspection_proto_rawDescData +} + +var file_github_com_containerd_containerd_api_types_introspection_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_github_com_containerd_containerd_api_types_introspection_proto_goTypes = []interface{}{ + (*RuntimeRequest)(nil), // 0: containerd.types.RuntimeRequest + (*RuntimeVersion)(nil), // 1: containerd.types.RuntimeVersion + (*RuntimeInfo)(nil), // 2: containerd.types.RuntimeInfo + nil, // 3: containerd.types.RuntimeInfo.AnnotationsEntry + (*anypb.Any)(nil), // 4: google.protobuf.Any +} +var file_github_com_containerd_containerd_api_types_introspection_proto_depIdxs = []int32{ + 4, // 0: containerd.types.RuntimeRequest.options:type_name -> google.protobuf.Any + 1, // 1: containerd.types.RuntimeInfo.version:type_name -> containerd.types.RuntimeVersion + 4, // 2: containerd.types.RuntimeInfo.options:type_name -> google.protobuf.Any + 4, // 3: containerd.types.RuntimeInfo.features:type_name -> google.protobuf.Any + 3, // 4: containerd.types.RuntimeInfo.annotations:type_name -> containerd.types.RuntimeInfo.AnnotationsEntry + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_github_com_containerd_containerd_api_types_introspection_proto_init() } +func file_github_com_containerd_containerd_api_types_introspection_proto_init() { + if File_github_com_containerd_containerd_api_types_introspection_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_github_com_containerd_containerd_api_types_introspection_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RuntimeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_containerd_containerd_api_types_introspection_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RuntimeVersion); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_containerd_containerd_api_types_introspection_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RuntimeInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_github_com_containerd_containerd_api_types_introspection_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_github_com_containerd_containerd_api_types_introspection_proto_goTypes, + DependencyIndexes: file_github_com_containerd_containerd_api_types_introspection_proto_depIdxs, + MessageInfos: file_github_com_containerd_containerd_api_types_introspection_proto_msgTypes, + }.Build() + File_github_com_containerd_containerd_api_types_introspection_proto = out.File + file_github_com_containerd_containerd_api_types_introspection_proto_rawDesc = nil + file_github_com_containerd_containerd_api_types_introspection_proto_goTypes = nil + file_github_com_containerd_containerd_api_types_introspection_proto_depIdxs = nil +} diff --git a/e2e/vendor/github.com/containerd/containerd/api/types/introspection.proto b/e2e/vendor/github.com/containerd/containerd/api/types/introspection.proto new file mode 100644 index 000000000..8f3fcb5a4 --- /dev/null +++ b/e2e/vendor/github.com/containerd/containerd/api/types/introspection.proto @@ -0,0 +1,46 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +syntax = "proto3"; + +package containerd.types; + +import "google/protobuf/any.proto"; + +option go_package = "github.com/containerd/containerd/api/types;types"; + +message RuntimeRequest { + string runtime_path = 1; + // Options correspond to CreateTaskRequest.options. + // This is needed to pass the runc binary path, etc. + google.protobuf.Any options = 2; +} + +message RuntimeVersion { + string version = 1; + string revision = 2; +} + +message RuntimeInfo { + string name = 1; + RuntimeVersion version = 2; + // Options correspond to RuntimeInfoRequest.Options (contains runc binary path, etc.) + google.protobuf.Any options = 3; + // OCI-compatible runtimes should use https://github.com/opencontainers/runtime-spec/blob/main/features.md + google.protobuf.Any features = 4; + // Annotations of the shim. Irrelevant to features.Annotations. + map annotations = 5; +} diff --git a/e2e/vendor/github.com/containerd/containerd/api/types/platform.pb.go b/e2e/vendor/github.com/containerd/containerd/api/types/platform.pb.go index 3e206cbaf..daa62b834 100644 --- a/e2e/vendor/github.com/containerd/containerd/api/types/platform.pb.go +++ b/e2e/vendor/github.com/containerd/containerd/api/types/platform.pb.go @@ -45,6 +45,7 @@ type Platform struct { OS string `protobuf:"bytes,1,opt,name=os,proto3" json:"os,omitempty"` Architecture string `protobuf:"bytes,2,opt,name=architecture,proto3" json:"architecture,omitempty"` Variant string `protobuf:"bytes,3,opt,name=variant,proto3" json:"variant,omitempty"` + OSVersion string `protobuf:"bytes,4,opt,name=os_version,json=osVersion,proto3" json:"os_version,omitempty"` } func (x *Platform) Reset() { @@ -100,6 +101,13 @@ func (x *Platform) GetVariant() string { return "" } +func (x *Platform) GetOsVersion() string { + if x != nil { + return x.OSVersion + } + return "" +} + var File_github_com_containerd_containerd_api_types_platform_proto protoreflect.FileDescriptor var file_github_com_containerd_containerd_api_types_platform_proto_rawDesc = []byte{ @@ -107,17 +115,19 @@ var file_github_com_containerd_containerd_api_types_platform_proto_rawDesc = []b 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x22, 0x58, 0x0a, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x22, 0x77, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x6f, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x73, 0x5f, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x73, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/e2e/vendor/github.com/containerd/containerd/api/types/platform.proto b/e2e/vendor/github.com/containerd/containerd/api/types/platform.proto index b6088251f..0b9180016 100644 --- a/e2e/vendor/github.com/containerd/containerd/api/types/platform.proto +++ b/e2e/vendor/github.com/containerd/containerd/api/types/platform.proto @@ -26,4 +26,5 @@ message Platform { string os = 1; string architecture = 2; string variant = 3; + string os_version = 4; } diff --git a/e2e/vendor/github.com/containerd/containerd/api/types/platform_helpers.go b/e2e/vendor/github.com/containerd/containerd/api/types/platform_helpers.go new file mode 100644 index 000000000..d8c1a6877 --- /dev/null +++ b/e2e/vendor/github.com/containerd/containerd/api/types/platform_helpers.go @@ -0,0 +1,49 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package types + +import oci "github.com/opencontainers/image-spec/specs-go/v1" + +// OCIPlatformToProto converts from a slice of OCI [specs.Platform] to a +// slice of the protobuf definition [Platform]. +func OCIPlatformToProto(platforms []oci.Platform) []*Platform { + ap := make([]*Platform, len(platforms)) + for i := range platforms { + ap[i] = &Platform{ + OS: platforms[i].OS, + OSVersion: platforms[i].OSVersion, + Architecture: platforms[i].Architecture, + Variant: platforms[i].Variant, + } + } + return ap +} + +// OCIPlatformFromProto converts a slice of the protobuf definition [Platform] +// to a slice of OCI [specs.Platform]. +func OCIPlatformFromProto(platforms []*Platform) []oci.Platform { + op := make([]oci.Platform, len(platforms)) + for i := range platforms { + op[i] = oci.Platform{ + OS: platforms[i].OS, + OSVersion: platforms[i].OSVersion, + Architecture: platforms[i].Architecture, + Variant: platforms[i].Variant, + } + } + return op +} diff --git a/e2e/vendor/github.com/containerd/containerd/api/types/sandbox.pb.go b/e2e/vendor/github.com/containerd/containerd/api/types/sandbox.pb.go index 67594f416..77888bf33 100644 --- a/e2e/vendor/github.com/containerd/containerd/api/types/sandbox.pb.go +++ b/e2e/vendor/github.com/containerd/containerd/api/types/sandbox.pb.go @@ -59,6 +59,8 @@ type Sandbox struct { UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // Extensions allow clients to provide optional blobs that can be handled by runtime. Extensions map[string]*anypb.Any `protobuf:"bytes,7,rep,name=extensions,proto3" json:"extensions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Sandboxer is the name of the sandbox controller who manages the sandbox. + Sandboxer string `protobuf:"bytes,10,opt,name=sandboxer,proto3" json:"sandboxer,omitempty"` } func (x *Sandbox) Reset() { @@ -142,6 +144,13 @@ func (x *Sandbox) GetExtensions() map[string]*anypb.Any { return nil } +func (x *Sandbox) GetSandboxer() string { + if x != nil { + return x.Sandboxer + } + return "" +} + type Sandbox_Runtime struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -211,7 +220,7 @@ var file_github_com_containerd_containerd_api_types_sandbox_proto_rawDesc = []by 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xee, 0x04, 0x0a, 0x07, 0x53, 0x61, 0x6e, + 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8c, 0x05, 0x0a, 0x07, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x07, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, @@ -236,25 +245,27 @@ var file_github_com_containerd_containerd_api_types_sandbox_proto_rawDesc = []by 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, - 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x4d, 0x0a, 0x07, 0x52, 0x75, - 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, - 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x53, 0x0a, 0x0f, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x61, + 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, + 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x65, 0x72, 0x1a, 0x4d, 0x0a, 0x07, 0x52, 0x75, 0x6e, 0x74, + 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x1a, 0x53, 0x0a, 0x0f, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, + 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/e2e/vendor/github.com/containerd/containerd/api/types/sandbox.proto b/e2e/vendor/github.com/containerd/containerd/api/types/sandbox.proto index b60770619..b0bf233b9 100644 --- a/e2e/vendor/github.com/containerd/containerd/api/types/sandbox.proto +++ b/e2e/vendor/github.com/containerd/containerd/api/types/sandbox.proto @@ -41,11 +41,14 @@ message Sandbox { // bundle directory (similary to OCI spec). google.protobuf.Any spec = 3; // Labels provides an area to include arbitrary data on containers. - map labels = 4; + map labels = 4; // CreatedAt is the time the container was first created. google.protobuf.Timestamp created_at = 5; // UpdatedAt is the last time the container was mutated. google.protobuf.Timestamp updated_at = 6; // Extensions allow clients to provide optional blobs that can be handled by runtime. map extensions = 7; + // Sandboxer is the name of the sandbox controller who manages the sandbox. + string sandboxer = 10; + } diff --git a/e2e/vendor/github.com/containerd/errdefs/errors.go b/e2e/vendor/github.com/containerd/errdefs/errors.go index 876225597..f654d1964 100644 --- a/e2e/vendor/github.com/containerd/errdefs/errors.go +++ b/e2e/vendor/github.com/containerd/errdefs/errors.go @@ -21,9 +21,6 @@ // // To detect an error class, use the IsXXX functions to tell whether an error // is of a certain type. -// -// The functions ToGRPC and FromGRPC can be used to map server-side and -// client-side errors to the correct types. package errdefs import ( @@ -36,57 +33,411 @@ import ( // Packages should return errors of these types when they want to instruct a // client to take a particular action. // -// For the most part, we just try to provide local grpc errors. Most conditions -// map very well to those defined by grpc. +// These errors map closely to grpc errors. var ( - ErrUnknown = errors.New("unknown") // used internally to represent a missed mapping. - ErrInvalidArgument = errors.New("invalid argument") - ErrNotFound = errors.New("not found") - ErrAlreadyExists = errors.New("already exists") - ErrFailedPrecondition = errors.New("failed precondition") - ErrUnavailable = errors.New("unavailable") - ErrNotImplemented = errors.New("not implemented") // represents not supported and unimplemented + ErrUnknown = errUnknown{} + ErrInvalidArgument = errInvalidArgument{} + ErrNotFound = errNotFound{} + ErrAlreadyExists = errAlreadyExists{} + ErrPermissionDenied = errPermissionDenied{} + ErrResourceExhausted = errResourceExhausted{} + ErrFailedPrecondition = errFailedPrecondition{} + ErrConflict = errConflict{} + ErrNotModified = errNotModified{} + ErrAborted = errAborted{} + ErrOutOfRange = errOutOfRange{} + ErrNotImplemented = errNotImplemented{} + ErrInternal = errInternal{} + ErrUnavailable = errUnavailable{} + ErrDataLoss = errDataLoss{} + ErrUnauthenticated = errUnauthorized{} ) -// IsInvalidArgument returns true if the error is due to an invalid argument -func IsInvalidArgument(err error) bool { - return errors.Is(err, ErrInvalidArgument) -} - -// IsNotFound returns true if the error is due to a missing object -func IsNotFound(err error) bool { - return errors.Is(err, ErrNotFound) -} - -// IsAlreadyExists returns true if the error is due to an already existing -// metadata item -func IsAlreadyExists(err error) bool { - return errors.Is(err, ErrAlreadyExists) -} - -// IsFailedPrecondition returns true if an operation could not proceed to the -// lack of a particular condition -func IsFailedPrecondition(err error) bool { - return errors.Is(err, ErrFailedPrecondition) -} - -// IsUnavailable returns true if the error is due to a resource being unavailable -func IsUnavailable(err error) bool { - return errors.Is(err, ErrUnavailable) -} - -// IsNotImplemented returns true if the error is due to not being implemented -func IsNotImplemented(err error) bool { - return errors.Is(err, ErrNotImplemented) +// cancelled maps to Moby's "ErrCancelled" +type cancelled interface { + Cancelled() } // IsCanceled returns true if the error is due to `context.Canceled`. func IsCanceled(err error) bool { - return errors.Is(err, context.Canceled) + return errors.Is(err, context.Canceled) || isInterface[cancelled](err) +} + +type errUnknown struct{} + +func (errUnknown) Error() string { return "unknown" } + +func (errUnknown) Unknown() {} + +func (e errUnknown) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// unknown maps to Moby's "ErrUnknown" +type unknown interface { + Unknown() +} + +// IsUnknown returns true if the error is due to an unknown error, +// unhandled condition or unexpected response. +func IsUnknown(err error) bool { + return errors.Is(err, errUnknown{}) || isInterface[unknown](err) +} + +type errInvalidArgument struct{} + +func (errInvalidArgument) Error() string { return "invalid argument" } + +func (errInvalidArgument) InvalidParameter() {} + +func (e errInvalidArgument) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// invalidParameter maps to Moby's "ErrInvalidParameter" +type invalidParameter interface { + InvalidParameter() +} + +// IsInvalidArgument returns true if the error is due to an invalid argument +func IsInvalidArgument(err error) bool { + return errors.Is(err, ErrInvalidArgument) || isInterface[invalidParameter](err) +} + +// deadlineExceed maps to Moby's "ErrDeadline" +type deadlineExceeded interface { + DeadlineExceeded() } // IsDeadlineExceeded returns true if the error is due to // `context.DeadlineExceeded`. func IsDeadlineExceeded(err error) bool { - return errors.Is(err, context.DeadlineExceeded) + return errors.Is(err, context.DeadlineExceeded) || isInterface[deadlineExceeded](err) +} + +type errNotFound struct{} + +func (errNotFound) Error() string { return "not found" } + +func (errNotFound) NotFound() {} + +func (e errNotFound) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// notFound maps to Moby's "ErrNotFound" +type notFound interface { + NotFound() +} + +// IsNotFound returns true if the error is due to a missing object +func IsNotFound(err error) bool { + return errors.Is(err, ErrNotFound) || isInterface[notFound](err) +} + +type errAlreadyExists struct{} + +func (errAlreadyExists) Error() string { return "already exists" } + +func (errAlreadyExists) AlreadyExists() {} + +func (e errAlreadyExists) WithMessage(msg string) error { + return customMessage{e, msg} +} + +type alreadyExists interface { + AlreadyExists() +} + +// IsAlreadyExists returns true if the error is due to an already existing +// metadata item +func IsAlreadyExists(err error) bool { + return errors.Is(err, ErrAlreadyExists) || isInterface[alreadyExists](err) +} + +type errPermissionDenied struct{} + +func (errPermissionDenied) Error() string { return "permission denied" } + +func (errPermissionDenied) Forbidden() {} + +func (e errPermissionDenied) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// forbidden maps to Moby's "ErrForbidden" +type forbidden interface { + Forbidden() +} + +// IsPermissionDenied returns true if the error is due to permission denied +// or forbidden (403) response +func IsPermissionDenied(err error) bool { + return errors.Is(err, ErrPermissionDenied) || isInterface[forbidden](err) +} + +type errResourceExhausted struct{} + +func (errResourceExhausted) Error() string { return "resource exhausted" } + +func (errResourceExhausted) ResourceExhausted() {} + +func (e errResourceExhausted) WithMessage(msg string) error { + return customMessage{e, msg} +} + +type resourceExhausted interface { + ResourceExhausted() +} + +// IsResourceExhausted returns true if the error is due to +// a lack of resources or too many attempts. +func IsResourceExhausted(err error) bool { + return errors.Is(err, errResourceExhausted{}) || isInterface[resourceExhausted](err) +} + +type errFailedPrecondition struct{} + +func (e errFailedPrecondition) Error() string { return "failed precondition" } + +func (errFailedPrecondition) FailedPrecondition() {} + +func (e errFailedPrecondition) WithMessage(msg string) error { + return customMessage{e, msg} +} + +type failedPrecondition interface { + FailedPrecondition() +} + +// IsFailedPrecondition returns true if an operation could not proceed due to +// the lack of a particular condition +func IsFailedPrecondition(err error) bool { + return errors.Is(err, errFailedPrecondition{}) || isInterface[failedPrecondition](err) +} + +type errConflict struct{} + +func (errConflict) Error() string { return "conflict" } + +func (errConflict) Conflict() {} + +func (e errConflict) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// conflict maps to Moby's "ErrConflict" +type conflict interface { + Conflict() +} + +// IsConflict returns true if an operation could not proceed due to +// a conflict. +func IsConflict(err error) bool { + return errors.Is(err, errConflict{}) || isInterface[conflict](err) +} + +type errNotModified struct{} + +func (errNotModified) Error() string { return "not modified" } + +func (errNotModified) NotModified() {} + +func (e errNotModified) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// notModified maps to Moby's "ErrNotModified" +type notModified interface { + NotModified() +} + +// IsNotModified returns true if an operation could not proceed due +// to an object not modified from a previous state. +func IsNotModified(err error) bool { + return errors.Is(err, errNotModified{}) || isInterface[notModified](err) +} + +type errAborted struct{} + +func (errAborted) Error() string { return "aborted" } + +func (errAborted) Aborted() {} + +func (e errAborted) WithMessage(msg string) error { + return customMessage{e, msg} +} + +type aborted interface { + Aborted() +} + +// IsAborted returns true if an operation was aborted. +func IsAborted(err error) bool { + return errors.Is(err, errAborted{}) || isInterface[aborted](err) +} + +type errOutOfRange struct{} + +func (errOutOfRange) Error() string { return "out of range" } + +func (errOutOfRange) OutOfRange() {} + +func (e errOutOfRange) WithMessage(msg string) error { + return customMessage{e, msg} +} + +type outOfRange interface { + OutOfRange() +} + +// IsOutOfRange returns true if an operation could not proceed due +// to data being out of the expected range. +func IsOutOfRange(err error) bool { + return errors.Is(err, errOutOfRange{}) || isInterface[outOfRange](err) +} + +type errNotImplemented struct{} + +func (errNotImplemented) Error() string { return "not implemented" } + +func (errNotImplemented) NotImplemented() {} + +func (e errNotImplemented) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// notImplemented maps to Moby's "ErrNotImplemented" +type notImplemented interface { + NotImplemented() +} + +// IsNotImplemented returns true if the error is due to not being implemented +func IsNotImplemented(err error) bool { + return errors.Is(err, errNotImplemented{}) || isInterface[notImplemented](err) +} + +type errInternal struct{} + +func (errInternal) Error() string { return "internal" } + +func (errInternal) System() {} + +func (e errInternal) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// system maps to Moby's "ErrSystem" +type system interface { + System() +} + +// IsInternal returns true if the error returns to an internal or system error +func IsInternal(err error) bool { + return errors.Is(err, errInternal{}) || isInterface[system](err) +} + +type errUnavailable struct{} + +func (errUnavailable) Error() string { return "unavailable" } + +func (errUnavailable) Unavailable() {} + +func (e errUnavailable) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// unavailable maps to Moby's "ErrUnavailable" +type unavailable interface { + Unavailable() +} + +// IsUnavailable returns true if the error is due to a resource being unavailable +func IsUnavailable(err error) bool { + return errors.Is(err, errUnavailable{}) || isInterface[unavailable](err) +} + +type errDataLoss struct{} + +func (errDataLoss) Error() string { return "data loss" } + +func (errDataLoss) DataLoss() {} + +func (e errDataLoss) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// dataLoss maps to Moby's "ErrDataLoss" +type dataLoss interface { + DataLoss() +} + +// IsDataLoss returns true if data during an operation was lost or corrupted +func IsDataLoss(err error) bool { + return errors.Is(err, errDataLoss{}) || isInterface[dataLoss](err) +} + +type errUnauthorized struct{} + +func (errUnauthorized) Error() string { return "unauthorized" } + +func (errUnauthorized) Unauthorized() {} + +func (e errUnauthorized) WithMessage(msg string) error { + return customMessage{e, msg} +} + +// unauthorized maps to Moby's "ErrUnauthorized" +type unauthorized interface { + Unauthorized() +} + +// IsUnauthorized returns true if the error indicates that the user was +// unauthenticated or unauthorized. +func IsUnauthorized(err error) bool { + return errors.Is(err, errUnauthorized{}) || isInterface[unauthorized](err) +} + +func isInterface[T any](err error) bool { + for { + switch x := err.(type) { + case T: + return true + case customMessage: + err = x.err + case interface{ Unwrap() error }: + err = x.Unwrap() + if err == nil { + return false + } + case interface{ Unwrap() []error }: + for _, err := range x.Unwrap() { + if isInterface[T](err) { + return true + } + } + return false + default: + return false + } + } +} + +// customMessage is used to provide a defined error with a custom message. +// The message is not wrapped but can be compared by the `Is(error) bool` interface. +type customMessage struct { + err error + msg string +} + +func (c customMessage) Is(err error) bool { + return c.err == err +} + +func (c customMessage) As(target any) bool { + return errors.As(c.err, target) +} + +func (c customMessage) Error() string { + return c.msg } diff --git a/e2e/vendor/github.com/containerd/errdefs/grpc.go b/e2e/vendor/github.com/containerd/errdefs/grpc.go deleted file mode 100644 index 7a9b33e05..000000000 --- a/e2e/vendor/github.com/containerd/errdefs/grpc.go +++ /dev/null @@ -1,147 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package errdefs - -import ( - "context" - "fmt" - "strings" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -// ToGRPC will attempt to map the backend containerd error into a grpc error, -// using the original error message as a description. -// -// Further information may be extracted from certain errors depending on their -// type. -// -// If the error is unmapped, the original error will be returned to be handled -// by the regular grpc error handling stack. -func ToGRPC(err error) error { - if err == nil { - return nil - } - - if isGRPCError(err) { - // error has already been mapped to grpc - return err - } - - switch { - case IsInvalidArgument(err): - return status.Errorf(codes.InvalidArgument, err.Error()) - case IsNotFound(err): - return status.Errorf(codes.NotFound, err.Error()) - case IsAlreadyExists(err): - return status.Errorf(codes.AlreadyExists, err.Error()) - case IsFailedPrecondition(err): - return status.Errorf(codes.FailedPrecondition, err.Error()) - case IsUnavailable(err): - return status.Errorf(codes.Unavailable, err.Error()) - case IsNotImplemented(err): - return status.Errorf(codes.Unimplemented, err.Error()) - case IsCanceled(err): - return status.Errorf(codes.Canceled, err.Error()) - case IsDeadlineExceeded(err): - return status.Errorf(codes.DeadlineExceeded, err.Error()) - } - - return err -} - -// ToGRPCf maps the error to grpc error codes, assembling the formatting string -// and combining it with the target error string. -// -// This is equivalent to errdefs.ToGRPC(fmt.Errorf("%s: %w", fmt.Sprintf(format, args...), err)) -func ToGRPCf(err error, format string, args ...interface{}) error { - return ToGRPC(fmt.Errorf("%s: %w", fmt.Sprintf(format, args...), err)) -} - -// FromGRPC returns the underlying error from a grpc service based on the grpc error code -func FromGRPC(err error) error { - if err == nil { - return nil - } - - var cls error // divide these into error classes, becomes the cause - - switch code(err) { - case codes.InvalidArgument: - cls = ErrInvalidArgument - case codes.AlreadyExists: - cls = ErrAlreadyExists - case codes.NotFound: - cls = ErrNotFound - case codes.Unavailable: - cls = ErrUnavailable - case codes.FailedPrecondition: - cls = ErrFailedPrecondition - case codes.Unimplemented: - cls = ErrNotImplemented - case codes.Canceled: - cls = context.Canceled - case codes.DeadlineExceeded: - cls = context.DeadlineExceeded - default: - cls = ErrUnknown - } - - msg := rebaseMessage(cls, err) - if msg != "" { - err = fmt.Errorf("%s: %w", msg, cls) - } else { - err = cls - } - - return err -} - -// rebaseMessage removes the repeats for an error at the end of an error -// string. This will happen when taking an error over grpc then remapping it. -// -// Effectively, we just remove the string of cls from the end of err if it -// appears there. -func rebaseMessage(cls error, err error) string { - desc := errDesc(err) - clss := cls.Error() - if desc == clss { - return "" - } - - return strings.TrimSuffix(desc, ": "+clss) -} - -func isGRPCError(err error) bool { - _, ok := status.FromError(err) - return ok -} - -func code(err error) codes.Code { - if s, ok := status.FromError(err); ok { - return s.Code() - } - return codes.Unknown -} - -func errDesc(err error) string { - if s, ok := status.FromError(err); ok { - return s.Message() - } - return err.Error() -} diff --git a/e2e/vendor/go.etcd.io/etcd/api/v3/LICENSE b/e2e/vendor/github.com/containerd/errdefs/pkg/LICENSE similarity index 93% rename from e2e/vendor/go.etcd.io/etcd/api/v3/LICENSE rename to e2e/vendor/github.com/containerd/errdefs/pkg/LICENSE index d64569567..584149b6e 100644 --- a/e2e/vendor/go.etcd.io/etcd/api/v3/LICENSE +++ b/e2e/vendor/github.com/containerd/errdefs/pkg/LICENSE @@ -1,7 +1,7 @@ Apache License Version 2.0, January 2004 - http://www.apache.org/licenses/ + https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -176,24 +176,13 @@ END OF TERMS AND CONDITIONS - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] + Copyright The containerd Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/e2e/vendor/github.com/containerd/errdefs/pkg/errgrpc/grpc.go b/e2e/vendor/github.com/containerd/errdefs/pkg/errgrpc/grpc.go new file mode 100644 index 000000000..59577595a --- /dev/null +++ b/e2e/vendor/github.com/containerd/errdefs/pkg/errgrpc/grpc.go @@ -0,0 +1,353 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// Package errgrpc provides utility functions for translating errors to +// and from a gRPC context. +// +// The functions ToGRPC and ToNative can be used to map server-side and +// client-side errors to the correct types. +package errgrpc + +import ( + "context" + "errors" + "fmt" + "reflect" + "strconv" + "strings" + + spb "google.golang.org/genproto/googleapis/rpc/status" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/protoadapt" + "google.golang.org/protobuf/types/known/anypb" + + "github.com/containerd/typeurl/v2" + + "github.com/containerd/errdefs" + "github.com/containerd/errdefs/pkg/internal/cause" + "github.com/containerd/errdefs/pkg/internal/types" +) + +// ToGRPC will attempt to map the error into a grpc error, from the error types +// defined in the the errdefs package and attempign to preserve the original +// description. Any type which does not resolve to a defined error type will +// be assigned the unknown error code. +// +// Further information may be extracted from certain errors depending on their +// type. The grpc error details will be used to attempt to preserve as much of +// the error structures and types as possible. +// +// Errors which can be marshaled using protobuf or typeurl will be considered +// for including as GRPC error details. +// Additionally, use the following interfaces in errors to preserve custom types: +// +// WrapError(error) error - Used to wrap the previous error +// JoinErrors(...error) error - Used to join all previous errors +// CollapseError() - Used for errors which carry information but +// should not have their error message shown. +func ToGRPC(err error) error { + if err == nil { + return nil + } + + if _, ok := status.FromError(err); ok { + // error has already been mapped to grpc + return err + } + st := statusFromError(err) + if st != nil { + if details := errorDetails(err, false); len(details) > 0 { + if ds, _ := st.WithDetails(details...); ds != nil { + st = ds + } + } + err = st.Err() + } + return err +} + +func statusFromError(err error) *status.Status { + switch errdefs.Resolve(err) { + case errdefs.ErrInvalidArgument: + return status.New(codes.InvalidArgument, err.Error()) + case errdefs.ErrNotFound: + return status.New(codes.NotFound, err.Error()) + case errdefs.ErrAlreadyExists: + return status.New(codes.AlreadyExists, err.Error()) + case errdefs.ErrPermissionDenied: + return status.New(codes.PermissionDenied, err.Error()) + case errdefs.ErrResourceExhausted: + return status.New(codes.ResourceExhausted, err.Error()) + case errdefs.ErrFailedPrecondition, errdefs.ErrConflict, errdefs.ErrNotModified: + return status.New(codes.FailedPrecondition, err.Error()) + case errdefs.ErrAborted: + return status.New(codes.Aborted, err.Error()) + case errdefs.ErrOutOfRange: + return status.New(codes.OutOfRange, err.Error()) + case errdefs.ErrNotImplemented: + return status.New(codes.Unimplemented, err.Error()) + case errdefs.ErrInternal: + return status.New(codes.Internal, err.Error()) + case errdefs.ErrUnavailable: + return status.New(codes.Unavailable, err.Error()) + case errdefs.ErrDataLoss: + return status.New(codes.DataLoss, err.Error()) + case errdefs.ErrUnauthenticated: + return status.New(codes.Unauthenticated, err.Error()) + case context.DeadlineExceeded: + return status.New(codes.DeadlineExceeded, err.Error()) + case context.Canceled: + return status.New(codes.Canceled, err.Error()) + case errdefs.ErrUnknown: + return status.New(codes.Unknown, err.Error()) + } + return nil +} + +// errorDetails returns an array of errors which make up the provided error. +// If firstIncluded is true, then all encodable errors will be used, otherwise +// the first error in an error list will be not be used, to account for the +// the base status error which details are added to via wrap or join. +// +// The errors are ordered in way that they can be applied in order by either +// wrapping or joining the errors to recreate an error with the same structure +// when `WrapError` and `JoinErrors` interfaces are used. +// +// The intent is that when re-applying the errors to create a single error, the +// results of calls to `Error()`, `errors.Is`, `errors.As`, and "%+v" formatting +// is the same as the original error. +func errorDetails(err error, firstIncluded bool) []protoadapt.MessageV1 { + switch uerr := err.(type) { + case interface{ Unwrap() error }: + details := errorDetails(uerr.Unwrap(), firstIncluded) + + // If the type is able to wrap, then include if proto + if _, ok := err.(interface{ WrapError(error) error }); ok { + // Get proto message + if protoErr := toProtoMessage(err); protoErr != nil { + details = append(details, protoErr) + } + } + + return details + case interface{ Unwrap() []error }: + var details []protoadapt.MessageV1 + for i, e := range uerr.Unwrap() { + details = append(details, errorDetails(e, firstIncluded || i > 0)...) + } + + if _, ok := err.(interface{ JoinErrors(...error) error }); ok { + // Get proto message + if protoErr := toProtoMessage(err); protoErr != nil { + details = append(details, protoErr) + } + } + return details + } + + if firstIncluded { + if protoErr := toProtoMessage(err); protoErr != nil { + return []protoadapt.MessageV1{protoErr} + } + if gs, ok := status.FromError(ToGRPC(err)); ok { + return []protoadapt.MessageV1{gs.Proto()} + } + // TODO: Else include unknown extra error type? + } + + return nil +} + +func toProtoMessage(err error) protoadapt.MessageV1 { + // Do not double encode proto messages, otherwise use Any + if pm, ok := err.(protoadapt.MessageV1); ok { + return pm + } + if pm, ok := err.(proto.Message); ok { + return protoadapt.MessageV1Of(pm) + } + + if reflect.TypeOf(err).Kind() == reflect.Ptr { + a, aerr := typeurl.MarshalAny(err) + if aerr == nil { + return &anypb.Any{ + TypeUrl: a.GetTypeUrl(), + Value: a.GetValue(), + } + } + } + return nil +} + +// ToGRPCf maps the error to grpc error codes, assembling the formatting string +// and combining it with the target error string. +// +// This is equivalent to grpc.ToGRPC(fmt.Errorf("%s: %w", fmt.Sprintf(format, args...), err)) +func ToGRPCf(err error, format string, args ...interface{}) error { + return ToGRPC(fmt.Errorf("%s: %w", fmt.Sprintf(format, args...), err)) +} + +// ToNative returns the underlying error from a grpc service based on the grpc +// error code. The grpc details are used to add wrap the error in more context +// or support multiple errors. +func ToNative(err error) error { + if err == nil { + return nil + } + + s, isGRPC := status.FromError(err) + + var ( + desc string + code codes.Code + ) + + if isGRPC { + desc = s.Message() + code = s.Code() + } else { + desc = err.Error() + code = codes.Unknown + } + + var cls error // divide these into error classes, becomes the cause + + switch code { + case codes.InvalidArgument: + cls = errdefs.ErrInvalidArgument + case codes.AlreadyExists: + cls = errdefs.ErrAlreadyExists + case codes.NotFound: + cls = errdefs.ErrNotFound + case codes.Unavailable: + cls = errdefs.ErrUnavailable + case codes.FailedPrecondition: + // TODO: Has suffix is not sufficient for conflict and not modified + // Message should start with ": " or be at beginning of a line + // Message should end with ": " or be at the end of a line + // Compile a regex + if desc == errdefs.ErrConflict.Error() || strings.HasSuffix(desc, ": "+errdefs.ErrConflict.Error()) { + cls = errdefs.ErrConflict + } else if desc == errdefs.ErrNotModified.Error() || strings.HasSuffix(desc, ": "+errdefs.ErrNotModified.Error()) { + cls = errdefs.ErrNotModified + } else { + cls = errdefs.ErrFailedPrecondition + } + case codes.Unimplemented: + cls = errdefs.ErrNotImplemented + case codes.Canceled: + cls = context.Canceled + case codes.DeadlineExceeded: + cls = context.DeadlineExceeded + case codes.Aborted: + cls = errdefs.ErrAborted + case codes.Unauthenticated: + cls = errdefs.ErrUnauthenticated + case codes.PermissionDenied: + cls = errdefs.ErrPermissionDenied + case codes.Internal: + cls = errdefs.ErrInternal + case codes.DataLoss: + cls = errdefs.ErrDataLoss + case codes.OutOfRange: + cls = errdefs.ErrOutOfRange + case codes.ResourceExhausted: + cls = errdefs.ErrResourceExhausted + default: + if idx := strings.LastIndex(desc, cause.UnexpectedStatusPrefix); idx > 0 { + if status, uerr := strconv.Atoi(desc[idx+len(cause.UnexpectedStatusPrefix):]); uerr == nil && status >= 200 && status < 600 { + cls = cause.ErrUnexpectedStatus{Status: status} + } + } + if cls == nil { + cls = errdefs.ErrUnknown + } + } + + msg := rebaseMessage(cls, desc) + if msg == "" { + err = cls + } else if msg != desc { + err = fmt.Errorf("%s: %w", msg, cls) + } else if wm, ok := cls.(interface{ WithMessage(string) error }); ok { + err = wm.WithMessage(msg) + } else { + err = fmt.Errorf("%s: %w", msg, cls) + } + + if isGRPC { + errs := []error{err} + for _, a := range s.Details() { + var derr error + + // First decode error if needed + if s, ok := a.(*spb.Status); ok { + derr = ToNative(status.ErrorProto(s)) + } else if e, ok := a.(error); ok { + derr = e + } else if dany, ok := a.(typeurl.Any); ok { + i, uerr := typeurl.UnmarshalAny(dany) + if uerr == nil { + if e, ok = i.(error); ok { + derr = e + } else { + derr = fmt.Errorf("non-error unmarshalled detail: %v", i) + } + } else { + derr = fmt.Errorf("error of type %q with failure to unmarshal: %v", dany.GetTypeUrl(), uerr) + } + } else { + derr = fmt.Errorf("non-error detail: %v", a) + } + + switch werr := derr.(type) { + case interface{ WrapError(error) error }: + errs[len(errs)-1] = werr.WrapError(errs[len(errs)-1]) + case interface{ JoinErrors(...error) error }: + // TODO: Consider whether this should support joining a subset + errs[0] = werr.JoinErrors(errs...) + case interface{ CollapseError() }: + errs[len(errs)-1] = types.CollapsedError(errs[len(errs)-1], derr) + default: + errs = append(errs, derr) + } + + } + if len(errs) > 1 { + err = errors.Join(errs...) + } else { + err = errs[0] + } + } + + return err +} + +// rebaseMessage removes the repeats for an error at the end of an error +// string. This will happen when taking an error over grpc then remapping it. +// +// Effectively, we just remove the string of cls from the end of err if it +// appears there. +func rebaseMessage(cls error, desc string) string { + clss := cls.Error() + if desc == clss { + return "" + } + + return strings.TrimSuffix(desc, ": "+clss) +} diff --git a/e2e/vendor/github.com/containerd/errdefs/pkg/internal/cause/cause.go b/e2e/vendor/github.com/containerd/errdefs/pkg/internal/cause/cause.go new file mode 100644 index 000000000..d88756bb0 --- /dev/null +++ b/e2e/vendor/github.com/containerd/errdefs/pkg/internal/cause/cause.go @@ -0,0 +1,33 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// Package cause is used to define root causes for errors +// common to errors packages like grpc and http. +package cause + +import "fmt" + +type ErrUnexpectedStatus struct { + Status int +} + +const UnexpectedStatusPrefix = "unexpected status " + +func (e ErrUnexpectedStatus) Error() string { + return fmt.Sprintf("%s%d", UnexpectedStatusPrefix, e.Status) +} + +func (ErrUnexpectedStatus) Unknown() {} diff --git a/e2e/vendor/github.com/containerd/errdefs/pkg/internal/types/collapsible.go b/e2e/vendor/github.com/containerd/errdefs/pkg/internal/types/collapsible.go new file mode 100644 index 000000000..a37e7722a --- /dev/null +++ b/e2e/vendor/github.com/containerd/errdefs/pkg/internal/types/collapsible.go @@ -0,0 +1,57 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package types + +import "fmt" + +// CollapsibleError indicates the error should be collapsed +type CollapsibleError interface { + CollapseError() +} + +// CollapsedError returns a new error with the collapsed +// error returned on unwrapped or when formatted with "%+v" +func CollapsedError(err error, collapsed ...error) error { + return collapsedError{err, collapsed} +} + +type collapsedError struct { + error + collapsed []error +} + +func (c collapsedError) Unwrap() []error { + return append([]error{c.error}, c.collapsed...) +} + +func (c collapsedError) Format(s fmt.State, verb rune) { + switch verb { + case 'v': + if s.Flag('+') { + fmt.Fprintf(s, "%+v", c.error) + for _, err := range c.collapsed { + fmt.Fprintf(s, "\n%+v", err) + } + return + } + fallthrough + case 's': + fmt.Fprint(s, c.Error()) + case 'q': + fmt.Fprintf(s, "%q", c.Error()) + } +} diff --git a/e2e/vendor/github.com/containerd/errdefs/resolve.go b/e2e/vendor/github.com/containerd/errdefs/resolve.go new file mode 100644 index 000000000..c02d4a73f --- /dev/null +++ b/e2e/vendor/github.com/containerd/errdefs/resolve.go @@ -0,0 +1,147 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package errdefs + +import "context" + +// Resolve returns the first error found in the error chain which matches an +// error defined in this package or context error. A raw, unwrapped error is +// returned or ErrUnknown if no matching error is found. +// +// This is useful for determining a response code based on the outermost wrapped +// error rather than the original cause. For example, a not found error deep +// in the code may be wrapped as an invalid argument. When determining status +// code from Is* functions, the depth or ordering of the error is not +// considered. +// +// The search order is depth first, a wrapped error returned from any part of +// the chain from `Unwrap() error` will be returned before any joined errors +// as returned by `Unwrap() []error`. +func Resolve(err error) error { + if err == nil { + return nil + } + err = firstError(err) + if err == nil { + err = ErrUnknown + } + return err +} + +func firstError(err error) error { + for { + switch err { + case ErrUnknown, + ErrInvalidArgument, + ErrNotFound, + ErrAlreadyExists, + ErrPermissionDenied, + ErrResourceExhausted, + ErrFailedPrecondition, + ErrConflict, + ErrNotModified, + ErrAborted, + ErrOutOfRange, + ErrNotImplemented, + ErrInternal, + ErrUnavailable, + ErrDataLoss, + ErrUnauthenticated, + context.DeadlineExceeded, + context.Canceled: + return err + } + switch e := err.(type) { + case customMessage: + err = e.err + case unknown: + return ErrUnknown + case invalidParameter: + return ErrInvalidArgument + case notFound: + return ErrNotFound + case alreadyExists: + return ErrAlreadyExists + case forbidden: + return ErrPermissionDenied + case resourceExhausted: + return ErrResourceExhausted + case failedPrecondition: + return ErrFailedPrecondition + case conflict: + return ErrConflict + case notModified: + return ErrNotModified + case aborted: + return ErrAborted + case errOutOfRange: + return ErrOutOfRange + case notImplemented: + return ErrNotImplemented + case system: + return ErrInternal + case unavailable: + return ErrUnavailable + case dataLoss: + return ErrDataLoss + case unauthorized: + return ErrUnauthenticated + case deadlineExceeded: + return context.DeadlineExceeded + case cancelled: + return context.Canceled + case interface{ Unwrap() error }: + err = e.Unwrap() + if err == nil { + return nil + } + case interface{ Unwrap() []error }: + for _, ue := range e.Unwrap() { + if fe := firstError(ue); fe != nil { + return fe + } + } + return nil + case interface{ Is(error) bool }: + for _, target := range []error{ErrUnknown, + ErrInvalidArgument, + ErrNotFound, + ErrAlreadyExists, + ErrPermissionDenied, + ErrResourceExhausted, + ErrFailedPrecondition, + ErrConflict, + ErrNotModified, + ErrAborted, + ErrOutOfRange, + ErrNotImplemented, + ErrInternal, + ErrUnavailable, + ErrDataLoss, + ErrUnauthenticated, + context.DeadlineExceeded, + context.Canceled} { + if e.Is(target) { + return target + } + } + return nil + default: + return nil + } + } +} diff --git a/e2e/vendor/github.com/containerd/ttrpc/channel.go b/e2e/vendor/github.com/containerd/ttrpc/channel.go index feafd9a6b..872261e6d 100644 --- a/e2e/vendor/github.com/containerd/ttrpc/channel.go +++ b/e2e/vendor/github.com/containerd/ttrpc/channel.go @@ -143,10 +143,10 @@ func (ch *channel) recv() (messageHeader, []byte, error) { } func (ch *channel) send(streamID uint32, t messageType, flags uint8, p []byte) error { - // TODO: Error on send rather than on recv - //if len(p) > messageLengthMax { - // return status.Errorf(codes.InvalidArgument, "refusing to send, message length %v exceed maximum message size of %v", len(p), messageLengthMax) - //} + if len(p) > messageLengthMax { + return OversizedMessageError(len(p)) + } + if err := writeMessageHeader(ch.bw, ch.hwbuf[:], messageHeader{Length: uint32(len(p)), StreamID: streamID, Type: t, Flags: flags}); err != nil { return err } diff --git a/e2e/vendor/github.com/containerd/ttrpc/errors.go b/e2e/vendor/github.com/containerd/ttrpc/errors.go index ec14b7952..632dbe8bd 100644 --- a/e2e/vendor/github.com/containerd/ttrpc/errors.go +++ b/e2e/vendor/github.com/containerd/ttrpc/errors.go @@ -16,7 +16,12 @@ package ttrpc -import "errors" +import ( + "errors" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) var ( // ErrProtocol is a general error in the handling the protocol. @@ -32,3 +37,44 @@ var ( // ErrStreamClosed is when the streaming connection is closed. ErrStreamClosed = errors.New("ttrpc: stream closed") ) + +// OversizedMessageErr is used to indicate refusal to send an oversized message. +// It wraps a ResourceExhausted grpc Status together with the offending message +// length. +type OversizedMessageErr struct { + messageLength int + err error +} + +// OversizedMessageError returns an OversizedMessageErr error for the given message +// length if it exceeds the allowed maximum. Otherwise a nil error is returned. +func OversizedMessageError(messageLength int) error { + if messageLength <= messageLengthMax { + return nil + } + + return &OversizedMessageErr{ + messageLength: messageLength, + err: status.Errorf(codes.ResourceExhausted, "message length %v exceed maximum message size of %v", messageLength, messageLengthMax), + } +} + +// Error returns the error message for the corresponding grpc Status for the error. +func (e *OversizedMessageErr) Error() string { + return e.err.Error() +} + +// Unwrap returns the corresponding error with our grpc status code. +func (e *OversizedMessageErr) Unwrap() error { + return e.err +} + +// RejectedLength retrieves the rejected message length which triggered the error. +func (e *OversizedMessageErr) RejectedLength() int { + return e.messageLength +} + +// MaximumLength retrieves the maximum allowed message length that triggered the error. +func (*OversizedMessageErr) MaximumLength() int { + return messageLengthMax +} diff --git a/e2e/vendor/github.com/containerd/typeurl/v2/.gitignore b/e2e/vendor/github.com/containerd/typeurl/v2/.gitignore new file mode 100644 index 000000000..d53846778 --- /dev/null +++ b/e2e/vendor/github.com/containerd/typeurl/v2/.gitignore @@ -0,0 +1,2 @@ +*.test +coverage.txt diff --git a/e2e/vendor/github.com/google/btree/LICENSE b/e2e/vendor/github.com/containerd/typeurl/v2/LICENSE similarity index 93% rename from e2e/vendor/github.com/google/btree/LICENSE rename to e2e/vendor/github.com/containerd/typeurl/v2/LICENSE index d64569567..584149b6e 100644 --- a/e2e/vendor/github.com/google/btree/LICENSE +++ b/e2e/vendor/github.com/containerd/typeurl/v2/LICENSE @@ -1,7 +1,7 @@ Apache License Version 2.0, January 2004 - http://www.apache.org/licenses/ + https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -176,24 +176,13 @@ END OF TERMS AND CONDITIONS - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] + Copyright The containerd Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/e2e/vendor/github.com/containerd/typeurl/v2/README.md b/e2e/vendor/github.com/containerd/typeurl/v2/README.md new file mode 100644 index 000000000..3098526ab --- /dev/null +++ b/e2e/vendor/github.com/containerd/typeurl/v2/README.md @@ -0,0 +1,26 @@ +# typeurl + +[![PkgGoDev](https://pkg.go.dev/badge/github.com/containerd/typeurl)](https://pkg.go.dev/github.com/containerd/typeurl) +[![Build Status](https://github.com/containerd/typeurl/workflows/CI/badge.svg)](https://github.com/containerd/typeurl/actions?query=workflow%3ACI) +[![codecov](https://codecov.io/gh/containerd/typeurl/branch/main/graph/badge.svg)](https://codecov.io/gh/containerd/typeurl) +[![Go Report Card](https://goreportcard.com/badge/github.com/containerd/typeurl)](https://goreportcard.com/report/github.com/containerd/typeurl) + +A Go package for managing the registration, marshaling, and unmarshaling of encoded types. + +This package helps when types are sent over a ttrpc/GRPC API and marshaled as a protobuf [Any](https://pkg.go.dev/google.golang.org/protobuf@v1.27.1/types/known/anypb#Any) + +## Project details + +**typeurl** is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE). +As a containerd sub-project, you will find the: + * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md), + * [Maintainers](https://github.com/containerd/project/blob/main/MAINTAINERS), + * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md) + +information in our [`containerd/project`](https://github.com/containerd/project) repository. + +## Optional + +By default, support for gogoproto is available along side the standard Google +protobuf types. +You can choose to leave gogo support out by using the `!no_gogo` build tag. diff --git a/e2e/vendor/github.com/containerd/typeurl/v2/doc.go b/e2e/vendor/github.com/containerd/typeurl/v2/doc.go new file mode 100644 index 000000000..c0d0fd205 --- /dev/null +++ b/e2e/vendor/github.com/containerd/typeurl/v2/doc.go @@ -0,0 +1,83 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package typeurl + +// Package typeurl assists with managing the registration, marshaling, and +// unmarshaling of types encoded as protobuf.Any. +// +// A protobuf.Any is a proto message that can contain any arbitrary data. It +// consists of two components, a TypeUrl and a Value, and its proto definition +// looks like this: +// +// message Any { +// string type_url = 1; +// bytes value = 2; +// } +// +// The TypeUrl is used to distinguish the contents from other proto.Any +// messages. This typeurl library manages these URLs to enable automagic +// marshaling and unmarshaling of the contents. +// +// For example, consider this go struct: +// +// type Foo struct { +// Field1 string +// Field2 string +// } +// +// To use typeurl, types must first be registered. This is typically done in +// the init function +// +// func init() { +// typeurl.Register(&Foo{}, "Foo") +// } +// +// This will register the type Foo with the url path "Foo". The arguments to +// Register are variadic, and are used to construct a url path. Consider this +// example, from the github.com/containerd/containerd/client package: +// +// func init() { +// const prefix = "types.containerd.io" +// // register TypeUrls for commonly marshaled external types +// major := strconv.Itoa(specs.VersionMajor) +// typeurl.Register(&specs.Spec{}, prefix, "opencontainers/runtime-spec", major, "Spec") +// // this function has more Register calls, which are elided. +// } +// +// This registers several types under a more complex url, which ends up mapping +// to `types.containerd.io/opencontainers/runtime-spec/1/Spec` (or some other +// value for major). +// +// Once a type is registered, it can be marshaled to a proto.Any message simply +// by calling `MarshalAny`, like this: +// +// foo := &Foo{Field1: "value1", Field2: "value2"} +// anyFoo, err := typeurl.MarshalAny(foo) +// +// MarshalAny will resolve the correct URL for the type. If the type in +// question implements the proto.Message interface, then it will be marshaled +// as a proto message. Otherwise, it will be marshaled as json. This means that +// typeurl will work on any arbitrary data, whether or not it has a proto +// definition, as long as it can be serialized to json. +// +// To unmarshal, the process is simply inverse: +// +// iface, err := typeurl.UnmarshalAny(anyFoo) +// foo := iface.(*Foo) +// +// The correct type is automatically chosen from the type registry, and the +// returned interface can be cast straight to that type. diff --git a/e2e/vendor/github.com/containerd/typeurl/v2/types.go b/e2e/vendor/github.com/containerd/typeurl/v2/types.go new file mode 100644 index 000000000..efc405ddd --- /dev/null +++ b/e2e/vendor/github.com/containerd/typeurl/v2/types.go @@ -0,0 +1,307 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package typeurl + +import ( + "encoding/json" + "errors" + "fmt" + "path" + "reflect" + "sync" + + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoregistry" + "google.golang.org/protobuf/types/known/anypb" +) + +var ( + mu sync.RWMutex + registry = make(map[reflect.Type]string) + handlers []handler +) + +type handler interface { + Marshaller(interface{}) func() ([]byte, error) + Unmarshaller(interface{}) func([]byte) error + TypeURL(interface{}) string + GetType(url string) reflect.Type +} + +// Definitions of common error types used throughout typeurl. +// +// These error types are used with errors.Wrap and errors.Wrapf to add context +// to an error. +// +// To detect an error class, use errors.Is() functions to tell whether an +// error is of this type. + +var ( + ErrNotFound = errors.New("not found") +) + +// Any contains an arbitrary protcol buffer message along with its type. +// +// While there is google.golang.org/protobuf/types/known/anypb.Any, +// we'd like to have our own to hide the underlying protocol buffer +// implementations from containerd clients. +// +// https://developers.google.com/protocol-buffers/docs/proto3#any +type Any interface { + // GetTypeUrl returns a URL/resource name that uniquely identifies + // the type of the serialized protocol buffer message. + GetTypeUrl() string + + // GetValue returns a valid serialized protocol buffer of the type that + // GetTypeUrl() indicates. + GetValue() []byte +} + +type anyType struct { + typeURL string + value []byte +} + +func (a *anyType) GetTypeUrl() string { + if a == nil { + return "" + } + return a.typeURL +} + +func (a *anyType) GetValue() []byte { + if a == nil { + return nil + } + return a.value +} + +// Register a type with a base URL for JSON marshaling. When the MarshalAny and +// UnmarshalAny functions are called they will treat the Any type value as JSON. +// To use protocol buffers for handling the Any value the proto.Register +// function should be used instead of this function. +func Register(v interface{}, args ...string) { + var ( + t = tryDereference(v) + p = path.Join(args...) + ) + mu.Lock() + defer mu.Unlock() + if et, ok := registry[t]; ok { + if et != p { + panic(fmt.Errorf("type registered with alternate path %q != %q", et, p)) + } + return + } + registry[t] = p +} + +// TypeURL returns the type url for a registered type. +func TypeURL(v interface{}) (string, error) { + mu.RLock() + u, ok := registry[tryDereference(v)] + mu.RUnlock() + if !ok { + switch t := v.(type) { + case proto.Message: + return string(t.ProtoReflect().Descriptor().FullName()), nil + default: + for _, h := range handlers { + if u := h.TypeURL(v); u != "" { + return u, nil + } + } + return "", fmt.Errorf("type %s: %w", reflect.TypeOf(v), ErrNotFound) + } + } + return u, nil +} + +// Is returns true if the type of the Any is the same as v. +func Is(any Any, v interface{}) bool { + if any == nil { + return false + } + // call to check that v is a pointer + tryDereference(v) + url, err := TypeURL(v) + if err != nil { + return false + } + return any.GetTypeUrl() == url +} + +// MarshalAny marshals the value v into an any with the correct TypeUrl. +// If the provided object is already a proto.Any message, then it will be +// returned verbatim. If it is of type proto.Message, it will be marshaled as a +// protocol buffer. Otherwise, the object will be marshaled to json. +func MarshalAny(v interface{}) (Any, error) { + var marshal func(v interface{}) ([]byte, error) + switch t := v.(type) { + case Any: + // avoid reserializing the type if we have an any. + return t, nil + case proto.Message: + marshal = func(v interface{}) ([]byte, error) { + return proto.Marshal(t) + } + default: + for _, h := range handlers { + if m := h.Marshaller(v); m != nil { + marshal = func(v interface{}) ([]byte, error) { + return m() + } + break + } + } + + if marshal == nil { + marshal = json.Marshal + } + } + + url, err := TypeURL(v) + if err != nil { + return nil, err + } + + data, err := marshal(v) + if err != nil { + return nil, err + } + return &anyType{ + typeURL: url, + value: data, + }, nil +} + +// UnmarshalAny unmarshals the any type into a concrete type. +func UnmarshalAny(any Any) (interface{}, error) { + return UnmarshalByTypeURL(any.GetTypeUrl(), any.GetValue()) +} + +// UnmarshalByTypeURL unmarshals the given type and value to into a concrete type. +func UnmarshalByTypeURL(typeURL string, value []byte) (interface{}, error) { + return unmarshal(typeURL, value, nil) +} + +// UnmarshalTo unmarshals the any type into a concrete type passed in the out +// argument. It is identical to UnmarshalAny, but lets clients provide a +// destination type through the out argument. +func UnmarshalTo(any Any, out interface{}) error { + return UnmarshalToByTypeURL(any.GetTypeUrl(), any.GetValue(), out) +} + +// UnmarshalToByTypeURL unmarshals the given type and value into a concrete type passed +// in the out argument. It is identical to UnmarshalByTypeURL, but lets clients +// provide a destination type through the out argument. +func UnmarshalToByTypeURL(typeURL string, value []byte, out interface{}) error { + _, err := unmarshal(typeURL, value, out) + return err +} + +// MarshalProto converts typeurl.Any to google.golang.org/protobuf/types/known/anypb.Any. +func MarshalProto(from Any) *anypb.Any { + if from == nil { + return nil + } + + if pbany, ok := from.(*anypb.Any); ok { + return pbany + } + + return &anypb.Any{ + TypeUrl: from.GetTypeUrl(), + Value: from.GetValue(), + } +} + +// MarshalAnyToProto converts an arbitrary interface to google.golang.org/protobuf/types/known/anypb.Any. +func MarshalAnyToProto(from interface{}) (*anypb.Any, error) { + anyType, err := MarshalAny(from) + if err != nil { + return nil, err + } + return MarshalProto(anyType), nil +} + +func unmarshal(typeURL string, value []byte, v interface{}) (interface{}, error) { + t, err := getTypeByUrl(typeURL) + if err != nil { + return nil, err + } + + if v == nil { + v = reflect.New(t).Interface() + } else { + // Validate interface type provided by client + vURL, err := TypeURL(v) + if err != nil { + return nil, err + } + if typeURL != vURL { + return nil, fmt.Errorf("can't unmarshal type %q to output %q", typeURL, vURL) + } + } + + pm, ok := v.(proto.Message) + if ok { + return v, proto.Unmarshal(value, pm) + } + + for _, h := range handlers { + if unmarshal := h.Unmarshaller(v); unmarshal != nil { + return v, unmarshal(value) + } + } + + // fallback to json unmarshaller + return v, json.Unmarshal(value, v) +} + +func getTypeByUrl(url string) (reflect.Type, error) { + mu.RLock() + for t, u := range registry { + if u == url { + mu.RUnlock() + return t, nil + } + } + mu.RUnlock() + mt, err := protoregistry.GlobalTypes.FindMessageByURL(url) + if err != nil { + if errors.Is(err, protoregistry.NotFound) { + for _, h := range handlers { + if t := h.GetType(url); t != nil { + return t, nil + } + } + } + return nil, fmt.Errorf("type with url %s: %w", url, ErrNotFound) + } + empty := mt.New().Interface() + return reflect.TypeOf(empty).Elem(), nil +} + +func tryDereference(v interface{}) reflect.Type { + t := reflect.TypeOf(v) + if t.Kind() == reflect.Ptr { + // require check of pointer but dereference to register + return t.Elem() + } + panic("v is not a pointer to a type") +} diff --git a/e2e/vendor/github.com/containerd/typeurl/v2/types_gogo.go b/e2e/vendor/github.com/containerd/typeurl/v2/types_gogo.go new file mode 100644 index 000000000..fa293323b --- /dev/null +++ b/e2e/vendor/github.com/containerd/typeurl/v2/types_gogo.go @@ -0,0 +1,68 @@ +//go:build !no_gogo + +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package typeurl + +import ( + "reflect" + + gogoproto "github.com/gogo/protobuf/proto" +) + +func init() { + handlers = append(handlers, gogoHandler{}) +} + +type gogoHandler struct{} + +func (gogoHandler) Marshaller(v interface{}) func() ([]byte, error) { + pm, ok := v.(gogoproto.Message) + if !ok { + return nil + } + return func() ([]byte, error) { + return gogoproto.Marshal(pm) + } +} + +func (gogoHandler) Unmarshaller(v interface{}) func([]byte) error { + pm, ok := v.(gogoproto.Message) + if !ok { + return nil + } + + return func(dt []byte) error { + return gogoproto.Unmarshal(dt, pm) + } +} + +func (gogoHandler) TypeURL(v interface{}) string { + pm, ok := v.(gogoproto.Message) + if !ok { + return "" + } + return gogoproto.MessageName(pm) +} + +func (gogoHandler) GetType(url string) reflect.Type { + t := gogoproto.MessageType(url) + if t == nil { + return nil + } + return t.Elem() +} diff --git a/e2e/vendor/github.com/coreos/go-semver/LICENSE b/e2e/vendor/github.com/coreos/go-semver/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/e2e/vendor/github.com/coreos/go-semver/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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/e2e/vendor/github.com/coreos/go-semver/NOTICE b/e2e/vendor/github.com/coreos/go-semver/NOTICE deleted file mode 100644 index 23a0ada2f..000000000 --- a/e2e/vendor/github.com/coreos/go-semver/NOTICE +++ /dev/null @@ -1,5 +0,0 @@ -CoreOS Project -Copyright 2018 CoreOS, Inc - -This product includes software developed at CoreOS, Inc. -(http://www.coreos.com/). diff --git a/e2e/vendor/github.com/coreos/go-semver/semver/semver.go b/e2e/vendor/github.com/coreos/go-semver/semver/semver.go deleted file mode 100644 index eb9fb7ff2..000000000 --- a/e2e/vendor/github.com/coreos/go-semver/semver/semver.go +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright 2013-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. - -// Semantic Versions http://semver.org -package semver - -import ( - "bytes" - "errors" - "fmt" - "regexp" - "strconv" - "strings" -) - -type Version struct { - Major int64 - Minor int64 - Patch int64 - PreRelease PreRelease - Metadata string -} - -type PreRelease string - -func splitOff(input *string, delim string) (val string) { - parts := strings.SplitN(*input, delim, 2) - - if len(parts) == 2 { - *input = parts[0] - val = parts[1] - } - - return val -} - -func New(version string) *Version { - return Must(NewVersion(version)) -} - -func NewVersion(version string) (*Version, error) { - v := Version{} - - if err := v.Set(version); err != nil { - return nil, err - } - - return &v, nil -} - -// Must is a helper for wrapping NewVersion and will panic if err is not nil. -func Must(v *Version, err error) *Version { - if err != nil { - panic(err) - } - return v -} - -// Set parses and updates v from the given version string. Implements flag.Value -func (v *Version) Set(version string) error { - metadata := splitOff(&version, "+") - preRelease := PreRelease(splitOff(&version, "-")) - dotParts := strings.SplitN(version, ".", 3) - - if len(dotParts) != 3 { - return fmt.Errorf("%s is not in dotted-tri format", version) - } - - if err := validateIdentifier(string(preRelease)); err != nil { - return fmt.Errorf("failed to validate pre-release: %v", err) - } - - if err := validateIdentifier(metadata); err != nil { - return fmt.Errorf("failed to validate metadata: %v", err) - } - - parsed := make([]int64, 3) - - for i, v := range dotParts[:3] { - val, err := strconv.ParseInt(v, 10, 64) - parsed[i] = val - if err != nil { - return err - } - } - - v.Metadata = metadata - v.PreRelease = preRelease - v.Major = parsed[0] - v.Minor = parsed[1] - v.Patch = parsed[2] - return nil -} - -func (v Version) String() string { - var buffer bytes.Buffer - - fmt.Fprintf(&buffer, "%d.%d.%d", v.Major, v.Minor, v.Patch) - - if v.PreRelease != "" { - fmt.Fprintf(&buffer, "-%s", v.PreRelease) - } - - if v.Metadata != "" { - fmt.Fprintf(&buffer, "+%s", v.Metadata) - } - - return buffer.String() -} - -func (v *Version) UnmarshalYAML(unmarshal func(interface{}) error) error { - var data string - if err := unmarshal(&data); err != nil { - return err - } - return v.Set(data) -} - -func (v Version) MarshalJSON() ([]byte, error) { - return []byte(`"` + v.String() + `"`), nil -} - -func (v *Version) UnmarshalJSON(data []byte) error { - l := len(data) - if l == 0 || string(data) == `""` { - return nil - } - if l < 2 || data[0] != '"' || data[l-1] != '"' { - return errors.New("invalid semver string") - } - return v.Set(string(data[1 : l-1])) -} - -// Compare tests if v is less than, equal to, or greater than versionB, -// returning -1, 0, or +1 respectively. -func (v Version) Compare(versionB Version) int { - if cmp := recursiveCompare(v.Slice(), versionB.Slice()); cmp != 0 { - return cmp - } - return preReleaseCompare(v, versionB) -} - -// Equal tests if v is equal to versionB. -func (v Version) Equal(versionB Version) bool { - return v.Compare(versionB) == 0 -} - -// LessThan tests if v is less than versionB. -func (v Version) LessThan(versionB Version) bool { - return v.Compare(versionB) < 0 -} - -// Slice converts the comparable parts of the semver into a slice of integers. -func (v Version) Slice() []int64 { - return []int64{v.Major, v.Minor, v.Patch} -} - -func (p PreRelease) Slice() []string { - preRelease := string(p) - return strings.Split(preRelease, ".") -} - -func preReleaseCompare(versionA Version, versionB Version) int { - a := versionA.PreRelease - b := versionB.PreRelease - - /* Handle the case where if two versions are otherwise equal it is the - * one without a PreRelease that is greater */ - if len(a) == 0 && (len(b) > 0) { - return 1 - } else if len(b) == 0 && (len(a) > 0) { - return -1 - } - - // If there is a prerelease, check and compare each part. - return recursivePreReleaseCompare(a.Slice(), b.Slice()) -} - -func recursiveCompare(versionA []int64, versionB []int64) int { - if len(versionA) == 0 { - return 0 - } - - a := versionA[0] - b := versionB[0] - - if a > b { - return 1 - } else if a < b { - return -1 - } - - return recursiveCompare(versionA[1:], versionB[1:]) -} - -func recursivePreReleaseCompare(versionA []string, versionB []string) int { - // A larger set of pre-release fields has a higher precedence than a smaller set, - // if all of the preceding identifiers are equal. - if len(versionA) == 0 { - if len(versionB) > 0 { - return -1 - } - return 0 - } else if len(versionB) == 0 { - // We're longer than versionB so return 1. - return 1 - } - - a := versionA[0] - b := versionB[0] - - aInt := false - bInt := false - - aI, err := strconv.Atoi(versionA[0]) - if err == nil { - aInt = true - } - - bI, err := strconv.Atoi(versionB[0]) - if err == nil { - bInt = true - } - - // Numeric identifiers always have lower precedence than non-numeric identifiers. - if aInt && !bInt { - return -1 - } else if !aInt && bInt { - return 1 - } - - // Handle Integer Comparison - if aInt && bInt { - if aI > bI { - return 1 - } else if aI < bI { - return -1 - } - } - - // Handle String Comparison - if a > b { - return 1 - } else if a < b { - return -1 - } - - return recursivePreReleaseCompare(versionA[1:], versionB[1:]) -} - -// BumpMajor increments the Major field by 1 and resets all other fields to their default values -func (v *Version) BumpMajor() { - v.Major += 1 - v.Minor = 0 - v.Patch = 0 - v.PreRelease = PreRelease("") - v.Metadata = "" -} - -// BumpMinor increments the Minor field by 1 and resets all other fields to their default values -func (v *Version) BumpMinor() { - v.Minor += 1 - v.Patch = 0 - v.PreRelease = PreRelease("") - v.Metadata = "" -} - -// BumpPatch increments the Patch field by 1 and resets all other fields to their default values -func (v *Version) BumpPatch() { - v.Patch += 1 - v.PreRelease = PreRelease("") - v.Metadata = "" -} - -// validateIdentifier makes sure the provided identifier satisfies semver spec -func validateIdentifier(id string) error { - if id != "" && !reIdentifier.MatchString(id) { - return fmt.Errorf("%s is not a valid semver identifier", id) - } - return nil -} - -// reIdentifier is a regular expression used to check that pre-release and metadata -// identifiers satisfy the spec requirements -var reIdentifier = regexp.MustCompile(`^[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*$`) diff --git a/e2e/vendor/github.com/coreos/go-semver/semver/sort.go b/e2e/vendor/github.com/coreos/go-semver/semver/sort.go deleted file mode 100644 index e256b41a5..000000000 --- a/e2e/vendor/github.com/coreos/go-semver/semver/sort.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2013-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 semver - -import ( - "sort" -) - -type Versions []*Version - -func (s Versions) Len() int { - return len(s) -} - -func (s Versions) Swap(i, j int) { - s[i], s[j] = s[j], s[i] -} - -func (s Versions) Less(i, j int) bool { - return s[i].LessThan(*s[j]) -} - -// Sort sorts the given slice of Version -func Sort(versions []*Version) { - sort.Sort(Versions(versions)) -} diff --git a/e2e/vendor/github.com/coreos/go-systemd/v22/daemon/sdnotify.go b/e2e/vendor/github.com/coreos/go-systemd/v22/daemon/sdnotify.go deleted file mode 100644 index ba4ae31f1..000000000 --- a/e2e/vendor/github.com/coreos/go-systemd/v22/daemon/sdnotify.go +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2014 Docker, Inc. -// Copyright 2015-2018 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 daemon provides a Go implementation of the sd_notify protocol. -// It can be used to inform systemd of service start-up completion, watchdog -// events, and other status changes. -// -// https://www.freedesktop.org/software/systemd/man/sd_notify.html#Description -package daemon - -import ( - "net" - "os" -) - -const ( - // SdNotifyReady tells the service manager that service startup is finished - // or the service finished loading its configuration. - SdNotifyReady = "READY=1" - - // SdNotifyStopping tells the service manager that the service is beginning - // its shutdown. - SdNotifyStopping = "STOPPING=1" - - // SdNotifyReloading tells the service manager that this service is - // reloading its configuration. Note that you must call SdNotifyReady when - // it completed reloading. - SdNotifyReloading = "RELOADING=1" - - // SdNotifyWatchdog tells the service manager to update the watchdog - // timestamp for the service. - SdNotifyWatchdog = "WATCHDOG=1" -) - -// SdNotify sends a message to the init daemon. It is common to ignore the error. -// If `unsetEnvironment` is true, the environment variable `NOTIFY_SOCKET` -// will be unconditionally unset. -// -// It returns one of the following: -// (false, nil) - notification not supported (i.e. NOTIFY_SOCKET is unset) -// (false, err) - notification supported, but failure happened (e.g. error connecting to NOTIFY_SOCKET or while sending data) -// (true, nil) - notification supported, data has been sent -func SdNotify(unsetEnvironment bool, state string) (bool, error) { - socketAddr := &net.UnixAddr{ - Name: os.Getenv("NOTIFY_SOCKET"), - Net: "unixgram", - } - - // NOTIFY_SOCKET not set - if socketAddr.Name == "" { - return false, nil - } - - if unsetEnvironment { - if err := os.Unsetenv("NOTIFY_SOCKET"); err != nil { - return false, err - } - } - - conn, err := net.DialUnix(socketAddr.Net, nil, socketAddr) - // Error connecting to NOTIFY_SOCKET - if err != nil { - return false, err - } - defer conn.Close() - - if _, err = conn.Write([]byte(state)); err != nil { - return false, err - } - return true, nil -} diff --git a/e2e/vendor/github.com/coreos/go-systemd/v22/daemon/watchdog.go b/e2e/vendor/github.com/coreos/go-systemd/v22/daemon/watchdog.go deleted file mode 100644 index 25d9c1aa9..000000000 --- a/e2e/vendor/github.com/coreos/go-systemd/v22/daemon/watchdog.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2016 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 daemon - -import ( - "fmt" - "os" - "strconv" - "time" -) - -// SdWatchdogEnabled returns watchdog information for a service. -// Processes should call daemon.SdNotify(false, daemon.SdNotifyWatchdog) every -// time / 2. -// If `unsetEnvironment` is true, the environment variables `WATCHDOG_USEC` and -// `WATCHDOG_PID` will be unconditionally unset. -// -// It returns one of the following: -// (0, nil) - watchdog isn't enabled or we aren't the watched PID. -// (0, err) - an error happened (e.g. error converting time). -// (time, nil) - watchdog is enabled and we can send ping. time is delay -// before inactive service will be killed. -func SdWatchdogEnabled(unsetEnvironment bool) (time.Duration, error) { - wusec := os.Getenv("WATCHDOG_USEC") - wpid := os.Getenv("WATCHDOG_PID") - if unsetEnvironment { - wusecErr := os.Unsetenv("WATCHDOG_USEC") - wpidErr := os.Unsetenv("WATCHDOG_PID") - if wusecErr != nil { - return 0, wusecErr - } - if wpidErr != nil { - return 0, wpidErr - } - } - - if wusec == "" { - return 0, nil - } - s, err := strconv.Atoi(wusec) - if err != nil { - return 0, fmt.Errorf("error converting WATCHDOG_USEC: %s", err) - } - if s <= 0 { - return 0, fmt.Errorf("error WATCHDOG_USEC must be a positive number") - } - interval := time.Duration(s) * time.Microsecond - - if wpid == "" { - return interval, nil - } - p, err := strconv.Atoi(wpid) - if err != nil { - return 0, fmt.Errorf("error converting WATCHDOG_PID: %s", err) - } - if os.Getpid() != p { - return 0, nil - } - - return interval, nil -} diff --git a/e2e/vendor/github.com/coreos/go-systemd/v22/journal/journal.go b/e2e/vendor/github.com/coreos/go-systemd/v22/journal/journal.go deleted file mode 100644 index ac24c7767..000000000 --- a/e2e/vendor/github.com/coreos/go-systemd/v22/journal/journal.go +++ /dev/null @@ -1,46 +0,0 @@ -// 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 journal provides write bindings to the local systemd journal. -// It is implemented in pure Go and connects to the journal directly over its -// unix socket. -// -// To read from the journal, see the "sdjournal" package, which wraps the -// sd-journal a C API. -// -// http://www.freedesktop.org/software/systemd/man/systemd-journald.service.html -package journal - -import ( - "fmt" -) - -// Priority of a journal message -type Priority int - -const ( - PriEmerg Priority = iota - PriAlert - PriCrit - PriErr - PriWarning - PriNotice - PriInfo - PriDebug -) - -// Print prints a message to the local systemd journal using Send(). -func Print(priority Priority, format string, a ...interface{}) error { - return Send(fmt.Sprintf(format, a...), priority, nil) -} diff --git a/e2e/vendor/github.com/coreos/go-systemd/v22/journal/journal_unix.go b/e2e/vendor/github.com/coreos/go-systemd/v22/journal/journal_unix.go deleted file mode 100644 index c5b23a819..000000000 --- a/e2e/vendor/github.com/coreos/go-systemd/v22/journal/journal_unix.go +++ /dev/null @@ -1,267 +0,0 @@ -// 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. - -//go:build !windows -// +build !windows - -// Package journal provides write bindings to the local systemd journal. -// It is implemented in pure Go and connects to the journal directly over its -// unix socket. -// -// To read from the journal, see the "sdjournal" package, which wraps the -// sd-journal a C API. -// -// http://www.freedesktop.org/software/systemd/man/systemd-journald.service.html -package journal - -import ( - "bytes" - "encoding/binary" - "errors" - "fmt" - "io" - "io/ioutil" - "net" - "os" - "strconv" - "strings" - "sync" - "sync/atomic" - "syscall" - "unsafe" -) - -var ( - // This can be overridden at build-time: - // https://github.com/golang/go/wiki/GcToolchainTricks#including-build-information-in-the-executable - journalSocket = "/run/systemd/journal/socket" - - // unixConnPtr atomically holds the local unconnected Unix-domain socket. - // Concrete safe pointer type: *net.UnixConn - unixConnPtr unsafe.Pointer - // onceConn ensures that unixConnPtr is initialized exactly once. - onceConn sync.Once -) - -// Enabled checks whether the local systemd journal is available for logging. -func Enabled() bool { - if c := getOrInitConn(); c == nil { - return false - } - - conn, err := net.Dial("unixgram", journalSocket) - if err != nil { - return false - } - defer conn.Close() - - return true -} - -// StderrIsJournalStream returns whether the process stderr is connected -// to the Journal's stream transport. -// -// This can be used for automatic protocol upgrading described in [Journal Native Protocol]. -// -// Returns true if JOURNAL_STREAM environment variable is present, -// and stderr's device and inode numbers match it. -// -// Error is returned if unexpected error occurs: e.g. if JOURNAL_STREAM environment variable -// is present, but malformed, fstat syscall fails, etc. -// -// [Journal Native Protocol]: https://systemd.io/JOURNAL_NATIVE_PROTOCOL/#automatic-protocol-upgrading -func StderrIsJournalStream() (bool, error) { - return fdIsJournalStream(syscall.Stderr) -} - -// StdoutIsJournalStream returns whether the process stdout is connected -// to the Journal's stream transport. -// -// Returns true if JOURNAL_STREAM environment variable is present, -// and stdout's device and inode numbers match it. -// -// Error is returned if unexpected error occurs: e.g. if JOURNAL_STREAM environment variable -// is present, but malformed, fstat syscall fails, etc. -// -// Most users should probably use [StderrIsJournalStream]. -func StdoutIsJournalStream() (bool, error) { - return fdIsJournalStream(syscall.Stdout) -} - -func fdIsJournalStream(fd int) (bool, error) { - journalStream := os.Getenv("JOURNAL_STREAM") - if journalStream == "" { - return false, nil - } - - var expectedStat syscall.Stat_t - _, err := fmt.Sscanf(journalStream, "%d:%d", &expectedStat.Dev, &expectedStat.Ino) - if err != nil { - return false, fmt.Errorf("failed to parse JOURNAL_STREAM=%q: %v", journalStream, err) - } - - var stat syscall.Stat_t - err = syscall.Fstat(fd, &stat) - if err != nil { - return false, err - } - - match := stat.Dev == expectedStat.Dev && stat.Ino == expectedStat.Ino - return match, nil -} - -// Send a message to the local systemd journal. vars is a map of journald -// fields to values. Fields must be composed of uppercase letters, numbers, -// and underscores, but must not start with an underscore. Within these -// restrictions, any arbitrary field name may be used. Some names have special -// significance: see the journalctl documentation -// (http://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html) -// for more details. vars may be nil. -func Send(message string, priority Priority, vars map[string]string) error { - conn := getOrInitConn() - if conn == nil { - return errors.New("could not initialize socket to journald") - } - - socketAddr := &net.UnixAddr{ - Name: journalSocket, - Net: "unixgram", - } - - data := new(bytes.Buffer) - appendVariable(data, "PRIORITY", strconv.Itoa(int(priority))) - appendVariable(data, "MESSAGE", message) - for k, v := range vars { - appendVariable(data, k, v) - } - - _, _, err := conn.WriteMsgUnix(data.Bytes(), nil, socketAddr) - if err == nil { - return nil - } - if !isSocketSpaceError(err) { - return err - } - - // Large log entry, send it via tempfile and ancillary-fd. - file, err := tempFd() - if err != nil { - return err - } - defer file.Close() - _, err = io.Copy(file, data) - if err != nil { - return err - } - rights := syscall.UnixRights(int(file.Fd())) - _, _, err = conn.WriteMsgUnix([]byte{}, rights, socketAddr) - if err != nil { - return err - } - - return nil -} - -// getOrInitConn attempts to get the global `unixConnPtr` socket, initializing if necessary -func getOrInitConn() *net.UnixConn { - conn := (*net.UnixConn)(atomic.LoadPointer(&unixConnPtr)) - if conn != nil { - return conn - } - onceConn.Do(initConn) - return (*net.UnixConn)(atomic.LoadPointer(&unixConnPtr)) -} - -func appendVariable(w io.Writer, name, value string) { - if err := validVarName(name); err != nil { - fmt.Fprintf(os.Stderr, "variable name %s contains invalid character, ignoring\n", name) - } - if strings.ContainsRune(value, '\n') { - /* When the value contains a newline, we write: - * - the variable name, followed by a newline - * - the size (in 64bit little endian format) - * - the data, followed by a newline - */ - fmt.Fprintln(w, name) - binary.Write(w, binary.LittleEndian, uint64(len(value))) - fmt.Fprintln(w, value) - } else { - /* just write the variable and value all on one line */ - fmt.Fprintf(w, "%s=%s\n", name, value) - } -} - -// validVarName validates a variable name to make sure journald will accept it. -// The variable name must be in uppercase and consist only of characters, -// numbers and underscores, and may not begin with an underscore: -// https://www.freedesktop.org/software/systemd/man/sd_journal_print.html -func validVarName(name string) error { - if name == "" { - return errors.New("Empty variable name") - } else if name[0] == '_' { - return errors.New("Variable name begins with an underscore") - } - - for _, c := range name { - if !(('A' <= c && c <= 'Z') || ('0' <= c && c <= '9') || c == '_') { - return errors.New("Variable name contains invalid characters") - } - } - return nil -} - -// isSocketSpaceError checks whether the error is signaling -// an "overlarge message" condition. -func isSocketSpaceError(err error) bool { - opErr, ok := err.(*net.OpError) - if !ok || opErr == nil { - return false - } - - sysErr, ok := opErr.Err.(*os.SyscallError) - if !ok || sysErr == nil { - return false - } - - return sysErr.Err == syscall.EMSGSIZE || sysErr.Err == syscall.ENOBUFS -} - -// tempFd creates a temporary, unlinked file under `/dev/shm`. -func tempFd() (*os.File, error) { - file, err := ioutil.TempFile("/dev/shm/", "journal.XXXXX") - if err != nil { - return nil, err - } - err = syscall.Unlink(file.Name()) - if err != nil { - return nil, err - } - return file, nil -} - -// initConn initializes the global `unixConnPtr` socket. -// It is automatically called when needed. -func initConn() { - autobind, err := net.ResolveUnixAddr("unixgram", "") - if err != nil { - return - } - - sock, err := net.ListenUnixgram("unixgram", autobind) - if err != nil { - return - } - - atomic.StorePointer(&unixConnPtr, unsafe.Pointer(sock)) -} diff --git a/e2e/vendor/github.com/coreos/go-systemd/v22/journal/journal_windows.go b/e2e/vendor/github.com/coreos/go-systemd/v22/journal/journal_windows.go deleted file mode 100644 index 322e41e74..000000000 --- a/e2e/vendor/github.com/coreos/go-systemd/v22/journal/journal_windows.go +++ /dev/null @@ -1,43 +0,0 @@ -// 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 journal provides write bindings to the local systemd journal. -// It is implemented in pure Go and connects to the journal directly over its -// unix socket. -// -// To read from the journal, see the "sdjournal" package, which wraps the -// sd-journal a C API. -// -// http://www.freedesktop.org/software/systemd/man/systemd-journald.service.html -package journal - -import ( - "errors" -) - -func Enabled() bool { - return false -} - -func Send(message string, priority Priority, vars map[string]string) error { - return errors.New("could not initialize socket to journald") -} - -func StderrIsJournalStream() (bool, error) { - return false, nil -} - -func StdoutIsJournalStream() (bool, error) { - return false, nil -} diff --git a/e2e/vendor/github.com/cyphar/filepath-securejoin/CHANGELOG.md b/e2e/vendor/github.com/cyphar/filepath-securejoin/CHANGELOG.md index 04b5685ab..ca0e3c62c 100644 --- a/e2e/vendor/github.com/cyphar/filepath-securejoin/CHANGELOG.md +++ b/e2e/vendor/github.com/cyphar/filepath-securejoin/CHANGELOG.md @@ -6,6 +6,80 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] ## +## [0.4.1] - 2025-01-28 ## + +### Fixed ### +- The restrictions added for `root` paths passed to `SecureJoin` in 0.4.0 was + found to be too strict and caused some regressions when folks tried to + update, so this restriction has been relaxed to only return an error if the + path contains a `..` component. We still recommend users use `filepath.Clean` + (and even `filepath.EvalSymlinks`) on the `root` path they are using, but at + least you will no longer be punished for "trivial" unclean paths. + +## [0.4.0] - 2025-01-13 ## + +### Breaking #### +- `SecureJoin(VFS)` will now return an error if the provided `root` is not a + `filepath.Clean`'d path. + + While it is ultimately the responsibility of the caller to ensure the root is + a safe path to use, passing a path like `/symlink/..` as a root would result + in the `SecureJoin`'d path being placed in `/` even though `/symlink/..` + might be a different directory, and so we should more strongly discourage + such usage. + + All major users of `securejoin.SecureJoin` already ensure that the paths they + provide are safe (and this is ultimately a question of user error), but + removing this foot-gun is probably a good idea. Of course, this is + necessarily a breaking API change (though we expect no real users to be + affected by it). + + Thanks to [Erik Sjölund](https://github.com/eriksjolund), who initially + reported this issue as a possible security issue. + +- `MkdirAll` and `MkdirHandle` now take an `os.FileMode`-style mode argument + instead of a raw `unix.S_*`-style mode argument, which may cause compile-time + type errors depending on how you use `filepath-securejoin`. For most users, + there will be no change in behaviour aside from the type change (as the + bottom `0o777` bits are the same in both formats, and most users are probably + only using those bits). + + However, if you were using `unix.S_ISVTX` to set the sticky bit with + `MkdirAll(Handle)` you will need to switch to `os.ModeSticky` otherwise you + will get a runtime error with this update. In addition, the error message you + will get from passing `unix.S_ISUID` and `unix.S_ISGID` will be different as + they are treated as invalid bits now (note that previously passing said bits + was also an error). + +## [0.3.6] - 2024-12-17 ## + +### Compatibility ### +- The minimum Go version requirement for `filepath-securejoin` is now Go 1.18 + (we use generics internally). + + For reference, `filepath-securejoin@v0.3.0` somewhat-arbitrarily bumped the + Go version requirement to 1.21. + + While we did make some use of Go 1.21 stdlib features (and in principle Go + versions <= 1.21 are no longer even supported by upstream anymore), some + downstreams have complained that the version bump has meant that they have to + do workarounds when backporting fixes that use the new `filepath-securejoin` + API onto old branches. This is not an ideal situation, but since using this + library is probably better for most downstreams than a hand-rolled + workaround, we now have compatibility shims that allow us to build on older + Go versions. +- Lower minimum version requirement for `golang.org/x/sys` to `v0.18.0` (we + need the wrappers for `fsconfig(2)`), which should also make backporting + patches to older branches easier. + +## [0.3.5] - 2024-12-06 ## + +### Fixed ### +- `MkdirAll` will now no longer return an `EEXIST` error if two racing + processes are creating the same directory. We will still verify that the path + is a directory, but this will avoid spurious errors when multiple threads or + programs are trying to `MkdirAll` the same path. opencontainers/runc#4543 + ## [0.3.4] - 2024-10-09 ## ### Fixed ### @@ -164,8 +238,12 @@ This is our first release of `github.com/cyphar/filepath-securejoin`, containing a full implementation with a coverage of 93.5% (the only missing cases are the error cases, which are hard to mocktest at the moment). -[Unreleased]: https://github.com/cyphar/filepath-securejoin/compare/v0.3.4...HEAD -[0.3.3]: https://github.com/cyphar/filepath-securejoin/compare/v0.3.3...v0.3.4 +[Unreleased]: https://github.com/cyphar/filepath-securejoin/compare/v0.4.1...HEAD +[0.4.1]: https://github.com/cyphar/filepath-securejoin/compare/v0.4.0...v0.4.1 +[0.4.0]: https://github.com/cyphar/filepath-securejoin/compare/v0.3.6...v0.4.0 +[0.3.6]: https://github.com/cyphar/filepath-securejoin/compare/v0.3.5...v0.3.6 +[0.3.5]: https://github.com/cyphar/filepath-securejoin/compare/v0.3.4...v0.3.5 +[0.3.4]: https://github.com/cyphar/filepath-securejoin/compare/v0.3.3...v0.3.4 [0.3.3]: https://github.com/cyphar/filepath-securejoin/compare/v0.3.2...v0.3.3 [0.3.2]: https://github.com/cyphar/filepath-securejoin/compare/v0.3.1...v0.3.2 [0.3.1]: https://github.com/cyphar/filepath-securejoin/compare/v0.3.0...v0.3.1 diff --git a/e2e/vendor/github.com/cyphar/filepath-securejoin/VERSION b/e2e/vendor/github.com/cyphar/filepath-securejoin/VERSION index 42045acae..267577d47 100644 --- a/e2e/vendor/github.com/cyphar/filepath-securejoin/VERSION +++ b/e2e/vendor/github.com/cyphar/filepath-securejoin/VERSION @@ -1 +1 @@ -0.3.4 +0.4.1 diff --git a/e2e/vendor/github.com/cyphar/filepath-securejoin/gocompat_errors_go120.go b/e2e/vendor/github.com/cyphar/filepath-securejoin/gocompat_errors_go120.go new file mode 100644 index 000000000..42452bbf9 --- /dev/null +++ b/e2e/vendor/github.com/cyphar/filepath-securejoin/gocompat_errors_go120.go @@ -0,0 +1,18 @@ +//go:build linux && go1.20 + +// Copyright (C) 2024 SUSE LLC. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package securejoin + +import ( + "fmt" +) + +// wrapBaseError is a helper that is equivalent to fmt.Errorf("%w: %w"), except +// that on pre-1.20 Go versions only errors.Is() works properly (errors.Unwrap) +// is only guaranteed to give you baseErr. +func wrapBaseError(baseErr, extraErr error) error { + return fmt.Errorf("%w: %w", extraErr, baseErr) +} diff --git a/e2e/vendor/github.com/cyphar/filepath-securejoin/gocompat_errors_unsupported.go b/e2e/vendor/github.com/cyphar/filepath-securejoin/gocompat_errors_unsupported.go new file mode 100644 index 000000000..e7adca3fd --- /dev/null +++ b/e2e/vendor/github.com/cyphar/filepath-securejoin/gocompat_errors_unsupported.go @@ -0,0 +1,38 @@ +//go:build linux && !go1.20 + +// Copyright (C) 2024 SUSE LLC. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package securejoin + +import ( + "fmt" +) + +type wrappedError struct { + inner error + isError error +} + +func (err wrappedError) Is(target error) bool { + return err.isError == target +} + +func (err wrappedError) Unwrap() error { + return err.inner +} + +func (err wrappedError) Error() string { + return fmt.Sprintf("%v: %v", err.isError, err.inner) +} + +// wrapBaseError is a helper that is equivalent to fmt.Errorf("%w: %w"), except +// that on pre-1.20 Go versions only errors.Is() works properly (errors.Unwrap) +// is only guaranteed to give you baseErr. +func wrapBaseError(baseErr, extraErr error) error { + return wrappedError{ + inner: baseErr, + isError: extraErr, + } +} diff --git a/e2e/vendor/github.com/cyphar/filepath-securejoin/gocompat_generics_go121.go b/e2e/vendor/github.com/cyphar/filepath-securejoin/gocompat_generics_go121.go new file mode 100644 index 000000000..ddd6fa9a4 --- /dev/null +++ b/e2e/vendor/github.com/cyphar/filepath-securejoin/gocompat_generics_go121.go @@ -0,0 +1,32 @@ +//go:build linux && go1.21 + +// Copyright (C) 2024 SUSE LLC. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package securejoin + +import ( + "slices" + "sync" +) + +func slices_DeleteFunc[S ~[]E, E any](slice S, delFn func(E) bool) S { + return slices.DeleteFunc(slice, delFn) +} + +func slices_Contains[S ~[]E, E comparable](slice S, val E) bool { + return slices.Contains(slice, val) +} + +func slices_Clone[S ~[]E, E any](slice S) S { + return slices.Clone(slice) +} + +func sync_OnceValue[T any](f func() T) func() T { + return sync.OnceValue(f) +} + +func sync_OnceValues[T1, T2 any](f func() (T1, T2)) func() (T1, T2) { + return sync.OnceValues(f) +} diff --git a/e2e/vendor/github.com/cyphar/filepath-securejoin/gocompat_generics_unsupported.go b/e2e/vendor/github.com/cyphar/filepath-securejoin/gocompat_generics_unsupported.go new file mode 100644 index 000000000..f1e6fe7e7 --- /dev/null +++ b/e2e/vendor/github.com/cyphar/filepath-securejoin/gocompat_generics_unsupported.go @@ -0,0 +1,124 @@ +//go:build linux && !go1.21 + +// Copyright (C) 2024 SUSE LLC. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package securejoin + +import ( + "sync" +) + +// These are very minimal implementations of functions that appear in Go 1.21's +// stdlib, included so that we can build on older Go versions. Most are +// borrowed directly from the stdlib, and a few are modified to be "obviously +// correct" without needing to copy too many other helpers. + +// clearSlice is equivalent to the builtin clear from Go 1.21. +// Copied from the Go 1.24 stdlib implementation. +func clearSlice[S ~[]E, E any](slice S) { + var zero E + for i := range slice { + slice[i] = zero + } +} + +// Copied from the Go 1.24 stdlib implementation. +func slices_IndexFunc[S ~[]E, E any](s S, f func(E) bool) int { + for i := range s { + if f(s[i]) { + return i + } + } + return -1 +} + +// Copied from the Go 1.24 stdlib implementation. +func slices_DeleteFunc[S ~[]E, E any](s S, del func(E) bool) S { + i := slices_IndexFunc(s, del) + if i == -1 { + return s + } + // Don't start copying elements until we find one to delete. + for j := i + 1; j < len(s); j++ { + if v := s[j]; !del(v) { + s[i] = v + i++ + } + } + clearSlice(s[i:]) // zero/nil out the obsolete elements, for GC + return s[:i] +} + +// Similar to the stdlib slices.Contains, except that we don't have +// slices.Index so we need to use slices.IndexFunc for this non-Func helper. +func slices_Contains[S ~[]E, E comparable](s S, v E) bool { + return slices_IndexFunc(s, func(e E) bool { return e == v }) >= 0 +} + +// Copied from the Go 1.24 stdlib implementation. +func slices_Clone[S ~[]E, E any](s S) S { + // Preserve nil in case it matters. + if s == nil { + return nil + } + return append(S([]E{}), s...) +} + +// Copied from the Go 1.24 stdlib implementation. +func sync_OnceValue[T any](f func() T) func() T { + var ( + once sync.Once + valid bool + p any + result T + ) + g := func() { + defer func() { + p = recover() + if !valid { + panic(p) + } + }() + result = f() + f = nil + valid = true + } + return func() T { + once.Do(g) + if !valid { + panic(p) + } + return result + } +} + +// Copied from the Go 1.24 stdlib implementation. +func sync_OnceValues[T1, T2 any](f func() (T1, T2)) func() (T1, T2) { + var ( + once sync.Once + valid bool + p any + r1 T1 + r2 T2 + ) + g := func() { + defer func() { + p = recover() + if !valid { + panic(p) + } + }() + r1, r2 = f() + f = nil + valid = true + } + return func() (T1, T2) { + once.Do(g) + if !valid { + panic(p) + } + return r1, r2 + } +} diff --git a/e2e/vendor/github.com/cyphar/filepath-securejoin/join.go b/e2e/vendor/github.com/cyphar/filepath-securejoin/join.go index e0ee3f2b5..e6634d477 100644 --- a/e2e/vendor/github.com/cyphar/filepath-securejoin/join.go +++ b/e2e/vendor/github.com/cyphar/filepath-securejoin/join.go @@ -1,5 +1,5 @@ // Copyright (C) 2014-2015 Docker Inc & Go Authors. All rights reserved. -// Copyright (C) 2017-2024 SUSE LLC. All rights reserved. +// Copyright (C) 2017-2025 SUSE LLC. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -24,6 +24,31 @@ func IsNotExist(err error) bool { return errors.Is(err, os.ErrNotExist) || errors.Is(err, syscall.ENOTDIR) || errors.Is(err, syscall.ENOENT) } +// errUnsafeRoot is returned if the user provides SecureJoinVFS with a path +// that contains ".." components. +var errUnsafeRoot = errors.New("root path provided to SecureJoin contains '..' components") + +// stripVolume just gets rid of the Windows volume included in a path. Based on +// some godbolt tests, the Go compiler is smart enough to make this a no-op on +// Linux. +func stripVolume(path string) string { + return path[len(filepath.VolumeName(path)):] +} + +// hasDotDot checks if the path contains ".." components in a platform-agnostic +// way. +func hasDotDot(path string) bool { + // If we are on Windows, strip any volume letters. It turns out that + // C:..\foo may (or may not) be a valid pathname and we need to handle that + // leading "..". + path = stripVolume(path) + // Look for "/../" in the path, but we need to handle leading and trailing + // ".."s by adding separators. Doing this with filepath.Separator is ugly + // so just convert to Unix-style "/" first. + path = filepath.ToSlash(path) + return strings.Contains("/"+path+"/", "/../") +} + // SecureJoinVFS joins the two given path components (similar to [filepath.Join]) except // that the returned path is guaranteed to be scoped inside the provided root // path (when evaluated). Any symbolic links in the path are evaluated with the @@ -46,7 +71,22 @@ func IsNotExist(err error) bool { // provided via direct input or when evaluating symlinks. Therefore: // // "C:\Temp" + "D:\path\to\file.txt" results in "C:\Temp\path\to\file.txt" +// +// If the provided root is not [filepath.Clean] then an error will be returned, +// as such root paths are bordering on somewhat unsafe and using such paths is +// not best practice. We also strongly suggest that any root path is first +// fully resolved using [filepath.EvalSymlinks] or otherwise constructed to +// avoid containing symlink components. Of course, the root also *must not* be +// attacker-controlled. func SecureJoinVFS(root, unsafePath string, vfs VFS) (string, error) { + // The root path must not contain ".." components, otherwise when we join + // the subpath we will end up with a weird path. We could work around this + // in other ways but users shouldn't be giving us non-lexical root paths in + // the first place. + if hasDotDot(root) { + return "", errUnsafeRoot + } + // Use the os.* VFS implementation if none was specified. if vfs == nil { vfs = osVFS{} @@ -59,9 +99,10 @@ func SecureJoinVFS(root, unsafePath string, vfs VFS) (string, error) { linksWalked int ) for remainingPath != "" { - if v := filepath.VolumeName(remainingPath); v != "" { - remainingPath = remainingPath[len(v):] - } + // On Windows, if we managed to end up at a path referencing a volume, + // drop the volume to make sure we don't end up with broken paths or + // escaping the root volume. + remainingPath = stripVolume(remainingPath) // Get the next path component. var part string diff --git a/e2e/vendor/github.com/cyphar/filepath-securejoin/lookup_linux.go b/e2e/vendor/github.com/cyphar/filepath-securejoin/lookup_linux.go index 290befa15..be81e498d 100644 --- a/e2e/vendor/github.com/cyphar/filepath-securejoin/lookup_linux.go +++ b/e2e/vendor/github.com/cyphar/filepath-securejoin/lookup_linux.go @@ -12,7 +12,6 @@ import ( "os" "path" "path/filepath" - "slices" "strings" "golang.org/x/sys/unix" @@ -113,7 +112,7 @@ func (s *symlinkStack) push(dir *os.File, remainingPath, linkTarget string) erro return nil } // Split the link target and clean up any "" parts. - linkTargetParts := slices.DeleteFunc( + linkTargetParts := slices_DeleteFunc( strings.Split(linkTarget, "/"), func(part string) bool { return part == "" || part == "." }) diff --git a/e2e/vendor/github.com/cyphar/filepath-securejoin/mkdir_linux.go b/e2e/vendor/github.com/cyphar/filepath-securejoin/mkdir_linux.go index b5f674524..a17ae3b03 100644 --- a/e2e/vendor/github.com/cyphar/filepath-securejoin/mkdir_linux.go +++ b/e2e/vendor/github.com/cyphar/filepath-securejoin/mkdir_linux.go @@ -11,7 +11,6 @@ import ( "fmt" "os" "path/filepath" - "slices" "strings" "golang.org/x/sys/unix" @@ -22,6 +21,33 @@ var ( errPossibleAttack = errors.New("possible attack detected") ) +// modePermExt is like os.ModePerm except that it also includes the set[ug]id +// and sticky bits. +const modePermExt = os.ModePerm | os.ModeSetuid | os.ModeSetgid | os.ModeSticky + +//nolint:cyclop // this function needs to handle a lot of cases +func toUnixMode(mode os.FileMode) (uint32, error) { + sysMode := uint32(mode.Perm()) + if mode&os.ModeSetuid != 0 { + sysMode |= unix.S_ISUID + } + if mode&os.ModeSetgid != 0 { + sysMode |= unix.S_ISGID + } + if mode&os.ModeSticky != 0 { + sysMode |= unix.S_ISVTX + } + // We don't allow file type bits. + if mode&os.ModeType != 0 { + return 0, fmt.Errorf("%w %+.3o (%s): type bits not permitted", errInvalidMode, mode, mode) + } + // We don't allow other unknown modes. + if mode&^modePermExt != 0 || sysMode&unix.S_IFMT != 0 { + return 0, fmt.Errorf("%w %+.3o (%s): unknown mode bits", errInvalidMode, mode, mode) + } + return sysMode, nil +} + // MkdirAllHandle is equivalent to [MkdirAll], except that it is safer to use // in two respects: // @@ -40,17 +66,17 @@ var ( // a brand new lookup of unsafePath (such as with [SecureJoin] or openat2) after // doing [MkdirAll]. If you intend to open the directory after creating it, you // should use MkdirAllHandle. -func MkdirAllHandle(root *os.File, unsafePath string, mode int) (_ *os.File, Err error) { - // Make sure there are no os.FileMode bits set. - if mode&^0o7777 != 0 { - return nil, fmt.Errorf("%w for mkdir 0o%.3o", errInvalidMode, mode) +func MkdirAllHandle(root *os.File, unsafePath string, mode os.FileMode) (_ *os.File, Err error) { + unixMode, err := toUnixMode(mode) + if err != nil { + return nil, err } // On Linux, mkdirat(2) (and os.Mkdir) silently ignore the suid and sgid // bits. We could also silently ignore them but since we have very few // users it seems more prudent to return an error so users notice that // these bits will not be set. - if mode&^0o1777 != 0 { - return nil, fmt.Errorf("%w for mkdir 0o%.3o: suid and sgid are ignored by mkdir", errInvalidMode, mode) + if unixMode&^0o1777 != 0 { + return nil, fmt.Errorf("%w for mkdir %+.3o: suid and sgid are ignored by mkdir", errInvalidMode, mode) } // Try to open as much of the path as possible. @@ -93,7 +119,7 @@ func MkdirAllHandle(root *os.File, unsafePath string, mode int) (_ *os.File, Err } remainingParts := strings.Split(remainingPath, string(filepath.Separator)) - if slices.Contains(remainingParts, "..") { + if slices_Contains(remainingParts, "..") { // The path contained ".." components after the end of the "real" // components. We could try to safely resolve ".." here but that would // add a bunch of extra logic for something that it's not clear even @@ -105,9 +131,6 @@ func MkdirAllHandle(root *os.File, unsafePath string, mode int) (_ *os.File, Err return nil, fmt.Errorf("%w: yet-to-be-created path %q contains '..' components", unix.ENOENT, remainingPath) } - // Make sure the mode doesn't have any type bits. - mode &^= unix.S_IFMT - // Create the remaining components. for _, part := range remainingParts { switch part { @@ -119,11 +142,20 @@ func MkdirAllHandle(root *os.File, unsafePath string, mode int) (_ *os.File, Err // NOTE: mkdir(2) will not follow trailing symlinks, so we can safely // create the final component without worrying about symlink-exchange // attacks. - if err := unix.Mkdirat(int(currentDir.Fd()), part, uint32(mode)); err != nil { + // + // If we get -EEXIST, it's possible that another program created the + // directory at the same time as us. In that case, just continue on as + // if we created it (if the created inode is not a directory, the + // following open call will fail). + if err := unix.Mkdirat(int(currentDir.Fd()), part, unixMode); err != nil && !errors.Is(err, unix.EEXIST) { err = &os.PathError{Op: "mkdirat", Path: currentDir.Name() + "/" + part, Err: err} // Make the error a bit nicer if the directory is dead. - if err2 := isDeadInode(currentDir); err2 != nil { - err = fmt.Errorf("%w (%w)", err, err2) + if deadErr := isDeadInode(currentDir); deadErr != nil { + // TODO: Once we bump the minimum Go version to 1.20, we can use + // multiple %w verbs for this wrapping. For now we need to use a + // compatibility shim for older Go versions. + //err = fmt.Errorf("%w (%w)", err, deadErr) + err = wrapBaseError(err, deadErr) } return nil, err } @@ -188,10 +220,7 @@ func MkdirAllHandle(root *os.File, unsafePath string, mode int) (_ *os.File, Err // If you plan to open the directory after you have created it or want to use // an open directory handle as the root, you should use [MkdirAllHandle] instead. // This function is a wrapper around [MkdirAllHandle]. -// -// NOTE: The mode argument must be set the unix mode bits (unix.S_I...), not -// the Go generic mode bits ([os.FileMode]...). -func MkdirAll(root, unsafePath string, mode int) error { +func MkdirAll(root, unsafePath string, mode os.FileMode) error { rootDir, err := os.OpenFile(root, unix.O_PATH|unix.O_DIRECTORY|unix.O_CLOEXEC, 0) if err != nil { return err diff --git a/e2e/vendor/github.com/cyphar/filepath-securejoin/openat2_linux.go b/e2e/vendor/github.com/cyphar/filepath-securejoin/openat2_linux.go index ae3b381ef..f7a13e69c 100644 --- a/e2e/vendor/github.com/cyphar/filepath-securejoin/openat2_linux.go +++ b/e2e/vendor/github.com/cyphar/filepath-securejoin/openat2_linux.go @@ -12,12 +12,11 @@ import ( "os" "path/filepath" "strings" - "sync" "golang.org/x/sys/unix" ) -var hasOpenat2 = sync.OnceValue(func() bool { +var hasOpenat2 = sync_OnceValue(func() bool { fd, err := unix.Openat2(unix.AT_FDCWD, ".", &unix.OpenHow{ Flags: unix.O_PATH | unix.O_CLOEXEC, Resolve: unix.RESOLVE_NO_SYMLINKS | unix.RESOLVE_IN_ROOT, diff --git a/e2e/vendor/github.com/cyphar/filepath-securejoin/procfs_linux.go b/e2e/vendor/github.com/cyphar/filepath-securejoin/procfs_linux.go index 8cc827d70..809a579cb 100644 --- a/e2e/vendor/github.com/cyphar/filepath-securejoin/procfs_linux.go +++ b/e2e/vendor/github.com/cyphar/filepath-securejoin/procfs_linux.go @@ -12,7 +12,6 @@ import ( "os" "runtime" "strconv" - "sync" "golang.org/x/sys/unix" ) @@ -54,7 +53,7 @@ func verifyProcRoot(procRoot *os.File) error { return nil } -var hasNewMountApi = sync.OnceValue(func() bool { +var hasNewMountApi = sync_OnceValue(func() bool { // All of the pieces of the new mount API we use (fsopen, fsconfig, // fsmount, open_tree) were added together in Linux 5.1[1,2], so we can // just check for one of the syscalls and the others should also be @@ -192,11 +191,11 @@ func doGetProcRoot() (*os.File, error) { return procRoot, err } -var getProcRoot = sync.OnceValues(func() (*os.File, error) { +var getProcRoot = sync_OnceValues(func() (*os.File, error) { return doGetProcRoot() }) -var hasProcThreadSelf = sync.OnceValue(func() bool { +var hasProcThreadSelf = sync_OnceValue(func() bool { return unix.Access("/proc/thread-self/", unix.F_OK) == nil }) @@ -265,12 +264,20 @@ func procThreadSelf(procRoot *os.File, subpath string) (_ *os.File, _ procThread Resolve: unix.RESOLVE_BENEATH | unix.RESOLVE_NO_XDEV | unix.RESOLVE_NO_MAGICLINKS, }) if err != nil { - return nil, nil, fmt.Errorf("%w: %w", errUnsafeProcfs, err) + // TODO: Once we bump the minimum Go version to 1.20, we can use + // multiple %w verbs for this wrapping. For now we need to use a + // compatibility shim for older Go versions. + //err = fmt.Errorf("%w: %w", errUnsafeProcfs, err) + return nil, nil, wrapBaseError(err, errUnsafeProcfs) } } else { handle, err = openatFile(procRoot, threadSelf+subpath, unix.O_PATH|unix.O_NOFOLLOW|unix.O_CLOEXEC, 0) if err != nil { - return nil, nil, fmt.Errorf("%w: %w", errUnsafeProcfs, err) + // TODO: Once we bump the minimum Go version to 1.20, we can use + // multiple %w verbs for this wrapping. For now we need to use a + // compatibility shim for older Go versions. + //err = fmt.Errorf("%w: %w", errUnsafeProcfs, err) + return nil, nil, wrapBaseError(err, errUnsafeProcfs) } defer func() { if Err != nil { @@ -289,12 +296,17 @@ func procThreadSelf(procRoot *os.File, subpath string) (_ *os.File, _ procThread return handle, runtime.UnlockOSThread, nil } -var hasStatxMountId = sync.OnceValue(func() bool { +// STATX_MNT_ID_UNIQUE is provided in golang.org/x/sys@v0.20.0, but in order to +// avoid bumping the requirement for a single constant we can just define it +// ourselves. +const STATX_MNT_ID_UNIQUE = 0x4000 + +var hasStatxMountId = sync_OnceValue(func() bool { var ( stx unix.Statx_t // We don't care which mount ID we get. The kernel will give us the // unique one if it is supported. - wantStxMask uint32 = unix.STATX_MNT_ID_UNIQUE | unix.STATX_MNT_ID + wantStxMask uint32 = STATX_MNT_ID_UNIQUE | unix.STATX_MNT_ID ) err := unix.Statx(-int(unix.EBADF), "/", 0, int(wantStxMask), &stx) return err == nil && stx.Mask&wantStxMask != 0 @@ -310,7 +322,7 @@ func getMountId(dir *os.File, path string) (uint64, error) { stx unix.Statx_t // We don't care which mount ID we get. The kernel will give us the // unique one if it is supported. - wantStxMask uint32 = unix.STATX_MNT_ID_UNIQUE | unix.STATX_MNT_ID + wantStxMask uint32 = STATX_MNT_ID_UNIQUE | unix.STATX_MNT_ID ) err := unix.Statx(int(dir.Fd()), path, unix.AT_EMPTY_PATH|unix.AT_SYMLINK_NOFOLLOW, int(wantStxMask), &stx) diff --git a/e2e/vendor/github.com/golang/protobuf/AUTHORS b/e2e/vendor/github.com/golang/protobuf/AUTHORS deleted file mode 100644 index 15167cd74..000000000 --- a/e2e/vendor/github.com/golang/protobuf/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code refers to The Go Authors for copyright purposes. -# The master list of authors is in the main Go distribution, -# visible at http://tip.golang.org/AUTHORS. diff --git a/e2e/vendor/github.com/golang/protobuf/CONTRIBUTORS b/e2e/vendor/github.com/golang/protobuf/CONTRIBUTORS deleted file mode 100644 index 1c4577e96..000000000 --- a/e2e/vendor/github.com/golang/protobuf/CONTRIBUTORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code was written by the Go contributors. -# The master list of contributors is in the main Go distribution, -# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/e2e/vendor/github.com/golang/protobuf/LICENSE b/e2e/vendor/github.com/golang/protobuf/LICENSE deleted file mode 100644 index 0f646931a..000000000 --- a/e2e/vendor/github.com/golang/protobuf/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright 2010 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/e2e/vendor/github.com/golang/protobuf/proto/buffer.go b/e2e/vendor/github.com/golang/protobuf/proto/buffer.go deleted file mode 100644 index e810e6fea..000000000 --- a/e2e/vendor/github.com/golang/protobuf/proto/buffer.go +++ /dev/null @@ -1,324 +0,0 @@ -// Copyright 2019 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 proto - -import ( - "errors" - "fmt" - - "google.golang.org/protobuf/encoding/prototext" - "google.golang.org/protobuf/encoding/protowire" - "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - WireVarint = 0 - WireFixed32 = 5 - WireFixed64 = 1 - WireBytes = 2 - WireStartGroup = 3 - WireEndGroup = 4 -) - -// EncodeVarint returns the varint encoded bytes of v. -func EncodeVarint(v uint64) []byte { - return protowire.AppendVarint(nil, v) -} - -// SizeVarint returns the length of the varint encoded bytes of v. -// This is equal to len(EncodeVarint(v)). -func SizeVarint(v uint64) int { - return protowire.SizeVarint(v) -} - -// DecodeVarint parses a varint encoded integer from b, -// returning the integer value and the length of the varint. -// It returns (0, 0) if there is a parse error. -func DecodeVarint(b []byte) (uint64, int) { - v, n := protowire.ConsumeVarint(b) - if n < 0 { - return 0, 0 - } - return v, n -} - -// Buffer is a buffer for encoding and decoding the protobuf wire format. -// It may be reused between invocations to reduce memory usage. -type Buffer struct { - buf []byte - idx int - deterministic bool -} - -// NewBuffer allocates a new Buffer initialized with buf, -// where the contents of buf are considered the unread portion of the buffer. -func NewBuffer(buf []byte) *Buffer { - return &Buffer{buf: buf} -} - -// SetDeterministic specifies whether to use deterministic serialization. -// -// Deterministic serialization guarantees that for a given binary, equal -// messages will always be serialized to the same bytes. This implies: -// -// - Repeated serialization of a message will return the same bytes. -// - Different processes of the same binary (which may be executing on -// different machines) will serialize equal messages to the same bytes. -// -// Note that the deterministic serialization is NOT canonical across -// languages. It is not guaranteed to remain stable over time. It is unstable -// across different builds with schema changes due to unknown fields. -// Users who need canonical serialization (e.g., persistent storage in a -// canonical form, fingerprinting, etc.) should define their own -// canonicalization specification and implement their own serializer rather -// than relying on this API. -// -// If deterministic serialization is requested, map entries will be sorted -// by keys in lexographical order. This is an implementation detail and -// subject to change. -func (b *Buffer) SetDeterministic(deterministic bool) { - b.deterministic = deterministic -} - -// SetBuf sets buf as the internal buffer, -// where the contents of buf are considered the unread portion of the buffer. -func (b *Buffer) SetBuf(buf []byte) { - b.buf = buf - b.idx = 0 -} - -// Reset clears the internal buffer of all written and unread data. -func (b *Buffer) Reset() { - b.buf = b.buf[:0] - b.idx = 0 -} - -// Bytes returns the internal buffer. -func (b *Buffer) Bytes() []byte { - return b.buf -} - -// Unread returns the unread portion of the buffer. -func (b *Buffer) Unread() []byte { - return b.buf[b.idx:] -} - -// Marshal appends the wire-format encoding of m to the buffer. -func (b *Buffer) Marshal(m Message) error { - var err error - b.buf, err = marshalAppend(b.buf, m, b.deterministic) - return err -} - -// Unmarshal parses the wire-format message in the buffer and -// places the decoded results in m. -// It does not reset m before unmarshaling. -func (b *Buffer) Unmarshal(m Message) error { - err := UnmarshalMerge(b.Unread(), m) - b.idx = len(b.buf) - return err -} - -type unknownFields struct{ XXX_unrecognized protoimpl.UnknownFields } - -func (m *unknownFields) String() string { panic("not implemented") } -func (m *unknownFields) Reset() { panic("not implemented") } -func (m *unknownFields) ProtoMessage() { panic("not implemented") } - -// DebugPrint dumps the encoded bytes of b with a header and footer including s -// to stdout. This is only intended for debugging. -func (*Buffer) DebugPrint(s string, b []byte) { - m := MessageReflect(new(unknownFields)) - m.SetUnknown(b) - b, _ = prototext.MarshalOptions{AllowPartial: true, Indent: "\t"}.Marshal(m.Interface()) - fmt.Printf("==== %s ====\n%s==== %s ====\n", s, b, s) -} - -// EncodeVarint appends an unsigned varint encoding to the buffer. -func (b *Buffer) EncodeVarint(v uint64) error { - b.buf = protowire.AppendVarint(b.buf, v) - return nil -} - -// EncodeZigzag32 appends a 32-bit zig-zag varint encoding to the buffer. -func (b *Buffer) EncodeZigzag32(v uint64) error { - return b.EncodeVarint(uint64((uint32(v) << 1) ^ uint32((int32(v) >> 31)))) -} - -// EncodeZigzag64 appends a 64-bit zig-zag varint encoding to the buffer. -func (b *Buffer) EncodeZigzag64(v uint64) error { - return b.EncodeVarint(uint64((uint64(v) << 1) ^ uint64((int64(v) >> 63)))) -} - -// EncodeFixed32 appends a 32-bit little-endian integer to the buffer. -func (b *Buffer) EncodeFixed32(v uint64) error { - b.buf = protowire.AppendFixed32(b.buf, uint32(v)) - return nil -} - -// EncodeFixed64 appends a 64-bit little-endian integer to the buffer. -func (b *Buffer) EncodeFixed64(v uint64) error { - b.buf = protowire.AppendFixed64(b.buf, uint64(v)) - return nil -} - -// EncodeRawBytes appends a length-prefixed raw bytes to the buffer. -func (b *Buffer) EncodeRawBytes(v []byte) error { - b.buf = protowire.AppendBytes(b.buf, v) - return nil -} - -// EncodeStringBytes appends a length-prefixed raw bytes to the buffer. -// It does not validate whether v contains valid UTF-8. -func (b *Buffer) EncodeStringBytes(v string) error { - b.buf = protowire.AppendString(b.buf, v) - return nil -} - -// EncodeMessage appends a length-prefixed encoded message to the buffer. -func (b *Buffer) EncodeMessage(m Message) error { - var err error - b.buf = protowire.AppendVarint(b.buf, uint64(Size(m))) - b.buf, err = marshalAppend(b.buf, m, b.deterministic) - return err -} - -// DecodeVarint consumes an encoded unsigned varint from the buffer. -func (b *Buffer) DecodeVarint() (uint64, error) { - v, n := protowire.ConsumeVarint(b.buf[b.idx:]) - if n < 0 { - return 0, protowire.ParseError(n) - } - b.idx += n - return uint64(v), nil -} - -// DecodeZigzag32 consumes an encoded 32-bit zig-zag varint from the buffer. -func (b *Buffer) DecodeZigzag32() (uint64, error) { - v, err := b.DecodeVarint() - if err != nil { - return 0, err - } - return uint64((uint32(v) >> 1) ^ uint32((int32(v&1)<<31)>>31)), nil -} - -// DecodeZigzag64 consumes an encoded 64-bit zig-zag varint from the buffer. -func (b *Buffer) DecodeZigzag64() (uint64, error) { - v, err := b.DecodeVarint() - if err != nil { - return 0, err - } - return uint64((uint64(v) >> 1) ^ uint64((int64(v&1)<<63)>>63)), nil -} - -// DecodeFixed32 consumes a 32-bit little-endian integer from the buffer. -func (b *Buffer) DecodeFixed32() (uint64, error) { - v, n := protowire.ConsumeFixed32(b.buf[b.idx:]) - if n < 0 { - return 0, protowire.ParseError(n) - } - b.idx += n - return uint64(v), nil -} - -// DecodeFixed64 consumes a 64-bit little-endian integer from the buffer. -func (b *Buffer) DecodeFixed64() (uint64, error) { - v, n := protowire.ConsumeFixed64(b.buf[b.idx:]) - if n < 0 { - return 0, protowire.ParseError(n) - } - b.idx += n - return uint64(v), nil -} - -// DecodeRawBytes consumes a length-prefixed raw bytes from the buffer. -// If alloc is specified, it returns a copy the raw bytes -// rather than a sub-slice of the buffer. -func (b *Buffer) DecodeRawBytes(alloc bool) ([]byte, error) { - v, n := protowire.ConsumeBytes(b.buf[b.idx:]) - if n < 0 { - return nil, protowire.ParseError(n) - } - b.idx += n - if alloc { - v = append([]byte(nil), v...) - } - return v, nil -} - -// DecodeStringBytes consumes a length-prefixed raw bytes from the buffer. -// It does not validate whether the raw bytes contain valid UTF-8. -func (b *Buffer) DecodeStringBytes() (string, error) { - v, n := protowire.ConsumeString(b.buf[b.idx:]) - if n < 0 { - return "", protowire.ParseError(n) - } - b.idx += n - return v, nil -} - -// DecodeMessage consumes a length-prefixed message from the buffer. -// It does not reset m before unmarshaling. -func (b *Buffer) DecodeMessage(m Message) error { - v, err := b.DecodeRawBytes(false) - if err != nil { - return err - } - return UnmarshalMerge(v, m) -} - -// DecodeGroup consumes a message group from the buffer. -// It assumes that the start group marker has already been consumed and -// consumes all bytes until (and including the end group marker). -// It does not reset m before unmarshaling. -func (b *Buffer) DecodeGroup(m Message) error { - v, n, err := consumeGroup(b.buf[b.idx:]) - if err != nil { - return err - } - b.idx += n - return UnmarshalMerge(v, m) -} - -// consumeGroup parses b until it finds an end group marker, returning -// the raw bytes of the message (excluding the end group marker) and the -// the total length of the message (including the end group marker). -func consumeGroup(b []byte) ([]byte, int, error) { - b0 := b - depth := 1 // assume this follows a start group marker - for { - _, wtyp, tagLen := protowire.ConsumeTag(b) - if tagLen < 0 { - return nil, 0, protowire.ParseError(tagLen) - } - b = b[tagLen:] - - var valLen int - switch wtyp { - case protowire.VarintType: - _, valLen = protowire.ConsumeVarint(b) - case protowire.Fixed32Type: - _, valLen = protowire.ConsumeFixed32(b) - case protowire.Fixed64Type: - _, valLen = protowire.ConsumeFixed64(b) - case protowire.BytesType: - _, valLen = protowire.ConsumeBytes(b) - case protowire.StartGroupType: - depth++ - case protowire.EndGroupType: - depth-- - default: - return nil, 0, errors.New("proto: cannot parse reserved wire type") - } - if valLen < 0 { - return nil, 0, protowire.ParseError(valLen) - } - b = b[valLen:] - - if depth == 0 { - return b0[:len(b0)-len(b)-tagLen], len(b0) - len(b), nil - } - } -} diff --git a/e2e/vendor/github.com/golang/protobuf/proto/defaults.go b/e2e/vendor/github.com/golang/protobuf/proto/defaults.go deleted file mode 100644 index d399bf069..000000000 --- a/e2e/vendor/github.com/golang/protobuf/proto/defaults.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2019 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 proto - -import ( - "google.golang.org/protobuf/reflect/protoreflect" -) - -// SetDefaults sets unpopulated scalar fields to their default values. -// Fields within a oneof are not set even if they have a default value. -// SetDefaults is recursively called upon any populated message fields. -func SetDefaults(m Message) { - if m != nil { - setDefaults(MessageReflect(m)) - } -} - -func setDefaults(m protoreflect.Message) { - fds := m.Descriptor().Fields() - for i := 0; i < fds.Len(); i++ { - fd := fds.Get(i) - if !m.Has(fd) { - if fd.HasDefault() && fd.ContainingOneof() == nil { - v := fd.Default() - if fd.Kind() == protoreflect.BytesKind { - v = protoreflect.ValueOf(append([]byte(nil), v.Bytes()...)) // copy the default bytes - } - m.Set(fd, v) - } - continue - } - } - - m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { - switch { - // Handle singular message. - case fd.Cardinality() != protoreflect.Repeated: - if fd.Message() != nil { - setDefaults(m.Get(fd).Message()) - } - // Handle list of messages. - case fd.IsList(): - if fd.Message() != nil { - ls := m.Get(fd).List() - for i := 0; i < ls.Len(); i++ { - setDefaults(ls.Get(i).Message()) - } - } - // Handle map of messages. - case fd.IsMap(): - if fd.MapValue().Message() != nil { - ms := m.Get(fd).Map() - ms.Range(func(_ protoreflect.MapKey, v protoreflect.Value) bool { - setDefaults(v.Message()) - return true - }) - } - } - return true - }) -} diff --git a/e2e/vendor/github.com/golang/protobuf/proto/deprecated.go b/e2e/vendor/github.com/golang/protobuf/proto/deprecated.go deleted file mode 100644 index e8db57e09..000000000 --- a/e2e/vendor/github.com/golang/protobuf/proto/deprecated.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2018 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 proto - -import ( - "encoding/json" - "errors" - "fmt" - "strconv" - - protoV2 "google.golang.org/protobuf/proto" -) - -var ( - // Deprecated: No longer returned. - ErrNil = errors.New("proto: Marshal called with nil") - - // Deprecated: No longer returned. - ErrTooLarge = errors.New("proto: message encodes to over 2 GB") - - // Deprecated: No longer returned. - ErrInternalBadWireType = errors.New("proto: internal error: bad wiretype for oneof") -) - -// Deprecated: Do not use. -type Stats struct{ Emalloc, Dmalloc, Encode, Decode, Chit, Cmiss, Size uint64 } - -// Deprecated: Do not use. -func GetStats() Stats { return Stats{} } - -// Deprecated: Do not use. -func MarshalMessageSet(interface{}) ([]byte, error) { - return nil, errors.New("proto: not implemented") -} - -// Deprecated: Do not use. -func UnmarshalMessageSet([]byte, interface{}) error { - return errors.New("proto: not implemented") -} - -// Deprecated: Do not use. -func MarshalMessageSetJSON(interface{}) ([]byte, error) { - return nil, errors.New("proto: not implemented") -} - -// Deprecated: Do not use. -func UnmarshalMessageSetJSON([]byte, interface{}) error { - return errors.New("proto: not implemented") -} - -// Deprecated: Do not use. -func RegisterMessageSetType(Message, int32, string) {} - -// Deprecated: Do not use. -func EnumName(m map[int32]string, v int32) string { - s, ok := m[v] - if ok { - return s - } - return strconv.Itoa(int(v)) -} - -// Deprecated: Do not use. -func UnmarshalJSONEnum(m map[string]int32, data []byte, enumName string) (int32, error) { - if data[0] == '"' { - // New style: enums are strings. - var repr string - if err := json.Unmarshal(data, &repr); err != nil { - return -1, err - } - val, ok := m[repr] - if !ok { - return 0, fmt.Errorf("unrecognized enum %s value %q", enumName, repr) - } - return val, nil - } - // Old style: enums are ints. - var val int32 - if err := json.Unmarshal(data, &val); err != nil { - return 0, fmt.Errorf("cannot unmarshal %#q into enum %s", data, enumName) - } - return val, nil -} - -// Deprecated: Do not use; this type existed for intenal-use only. -type InternalMessageInfo struct{} - -// Deprecated: Do not use; this method existed for intenal-use only. -func (*InternalMessageInfo) DiscardUnknown(m Message) { - DiscardUnknown(m) -} - -// Deprecated: Do not use; this method existed for intenal-use only. -func (*InternalMessageInfo) Marshal(b []byte, m Message, deterministic bool) ([]byte, error) { - return protoV2.MarshalOptions{Deterministic: deterministic}.MarshalAppend(b, MessageV2(m)) -} - -// Deprecated: Do not use; this method existed for intenal-use only. -func (*InternalMessageInfo) Merge(dst, src Message) { - protoV2.Merge(MessageV2(dst), MessageV2(src)) -} - -// Deprecated: Do not use; this method existed for intenal-use only. -func (*InternalMessageInfo) Size(m Message) int { - return protoV2.Size(MessageV2(m)) -} - -// Deprecated: Do not use; this method existed for intenal-use only. -func (*InternalMessageInfo) Unmarshal(m Message, b []byte) error { - return protoV2.UnmarshalOptions{Merge: true}.Unmarshal(b, MessageV2(m)) -} diff --git a/e2e/vendor/github.com/golang/protobuf/proto/discard.go b/e2e/vendor/github.com/golang/protobuf/proto/discard.go deleted file mode 100644 index 2187e877f..000000000 --- a/e2e/vendor/github.com/golang/protobuf/proto/discard.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2019 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 proto - -import ( - "google.golang.org/protobuf/reflect/protoreflect" -) - -// DiscardUnknown recursively discards all unknown fields from this message -// and all embedded messages. -// -// When unmarshaling a message with unrecognized fields, the tags and values -// of such fields are preserved in the Message. This allows a later call to -// marshal to be able to produce a message that continues to have those -// unrecognized fields. To avoid this, DiscardUnknown is used to -// explicitly clear the unknown fields after unmarshaling. -func DiscardUnknown(m Message) { - if m != nil { - discardUnknown(MessageReflect(m)) - } -} - -func discardUnknown(m protoreflect.Message) { - m.Range(func(fd protoreflect.FieldDescriptor, val protoreflect.Value) bool { - switch { - // Handle singular message. - case fd.Cardinality() != protoreflect.Repeated: - if fd.Message() != nil { - discardUnknown(m.Get(fd).Message()) - } - // Handle list of messages. - case fd.IsList(): - if fd.Message() != nil { - ls := m.Get(fd).List() - for i := 0; i < ls.Len(); i++ { - discardUnknown(ls.Get(i).Message()) - } - } - // Handle map of messages. - case fd.IsMap(): - if fd.MapValue().Message() != nil { - ms := m.Get(fd).Map() - ms.Range(func(_ protoreflect.MapKey, v protoreflect.Value) bool { - discardUnknown(v.Message()) - return true - }) - } - } - return true - }) - - // Discard unknown fields. - if len(m.GetUnknown()) > 0 { - m.SetUnknown(nil) - } -} diff --git a/e2e/vendor/github.com/golang/protobuf/proto/extensions.go b/e2e/vendor/github.com/golang/protobuf/proto/extensions.go deleted file mode 100644 index 42fc120c9..000000000 --- a/e2e/vendor/github.com/golang/protobuf/proto/extensions.go +++ /dev/null @@ -1,356 +0,0 @@ -// Copyright 2010 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 proto - -import ( - "errors" - "fmt" - "reflect" - - "google.golang.org/protobuf/encoding/protowire" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - "google.golang.org/protobuf/runtime/protoiface" - "google.golang.org/protobuf/runtime/protoimpl" -) - -type ( - // ExtensionDesc represents an extension descriptor and - // is used to interact with an extension field in a message. - // - // Variables of this type are generated in code by protoc-gen-go. - ExtensionDesc = protoimpl.ExtensionInfo - - // ExtensionRange represents a range of message extensions. - // Used in code generated by protoc-gen-go. - ExtensionRange = protoiface.ExtensionRangeV1 - - // Deprecated: Do not use; this is an internal type. - Extension = protoimpl.ExtensionFieldV1 - - // Deprecated: Do not use; this is an internal type. - XXX_InternalExtensions = protoimpl.ExtensionFields -) - -// ErrMissingExtension reports whether the extension was not present. -var ErrMissingExtension = errors.New("proto: missing extension") - -var errNotExtendable = errors.New("proto: not an extendable proto.Message") - -// HasExtension reports whether the extension field is present in m -// either as an explicitly populated field or as an unknown field. -func HasExtension(m Message, xt *ExtensionDesc) (has bool) { - mr := MessageReflect(m) - if mr == nil || !mr.IsValid() { - return false - } - - // Check whether any populated known field matches the field number. - xtd := xt.TypeDescriptor() - if isValidExtension(mr.Descriptor(), xtd) { - has = mr.Has(xtd) - } else { - mr.Range(func(fd protoreflect.FieldDescriptor, _ protoreflect.Value) bool { - has = int32(fd.Number()) == xt.Field - return !has - }) - } - - // Check whether any unknown field matches the field number. - for b := mr.GetUnknown(); !has && len(b) > 0; { - num, _, n := protowire.ConsumeField(b) - has = int32(num) == xt.Field - b = b[n:] - } - return has -} - -// ClearExtension removes the extension field from m -// either as an explicitly populated field or as an unknown field. -func ClearExtension(m Message, xt *ExtensionDesc) { - mr := MessageReflect(m) - if mr == nil || !mr.IsValid() { - return - } - - xtd := xt.TypeDescriptor() - if isValidExtension(mr.Descriptor(), xtd) { - mr.Clear(xtd) - } else { - mr.Range(func(fd protoreflect.FieldDescriptor, _ protoreflect.Value) bool { - if int32(fd.Number()) == xt.Field { - mr.Clear(fd) - return false - } - return true - }) - } - clearUnknown(mr, fieldNum(xt.Field)) -} - -// ClearAllExtensions clears all extensions from m. -// This includes populated fields and unknown fields in the extension range. -func ClearAllExtensions(m Message) { - mr := MessageReflect(m) - if mr == nil || !mr.IsValid() { - return - } - - mr.Range(func(fd protoreflect.FieldDescriptor, _ protoreflect.Value) bool { - if fd.IsExtension() { - mr.Clear(fd) - } - return true - }) - clearUnknown(mr, mr.Descriptor().ExtensionRanges()) -} - -// GetExtension retrieves a proto2 extended field from m. -// -// If the descriptor is type complete (i.e., ExtensionDesc.ExtensionType is non-nil), -// then GetExtension parses the encoded field and returns a Go value of the specified type. -// If the field is not present, then the default value is returned (if one is specified), -// otherwise ErrMissingExtension is reported. -// -// If the descriptor is type incomplete (i.e., ExtensionDesc.ExtensionType is nil), -// then GetExtension returns the raw encoded bytes for the extension field. -func GetExtension(m Message, xt *ExtensionDesc) (interface{}, error) { - mr := MessageReflect(m) - if mr == nil || !mr.IsValid() || mr.Descriptor().ExtensionRanges().Len() == 0 { - return nil, errNotExtendable - } - - // Retrieve the unknown fields for this extension field. - var bo protoreflect.RawFields - for bi := mr.GetUnknown(); len(bi) > 0; { - num, _, n := protowire.ConsumeField(bi) - if int32(num) == xt.Field { - bo = append(bo, bi[:n]...) - } - bi = bi[n:] - } - - // For type incomplete descriptors, only retrieve the unknown fields. - if xt.ExtensionType == nil { - return []byte(bo), nil - } - - // If the extension field only exists as unknown fields, unmarshal it. - // This is rarely done since proto.Unmarshal eagerly unmarshals extensions. - xtd := xt.TypeDescriptor() - if !isValidExtension(mr.Descriptor(), xtd) { - return nil, fmt.Errorf("proto: bad extended type; %T does not extend %T", xt.ExtendedType, m) - } - if !mr.Has(xtd) && len(bo) > 0 { - m2 := mr.New() - if err := (proto.UnmarshalOptions{ - Resolver: extensionResolver{xt}, - }.Unmarshal(bo, m2.Interface())); err != nil { - return nil, err - } - if m2.Has(xtd) { - mr.Set(xtd, m2.Get(xtd)) - clearUnknown(mr, fieldNum(xt.Field)) - } - } - - // Check whether the message has the extension field set or a default. - var pv protoreflect.Value - switch { - case mr.Has(xtd): - pv = mr.Get(xtd) - case xtd.HasDefault(): - pv = xtd.Default() - default: - return nil, ErrMissingExtension - } - - v := xt.InterfaceOf(pv) - rv := reflect.ValueOf(v) - if isScalarKind(rv.Kind()) { - rv2 := reflect.New(rv.Type()) - rv2.Elem().Set(rv) - v = rv2.Interface() - } - return v, nil -} - -// extensionResolver is a custom extension resolver that stores a single -// extension type that takes precedence over the global registry. -type extensionResolver struct{ xt protoreflect.ExtensionType } - -func (r extensionResolver) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) { - if xtd := r.xt.TypeDescriptor(); xtd.FullName() == field { - return r.xt, nil - } - return protoregistry.GlobalTypes.FindExtensionByName(field) -} - -func (r extensionResolver) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) { - if xtd := r.xt.TypeDescriptor(); xtd.ContainingMessage().FullName() == message && xtd.Number() == field { - return r.xt, nil - } - return protoregistry.GlobalTypes.FindExtensionByNumber(message, field) -} - -// GetExtensions returns a list of the extensions values present in m, -// corresponding with the provided list of extension descriptors, xts. -// If an extension is missing in m, the corresponding value is nil. -func GetExtensions(m Message, xts []*ExtensionDesc) ([]interface{}, error) { - mr := MessageReflect(m) - if mr == nil || !mr.IsValid() { - return nil, errNotExtendable - } - - vs := make([]interface{}, len(xts)) - for i, xt := range xts { - v, err := GetExtension(m, xt) - if err != nil { - if err == ErrMissingExtension { - continue - } - return vs, err - } - vs[i] = v - } - return vs, nil -} - -// SetExtension sets an extension field in m to the provided value. -func SetExtension(m Message, xt *ExtensionDesc, v interface{}) error { - mr := MessageReflect(m) - if mr == nil || !mr.IsValid() || mr.Descriptor().ExtensionRanges().Len() == 0 { - return errNotExtendable - } - - rv := reflect.ValueOf(v) - if reflect.TypeOf(v) != reflect.TypeOf(xt.ExtensionType) { - return fmt.Errorf("proto: bad extension value type. got: %T, want: %T", v, xt.ExtensionType) - } - if rv.Kind() == reflect.Ptr { - if rv.IsNil() { - return fmt.Errorf("proto: SetExtension called with nil value of type %T", v) - } - if isScalarKind(rv.Elem().Kind()) { - v = rv.Elem().Interface() - } - } - - xtd := xt.TypeDescriptor() - if !isValidExtension(mr.Descriptor(), xtd) { - return fmt.Errorf("proto: bad extended type; %T does not extend %T", xt.ExtendedType, m) - } - mr.Set(xtd, xt.ValueOf(v)) - clearUnknown(mr, fieldNum(xt.Field)) - return nil -} - -// SetRawExtension inserts b into the unknown fields of m. -// -// Deprecated: Use Message.ProtoReflect.SetUnknown instead. -func SetRawExtension(m Message, fnum int32, b []byte) { - mr := MessageReflect(m) - if mr == nil || !mr.IsValid() { - return - } - - // Verify that the raw field is valid. - for b0 := b; len(b0) > 0; { - num, _, n := protowire.ConsumeField(b0) - if int32(num) != fnum { - panic(fmt.Sprintf("mismatching field number: got %d, want %d", num, fnum)) - } - b0 = b0[n:] - } - - ClearExtension(m, &ExtensionDesc{Field: fnum}) - mr.SetUnknown(append(mr.GetUnknown(), b...)) -} - -// ExtensionDescs returns a list of extension descriptors found in m, -// containing descriptors for both populated extension fields in m and -// also unknown fields of m that are in the extension range. -// For the later case, an type incomplete descriptor is provided where only -// the ExtensionDesc.Field field is populated. -// The order of the extension descriptors is undefined. -func ExtensionDescs(m Message) ([]*ExtensionDesc, error) { - mr := MessageReflect(m) - if mr == nil || !mr.IsValid() || mr.Descriptor().ExtensionRanges().Len() == 0 { - return nil, errNotExtendable - } - - // Collect a set of known extension descriptors. - extDescs := make(map[protoreflect.FieldNumber]*ExtensionDesc) - mr.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { - if fd.IsExtension() { - xt := fd.(protoreflect.ExtensionTypeDescriptor) - if xd, ok := xt.Type().(*ExtensionDesc); ok { - extDescs[fd.Number()] = xd - } - } - return true - }) - - // Collect a set of unknown extension descriptors. - extRanges := mr.Descriptor().ExtensionRanges() - for b := mr.GetUnknown(); len(b) > 0; { - num, _, n := protowire.ConsumeField(b) - if extRanges.Has(num) && extDescs[num] == nil { - extDescs[num] = nil - } - b = b[n:] - } - - // Transpose the set of descriptors into a list. - var xts []*ExtensionDesc - for num, xt := range extDescs { - if xt == nil { - xt = &ExtensionDesc{Field: int32(num)} - } - xts = append(xts, xt) - } - return xts, nil -} - -// isValidExtension reports whether xtd is a valid extension descriptor for md. -func isValidExtension(md protoreflect.MessageDescriptor, xtd protoreflect.ExtensionTypeDescriptor) bool { - return xtd.ContainingMessage() == md && md.ExtensionRanges().Has(xtd.Number()) -} - -// isScalarKind reports whether k is a protobuf scalar kind (except bytes). -// This function exists for historical reasons since the representation of -// scalars differs between v1 and v2, where v1 uses *T and v2 uses T. -func isScalarKind(k reflect.Kind) bool { - switch k { - case reflect.Bool, reflect.Int32, reflect.Int64, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64, reflect.String: - return true - default: - return false - } -} - -// clearUnknown removes unknown fields from m where remover.Has reports true. -func clearUnknown(m protoreflect.Message, remover interface { - Has(protoreflect.FieldNumber) bool -}) { - var bo protoreflect.RawFields - for bi := m.GetUnknown(); len(bi) > 0; { - num, _, n := protowire.ConsumeField(bi) - if !remover.Has(num) { - bo = append(bo, bi[:n]...) - } - bi = bi[n:] - } - if bi := m.GetUnknown(); len(bi) != len(bo) { - m.SetUnknown(bo) - } -} - -type fieldNum protoreflect.FieldNumber - -func (n1 fieldNum) Has(n2 protoreflect.FieldNumber) bool { - return protoreflect.FieldNumber(n1) == n2 -} diff --git a/e2e/vendor/github.com/golang/protobuf/proto/properties.go b/e2e/vendor/github.com/golang/protobuf/proto/properties.go deleted file mode 100644 index dcdc2202f..000000000 --- a/e2e/vendor/github.com/golang/protobuf/proto/properties.go +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright 2010 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 proto - -import ( - "fmt" - "reflect" - "strconv" - "strings" - "sync" - - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/runtime/protoimpl" -) - -// StructProperties represents protocol buffer type information for a -// generated protobuf message in the open-struct API. -// -// Deprecated: Do not use. -type StructProperties struct { - // Prop are the properties for each field. - // - // Fields belonging to a oneof are stored in OneofTypes instead, with a - // single Properties representing the parent oneof held here. - // - // The order of Prop matches the order of fields in the Go struct. - // Struct fields that are not related to protobufs have a "XXX_" prefix - // in the Properties.Name and must be ignored by the user. - Prop []*Properties - - // OneofTypes contains information about the oneof fields in this message. - // It is keyed by the protobuf field name. - OneofTypes map[string]*OneofProperties -} - -// Properties represents the type information for a protobuf message field. -// -// Deprecated: Do not use. -type Properties struct { - // Name is a placeholder name with little meaningful semantic value. - // If the name has an "XXX_" prefix, the entire Properties must be ignored. - Name string - // OrigName is the protobuf field name or oneof name. - OrigName string - // JSONName is the JSON name for the protobuf field. - JSONName string - // Enum is a placeholder name for enums. - // For historical reasons, this is neither the Go name for the enum, - // nor the protobuf name for the enum. - Enum string // Deprecated: Do not use. - // Weak contains the full name of the weakly referenced message. - Weak string - // Wire is a string representation of the wire type. - Wire string - // WireType is the protobuf wire type for the field. - WireType int - // Tag is the protobuf field number. - Tag int - // Required reports whether this is a required field. - Required bool - // Optional reports whether this is a optional field. - Optional bool - // Repeated reports whether this is a repeated field. - Repeated bool - // Packed reports whether this is a packed repeated field of scalars. - Packed bool - // Proto3 reports whether this field operates under the proto3 syntax. - Proto3 bool - // Oneof reports whether this field belongs within a oneof. - Oneof bool - - // Default is the default value in string form. - Default string - // HasDefault reports whether the field has a default value. - HasDefault bool - - // MapKeyProp is the properties for the key field for a map field. - MapKeyProp *Properties - // MapValProp is the properties for the value field for a map field. - MapValProp *Properties -} - -// OneofProperties represents the type information for a protobuf oneof. -// -// Deprecated: Do not use. -type OneofProperties struct { - // Type is a pointer to the generated wrapper type for the field value. - // This is nil for messages that are not in the open-struct API. - Type reflect.Type - // Field is the index into StructProperties.Prop for the containing oneof. - Field int - // Prop is the properties for the field. - Prop *Properties -} - -// String formats the properties in the protobuf struct field tag style. -func (p *Properties) String() string { - s := p.Wire - s += "," + strconv.Itoa(p.Tag) - if p.Required { - s += ",req" - } - if p.Optional { - s += ",opt" - } - if p.Repeated { - s += ",rep" - } - if p.Packed { - s += ",packed" - } - s += ",name=" + p.OrigName - if p.JSONName != "" { - s += ",json=" + p.JSONName - } - if len(p.Enum) > 0 { - s += ",enum=" + p.Enum - } - if len(p.Weak) > 0 { - s += ",weak=" + p.Weak - } - if p.Proto3 { - s += ",proto3" - } - if p.Oneof { - s += ",oneof" - } - if p.HasDefault { - s += ",def=" + p.Default - } - return s -} - -// Parse populates p by parsing a string in the protobuf struct field tag style. -func (p *Properties) Parse(tag string) { - // For example: "bytes,49,opt,name=foo,def=hello!" - for len(tag) > 0 { - i := strings.IndexByte(tag, ',') - if i < 0 { - i = len(tag) - } - switch s := tag[:i]; { - case strings.HasPrefix(s, "name="): - p.OrigName = s[len("name="):] - case strings.HasPrefix(s, "json="): - p.JSONName = s[len("json="):] - case strings.HasPrefix(s, "enum="): - p.Enum = s[len("enum="):] - case strings.HasPrefix(s, "weak="): - p.Weak = s[len("weak="):] - case strings.Trim(s, "0123456789") == "": - n, _ := strconv.ParseUint(s, 10, 32) - p.Tag = int(n) - case s == "opt": - p.Optional = true - case s == "req": - p.Required = true - case s == "rep": - p.Repeated = true - case s == "varint" || s == "zigzag32" || s == "zigzag64": - p.Wire = s - p.WireType = WireVarint - case s == "fixed32": - p.Wire = s - p.WireType = WireFixed32 - case s == "fixed64": - p.Wire = s - p.WireType = WireFixed64 - case s == "bytes": - p.Wire = s - p.WireType = WireBytes - case s == "group": - p.Wire = s - p.WireType = WireStartGroup - case s == "packed": - p.Packed = true - case s == "proto3": - p.Proto3 = true - case s == "oneof": - p.Oneof = true - case strings.HasPrefix(s, "def="): - // The default tag is special in that everything afterwards is the - // default regardless of the presence of commas. - p.HasDefault = true - p.Default, i = tag[len("def="):], len(tag) - } - tag = strings.TrimPrefix(tag[i:], ",") - } -} - -// Init populates the properties from a protocol buffer struct tag. -// -// Deprecated: Do not use. -func (p *Properties) Init(typ reflect.Type, name, tag string, f *reflect.StructField) { - p.Name = name - p.OrigName = name - if tag == "" { - return - } - p.Parse(tag) - - if typ != nil && typ.Kind() == reflect.Map { - p.MapKeyProp = new(Properties) - p.MapKeyProp.Init(nil, "Key", f.Tag.Get("protobuf_key"), nil) - p.MapValProp = new(Properties) - p.MapValProp.Init(nil, "Value", f.Tag.Get("protobuf_val"), nil) - } -} - -var propertiesCache sync.Map // map[reflect.Type]*StructProperties - -// GetProperties returns the list of properties for the type represented by t, -// which must be a generated protocol buffer message in the open-struct API, -// where protobuf message fields are represented by exported Go struct fields. -// -// Deprecated: Use protobuf reflection instead. -func GetProperties(t reflect.Type) *StructProperties { - if p, ok := propertiesCache.Load(t); ok { - return p.(*StructProperties) - } - p, _ := propertiesCache.LoadOrStore(t, newProperties(t)) - return p.(*StructProperties) -} - -func newProperties(t reflect.Type) *StructProperties { - if t.Kind() != reflect.Struct { - panic(fmt.Sprintf("%v is not a generated message in the open-struct API", t)) - } - - var hasOneof bool - prop := new(StructProperties) - - // Construct a list of properties for each field in the struct. - for i := 0; i < t.NumField(); i++ { - p := new(Properties) - f := t.Field(i) - tagField := f.Tag.Get("protobuf") - p.Init(f.Type, f.Name, tagField, &f) - - tagOneof := f.Tag.Get("protobuf_oneof") - if tagOneof != "" { - hasOneof = true - p.OrigName = tagOneof - } - - // Rename unrelated struct fields with the "XXX_" prefix since so much - // user code simply checks for this to exclude special fields. - if tagField == "" && tagOneof == "" && !strings.HasPrefix(p.Name, "XXX_") { - p.Name = "XXX_" + p.Name - p.OrigName = "XXX_" + p.OrigName - } else if p.Weak != "" { - p.Name = p.OrigName // avoid possible "XXX_" prefix on weak field - } - - prop.Prop = append(prop.Prop, p) - } - - // Construct a mapping of oneof field names to properties. - if hasOneof { - var oneofWrappers []interface{} - if fn, ok := reflect.PtrTo(t).MethodByName("XXX_OneofFuncs"); ok { - oneofWrappers = fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))})[3].Interface().([]interface{}) - } - if fn, ok := reflect.PtrTo(t).MethodByName("XXX_OneofWrappers"); ok { - oneofWrappers = fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))})[0].Interface().([]interface{}) - } - if m, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(protoreflect.ProtoMessage); ok { - if m, ok := m.ProtoReflect().(interface{ ProtoMessageInfo() *protoimpl.MessageInfo }); ok { - oneofWrappers = m.ProtoMessageInfo().OneofWrappers - } - } - - prop.OneofTypes = make(map[string]*OneofProperties) - for _, wrapper := range oneofWrappers { - p := &OneofProperties{ - Type: reflect.ValueOf(wrapper).Type(), // *T - Prop: new(Properties), - } - f := p.Type.Elem().Field(0) - p.Prop.Name = f.Name - p.Prop.Parse(f.Tag.Get("protobuf")) - - // Determine the struct field that contains this oneof. - // Each wrapper is assignable to exactly one parent field. - var foundOneof bool - for i := 0; i < t.NumField() && !foundOneof; i++ { - if p.Type.AssignableTo(t.Field(i).Type) { - p.Field = i - foundOneof = true - } - } - if !foundOneof { - panic(fmt.Sprintf("%v is not a generated message in the open-struct API", t)) - } - prop.OneofTypes[p.Prop.OrigName] = p - } - } - - return prop -} - -func (sp *StructProperties) Len() int { return len(sp.Prop) } -func (sp *StructProperties) Less(i, j int) bool { return false } -func (sp *StructProperties) Swap(i, j int) { return } diff --git a/e2e/vendor/github.com/golang/protobuf/proto/proto.go b/e2e/vendor/github.com/golang/protobuf/proto/proto.go deleted file mode 100644 index 5aee89c32..000000000 --- a/e2e/vendor/github.com/golang/protobuf/proto/proto.go +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2019 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 proto provides functionality for handling protocol buffer messages. -// In particular, it provides marshaling and unmarshaling between a protobuf -// message and the binary wire format. -// -// See https://developers.google.com/protocol-buffers/docs/gotutorial for -// more information. -// -// Deprecated: Use the "google.golang.org/protobuf/proto" package instead. -package proto - -import ( - protoV2 "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/runtime/protoiface" - "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - ProtoPackageIsVersion1 = true - ProtoPackageIsVersion2 = true - ProtoPackageIsVersion3 = true - ProtoPackageIsVersion4 = true -) - -// GeneratedEnum is any enum type generated by protoc-gen-go -// which is a named int32 kind. -// This type exists for documentation purposes. -type GeneratedEnum interface{} - -// GeneratedMessage is any message type generated by protoc-gen-go -// which is a pointer to a named struct kind. -// This type exists for documentation purposes. -type GeneratedMessage interface{} - -// Message is a protocol buffer message. -// -// This is the v1 version of the message interface and is marginally better -// than an empty interface as it lacks any method to programatically interact -// with the contents of the message. -// -// A v2 message is declared in "google.golang.org/protobuf/proto".Message and -// exposes protobuf reflection as a first-class feature of the interface. -// -// To convert a v1 message to a v2 message, use the MessageV2 function. -// To convert a v2 message to a v1 message, use the MessageV1 function. -type Message = protoiface.MessageV1 - -// MessageV1 converts either a v1 or v2 message to a v1 message. -// It returns nil if m is nil. -func MessageV1(m GeneratedMessage) protoiface.MessageV1 { - return protoimpl.X.ProtoMessageV1Of(m) -} - -// MessageV2 converts either a v1 or v2 message to a v2 message. -// It returns nil if m is nil. -func MessageV2(m GeneratedMessage) protoV2.Message { - return protoimpl.X.ProtoMessageV2Of(m) -} - -// MessageReflect returns a reflective view for a message. -// It returns nil if m is nil. -func MessageReflect(m Message) protoreflect.Message { - return protoimpl.X.MessageOf(m) -} - -// Marshaler is implemented by messages that can marshal themselves. -// This interface is used by the following functions: Size, Marshal, -// Buffer.Marshal, and Buffer.EncodeMessage. -// -// Deprecated: Do not implement. -type Marshaler interface { - // Marshal formats the encoded bytes of the message. - // It should be deterministic and emit valid protobuf wire data. - // The caller takes ownership of the returned buffer. - Marshal() ([]byte, error) -} - -// Unmarshaler is implemented by messages that can unmarshal themselves. -// This interface is used by the following functions: Unmarshal, UnmarshalMerge, -// Buffer.Unmarshal, Buffer.DecodeMessage, and Buffer.DecodeGroup. -// -// Deprecated: Do not implement. -type Unmarshaler interface { - // Unmarshal parses the encoded bytes of the protobuf wire input. - // The provided buffer is only valid for during method call. - // It should not reset the receiver message. - Unmarshal([]byte) error -} - -// Merger is implemented by messages that can merge themselves. -// This interface is used by the following functions: Clone and Merge. -// -// Deprecated: Do not implement. -type Merger interface { - // Merge merges the contents of src into the receiver message. - // It clones all data structures in src such that it aliases no mutable - // memory referenced by src. - Merge(src Message) -} - -// RequiredNotSetError is an error type returned when -// marshaling or unmarshaling a message with missing required fields. -type RequiredNotSetError struct { - err error -} - -func (e *RequiredNotSetError) Error() string { - if e.err != nil { - return e.err.Error() - } - return "proto: required field not set" -} -func (e *RequiredNotSetError) RequiredNotSet() bool { - return true -} - -func checkRequiredNotSet(m protoV2.Message) error { - if err := protoV2.CheckInitialized(m); err != nil { - return &RequiredNotSetError{err: err} - } - return nil -} - -// Clone returns a deep copy of src. -func Clone(src Message) Message { - return MessageV1(protoV2.Clone(MessageV2(src))) -} - -// Merge merges src into dst, which must be messages of the same type. -// -// Populated scalar fields in src are copied to dst, while populated -// singular messages in src are merged into dst by recursively calling Merge. -// The elements of every list field in src is appended to the corresponded -// list fields in dst. The entries of every map field in src is copied into -// the corresponding map field in dst, possibly replacing existing entries. -// The unknown fields of src are appended to the unknown fields of dst. -func Merge(dst, src Message) { - protoV2.Merge(MessageV2(dst), MessageV2(src)) -} - -// Equal reports whether two messages are equal. -// If two messages marshal to the same bytes under deterministic serialization, -// then Equal is guaranteed to report true. -// -// Two messages are equal if they are the same protobuf message type, -// have the same set of populated known and extension field values, -// and the same set of unknown fields values. -// -// Scalar values are compared with the equivalent of the == operator in Go, -// except bytes values which are compared using bytes.Equal and -// floating point values which specially treat NaNs as equal. -// Message values are compared by recursively calling Equal. -// Lists are equal if each element value is also equal. -// Maps are equal if they have the same set of keys, where the pair of values -// for each key is also equal. -func Equal(x, y Message) bool { - return protoV2.Equal(MessageV2(x), MessageV2(y)) -} - -func isMessageSet(md protoreflect.MessageDescriptor) bool { - ms, ok := md.(interface{ IsMessageSet() bool }) - return ok && ms.IsMessageSet() -} diff --git a/e2e/vendor/github.com/golang/protobuf/proto/registry.go b/e2e/vendor/github.com/golang/protobuf/proto/registry.go deleted file mode 100644 index 066b4323b..000000000 --- a/e2e/vendor/github.com/golang/protobuf/proto/registry.go +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright 2019 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 proto - -import ( - "bytes" - "compress/gzip" - "fmt" - "io/ioutil" - "reflect" - "strings" - "sync" - - "google.golang.org/protobuf/reflect/protodesc" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - "google.golang.org/protobuf/runtime/protoimpl" -) - -// filePath is the path to the proto source file. -type filePath = string // e.g., "google/protobuf/descriptor.proto" - -// fileDescGZIP is the compressed contents of the encoded FileDescriptorProto. -type fileDescGZIP = []byte - -var fileCache sync.Map // map[filePath]fileDescGZIP - -// RegisterFile is called from generated code to register the compressed -// FileDescriptorProto with the file path for a proto source file. -// -// Deprecated: Use protoregistry.GlobalFiles.RegisterFile instead. -func RegisterFile(s filePath, d fileDescGZIP) { - // Decompress the descriptor. - zr, err := gzip.NewReader(bytes.NewReader(d)) - if err != nil { - panic(fmt.Sprintf("proto: invalid compressed file descriptor: %v", err)) - } - b, err := ioutil.ReadAll(zr) - if err != nil { - panic(fmt.Sprintf("proto: invalid compressed file descriptor: %v", err)) - } - - // Construct a protoreflect.FileDescriptor from the raw descriptor. - // Note that DescBuilder.Build automatically registers the constructed - // file descriptor with the v2 registry. - protoimpl.DescBuilder{RawDescriptor: b}.Build() - - // Locally cache the raw descriptor form for the file. - fileCache.Store(s, d) -} - -// FileDescriptor returns the compressed FileDescriptorProto given the file path -// for a proto source file. It returns nil if not found. -// -// Deprecated: Use protoregistry.GlobalFiles.FindFileByPath instead. -func FileDescriptor(s filePath) fileDescGZIP { - if v, ok := fileCache.Load(s); ok { - return v.(fileDescGZIP) - } - - // Find the descriptor in the v2 registry. - var b []byte - if fd, _ := protoregistry.GlobalFiles.FindFileByPath(s); fd != nil { - b, _ = Marshal(protodesc.ToFileDescriptorProto(fd)) - } - - // Locally cache the raw descriptor form for the file. - if len(b) > 0 { - v, _ := fileCache.LoadOrStore(s, protoimpl.X.CompressGZIP(b)) - return v.(fileDescGZIP) - } - return nil -} - -// enumName is the name of an enum. For historical reasons, the enum name is -// neither the full Go name nor the full protobuf name of the enum. -// The name is the dot-separated combination of just the proto package that the -// enum is declared within followed by the Go type name of the generated enum. -type enumName = string // e.g., "my.proto.package.GoMessage_GoEnum" - -// enumsByName maps enum values by name to their numeric counterpart. -type enumsByName = map[string]int32 - -// enumsByNumber maps enum values by number to their name counterpart. -type enumsByNumber = map[int32]string - -var enumCache sync.Map // map[enumName]enumsByName -var numFilesCache sync.Map // map[protoreflect.FullName]int - -// RegisterEnum is called from the generated code to register the mapping of -// enum value names to enum numbers for the enum identified by s. -// -// Deprecated: Use protoregistry.GlobalTypes.RegisterEnum instead. -func RegisterEnum(s enumName, _ enumsByNumber, m enumsByName) { - if _, ok := enumCache.Load(s); ok { - panic("proto: duplicate enum registered: " + s) - } - enumCache.Store(s, m) - - // This does not forward registration to the v2 registry since this API - // lacks sufficient information to construct a complete v2 enum descriptor. -} - -// EnumValueMap returns the mapping from enum value names to enum numbers for -// the enum of the given name. It returns nil if not found. -// -// Deprecated: Use protoregistry.GlobalTypes.FindEnumByName instead. -func EnumValueMap(s enumName) enumsByName { - if v, ok := enumCache.Load(s); ok { - return v.(enumsByName) - } - - // Check whether the cache is stale. If the number of files in the current - // package differs, then it means that some enums may have been recently - // registered upstream that we do not know about. - var protoPkg protoreflect.FullName - if i := strings.LastIndexByte(s, '.'); i >= 0 { - protoPkg = protoreflect.FullName(s[:i]) - } - v, _ := numFilesCache.Load(protoPkg) - numFiles, _ := v.(int) - if protoregistry.GlobalFiles.NumFilesByPackage(protoPkg) == numFiles { - return nil // cache is up-to-date; was not found earlier - } - - // Update the enum cache for all enums declared in the given proto package. - numFiles = 0 - protoregistry.GlobalFiles.RangeFilesByPackage(protoPkg, func(fd protoreflect.FileDescriptor) bool { - walkEnums(fd, func(ed protoreflect.EnumDescriptor) { - name := protoimpl.X.LegacyEnumName(ed) - if _, ok := enumCache.Load(name); !ok { - m := make(enumsByName) - evs := ed.Values() - for i := evs.Len() - 1; i >= 0; i-- { - ev := evs.Get(i) - m[string(ev.Name())] = int32(ev.Number()) - } - enumCache.LoadOrStore(name, m) - } - }) - numFiles++ - return true - }) - numFilesCache.Store(protoPkg, numFiles) - - // Check cache again for enum map. - if v, ok := enumCache.Load(s); ok { - return v.(enumsByName) - } - return nil -} - -// walkEnums recursively walks all enums declared in d. -func walkEnums(d interface { - Enums() protoreflect.EnumDescriptors - Messages() protoreflect.MessageDescriptors -}, f func(protoreflect.EnumDescriptor)) { - eds := d.Enums() - for i := eds.Len() - 1; i >= 0; i-- { - f(eds.Get(i)) - } - mds := d.Messages() - for i := mds.Len() - 1; i >= 0; i-- { - walkEnums(mds.Get(i), f) - } -} - -// messageName is the full name of protobuf message. -type messageName = string - -var messageTypeCache sync.Map // map[messageName]reflect.Type - -// RegisterType is called from generated code to register the message Go type -// for a message of the given name. -// -// Deprecated: Use protoregistry.GlobalTypes.RegisterMessage instead. -func RegisterType(m Message, s messageName) { - mt := protoimpl.X.LegacyMessageTypeOf(m, protoreflect.FullName(s)) - if err := protoregistry.GlobalTypes.RegisterMessage(mt); err != nil { - panic(err) - } - messageTypeCache.Store(s, reflect.TypeOf(m)) -} - -// RegisterMapType is called from generated code to register the Go map type -// for a protobuf message representing a map entry. -// -// Deprecated: Do not use. -func RegisterMapType(m interface{}, s messageName) { - t := reflect.TypeOf(m) - if t.Kind() != reflect.Map { - panic(fmt.Sprintf("invalid map kind: %v", t)) - } - if _, ok := messageTypeCache.Load(s); ok { - panic(fmt.Errorf("proto: duplicate proto message registered: %s", s)) - } - messageTypeCache.Store(s, t) -} - -// MessageType returns the message type for a named message. -// It returns nil if not found. -// -// Deprecated: Use protoregistry.GlobalTypes.FindMessageByName instead. -func MessageType(s messageName) reflect.Type { - if v, ok := messageTypeCache.Load(s); ok { - return v.(reflect.Type) - } - - // Derive the message type from the v2 registry. - var t reflect.Type - if mt, _ := protoregistry.GlobalTypes.FindMessageByName(protoreflect.FullName(s)); mt != nil { - t = messageGoType(mt) - } - - // If we could not get a concrete type, it is possible that it is a - // pseudo-message for a map entry. - if t == nil { - d, _ := protoregistry.GlobalFiles.FindDescriptorByName(protoreflect.FullName(s)) - if md, _ := d.(protoreflect.MessageDescriptor); md != nil && md.IsMapEntry() { - kt := goTypeForField(md.Fields().ByNumber(1)) - vt := goTypeForField(md.Fields().ByNumber(2)) - t = reflect.MapOf(kt, vt) - } - } - - // Locally cache the message type for the given name. - if t != nil { - v, _ := messageTypeCache.LoadOrStore(s, t) - return v.(reflect.Type) - } - return nil -} - -func goTypeForField(fd protoreflect.FieldDescriptor) reflect.Type { - switch k := fd.Kind(); k { - case protoreflect.EnumKind: - if et, _ := protoregistry.GlobalTypes.FindEnumByName(fd.Enum().FullName()); et != nil { - return enumGoType(et) - } - return reflect.TypeOf(protoreflect.EnumNumber(0)) - case protoreflect.MessageKind, protoreflect.GroupKind: - if mt, _ := protoregistry.GlobalTypes.FindMessageByName(fd.Message().FullName()); mt != nil { - return messageGoType(mt) - } - return reflect.TypeOf((*protoreflect.Message)(nil)).Elem() - default: - return reflect.TypeOf(fd.Default().Interface()) - } -} - -func enumGoType(et protoreflect.EnumType) reflect.Type { - return reflect.TypeOf(et.New(0)) -} - -func messageGoType(mt protoreflect.MessageType) reflect.Type { - return reflect.TypeOf(MessageV1(mt.Zero().Interface())) -} - -// MessageName returns the full protobuf name for the given message type. -// -// Deprecated: Use protoreflect.MessageDescriptor.FullName instead. -func MessageName(m Message) messageName { - if m == nil { - return "" - } - if m, ok := m.(interface{ XXX_MessageName() messageName }); ok { - return m.XXX_MessageName() - } - return messageName(protoimpl.X.MessageDescriptorOf(m).FullName()) -} - -// RegisterExtension is called from the generated code to register -// the extension descriptor. -// -// Deprecated: Use protoregistry.GlobalTypes.RegisterExtension instead. -func RegisterExtension(d *ExtensionDesc) { - if err := protoregistry.GlobalTypes.RegisterExtension(d); err != nil { - panic(err) - } -} - -type extensionsByNumber = map[int32]*ExtensionDesc - -var extensionCache sync.Map // map[messageName]extensionsByNumber - -// RegisteredExtensions returns a map of the registered extensions for the -// provided protobuf message, indexed by the extension field number. -// -// Deprecated: Use protoregistry.GlobalTypes.RangeExtensionsByMessage instead. -func RegisteredExtensions(m Message) extensionsByNumber { - // Check whether the cache is stale. If the number of extensions for - // the given message differs, then it means that some extensions were - // recently registered upstream that we do not know about. - s := MessageName(m) - v, _ := extensionCache.Load(s) - xs, _ := v.(extensionsByNumber) - if protoregistry.GlobalTypes.NumExtensionsByMessage(protoreflect.FullName(s)) == len(xs) { - return xs // cache is up-to-date - } - - // Cache is stale, re-compute the extensions map. - xs = make(extensionsByNumber) - protoregistry.GlobalTypes.RangeExtensionsByMessage(protoreflect.FullName(s), func(xt protoreflect.ExtensionType) bool { - if xd, ok := xt.(*ExtensionDesc); ok { - xs[int32(xt.TypeDescriptor().Number())] = xd - } else { - // TODO: This implies that the protoreflect.ExtensionType is a - // custom type not generated by protoc-gen-go. We could try and - // convert the type to an ExtensionDesc. - } - return true - }) - extensionCache.Store(s, xs) - return xs -} diff --git a/e2e/vendor/github.com/golang/protobuf/proto/text_decode.go b/e2e/vendor/github.com/golang/protobuf/proto/text_decode.go deleted file mode 100644 index 47eb3e445..000000000 --- a/e2e/vendor/github.com/golang/protobuf/proto/text_decode.go +++ /dev/null @@ -1,801 +0,0 @@ -// Copyright 2010 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 proto - -import ( - "encoding" - "errors" - "fmt" - "reflect" - "strconv" - "strings" - "unicode/utf8" - - "google.golang.org/protobuf/encoding/prototext" - protoV2 "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" -) - -const wrapTextUnmarshalV2 = false - -// ParseError is returned by UnmarshalText. -type ParseError struct { - Message string - - // Deprecated: Do not use. - Line, Offset int -} - -func (e *ParseError) Error() string { - if wrapTextUnmarshalV2 { - return e.Message - } - if e.Line == 1 { - return fmt.Sprintf("line 1.%d: %v", e.Offset, e.Message) - } - return fmt.Sprintf("line %d: %v", e.Line, e.Message) -} - -// UnmarshalText parses a proto text formatted string into m. -func UnmarshalText(s string, m Message) error { - if u, ok := m.(encoding.TextUnmarshaler); ok { - return u.UnmarshalText([]byte(s)) - } - - m.Reset() - mi := MessageV2(m) - - if wrapTextUnmarshalV2 { - err := prototext.UnmarshalOptions{ - AllowPartial: true, - }.Unmarshal([]byte(s), mi) - if err != nil { - return &ParseError{Message: err.Error()} - } - return checkRequiredNotSet(mi) - } else { - if err := newTextParser(s).unmarshalMessage(mi.ProtoReflect(), ""); err != nil { - return err - } - return checkRequiredNotSet(mi) - } -} - -type textParser struct { - s string // remaining input - done bool // whether the parsing is finished (success or error) - backed bool // whether back() was called - offset, line int - cur token -} - -type token struct { - value string - err *ParseError - line int // line number - offset int // byte number from start of input, not start of line - unquoted string // the unquoted version of value, if it was a quoted string -} - -func newTextParser(s string) *textParser { - p := new(textParser) - p.s = s - p.line = 1 - p.cur.line = 1 - return p -} - -func (p *textParser) unmarshalMessage(m protoreflect.Message, terminator string) (err error) { - md := m.Descriptor() - fds := md.Fields() - - // A struct is a sequence of "name: value", terminated by one of - // '>' or '}', or the end of the input. A name may also be - // "[extension]" or "[type/url]". - // - // The whole struct can also be an expanded Any message, like: - // [type/url] < ... struct contents ... > - seen := make(map[protoreflect.FieldNumber]bool) - for { - tok := p.next() - if tok.err != nil { - return tok.err - } - if tok.value == terminator { - break - } - if tok.value == "[" { - if err := p.unmarshalExtensionOrAny(m, seen); err != nil { - return err - } - continue - } - - // This is a normal, non-extension field. - name := protoreflect.Name(tok.value) - fd := fds.ByName(name) - switch { - case fd == nil: - gd := fds.ByName(protoreflect.Name(strings.ToLower(string(name)))) - if gd != nil && gd.Kind() == protoreflect.GroupKind && gd.Message().Name() == name { - fd = gd - } - case fd.Kind() == protoreflect.GroupKind && fd.Message().Name() != name: - fd = nil - case fd.IsWeak() && fd.Message().IsPlaceholder(): - fd = nil - } - if fd == nil { - typeName := string(md.FullName()) - if m, ok := m.Interface().(Message); ok { - t := reflect.TypeOf(m) - if t.Kind() == reflect.Ptr { - typeName = t.Elem().String() - } - } - return p.errorf("unknown field name %q in %v", name, typeName) - } - if od := fd.ContainingOneof(); od != nil && m.WhichOneof(od) != nil { - return p.errorf("field '%s' would overwrite already parsed oneof '%s'", name, od.Name()) - } - if fd.Cardinality() != protoreflect.Repeated && seen[fd.Number()] { - return p.errorf("non-repeated field %q was repeated", fd.Name()) - } - seen[fd.Number()] = true - - // Consume any colon. - if err := p.checkForColon(fd); err != nil { - return err - } - - // Parse into the field. - v := m.Get(fd) - if !m.Has(fd) && (fd.IsList() || fd.IsMap() || fd.Message() != nil) { - v = m.Mutable(fd) - } - if v, err = p.unmarshalValue(v, fd); err != nil { - return err - } - m.Set(fd, v) - - if err := p.consumeOptionalSeparator(); err != nil { - return err - } - } - return nil -} - -func (p *textParser) unmarshalExtensionOrAny(m protoreflect.Message, seen map[protoreflect.FieldNumber]bool) error { - name, err := p.consumeExtensionOrAnyName() - if err != nil { - return err - } - - // If it contains a slash, it's an Any type URL. - if slashIdx := strings.LastIndex(name, "/"); slashIdx >= 0 { - tok := p.next() - if tok.err != nil { - return tok.err - } - // consume an optional colon - if tok.value == ":" { - tok = p.next() - if tok.err != nil { - return tok.err - } - } - - var terminator string - switch tok.value { - case "<": - terminator = ">" - case "{": - terminator = "}" - default: - return p.errorf("expected '{' or '<', found %q", tok.value) - } - - mt, err := protoregistry.GlobalTypes.FindMessageByURL(name) - if err != nil { - return p.errorf("unrecognized message %q in google.protobuf.Any", name[slashIdx+len("/"):]) - } - m2 := mt.New() - if err := p.unmarshalMessage(m2, terminator); err != nil { - return err - } - b, err := protoV2.Marshal(m2.Interface()) - if err != nil { - return p.errorf("failed to marshal message of type %q: %v", name[slashIdx+len("/"):], err) - } - - urlFD := m.Descriptor().Fields().ByName("type_url") - valFD := m.Descriptor().Fields().ByName("value") - if seen[urlFD.Number()] { - return p.errorf("Any message unpacked multiple times, or %q already set", urlFD.Name()) - } - if seen[valFD.Number()] { - return p.errorf("Any message unpacked multiple times, or %q already set", valFD.Name()) - } - m.Set(urlFD, protoreflect.ValueOfString(name)) - m.Set(valFD, protoreflect.ValueOfBytes(b)) - seen[urlFD.Number()] = true - seen[valFD.Number()] = true - return nil - } - - xname := protoreflect.FullName(name) - xt, _ := protoregistry.GlobalTypes.FindExtensionByName(xname) - if xt == nil && isMessageSet(m.Descriptor()) { - xt, _ = protoregistry.GlobalTypes.FindExtensionByName(xname.Append("message_set_extension")) - } - if xt == nil { - return p.errorf("unrecognized extension %q", name) - } - fd := xt.TypeDescriptor() - if fd.ContainingMessage().FullName() != m.Descriptor().FullName() { - return p.errorf("extension field %q does not extend message %q", name, m.Descriptor().FullName()) - } - - if err := p.checkForColon(fd); err != nil { - return err - } - - v := m.Get(fd) - if !m.Has(fd) && (fd.IsList() || fd.IsMap() || fd.Message() != nil) { - v = m.Mutable(fd) - } - v, err = p.unmarshalValue(v, fd) - if err != nil { - return err - } - m.Set(fd, v) - return p.consumeOptionalSeparator() -} - -func (p *textParser) unmarshalValue(v protoreflect.Value, fd protoreflect.FieldDescriptor) (protoreflect.Value, error) { - tok := p.next() - if tok.err != nil { - return v, tok.err - } - if tok.value == "" { - return v, p.errorf("unexpected EOF") - } - - switch { - case fd.IsList(): - lv := v.List() - var err error - if tok.value == "[" { - // Repeated field with list notation, like [1,2,3]. - for { - vv := lv.NewElement() - vv, err = p.unmarshalSingularValue(vv, fd) - if err != nil { - return v, err - } - lv.Append(vv) - - tok := p.next() - if tok.err != nil { - return v, tok.err - } - if tok.value == "]" { - break - } - if tok.value != "," { - return v, p.errorf("Expected ']' or ',' found %q", tok.value) - } - } - return v, nil - } - - // One value of the repeated field. - p.back() - vv := lv.NewElement() - vv, err = p.unmarshalSingularValue(vv, fd) - if err != nil { - return v, err - } - lv.Append(vv) - return v, nil - case fd.IsMap(): - // The map entry should be this sequence of tokens: - // < key : KEY value : VALUE > - // However, implementations may omit key or value, and technically - // we should support them in any order. - var terminator string - switch tok.value { - case "<": - terminator = ">" - case "{": - terminator = "}" - default: - return v, p.errorf("expected '{' or '<', found %q", tok.value) - } - - keyFD := fd.MapKey() - valFD := fd.MapValue() - - mv := v.Map() - kv := keyFD.Default() - vv := mv.NewValue() - for { - tok := p.next() - if tok.err != nil { - return v, tok.err - } - if tok.value == terminator { - break - } - var err error - switch tok.value { - case "key": - if err := p.consumeToken(":"); err != nil { - return v, err - } - if kv, err = p.unmarshalSingularValue(kv, keyFD); err != nil { - return v, err - } - if err := p.consumeOptionalSeparator(); err != nil { - return v, err - } - case "value": - if err := p.checkForColon(valFD); err != nil { - return v, err - } - if vv, err = p.unmarshalSingularValue(vv, valFD); err != nil { - return v, err - } - if err := p.consumeOptionalSeparator(); err != nil { - return v, err - } - default: - p.back() - return v, p.errorf(`expected "key", "value", or %q, found %q`, terminator, tok.value) - } - } - mv.Set(kv.MapKey(), vv) - return v, nil - default: - p.back() - return p.unmarshalSingularValue(v, fd) - } -} - -func (p *textParser) unmarshalSingularValue(v protoreflect.Value, fd protoreflect.FieldDescriptor) (protoreflect.Value, error) { - tok := p.next() - if tok.err != nil { - return v, tok.err - } - if tok.value == "" { - return v, p.errorf("unexpected EOF") - } - - switch fd.Kind() { - case protoreflect.BoolKind: - switch tok.value { - case "true", "1", "t", "True": - return protoreflect.ValueOfBool(true), nil - case "false", "0", "f", "False": - return protoreflect.ValueOfBool(false), nil - } - case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - if x, err := strconv.ParseInt(tok.value, 0, 32); err == nil { - return protoreflect.ValueOfInt32(int32(x)), nil - } - - // The C++ parser accepts large positive hex numbers that uses - // two's complement arithmetic to represent negative numbers. - // This feature is here for backwards compatibility with C++. - if strings.HasPrefix(tok.value, "0x") { - if x, err := strconv.ParseUint(tok.value, 0, 32); err == nil { - return protoreflect.ValueOfInt32(int32(-(int64(^x) + 1))), nil - } - } - case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - if x, err := strconv.ParseInt(tok.value, 0, 64); err == nil { - return protoreflect.ValueOfInt64(int64(x)), nil - } - - // The C++ parser accepts large positive hex numbers that uses - // two's complement arithmetic to represent negative numbers. - // This feature is here for backwards compatibility with C++. - if strings.HasPrefix(tok.value, "0x") { - if x, err := strconv.ParseUint(tok.value, 0, 64); err == nil { - return protoreflect.ValueOfInt64(int64(-(int64(^x) + 1))), nil - } - } - case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: - if x, err := strconv.ParseUint(tok.value, 0, 32); err == nil { - return protoreflect.ValueOfUint32(uint32(x)), nil - } - case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: - if x, err := strconv.ParseUint(tok.value, 0, 64); err == nil { - return protoreflect.ValueOfUint64(uint64(x)), nil - } - case protoreflect.FloatKind: - // Ignore 'f' for compatibility with output generated by C++, - // but don't remove 'f' when the value is "-inf" or "inf". - v := tok.value - if strings.HasSuffix(v, "f") && v != "-inf" && v != "inf" { - v = v[:len(v)-len("f")] - } - if x, err := strconv.ParseFloat(v, 32); err == nil { - return protoreflect.ValueOfFloat32(float32(x)), nil - } - case protoreflect.DoubleKind: - // Ignore 'f' for compatibility with output generated by C++, - // but don't remove 'f' when the value is "-inf" or "inf". - v := tok.value - if strings.HasSuffix(v, "f") && v != "-inf" && v != "inf" { - v = v[:len(v)-len("f")] - } - if x, err := strconv.ParseFloat(v, 64); err == nil { - return protoreflect.ValueOfFloat64(float64(x)), nil - } - case protoreflect.StringKind: - if isQuote(tok.value[0]) { - return protoreflect.ValueOfString(tok.unquoted), nil - } - case protoreflect.BytesKind: - if isQuote(tok.value[0]) { - return protoreflect.ValueOfBytes([]byte(tok.unquoted)), nil - } - case protoreflect.EnumKind: - if x, err := strconv.ParseInt(tok.value, 0, 32); err == nil { - return protoreflect.ValueOfEnum(protoreflect.EnumNumber(x)), nil - } - vd := fd.Enum().Values().ByName(protoreflect.Name(tok.value)) - if vd != nil { - return protoreflect.ValueOfEnum(vd.Number()), nil - } - case protoreflect.MessageKind, protoreflect.GroupKind: - var terminator string - switch tok.value { - case "{": - terminator = "}" - case "<": - terminator = ">" - default: - return v, p.errorf("expected '{' or '<', found %q", tok.value) - } - err := p.unmarshalMessage(v.Message(), terminator) - return v, err - default: - panic(fmt.Sprintf("invalid kind %v", fd.Kind())) - } - return v, p.errorf("invalid %v: %v", fd.Kind(), tok.value) -} - -// Consume a ':' from the input stream (if the next token is a colon), -// returning an error if a colon is needed but not present. -func (p *textParser) checkForColon(fd protoreflect.FieldDescriptor) *ParseError { - tok := p.next() - if tok.err != nil { - return tok.err - } - if tok.value != ":" { - if fd.Message() == nil { - return p.errorf("expected ':', found %q", tok.value) - } - p.back() - } - return nil -} - -// consumeExtensionOrAnyName consumes an extension name or an Any type URL and -// the following ']'. It returns the name or URL consumed. -func (p *textParser) consumeExtensionOrAnyName() (string, error) { - tok := p.next() - if tok.err != nil { - return "", tok.err - } - - // If extension name or type url is quoted, it's a single token. - if len(tok.value) > 2 && isQuote(tok.value[0]) && tok.value[len(tok.value)-1] == tok.value[0] { - name, err := unquoteC(tok.value[1:len(tok.value)-1], rune(tok.value[0])) - if err != nil { - return "", err - } - return name, p.consumeToken("]") - } - - // Consume everything up to "]" - var parts []string - for tok.value != "]" { - parts = append(parts, tok.value) - tok = p.next() - if tok.err != nil { - return "", p.errorf("unrecognized type_url or extension name: %s", tok.err) - } - if p.done && tok.value != "]" { - return "", p.errorf("unclosed type_url or extension name") - } - } - return strings.Join(parts, ""), nil -} - -// consumeOptionalSeparator consumes an optional semicolon or comma. -// It is used in unmarshalMessage 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) errorf(format string, a ...interface{}) *ParseError { - pe := &ParseError{fmt.Sprintf(format, a...), p.cur.line, p.cur.offset} - p.cur.err = pe - p.done = true - return pe -} - -func (p *textParser) skipWhitespace() { - i := 0 - for i < len(p.s) && (isWhitespace(p.s[i]) || p.s[i] == '#') { - if p.s[i] == '#' { - // comment; skip to end of line or input - for i < len(p.s) && p.s[i] != '\n' { - i++ - } - if i == len(p.s) { - break - } - } - if p.s[i] == '\n' { - p.line++ - } - i++ - } - p.offset += i - p.s = p.s[i:len(p.s)] - if len(p.s) == 0 { - p.done = true - } -} - -func (p *textParser) advance() { - // Skip whitespace - p.skipWhitespace() - if p.done { - return - } - - // Start of non-whitespace - p.cur.err = nil - p.cur.offset, p.cur.line = p.offset, p.line - p.cur.unquoted = "" - switch p.s[0] { - case '<', '>', '{', '}', ':', '[', ']', ';', ',', '/': - // Single symbol - p.cur.value, p.s = p.s[0:1], p.s[1:len(p.s)] - case '"', '\'': - // Quoted string - i := 1 - for i < len(p.s) && p.s[i] != p.s[0] && p.s[i] != '\n' { - if p.s[i] == '\\' && i+1 < len(p.s) { - // skip escaped char - i++ - } - i++ - } - if i >= len(p.s) || p.s[i] != p.s[0] { - p.errorf("unmatched quote") - return - } - unq, err := unquoteC(p.s[1:i], rune(p.s[0])) - if err != nil { - 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)] - p.cur.unquoted = unq - default: - i := 0 - for i < len(p.s) && isIdentOrNumberChar(p.s[i]) { - i++ - } - if i == 0 { - p.errorf("unexpected byte %#x", p.s[0]) - return - } - p.cur.value, p.s = p.s[0:i], p.s[i:len(p.s)] - } - p.offset += len(p.cur.value) -} - -// Back off the parser by one token. Can only be done between calls to next(). -// It makes the next advance() a no-op. -func (p *textParser) back() { p.backed = true } - -// Advances the parser and returns the new current token. -func (p *textParser) next() *token { - if p.backed || p.done { - p.backed = false - return &p.cur - } - p.advance() - if p.done { - p.cur.value = "" - } 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 || !isQuote(p.s[0]) { - break - } - p.advance() - if p.cur.err != nil { - return &p.cur - } - cat.value += " " + p.cur.value - cat.unquoted += p.cur.unquoted - } - p.done = false // parser may have seen EOF, but we want to return cat - p.cur = cat - } - return &p.cur -} - -func (p *textParser) consumeToken(s string) error { - tok := p.next() - if tok.err != nil { - return tok.err - } - if tok.value != s { - p.back() - return p.errorf("expected %q, found %q", s, tok.value) - } - return nil -} - -var errBadUTF8 = errors.New("proto: bad UTF-8") - -func unquoteC(s string, quote rune) (string, error) { - // This is based on C++'s tokenizer.cc. - // Despite its name, this is *not* parsing C syntax. - // For instance, "\0" is an invalid quoted string. - - // Avoid allocation in trivial cases. - simple := true - for _, r := range s { - if r == '\\' || r == quote { - simple = false - break - } - } - if simple { - return s, nil - } - - buf := make([]byte, 0, 3*len(s)/2) - for len(s) > 0 { - r, n := utf8.DecodeRuneInString(s) - if r == utf8.RuneError && n == 1 { - return "", errBadUTF8 - } - s = s[n:] - if r != '\\' { - if r < utf8.RuneSelf { - buf = append(buf, byte(r)) - } else { - buf = append(buf, string(r)...) - } - continue - } - - ch, tail, err := unescape(s) - if err != nil { - return "", err - } - buf = append(buf, ch...) - s = tail - } - return string(buf), nil -} - -func unescape(s string) (ch string, tail string, err error) { - r, n := utf8.DecodeRuneInString(s) - if r == utf8.RuneError && n == 1 { - return "", "", errBadUTF8 - } - s = s[n:] - switch r { - case 'a': - return "\a", s, nil - case 'b': - return "\b", s, nil - case 'f': - return "\f", s, nil - case 'n': - return "\n", s, nil - case 'r': - return "\r", s, nil - case 't': - return "\t", s, nil - case 'v': - return "\v", s, nil - case '?': - return "?", s, nil // trigraph workaround - case '\'', '"', '\\': - return string(r), s, nil - case '0', '1', '2', '3', '4', '5', '6', '7': - if len(s) < 2 { - return "", "", fmt.Errorf(`\%c requires 2 following digits`, r) - } - ss := string(r) + s[:2] - s = s[2:] - i, err := strconv.ParseUint(ss, 8, 8) - if err != nil { - return "", "", fmt.Errorf(`\%s contains non-octal digits`, ss) - } - return string([]byte{byte(i)}), s, nil - case 'x', 'X', 'u', 'U': - var n int - switch r { - case 'x', 'X': - n = 2 - case 'u': - n = 4 - case 'U': - n = 8 - } - if len(s) < n { - return "", "", fmt.Errorf(`\%c requires %d following digits`, r, n) - } - ss := s[:n] - s = s[n:] - i, err := strconv.ParseUint(ss, 16, 64) - if err != nil { - return "", "", fmt.Errorf(`\%c%s contains non-hexadecimal digits`, r, ss) - } - if r == 'x' || r == 'X' { - return string([]byte{byte(i)}), s, nil - } - if i > utf8.MaxRune { - return "", "", fmt.Errorf(`\%c%s is not a valid Unicode code point`, r, ss) - } - return string(rune(i)), s, nil - } - return "", "", fmt.Errorf(`unknown escape \%c`, r) -} - -func isIdentOrNumberChar(c byte) bool { - switch { - case 'A' <= c && c <= 'Z', 'a' <= c && c <= 'z': - return true - case '0' <= c && c <= '9': - return true - } - switch c { - case '-', '+', '.', '_': - return true - } - return false -} - -func isWhitespace(c byte) bool { - switch c { - case ' ', '\t', '\n', '\r': - return true - } - return false -} - -func isQuote(c byte) bool { - switch c { - case '"', '\'': - return true - } - return false -} diff --git a/e2e/vendor/github.com/golang/protobuf/proto/text_encode.go b/e2e/vendor/github.com/golang/protobuf/proto/text_encode.go deleted file mode 100644 index a31134eeb..000000000 --- a/e2e/vendor/github.com/golang/protobuf/proto/text_encode.go +++ /dev/null @@ -1,560 +0,0 @@ -// Copyright 2010 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 proto - -import ( - "bytes" - "encoding" - "fmt" - "io" - "math" - "sort" - "strings" - - "google.golang.org/protobuf/encoding/prototext" - "google.golang.org/protobuf/encoding/protowire" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" -) - -const wrapTextMarshalV2 = false - -// TextMarshaler is a configurable text format marshaler. -type TextMarshaler struct { - Compact bool // use compact text format (one line) - ExpandAny bool // expand google.protobuf.Any messages of known types -} - -// Marshal writes the proto text format of m to w. -func (tm *TextMarshaler) Marshal(w io.Writer, m Message) error { - b, err := tm.marshal(m) - if len(b) > 0 { - if _, err := w.Write(b); err != nil { - return err - } - } - return err -} - -// Text returns a proto text formatted string of m. -func (tm *TextMarshaler) Text(m Message) string { - b, _ := tm.marshal(m) - return string(b) -} - -func (tm *TextMarshaler) marshal(m Message) ([]byte, error) { - mr := MessageReflect(m) - if mr == nil || !mr.IsValid() { - return []byte(""), nil - } - - if wrapTextMarshalV2 { - if m, ok := m.(encoding.TextMarshaler); ok { - return m.MarshalText() - } - - opts := prototext.MarshalOptions{ - AllowPartial: true, - EmitUnknown: true, - } - if !tm.Compact { - opts.Indent = " " - } - if !tm.ExpandAny { - opts.Resolver = (*protoregistry.Types)(nil) - } - return opts.Marshal(mr.Interface()) - } else { - w := &textWriter{ - compact: tm.Compact, - expandAny: tm.ExpandAny, - complete: true, - } - - if m, ok := m.(encoding.TextMarshaler); ok { - b, err := m.MarshalText() - if err != nil { - return nil, err - } - w.Write(b) - return w.buf, nil - } - - err := w.writeMessage(mr) - return w.buf, err - } -} - -var ( - defaultTextMarshaler = TextMarshaler{} - compactTextMarshaler = TextMarshaler{Compact: true} -) - -// MarshalText writes the proto text format of m to w. -func MarshalText(w io.Writer, m Message) error { return defaultTextMarshaler.Marshal(w, m) } - -// MarshalTextString returns a proto text formatted string of m. -func MarshalTextString(m Message) string { return defaultTextMarshaler.Text(m) } - -// CompactText writes the compact proto text format of m to w. -func CompactText(w io.Writer, m Message) error { return compactTextMarshaler.Marshal(w, m) } - -// CompactTextString returns a compact proto text formatted string of m. -func CompactTextString(m Message) string { return compactTextMarshaler.Text(m) } - -var ( - newline = []byte("\n") - endBraceNewline = []byte("}\n") - posInf = []byte("inf") - negInf = []byte("-inf") - nan = []byte("nan") -) - -// textWriter is an io.Writer that tracks its indentation level. -type textWriter struct { - compact bool // same as TextMarshaler.Compact - expandAny bool // same as TextMarshaler.ExpandAny - complete bool // whether the current position is a complete line - indent int // indentation level; never negative - buf []byte -} - -func (w *textWriter) Write(p []byte) (n int, _ error) { - newlines := bytes.Count(p, newline) - if newlines == 0 { - if !w.compact && w.complete { - w.writeIndent() - } - w.buf = append(w.buf, p...) - w.complete = false - return len(p), nil - } - - frags := bytes.SplitN(p, newline, newlines+1) - if w.compact { - for i, frag := range frags { - if i > 0 { - w.buf = append(w.buf, ' ') - n++ - } - w.buf = append(w.buf, frag...) - n += len(frag) - } - return n, nil - } - - for i, frag := range frags { - if w.complete { - w.writeIndent() - } - w.buf = append(w.buf, frag...) - n += len(frag) - if i+1 < len(frags) { - w.buf = append(w.buf, '\n') - n++ - } - } - w.complete = len(frags[len(frags)-1]) == 0 - return n, nil -} - -func (w *textWriter) WriteByte(c byte) error { - if w.compact && c == '\n' { - c = ' ' - } - if !w.compact && w.complete { - w.writeIndent() - } - w.buf = append(w.buf, c) - w.complete = c == '\n' - return nil -} - -func (w *textWriter) writeName(fd protoreflect.FieldDescriptor) { - if !w.compact && w.complete { - w.writeIndent() - } - w.complete = false - - if fd.Kind() != protoreflect.GroupKind { - w.buf = append(w.buf, fd.Name()...) - w.WriteByte(':') - } else { - // Use message type name for group field name. - w.buf = append(w.buf, fd.Message().Name()...) - } - - if !w.compact { - w.WriteByte(' ') - } -} - -func requiresQuotes(u string) bool { - // When type URL contains any characters except [0-9A-Za-z./\-]*, it must be quoted. - for _, ch := range u { - switch { - case ch == '.' || ch == '/' || ch == '_': - continue - case '0' <= ch && ch <= '9': - continue - case 'A' <= ch && ch <= 'Z': - continue - case 'a' <= ch && ch <= 'z': - continue - default: - return true - } - } - return false -} - -// writeProto3Any writes an expanded google.protobuf.Any message. -// -// It returns (false, nil) if sv value can't be unmarshaled (e.g. because -// required messages are not linked in). -// -// It returns (true, error) when sv was written in expanded format or an error -// was encountered. -func (w *textWriter) writeProto3Any(m protoreflect.Message) (bool, error) { - md := m.Descriptor() - fdURL := md.Fields().ByName("type_url") - fdVal := md.Fields().ByName("value") - - url := m.Get(fdURL).String() - mt, err := protoregistry.GlobalTypes.FindMessageByURL(url) - if err != nil { - return false, nil - } - - b := m.Get(fdVal).Bytes() - m2 := mt.New() - if err := proto.Unmarshal(b, m2.Interface()); err != nil { - return false, nil - } - w.Write([]byte("[")) - if requiresQuotes(url) { - w.writeQuotedString(url) - } else { - w.Write([]byte(url)) - } - if w.compact { - w.Write([]byte("]:<")) - } else { - w.Write([]byte("]: <\n")) - w.indent++ - } - if err := w.writeMessage(m2); err != nil { - return true, err - } - if w.compact { - w.Write([]byte("> ")) - } else { - w.indent-- - w.Write([]byte(">\n")) - } - return true, nil -} - -func (w *textWriter) writeMessage(m protoreflect.Message) error { - md := m.Descriptor() - if w.expandAny && md.FullName() == "google.protobuf.Any" { - if canExpand, err := w.writeProto3Any(m); canExpand { - return err - } - } - - fds := md.Fields() - for i := 0; i < fds.Len(); { - fd := fds.Get(i) - if od := fd.ContainingOneof(); od != nil { - fd = m.WhichOneof(od) - i += od.Fields().Len() - } else { - i++ - } - if fd == nil || !m.Has(fd) { - continue - } - - switch { - case fd.IsList(): - lv := m.Get(fd).List() - for j := 0; j < lv.Len(); j++ { - w.writeName(fd) - v := lv.Get(j) - if err := w.writeSingularValue(v, fd); err != nil { - return err - } - w.WriteByte('\n') - } - case fd.IsMap(): - kfd := fd.MapKey() - vfd := fd.MapValue() - mv := m.Get(fd).Map() - - type entry struct{ key, val protoreflect.Value } - var entries []entry - mv.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool { - entries = append(entries, entry{k.Value(), v}) - return true - }) - sort.Slice(entries, func(i, j int) bool { - switch kfd.Kind() { - case protoreflect.BoolKind: - return !entries[i].key.Bool() && entries[j].key.Bool() - case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind, protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - return entries[i].key.Int() < entries[j].key.Int() - case protoreflect.Uint32Kind, protoreflect.Fixed32Kind, protoreflect.Uint64Kind, protoreflect.Fixed64Kind: - return entries[i].key.Uint() < entries[j].key.Uint() - case protoreflect.StringKind: - return entries[i].key.String() < entries[j].key.String() - default: - panic("invalid kind") - } - }) - for _, entry := range entries { - w.writeName(fd) - w.WriteByte('<') - if !w.compact { - w.WriteByte('\n') - } - w.indent++ - w.writeName(kfd) - if err := w.writeSingularValue(entry.key, kfd); err != nil { - return err - } - w.WriteByte('\n') - w.writeName(vfd) - if err := w.writeSingularValue(entry.val, vfd); err != nil { - return err - } - w.WriteByte('\n') - w.indent-- - w.WriteByte('>') - w.WriteByte('\n') - } - default: - w.writeName(fd) - if err := w.writeSingularValue(m.Get(fd), fd); err != nil { - return err - } - w.WriteByte('\n') - } - } - - if b := m.GetUnknown(); len(b) > 0 { - w.writeUnknownFields(b) - } - return w.writeExtensions(m) -} - -func (w *textWriter) writeSingularValue(v protoreflect.Value, fd protoreflect.FieldDescriptor) error { - switch fd.Kind() { - case protoreflect.FloatKind, protoreflect.DoubleKind: - switch vf := v.Float(); { - case math.IsInf(vf, +1): - w.Write(posInf) - case math.IsInf(vf, -1): - w.Write(negInf) - case math.IsNaN(vf): - w.Write(nan) - default: - fmt.Fprint(w, v.Interface()) - } - case protoreflect.StringKind: - // NOTE: This does not validate UTF-8 for historical reasons. - w.writeQuotedString(string(v.String())) - case protoreflect.BytesKind: - w.writeQuotedString(string(v.Bytes())) - case protoreflect.MessageKind, protoreflect.GroupKind: - var bra, ket byte = '<', '>' - if fd.Kind() == protoreflect.GroupKind { - bra, ket = '{', '}' - } - w.WriteByte(bra) - if !w.compact { - w.WriteByte('\n') - } - w.indent++ - m := v.Message() - if m2, ok := m.Interface().(encoding.TextMarshaler); ok { - b, err := m2.MarshalText() - if err != nil { - return err - } - w.Write(b) - } else { - w.writeMessage(m) - } - w.indent-- - w.WriteByte(ket) - case protoreflect.EnumKind: - if ev := fd.Enum().Values().ByNumber(v.Enum()); ev != nil { - fmt.Fprint(w, ev.Name()) - } else { - fmt.Fprint(w, v.Enum()) - } - default: - fmt.Fprint(w, v.Interface()) - } - return nil -} - -// writeQuotedString writes a quoted string in the protocol buffer text format. -func (w *textWriter) writeQuotedString(s string) { - w.WriteByte('"') - for i := 0; i < len(s); i++ { - switch c := s[i]; c { - case '\n': - w.buf = append(w.buf, `\n`...) - case '\r': - w.buf = append(w.buf, `\r`...) - case '\t': - w.buf = append(w.buf, `\t`...) - case '"': - w.buf = append(w.buf, `\"`...) - case '\\': - w.buf = append(w.buf, `\\`...) - default: - if isPrint := c >= 0x20 && c < 0x7f; isPrint { - w.buf = append(w.buf, c) - } else { - w.buf = append(w.buf, fmt.Sprintf(`\%03o`, c)...) - } - } - } - w.WriteByte('"') -} - -func (w *textWriter) writeUnknownFields(b []byte) { - if !w.compact { - fmt.Fprintf(w, "/* %d unknown bytes */\n", len(b)) - } - - for len(b) > 0 { - num, wtyp, n := protowire.ConsumeTag(b) - if n < 0 { - return - } - b = b[n:] - - if wtyp == protowire.EndGroupType { - w.indent-- - w.Write(endBraceNewline) - continue - } - fmt.Fprint(w, num) - if wtyp != protowire.StartGroupType { - w.WriteByte(':') - } - if !w.compact || wtyp == protowire.StartGroupType { - w.WriteByte(' ') - } - switch wtyp { - case protowire.VarintType: - v, n := protowire.ConsumeVarint(b) - if n < 0 { - return - } - b = b[n:] - fmt.Fprint(w, v) - case protowire.Fixed32Type: - v, n := protowire.ConsumeFixed32(b) - if n < 0 { - return - } - b = b[n:] - fmt.Fprint(w, v) - case protowire.Fixed64Type: - v, n := protowire.ConsumeFixed64(b) - if n < 0 { - return - } - b = b[n:] - fmt.Fprint(w, v) - case protowire.BytesType: - v, n := protowire.ConsumeBytes(b) - if n < 0 { - return - } - b = b[n:] - fmt.Fprintf(w, "%q", v) - case protowire.StartGroupType: - w.WriteByte('{') - w.indent++ - default: - fmt.Fprintf(w, "/* unknown wire type %d */", wtyp) - } - w.WriteByte('\n') - } -} - -// writeExtensions writes all the extensions in m. -func (w *textWriter) writeExtensions(m protoreflect.Message) error { - md := m.Descriptor() - if md.ExtensionRanges().Len() == 0 { - return nil - } - - type ext struct { - desc protoreflect.FieldDescriptor - val protoreflect.Value - } - var exts []ext - m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { - if fd.IsExtension() { - exts = append(exts, ext{fd, v}) - } - return true - }) - sort.Slice(exts, func(i, j int) bool { - return exts[i].desc.Number() < exts[j].desc.Number() - }) - - for _, ext := range exts { - // For message set, use the name of the message as the extension name. - name := string(ext.desc.FullName()) - if isMessageSet(ext.desc.ContainingMessage()) { - name = strings.TrimSuffix(name, ".message_set_extension") - } - - if !ext.desc.IsList() { - if err := w.writeSingularExtension(name, ext.val, ext.desc); err != nil { - return err - } - } else { - lv := ext.val.List() - for i := 0; i < lv.Len(); i++ { - if err := w.writeSingularExtension(name, lv.Get(i), ext.desc); err != nil { - return err - } - } - } - } - return nil -} - -func (w *textWriter) writeSingularExtension(name string, v protoreflect.Value, fd protoreflect.FieldDescriptor) error { - fmt.Fprintf(w, "[%s]:", name) - if !w.compact { - w.WriteByte(' ') - } - if err := w.writeSingularValue(v, fd); err != nil { - return err - } - w.WriteByte('\n') - return nil -} - -func (w *textWriter) writeIndent() { - if !w.complete { - return - } - for i := 0; i < w.indent*2; i++ { - w.buf = append(w.buf, ' ') - } - w.complete = false -} diff --git a/e2e/vendor/github.com/golang/protobuf/proto/wire.go b/e2e/vendor/github.com/golang/protobuf/proto/wire.go deleted file mode 100644 index d7c28da5a..000000000 --- a/e2e/vendor/github.com/golang/protobuf/proto/wire.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2019 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 proto - -import ( - protoV2 "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/runtime/protoiface" -) - -// Size returns the size in bytes of the wire-format encoding of m. -func Size(m Message) int { - if m == nil { - return 0 - } - mi := MessageV2(m) - return protoV2.Size(mi) -} - -// Marshal returns the wire-format encoding of m. -func Marshal(m Message) ([]byte, error) { - b, err := marshalAppend(nil, m, false) - if b == nil { - b = zeroBytes - } - return b, err -} - -var zeroBytes = make([]byte, 0, 0) - -func marshalAppend(buf []byte, m Message, deterministic bool) ([]byte, error) { - if m == nil { - return nil, ErrNil - } - mi := MessageV2(m) - nbuf, err := protoV2.MarshalOptions{ - Deterministic: deterministic, - AllowPartial: true, - }.MarshalAppend(buf, mi) - if err != nil { - return buf, err - } - if len(buf) == len(nbuf) { - if !mi.ProtoReflect().IsValid() { - return buf, ErrNil - } - } - return nbuf, checkRequiredNotSet(mi) -} - -// Unmarshal parses a wire-format message in b and places the decoded results in m. -// -// Unmarshal resets m before starting to unmarshal, so any existing data in m is always -// removed. Use UnmarshalMerge to preserve and append to existing data. -func Unmarshal(b []byte, m Message) error { - m.Reset() - return UnmarshalMerge(b, m) -} - -// UnmarshalMerge parses a wire-format message in b and places the decoded results in m. -func UnmarshalMerge(b []byte, m Message) error { - mi := MessageV2(m) - out, err := protoV2.UnmarshalOptions{ - AllowPartial: true, - Merge: true, - }.UnmarshalState(protoiface.UnmarshalInput{ - Buf: b, - Message: mi.ProtoReflect(), - }) - if err != nil { - return err - } - if out.Flags&protoiface.UnmarshalInitialized > 0 { - return nil - } - return checkRequiredNotSet(mi) -} diff --git a/e2e/vendor/github.com/golang/protobuf/proto/wrappers.go b/e2e/vendor/github.com/golang/protobuf/proto/wrappers.go deleted file mode 100644 index 398e34859..000000000 --- a/e2e/vendor/github.com/golang/protobuf/proto/wrappers.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2019 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 proto - -// Bool stores v in a new bool value and returns a pointer to it. -func Bool(v bool) *bool { return &v } - -// Int stores v in a new int32 value and returns a pointer to it. -// -// Deprecated: Use Int32 instead. -func Int(v int) *int32 { return Int32(int32(v)) } - -// Int32 stores v in a new int32 value and returns a pointer to it. -func Int32(v int32) *int32 { return &v } - -// Int64 stores v in a new int64 value and returns a pointer to it. -func Int64(v int64) *int64 { return &v } - -// Uint32 stores v in a new uint32 value and returns a pointer to it. -func Uint32(v uint32) *uint32 { return &v } - -// Uint64 stores v in a new uint64 value and returns a pointer to it. -func Uint64(v uint64) *uint64 { return &v } - -// Float32 stores v in a new float32 value and returns a pointer to it. -func Float32(v float32) *float32 { return &v } - -// Float64 stores v in a new float64 value and returns a pointer to it. -func Float64(v float64) *float64 { return &v } - -// String stores v in a new string value and returns a pointer to it. -func String(v string) *string { return &v } diff --git a/e2e/vendor/github.com/google/btree/README.md b/e2e/vendor/github.com/google/btree/README.md deleted file mode 100644 index eab5dbf7b..000000000 --- a/e2e/vendor/github.com/google/btree/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# BTree implementation for Go - -This package provides an in-memory B-Tree implementation for Go, useful as -an ordered, mutable data structure. - -The API is based off of the wonderful -http://godoc.org/github.com/petar/GoLLRB/llrb, and is meant to allow btree to -act as a drop-in replacement for gollrb trees. - -See http://godoc.org/github.com/google/btree for documentation. diff --git a/e2e/vendor/github.com/google/btree/btree.go b/e2e/vendor/github.com/google/btree/btree.go deleted file mode 100644 index 6f5184fef..000000000 --- a/e2e/vendor/github.com/google/btree/btree.go +++ /dev/null @@ -1,893 +0,0 @@ -// Copyright 2014 Google 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. - -//go:build !go1.18 -// +build !go1.18 - -// Package btree implements in-memory B-Trees of arbitrary degree. -// -// btree implements an in-memory B-Tree for use as an ordered data structure. -// It is not meant for persistent storage solutions. -// -// It has a flatter structure than an equivalent red-black or other binary tree, -// which in some cases yields better memory usage and/or performance. -// See some discussion on the matter here: -// http://google-opensource.blogspot.com/2013/01/c-containers-that-save-memory-and-time.html -// Note, though, that this project is in no way related to the C++ B-Tree -// implementation written about there. -// -// Within this tree, each node contains a slice of items and a (possibly nil) -// slice of children. For basic numeric values or raw structs, this can cause -// efficiency differences when compared to equivalent C++ template code that -// stores values in arrays within the node: -// * Due to the overhead of storing values as interfaces (each -// value needs to be stored as the value itself, then 2 words for the -// interface pointing to that value and its type), resulting in higher -// memory use. -// * Since interfaces can point to values anywhere in memory, values are -// most likely not stored in contiguous blocks, resulting in a higher -// number of cache misses. -// These issues don't tend to matter, though, when working with strings or other -// heap-allocated structures, since C++-equivalent structures also must store -// pointers and also distribute their values across the heap. -// -// This implementation is designed to be a drop-in replacement to gollrb.LLRB -// trees, (http://github.com/petar/gollrb), an excellent and probably the most -// widely used ordered tree implementation in the Go ecosystem currently. -// Its functions, therefore, exactly mirror those of -// llrb.LLRB where possible. Unlike gollrb, though, we currently don't -// support storing multiple equivalent values. -package btree - -import ( - "fmt" - "io" - "sort" - "strings" - "sync" -) - -// Item represents a single object in the tree. -type Item interface { - // Less tests whether the current item is less than the given argument. - // - // This must provide a strict weak ordering. - // If !a.Less(b) && !b.Less(a), we treat this to mean a == b (i.e. we can only - // hold one of either a or b in the tree). - Less(than Item) bool -} - -const ( - DefaultFreeListSize = 32 -) - -var ( - nilItems = make(items, 16) - nilChildren = make(children, 16) -) - -// FreeList represents a free list of btree nodes. By default each -// BTree has its own FreeList, but multiple BTrees can share the same -// FreeList. -// Two Btrees using the same freelist are safe for concurrent write access. -type FreeList struct { - mu sync.Mutex - freelist []*node -} - -// NewFreeList creates a new free list. -// size is the maximum size of the returned free list. -func NewFreeList(size int) *FreeList { - return &FreeList{freelist: make([]*node, 0, size)} -} - -func (f *FreeList) newNode() (n *node) { - f.mu.Lock() - index := len(f.freelist) - 1 - if index < 0 { - f.mu.Unlock() - return new(node) - } - n = f.freelist[index] - f.freelist[index] = nil - f.freelist = f.freelist[:index] - f.mu.Unlock() - return -} - -// freeNode adds the given node to the list, returning true if it was added -// and false if it was discarded. -func (f *FreeList) freeNode(n *node) (out bool) { - f.mu.Lock() - if len(f.freelist) < cap(f.freelist) { - f.freelist = append(f.freelist, n) - out = true - } - f.mu.Unlock() - return -} - -// ItemIterator allows callers of Ascend* to iterate in-order over portions of -// the tree. When this function returns false, iteration will stop and the -// associated Ascend* function will immediately return. -type ItemIterator func(i Item) bool - -// New creates a new B-Tree with the given degree. -// -// New(2), for example, will create a 2-3-4 tree (each node contains 1-3 items -// and 2-4 children). -func New(degree int) *BTree { - return NewWithFreeList(degree, NewFreeList(DefaultFreeListSize)) -} - -// NewWithFreeList creates a new B-Tree that uses the given node free list. -func NewWithFreeList(degree int, f *FreeList) *BTree { - if degree <= 1 { - panic("bad degree") - } - return &BTree{ - degree: degree, - cow: ©OnWriteContext{freelist: f}, - } -} - -// items stores items in a node. -type items []Item - -// insertAt inserts a value into the given index, pushing all subsequent values -// forward. -func (s *items) insertAt(index int, item Item) { - *s = append(*s, nil) - if index < len(*s) { - copy((*s)[index+1:], (*s)[index:]) - } - (*s)[index] = item -} - -// removeAt removes a value at a given index, pulling all subsequent values -// back. -func (s *items) removeAt(index int) Item { - item := (*s)[index] - copy((*s)[index:], (*s)[index+1:]) - (*s)[len(*s)-1] = nil - *s = (*s)[:len(*s)-1] - return item -} - -// pop removes and returns the last element in the list. -func (s *items) pop() (out Item) { - index := len(*s) - 1 - out = (*s)[index] - (*s)[index] = nil - *s = (*s)[:index] - return -} - -// truncate truncates this instance at index so that it contains only the -// first index items. index must be less than or equal to length. -func (s *items) truncate(index int) { - var toClear items - *s, toClear = (*s)[:index], (*s)[index:] - for len(toClear) > 0 { - toClear = toClear[copy(toClear, nilItems):] - } -} - -// find returns the index where the given item should be inserted into this -// list. 'found' is true if the item already exists in the list at the given -// index. -func (s items) find(item Item) (index int, found bool) { - i := sort.Search(len(s), func(i int) bool { - return item.Less(s[i]) - }) - if i > 0 && !s[i-1].Less(item) { - return i - 1, true - } - return i, false -} - -// children stores child nodes in a node. -type children []*node - -// insertAt inserts a value into the given index, pushing all subsequent values -// forward. -func (s *children) insertAt(index int, n *node) { - *s = append(*s, nil) - if index < len(*s) { - copy((*s)[index+1:], (*s)[index:]) - } - (*s)[index] = n -} - -// removeAt removes a value at a given index, pulling all subsequent values -// back. -func (s *children) removeAt(index int) *node { - n := (*s)[index] - copy((*s)[index:], (*s)[index+1:]) - (*s)[len(*s)-1] = nil - *s = (*s)[:len(*s)-1] - return n -} - -// pop removes and returns the last element in the list. -func (s *children) pop() (out *node) { - index := len(*s) - 1 - out = (*s)[index] - (*s)[index] = nil - *s = (*s)[:index] - return -} - -// truncate truncates this instance at index so that it contains only the -// first index children. index must be less than or equal to length. -func (s *children) truncate(index int) { - var toClear children - *s, toClear = (*s)[:index], (*s)[index:] - for len(toClear) > 0 { - toClear = toClear[copy(toClear, nilChildren):] - } -} - -// node is an internal node in a tree. -// -// It must at all times maintain the invariant that either -// * len(children) == 0, len(items) unconstrained -// * len(children) == len(items) + 1 -type node struct { - items items - children children - cow *copyOnWriteContext -} - -func (n *node) mutableFor(cow *copyOnWriteContext) *node { - if n.cow == cow { - return n - } - out := cow.newNode() - if cap(out.items) >= len(n.items) { - out.items = out.items[:len(n.items)] - } else { - out.items = make(items, len(n.items), cap(n.items)) - } - copy(out.items, n.items) - // Copy children - if cap(out.children) >= len(n.children) { - out.children = out.children[:len(n.children)] - } else { - out.children = make(children, len(n.children), cap(n.children)) - } - copy(out.children, n.children) - return out -} - -func (n *node) mutableChild(i int) *node { - c := n.children[i].mutableFor(n.cow) - n.children[i] = c - return c -} - -// split splits the given node at the given index. The current node shrinks, -// and this function returns the item that existed at that index and a new node -// containing all items/children after it. -func (n *node) split(i int) (Item, *node) { - item := n.items[i] - next := n.cow.newNode() - next.items = append(next.items, n.items[i+1:]...) - n.items.truncate(i) - if len(n.children) > 0 { - next.children = append(next.children, n.children[i+1:]...) - n.children.truncate(i + 1) - } - return item, next -} - -// maybeSplitChild checks if a child should be split, and if so splits it. -// Returns whether or not a split occurred. -func (n *node) maybeSplitChild(i, maxItems int) bool { - if len(n.children[i].items) < maxItems { - return false - } - first := n.mutableChild(i) - item, second := first.split(maxItems / 2) - n.items.insertAt(i, item) - n.children.insertAt(i+1, second) - return true -} - -// insert inserts an item into the subtree rooted at this node, making sure -// no nodes in the subtree exceed maxItems items. Should an equivalent item be -// be found/replaced by insert, it will be returned. -func (n *node) insert(item Item, maxItems int) Item { - i, found := n.items.find(item) - if found { - out := n.items[i] - n.items[i] = item - return out - } - if len(n.children) == 0 { - n.items.insertAt(i, item) - return nil - } - if n.maybeSplitChild(i, maxItems) { - inTree := n.items[i] - switch { - case item.Less(inTree): - // no change, we want first split node - case inTree.Less(item): - i++ // we want second split node - default: - out := n.items[i] - n.items[i] = item - return out - } - } - return n.mutableChild(i).insert(item, maxItems) -} - -// get finds the given key in the subtree and returns it. -func (n *node) get(key Item) Item { - i, found := n.items.find(key) - if found { - return n.items[i] - } else if len(n.children) > 0 { - return n.children[i].get(key) - } - return nil -} - -// min returns the first item in the subtree. -func min(n *node) Item { - if n == nil { - return nil - } - for len(n.children) > 0 { - n = n.children[0] - } - if len(n.items) == 0 { - return nil - } - return n.items[0] -} - -// max returns the last item in the subtree. -func max(n *node) Item { - if n == nil { - return nil - } - for len(n.children) > 0 { - n = n.children[len(n.children)-1] - } - if len(n.items) == 0 { - return nil - } - return n.items[len(n.items)-1] -} - -// toRemove details what item to remove in a node.remove call. -type toRemove int - -const ( - removeItem toRemove = iota // removes the given item - removeMin // removes smallest item in the subtree - removeMax // removes largest item in the subtree -) - -// remove removes an item from the subtree rooted at this node. -func (n *node) remove(item Item, minItems int, typ toRemove) Item { - var i int - var found bool - switch typ { - case removeMax: - if len(n.children) == 0 { - return n.items.pop() - } - i = len(n.items) - case removeMin: - if len(n.children) == 0 { - return n.items.removeAt(0) - } - i = 0 - case removeItem: - i, found = n.items.find(item) - if len(n.children) == 0 { - if found { - return n.items.removeAt(i) - } - return nil - } - default: - panic("invalid type") - } - // If we get to here, we have children. - if len(n.children[i].items) <= minItems { - return n.growChildAndRemove(i, item, minItems, typ) - } - child := n.mutableChild(i) - // Either we had enough items to begin with, or we've done some - // merging/stealing, because we've got enough now and we're ready to return - // stuff. - if found { - // The item exists at index 'i', and the child we've selected can give us a - // predecessor, since if we've gotten here it's got > minItems items in it. - out := n.items[i] - // We use our special-case 'remove' call with typ=maxItem to pull the - // predecessor of item i (the rightmost leaf of our immediate left child) - // and set it into where we pulled the item from. - n.items[i] = child.remove(nil, minItems, removeMax) - return out - } - // Final recursive call. Once we're here, we know that the item isn't in this - // node and that the child is big enough to remove from. - return child.remove(item, minItems, typ) -} - -// growChildAndRemove grows child 'i' to make sure it's possible to remove an -// item from it while keeping it at minItems, then calls remove to actually -// remove it. -// -// Most documentation says we have to do two sets of special casing: -// 1) item is in this node -// 2) item is in child -// In both cases, we need to handle the two subcases: -// A) node has enough values that it can spare one -// B) node doesn't have enough values -// For the latter, we have to check: -// a) left sibling has node to spare -// b) right sibling has node to spare -// c) we must merge -// To simplify our code here, we handle cases #1 and #2 the same: -// If a node doesn't have enough items, we make sure it does (using a,b,c). -// We then simply redo our remove call, and the second time (regardless of -// whether we're in case 1 or 2), we'll have enough items and can guarantee -// that we hit case A. -func (n *node) growChildAndRemove(i int, item Item, minItems int, typ toRemove) Item { - if i > 0 && len(n.children[i-1].items) > minItems { - // Steal from left child - child := n.mutableChild(i) - stealFrom := n.mutableChild(i - 1) - stolenItem := stealFrom.items.pop() - child.items.insertAt(0, n.items[i-1]) - n.items[i-1] = stolenItem - if len(stealFrom.children) > 0 { - child.children.insertAt(0, stealFrom.children.pop()) - } - } else if i < len(n.items) && len(n.children[i+1].items) > minItems { - // steal from right child - child := n.mutableChild(i) - stealFrom := n.mutableChild(i + 1) - stolenItem := stealFrom.items.removeAt(0) - child.items = append(child.items, n.items[i]) - n.items[i] = stolenItem - if len(stealFrom.children) > 0 { - child.children = append(child.children, stealFrom.children.removeAt(0)) - } - } else { - if i >= len(n.items) { - i-- - } - child := n.mutableChild(i) - // merge with right child - mergeItem := n.items.removeAt(i) - mergeChild := n.children.removeAt(i + 1).mutableFor(n.cow) - child.items = append(child.items, mergeItem) - child.items = append(child.items, mergeChild.items...) - child.children = append(child.children, mergeChild.children...) - n.cow.freeNode(mergeChild) - } - return n.remove(item, minItems, typ) -} - -type direction int - -const ( - descend = direction(-1) - ascend = direction(+1) -) - -// iterate provides a simple method for iterating over elements in the tree. -// -// When ascending, the 'start' should be less than 'stop' and when descending, -// the 'start' should be greater than 'stop'. Setting 'includeStart' to true -// will force the iterator to include the first item when it equals 'start', -// thus creating a "greaterOrEqual" or "lessThanEqual" rather than just a -// "greaterThan" or "lessThan" queries. -func (n *node) iterate(dir direction, start, stop Item, includeStart bool, hit bool, iter ItemIterator) (bool, bool) { - var ok, found bool - var index int - switch dir { - case ascend: - if start != nil { - index, _ = n.items.find(start) - } - for i := index; i < len(n.items); i++ { - if len(n.children) > 0 { - if hit, ok = n.children[i].iterate(dir, start, stop, includeStart, hit, iter); !ok { - return hit, false - } - } - if !includeStart && !hit && start != nil && !start.Less(n.items[i]) { - hit = true - continue - } - hit = true - if stop != nil && !n.items[i].Less(stop) { - return hit, false - } - if !iter(n.items[i]) { - return hit, false - } - } - if len(n.children) > 0 { - if hit, ok = n.children[len(n.children)-1].iterate(dir, start, stop, includeStart, hit, iter); !ok { - return hit, false - } - } - case descend: - if start != nil { - index, found = n.items.find(start) - if !found { - index = index - 1 - } - } else { - index = len(n.items) - 1 - } - for i := index; i >= 0; i-- { - if start != nil && !n.items[i].Less(start) { - if !includeStart || hit || start.Less(n.items[i]) { - continue - } - } - if len(n.children) > 0 { - if hit, ok = n.children[i+1].iterate(dir, start, stop, includeStart, hit, iter); !ok { - return hit, false - } - } - if stop != nil && !stop.Less(n.items[i]) { - return hit, false // continue - } - hit = true - if !iter(n.items[i]) { - return hit, false - } - } - if len(n.children) > 0 { - if hit, ok = n.children[0].iterate(dir, start, stop, includeStart, hit, iter); !ok { - return hit, false - } - } - } - return hit, true -} - -// Used for testing/debugging purposes. -func (n *node) print(w io.Writer, level int) { - fmt.Fprintf(w, "%sNODE:%v\n", strings.Repeat(" ", level), n.items) - for _, c := range n.children { - c.print(w, level+1) - } -} - -// BTree is an implementation of a B-Tree. -// -// BTree stores Item instances in an ordered structure, allowing easy insertion, -// removal, and iteration. -// -// Write operations are not safe for concurrent mutation by multiple -// goroutines, but Read operations are. -type BTree struct { - degree int - length int - root *node - cow *copyOnWriteContext -} - -// copyOnWriteContext pointers determine node ownership... a tree with a write -// context equivalent to a node's write context is allowed to modify that node. -// A tree whose write context does not match a node's is not allowed to modify -// it, and must create a new, writable copy (IE: it's a Clone). -// -// When doing any write operation, we maintain the invariant that the current -// node's context is equal to the context of the tree that requested the write. -// We do this by, before we descend into any node, creating a copy with the -// correct context if the contexts don't match. -// -// Since the node we're currently visiting on any write has the requesting -// tree's context, that node is modifiable in place. Children of that node may -// not share context, but before we descend into them, we'll make a mutable -// copy. -type copyOnWriteContext struct { - freelist *FreeList -} - -// Clone clones the btree, lazily. Clone should not be called concurrently, -// but the original tree (t) and the new tree (t2) can be used concurrently -// once the Clone call completes. -// -// The internal tree structure of b is marked read-only and shared between t and -// t2. Writes to both t and t2 use copy-on-write logic, creating new nodes -// whenever one of b's original nodes would have been modified. Read operations -// should have no performance degredation. Write operations for both t and t2 -// will initially experience minor slow-downs caused by additional allocs and -// copies due to the aforementioned copy-on-write logic, but should converge to -// the original performance characteristics of the original tree. -func (t *BTree) Clone() (t2 *BTree) { - // Create two entirely new copy-on-write contexts. - // This operation effectively creates three trees: - // the original, shared nodes (old b.cow) - // the new b.cow nodes - // the new out.cow nodes - cow1, cow2 := *t.cow, *t.cow - out := *t - t.cow = &cow1 - out.cow = &cow2 - return &out -} - -// maxItems returns the max number of items to allow per node. -func (t *BTree) maxItems() int { - return t.degree*2 - 1 -} - -// minItems returns the min number of items to allow per node (ignored for the -// root node). -func (t *BTree) minItems() int { - return t.degree - 1 -} - -func (c *copyOnWriteContext) newNode() (n *node) { - n = c.freelist.newNode() - n.cow = c - return -} - -type freeType int - -const ( - ftFreelistFull freeType = iota // node was freed (available for GC, not stored in freelist) - ftStored // node was stored in the freelist for later use - ftNotOwned // node was ignored by COW, since it's owned by another one -) - -// freeNode frees a node within a given COW context, if it's owned by that -// context. It returns what happened to the node (see freeType const -// documentation). -func (c *copyOnWriteContext) freeNode(n *node) freeType { - if n.cow == c { - // clear to allow GC - n.items.truncate(0) - n.children.truncate(0) - n.cow = nil - if c.freelist.freeNode(n) { - return ftStored - } else { - return ftFreelistFull - } - } else { - return ftNotOwned - } -} - -// ReplaceOrInsert adds the given item to the tree. If an item in the tree -// already equals the given one, it is removed from the tree and returned. -// Otherwise, nil is returned. -// -// nil cannot be added to the tree (will panic). -func (t *BTree) ReplaceOrInsert(item Item) Item { - if item == nil { - panic("nil item being added to BTree") - } - if t.root == nil { - t.root = t.cow.newNode() - t.root.items = append(t.root.items, item) - t.length++ - return nil - } else { - t.root = t.root.mutableFor(t.cow) - if len(t.root.items) >= t.maxItems() { - item2, second := t.root.split(t.maxItems() / 2) - oldroot := t.root - t.root = t.cow.newNode() - t.root.items = append(t.root.items, item2) - t.root.children = append(t.root.children, oldroot, second) - } - } - out := t.root.insert(item, t.maxItems()) - if out == nil { - t.length++ - } - return out -} - -// Delete removes an item equal to the passed in item from the tree, returning -// it. If no such item exists, returns nil. -func (t *BTree) Delete(item Item) Item { - return t.deleteItem(item, removeItem) -} - -// DeleteMin removes the smallest item in the tree and returns it. -// If no such item exists, returns nil. -func (t *BTree) DeleteMin() Item { - return t.deleteItem(nil, removeMin) -} - -// DeleteMax removes the largest item in the tree and returns it. -// If no such item exists, returns nil. -func (t *BTree) DeleteMax() Item { - return t.deleteItem(nil, removeMax) -} - -func (t *BTree) deleteItem(item Item, typ toRemove) Item { - if t.root == nil || len(t.root.items) == 0 { - return nil - } - t.root = t.root.mutableFor(t.cow) - out := t.root.remove(item, t.minItems(), typ) - if len(t.root.items) == 0 && len(t.root.children) > 0 { - oldroot := t.root - t.root = t.root.children[0] - t.cow.freeNode(oldroot) - } - if out != nil { - t.length-- - } - return out -} - -// AscendRange calls the iterator for every value in the tree within the range -// [greaterOrEqual, lessThan), until iterator returns false. -func (t *BTree) AscendRange(greaterOrEqual, lessThan Item, iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(ascend, greaterOrEqual, lessThan, true, false, iterator) -} - -// AscendLessThan calls the iterator for every value in the tree within the range -// [first, pivot), until iterator returns false. -func (t *BTree) AscendLessThan(pivot Item, iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(ascend, nil, pivot, false, false, iterator) -} - -// AscendGreaterOrEqual calls the iterator for every value in the tree within -// the range [pivot, last], until iterator returns false. -func (t *BTree) AscendGreaterOrEqual(pivot Item, iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(ascend, pivot, nil, true, false, iterator) -} - -// Ascend calls the iterator for every value in the tree within the range -// [first, last], until iterator returns false. -func (t *BTree) Ascend(iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(ascend, nil, nil, false, false, iterator) -} - -// DescendRange calls the iterator for every value in the tree within the range -// [lessOrEqual, greaterThan), until iterator returns false. -func (t *BTree) DescendRange(lessOrEqual, greaterThan Item, iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(descend, lessOrEqual, greaterThan, true, false, iterator) -} - -// DescendLessOrEqual calls the iterator for every value in the tree within the range -// [pivot, first], until iterator returns false. -func (t *BTree) DescendLessOrEqual(pivot Item, iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(descend, pivot, nil, true, false, iterator) -} - -// DescendGreaterThan calls the iterator for every value in the tree within -// the range [last, pivot), until iterator returns false. -func (t *BTree) DescendGreaterThan(pivot Item, iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(descend, nil, pivot, false, false, iterator) -} - -// Descend calls the iterator for every value in the tree within the range -// [last, first], until iterator returns false. -func (t *BTree) Descend(iterator ItemIterator) { - if t.root == nil { - return - } - t.root.iterate(descend, nil, nil, false, false, iterator) -} - -// Get looks for the key item in the tree, returning it. It returns nil if -// unable to find that item. -func (t *BTree) Get(key Item) Item { - if t.root == nil { - return nil - } - return t.root.get(key) -} - -// Min returns the smallest item in the tree, or nil if the tree is empty. -func (t *BTree) Min() Item { - return min(t.root) -} - -// Max returns the largest item in the tree, or nil if the tree is empty. -func (t *BTree) Max() Item { - return max(t.root) -} - -// Has returns true if the given key is in the tree. -func (t *BTree) Has(key Item) bool { - return t.Get(key) != nil -} - -// Len returns the number of items currently in the tree. -func (t *BTree) Len() int { - return t.length -} - -// Clear removes all items from the btree. If addNodesToFreelist is true, -// t's nodes are added to its freelist as part of this call, until the freelist -// is full. Otherwise, the root node is simply dereferenced and the subtree -// left to Go's normal GC processes. -// -// This can be much faster -// than calling Delete on all elements, because that requires finding/removing -// each element in the tree and updating the tree accordingly. It also is -// somewhat faster than creating a new tree to replace the old one, because -// nodes from the old tree are reclaimed into the freelist for use by the new -// one, instead of being lost to the garbage collector. -// -// This call takes: -// O(1): when addNodesToFreelist is false, this is a single operation. -// O(1): when the freelist is already full, it breaks out immediately -// O(freelist size): when the freelist is empty and the nodes are all owned -// by this tree, nodes are added to the freelist until full. -// O(tree size): when all nodes are owned by another tree, all nodes are -// iterated over looking for nodes to add to the freelist, and due to -// ownership, none are. -func (t *BTree) Clear(addNodesToFreelist bool) { - if t.root != nil && addNodesToFreelist { - t.root.reset(t.cow) - } - t.root, t.length = nil, 0 -} - -// reset returns a subtree to the freelist. It breaks out immediately if the -// freelist is full, since the only benefit of iterating is to fill that -// freelist up. Returns true if parent reset call should continue. -func (n *node) reset(c *copyOnWriteContext) bool { - for _, child := range n.children { - if !child.reset(c) { - return false - } - } - return c.freeNode(n) != ftFreelistFull -} - -// Int implements the Item interface for integers. -type Int int - -// Less returns true if int(a) < int(b). -func (a Int) Less(b Item) bool { - return a < b.(Int) -} diff --git a/e2e/vendor/github.com/google/btree/btree_generic.go b/e2e/vendor/github.com/google/btree/btree_generic.go deleted file mode 100644 index e44a0f488..000000000 --- a/e2e/vendor/github.com/google/btree/btree_generic.go +++ /dev/null @@ -1,1083 +0,0 @@ -// Copyright 2014-2022 Google 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. - -//go:build go1.18 -// +build go1.18 - -// In Go 1.18 and beyond, a BTreeG generic is created, and BTree is a specific -// instantiation of that generic for the Item interface, with a backwards- -// compatible API. Before go1.18, generics are not supported, -// and BTree is just an implementation based around the Item interface. - -// Package btree implements in-memory B-Trees of arbitrary degree. -// -// btree implements an in-memory B-Tree for use as an ordered data structure. -// It is not meant for persistent storage solutions. -// -// It has a flatter structure than an equivalent red-black or other binary tree, -// which in some cases yields better memory usage and/or performance. -// See some discussion on the matter here: -// http://google-opensource.blogspot.com/2013/01/c-containers-that-save-memory-and-time.html -// Note, though, that this project is in no way related to the C++ B-Tree -// implementation written about there. -// -// Within this tree, each node contains a slice of items and a (possibly nil) -// slice of children. For basic numeric values or raw structs, this can cause -// efficiency differences when compared to equivalent C++ template code that -// stores values in arrays within the node: -// * Due to the overhead of storing values as interfaces (each -// value needs to be stored as the value itself, then 2 words for the -// interface pointing to that value and its type), resulting in higher -// memory use. -// * Since interfaces can point to values anywhere in memory, values are -// most likely not stored in contiguous blocks, resulting in a higher -// number of cache misses. -// These issues don't tend to matter, though, when working with strings or other -// heap-allocated structures, since C++-equivalent structures also must store -// pointers and also distribute their values across the heap. -// -// This implementation is designed to be a drop-in replacement to gollrb.LLRB -// trees, (http://github.com/petar/gollrb), an excellent and probably the most -// widely used ordered tree implementation in the Go ecosystem currently. -// Its functions, therefore, exactly mirror those of -// llrb.LLRB where possible. Unlike gollrb, though, we currently don't -// support storing multiple equivalent values. -// -// There are two implementations; those suffixed with 'G' are generics, usable -// for any type, and require a passed-in "less" function to define their ordering. -// Those without this prefix are specific to the 'Item' interface, and use -// its 'Less' function for ordering. -package btree - -import ( - "fmt" - "io" - "sort" - "strings" - "sync" -) - -// Item represents a single object in the tree. -type Item interface { - // Less tests whether the current item is less than the given argument. - // - // This must provide a strict weak ordering. - // If !a.Less(b) && !b.Less(a), we treat this to mean a == b (i.e. we can only - // hold one of either a or b in the tree). - Less(than Item) bool -} - -const ( - DefaultFreeListSize = 32 -) - -// FreeListG represents a free list of btree nodes. By default each -// BTree has its own FreeList, but multiple BTrees can share the same -// FreeList, in particular when they're created with Clone. -// Two Btrees using the same freelist are safe for concurrent write access. -type FreeListG[T any] struct { - mu sync.Mutex - freelist []*node[T] -} - -// NewFreeListG creates a new free list. -// size is the maximum size of the returned free list. -func NewFreeListG[T any](size int) *FreeListG[T] { - return &FreeListG[T]{freelist: make([]*node[T], 0, size)} -} - -func (f *FreeListG[T]) newNode() (n *node[T]) { - f.mu.Lock() - index := len(f.freelist) - 1 - if index < 0 { - f.mu.Unlock() - return new(node[T]) - } - n = f.freelist[index] - f.freelist[index] = nil - f.freelist = f.freelist[:index] - f.mu.Unlock() - return -} - -func (f *FreeListG[T]) freeNode(n *node[T]) (out bool) { - f.mu.Lock() - if len(f.freelist) < cap(f.freelist) { - f.freelist = append(f.freelist, n) - out = true - } - f.mu.Unlock() - return -} - -// ItemIteratorG allows callers of {A/De}scend* to iterate in-order over portions of -// the tree. When this function returns false, iteration will stop and the -// associated Ascend* function will immediately return. -type ItemIteratorG[T any] func(item T) bool - -// Ordered represents the set of types for which the '<' operator work. -type Ordered interface { - ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~float32 | ~float64 | ~string -} - -// Less[T] returns a default LessFunc that uses the '<' operator for types that support it. -func Less[T Ordered]() LessFunc[T] { - return func(a, b T) bool { return a < b } -} - -// NewOrderedG creates a new B-Tree for ordered types. -func NewOrderedG[T Ordered](degree int) *BTreeG[T] { - return NewG[T](degree, Less[T]()) -} - -// NewG creates a new B-Tree with the given degree. -// -// NewG(2), for example, will create a 2-3-4 tree (each node contains 1-3 items -// and 2-4 children). -// -// The passed-in LessFunc determines how objects of type T are ordered. -func NewG[T any](degree int, less LessFunc[T]) *BTreeG[T] { - return NewWithFreeListG(degree, less, NewFreeListG[T](DefaultFreeListSize)) -} - -// NewWithFreeListG creates a new B-Tree that uses the given node free list. -func NewWithFreeListG[T any](degree int, less LessFunc[T], f *FreeListG[T]) *BTreeG[T] { - if degree <= 1 { - panic("bad degree") - } - return &BTreeG[T]{ - degree: degree, - cow: ©OnWriteContext[T]{freelist: f, less: less}, - } -} - -// items stores items in a node. -type items[T any] []T - -// insertAt inserts a value into the given index, pushing all subsequent values -// forward. -func (s *items[T]) insertAt(index int, item T) { - var zero T - *s = append(*s, zero) - if index < len(*s) { - copy((*s)[index+1:], (*s)[index:]) - } - (*s)[index] = item -} - -// removeAt removes a value at a given index, pulling all subsequent values -// back. -func (s *items[T]) removeAt(index int) T { - item := (*s)[index] - copy((*s)[index:], (*s)[index+1:]) - var zero T - (*s)[len(*s)-1] = zero - *s = (*s)[:len(*s)-1] - return item -} - -// pop removes and returns the last element in the list. -func (s *items[T]) pop() (out T) { - index := len(*s) - 1 - out = (*s)[index] - var zero T - (*s)[index] = zero - *s = (*s)[:index] - return -} - -// truncate truncates this instance at index so that it contains only the -// first index items. index must be less than or equal to length. -func (s *items[T]) truncate(index int) { - var toClear items[T] - *s, toClear = (*s)[:index], (*s)[index:] - var zero T - for i := 0; i < len(toClear); i++ { - toClear[i] = zero - } -} - -// find returns the index where the given item should be inserted into this -// list. 'found' is true if the item already exists in the list at the given -// index. -func (s items[T]) find(item T, less func(T, T) bool) (index int, found bool) { - i := sort.Search(len(s), func(i int) bool { - return less(item, s[i]) - }) - if i > 0 && !less(s[i-1], item) { - return i - 1, true - } - return i, false -} - -// node is an internal node in a tree. -// -// It must at all times maintain the invariant that either -// * len(children) == 0, len(items) unconstrained -// * len(children) == len(items) + 1 -type node[T any] struct { - items items[T] - children items[*node[T]] - cow *copyOnWriteContext[T] -} - -func (n *node[T]) mutableFor(cow *copyOnWriteContext[T]) *node[T] { - if n.cow == cow { - return n - } - out := cow.newNode() - if cap(out.items) >= len(n.items) { - out.items = out.items[:len(n.items)] - } else { - out.items = make(items[T], len(n.items), cap(n.items)) - } - copy(out.items, n.items) - // Copy children - if cap(out.children) >= len(n.children) { - out.children = out.children[:len(n.children)] - } else { - out.children = make(items[*node[T]], len(n.children), cap(n.children)) - } - copy(out.children, n.children) - return out -} - -func (n *node[T]) mutableChild(i int) *node[T] { - c := n.children[i].mutableFor(n.cow) - n.children[i] = c - return c -} - -// split splits the given node at the given index. The current node shrinks, -// and this function returns the item that existed at that index and a new node -// containing all items/children after it. -func (n *node[T]) split(i int) (T, *node[T]) { - item := n.items[i] - next := n.cow.newNode() - next.items = append(next.items, n.items[i+1:]...) - n.items.truncate(i) - if len(n.children) > 0 { - next.children = append(next.children, n.children[i+1:]...) - n.children.truncate(i + 1) - } - return item, next -} - -// maybeSplitChild checks if a child should be split, and if so splits it. -// Returns whether or not a split occurred. -func (n *node[T]) maybeSplitChild(i, maxItems int) bool { - if len(n.children[i].items) < maxItems { - return false - } - first := n.mutableChild(i) - item, second := first.split(maxItems / 2) - n.items.insertAt(i, item) - n.children.insertAt(i+1, second) - return true -} - -// insert inserts an item into the subtree rooted at this node, making sure -// no nodes in the subtree exceed maxItems items. Should an equivalent item be -// be found/replaced by insert, it will be returned. -func (n *node[T]) insert(item T, maxItems int) (_ T, _ bool) { - i, found := n.items.find(item, n.cow.less) - if found { - out := n.items[i] - n.items[i] = item - return out, true - } - if len(n.children) == 0 { - n.items.insertAt(i, item) - return - } - if n.maybeSplitChild(i, maxItems) { - inTree := n.items[i] - switch { - case n.cow.less(item, inTree): - // no change, we want first split node - case n.cow.less(inTree, item): - i++ // we want second split node - default: - out := n.items[i] - n.items[i] = item - return out, true - } - } - return n.mutableChild(i).insert(item, maxItems) -} - -// get finds the given key in the subtree and returns it. -func (n *node[T]) get(key T) (_ T, _ bool) { - i, found := n.items.find(key, n.cow.less) - if found { - return n.items[i], true - } else if len(n.children) > 0 { - return n.children[i].get(key) - } - return -} - -// min returns the first item in the subtree. -func min[T any](n *node[T]) (_ T, found bool) { - if n == nil { - return - } - for len(n.children) > 0 { - n = n.children[0] - } - if len(n.items) == 0 { - return - } - return n.items[0], true -} - -// max returns the last item in the subtree. -func max[T any](n *node[T]) (_ T, found bool) { - if n == nil { - return - } - for len(n.children) > 0 { - n = n.children[len(n.children)-1] - } - if len(n.items) == 0 { - return - } - return n.items[len(n.items)-1], true -} - -// toRemove details what item to remove in a node.remove call. -type toRemove int - -const ( - removeItem toRemove = iota // removes the given item - removeMin // removes smallest item in the subtree - removeMax // removes largest item in the subtree -) - -// remove removes an item from the subtree rooted at this node. -func (n *node[T]) remove(item T, minItems int, typ toRemove) (_ T, _ bool) { - var i int - var found bool - switch typ { - case removeMax: - if len(n.children) == 0 { - return n.items.pop(), true - } - i = len(n.items) - case removeMin: - if len(n.children) == 0 { - return n.items.removeAt(0), true - } - i = 0 - case removeItem: - i, found = n.items.find(item, n.cow.less) - if len(n.children) == 0 { - if found { - return n.items.removeAt(i), true - } - return - } - default: - panic("invalid type") - } - // If we get to here, we have children. - if len(n.children[i].items) <= minItems { - return n.growChildAndRemove(i, item, minItems, typ) - } - child := n.mutableChild(i) - // Either we had enough items to begin with, or we've done some - // merging/stealing, because we've got enough now and we're ready to return - // stuff. - if found { - // The item exists at index 'i', and the child we've selected can give us a - // predecessor, since if we've gotten here it's got > minItems items in it. - out := n.items[i] - // We use our special-case 'remove' call with typ=maxItem to pull the - // predecessor of item i (the rightmost leaf of our immediate left child) - // and set it into where we pulled the item from. - var zero T - n.items[i], _ = child.remove(zero, minItems, removeMax) - return out, true - } - // Final recursive call. Once we're here, we know that the item isn't in this - // node and that the child is big enough to remove from. - return child.remove(item, minItems, typ) -} - -// growChildAndRemove grows child 'i' to make sure it's possible to remove an -// item from it while keeping it at minItems, then calls remove to actually -// remove it. -// -// Most documentation says we have to do two sets of special casing: -// 1) item is in this node -// 2) item is in child -// In both cases, we need to handle the two subcases: -// A) node has enough values that it can spare one -// B) node doesn't have enough values -// For the latter, we have to check: -// a) left sibling has node to spare -// b) right sibling has node to spare -// c) we must merge -// To simplify our code here, we handle cases #1 and #2 the same: -// If a node doesn't have enough items, we make sure it does (using a,b,c). -// We then simply redo our remove call, and the second time (regardless of -// whether we're in case 1 or 2), we'll have enough items and can guarantee -// that we hit case A. -func (n *node[T]) growChildAndRemove(i int, item T, minItems int, typ toRemove) (T, bool) { - if i > 0 && len(n.children[i-1].items) > minItems { - // Steal from left child - child := n.mutableChild(i) - stealFrom := n.mutableChild(i - 1) - stolenItem := stealFrom.items.pop() - child.items.insertAt(0, n.items[i-1]) - n.items[i-1] = stolenItem - if len(stealFrom.children) > 0 { - child.children.insertAt(0, stealFrom.children.pop()) - } - } else if i < len(n.items) && len(n.children[i+1].items) > minItems { - // steal from right child - child := n.mutableChild(i) - stealFrom := n.mutableChild(i + 1) - stolenItem := stealFrom.items.removeAt(0) - child.items = append(child.items, n.items[i]) - n.items[i] = stolenItem - if len(stealFrom.children) > 0 { - child.children = append(child.children, stealFrom.children.removeAt(0)) - } - } else { - if i >= len(n.items) { - i-- - } - child := n.mutableChild(i) - // merge with right child - mergeItem := n.items.removeAt(i) - mergeChild := n.children.removeAt(i + 1) - child.items = append(child.items, mergeItem) - child.items = append(child.items, mergeChild.items...) - child.children = append(child.children, mergeChild.children...) - n.cow.freeNode(mergeChild) - } - return n.remove(item, minItems, typ) -} - -type direction int - -const ( - descend = direction(-1) - ascend = direction(+1) -) - -type optionalItem[T any] struct { - item T - valid bool -} - -func optional[T any](item T) optionalItem[T] { - return optionalItem[T]{item: item, valid: true} -} -func empty[T any]() optionalItem[T] { - return optionalItem[T]{} -} - -// iterate provides a simple method for iterating over elements in the tree. -// -// When ascending, the 'start' should be less than 'stop' and when descending, -// the 'start' should be greater than 'stop'. Setting 'includeStart' to true -// will force the iterator to include the first item when it equals 'start', -// thus creating a "greaterOrEqual" or "lessThanEqual" rather than just a -// "greaterThan" or "lessThan" queries. -func (n *node[T]) iterate(dir direction, start, stop optionalItem[T], includeStart bool, hit bool, iter ItemIteratorG[T]) (bool, bool) { - var ok, found bool - var index int - switch dir { - case ascend: - if start.valid { - index, _ = n.items.find(start.item, n.cow.less) - } - for i := index; i < len(n.items); i++ { - if len(n.children) > 0 { - if hit, ok = n.children[i].iterate(dir, start, stop, includeStart, hit, iter); !ok { - return hit, false - } - } - if !includeStart && !hit && start.valid && !n.cow.less(start.item, n.items[i]) { - hit = true - continue - } - hit = true - if stop.valid && !n.cow.less(n.items[i], stop.item) { - return hit, false - } - if !iter(n.items[i]) { - return hit, false - } - } - if len(n.children) > 0 { - if hit, ok = n.children[len(n.children)-1].iterate(dir, start, stop, includeStart, hit, iter); !ok { - return hit, false - } - } - case descend: - if start.valid { - index, found = n.items.find(start.item, n.cow.less) - if !found { - index = index - 1 - } - } else { - index = len(n.items) - 1 - } - for i := index; i >= 0; i-- { - if start.valid && !n.cow.less(n.items[i], start.item) { - if !includeStart || hit || n.cow.less(start.item, n.items[i]) { - continue - } - } - if len(n.children) > 0 { - if hit, ok = n.children[i+1].iterate(dir, start, stop, includeStart, hit, iter); !ok { - return hit, false - } - } - if stop.valid && !n.cow.less(stop.item, n.items[i]) { - return hit, false // continue - } - hit = true - if !iter(n.items[i]) { - return hit, false - } - } - if len(n.children) > 0 { - if hit, ok = n.children[0].iterate(dir, start, stop, includeStart, hit, iter); !ok { - return hit, false - } - } - } - return hit, true -} - -// print is used for testing/debugging purposes. -func (n *node[T]) print(w io.Writer, level int) { - fmt.Fprintf(w, "%sNODE:%v\n", strings.Repeat(" ", level), n.items) - for _, c := range n.children { - c.print(w, level+1) - } -} - -// BTreeG is a generic implementation of a B-Tree. -// -// BTreeG stores items of type T in an ordered structure, allowing easy insertion, -// removal, and iteration. -// -// Write operations are not safe for concurrent mutation by multiple -// goroutines, but Read operations are. -type BTreeG[T any] struct { - degree int - length int - root *node[T] - cow *copyOnWriteContext[T] -} - -// LessFunc[T] determines how to order a type 'T'. It should implement a strict -// ordering, and should return true if within that ordering, 'a' < 'b'. -type LessFunc[T any] func(a, b T) bool - -// copyOnWriteContext pointers determine node ownership... a tree with a write -// context equivalent to a node's write context is allowed to modify that node. -// A tree whose write context does not match a node's is not allowed to modify -// it, and must create a new, writable copy (IE: it's a Clone). -// -// When doing any write operation, we maintain the invariant that the current -// node's context is equal to the context of the tree that requested the write. -// We do this by, before we descend into any node, creating a copy with the -// correct context if the contexts don't match. -// -// Since the node we're currently visiting on any write has the requesting -// tree's context, that node is modifiable in place. Children of that node may -// not share context, but before we descend into them, we'll make a mutable -// copy. -type copyOnWriteContext[T any] struct { - freelist *FreeListG[T] - less LessFunc[T] -} - -// Clone clones the btree, lazily. Clone should not be called concurrently, -// but the original tree (t) and the new tree (t2) can be used concurrently -// once the Clone call completes. -// -// The internal tree structure of b is marked read-only and shared between t and -// t2. Writes to both t and t2 use copy-on-write logic, creating new nodes -// whenever one of b's original nodes would have been modified. Read operations -// should have no performance degredation. Write operations for both t and t2 -// will initially experience minor slow-downs caused by additional allocs and -// copies due to the aforementioned copy-on-write logic, but should converge to -// the original performance characteristics of the original tree. -func (t *BTreeG[T]) Clone() (t2 *BTreeG[T]) { - // Create two entirely new copy-on-write contexts. - // This operation effectively creates three trees: - // the original, shared nodes (old b.cow) - // the new b.cow nodes - // the new out.cow nodes - cow1, cow2 := *t.cow, *t.cow - out := *t - t.cow = &cow1 - out.cow = &cow2 - return &out -} - -// maxItems returns the max number of items to allow per node. -func (t *BTreeG[T]) maxItems() int { - return t.degree*2 - 1 -} - -// minItems returns the min number of items to allow per node (ignored for the -// root node). -func (t *BTreeG[T]) minItems() int { - return t.degree - 1 -} - -func (c *copyOnWriteContext[T]) newNode() (n *node[T]) { - n = c.freelist.newNode() - n.cow = c - return -} - -type freeType int - -const ( - ftFreelistFull freeType = iota // node was freed (available for GC, not stored in freelist) - ftStored // node was stored in the freelist for later use - ftNotOwned // node was ignored by COW, since it's owned by another one -) - -// freeNode frees a node within a given COW context, if it's owned by that -// context. It returns what happened to the node (see freeType const -// documentation). -func (c *copyOnWriteContext[T]) freeNode(n *node[T]) freeType { - if n.cow == c { - // clear to allow GC - n.items.truncate(0) - n.children.truncate(0) - n.cow = nil - if c.freelist.freeNode(n) { - return ftStored - } else { - return ftFreelistFull - } - } else { - return ftNotOwned - } -} - -// ReplaceOrInsert adds the given item to the tree. If an item in the tree -// already equals the given one, it is removed from the tree and returned, -// and the second return value is true. Otherwise, (zeroValue, false) -// -// nil cannot be added to the tree (will panic). -func (t *BTreeG[T]) ReplaceOrInsert(item T) (_ T, _ bool) { - if t.root == nil { - t.root = t.cow.newNode() - t.root.items = append(t.root.items, item) - t.length++ - return - } else { - t.root = t.root.mutableFor(t.cow) - if len(t.root.items) >= t.maxItems() { - item2, second := t.root.split(t.maxItems() / 2) - oldroot := t.root - t.root = t.cow.newNode() - t.root.items = append(t.root.items, item2) - t.root.children = append(t.root.children, oldroot, second) - } - } - out, outb := t.root.insert(item, t.maxItems()) - if !outb { - t.length++ - } - return out, outb -} - -// Delete removes an item equal to the passed in item from the tree, returning -// it. If no such item exists, returns (zeroValue, false). -func (t *BTreeG[T]) Delete(item T) (T, bool) { - return t.deleteItem(item, removeItem) -} - -// DeleteMin removes the smallest item in the tree and returns it. -// If no such item exists, returns (zeroValue, false). -func (t *BTreeG[T]) DeleteMin() (T, bool) { - var zero T - return t.deleteItem(zero, removeMin) -} - -// DeleteMax removes the largest item in the tree and returns it. -// If no such item exists, returns (zeroValue, false). -func (t *BTreeG[T]) DeleteMax() (T, bool) { - var zero T - return t.deleteItem(zero, removeMax) -} - -func (t *BTreeG[T]) deleteItem(item T, typ toRemove) (_ T, _ bool) { - if t.root == nil || len(t.root.items) == 0 { - return - } - t.root = t.root.mutableFor(t.cow) - out, outb := t.root.remove(item, t.minItems(), typ) - if len(t.root.items) == 0 && len(t.root.children) > 0 { - oldroot := t.root - t.root = t.root.children[0] - t.cow.freeNode(oldroot) - } - if outb { - t.length-- - } - return out, outb -} - -// AscendRange calls the iterator for every value in the tree within the range -// [greaterOrEqual, lessThan), until iterator returns false. -func (t *BTreeG[T]) AscendRange(greaterOrEqual, lessThan T, iterator ItemIteratorG[T]) { - if t.root == nil { - return - } - t.root.iterate(ascend, optional[T](greaterOrEqual), optional[T](lessThan), true, false, iterator) -} - -// AscendLessThan calls the iterator for every value in the tree within the range -// [first, pivot), until iterator returns false. -func (t *BTreeG[T]) AscendLessThan(pivot T, iterator ItemIteratorG[T]) { - if t.root == nil { - return - } - t.root.iterate(ascend, empty[T](), optional(pivot), false, false, iterator) -} - -// AscendGreaterOrEqual calls the iterator for every value in the tree within -// the range [pivot, last], until iterator returns false. -func (t *BTreeG[T]) AscendGreaterOrEqual(pivot T, iterator ItemIteratorG[T]) { - if t.root == nil { - return - } - t.root.iterate(ascend, optional[T](pivot), empty[T](), true, false, iterator) -} - -// Ascend calls the iterator for every value in the tree within the range -// [first, last], until iterator returns false. -func (t *BTreeG[T]) Ascend(iterator ItemIteratorG[T]) { - if t.root == nil { - return - } - t.root.iterate(ascend, empty[T](), empty[T](), false, false, iterator) -} - -// DescendRange calls the iterator for every value in the tree within the range -// [lessOrEqual, greaterThan), until iterator returns false. -func (t *BTreeG[T]) DescendRange(lessOrEqual, greaterThan T, iterator ItemIteratorG[T]) { - if t.root == nil { - return - } - t.root.iterate(descend, optional[T](lessOrEqual), optional[T](greaterThan), true, false, iterator) -} - -// DescendLessOrEqual calls the iterator for every value in the tree within the range -// [pivot, first], until iterator returns false. -func (t *BTreeG[T]) DescendLessOrEqual(pivot T, iterator ItemIteratorG[T]) { - if t.root == nil { - return - } - t.root.iterate(descend, optional[T](pivot), empty[T](), true, false, iterator) -} - -// DescendGreaterThan calls the iterator for every value in the tree within -// the range [last, pivot), until iterator returns false. -func (t *BTreeG[T]) DescendGreaterThan(pivot T, iterator ItemIteratorG[T]) { - if t.root == nil { - return - } - t.root.iterate(descend, empty[T](), optional[T](pivot), false, false, iterator) -} - -// Descend calls the iterator for every value in the tree within the range -// [last, first], until iterator returns false. -func (t *BTreeG[T]) Descend(iterator ItemIteratorG[T]) { - if t.root == nil { - return - } - t.root.iterate(descend, empty[T](), empty[T](), false, false, iterator) -} - -// Get looks for the key item in the tree, returning it. It returns -// (zeroValue, false) if unable to find that item. -func (t *BTreeG[T]) Get(key T) (_ T, _ bool) { - if t.root == nil { - return - } - return t.root.get(key) -} - -// Min returns the smallest item in the tree, or (zeroValue, false) if the tree is empty. -func (t *BTreeG[T]) Min() (_ T, _ bool) { - return min(t.root) -} - -// Max returns the largest item in the tree, or (zeroValue, false) if the tree is empty. -func (t *BTreeG[T]) Max() (_ T, _ bool) { - return max(t.root) -} - -// Has returns true if the given key is in the tree. -func (t *BTreeG[T]) Has(key T) bool { - _, ok := t.Get(key) - return ok -} - -// Len returns the number of items currently in the tree. -func (t *BTreeG[T]) Len() int { - return t.length -} - -// Clear removes all items from the btree. If addNodesToFreelist is true, -// t's nodes are added to its freelist as part of this call, until the freelist -// is full. Otherwise, the root node is simply dereferenced and the subtree -// left to Go's normal GC processes. -// -// This can be much faster -// than calling Delete on all elements, because that requires finding/removing -// each element in the tree and updating the tree accordingly. It also is -// somewhat faster than creating a new tree to replace the old one, because -// nodes from the old tree are reclaimed into the freelist for use by the new -// one, instead of being lost to the garbage collector. -// -// This call takes: -// O(1): when addNodesToFreelist is false, this is a single operation. -// O(1): when the freelist is already full, it breaks out immediately -// O(freelist size): when the freelist is empty and the nodes are all owned -// by this tree, nodes are added to the freelist until full. -// O(tree size): when all nodes are owned by another tree, all nodes are -// iterated over looking for nodes to add to the freelist, and due to -// ownership, none are. -func (t *BTreeG[T]) Clear(addNodesToFreelist bool) { - if t.root != nil && addNodesToFreelist { - t.root.reset(t.cow) - } - t.root, t.length = nil, 0 -} - -// reset returns a subtree to the freelist. It breaks out immediately if the -// freelist is full, since the only benefit of iterating is to fill that -// freelist up. Returns true if parent reset call should continue. -func (n *node[T]) reset(c *copyOnWriteContext[T]) bool { - for _, child := range n.children { - if !child.reset(c) { - return false - } - } - return c.freeNode(n) != ftFreelistFull -} - -// Int implements the Item interface for integers. -type Int int - -// Less returns true if int(a) < int(b). -func (a Int) Less(b Item) bool { - return a < b.(Int) -} - -// BTree is an implementation of a B-Tree. -// -// BTree stores Item instances in an ordered structure, allowing easy insertion, -// removal, and iteration. -// -// Write operations are not safe for concurrent mutation by multiple -// goroutines, but Read operations are. -type BTree BTreeG[Item] - -var itemLess LessFunc[Item] = func(a, b Item) bool { - return a.Less(b) -} - -// New creates a new B-Tree with the given degree. -// -// New(2), for example, will create a 2-3-4 tree (each node contains 1-3 items -// and 2-4 children). -func New(degree int) *BTree { - return (*BTree)(NewG[Item](degree, itemLess)) -} - -// FreeList represents a free list of btree nodes. By default each -// BTree has its own FreeList, but multiple BTrees can share the same -// FreeList. -// Two Btrees using the same freelist are safe for concurrent write access. -type FreeList FreeListG[Item] - -// NewFreeList creates a new free list. -// size is the maximum size of the returned free list. -func NewFreeList(size int) *FreeList { - return (*FreeList)(NewFreeListG[Item](size)) -} - -// NewWithFreeList creates a new B-Tree that uses the given node free list. -func NewWithFreeList(degree int, f *FreeList) *BTree { - return (*BTree)(NewWithFreeListG[Item](degree, itemLess, (*FreeListG[Item])(f))) -} - -// ItemIterator allows callers of Ascend* to iterate in-order over portions of -// the tree. When this function returns false, iteration will stop and the -// associated Ascend* function will immediately return. -type ItemIterator ItemIteratorG[Item] - -// Clone clones the btree, lazily. Clone should not be called concurrently, -// but the original tree (t) and the new tree (t2) can be used concurrently -// once the Clone call completes. -// -// The internal tree structure of b is marked read-only and shared between t and -// t2. Writes to both t and t2 use copy-on-write logic, creating new nodes -// whenever one of b's original nodes would have been modified. Read operations -// should have no performance degredation. Write operations for both t and t2 -// will initially experience minor slow-downs caused by additional allocs and -// copies due to the aforementioned copy-on-write logic, but should converge to -// the original performance characteristics of the original tree. -func (t *BTree) Clone() (t2 *BTree) { - return (*BTree)((*BTreeG[Item])(t).Clone()) -} - -// Delete removes an item equal to the passed in item from the tree, returning -// it. If no such item exists, returns nil. -func (t *BTree) Delete(item Item) Item { - i, _ := (*BTreeG[Item])(t).Delete(item) - return i -} - -// DeleteMax removes the largest item in the tree and returns it. -// If no such item exists, returns nil. -func (t *BTree) DeleteMax() Item { - i, _ := (*BTreeG[Item])(t).DeleteMax() - return i -} - -// DeleteMin removes the smallest item in the tree and returns it. -// If no such item exists, returns nil. -func (t *BTree) DeleteMin() Item { - i, _ := (*BTreeG[Item])(t).DeleteMin() - return i -} - -// Get looks for the key item in the tree, returning it. It returns nil if -// unable to find that item. -func (t *BTree) Get(key Item) Item { - i, _ := (*BTreeG[Item])(t).Get(key) - return i -} - -// Max returns the largest item in the tree, or nil if the tree is empty. -func (t *BTree) Max() Item { - i, _ := (*BTreeG[Item])(t).Max() - return i -} - -// Min returns the smallest item in the tree, or nil if the tree is empty. -func (t *BTree) Min() Item { - i, _ := (*BTreeG[Item])(t).Min() - return i -} - -// Has returns true if the given key is in the tree. -func (t *BTree) Has(key Item) bool { - return (*BTreeG[Item])(t).Has(key) -} - -// ReplaceOrInsert adds the given item to the tree. If an item in the tree -// already equals the given one, it is removed from the tree and returned. -// Otherwise, nil is returned. -// -// nil cannot be added to the tree (will panic). -func (t *BTree) ReplaceOrInsert(item Item) Item { - i, _ := (*BTreeG[Item])(t).ReplaceOrInsert(item) - return i -} - -// AscendRange calls the iterator for every value in the tree within the range -// [greaterOrEqual, lessThan), until iterator returns false. -func (t *BTree) AscendRange(greaterOrEqual, lessThan Item, iterator ItemIterator) { - (*BTreeG[Item])(t).AscendRange(greaterOrEqual, lessThan, (ItemIteratorG[Item])(iterator)) -} - -// AscendLessThan calls the iterator for every value in the tree within the range -// [first, pivot), until iterator returns false. -func (t *BTree) AscendLessThan(pivot Item, iterator ItemIterator) { - (*BTreeG[Item])(t).AscendLessThan(pivot, (ItemIteratorG[Item])(iterator)) -} - -// AscendGreaterOrEqual calls the iterator for every value in the tree within -// the range [pivot, last], until iterator returns false. -func (t *BTree) AscendGreaterOrEqual(pivot Item, iterator ItemIterator) { - (*BTreeG[Item])(t).AscendGreaterOrEqual(pivot, (ItemIteratorG[Item])(iterator)) -} - -// Ascend calls the iterator for every value in the tree within the range -// [first, last], until iterator returns false. -func (t *BTree) Ascend(iterator ItemIterator) { - (*BTreeG[Item])(t).Ascend((ItemIteratorG[Item])(iterator)) -} - -// DescendRange calls the iterator for every value in the tree within the range -// [lessOrEqual, greaterThan), until iterator returns false. -func (t *BTree) DescendRange(lessOrEqual, greaterThan Item, iterator ItemIterator) { - (*BTreeG[Item])(t).DescendRange(lessOrEqual, greaterThan, (ItemIteratorG[Item])(iterator)) -} - -// DescendLessOrEqual calls the iterator for every value in the tree within the range -// [pivot, first], until iterator returns false. -func (t *BTree) DescendLessOrEqual(pivot Item, iterator ItemIterator) { - (*BTreeG[Item])(t).DescendLessOrEqual(pivot, (ItemIteratorG[Item])(iterator)) -} - -// DescendGreaterThan calls the iterator for every value in the tree within -// the range [last, pivot), until iterator returns false. -func (t *BTree) DescendGreaterThan(pivot Item, iterator ItemIterator) { - (*BTreeG[Item])(t).DescendGreaterThan(pivot, (ItemIteratorG[Item])(iterator)) -} - -// Descend calls the iterator for every value in the tree within the range -// [last, first], until iterator returns false. -func (t *BTree) Descend(iterator ItemIterator) { - (*BTreeG[Item])(t).Descend((ItemIteratorG[Item])(iterator)) -} - -// Len returns the number of items currently in the tree. -func (t *BTree) Len() int { - return (*BTreeG[Item])(t).Len() -} - -// Clear removes all items from the btree. If addNodesToFreelist is true, -// t's nodes are added to its freelist as part of this call, until the freelist -// is full. Otherwise, the root node is simply dereferenced and the subtree -// left to Go's normal GC processes. -// -// This can be much faster -// than calling Delete on all elements, because that requires finding/removing -// each element in the tree and updating the tree accordingly. It also is -// somewhat faster than creating a new tree to replace the old one, because -// nodes from the old tree are reclaimed into the freelist for use by the new -// one, instead of being lost to the garbage collector. -// -// This call takes: -// O(1): when addNodesToFreelist is false, this is a single operation. -// O(1): when the freelist is already full, it breaks out immediately -// O(freelist size): when the freelist is empty and the nodes are all owned -// by this tree, nodes are added to the freelist until full. -// O(tree size): when all nodes are owned by another tree, all nodes are -// iterated over looking for nodes to add to the freelist, and due to -// ownership, none are. -func (t *BTree) Clear(addNodesToFreelist bool) { - (*BTreeG[Item])(t).Clear(addNodesToFreelist) -} diff --git a/e2e/vendor/github.com/google/cadvisor/container/common/helpers.go b/e2e/vendor/github.com/google/cadvisor/container/common/helpers.go index dbffc922e..f5cbcbd4d 100644 --- a/e2e/vendor/github.com/google/cadvisor/container/common/helpers.go +++ b/e2e/vendor/github.com/google/cadvisor/container/common/helpers.go @@ -24,7 +24,7 @@ import ( "time" "github.com/karrick/godirwalk" - "github.com/opencontainers/runc/libcontainer/cgroups" + "github.com/opencontainers/cgroups" "github.com/pkg/errors" "golang.org/x/sys/unix" diff --git a/e2e/vendor/github.com/google/cadvisor/container/containerd/client.go b/e2e/vendor/github.com/google/cadvisor/container/containerd/client.go index ff5625170..34134baf3 100644 --- a/e2e/vendor/github.com/google/cadvisor/container/containerd/client.go +++ b/e2e/vendor/github.com/google/cadvisor/container/containerd/client.go @@ -26,7 +26,7 @@ import ( tasksapi "github.com/containerd/containerd/api/services/tasks/v1" versionapi "github.com/containerd/containerd/api/services/version/v1" tasktypes "github.com/containerd/containerd/api/types/task" - "github.com/containerd/errdefs" + "github.com/containerd/errdefs/pkg/errgrpc" "google.golang.org/grpc" "google.golang.org/grpc/backoff" "google.golang.org/grpc/credentials/insecure" @@ -114,7 +114,7 @@ func (c *client) LoadContainer(ctx context.Context, id string) (*containers.Cont ID: id, }) if err != nil { - return nil, errdefs.FromGRPC(err) + return nil, errgrpc.ToNative(err) } return containerFromProto(r.Container), nil } @@ -124,7 +124,7 @@ func (c *client) TaskPid(ctx context.Context, id string) (uint32, error) { ContainerID: id, }) if err != nil { - return 0, errdefs.FromGRPC(err) + return 0, errgrpc.ToNative(err) } if response.Process.Status == tasktypes.Status_UNKNOWN { return 0, ErrTaskIsInUnknownState @@ -135,7 +135,7 @@ func (c *client) TaskPid(ctx context.Context, id string) (uint32, error) { func (c *client) Version(ctx context.Context) (string, error) { response, err := c.versionService.Version(ctx, &emptypb.Empty{}) if err != nil { - return "", errdefs.FromGRPC(err) + return "", errgrpc.ToNative(err) } return response.Version, nil } diff --git a/e2e/vendor/github.com/google/cadvisor/container/containerd/handler.go b/e2e/vendor/github.com/google/cadvisor/container/containerd/handler.go index 7746341cd..d7f0864a6 100644 --- a/e2e/vendor/github.com/google/cadvisor/container/containerd/handler.go +++ b/e2e/vendor/github.com/google/cadvisor/container/containerd/handler.go @@ -23,7 +23,7 @@ import ( "time" "github.com/containerd/errdefs" - "github.com/opencontainers/runc/libcontainer/cgroups" + "github.com/opencontainers/cgroups" specs "github.com/opencontainers/runtime-spec/specs-go" "golang.org/x/net/context" diff --git a/e2e/vendor/github.com/google/cadvisor/container/crio/handler.go b/e2e/vendor/github.com/google/cadvisor/container/crio/handler.go index a68325187..f95573237 100644 --- a/e2e/vendor/github.com/google/cadvisor/container/crio/handler.go +++ b/e2e/vendor/github.com/google/cadvisor/container/crio/handler.go @@ -21,7 +21,7 @@ import ( "strconv" "strings" - "github.com/opencontainers/runc/libcontainer/cgroups" + "github.com/opencontainers/cgroups" "github.com/google/cadvisor/container" "github.com/google/cadvisor/container/common" diff --git a/e2e/vendor/github.com/google/cadvisor/container/factory.go b/e2e/vendor/github.com/google/cadvisor/container/factory.go index c48a64e16..dfe6de643 100644 --- a/e2e/vendor/github.com/google/cadvisor/container/factory.go +++ b/e2e/vendor/github.com/google/cadvisor/container/factory.go @@ -66,6 +66,7 @@ const ( ResctrlMetrics MetricKind = "resctrl" CPUSetMetrics MetricKind = "cpuset" OOMMetrics MetricKind = "oom_event" + PressureMetrics MetricKind = "pressure" ) // AllMetrics represents all kinds of metrics that cAdvisor supported. @@ -91,6 +92,7 @@ var AllMetrics = MetricSet{ ResctrlMetrics: struct{}{}, CPUSetMetrics: struct{}{}, OOMMetrics: struct{}{}, + PressureMetrics: struct{}{}, } // AllNetworkMetrics represents all network metrics that cAdvisor supports. diff --git a/e2e/vendor/github.com/google/cadvisor/container/libcontainer/handler.go b/e2e/vendor/github.com/google/cadvisor/container/libcontainer/handler.go index 9f05a52a4..cb34177cb 100644 --- a/e2e/vendor/github.com/google/cadvisor/container/libcontainer/handler.go +++ b/e2e/vendor/github.com/google/cadvisor/container/libcontainer/handler.go @@ -28,8 +28,8 @@ import ( "strings" "time" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fs2" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/fs2" "k8s.io/klog/v2" "github.com/google/cadvisor/container" @@ -717,10 +717,7 @@ func scanUDPStats(r io.Reader) (info.UdpStat, error) { return stats, scanner.Err() } - listening := uint64(0) - dropped := uint64(0) - rxQueued := uint64(0) - txQueued := uint64(0) + var listening, dropped, rxQueued, txQueued uint64 for scanner.Scan() { line := scanner.Text() @@ -733,8 +730,11 @@ func scanUDPStats(r io.Reader) (info.UdpStat, error) { continue } - rx, tx := uint64(0), uint64(0) - fmt.Sscanf(fs[4], "%X:%X", &rx, &tx) + var rx, tx uint64 + _, err := fmt.Sscanf(fs[4], "%X:%X", &rx, &tx) + if err != nil { + continue + } rxQueued += rx txQueued += tx @@ -771,6 +771,7 @@ func setCPUStats(s *cgroups.Stats, ret *info.ContainerStats, withPerCPU bool) { ret.Cpu.CFS.Periods = s.CpuStats.ThrottlingData.Periods ret.Cpu.CFS.ThrottledPeriods = s.CpuStats.ThrottlingData.ThrottledPeriods ret.Cpu.CFS.ThrottledTime = s.CpuStats.ThrottlingData.ThrottledTime + setPSIStats(s.CpuStats.PSI, &ret.Cpu.PSI) if !withPerCPU { return @@ -792,6 +793,7 @@ func setDiskIoStats(s *cgroups.Stats, ret *info.ContainerStats) { ret.DiskIo.IoWaitTime = diskStatsCopy(s.BlkioStats.IoWaitTimeRecursive) ret.DiskIo.IoMerged = diskStatsCopy(s.BlkioStats.IoMergedRecursive) ret.DiskIo.IoTime = diskStatsCopy(s.BlkioStats.IoTimeRecursive) + setPSIStats(s.BlkioStats.PSI, &ret.DiskIo.PSI) } func setMemoryStats(s *cgroups.Stats, ret *info.ContainerStats) { @@ -799,6 +801,7 @@ func setMemoryStats(s *cgroups.Stats, ret *info.ContainerStats) { ret.Memory.MaxUsage = s.MemoryStats.Usage.MaxUsage ret.Memory.Failcnt = s.MemoryStats.Usage.Failcnt ret.Memory.KernelUsage = s.MemoryStats.KernelUsage.Usage + setPSIStats(s.MemoryStats.PSI, &ret.Memory.PSI) if cgroups.IsCgroup2UnifiedMode() { ret.Memory.Cache = s.MemoryStats.Stats["file"] @@ -884,6 +887,22 @@ func setHugepageStats(s *cgroups.Stats, ret *info.ContainerStats) { } } +func setPSIData(d *cgroups.PSIData, ret *info.PSIData) { + if d != nil { + ret.Total = d.Total + ret.Avg10 = d.Avg10 + ret.Avg60 = d.Avg60 + ret.Avg300 = d.Avg300 + } +} + +func setPSIStats(s *cgroups.PSIStats, ret *info.PSIStats) { + if s != nil { + setPSIData(&s.Full, &ret.Full) + setPSIData(&s.Some, &ret.Some) + } +} + // read from pids path not cpu func setThreadsStats(s *cgroups.Stats, ret *info.ContainerStats) { if s != nil { diff --git a/e2e/vendor/github.com/google/cadvisor/container/libcontainer/helpers.go b/e2e/vendor/github.com/google/cadvisor/container/libcontainer/helpers.go index e535ad64c..de2387ee9 100644 --- a/e2e/vendor/github.com/google/cadvisor/container/libcontainer/helpers.go +++ b/e2e/vendor/github.com/google/cadvisor/container/libcontainer/helpers.go @@ -17,15 +17,12 @@ package libcontainer import ( "fmt" + "github.com/google/cadvisor/container" info "github.com/google/cadvisor/info/v1" - "github.com/opencontainers/runc/libcontainer/cgroups" - - "github.com/google/cadvisor/container" - - fs "github.com/opencontainers/runc/libcontainer/cgroups/fs" - fs2 "github.com/opencontainers/runc/libcontainer/cgroups/fs2" - configs "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" + fs "github.com/opencontainers/cgroups/fs" + fs2 "github.com/opencontainers/cgroups/fs2" "k8s.io/klog/v2" ) @@ -157,9 +154,9 @@ func diskStatsCopy(blkioStats []cgroups.BlkioStatEntry) (stat []info.PerDiskStat } func NewCgroupManager(name string, paths map[string]string) (cgroups.Manager, error) { - config := &configs.Cgroup{ + config := &cgroups.Cgroup{ Name: name, - Resources: &configs.Resources{}, + Resources: &cgroups.Resources{}, } if cgroups.IsCgroup2UnifiedMode() { path := paths[""] diff --git a/e2e/vendor/github.com/google/cadvisor/container/raw/handler.go b/e2e/vendor/github.com/google/cadvisor/container/raw/handler.go index 67a75c3d5..9397fb643 100644 --- a/e2e/vendor/github.com/google/cadvisor/container/raw/handler.go +++ b/e2e/vendor/github.com/google/cadvisor/container/raw/handler.go @@ -24,8 +24,8 @@ import ( "github.com/google/cadvisor/fs" info "github.com/google/cadvisor/info/v1" "github.com/google/cadvisor/machine" - "github.com/opencontainers/runc/libcontainer/cgroups" + "github.com/opencontainers/cgroups" "k8s.io/klog/v2" ) diff --git a/e2e/vendor/github.com/google/cadvisor/info/v1/container.go b/e2e/vendor/github.com/google/cadvisor/info/v1/container.go index ae1d9caec..592178316 100644 --- a/e2e/vendor/github.com/google/cadvisor/info/v1/container.go +++ b/e2e/vendor/github.com/google/cadvisor/info/v1/container.go @@ -261,6 +261,26 @@ func (ci *ContainerInfo) StatsEndTime() time.Time { return ret } +// PSI statistics for an individual resource. +type PSIStats struct { + // PSI data for all tasks of in the cgroup. + Full PSIData `json:"full,omitempty"` + // PSI data for some tasks in the cgroup. + Some PSIData `json:"some,omitempty"` +} + +type PSIData struct { + // Total time duration for tasks in the cgroup have waited due to congestion. + // Unit: nanoseconds. + Total uint64 `json:"total"` + // The average (in %) tasks have waited due to congestion over a 10 second window. + Avg10 float64 `json:"avg10"` + // The average (in %) tasks have waited due to congestion over a 60 second window. + Avg60 float64 `json:"avg60"` + // The average (in %) tasks have waited due to congestion over a 300 second window. + Avg300 float64 `json:"avg300"` +} + // This mirrors kernel internal structure. type LoadStats struct { // Number of sleeping tasks. @@ -334,7 +354,8 @@ type CpuStats struct { // from LoadStats.NrRunning. LoadAverage int32 `json:"load_average"` // from LoadStats.NrUninterruptible - LoadDAverage int32 `json:"load_d_average"` + LoadDAverage int32 `json:"load_d_average"` + PSI PSIStats `json:"psi"` } type PerDiskStats struct { @@ -353,6 +374,7 @@ type DiskIoStats struct { IoWaitTime []PerDiskStats `json:"io_wait_time,omitempty"` IoMerged []PerDiskStats `json:"io_merged,omitempty"` IoTime []PerDiskStats `json:"io_time,omitempty"` + PSI PSIStats `json:"psi"` } type HugetlbStats struct { @@ -411,6 +433,8 @@ type MemoryStats struct { ContainerData MemoryStatsMemoryData `json:"container_data,omitempty"` HierarchicalData MemoryStatsMemoryData `json:"hierarchical_data,omitempty"` + + PSI PSIStats `json:"psi"` } type CPUSetStats struct { diff --git a/e2e/vendor/github.com/google/cadvisor/manager/manager.go b/e2e/vendor/github.com/google/cadvisor/manager/manager.go index 8043394d5..7dbb01ecf 100644 --- a/e2e/vendor/github.com/google/cadvisor/manager/manager.go +++ b/e2e/vendor/github.com/google/cadvisor/manager/manager.go @@ -45,7 +45,7 @@ import ( "github.com/google/cadvisor/version" "github.com/google/cadvisor/watcher" - "github.com/opencontainers/runc/libcontainer/cgroups" + "github.com/opencontainers/cgroups" "k8s.io/klog/v2" "k8s.io/utils/clock" @@ -221,7 +221,7 @@ func New(memoryCache *memory.InMemoryCache, sysfs sysfs.SysFs, HousekeepingConfi return nil, err } - newManager.resctrlManager, err = resctrl.NewManager(resctrlInterval, resctrl.Setup, machineInfo.CPUVendorID, inHostNamespace) + newManager.resctrlManager, err = resctrl.NewManager(resctrlInterval, machineInfo.CPUVendorID, inHostNamespace) if err != nil { klog.V(4).Infof("Cannot gather resctrl metrics: %v", err) } @@ -265,7 +265,7 @@ type manager struct { eventsChannel chan watcher.ContainerEvent collectorHTTPClient *http.Client perfManager stats.Manager - resctrlManager resctrl.Manager + resctrlManager resctrl.ResControlManager // List of raw container cgroup path prefix whitelist. rawContainerCgroupPathPrefixWhiteList []string // List of container env prefix whitelist, the matched container envs would be collected into metrics as extra labels. diff --git a/e2e/vendor/github.com/google/cadvisor/resctrl/collector.go b/e2e/vendor/github.com/google/cadvisor/resctrl/collector.go deleted file mode 100644 index e5e71a7e4..000000000 --- a/e2e/vendor/github.com/google/cadvisor/resctrl/collector.go +++ /dev/null @@ -1,171 +0,0 @@ -//go:build linux -// +build linux - -// Copyright 2021 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. - -// Collector of resctrl for a container. -package resctrl - -import ( - "fmt" - "os" - "path/filepath" - "strings" - "sync" - "time" - - "k8s.io/klog/v2" - - info "github.com/google/cadvisor/info/v1" -) - -const noInterval = 0 - -type collector struct { - id string - interval time.Duration - getContainerPids func() ([]string, error) - resctrlPath string - running bool - destroyed bool - numberOfNUMANodes int - vendorID string - mu sync.Mutex - inHostNamespace bool -} - -func newCollector(id string, getContainerPids func() ([]string, error), interval time.Duration, numberOfNUMANodes int, vendorID string, inHostNamespace bool) *collector { - return &collector{id: id, interval: interval, getContainerPids: getContainerPids, numberOfNUMANodes: numberOfNUMANodes, - vendorID: vendorID, mu: sync.Mutex{}, inHostNamespace: inHostNamespace} -} - -func (c *collector) setup() error { - var err error - c.resctrlPath, err = prepareMonitoringGroup(c.id, c.getContainerPids, c.inHostNamespace) - - if c.interval != noInterval { - if err != nil { - klog.Errorf("Failed to setup container %q resctrl collector: %s \n Trying again in next intervals.", c.id, err) - } else { - c.running = true - } - go func() { - for { - time.Sleep(c.interval) - c.mu.Lock() - if c.destroyed { - break - } - klog.V(5).Infof("Trying to check %q containers control group.", c.id) - if c.running { - err = c.checkMonitoringGroup() - if err != nil { - c.running = false - klog.Errorf("Failed to check %q resctrl collector control group: %s \n Trying again in next intervals.", c.id, err) - } - } else { - c.resctrlPath, err = prepareMonitoringGroup(c.id, c.getContainerPids, c.inHostNamespace) - if err != nil { - c.running = false - klog.Errorf("Failed to setup container %q resctrl collector: %s \n Trying again in next intervals.", c.id, err) - } - } - c.mu.Unlock() - } - }() - } else { - // There is no interval set, if setup fail, stop. - if err != nil { - return fmt.Errorf("failed to setup container %q resctrl collector: %w", c.id, err) - } - c.running = true - } - - return nil -} - -func (c *collector) checkMonitoringGroup() error { - newPath, err := prepareMonitoringGroup(c.id, c.getContainerPids, c.inHostNamespace) - if err != nil { - return fmt.Errorf("couldn't obtain mon_group path: %v", err) - } - - // Check if container moved between control groups. - if newPath != c.resctrlPath { - err = c.clear() - if err != nil { - return fmt.Errorf("couldn't clear previous monitoring group: %w", err) - } - c.resctrlPath = newPath - } - - return nil -} - -func (c *collector) UpdateStats(stats *info.ContainerStats) error { - c.mu.Lock() - defer c.mu.Unlock() - if c.running { - stats.Resctrl = info.ResctrlStats{} - - resctrlStats, err := getIntelRDTStatsFrom(c.resctrlPath, c.vendorID) - if err != nil { - return err - } - - stats.Resctrl.MemoryBandwidth = make([]info.MemoryBandwidthStats, 0, c.numberOfNUMANodes) - stats.Resctrl.Cache = make([]info.CacheStats, 0, c.numberOfNUMANodes) - - for _, numaNodeStats := range *resctrlStats.MBMStats { - stats.Resctrl.MemoryBandwidth = append(stats.Resctrl.MemoryBandwidth, - info.MemoryBandwidthStats{ - TotalBytes: numaNodeStats.MBMTotalBytes, - LocalBytes: numaNodeStats.MBMLocalBytes, - }) - } - - for _, numaNodeStats := range *resctrlStats.CMTStats { - stats.Resctrl.Cache = append(stats.Resctrl.Cache, - info.CacheStats{LLCOccupancy: numaNodeStats.LLCOccupancy}) - } - } - - return nil -} - -func (c *collector) Destroy() { - c.mu.Lock() - defer c.mu.Unlock() - c.running = false - err := c.clear() - if err != nil { - klog.Errorf("trying to destroy %q resctrl collector but: %v", c.id, err) - } - c.destroyed = true -} - -func (c *collector) clear() error { - // Not allowed to remove root or undefined resctrl directory. - if c.id != rootContainer && c.resctrlPath != "" { - // Remove only own prepared mon group. - if strings.HasPrefix(filepath.Base(c.resctrlPath), monGroupPrefix) { - err := os.RemoveAll(c.resctrlPath) - if err != nil { - return fmt.Errorf("couldn't clear mon_group: %v", err) - } - } - } - return nil -} diff --git a/e2e/vendor/github.com/google/cadvisor/resctrl/factory.go b/e2e/vendor/github.com/google/cadvisor/resctrl/factory.go new file mode 100644 index 000000000..097b0bf6c --- /dev/null +++ b/e2e/vendor/github.com/google/cadvisor/resctrl/factory.go @@ -0,0 +1,58 @@ +// Copyright 2025 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 resctrl + +import ( + "fmt" + "sync" + "time" + + "github.com/google/cadvisor/stats" + + "k8s.io/klog/v2" +) + +type ResControlManager interface { + Destroy() + GetCollector(containerName string, getContainerPids func() ([]string, error), numberOfNUMANodes int) (stats.Collector, error) +} + +// All registered auth provider plugins. +var pluginsLock sync.Mutex +var plugins = make(map[string]ResControlManagerPlugin) + +type ResControlManagerPlugin interface { + NewManager(interval time.Duration, vendorID string, inHostNamespace bool) (ResControlManager, error) +} + +func RegisterPlugin(name string, plugin ResControlManagerPlugin) error { + pluginsLock.Lock() + defer pluginsLock.Unlock() + if _, found := plugins[name]; found { + return fmt.Errorf("ResControlManagerPlugin %q was registered twice", name) + } + klog.V(4).Infof("Registered ResControlManagerPlugin %q", name) + plugins[name] = plugin + return nil +} + +func NewManager(interval time.Duration, vendorID string, inHostNamespace bool) (ResControlManager, error) { + pluginsLock.Lock() + defer pluginsLock.Unlock() + for _, plugin := range plugins { + return plugin.NewManager(interval, vendorID, inHostNamespace) + } + return nil, fmt.Errorf("unable to find plugins for resctrl manager") +} diff --git a/e2e/vendor/github.com/google/cadvisor/resctrl/manager.go b/e2e/vendor/github.com/google/cadvisor/resctrl/manager.go deleted file mode 100644 index 672e0c74e..000000000 --- a/e2e/vendor/github.com/google/cadvisor/resctrl/manager.go +++ /dev/null @@ -1,79 +0,0 @@ -//go:build linux -// +build linux - -// Copyright 2021 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. - -// Manager of resctrl for containers. -package resctrl - -import ( - "errors" - "time" - - "k8s.io/klog/v2" - - "github.com/google/cadvisor/container/raw" - "github.com/google/cadvisor/stats" -) - -type Manager interface { - Destroy() - GetCollector(containerName string, getContainerPids func() ([]string, error), numberOfNUMANodes int) (stats.Collector, error) -} - -type manager struct { - stats.NoopDestroy - interval time.Duration - vendorID string - inHostNamespace bool -} - -func (m *manager) GetCollector(containerName string, getContainerPids func() ([]string, error), numberOfNUMANodes int) (stats.Collector, error) { - collector := newCollector(containerName, getContainerPids, m.interval, numberOfNUMANodes, m.vendorID, m.inHostNamespace) - err := collector.setup() - if err != nil { - return &stats.NoopCollector{}, err - } - - return collector, nil -} - -func NewManager(interval time.Duration, setup func() error, vendorID string, inHostNamespace bool) (Manager, error) { - err := setup() - if err != nil { - return &NoopManager{}, err - } - - if !isResctrlInitialized { - return &NoopManager{}, errors.New("the resctrl isn't initialized") - } - if !(enabledCMT || enabledMBM) { - return &NoopManager{}, errors.New("there are no monitoring features available") - } - - if !*raw.DockerOnly { - klog.Warning("--docker_only should be set when collecting Resctrl metrics! See the runtime docs.") - } - - return &manager{interval: interval, vendorID: vendorID, inHostNamespace: inHostNamespace}, nil -} - -type NoopManager struct { - stats.NoopDestroy -} - -func (np *NoopManager) GetCollector(_ string, _ func() ([]string, error), _ int) (stats.Collector, error) { - return &stats.NoopCollector{}, nil -} diff --git a/e2e/vendor/github.com/google/cadvisor/resctrl/utils.go b/e2e/vendor/github.com/google/cadvisor/resctrl/utils.go deleted file mode 100644 index 78c6262fb..000000000 --- a/e2e/vendor/github.com/google/cadvisor/resctrl/utils.go +++ /dev/null @@ -1,369 +0,0 @@ -//go:build linux -// +build linux - -// Copyright 2021 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. - -// Utilities. -package resctrl - -import ( - "bufio" - "bytes" - "fmt" - "os" - "path/filepath" - "strconv" - "strings" - - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fs2" - "github.com/opencontainers/runc/libcontainer/intelrdt" -) - -const ( - cpuCgroup = "cpu" - rootContainer = "/" - monitoringGroupDir = "mon_groups" - processTask = "task" - cpusFileName = "cpus" - cpusListFileName = "cpus_list" - schemataFileName = "schemata" - tasksFileName = "tasks" - modeFileName = "mode" - sizeFileName = "size" - infoDirName = "info" - monDataDirName = "mon_data" - monGroupsDirName = "mon_groups" - noPidsPassedError = "there are no pids passed" - noContainerNameError = "there are no container name passed" - noControlGroupFoundError = "couldn't find control group matching container" - llcOccupancyFileName = "llc_occupancy" - mbmLocalBytesFileName = "mbm_local_bytes" - mbmTotalBytesFileName = "mbm_total_bytes" - containerPrefix = '/' - minContainerNameLen = 2 // "/" e.g. "/a" - unavailable = "Unavailable" - monGroupPrefix = "cadvisor" -) - -var ( - rootResctrl = "" - pidsPath = "" - processPath = "/proc" - enabledMBM = false - enabledCMT = false - isResctrlInitialized = false - groupDirectories = map[string]struct{}{ - cpusFileName: {}, - cpusListFileName: {}, - infoDirName: {}, - monDataDirName: {}, - monGroupsDirName: {}, - schemataFileName: {}, - tasksFileName: {}, - modeFileName: {}, - sizeFileName: {}, - } -) - -func Setup() error { - var err error - rootResctrl, err = intelrdt.Root() - if err != nil { - return fmt.Errorf("unable to initialize resctrl: %v", err) - } - - if cgroups.IsCgroup2UnifiedMode() { - pidsPath = fs2.UnifiedMountpoint - } else { - pidsPath = filepath.Join(fs2.UnifiedMountpoint, cpuCgroup) - } - - enabledMBM = intelrdt.IsMBMEnabled() - enabledCMT = intelrdt.IsCMTEnabled() - - isResctrlInitialized = true - - return nil -} - -func prepareMonitoringGroup(containerName string, getContainerPids func() ([]string, error), inHostNamespace bool) (string, error) { - if containerName == rootContainer { - return rootResctrl, nil - } - - pids, err := getContainerPids() - if err != nil { - return "", err - } - - if len(pids) == 0 { - return "", fmt.Errorf("couldn't obtain %q container pids: there is no pids in cgroup", containerName) - } - - // Firstly, find the control group to which the container belongs. - // Consider the root group. - controlGroupPath, err := findGroup(rootResctrl, pids, true, false) - if err != nil { - return "", fmt.Errorf("%q %q: %q", noControlGroupFoundError, containerName, err) - } - if controlGroupPath == "" { - return "", fmt.Errorf("%q %q", noControlGroupFoundError, containerName) - } - - // Check if there is any monitoring group. - monGroupPath, err := findGroup(filepath.Join(controlGroupPath, monGroupsDirName), pids, false, true) - if err != nil { - return "", fmt.Errorf("couldn't find monitoring group matching %q container: %v", containerName, err) - } - - // Prepare new one if not exists. - if monGroupPath == "" { - // Remove leading prefix. - // e.g. /my/container -> my/container - if len(containerName) >= minContainerNameLen && containerName[0] == containerPrefix { - containerName = containerName[1:] - } - - // Add own prefix and use `-` instead `/`. - // e.g. my/container -> cadvisor-my-container - properContainerName := fmt.Sprintf("%s-%s", monGroupPrefix, strings.Replace(containerName, "/", "-", -1)) - monGroupPath = filepath.Join(controlGroupPath, monitoringGroupDir, properContainerName) - - err = os.MkdirAll(monGroupPath, os.ModePerm) - if err != nil { - return "", fmt.Errorf("couldn't create monitoring group directory for %q container: %w", containerName, err) - } - - if !inHostNamespace { - processPath = "/rootfs/proc" - } - - for _, pid := range pids { - processThreads, err := getAllProcessThreads(filepath.Join(processPath, pid, processTask)) - if err != nil { - return "", err - } - for _, thread := range processThreads { - err = intelrdt.WriteIntelRdtTasks(monGroupPath, thread) - if err != nil { - secondError := os.Remove(monGroupPath) - if secondError != nil { - return "", fmt.Errorf( - "coudn't assign pids to %q container monitoring group: %w \n couldn't clear %q monitoring group: %v", - containerName, err, containerName, secondError) - } - return "", fmt.Errorf("coudn't assign pids to %q container monitoring group: %w", containerName, err) - } - } - } - } - - return monGroupPath, nil -} - -func getPids(containerName string) ([]int, error) { - if len(containerName) == 0 { - // No container name passed. - return nil, fmt.Errorf(noContainerNameError) - } - pids, err := cgroups.GetAllPids(filepath.Join(pidsPath, containerName)) - if err != nil { - return nil, fmt.Errorf("couldn't obtain pids for %q container: %v", containerName, err) - } - return pids, nil -} - -// getAllProcessThreads obtains all available processes from directory. -// e.g. ls /proc/4215/task/ -> 4215, 4216, 4217, 4218 -// func will return [4215, 4216, 4217, 4218]. -func getAllProcessThreads(path string) ([]int, error) { - processThreads := make([]int, 0) - - threadDirs, err := os.ReadDir(path) - if err != nil { - return processThreads, err - } - - for _, dir := range threadDirs { - pid, err := strconv.Atoi(dir.Name()) - if err != nil { - return nil, fmt.Errorf("couldn't parse %q dir: %v", dir.Name(), err) - } - processThreads = append(processThreads, pid) - } - - return processThreads, nil -} - -// findGroup returns the path of a control/monitoring group in which the pids are. -func findGroup(group string, pids []string, includeGroup bool, exclusive bool) (string, error) { - if len(pids) == 0 { - return "", fmt.Errorf(noPidsPassedError) - } - - availablePaths := make([]string, 0) - if includeGroup { - availablePaths = append(availablePaths, group) - } - - files, err := os.ReadDir(group) - for _, file := range files { - if _, ok := groupDirectories[file.Name()]; !ok { - availablePaths = append(availablePaths, filepath.Join(group, file.Name())) - } - } - if err != nil { - return "", fmt.Errorf("couldn't obtain groups paths: %w", err) - } - - for _, path := range availablePaths { - groupFound, err := arePIDsInGroup(path, pids, exclusive) - if err != nil { - return "", err - } - if groupFound { - return path, nil - } - } - - return "", nil -} - -// arePIDsInGroup returns true if all of the pids are within control group. -func arePIDsInGroup(path string, pids []string, exclusive bool) (bool, error) { - if len(pids) == 0 { - return false, fmt.Errorf("couldn't obtain pids from %q path: %v", path, noPidsPassedError) - } - - tasks, err := readTasksFile(filepath.Join(path, tasksFileName)) - if err != nil { - return false, err - } - - any := false - for _, pid := range pids { - _, ok := tasks[pid] - if !ok { - // There are missing pids within group. - if any { - return false, fmt.Errorf("there should be all pids in group") - } - return false, nil - } - any = true - } - - // Check if there should be only passed pids in group. - if exclusive { - if len(tasks) != len(pids) { - return false, fmt.Errorf("group should have container pids only") - } - } - - return true, nil -} - -// readTasksFile returns pids map from given tasks path. -func readTasksFile(tasksPath string) (map[string]struct{}, error) { - tasks := make(map[string]struct{}) - - tasksFile, err := os.Open(tasksPath) - if err != nil { - return tasks, fmt.Errorf("couldn't read tasks file from %q path: %w", tasksPath, err) - } - defer tasksFile.Close() - - scanner := bufio.NewScanner(tasksFile) - for scanner.Scan() { - tasks[scanner.Text()] = struct{}{} - } - - if err := scanner.Err(); err != nil { - return tasks, fmt.Errorf("couldn't obtain pids from %q path: %w", tasksPath, err) - } - - return tasks, nil -} - -func readStatFrom(path string, vendorID string) (uint64, error) { - context, err := os.ReadFile(path) - if err != nil { - return 0, err - } - - contextString := string(bytes.TrimSpace(context)) - - if contextString == unavailable { - err := fmt.Errorf("\"Unavailable\" value from file %q", path) - if vendorID == "AuthenticAMD" { - kernelBugzillaLink := "https://bugzilla.kernel.org/show_bug.cgi?id=213311" - err = fmt.Errorf("%v, possible bug: %q", err, kernelBugzillaLink) - } - return 0, err - } - - stat, err := strconv.ParseUint(contextString, 10, 64) - if err != nil { - return stat, fmt.Errorf("unable to parse %q as a uint from file %q", string(context), path) - } - - return stat, nil -} - -func getIntelRDTStatsFrom(path string, vendorID string) (intelrdt.Stats, error) { - stats := intelrdt.Stats{} - - statsDirectories, err := filepath.Glob(filepath.Join(path, monDataDirName, "*")) - if err != nil { - return stats, err - } - - if len(statsDirectories) == 0 { - return stats, fmt.Errorf("there is no mon_data stats directories: %q", path) - } - - var cmtStats []intelrdt.CMTNumaNodeStats - var mbmStats []intelrdt.MBMNumaNodeStats - - for _, dir := range statsDirectories { - if enabledCMT { - llcOccupancy, err := readStatFrom(filepath.Join(dir, llcOccupancyFileName), vendorID) - if err != nil { - return stats, err - } - cmtStats = append(cmtStats, intelrdt.CMTNumaNodeStats{LLCOccupancy: llcOccupancy}) - } - if enabledMBM { - mbmTotalBytes, err := readStatFrom(filepath.Join(dir, mbmTotalBytesFileName), vendorID) - if err != nil { - return stats, err - } - mbmLocalBytes, err := readStatFrom(filepath.Join(dir, mbmLocalBytesFileName), vendorID) - if err != nil { - return stats, err - } - mbmStats = append(mbmStats, intelrdt.MBMNumaNodeStats{ - MBMTotalBytes: mbmTotalBytes, - MBMLocalBytes: mbmLocalBytes, - }) - } - } - - stats.CMTStats = &cmtStats - stats.MBMStats = &mbmStats - - return stats, nil -} diff --git a/e2e/vendor/github.com/google/cadvisor/utils/cpuload/netlink/netlink.go b/e2e/vendor/github.com/google/cadvisor/utils/cpuload/netlink/netlink.go index 31804768d..8af275f9b 100644 --- a/e2e/vendor/github.com/google/cadvisor/utils/cpuload/netlink/netlink.go +++ b/e2e/vendor/github.com/google/cadvisor/utils/cpuload/netlink/netlink.go @@ -47,7 +47,7 @@ type netlinkMessage struct { func (m netlinkMessage) toRawMsg() (rawmsg syscall.NetlinkMessage) { rawmsg.Header = m.Header w := bytes.NewBuffer([]byte{}) - binary.Write(w, Endian, m.GenHeader) + _ = binary.Write(w, Endian, m.GenHeader) w.Write(m.Data) rawmsg.Data = w.Bytes() return rawmsg @@ -94,13 +94,13 @@ func addAttribute(buf *bytes.Buffer, attrType uint16, data interface{}, dataSize Type: attrType, } attr.Len += uint16(dataSize) - binary.Write(buf, Endian, attr) + _ = binary.Write(buf, Endian, attr) switch data := data.(type) { case string: - binary.Write(buf, Endian, []byte(data)) + _ = binary.Write(buf, Endian, []byte(data)) buf.WriteByte(0) // terminate default: - binary.Write(buf, Endian, data) + _ = binary.Write(buf, Endian, data) } for i := 0; i < padding(int(attr.Len), syscall.NLMSG_ALIGNTO); i++ { buf.WriteByte(0) diff --git a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/.gitignore b/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/.gitignore deleted file mode 100644 index 2233cff9d..000000000 --- a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/.gitignore +++ /dev/null @@ -1,201 +0,0 @@ -#vendor -vendor/ - -# Created by .ignore support plugin (hsz.mobi) -coverage.txt -### Go template -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof -### Windows template -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk -### Kate template -# Swap Files # -.*.kate-swp -.swp.* -### SublimeText template -# cache files for sublime text -*.tmlanguage.cache -*.tmPreferences.cache -*.stTheme.cache - -# workspace files are user-specific -*.sublime-workspace - -# project files should be checked into the repository, unless a significant -# proportion of contributors will probably not be using SublimeText -# *.sublime-project - -# sftp configuration file -sftp-config.json -### Linux template -*~ - -# temporary files which can be created if a process still has a handle open of a deleted file -.fuse_hidden* - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* -### JetBrains template -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff: -.idea -.idea/tasks.xml -.idea/dictionaries -.idea/vcs.xml -.idea/jsLibraryMappings.xml - -# Sensitive or high-churn files: -.idea/dataSources.ids -.idea/dataSources.xml -.idea/dataSources.local.xml -.idea/sqlDataSources.xml -.idea/dynamic.xml -.idea/uiDesigner.xml - -# Gradle: -.idea/gradle.xml -.idea/libraries - -# Mongo Explorer plugin: -.idea/mongoSettings.xml - -## File-based project format: -*.iws - -## Plugin-specific files: - -# IntelliJ -/out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties -### Xcode template -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData/ - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata/ - -## Other -*.moved-aside -*.xccheckout -*.xcscmblueprint -### Eclipse template - -.metadata -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.settings/ -.loadpath -.recommenders - -# Eclipse Core -.project - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch - -# PyDev specific (Python IDE for Eclipse) -*.pydevproject - -# CDT-specific (C/C++ Development Tooling) -.cproject - -# JDT-specific (Eclipse Java Development Tools) -.classpath - -# Java annotation processor (APT) -.factorypath - -# PDT-specific (PHP Development Tools) -.buildpath - -# sbteclipse plugin -.target - -# Tern plugin -.tern-project - -# TeXlipse plugin -.texlipse - -# STS (Spring Tool Suite) -.springBeans - -# Code Recommenders -.recommenders/ - diff --git a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/.travis.yml b/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/.travis.yml deleted file mode 100644 index 2a845b96a..000000000 --- a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -sudo: false -language: go -# * github.com/grpc/grpc-go still supports go1.6 -# - When we drop support for go1.6 we can remove golang.org/x/net/context -# below as it is part of the Go std library since go1.7 -# * github.com/prometheus/client_golang already requires at least go1.7 since -# September 2017 -go: - - 1.6.x - - 1.7.x - - 1.8.x - - 1.9.x - - 1.10.x - - master - -install: - - go get github.com/prometheus/client_golang/prometheus - - go get google.golang.org/grpc - - go get golang.org/x/net/context - - go get github.com/stretchr/testify -script: - - make test - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/CHANGELOG.md b/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/CHANGELOG.md deleted file mode 100644 index 19a8059e1..000000000 --- a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/CHANGELOG.md +++ /dev/null @@ -1,24 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - -## [Unreleased] - -## [1.2.0](https://github.com/grpc-ecosystem/go-grpc-prometheus/releases/tag/v1.2.0) - 2018-06-04 - -### Added - -* Provide metrics object as `prometheus.Collector`, for conventional metric registration. -* Support non-default/global Prometheus registry. -* Allow configuring counters with `prometheus.CounterOpts`. - -### Changed - -* Remove usage of deprecated `grpc.Code()`. -* Remove usage of deprecated `grpc.Errorf` and replace with `status.Errorf`. - ---- - -This changelog was started with version `v1.2.0`, for earlier versions refer to the respective [GitHub releases](https://github.com/grpc-ecosystem/go-grpc-prometheus/releases). diff --git a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/LICENSE b/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/LICENSE deleted file mode 100644 index b2b065037..000000000 --- a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. \ No newline at end of file diff --git a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/README.md b/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/README.md deleted file mode 100644 index 499c58355..000000000 --- a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/README.md +++ /dev/null @@ -1,247 +0,0 @@ -# Go gRPC Interceptors for Prometheus monitoring - -[![Travis Build](https://travis-ci.org/grpc-ecosystem/go-grpc-prometheus.svg)](https://travis-ci.org/grpc-ecosystem/go-grpc-prometheus) -[![Go Report Card](https://goreportcard.com/badge/github.com/grpc-ecosystem/go-grpc-prometheus)](http://goreportcard.com/report/grpc-ecosystem/go-grpc-prometheus) -[![GoDoc](http://img.shields.io/badge/GoDoc-Reference-blue.svg)](https://godoc.org/github.com/grpc-ecosystem/go-grpc-prometheus) -[![SourceGraph](https://sourcegraph.com/github.com/grpc-ecosystem/go-grpc-prometheus/-/badge.svg)](https://sourcegraph.com/github.com/grpc-ecosystem/go-grpc-prometheus/?badge) -[![codecov](https://codecov.io/gh/grpc-ecosystem/go-grpc-prometheus/branch/master/graph/badge.svg)](https://codecov.io/gh/grpc-ecosystem/go-grpc-prometheus) -[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE) - -[Prometheus](https://prometheus.io/) monitoring for your [gRPC Go](https://github.com/grpc/grpc-go) servers and clients. - -A sister implementation for [gRPC Java](https://github.com/grpc/grpc-java) (same metrics, same semantics) is in [grpc-ecosystem/java-grpc-prometheus](https://github.com/grpc-ecosystem/java-grpc-prometheus). - -## Interceptors - -[gRPC Go](https://github.com/grpc/grpc-go) recently acquired support for Interceptors, i.e. middleware that is executed -by a gRPC Server before the request is passed onto the user's application logic. It is a perfect way to implement -common patterns: auth, logging and... monitoring. - -To use Interceptors in chains, please see [`go-grpc-middleware`](https://github.com/mwitkow/go-grpc-middleware). - -## Usage - -There are two types of interceptors: client-side and server-side. This package provides monitoring Interceptors for both. - -### Server-side - -```go -import "github.com/grpc-ecosystem/go-grpc-prometheus" -... - // Initialize your gRPC server's interceptor. - myServer := grpc.NewServer( - grpc.StreamInterceptor(grpc_prometheus.StreamServerInterceptor), - grpc.UnaryInterceptor(grpc_prometheus.UnaryServerInterceptor), - ) - // Register your gRPC service implementations. - myservice.RegisterMyServiceServer(s.server, &myServiceImpl{}) - // After all your registrations, make sure all of the Prometheus metrics are initialized. - grpc_prometheus.Register(myServer) - // Register Prometheus metrics handler. - http.Handle("/metrics", promhttp.Handler()) -... -``` - -### Client-side - -```go -import "github.com/grpc-ecosystem/go-grpc-prometheus" -... - clientConn, err = grpc.Dial( - address, - grpc.WithUnaryInterceptor(grpc_prometheus.UnaryClientInterceptor), - grpc.WithStreamInterceptor(grpc_prometheus.StreamClientInterceptor) - ) - client = pb_testproto.NewTestServiceClient(clientConn) - resp, err := client.PingEmpty(s.ctx, &myservice.Request{Msg: "hello"}) -... -``` - -# Metrics - -## Labels - -All server-side metrics start with `grpc_server` as Prometheus subsystem name. All client-side metrics start with `grpc_client`. Both of them have mirror-concepts. Similarly all methods -contain the same rich labels: - - * `grpc_service` - the [gRPC service](http://www.grpc.io/docs/#defining-a-service) name, which is the combination of protobuf `package` and - the `grpc_service` section name. E.g. for `package = mwitkow.testproto` and - `service TestService` the label will be `grpc_service="mwitkow.testproto.TestService"` - * `grpc_method` - the name of the method called on the gRPC service. E.g. - `grpc_method="Ping"` - * `grpc_type` - the gRPC [type of request](http://www.grpc.io/docs/guides/concepts.html#rpc-life-cycle). - Differentiating between the two is important especially for latency measurements. - - - `unary` is single request, single response RPC - - `client_stream` is a multi-request, single response RPC - - `server_stream` is a single request, multi-response RPC - - `bidi_stream` is a multi-request, multi-response RPC - - -Additionally for completed RPCs, the following labels are used: - - * `grpc_code` - the human-readable [gRPC status code](https://github.com/grpc/grpc-go/blob/master/codes/codes.go). - The list of all statuses is to long, but here are some common ones: - - - `OK` - means the RPC was successful - - `IllegalArgument` - RPC contained bad values - - `Internal` - server-side error not disclosed to the clients - -## Counters - -The counters and their up to date documentation is in [server_reporter.go](server_reporter.go) and [client_reporter.go](client_reporter.go) -the respective Prometheus handler (usually `/metrics`). - -For the purpose of this documentation we will only discuss `grpc_server` metrics. The `grpc_client` ones contain mirror concepts. - -For simplicity, let's assume we're tracking a single server-side RPC call of [`mwitkow.testproto.TestService`](examples/testproto/test.proto), -calling the method `PingList`. The call succeeds and returns 20 messages in the stream. - -First, immediately after the server receives the call it will increment the -`grpc_server_started_total` and start the handling time clock (if histograms are enabled). - -```jsoniq -grpc_server_started_total{grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream"} 1 -``` - -Then the user logic gets invoked. It receives one message from the client containing the request -(it's a `server_stream`): - -```jsoniq -grpc_server_msg_received_total{grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream"} 1 -``` - -The user logic may return an error, or send multiple messages back to the client. In this case, on -each of the 20 messages sent back, a counter will be incremented: - -```jsoniq -grpc_server_msg_sent_total{grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream"} 20 -``` - -After the call completes, its status (`OK` or other [gRPC status code](https://github.com/grpc/grpc-go/blob/master/codes/codes.go)) -and the relevant call labels increment the `grpc_server_handled_total` counter. - -```jsoniq -grpc_server_handled_total{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream"} 1 -``` - -## Histograms - -[Prometheus histograms](https://prometheus.io/docs/concepts/metric_types/#histogram) are a great way -to measure latency distributions of your RPCs. However, since it is bad practice to have metrics -of [high cardinality](https://prometheus.io/docs/practices/instrumentation/#do-not-overuse-labels) -the latency monitoring metrics are disabled by default. To enable them please call the following -in your server initialization code: - -```jsoniq -grpc_prometheus.EnableHandlingTimeHistogram() -``` - -After the call completes, its handling time will be recorded in a [Prometheus histogram](https://prometheus.io/docs/concepts/metric_types/#histogram) -variable `grpc_server_handling_seconds`. The histogram variable contains three sub-metrics: - - * `grpc_server_handling_seconds_count` - the count of all completed RPCs by status and method - * `grpc_server_handling_seconds_sum` - cumulative time of RPCs by status and method, useful for - calculating average handling times - * `grpc_server_handling_seconds_bucket` - contains the counts of RPCs by status and method in respective - handling-time buckets. These buckets can be used by Prometheus to estimate SLAs (see [here](https://prometheus.io/docs/practices/histograms/)) - -The counter values will look as follows: - -```jsoniq -grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.005"} 1 -grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.01"} 1 -grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.025"} 1 -grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.05"} 1 -grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.1"} 1 -grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.25"} 1 -grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.5"} 1 -grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="1"} 1 -grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="2.5"} 1 -grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="5"} 1 -grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="10"} 1 -grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="+Inf"} 1 -grpc_server_handling_seconds_sum{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream"} 0.0003866430000000001 -grpc_server_handling_seconds_count{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream"} 1 -``` - - -## Useful query examples - -Prometheus philosophy is to provide raw metrics to the monitoring system, and -let the aggregations be handled there. The verbosity of above metrics make it possible to have that -flexibility. Here's a couple of useful monitoring queries: - - -### request inbound rate -```jsoniq -sum(rate(grpc_server_started_total{job="foo"}[1m])) by (grpc_service) -``` -For `job="foo"` (common label to differentiate between Prometheus monitoring targets), calculate the -rate of requests per second (1 minute window) for each gRPC `grpc_service` that the job has. Please note -how the `grpc_method` is being omitted here: all methods of a given gRPC service will be summed together. - -### unary request error rate -```jsoniq -sum(rate(grpc_server_handled_total{job="foo",grpc_type="unary",grpc_code!="OK"}[1m])) by (grpc_service) -``` -For `job="foo"`, calculate the per-`grpc_service` rate of `unary` (1:1) RPCs that failed, i.e. the -ones that didn't finish with `OK` code. - -### unary request error percentage -```jsoniq -sum(rate(grpc_server_handled_total{job="foo",grpc_type="unary",grpc_code!="OK"}[1m])) by (grpc_service) - / -sum(rate(grpc_server_started_total{job="foo",grpc_type="unary"}[1m])) by (grpc_service) - * 100.0 -``` -For `job="foo"`, calculate the percentage of failed requests by service. It's easy to notice that -this is a combination of the two above examples. This is an example of a query you would like to -[alert on](https://prometheus.io/docs/alerting/rules/) in your system for SLA violations, e.g. -"no more than 1% requests should fail". - -### average response stream size -```jsoniq -sum(rate(grpc_server_msg_sent_total{job="foo",grpc_type="server_stream"}[10m])) by (grpc_service) - / -sum(rate(grpc_server_started_total{job="foo",grpc_type="server_stream"}[10m])) by (grpc_service) -``` -For `job="foo"` what is the `grpc_service`-wide `10m` average of messages returned for all ` -server_stream` RPCs. This allows you to track the stream sizes returned by your system, e.g. allows -you to track when clients started to send "wide" queries that ret -Note the divisor is the number of started RPCs, in order to account for in-flight requests. - -### 99%-tile latency of unary requests -```jsoniq -histogram_quantile(0.99, - sum(rate(grpc_server_handling_seconds_bucket{job="foo",grpc_type="unary"}[5m])) by (grpc_service,le) -) -``` -For `job="foo"`, returns an 99%-tile [quantile estimation](https://prometheus.io/docs/practices/histograms/#quantiles) -of the handling time of RPCs per service. Please note the `5m` rate, this means that the quantile -estimation will take samples in a rolling `5m` window. When combined with other quantiles -(e.g. 50%, 90%), this query gives you tremendous insight into the responsiveness of your system -(e.g. impact of caching). - -### percentage of slow unary queries (>250ms) -```jsoniq -100.0 - ( -sum(rate(grpc_server_handling_seconds_bucket{job="foo",grpc_type="unary",le="0.25"}[5m])) by (grpc_service) - / -sum(rate(grpc_server_handling_seconds_count{job="foo",grpc_type="unary"}[5m])) by (grpc_service) -) * 100.0 -``` -For `job="foo"` calculate the by-`grpc_service` fraction of slow requests that took longer than `0.25` -seconds. This query is relatively complex, since the Prometheus aggregations use `le` (less or equal) -buckets, meaning that counting "fast" requests fractions is easier. However, simple maths helps. -This is an example of a query you would like to alert on in your system for SLA violations, -e.g. "less than 1% of requests are slower than 250ms". - - -## Status - -This code has been used since August 2015 as the basis for monitoring of *production* gRPC micro services at [Improbable](https://improbable.io). - -## License - -`go-grpc-prometheus` is released under the Apache 2.0 license. See the [LICENSE](LICENSE) file for details. diff --git a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client.go b/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client.go deleted file mode 100644 index 751a4c72d..000000000 --- a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2016 Michal Witkowski. All Rights Reserved. -// See LICENSE for licensing terms. - -// gRPC Prometheus monitoring interceptors for client-side gRPC. - -package grpc_prometheus - -import ( - prom "github.com/prometheus/client_golang/prometheus" -) - -var ( - // DefaultClientMetrics is the default instance of ClientMetrics. It is - // intended to be used in conjunction the default Prometheus metrics - // registry. - DefaultClientMetrics = NewClientMetrics() - - // UnaryClientInterceptor is a gRPC client-side interceptor that provides Prometheus monitoring for Unary RPCs. - UnaryClientInterceptor = DefaultClientMetrics.UnaryClientInterceptor() - - // StreamClientInterceptor is a gRPC client-side interceptor that provides Prometheus monitoring for Streaming RPCs. - StreamClientInterceptor = DefaultClientMetrics.StreamClientInterceptor() -) - -func init() { - prom.MustRegister(DefaultClientMetrics.clientStartedCounter) - prom.MustRegister(DefaultClientMetrics.clientHandledCounter) - prom.MustRegister(DefaultClientMetrics.clientStreamMsgReceived) - prom.MustRegister(DefaultClientMetrics.clientStreamMsgSent) -} - -// EnableClientHandlingTimeHistogram turns on recording of handling time of -// RPCs. Histogram metrics can be very expensive for Prometheus to retain and -// query. This function acts on the DefaultClientMetrics variable and the -// default Prometheus metrics registry. -func EnableClientHandlingTimeHistogram(opts ...HistogramOption) { - DefaultClientMetrics.EnableClientHandlingTimeHistogram(opts...) - prom.Register(DefaultClientMetrics.clientHandledHistogram) -} diff --git a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client_metrics.go b/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client_metrics.go deleted file mode 100644 index 9b476f983..000000000 --- a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client_metrics.go +++ /dev/null @@ -1,170 +0,0 @@ -package grpc_prometheus - -import ( - "io" - - prom "github.com/prometheus/client_golang/prometheus" - "golang.org/x/net/context" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -// ClientMetrics represents a collection of metrics to be registered on a -// Prometheus metrics registry for a gRPC client. -type ClientMetrics struct { - clientStartedCounter *prom.CounterVec - clientHandledCounter *prom.CounterVec - clientStreamMsgReceived *prom.CounterVec - clientStreamMsgSent *prom.CounterVec - clientHandledHistogramEnabled bool - clientHandledHistogramOpts prom.HistogramOpts - clientHandledHistogram *prom.HistogramVec -} - -// NewClientMetrics returns a ClientMetrics object. Use a new instance of -// ClientMetrics when not using the default Prometheus metrics registry, for -// example when wanting to control which metrics are added to a registry as -// opposed to automatically adding metrics via init functions. -func NewClientMetrics(counterOpts ...CounterOption) *ClientMetrics { - opts := counterOptions(counterOpts) - return &ClientMetrics{ - clientStartedCounter: prom.NewCounterVec( - opts.apply(prom.CounterOpts{ - Name: "grpc_client_started_total", - Help: "Total number of RPCs started on the client.", - }), []string{"grpc_type", "grpc_service", "grpc_method"}), - - clientHandledCounter: prom.NewCounterVec( - opts.apply(prom.CounterOpts{ - Name: "grpc_client_handled_total", - Help: "Total number of RPCs completed by the client, regardless of success or failure.", - }), []string{"grpc_type", "grpc_service", "grpc_method", "grpc_code"}), - - clientStreamMsgReceived: prom.NewCounterVec( - opts.apply(prom.CounterOpts{ - Name: "grpc_client_msg_received_total", - Help: "Total number of RPC stream messages received by the client.", - }), []string{"grpc_type", "grpc_service", "grpc_method"}), - - clientStreamMsgSent: prom.NewCounterVec( - opts.apply(prom.CounterOpts{ - Name: "grpc_client_msg_sent_total", - Help: "Total number of gRPC stream messages sent by the client.", - }), []string{"grpc_type", "grpc_service", "grpc_method"}), - - clientHandledHistogramEnabled: false, - clientHandledHistogramOpts: prom.HistogramOpts{ - Name: "grpc_client_handling_seconds", - Help: "Histogram of response latency (seconds) of the gRPC until it is finished by the application.", - Buckets: prom.DefBuckets, - }, - clientHandledHistogram: nil, - } -} - -// Describe sends the super-set of all possible descriptors of metrics -// collected by this Collector to the provided channel and returns once -// the last descriptor has been sent. -func (m *ClientMetrics) Describe(ch chan<- *prom.Desc) { - m.clientStartedCounter.Describe(ch) - m.clientHandledCounter.Describe(ch) - m.clientStreamMsgReceived.Describe(ch) - m.clientStreamMsgSent.Describe(ch) - if m.clientHandledHistogramEnabled { - m.clientHandledHistogram.Describe(ch) - } -} - -// Collect is called by the Prometheus registry when collecting -// metrics. The implementation sends each collected metric via the -// provided channel and returns once the last metric has been sent. -func (m *ClientMetrics) Collect(ch chan<- prom.Metric) { - m.clientStartedCounter.Collect(ch) - m.clientHandledCounter.Collect(ch) - m.clientStreamMsgReceived.Collect(ch) - m.clientStreamMsgSent.Collect(ch) - if m.clientHandledHistogramEnabled { - m.clientHandledHistogram.Collect(ch) - } -} - -// EnableClientHandlingTimeHistogram turns on recording of handling time of RPCs. -// Histogram metrics can be very expensive for Prometheus to retain and query. -func (m *ClientMetrics) EnableClientHandlingTimeHistogram(opts ...HistogramOption) { - for _, o := range opts { - o(&m.clientHandledHistogramOpts) - } - if !m.clientHandledHistogramEnabled { - m.clientHandledHistogram = prom.NewHistogramVec( - m.clientHandledHistogramOpts, - []string{"grpc_type", "grpc_service", "grpc_method"}, - ) - } - m.clientHandledHistogramEnabled = true -} - -// UnaryClientInterceptor is a gRPC client-side interceptor that provides Prometheus monitoring for Unary RPCs. -func (m *ClientMetrics) UnaryClientInterceptor() func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { - return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { - monitor := newClientReporter(m, Unary, method) - monitor.SentMessage() - err := invoker(ctx, method, req, reply, cc, opts...) - if err != nil { - monitor.ReceivedMessage() - } - st, _ := status.FromError(err) - monitor.Handled(st.Code()) - return err - } -} - -// StreamClientInterceptor is a gRPC client-side interceptor that provides Prometheus monitoring for Streaming RPCs. -func (m *ClientMetrics) StreamClientInterceptor() func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) { - return func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) { - monitor := newClientReporter(m, clientStreamType(desc), method) - clientStream, err := streamer(ctx, desc, cc, method, opts...) - if err != nil { - st, _ := status.FromError(err) - monitor.Handled(st.Code()) - return nil, err - } - return &monitoredClientStream{clientStream, monitor}, nil - } -} - -func clientStreamType(desc *grpc.StreamDesc) grpcType { - if desc.ClientStreams && !desc.ServerStreams { - return ClientStream - } else if !desc.ClientStreams && desc.ServerStreams { - return ServerStream - } - return BidiStream -} - -// monitoredClientStream wraps grpc.ClientStream allowing each Sent/Recv of message to increment counters. -type monitoredClientStream struct { - grpc.ClientStream - monitor *clientReporter -} - -func (s *monitoredClientStream) SendMsg(m interface{}) error { - err := s.ClientStream.SendMsg(m) - if err == nil { - s.monitor.SentMessage() - } - return err -} - -func (s *monitoredClientStream) RecvMsg(m interface{}) error { - err := s.ClientStream.RecvMsg(m) - if err == nil { - s.monitor.ReceivedMessage() - } else if err == io.EOF { - s.monitor.Handled(codes.OK) - } else { - st, _ := status.FromError(err) - s.monitor.Handled(st.Code()) - } - return err -} diff --git a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client_reporter.go b/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client_reporter.go deleted file mode 100644 index cbf153229..000000000 --- a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client_reporter.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2016 Michal Witkowski. All Rights Reserved. -// See LICENSE for licensing terms. - -package grpc_prometheus - -import ( - "time" - - "google.golang.org/grpc/codes" -) - -type clientReporter struct { - metrics *ClientMetrics - rpcType grpcType - serviceName string - methodName string - startTime time.Time -} - -func newClientReporter(m *ClientMetrics, rpcType grpcType, fullMethod string) *clientReporter { - r := &clientReporter{ - metrics: m, - rpcType: rpcType, - } - if r.metrics.clientHandledHistogramEnabled { - r.startTime = time.Now() - } - r.serviceName, r.methodName = splitMethodName(fullMethod) - r.metrics.clientStartedCounter.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Inc() - return r -} - -func (r *clientReporter) ReceivedMessage() { - r.metrics.clientStreamMsgReceived.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Inc() -} - -func (r *clientReporter) SentMessage() { - r.metrics.clientStreamMsgSent.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Inc() -} - -func (r *clientReporter) Handled(code codes.Code) { - r.metrics.clientHandledCounter.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName, code.String()).Inc() - if r.metrics.clientHandledHistogramEnabled { - r.metrics.clientHandledHistogram.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Observe(time.Since(r.startTime).Seconds()) - } -} diff --git a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/makefile b/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/makefile deleted file mode 100644 index 74c084223..000000000 --- a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/makefile +++ /dev/null @@ -1,16 +0,0 @@ -SHELL="/bin/bash" - -GOFILES_NOVENDOR = $(shell go list ./... | grep -v /vendor/) - -all: vet fmt test - -fmt: - go fmt $(GOFILES_NOVENDOR) - -vet: - go vet $(GOFILES_NOVENDOR) - -test: vet - ./scripts/test_all.sh - -.PHONY: all vet test diff --git a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/metric_options.go b/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/metric_options.go deleted file mode 100644 index 9d51aec98..000000000 --- a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/metric_options.go +++ /dev/null @@ -1,41 +0,0 @@ -package grpc_prometheus - -import ( - prom "github.com/prometheus/client_golang/prometheus" -) - -// A CounterOption lets you add options to Counter metrics using With* funcs. -type CounterOption func(*prom.CounterOpts) - -type counterOptions []CounterOption - -func (co counterOptions) apply(o prom.CounterOpts) prom.CounterOpts { - for _, f := range co { - f(&o) - } - return o -} - -// WithConstLabels allows you to add ConstLabels to Counter metrics. -func WithConstLabels(labels prom.Labels) CounterOption { - return func(o *prom.CounterOpts) { - o.ConstLabels = labels - } -} - -// A HistogramOption lets you add options to Histogram metrics using With* -// funcs. -type HistogramOption func(*prom.HistogramOpts) - -// WithHistogramBuckets allows you to specify custom bucket ranges for histograms if EnableHandlingTimeHistogram is on. -func WithHistogramBuckets(buckets []float64) HistogramOption { - return func(o *prom.HistogramOpts) { o.Buckets = buckets } -} - -// WithHistogramConstLabels allows you to add custom ConstLabels to -// histograms metrics. -func WithHistogramConstLabels(labels prom.Labels) HistogramOption { - return func(o *prom.HistogramOpts) { - o.ConstLabels = labels - } -} diff --git a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server.go b/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server.go deleted file mode 100644 index 322f99046..000000000 --- a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2016 Michal Witkowski. All Rights Reserved. -// See LICENSE for licensing terms. - -// gRPC Prometheus monitoring interceptors for server-side gRPC. - -package grpc_prometheus - -import ( - prom "github.com/prometheus/client_golang/prometheus" - "google.golang.org/grpc" -) - -var ( - // DefaultServerMetrics is the default instance of ServerMetrics. It is - // intended to be used in conjunction the default Prometheus metrics - // registry. - DefaultServerMetrics = NewServerMetrics() - - // UnaryServerInterceptor is a gRPC server-side interceptor that provides Prometheus monitoring for Unary RPCs. - UnaryServerInterceptor = DefaultServerMetrics.UnaryServerInterceptor() - - // StreamServerInterceptor is a gRPC server-side interceptor that provides Prometheus monitoring for Streaming RPCs. - StreamServerInterceptor = DefaultServerMetrics.StreamServerInterceptor() -) - -func init() { - prom.MustRegister(DefaultServerMetrics.serverStartedCounter) - prom.MustRegister(DefaultServerMetrics.serverHandledCounter) - prom.MustRegister(DefaultServerMetrics.serverStreamMsgReceived) - prom.MustRegister(DefaultServerMetrics.serverStreamMsgSent) -} - -// Register takes a gRPC server and pre-initializes all counters to 0. This -// allows for easier monitoring in Prometheus (no missing metrics), and should -// be called *after* all services have been registered with the server. This -// function acts on the DefaultServerMetrics variable. -func Register(server *grpc.Server) { - DefaultServerMetrics.InitializeMetrics(server) -} - -// EnableHandlingTimeHistogram turns on recording of handling time -// of RPCs. Histogram metrics can be very expensive for Prometheus -// to retain and query. This function acts on the DefaultServerMetrics -// variable and the default Prometheus metrics registry. -func EnableHandlingTimeHistogram(opts ...HistogramOption) { - DefaultServerMetrics.EnableHandlingTimeHistogram(opts...) - prom.Register(DefaultServerMetrics.serverHandledHistogram) -} diff --git a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_metrics.go b/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_metrics.go deleted file mode 100644 index 5b1467e7a..000000000 --- a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_metrics.go +++ /dev/null @@ -1,185 +0,0 @@ -package grpc_prometheus - -import ( - prom "github.com/prometheus/client_golang/prometheus" - "golang.org/x/net/context" - "google.golang.org/grpc" - "google.golang.org/grpc/status" -) - -// ServerMetrics represents a collection of metrics to be registered on a -// Prometheus metrics registry for a gRPC server. -type ServerMetrics struct { - serverStartedCounter *prom.CounterVec - serverHandledCounter *prom.CounterVec - serverStreamMsgReceived *prom.CounterVec - serverStreamMsgSent *prom.CounterVec - serverHandledHistogramEnabled bool - serverHandledHistogramOpts prom.HistogramOpts - serverHandledHistogram *prom.HistogramVec -} - -// NewServerMetrics returns a ServerMetrics object. Use a new instance of -// ServerMetrics when not using the default Prometheus metrics registry, for -// example when wanting to control which metrics are added to a registry as -// opposed to automatically adding metrics via init functions. -func NewServerMetrics(counterOpts ...CounterOption) *ServerMetrics { - opts := counterOptions(counterOpts) - return &ServerMetrics{ - serverStartedCounter: prom.NewCounterVec( - opts.apply(prom.CounterOpts{ - Name: "grpc_server_started_total", - Help: "Total number of RPCs started on the server.", - }), []string{"grpc_type", "grpc_service", "grpc_method"}), - serverHandledCounter: prom.NewCounterVec( - opts.apply(prom.CounterOpts{ - Name: "grpc_server_handled_total", - Help: "Total number of RPCs completed on the server, regardless of success or failure.", - }), []string{"grpc_type", "grpc_service", "grpc_method", "grpc_code"}), - serverStreamMsgReceived: prom.NewCounterVec( - opts.apply(prom.CounterOpts{ - Name: "grpc_server_msg_received_total", - Help: "Total number of RPC stream messages received on the server.", - }), []string{"grpc_type", "grpc_service", "grpc_method"}), - serverStreamMsgSent: prom.NewCounterVec( - opts.apply(prom.CounterOpts{ - Name: "grpc_server_msg_sent_total", - Help: "Total number of gRPC stream messages sent by the server.", - }), []string{"grpc_type", "grpc_service", "grpc_method"}), - serverHandledHistogramEnabled: false, - serverHandledHistogramOpts: prom.HistogramOpts{ - Name: "grpc_server_handling_seconds", - Help: "Histogram of response latency (seconds) of gRPC that had been application-level handled by the server.", - Buckets: prom.DefBuckets, - }, - serverHandledHistogram: nil, - } -} - -// EnableHandlingTimeHistogram enables histograms being registered when -// registering the ServerMetrics on a Prometheus registry. Histograms can be -// expensive on Prometheus servers. It takes options to configure histogram -// options such as the defined buckets. -func (m *ServerMetrics) EnableHandlingTimeHistogram(opts ...HistogramOption) { - for _, o := range opts { - o(&m.serverHandledHistogramOpts) - } - if !m.serverHandledHistogramEnabled { - m.serverHandledHistogram = prom.NewHistogramVec( - m.serverHandledHistogramOpts, - []string{"grpc_type", "grpc_service", "grpc_method"}, - ) - } - m.serverHandledHistogramEnabled = true -} - -// Describe sends the super-set of all possible descriptors of metrics -// collected by this Collector to the provided channel and returns once -// the last descriptor has been sent. -func (m *ServerMetrics) Describe(ch chan<- *prom.Desc) { - m.serverStartedCounter.Describe(ch) - m.serverHandledCounter.Describe(ch) - m.serverStreamMsgReceived.Describe(ch) - m.serverStreamMsgSent.Describe(ch) - if m.serverHandledHistogramEnabled { - m.serverHandledHistogram.Describe(ch) - } -} - -// Collect is called by the Prometheus registry when collecting -// metrics. The implementation sends each collected metric via the -// provided channel and returns once the last metric has been sent. -func (m *ServerMetrics) Collect(ch chan<- prom.Metric) { - m.serverStartedCounter.Collect(ch) - m.serverHandledCounter.Collect(ch) - m.serverStreamMsgReceived.Collect(ch) - m.serverStreamMsgSent.Collect(ch) - if m.serverHandledHistogramEnabled { - m.serverHandledHistogram.Collect(ch) - } -} - -// UnaryServerInterceptor is a gRPC server-side interceptor that provides Prometheus monitoring for Unary RPCs. -func (m *ServerMetrics) UnaryServerInterceptor() func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { - return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { - monitor := newServerReporter(m, Unary, info.FullMethod) - monitor.ReceivedMessage() - resp, err := handler(ctx, req) - st, _ := status.FromError(err) - monitor.Handled(st.Code()) - if err == nil { - monitor.SentMessage() - } - return resp, err - } -} - -// StreamServerInterceptor is a gRPC server-side interceptor that provides Prometheus monitoring for Streaming RPCs. -func (m *ServerMetrics) StreamServerInterceptor() func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { - return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { - monitor := newServerReporter(m, streamRPCType(info), info.FullMethod) - err := handler(srv, &monitoredServerStream{ss, monitor}) - st, _ := status.FromError(err) - monitor.Handled(st.Code()) - return err - } -} - -// InitializeMetrics initializes all metrics, with their appropriate null -// value, for all gRPC methods registered on a gRPC server. This is useful, to -// ensure that all metrics exist when collecting and querying. -func (m *ServerMetrics) InitializeMetrics(server *grpc.Server) { - serviceInfo := server.GetServiceInfo() - for serviceName, info := range serviceInfo { - for _, mInfo := range info.Methods { - preRegisterMethod(m, serviceName, &mInfo) - } - } -} - -func streamRPCType(info *grpc.StreamServerInfo) grpcType { - if info.IsClientStream && !info.IsServerStream { - return ClientStream - } else if !info.IsClientStream && info.IsServerStream { - return ServerStream - } - return BidiStream -} - -// monitoredStream wraps grpc.ServerStream allowing each Sent/Recv of message to increment counters. -type monitoredServerStream struct { - grpc.ServerStream - monitor *serverReporter -} - -func (s *monitoredServerStream) SendMsg(m interface{}) error { - err := s.ServerStream.SendMsg(m) - if err == nil { - s.monitor.SentMessage() - } - return err -} - -func (s *monitoredServerStream) RecvMsg(m interface{}) error { - err := s.ServerStream.RecvMsg(m) - if err == nil { - s.monitor.ReceivedMessage() - } - return err -} - -// preRegisterMethod is invoked on Register of a Server, allowing all gRPC services labels to be pre-populated. -func preRegisterMethod(metrics *ServerMetrics, serviceName string, mInfo *grpc.MethodInfo) { - methodName := mInfo.Name - methodType := string(typeFromMethodInfo(mInfo)) - // These are just references (no increments), as just referencing will create the labels but not set values. - metrics.serverStartedCounter.GetMetricWithLabelValues(methodType, serviceName, methodName) - metrics.serverStreamMsgReceived.GetMetricWithLabelValues(methodType, serviceName, methodName) - metrics.serverStreamMsgSent.GetMetricWithLabelValues(methodType, serviceName, methodName) - if metrics.serverHandledHistogramEnabled { - metrics.serverHandledHistogram.GetMetricWithLabelValues(methodType, serviceName, methodName) - } - for _, code := range allCodes { - metrics.serverHandledCounter.GetMetricWithLabelValues(methodType, serviceName, methodName, code.String()) - } -} diff --git a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_reporter.go b/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_reporter.go deleted file mode 100644 index aa9db5401..000000000 --- a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_reporter.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2016 Michal Witkowski. All Rights Reserved. -// See LICENSE for licensing terms. - -package grpc_prometheus - -import ( - "time" - - "google.golang.org/grpc/codes" -) - -type serverReporter struct { - metrics *ServerMetrics - rpcType grpcType - serviceName string - methodName string - startTime time.Time -} - -func newServerReporter(m *ServerMetrics, rpcType grpcType, fullMethod string) *serverReporter { - r := &serverReporter{ - metrics: m, - rpcType: rpcType, - } - if r.metrics.serverHandledHistogramEnabled { - r.startTime = time.Now() - } - r.serviceName, r.methodName = splitMethodName(fullMethod) - r.metrics.serverStartedCounter.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Inc() - return r -} - -func (r *serverReporter) ReceivedMessage() { - r.metrics.serverStreamMsgReceived.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Inc() -} - -func (r *serverReporter) SentMessage() { - r.metrics.serverStreamMsgSent.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Inc() -} - -func (r *serverReporter) Handled(code codes.Code) { - r.metrics.serverHandledCounter.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName, code.String()).Inc() - if r.metrics.serverHandledHistogramEnabled { - r.metrics.serverHandledHistogram.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Observe(time.Since(r.startTime).Seconds()) - } -} diff --git a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/util.go b/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/util.go deleted file mode 100644 index 7987de35f..000000000 --- a/e2e/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/util.go +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2016 Michal Witkowski. All Rights Reserved. -// See LICENSE for licensing terms. - -package grpc_prometheus - -import ( - "strings" - - "google.golang.org/grpc" - "google.golang.org/grpc/codes" -) - -type grpcType string - -const ( - Unary grpcType = "unary" - ClientStream grpcType = "client_stream" - ServerStream grpcType = "server_stream" - BidiStream grpcType = "bidi_stream" -) - -var ( - allCodes = []codes.Code{ - codes.OK, codes.Canceled, codes.Unknown, codes.InvalidArgument, codes.DeadlineExceeded, codes.NotFound, - codes.AlreadyExists, codes.PermissionDenied, codes.Unauthenticated, codes.ResourceExhausted, - codes.FailedPrecondition, codes.Aborted, codes.OutOfRange, codes.Unimplemented, codes.Internal, - codes.Unavailable, codes.DataLoss, - } -) - -func splitMethodName(fullMethodName string) (string, string) { - fullMethodName = strings.TrimPrefix(fullMethodName, "/") // remove leading slash - if i := strings.Index(fullMethodName, "/"); i >= 0 { - return fullMethodName[:i], fullMethodName[i+1:] - } - return "unknown", "unknown" -} - -func typeFromMethodInfo(mInfo *grpc.MethodInfo) grpcType { - if !mInfo.IsClientStream && !mInfo.IsServerStream { - return Unary - } - if mInfo.IsClientStream && !mInfo.IsServerStream { - return ClientStream - } - if !mInfo.IsClientStream && mInfo.IsServerStream { - return ServerStream - } - return BidiStream -} diff --git a/e2e/vendor/github.com/opencontainers/cgroups/CODEOWNERS b/e2e/vendor/github.com/opencontainers/cgroups/CODEOWNERS new file mode 100644 index 000000000..7201e35ac --- /dev/null +++ b/e2e/vendor/github.com/opencontainers/cgroups/CODEOWNERS @@ -0,0 +1 @@ +* @maintainer1 @maintainer2 @maintainer3 diff --git a/e2e/vendor/github.com/opencontainers/cgroups/CONTRIBUTING.md b/e2e/vendor/github.com/opencontainers/cgroups/CONTRIBUTING.md new file mode 100644 index 000000000..135abcf02 --- /dev/null +++ b/e2e/vendor/github.com/opencontainers/cgroups/CONTRIBUTING.md @@ -0,0 +1,150 @@ +# Contribution Guidelines + +Development happens on GitHub. +Issues are used for bugs and actionable items and longer discussions can happen on the [mailing list](#mailing-list). + +The content of this repository is licensed under the [Apache License, Version 2.0](LICENSE). + +## Code of Conduct + +Participation in the Open Container community is governed by [Open Container Code of Conduct][code-of-conduct]. + +## Meetings + +The contributors and maintainers of all OCI projects have monthly meetings at 2:00 PM (USA Pacific) on the first Wednesday of every month. +There is an [iCalendar][rfc5545] format for the meetings [here][meeting.ics]. +Everyone is welcome to participate via [UberConference web][UberConference] or audio-only: +1 415 968 0849 (no PIN needed). +An initial agenda will be posted to the [mailing list](#mailing-list) in the week before each meeting, and everyone is welcome to propose additional topics or suggest other agenda alterations there. +Minutes from past meetings are archived [here][minutes]. + +## Mailing list + +You can subscribe and browse the mailing list on [Google Groups][mailing-list]. + +## IRC + +OCI discussion happens on #opencontainers on [Freenode][] ([logs][irc-logs]). + +## Git + +### Security issues + +If you are reporting a security issue, do not create an issue or file a pull +request on GitHub. Instead, disclose the issue responsibly by sending an email +to security@opencontainers.org (which is inhabited only by the maintainers of +the various OCI projects). + +### Pull requests are always welcome + +We are always thrilled to receive pull requests, and do our best to +process them as fast as possible. Not sure if that typo is worth a pull +request? Do it! We will appreciate it. + +If your pull request is not accepted on the first try, don't be +discouraged! If there's a problem with the implementation, hopefully you +received feedback on what to improve. + +We're trying very hard to keep the project lean and focused. We don't want it +to do everything for everybody. This means that we might decide against +incorporating a new feature. + +### Conventions + +Fork the repo and make changes on your fork in a feature branch. +For larger bugs and enhancements, consider filing a leader issue or mailing-list thread for discussion that is independent of the implementation. +Small changes or changes that have been discussed on the [project mailing list](#mailing-list) may be submitted without a leader issue. + +If the project has a test suite, submit unit tests for your changes. Take a +look at existing tests for inspiration. Run the full test suite on your branch +before submitting a pull request. + +Update the documentation when creating or modifying features. Test +your documentation changes for clarity, concision, and correctness, as +well as a clean documentation build. + +Pull requests descriptions should be as clear as possible and include a +reference to all the issues that they address. + +Commit messages must start with a capitalized and short summary +written in the imperative, followed by an optional, more detailed +explanatory text which is separated from the summary by an empty line. + +Code review comments may be added to your pull request. Discuss, then make the +suggested modifications and push additional commits to your feature branch. Be +sure to post a comment after pushing. The new commits will show up in the pull +request automatically, but the reviewers will not be notified unless you +comment. + +Before the pull request is merged, make sure that you squash your commits into +logical units of work using `git rebase -i` and `git push -f`. After every +commit the test suite (if any) should be passing. Include documentation changes +in the same commit so that a revert would remove all traces of the feature or +fix. + +Commits that fix or close an issue should include a reference like `Closes #XXX` +or `Fixes #XXX`, which will automatically close the issue when merged. + +### Sign your work + +The sign-off is a simple line at the end of the explanation for the +patch, which certifies that you wrote it or otherwise have the right to +pass it on as an open-source patch. The rules are pretty simple: if you +can certify the below (from [developercertificate.org][]): + +``` +Developer Certificate of Origin +Version 1.1 + +Copyright (C) 2004, 2006 The Linux Foundation and its contributors. +1 Letterman Drive +Suite D4700 +San Francisco, CA, 94129 + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + + +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. +``` + +then you just add a line to every git commit message: + + Signed-off-by: Joe Smith + +using your real name (sorry, no pseudonyms or anonymous contributions.) + +You can add the sign off when creating the git commit via `git commit -s`. + +[code-of-conduct]: https://github.com/opencontainers/tob/blob/d2f9d68c1332870e40693fe077d311e0742bc73d/code-of-conduct.md +[developercertificate.org]: http://developercertificate.org/ +[Freenode]: https://freenode.net/ +[irc-logs]: http://ircbot.wl.linuxfoundation.org/eavesdrop/%23opencontainers/ +[mailing-list]: https://groups.google.com/a/opencontainers.org/forum/#!forum/dev +[meeting.ics]: https://github.com/opencontainers/runtime-spec/blob/master/meeting.ics +[minutes]: http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/ +[rfc5545]: https://tools.ietf.org/html/rfc5545 +[UberConference]: https://www.uberconference.com/opencontainers diff --git a/e2e/vendor/github.com/opencontainers/cgroups/GOVERNANCE.md b/e2e/vendor/github.com/opencontainers/cgroups/GOVERNANCE.md new file mode 100644 index 000000000..3b7b32f78 --- /dev/null +++ b/e2e/vendor/github.com/opencontainers/cgroups/GOVERNANCE.md @@ -0,0 +1,63 @@ +# Project governance + +The [OCI charter][charter] §5.b.viii tasks an OCI Project's maintainers (listed in the repository's MAINTAINERS file and sometimes referred to as "the TDC", [§5.e][charter]) with: + +> Creating, maintaining and enforcing governance guidelines for the TDC, approved by the maintainers, and which shall be posted visibly for the TDC. + +This section describes generic rules and procedures for fulfilling that mandate. + +## Proposing a motion + +A maintainer SHOULD propose a motion on the dev@opencontainers.org mailing list (except [security issues](#security-issues)) with another maintainer as a co-sponsor. + +## Voting + +Voting on a proposed motion SHOULD happen on the dev@opencontainers.org mailing list (except [security issues](#security-issues)) with maintainers posting LGTM or REJECT. +Maintainers MAY also explicitly not vote by posting ABSTAIN (which is useful to revert a previous vote). +Maintainers MAY post multiple times (e.g. as they revise their position based on feedback), but only their final post counts in the tally. +A proposed motion is adopted if two-thirds of votes cast, a quorum having voted, are in favor of the release. + +Voting SHOULD remain open for a week to collect feedback from the wider community and allow the maintainers to digest the proposed motion. +Under exceptional conditions (e.g. non-major security fix releases) proposals which reach quorum with unanimous support MAY be adopted earlier. + +A maintainer MAY choose to reply with REJECT. +A maintainer posting a REJECT MUST include a list of concerns or links to written documentation for those concerns (e.g. GitHub issues or mailing-list threads). +The maintainers SHOULD try to resolve the concerns and wait for the rejecting maintainer to change their opinion to LGTM. +However, a motion MAY be adopted with REJECTs, as outlined in the previous paragraphs. + +## Quorum + +A quorum is established when at least two-thirds of maintainers have voted. + +For projects that are not specifications, a [motion to release](#release-approval) MAY be adopted if the tally is at least three LGTMs and no REJECTs, even if three votes does not meet the usual two-thirds quorum. + +## Amendments + +The [project governance](#project-governance) rules and procedures MAY be amended or replaced using the procedures themselves. +The MAINTAINERS of this project governance document is the total set of MAINTAINERS from all Open Containers projects (go-digest, image-spec, image-tools, runC, runtime-spec, runtime-tools, and selinux). + +## Subject templates + +Maintainers are busy and get lots of email. +To make project proposals recognizable, proposed motions SHOULD use the following subject templates. + +### Proposing a motion + +> [{project} VOTE]: {motion description} (closes {end of voting window}) + +For example: + +> [runtime-spec VOTE]: Tag 0647920 as 1.0.0-rc (closes 2016-06-03 20:00 UTC) + +### Tallying results + +After voting closes, a maintainer SHOULD post a tally to the motion thread with a subject template like: + +> [{project} {status}]: {motion description} (+{LGTMs} -{REJECTs} #{ABSTAINs}) + +Where `{status}` is either `adopted` or `rejected`. +For example: + +> [runtime-spec adopted]: Tag 0647920 as 1.0.0-rc (+6 -0 #3) + +[charter]: https://www.opencontainers.org/about/governance diff --git a/e2e/vendor/k8s.io/kms/LICENSE b/e2e/vendor/github.com/opencontainers/cgroups/LICENSE similarity index 100% rename from e2e/vendor/k8s.io/kms/LICENSE rename to e2e/vendor/github.com/opencontainers/cgroups/LICENSE diff --git a/e2e/vendor/github.com/opencontainers/cgroups/MAINTAINERS b/e2e/vendor/github.com/opencontainers/cgroups/MAINTAINERS new file mode 100644 index 000000000..413edcb7d --- /dev/null +++ b/e2e/vendor/github.com/opencontainers/cgroups/MAINTAINERS @@ -0,0 +1,8 @@ +Akihiro Suda (@AkihiroSuda) +Aleksa Sarai (@cyphar) +Kir Kolyshkin (@kolyshkin) +Mrunal Patel (@mrunalp) +Sebastiaan van Stijn (@thaJeztah) +Odin Ugedal (@odinuge) +Peter Hunt (@haircommander) +Davanum Srinivas (@dims) diff --git a/e2e/vendor/github.com/opencontainers/cgroups/MAINTAINERS_GUIDE.md b/e2e/vendor/github.com/opencontainers/cgroups/MAINTAINERS_GUIDE.md new file mode 100644 index 000000000..8e9691747 --- /dev/null +++ b/e2e/vendor/github.com/opencontainers/cgroups/MAINTAINERS_GUIDE.md @@ -0,0 +1,92 @@ +## Introduction + +Dear maintainer. Thank you for investing the time and energy to help +make this project as useful as possible. Maintaining a project is difficult, +sometimes unrewarding work. Sure, you will get to contribute cool +features to the project. But most of your time will be spent reviewing, +cleaning up, documenting, answering questions, justifying design +decisions - while everyone has all the fun! But remember - the quality +of the maintainers work is what distinguishes the good projects from the +great. So please be proud of your work, even the unglamourous parts, +and encourage a culture of appreciation and respect for *every* aspect +of improving the project - not just the hot new features. + +This document is a manual for maintainers old and new. It explains what +is expected of maintainers, how they should work, and what tools are +available to them. + +This is a living document - if you see something out of date or missing, +speak up! + +## What are a maintainer's responsibilities? + +It is every maintainer's responsibility to: + +* Expose a clear roadmap for improving their component. +* Deliver prompt feedback and decisions on pull requests. +* Be available to anyone with questions, bug reports, criticism etc. on their component. + This includes IRC and GitHub issues and pull requests. +* Make sure their component respects the philosophy, design and roadmap of the project. + +## How are decisions made? + +This project is an open-source project with an open design philosophy. This +means that the repository is the source of truth for EVERY aspect of the +project, including its philosophy, design, roadmap and APIs. *If it's +part of the project, it's in the repo. It's in the repo, it's part of +the project.* + +As a result, all decisions can be expressed as changes to the +repository. An implementation change is a change to the source code. An +API change is a change to the API specification. A philosophy change is +a change to the philosophy manifesto. And so on. + +All decisions affecting this project, big and small, follow the same procedure: + +1. Discuss a proposal on the [mailing list](CONTRIBUTING.md#mailing-list). + Anyone can do this. +2. Open a pull request. + Anyone can do this. +3. Discuss the pull request. + Anyone can do this. +4. Endorse (`LGTM`) or oppose (`Rejected`) the pull request. + The relevant maintainers do this (see below [Who decides what?](#who-decides-what)). + Changes that affect project management (changing policy, cutting releases, etc.) are [proposed and voted on the mailing list](GOVERNANCE.md). +5. Merge or close the pull request. + The relevant maintainers do this. + +### I'm a maintainer, should I make pull requests too? + +Yes. Nobody should ever push to master directly. All changes should be +made through a pull request. + +## Who decides what? + +All decisions are pull requests, and the relevant maintainers make +decisions by accepting or refusing the pull request. Review and acceptance +by anyone is denoted by adding a comment in the pull request: `LGTM`. +However, only currently listed `MAINTAINERS` are counted towards the required +two LGTMs. In addition, if a maintainer has created a pull request, they cannot +count toward the two LGTM rule (to ensure equal amounts of review for every pull +request, no matter who wrote it). + +Overall the maintainer system works because of mutual respect. +The maintainers trust one another to act in the best interests of the project. +Sometimes maintainers can disagree and this is part of a healthy project to represent the points of view of various people. +In the case where maintainers cannot find agreement on a specific change, maintainers should use the [governance procedure](GOVERNANCE.md) to attempt to reach a consensus. + +### How are maintainers added? + +The best maintainers have a vested interest in the project. Maintainers +are first and foremost contributors that have shown they are committed to +the long term success of the project. Contributors wanting to become +maintainers are expected to be deeply involved in contributing code, +pull request review, and triage of issues in the project for more than two months. + +Just contributing does not make you a maintainer, it is about building trust with the current maintainers of the project and being a person that they can depend on to act in the best interest of the project. +The final vote to add a new maintainer should be approved by the [governance procedure](GOVERNANCE.md). + +### How are maintainers removed? + +When a maintainer is unable to perform the [required duties](#what-are-a-maintainers-responsibilities) they can be removed by the [governance procedure](GOVERNANCE.md). +Issues related to a maintainer's performance should be discussed with them among the other maintainers so that they are not surprised by a pull request removing them. diff --git a/e2e/vendor/github.com/opencontainers/cgroups/README.md b/e2e/vendor/github.com/opencontainers/cgroups/README.md new file mode 100644 index 000000000..a8187da1e --- /dev/null +++ b/e2e/vendor/github.com/opencontainers/cgroups/README.md @@ -0,0 +1,11 @@ +# OCI Project Template + +Useful boilerplate and organizational information for all OCI projects. + +* README (this file) +* [The Apache License, Version 2.0](LICENSE) +* [A list of maintainers](MAINTAINERS) +* [Maintainer guidelines](MAINTAINERS_GUIDE.md) +* [Contributor guidelines](CONTRIBUTING.md) +* [Project governance](GOVERNANCE.md) +* [Release procedures](RELEASES.md) diff --git a/e2e/vendor/github.com/opencontainers/cgroups/RELEASES.md b/e2e/vendor/github.com/opencontainers/cgroups/RELEASES.md new file mode 100644 index 000000000..028ec265d --- /dev/null +++ b/e2e/vendor/github.com/opencontainers/cgroups/RELEASES.md @@ -0,0 +1,51 @@ +# Releases + +The release process hopes to encourage early, consistent consensus-building during project development. +The mechanisms used are regular community communication on the mailing list about progress, scheduled meetings for issue resolution and release triage, and regularly paced and communicated releases. +Releases are proposed and adopted or rejected using the usual [project governance](GOVERNANCE.md) rules and procedures. + +An anti-pattern that we want to avoid is heavy development or discussions "late cycle" around major releases. +We want to build a community that is involved and communicates consistently through all releases instead of relying on "silent periods" as a judge of stability. + +## Parallel releases + +A single project MAY consider several motions to release in parallel. +However each motion to release after the initial 0.1.0 MUST be based on a previous release that has already landed. + +For example, runtime-spec maintainers may propose a v1.0.0-rc2 on the 1st of the month and a v0.9.1 bugfix on the 2nd of the month. +They may not propose a v1.0.0-rc3 until the v1.0.0-rc2 is accepted (on the 7th if the vote initiated on the 1st passes). + +## Specifications + +The OCI maintains three categories of projects: specifications, applications, and conformance-testing tools. +However, specification releases have special restrictions in the [OCI charter][charter]: + +* They are the target of backwards compatibility (§7.g), and +* They are subject to the OFWa patent grant (§8.d and e). + +To avoid unfortunate side effects (onerous backwards compatibity requirements or Member resignations), the following additional procedures apply to specification releases: + +### Planning a release + +Every OCI specification project SHOULD hold meetings that involve maintainers reviewing pull requests, debating outstanding issues, and planning releases. +This meeting MUST be advertised on the project README and MAY happen on a phone call, video conference, or on IRC. +Maintainers MUST send updates to the dev@opencontainers.org with results of these meetings. + +Before the specification reaches v1.0.0, the meetings SHOULD be weekly. +Once a specification has reached v1.0.0, the maintainers may alter the cadence, but a meeting MUST be held within four weeks of the previous meeting. + +The release plans, corresponding milestones and estimated due dates MUST be published on GitHub (e.g. https://github.com/opencontainers/runtime-spec/milestones). +GitHub milestones and issues are only used for community organization and all releases MUST follow the [project governance](GOVERNANCE.md) rules and procedures. + +### Timelines + +Specifications have a variety of different timelines in their lifecycle. + +* Pre-v1.0.0 specifications SHOULD release on a monthly cadence to garner feedback. +* Major specification releases MUST release at least three release candidates spaced a minimum of one week apart. + This means a major release like a v1.0.0 or v2.0.0 release will take 1 month at minimum: one week for rc1, one week for rc2, one week for rc3, and one week for the major release itself. + Maintainers SHOULD strive to make zero breaking changes during this cycle of release candidates and SHOULD restart the three-candidate count when a breaking change is introduced. + For example if a breaking change is introduced in v1.0.0-rc2 then the series would end with v1.0.0-rc4 and v1.0.0. +* Minor and patch releases SHOULD be made on an as-needed basis. + +[charter]: https://www.opencontainers.org/about/governance diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/cgroups.go b/e2e/vendor/github.com/opencontainers/cgroups/cgroups.go similarity index 84% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/cgroups.go rename to e2e/vendor/github.com/opencontainers/cgroups/cgroups.go index 53e194c74..1f127550c 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/cgroups.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/cgroups.go @@ -2,8 +2,6 @@ package cgroups import ( "errors" - - "github.com/opencontainers/runc/libcontainer/configs" ) var ( @@ -18,11 +16,11 @@ var ( // DevicesSetV1 and DevicesSetV2 are functions to set devices for // cgroup v1 and v2, respectively. Unless - // [github.com/opencontainers/runc/libcontainer/cgroups/devices] + // [github.com/opencontainers/cgroups/devices] // package is imported, it is set to nil, so cgroup managers can't // manage devices. - DevicesSetV1 func(path string, r *configs.Resources) error - DevicesSetV2 func(path string, r *configs.Resources) error + DevicesSetV1 func(path string, r *Resources) error + DevicesSetV2 func(path string, r *Resources) error ) type Manager interface { @@ -42,7 +40,7 @@ type Manager interface { GetStats() (*Stats, error) // Freeze sets the freezer cgroup to the specified state. - Freeze(state configs.FreezerState) error + Freeze(state FreezerState) error // Destroy removes cgroup. Destroy() error @@ -54,7 +52,7 @@ type Manager interface { // Set sets cgroup resources parameters/limits. If the argument is nil, // the resources specified during Manager creation (or the previous call // to Set) are used. - Set(r *configs.Resources) error + Set(r *Resources) error // GetPaths returns cgroup path(s) to save in a state file in order to // restore later. @@ -67,10 +65,10 @@ type Manager interface { GetPaths() map[string]string // GetCgroups returns the cgroup data as configured. - GetCgroups() (*configs.Cgroup, error) + GetCgroups() (*Cgroup, error) // GetFreezerState retrieves the current FreezerState of the cgroup. - GetFreezerState() (configs.FreezerState, error) + GetFreezerState() (FreezerState, error) // Exists returns whether the cgroup path exists or not. Exists() bool diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/blkio_device.go b/e2e/vendor/github.com/opencontainers/cgroups/config_blkio_device.go similarity index 99% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/blkio_device.go rename to e2e/vendor/github.com/opencontainers/cgroups/config_blkio_device.go index 865344f99..9dc2a034c 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/blkio_device.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/config_blkio_device.go @@ -1,4 +1,4 @@ -package configs +package cgroups import "fmt" diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/hugepage_limit.go b/e2e/vendor/github.com/opencontainers/cgroups/config_hugepages.go similarity index 91% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/hugepage_limit.go rename to e2e/vendor/github.com/opencontainers/cgroups/config_hugepages.go index d30216380..5357dd090 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/hugepage_limit.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/config_hugepages.go @@ -1,4 +1,4 @@ -package configs +package cgroups type HugepageLimit struct { // which type of hugepage to limit. diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/interface_priority_map.go b/e2e/vendor/github.com/opencontainers/cgroups/config_ifprio_map.go similarity index 93% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/interface_priority_map.go rename to e2e/vendor/github.com/opencontainers/cgroups/config_ifprio_map.go index 9a0395eaf..d771603a7 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/interface_priority_map.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/config_ifprio_map.go @@ -1,4 +1,4 @@ -package configs +package cgroups import ( "fmt" diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/cgroup_linux.go b/e2e/vendor/github.com/opencontainers/cgroups/config_linux.go similarity index 98% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/cgroup_linux.go rename to e2e/vendor/github.com/opencontainers/cgroups/config_linux.go index 4a34cf76f..ce98b3d78 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/cgroup_linux.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/config_linux.go @@ -1,8 +1,8 @@ -package configs +package cgroups import ( systemdDbus "github.com/coreos/go-systemd/v22/dbus" - "github.com/opencontainers/runc/libcontainer/devices" + devices "github.com/opencontainers/cgroups/devices/config" ) type FreezerState string diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/rdma.go b/e2e/vendor/github.com/opencontainers/cgroups/config_rdma.go similarity index 95% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/rdma.go rename to e2e/vendor/github.com/opencontainers/cgroups/config_rdma.go index c69f2c802..a0bd54f04 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/rdma.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/config_rdma.go @@ -1,4 +1,4 @@ -package configs +package cgroups // LinuxRdma for Linux cgroup 'rdma' resource management (Linux 4.11) type LinuxRdma struct { diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/cgroup_unsupported.go b/e2e/vendor/github.com/opencontainers/cgroups/config_unsupported.go similarity index 92% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/cgroup_unsupported.go rename to e2e/vendor/github.com/opencontainers/cgroups/config_unsupported.go index 53f5ec5a0..db32ec483 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/cgroup_unsupported.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/config_unsupported.go @@ -1,6 +1,6 @@ //go:build !linux -package configs +package cgroups // Cgroup holds properties of a cgroup on Linux // TODO Windows: This can ultimately be entirely factored out on Windows as diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/devices/device.go b/e2e/vendor/github.com/opencontainers/cgroups/devices/config/device.go similarity index 99% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/devices/device.go rename to e2e/vendor/github.com/opencontainers/cgroups/devices/config/device.go index c2c2b3bb7..05ad3ef8c 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/devices/device.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/devices/config/device.go @@ -1,4 +1,4 @@ -package devices +package config import ( "fmt" diff --git a/e2e/vendor/github.com/opencontainers/cgroups/devices/config/mknod_unix.go b/e2e/vendor/github.com/opencontainers/cgroups/devices/config/mknod_unix.go new file mode 100644 index 000000000..98cdc6e2f --- /dev/null +++ b/e2e/vendor/github.com/opencontainers/cgroups/devices/config/mknod_unix.go @@ -0,0 +1,14 @@ +package config + +import ( + "errors" + + "golang.org/x/sys/unix" +) + +func mkDev(d *Rule) (uint64, error) { + if d.Major == Wildcard || d.Minor == Wildcard { + return 0, errors.New("cannot mkdev() device with wildcards") + } + return unix.Mkdev(uint32(d.Major), uint32(d.Minor)), nil +} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/file.go b/e2e/vendor/github.com/opencontainers/cgroups/file.go similarity index 92% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/file.go rename to e2e/vendor/github.com/opencontainers/cgroups/file.go index 78c5bcf0d..c1b8f5c15 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/file.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/file.go @@ -5,12 +5,11 @@ import ( "errors" "fmt" "os" - "path" + "path/filepath" "strconv" "strings" "sync" - "github.com/opencontainers/runc/libcontainer/utils" "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) @@ -147,12 +146,15 @@ func openFile(dir, file string, flags int) (*os.File, error) { flags |= os.O_TRUNC | os.O_CREATE mode = 0o600 } - path := path.Join(dir, utils.CleanPath(file)) + // NOTE it is important to use filepath.Clean("/"+file) here + // (see https://github.com/opencontainers/runc/issues/4103)! + path := filepath.Join(dir, filepath.Clean("/"+file)) + if prepareOpenat2() != nil { return openFallback(path, flags, mode) } - relPath := strings.TrimPrefix(path, cgroupfsPrefix) - if len(relPath) == len(path) { // non-standard path, old system? + relPath, ok := strings.CutPrefix(path, cgroupfsPrefix) + if !ok { // Non-standard path, old system? return openFallback(path, flags, mode) } @@ -171,10 +173,8 @@ func openFile(dir, file string, flags int) (*os.File, error) { // // TODO: if such usage will ever be common, amend this // to reopen cgroupRootHandle and retry openat2. - fdPath, closer := utils.ProcThreadSelf("fd/" + strconv.Itoa(int(cgroupRootHandle.Fd()))) - defer closer() - fdDest, _ := os.Readlink(fdPath) - if fdDest != cgroupfsDir { + fdDest, fdErr := os.Readlink("/proc/thread-self/fd/" + strconv.Itoa(int(cgroupRootHandle.Fd()))) + if fdErr == nil && fdDest != cgroupfsDir { // Wrap the error so it is clear that cgroupRootHandle // is opened to an unexpected/wrong directory. err = fmt.Errorf("cgroupRootHandle %d unexpectedly opened to %s != %s: %w", diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/blkio.go b/e2e/vendor/github.com/opencontainers/cgroups/fs/blkio.go similarity index 97% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/blkio.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs/blkio.go index c81b6562a..f3c4c5cf8 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/blkio.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs/blkio.go @@ -7,8 +7,7 @@ import ( "strconv" "strings" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" ) type BlkioGroup struct { @@ -20,11 +19,11 @@ func (s *BlkioGroup) Name() string { return "blkio" } -func (s *BlkioGroup) Apply(path string, _ *configs.Resources, pid int) error { +func (s *BlkioGroup) Apply(path string, _ *cgroups.Resources, pid int) error { return apply(path, pid) } -func (s *BlkioGroup) Set(path string, r *configs.Resources) error { +func (s *BlkioGroup) Set(path string, r *cgroups.Resources) error { s.detectWeightFilenames(path) if r.BlkioWeight != 0 { if err := cgroups.WriteFile(path, s.weightFilename, strconv.FormatUint(uint64(r.BlkioWeight), 10)); err != nil { diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpu.go b/e2e/vendor/github.com/opencontainers/cgroups/fs/cpu.go similarity index 92% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpu.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs/cpu.go index 62574b53c..3e05788a3 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpu.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs/cpu.go @@ -7,9 +7,8 @@ import ( "os" "strconv" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/fscommon" "golang.org/x/sys/unix" ) @@ -19,7 +18,7 @@ func (s *CpuGroup) Name() string { return "cpu" } -func (s *CpuGroup) Apply(path string, r *configs.Resources, pid int) error { +func (s *CpuGroup) Apply(path string, r *cgroups.Resources, pid int) error { if err := os.MkdirAll(path, 0o755); err != nil { return err } @@ -34,7 +33,7 @@ func (s *CpuGroup) Apply(path string, r *configs.Resources, pid int) error { return cgroups.WriteCgroupProc(path, pid) } -func (s *CpuGroup) SetRtSched(path string, r *configs.Resources) error { +func (s *CpuGroup) SetRtSched(path string, r *cgroups.Resources) error { var period string if r.CpuRtPeriod != 0 { period = strconv.FormatUint(r.CpuRtPeriod, 10) @@ -64,7 +63,7 @@ func (s *CpuGroup) SetRtSched(path string, r *configs.Resources) error { return nil } -func (s *CpuGroup) Set(path string, r *configs.Resources) error { +func (s *CpuGroup) Set(path string, r *cgroups.Resources) error { if r.CpuShares != 0 { shares := r.CpuShares if err := cgroups.WriteFile(path, "cpu.shares", strconv.FormatUint(shares, 10)); err != nil { diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuacct.go b/e2e/vendor/github.com/opencontainers/cgroups/fs/cpuacct.go similarity index 74% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuacct.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs/cpuacct.go index 69f8f9d8c..391a023c7 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuacct.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs/cpuacct.go @@ -6,20 +6,12 @@ import ( "strconv" "strings" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/fscommon" ) const ( - cgroupCpuacctStat = "cpuacct.stat" - cgroupCpuacctUsageAll = "cpuacct.usage_all" - - nanosecondsInSecond = 1000000000 - - userModeColumn = 1 - kernelModeColumn = 2 - cuacctUsageAllColumnsNumber = 3 + nsInSec = 1000000000 // The value comes from `C.sysconf(C._SC_CLK_TCK)`, and // on Linux it's a constant which is safe to be hard coded, @@ -34,11 +26,11 @@ func (s *CpuacctGroup) Name() string { return "cpuacct" } -func (s *CpuacctGroup) Apply(path string, _ *configs.Resources, pid int) error { +func (s *CpuacctGroup) Apply(path string, _ *cgroups.Resources, pid int) error { return apply(path, pid) } -func (s *CpuacctGroup) Set(_ string, _ *configs.Resources) error { +func (s *CpuacctGroup) Set(_ string, _ *cgroups.Resources) error { return nil } @@ -81,7 +73,7 @@ func getCpuUsageBreakdown(path string) (uint64, uint64, error) { const ( userField = "user" systemField = "system" - file = cgroupCpuacctStat + file = "cpuacct.stat" ) // Expected format: @@ -103,7 +95,7 @@ func getCpuUsageBreakdown(path string) (uint64, uint64, error) { return 0, 0, &parseError{Path: path, File: file, Err: err} } - return (userModeUsage * nanosecondsInSecond) / clockTicks, (kernelModeUsage * nanosecondsInSecond) / clockTicks, nil + return (userModeUsage * nsInSec) / clockTicks, (kernelModeUsage * nsInSec) / clockTicks, nil } func getPercpuUsage(path string) ([]uint64, error) { @@ -113,7 +105,6 @@ func getPercpuUsage(path string) ([]uint64, error) { if err != nil { return percpuUsage, err } - // TODO: use strings.SplitN instead. for _, value := range strings.Fields(data) { value, err := strconv.ParseUint(value, 10, 64) if err != nil { @@ -127,7 +118,7 @@ func getPercpuUsage(path string) ([]uint64, error) { func getPercpuUsageInModes(path string) ([]uint64, []uint64, error) { usageKernelMode := []uint64{} usageUserMode := []uint64{} - const file = cgroupCpuacctUsageAll + const file = "cpuacct.usage_all" fd, err := cgroups.OpenFile(path, file, os.O_RDONLY) if os.IsNotExist(err) { @@ -141,22 +132,23 @@ func getPercpuUsageInModes(path string) ([]uint64, []uint64, error) { scanner.Scan() // skipping header line for scanner.Scan() { - lineFields := strings.SplitN(scanner.Text(), " ", cuacctUsageAllColumnsNumber+1) - if len(lineFields) != cuacctUsageAllColumnsNumber { + // Each line is: cpu user system + fields := strings.SplitN(scanner.Text(), " ", 3) + if len(fields) != 3 { continue } - usageInKernelMode, err := strconv.ParseUint(lineFields[kernelModeColumn], 10, 64) + user, err := strconv.ParseUint(fields[1], 10, 64) if err != nil { return nil, nil, &parseError{Path: path, File: file, Err: err} } - usageKernelMode = append(usageKernelMode, usageInKernelMode) + usageUserMode = append(usageUserMode, user) - usageInUserMode, err := strconv.ParseUint(lineFields[userModeColumn], 10, 64) + kernel, err := strconv.ParseUint(fields[2], 10, 64) if err != nil { return nil, nil, &parseError{Path: path, File: file, Err: err} } - usageUserMode = append(usageUserMode, usageInUserMode) + usageKernelMode = append(usageKernelMode, kernel) } if err := scanner.Err(); err != nil { return nil, nil, &parseError{Path: path, File: file, Err: err} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuset.go b/e2e/vendor/github.com/opencontainers/cgroups/fs/cpuset.go similarity index 67% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuset.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs/cpuset.go index fe01ba984..ef6ff7da3 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/cpuset.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs/cpuset.go @@ -6,32 +6,66 @@ import ( "path/filepath" "strconv" "strings" + "sync" "golang.org/x/sys/unix" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/fscommon" ) +var ( + cpusetLock sync.Mutex + cpusetPrefix = "cpuset." + cpusetFastPath bool +) + +func cpusetFile(path string, name string) string { + cpusetLock.Lock() + defer cpusetLock.Unlock() + + // Only the v1 cpuset cgroup is allowed to mount with noprefix. + // See kernel source: https://github.com/torvalds/linux/blob/2e1b3cc9d7f790145a80cb705b168f05dab65df2/kernel/cgroup/cgroup-v1.c#L1070 + // Cpuset cannot be mounted with and without prefix simultaneously. + // Commonly used in Android environments. + + if cpusetFastPath { + return cpusetPrefix + name + } + + err := unix.Access(filepath.Join(path, cpusetPrefix+name), unix.F_OK) + if err == nil { + // Use the fast path only if we can access one type of mount for cpuset already + cpusetFastPath = true + } else { + err = unix.Access(filepath.Join(path, name), unix.F_OK) + if err == nil { + cpusetPrefix = "" + cpusetFastPath = true + } + } + + return cpusetPrefix + name +} + type CpusetGroup struct{} func (s *CpusetGroup) Name() string { return "cpuset" } -func (s *CpusetGroup) Apply(path string, r *configs.Resources, pid int) error { +func (s *CpusetGroup) Apply(path string, r *cgroups.Resources, pid int) error { return s.ApplyDir(path, r, pid) } -func (s *CpusetGroup) Set(path string, r *configs.Resources) error { +func (s *CpusetGroup) Set(path string, r *cgroups.Resources) error { if r.CpusetCpus != "" { - if err := cgroups.WriteFile(path, "cpuset.cpus", r.CpusetCpus); err != nil { + if err := cgroups.WriteFile(path, cpusetFile(path, "cpus"), r.CpusetCpus); err != nil { return err } } if r.CpusetMems != "" { - if err := cgroups.WriteFile(path, "cpuset.mems", r.CpusetMems); err != nil { + if err := cgroups.WriteFile(path, cpusetFile(path, "mems"), r.CpusetMems); err != nil { return err } } @@ -49,26 +83,23 @@ func getCpusetStat(path string, file string) ([]uint16, error) { } for _, s := range strings.Split(fileContent, ",") { - sp := strings.SplitN(s, "-", 3) - switch len(sp) { - case 3: - return extracted, &parseError{Path: path, File: file, Err: errors.New("extra dash")} - case 2: - min, err := strconv.ParseUint(sp[0], 10, 16) + fromStr, toStr, ok := strings.Cut(s, "-") + if ok { + from, err := strconv.ParseUint(fromStr, 10, 16) if err != nil { return extracted, &parseError{Path: path, File: file, Err: err} } - max, err := strconv.ParseUint(sp[1], 10, 16) + to, err := strconv.ParseUint(toStr, 10, 16) if err != nil { return extracted, &parseError{Path: path, File: file, Err: err} } - if min > max { - return extracted, &parseError{Path: path, File: file, Err: errors.New("invalid values, min > max")} + if from > to { + return extracted, &parseError{Path: path, File: file, Err: errors.New("invalid values, from > to")} } - for i := min; i <= max; i++ { + for i := from; i <= to; i++ { extracted = append(extracted, uint16(i)) } - case 1: + } else { value, err := strconv.ParseUint(s, 10, 16) if err != nil { return extracted, &parseError{Path: path, File: file, Err: err} @@ -83,57 +114,57 @@ func getCpusetStat(path string, file string) ([]uint16, error) { func (s *CpusetGroup) GetStats(path string, stats *cgroups.Stats) error { var err error - stats.CPUSetStats.CPUs, err = getCpusetStat(path, "cpuset.cpus") + stats.CPUSetStats.CPUs, err = getCpusetStat(path, cpusetFile(path, "cpus")) if err != nil && !errors.Is(err, os.ErrNotExist) { return err } - stats.CPUSetStats.CPUExclusive, err = fscommon.GetCgroupParamUint(path, "cpuset.cpu_exclusive") + stats.CPUSetStats.CPUExclusive, err = fscommon.GetCgroupParamUint(path, cpusetFile(path, "cpu_exclusive")) if err != nil && !errors.Is(err, os.ErrNotExist) { return err } - stats.CPUSetStats.Mems, err = getCpusetStat(path, "cpuset.mems") + stats.CPUSetStats.Mems, err = getCpusetStat(path, cpusetFile(path, "mems")) if err != nil && !errors.Is(err, os.ErrNotExist) { return err } - stats.CPUSetStats.MemHardwall, err = fscommon.GetCgroupParamUint(path, "cpuset.mem_hardwall") + stats.CPUSetStats.MemHardwall, err = fscommon.GetCgroupParamUint(path, cpusetFile(path, "mem_hardwall")) if err != nil && !errors.Is(err, os.ErrNotExist) { return err } - stats.CPUSetStats.MemExclusive, err = fscommon.GetCgroupParamUint(path, "cpuset.mem_exclusive") + stats.CPUSetStats.MemExclusive, err = fscommon.GetCgroupParamUint(path, cpusetFile(path, "mem_exclusive")) if err != nil && !errors.Is(err, os.ErrNotExist) { return err } - stats.CPUSetStats.MemoryMigrate, err = fscommon.GetCgroupParamUint(path, "cpuset.memory_migrate") + stats.CPUSetStats.MemoryMigrate, err = fscommon.GetCgroupParamUint(path, cpusetFile(path, "memory_migrate")) if err != nil && !errors.Is(err, os.ErrNotExist) { return err } - stats.CPUSetStats.MemorySpreadPage, err = fscommon.GetCgroupParamUint(path, "cpuset.memory_spread_page") + stats.CPUSetStats.MemorySpreadPage, err = fscommon.GetCgroupParamUint(path, cpusetFile(path, "memory_spread_page")) if err != nil && !errors.Is(err, os.ErrNotExist) { return err } - stats.CPUSetStats.MemorySpreadSlab, err = fscommon.GetCgroupParamUint(path, "cpuset.memory_spread_slab") + stats.CPUSetStats.MemorySpreadSlab, err = fscommon.GetCgroupParamUint(path, cpusetFile(path, "memory_spread_slab")) if err != nil && !errors.Is(err, os.ErrNotExist) { return err } - stats.CPUSetStats.MemoryPressure, err = fscommon.GetCgroupParamUint(path, "cpuset.memory_pressure") + stats.CPUSetStats.MemoryPressure, err = fscommon.GetCgroupParamUint(path, cpusetFile(path, "memory_pressure")) if err != nil && !errors.Is(err, os.ErrNotExist) { return err } - stats.CPUSetStats.SchedLoadBalance, err = fscommon.GetCgroupParamUint(path, "cpuset.sched_load_balance") + stats.CPUSetStats.SchedLoadBalance, err = fscommon.GetCgroupParamUint(path, cpusetFile(path, "sched_load_balance")) if err != nil && !errors.Is(err, os.ErrNotExist) { return err } - stats.CPUSetStats.SchedRelaxDomainLevel, err = fscommon.GetCgroupParamInt(path, "cpuset.sched_relax_domain_level") + stats.CPUSetStats.SchedRelaxDomainLevel, err = fscommon.GetCgroupParamInt(path, cpusetFile(path, "sched_relax_domain_level")) if err != nil && !errors.Is(err, os.ErrNotExist) { return err } @@ -141,7 +172,7 @@ func (s *CpusetGroup) GetStats(path string, stats *cgroups.Stats) error { return nil } -func (s *CpusetGroup) ApplyDir(dir string, r *configs.Resources, pid int) error { +func (s *CpusetGroup) ApplyDir(dir string, r *cgroups.Resources, pid int) error { // This might happen if we have no cpuset cgroup mounted. // Just do nothing and don't fail. if dir == "" { @@ -172,10 +203,10 @@ func (s *CpusetGroup) ApplyDir(dir string, r *configs.Resources, pid int) error } func getCpusetSubsystemSettings(parent string) (cpus, mems string, err error) { - if cpus, err = cgroups.ReadFile(parent, "cpuset.cpus"); err != nil { + if cpus, err = cgroups.ReadFile(parent, cpusetFile(parent, "cpus")); err != nil { return } - if mems, err = cgroups.ReadFile(parent, "cpuset.mems"); err != nil { + if mems, err = cgroups.ReadFile(parent, cpusetFile(parent, "mems")); err != nil { return } return cpus, mems, nil @@ -221,12 +252,12 @@ func cpusetCopyIfNeeded(current, parent string) error { } if isEmptyCpuset(currentCpus) { - if err := cgroups.WriteFile(current, "cpuset.cpus", parentCpus); err != nil { + if err := cgroups.WriteFile(current, cpusetFile(current, "cpus"), parentCpus); err != nil { return err } } if isEmptyCpuset(currentMems) { - if err := cgroups.WriteFile(current, "cpuset.mems", parentMems); err != nil { + if err := cgroups.WriteFile(current, cpusetFile(current, "mems"), parentMems); err != nil { return err } } @@ -237,7 +268,7 @@ func isEmptyCpuset(str string) bool { return str == "" || str == "\n" } -func (s *CpusetGroup) ensureCpusAndMems(path string, r *configs.Resources) error { +func (s *CpusetGroup) ensureCpusAndMems(path string, r *cgroups.Resources) error { if err := s.Set(path, r); err != nil { return err } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/devices.go b/e2e/vendor/github.com/opencontainers/cgroups/fs/devices.go similarity index 71% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/devices.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs/devices.go index 0bf3d9deb..26483ecb7 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/devices.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs/devices.go @@ -1,8 +1,7 @@ package fs import ( - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" ) type DevicesGroup struct{} @@ -11,7 +10,7 @@ func (s *DevicesGroup) Name() string { return "devices" } -func (s *DevicesGroup) Apply(path string, r *configs.Resources, pid int) error { +func (s *DevicesGroup) Apply(path string, r *cgroups.Resources, pid int) error { if r.SkipDevices { return nil } @@ -24,7 +23,7 @@ func (s *DevicesGroup) Apply(path string, r *configs.Resources, pid int) error { return apply(path, pid) } -func (s *DevicesGroup) Set(path string, r *configs.Resources) error { +func (s *DevicesGroup) Set(path string, r *cgroups.Resources) error { if cgroups.DevicesSetV1 == nil { if len(r.Devices) == 0 { return nil diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/error.go b/e2e/vendor/github.com/opencontainers/cgroups/fs/error.go similarity index 84% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/error.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs/error.go index f2ab6f130..f13033e3d 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/error.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs/error.go @@ -3,7 +3,7 @@ package fs import ( "fmt" - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" + "github.com/opencontainers/cgroups/fscommon" ) type parseError = fscommon.ParseError diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/freezer.go b/e2e/vendor/github.com/opencontainers/cgroups/fs/freezer.go similarity index 79% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/freezer.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs/freezer.go index 987f1bf5e..dae4a6058 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/freezer.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs/freezer.go @@ -7,8 +7,7 @@ import ( "strings" "time" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) @@ -19,19 +18,19 @@ func (s *FreezerGroup) Name() string { return "freezer" } -func (s *FreezerGroup) Apply(path string, _ *configs.Resources, pid int) error { +func (s *FreezerGroup) Apply(path string, _ *cgroups.Resources, pid int) error { return apply(path, pid) } -func (s *FreezerGroup) Set(path string, r *configs.Resources) (Err error) { +func (s *FreezerGroup) Set(path string, r *cgroups.Resources) (Err error) { switch r.Freezer { - case configs.Frozen: + case cgroups.Frozen: defer func() { if Err != nil { // Freezing failed, and it is bad and dangerous // to leave the cgroup in FROZEN or FREEZING // state, so (try to) thaw it back. - _ = cgroups.WriteFile(path, "freezer.state", string(configs.Thawed)) + _ = cgroups.WriteFile(path, "freezer.state", string(cgroups.Thawed)) } }() @@ -64,11 +63,11 @@ func (s *FreezerGroup) Set(path string, r *configs.Resources) (Err error) { // the chances to succeed in freezing // in case new processes keep appearing // in the cgroup. - _ = cgroups.WriteFile(path, "freezer.state", string(configs.Thawed)) + _ = cgroups.WriteFile(path, "freezer.state", string(cgroups.Thawed)) time.Sleep(10 * time.Millisecond) } - if err := cgroups.WriteFile(path, "freezer.state", string(configs.Frozen)); err != nil { + if err := cgroups.WriteFile(path, "freezer.state", string(cgroups.Frozen)); err != nil { return err } @@ -87,7 +86,7 @@ func (s *FreezerGroup) Set(path string, r *configs.Resources) (Err error) { switch state { case "FREEZING": continue - case string(configs.Frozen): + case string(cgroups.Frozen): if i > 1 { logrus.Debugf("frozen after %d retries", i) } @@ -99,9 +98,9 @@ func (s *FreezerGroup) Set(path string, r *configs.Resources) (Err error) { } // Despite our best efforts, it got stuck in FREEZING. return errors.New("unable to freeze") - case configs.Thawed: - return cgroups.WriteFile(path, "freezer.state", string(configs.Thawed)) - case configs.Undefined: + case cgroups.Thawed: + return cgroups.WriteFile(path, "freezer.state", string(cgroups.Thawed)) + case cgroups.Undefined: return nil default: return fmt.Errorf("Invalid argument '%s' to freezer.state", string(r.Freezer)) @@ -112,7 +111,7 @@ func (s *FreezerGroup) GetStats(path string, stats *cgroups.Stats) error { return nil } -func (s *FreezerGroup) GetState(path string) (configs.FreezerState, error) { +func (s *FreezerGroup) GetState(path string) (cgroups.FreezerState, error) { for { state, err := cgroups.ReadFile(path, "freezer.state") if err != nil { @@ -121,11 +120,11 @@ func (s *FreezerGroup) GetState(path string) (configs.FreezerState, error) { if os.IsNotExist(err) || errors.Is(err, unix.ENODEV) { err = nil } - return configs.Undefined, err + return cgroups.Undefined, err } switch strings.TrimSpace(state) { case "THAWED": - return configs.Thawed, nil + return cgroups.Thawed, nil case "FROZEN": // Find out whether the cgroup is frozen directly, // or indirectly via an ancestor. @@ -136,15 +135,15 @@ func (s *FreezerGroup) GetState(path string) (configs.FreezerState, error) { if errors.Is(err, os.ErrNotExist) || errors.Is(err, unix.ENODEV) { err = nil } - return configs.Frozen, err + return cgroups.Frozen, err } switch self { case "0\n": - return configs.Thawed, nil + return cgroups.Thawed, nil case "1\n": - return configs.Frozen, nil + return cgroups.Frozen, nil default: - return configs.Undefined, fmt.Errorf(`unknown "freezer.self_freezing" state: %q`, self) + return cgroups.Undefined, fmt.Errorf(`unknown "freezer.self_freezing" state: %q`, self) } case "FREEZING": // Make sure we get a stable freezer state, so retry if the cgroup @@ -152,7 +151,7 @@ func (s *FreezerGroup) GetState(path string) (configs.FreezerState, error) { time.Sleep(1 * time.Millisecond) continue default: - return configs.Undefined, fmt.Errorf("unknown freezer.state %q", state) + return cgroups.Undefined, fmt.Errorf("unknown freezer.state %q", state) } } } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/fs.go b/e2e/vendor/github.com/opencontainers/cgroups/fs/fs.go similarity index 89% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/fs.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs/fs.go index ba15bfc40..23a8fb874 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/fs.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs/fs.go @@ -8,9 +8,8 @@ import ( "golang.org/x/sys/unix" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/fscommon" ) var subsystems = []subsystem{ @@ -49,22 +48,22 @@ type subsystem interface { // Apply creates and joins a cgroup, adding pid into it. Some // subsystems use resources to pre-configure the cgroup parents // before creating or joining it. - Apply(path string, r *configs.Resources, pid int) error + Apply(path string, r *cgroups.Resources, pid int) error // Set sets the cgroup resources. - Set(path string, r *configs.Resources) error + Set(path string, r *cgroups.Resources) error } type Manager struct { mu sync.Mutex - cgroups *configs.Cgroup + cgroups *cgroups.Cgroup paths map[string]string } -func NewManager(cg *configs.Cgroup, paths map[string]string) (*Manager, error) { +func NewManager(cg *cgroups.Cgroup, paths map[string]string) (*Manager, error) { // Some v1 controllers (cpu, cpuset, and devices) expect // cgroups.Resources to not be nil in Apply. if cg.Resources == nil { - return nil, errors.New("cgroup v1 manager needs configs.Resources to be set during manager creation") + return nil, errors.New("cgroup v1 manager needs cgroups.Resources to be set during manager creation") } if cg.Resources.Unified != nil { return nil, cgroups.ErrV1NoUnified @@ -168,7 +167,7 @@ func (m *Manager) GetStats() (*cgroups.Stats, error) { return stats, nil } -func (m *Manager) Set(r *configs.Resources) error { +func (m *Manager) Set(r *cgroups.Resources) error { if r == nil { return nil } @@ -203,7 +202,7 @@ func (m *Manager) Set(r *configs.Resources) error { // Freeze toggles the container's freezer cgroup depending on the state // provided -func (m *Manager) Freeze(state configs.FreezerState) error { +func (m *Manager) Freeze(state cgroups.FreezerState) error { path := m.Path("freezer") if path == "" { return errors.New("cannot toggle freezer: cgroups not configured for container") @@ -233,15 +232,15 @@ func (m *Manager) GetPaths() map[string]string { return m.paths } -func (m *Manager) GetCgroups() (*configs.Cgroup, error) { +func (m *Manager) GetCgroups() (*cgroups.Cgroup, error) { return m.cgroups, nil } -func (m *Manager) GetFreezerState() (configs.FreezerState, error) { +func (m *Manager) GetFreezerState() (cgroups.FreezerState, error) { dir := m.Path("freezer") // If the container doesn't have the freezer cgroup, say it's undefined. if dir == "" { - return configs.Undefined, nil + return cgroups.Undefined, nil } freezer := &FreezerGroup{} return freezer.GetState(dir) diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/hugetlb.go b/e2e/vendor/github.com/opencontainers/cgroups/fs/hugetlb.go similarity index 83% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/hugetlb.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs/hugetlb.go index 50f8f30cd..698fd691e 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/hugetlb.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs/hugetlb.go @@ -5,9 +5,8 @@ import ( "os" "strconv" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/fscommon" ) type HugetlbGroup struct{} @@ -16,11 +15,11 @@ func (s *HugetlbGroup) Name() string { return "hugetlb" } -func (s *HugetlbGroup) Apply(path string, _ *configs.Resources, pid int) error { +func (s *HugetlbGroup) Apply(path string, _ *cgroups.Resources, pid int) error { return apply(path, pid) } -func (s *HugetlbGroup) Set(path string, r *configs.Resources) error { +func (s *HugetlbGroup) Set(path string, r *cgroups.Resources) error { const suffix = ".limit_in_bytes" skipRsvd := false diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/memory.go b/e2e/vendor/github.com/opencontainers/cgroups/fs/memory.go similarity index 96% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/memory.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs/memory.go index 0abea63f9..d92f2322b 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/memory.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs/memory.go @@ -12,9 +12,8 @@ import ( "golang.org/x/sys/unix" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/fscommon" ) const ( @@ -30,7 +29,7 @@ func (s *MemoryGroup) Name() string { return "memory" } -func (s *MemoryGroup) Apply(path string, _ *configs.Resources, pid int) error { +func (s *MemoryGroup) Apply(path string, _ *cgroups.Resources, pid int) error { return apply(path, pid) } @@ -66,7 +65,7 @@ func setSwap(path string, val int64) error { return cgroups.WriteFile(path, cgroupMemorySwapLimit, strconv.FormatInt(val, 10)) } -func setMemoryAndSwap(path string, r *configs.Resources) error { +func setMemoryAndSwap(path string, r *cgroups.Resources) error { // If the memory update is set to -1 and the swap is not explicitly // set, we should also set swap to -1, it means unlimited memory. if r.Memory == -1 && r.MemorySwap == 0 { @@ -108,7 +107,7 @@ func setMemoryAndSwap(path string, r *configs.Resources) error { return nil } -func (s *MemoryGroup) Set(path string, r *configs.Resources) error { +func (s *MemoryGroup) Set(path string, r *cgroups.Resources) error { if err := setMemoryAndSwap(path, r); err != nil { return err } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/name.go b/e2e/vendor/github.com/opencontainers/cgroups/fs/name.go similarity index 60% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/name.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs/name.go index b8d5d849c..28643519b 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/name.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs/name.go @@ -1,8 +1,7 @@ package fs import ( - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" ) type NameGroup struct { @@ -14,7 +13,7 @@ func (s *NameGroup) Name() string { return s.GroupName } -func (s *NameGroup) Apply(path string, _ *configs.Resources, pid int) error { +func (s *NameGroup) Apply(path string, _ *cgroups.Resources, pid int) error { if s.Join { // Ignore errors if the named cgroup does not exist. _ = apply(path, pid) @@ -22,7 +21,7 @@ func (s *NameGroup) Apply(path string, _ *configs.Resources, pid int) error { return nil } -func (s *NameGroup) Set(_ string, _ *configs.Resources) error { +func (s *NameGroup) Set(_ string, _ *cgroups.Resources) error { return nil } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/net_cls.go b/e2e/vendor/github.com/opencontainers/cgroups/fs/net_cls.go similarity index 64% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/net_cls.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs/net_cls.go index abfd09ce8..2bd6c5ab2 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/net_cls.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs/net_cls.go @@ -3,8 +3,7 @@ package fs import ( "strconv" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" ) type NetClsGroup struct{} @@ -13,11 +12,11 @@ func (s *NetClsGroup) Name() string { return "net_cls" } -func (s *NetClsGroup) Apply(path string, _ *configs.Resources, pid int) error { +func (s *NetClsGroup) Apply(path string, _ *cgroups.Resources, pid int) error { return apply(path, pid) } -func (s *NetClsGroup) Set(path string, r *configs.Resources) error { +func (s *NetClsGroup) Set(path string, r *cgroups.Resources) error { if r.NetClsClassid != 0 { if err := cgroups.WriteFile(path, "net_cls.classid", strconv.FormatUint(uint64(r.NetClsClassid), 10)); err != nil { return err diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/net_prio.go b/e2e/vendor/github.com/opencontainers/cgroups/fs/net_prio.go similarity index 64% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/net_prio.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs/net_prio.go index da74d3779..b51682b6d 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/net_prio.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs/net_prio.go @@ -1,8 +1,7 @@ package fs import ( - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" ) type NetPrioGroup struct{} @@ -11,11 +10,11 @@ func (s *NetPrioGroup) Name() string { return "net_prio" } -func (s *NetPrioGroup) Apply(path string, _ *configs.Resources, pid int) error { +func (s *NetPrioGroup) Apply(path string, _ *cgroups.Resources, pid int) error { return apply(path, pid) } -func (s *NetPrioGroup) Set(path string, r *configs.Resources) error { +func (s *NetPrioGroup) Set(path string, r *cgroups.Resources) error { for _, prioMap := range r.NetPrioIfpriomap { if err := cgroups.WriteFile(path, "net_prio.ifpriomap", prioMap.CgroupString()); err != nil { return err diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/paths.go b/e2e/vendor/github.com/opencontainers/cgroups/fs/paths.go similarity index 82% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/paths.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs/paths.go index 5f119bac3..edbe041ea 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/paths.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs/paths.go @@ -8,9 +8,8 @@ import ( "golang.org/x/sys/unix" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/configs" - "github.com/opencontainers/runc/libcontainer/utils" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/internal/path" ) // The absolute path to the root of the cgroup hierarchies. @@ -21,13 +20,13 @@ var ( const defaultCgroupRoot = "/sys/fs/cgroup" -func initPaths(cg *configs.Cgroup) (map[string]string, error) { +func initPaths(cg *cgroups.Cgroup) (map[string]string, error) { root, err := rootPath() if err != nil { return nil, err } - inner, err := innerPath(cg) + inner, err := path.Inner(cg) if err != nil { return nil, err } @@ -136,22 +135,6 @@ func rootPath() (string, error) { return cgroupRoot, nil } -func innerPath(c *configs.Cgroup) (string, error) { - if (c.Name != "" || c.Parent != "") && c.Path != "" { - return "", errors.New("cgroup: either Path or Name and Parent should be used") - } - - // XXX: Do not remove CleanPath. Path safety is important! -- cyphar - innerPath := utils.CleanPath(c.Path) - if innerPath == "" { - cgParent := utils.CleanPath(c.Parent) - cgName := utils.CleanPath(c.Name) - innerPath = filepath.Join(cgParent, cgName) - } - - return innerPath, nil -} - func subsysPath(root, inner, subsystem string) (string, error) { // If the cgroup name/path is absolute do not look relative to the cgroup of the init process. if filepath.IsAbs(inner) { diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/perf_event.go b/e2e/vendor/github.com/opencontainers/cgroups/fs/perf_event.go similarity index 53% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/perf_event.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs/perf_event.go index b86955c8f..929c412a3 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/perf_event.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs/perf_event.go @@ -1,8 +1,7 @@ package fs import ( - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" ) type PerfEventGroup struct{} @@ -11,11 +10,11 @@ func (s *PerfEventGroup) Name() string { return "perf_event" } -func (s *PerfEventGroup) Apply(path string, _ *configs.Resources, pid int) error { +func (s *PerfEventGroup) Apply(path string, _ *cgroups.Resources, pid int) error { return apply(path, pid) } -func (s *PerfEventGroup) Set(_ string, _ *configs.Resources) error { +func (s *PerfEventGroup) Set(_ string, _ *cgroups.Resources) error { return nil } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/pids.go b/e2e/vendor/github.com/opencontainers/cgroups/fs/pids.go similarity index 77% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/pids.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs/pids.go index 1f13532a5..9319761e6 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/pids.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs/pids.go @@ -4,9 +4,8 @@ import ( "math" "strconv" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/fscommon" ) type PidsGroup struct{} @@ -15,11 +14,11 @@ func (s *PidsGroup) Name() string { return "pids" } -func (s *PidsGroup) Apply(path string, _ *configs.Resources, pid int) error { +func (s *PidsGroup) Apply(path string, _ *cgroups.Resources, pid int) error { return apply(path, pid) } -func (s *PidsGroup) Set(path string, r *configs.Resources) error { +func (s *PidsGroup) Set(path string, r *cgroups.Resources) error { if r.PidsLimit != 0 { // "max" is the fallback value. limit := "max" diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/rdma.go b/e2e/vendor/github.com/opencontainers/cgroups/fs/rdma.go similarity index 50% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/rdma.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs/rdma.go index 5bbe0f35f..4b175365f 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs/rdma.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs/rdma.go @@ -1,9 +1,8 @@ package fs import ( - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/fscommon" ) type RdmaGroup struct{} @@ -12,11 +11,11 @@ func (s *RdmaGroup) Name() string { return "rdma" } -func (s *RdmaGroup) Apply(path string, _ *configs.Resources, pid int) error { +func (s *RdmaGroup) Apply(path string, _ *cgroups.Resources, pid int) error { return apply(path, pid) } -func (s *RdmaGroup) Set(path string, r *configs.Resources) error { +func (s *RdmaGroup) Set(path string, r *cgroups.Resources) error { return fscommon.RdmaSet(path, r) } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/cpu.go b/e2e/vendor/github.com/opencontainers/cgroups/fs2/cpu.go similarity index 90% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/cpu.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs2/cpu.go index 8ee49d499..8eae67351 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/cpu.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs2/cpu.go @@ -8,17 +8,16 @@ import ( "golang.org/x/sys/unix" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/fscommon" ) -func isCpuSet(r *configs.Resources) bool { +func isCPUSet(r *cgroups.Resources) bool { return r.CpuWeight != 0 || r.CpuQuota != 0 || r.CpuPeriod != 0 || r.CPUIdle != nil || r.CpuBurst != nil } -func setCpu(dirPath string, r *configs.Resources) error { - if !isCpuSet(r) { +func setCPU(dirPath string, r *cgroups.Resources) error { + if !isCPUSet(r) { return nil } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/cpuset.go b/e2e/vendor/github.com/opencontainers/cgroups/fs2/cpuset.go similarity index 64% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/cpuset.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs2/cpuset.go index 16c45bad8..9399919a0 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/cpuset.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs2/cpuset.go @@ -1,15 +1,14 @@ package fs2 import ( - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" ) -func isCpusetSet(r *configs.Resources) bool { +func isCpusetSet(r *cgroups.Resources) bool { return r.CpusetCpus != "" || r.CpusetMems != "" } -func setCpuset(dirPath string, r *configs.Resources) error { +func setCpuset(dirPath string, r *cgroups.Resources) error { if !isCpusetSet(r) { return nil } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/create.go b/e2e/vendor/github.com/opencontainers/cgroups/fs2/create.go similarity index 91% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/create.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs2/create.go index 641123a4d..565ca8830 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/create.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs2/create.go @@ -6,8 +6,7 @@ import ( "path/filepath" "strings" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" ) func supportedControllers() (string, error) { @@ -18,7 +17,7 @@ func supportedControllers() (string, error) { // based on (1) controllers available and (2) resources that are being set. // We don't check "pseudo" controllers such as // "freezer" and "devices". -func needAnyControllers(r *configs.Resources) (bool, error) { +func needAnyControllers(r *cgroups.Resources) (bool, error) { if r == nil { return false, nil } @@ -48,7 +47,7 @@ func needAnyControllers(r *configs.Resources) (bool, error) { if isIoSet(r) && have("io") { return true, nil } - if isCpuSet(r) && have("cpu") { + if isCPUSet(r) && have("cpu") { return true, nil } if isCpusetSet(r) && have("cpuset") { @@ -64,12 +63,12 @@ func needAnyControllers(r *configs.Resources) (bool, error) { // containsDomainController returns whether the current config contains domain controller or not. // Refer to: http://man7.org/linux/man-pages/man7/cgroups.7.html // As at Linux 4.19, the following controllers are threaded: cpu, perf_event, and pids. -func containsDomainController(r *configs.Resources) bool { - return isMemorySet(r) || isIoSet(r) || isCpuSet(r) || isHugeTlbSet(r) +func containsDomainController(r *cgroups.Resources) bool { + return isMemorySet(r) || isIoSet(r) || isCPUSet(r) || isHugeTlbSet(r) } // CreateCgroupPath creates cgroupv2 path, enabling all the supported controllers. -func CreateCgroupPath(path string, c *configs.Cgroup) (Err error) { +func CreateCgroupPath(path string, c *cgroups.Cgroup) (Err error) { if !strings.HasPrefix(path, UnifiedMountpoint) { return fmt.Errorf("invalid cgroup path %s", path) } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/defaultpath.go b/e2e/vendor/github.com/opencontainers/cgroups/fs2/defaultpath.go similarity index 57% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/defaultpath.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs2/defaultpath.go index 8ac831201..0bc479de3 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/defaultpath.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs2/defaultpath.go @@ -19,40 +19,25 @@ package fs2 import ( "bufio" "errors" - "fmt" "io" "os" "path/filepath" "strings" - "github.com/opencontainers/runc/libcontainer/configs" - "github.com/opencontainers/runc/libcontainer/utils" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/internal/path" ) const UnifiedMountpoint = "/sys/fs/cgroup" -func defaultDirPath(c *configs.Cgroup) (string, error) { - if (c.Name != "" || c.Parent != "") && c.Path != "" { - return "", fmt.Errorf("cgroup: either Path or Name and Parent should be used, got %+v", c) +func defaultDirPath(c *cgroups.Cgroup) (string, error) { + innerPath, err := path.Inner(c) + if err != nil { + return "", err } - return _defaultDirPath(UnifiedMountpoint, c.Path, c.Parent, c.Name) -} - -func _defaultDirPath(root, cgPath, cgParent, cgName string) (string, error) { - if (cgName != "" || cgParent != "") && cgPath != "" { - return "", errors.New("cgroup: either Path or Name and Parent should be used") - } - - // XXX: Do not remove CleanPath. Path safety is important! -- cyphar - innerPath := utils.CleanPath(cgPath) - if innerPath == "" { - cgParent := utils.CleanPath(cgParent) - cgName := utils.CleanPath(cgName) - innerPath = filepath.Join(cgParent, cgName) - } if filepath.IsAbs(innerPath) { - return filepath.Join(root, innerPath), nil + return filepath.Join(UnifiedMountpoint, innerPath), nil } // we don't need to use /proc/thread-self here because runc always runs @@ -67,7 +52,7 @@ func _defaultDirPath(root, cgPath, cgParent, cgName string) (string, error) { // A parent cgroup (with no tasks in it) is what we need. ownCgroup = filepath.Dir(ownCgroup) - return filepath.Join(root, ownCgroup, innerPath), nil + return filepath.Join(UnifiedMountpoint, ownCgroup, innerPath), nil } // parseCgroupFile parses /proc/PID/cgroup file and return string @@ -83,16 +68,9 @@ func parseCgroupFile(path string) (string, error) { func parseCgroupFromReader(r io.Reader) (string, error) { s := bufio.NewScanner(r) for s.Scan() { - var ( - text = s.Text() - parts = strings.SplitN(text, ":", 3) - ) - if len(parts) < 3 { - return "", fmt.Errorf("invalid cgroup entry: %q", text) - } - // text is like "0::/user.slice/user-1001.slice/session-1.scope" - if parts[0] == "0" && parts[1] == "" { - return parts[2], nil + // "0::/user.slice/user-1001.slice/session-1.scope" + if path, ok := strings.CutPrefix(s.Text(), "0::"); ok { + return path, nil } } if err := s.Err(); err != nil { diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/freezer.go b/e2e/vendor/github.com/opencontainers/cgroups/fs2/freezer.go similarity index 71% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/freezer.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs2/freezer.go index 8917a6411..f0192f095 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/freezer.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs2/freezer.go @@ -10,18 +10,17 @@ import ( "golang.org/x/sys/unix" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" ) -func setFreezer(dirPath string, state configs.FreezerState) error { +func setFreezer(dirPath string, state cgroups.FreezerState) error { var stateStr string switch state { - case configs.Undefined: + case cgroups.Undefined: return nil - case configs.Frozen: + case cgroups.Frozen: stateStr = "1" - case configs.Thawed: + case cgroups.Thawed: stateStr = "0" default: return fmt.Errorf("invalid freezer state %q requested", state) @@ -32,7 +31,7 @@ func setFreezer(dirPath string, state configs.FreezerState) error { // We can ignore this request as long as the user didn't ask us to // freeze the container (since without the freezer cgroup, that's a // no-op). - if state != configs.Frozen { + if state != cgroups.Frozen { return nil } return fmt.Errorf("freezer not supported: %w", err) @@ -51,7 +50,7 @@ func setFreezer(dirPath string, state configs.FreezerState) error { return nil } -func getFreezer(dirPath string) (configs.FreezerState, error) { +func getFreezer(dirPath string) (cgroups.FreezerState, error) { fd, err := cgroups.OpenFile(dirPath, "cgroup.freeze", unix.O_RDONLY) if err != nil { // If the kernel is too old, then we just treat the freezer as being in @@ -59,36 +58,36 @@ func getFreezer(dirPath string) (configs.FreezerState, error) { if os.IsNotExist(err) || errors.Is(err, unix.ENODEV) { err = nil } - return configs.Undefined, err + return cgroups.Undefined, err } defer fd.Close() return readFreezer(dirPath, fd) } -func readFreezer(dirPath string, fd *os.File) (configs.FreezerState, error) { +func readFreezer(dirPath string, fd *os.File) (cgroups.FreezerState, error) { if _, err := fd.Seek(0, 0); err != nil { - return configs.Undefined, err + return cgroups.Undefined, err } state := make([]byte, 2) if _, err := fd.Read(state); err != nil { - return configs.Undefined, err + return cgroups.Undefined, err } switch string(state) { case "0\n": - return configs.Thawed, nil + return cgroups.Thawed, nil case "1\n": return waitFrozen(dirPath) default: - return configs.Undefined, fmt.Errorf(`unknown "cgroup.freeze" state: %q`, state) + return cgroups.Undefined, fmt.Errorf(`unknown "cgroup.freeze" state: %q`, state) } } // waitFrozen polls cgroup.events until it sees "frozen 1" in it. -func waitFrozen(dirPath string) (configs.FreezerState, error) { +func waitFrozen(dirPath string) (cgroups.FreezerState, error) { fd, err := cgroups.OpenFile(dirPath, "cgroup.events", unix.O_RDONLY) if err != nil { - return configs.Undefined, err + return cgroups.Undefined, err } defer fd.Close() @@ -103,13 +102,11 @@ func waitFrozen(dirPath string) (configs.FreezerState, error) { scanner := bufio.NewScanner(fd) for i := 0; scanner.Scan(); { if i == maxIter { - return configs.Undefined, fmt.Errorf("timeout of %s reached waiting for the cgroup to freeze", waitTime*maxIter) + return cgroups.Undefined, fmt.Errorf("timeout of %s reached waiting for the cgroup to freeze", waitTime*maxIter) } - line := scanner.Text() - val := strings.TrimPrefix(line, "frozen ") - if val != line { // got prefix + if val, ok := strings.CutPrefix(scanner.Text(), "frozen "); ok { if val[0] == '1' { - return configs.Frozen, nil + return cgroups.Frozen, nil } i++ @@ -117,11 +114,11 @@ func waitFrozen(dirPath string) (configs.FreezerState, error) { time.Sleep(waitTime) _, err := fd.Seek(0, 0) if err != nil { - return configs.Undefined, err + return cgroups.Undefined, err } } } // Should only reach here either on read error, // or if the file does not contain "frozen " line. - return configs.Undefined, scanner.Err() + return cgroups.Undefined, scanner.Err() } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/fs2.go b/e2e/vendor/github.com/opencontainers/cgroups/fs2/fs2.go similarity index 91% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/fs2.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs2/fs2.go index 93f81bf8d..c5d5a1f8e 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/fs2.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs2/fs2.go @@ -6,15 +6,14 @@ import ( "os" "strings" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/fscommon" ) type parseError = fscommon.ParseError type Manager struct { - config *configs.Cgroup + config *cgroups.Cgroup // dirPath is like "/sys/fs/cgroup/user.slice/user-1001.slice/session-1.scope" dirPath string // controllers is content of "cgroup.controllers" file. @@ -25,7 +24,7 @@ type Manager struct { // NewManager creates a manager for cgroup v2 unified hierarchy. // dirPath is like "/sys/fs/cgroup/user.slice/user-1001.slice/session-1.scope". // If dirPath is empty, it is automatically set using config. -func NewManager(config *configs.Cgroup, dirPath string) (*Manager, error) { +func NewManager(config *cgroups.Cgroup, dirPath string) (*Manager, error) { if dirPath == "" { var err error dirPath, err = defaultDirPath(config) @@ -143,7 +142,7 @@ func (m *Manager) GetStats() (*cgroups.Stats, error) { return st, nil } -func (m *Manager) Freeze(state configs.FreezerState) error { +func (m *Manager) Freeze(state cgroups.FreezerState) error { if m.config.Resources == nil { return errors.New("cannot toggle freezer: cgroups not configured for container") } @@ -162,7 +161,7 @@ func (m *Manager) Path(_ string) string { return m.dirPath } -func (m *Manager) Set(r *configs.Resources) error { +func (m *Manager) Set(r *cgroups.Resources) error { if r == nil { return nil } @@ -182,7 +181,7 @@ func (m *Manager) Set(r *configs.Resources) error { return err } // cpu (since kernel 4.15) - if err := setCpu(m.dirPath, r); err != nil { + if err := setCPU(m.dirPath, r); err != nil { return err } // devices (since kernel 4.15, pseudo-controller) @@ -218,7 +217,7 @@ func (m *Manager) Set(r *configs.Resources) error { return nil } -func setDevices(dirPath string, r *configs.Resources) error { +func setDevices(dirPath string, r *cgroups.Resources) error { if cgroups.DevicesSetV2 == nil { if len(r.Devices) > 0 { return cgroups.ErrDevicesUnsupported @@ -238,11 +237,10 @@ func (m *Manager) setUnified(res map[string]string) error { if errors.Is(err, os.ErrPermission) || errors.Is(err, os.ErrNotExist) { // Check if a controller is available, // to give more specific error if not. - sk := strings.SplitN(k, ".", 2) - if len(sk) != 2 { + c, _, ok := strings.Cut(k, ".") + if !ok { return fmt.Errorf("unified resource %q must be in the form CONTROLLER.PARAMETER", k) } - c := sk[0] if _, ok := m.controllers[c]; !ok && c != "cgroup" { return fmt.Errorf("unified resource %q can't be set: controller %q not available", k, c) } @@ -260,11 +258,11 @@ func (m *Manager) GetPaths() map[string]string { return paths } -func (m *Manager) GetCgroups() (*configs.Cgroup, error) { +func (m *Manager) GetCgroups() (*cgroups.Cgroup, error) { return m.config, nil } -func (m *Manager) GetFreezerState() (configs.FreezerState, error) { +func (m *Manager) GetFreezerState() (cgroups.FreezerState, error) { return getFreezer(m.dirPath) } @@ -285,7 +283,7 @@ func (m *Manager) OOMKillCount() (uint64, error) { return c, err } -func CheckMemoryUsage(dirPath string, r *configs.Resources) error { +func CheckMemoryUsage(dirPath string, r *cgroups.Resources) error { if !r.MemoryCheckBeforeUpdate { return nil } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/hugetlb.go b/e2e/vendor/github.com/opencontainers/cgroups/fs2/hugetlb.go similarity index 81% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/hugetlb.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs2/hugetlb.go index 2ce2631e1..8e1ac874a 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/hugetlb.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs2/hugetlb.go @@ -5,16 +5,15 @@ import ( "os" "strconv" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/fscommon" ) -func isHugeTlbSet(r *configs.Resources) bool { +func isHugeTlbSet(r *cgroups.Resources) bool { return len(r.HugetlbLimit) > 0 } -func setHugeTlb(dirPath string, r *configs.Resources) error { +func setHugeTlb(dirPath string, r *cgroups.Resources) error { if !isHugeTlbSet(r) { return nil } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/io.go b/e2e/vendor/github.com/opencontainers/cgroups/fs2/io.go similarity index 95% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/io.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs2/io.go index b2ff7d340..0f6ef7fea 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/io.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs2/io.go @@ -10,11 +10,10 @@ import ( "github.com/sirupsen/logrus" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" ) -func isIoSet(r *configs.Resources) bool { +func isIoSet(r *cgroups.Resources) bool { return r.BlkioWeight != 0 || len(r.BlkioWeightDevice) > 0 || len(r.BlkioThrottleReadBpsDevice) > 0 || @@ -37,7 +36,7 @@ func bfqDeviceWeightSupported(bfq *os.File) bool { return err != nil } -func setIo(dirPath string, r *configs.Resources) error { +func setIo(dirPath string, r *cgroups.Resources) error { if !isIoSet(r) { return nil } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/memory.go b/e2e/vendor/github.com/opencontainers/cgroups/fs2/memory.go similarity index 95% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/memory.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs2/memory.go index df8336ba0..d67fd8aba 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/memory.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs2/memory.go @@ -10,9 +10,8 @@ import ( "golang.org/x/sys/unix" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/fscommon" ) // numToStr converts an int64 value to a string for writing to a @@ -32,11 +31,11 @@ func numToStr(value int64) (ret string) { return ret } -func isMemorySet(r *configs.Resources) bool { +func isMemorySet(r *cgroups.Resources) bool { return r.MemoryReservation != 0 || r.Memory != 0 || r.MemorySwap != 0 } -func setMemory(dirPath string, r *configs.Resources) error { +func setMemory(dirPath string, r *cgroups.Resources) error { if !isMemorySet(r) { return nil } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/misc.go b/e2e/vendor/github.com/opencontainers/cgroups/fs2/misc.go similarity index 87% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/misc.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs2/misc.go index f0b292aa0..f20136b66 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/misc.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs2/misc.go @@ -5,8 +5,8 @@ import ( "os" "strings" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/fscommon" ) func statMisc(dirPath string, stats *cgroups.Stats) error { diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/pids.go b/e2e/vendor/github.com/opencontainers/cgroups/fs2/pids.go similarity index 84% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/pids.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs2/pids.go index c8c4a3658..9b82b9011 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/pids.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs2/pids.go @@ -8,16 +8,15 @@ import ( "golang.org/x/sys/unix" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/fscommon" ) -func isPidsSet(r *configs.Resources) bool { +func isPidsSet(r *cgroups.Resources) bool { return r.PidsLimit != 0 } -func setPids(dirPath string, r *configs.Resources) error { +func setPids(dirPath string, r *cgroups.Resources) error { if !isPidsSet(r) { return nil } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/psi.go b/e2e/vendor/github.com/opencontainers/cgroups/fs2/psi.go similarity index 82% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/psi.go rename to e2e/vendor/github.com/opencontainers/cgroups/fs2/psi.go index 09f348885..010fe0bff 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs2/psi.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fs2/psi.go @@ -10,7 +10,7 @@ import ( "golang.org/x/sys/unix" - "github.com/opencontainers/runc/libcontainer/cgroups" + "github.com/opencontainers/cgroups" ) func statPSI(dirPath string, file string) (*cgroups.PSIStats, error) { @@ -58,12 +58,12 @@ func statPSI(dirPath string, file string) (*cgroups.PSIStats, error) { func parsePSIData(psi []string) (cgroups.PSIData, error) { data := cgroups.PSIData{} for _, f := range psi { - kv := strings.SplitN(f, "=", 2) - if len(kv) != 2 { + key, val, ok := strings.Cut(f, "=") + if !ok { return data, fmt.Errorf("invalid psi data: %q", f) } var pv *float64 - switch kv[0] { + switch key { case "avg10": pv = &data.Avg10 case "avg60": @@ -71,16 +71,16 @@ func parsePSIData(psi []string) (cgroups.PSIData, error) { case "avg300": pv = &data.Avg300 case "total": - v, err := strconv.ParseUint(kv[1], 10, 64) + v, err := strconv.ParseUint(val, 10, 64) if err != nil { - return data, fmt.Errorf("invalid %s PSI value: %w", kv[0], err) + return data, fmt.Errorf("invalid %s PSI value: %w", key, err) } data.Total = v } if pv != nil { - v, err := strconv.ParseFloat(kv[1], 64) + v, err := strconv.ParseFloat(val, 64) if err != nil { - return data, fmt.Errorf("invalid %s PSI value: %w", kv[0], err) + return data, fmt.Errorf("invalid %s PSI value: %w", key, err) } *pv = v } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/rdma.go b/e2e/vendor/github.com/opencontainers/cgroups/fscommon/rdma.go similarity index 86% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/rdma.go rename to e2e/vendor/github.com/opencontainers/cgroups/fscommon/rdma.go index d463d15ee..86e38fdcb 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/rdma.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fscommon/rdma.go @@ -8,23 +8,21 @@ import ( "strconv" "strings" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/configs" "golang.org/x/sys/unix" + + "github.com/opencontainers/cgroups" ) // parseRdmaKV parses raw string to RdmaEntry. func parseRdmaKV(raw string, entry *cgroups.RdmaEntry) error { var value uint32 - parts := strings.SplitN(raw, "=", 3) + k, v, ok := strings.Cut(raw, "=") - if len(parts) != 2 { + if !ok { return errors.New("Unable to parse RDMA entry") } - k, v := parts[0], parts[1] - if v == "max" { value = math.MaxUint32 } else { @@ -34,9 +32,10 @@ func parseRdmaKV(raw string, entry *cgroups.RdmaEntry) error { } value = uint32(val64) } - if k == "hca_handle" { + switch k { + case "hca_handle": entry.HcaHandles = value - } else if k == "hca_object" { + case "hca_object": entry.HcaObjects = value } @@ -99,7 +98,7 @@ func RdmaGetStats(path string, stats *cgroups.Stats) error { return nil } -func createCmdString(device string, limits configs.LinuxRdma) string { +func createCmdString(device string, limits cgroups.LinuxRdma) string { cmdString := device if limits.HcaHandles != nil { cmdString += " hca_handle=" + strconv.FormatUint(uint64(*limits.HcaHandles), 10) @@ -111,7 +110,7 @@ func createCmdString(device string, limits configs.LinuxRdma) string { } // RdmaSet sets RDMA resources. -func RdmaSet(path string, r *configs.Resources) error { +func RdmaSet(path string, r *cgroups.Resources) error { for device, limits := range r.Rdma { if err := cgroups.WriteFile(path, "rdma.max", createCmdString(device, limits)); err != nil { return err diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/utils.go b/e2e/vendor/github.com/opencontainers/cgroups/fscommon/utils.go similarity index 79% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/utils.go rename to e2e/vendor/github.com/opencontainers/cgroups/fscommon/utils.go index f4a51c9e5..d8f8dfc02 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/fscommon/utils.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/fscommon/utils.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/opencontainers/runc/libcontainer/cgroups" + "github.com/opencontainers/cgroups" ) var ( @@ -54,38 +54,39 @@ func ParseUint(s string, base, bitSize int) (uint64, error) { return value, nil } -// ParseKeyValue parses a space-separated "name value" kind of cgroup +// ParseKeyValue parses a space-separated "key value" kind of cgroup // parameter and returns its key as a string, and its value as uint64 -// (ParseUint is used to convert the value). For example, +// (using [ParseUint] to convert the value). For example, // "io_service_bytes 1234" will be returned as "io_service_bytes", 1234. func ParseKeyValue(t string) (string, uint64, error) { - parts := strings.SplitN(t, " ", 3) - if len(parts) != 2 { - return "", 0, fmt.Errorf("line %q is not in key value format", t) + key, val, ok := strings.Cut(t, " ") + if !ok || key == "" || val == "" { + return "", 0, fmt.Errorf(`line %q is not in "key value" format`, t) } - value, err := ParseUint(parts[1], 10, 64) + value, err := ParseUint(val, 10, 64) if err != nil { return "", 0, err } - return parts[0], value, nil + return key, value, nil } -// GetValueByKey reads a key-value pairs from the specified cgroup file, -// and returns a value of the specified key. ParseUint is used for value -// conversion. +// GetValueByKey reads space-separated "key value" pairs from the specified +// cgroup file, looking for a specified key, and returns its value as uint64, +// using [ParseUint] for conversion. If the value is not found, 0 is returned. func GetValueByKey(path, file, key string) (uint64, error) { content, err := cgroups.ReadFile(path, file) if err != nil { return 0, err } + key += " " lines := strings.Split(content, "\n") for _, line := range lines { - arr := strings.Split(line, " ") - if len(arr) == 2 && arr[0] == key { - val, err := ParseUint(arr[1], 10, 64) + v, ok := strings.CutPrefix(line, key) + if ok { + val, err := ParseUint(v, 10, 64) if err != nil { err = &ParseError{Path: path, File: file, Err: err} } @@ -103,7 +104,6 @@ func GetCgroupParamUint(path, file string) (uint64, error) { if err != nil { return 0, err } - contents = strings.TrimSpace(contents) if contents == "max" { return math.MaxUint64, nil } @@ -118,11 +118,10 @@ func GetCgroupParamUint(path, file string) (uint64, error) { // GetCgroupParamInt reads a single int64 value from specified cgroup file. // If the value read is "max", the math.MaxInt64 is returned. func GetCgroupParamInt(path, file string) (int64, error) { - contents, err := cgroups.ReadFile(path, file) + contents, err := GetCgroupParamString(path, file) if err != nil { return 0, err } - contents = strings.TrimSpace(contents) if contents == "max" { return math.MaxInt64, nil } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/getallpids.go b/e2e/vendor/github.com/opencontainers/cgroups/getallpids.go similarity index 100% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/getallpids.go rename to e2e/vendor/github.com/opencontainers/cgroups/getallpids.go diff --git a/e2e/vendor/github.com/opencontainers/cgroups/internal/path/path.go b/e2e/vendor/github.com/opencontainers/cgroups/internal/path/path.go new file mode 100644 index 000000000..a105a7cf4 --- /dev/null +++ b/e2e/vendor/github.com/opencontainers/cgroups/internal/path/path.go @@ -0,0 +1,52 @@ +package path + +import ( + "errors" + "os" + "path/filepath" + + "github.com/opencontainers/cgroups" +) + +// Inner returns a path to cgroup relative to a cgroup mount point, based +// on cgroup configuration, or an error, if cgroup configuration is invalid. +// To be used only by fs cgroup managers (systemd has different path rules). +func Inner(c *cgroups.Cgroup) (string, error) { + if (c.Name != "" || c.Parent != "") && c.Path != "" { + return "", errors.New("cgroup: either Path or Name and Parent should be used") + } + + // XXX: Do not remove cleanPath. Path safety is important! -- cyphar + innerPath := cleanPath(c.Path) + if innerPath == "" { + cgParent := cleanPath(c.Parent) + cgName := cleanPath(c.Name) + innerPath = filepath.Join(cgParent, cgName) + } + + return innerPath, nil +} + +// cleanPath is a copy of github.com/opencontainers/runc/libcontainer/utils.CleanPath. +func cleanPath(path string) string { + // Deal with empty strings nicely. + if path == "" { + return "" + } + + // Ensure that all paths are cleaned (especially problematic ones like + // "/../../../../../" which can cause lots of issues). + + if filepath.IsAbs(path) { + return filepath.Clean(path) + } + + // If the path isn't absolute, we need to do more processing to fix paths + // such as "../../../..//some/path". We also shouldn't convert absolute + // paths to relative ones. + path = filepath.Clean(string(os.PathSeparator) + path) + // This can't fail, as (by definition) all paths are relative to root. + path, _ = filepath.Rel(string(os.PathSeparator), path) + + return path +} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/manager/new.go b/e2e/vendor/github.com/opencontainers/cgroups/manager/new.go similarity index 83% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/manager/new.go rename to e2e/vendor/github.com/opencontainers/cgroups/manager/new.go index a7bf155cf..2df39e587 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/manager/new.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/manager/new.go @@ -5,17 +5,16 @@ import ( "fmt" "path/filepath" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fs" - "github.com/opencontainers/runc/libcontainer/cgroups/fs2" - "github.com/opencontainers/runc/libcontainer/cgroups/systemd" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/fs" + "github.com/opencontainers/cgroups/fs2" + "github.com/opencontainers/cgroups/systemd" ) // New returns the instance of a cgroup manager, which is chosen // based on the local environment (whether cgroup v1 or v2 is used) // and the config (whether config.Systemd is set or not). -func New(config *configs.Cgroup) (cgroups.Manager, error) { +func New(config *cgroups.Cgroup) (cgroups.Manager, error) { return NewWithPaths(config, nil) } @@ -27,7 +26,7 @@ func New(config *configs.Cgroup) (cgroups.Manager, error) { // // For cgroup v2, the only key allowed is "" (empty string), and the value // is the unified cgroup path. -func NewWithPaths(config *configs.Cgroup, paths map[string]string) (cgroups.Manager, error) { +func NewWithPaths(config *cgroups.Cgroup, paths map[string]string) (cgroups.Manager, error) { if config == nil { return nil, errors.New("cgroups/manager.New: config must not be nil") } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/stats.go b/e2e/vendor/github.com/opencontainers/cgroups/stats.go similarity index 100% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/stats.go rename to e2e/vendor/github.com/opencontainers/cgroups/stats.go diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/common.go b/e2e/vendor/github.com/opencontainers/cgroups/systemd/common.go similarity index 96% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/common.go rename to e2e/vendor/github.com/opencontainers/cgroups/systemd/common.go index ed2f4110f..b3077bd37 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/common.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/systemd/common.go @@ -15,8 +15,7 @@ import ( dbus "github.com/godbus/dbus/v5" "github.com/sirupsen/logrus" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" ) const ( @@ -35,10 +34,10 @@ var ( // GenerateDeviceProps is a function to generate systemd device // properties, used by Set methods. Unless - // [github.com/opencontainers/runc/libcontainer/cgroups/devices] + // [github.com/opencontainers/cgroups/devices] // package is imported, it is set to nil, so cgroup managers can't // configure devices. - GenerateDeviceProps func(r *configs.Resources, sdVer int) ([]systemdDbus.Property, error) + GenerateDeviceProps func(r *cgroups.Resources, sdVer int) ([]systemdDbus.Property, error) ) // NOTE: This function comes from package github.com/coreos/go-systemd/util @@ -97,7 +96,7 @@ func newProp(name string, units interface{}) systemdDbus.Property { } } -func getUnitName(c *configs.Cgroup) string { +func getUnitName(c *cgroups.Cgroup) string { // by default, we create a scope unless the user explicitly asks for a slice. if !strings.HasSuffix(c.Name, ".slice") { return c.ScopePrefix + "-" + c.Name + ".scope" @@ -351,7 +350,7 @@ func addCpuset(cm *dbusConnManager, props *[]systemdDbus.Property, cpus, mems st // generateDeviceProperties takes the configured device rules and generates a // corresponding set of systemd properties to configure the devices correctly. -func generateDeviceProperties(r *configs.Resources, cm *dbusConnManager) ([]systemdDbus.Property, error) { +func generateDeviceProperties(r *cgroups.Resources, cm *dbusConnManager) ([]systemdDbus.Property, error) { if GenerateDeviceProps == nil { if len(r.Devices) > 0 { return nil, cgroups.ErrDevicesUnsupported diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/cpuset.go b/e2e/vendor/github.com/opencontainers/cgroups/systemd/cpuset.go similarity index 100% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/cpuset.go rename to e2e/vendor/github.com/opencontainers/cgroups/systemd/cpuset.go diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/dbus.go b/e2e/vendor/github.com/opencontainers/cgroups/systemd/dbus.go similarity index 100% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/dbus.go rename to e2e/vendor/github.com/opencontainers/cgroups/systemd/dbus.go diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/devices.go b/e2e/vendor/github.com/opencontainers/cgroups/systemd/devices.go similarity index 89% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/devices.go rename to e2e/vendor/github.com/opencontainers/cgroups/systemd/devices.go index d8c572b4d..51ca7fa11 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/devices.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/systemd/devices.go @@ -5,7 +5,7 @@ import ( dbus "github.com/godbus/dbus/v5" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" ) // freezeBeforeSet answers whether there is a need to freeze the cgroup before @@ -17,7 +17,7 @@ import ( // (unlike our fs driver, they will happily write deny-all rules to running // containers). So we have to freeze the container to avoid the container get // an occasional "permission denied" error. -func (m *LegacyManager) freezeBeforeSet(unitName string, r *configs.Resources) (needsFreeze, needsThaw bool, err error) { +func (m *LegacyManager) freezeBeforeSet(unitName string, r *cgroups.Resources) (needsFreeze, needsThaw bool, err error) { // Special case for SkipDevices, as used by Kubernetes to create pod // cgroups with allow-all device policy). if r.SkipDevices { @@ -60,13 +60,13 @@ func (m *LegacyManager) freezeBeforeSet(unitName string, r *configs.Resources) ( if err != nil { return } - if freezerState == configs.Frozen { + if freezerState == cgroups.Frozen { // Already frozen, and should stay frozen. needsFreeze = false needsThaw = false } - if r.Freezer == configs.Frozen { + if r.Freezer == cgroups.Frozen { // Will be frozen anyway -- no need to thaw. needsThaw = false } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/user.go b/e2e/vendor/github.com/opencontainers/cgroups/systemd/user.go similarity index 96% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/user.go rename to e2e/vendor/github.com/opencontainers/cgroups/systemd/user.go index 1e18403ba..4a4348e70 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/user.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/systemd/user.go @@ -61,8 +61,7 @@ func DetectUID() (int, error) { scanner := bufio.NewScanner(bytes.NewReader(b)) for scanner.Scan() { s := strings.TrimSpace(scanner.Text()) - if strings.HasPrefix(s, "OwnerUID=") { - uidStr := strings.TrimPrefix(s, "OwnerUID=") + if uidStr, ok := strings.CutPrefix(s, "OwnerUID="); ok { i, err := strconv.Atoi(uidStr) if err != nil { return -1, fmt.Errorf("could not detect the OwnerUID: %w", err) diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v1.go b/e2e/vendor/github.com/opencontainers/cgroups/systemd/v1.go similarity index 90% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v1.go rename to e2e/vendor/github.com/opencontainers/cgroups/systemd/v1.go index 8c64a5887..8453e9b49 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v1.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/systemd/v1.go @@ -10,19 +10,18 @@ import ( systemdDbus "github.com/coreos/go-systemd/v22/dbus" "github.com/sirupsen/logrus" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fs" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/fs" ) type LegacyManager struct { mu sync.Mutex - cgroups *configs.Cgroup + cgroups *cgroups.Cgroup paths map[string]string dbus *dbusConnManager } -func NewLegacyManager(cg *configs.Cgroup, paths map[string]string) (*LegacyManager, error) { +func NewLegacyManager(cg *cgroups.Cgroup, paths map[string]string) (*LegacyManager, error) { if cg.Rootless { return nil, errors.New("cannot use rootless systemd cgroups manager on cgroup v1") } @@ -49,7 +48,7 @@ type subsystem interface { // GetStats returns the stats, as 'stats', corresponding to the cgroup under 'path'. GetStats(path string, stats *cgroups.Stats) error // Set sets cgroup resource limits. - Set(path string, r *configs.Resources) error + Set(path string, r *cgroups.Resources) error } var errSubsystemDoesNotExist = errors.New("cgroup: subsystem does not exist") @@ -72,7 +71,7 @@ var legacySubsystems = []subsystem{ &fs.NameGroup{GroupName: "misc"}, } -func genV1ResourcesProperties(r *configs.Resources, cm *dbusConnManager) ([]systemdDbus.Property, error) { +func genV1ResourcesProperties(r *cgroups.Resources, cm *dbusConnManager) ([]systemdDbus.Property, error) { var properties []systemdDbus.Property deviceProperties, err := generateDeviceProperties(r, cm) @@ -112,7 +111,7 @@ func genV1ResourcesProperties(r *configs.Resources, cm *dbusConnManager) ([]syst } // initPaths figures out and returns paths to cgroups. -func initPaths(c *configs.Cgroup) (map[string]string, error) { +func initPaths(c *cgroups.Cgroup) (map[string]string, error) { slice := "system.slice" if c.Parent != "" { var err error @@ -275,7 +274,7 @@ func getSubsystemPath(slice, unit, subsystem string) (string, error) { return filepath.Join(mountpoint, slice, unit), nil } -func (m *LegacyManager) Freeze(state configs.FreezerState) error { +func (m *LegacyManager) Freeze(state cgroups.FreezerState) error { err := m.doFreeze(state) if err == nil { m.cgroups.Resources.Freezer = state @@ -285,13 +284,13 @@ func (m *LegacyManager) Freeze(state configs.FreezerState) error { // doFreeze is the same as Freeze but without // changing the m.cgroups.Resources.Frozen field. -func (m *LegacyManager) doFreeze(state configs.FreezerState) error { +func (m *LegacyManager) doFreeze(state cgroups.FreezerState) error { path, ok := m.paths["freezer"] if !ok { return errSubsystemDoesNotExist } freezer := &fs.FreezerGroup{} - resources := &configs.Resources{Freezer: state} + resources := &cgroups.Resources{Freezer: state} return freezer.Set(path, resources) } @@ -328,7 +327,7 @@ func (m *LegacyManager) GetStats() (*cgroups.Stats, error) { return stats, nil } -func (m *LegacyManager) Set(r *configs.Resources) error { +func (m *LegacyManager) Set(r *cgroups.Resources) error { if r == nil { return nil } @@ -347,13 +346,13 @@ func (m *LegacyManager) Set(r *configs.Resources) error { } if needsFreeze { - if err := m.doFreeze(configs.Frozen); err != nil { + if err := m.doFreeze(cgroups.Frozen); err != nil { // If freezer cgroup isn't supported, we just warn about it. logrus.Infof("freeze container before SetUnitProperties failed: %v", err) // skip update the cgroup while frozen failed. #3803 if !errors.Is(err, errSubsystemDoesNotExist) { if needsThaw { - if thawErr := m.doFreeze(configs.Thawed); thawErr != nil { + if thawErr := m.doFreeze(cgroups.Thawed); thawErr != nil { logrus.Infof("thaw container after doFreeze failed: %v", thawErr) } } @@ -363,7 +362,7 @@ func (m *LegacyManager) Set(r *configs.Resources) error { } setErr := setUnitProperties(m.dbus, unitName, properties...) if needsThaw { - if err := m.doFreeze(configs.Thawed); err != nil { + if err := m.doFreeze(cgroups.Thawed); err != nil { logrus.Infof("thaw container after SetUnitProperties failed: %v", err) } } @@ -391,14 +390,14 @@ func (m *LegacyManager) GetPaths() map[string]string { return m.paths } -func (m *LegacyManager) GetCgroups() (*configs.Cgroup, error) { +func (m *LegacyManager) GetCgroups() (*cgroups.Cgroup, error) { return m.cgroups, nil } -func (m *LegacyManager) GetFreezerState() (configs.FreezerState, error) { +func (m *LegacyManager) GetFreezerState() (cgroups.FreezerState, error) { path, ok := m.paths["freezer"] if !ok { - return configs.Undefined, nil + return cgroups.Undefined, nil } freezer := &fs.FreezerGroup{} return freezer.GetState(path) diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v2.go b/e2e/vendor/github.com/opencontainers/cgroups/systemd/v2.go similarity index 96% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v2.go rename to e2e/vendor/github.com/opencontainers/cgroups/systemd/v2.go index b28ec6b22..42a6e3551 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/v2.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/systemd/v2.go @@ -15,9 +15,8 @@ import ( securejoin "github.com/cyphar/filepath-securejoin" "github.com/sirupsen/logrus" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fs2" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/fs2" ) const ( @@ -26,14 +25,14 @@ const ( type UnifiedManager struct { mu sync.Mutex - cgroups *configs.Cgroup + cgroups *cgroups.Cgroup // path is like "/sys/fs/cgroup/user.slice/user-1001.slice/session-1.scope" path string dbus *dbusConnManager fsMgr cgroups.Manager } -func NewUnifiedManager(config *configs.Cgroup, path string) (*UnifiedManager, error) { +func NewUnifiedManager(config *cgroups.Cgroup, path string) (*UnifiedManager, error) { m := &UnifiedManager{ cgroups: config, path: path, @@ -199,7 +198,7 @@ func unifiedResToSystemdProps(cm *dbusConnManager, res map[string]string) (props return props, nil } -func genV2ResourcesProperties(dirPath string, r *configs.Resources, cm *dbusConnManager) ([]systemdDbus.Property, error) { +func genV2ResourcesProperties(dirPath string, r *cgroups.Resources, cm *dbusConnManager) ([]systemdDbus.Property, error) { // We need this check before setting systemd properties, otherwise // the container is OOM-killed and the systemd unit is removed // before we get to fsMgr.Set(). @@ -461,7 +460,7 @@ func (m *UnifiedManager) initPath() error { return nil } -func (m *UnifiedManager) Freeze(state configs.FreezerState) error { +func (m *UnifiedManager) Freeze(state cgroups.FreezerState) error { return m.fsMgr.Freeze(state) } @@ -477,7 +476,7 @@ func (m *UnifiedManager) GetStats() (*cgroups.Stats, error) { return m.fsMgr.GetStats() } -func (m *UnifiedManager) Set(r *configs.Resources) error { +func (m *UnifiedManager) Set(r *cgroups.Resources) error { if r == nil { return nil } @@ -499,11 +498,11 @@ func (m *UnifiedManager) GetPaths() map[string]string { return paths } -func (m *UnifiedManager) GetCgroups() (*configs.Cgroup, error) { +func (m *UnifiedManager) GetCgroups() (*cgroups.Cgroup, error) { return m.cgroups, nil } -func (m *UnifiedManager) GetFreezerState() (configs.FreezerState, error) { +func (m *UnifiedManager) GetFreezerState() (cgroups.FreezerState, error) { return m.fsMgr.GetFreezerState() } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go b/e2e/vendor/github.com/opencontainers/cgroups/utils.go similarity index 92% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go rename to e2e/vendor/github.com/opencontainers/cgroups/utils.go index a05945cba..9ef24b1ac 100644 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/utils.go +++ b/e2e/vendor/github.com/opencontainers/cgroups/utils.go @@ -251,27 +251,39 @@ again: // RemovePath aims to remove cgroup path. It does so recursively, // by removing any subdirectories (sub-cgroups) first. func RemovePath(path string) error { - // Try the fast path first. + // Try the fast path first; don't retry on EBUSY yet. if err := rmdir(path, false); err == nil { return nil } + // There are many reasons why rmdir can fail, including: + // 1. cgroup have existing sub-cgroups; + // 2. cgroup (still) have some processes (that are about to vanish); + // 3. lack of permission (one example is read-only /sys/fs/cgroup mount, + // in which case rmdir returns EROFS even for for a non-existent path, + // see issue 4518). + // + // Using os.ReadDir here kills two birds with one stone: check if + // the directory exists (handling scenario 3 above), and use + // directory contents to remove sub-cgroups (handling scenario 1). infos, err := os.ReadDir(path) - if err != nil && !os.IsNotExist(err) { + if err != nil { + if os.IsNotExist(err) { + return nil + } return err } + // Let's remove sub-cgroups, if any. for _, info := range infos { if info.IsDir() { - // We should remove subcgroup first. if err = RemovePath(filepath.Join(path, info.Name())); err != nil { - break + return err } } } - if err == nil { - err = rmdir(path, true) - } - return err + // Finally, try rmdir again, this time with retries on EBUSY, + // which may help with scenario 2 above. + return rmdir(path, true) } // RemovePaths iterates over the provided paths removing them. @@ -320,8 +332,8 @@ func getHugePageSizeFromFilenames(fileNames []string) ([]string, error) { for _, file := range fileNames { // example: hugepages-1048576kB - val := strings.TrimPrefix(file, "hugepages-") - if len(val) == len(file) { + val, ok := strings.CutPrefix(file, "hugepages-") + if !ok { // Unexpected file name: no prefix found, ignore it. continue } diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/v1_utils.go b/e2e/vendor/github.com/opencontainers/cgroups/v1_utils.go similarity index 100% rename from e2e/vendor/github.com/opencontainers/runc/libcontainer/cgroups/v1_utils.go rename to e2e/vendor/github.com/opencontainers/cgroups/v1_utils.go diff --git a/e2e/vendor/github.com/opencontainers/runc/LICENSE b/e2e/vendor/github.com/opencontainers/image-spec/LICENSE similarity index 99% rename from e2e/vendor/github.com/opencontainers/runc/LICENSE rename to e2e/vendor/github.com/opencontainers/image-spec/LICENSE index 27448585a..9fdc20fdb 100644 --- a/e2e/vendor/github.com/opencontainers/runc/LICENSE +++ b/e2e/vendor/github.com/opencontainers/image-spec/LICENSE @@ -176,7 +176,7 @@ END OF TERMS AND CONDITIONS - Copyright 2014 Docker, Inc. + Copyright 2016 The Linux Foundation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/annotations.go b/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/annotations.go new file mode 100644 index 000000000..581cf7cdf --- /dev/null +++ b/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/annotations.go @@ -0,0 +1,62 @@ +// Copyright 2016 The Linux Foundation +// +// 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 v1 + +const ( + // AnnotationCreated is the annotation key for the date and time on which the image was built (date-time string as defined by RFC 3339). + AnnotationCreated = "org.opencontainers.image.created" + + // AnnotationAuthors is the annotation key for the contact details of the people or organization responsible for the image (freeform string). + AnnotationAuthors = "org.opencontainers.image.authors" + + // AnnotationURL is the annotation key for the URL to find more information on the image. + AnnotationURL = "org.opencontainers.image.url" + + // AnnotationDocumentation is the annotation key for the URL to get documentation on the image. + AnnotationDocumentation = "org.opencontainers.image.documentation" + + // AnnotationSource is the annotation key for the URL to get source code for building the image. + AnnotationSource = "org.opencontainers.image.source" + + // AnnotationVersion is the annotation key for the version of the packaged software. + // The version MAY match a label or tag in the source code repository. + // The version MAY be Semantic versioning-compatible. + AnnotationVersion = "org.opencontainers.image.version" + + // AnnotationRevision is the annotation key for the source control revision identifier for the packaged software. + AnnotationRevision = "org.opencontainers.image.revision" + + // AnnotationVendor is the annotation key for the name of the distributing entity, organization or individual. + AnnotationVendor = "org.opencontainers.image.vendor" + + // AnnotationLicenses is the annotation key for the license(s) under which contained software is distributed as an SPDX License Expression. + AnnotationLicenses = "org.opencontainers.image.licenses" + + // AnnotationRefName is the annotation key for the name of the reference for a target. + // SHOULD only be considered valid when on descriptors on `index.json` within image layout. + AnnotationRefName = "org.opencontainers.image.ref.name" + + // AnnotationTitle is the annotation key for the human-readable title of the image. + AnnotationTitle = "org.opencontainers.image.title" + + // AnnotationDescription is the annotation key for the human-readable description of the software packaged in the image. + AnnotationDescription = "org.opencontainers.image.description" + + // AnnotationBaseImageDigest is the annotation key for the digest of the image's base image. + AnnotationBaseImageDigest = "org.opencontainers.image.base.digest" + + // AnnotationBaseImageName is the annotation key for the image reference of the image's base image. + AnnotationBaseImageName = "org.opencontainers.image.base.name" +) diff --git a/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/config.go b/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/config.go new file mode 100644 index 000000000..36b0aeb8f --- /dev/null +++ b/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/config.go @@ -0,0 +1,111 @@ +// Copyright 2016 The Linux Foundation +// +// 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 v1 + +import ( + "time" + + digest "github.com/opencontainers/go-digest" +) + +// ImageConfig defines the execution parameters which should be used as a base when running a container using an image. +type ImageConfig struct { + // User defines the username or UID which the process in the container should run as. + User string `json:"User,omitempty"` + + // ExposedPorts a set of ports to expose from a container running this image. + ExposedPorts map[string]struct{} `json:"ExposedPorts,omitempty"` + + // Env is a list of environment variables to be used in a container. + Env []string `json:"Env,omitempty"` + + // Entrypoint defines a list of arguments to use as the command to execute when the container starts. + Entrypoint []string `json:"Entrypoint,omitempty"` + + // Cmd defines the default arguments to the entrypoint of the container. + Cmd []string `json:"Cmd,omitempty"` + + // Volumes is a set of directories describing where the process is likely write data specific to a container instance. + Volumes map[string]struct{} `json:"Volumes,omitempty"` + + // WorkingDir sets the current working directory of the entrypoint process in the container. + WorkingDir string `json:"WorkingDir,omitempty"` + + // Labels contains arbitrary metadata for the container. + Labels map[string]string `json:"Labels,omitempty"` + + // StopSignal contains the system call signal that will be sent to the container to exit. + StopSignal string `json:"StopSignal,omitempty"` + + // ArgsEscaped + // + // Deprecated: This field is present only for legacy compatibility with + // Docker and should not be used by new image builders. It is used by Docker + // for Windows images to indicate that the `Entrypoint` or `Cmd` or both, + // contains only a single element array, that is a pre-escaped, and combined + // into a single string `CommandLine`. If `true` the value in `Entrypoint` or + // `Cmd` should be used as-is to avoid double escaping. + // https://github.com/opencontainers/image-spec/pull/892 + ArgsEscaped bool `json:"ArgsEscaped,omitempty"` +} + +// RootFS describes a layer content addresses +type RootFS struct { + // Type is the type of the rootfs. + Type string `json:"type"` + + // DiffIDs is an array of layer content hashes (DiffIDs), in order from bottom-most to top-most. + DiffIDs []digest.Digest `json:"diff_ids"` +} + +// History describes the history of a layer. +type History struct { + // Created is the combined date and time at which the layer was created, formatted as defined by RFC 3339, section 5.6. + Created *time.Time `json:"created,omitempty"` + + // CreatedBy is the command which created the layer. + CreatedBy string `json:"created_by,omitempty"` + + // Author is the author of the build point. + Author string `json:"author,omitempty"` + + // Comment is a custom message set when creating the layer. + Comment string `json:"comment,omitempty"` + + // EmptyLayer is used to mark if the history item created a filesystem diff. + EmptyLayer bool `json:"empty_layer,omitempty"` +} + +// Image is the JSON structure which describes some basic information about the image. +// This provides the `application/vnd.oci.image.config.v1+json` mediatype when marshalled to JSON. +type Image struct { + // Created is the combined date and time at which the image was created, formatted as defined by RFC 3339, section 5.6. + Created *time.Time `json:"created,omitempty"` + + // Author defines the name and/or email address of the person or entity which created and is responsible for maintaining the image. + Author string `json:"author,omitempty"` + + // Platform describes the platform which the image in the manifest runs on. + Platform + + // Config defines the execution parameters which should be used as a base when running a container using the image. + Config ImageConfig `json:"config,omitempty"` + + // RootFS references the layer content addresses used by the image. + RootFS RootFS `json:"rootfs"` + + // History describes the history of each layer. + History []History `json:"history,omitempty"` +} diff --git a/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/descriptor.go b/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/descriptor.go new file mode 100644 index 000000000..1881b1181 --- /dev/null +++ b/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/descriptor.go @@ -0,0 +1,80 @@ +// Copyright 2016-2022 The Linux Foundation +// +// 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 v1 + +import digest "github.com/opencontainers/go-digest" + +// Descriptor describes the disposition of targeted content. +// This structure provides `application/vnd.oci.descriptor.v1+json` mediatype +// when marshalled to JSON. +type Descriptor struct { + // MediaType is the media type of the object this schema refers to. + MediaType string `json:"mediaType"` + + // Digest is the digest of the targeted content. + Digest digest.Digest `json:"digest"` + + // Size specifies the size in bytes of the blob. + Size int64 `json:"size"` + + // URLs specifies a list of URLs from which this object MAY be downloaded + URLs []string `json:"urls,omitempty"` + + // Annotations contains arbitrary metadata relating to the targeted content. + Annotations map[string]string `json:"annotations,omitempty"` + + // Data is an embedding of the targeted content. This is encoded as a base64 + // string when marshalled to JSON (automatically, by encoding/json). If + // present, Data can be used directly to avoid fetching the targeted content. + Data []byte `json:"data,omitempty"` + + // Platform describes the platform which the image in the manifest runs on. + // + // This should only be used when referring to a manifest. + Platform *Platform `json:"platform,omitempty"` + + // ArtifactType is the IANA media type of this artifact. + ArtifactType string `json:"artifactType,omitempty"` +} + +// Platform describes the platform which the image in the manifest runs on. +type Platform struct { + // Architecture field specifies the CPU architecture, for example + // `amd64` or `ppc64le`. + Architecture string `json:"architecture"` + + // OS specifies the operating system, for example `linux` or `windows`. + OS string `json:"os"` + + // OSVersion is an optional field specifying the operating system + // version, for example on Windows `10.0.14393.1066`. + OSVersion string `json:"os.version,omitempty"` + + // OSFeatures is an optional field specifying an array of strings, + // each listing a required OS feature (for example on Windows `win32k`). + OSFeatures []string `json:"os.features,omitempty"` + + // Variant is an optional field specifying a variant of the CPU, for + // example `v7` to specify ARMv7 when architecture is `arm`. + Variant string `json:"variant,omitempty"` +} + +// DescriptorEmptyJSON is the descriptor of a blob with content of `{}`. +var DescriptorEmptyJSON = Descriptor{ + MediaType: MediaTypeEmptyJSON, + Digest: `sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a`, + Size: 2, + Data: []byte(`{}`), +} diff --git a/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/index.go b/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/index.go new file mode 100644 index 000000000..e2bed9d4e --- /dev/null +++ b/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/index.go @@ -0,0 +1,38 @@ +// Copyright 2016 The Linux Foundation +// +// 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 v1 + +import "github.com/opencontainers/image-spec/specs-go" + +// Index references manifests for various platforms. +// This structure provides `application/vnd.oci.image.index.v1+json` mediatype when marshalled to JSON. +type Index struct { + specs.Versioned + + // MediaType specifies the type of this document data structure e.g. `application/vnd.oci.image.index.v1+json` + MediaType string `json:"mediaType,omitempty"` + + // ArtifactType specifies the IANA media type of artifact when the manifest is used for an artifact. + ArtifactType string `json:"artifactType,omitempty"` + + // Manifests references platform specific manifests. + Manifests []Descriptor `json:"manifests"` + + // Subject is an optional link from the image manifest to another manifest forming an association between the image manifest and the other manifest. + Subject *Descriptor `json:"subject,omitempty"` + + // Annotations contains arbitrary metadata for the image index. + Annotations map[string]string `json:"annotations,omitempty"` +} diff --git a/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/layout.go b/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/layout.go new file mode 100644 index 000000000..c5503cb30 --- /dev/null +++ b/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/layout.go @@ -0,0 +1,32 @@ +// Copyright 2016 The Linux Foundation +// +// 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 v1 + +const ( + // ImageLayoutFile is the file name containing ImageLayout in an OCI Image Layout + ImageLayoutFile = "oci-layout" + // ImageLayoutVersion is the version of ImageLayout + ImageLayoutVersion = "1.0.0" + // ImageIndexFile is the file name of the entry point for references and descriptors in an OCI Image Layout + ImageIndexFile = "index.json" + // ImageBlobsDir is the directory name containing content addressable blobs in an OCI Image Layout + ImageBlobsDir = "blobs" +) + +// ImageLayout is the structure in the "oci-layout" file, found in the root +// of an OCI Image-layout directory. +type ImageLayout struct { + Version string `json:"imageLayoutVersion"` +} diff --git a/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/manifest.go b/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/manifest.go new file mode 100644 index 000000000..26fec52a6 --- /dev/null +++ b/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/manifest.go @@ -0,0 +1,41 @@ +// Copyright 2016-2022 The Linux Foundation +// +// 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 v1 + +import "github.com/opencontainers/image-spec/specs-go" + +// Manifest provides `application/vnd.oci.image.manifest.v1+json` mediatype structure when marshalled to JSON. +type Manifest struct { + specs.Versioned + + // MediaType specifies the type of this document data structure e.g. `application/vnd.oci.image.manifest.v1+json` + MediaType string `json:"mediaType,omitempty"` + + // ArtifactType specifies the IANA media type of artifact when the manifest is used for an artifact. + ArtifactType string `json:"artifactType,omitempty"` + + // Config references a configuration object for a container, by digest. + // The referenced configuration object is a JSON blob that the runtime uses to set up the container. + Config Descriptor `json:"config"` + + // Layers is an indexed list of layers referenced by the manifest. + Layers []Descriptor `json:"layers"` + + // Subject is an optional link from the image manifest to another manifest forming an association between the image manifest and the other manifest. + Subject *Descriptor `json:"subject,omitempty"` + + // Annotations contains arbitrary metadata for the image manifest. + Annotations map[string]string `json:"annotations,omitempty"` +} diff --git a/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/mediatype.go b/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/mediatype.go new file mode 100644 index 000000000..ce8313e79 --- /dev/null +++ b/e2e/vendor/github.com/opencontainers/image-spec/specs-go/v1/mediatype.go @@ -0,0 +1,85 @@ +// Copyright 2016 The Linux Foundation +// +// 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 v1 + +const ( + // MediaTypeDescriptor specifies the media type for a content descriptor. + MediaTypeDescriptor = "application/vnd.oci.descriptor.v1+json" + + // MediaTypeLayoutHeader specifies the media type for the oci-layout. + MediaTypeLayoutHeader = "application/vnd.oci.layout.header.v1+json" + + // MediaTypeImageIndex specifies the media type for an image index. + MediaTypeImageIndex = "application/vnd.oci.image.index.v1+json" + + // MediaTypeImageManifest specifies the media type for an image manifest. + MediaTypeImageManifest = "application/vnd.oci.image.manifest.v1+json" + + // MediaTypeImageConfig specifies the media type for the image configuration. + MediaTypeImageConfig = "application/vnd.oci.image.config.v1+json" + + // MediaTypeEmptyJSON specifies the media type for an unused blob containing the value "{}". + MediaTypeEmptyJSON = "application/vnd.oci.empty.v1+json" +) + +const ( + // MediaTypeImageLayer is the media type used for layers referenced by the manifest. + MediaTypeImageLayer = "application/vnd.oci.image.layer.v1.tar" + + // MediaTypeImageLayerGzip is the media type used for gzipped layers + // referenced by the manifest. + MediaTypeImageLayerGzip = "application/vnd.oci.image.layer.v1.tar+gzip" + + // MediaTypeImageLayerZstd is the media type used for zstd compressed + // layers referenced by the manifest. + MediaTypeImageLayerZstd = "application/vnd.oci.image.layer.v1.tar+zstd" +) + +// Non-distributable layer media-types. +// +// Deprecated: Non-distributable layers are deprecated, and not recommended +// for future use. Implementations SHOULD NOT produce new non-distributable +// layers. +// https://github.com/opencontainers/image-spec/pull/965 +const ( + // MediaTypeImageLayerNonDistributable is the media type for layers referenced by + // the manifest but with distribution restrictions. + // + // Deprecated: Non-distributable layers are deprecated, and not recommended + // for future use. Implementations SHOULD NOT produce new non-distributable + // layers. + // https://github.com/opencontainers/image-spec/pull/965 + MediaTypeImageLayerNonDistributable = "application/vnd.oci.image.layer.nondistributable.v1.tar" + + // MediaTypeImageLayerNonDistributableGzip is the media type for + // gzipped layers referenced by the manifest but with distribution + // restrictions. + // + // Deprecated: Non-distributable layers are deprecated, and not recommended + // for future use. Implementations SHOULD NOT produce new non-distributable + // layers. + // https://github.com/opencontainers/image-spec/pull/965 + MediaTypeImageLayerNonDistributableGzip = "application/vnd.oci.image.layer.nondistributable.v1.tar+gzip" + + // MediaTypeImageLayerNonDistributableZstd is the media type for zstd + // compressed layers referenced by the manifest but with distribution + // restrictions. + // + // Deprecated: Non-distributable layers are deprecated, and not recommended + // for future use. Implementations SHOULD NOT produce new non-distributable + // layers. + // https://github.com/opencontainers/image-spec/pull/965 + MediaTypeImageLayerNonDistributableZstd = "application/vnd.oci.image.layer.nondistributable.v1.tar+zstd" +) diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/sort.go b/e2e/vendor/github.com/opencontainers/image-spec/specs-go/version.go similarity index 50% rename from e2e/vendor/go.etcd.io/etcd/client/v3/sort.go rename to e2e/vendor/github.com/opencontainers/image-spec/specs-go/version.go index 2bb9d9a13..c3897c7ca 100644 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/sort.go +++ b/e2e/vendor/github.com/opencontainers/image-spec/specs-go/version.go @@ -1,4 +1,4 @@ -// Copyright 2016 The etcd Authors +// Copyright 2016 The Linux Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,26 +12,21 @@ // See the License for the specific language governing permissions and // limitations under the License. -package clientv3 +package specs -type SortTarget int -type SortOrder int +import "fmt" const ( - SortNone SortOrder = iota - SortAscend - SortDescend + // VersionMajor is for an API incompatible changes + VersionMajor = 1 + // VersionMinor is for functionality in a backwards-compatible manner + VersionMinor = 1 + // VersionPatch is for backwards-compatible bug fixes + VersionPatch = 1 + + // VersionDev indicates development branch. Releases will be empty string. + VersionDev = "" ) -const ( - SortByKey SortTarget = iota - SortByVersion - SortByCreateRevision - SortByModRevision - SortByValue -) - -type SortOption struct { - Target SortTarget - Order SortOrder -} +// Version is the specification version that the package types support. +var Version = fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionDev) diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_unsupported.go b/e2e/vendor/github.com/opencontainers/image-spec/specs-go/versioned.go similarity index 59% rename from e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_unsupported.go rename to e2e/vendor/github.com/opencontainers/image-spec/specs-go/versioned.go index 2c46dd490..58a1510f3 100644 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_unsupported.go +++ b/e2e/vendor/github.com/opencontainers/image-spec/specs-go/versioned.go @@ -1,4 +1,4 @@ -// Copyright 2015 The etcd Authors +// Copyright 2016 The Linux Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,15 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build !linux && !darwin -// +build !linux,!darwin +package specs -package fileutil - -import "os" - -func preallocExtend(f *os.File, sizeInBytes int64) error { - return preallocExtendTrunc(f, sizeInBytes) +// Versioned provides a struct with the manifest schemaVersion and mediaType. +// Incoming content with unknown schema version can be decoded against this +// struct to check the version. +type Versioned struct { + // SchemaVersion is the image manifest schema that this image follows + SchemaVersion int `json:"schemaVersion"` } - -func preallocFixed(f *os.File, sizeInBytes int64) error { return nil } diff --git a/e2e/vendor/github.com/opencontainers/runc/NOTICE b/e2e/vendor/github.com/opencontainers/runc/NOTICE deleted file mode 100644 index c29775c0d..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/NOTICE +++ /dev/null @@ -1,17 +0,0 @@ -runc - -Copyright 2012-2015 Docker, Inc. - -This product includes software developed at Docker, Inc. (http://www.docker.com). - -The following is courtesy of our legal counsel: - - -Use and transfer of Docker may be subject to certain restrictions by the -United States and other governments. -It is your responsibility to ensure that your use and/or transfer does not -violate applicable laws. - -For more information, please see http://www.bis.doc.gov - -See also http://www.apache.org/dev/crypto.html and/or seek legal counsel. diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/config.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/config.go deleted file mode 100644 index 22fe0f9b4..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/config.go +++ /dev/null @@ -1,508 +0,0 @@ -package configs - -import ( - "bytes" - "encoding/json" - "fmt" - "os/exec" - "time" - - "github.com/sirupsen/logrus" - "golang.org/x/sys/unix" - - "github.com/opencontainers/runc/libcontainer/devices" - "github.com/opencontainers/runtime-spec/specs-go" -) - -type Rlimit struct { - Type int `json:"type"` - Hard uint64 `json:"hard"` - Soft uint64 `json:"soft"` -} - -// IDMap represents UID/GID Mappings for User Namespaces. -type IDMap struct { - ContainerID int64 `json:"container_id"` - HostID int64 `json:"host_id"` - Size int64 `json:"size"` -} - -// Seccomp represents syscall restrictions -// By default, only the native architecture of the kernel is allowed to be used -// for syscalls. Additional architectures can be added by specifying them in -// Architectures. -type Seccomp struct { - DefaultAction Action `json:"default_action"` - Architectures []string `json:"architectures"` - Flags []specs.LinuxSeccompFlag `json:"flags"` - Syscalls []*Syscall `json:"syscalls"` - DefaultErrnoRet *uint `json:"default_errno_ret"` - ListenerPath string `json:"listener_path,omitempty"` - ListenerMetadata string `json:"listener_metadata,omitempty"` -} - -// Action is taken upon rule match in Seccomp -type Action int - -const ( - Kill Action = iota + 1 - Errno - Trap - Allow - Trace - Log - Notify - KillThread - KillProcess -) - -// Operator is a comparison operator to be used when matching syscall arguments in Seccomp -type Operator int - -const ( - EqualTo Operator = iota + 1 - NotEqualTo - GreaterThan - GreaterThanOrEqualTo - LessThan - LessThanOrEqualTo - MaskEqualTo -) - -// Arg is a rule to match a specific syscall argument in Seccomp -type Arg struct { - Index uint `json:"index"` - Value uint64 `json:"value"` - ValueTwo uint64 `json:"value_two"` - Op Operator `json:"op"` -} - -// Syscall is a rule to match a syscall in Seccomp -type Syscall struct { - Name string `json:"name"` - Action Action `json:"action"` - ErrnoRet *uint `json:"errnoRet"` - Args []*Arg `json:"args"` -} - -// Config defines configuration options for executing a process inside a contained environment. -type Config struct { - // NoPivotRoot will use MS_MOVE and a chroot to jail the process into the container's rootfs - // This is a common option when the container is running in ramdisk - NoPivotRoot bool `json:"no_pivot_root"` - - // ParentDeathSignal specifies the signal that is sent to the container's process in the case - // that the parent process dies. - ParentDeathSignal int `json:"parent_death_signal"` - - // Path to a directory containing the container's root filesystem. - Rootfs string `json:"rootfs"` - - // Umask is the umask to use inside of the container. - Umask *uint32 `json:"umask"` - - // Readonlyfs will remount the container's rootfs as readonly where only externally mounted - // bind mounts are writtable. - Readonlyfs bool `json:"readonlyfs"` - - // Specifies the mount propagation flags to be applied to /. - RootPropagation int `json:"rootPropagation"` - - // Mounts specify additional source and destination paths that will be mounted inside the container's - // rootfs and mount namespace if specified - Mounts []*Mount `json:"mounts"` - - // The device nodes that should be automatically created within the container upon container start. Note, make sure that the node is marked as allowed in the cgroup as well! - Devices []*devices.Device `json:"devices"` - - MountLabel string `json:"mount_label"` - - // Hostname optionally sets the container's hostname if provided - Hostname string `json:"hostname"` - - // Domainname optionally sets the container's domainname if provided - Domainname string `json:"domainname"` - - // Namespaces specifies the container's namespaces that it should setup when cloning the init process - // If a namespace is not provided that namespace is shared from the container's parent process - Namespaces Namespaces `json:"namespaces"` - - // Capabilities specify the capabilities to keep when executing the process inside the container - // All capabilities not specified will be dropped from the processes capability mask - Capabilities *Capabilities `json:"capabilities"` - - // Networks specifies the container's network setup to be created - Networks []*Network `json:"networks"` - - // Routes can be specified to create entries in the route table as the container is started - Routes []*Route `json:"routes"` - - // Cgroups specifies specific cgroup settings for the various subsystems that the container is - // placed into to limit the resources the container has available - Cgroups *Cgroup `json:"cgroups"` - - // AppArmorProfile specifies the profile to apply to the process running in the container and is - // change at the time the process is execed - AppArmorProfile string `json:"apparmor_profile,omitempty"` - - // ProcessLabel specifies the label to apply to the process running in the container. It is - // commonly used by selinux - ProcessLabel string `json:"process_label,omitempty"` - - // Rlimits specifies the resource limits, such as max open files, to set in the container - // If Rlimits are not set, the container will inherit rlimits from the parent process - Rlimits []Rlimit `json:"rlimits,omitempty"` - - // OomScoreAdj specifies the adjustment to be made by the kernel when calculating oom scores - // for a process. Valid values are between the range [-1000, '1000'], where processes with - // higher scores are preferred for being killed. If it is unset then we don't touch the current - // value. - // More information about kernel oom score calculation here: https://lwn.net/Articles/317814/ - OomScoreAdj *int `json:"oom_score_adj,omitempty"` - - // UIDMappings is an array of User ID mappings for User Namespaces - UIDMappings []IDMap `json:"uid_mappings"` - - // GIDMappings is an array of Group ID mappings for User Namespaces - GIDMappings []IDMap `json:"gid_mappings"` - - // MaskPaths specifies paths within the container's rootfs to mask over with a bind - // mount pointing to /dev/null as to prevent reads of the file. - MaskPaths []string `json:"mask_paths"` - - // ReadonlyPaths specifies paths within the container's rootfs to remount as read-only - // so that these files prevent any writes. - ReadonlyPaths []string `json:"readonly_paths"` - - // Sysctl is a map of properties and their values. It is the equivalent of using - // sysctl -w my.property.name value in Linux. - Sysctl map[string]string `json:"sysctl"` - - // Seccomp allows actions to be taken whenever a syscall is made within the container. - // A number of rules are given, each having an action to be taken if a syscall matches it. - // A default action to be taken if no rules match is also given. - Seccomp *Seccomp `json:"seccomp"` - - // NoNewPrivileges controls whether processes in the container can gain additional privileges. - NoNewPrivileges bool `json:"no_new_privileges,omitempty"` - - // Hooks are a collection of actions to perform at various container lifecycle events. - // CommandHooks are serialized to JSON, but other hooks are not. - Hooks Hooks - - // Version is the version of opencontainer specification that is supported. - Version string `json:"version"` - - // Labels are user defined metadata that is stored in the config and populated on the state - Labels []string `json:"labels"` - - // NoNewKeyring will not allocated a new session keyring for the container. It will use the - // callers keyring in this case. - NoNewKeyring bool `json:"no_new_keyring"` - - // IntelRdt specifies settings for Intel RDT group that the container is placed into - // to limit the resources (e.g., L3 cache, memory bandwidth) the container has available - IntelRdt *IntelRdt `json:"intel_rdt,omitempty"` - - // RootlessEUID is set when the runc was launched with non-zero EUID. - // Note that RootlessEUID is set to false when launched with EUID=0 in userns. - // When RootlessEUID is set, runc creates a new userns for the container. - // (config.json needs to contain userns settings) - RootlessEUID bool `json:"rootless_euid,omitempty"` - - // RootlessCgroups is set when unlikely to have the full access to cgroups. - // When RootlessCgroups is set, cgroups errors are ignored. - RootlessCgroups bool `json:"rootless_cgroups,omitempty"` - - // TimeOffsets specifies the offset for supporting time namespaces. - TimeOffsets map[string]specs.LinuxTimeOffset `json:"time_offsets,omitempty"` - - // Scheduler represents the scheduling attributes for a process. - Scheduler *Scheduler `json:"scheduler,omitempty"` - - // Personality contains configuration for the Linux personality syscall. - Personality *LinuxPersonality `json:"personality,omitempty"` - - // IOPriority is the container's I/O priority. - IOPriority *IOPriority `json:"io_priority,omitempty"` -} - -// Scheduler is based on the Linux sched_setattr(2) syscall. -type Scheduler = specs.Scheduler - -// ToSchedAttr is to convert *configs.Scheduler to *unix.SchedAttr. -func ToSchedAttr(scheduler *Scheduler) (*unix.SchedAttr, error) { - var policy uint32 - switch scheduler.Policy { - case specs.SchedOther: - policy = 0 - case specs.SchedFIFO: - policy = 1 - case specs.SchedRR: - policy = 2 - case specs.SchedBatch: - policy = 3 - case specs.SchedISO: - policy = 4 - case specs.SchedIdle: - policy = 5 - case specs.SchedDeadline: - policy = 6 - default: - return nil, fmt.Errorf("invalid scheduler policy: %s", scheduler.Policy) - } - - var flags uint64 - for _, flag := range scheduler.Flags { - switch flag { - case specs.SchedFlagResetOnFork: - flags |= 0x01 - case specs.SchedFlagReclaim: - flags |= 0x02 - case specs.SchedFlagDLOverrun: - flags |= 0x04 - case specs.SchedFlagKeepPolicy: - flags |= 0x08 - case specs.SchedFlagKeepParams: - flags |= 0x10 - case specs.SchedFlagUtilClampMin: - flags |= 0x20 - case specs.SchedFlagUtilClampMax: - flags |= 0x40 - default: - return nil, fmt.Errorf("invalid scheduler flag: %s", flag) - } - } - - return &unix.SchedAttr{ - Size: unix.SizeofSchedAttr, - Policy: policy, - Flags: flags, - Nice: scheduler.Nice, - Priority: uint32(scheduler.Priority), - Runtime: scheduler.Runtime, - Deadline: scheduler.Deadline, - Period: scheduler.Period, - }, nil -} - -var IOPrioClassMapping = map[specs.IOPriorityClass]int{ - specs.IOPRIO_CLASS_RT: 1, - specs.IOPRIO_CLASS_BE: 2, - specs.IOPRIO_CLASS_IDLE: 3, -} - -type IOPriority = specs.LinuxIOPriority - -type ( - HookName string - HookList []Hook - Hooks map[HookName]HookList -) - -const ( - // Prestart commands are executed after the container namespaces are created, - // but before the user supplied command is executed from init. - // Note: This hook is now deprecated - // Prestart commands are called in the Runtime namespace. - Prestart HookName = "prestart" - - // CreateRuntime commands MUST be called as part of the create operation after - // the runtime environment has been created but before the pivot_root has been executed. - // CreateRuntime is called immediately after the deprecated Prestart hook. - // CreateRuntime commands are called in the Runtime Namespace. - CreateRuntime HookName = "createRuntime" - - // CreateContainer commands MUST be called as part of the create operation after - // the runtime environment has been created but before the pivot_root has been executed. - // CreateContainer commands are called in the Container namespace. - CreateContainer HookName = "createContainer" - - // StartContainer commands MUST be called as part of the start operation and before - // the container process is started. - // StartContainer commands are called in the Container namespace. - StartContainer HookName = "startContainer" - - // Poststart commands are executed after the container init process starts. - // Poststart commands are called in the Runtime Namespace. - Poststart HookName = "poststart" - - // Poststop commands are executed after the container init process exits. - // Poststop commands are called in the Runtime Namespace. - Poststop HookName = "poststop" -) - -// KnownHookNames returns the known hook names. -// Used by `runc features`. -func KnownHookNames() []string { - return []string{ - string(Prestart), // deprecated - string(CreateRuntime), - string(CreateContainer), - string(StartContainer), - string(Poststart), - string(Poststop), - } -} - -type Capabilities struct { - // Bounding is the set of capabilities checked by the kernel. - Bounding []string - // Effective is the set of capabilities checked by the kernel. - Effective []string - // Inheritable is the capabilities preserved across execve. - Inheritable []string - // Permitted is the limiting superset for effective capabilities. - Permitted []string - // Ambient is the ambient set of capabilities that are kept. - Ambient []string -} - -// Deprecated: use (Hooks).Run instead. -func (hooks HookList) RunHooks(state *specs.State) error { - for i, h := range hooks { - if err := h.Run(state); err != nil { - return fmt.Errorf("error running hook #%d: %w", i, err) - } - } - - return nil -} - -func (hooks *Hooks) UnmarshalJSON(b []byte) error { - var state map[HookName][]CommandHook - - if err := json.Unmarshal(b, &state); err != nil { - return err - } - - *hooks = Hooks{} - for n, commandHooks := range state { - if len(commandHooks) == 0 { - continue - } - - (*hooks)[n] = HookList{} - for _, h := range commandHooks { - (*hooks)[n] = append((*hooks)[n], h) - } - } - - return nil -} - -func (hooks *Hooks) MarshalJSON() ([]byte, error) { - serialize := func(hooks []Hook) (serializableHooks []CommandHook) { - for _, hook := range hooks { - switch chook := hook.(type) { - case CommandHook: - serializableHooks = append(serializableHooks, chook) - default: - logrus.Warnf("cannot serialize hook of type %T, skipping", hook) - } - } - - return serializableHooks - } - - return json.Marshal(map[string]interface{}{ - "prestart": serialize((*hooks)[Prestart]), - "createRuntime": serialize((*hooks)[CreateRuntime]), - "createContainer": serialize((*hooks)[CreateContainer]), - "startContainer": serialize((*hooks)[StartContainer]), - "poststart": serialize((*hooks)[Poststart]), - "poststop": serialize((*hooks)[Poststop]), - }) -} - -// Run executes all hooks for the given hook name. -func (hooks Hooks) Run(name HookName, state *specs.State) error { - list := hooks[name] - for i, h := range list { - if err := h.Run(state); err != nil { - return fmt.Errorf("error running %s hook #%d: %w", name, i, err) - } - } - - return nil -} - -type Hook interface { - // Run executes the hook with the provided state. - Run(*specs.State) error -} - -// NewFunctionHook will call the provided function when the hook is run. -func NewFunctionHook(f func(*specs.State) error) FuncHook { - return FuncHook{ - run: f, - } -} - -type FuncHook struct { - run func(*specs.State) error -} - -func (f FuncHook) Run(s *specs.State) error { - return f.run(s) -} - -type Command struct { - Path string `json:"path"` - Args []string `json:"args"` - Env []string `json:"env"` - Dir string `json:"dir"` - Timeout *time.Duration `json:"timeout"` -} - -// NewCommandHook will execute the provided command when the hook is run. -func NewCommandHook(cmd Command) CommandHook { - return CommandHook{ - Command: cmd, - } -} - -type CommandHook struct { - Command -} - -func (c Command) Run(s *specs.State) error { - b, err := json.Marshal(s) - if err != nil { - return err - } - var stdout, stderr bytes.Buffer - cmd := exec.Cmd{ - Path: c.Path, - Args: c.Args, - Env: c.Env, - Stdin: bytes.NewReader(b), - Stdout: &stdout, - Stderr: &stderr, - } - if err := cmd.Start(); err != nil { - return err - } - errC := make(chan error, 1) - go func() { - err := cmd.Wait() - if err != nil { - err = fmt.Errorf("%w, stdout: %s, stderr: %s", err, stdout.String(), stderr.String()) - } - errC <- err - }() - var timerCh <-chan time.Time - if c.Timeout != nil { - timer := time.NewTimer(*c.Timeout) - defer timer.Stop() - timerCh = timer.C - } - select { - case err := <-errC: - return err - case <-timerCh: - _ = cmd.Process.Kill() - <-errC - return fmt.Errorf("hook ran past specified timeout of %.1fs", c.Timeout.Seconds()) - } -} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/config_linux.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/config_linux.go deleted file mode 100644 index e401f5331..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/config_linux.go +++ /dev/null @@ -1,97 +0,0 @@ -package configs - -import ( - "errors" - "fmt" - "math" -) - -var ( - errNoUIDMap = errors.New("user namespaces enabled, but no uid mappings found") - errNoGIDMap = errors.New("user namespaces enabled, but no gid mappings found") -) - -// Please check https://man7.org/linux/man-pages/man2/personality.2.html for const details. -// https://raw.githubusercontent.com/torvalds/linux/master/include/uapi/linux/personality.h -const ( - PerLinux = 0x0000 - PerLinux32 = 0x0008 -) - -type LinuxPersonality struct { - // Domain for the personality - // can only contain values "LINUX" and "LINUX32" - Domain int `json:"domain"` -} - -// HostUID gets the translated uid for the process on host which could be -// different when user namespaces are enabled. -func (c Config) HostUID(containerId int) (int, error) { - if c.Namespaces.Contains(NEWUSER) { - if len(c.UIDMappings) == 0 { - return -1, errNoUIDMap - } - id, found := c.hostIDFromMapping(int64(containerId), c.UIDMappings) - if !found { - return -1, fmt.Errorf("user namespaces enabled, but no mapping found for uid %d", containerId) - } - // If we are a 32-bit binary running on a 64-bit system, it's possible - // the mapped user is too large to store in an int, which means we - // cannot do the mapping. We can't just return an int64, because - // os.Setuid() takes an int. - if id > math.MaxInt { - return -1, fmt.Errorf("mapping for uid %d (host id %d) is larger than native integer size (%d)", containerId, id, math.MaxInt) - } - return int(id), nil - } - // Return unchanged id. - return containerId, nil -} - -// HostRootUID gets the root uid for the process on host which could be non-zero -// when user namespaces are enabled. -func (c Config) HostRootUID() (int, error) { - return c.HostUID(0) -} - -// HostGID gets the translated gid for the process on host which could be -// different when user namespaces are enabled. -func (c Config) HostGID(containerId int) (int, error) { - if c.Namespaces.Contains(NEWUSER) { - if len(c.GIDMappings) == 0 { - return -1, errNoGIDMap - } - id, found := c.hostIDFromMapping(int64(containerId), c.GIDMappings) - if !found { - return -1, fmt.Errorf("user namespaces enabled, but no mapping found for gid %d", containerId) - } - // If we are a 32-bit binary running on a 64-bit system, it's possible - // the mapped user is too large to store in an int, which means we - // cannot do the mapping. We can't just return an int64, because - // os.Setgid() takes an int. - if id > math.MaxInt { - return -1, fmt.Errorf("mapping for gid %d (host id %d) is larger than native integer size (%d)", containerId, id, math.MaxInt) - } - return int(id), nil - } - // Return unchanged id. - return containerId, nil -} - -// HostRootGID gets the root gid for the process on host which could be non-zero -// when user namespaces are enabled. -func (c Config) HostRootGID() (int, error) { - return c.HostGID(0) -} - -// Utility function that gets a host ID for a container ID from user namespace map -// if that ID is present in the map. -func (c Config) hostIDFromMapping(containerID int64, uMap []IDMap) (int64, bool) { - for _, m := range uMap { - if (containerID >= m.ContainerID) && (containerID <= (m.ContainerID + m.Size - 1)) { - hostID := m.HostID + (containerID - m.ContainerID) - return hostID, true - } - } - return -1, false -} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/configs_fuzzer.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/configs_fuzzer.go deleted file mode 100644 index 1fd87ce6a..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/configs_fuzzer.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build gofuzz - -package configs - -func FuzzUnmarshalJSON(data []byte) int { - hooks := Hooks{} - _ = hooks.UnmarshalJSON(data) - return 1 -} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/intelrdt.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/intelrdt.go deleted file mode 100644 index f8d951ab8..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/intelrdt.go +++ /dev/null @@ -1,16 +0,0 @@ -package configs - -type IntelRdt struct { - // The identity for RDT Class of Service - ClosID string `json:"closID,omitempty"` - - // The schema for L3 cache id and capacity bitmask (CBM) - // Format: "L3:=;=;..." - L3CacheSchema string `json:"l3_cache_schema,omitempty"` - - // The schema of memory bandwidth per L3 cache id - // Format: "MB:=bandwidth0;=bandwidth1;..." - // The unit of memory bandwidth is specified in "percentages" by - // default, and in "MBps" if MBA Software Controller is enabled. - MemBwSchema string `json:"memBwSchema,omitempty"` -} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/mount.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/mount.go deleted file mode 100644 index bfd356e49..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/mount.go +++ /dev/null @@ -1,7 +0,0 @@ -package configs - -const ( - // EXT_COPYUP is a directive to copy up the contents of a directory when - // a tmpfs is mounted over it. - EXT_COPYUP = 1 << iota //nolint:golint,revive // ignore "don't use ALL_CAPS" warning -) diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/mount_linux.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/mount_linux.go deleted file mode 100644 index b69e9ab23..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/mount_linux.go +++ /dev/null @@ -1,66 +0,0 @@ -package configs - -import "golang.org/x/sys/unix" - -type MountIDMapping struct { - // Recursive indicates if the mapping needs to be recursive. - Recursive bool `json:"recursive"` - - // UserNSPath is a path to a user namespace that indicates the necessary - // id-mappings for MOUNT_ATTR_IDMAP. If set to non-"", UIDMappings and - // GIDMappings must be set to nil. - UserNSPath string `json:"userns_path,omitempty"` - - // UIDMappings is the uid mapping set for this mount, to be used with - // MOUNT_ATTR_IDMAP. - UIDMappings []IDMap `json:"uid_mappings,omitempty"` - - // GIDMappings is the gid mapping set for this mount, to be used with - // MOUNT_ATTR_IDMAP. - GIDMappings []IDMap `json:"gid_mappings,omitempty"` -} - -type Mount struct { - // Source path for the mount. - Source string `json:"source"` - - // Destination path for the mount inside the container. - Destination string `json:"destination"` - - // Device the mount is for. - Device string `json:"device"` - - // Mount flags. - Flags int `json:"flags"` - - // Mount flags that were explicitly cleared in the configuration (meaning - // the user explicitly requested that these flags *not* be set). - ClearedFlags int `json:"cleared_flags"` - - // Propagation Flags - PropagationFlags []int `json:"propagation_flags"` - - // Mount data applied to the mount. - Data string `json:"data"` - - // Relabel source if set, "z" indicates shared, "Z" indicates unshared. - Relabel string `json:"relabel"` - - // RecAttr represents mount properties to be applied recursively (AT_RECURSIVE), see mount_setattr(2). - RecAttr *unix.MountAttr `json:"rec_attr"` - - // Extensions are additional flags that are specific to runc. - Extensions int `json:"extensions"` - - // Mapping is the MOUNT_ATTR_IDMAP configuration for the mount. If non-nil, - // the mount is configured to use MOUNT_ATTR_IDMAP-style id mappings. - IDMapping *MountIDMapping `json:"id_mapping,omitempty"` -} - -func (m *Mount) IsBind() bool { - return m.Flags&unix.MS_BIND != 0 -} - -func (m *Mount) IsIDMapped() bool { - return m.IDMapping != nil -} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/mount_unsupported.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/mount_unsupported.go deleted file mode 100644 index 1d4d9fe52..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/mount_unsupported.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build !linux - -package configs - -type Mount struct{} - -func (m *Mount) IsBind() bool { - return false -} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces.go deleted file mode 100644 index a3329a31a..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces.go +++ /dev/null @@ -1,5 +0,0 @@ -package configs - -type NamespaceType string - -type Namespaces []Namespace diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_linux.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_linux.go deleted file mode 100644 index 898f96fd0..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_linux.go +++ /dev/null @@ -1,133 +0,0 @@ -package configs - -import ( - "fmt" - "os" - "sync" -) - -const ( - NEWNET NamespaceType = "NEWNET" - NEWPID NamespaceType = "NEWPID" - NEWNS NamespaceType = "NEWNS" - NEWUTS NamespaceType = "NEWUTS" - NEWIPC NamespaceType = "NEWIPC" - NEWUSER NamespaceType = "NEWUSER" - NEWCGROUP NamespaceType = "NEWCGROUP" - NEWTIME NamespaceType = "NEWTIME" -) - -var ( - nsLock sync.Mutex - supportedNamespaces = make(map[NamespaceType]bool) -) - -// NsName converts the namespace type to its filename -func NsName(ns NamespaceType) string { - switch ns { - case NEWNET: - return "net" - case NEWNS: - return "mnt" - case NEWPID: - return "pid" - case NEWIPC: - return "ipc" - case NEWUSER: - return "user" - case NEWUTS: - return "uts" - case NEWCGROUP: - return "cgroup" - case NEWTIME: - return "time" - } - return "" -} - -// IsNamespaceSupported returns whether a namespace is available or -// not -func IsNamespaceSupported(ns NamespaceType) bool { - nsLock.Lock() - defer nsLock.Unlock() - supported, ok := supportedNamespaces[ns] - if ok { - return supported - } - nsFile := NsName(ns) - // if the namespace type is unknown, just return false - if nsFile == "" { - return false - } - // We don't need to use /proc/thread-self here because the list of - // namespace types is unrelated to the thread. This lets us avoid having to - // do runtime.LockOSThread. - _, err := os.Stat("/proc/self/ns/" + nsFile) - // a namespace is supported if it exists and we have permissions to read it - supported = err == nil - supportedNamespaces[ns] = supported - return supported -} - -func NamespaceTypes() []NamespaceType { - return []NamespaceType{ - NEWUSER, // Keep user NS always first, don't move it. - NEWIPC, - NEWUTS, - NEWNET, - NEWPID, - NEWNS, - NEWCGROUP, - NEWTIME, - } -} - -// Namespace defines configuration for each namespace. It specifies an -// alternate path that is able to be joined via setns. -type Namespace struct { - Type NamespaceType `json:"type"` - Path string `json:"path"` -} - -func (n *Namespace) GetPath(pid int) string { - return fmt.Sprintf("/proc/%d/ns/%s", pid, NsName(n.Type)) -} - -func (n *Namespaces) Remove(t NamespaceType) bool { - i := n.index(t) - if i == -1 { - return false - } - *n = append((*n)[:i], (*n)[i+1:]...) - return true -} - -func (n *Namespaces) Add(t NamespaceType, path string) { - i := n.index(t) - if i == -1 { - *n = append(*n, Namespace{Type: t, Path: path}) - return - } - (*n)[i].Path = path -} - -func (n *Namespaces) index(t NamespaceType) int { - for i, ns := range *n { - if ns.Type == t { - return i - } - } - return -1 -} - -func (n *Namespaces) Contains(t NamespaceType) bool { - return n.index(t) != -1 -} - -func (n *Namespaces) PathOf(t NamespaceType) string { - i := n.index(t) - if i == -1 { - return "" - } - return (*n)[i].Path -} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_syscall.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_syscall.go deleted file mode 100644 index 26b70b26f..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_syscall.go +++ /dev/null @@ -1,45 +0,0 @@ -//go:build linux - -package configs - -import "golang.org/x/sys/unix" - -func (n *Namespace) Syscall() int { - return namespaceInfo[n.Type] -} - -var namespaceInfo = map[NamespaceType]int{ - NEWNET: unix.CLONE_NEWNET, - NEWNS: unix.CLONE_NEWNS, - NEWUSER: unix.CLONE_NEWUSER, - NEWIPC: unix.CLONE_NEWIPC, - NEWUTS: unix.CLONE_NEWUTS, - NEWPID: unix.CLONE_NEWPID, - NEWCGROUP: unix.CLONE_NEWCGROUP, - NEWTIME: unix.CLONE_NEWTIME, -} - -// CloneFlags parses the container's Namespaces options to set the correct -// flags on clone, unshare. This function returns flags only for new namespaces. -func (n *Namespaces) CloneFlags() uintptr { - var flag int - for _, v := range *n { - if v.Path != "" { - continue - } - flag |= namespaceInfo[v.Type] - } - return uintptr(flag) -} - -// IsPrivate tells whether the namespace of type t is configured as private -// (i.e. it exists and is not shared). -func (n Namespaces) IsPrivate(t NamespaceType) bool { - for _, v := range n { - if v.Type == t { - return v.Path == "" - } - } - // Not found, so implicitly sharing a parent namespace. - return false -} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_syscall_unsupported.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_syscall_unsupported.go deleted file mode 100644 index 10bf24365..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_syscall_unsupported.go +++ /dev/null @@ -1,13 +0,0 @@ -//go:build !linux && !windows - -package configs - -func (n *Namespace) Syscall() int { - panic("No namespace syscall support") -} - -// CloneFlags parses the container's Namespaces options to set the correct -// flags on clone, unshare. This function returns flags only for new namespaces. -func (n *Namespaces) CloneFlags() uintptr { - panic("No namespace syscall support") -} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_unsupported.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_unsupported.go deleted file mode 100644 index 914684993..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/namespaces_unsupported.go +++ /dev/null @@ -1,7 +0,0 @@ -//go:build !linux - -package configs - -// Namespace defines configuration for each namespace. It specifies an -// alternate path that is able to be joined via setns. -type Namespace struct{} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/network.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/network.go deleted file mode 100644 index c44c3ea71..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/configs/network.go +++ /dev/null @@ -1,75 +0,0 @@ -package configs - -// Network defines configuration for a container's networking stack -// -// The network configuration can be omitted from a container causing the -// container to be setup with the host's networking stack -type Network struct { - // Type sets the networks type, commonly veth and loopback - Type string `json:"type"` - - // Name of the network interface - Name string `json:"name"` - - // The bridge to use. - Bridge string `json:"bridge"` - - // MacAddress contains the MAC address to set on the network interface - MacAddress string `json:"mac_address"` - - // Address contains the IPv4 and mask to set on the network interface - Address string `json:"address"` - - // Gateway sets the gateway address that is used as the default for the interface - Gateway string `json:"gateway"` - - // IPv6Address contains the IPv6 and mask to set on the network interface - IPv6Address string `json:"ipv6_address"` - - // IPv6Gateway sets the ipv6 gateway address that is used as the default for the interface - IPv6Gateway string `json:"ipv6_gateway"` - - // Mtu sets the mtu value for the interface and will be mirrored on both the host and - // container's interfaces if a pair is created, specifically in the case of type veth - // Note: This does not apply to loopback interfaces. - Mtu int `json:"mtu"` - - // TxQueueLen sets the tx_queuelen value for the interface and will be mirrored on both the host and - // container's interfaces if a pair is created, specifically in the case of type veth - // Note: This does not apply to loopback interfaces. - TxQueueLen int `json:"txqueuelen"` - - // HostInterfaceName is a unique name of a veth pair that resides on in the host interface of the - // container. - HostInterfaceName string `json:"host_interface_name"` - - // HairpinMode specifies if hairpin NAT should be enabled on the virtual interface - // bridge port in the case of type veth - // Note: This is unsupported on some systems. - // Note: This does not apply to loopback interfaces. - HairpinMode bool `json:"hairpin_mode"` -} - -// Route defines a routing table entry. -// -// Routes can be specified to create entries in the routing table as the container -// is started. -// -// All of destination, source, and gateway should be either IPv4 or IPv6. -// One of the three options must be present, and omitted entries will use their -// IP family default for the route table. For IPv4 for example, setting the -// gateway to 1.2.3.4 and the interface to eth0 will set up a standard -// destination of 0.0.0.0(or *) when viewed in the route table. -type Route struct { - // Destination specifies the destination IP address and mask in the CIDR form. - Destination string `json:"destination"` - - // Source specifies the source IP address and mask in the CIDR form. - Source string `json:"source"` - - // Gateway specifies the gateway IP address. - Gateway string `json:"gateway"` - - // InterfaceName specifies the device to set this route up for, for example eth0. - InterfaceName string `json:"interface_name"` -} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/devices/device_unix.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/devices/device_unix.go deleted file mode 100644 index d00775f51..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/devices/device_unix.go +++ /dev/null @@ -1,119 +0,0 @@ -//go:build !windows - -package devices - -import ( - "errors" - "os" - "path/filepath" - - "golang.org/x/sys/unix" -) - -// ErrNotADevice denotes that a file is not a valid linux device. -var ErrNotADevice = errors.New("not a device node") - -// Testing dependencies -var ( - unixLstat = unix.Lstat - osReadDir = os.ReadDir -) - -func mkDev(d *Rule) (uint64, error) { - if d.Major == Wildcard || d.Minor == Wildcard { - return 0, errors.New("cannot mkdev() device with wildcards") - } - return unix.Mkdev(uint32(d.Major), uint32(d.Minor)), nil -} - -// DeviceFromPath takes the path to a device and its cgroup_permissions (which -// cannot be easily queried) to look up the information about a linux device -// and returns that information as a Device struct. -func DeviceFromPath(path, permissions string) (*Device, error) { - var stat unix.Stat_t - err := unixLstat(path, &stat) - if err != nil { - return nil, err - } - - var ( - devType Type - mode = stat.Mode - devNumber = uint64(stat.Rdev) //nolint:unconvert // Rdev is uint32 on e.g. MIPS. - major = unix.Major(devNumber) - minor = unix.Minor(devNumber) - ) - switch mode & unix.S_IFMT { - case unix.S_IFBLK: - devType = BlockDevice - case unix.S_IFCHR: - devType = CharDevice - case unix.S_IFIFO: - devType = FifoDevice - default: - return nil, ErrNotADevice - } - return &Device{ - Rule: Rule{ - Type: devType, - Major: int64(major), - Minor: int64(minor), - Permissions: Permissions(permissions), - }, - Path: path, - FileMode: os.FileMode(mode &^ unix.S_IFMT), - Uid: stat.Uid, - Gid: stat.Gid, - }, nil -} - -// HostDevices returns all devices that can be found under /dev directory. -func HostDevices() ([]*Device, error) { - return GetDevices("/dev") -} - -// GetDevices recursively traverses a directory specified by path -// and returns all devices found there. -func GetDevices(path string) ([]*Device, error) { - files, err := osReadDir(path) - if err != nil { - return nil, err - } - var out []*Device - for _, f := range files { - switch { - case f.IsDir(): - switch f.Name() { - // ".lxc" & ".lxd-mounts" added to address https://github.com/lxc/lxd/issues/2825 - // ".udev" added to address https://github.com/opencontainers/runc/issues/2093 - case "pts", "shm", "fd", "mqueue", ".lxc", ".lxd-mounts", ".udev": - continue - default: - sub, err := GetDevices(filepath.Join(path, f.Name())) - if err != nil { - return nil, err - } - - out = append(out, sub...) - continue - } - case f.Name() == "console": - continue - } - device, err := DeviceFromPath(filepath.Join(path, f.Name()), "rwm") - if err != nil { - if errors.Is(err, ErrNotADevice) { - continue - } - if os.IsNotExist(err) { - continue - } - return nil, err - } - if device.Type == FifoDevice { - continue - } - out = append(out, device) - } - return out, nil -} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/cmt.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/cmt.go deleted file mode 100644 index 6480a1306..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/cmt.go +++ /dev/null @@ -1,23 +0,0 @@ -package intelrdt - -var cmtEnabled bool - -// Check if Intel RDT/CMT is enabled. -func IsCMTEnabled() bool { - featuresInit() - return cmtEnabled -} - -func getCMTNumaNodeStats(numaPath string) (*CMTNumaNodeStats, error) { - stats := &CMTNumaNodeStats{} - - if enabledMonFeatures.llcOccupancy { - llcOccupancy, err := getIntelRdtParamUint(numaPath, "llc_occupancy") - if err != nil { - return nil, err - } - stats.LLCOccupancy = llcOccupancy - } - - return stats, nil -} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/intelrdt.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/intelrdt.go deleted file mode 100644 index 0f5c457b0..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/intelrdt.go +++ /dev/null @@ -1,681 +0,0 @@ -package intelrdt - -import ( - "bytes" - "errors" - "fmt" - "os" - "path/filepath" - "strconv" - "strings" - "sync" - - "github.com/moby/sys/mountinfo" - "golang.org/x/sys/unix" - - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" - "github.com/opencontainers/runc/libcontainer/configs" -) - -/* - * About Intel RDT features: - * Intel platforms with new Xeon CPU support Resource Director Technology (RDT). - * Cache Allocation Technology (CAT) and Memory Bandwidth Allocation (MBA) are - * two sub-features of RDT. - * - * Cache Allocation Technology (CAT) provides a way for the software to restrict - * cache allocation to a defined 'subset' of L3 cache which may be overlapping - * with other 'subsets'. The different subsets are identified by class of - * service (CLOS) and each CLOS has a capacity bitmask (CBM). - * - * Memory Bandwidth Allocation (MBA) provides indirect and approximate throttle - * over memory bandwidth for the software. A user controls the resource by - * indicating the percentage of maximum memory bandwidth or memory bandwidth - * limit in MBps unit if MBA Software Controller is enabled. - * - * More details about Intel RDT CAT and MBA can be found in the section 17.18 - * of Intel Software Developer Manual: - * https://software.intel.com/en-us/articles/intel-sdm - * - * About Intel RDT kernel interface: - * In Linux 4.10 kernel or newer, the interface is defined and exposed via - * "resource control" filesystem, which is a "cgroup-like" interface. - * - * Comparing with cgroups, it has similar process management lifecycle and - * interfaces in a container. But unlike cgroups' hierarchy, it has single level - * filesystem layout. - * - * CAT and MBA features are introduced in Linux 4.10 and 4.12 kernel via - * "resource control" filesystem. - * - * Intel RDT "resource control" filesystem hierarchy: - * mount -t resctrl resctrl /sys/fs/resctrl - * tree /sys/fs/resctrl - * /sys/fs/resctrl/ - * |-- info - * | |-- L3 - * | | |-- cbm_mask - * | | |-- min_cbm_bits - * | | |-- num_closids - * | |-- L3_MON - * | | |-- max_threshold_occupancy - * | | |-- mon_features - * | | |-- num_rmids - * | |-- MB - * | |-- bandwidth_gran - * | |-- delay_linear - * | |-- min_bandwidth - * | |-- num_closids - * |-- ... - * |-- schemata - * |-- tasks - * |-- - * |-- ... - * |-- schemata - * |-- tasks - * - * For runc, we can make use of `tasks` and `schemata` configuration for L3 - * cache and memory bandwidth resources constraints. - * - * The file `tasks` has a list of tasks that belongs to this group (e.g., - * " group). Tasks can be added to a group by writing the task ID - * to the "tasks" file (which will automatically remove them from the previous - * group to which they belonged). New tasks created by fork(2) and clone(2) are - * added to the same group as their parent. - * - * The file `schemata` has a list of all the resources available to this group. - * Each resource (L3 cache, memory bandwidth) has its own line and format. - * - * L3 cache schema: - * It has allocation bitmasks/values for L3 cache on each socket, which - * contains L3 cache id and capacity bitmask (CBM). - * Format: "L3:=;=;..." - * For example, on a two-socket machine, the schema line could be "L3:0=ff;1=c0" - * which means L3 cache id 0's CBM is 0xff, and L3 cache id 1's CBM is 0xc0. - * - * The valid L3 cache CBM is a *contiguous bits set* and number of bits that can - * be set is less than the max bit. The max bits in the CBM is varied among - * supported Intel CPU models. Kernel will check if it is valid when writing. - * e.g., default value 0xfffff in root indicates the max bits of CBM is 20 - * bits, which mapping to entire L3 cache capacity. Some valid CBM values to - * set in a group: 0xf, 0xf0, 0x3ff, 0x1f00 and etc. - * - * Memory bandwidth schema: - * It has allocation values for memory bandwidth on each socket, which contains - * L3 cache id and memory bandwidth. - * Format: "MB:=bandwidth0;=bandwidth1;..." - * For example, on a two-socket machine, the schema line could be "MB:0=20;1=70" - * - * The minimum bandwidth percentage value for each CPU model is predefined and - * can be looked up through "info/MB/min_bandwidth". The bandwidth granularity - * that is allocated is also dependent on the CPU model and can be looked up at - * "info/MB/bandwidth_gran". The available bandwidth control steps are: - * min_bw + N * bw_gran. Intermediate values are rounded to the next control - * step available on the hardware. - * - * If MBA Software Controller is enabled through mount option "-o mba_MBps": - * mount -t resctrl resctrl -o mba_MBps /sys/fs/resctrl - * We could specify memory bandwidth in "MBps" (Mega Bytes per second) unit - * instead of "percentages". The kernel underneath would use a software feedback - * mechanism or a "Software Controller" which reads the actual bandwidth using - * MBM counters and adjust the memory bandwidth percentages to ensure: - * "actual memory bandwidth < user specified memory bandwidth". - * - * For example, on a two-socket machine, the schema line could be - * "MB:0=5000;1=7000" which means 5000 MBps memory bandwidth limit on socket 0 - * and 7000 MBps memory bandwidth limit on socket 1. - * - * For more information about Intel RDT kernel interface: - * https://www.kernel.org/doc/Documentation/x86/intel_rdt_ui.txt - * - * An example for runc: - * Consider a two-socket machine with two L3 caches where the default CBM is - * 0x7ff and the max CBM length is 11 bits, and minimum memory bandwidth of 10% - * with a memory bandwidth granularity of 10%. - * - * Tasks inside the container only have access to the "upper" 7/11 of L3 cache - * on socket 0 and the "lower" 5/11 L3 cache on socket 1, and may use a - * maximum memory bandwidth of 20% on socket 0 and 70% on socket 1. - * - * "linux": { - * "intelRdt": { - * "l3CacheSchema": "L3:0=7f0;1=1f", - * "memBwSchema": "MB:0=20;1=70" - * } - * } - */ - -type Manager struct { - mu sync.Mutex - config *configs.Config - id string - path string -} - -// NewManager returns a new instance of Manager, or nil if the Intel RDT -// functionality is not specified in the config, available from hardware or -// enabled in the kernel. -func NewManager(config *configs.Config, id string, path string) *Manager { - if config.IntelRdt == nil { - return nil - } - if _, err := Root(); err != nil { - // Intel RDT is not available. - return nil - } - return newManager(config, id, path) -} - -// newManager is the same as NewManager, except it does not check if the feature -// is actually available. Used by unit tests that mock intelrdt paths. -func newManager(config *configs.Config, id string, path string) *Manager { - return &Manager{ - config: config, - id: id, - path: path, - } -} - -const ( - intelRdtTasks = "tasks" -) - -var ( - // The flag to indicate if Intel RDT/CAT is enabled - catEnabled bool - // The flag to indicate if Intel RDT/MBA is enabled - mbaEnabled bool - - // For Intel RDT initialization - initOnce sync.Once - - errNotFound = errors.New("Intel RDT not available") -) - -// Check if Intel RDT sub-features are enabled in featuresInit() -func featuresInit() { - initOnce.Do(func() { - // 1. Check if Intel RDT "resource control" filesystem is available. - // The user guarantees to mount the filesystem. - root, err := Root() - if err != nil { - return - } - - // 2. Check if Intel RDT sub-features are available in "resource - // control" filesystem. Intel RDT sub-features can be - // selectively disabled or enabled by kernel command line - // (e.g., rdt=!l3cat,mba) in 4.14 and newer kernel - if _, err := os.Stat(filepath.Join(root, "info", "L3")); err == nil { - catEnabled = true - } - if _, err := os.Stat(filepath.Join(root, "info", "MB")); err == nil { - mbaEnabled = true - } - if _, err := os.Stat(filepath.Join(root, "info", "L3_MON")); err != nil { - return - } - enabledMonFeatures, err = getMonFeatures(root) - if err != nil { - return - } - if enabledMonFeatures.mbmTotalBytes || enabledMonFeatures.mbmLocalBytes { - mbmEnabled = true - } - if enabledMonFeatures.llcOccupancy { - cmtEnabled = true - } - }) -} - -// findIntelRdtMountpointDir returns the mount point of the Intel RDT "resource control" filesystem. -func findIntelRdtMountpointDir() (string, error) { - mi, err := mountinfo.GetMounts(func(m *mountinfo.Info) (bool, bool) { - // similar to mountinfo.FSTypeFilter but stops after the first match - if m.FSType == "resctrl" { - return false, true // don't skip, stop - } - return true, false // skip, keep going - }) - if err != nil { - return "", err - } - if len(mi) < 1 { - return "", errNotFound - } - - return mi[0].Mountpoint, nil -} - -// For Root() use only. -var ( - intelRdtRoot string - intelRdtRootErr error - rootOnce sync.Once -) - -// The kernel creates this (empty) directory if resctrl is supported by the -// hardware and kernel. The user is responsible for mounting the resctrl -// filesystem, and they could mount it somewhere else if they wanted to. -const defaultResctrlMountpoint = "/sys/fs/resctrl" - -// Root returns the Intel RDT "resource control" filesystem mount point. -func Root() (string, error) { - rootOnce.Do(func() { - // Does this system support resctrl? - var statfs unix.Statfs_t - if err := unix.Statfs(defaultResctrlMountpoint, &statfs); err != nil { - if errors.Is(err, unix.ENOENT) { - err = errNotFound - } - intelRdtRootErr = err - return - } - - // Has the resctrl fs been mounted to the default mount point? - if statfs.Type == unix.RDTGROUP_SUPER_MAGIC { - intelRdtRoot = defaultResctrlMountpoint - return - } - - // The resctrl fs could have been mounted somewhere nonstandard. - intelRdtRoot, intelRdtRootErr = findIntelRdtMountpointDir() - }) - - return intelRdtRoot, intelRdtRootErr -} - -// Gets a single uint64 value from the specified file. -func getIntelRdtParamUint(path, file string) (uint64, error) { - fileName := filepath.Join(path, file) - contents, err := os.ReadFile(fileName) - if err != nil { - return 0, err - } - - res, err := fscommon.ParseUint(string(bytes.TrimSpace(contents)), 10, 64) - if err != nil { - return res, fmt.Errorf("unable to parse %q as a uint from file %q", string(contents), fileName) - } - return res, nil -} - -// Gets a string value from the specified file -func getIntelRdtParamString(path, file string) (string, error) { - contents, err := os.ReadFile(filepath.Join(path, file)) - if err != nil { - return "", err - } - - return string(bytes.TrimSpace(contents)), nil -} - -func writeFile(dir, file, data string) error { - if dir == "" { - return fmt.Errorf("no such directory for %s", file) - } - if err := os.WriteFile(filepath.Join(dir, file), []byte(data+"\n"), 0o600); err != nil { - return newLastCmdError(fmt.Errorf("intelrdt: unable to write %v: %w", data, err)) - } - return nil -} - -// Get the read-only L3 cache information -func getL3CacheInfo() (*L3CacheInfo, error) { - l3CacheInfo := &L3CacheInfo{} - - rootPath, err := Root() - if err != nil { - return l3CacheInfo, err - } - - path := filepath.Join(rootPath, "info", "L3") - cbmMask, err := getIntelRdtParamString(path, "cbm_mask") - if err != nil { - return l3CacheInfo, err - } - minCbmBits, err := getIntelRdtParamUint(path, "min_cbm_bits") - if err != nil { - return l3CacheInfo, err - } - numClosids, err := getIntelRdtParamUint(path, "num_closids") - if err != nil { - return l3CacheInfo, err - } - - l3CacheInfo.CbmMask = cbmMask - l3CacheInfo.MinCbmBits = minCbmBits - l3CacheInfo.NumClosids = numClosids - - return l3CacheInfo, nil -} - -// Get the read-only memory bandwidth information -func getMemBwInfo() (*MemBwInfo, error) { - memBwInfo := &MemBwInfo{} - - rootPath, err := Root() - if err != nil { - return memBwInfo, err - } - - path := filepath.Join(rootPath, "info", "MB") - bandwidthGran, err := getIntelRdtParamUint(path, "bandwidth_gran") - if err != nil { - return memBwInfo, err - } - delayLinear, err := getIntelRdtParamUint(path, "delay_linear") - if err != nil { - return memBwInfo, err - } - minBandwidth, err := getIntelRdtParamUint(path, "min_bandwidth") - if err != nil { - return memBwInfo, err - } - numClosids, err := getIntelRdtParamUint(path, "num_closids") - if err != nil { - return memBwInfo, err - } - - memBwInfo.BandwidthGran = bandwidthGran - memBwInfo.DelayLinear = delayLinear - memBwInfo.MinBandwidth = minBandwidth - memBwInfo.NumClosids = numClosids - - return memBwInfo, nil -} - -// Get diagnostics for last filesystem operation error from file info/last_cmd_status -func getLastCmdStatus() (string, error) { - rootPath, err := Root() - if err != nil { - return "", err - } - - path := filepath.Join(rootPath, "info") - lastCmdStatus, err := getIntelRdtParamString(path, "last_cmd_status") - if err != nil { - return "", err - } - - return lastCmdStatus, nil -} - -// WriteIntelRdtTasks writes the specified pid into the "tasks" file -func WriteIntelRdtTasks(dir string, pid int) error { - if dir == "" { - return fmt.Errorf("no such directory for %s", intelRdtTasks) - } - - // Don't attach any pid if -1 is specified as a pid - if pid != -1 { - if err := os.WriteFile(filepath.Join(dir, intelRdtTasks), []byte(strconv.Itoa(pid)), 0o600); err != nil { - return newLastCmdError(fmt.Errorf("intelrdt: unable to add pid %d: %w", pid, err)) - } - } - return nil -} - -// Check if Intel RDT/CAT is enabled -func IsCATEnabled() bool { - featuresInit() - return catEnabled -} - -// Check if Intel RDT/MBA is enabled -func IsMBAEnabled() bool { - featuresInit() - return mbaEnabled -} - -// Get the path of the clos group in "resource control" filesystem that the container belongs to -func (m *Manager) getIntelRdtPath() (string, error) { - rootPath, err := Root() - if err != nil { - return "", err - } - - clos := m.id - if m.config.IntelRdt != nil && m.config.IntelRdt.ClosID != "" { - clos = m.config.IntelRdt.ClosID - } - - return filepath.Join(rootPath, clos), nil -} - -// Applies Intel RDT configuration to the process with the specified pid -func (m *Manager) Apply(pid int) (err error) { - // If intelRdt is not specified in config, we do nothing - if m.config.IntelRdt == nil { - return nil - } - - path, err := m.getIntelRdtPath() - if err != nil { - return err - } - - m.mu.Lock() - defer m.mu.Unlock() - - if m.config.IntelRdt.ClosID != "" && m.config.IntelRdt.L3CacheSchema == "" && m.config.IntelRdt.MemBwSchema == "" { - // Check that the CLOS exists, i.e. it has been pre-configured to - // conform with the runtime spec - if _, err := os.Stat(path); err != nil { - return fmt.Errorf("clos dir not accessible (must be pre-created when l3CacheSchema and memBwSchema are empty): %w", err) - } - } - - if err := os.MkdirAll(path, 0o755); err != nil { - return newLastCmdError(err) - } - - if err := WriteIntelRdtTasks(path, pid); err != nil { - return newLastCmdError(err) - } - - m.path = path - return nil -} - -// Destroys the Intel RDT container-specific 'container_id' group -func (m *Manager) Destroy() error { - // Don't remove resctrl group if closid has been explicitly specified. The - // group is likely externally managed, i.e. by some other entity than us. - // There are probably other containers/tasks sharing the same group. - if m.config.IntelRdt != nil && m.config.IntelRdt.ClosID == "" { - m.mu.Lock() - defer m.mu.Unlock() - if err := os.RemoveAll(m.GetPath()); err != nil { - return err - } - m.path = "" - } - return nil -} - -// Returns Intel RDT path to save in a state file and to be able to -// restore the object later -func (m *Manager) GetPath() string { - if m.path == "" { - m.path, _ = m.getIntelRdtPath() - } - return m.path -} - -// Returns statistics for Intel RDT -func (m *Manager) GetStats() (*Stats, error) { - // If intelRdt is not specified in config - if m.config.IntelRdt == nil { - return nil, nil - } - - m.mu.Lock() - defer m.mu.Unlock() - stats := newStats() - - rootPath, err := Root() - if err != nil { - return nil, err - } - // The read-only L3 cache and memory bandwidth schemata in root - tmpRootStrings, err := getIntelRdtParamString(rootPath, "schemata") - if err != nil { - return nil, err - } - schemaRootStrings := strings.Split(tmpRootStrings, "\n") - - // The L3 cache and memory bandwidth schemata in container's clos group - containerPath := m.GetPath() - tmpStrings, err := getIntelRdtParamString(containerPath, "schemata") - if err != nil { - return nil, err - } - schemaStrings := strings.Split(tmpStrings, "\n") - - if IsCATEnabled() { - // The read-only L3 cache information - l3CacheInfo, err := getL3CacheInfo() - if err != nil { - return nil, err - } - stats.L3CacheInfo = l3CacheInfo - - // The read-only L3 cache schema in root - for _, schemaRoot := range schemaRootStrings { - if strings.Contains(schemaRoot, "L3") { - stats.L3CacheSchemaRoot = strings.TrimSpace(schemaRoot) - } - } - - // The L3 cache schema in container's clos group - for _, schema := range schemaStrings { - if strings.Contains(schema, "L3") { - stats.L3CacheSchema = strings.TrimSpace(schema) - } - } - } - - if IsMBAEnabled() { - // The read-only memory bandwidth information - memBwInfo, err := getMemBwInfo() - if err != nil { - return nil, err - } - stats.MemBwInfo = memBwInfo - - // The read-only memory bandwidth information - for _, schemaRoot := range schemaRootStrings { - if strings.Contains(schemaRoot, "MB") { - stats.MemBwSchemaRoot = strings.TrimSpace(schemaRoot) - } - } - - // The memory bandwidth schema in container's clos group - for _, schema := range schemaStrings { - if strings.Contains(schema, "MB") { - stats.MemBwSchema = strings.TrimSpace(schema) - } - } - } - - if IsMBMEnabled() || IsCMTEnabled() { - err = getMonitoringStats(containerPath, stats) - if err != nil { - return nil, err - } - } - - return stats, nil -} - -// Set Intel RDT "resource control" filesystem as configured. -func (m *Manager) Set(container *configs.Config) error { - // About L3 cache schema: - // It has allocation bitmasks/values for L3 cache on each socket, - // which contains L3 cache id and capacity bitmask (CBM). - // Format: "L3:=;=;..." - // For example, on a two-socket machine, the schema line could be: - // L3:0=ff;1=c0 - // which means L3 cache id 0's CBM is 0xff, and L3 cache id 1's CBM - // is 0xc0. - // - // The valid L3 cache CBM is a *contiguous bits set* and number of - // bits that can be set is less than the max bit. The max bits in the - // CBM is varied among supported Intel CPU models. Kernel will check - // if it is valid when writing. e.g., default value 0xfffff in root - // indicates the max bits of CBM is 20 bits, which mapping to entire - // L3 cache capacity. Some valid CBM values to set in a group: - // 0xf, 0xf0, 0x3ff, 0x1f00 and etc. - // - // - // About memory bandwidth schema: - // It has allocation values for memory bandwidth on each socket, which - // contains L3 cache id and memory bandwidth. - // Format: "MB:=bandwidth0;=bandwidth1;..." - // For example, on a two-socket machine, the schema line could be: - // "MB:0=20;1=70" - // - // The minimum bandwidth percentage value for each CPU model is - // predefined and can be looked up through "info/MB/min_bandwidth". - // The bandwidth granularity that is allocated is also dependent on - // the CPU model and can be looked up at "info/MB/bandwidth_gran". - // The available bandwidth control steps are: min_bw + N * bw_gran. - // Intermediate values are rounded to the next control step available - // on the hardware. - // - // If MBA Software Controller is enabled through mount option - // "-o mba_MBps": mount -t resctrl resctrl -o mba_MBps /sys/fs/resctrl - // We could specify memory bandwidth in "MBps" (Mega Bytes per second) - // unit instead of "percentages". The kernel underneath would use a - // software feedback mechanism or a "Software Controller" which reads - // the actual bandwidth using MBM counters and adjust the memory - // bandwidth percentages to ensure: - // "actual memory bandwidth < user specified memory bandwidth". - // - // For example, on a two-socket machine, the schema line could be - // "MB:0=5000;1=7000" which means 5000 MBps memory bandwidth limit on - // socket 0 and 7000 MBps memory bandwidth limit on socket 1. - if container.IntelRdt != nil { - path := m.GetPath() - l3CacheSchema := container.IntelRdt.L3CacheSchema - memBwSchema := container.IntelRdt.MemBwSchema - - // TODO: verify that l3CacheSchema and/or memBwSchema match the - // existing schemata if ClosID has been specified. This is a more - // involved than reading the file and doing plain string comparison as - // the value written in does not necessarily match what gets read out - // (leading zeros, cache id ordering etc). - - // Write a single joint schema string to schemata file - if l3CacheSchema != "" && memBwSchema != "" { - if err := writeFile(path, "schemata", l3CacheSchema+"\n"+memBwSchema); err != nil { - return err - } - } - - // Write only L3 cache schema string to schemata file - if l3CacheSchema != "" && memBwSchema == "" { - if err := writeFile(path, "schemata", l3CacheSchema); err != nil { - return err - } - } - - // Write only memory bandwidth schema string to schemata file - if l3CacheSchema == "" && memBwSchema != "" { - if err := writeFile(path, "schemata", memBwSchema); err != nil { - return err - } - } - } - - return nil -} - -func newLastCmdError(err error) error { - status, err1 := getLastCmdStatus() - if err1 == nil { - return fmt.Errorf("%w, last_cmd_status: %s", err, status) - } - return err -} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/mbm.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/mbm.go deleted file mode 100644 index 13f31ac7a..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/mbm.go +++ /dev/null @@ -1,31 +0,0 @@ -package intelrdt - -// The flag to indicate if Intel RDT/MBM is enabled -var mbmEnabled bool - -// Check if Intel RDT/MBM is enabled. -func IsMBMEnabled() bool { - featuresInit() - return mbmEnabled -} - -func getMBMNumaNodeStats(numaPath string) (*MBMNumaNodeStats, error) { - stats := &MBMNumaNodeStats{} - if enabledMonFeatures.mbmTotalBytes { - mbmTotalBytes, err := getIntelRdtParamUint(numaPath, "mbm_total_bytes") - if err != nil { - return nil, err - } - stats.MBMTotalBytes = mbmTotalBytes - } - - if enabledMonFeatures.mbmLocalBytes { - mbmLocalBytes, err := getIntelRdtParamUint(numaPath, "mbm_local_bytes") - if err != nil { - return nil, err - } - stats.MBMLocalBytes = mbmLocalBytes - } - - return stats, nil -} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/monitoring.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/monitoring.go deleted file mode 100644 index 82e0002ef..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/monitoring.go +++ /dev/null @@ -1,83 +0,0 @@ -package intelrdt - -import ( - "bufio" - "io" - "os" - "path/filepath" - - "github.com/sirupsen/logrus" -) - -var enabledMonFeatures monFeatures - -type monFeatures struct { - mbmTotalBytes bool - mbmLocalBytes bool - llcOccupancy bool -} - -func getMonFeatures(intelRdtRoot string) (monFeatures, error) { - file, err := os.Open(filepath.Join(intelRdtRoot, "info", "L3_MON", "mon_features")) - if err != nil { - return monFeatures{}, err - } - defer file.Close() - return parseMonFeatures(file) -} - -func parseMonFeatures(reader io.Reader) (monFeatures, error) { - scanner := bufio.NewScanner(reader) - - monFeatures := monFeatures{} - - for scanner.Scan() { - switch feature := scanner.Text(); feature { - case "mbm_total_bytes": - monFeatures.mbmTotalBytes = true - case "mbm_local_bytes": - monFeatures.mbmLocalBytes = true - case "llc_occupancy": - monFeatures.llcOccupancy = true - default: - logrus.Warnf("Unsupported Intel RDT monitoring feature: %s", feature) - } - } - - return monFeatures, scanner.Err() -} - -func getMonitoringStats(containerPath string, stats *Stats) error { - numaFiles, err := os.ReadDir(filepath.Join(containerPath, "mon_data")) - if err != nil { - return err - } - - var mbmStats []MBMNumaNodeStats - var cmtStats []CMTNumaNodeStats - - for _, file := range numaFiles { - if file.IsDir() { - numaPath := filepath.Join(containerPath, "mon_data", file.Name()) - if IsMBMEnabled() { - numaMBMStats, err := getMBMNumaNodeStats(numaPath) - if err != nil { - return err - } - mbmStats = append(mbmStats, *numaMBMStats) - } - if IsCMTEnabled() { - numaCMTStats, err := getCMTNumaNodeStats(numaPath) - if err != nil { - return err - } - cmtStats = append(cmtStats, *numaCMTStats) - } - } - } - - stats.MBMStats = &mbmStats - stats.CMTStats = &cmtStats - - return err -} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/stats.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/stats.go deleted file mode 100644 index a5eb2541e..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/intelrdt/stats.go +++ /dev/null @@ -1,57 +0,0 @@ -package intelrdt - -type L3CacheInfo struct { - CbmMask string `json:"cbm_mask,omitempty"` - MinCbmBits uint64 `json:"min_cbm_bits,omitempty"` - NumClosids uint64 `json:"num_closids,omitempty"` -} - -type MemBwInfo struct { - BandwidthGran uint64 `json:"bandwidth_gran,omitempty"` - DelayLinear uint64 `json:"delay_linear,omitempty"` - MinBandwidth uint64 `json:"min_bandwidth,omitempty"` - NumClosids uint64 `json:"num_closids,omitempty"` -} - -type MBMNumaNodeStats struct { - // The 'mbm_total_bytes' in 'container_id' group. - MBMTotalBytes uint64 `json:"mbm_total_bytes"` - - // The 'mbm_local_bytes' in 'container_id' group. - MBMLocalBytes uint64 `json:"mbm_local_bytes"` -} - -type CMTNumaNodeStats struct { - // The 'llc_occupancy' in 'container_id' group. - LLCOccupancy uint64 `json:"llc_occupancy"` -} - -type Stats struct { - // The read-only L3 cache information - L3CacheInfo *L3CacheInfo `json:"l3_cache_info,omitempty"` - - // The read-only L3 cache schema in root - L3CacheSchemaRoot string `json:"l3_cache_schema_root,omitempty"` - - // The L3 cache schema in 'container_id' group - L3CacheSchema string `json:"l3_cache_schema,omitempty"` - - // The read-only memory bandwidth information - MemBwInfo *MemBwInfo `json:"mem_bw_info,omitempty"` - - // The read-only memory bandwidth schema in root - MemBwSchemaRoot string `json:"mem_bw_schema_root,omitempty"` - - // The memory bandwidth schema in 'container_id' group - MemBwSchema string `json:"mem_bw_schema,omitempty"` - - // The memory bandwidth monitoring statistics from NUMA nodes in 'container_id' group - MBMStats *[]MBMNumaNodeStats `json:"mbm_stats,omitempty"` - - // The cache monitoring technology statistics from NUMA nodes in 'container_id' group - CMTStats *[]CMTNumaNodeStats `json:"cmt_stats,omitempty"` -} - -func newStats() *Stats { - return &Stats{} -} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/utils/cmsg.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/utils/cmsg.go deleted file mode 100644 index 2edd1417a..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/utils/cmsg.go +++ /dev/null @@ -1,119 +0,0 @@ -package utils - -/* - * Copyright 2016, 2017 SUSE LLC - * - * 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. - */ - -import ( - "fmt" - "os" - "runtime" - - "golang.org/x/sys/unix" -) - -// MaxNameLen is the maximum length of the name of a file descriptor being sent -// using SendFile. The name of the file handle returned by RecvFile will never be -// larger than this value. -const MaxNameLen = 4096 - -// oobSpace is the size of the oob slice required to store a single FD. Note -// that unix.UnixRights appears to make the assumption that fd is always int32, -// so sizeof(fd) = 4. -var oobSpace = unix.CmsgSpace(4) - -// RecvFile waits for a file descriptor to be sent over the given AF_UNIX -// socket. The file name of the remote file descriptor will be recreated -// locally (it is sent as non-auxiliary data in the same payload). -func RecvFile(socket *os.File) (_ *os.File, Err error) { - name := make([]byte, MaxNameLen) - oob := make([]byte, oobSpace) - - sockfd := socket.Fd() - n, oobn, _, _, err := unix.Recvmsg(int(sockfd), name, oob, unix.MSG_CMSG_CLOEXEC) - if err != nil { - return nil, err - } - if n >= MaxNameLen || oobn != oobSpace { - return nil, fmt.Errorf("recvfile: incorrect number of bytes read (n=%d oobn=%d)", n, oobn) - } - // Truncate. - name = name[:n] - oob = oob[:oobn] - - scms, err := unix.ParseSocketControlMessage(oob) - if err != nil { - return nil, err - } - - // We cannot control how many SCM_RIGHTS we receive, and upon receiving - // them all of the descriptors are installed in our fd table, so we need to - // parse all of the SCM_RIGHTS we received in order to close all of the - // descriptors on error. - var fds []int - defer func() { - for i, fd := range fds { - if i == 0 && Err == nil { - // Only close the first one on error. - continue - } - // Always close extra ones. - _ = unix.Close(fd) - } - }() - var lastErr error - for _, scm := range scms { - if scm.Header.Type == unix.SCM_RIGHTS { - scmFds, err := unix.ParseUnixRights(&scm) - if err != nil { - lastErr = err - } else { - fds = append(fds, scmFds...) - } - } - } - if lastErr != nil { - return nil, lastErr - } - - // We do this after collecting the fds to make sure we close them all when - // returning an error here. - if len(scms) != 1 { - return nil, fmt.Errorf("recvfd: number of SCMs is not 1: %d", len(scms)) - } - if len(fds) != 1 { - return nil, fmt.Errorf("recvfd: number of fds is not 1: %d", len(fds)) - } - return os.NewFile(uintptr(fds[0]), string(name)), nil -} - -// SendFile sends a file over the given AF_UNIX socket. file.Name() is also -// included so that if the other end uses RecvFile, the file will have the same -// name information. -func SendFile(socket *os.File, file *os.File) error { - name := file.Name() - if len(name) >= MaxNameLen { - return fmt.Errorf("sendfd: filename too long: %s", name) - } - err := SendRawFd(socket, name, file.Fd()) - runtime.KeepAlive(file) - return err -} - -// SendRawFd sends a specific file descriptor over the given AF_UNIX socket. -func SendRawFd(socket *os.File, msg string, fd uintptr) error { - oob := unix.UnixRights(int(fd)) - return unix.Sendmsg(int(socket.Fd()), []byte(msg), oob, nil, 0) -} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/utils/utils.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/utils/utils.go deleted file mode 100644 index db420ea68..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/utils/utils.go +++ /dev/null @@ -1,115 +0,0 @@ -package utils - -import ( - "encoding/json" - "io" - "os" - "path/filepath" - "strings" - - "golang.org/x/sys/unix" -) - -const ( - exitSignalOffset = 128 -) - -// ExitStatus returns the correct exit status for a process based on if it -// was signaled or exited cleanly -func ExitStatus(status unix.WaitStatus) int { - if status.Signaled() { - return exitSignalOffset + int(status.Signal()) - } - return status.ExitStatus() -} - -// WriteJSON writes the provided struct v to w using standard json marshaling -// without a trailing newline. This is used instead of json.Encoder because -// there might be a problem in json decoder in some cases, see: -// https://github.com/docker/docker/issues/14203#issuecomment-174177790 -func WriteJSON(w io.Writer, v interface{}) error { - data, err := json.Marshal(v) - if err != nil { - return err - } - _, err = w.Write(data) - return err -} - -// CleanPath makes a path safe for use with filepath.Join. This is done by not -// only cleaning the path, but also (if the path is relative) adding a leading -// '/' and cleaning it (then removing the leading '/'). This ensures that a -// path resulting from prepending another path will always resolve to lexically -// be a subdirectory of the prefixed path. This is all done lexically, so paths -// that include symlinks won't be safe as a result of using CleanPath. -func CleanPath(path string) string { - // Deal with empty strings nicely. - if path == "" { - return "" - } - - // Ensure that all paths are cleaned (especially problematic ones like - // "/../../../../../" which can cause lots of issues). - path = filepath.Clean(path) - - // If the path isn't absolute, we need to do more processing to fix paths - // such as "../../../..//some/path". We also shouldn't convert absolute - // paths to relative ones. - if !filepath.IsAbs(path) { - path = filepath.Clean(string(os.PathSeparator) + path) - // This can't fail, as (by definition) all paths are relative to root. - path, _ = filepath.Rel(string(os.PathSeparator), path) - } - - // Clean the path again for good measure. - return filepath.Clean(path) -} - -// stripRoot returns the passed path, stripping the root path if it was -// (lexicially) inside it. Note that both passed paths will always be treated -// as absolute, and the returned path will also always be absolute. In -// addition, the paths are cleaned before stripping the root. -func stripRoot(root, path string) string { - // Make the paths clean and absolute. - root, path = CleanPath("/"+root), CleanPath("/"+path) - switch { - case path == root: - path = "/" - case root == "/": - // do nothing - case strings.HasPrefix(path, root+"/"): - path = strings.TrimPrefix(path, root+"/") - } - return CleanPath("/" + path) -} - -// SearchLabels searches through a list of key=value pairs for a given key, -// returning its value, and the binary flag telling whether the key exist. -func SearchLabels(labels []string, key string) (string, bool) { - key += "=" - for _, s := range labels { - if strings.HasPrefix(s, key) { - return s[len(key):], true - } - } - return "", false -} - -// Annotations returns the bundle path and user defined annotations from the -// libcontainer state. We need to remove the bundle because that is a label -// added by libcontainer. -func Annotations(labels []string) (bundle string, userAnnotations map[string]string) { - userAnnotations = make(map[string]string) - for _, l := range labels { - name, value, ok := strings.Cut(l, "=") - if !ok { - continue - } - if name == "bundle" { - bundle = value - } else { - userAnnotations[name] = value - } - } - return -} diff --git a/e2e/vendor/github.com/opencontainers/runc/libcontainer/utils/utils_unix.go b/e2e/vendor/github.com/opencontainers/runc/libcontainer/utils/utils_unix.go deleted file mode 100644 index c8ad559d9..000000000 --- a/e2e/vendor/github.com/opencontainers/runc/libcontainer/utils/utils_unix.go +++ /dev/null @@ -1,363 +0,0 @@ -//go:build !windows - -package utils - -import ( - "fmt" - "math" - "os" - "path/filepath" - "runtime" - "strconv" - "strings" - "sync" - _ "unsafe" // for go:linkname - - securejoin "github.com/cyphar/filepath-securejoin" - "github.com/sirupsen/logrus" - "golang.org/x/sys/unix" -) - -// EnsureProcHandle returns whether or not the given file handle is on procfs. -func EnsureProcHandle(fh *os.File) error { - var buf unix.Statfs_t - if err := unix.Fstatfs(int(fh.Fd()), &buf); err != nil { - return fmt.Errorf("ensure %s is on procfs: %w", fh.Name(), err) - } - if buf.Type != unix.PROC_SUPER_MAGIC { - return fmt.Errorf("%s is not on procfs", fh.Name()) - } - return nil -} - -var ( - haveCloseRangeCloexecBool bool - haveCloseRangeCloexecOnce sync.Once -) - -func haveCloseRangeCloexec() bool { - haveCloseRangeCloexecOnce.Do(func() { - // Make sure we're not closing a random file descriptor. - tmpFd, err := unix.FcntlInt(0, unix.F_DUPFD_CLOEXEC, 0) - if err != nil { - return - } - defer unix.Close(tmpFd) - - err = unix.CloseRange(uint(tmpFd), uint(tmpFd), unix.CLOSE_RANGE_CLOEXEC) - // Any error means we cannot use close_range(CLOSE_RANGE_CLOEXEC). - // -ENOSYS and -EINVAL ultimately mean we don't have support, but any - // other potential error would imply that even the most basic close - // operation wouldn't work. - haveCloseRangeCloexecBool = err == nil - }) - return haveCloseRangeCloexecBool -} - -type fdFunc func(fd int) - -// fdRangeFrom calls the passed fdFunc for each file descriptor that is open in -// the current process. -func fdRangeFrom(minFd int, fn fdFunc) error { - procSelfFd, closer := ProcThreadSelf("fd") - defer closer() - - fdDir, err := os.Open(procSelfFd) - if err != nil { - return err - } - defer fdDir.Close() - - if err := EnsureProcHandle(fdDir); err != nil { - return err - } - - fdList, err := fdDir.Readdirnames(-1) - if err != nil { - return err - } - for _, fdStr := range fdList { - fd, err := strconv.Atoi(fdStr) - // Ignore non-numeric file names. - if err != nil { - continue - } - // Ignore descriptors lower than our specified minimum. - if fd < minFd { - continue - } - // Ignore the file descriptor we used for readdir, as it will be closed - // when we return. - if uintptr(fd) == fdDir.Fd() { - continue - } - // Run the closure. - fn(fd) - } - return nil -} - -// CloseExecFrom sets the O_CLOEXEC flag on all file descriptors greater or -// equal to minFd in the current process. -func CloseExecFrom(minFd int) error { - // Use close_range(CLOSE_RANGE_CLOEXEC) if possible. - if haveCloseRangeCloexec() { - err := unix.CloseRange(uint(minFd), math.MaxUint, unix.CLOSE_RANGE_CLOEXEC) - return os.NewSyscallError("close_range", err) - } - // Otherwise, fall back to the standard loop. - return fdRangeFrom(minFd, unix.CloseOnExec) -} - -//go:linkname runtime_IsPollDescriptor internal/poll.IsPollDescriptor - -// In order to make sure we do not close the internal epoll descriptors the Go -// runtime uses, we need to ensure that we skip descriptors that match -// "internal/poll".IsPollDescriptor. Yes, this is a Go runtime internal thing, -// unfortunately there's no other way to be sure we're only keeping the file -// descriptors the Go runtime needs. Hopefully nothing blows up doing this... -func runtime_IsPollDescriptor(fd uintptr) bool //nolint:revive - -// UnsafeCloseFrom closes all file descriptors greater or equal to minFd in the -// current process, except for those critical to Go's runtime (such as the -// netpoll management descriptors). -// -// NOTE: That this function is incredibly dangerous to use in most Go code, as -// closing file descriptors from underneath *os.File handles can lead to very -// bad behaviour (the closed file descriptor can be re-used and then any -// *os.File operations would apply to the wrong file). This function is only -// intended to be called from the last stage of runc init. -func UnsafeCloseFrom(minFd int) error { - // We cannot use close_range(2) even if it is available, because we must - // not close some file descriptors. - return fdRangeFrom(minFd, func(fd int) { - if runtime_IsPollDescriptor(uintptr(fd)) { - // These are the Go runtimes internal netpoll file descriptors. - // These file descriptors are operated on deep in the Go scheduler, - // and closing those files from underneath Go can result in panics. - // There is no issue with keeping them because they are not - // executable and are not useful to an attacker anyway. Also we - // don't have any choice. - return - } - // There's nothing we can do about errors from close(2), and the - // only likely error to be seen is EBADF which indicates the fd was - // already closed (in which case, we got what we wanted). - _ = unix.Close(fd) - }) -} - -// NewSockPair returns a new SOCK_STREAM unix socket pair. -func NewSockPair(name string) (parent, child *os.File, err error) { - fds, err := unix.Socketpair(unix.AF_LOCAL, unix.SOCK_STREAM|unix.SOCK_CLOEXEC, 0) - if err != nil { - return nil, nil, err - } - return os.NewFile(uintptr(fds[1]), name+"-p"), os.NewFile(uintptr(fds[0]), name+"-c"), nil -} - -// WithProcfd runs the passed closure with a procfd path (/proc/self/fd/...) -// corresponding to the unsafePath resolved within the root. Before passing the -// fd, this path is verified to have been inside the root -- so operating on it -// through the passed fdpath should be safe. Do not access this path through -// the original path strings, and do not attempt to use the pathname outside of -// the passed closure (the file handle will be freed once the closure returns). -func WithProcfd(root, unsafePath string, fn func(procfd string) error) error { - // Remove the root then forcefully resolve inside the root. - unsafePath = stripRoot(root, unsafePath) - path, err := securejoin.SecureJoin(root, unsafePath) - if err != nil { - return fmt.Errorf("resolving path inside rootfs failed: %w", err) - } - - procSelfFd, closer := ProcThreadSelf("fd/") - defer closer() - - // Open the target path. - fh, err := os.OpenFile(path, unix.O_PATH|unix.O_CLOEXEC, 0) - if err != nil { - return fmt.Errorf("open o_path procfd: %w", err) - } - defer fh.Close() - - procfd := filepath.Join(procSelfFd, strconv.Itoa(int(fh.Fd()))) - // Double-check the path is the one we expected. - if realpath, err := os.Readlink(procfd); err != nil { - return fmt.Errorf("procfd verification failed: %w", err) - } else if realpath != path { - return fmt.Errorf("possibly malicious path detected -- refusing to operate on %s", realpath) - } - - return fn(procfd) -} - -type ProcThreadSelfCloser func() - -var ( - haveProcThreadSelf bool - haveProcThreadSelfOnce sync.Once -) - -// ProcThreadSelf returns a string that is equivalent to -// /proc/thread-self/, with a graceful fallback on older kernels where -// /proc/thread-self doesn't exist. This method DOES NOT use SecureJoin, -// meaning that the passed string needs to be trusted. The caller _must_ call -// the returned procThreadSelfCloser function (which is runtime.UnlockOSThread) -// *only once* after it has finished using the returned path string. -func ProcThreadSelf(subpath string) (string, ProcThreadSelfCloser) { - haveProcThreadSelfOnce.Do(func() { - if _, err := os.Stat("/proc/thread-self/"); err == nil { - haveProcThreadSelf = true - } else { - logrus.Debugf("cannot stat /proc/thread-self (%v), falling back to /proc/self/task/", err) - } - }) - - // We need to lock our thread until the caller is done with the path string - // because any non-atomic operation on the path (such as opening a file, - // then reading it) could be interrupted by the Go runtime where the - // underlying thread is swapped out and the original thread is killed, - // resulting in pull-your-hair-out-hard-to-debug issues in the caller. In - // addition, the pre-3.17 fallback makes everything non-atomic because the - // same thing could happen between unix.Gettid() and the path operations. - // - // In theory, we don't need to lock in the atomic user case when using - // /proc/thread-self/, but it's better to be safe than sorry (and there are - // only one or two truly atomic users of /proc/thread-self/). - runtime.LockOSThread() - - threadSelf := "/proc/thread-self/" - if !haveProcThreadSelf { - // Pre-3.17 kernels did not have /proc/thread-self, so do it manually. - threadSelf = "/proc/self/task/" + strconv.Itoa(unix.Gettid()) + "/" - if _, err := os.Stat(threadSelf); err != nil { - // Unfortunately, this code is called from rootfs_linux.go where we - // are running inside the pid namespace of the container but /proc - // is the host's procfs. Unfortunately there is no real way to get - // the correct tid to use here (the kernel age means we cannot do - // things like set up a private fsopen("proc") -- even scanning - // NSpid in all of the tasks in /proc/self/task/*/status requires - // Linux 4.1). - // - // So, we just have to assume that /proc/self is acceptable in this - // one specific case. - if os.Getpid() == 1 { - logrus.Debugf("/proc/thread-self (tid=%d) cannot be emulated inside the initial container setup -- using /proc/self instead: %v", unix.Gettid(), err) - } else { - // This should never happen, but the fallback should work in most cases... - logrus.Warnf("/proc/thread-self could not be emulated for pid=%d (tid=%d) -- using more buggy /proc/self fallback instead: %v", os.Getpid(), unix.Gettid(), err) - } - threadSelf = "/proc/self/" - } - } - return threadSelf + subpath, runtime.UnlockOSThread -} - -// ProcThreadSelfFd is small wrapper around ProcThreadSelf to make it easier to -// create a /proc/thread-self handle for given file descriptor. -// -// It is basically equivalent to ProcThreadSelf(fmt.Sprintf("fd/%d", fd)), but -// without using fmt.Sprintf to avoid unneeded overhead. -func ProcThreadSelfFd(fd uintptr) (string, ProcThreadSelfCloser) { - return ProcThreadSelf("fd/" + strconv.FormatUint(uint64(fd), 10)) -} - -// IsLexicallyInRoot is shorthand for strings.HasPrefix(path+"/", root+"/"), -// but properly handling the case where path or root are "/". -// -// NOTE: The return value only make sense if the path doesn't contain "..". -func IsLexicallyInRoot(root, path string) bool { - if root != "/" { - root += "/" - } - if path != "/" { - path += "/" - } - return strings.HasPrefix(path, root) -} - -// MkdirAllInRootOpen attempts to make -// -// path, _ := securejoin.SecureJoin(root, unsafePath) -// os.MkdirAll(path, mode) -// os.Open(path) -// -// safer against attacks where components in the path are changed between -// SecureJoin returning and MkdirAll (or Open) being called. In particular, we -// try to detect any symlink components in the path while we are doing the -// MkdirAll. -// -// NOTE: Unlike os.MkdirAll, mode is not Go's os.FileMode, it is the unix mode -// (the suid/sgid/sticky bits are not the same as for os.FileMode). -// -// NOTE: If unsafePath is a subpath of root, we assume that you have already -// called SecureJoin and so we use the provided path verbatim without resolving -// any symlinks (this is done in a way that avoids symlink-exchange races). -// This means that the path also must not contain ".." elements, otherwise an -// error will occur. -// -// This uses securejoin.MkdirAllHandle under the hood, but it has special -// handling if unsafePath has already been scoped within the rootfs (this is -// needed for a lot of runc callers and fixing this would require reworking a -// lot of path logic). -func MkdirAllInRootOpen(root, unsafePath string, mode uint32) (_ *os.File, Err error) { - // If the path is already "within" the root, get the path relative to the - // root and use that as the unsafe path. This is necessary because a lot of - // MkdirAllInRootOpen callers have already done SecureJoin, and refactoring - // all of them to stop using these SecureJoin'd paths would require a fair - // amount of work. - // TODO(cyphar): Do the refactor to libpathrs once it's ready. - if IsLexicallyInRoot(root, unsafePath) { - subPath, err := filepath.Rel(root, unsafePath) - if err != nil { - return nil, err - } - unsafePath = subPath - } - - // Check for any silly mode bits. - if mode&^0o7777 != 0 { - return nil, fmt.Errorf("tried to include non-mode bits in MkdirAll mode: 0o%.3o", mode) - } - // Linux (and thus os.MkdirAll) silently ignores the suid and sgid bits if - // passed. While it would make sense to return an error in that case (since - // the user has asked for a mode that won't be applied), for compatibility - // reasons we have to ignore these bits. - if ignoredBits := mode &^ 0o1777; ignoredBits != 0 { - logrus.Warnf("MkdirAll called with no-op mode bits that are ignored by Linux: 0o%.3o", ignoredBits) - mode &= 0o1777 - } - - rootDir, err := os.OpenFile(root, unix.O_DIRECTORY|unix.O_CLOEXEC, 0) - if err != nil { - return nil, fmt.Errorf("open root handle: %w", err) - } - defer rootDir.Close() - - return securejoin.MkdirAllHandle(rootDir, unsafePath, int(mode)) -} - -// MkdirAllInRoot is a wrapper around MkdirAllInRootOpen which closes the -// returned handle, for callers that don't need to use it. -func MkdirAllInRoot(root, unsafePath string, mode uint32) error { - f, err := MkdirAllInRootOpen(root, unsafePath, mode) - if err == nil { - _ = f.Close() - } - return err -} - -// Openat is a Go-friendly openat(2) wrapper. -func Openat(dir *os.File, path string, flags int, mode uint32) (*os.File, error) { - dirFd := unix.AT_FDCWD - if dir != nil { - dirFd = int(dir.Fd()) - } - flags |= unix.O_CLOEXEC - - fd, err := unix.Openat(dirFd, path, flags, mode) - if err != nil { - return nil, &os.PathError{Op: "openat", Path: path, Err: err} - } - return os.NewFile(uintptr(fd), dir.Name()+"/"+path), nil -} diff --git a/e2e/vendor/go.etcd.io/etcd/api/v3/authpb/auth.pb.go b/e2e/vendor/go.etcd.io/etcd/api/v3/authpb/auth.pb.go deleted file mode 100644 index 16affcd62..000000000 --- a/e2e/vendor/go.etcd.io/etcd/api/v3/authpb/auth.pb.go +++ /dev/null @@ -1,1158 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: auth.proto - -package authpb - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/golang/protobuf/proto" -) - -// 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. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type Permission_Type int32 - -const ( - READ Permission_Type = 0 - WRITE Permission_Type = 1 - READWRITE Permission_Type = 2 -) - -var Permission_Type_name = map[int32]string{ - 0: "READ", - 1: "WRITE", - 2: "READWRITE", -} - -var Permission_Type_value = map[string]int32{ - "READ": 0, - "WRITE": 1, - "READWRITE": 2, -} - -func (x Permission_Type) String() string { - return proto.EnumName(Permission_Type_name, int32(x)) -} - -func (Permission_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_8bbd6f3875b0e874, []int{2, 0} -} - -type UserAddOptions struct { - NoPassword bool `protobuf:"varint,1,opt,name=no_password,json=noPassword,proto3" json:"no_password,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UserAddOptions) Reset() { *m = UserAddOptions{} } -func (m *UserAddOptions) String() string { return proto.CompactTextString(m) } -func (*UserAddOptions) ProtoMessage() {} -func (*UserAddOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_8bbd6f3875b0e874, []int{0} -} -func (m *UserAddOptions) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UserAddOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UserAddOptions.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UserAddOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserAddOptions.Merge(m, src) -} -func (m *UserAddOptions) XXX_Size() int { - return m.Size() -} -func (m *UserAddOptions) XXX_DiscardUnknown() { - xxx_messageInfo_UserAddOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_UserAddOptions proto.InternalMessageInfo - -// User is a single entry in the bucket authUsers -type User struct { - Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Password []byte `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - Roles []string `protobuf:"bytes,3,rep,name=roles,proto3" json:"roles,omitempty"` - Options *UserAddOptions `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *User) Reset() { *m = User{} } -func (m *User) String() string { return proto.CompactTextString(m) } -func (*User) ProtoMessage() {} -func (*User) Descriptor() ([]byte, []int) { - return fileDescriptor_8bbd6f3875b0e874, []int{1} -} -func (m *User) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_User.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *User) XXX_Merge(src proto.Message) { - xxx_messageInfo_User.Merge(m, src) -} -func (m *User) XXX_Size() int { - return m.Size() -} -func (m *User) XXX_DiscardUnknown() { - xxx_messageInfo_User.DiscardUnknown(m) -} - -var xxx_messageInfo_User proto.InternalMessageInfo - -// Permission is a single entity -type Permission struct { - PermType Permission_Type `protobuf:"varint,1,opt,name=permType,proto3,enum=authpb.Permission_Type" json:"permType,omitempty"` - Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - RangeEnd []byte `protobuf:"bytes,3,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Permission) Reset() { *m = Permission{} } -func (m *Permission) String() string { return proto.CompactTextString(m) } -func (*Permission) ProtoMessage() {} -func (*Permission) Descriptor() ([]byte, []int) { - return fileDescriptor_8bbd6f3875b0e874, []int{2} -} -func (m *Permission) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Permission) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Permission.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Permission) XXX_Merge(src proto.Message) { - xxx_messageInfo_Permission.Merge(m, src) -} -func (m *Permission) XXX_Size() int { - return m.Size() -} -func (m *Permission) XXX_DiscardUnknown() { - xxx_messageInfo_Permission.DiscardUnknown(m) -} - -var xxx_messageInfo_Permission proto.InternalMessageInfo - -// Role is a single entry in the bucket authRoles -type Role struct { - Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - KeyPermission []*Permission `protobuf:"bytes,2,rep,name=keyPermission,proto3" json:"keyPermission,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Role) Reset() { *m = Role{} } -func (m *Role) String() string { return proto.CompactTextString(m) } -func (*Role) ProtoMessage() {} -func (*Role) Descriptor() ([]byte, []int) { - return fileDescriptor_8bbd6f3875b0e874, []int{3} -} -func (m *Role) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Role) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Role.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Role) XXX_Merge(src proto.Message) { - xxx_messageInfo_Role.Merge(m, src) -} -func (m *Role) XXX_Size() int { - return m.Size() -} -func (m *Role) XXX_DiscardUnknown() { - xxx_messageInfo_Role.DiscardUnknown(m) -} - -var xxx_messageInfo_Role proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("authpb.Permission_Type", Permission_Type_name, Permission_Type_value) - proto.RegisterType((*UserAddOptions)(nil), "authpb.UserAddOptions") - proto.RegisterType((*User)(nil), "authpb.User") - proto.RegisterType((*Permission)(nil), "authpb.Permission") - proto.RegisterType((*Role)(nil), "authpb.Role") -} - -func init() { proto.RegisterFile("auth.proto", fileDescriptor_8bbd6f3875b0e874) } - -var fileDescriptor_8bbd6f3875b0e874 = []byte{ - // 338 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xcf, 0x4e, 0xea, 0x40, - 0x14, 0xc6, 0x3b, 0xb4, 0x70, 0xdb, 0xc3, 0x85, 0x90, 0x13, 0x72, 0x6f, 0x83, 0x49, 0x6d, 0xba, - 0x6a, 0x5c, 0x54, 0x85, 0x8d, 0x5b, 0x8c, 0x2c, 0x5c, 0x49, 0x26, 0x18, 0x97, 0xa4, 0xa4, 0x13, - 0x24, 0xc0, 0x4c, 0x33, 0x83, 0x31, 0x6c, 0x7c, 0x0e, 0x17, 0x3e, 0x10, 0x4b, 0x1e, 0x41, 0xf0, - 0x45, 0x4c, 0x67, 0xf8, 0x13, 0xa2, 0xbb, 0xef, 0x7c, 0xe7, 0xfb, 0x66, 0x7e, 0x99, 0x01, 0x48, - 0x5f, 0x16, 0xcf, 0x49, 0x2e, 0xc5, 0x42, 0x60, 0xa5, 0xd0, 0xf9, 0xa8, 0xd5, 0x1c, 0x8b, 0xb1, - 0xd0, 0xd6, 0x65, 0xa1, 0xcc, 0x36, 0xba, 0x86, 0xfa, 0xa3, 0x62, 0xb2, 0x9b, 0x65, 0x0f, 0xf9, - 0x62, 0x22, 0xb8, 0xc2, 0x73, 0xa8, 0x72, 0x31, 0xcc, 0x53, 0xa5, 0x5e, 0x85, 0xcc, 0x7c, 0x12, - 0x92, 0xd8, 0xa5, 0xc0, 0x45, 0x7f, 0xe7, 0x44, 0x6f, 0xe0, 0x14, 0x15, 0x44, 0x70, 0x78, 0x3a, - 0x67, 0x3a, 0xf1, 0x97, 0x6a, 0x8d, 0x2d, 0x70, 0x0f, 0xcd, 0x92, 0xf6, 0x0f, 0x33, 0x36, 0xa1, - 0x2c, 0xc5, 0x8c, 0x29, 0xdf, 0x0e, 0xed, 0xd8, 0xa3, 0x66, 0xc0, 0x2b, 0xf8, 0x23, 0xcc, 0xcd, - 0xbe, 0x13, 0x92, 0xb8, 0xda, 0xfe, 0x97, 0x18, 0xe0, 0xe4, 0x94, 0x8b, 0xee, 0x63, 0xd1, 0x07, - 0x01, 0xe8, 0x33, 0x39, 0x9f, 0x28, 0x35, 0x11, 0x1c, 0x3b, 0xe0, 0xe6, 0x4c, 0xce, 0x07, 0xcb, - 0xdc, 0xa0, 0xd4, 0xdb, 0xff, 0xf7, 0x27, 0x1c, 0x53, 0x49, 0xb1, 0xa6, 0x87, 0x20, 0x36, 0xc0, - 0x9e, 0xb2, 0xe5, 0x0e, 0xb1, 0x90, 0x78, 0x06, 0x9e, 0x4c, 0xf9, 0x98, 0x0d, 0x19, 0xcf, 0x7c, - 0xdb, 0xa0, 0x6b, 0xa3, 0xc7, 0xb3, 0xe8, 0x02, 0x1c, 0x5d, 0x73, 0xc1, 0xa1, 0xbd, 0xee, 0x5d, - 0xc3, 0x42, 0x0f, 0xca, 0x4f, 0xf4, 0x7e, 0xd0, 0x6b, 0x10, 0xac, 0x81, 0x57, 0x98, 0x66, 0x2c, - 0x45, 0x03, 0x70, 0xa8, 0x98, 0xb1, 0x5f, 0x9f, 0xe7, 0x06, 0x6a, 0x53, 0xb6, 0x3c, 0x62, 0xf9, - 0xa5, 0xd0, 0x8e, 0xab, 0x6d, 0xfc, 0x09, 0x4c, 0x4f, 0x83, 0xb7, 0xfe, 0x6a, 0x13, 0x58, 0xeb, - 0x4d, 0x60, 0xad, 0xb6, 0x01, 0x59, 0x6f, 0x03, 0xf2, 0xb9, 0x0d, 0xc8, 0xfb, 0x57, 0x60, 0x8d, - 0x2a, 0xfa, 0x23, 0x3b, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x61, 0x66, 0xc6, 0x9d, 0xf4, 0x01, - 0x00, 0x00, -} - -func (m *UserAddOptions) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UserAddOptions) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UserAddOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.NoPassword { - i-- - if m.NoPassword { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *User) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *User) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *User) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Options != nil { - { - size, err := m.Options.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuth(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if len(m.Roles) > 0 { - for iNdEx := len(m.Roles) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Roles[iNdEx]) - copy(dAtA[i:], m.Roles[iNdEx]) - i = encodeVarintAuth(dAtA, i, uint64(len(m.Roles[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(m.Password) > 0 { - i -= len(m.Password) - copy(dAtA[i:], m.Password) - i = encodeVarintAuth(dAtA, i, uint64(len(m.Password))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintAuth(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Permission) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Permission) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Permission) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.RangeEnd) > 0 { - i -= len(m.RangeEnd) - copy(dAtA[i:], m.RangeEnd) - i = encodeVarintAuth(dAtA, i, uint64(len(m.RangeEnd))) - i-- - dAtA[i] = 0x1a - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintAuth(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0x12 - } - if m.PermType != 0 { - i = encodeVarintAuth(dAtA, i, uint64(m.PermType)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Role) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Role) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Role) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.KeyPermission) > 0 { - for iNdEx := len(m.KeyPermission) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.KeyPermission[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuth(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintAuth(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintAuth(dAtA []byte, offset int, v uint64) int { - offset -= sovAuth(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *UserAddOptions) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NoPassword { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *User) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovAuth(uint64(l)) - } - l = len(m.Password) - if l > 0 { - n += 1 + l + sovAuth(uint64(l)) - } - if len(m.Roles) > 0 { - for _, s := range m.Roles { - l = len(s) - n += 1 + l + sovAuth(uint64(l)) - } - } - if m.Options != nil { - l = m.Options.Size() - n += 1 + l + sovAuth(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Permission) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PermType != 0 { - n += 1 + sovAuth(uint64(m.PermType)) - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovAuth(uint64(l)) - } - l = len(m.RangeEnd) - if l > 0 { - n += 1 + l + sovAuth(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Role) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovAuth(uint64(l)) - } - if len(m.KeyPermission) > 0 { - for _, e := range m.KeyPermission { - l = e.Size() - n += 1 + l + sovAuth(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovAuth(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozAuth(x uint64) (n int) { - return sovAuth(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *UserAddOptions) 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 ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UserAddOptions: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UserAddOptions: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NoPassword", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.NoPassword = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipAuth(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuth - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *User) 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 ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: User: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: User: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAuth - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAuth - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) - if m.Name == nil { - m.Name = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAuth - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAuth - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Password = append(m.Password[:0], dAtA[iNdEx:postIndex]...) - if m.Password == nil { - m.Password = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAuth - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuth - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuth - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuth - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Options == nil { - m.Options = &UserAddOptions{} - } - if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAuth(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuth - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Permission) 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 ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Permission: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Permission: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PermType", wireType) - } - m.PermType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PermType |= Permission_Type(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAuth - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAuth - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAuth - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAuth - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) - if m.RangeEnd == nil { - m.RangeEnd = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAuth(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuth - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Role) 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 ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Role: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Role: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAuth - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAuth - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) - if m.Name == nil { - m.Name = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field KeyPermission", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuth - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuth - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.KeyPermission = append(m.KeyPermission, &Permission{}) - if err := m.KeyPermission[len(m.KeyPermission)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAuth(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuth - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipAuth(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAuth - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAuth - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAuth - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthAuth - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupAuth - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthAuth - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthAuth = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowAuth = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupAuth = fmt.Errorf("proto: unexpected end of group") -) diff --git a/e2e/vendor/go.etcd.io/etcd/api/v3/authpb/auth.proto b/e2e/vendor/go.etcd.io/etcd/api/v3/authpb/auth.proto deleted file mode 100644 index 8f82b7cf1..000000000 --- a/e2e/vendor/go.etcd.io/etcd/api/v3/authpb/auth.proto +++ /dev/null @@ -1,42 +0,0 @@ -syntax = "proto3"; -package authpb; - -import "gogoproto/gogo.proto"; - -option (gogoproto.marshaler_all) = true; -option (gogoproto.sizer_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; -option (gogoproto.goproto_enum_prefix_all) = false; - -message UserAddOptions { - bool no_password = 1; -}; - -// User is a single entry in the bucket authUsers -message User { - bytes name = 1; - bytes password = 2; - repeated string roles = 3; - UserAddOptions options = 4; -} - -// Permission is a single entity -message Permission { - enum Type { - READ = 0; - WRITE = 1; - READWRITE = 2; - } - Type permType = 1; - - bytes key = 2; - bytes range_end = 3; -} - -// Role is a single entry in the bucket authRoles -message Role { - bytes name = 1; - - repeated Permission keyPermission = 2; -} diff --git a/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/etcdserver.pb.go b/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/etcdserver.pb.go deleted file mode 100644 index 38434d09c..000000000 --- a/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/etcdserver.pb.go +++ /dev/null @@ -1,1002 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: etcdserver.proto - -package etcdserverpb - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/golang/protobuf/proto" -) - -// 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. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type Request struct { - 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"` - Refresh *bool `protobuf:"varint,17,opt,name=Refresh" json:"Refresh,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Request) Reset() { *m = Request{} } -func (m *Request) String() string { return proto.CompactTextString(m) } -func (*Request) ProtoMessage() {} -func (*Request) Descriptor() ([]byte, []int) { - return fileDescriptor_09ffbeb3bebbce7e, []int{0} -} -func (m *Request) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Request.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Request) XXX_Merge(src proto.Message) { - xxx_messageInfo_Request.Merge(m, src) -} -func (m *Request) XXX_Size() int { - return m.Size() -} -func (m *Request) XXX_DiscardUnknown() { - xxx_messageInfo_Request.DiscardUnknown(m) -} - -var xxx_messageInfo_Request proto.InternalMessageInfo - -type Metadata struct { - NodeID uint64 `protobuf:"varint,1,opt,name=NodeID" json:"NodeID"` - ClusterID uint64 `protobuf:"varint,2,opt,name=ClusterID" json:"ClusterID"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Metadata) Reset() { *m = Metadata{} } -func (m *Metadata) String() string { return proto.CompactTextString(m) } -func (*Metadata) ProtoMessage() {} -func (*Metadata) Descriptor() ([]byte, []int) { - return fileDescriptor_09ffbeb3bebbce7e, []int{1} -} -func (m *Metadata) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Metadata.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Metadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_Metadata.Merge(m, src) -} -func (m *Metadata) XXX_Size() int { - return m.Size() -} -func (m *Metadata) XXX_DiscardUnknown() { - xxx_messageInfo_Metadata.DiscardUnknown(m) -} - -var xxx_messageInfo_Metadata proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Request)(nil), "etcdserverpb.Request") - proto.RegisterType((*Metadata)(nil), "etcdserverpb.Metadata") -} - -func init() { proto.RegisterFile("etcdserver.proto", fileDescriptor_09ffbeb3bebbce7e) } - -var fileDescriptor_09ffbeb3bebbce7e = []byte{ - // 380 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0xd2, 0xdd, 0x6e, 0xda, 0x30, - 0x14, 0x07, 0x70, 0x0c, 0xe1, 0xcb, 0x63, 0x1b, 0xb3, 0xd0, 0x74, 0x84, 0xa6, 0x2c, 0x42, 0xbb, - 0xc8, 0xd5, 0xf6, 0x0e, 0x2c, 0x5c, 0x44, 0x2a, 0x15, 0x0d, 0x15, 0xbd, 0x76, 0xc9, 0x29, 0x58, - 0x02, 0x4c, 0x1d, 0x07, 0xf1, 0x06, 0x7d, 0x85, 0x3e, 0x12, 0x97, 0x7d, 0x82, 0xaa, 0xa5, 0x2f, - 0x52, 0x39, 0x24, 0xc4, 0xed, 0x5d, 0xf4, 0xfb, 0x9f, 0x1c, 0x1f, 0x7f, 0xd0, 0x2e, 0xea, 0x79, - 0x9c, 0xa0, 0xda, 0xa1, 0xfa, 0xbb, 0x55, 0x52, 0x4b, 0xd6, 0x29, 0x65, 0x7b, 0xdb, 0xef, 0x2d, - 0xe4, 0x42, 0x66, 0xc1, 0x3f, 0xf3, 0x75, 0xaa, 0x19, 0x3c, 0x38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0xdf, 0xad, 0xa9, 0x33, 0xc9, 0xba, 0x6a, 0x85, 0x7c, 0x0d, 0xdd, 0x0f, 0x5d, 0x33, 0x63, - 0xae, 0xb9, 0xe8, 0x3b, 0x85, 0xc9, 0x12, 0x7e, 0x58, 0xa7, 0x52, 0xe0, 0xe0, 0x82, 0xb6, 0xc6, - 0xa8, 0x79, 0xcc, 0x35, 0x37, 0x9d, 0x2e, 0x65, 0x8c, 0x9f, 0x5e, 0x43, 0x6e, 0x66, 0x87, 0xff, - 0x57, 0x69, 0xa2, 0x51, 0x85, 0x41, 0xf6, 0x28, 0xce, 0xb7, 0x70, 0xe6, 0x61, 0xef, 0xf0, 0xea, - 0x56, 0x0e, 0x47, 0x97, 0x3c, 0x1d, 0x5d, 0xf2, 0x72, 0x74, 0xc9, 0xe3, 0x9b, 0x5b, 0x79, 0x0f, - 0x00, 0x00, 0xff, 0xff, 0xee, 0x40, 0xba, 0xd6, 0xa4, 0x02, 0x00, 0x00, -} - -func (m *Request) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Request) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Request) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Refresh != nil { - i-- - if *m.Refresh { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x88 - } - i-- - if m.Stream { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x80 - i = encodeVarintEtcdserver(dAtA, i, uint64(m.Time)) - i-- - dAtA[i] = 0x78 - i-- - if m.Quorum { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x70 - i-- - if m.Sorted { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x68 - i-- - if m.Recursive { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x60 - i = encodeVarintEtcdserver(dAtA, i, uint64(m.Since)) - i-- - dAtA[i] = 0x58 - i-- - if m.Wait { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x50 - i = encodeVarintEtcdserver(dAtA, i, uint64(m.Expiration)) - i-- - dAtA[i] = 0x48 - if m.PrevExist != nil { - i-- - if *m.PrevExist { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - i = encodeVarintEtcdserver(dAtA, i, uint64(m.PrevIndex)) - i-- - dAtA[i] = 0x38 - i -= len(m.PrevValue) - copy(dAtA[i:], m.PrevValue) - i = encodeVarintEtcdserver(dAtA, i, uint64(len(m.PrevValue))) - i-- - dAtA[i] = 0x32 - i-- - if m.Dir { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - i -= len(m.Val) - copy(dAtA[i:], m.Val) - i = encodeVarintEtcdserver(dAtA, i, uint64(len(m.Val))) - i-- - dAtA[i] = 0x22 - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintEtcdserver(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0x1a - i -= len(m.Method) - copy(dAtA[i:], m.Method) - i = encodeVarintEtcdserver(dAtA, i, uint64(len(m.Method))) - i-- - dAtA[i] = 0x12 - i = encodeVarintEtcdserver(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x8 - return len(dAtA) - i, nil -} - -func (m *Metadata) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Metadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - i = encodeVarintEtcdserver(dAtA, i, uint64(m.ClusterID)) - i-- - dAtA[i] = 0x10 - i = encodeVarintEtcdserver(dAtA, i, uint64(m.NodeID)) - i-- - dAtA[i] = 0x8 - return len(dAtA) - i, nil -} - -func encodeVarintEtcdserver(dAtA []byte, offset int, v uint64) int { - offset -= sovEtcdserver(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Request) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovEtcdserver(uint64(m.ID)) - l = len(m.Method) - n += 1 + l + sovEtcdserver(uint64(l)) - l = len(m.Path) - n += 1 + l + sovEtcdserver(uint64(l)) - l = len(m.Val) - n += 1 + l + sovEtcdserver(uint64(l)) - n += 2 - l = len(m.PrevValue) - n += 1 + l + sovEtcdserver(uint64(l)) - n += 1 + sovEtcdserver(uint64(m.PrevIndex)) - if m.PrevExist != nil { - n += 2 - } - n += 1 + sovEtcdserver(uint64(m.Expiration)) - n += 2 - n += 1 + sovEtcdserver(uint64(m.Since)) - n += 2 - n += 2 - n += 2 - n += 1 + sovEtcdserver(uint64(m.Time)) - n += 3 - if m.Refresh != nil { - n += 3 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Metadata) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovEtcdserver(uint64(m.NodeID)) - n += 1 + sovEtcdserver(uint64(m.ClusterID)) - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovEtcdserver(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEtcdserver(x uint64) (n int) { - return sovEtcdserver(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: 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 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEtcdserver - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEtcdserver - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Method = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEtcdserver - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEtcdserver - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Path = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Val", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEtcdserver - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEtcdserver - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Val = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Dir", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Dir = bool(v != 0) - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevValue", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEtcdserver - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEtcdserver - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PrevValue = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevIndex", wireType) - } - m.PrevIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PrevIndex |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevExist", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.PrevExist = &b - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) - } - m.Expiration = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Expiration |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Wait", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Wait = bool(v != 0) - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Since", wireType) - } - m.Since = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Since |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Recursive", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Recursive = bool(v != 0) - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Sorted", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Sorted = bool(v != 0) - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Quorum", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Quorum = bool(v != 0) - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) - } - m.Time = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Time |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 16: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Stream", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Stream = bool(v != 0) - case 17: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Refresh", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Refresh = &b - default: - iNdEx = preIndex - skippy, err := skipEtcdserver(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEtcdserver - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: 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 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) - } - m.NodeID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NodeID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ClusterID", wireType) - } - m.ClusterID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ClusterID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipEtcdserver(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEtcdserver - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEtcdserver(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthEtcdserver - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEtcdserver - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEtcdserver - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEtcdserver = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEtcdserver = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEtcdserver = fmt.Errorf("proto: unexpected end of group") -) diff --git a/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/etcdserver.proto b/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/etcdserver.proto deleted file mode 100644 index 25e0aca5d..000000000 --- a/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/etcdserver.proto +++ /dev/null @@ -1,34 +0,0 @@ -syntax = "proto2"; -package etcdserverpb; - -import "gogoproto/gogo.proto"; - -option (gogoproto.marshaler_all) = true; -option (gogoproto.sizer_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; - -message Request { - optional uint64 ID = 1 [(gogoproto.nullable) = false]; - optional string Method = 2 [(gogoproto.nullable) = false]; - optional string Path = 3 [(gogoproto.nullable) = false]; - optional string Val = 4 [(gogoproto.nullable) = false]; - optional bool Dir = 5 [(gogoproto.nullable) = false]; - optional string PrevValue = 6 [(gogoproto.nullable) = false]; - optional uint64 PrevIndex = 7 [(gogoproto.nullable) = false]; - optional bool PrevExist = 8 [(gogoproto.nullable) = true]; - optional int64 Expiration = 9 [(gogoproto.nullable) = false]; - optional bool Wait = 10 [(gogoproto.nullable) = false]; - optional uint64 Since = 11 [(gogoproto.nullable) = false]; - optional bool Recursive = 12 [(gogoproto.nullable) = false]; - optional bool Sorted = 13 [(gogoproto.nullable) = false]; - optional bool Quorum = 14 [(gogoproto.nullable) = false]; - optional int64 Time = 15 [(gogoproto.nullable) = false]; - optional bool Stream = 16 [(gogoproto.nullable) = false]; - optional bool Refresh = 17 [(gogoproto.nullable) = true]; -} - -message Metadata { - optional uint64 NodeID = 1 [(gogoproto.nullable) = false]; - optional uint64 ClusterID = 2 [(gogoproto.nullable) = false]; -} diff --git a/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/raft_internal.pb.go b/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/raft_internal.pb.go deleted file mode 100644 index b94a7bfd9..000000000 --- a/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/raft_internal.pb.go +++ /dev/null @@ -1,2673 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: raft_internal.proto - -package etcdserverpb - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/golang/protobuf/proto" - membershippb "go.etcd.io/etcd/api/v3/membershippb" -) - -// 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. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type RequestHeader struct { - ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - // username is a username that is associated with an auth token of gRPC connection - Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` - // auth_revision is a revision number of auth.authStore. It is not related to mvcc - AuthRevision uint64 `protobuf:"varint,3,opt,name=auth_revision,json=authRevision,proto3" json:"auth_revision,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RequestHeader) Reset() { *m = RequestHeader{} } -func (m *RequestHeader) String() string { return proto.CompactTextString(m) } -func (*RequestHeader) ProtoMessage() {} -func (*RequestHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_b4c9a9be0cfca103, []int{0} -} -func (m *RequestHeader) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestHeader.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RequestHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestHeader.Merge(m, src) -} -func (m *RequestHeader) XXX_Size() int { - return m.Size() -} -func (m *RequestHeader) XXX_DiscardUnknown() { - xxx_messageInfo_RequestHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestHeader proto.InternalMessageInfo - -// An InternalRaftRequest is the union of all requests which can be -// sent via raft. -type InternalRaftRequest struct { - Header *RequestHeader `protobuf:"bytes,100,opt,name=header,proto3" json:"header,omitempty"` - ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - V2 *Request `protobuf:"bytes,2,opt,name=v2,proto3" json:"v2,omitempty"` - Range *RangeRequest `protobuf:"bytes,3,opt,name=range,proto3" json:"range,omitempty"` - Put *PutRequest `protobuf:"bytes,4,opt,name=put,proto3" json:"put,omitempty"` - DeleteRange *DeleteRangeRequest `protobuf:"bytes,5,opt,name=delete_range,json=deleteRange,proto3" json:"delete_range,omitempty"` - Txn *TxnRequest `protobuf:"bytes,6,opt,name=txn,proto3" json:"txn,omitempty"` - Compaction *CompactionRequest `protobuf:"bytes,7,opt,name=compaction,proto3" json:"compaction,omitempty"` - LeaseGrant *LeaseGrantRequest `protobuf:"bytes,8,opt,name=lease_grant,json=leaseGrant,proto3" json:"lease_grant,omitempty"` - LeaseRevoke *LeaseRevokeRequest `protobuf:"bytes,9,opt,name=lease_revoke,json=leaseRevoke,proto3" json:"lease_revoke,omitempty"` - Alarm *AlarmRequest `protobuf:"bytes,10,opt,name=alarm,proto3" json:"alarm,omitempty"` - LeaseCheckpoint *LeaseCheckpointRequest `protobuf:"bytes,11,opt,name=lease_checkpoint,json=leaseCheckpoint,proto3" json:"lease_checkpoint,omitempty"` - AuthEnable *AuthEnableRequest `protobuf:"bytes,1000,opt,name=auth_enable,json=authEnable,proto3" json:"auth_enable,omitempty"` - AuthDisable *AuthDisableRequest `protobuf:"bytes,1011,opt,name=auth_disable,json=authDisable,proto3" json:"auth_disable,omitempty"` - AuthStatus *AuthStatusRequest `protobuf:"bytes,1013,opt,name=auth_status,json=authStatus,proto3" json:"auth_status,omitempty"` - Authenticate *InternalAuthenticateRequest `protobuf:"bytes,1012,opt,name=authenticate,proto3" json:"authenticate,omitempty"` - AuthUserAdd *AuthUserAddRequest `protobuf:"bytes,1100,opt,name=auth_user_add,json=authUserAdd,proto3" json:"auth_user_add,omitempty"` - AuthUserDelete *AuthUserDeleteRequest `protobuf:"bytes,1101,opt,name=auth_user_delete,json=authUserDelete,proto3" json:"auth_user_delete,omitempty"` - AuthUserGet *AuthUserGetRequest `protobuf:"bytes,1102,opt,name=auth_user_get,json=authUserGet,proto3" json:"auth_user_get,omitempty"` - AuthUserChangePassword *AuthUserChangePasswordRequest `protobuf:"bytes,1103,opt,name=auth_user_change_password,json=authUserChangePassword,proto3" json:"auth_user_change_password,omitempty"` - AuthUserGrantRole *AuthUserGrantRoleRequest `protobuf:"bytes,1104,opt,name=auth_user_grant_role,json=authUserGrantRole,proto3" json:"auth_user_grant_role,omitempty"` - AuthUserRevokeRole *AuthUserRevokeRoleRequest `protobuf:"bytes,1105,opt,name=auth_user_revoke_role,json=authUserRevokeRole,proto3" json:"auth_user_revoke_role,omitempty"` - AuthUserList *AuthUserListRequest `protobuf:"bytes,1106,opt,name=auth_user_list,json=authUserList,proto3" json:"auth_user_list,omitempty"` - AuthRoleList *AuthRoleListRequest `protobuf:"bytes,1107,opt,name=auth_role_list,json=authRoleList,proto3" json:"auth_role_list,omitempty"` - AuthRoleAdd *AuthRoleAddRequest `protobuf:"bytes,1200,opt,name=auth_role_add,json=authRoleAdd,proto3" json:"auth_role_add,omitempty"` - AuthRoleDelete *AuthRoleDeleteRequest `protobuf:"bytes,1201,opt,name=auth_role_delete,json=authRoleDelete,proto3" json:"auth_role_delete,omitempty"` - AuthRoleGet *AuthRoleGetRequest `protobuf:"bytes,1202,opt,name=auth_role_get,json=authRoleGet,proto3" json:"auth_role_get,omitempty"` - AuthRoleGrantPermission *AuthRoleGrantPermissionRequest `protobuf:"bytes,1203,opt,name=auth_role_grant_permission,json=authRoleGrantPermission,proto3" json:"auth_role_grant_permission,omitempty"` - AuthRoleRevokePermission *AuthRoleRevokePermissionRequest `protobuf:"bytes,1204,opt,name=auth_role_revoke_permission,json=authRoleRevokePermission,proto3" json:"auth_role_revoke_permission,omitempty"` - ClusterVersionSet *membershippb.ClusterVersionSetRequest `protobuf:"bytes,1300,opt,name=cluster_version_set,json=clusterVersionSet,proto3" json:"cluster_version_set,omitempty"` - ClusterMemberAttrSet *membershippb.ClusterMemberAttrSetRequest `protobuf:"bytes,1301,opt,name=cluster_member_attr_set,json=clusterMemberAttrSet,proto3" json:"cluster_member_attr_set,omitempty"` - DowngradeInfoSet *membershippb.DowngradeInfoSetRequest `protobuf:"bytes,1302,opt,name=downgrade_info_set,json=downgradeInfoSet,proto3" json:"downgrade_info_set,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *InternalRaftRequest) Reset() { *m = InternalRaftRequest{} } -func (m *InternalRaftRequest) String() string { return proto.CompactTextString(m) } -func (*InternalRaftRequest) ProtoMessage() {} -func (*InternalRaftRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b4c9a9be0cfca103, []int{1} -} -func (m *InternalRaftRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *InternalRaftRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_InternalRaftRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *InternalRaftRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_InternalRaftRequest.Merge(m, src) -} -func (m *InternalRaftRequest) XXX_Size() int { - return m.Size() -} -func (m *InternalRaftRequest) XXX_DiscardUnknown() { - xxx_messageInfo_InternalRaftRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_InternalRaftRequest proto.InternalMessageInfo - -type EmptyResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EmptyResponse) Reset() { *m = EmptyResponse{} } -func (m *EmptyResponse) String() string { return proto.CompactTextString(m) } -func (*EmptyResponse) ProtoMessage() {} -func (*EmptyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b4c9a9be0cfca103, []int{2} -} -func (m *EmptyResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EmptyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EmptyResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EmptyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_EmptyResponse.Merge(m, src) -} -func (m *EmptyResponse) XXX_Size() int { - return m.Size() -} -func (m *EmptyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_EmptyResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_EmptyResponse proto.InternalMessageInfo - -// What is the difference between AuthenticateRequest (defined in rpc.proto) and InternalAuthenticateRequest? -// InternalAuthenticateRequest has a member that is filled by etcdserver and shouldn't be user-facing. -// For avoiding misusage the field, we have an internal version of AuthenticateRequest. -type InternalAuthenticateRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - // simple_token is generated in API layer (etcdserver/v3_server.go) - SimpleToken string `protobuf:"bytes,3,opt,name=simple_token,json=simpleToken,proto3" json:"simple_token,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *InternalAuthenticateRequest) Reset() { *m = InternalAuthenticateRequest{} } -func (m *InternalAuthenticateRequest) String() string { return proto.CompactTextString(m) } -func (*InternalAuthenticateRequest) ProtoMessage() {} -func (*InternalAuthenticateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b4c9a9be0cfca103, []int{3} -} -func (m *InternalAuthenticateRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *InternalAuthenticateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_InternalAuthenticateRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *InternalAuthenticateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_InternalAuthenticateRequest.Merge(m, src) -} -func (m *InternalAuthenticateRequest) XXX_Size() int { - return m.Size() -} -func (m *InternalAuthenticateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_InternalAuthenticateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_InternalAuthenticateRequest proto.InternalMessageInfo - -func init() { - proto.RegisterType((*RequestHeader)(nil), "etcdserverpb.RequestHeader") - proto.RegisterType((*InternalRaftRequest)(nil), "etcdserverpb.InternalRaftRequest") - proto.RegisterType((*EmptyResponse)(nil), "etcdserverpb.EmptyResponse") - proto.RegisterType((*InternalAuthenticateRequest)(nil), "etcdserverpb.InternalAuthenticateRequest") -} - -func init() { proto.RegisterFile("raft_internal.proto", fileDescriptor_b4c9a9be0cfca103) } - -var fileDescriptor_b4c9a9be0cfca103 = []byte{ - // 1003 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x96, 0xd9, 0x72, 0x1b, 0x45, - 0x14, 0x86, 0x23, 0xc5, 0x71, 0xac, 0x96, 0xed, 0x38, 0x6d, 0x87, 0x34, 0x72, 0x95, 0x70, 0x1c, - 0x12, 0xcc, 0x66, 0x53, 0xca, 0x03, 0x80, 0x90, 0x5c, 0x8e, 0xab, 0x42, 0x70, 0x4d, 0xcc, 0x52, - 0xc5, 0xc5, 0xd0, 0x9a, 0x39, 0x96, 0x06, 0xcf, 0x46, 0x77, 0x4b, 0x31, 0xef, 0x11, 0x28, 0x1e, - 0x83, 0xed, 0x21, 0x72, 0xc1, 0x62, 0xe0, 0x05, 0xc0, 0xdc, 0x70, 0x0f, 0xdc, 0x53, 0xbd, 0xcc, - 0x26, 0xb5, 0x7c, 0xa7, 0xf9, 0xcf, 0x7f, 0xbe, 0x73, 0xba, 0xe7, 0xf4, 0xa8, 0xd1, 0x3a, 0xa3, - 0x27, 0xc2, 0x0d, 0x62, 0x01, 0x2c, 0xa6, 0xe1, 0x6e, 0xca, 0x12, 0x91, 0xe0, 0x65, 0x10, 0x9e, - 0xcf, 0x81, 0x4d, 0x80, 0xa5, 0x83, 0xd6, 0xc6, 0x30, 0x19, 0x26, 0x2a, 0xb0, 0x27, 0x7f, 0x69, - 0x4f, 0x6b, 0xad, 0xf0, 0x18, 0xa5, 0xc1, 0x52, 0xcf, 0xfc, 0xbc, 0x2f, 0x83, 0x7b, 0x34, 0x0d, - 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0x61, 0x3f, 0x79, 0x1a, 0x0f, 0x19, 0xf5, 0xc1, 0x0d, - 0xe2, 0x93, 0x44, 0xd1, 0xbf, 0xd2, 0xf4, 0x7b, 0x55, 0x7a, 0x3f, 0x33, 0x1e, 0xc6, 0x27, 0x49, - 0x89, 0xbc, 0xe6, 0x4f, 0x05, 0xb6, 0x6f, 0xa0, 0x95, 0xfd, 0x28, 0x15, 0x5f, 0x38, 0xc0, 0xd3, - 0x24, 0xe6, 0xb0, 0x9d, 0xa2, 0xcd, 0x4b, 0x3e, 0xcd, 0x18, 0xa3, 0x05, 0x75, 0x07, 0xab, 0xa9, - 0x3b, 0x98, 0xfa, 0x2d, 0xef, 0x66, 0xf9, 0x17, 0xcb, 0xdc, 0xcd, 0xb2, 0x67, 0x7c, 0x07, 0x2d, - 0xf3, 0x20, 0x4a, 0x43, 0x70, 0x45, 0x72, 0x0a, 0xfa, 0x6a, 0xd6, 0x70, 0x9a, 0x5a, 0x3b, 0x96, - 0xd2, 0xbb, 0x1b, 0xcf, 0xff, 0x6c, 0x5f, 0x79, 0x7e, 0xd1, 0xae, 0x9d, 0x5f, 0xb4, 0x6b, 0x7f, - 0x5c, 0xb4, 0x6b, 0x5f, 0xff, 0xd5, 0xbe, 0x32, 0x58, 0x54, 0x17, 0xc3, 0x07, 0xff, 0x07, 0x00, - 0x00, 0xff, 0xff, 0x94, 0x6f, 0x64, 0x0a, 0x98, 0x0a, 0x00, 0x00, -} - -func (m *RequestHeader) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RequestHeader) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.AuthRevision != 0 { - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRevision)) - i-- - dAtA[i] = 0x18 - } - if len(m.Username) > 0 { - i -= len(m.Username) - copy(dAtA[i:], m.Username) - i = encodeVarintRaftInternal(dAtA, i, uint64(len(m.Username))) - i-- - dAtA[i] = 0x12 - } - if m.ID != 0 { - i = encodeVarintRaftInternal(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *InternalRaftRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InternalRaftRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.DowngradeInfoSet != nil { - { - size, err := m.DowngradeInfoSet.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x51 - i-- - dAtA[i] = 0xb2 - } - if m.ClusterMemberAttrSet != nil { - { - size, err := m.ClusterMemberAttrSet.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x51 - i-- - dAtA[i] = 0xaa - } - if m.ClusterVersionSet != nil { - { - size, err := m.ClusterVersionSet.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x51 - i-- - dAtA[i] = 0xa2 - } - if m.AuthRoleRevokePermission != nil { - { - size, err := m.AuthRoleRevokePermission.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4b - i-- - dAtA[i] = 0xa2 - } - if m.AuthRoleGrantPermission != nil { - { - size, err := m.AuthRoleGrantPermission.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4b - i-- - dAtA[i] = 0x9a - } - if m.AuthRoleGet != nil { - { - size, err := m.AuthRoleGet.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4b - i-- - dAtA[i] = 0x92 - } - if m.AuthRoleDelete != nil { - { - size, err := m.AuthRoleDelete.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4b - i-- - dAtA[i] = 0x8a - } - if m.AuthRoleAdd != nil { - { - size, err := m.AuthRoleAdd.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4b - i-- - dAtA[i] = 0x82 - } - if m.AuthRoleList != nil { - { - size, err := m.AuthRoleList.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x45 - i-- - dAtA[i] = 0x9a - } - if m.AuthUserList != nil { - { - size, err := m.AuthUserList.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x45 - i-- - dAtA[i] = 0x92 - } - if m.AuthUserRevokeRole != nil { - { - size, err := m.AuthUserRevokeRole.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x45 - i-- - dAtA[i] = 0x8a - } - if m.AuthUserGrantRole != nil { - { - size, err := m.AuthUserGrantRole.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x45 - i-- - dAtA[i] = 0x82 - } - if m.AuthUserChangePassword != nil { - { - size, err := m.AuthUserChangePassword.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x44 - i-- - dAtA[i] = 0xfa - } - if m.AuthUserGet != nil { - { - size, err := m.AuthUserGet.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x44 - i-- - dAtA[i] = 0xf2 - } - if m.AuthUserDelete != nil { - { - size, err := m.AuthUserDelete.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x44 - i-- - dAtA[i] = 0xea - } - if m.AuthUserAdd != nil { - { - size, err := m.AuthUserAdd.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x44 - i-- - dAtA[i] = 0xe2 - } - if m.AuthStatus != nil { - { - size, err := m.AuthStatus.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3f - i-- - dAtA[i] = 0xaa - } - if m.Authenticate != nil { - { - size, err := m.Authenticate.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3f - i-- - dAtA[i] = 0xa2 - } - if m.AuthDisable != nil { - { - size, err := m.AuthDisable.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3f - i-- - dAtA[i] = 0x9a - } - if m.AuthEnable != nil { - { - size, err := m.AuthEnable.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3e - i-- - dAtA[i] = 0xc2 - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6 - i-- - dAtA[i] = 0xa2 - } - if m.LeaseCheckpoint != nil { - { - size, err := m.LeaseCheckpoint.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - } - if m.Alarm != nil { - { - size, err := m.Alarm.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - if m.LeaseRevoke != nil { - { - size, err := m.LeaseRevoke.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - if m.LeaseGrant != nil { - { - size, err := m.LeaseGrant.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.Compaction != nil { - { - size, err := m.Compaction.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if m.Txn != nil { - { - size, err := m.Txn.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if m.DeleteRange != nil { - { - size, err := m.DeleteRange.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.Put != nil { - { - size, err := m.Put.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Range != nil { - { - size, err := m.Range.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.V2 != nil { - { - size, err := m.V2.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftInternal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.ID != 0 { - i = encodeVarintRaftInternal(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *EmptyResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EmptyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EmptyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} - -func (m *InternalAuthenticateRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *InternalAuthenticateRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InternalAuthenticateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.SimpleToken) > 0 { - i -= len(m.SimpleToken) - copy(dAtA[i:], m.SimpleToken) - i = encodeVarintRaftInternal(dAtA, i, uint64(len(m.SimpleToken))) - i-- - dAtA[i] = 0x1a - } - if len(m.Password) > 0 { - i -= len(m.Password) - copy(dAtA[i:], m.Password) - i = encodeVarintRaftInternal(dAtA, i, uint64(len(m.Password))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintRaftInternal(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintRaftInternal(dAtA []byte, offset int, v uint64) int { - offset -= sovRaftInternal(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *RequestHeader) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRaftInternal(uint64(m.ID)) - } - l = len(m.Username) - if l > 0 { - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.AuthRevision != 0 { - n += 1 + sovRaftInternal(uint64(m.AuthRevision)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *InternalRaftRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRaftInternal(uint64(m.ID)) - } - if m.V2 != nil { - l = m.V2.Size() - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.Range != nil { - l = m.Range.Size() - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.Put != nil { - l = m.Put.Size() - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.DeleteRange != nil { - l = m.DeleteRange.Size() - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.Txn != nil { - l = m.Txn.Size() - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.Compaction != nil { - l = m.Compaction.Size() - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.LeaseGrant != nil { - l = m.LeaseGrant.Size() - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.LeaseRevoke != nil { - l = m.LeaseRevoke.Size() - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.Alarm != nil { - l = m.Alarm.Size() - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.LeaseCheckpoint != nil { - l = m.LeaseCheckpoint.Size() - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.Header != nil { - l = m.Header.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthEnable != nil { - l = m.AuthEnable.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthDisable != nil { - l = m.AuthDisable.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.Authenticate != nil { - l = m.Authenticate.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthStatus != nil { - l = m.AuthStatus.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthUserAdd != nil { - l = m.AuthUserAdd.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthUserDelete != nil { - l = m.AuthUserDelete.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthUserGet != nil { - l = m.AuthUserGet.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthUserChangePassword != nil { - l = m.AuthUserChangePassword.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthUserGrantRole != nil { - l = m.AuthUserGrantRole.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthUserRevokeRole != nil { - l = m.AuthUserRevokeRole.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthUserList != nil { - l = m.AuthUserList.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthRoleList != nil { - l = m.AuthRoleList.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthRoleAdd != nil { - l = m.AuthRoleAdd.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthRoleDelete != nil { - l = m.AuthRoleDelete.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthRoleGet != nil { - l = m.AuthRoleGet.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthRoleGrantPermission != nil { - l = m.AuthRoleGrantPermission.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthRoleRevokePermission != nil { - l = m.AuthRoleRevokePermission.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.ClusterVersionSet != nil { - l = m.ClusterVersionSet.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.ClusterMemberAttrSet != nil { - l = m.ClusterMemberAttrSet.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.DowngradeInfoSet != nil { - l = m.DowngradeInfoSet.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *EmptyResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *InternalAuthenticateRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRaftInternal(uint64(l)) - } - l = len(m.Password) - if l > 0 { - n += 1 + l + sovRaftInternal(uint64(l)) - } - l = len(m.SimpleToken) - if l > 0 { - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovRaftInternal(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRaftInternal(x uint64) (n int) { - return sovRaftInternal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *RequestHeader) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestHeader: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestHeader: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Username = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthRevision", wireType) - } - m.AuthRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuthRevision |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRaftInternal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaftInternal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: 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 != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field V2", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.V2 == nil { - m.V2 = &Request{} - } - if err := m.V2.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Range", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Range == nil { - m.Range = &RangeRequest{} - } - if err := m.Range.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Put", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Put == nil { - m.Put = &PutRequest{} - } - if err := m.Put.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeleteRange", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DeleteRange == nil { - m.DeleteRange = &DeleteRangeRequest{} - } - if err := m.DeleteRange.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Txn", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Txn == nil { - m.Txn = &TxnRequest{} - } - if err := m.Txn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Compaction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Compaction == nil { - m.Compaction = &CompactionRequest{} - } - if err := m.Compaction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LeaseGrant", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.LeaseGrant == nil { - m.LeaseGrant = &LeaseGrantRequest{} - } - if err := m.LeaseGrant.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LeaseRevoke", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.LeaseRevoke == nil { - m.LeaseRevoke = &LeaseRevokeRequest{} - } - if err := m.LeaseRevoke.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Alarm == nil { - m.Alarm = &AlarmRequest{} - } - if err := m.Alarm.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LeaseCheckpoint", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.LeaseCheckpoint == nil { - m.LeaseCheckpoint = &LeaseCheckpointRequest{} - } - if err := m.LeaseCheckpoint.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 100: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &RequestHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1000: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthEnable", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthEnable == nil { - m.AuthEnable = &AuthEnableRequest{} - } - if err := m.AuthEnable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1011: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthDisable", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthDisable == nil { - m.AuthDisable = &AuthDisableRequest{} - } - if err := m.AuthDisable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1012: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authenticate", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Authenticate == nil { - m.Authenticate = &InternalAuthenticateRequest{} - } - if err := m.Authenticate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1013: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthStatus", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthStatus == nil { - m.AuthStatus = &AuthStatusRequest{} - } - if err := m.AuthStatus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1100: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthUserAdd", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthUserAdd == nil { - m.AuthUserAdd = &AuthUserAddRequest{} - } - if err := m.AuthUserAdd.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1101: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthUserDelete", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthUserDelete == nil { - m.AuthUserDelete = &AuthUserDeleteRequest{} - } - if err := m.AuthUserDelete.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1102: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthUserGet", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthUserGet == nil { - m.AuthUserGet = &AuthUserGetRequest{} - } - if err := m.AuthUserGet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1103: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthUserChangePassword", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthUserChangePassword == nil { - m.AuthUserChangePassword = &AuthUserChangePasswordRequest{} - } - if err := m.AuthUserChangePassword.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1104: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthUserGrantRole", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthUserGrantRole == nil { - m.AuthUserGrantRole = &AuthUserGrantRoleRequest{} - } - if err := m.AuthUserGrantRole.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1105: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthUserRevokeRole", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthUserRevokeRole == nil { - m.AuthUserRevokeRole = &AuthUserRevokeRoleRequest{} - } - if err := m.AuthUserRevokeRole.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1106: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthUserList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthUserList == nil { - m.AuthUserList = &AuthUserListRequest{} - } - if err := m.AuthUserList.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1107: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthRoleList == nil { - m.AuthRoleList = &AuthRoleListRequest{} - } - if err := m.AuthRoleList.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1200: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleAdd", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthRoleAdd == nil { - m.AuthRoleAdd = &AuthRoleAddRequest{} - } - if err := m.AuthRoleAdd.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1201: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleDelete", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthRoleDelete == nil { - m.AuthRoleDelete = &AuthRoleDeleteRequest{} - } - if err := m.AuthRoleDelete.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1202: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleGet", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthRoleGet == nil { - m.AuthRoleGet = &AuthRoleGetRequest{} - } - if err := m.AuthRoleGet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1203: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleGrantPermission", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthRoleGrantPermission == nil { - m.AuthRoleGrantPermission = &AuthRoleGrantPermissionRequest{} - } - if err := m.AuthRoleGrantPermission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1204: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleRevokePermission", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthRoleRevokePermission == nil { - m.AuthRoleRevokePermission = &AuthRoleRevokePermissionRequest{} - } - if err := m.AuthRoleRevokePermission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1300: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClusterVersionSet", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ClusterVersionSet == nil { - m.ClusterVersionSet = &membershippb.ClusterVersionSetRequest{} - } - if err := m.ClusterVersionSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1301: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClusterMemberAttrSet", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ClusterMemberAttrSet == nil { - m.ClusterMemberAttrSet = &membershippb.ClusterMemberAttrSetRequest{} - } - if err := m.ClusterMemberAttrSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1302: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DowngradeInfoSet", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DowngradeInfoSet == nil { - m.DowngradeInfoSet = &membershippb.DowngradeInfoSetRequest{} - } - if err := m.DowngradeInfoSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaftInternal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaftInternal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EmptyResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EmptyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EmptyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRaftInternal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaftInternal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *InternalAuthenticateRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: InternalAuthenticateRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InternalAuthenticateRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Password = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SimpleToken", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRaftInternal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SimpleToken = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaftInternal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaftInternal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRaftInternal(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthRaftInternal - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRaftInternal - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRaftInternal - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthRaftInternal = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRaftInternal = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRaftInternal = fmt.Errorf("proto: unexpected end of group") -) diff --git a/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/raft_internal.proto b/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/raft_internal.proto deleted file mode 100644 index 68926e59f..000000000 --- a/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/raft_internal.proto +++ /dev/null @@ -1,81 +0,0 @@ -syntax = "proto3"; -package etcdserverpb; - -import "gogoproto/gogo.proto"; -import "etcdserver.proto"; -import "rpc.proto"; -import "etcd/api/membershippb/membership.proto"; - -option (gogoproto.marshaler_all) = true; -option (gogoproto.sizer_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; - -message RequestHeader { - uint64 ID = 1; - // username is a username that is associated with an auth token of gRPC connection - string username = 2; - // auth_revision is a revision number of auth.authStore. It is not related to mvcc - uint64 auth_revision = 3; -} - -// An InternalRaftRequest is the union of all requests which can be -// sent via raft. -message InternalRaftRequest { - RequestHeader header = 100; - uint64 ID = 1; - - Request v2 = 2; - - RangeRequest range = 3; - PutRequest put = 4; - DeleteRangeRequest delete_range = 5; - TxnRequest txn = 6; - CompactionRequest compaction = 7; - - LeaseGrantRequest lease_grant = 8; - LeaseRevokeRequest lease_revoke = 9; - - AlarmRequest alarm = 10; - - LeaseCheckpointRequest lease_checkpoint = 11; - - AuthEnableRequest auth_enable = 1000; - AuthDisableRequest auth_disable = 1011; - AuthStatusRequest auth_status = 1013; - - InternalAuthenticateRequest authenticate = 1012; - - AuthUserAddRequest auth_user_add = 1100; - AuthUserDeleteRequest auth_user_delete = 1101; - AuthUserGetRequest auth_user_get = 1102; - AuthUserChangePasswordRequest auth_user_change_password = 1103; - AuthUserGrantRoleRequest auth_user_grant_role = 1104; - AuthUserRevokeRoleRequest auth_user_revoke_role = 1105; - AuthUserListRequest auth_user_list = 1106; - AuthRoleListRequest auth_role_list = 1107; - - AuthRoleAddRequest auth_role_add = 1200; - AuthRoleDeleteRequest auth_role_delete = 1201; - AuthRoleGetRequest auth_role_get = 1202; - AuthRoleGrantPermissionRequest auth_role_grant_permission = 1203; - AuthRoleRevokePermissionRequest auth_role_revoke_permission = 1204; - - membershippb.ClusterVersionSetRequest cluster_version_set = 1300; - membershippb.ClusterMemberAttrSetRequest cluster_member_attr_set = 1301; - membershippb.DowngradeInfoSetRequest downgrade_info_set = 1302; -} - -message EmptyResponse { -} - -// What is the difference between AuthenticateRequest (defined in rpc.proto) and InternalAuthenticateRequest? -// InternalAuthenticateRequest has a member that is filled by etcdserver and shouldn't be user-facing. -// For avoiding misusage the field, we have an internal version of AuthenticateRequest. -message InternalAuthenticateRequest { - string name = 1; - string password = 2; - - // simple_token is generated in API layer (etcdserver/v3_server.go) - string simple_token = 3; -} diff --git a/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/raft_internal_stringer.go b/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/raft_internal_stringer.go deleted file mode 100644 index 31e121ee0..000000000 --- a/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/raft_internal_stringer.go +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package etcdserverpb - -import ( - "fmt" - "strings" - - proto "github.com/golang/protobuf/proto" -) - -// InternalRaftStringer implements custom proto Stringer: -// redact password, replace value fields with value_size fields. -type InternalRaftStringer struct { - Request *InternalRaftRequest -} - -func (as *InternalRaftStringer) String() string { - switch { - case as.Request.LeaseGrant != nil: - return fmt.Sprintf("header:<%s> lease_grant:", - as.Request.Header.String(), - as.Request.LeaseGrant.TTL, - as.Request.LeaseGrant.ID, - ) - case as.Request.LeaseRevoke != nil: - return fmt.Sprintf("header:<%s> lease_revoke:", - as.Request.Header.String(), - as.Request.LeaseRevoke.ID, - ) - case as.Request.Authenticate != nil: - return fmt.Sprintf("header:<%s> authenticate:", - as.Request.Header.String(), - as.Request.Authenticate.Name, - as.Request.Authenticate.SimpleToken, - ) - case as.Request.AuthUserAdd != nil: - return fmt.Sprintf("header:<%s> auth_user_add:", - as.Request.Header.String(), - as.Request.AuthUserAdd.Name, - ) - case as.Request.AuthUserChangePassword != nil: - return fmt.Sprintf("header:<%s> auth_user_change_password:", - as.Request.Header.String(), - as.Request.AuthUserChangePassword.Name, - ) - case as.Request.Put != nil: - return fmt.Sprintf("header:<%s> put:<%s>", - as.Request.Header.String(), - NewLoggablePutRequest(as.Request.Put).String(), - ) - case as.Request.Txn != nil: - return fmt.Sprintf("header:<%s> txn:<%s>", - as.Request.Header.String(), - NewLoggableTxnRequest(as.Request.Txn).String(), - ) - default: - // nothing to redact - } - return as.Request.String() -} - -// txnRequestStringer implements a custom proto String to replace value bytes fields with value size -// fields in any nested txn and put operations. -type txnRequestStringer struct { - Request *TxnRequest -} - -func NewLoggableTxnRequest(request *TxnRequest) *txnRequestStringer { - return &txnRequestStringer{request} -} - -func (as *txnRequestStringer) String() string { - var compare []string - for _, c := range as.Request.Compare { - switch cv := c.TargetUnion.(type) { - case *Compare_Value: - compare = append(compare, newLoggableValueCompare(c, cv).String()) - default: - // nothing to redact - compare = append(compare, c.String()) - } - } - var success []string - for _, s := range as.Request.Success { - success = append(success, newLoggableRequestOp(s).String()) - } - var failure []string - for _, f := range as.Request.Failure { - failure = append(failure, newLoggableRequestOp(f).String()) - } - return fmt.Sprintf("compare:<%s> success:<%s> failure:<%s>", - strings.Join(compare, " "), - strings.Join(success, " "), - strings.Join(failure, " "), - ) -} - -// requestOpStringer implements a custom proto String to replace value bytes fields with value -// size fields in any nested txn and put operations. -type requestOpStringer struct { - Op *RequestOp -} - -func newLoggableRequestOp(op *RequestOp) *requestOpStringer { - return &requestOpStringer{op} -} - -func (as *requestOpStringer) String() string { - switch op := as.Op.Request.(type) { - case *RequestOp_RequestPut: - return fmt.Sprintf("request_put:<%s>", NewLoggablePutRequest(op.RequestPut).String()) - case *RequestOp_RequestTxn: - return fmt.Sprintf("request_txn:<%s>", NewLoggableTxnRequest(op.RequestTxn).String()) - default: - // nothing to redact - } - return as.Op.String() -} - -// loggableValueCompare implements a custom proto String for Compare.Value union member types to -// replace the value bytes field with a value size field. -// To preserve proto encoding of the key and range_end bytes, a faked out proto type is used here. -type loggableValueCompare struct { - Result Compare_CompareResult `protobuf:"varint,1,opt,name=result,proto3,enum=etcdserverpb.Compare_CompareResult"` - Target Compare_CompareTarget `protobuf:"varint,2,opt,name=target,proto3,enum=etcdserverpb.Compare_CompareTarget"` - Key []byte `protobuf:"bytes,3,opt,name=key,proto3"` - ValueSize int64 `protobuf:"varint,7,opt,name=value_size,proto3"` - RangeEnd []byte `protobuf:"bytes,64,opt,name=range_end,proto3"` -} - -func newLoggableValueCompare(c *Compare, cv *Compare_Value) *loggableValueCompare { - return &loggableValueCompare{ - c.Result, - c.Target, - c.Key, - int64(len(cv.Value)), - c.RangeEnd, - } -} - -func (m *loggableValueCompare) Reset() { *m = loggableValueCompare{} } -func (m *loggableValueCompare) String() string { return proto.CompactTextString(m) } -func (*loggableValueCompare) ProtoMessage() {} - -// loggablePutRequest implements a custom proto String to replace value bytes field with a value -// size field. -// To preserve proto encoding of the key bytes, a faked out proto type is used here. -type loggablePutRequest struct { - Key []byte `protobuf:"bytes,1,opt,name=key,proto3"` - ValueSize int64 `protobuf:"varint,2,opt,name=value_size,proto3"` - Lease int64 `protobuf:"varint,3,opt,name=lease,proto3"` - PrevKv bool `protobuf:"varint,4,opt,name=prev_kv,proto3"` - IgnoreValue bool `protobuf:"varint,5,opt,name=ignore_value,proto3"` - IgnoreLease bool `protobuf:"varint,6,opt,name=ignore_lease,proto3"` -} - -func NewLoggablePutRequest(request *PutRequest) *loggablePutRequest { - return &loggablePutRequest{ - request.Key, - int64(len(request.Value)), - request.Lease, - request.PrevKv, - request.IgnoreValue, - request.IgnoreLease, - } -} - -func (m *loggablePutRequest) Reset() { *m = loggablePutRequest{} } -func (m *loggablePutRequest) String() string { return proto.CompactTextString(m) } -func (*loggablePutRequest) ProtoMessage() {} diff --git a/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/rpc.pb.go b/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/rpc.pb.go deleted file mode 100644 index 8120907d9..000000000 --- a/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/rpc.pb.go +++ /dev/null @@ -1,25862 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: rpc.proto - -package etcdserverpb - -import ( - context "context" - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/golang/protobuf/proto" - authpb "go.etcd.io/etcd/api/v3/authpb" - mvccpb "go.etcd.io/etcd/api/v3/mvccpb" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// 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. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type AlarmType int32 - -const ( - AlarmType_NONE AlarmType = 0 - AlarmType_NOSPACE AlarmType = 1 - AlarmType_CORRUPT AlarmType = 2 -) - -var AlarmType_name = map[int32]string{ - 0: "NONE", - 1: "NOSPACE", - 2: "CORRUPT", -} - -var AlarmType_value = map[string]int32{ - "NONE": 0, - "NOSPACE": 1, - "CORRUPT": 2, -} - -func (x AlarmType) String() string { - return proto.EnumName(AlarmType_name, int32(x)) -} - -func (AlarmType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{0} -} - -type RangeRequest_SortOrder int32 - -const ( - RangeRequest_NONE RangeRequest_SortOrder = 0 - RangeRequest_ASCEND RangeRequest_SortOrder = 1 - RangeRequest_DESCEND RangeRequest_SortOrder = 2 -) - -var RangeRequest_SortOrder_name = map[int32]string{ - 0: "NONE", - 1: "ASCEND", - 2: "DESCEND", -} - -var RangeRequest_SortOrder_value = map[string]int32{ - "NONE": 0, - "ASCEND": 1, - "DESCEND": 2, -} - -func (x RangeRequest_SortOrder) String() string { - return proto.EnumName(RangeRequest_SortOrder_name, int32(x)) -} - -func (RangeRequest_SortOrder) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{1, 0} -} - -type RangeRequest_SortTarget int32 - -const ( - RangeRequest_KEY RangeRequest_SortTarget = 0 - RangeRequest_VERSION RangeRequest_SortTarget = 1 - RangeRequest_CREATE RangeRequest_SortTarget = 2 - RangeRequest_MOD RangeRequest_SortTarget = 3 - RangeRequest_VALUE RangeRequest_SortTarget = 4 -) - -var RangeRequest_SortTarget_name = map[int32]string{ - 0: "KEY", - 1: "VERSION", - 2: "CREATE", - 3: "MOD", - 4: "VALUE", -} - -var RangeRequest_SortTarget_value = map[string]int32{ - "KEY": 0, - "VERSION": 1, - "CREATE": 2, - "MOD": 3, - "VALUE": 4, -} - -func (x RangeRequest_SortTarget) String() string { - return proto.EnumName(RangeRequest_SortTarget_name, int32(x)) -} - -func (RangeRequest_SortTarget) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{1, 1} -} - -type Compare_CompareResult int32 - -const ( - Compare_EQUAL Compare_CompareResult = 0 - Compare_GREATER Compare_CompareResult = 1 - Compare_LESS Compare_CompareResult = 2 - Compare_NOT_EQUAL Compare_CompareResult = 3 -) - -var Compare_CompareResult_name = map[int32]string{ - 0: "EQUAL", - 1: "GREATER", - 2: "LESS", - 3: "NOT_EQUAL", -} - -var Compare_CompareResult_value = map[string]int32{ - "EQUAL": 0, - "GREATER": 1, - "LESS": 2, - "NOT_EQUAL": 3, -} - -func (x Compare_CompareResult) String() string { - return proto.EnumName(Compare_CompareResult_name, int32(x)) -} - -func (Compare_CompareResult) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{9, 0} -} - -type Compare_CompareTarget int32 - -const ( - Compare_VERSION Compare_CompareTarget = 0 - Compare_CREATE Compare_CompareTarget = 1 - Compare_MOD Compare_CompareTarget = 2 - Compare_VALUE Compare_CompareTarget = 3 - Compare_LEASE Compare_CompareTarget = 4 -) - -var Compare_CompareTarget_name = map[int32]string{ - 0: "VERSION", - 1: "CREATE", - 2: "MOD", - 3: "VALUE", - 4: "LEASE", -} - -var Compare_CompareTarget_value = map[string]int32{ - "VERSION": 0, - "CREATE": 1, - "MOD": 2, - "VALUE": 3, - "LEASE": 4, -} - -func (x Compare_CompareTarget) String() string { - return proto.EnumName(Compare_CompareTarget_name, int32(x)) -} - -func (Compare_CompareTarget) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{9, 1} -} - -type WatchCreateRequest_FilterType int32 - -const ( - // filter out put event. - WatchCreateRequest_NOPUT WatchCreateRequest_FilterType = 0 - // filter out delete event. - WatchCreateRequest_NODELETE WatchCreateRequest_FilterType = 1 -) - -var WatchCreateRequest_FilterType_name = map[int32]string{ - 0: "NOPUT", - 1: "NODELETE", -} - -var WatchCreateRequest_FilterType_value = map[string]int32{ - "NOPUT": 0, - "NODELETE": 1, -} - -func (x WatchCreateRequest_FilterType) String() string { - return proto.EnumName(WatchCreateRequest_FilterType_name, int32(x)) -} - -func (WatchCreateRequest_FilterType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{21, 0} -} - -type AlarmRequest_AlarmAction int32 - -const ( - AlarmRequest_GET AlarmRequest_AlarmAction = 0 - AlarmRequest_ACTIVATE AlarmRequest_AlarmAction = 1 - AlarmRequest_DEACTIVATE AlarmRequest_AlarmAction = 2 -) - -var AlarmRequest_AlarmAction_name = map[int32]string{ - 0: "GET", - 1: "ACTIVATE", - 2: "DEACTIVATE", -} - -var AlarmRequest_AlarmAction_value = map[string]int32{ - "GET": 0, - "ACTIVATE": 1, - "DEACTIVATE": 2, -} - -func (x AlarmRequest_AlarmAction) String() string { - return proto.EnumName(AlarmRequest_AlarmAction_name, int32(x)) -} - -func (AlarmRequest_AlarmAction) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{54, 0} -} - -type DowngradeRequest_DowngradeAction int32 - -const ( - DowngradeRequest_VALIDATE DowngradeRequest_DowngradeAction = 0 - DowngradeRequest_ENABLE DowngradeRequest_DowngradeAction = 1 - DowngradeRequest_CANCEL DowngradeRequest_DowngradeAction = 2 -) - -var DowngradeRequest_DowngradeAction_name = map[int32]string{ - 0: "VALIDATE", - 1: "ENABLE", - 2: "CANCEL", -} - -var DowngradeRequest_DowngradeAction_value = map[string]int32{ - "VALIDATE": 0, - "ENABLE": 1, - "CANCEL": 2, -} - -func (x DowngradeRequest_DowngradeAction) String() string { - return proto.EnumName(DowngradeRequest_DowngradeAction_name, int32(x)) -} - -func (DowngradeRequest_DowngradeAction) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{57, 0} -} - -type ResponseHeader struct { - // cluster_id is the ID of the cluster which sent the response. - ClusterId uint64 `protobuf:"varint,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // member_id is the ID of the member which sent the response. - MemberId uint64 `protobuf:"varint,2,opt,name=member_id,json=memberId,proto3" json:"member_id,omitempty"` - // revision is the key-value store revision when the request was applied. - // For watch progress responses, the header.revision indicates progress. All future events - // recieved in this stream are guaranteed to have a higher revision number than the - // header.revision number. - Revision int64 `protobuf:"varint,3,opt,name=revision,proto3" json:"revision,omitempty"` - // raft_term is the raft term when the request was applied. - RaftTerm uint64 `protobuf:"varint,4,opt,name=raft_term,json=raftTerm,proto3" json:"raft_term,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ResponseHeader) Reset() { *m = ResponseHeader{} } -func (m *ResponseHeader) String() string { return proto.CompactTextString(m) } -func (*ResponseHeader) ProtoMessage() {} -func (*ResponseHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{0} -} -func (m *ResponseHeader) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseHeader.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ResponseHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseHeader.Merge(m, src) -} -func (m *ResponseHeader) XXX_Size() int { - return m.Size() -} -func (m *ResponseHeader) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseHeader proto.InternalMessageInfo - -func (m *ResponseHeader) GetClusterId() uint64 { - if m != nil { - return m.ClusterId - } - return 0 -} - -func (m *ResponseHeader) GetMemberId() uint64 { - if m != nil { - return m.MemberId - } - return 0 -} - -func (m *ResponseHeader) GetRevision() int64 { - if m != nil { - return m.Revision - } - return 0 -} - -func (m *ResponseHeader) GetRaftTerm() uint64 { - if m != nil { - return m.RaftTerm - } - return 0 -} - -type RangeRequest struct { - // key is the first key for the range. If range_end is not given, the request only looks up key. - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // range_end is the upper bound on the requested range [key, range_end). - // If range_end is '\0', the range is all keys >= key. - // If range_end is key plus one (e.g., "aa"+1 == "ab", "a\xff"+1 == "b"), - // then the range request gets all keys prefixed with key. - // If both key and range_end are '\0', then the range request returns all keys. - RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` - // limit is a limit on the number of keys returned for the request. When limit is set to 0, - // it is treated as no limit. - Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` - // revision is the point-in-time of the key-value store to use for the range. - // If revision is less or equal to zero, the range is over the newest key-value store. - // If the revision has been compacted, ErrCompacted is returned as a response. - Revision int64 `protobuf:"varint,4,opt,name=revision,proto3" json:"revision,omitempty"` - // sort_order is the order for returned sorted results. - SortOrder RangeRequest_SortOrder `protobuf:"varint,5,opt,name=sort_order,json=sortOrder,proto3,enum=etcdserverpb.RangeRequest_SortOrder" json:"sort_order,omitempty"` - // sort_target is the key-value field to use for sorting. - SortTarget RangeRequest_SortTarget `protobuf:"varint,6,opt,name=sort_target,json=sortTarget,proto3,enum=etcdserverpb.RangeRequest_SortTarget" json:"sort_target,omitempty"` - // serializable sets the range request to use serializable member-local reads. - // Range requests are linearizable by default; linearizable requests have higher - // latency and lower throughput than serializable requests but reflect the current - // consensus of the cluster. For better performance, in exchange for possible stale reads, - // a serializable range request is served locally without needing to reach consensus - // with other nodes in the cluster. - Serializable bool `protobuf:"varint,7,opt,name=serializable,proto3" json:"serializable,omitempty"` - // keys_only when set returns only the keys and not the values. - KeysOnly bool `protobuf:"varint,8,opt,name=keys_only,json=keysOnly,proto3" json:"keys_only,omitempty"` - // count_only when set returns only the count of the keys in the range. - CountOnly bool `protobuf:"varint,9,opt,name=count_only,json=countOnly,proto3" json:"count_only,omitempty"` - // min_mod_revision is the lower bound for returned key mod revisions; all keys with - // lesser mod revisions will be filtered away. - MinModRevision int64 `protobuf:"varint,10,opt,name=min_mod_revision,json=minModRevision,proto3" json:"min_mod_revision,omitempty"` - // max_mod_revision is the upper bound for returned key mod revisions; all keys with - // greater mod revisions will be filtered away. - MaxModRevision int64 `protobuf:"varint,11,opt,name=max_mod_revision,json=maxModRevision,proto3" json:"max_mod_revision,omitempty"` - // min_create_revision is the lower bound for returned key create revisions; all keys with - // lesser create revisions will be filtered away. - MinCreateRevision int64 `protobuf:"varint,12,opt,name=min_create_revision,json=minCreateRevision,proto3" json:"min_create_revision,omitempty"` - // max_create_revision is the upper bound for returned key create revisions; all keys with - // greater create revisions will be filtered away. - MaxCreateRevision int64 `protobuf:"varint,13,opt,name=max_create_revision,json=maxCreateRevision,proto3" json:"max_create_revision,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RangeRequest) Reset() { *m = RangeRequest{} } -func (m *RangeRequest) String() string { return proto.CompactTextString(m) } -func (*RangeRequest) ProtoMessage() {} -func (*RangeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{1} -} -func (m *RangeRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RangeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RangeRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RangeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RangeRequest.Merge(m, src) -} -func (m *RangeRequest) XXX_Size() int { - return m.Size() -} -func (m *RangeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RangeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RangeRequest proto.InternalMessageInfo - -func (m *RangeRequest) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *RangeRequest) GetRangeEnd() []byte { - if m != nil { - return m.RangeEnd - } - return nil -} - -func (m *RangeRequest) GetLimit() int64 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *RangeRequest) GetRevision() int64 { - if m != nil { - return m.Revision - } - return 0 -} - -func (m *RangeRequest) GetSortOrder() RangeRequest_SortOrder { - if m != nil { - return m.SortOrder - } - return RangeRequest_NONE -} - -func (m *RangeRequest) GetSortTarget() RangeRequest_SortTarget { - if m != nil { - return m.SortTarget - } - return RangeRequest_KEY -} - -func (m *RangeRequest) GetSerializable() bool { - if m != nil { - return m.Serializable - } - return false -} - -func (m *RangeRequest) GetKeysOnly() bool { - if m != nil { - return m.KeysOnly - } - return false -} - -func (m *RangeRequest) GetCountOnly() bool { - if m != nil { - return m.CountOnly - } - return false -} - -func (m *RangeRequest) GetMinModRevision() int64 { - if m != nil { - return m.MinModRevision - } - return 0 -} - -func (m *RangeRequest) GetMaxModRevision() int64 { - if m != nil { - return m.MaxModRevision - } - return 0 -} - -func (m *RangeRequest) GetMinCreateRevision() int64 { - if m != nil { - return m.MinCreateRevision - } - return 0 -} - -func (m *RangeRequest) GetMaxCreateRevision() int64 { - if m != nil { - return m.MaxCreateRevision - } - return 0 -} - -type RangeResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // kvs is the list of key-value pairs matched by the range request. - // kvs is empty when count is requested. - Kvs []*mvccpb.KeyValue `protobuf:"bytes,2,rep,name=kvs,proto3" json:"kvs,omitempty"` - // more indicates if there are more keys to return in the requested range. - More bool `protobuf:"varint,3,opt,name=more,proto3" json:"more,omitempty"` - // count is set to the number of keys within the range when requested. - Count int64 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RangeResponse) Reset() { *m = RangeResponse{} } -func (m *RangeResponse) String() string { return proto.CompactTextString(m) } -func (*RangeResponse) ProtoMessage() {} -func (*RangeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{2} -} -func (m *RangeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RangeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RangeResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RangeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RangeResponse.Merge(m, src) -} -func (m *RangeResponse) XXX_Size() int { - return m.Size() -} -func (m *RangeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RangeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RangeResponse proto.InternalMessageInfo - -func (m *RangeResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *RangeResponse) GetKvs() []*mvccpb.KeyValue { - if m != nil { - return m.Kvs - } - return nil -} - -func (m *RangeResponse) GetMore() bool { - if m != nil { - return m.More - } - return false -} - -func (m *RangeResponse) GetCount() int64 { - if m != nil { - return m.Count - } - return 0 -} - -type PutRequest struct { - // key is the key, in bytes, to put into the key-value store. - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // value is the value, in bytes, to associate with the key in the key-value store. - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - // lease is the lease ID to associate with the key in the key-value store. A lease - // value of 0 indicates no lease. - Lease int64 `protobuf:"varint,3,opt,name=lease,proto3" json:"lease,omitempty"` - // If prev_kv is set, etcd gets the previous key-value pair before changing it. - // The previous key-value pair will be returned in the put response. - PrevKv bool `protobuf:"varint,4,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` - // If ignore_value is set, etcd updates the key using its current value. - // Returns an error if the key does not exist. - IgnoreValue bool `protobuf:"varint,5,opt,name=ignore_value,json=ignoreValue,proto3" json:"ignore_value,omitempty"` - // If ignore_lease is set, etcd updates the key using its current lease. - // Returns an error if the key does not exist. - IgnoreLease bool `protobuf:"varint,6,opt,name=ignore_lease,json=ignoreLease,proto3" json:"ignore_lease,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PutRequest) Reset() { *m = PutRequest{} } -func (m *PutRequest) String() string { return proto.CompactTextString(m) } -func (*PutRequest) ProtoMessage() {} -func (*PutRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{3} -} -func (m *PutRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PutRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PutRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PutRequest.Merge(m, src) -} -func (m *PutRequest) XXX_Size() int { - return m.Size() -} -func (m *PutRequest) XXX_DiscardUnknown() { - xxx_messageInfo_PutRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_PutRequest proto.InternalMessageInfo - -func (m *PutRequest) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *PutRequest) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func (m *PutRequest) GetLease() int64 { - if m != nil { - return m.Lease - } - return 0 -} - -func (m *PutRequest) GetPrevKv() bool { - if m != nil { - return m.PrevKv - } - return false -} - -func (m *PutRequest) GetIgnoreValue() bool { - if m != nil { - return m.IgnoreValue - } - return false -} - -func (m *PutRequest) GetIgnoreLease() bool { - if m != nil { - return m.IgnoreLease - } - return false -} - -type PutResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // if prev_kv is set in the request, the previous key-value pair will be returned. - PrevKv *mvccpb.KeyValue `protobuf:"bytes,2,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PutResponse) Reset() { *m = PutResponse{} } -func (m *PutResponse) String() string { return proto.CompactTextString(m) } -func (*PutResponse) ProtoMessage() {} -func (*PutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{4} -} -func (m *PutResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PutResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PutResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_PutResponse.Merge(m, src) -} -func (m *PutResponse) XXX_Size() int { - return m.Size() -} -func (m *PutResponse) XXX_DiscardUnknown() { - xxx_messageInfo_PutResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_PutResponse proto.InternalMessageInfo - -func (m *PutResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *PutResponse) GetPrevKv() *mvccpb.KeyValue { - if m != nil { - return m.PrevKv - } - return nil -} - -type DeleteRangeRequest struct { - // key is the first key to delete in the range. - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // range_end is the key following the last key to delete for the range [key, range_end). - // If range_end is not given, the range is defined to contain only the key argument. - // If range_end is one bit larger than the given key, then the range is all the keys - // with the prefix (the given key). - // If range_end is '\0', the range is all keys greater than or equal to the key argument. - RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` - // If prev_kv is set, etcd gets the previous key-value pairs before deleting it. - // The previous key-value pairs will be returned in the delete response. - PrevKv bool `protobuf:"varint,3,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteRangeRequest) Reset() { *m = DeleteRangeRequest{} } -func (m *DeleteRangeRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteRangeRequest) ProtoMessage() {} -func (*DeleteRangeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{5} -} -func (m *DeleteRangeRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DeleteRangeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DeleteRangeRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DeleteRangeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteRangeRequest.Merge(m, src) -} -func (m *DeleteRangeRequest) XXX_Size() int { - return m.Size() -} -func (m *DeleteRangeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteRangeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteRangeRequest proto.InternalMessageInfo - -func (m *DeleteRangeRequest) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *DeleteRangeRequest) GetRangeEnd() []byte { - if m != nil { - return m.RangeEnd - } - return nil -} - -func (m *DeleteRangeRequest) GetPrevKv() bool { - if m != nil { - return m.PrevKv - } - return false -} - -type DeleteRangeResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // deleted is the number of keys deleted by the delete range request. - Deleted int64 `protobuf:"varint,2,opt,name=deleted,proto3" json:"deleted,omitempty"` - // if prev_kv is set in the request, the previous key-value pairs will be returned. - PrevKvs []*mvccpb.KeyValue `protobuf:"bytes,3,rep,name=prev_kvs,json=prevKvs,proto3" json:"prev_kvs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteRangeResponse) Reset() { *m = DeleteRangeResponse{} } -func (m *DeleteRangeResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteRangeResponse) ProtoMessage() {} -func (*DeleteRangeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{6} -} -func (m *DeleteRangeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DeleteRangeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DeleteRangeResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DeleteRangeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteRangeResponse.Merge(m, src) -} -func (m *DeleteRangeResponse) XXX_Size() int { - return m.Size() -} -func (m *DeleteRangeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteRangeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteRangeResponse proto.InternalMessageInfo - -func (m *DeleteRangeResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *DeleteRangeResponse) GetDeleted() int64 { - if m != nil { - return m.Deleted - } - return 0 -} - -func (m *DeleteRangeResponse) GetPrevKvs() []*mvccpb.KeyValue { - if m != nil { - return m.PrevKvs - } - return nil -} - -type RequestOp struct { - // request is a union of request types accepted by a transaction. - // - // Types that are valid to be assigned to Request: - // *RequestOp_RequestRange - // *RequestOp_RequestPut - // *RequestOp_RequestDeleteRange - // *RequestOp_RequestTxn - Request isRequestOp_Request `protobuf_oneof:"request"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RequestOp) Reset() { *m = RequestOp{} } -func (m *RequestOp) String() string { return proto.CompactTextString(m) } -func (*RequestOp) ProtoMessage() {} -func (*RequestOp) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{7} -} -func (m *RequestOp) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestOp.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RequestOp) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestOp.Merge(m, src) -} -func (m *RequestOp) XXX_Size() int { - return m.Size() -} -func (m *RequestOp) XXX_DiscardUnknown() { - xxx_messageInfo_RequestOp.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestOp proto.InternalMessageInfo - -type isRequestOp_Request interface { - isRequestOp_Request() - MarshalTo([]byte) (int, error) - Size() int -} - -type RequestOp_RequestRange struct { - RequestRange *RangeRequest `protobuf:"bytes,1,opt,name=request_range,json=requestRange,proto3,oneof" json:"request_range,omitempty"` -} -type RequestOp_RequestPut struct { - RequestPut *PutRequest `protobuf:"bytes,2,opt,name=request_put,json=requestPut,proto3,oneof" json:"request_put,omitempty"` -} -type RequestOp_RequestDeleteRange struct { - RequestDeleteRange *DeleteRangeRequest `protobuf:"bytes,3,opt,name=request_delete_range,json=requestDeleteRange,proto3,oneof" json:"request_delete_range,omitempty"` -} -type RequestOp_RequestTxn struct { - RequestTxn *TxnRequest `protobuf:"bytes,4,opt,name=request_txn,json=requestTxn,proto3,oneof" json:"request_txn,omitempty"` -} - -func (*RequestOp_RequestRange) isRequestOp_Request() {} -func (*RequestOp_RequestPut) isRequestOp_Request() {} -func (*RequestOp_RequestDeleteRange) isRequestOp_Request() {} -func (*RequestOp_RequestTxn) isRequestOp_Request() {} - -func (m *RequestOp) GetRequest() isRequestOp_Request { - if m != nil { - return m.Request - } - return nil -} - -func (m *RequestOp) GetRequestRange() *RangeRequest { - if x, ok := m.GetRequest().(*RequestOp_RequestRange); ok { - return x.RequestRange - } - return nil -} - -func (m *RequestOp) GetRequestPut() *PutRequest { - if x, ok := m.GetRequest().(*RequestOp_RequestPut); ok { - return x.RequestPut - } - return nil -} - -func (m *RequestOp) GetRequestDeleteRange() *DeleteRangeRequest { - if x, ok := m.GetRequest().(*RequestOp_RequestDeleteRange); ok { - return x.RequestDeleteRange - } - return nil -} - -func (m *RequestOp) GetRequestTxn() *TxnRequest { - if x, ok := m.GetRequest().(*RequestOp_RequestTxn); ok { - return x.RequestTxn - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*RequestOp) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*RequestOp_RequestRange)(nil), - (*RequestOp_RequestPut)(nil), - (*RequestOp_RequestDeleteRange)(nil), - (*RequestOp_RequestTxn)(nil), - } -} - -type ResponseOp struct { - // response is a union of response types returned by a transaction. - // - // Types that are valid to be assigned to Response: - // *ResponseOp_ResponseRange - // *ResponseOp_ResponsePut - // *ResponseOp_ResponseDeleteRange - // *ResponseOp_ResponseTxn - Response isResponseOp_Response `protobuf_oneof:"response"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ResponseOp) Reset() { *m = ResponseOp{} } -func (m *ResponseOp) String() string { return proto.CompactTextString(m) } -func (*ResponseOp) ProtoMessage() {} -func (*ResponseOp) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{8} -} -func (m *ResponseOp) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseOp.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ResponseOp) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseOp.Merge(m, src) -} -func (m *ResponseOp) XXX_Size() int { - return m.Size() -} -func (m *ResponseOp) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseOp.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseOp proto.InternalMessageInfo - -type isResponseOp_Response interface { - isResponseOp_Response() - MarshalTo([]byte) (int, error) - Size() int -} - -type ResponseOp_ResponseRange struct { - ResponseRange *RangeResponse `protobuf:"bytes,1,opt,name=response_range,json=responseRange,proto3,oneof" json:"response_range,omitempty"` -} -type ResponseOp_ResponsePut struct { - ResponsePut *PutResponse `protobuf:"bytes,2,opt,name=response_put,json=responsePut,proto3,oneof" json:"response_put,omitempty"` -} -type ResponseOp_ResponseDeleteRange struct { - ResponseDeleteRange *DeleteRangeResponse `protobuf:"bytes,3,opt,name=response_delete_range,json=responseDeleteRange,proto3,oneof" json:"response_delete_range,omitempty"` -} -type ResponseOp_ResponseTxn struct { - ResponseTxn *TxnResponse `protobuf:"bytes,4,opt,name=response_txn,json=responseTxn,proto3,oneof" json:"response_txn,omitempty"` -} - -func (*ResponseOp_ResponseRange) isResponseOp_Response() {} -func (*ResponseOp_ResponsePut) isResponseOp_Response() {} -func (*ResponseOp_ResponseDeleteRange) isResponseOp_Response() {} -func (*ResponseOp_ResponseTxn) isResponseOp_Response() {} - -func (m *ResponseOp) GetResponse() isResponseOp_Response { - if m != nil { - return m.Response - } - return nil -} - -func (m *ResponseOp) GetResponseRange() *RangeResponse { - if x, ok := m.GetResponse().(*ResponseOp_ResponseRange); ok { - return x.ResponseRange - } - return nil -} - -func (m *ResponseOp) GetResponsePut() *PutResponse { - if x, ok := m.GetResponse().(*ResponseOp_ResponsePut); ok { - return x.ResponsePut - } - return nil -} - -func (m *ResponseOp) GetResponseDeleteRange() *DeleteRangeResponse { - if x, ok := m.GetResponse().(*ResponseOp_ResponseDeleteRange); ok { - return x.ResponseDeleteRange - } - return nil -} - -func (m *ResponseOp) GetResponseTxn() *TxnResponse { - if x, ok := m.GetResponse().(*ResponseOp_ResponseTxn); ok { - return x.ResponseTxn - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ResponseOp) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ResponseOp_ResponseRange)(nil), - (*ResponseOp_ResponsePut)(nil), - (*ResponseOp_ResponseDeleteRange)(nil), - (*ResponseOp_ResponseTxn)(nil), - } -} - -type Compare struct { - // result is logical comparison operation for this comparison. - Result Compare_CompareResult `protobuf:"varint,1,opt,name=result,proto3,enum=etcdserverpb.Compare_CompareResult" json:"result,omitempty"` - // target is the key-value field to inspect for the comparison. - Target Compare_CompareTarget `protobuf:"varint,2,opt,name=target,proto3,enum=etcdserverpb.Compare_CompareTarget" json:"target,omitempty"` - // key is the subject key for the comparison operation. - Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` - // Types that are valid to be assigned to TargetUnion: - // *Compare_Version - // *Compare_CreateRevision - // *Compare_ModRevision - // *Compare_Value - // *Compare_Lease - TargetUnion isCompare_TargetUnion `protobuf_oneof:"target_union"` - // range_end compares the given target to all keys in the range [key, range_end). - // See RangeRequest for more details on key ranges. - RangeEnd []byte `protobuf:"bytes,64,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Compare) Reset() { *m = Compare{} } -func (m *Compare) String() string { return proto.CompactTextString(m) } -func (*Compare) ProtoMessage() {} -func (*Compare) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{9} -} -func (m *Compare) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Compare) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Compare.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Compare) XXX_Merge(src proto.Message) { - xxx_messageInfo_Compare.Merge(m, src) -} -func (m *Compare) XXX_Size() int { - return m.Size() -} -func (m *Compare) XXX_DiscardUnknown() { - xxx_messageInfo_Compare.DiscardUnknown(m) -} - -var xxx_messageInfo_Compare proto.InternalMessageInfo - -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" json:"version,omitempty"` -} -type Compare_CreateRevision struct { - CreateRevision int64 `protobuf:"varint,5,opt,name=create_revision,json=createRevision,proto3,oneof" json:"create_revision,omitempty"` -} -type Compare_ModRevision struct { - ModRevision int64 `protobuf:"varint,6,opt,name=mod_revision,json=modRevision,proto3,oneof" json:"mod_revision,omitempty"` -} -type Compare_Value struct { - Value []byte `protobuf:"bytes,7,opt,name=value,proto3,oneof" json:"value,omitempty"` -} -type Compare_Lease struct { - Lease int64 `protobuf:"varint,8,opt,name=lease,proto3,oneof" json:"lease,omitempty"` -} - -func (*Compare_Version) isCompare_TargetUnion() {} -func (*Compare_CreateRevision) isCompare_TargetUnion() {} -func (*Compare_ModRevision) isCompare_TargetUnion() {} -func (*Compare_Value) isCompare_TargetUnion() {} -func (*Compare_Lease) isCompare_TargetUnion() {} - -func (m *Compare) GetTargetUnion() isCompare_TargetUnion { - if m != nil { - return m.TargetUnion - } - return nil -} - -func (m *Compare) GetResult() Compare_CompareResult { - if m != nil { - return m.Result - } - return Compare_EQUAL -} - -func (m *Compare) GetTarget() Compare_CompareTarget { - if m != nil { - return m.Target - } - return Compare_VERSION -} - -func (m *Compare) GetKey() []byte { - if m != nil { - return m.Key - } - 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 -} - -func (m *Compare) GetLease() int64 { - if x, ok := m.GetTargetUnion().(*Compare_Lease); ok { - return x.Lease - } - return 0 -} - -func (m *Compare) GetRangeEnd() []byte { - if m != nil { - return m.RangeEnd - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Compare) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Compare_Version)(nil), - (*Compare_CreateRevision)(nil), - (*Compare_ModRevision)(nil), - (*Compare_Value)(nil), - (*Compare_Lease)(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 -// and consists of three components: -// 1. A list of tests called guard. Each test in guard checks a single entry in the database. It may check -// for the absence or presence of a value, or compare with a given value. Two different tests in the guard -// may apply to the same or different entries in the database. All tests in the guard are applied and -// MultiOp returns the results. If all tests are true, MultiOp executes t op (see item 2 below), otherwise -// it executes f op (see item 3 below). -// 2. A list of database operations called t op. Each operation in the list is either an insert, delete, or -// lookup operation, and applies to a single database entry. Two different operations in the list may apply -// to the same or different entries in the database. These operations are executed -// if guard evaluates to -// true. -// 3. A list of database operations called f op. Like t op, but executed if guard evaluates to false. -type TxnRequest struct { - // compare is a list of predicates representing a conjunction of terms. - // If the comparisons succeed, then the success requests will be processed in order, - // and the response will contain their respective responses in order. - // If the comparisons fail, then the failure requests will be processed in order, - // and the response will contain their respective responses in order. - Compare []*Compare `protobuf:"bytes,1,rep,name=compare,proto3" json:"compare,omitempty"` - // success is a list of requests which will be applied when compare evaluates to true. - Success []*RequestOp `protobuf:"bytes,2,rep,name=success,proto3" json:"success,omitempty"` - // failure is a list of requests which will be applied when compare evaluates to false. - Failure []*RequestOp `protobuf:"bytes,3,rep,name=failure,proto3" json:"failure,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TxnRequest) Reset() { *m = TxnRequest{} } -func (m *TxnRequest) String() string { return proto.CompactTextString(m) } -func (*TxnRequest) ProtoMessage() {} -func (*TxnRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{10} -} -func (m *TxnRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TxnRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TxnRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TxnRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxnRequest.Merge(m, src) -} -func (m *TxnRequest) XXX_Size() int { - return m.Size() -} -func (m *TxnRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TxnRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_TxnRequest proto.InternalMessageInfo - -func (m *TxnRequest) GetCompare() []*Compare { - if m != nil { - return m.Compare - } - return nil -} - -func (m *TxnRequest) GetSuccess() []*RequestOp { - if m != nil { - return m.Success - } - return nil -} - -func (m *TxnRequest) GetFailure() []*RequestOp { - if m != nil { - return m.Failure - } - return nil -} - -type TxnResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // succeeded is set to true if the compare evaluated to true or false otherwise. - Succeeded bool `protobuf:"varint,2,opt,name=succeeded,proto3" json:"succeeded,omitempty"` - // responses is a list of responses corresponding to the results from applying - // success if succeeded is true or failure if succeeded is false. - Responses []*ResponseOp `protobuf:"bytes,3,rep,name=responses,proto3" json:"responses,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TxnResponse) Reset() { *m = TxnResponse{} } -func (m *TxnResponse) String() string { return proto.CompactTextString(m) } -func (*TxnResponse) ProtoMessage() {} -func (*TxnResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{11} -} -func (m *TxnResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TxnResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TxnResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TxnResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxnResponse.Merge(m, src) -} -func (m *TxnResponse) XXX_Size() int { - return m.Size() -} -func (m *TxnResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TxnResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_TxnResponse proto.InternalMessageInfo - -func (m *TxnResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *TxnResponse) GetSucceeded() bool { - if m != nil { - return m.Succeeded - } - return false -} - -func (m *TxnResponse) GetResponses() []*ResponseOp { - if m != nil { - return m.Responses - } - return nil -} - -// CompactionRequest compacts the key-value store up to a given revision. All superseded keys -// with a revision less than the compaction revision will be removed. -type CompactionRequest struct { - // revision is the key-value store revision for the compaction operation. - Revision int64 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - // physical is set so the RPC will wait until the compaction is physically - // applied to the local database such that compacted entries are totally - // removed from the backend database. - Physical bool `protobuf:"varint,2,opt,name=physical,proto3" json:"physical,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CompactionRequest) Reset() { *m = CompactionRequest{} } -func (m *CompactionRequest) String() string { return proto.CompactTextString(m) } -func (*CompactionRequest) ProtoMessage() {} -func (*CompactionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{12} -} -func (m *CompactionRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CompactionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CompactionRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CompactionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CompactionRequest.Merge(m, src) -} -func (m *CompactionRequest) XXX_Size() int { - return m.Size() -} -func (m *CompactionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CompactionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CompactionRequest proto.InternalMessageInfo - -func (m *CompactionRequest) GetRevision() int64 { - if m != nil { - return m.Revision - } - return 0 -} - -func (m *CompactionRequest) GetPhysical() bool { - if m != nil { - return m.Physical - } - return false -} - -type CompactionResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CompactionResponse) Reset() { *m = CompactionResponse{} } -func (m *CompactionResponse) String() string { return proto.CompactTextString(m) } -func (*CompactionResponse) ProtoMessage() {} -func (*CompactionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{13} -} -func (m *CompactionResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CompactionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CompactionResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CompactionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CompactionResponse.Merge(m, src) -} -func (m *CompactionResponse) XXX_Size() int { - return m.Size() -} -func (m *CompactionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CompactionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CompactionResponse proto.InternalMessageInfo - -func (m *CompactionResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type HashRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HashRequest) Reset() { *m = HashRequest{} } -func (m *HashRequest) String() string { return proto.CompactTextString(m) } -func (*HashRequest) ProtoMessage() {} -func (*HashRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{14} -} -func (m *HashRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HashRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HashRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HashRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_HashRequest.Merge(m, src) -} -func (m *HashRequest) XXX_Size() int { - return m.Size() -} -func (m *HashRequest) XXX_DiscardUnknown() { - xxx_messageInfo_HashRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_HashRequest proto.InternalMessageInfo - -type HashKVRequest struct { - // revision is the key-value store revision for the hash operation. - Revision int64 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HashKVRequest) Reset() { *m = HashKVRequest{} } -func (m *HashKVRequest) String() string { return proto.CompactTextString(m) } -func (*HashKVRequest) ProtoMessage() {} -func (*HashKVRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{15} -} -func (m *HashKVRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HashKVRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HashKVRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HashKVRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_HashKVRequest.Merge(m, src) -} -func (m *HashKVRequest) XXX_Size() int { - return m.Size() -} -func (m *HashKVRequest) XXX_DiscardUnknown() { - xxx_messageInfo_HashKVRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_HashKVRequest proto.InternalMessageInfo - -func (m *HashKVRequest) GetRevision() int64 { - if m != nil { - return m.Revision - } - return 0 -} - -type HashKVResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // hash is the hash value computed from the responding member's MVCC keys up to a given revision. - Hash uint32 `protobuf:"varint,2,opt,name=hash,proto3" json:"hash,omitempty"` - // compact_revision is the compacted revision of key-value store when hash begins. - CompactRevision int64 `protobuf:"varint,3,opt,name=compact_revision,json=compactRevision,proto3" json:"compact_revision,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HashKVResponse) Reset() { *m = HashKVResponse{} } -func (m *HashKVResponse) String() string { return proto.CompactTextString(m) } -func (*HashKVResponse) ProtoMessage() {} -func (*HashKVResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{16} -} -func (m *HashKVResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HashKVResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HashKVResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HashKVResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_HashKVResponse.Merge(m, src) -} -func (m *HashKVResponse) XXX_Size() int { - return m.Size() -} -func (m *HashKVResponse) XXX_DiscardUnknown() { - xxx_messageInfo_HashKVResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_HashKVResponse proto.InternalMessageInfo - -func (m *HashKVResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *HashKVResponse) GetHash() uint32 { - if m != nil { - return m.Hash - } - return 0 -} - -func (m *HashKVResponse) GetCompactRevision() int64 { - if m != nil { - return m.CompactRevision - } - return 0 -} - -type HashResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // hash is the hash value computed from the responding member's KV's backend. - Hash uint32 `protobuf:"varint,2,opt,name=hash,proto3" json:"hash,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HashResponse) Reset() { *m = HashResponse{} } -func (m *HashResponse) String() string { return proto.CompactTextString(m) } -func (*HashResponse) ProtoMessage() {} -func (*HashResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{17} -} -func (m *HashResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HashResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HashResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HashResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_HashResponse.Merge(m, src) -} -func (m *HashResponse) XXX_Size() int { - return m.Size() -} -func (m *HashResponse) XXX_DiscardUnknown() { - xxx_messageInfo_HashResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_HashResponse proto.InternalMessageInfo - -func (m *HashResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *HashResponse) GetHash() uint32 { - if m != nil { - return m.Hash - } - return 0 -} - -type SnapshotRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SnapshotRequest) Reset() { *m = SnapshotRequest{} } -func (m *SnapshotRequest) String() string { return proto.CompactTextString(m) } -func (*SnapshotRequest) ProtoMessage() {} -func (*SnapshotRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{18} -} -func (m *SnapshotRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SnapshotRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SnapshotRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SnapshotRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SnapshotRequest.Merge(m, src) -} -func (m *SnapshotRequest) XXX_Size() int { - return m.Size() -} -func (m *SnapshotRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SnapshotRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SnapshotRequest proto.InternalMessageInfo - -type SnapshotResponse struct { - // header has the current key-value store information. The first header in the snapshot - // stream indicates the point in time of the snapshot. - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // remaining_bytes is the number of blob bytes to be sent after this message - RemainingBytes uint64 `protobuf:"varint,2,opt,name=remaining_bytes,json=remainingBytes,proto3" json:"remaining_bytes,omitempty"` - // blob contains the next chunk of the snapshot in the snapshot stream. - Blob []byte `protobuf:"bytes,3,opt,name=blob,proto3" json:"blob,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SnapshotResponse) Reset() { *m = SnapshotResponse{} } -func (m *SnapshotResponse) String() string { return proto.CompactTextString(m) } -func (*SnapshotResponse) ProtoMessage() {} -func (*SnapshotResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{19} -} -func (m *SnapshotResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SnapshotResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SnapshotResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SnapshotResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SnapshotResponse.Merge(m, src) -} -func (m *SnapshotResponse) XXX_Size() int { - return m.Size() -} -func (m *SnapshotResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SnapshotResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SnapshotResponse proto.InternalMessageInfo - -func (m *SnapshotResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *SnapshotResponse) GetRemainingBytes() uint64 { - if m != nil { - return m.RemainingBytes - } - return 0 -} - -func (m *SnapshotResponse) GetBlob() []byte { - if m != nil { - return m.Blob - } - return nil -} - -type WatchRequest struct { - // request_union is a request to either create a new watcher or cancel an existing watcher. - // - // Types that are valid to be assigned to RequestUnion: - // *WatchRequest_CreateRequest - // *WatchRequest_CancelRequest - // *WatchRequest_ProgressRequest - RequestUnion isWatchRequest_RequestUnion `protobuf_oneof:"request_union"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WatchRequest) Reset() { *m = WatchRequest{} } -func (m *WatchRequest) String() string { return proto.CompactTextString(m) } -func (*WatchRequest) ProtoMessage() {} -func (*WatchRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{20} -} -func (m *WatchRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WatchRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *WatchRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_WatchRequest.Merge(m, src) -} -func (m *WatchRequest) XXX_Size() int { - return m.Size() -} -func (m *WatchRequest) XXX_DiscardUnknown() { - xxx_messageInfo_WatchRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_WatchRequest proto.InternalMessageInfo - -type isWatchRequest_RequestUnion interface { - isWatchRequest_RequestUnion() - MarshalTo([]byte) (int, error) - Size() int -} - -type WatchRequest_CreateRequest struct { - CreateRequest *WatchCreateRequest `protobuf:"bytes,1,opt,name=create_request,json=createRequest,proto3,oneof" json:"create_request,omitempty"` -} -type WatchRequest_CancelRequest struct { - CancelRequest *WatchCancelRequest `protobuf:"bytes,2,opt,name=cancel_request,json=cancelRequest,proto3,oneof" json:"cancel_request,omitempty"` -} -type WatchRequest_ProgressRequest struct { - ProgressRequest *WatchProgressRequest `protobuf:"bytes,3,opt,name=progress_request,json=progressRequest,proto3,oneof" json:"progress_request,omitempty"` -} - -func (*WatchRequest_CreateRequest) isWatchRequest_RequestUnion() {} -func (*WatchRequest_CancelRequest) isWatchRequest_RequestUnion() {} -func (*WatchRequest_ProgressRequest) isWatchRequest_RequestUnion() {} - -func (m *WatchRequest) GetRequestUnion() isWatchRequest_RequestUnion { - if m != nil { - return m.RequestUnion - } - return nil -} - -func (m *WatchRequest) GetCreateRequest() *WatchCreateRequest { - if x, ok := m.GetRequestUnion().(*WatchRequest_CreateRequest); ok { - return x.CreateRequest - } - return nil -} - -func (m *WatchRequest) GetCancelRequest() *WatchCancelRequest { - if x, ok := m.GetRequestUnion().(*WatchRequest_CancelRequest); ok { - return x.CancelRequest - } - return nil -} - -func (m *WatchRequest) GetProgressRequest() *WatchProgressRequest { - if x, ok := m.GetRequestUnion().(*WatchRequest_ProgressRequest); ok { - return x.ProgressRequest - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*WatchRequest) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*WatchRequest_CreateRequest)(nil), - (*WatchRequest_CancelRequest)(nil), - (*WatchRequest_ProgressRequest)(nil), - } -} - -type WatchCreateRequest struct { - // key is the key to register for watching. - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // range_end is the end of the range [key, range_end) to watch. If range_end is not given, - // only the key argument is watched. If range_end is equal to '\0', all keys greater than - // or equal to the key argument are watched. - // If the range_end is one bit larger than the given key, - // then all keys with the prefix (the given key) will be watched. - RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` - // start_revision is an optional revision to watch from (inclusive). No start_revision is "now". - StartRevision int64 `protobuf:"varint,3,opt,name=start_revision,json=startRevision,proto3" json:"start_revision,omitempty"` - // progress_notify is set so that the etcd server will periodically send a WatchResponse with - // no events to the new watcher if there are no recent events. It is useful when clients - // wish to recover a disconnected watcher starting from a recent known revision. - // The etcd server may decide how often it will send notifications based on current load. - ProgressNotify bool `protobuf:"varint,4,opt,name=progress_notify,json=progressNotify,proto3" json:"progress_notify,omitempty"` - // filters filter the events at server side before it sends back to the watcher. - Filters []WatchCreateRequest_FilterType `protobuf:"varint,5,rep,packed,name=filters,proto3,enum=etcdserverpb.WatchCreateRequest_FilterType" json:"filters,omitempty"` - // If prev_kv is set, created watcher gets the previous KV before the event happens. - // If the previous KV is already compacted, nothing will be returned. - PrevKv bool `protobuf:"varint,6,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` - // If watch_id is provided and non-zero, it will be assigned to this watcher. - // Since creating a watcher in etcd is not a synchronous operation, - // this can be used ensure that ordering is correct when creating multiple - // watchers on the same stream. Creating a watcher with an ID already in - // use on the stream will cause an error to be returned. - WatchId int64 `protobuf:"varint,7,opt,name=watch_id,json=watchId,proto3" json:"watch_id,omitempty"` - // fragment enables splitting large revisions into multiple watch responses. - Fragment bool `protobuf:"varint,8,opt,name=fragment,proto3" json:"fragment,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WatchCreateRequest) Reset() { *m = WatchCreateRequest{} } -func (m *WatchCreateRequest) String() string { return proto.CompactTextString(m) } -func (*WatchCreateRequest) ProtoMessage() {} -func (*WatchCreateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{21} -} -func (m *WatchCreateRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WatchCreateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WatchCreateRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *WatchCreateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_WatchCreateRequest.Merge(m, src) -} -func (m *WatchCreateRequest) XXX_Size() int { - return m.Size() -} -func (m *WatchCreateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_WatchCreateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_WatchCreateRequest proto.InternalMessageInfo - -func (m *WatchCreateRequest) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *WatchCreateRequest) GetRangeEnd() []byte { - if m != nil { - return m.RangeEnd - } - return nil -} - -func (m *WatchCreateRequest) GetStartRevision() int64 { - if m != nil { - return m.StartRevision - } - return 0 -} - -func (m *WatchCreateRequest) GetProgressNotify() bool { - if m != nil { - return m.ProgressNotify - } - return false -} - -func (m *WatchCreateRequest) GetFilters() []WatchCreateRequest_FilterType { - if m != nil { - return m.Filters - } - return nil -} - -func (m *WatchCreateRequest) GetPrevKv() bool { - if m != nil { - return m.PrevKv - } - return false -} - -func (m *WatchCreateRequest) GetWatchId() int64 { - if m != nil { - return m.WatchId - } - return 0 -} - -func (m *WatchCreateRequest) GetFragment() bool { - if m != nil { - return m.Fragment - } - return false -} - -type WatchCancelRequest struct { - // watch_id is the watcher id to cancel so that no more events are transmitted. - WatchId int64 `protobuf:"varint,1,opt,name=watch_id,json=watchId,proto3" json:"watch_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WatchCancelRequest) Reset() { *m = WatchCancelRequest{} } -func (m *WatchCancelRequest) String() string { return proto.CompactTextString(m) } -func (*WatchCancelRequest) ProtoMessage() {} -func (*WatchCancelRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{22} -} -func (m *WatchCancelRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WatchCancelRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WatchCancelRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *WatchCancelRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_WatchCancelRequest.Merge(m, src) -} -func (m *WatchCancelRequest) XXX_Size() int { - return m.Size() -} -func (m *WatchCancelRequest) XXX_DiscardUnknown() { - xxx_messageInfo_WatchCancelRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_WatchCancelRequest proto.InternalMessageInfo - -func (m *WatchCancelRequest) GetWatchId() int64 { - if m != nil { - return m.WatchId - } - return 0 -} - -// Requests the a watch stream progress status be sent in the watch response stream as soon as -// possible. -type WatchProgressRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WatchProgressRequest) Reset() { *m = WatchProgressRequest{} } -func (m *WatchProgressRequest) String() string { return proto.CompactTextString(m) } -func (*WatchProgressRequest) ProtoMessage() {} -func (*WatchProgressRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{23} -} -func (m *WatchProgressRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WatchProgressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WatchProgressRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *WatchProgressRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_WatchProgressRequest.Merge(m, src) -} -func (m *WatchProgressRequest) XXX_Size() int { - return m.Size() -} -func (m *WatchProgressRequest) XXX_DiscardUnknown() { - xxx_messageInfo_WatchProgressRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_WatchProgressRequest proto.InternalMessageInfo - -type WatchResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // watch_id is the ID of the watcher that corresponds to the response. - WatchId int64 `protobuf:"varint,2,opt,name=watch_id,json=watchId,proto3" json:"watch_id,omitempty"` - // created is set to true if the response is for a create watch request. - // The client should record the watch_id and expect to receive events for - // the created watcher from the same stream. - // All events sent to the created watcher will attach with the same watch_id. - Created bool `protobuf:"varint,3,opt,name=created,proto3" json:"created,omitempty"` - // canceled is set to true if the response is for a cancel watch request. - // No further events will be sent to the canceled watcher. - Canceled bool `protobuf:"varint,4,opt,name=canceled,proto3" json:"canceled,omitempty"` - // compact_revision is set to the minimum index if a watcher tries to watch - // at a compacted index. - // - // This happens when creating a watcher at a compacted revision or the watcher cannot - // catch up with the progress of the key-value store. - // - // The client should treat the watcher as canceled and should not try to create any - // watcher with the same start_revision again. - CompactRevision int64 `protobuf:"varint,5,opt,name=compact_revision,json=compactRevision,proto3" json:"compact_revision,omitempty"` - // cancel_reason indicates the reason for canceling the watcher. - CancelReason string `protobuf:"bytes,6,opt,name=cancel_reason,json=cancelReason,proto3" json:"cancel_reason,omitempty"` - // framgment is true if large watch response was split over multiple responses. - Fragment bool `protobuf:"varint,7,opt,name=fragment,proto3" json:"fragment,omitempty"` - Events []*mvccpb.Event `protobuf:"bytes,11,rep,name=events,proto3" json:"events,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WatchResponse) Reset() { *m = WatchResponse{} } -func (m *WatchResponse) String() string { return proto.CompactTextString(m) } -func (*WatchResponse) ProtoMessage() {} -func (*WatchResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{24} -} -func (m *WatchResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WatchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WatchResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *WatchResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_WatchResponse.Merge(m, src) -} -func (m *WatchResponse) XXX_Size() int { - return m.Size() -} -func (m *WatchResponse) XXX_DiscardUnknown() { - xxx_messageInfo_WatchResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_WatchResponse proto.InternalMessageInfo - -func (m *WatchResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *WatchResponse) GetWatchId() int64 { - if m != nil { - return m.WatchId - } - return 0 -} - -func (m *WatchResponse) GetCreated() bool { - if m != nil { - return m.Created - } - return false -} - -func (m *WatchResponse) GetCanceled() bool { - if m != nil { - return m.Canceled - } - return false -} - -func (m *WatchResponse) GetCompactRevision() int64 { - if m != nil { - return m.CompactRevision - } - return 0 -} - -func (m *WatchResponse) GetCancelReason() string { - if m != nil { - return m.CancelReason - } - return "" -} - -func (m *WatchResponse) GetFragment() bool { - if m != nil { - return m.Fragment - } - return false -} - -func (m *WatchResponse) GetEvents() []*mvccpb.Event { - if m != nil { - return m.Events - } - return nil -} - -type LeaseGrantRequest struct { - // TTL is the advisory time-to-live in seconds. Expired lease will return -1. - TTL int64 `protobuf:"varint,1,opt,name=TTL,proto3" json:"TTL,omitempty"` - // ID is the requested ID for the lease. If ID is set to 0, the lessor chooses an ID. - ID int64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LeaseGrantRequest) Reset() { *m = LeaseGrantRequest{} } -func (m *LeaseGrantRequest) String() string { return proto.CompactTextString(m) } -func (*LeaseGrantRequest) ProtoMessage() {} -func (*LeaseGrantRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{25} -} -func (m *LeaseGrantRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LeaseGrantRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LeaseGrantRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LeaseGrantRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaseGrantRequest.Merge(m, src) -} -func (m *LeaseGrantRequest) XXX_Size() int { - return m.Size() -} -func (m *LeaseGrantRequest) XXX_DiscardUnknown() { - xxx_messageInfo_LeaseGrantRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_LeaseGrantRequest proto.InternalMessageInfo - -func (m *LeaseGrantRequest) GetTTL() int64 { - if m != nil { - return m.TTL - } - return 0 -} - -func (m *LeaseGrantRequest) GetID() int64 { - if m != nil { - return m.ID - } - return 0 -} - -type LeaseGrantResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // ID is the lease ID for the granted lease. - ID int64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"` - // TTL is the server chosen lease time-to-live in seconds. - TTL int64 `protobuf:"varint,3,opt,name=TTL,proto3" json:"TTL,omitempty"` - Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LeaseGrantResponse) Reset() { *m = LeaseGrantResponse{} } -func (m *LeaseGrantResponse) String() string { return proto.CompactTextString(m) } -func (*LeaseGrantResponse) ProtoMessage() {} -func (*LeaseGrantResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{26} -} -func (m *LeaseGrantResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LeaseGrantResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LeaseGrantResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LeaseGrantResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaseGrantResponse.Merge(m, src) -} -func (m *LeaseGrantResponse) XXX_Size() int { - return m.Size() -} -func (m *LeaseGrantResponse) XXX_DiscardUnknown() { - xxx_messageInfo_LeaseGrantResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_LeaseGrantResponse proto.InternalMessageInfo - -func (m *LeaseGrantResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *LeaseGrantResponse) GetID() int64 { - if m != nil { - return m.ID - } - return 0 -} - -func (m *LeaseGrantResponse) GetTTL() int64 { - if m != nil { - return m.TTL - } - return 0 -} - -func (m *LeaseGrantResponse) GetError() string { - if m != nil { - return m.Error - } - return "" -} - -type LeaseRevokeRequest struct { - // ID is the lease ID to revoke. When the ID is revoked, all associated keys will be deleted. - ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LeaseRevokeRequest) Reset() { *m = LeaseRevokeRequest{} } -func (m *LeaseRevokeRequest) String() string { return proto.CompactTextString(m) } -func (*LeaseRevokeRequest) ProtoMessage() {} -func (*LeaseRevokeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{27} -} -func (m *LeaseRevokeRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LeaseRevokeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LeaseRevokeRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LeaseRevokeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaseRevokeRequest.Merge(m, src) -} -func (m *LeaseRevokeRequest) XXX_Size() int { - return m.Size() -} -func (m *LeaseRevokeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_LeaseRevokeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_LeaseRevokeRequest proto.InternalMessageInfo - -func (m *LeaseRevokeRequest) GetID() int64 { - if m != nil { - return m.ID - } - return 0 -} - -type LeaseRevokeResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LeaseRevokeResponse) Reset() { *m = LeaseRevokeResponse{} } -func (m *LeaseRevokeResponse) String() string { return proto.CompactTextString(m) } -func (*LeaseRevokeResponse) ProtoMessage() {} -func (*LeaseRevokeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{28} -} -func (m *LeaseRevokeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LeaseRevokeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LeaseRevokeResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LeaseRevokeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaseRevokeResponse.Merge(m, src) -} -func (m *LeaseRevokeResponse) XXX_Size() int { - return m.Size() -} -func (m *LeaseRevokeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_LeaseRevokeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_LeaseRevokeResponse proto.InternalMessageInfo - -func (m *LeaseRevokeResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type LeaseCheckpoint struct { - // ID is the lease ID to checkpoint. - ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - // Remaining_TTL is the remaining time until expiry of the lease. - Remaining_TTL int64 `protobuf:"varint,2,opt,name=remaining_TTL,json=remainingTTL,proto3" json:"remaining_TTL,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LeaseCheckpoint) Reset() { *m = LeaseCheckpoint{} } -func (m *LeaseCheckpoint) String() string { return proto.CompactTextString(m) } -func (*LeaseCheckpoint) ProtoMessage() {} -func (*LeaseCheckpoint) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{29} -} -func (m *LeaseCheckpoint) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LeaseCheckpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LeaseCheckpoint.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LeaseCheckpoint) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaseCheckpoint.Merge(m, src) -} -func (m *LeaseCheckpoint) XXX_Size() int { - return m.Size() -} -func (m *LeaseCheckpoint) XXX_DiscardUnknown() { - xxx_messageInfo_LeaseCheckpoint.DiscardUnknown(m) -} - -var xxx_messageInfo_LeaseCheckpoint proto.InternalMessageInfo - -func (m *LeaseCheckpoint) GetID() int64 { - if m != nil { - return m.ID - } - return 0 -} - -func (m *LeaseCheckpoint) GetRemaining_TTL() int64 { - if m != nil { - return m.Remaining_TTL - } - return 0 -} - -type LeaseCheckpointRequest struct { - Checkpoints []*LeaseCheckpoint `protobuf:"bytes,1,rep,name=checkpoints,proto3" json:"checkpoints,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LeaseCheckpointRequest) Reset() { *m = LeaseCheckpointRequest{} } -func (m *LeaseCheckpointRequest) String() string { return proto.CompactTextString(m) } -func (*LeaseCheckpointRequest) ProtoMessage() {} -func (*LeaseCheckpointRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{30} -} -func (m *LeaseCheckpointRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LeaseCheckpointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LeaseCheckpointRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LeaseCheckpointRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaseCheckpointRequest.Merge(m, src) -} -func (m *LeaseCheckpointRequest) XXX_Size() int { - return m.Size() -} -func (m *LeaseCheckpointRequest) XXX_DiscardUnknown() { - xxx_messageInfo_LeaseCheckpointRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_LeaseCheckpointRequest proto.InternalMessageInfo - -func (m *LeaseCheckpointRequest) GetCheckpoints() []*LeaseCheckpoint { - if m != nil { - return m.Checkpoints - } - return nil -} - -type LeaseCheckpointResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LeaseCheckpointResponse) Reset() { *m = LeaseCheckpointResponse{} } -func (m *LeaseCheckpointResponse) String() string { return proto.CompactTextString(m) } -func (*LeaseCheckpointResponse) ProtoMessage() {} -func (*LeaseCheckpointResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{31} -} -func (m *LeaseCheckpointResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LeaseCheckpointResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LeaseCheckpointResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LeaseCheckpointResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaseCheckpointResponse.Merge(m, src) -} -func (m *LeaseCheckpointResponse) XXX_Size() int { - return m.Size() -} -func (m *LeaseCheckpointResponse) XXX_DiscardUnknown() { - xxx_messageInfo_LeaseCheckpointResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_LeaseCheckpointResponse proto.InternalMessageInfo - -func (m *LeaseCheckpointResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type LeaseKeepAliveRequest struct { - // ID is the lease ID for the lease to keep alive. - ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LeaseKeepAliveRequest) Reset() { *m = LeaseKeepAliveRequest{} } -func (m *LeaseKeepAliveRequest) String() string { return proto.CompactTextString(m) } -func (*LeaseKeepAliveRequest) ProtoMessage() {} -func (*LeaseKeepAliveRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{32} -} -func (m *LeaseKeepAliveRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LeaseKeepAliveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LeaseKeepAliveRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LeaseKeepAliveRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaseKeepAliveRequest.Merge(m, src) -} -func (m *LeaseKeepAliveRequest) XXX_Size() int { - return m.Size() -} -func (m *LeaseKeepAliveRequest) XXX_DiscardUnknown() { - xxx_messageInfo_LeaseKeepAliveRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_LeaseKeepAliveRequest proto.InternalMessageInfo - -func (m *LeaseKeepAliveRequest) GetID() int64 { - if m != nil { - return m.ID - } - return 0 -} - -type LeaseKeepAliveResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // ID is the lease ID from the keep alive request. - ID int64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"` - // TTL is the new time-to-live for the lease. - TTL int64 `protobuf:"varint,3,opt,name=TTL,proto3" json:"TTL,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LeaseKeepAliveResponse) Reset() { *m = LeaseKeepAliveResponse{} } -func (m *LeaseKeepAliveResponse) String() string { return proto.CompactTextString(m) } -func (*LeaseKeepAliveResponse) ProtoMessage() {} -func (*LeaseKeepAliveResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{33} -} -func (m *LeaseKeepAliveResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LeaseKeepAliveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LeaseKeepAliveResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LeaseKeepAliveResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaseKeepAliveResponse.Merge(m, src) -} -func (m *LeaseKeepAliveResponse) XXX_Size() int { - return m.Size() -} -func (m *LeaseKeepAliveResponse) XXX_DiscardUnknown() { - xxx_messageInfo_LeaseKeepAliveResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_LeaseKeepAliveResponse proto.InternalMessageInfo - -func (m *LeaseKeepAliveResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *LeaseKeepAliveResponse) GetID() int64 { - if m != nil { - return m.ID - } - return 0 -} - -func (m *LeaseKeepAliveResponse) GetTTL() int64 { - if m != nil { - return m.TTL - } - return 0 -} - -type LeaseTimeToLiveRequest struct { - // ID is the lease ID for the lease. - ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - // keys is true to query all the keys attached to this lease. - Keys bool `protobuf:"varint,2,opt,name=keys,proto3" json:"keys,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LeaseTimeToLiveRequest) Reset() { *m = LeaseTimeToLiveRequest{} } -func (m *LeaseTimeToLiveRequest) String() string { return proto.CompactTextString(m) } -func (*LeaseTimeToLiveRequest) ProtoMessage() {} -func (*LeaseTimeToLiveRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{34} -} -func (m *LeaseTimeToLiveRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LeaseTimeToLiveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LeaseTimeToLiveRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LeaseTimeToLiveRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaseTimeToLiveRequest.Merge(m, src) -} -func (m *LeaseTimeToLiveRequest) XXX_Size() int { - return m.Size() -} -func (m *LeaseTimeToLiveRequest) XXX_DiscardUnknown() { - xxx_messageInfo_LeaseTimeToLiveRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_LeaseTimeToLiveRequest proto.InternalMessageInfo - -func (m *LeaseTimeToLiveRequest) GetID() int64 { - if m != nil { - return m.ID - } - return 0 -} - -func (m *LeaseTimeToLiveRequest) GetKeys() bool { - if m != nil { - return m.Keys - } - return false -} - -type LeaseTimeToLiveResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // ID is the lease ID from the keep alive request. - ID int64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"` - // TTL is the remaining TTL in seconds for the lease; the lease will expire in under TTL+1 seconds. - TTL int64 `protobuf:"varint,3,opt,name=TTL,proto3" json:"TTL,omitempty"` - // GrantedTTL is the initial granted time in seconds upon lease creation/renewal. - GrantedTTL int64 `protobuf:"varint,4,opt,name=grantedTTL,proto3" json:"grantedTTL,omitempty"` - // Keys is the list of keys attached to this lease. - Keys [][]byte `protobuf:"bytes,5,rep,name=keys,proto3" json:"keys,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LeaseTimeToLiveResponse) Reset() { *m = LeaseTimeToLiveResponse{} } -func (m *LeaseTimeToLiveResponse) String() string { return proto.CompactTextString(m) } -func (*LeaseTimeToLiveResponse) ProtoMessage() {} -func (*LeaseTimeToLiveResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{35} -} -func (m *LeaseTimeToLiveResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LeaseTimeToLiveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LeaseTimeToLiveResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LeaseTimeToLiveResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaseTimeToLiveResponse.Merge(m, src) -} -func (m *LeaseTimeToLiveResponse) XXX_Size() int { - return m.Size() -} -func (m *LeaseTimeToLiveResponse) XXX_DiscardUnknown() { - xxx_messageInfo_LeaseTimeToLiveResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_LeaseTimeToLiveResponse proto.InternalMessageInfo - -func (m *LeaseTimeToLiveResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *LeaseTimeToLiveResponse) GetID() int64 { - if m != nil { - return m.ID - } - return 0 -} - -func (m *LeaseTimeToLiveResponse) GetTTL() int64 { - if m != nil { - return m.TTL - } - return 0 -} - -func (m *LeaseTimeToLiveResponse) GetGrantedTTL() int64 { - if m != nil { - return m.GrantedTTL - } - return 0 -} - -func (m *LeaseTimeToLiveResponse) GetKeys() [][]byte { - if m != nil { - return m.Keys - } - return nil -} - -type LeaseLeasesRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LeaseLeasesRequest) Reset() { *m = LeaseLeasesRequest{} } -func (m *LeaseLeasesRequest) String() string { return proto.CompactTextString(m) } -func (*LeaseLeasesRequest) ProtoMessage() {} -func (*LeaseLeasesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{36} -} -func (m *LeaseLeasesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LeaseLeasesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LeaseLeasesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LeaseLeasesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaseLeasesRequest.Merge(m, src) -} -func (m *LeaseLeasesRequest) XXX_Size() int { - return m.Size() -} -func (m *LeaseLeasesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_LeaseLeasesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_LeaseLeasesRequest proto.InternalMessageInfo - -type LeaseStatus struct { - ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LeaseStatus) Reset() { *m = LeaseStatus{} } -func (m *LeaseStatus) String() string { return proto.CompactTextString(m) } -func (*LeaseStatus) ProtoMessage() {} -func (*LeaseStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{37} -} -func (m *LeaseStatus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LeaseStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LeaseStatus.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LeaseStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaseStatus.Merge(m, src) -} -func (m *LeaseStatus) XXX_Size() int { - return m.Size() -} -func (m *LeaseStatus) XXX_DiscardUnknown() { - xxx_messageInfo_LeaseStatus.DiscardUnknown(m) -} - -var xxx_messageInfo_LeaseStatus proto.InternalMessageInfo - -func (m *LeaseStatus) GetID() int64 { - if m != nil { - return m.ID - } - return 0 -} - -type LeaseLeasesResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - Leases []*LeaseStatus `protobuf:"bytes,2,rep,name=leases,proto3" json:"leases,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LeaseLeasesResponse) Reset() { *m = LeaseLeasesResponse{} } -func (m *LeaseLeasesResponse) String() string { return proto.CompactTextString(m) } -func (*LeaseLeasesResponse) ProtoMessage() {} -func (*LeaseLeasesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{38} -} -func (m *LeaseLeasesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LeaseLeasesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LeaseLeasesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LeaseLeasesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaseLeasesResponse.Merge(m, src) -} -func (m *LeaseLeasesResponse) XXX_Size() int { - return m.Size() -} -func (m *LeaseLeasesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_LeaseLeasesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_LeaseLeasesResponse proto.InternalMessageInfo - -func (m *LeaseLeasesResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *LeaseLeasesResponse) GetLeases() []*LeaseStatus { - if m != nil { - return m.Leases - } - return nil -} - -type Member struct { - // ID is the member ID for this member. - ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - // name is the human-readable name of the member. If the member is not started, the name will be an empty string. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // peerURLs is the list of URLs the member exposes to the cluster for communication. - PeerURLs []string `protobuf:"bytes,3,rep,name=peerURLs,proto3" json:"peerURLs,omitempty"` - // clientURLs is the list of URLs the member exposes to clients for communication. If the member is not started, clientURLs will be empty. - ClientURLs []string `protobuf:"bytes,4,rep,name=clientURLs,proto3" json:"clientURLs,omitempty"` - // isLearner indicates if the member is raft learner. - IsLearner bool `protobuf:"varint,5,opt,name=isLearner,proto3" json:"isLearner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Member) Reset() { *m = Member{} } -func (m *Member) String() string { return proto.CompactTextString(m) } -func (*Member) ProtoMessage() {} -func (*Member) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{39} -} -func (m *Member) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Member) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Member.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Member) XXX_Merge(src proto.Message) { - xxx_messageInfo_Member.Merge(m, src) -} -func (m *Member) XXX_Size() int { - return m.Size() -} -func (m *Member) XXX_DiscardUnknown() { - xxx_messageInfo_Member.DiscardUnknown(m) -} - -var xxx_messageInfo_Member proto.InternalMessageInfo - -func (m *Member) GetID() uint64 { - if m != nil { - return m.ID - } - return 0 -} - -func (m *Member) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Member) GetPeerURLs() []string { - if m != nil { - return m.PeerURLs - } - return nil -} - -func (m *Member) GetClientURLs() []string { - if m != nil { - return m.ClientURLs - } - return nil -} - -func (m *Member) GetIsLearner() bool { - if m != nil { - return m.IsLearner - } - return false -} - -type MemberAddRequest struct { - // peerURLs is the list of URLs the added member will use to communicate with the cluster. - PeerURLs []string `protobuf:"bytes,1,rep,name=peerURLs,proto3" json:"peerURLs,omitempty"` - // isLearner indicates if the added member is raft learner. - IsLearner bool `protobuf:"varint,2,opt,name=isLearner,proto3" json:"isLearner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MemberAddRequest) Reset() { *m = MemberAddRequest{} } -func (m *MemberAddRequest) String() string { return proto.CompactTextString(m) } -func (*MemberAddRequest) ProtoMessage() {} -func (*MemberAddRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{40} -} -func (m *MemberAddRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MemberAddRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MemberAddRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MemberAddRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MemberAddRequest.Merge(m, src) -} -func (m *MemberAddRequest) XXX_Size() int { - return m.Size() -} -func (m *MemberAddRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MemberAddRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MemberAddRequest proto.InternalMessageInfo - -func (m *MemberAddRequest) GetPeerURLs() []string { - if m != nil { - return m.PeerURLs - } - return nil -} - -func (m *MemberAddRequest) GetIsLearner() bool { - if m != nil { - return m.IsLearner - } - return false -} - -type MemberAddResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // member is the member information for the added member. - Member *Member `protobuf:"bytes,2,opt,name=member,proto3" json:"member,omitempty"` - // members is a list of all members after adding the new member. - Members []*Member `protobuf:"bytes,3,rep,name=members,proto3" json:"members,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MemberAddResponse) Reset() { *m = MemberAddResponse{} } -func (m *MemberAddResponse) String() string { return proto.CompactTextString(m) } -func (*MemberAddResponse) ProtoMessage() {} -func (*MemberAddResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{41} -} -func (m *MemberAddResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MemberAddResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MemberAddResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MemberAddResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MemberAddResponse.Merge(m, src) -} -func (m *MemberAddResponse) XXX_Size() int { - return m.Size() -} -func (m *MemberAddResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MemberAddResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MemberAddResponse proto.InternalMessageInfo - -func (m *MemberAddResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *MemberAddResponse) GetMember() *Member { - if m != nil { - return m.Member - } - return nil -} - -func (m *MemberAddResponse) GetMembers() []*Member { - if m != nil { - return m.Members - } - return nil -} - -type MemberRemoveRequest struct { - // ID is the member ID of the member to remove. - ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MemberRemoveRequest) Reset() { *m = MemberRemoveRequest{} } -func (m *MemberRemoveRequest) String() string { return proto.CompactTextString(m) } -func (*MemberRemoveRequest) ProtoMessage() {} -func (*MemberRemoveRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{42} -} -func (m *MemberRemoveRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MemberRemoveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MemberRemoveRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MemberRemoveRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MemberRemoveRequest.Merge(m, src) -} -func (m *MemberRemoveRequest) XXX_Size() int { - return m.Size() -} -func (m *MemberRemoveRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MemberRemoveRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MemberRemoveRequest proto.InternalMessageInfo - -func (m *MemberRemoveRequest) GetID() uint64 { - if m != nil { - return m.ID - } - return 0 -} - -type MemberRemoveResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // members is a list of all members after removing the member. - Members []*Member `protobuf:"bytes,2,rep,name=members,proto3" json:"members,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MemberRemoveResponse) Reset() { *m = MemberRemoveResponse{} } -func (m *MemberRemoveResponse) String() string { return proto.CompactTextString(m) } -func (*MemberRemoveResponse) ProtoMessage() {} -func (*MemberRemoveResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{43} -} -func (m *MemberRemoveResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MemberRemoveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MemberRemoveResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MemberRemoveResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MemberRemoveResponse.Merge(m, src) -} -func (m *MemberRemoveResponse) XXX_Size() int { - return m.Size() -} -func (m *MemberRemoveResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MemberRemoveResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MemberRemoveResponse proto.InternalMessageInfo - -func (m *MemberRemoveResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *MemberRemoveResponse) GetMembers() []*Member { - if m != nil { - return m.Members - } - return nil -} - -type MemberUpdateRequest struct { - // ID is the member ID of the member to update. - ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - // peerURLs is the new list of URLs the member will use to communicate with the cluster. - PeerURLs []string `protobuf:"bytes,2,rep,name=peerURLs,proto3" json:"peerURLs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MemberUpdateRequest) Reset() { *m = MemberUpdateRequest{} } -func (m *MemberUpdateRequest) String() string { return proto.CompactTextString(m) } -func (*MemberUpdateRequest) ProtoMessage() {} -func (*MemberUpdateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{44} -} -func (m *MemberUpdateRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MemberUpdateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MemberUpdateRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MemberUpdateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MemberUpdateRequest.Merge(m, src) -} -func (m *MemberUpdateRequest) XXX_Size() int { - return m.Size() -} -func (m *MemberUpdateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MemberUpdateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MemberUpdateRequest proto.InternalMessageInfo - -func (m *MemberUpdateRequest) GetID() uint64 { - if m != nil { - return m.ID - } - return 0 -} - -func (m *MemberUpdateRequest) GetPeerURLs() []string { - if m != nil { - return m.PeerURLs - } - return nil -} - -type MemberUpdateResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // members is a list of all members after updating the member. - Members []*Member `protobuf:"bytes,2,rep,name=members,proto3" json:"members,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MemberUpdateResponse) Reset() { *m = MemberUpdateResponse{} } -func (m *MemberUpdateResponse) String() string { return proto.CompactTextString(m) } -func (*MemberUpdateResponse) ProtoMessage() {} -func (*MemberUpdateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{45} -} -func (m *MemberUpdateResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MemberUpdateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MemberUpdateResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MemberUpdateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MemberUpdateResponse.Merge(m, src) -} -func (m *MemberUpdateResponse) XXX_Size() int { - return m.Size() -} -func (m *MemberUpdateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MemberUpdateResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MemberUpdateResponse proto.InternalMessageInfo - -func (m *MemberUpdateResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *MemberUpdateResponse) GetMembers() []*Member { - if m != nil { - return m.Members - } - return nil -} - -type MemberListRequest struct { - Linearizable bool `protobuf:"varint,1,opt,name=linearizable,proto3" json:"linearizable,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MemberListRequest) Reset() { *m = MemberListRequest{} } -func (m *MemberListRequest) String() string { return proto.CompactTextString(m) } -func (*MemberListRequest) ProtoMessage() {} -func (*MemberListRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{46} -} -func (m *MemberListRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MemberListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MemberListRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MemberListRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MemberListRequest.Merge(m, src) -} -func (m *MemberListRequest) XXX_Size() int { - return m.Size() -} -func (m *MemberListRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MemberListRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MemberListRequest proto.InternalMessageInfo - -func (m *MemberListRequest) GetLinearizable() bool { - if m != nil { - return m.Linearizable - } - return false -} - -type MemberListResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // members is a list of all members associated with the cluster. - Members []*Member `protobuf:"bytes,2,rep,name=members,proto3" json:"members,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MemberListResponse) Reset() { *m = MemberListResponse{} } -func (m *MemberListResponse) String() string { return proto.CompactTextString(m) } -func (*MemberListResponse) ProtoMessage() {} -func (*MemberListResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{47} -} -func (m *MemberListResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MemberListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MemberListResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MemberListResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MemberListResponse.Merge(m, src) -} -func (m *MemberListResponse) XXX_Size() int { - return m.Size() -} -func (m *MemberListResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MemberListResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MemberListResponse proto.InternalMessageInfo - -func (m *MemberListResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *MemberListResponse) GetMembers() []*Member { - if m != nil { - return m.Members - } - return nil -} - -type MemberPromoteRequest struct { - // ID is the member ID of the member to promote. - ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MemberPromoteRequest) Reset() { *m = MemberPromoteRequest{} } -func (m *MemberPromoteRequest) String() string { return proto.CompactTextString(m) } -func (*MemberPromoteRequest) ProtoMessage() {} -func (*MemberPromoteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{48} -} -func (m *MemberPromoteRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MemberPromoteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MemberPromoteRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MemberPromoteRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MemberPromoteRequest.Merge(m, src) -} -func (m *MemberPromoteRequest) XXX_Size() int { - return m.Size() -} -func (m *MemberPromoteRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MemberPromoteRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MemberPromoteRequest proto.InternalMessageInfo - -func (m *MemberPromoteRequest) GetID() uint64 { - if m != nil { - return m.ID - } - return 0 -} - -type MemberPromoteResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // members is a list of all members after promoting the member. - Members []*Member `protobuf:"bytes,2,rep,name=members,proto3" json:"members,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MemberPromoteResponse) Reset() { *m = MemberPromoteResponse{} } -func (m *MemberPromoteResponse) String() string { return proto.CompactTextString(m) } -func (*MemberPromoteResponse) ProtoMessage() {} -func (*MemberPromoteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{49} -} -func (m *MemberPromoteResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MemberPromoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MemberPromoteResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MemberPromoteResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MemberPromoteResponse.Merge(m, src) -} -func (m *MemberPromoteResponse) XXX_Size() int { - return m.Size() -} -func (m *MemberPromoteResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MemberPromoteResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MemberPromoteResponse proto.InternalMessageInfo - -func (m *MemberPromoteResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *MemberPromoteResponse) GetMembers() []*Member { - if m != nil { - return m.Members - } - return nil -} - -type DefragmentRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DefragmentRequest) Reset() { *m = DefragmentRequest{} } -func (m *DefragmentRequest) String() string { return proto.CompactTextString(m) } -func (*DefragmentRequest) ProtoMessage() {} -func (*DefragmentRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{50} -} -func (m *DefragmentRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DefragmentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DefragmentRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DefragmentRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DefragmentRequest.Merge(m, src) -} -func (m *DefragmentRequest) XXX_Size() int { - return m.Size() -} -func (m *DefragmentRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DefragmentRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DefragmentRequest proto.InternalMessageInfo - -type DefragmentResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DefragmentResponse) Reset() { *m = DefragmentResponse{} } -func (m *DefragmentResponse) String() string { return proto.CompactTextString(m) } -func (*DefragmentResponse) ProtoMessage() {} -func (*DefragmentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{51} -} -func (m *DefragmentResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DefragmentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DefragmentResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DefragmentResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DefragmentResponse.Merge(m, src) -} -func (m *DefragmentResponse) XXX_Size() int { - return m.Size() -} -func (m *DefragmentResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DefragmentResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DefragmentResponse proto.InternalMessageInfo - -func (m *DefragmentResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type MoveLeaderRequest struct { - // targetID is the node ID for the new leader. - TargetID uint64 `protobuf:"varint,1,opt,name=targetID,proto3" json:"targetID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MoveLeaderRequest) Reset() { *m = MoveLeaderRequest{} } -func (m *MoveLeaderRequest) String() string { return proto.CompactTextString(m) } -func (*MoveLeaderRequest) ProtoMessage() {} -func (*MoveLeaderRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{52} -} -func (m *MoveLeaderRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MoveLeaderRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MoveLeaderRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MoveLeaderRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MoveLeaderRequest.Merge(m, src) -} -func (m *MoveLeaderRequest) XXX_Size() int { - return m.Size() -} -func (m *MoveLeaderRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MoveLeaderRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MoveLeaderRequest proto.InternalMessageInfo - -func (m *MoveLeaderRequest) GetTargetID() uint64 { - if m != nil { - return m.TargetID - } - return 0 -} - -type MoveLeaderResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MoveLeaderResponse) Reset() { *m = MoveLeaderResponse{} } -func (m *MoveLeaderResponse) String() string { return proto.CompactTextString(m) } -func (*MoveLeaderResponse) ProtoMessage() {} -func (*MoveLeaderResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{53} -} -func (m *MoveLeaderResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MoveLeaderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MoveLeaderResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MoveLeaderResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MoveLeaderResponse.Merge(m, src) -} -func (m *MoveLeaderResponse) XXX_Size() int { - return m.Size() -} -func (m *MoveLeaderResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MoveLeaderResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MoveLeaderResponse proto.InternalMessageInfo - -func (m *MoveLeaderResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AlarmRequest struct { - // action is the kind of alarm request to issue. The action - // may GET alarm statuses, ACTIVATE an alarm, or DEACTIVATE a - // raised alarm. - Action AlarmRequest_AlarmAction `protobuf:"varint,1,opt,name=action,proto3,enum=etcdserverpb.AlarmRequest_AlarmAction" json:"action,omitempty"` - // memberID is the ID of the member associated with the alarm. If memberID is 0, the - // alarm request covers all members. - MemberID uint64 `protobuf:"varint,2,opt,name=memberID,proto3" json:"memberID,omitempty"` - // alarm is the type of alarm to consider for this request. - Alarm AlarmType `protobuf:"varint,3,opt,name=alarm,proto3,enum=etcdserverpb.AlarmType" json:"alarm,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AlarmRequest) Reset() { *m = AlarmRequest{} } -func (m *AlarmRequest) String() string { return proto.CompactTextString(m) } -func (*AlarmRequest) ProtoMessage() {} -func (*AlarmRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{54} -} -func (m *AlarmRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AlarmRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AlarmRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AlarmRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AlarmRequest.Merge(m, src) -} -func (m *AlarmRequest) XXX_Size() int { - return m.Size() -} -func (m *AlarmRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AlarmRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AlarmRequest proto.InternalMessageInfo - -func (m *AlarmRequest) GetAction() AlarmRequest_AlarmAction { - if m != nil { - return m.Action - } - return AlarmRequest_GET -} - -func (m *AlarmRequest) GetMemberID() uint64 { - if m != nil { - return m.MemberID - } - return 0 -} - -func (m *AlarmRequest) GetAlarm() AlarmType { - if m != nil { - return m.Alarm - } - return AlarmType_NONE -} - -type AlarmMember struct { - // memberID is the ID of the member associated with the raised alarm. - MemberID uint64 `protobuf:"varint,1,opt,name=memberID,proto3" json:"memberID,omitempty"` - // alarm is the type of alarm which has been raised. - Alarm AlarmType `protobuf:"varint,2,opt,name=alarm,proto3,enum=etcdserverpb.AlarmType" json:"alarm,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AlarmMember) Reset() { *m = AlarmMember{} } -func (m *AlarmMember) String() string { return proto.CompactTextString(m) } -func (*AlarmMember) ProtoMessage() {} -func (*AlarmMember) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{55} -} -func (m *AlarmMember) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AlarmMember) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AlarmMember.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AlarmMember) XXX_Merge(src proto.Message) { - xxx_messageInfo_AlarmMember.Merge(m, src) -} -func (m *AlarmMember) XXX_Size() int { - return m.Size() -} -func (m *AlarmMember) XXX_DiscardUnknown() { - xxx_messageInfo_AlarmMember.DiscardUnknown(m) -} - -var xxx_messageInfo_AlarmMember proto.InternalMessageInfo - -func (m *AlarmMember) GetMemberID() uint64 { - if m != nil { - return m.MemberID - } - return 0 -} - -func (m *AlarmMember) GetAlarm() AlarmType { - if m != nil { - return m.Alarm - } - return AlarmType_NONE -} - -type AlarmResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // alarms is a list of alarms associated with the alarm request. - Alarms []*AlarmMember `protobuf:"bytes,2,rep,name=alarms,proto3" json:"alarms,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AlarmResponse) Reset() { *m = AlarmResponse{} } -func (m *AlarmResponse) String() string { return proto.CompactTextString(m) } -func (*AlarmResponse) ProtoMessage() {} -func (*AlarmResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{56} -} -func (m *AlarmResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AlarmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AlarmResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AlarmResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AlarmResponse.Merge(m, src) -} -func (m *AlarmResponse) XXX_Size() int { - return m.Size() -} -func (m *AlarmResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AlarmResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AlarmResponse proto.InternalMessageInfo - -func (m *AlarmResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *AlarmResponse) GetAlarms() []*AlarmMember { - if m != nil { - return m.Alarms - } - return nil -} - -type DowngradeRequest struct { - // action is the kind of downgrade request to issue. The action may - // VALIDATE the target version, DOWNGRADE the cluster version, - // or CANCEL the current downgrading job. - Action DowngradeRequest_DowngradeAction `protobuf:"varint,1,opt,name=action,proto3,enum=etcdserverpb.DowngradeRequest_DowngradeAction" json:"action,omitempty"` - // version is the target version to downgrade. - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DowngradeRequest) Reset() { *m = DowngradeRequest{} } -func (m *DowngradeRequest) String() string { return proto.CompactTextString(m) } -func (*DowngradeRequest) ProtoMessage() {} -func (*DowngradeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{57} -} -func (m *DowngradeRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DowngradeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DowngradeRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DowngradeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DowngradeRequest.Merge(m, src) -} -func (m *DowngradeRequest) XXX_Size() int { - return m.Size() -} -func (m *DowngradeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DowngradeRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DowngradeRequest proto.InternalMessageInfo - -func (m *DowngradeRequest) GetAction() DowngradeRequest_DowngradeAction { - if m != nil { - return m.Action - } - return DowngradeRequest_VALIDATE -} - -func (m *DowngradeRequest) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -type DowngradeResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // version is the current cluster version. - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DowngradeResponse) Reset() { *m = DowngradeResponse{} } -func (m *DowngradeResponse) String() string { return proto.CompactTextString(m) } -func (*DowngradeResponse) ProtoMessage() {} -func (*DowngradeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{58} -} -func (m *DowngradeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DowngradeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DowngradeResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DowngradeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DowngradeResponse.Merge(m, src) -} -func (m *DowngradeResponse) XXX_Size() int { - return m.Size() -} -func (m *DowngradeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DowngradeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DowngradeResponse proto.InternalMessageInfo - -func (m *DowngradeResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *DowngradeResponse) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -type StatusRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StatusRequest) Reset() { *m = StatusRequest{} } -func (m *StatusRequest) String() string { return proto.CompactTextString(m) } -func (*StatusRequest) ProtoMessage() {} -func (*StatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{59} -} -func (m *StatusRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StatusRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StatusRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_StatusRequest.Merge(m, src) -} -func (m *StatusRequest) XXX_Size() int { - return m.Size() -} -func (m *StatusRequest) XXX_DiscardUnknown() { - xxx_messageInfo_StatusRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_StatusRequest proto.InternalMessageInfo - -type StatusResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // version is the cluster protocol version used by the responding member. - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - // dbSize is the size of the backend database physically allocated, in bytes, of the responding member. - DbSize int64 `protobuf:"varint,3,opt,name=dbSize,proto3" json:"dbSize,omitempty"` - // leader is the member ID which the responding member believes is the current leader. - Leader uint64 `protobuf:"varint,4,opt,name=leader,proto3" json:"leader,omitempty"` - // raftIndex is the current raft committed index of the responding member. - RaftIndex uint64 `protobuf:"varint,5,opt,name=raftIndex,proto3" json:"raftIndex,omitempty"` - // raftTerm is the current raft term of the responding member. - RaftTerm uint64 `protobuf:"varint,6,opt,name=raftTerm,proto3" json:"raftTerm,omitempty"` - // raftAppliedIndex is the current raft applied index of the responding member. - RaftAppliedIndex uint64 `protobuf:"varint,7,opt,name=raftAppliedIndex,proto3" json:"raftAppliedIndex,omitempty"` - // errors contains alarm/health information and status. - Errors []string `protobuf:"bytes,8,rep,name=errors,proto3" json:"errors,omitempty"` - // dbSizeInUse is the size of the backend database logically in use, in bytes, of the responding member. - DbSizeInUse int64 `protobuf:"varint,9,opt,name=dbSizeInUse,proto3" json:"dbSizeInUse,omitempty"` - // isLearner indicates if the member is raft learner. - IsLearner bool `protobuf:"varint,10,opt,name=isLearner,proto3" json:"isLearner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StatusResponse) Reset() { *m = StatusResponse{} } -func (m *StatusResponse) String() string { return proto.CompactTextString(m) } -func (*StatusResponse) ProtoMessage() {} -func (*StatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{60} -} -func (m *StatusResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StatusResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StatusResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_StatusResponse.Merge(m, src) -} -func (m *StatusResponse) XXX_Size() int { - return m.Size() -} -func (m *StatusResponse) XXX_DiscardUnknown() { - xxx_messageInfo_StatusResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_StatusResponse proto.InternalMessageInfo - -func (m *StatusResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *StatusResponse) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *StatusResponse) GetDbSize() int64 { - if m != nil { - return m.DbSize - } - return 0 -} - -func (m *StatusResponse) GetLeader() uint64 { - if m != nil { - return m.Leader - } - return 0 -} - -func (m *StatusResponse) GetRaftIndex() uint64 { - if m != nil { - return m.RaftIndex - } - return 0 -} - -func (m *StatusResponse) GetRaftTerm() uint64 { - if m != nil { - return m.RaftTerm - } - return 0 -} - -func (m *StatusResponse) GetRaftAppliedIndex() uint64 { - if m != nil { - return m.RaftAppliedIndex - } - return 0 -} - -func (m *StatusResponse) GetErrors() []string { - if m != nil { - return m.Errors - } - return nil -} - -func (m *StatusResponse) GetDbSizeInUse() int64 { - if m != nil { - return m.DbSizeInUse - } - return 0 -} - -func (m *StatusResponse) GetIsLearner() bool { - if m != nil { - return m.IsLearner - } - return false -} - -type AuthEnableRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthEnableRequest) Reset() { *m = AuthEnableRequest{} } -func (m *AuthEnableRequest) String() string { return proto.CompactTextString(m) } -func (*AuthEnableRequest) ProtoMessage() {} -func (*AuthEnableRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{61} -} -func (m *AuthEnableRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthEnableRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthEnableRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthEnableRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthEnableRequest.Merge(m, src) -} -func (m *AuthEnableRequest) XXX_Size() int { - return m.Size() -} -func (m *AuthEnableRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AuthEnableRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthEnableRequest proto.InternalMessageInfo - -type AuthDisableRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthDisableRequest) Reset() { *m = AuthDisableRequest{} } -func (m *AuthDisableRequest) String() string { return proto.CompactTextString(m) } -func (*AuthDisableRequest) ProtoMessage() {} -func (*AuthDisableRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{62} -} -func (m *AuthDisableRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthDisableRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthDisableRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthDisableRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthDisableRequest.Merge(m, src) -} -func (m *AuthDisableRequest) XXX_Size() int { - return m.Size() -} -func (m *AuthDisableRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AuthDisableRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthDisableRequest proto.InternalMessageInfo - -type AuthStatusRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthStatusRequest) Reset() { *m = AuthStatusRequest{} } -func (m *AuthStatusRequest) String() string { return proto.CompactTextString(m) } -func (*AuthStatusRequest) ProtoMessage() {} -func (*AuthStatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{63} -} -func (m *AuthStatusRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthStatusRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthStatusRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthStatusRequest.Merge(m, src) -} -func (m *AuthStatusRequest) XXX_Size() int { - return m.Size() -} -func (m *AuthStatusRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AuthStatusRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthStatusRequest proto.InternalMessageInfo - -type AuthenticateRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthenticateRequest) Reset() { *m = AuthenticateRequest{} } -func (m *AuthenticateRequest) String() string { return proto.CompactTextString(m) } -func (*AuthenticateRequest) ProtoMessage() {} -func (*AuthenticateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{64} -} -func (m *AuthenticateRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthenticateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthenticateRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthenticateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthenticateRequest.Merge(m, src) -} -func (m *AuthenticateRequest) XXX_Size() int { - return m.Size() -} -func (m *AuthenticateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AuthenticateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthenticateRequest proto.InternalMessageInfo - -func (m *AuthenticateRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *AuthenticateRequest) GetPassword() string { - if m != nil { - return m.Password - } - return "" -} - -type AuthUserAddRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - Options *authpb.UserAddOptions `protobuf:"bytes,3,opt,name=options,proto3" json:"options,omitempty"` - HashedPassword string `protobuf:"bytes,4,opt,name=hashedPassword,proto3" json:"hashedPassword,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthUserAddRequest) Reset() { *m = AuthUserAddRequest{} } -func (m *AuthUserAddRequest) String() string { return proto.CompactTextString(m) } -func (*AuthUserAddRequest) ProtoMessage() {} -func (*AuthUserAddRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{65} -} -func (m *AuthUserAddRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthUserAddRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthUserAddRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthUserAddRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthUserAddRequest.Merge(m, src) -} -func (m *AuthUserAddRequest) XXX_Size() int { - return m.Size() -} -func (m *AuthUserAddRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AuthUserAddRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthUserAddRequest proto.InternalMessageInfo - -func (m *AuthUserAddRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *AuthUserAddRequest) GetPassword() string { - if m != nil { - return m.Password - } - return "" -} - -func (m *AuthUserAddRequest) GetOptions() *authpb.UserAddOptions { - if m != nil { - return m.Options - } - return nil -} - -func (m *AuthUserAddRequest) GetHashedPassword() string { - if m != nil { - return m.HashedPassword - } - return "" -} - -type AuthUserGetRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthUserGetRequest) Reset() { *m = AuthUserGetRequest{} } -func (m *AuthUserGetRequest) String() string { return proto.CompactTextString(m) } -func (*AuthUserGetRequest) ProtoMessage() {} -func (*AuthUserGetRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{66} -} -func (m *AuthUserGetRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthUserGetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthUserGetRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthUserGetRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthUserGetRequest.Merge(m, src) -} -func (m *AuthUserGetRequest) XXX_Size() int { - return m.Size() -} -func (m *AuthUserGetRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AuthUserGetRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthUserGetRequest proto.InternalMessageInfo - -func (m *AuthUserGetRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type AuthUserDeleteRequest struct { - // name is the name of the user to delete. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthUserDeleteRequest) Reset() { *m = AuthUserDeleteRequest{} } -func (m *AuthUserDeleteRequest) String() string { return proto.CompactTextString(m) } -func (*AuthUserDeleteRequest) ProtoMessage() {} -func (*AuthUserDeleteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{67} -} -func (m *AuthUserDeleteRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthUserDeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthUserDeleteRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthUserDeleteRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthUserDeleteRequest.Merge(m, src) -} -func (m *AuthUserDeleteRequest) XXX_Size() int { - return m.Size() -} -func (m *AuthUserDeleteRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AuthUserDeleteRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthUserDeleteRequest proto.InternalMessageInfo - -func (m *AuthUserDeleteRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type AuthUserChangePasswordRequest struct { - // name is the name of the user whose password is being changed. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // password is the new password for the user. Note that this field will be removed in the API layer. - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - // hashedPassword is the new password for the user. Note that this field will be initialized in the API layer. - HashedPassword string `protobuf:"bytes,3,opt,name=hashedPassword,proto3" json:"hashedPassword,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthUserChangePasswordRequest) Reset() { *m = AuthUserChangePasswordRequest{} } -func (m *AuthUserChangePasswordRequest) String() string { return proto.CompactTextString(m) } -func (*AuthUserChangePasswordRequest) ProtoMessage() {} -func (*AuthUserChangePasswordRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{68} -} -func (m *AuthUserChangePasswordRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthUserChangePasswordRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthUserChangePasswordRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthUserChangePasswordRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthUserChangePasswordRequest.Merge(m, src) -} -func (m *AuthUserChangePasswordRequest) XXX_Size() int { - return m.Size() -} -func (m *AuthUserChangePasswordRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AuthUserChangePasswordRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthUserChangePasswordRequest proto.InternalMessageInfo - -func (m *AuthUserChangePasswordRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *AuthUserChangePasswordRequest) GetPassword() string { - if m != nil { - return m.Password - } - return "" -} - -func (m *AuthUserChangePasswordRequest) GetHashedPassword() string { - if m != nil { - return m.HashedPassword - } - return "" -} - -type AuthUserGrantRoleRequest struct { - // user is the name of the user which should be granted a given role. - User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` - // role is the name of the role to grant to the user. - Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthUserGrantRoleRequest) Reset() { *m = AuthUserGrantRoleRequest{} } -func (m *AuthUserGrantRoleRequest) String() string { return proto.CompactTextString(m) } -func (*AuthUserGrantRoleRequest) ProtoMessage() {} -func (*AuthUserGrantRoleRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{69} -} -func (m *AuthUserGrantRoleRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthUserGrantRoleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthUserGrantRoleRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthUserGrantRoleRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthUserGrantRoleRequest.Merge(m, src) -} -func (m *AuthUserGrantRoleRequest) XXX_Size() int { - return m.Size() -} -func (m *AuthUserGrantRoleRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AuthUserGrantRoleRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthUserGrantRoleRequest proto.InternalMessageInfo - -func (m *AuthUserGrantRoleRequest) GetUser() string { - if m != nil { - return m.User - } - return "" -} - -func (m *AuthUserGrantRoleRequest) GetRole() string { - if m != nil { - return m.Role - } - return "" -} - -type AuthUserRevokeRoleRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthUserRevokeRoleRequest) Reset() { *m = AuthUserRevokeRoleRequest{} } -func (m *AuthUserRevokeRoleRequest) String() string { return proto.CompactTextString(m) } -func (*AuthUserRevokeRoleRequest) ProtoMessage() {} -func (*AuthUserRevokeRoleRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{70} -} -func (m *AuthUserRevokeRoleRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthUserRevokeRoleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthUserRevokeRoleRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthUserRevokeRoleRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthUserRevokeRoleRequest.Merge(m, src) -} -func (m *AuthUserRevokeRoleRequest) XXX_Size() int { - return m.Size() -} -func (m *AuthUserRevokeRoleRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AuthUserRevokeRoleRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthUserRevokeRoleRequest proto.InternalMessageInfo - -func (m *AuthUserRevokeRoleRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *AuthUserRevokeRoleRequest) GetRole() string { - if m != nil { - return m.Role - } - return "" -} - -type AuthRoleAddRequest struct { - // name is the name of the role to add to the authentication system. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthRoleAddRequest) Reset() { *m = AuthRoleAddRequest{} } -func (m *AuthRoleAddRequest) String() string { return proto.CompactTextString(m) } -func (*AuthRoleAddRequest) ProtoMessage() {} -func (*AuthRoleAddRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{71} -} -func (m *AuthRoleAddRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthRoleAddRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthRoleAddRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthRoleAddRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthRoleAddRequest.Merge(m, src) -} -func (m *AuthRoleAddRequest) XXX_Size() int { - return m.Size() -} -func (m *AuthRoleAddRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AuthRoleAddRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthRoleAddRequest proto.InternalMessageInfo - -func (m *AuthRoleAddRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type AuthRoleGetRequest struct { - Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthRoleGetRequest) Reset() { *m = AuthRoleGetRequest{} } -func (m *AuthRoleGetRequest) String() string { return proto.CompactTextString(m) } -func (*AuthRoleGetRequest) ProtoMessage() {} -func (*AuthRoleGetRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{72} -} -func (m *AuthRoleGetRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthRoleGetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthRoleGetRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthRoleGetRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthRoleGetRequest.Merge(m, src) -} -func (m *AuthRoleGetRequest) XXX_Size() int { - return m.Size() -} -func (m *AuthRoleGetRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AuthRoleGetRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthRoleGetRequest proto.InternalMessageInfo - -func (m *AuthRoleGetRequest) GetRole() string { - if m != nil { - return m.Role - } - return "" -} - -type AuthUserListRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthUserListRequest) Reset() { *m = AuthUserListRequest{} } -func (m *AuthUserListRequest) String() string { return proto.CompactTextString(m) } -func (*AuthUserListRequest) ProtoMessage() {} -func (*AuthUserListRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{73} -} -func (m *AuthUserListRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthUserListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthUserListRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthUserListRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthUserListRequest.Merge(m, src) -} -func (m *AuthUserListRequest) XXX_Size() int { - return m.Size() -} -func (m *AuthUserListRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AuthUserListRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthUserListRequest proto.InternalMessageInfo - -type AuthRoleListRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthRoleListRequest) Reset() { *m = AuthRoleListRequest{} } -func (m *AuthRoleListRequest) String() string { return proto.CompactTextString(m) } -func (*AuthRoleListRequest) ProtoMessage() {} -func (*AuthRoleListRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{74} -} -func (m *AuthRoleListRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthRoleListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthRoleListRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthRoleListRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthRoleListRequest.Merge(m, src) -} -func (m *AuthRoleListRequest) XXX_Size() int { - return m.Size() -} -func (m *AuthRoleListRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AuthRoleListRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthRoleListRequest proto.InternalMessageInfo - -type AuthRoleDeleteRequest struct { - Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthRoleDeleteRequest) Reset() { *m = AuthRoleDeleteRequest{} } -func (m *AuthRoleDeleteRequest) String() string { return proto.CompactTextString(m) } -func (*AuthRoleDeleteRequest) ProtoMessage() {} -func (*AuthRoleDeleteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{75} -} -func (m *AuthRoleDeleteRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthRoleDeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthRoleDeleteRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthRoleDeleteRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthRoleDeleteRequest.Merge(m, src) -} -func (m *AuthRoleDeleteRequest) XXX_Size() int { - return m.Size() -} -func (m *AuthRoleDeleteRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AuthRoleDeleteRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthRoleDeleteRequest proto.InternalMessageInfo - -func (m *AuthRoleDeleteRequest) GetRole() string { - if m != nil { - return m.Role - } - return "" -} - -type AuthRoleGrantPermissionRequest struct { - // name is the name of the role which will be granted the permission. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // perm is the permission to grant to the role. - Perm *authpb.Permission `protobuf:"bytes,2,opt,name=perm,proto3" json:"perm,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthRoleGrantPermissionRequest) Reset() { *m = AuthRoleGrantPermissionRequest{} } -func (m *AuthRoleGrantPermissionRequest) String() string { return proto.CompactTextString(m) } -func (*AuthRoleGrantPermissionRequest) ProtoMessage() {} -func (*AuthRoleGrantPermissionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{76} -} -func (m *AuthRoleGrantPermissionRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthRoleGrantPermissionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthRoleGrantPermissionRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthRoleGrantPermissionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthRoleGrantPermissionRequest.Merge(m, src) -} -func (m *AuthRoleGrantPermissionRequest) XXX_Size() int { - return m.Size() -} -func (m *AuthRoleGrantPermissionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AuthRoleGrantPermissionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthRoleGrantPermissionRequest proto.InternalMessageInfo - -func (m *AuthRoleGrantPermissionRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *AuthRoleGrantPermissionRequest) GetPerm() *authpb.Permission { - if m != nil { - return m.Perm - } - return nil -} - -type AuthRoleRevokePermissionRequest struct { - Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` - Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - RangeEnd []byte `protobuf:"bytes,3,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthRoleRevokePermissionRequest) Reset() { *m = AuthRoleRevokePermissionRequest{} } -func (m *AuthRoleRevokePermissionRequest) String() string { return proto.CompactTextString(m) } -func (*AuthRoleRevokePermissionRequest) ProtoMessage() {} -func (*AuthRoleRevokePermissionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{77} -} -func (m *AuthRoleRevokePermissionRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthRoleRevokePermissionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthRoleRevokePermissionRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthRoleRevokePermissionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthRoleRevokePermissionRequest.Merge(m, src) -} -func (m *AuthRoleRevokePermissionRequest) XXX_Size() int { - return m.Size() -} -func (m *AuthRoleRevokePermissionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AuthRoleRevokePermissionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthRoleRevokePermissionRequest proto.InternalMessageInfo - -func (m *AuthRoleRevokePermissionRequest) GetRole() string { - if m != nil { - return m.Role - } - return "" -} - -func (m *AuthRoleRevokePermissionRequest) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *AuthRoleRevokePermissionRequest) GetRangeEnd() []byte { - if m != nil { - return m.RangeEnd - } - return nil -} - -type AuthEnableResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthEnableResponse) Reset() { *m = AuthEnableResponse{} } -func (m *AuthEnableResponse) String() string { return proto.CompactTextString(m) } -func (*AuthEnableResponse) ProtoMessage() {} -func (*AuthEnableResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{78} -} -func (m *AuthEnableResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthEnableResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthEnableResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthEnableResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthEnableResponse.Merge(m, src) -} -func (m *AuthEnableResponse) XXX_Size() int { - return m.Size() -} -func (m *AuthEnableResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AuthEnableResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthEnableResponse proto.InternalMessageInfo - -func (m *AuthEnableResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AuthDisableResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthDisableResponse) Reset() { *m = AuthDisableResponse{} } -func (m *AuthDisableResponse) String() string { return proto.CompactTextString(m) } -func (*AuthDisableResponse) ProtoMessage() {} -func (*AuthDisableResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{79} -} -func (m *AuthDisableResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthDisableResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthDisableResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthDisableResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthDisableResponse.Merge(m, src) -} -func (m *AuthDisableResponse) XXX_Size() int { - return m.Size() -} -func (m *AuthDisableResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AuthDisableResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthDisableResponse proto.InternalMessageInfo - -func (m *AuthDisableResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AuthStatusResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - Enabled bool `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"` - // authRevision is the current revision of auth store - AuthRevision uint64 `protobuf:"varint,3,opt,name=authRevision,proto3" json:"authRevision,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthStatusResponse) Reset() { *m = AuthStatusResponse{} } -func (m *AuthStatusResponse) String() string { return proto.CompactTextString(m) } -func (*AuthStatusResponse) ProtoMessage() {} -func (*AuthStatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{80} -} -func (m *AuthStatusResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthStatusResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthStatusResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthStatusResponse.Merge(m, src) -} -func (m *AuthStatusResponse) XXX_Size() int { - return m.Size() -} -func (m *AuthStatusResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AuthStatusResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthStatusResponse proto.InternalMessageInfo - -func (m *AuthStatusResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *AuthStatusResponse) GetEnabled() bool { - if m != nil { - return m.Enabled - } - return false -} - -func (m *AuthStatusResponse) GetAuthRevision() uint64 { - if m != nil { - return m.AuthRevision - } - return 0 -} - -type AuthenticateResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // token is an authorized token that can be used in succeeding RPCs - Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthenticateResponse) Reset() { *m = AuthenticateResponse{} } -func (m *AuthenticateResponse) String() string { return proto.CompactTextString(m) } -func (*AuthenticateResponse) ProtoMessage() {} -func (*AuthenticateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{81} -} -func (m *AuthenticateResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthenticateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthenticateResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthenticateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthenticateResponse.Merge(m, src) -} -func (m *AuthenticateResponse) XXX_Size() int { - return m.Size() -} -func (m *AuthenticateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AuthenticateResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthenticateResponse proto.InternalMessageInfo - -func (m *AuthenticateResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *AuthenticateResponse) GetToken() string { - if m != nil { - return m.Token - } - return "" -} - -type AuthUserAddResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthUserAddResponse) Reset() { *m = AuthUserAddResponse{} } -func (m *AuthUserAddResponse) String() string { return proto.CompactTextString(m) } -func (*AuthUserAddResponse) ProtoMessage() {} -func (*AuthUserAddResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{82} -} -func (m *AuthUserAddResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthUserAddResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthUserAddResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthUserAddResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthUserAddResponse.Merge(m, src) -} -func (m *AuthUserAddResponse) XXX_Size() int { - return m.Size() -} -func (m *AuthUserAddResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AuthUserAddResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthUserAddResponse proto.InternalMessageInfo - -func (m *AuthUserAddResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AuthUserGetResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - Roles []string `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthUserGetResponse) Reset() { *m = AuthUserGetResponse{} } -func (m *AuthUserGetResponse) String() string { return proto.CompactTextString(m) } -func (*AuthUserGetResponse) ProtoMessage() {} -func (*AuthUserGetResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{83} -} -func (m *AuthUserGetResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthUserGetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthUserGetResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthUserGetResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthUserGetResponse.Merge(m, src) -} -func (m *AuthUserGetResponse) XXX_Size() int { - return m.Size() -} -func (m *AuthUserGetResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AuthUserGetResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthUserGetResponse proto.InternalMessageInfo - -func (m *AuthUserGetResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *AuthUserGetResponse) GetRoles() []string { - if m != nil { - return m.Roles - } - return nil -} - -type AuthUserDeleteResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthUserDeleteResponse) Reset() { *m = AuthUserDeleteResponse{} } -func (m *AuthUserDeleteResponse) String() string { return proto.CompactTextString(m) } -func (*AuthUserDeleteResponse) ProtoMessage() {} -func (*AuthUserDeleteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{84} -} -func (m *AuthUserDeleteResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthUserDeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthUserDeleteResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthUserDeleteResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthUserDeleteResponse.Merge(m, src) -} -func (m *AuthUserDeleteResponse) XXX_Size() int { - return m.Size() -} -func (m *AuthUserDeleteResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AuthUserDeleteResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthUserDeleteResponse proto.InternalMessageInfo - -func (m *AuthUserDeleteResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AuthUserChangePasswordResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthUserChangePasswordResponse) Reset() { *m = AuthUserChangePasswordResponse{} } -func (m *AuthUserChangePasswordResponse) String() string { return proto.CompactTextString(m) } -func (*AuthUserChangePasswordResponse) ProtoMessage() {} -func (*AuthUserChangePasswordResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{85} -} -func (m *AuthUserChangePasswordResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthUserChangePasswordResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthUserChangePasswordResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthUserChangePasswordResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthUserChangePasswordResponse.Merge(m, src) -} -func (m *AuthUserChangePasswordResponse) XXX_Size() int { - return m.Size() -} -func (m *AuthUserChangePasswordResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AuthUserChangePasswordResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthUserChangePasswordResponse proto.InternalMessageInfo - -func (m *AuthUserChangePasswordResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AuthUserGrantRoleResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthUserGrantRoleResponse) Reset() { *m = AuthUserGrantRoleResponse{} } -func (m *AuthUserGrantRoleResponse) String() string { return proto.CompactTextString(m) } -func (*AuthUserGrantRoleResponse) ProtoMessage() {} -func (*AuthUserGrantRoleResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{86} -} -func (m *AuthUserGrantRoleResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthUserGrantRoleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthUserGrantRoleResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthUserGrantRoleResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthUserGrantRoleResponse.Merge(m, src) -} -func (m *AuthUserGrantRoleResponse) XXX_Size() int { - return m.Size() -} -func (m *AuthUserGrantRoleResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AuthUserGrantRoleResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthUserGrantRoleResponse proto.InternalMessageInfo - -func (m *AuthUserGrantRoleResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AuthUserRevokeRoleResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthUserRevokeRoleResponse) Reset() { *m = AuthUserRevokeRoleResponse{} } -func (m *AuthUserRevokeRoleResponse) String() string { return proto.CompactTextString(m) } -func (*AuthUserRevokeRoleResponse) ProtoMessage() {} -func (*AuthUserRevokeRoleResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{87} -} -func (m *AuthUserRevokeRoleResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthUserRevokeRoleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthUserRevokeRoleResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthUserRevokeRoleResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthUserRevokeRoleResponse.Merge(m, src) -} -func (m *AuthUserRevokeRoleResponse) XXX_Size() int { - return m.Size() -} -func (m *AuthUserRevokeRoleResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AuthUserRevokeRoleResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthUserRevokeRoleResponse proto.InternalMessageInfo - -func (m *AuthUserRevokeRoleResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AuthRoleAddResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthRoleAddResponse) Reset() { *m = AuthRoleAddResponse{} } -func (m *AuthRoleAddResponse) String() string { return proto.CompactTextString(m) } -func (*AuthRoleAddResponse) ProtoMessage() {} -func (*AuthRoleAddResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{88} -} -func (m *AuthRoleAddResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthRoleAddResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthRoleAddResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthRoleAddResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthRoleAddResponse.Merge(m, src) -} -func (m *AuthRoleAddResponse) XXX_Size() int { - return m.Size() -} -func (m *AuthRoleAddResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AuthRoleAddResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthRoleAddResponse proto.InternalMessageInfo - -func (m *AuthRoleAddResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AuthRoleGetResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - Perm []*authpb.Permission `protobuf:"bytes,2,rep,name=perm,proto3" json:"perm,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthRoleGetResponse) Reset() { *m = AuthRoleGetResponse{} } -func (m *AuthRoleGetResponse) String() string { return proto.CompactTextString(m) } -func (*AuthRoleGetResponse) ProtoMessage() {} -func (*AuthRoleGetResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{89} -} -func (m *AuthRoleGetResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthRoleGetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthRoleGetResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthRoleGetResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthRoleGetResponse.Merge(m, src) -} -func (m *AuthRoleGetResponse) XXX_Size() int { - return m.Size() -} -func (m *AuthRoleGetResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AuthRoleGetResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthRoleGetResponse proto.InternalMessageInfo - -func (m *AuthRoleGetResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *AuthRoleGetResponse) GetPerm() []*authpb.Permission { - if m != nil { - return m.Perm - } - return nil -} - -type AuthRoleListResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - Roles []string `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthRoleListResponse) Reset() { *m = AuthRoleListResponse{} } -func (m *AuthRoleListResponse) String() string { return proto.CompactTextString(m) } -func (*AuthRoleListResponse) ProtoMessage() {} -func (*AuthRoleListResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{90} -} -func (m *AuthRoleListResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthRoleListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthRoleListResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthRoleListResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthRoleListResponse.Merge(m, src) -} -func (m *AuthRoleListResponse) XXX_Size() int { - return m.Size() -} -func (m *AuthRoleListResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AuthRoleListResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthRoleListResponse proto.InternalMessageInfo - -func (m *AuthRoleListResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *AuthRoleListResponse) GetRoles() []string { - if m != nil { - return m.Roles - } - return nil -} - -type AuthUserListResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - Users []string `protobuf:"bytes,2,rep,name=users,proto3" json:"users,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthUserListResponse) Reset() { *m = AuthUserListResponse{} } -func (m *AuthUserListResponse) String() string { return proto.CompactTextString(m) } -func (*AuthUserListResponse) ProtoMessage() {} -func (*AuthUserListResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{91} -} -func (m *AuthUserListResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthUserListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthUserListResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthUserListResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthUserListResponse.Merge(m, src) -} -func (m *AuthUserListResponse) XXX_Size() int { - return m.Size() -} -func (m *AuthUserListResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AuthUserListResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthUserListResponse proto.InternalMessageInfo - -func (m *AuthUserListResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *AuthUserListResponse) GetUsers() []string { - if m != nil { - return m.Users - } - return nil -} - -type AuthRoleDeleteResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthRoleDeleteResponse) Reset() { *m = AuthRoleDeleteResponse{} } -func (m *AuthRoleDeleteResponse) String() string { return proto.CompactTextString(m) } -func (*AuthRoleDeleteResponse) ProtoMessage() {} -func (*AuthRoleDeleteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{92} -} -func (m *AuthRoleDeleteResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthRoleDeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthRoleDeleteResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthRoleDeleteResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthRoleDeleteResponse.Merge(m, src) -} -func (m *AuthRoleDeleteResponse) XXX_Size() int { - return m.Size() -} -func (m *AuthRoleDeleteResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AuthRoleDeleteResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthRoleDeleteResponse proto.InternalMessageInfo - -func (m *AuthRoleDeleteResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AuthRoleGrantPermissionResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthRoleGrantPermissionResponse) Reset() { *m = AuthRoleGrantPermissionResponse{} } -func (m *AuthRoleGrantPermissionResponse) String() string { return proto.CompactTextString(m) } -func (*AuthRoleGrantPermissionResponse) ProtoMessage() {} -func (*AuthRoleGrantPermissionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{93} -} -func (m *AuthRoleGrantPermissionResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthRoleGrantPermissionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthRoleGrantPermissionResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthRoleGrantPermissionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthRoleGrantPermissionResponse.Merge(m, src) -} -func (m *AuthRoleGrantPermissionResponse) XXX_Size() int { - return m.Size() -} -func (m *AuthRoleGrantPermissionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AuthRoleGrantPermissionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthRoleGrantPermissionResponse proto.InternalMessageInfo - -func (m *AuthRoleGrantPermissionResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AuthRoleRevokePermissionResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthRoleRevokePermissionResponse) Reset() { *m = AuthRoleRevokePermissionResponse{} } -func (m *AuthRoleRevokePermissionResponse) String() string { return proto.CompactTextString(m) } -func (*AuthRoleRevokePermissionResponse) ProtoMessage() {} -func (*AuthRoleRevokePermissionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a6da22d6a3feb1, []int{94} -} -func (m *AuthRoleRevokePermissionResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthRoleRevokePermissionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthRoleRevokePermissionResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuthRoleRevokePermissionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthRoleRevokePermissionResponse.Merge(m, src) -} -func (m *AuthRoleRevokePermissionResponse) XXX_Size() int { - return m.Size() -} -func (m *AuthRoleRevokePermissionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AuthRoleRevokePermissionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthRoleRevokePermissionResponse proto.InternalMessageInfo - -func (m *AuthRoleRevokePermissionResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func init() { - proto.RegisterEnum("etcdserverpb.AlarmType", AlarmType_name, AlarmType_value) - proto.RegisterEnum("etcdserverpb.RangeRequest_SortOrder", RangeRequest_SortOrder_name, RangeRequest_SortOrder_value) - proto.RegisterEnum("etcdserverpb.RangeRequest_SortTarget", RangeRequest_SortTarget_name, RangeRequest_SortTarget_value) - proto.RegisterEnum("etcdserverpb.Compare_CompareResult", Compare_CompareResult_name, Compare_CompareResult_value) - proto.RegisterEnum("etcdserverpb.Compare_CompareTarget", Compare_CompareTarget_name, Compare_CompareTarget_value) - proto.RegisterEnum("etcdserverpb.WatchCreateRequest_FilterType", WatchCreateRequest_FilterType_name, WatchCreateRequest_FilterType_value) - proto.RegisterEnum("etcdserverpb.AlarmRequest_AlarmAction", AlarmRequest_AlarmAction_name, AlarmRequest_AlarmAction_value) - proto.RegisterEnum("etcdserverpb.DowngradeRequest_DowngradeAction", DowngradeRequest_DowngradeAction_name, DowngradeRequest_DowngradeAction_value) - 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((*RequestOp)(nil), "etcdserverpb.RequestOp") - proto.RegisterType((*ResponseOp)(nil), "etcdserverpb.ResponseOp") - 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.RegisterType((*HashRequest)(nil), "etcdserverpb.HashRequest") - proto.RegisterType((*HashKVRequest)(nil), "etcdserverpb.HashKVRequest") - proto.RegisterType((*HashKVResponse)(nil), "etcdserverpb.HashKVResponse") - proto.RegisterType((*HashResponse)(nil), "etcdserverpb.HashResponse") - proto.RegisterType((*SnapshotRequest)(nil), "etcdserverpb.SnapshotRequest") - proto.RegisterType((*SnapshotResponse)(nil), "etcdserverpb.SnapshotResponse") - proto.RegisterType((*WatchRequest)(nil), "etcdserverpb.WatchRequest") - proto.RegisterType((*WatchCreateRequest)(nil), "etcdserverpb.WatchCreateRequest") - proto.RegisterType((*WatchCancelRequest)(nil), "etcdserverpb.WatchCancelRequest") - proto.RegisterType((*WatchProgressRequest)(nil), "etcdserverpb.WatchProgressRequest") - proto.RegisterType((*WatchResponse)(nil), "etcdserverpb.WatchResponse") - proto.RegisterType((*LeaseGrantRequest)(nil), "etcdserverpb.LeaseGrantRequest") - proto.RegisterType((*LeaseGrantResponse)(nil), "etcdserverpb.LeaseGrantResponse") - proto.RegisterType((*LeaseRevokeRequest)(nil), "etcdserverpb.LeaseRevokeRequest") - proto.RegisterType((*LeaseRevokeResponse)(nil), "etcdserverpb.LeaseRevokeResponse") - proto.RegisterType((*LeaseCheckpoint)(nil), "etcdserverpb.LeaseCheckpoint") - proto.RegisterType((*LeaseCheckpointRequest)(nil), "etcdserverpb.LeaseCheckpointRequest") - proto.RegisterType((*LeaseCheckpointResponse)(nil), "etcdserverpb.LeaseCheckpointResponse") - proto.RegisterType((*LeaseKeepAliveRequest)(nil), "etcdserverpb.LeaseKeepAliveRequest") - proto.RegisterType((*LeaseKeepAliveResponse)(nil), "etcdserverpb.LeaseKeepAliveResponse") - proto.RegisterType((*LeaseTimeToLiveRequest)(nil), "etcdserverpb.LeaseTimeToLiveRequest") - proto.RegisterType((*LeaseTimeToLiveResponse)(nil), "etcdserverpb.LeaseTimeToLiveResponse") - proto.RegisterType((*LeaseLeasesRequest)(nil), "etcdserverpb.LeaseLeasesRequest") - proto.RegisterType((*LeaseStatus)(nil), "etcdserverpb.LeaseStatus") - proto.RegisterType((*LeaseLeasesResponse)(nil), "etcdserverpb.LeaseLeasesResponse") - proto.RegisterType((*Member)(nil), "etcdserverpb.Member") - proto.RegisterType((*MemberAddRequest)(nil), "etcdserverpb.MemberAddRequest") - proto.RegisterType((*MemberAddResponse)(nil), "etcdserverpb.MemberAddResponse") - proto.RegisterType((*MemberRemoveRequest)(nil), "etcdserverpb.MemberRemoveRequest") - proto.RegisterType((*MemberRemoveResponse)(nil), "etcdserverpb.MemberRemoveResponse") - proto.RegisterType((*MemberUpdateRequest)(nil), "etcdserverpb.MemberUpdateRequest") - proto.RegisterType((*MemberUpdateResponse)(nil), "etcdserverpb.MemberUpdateResponse") - proto.RegisterType((*MemberListRequest)(nil), "etcdserverpb.MemberListRequest") - proto.RegisterType((*MemberListResponse)(nil), "etcdserverpb.MemberListResponse") - proto.RegisterType((*MemberPromoteRequest)(nil), "etcdserverpb.MemberPromoteRequest") - proto.RegisterType((*MemberPromoteResponse)(nil), "etcdserverpb.MemberPromoteResponse") - proto.RegisterType((*DefragmentRequest)(nil), "etcdserverpb.DefragmentRequest") - proto.RegisterType((*DefragmentResponse)(nil), "etcdserverpb.DefragmentResponse") - proto.RegisterType((*MoveLeaderRequest)(nil), "etcdserverpb.MoveLeaderRequest") - proto.RegisterType((*MoveLeaderResponse)(nil), "etcdserverpb.MoveLeaderResponse") - proto.RegisterType((*AlarmRequest)(nil), "etcdserverpb.AlarmRequest") - proto.RegisterType((*AlarmMember)(nil), "etcdserverpb.AlarmMember") - proto.RegisterType((*AlarmResponse)(nil), "etcdserverpb.AlarmResponse") - proto.RegisterType((*DowngradeRequest)(nil), "etcdserverpb.DowngradeRequest") - proto.RegisterType((*DowngradeResponse)(nil), "etcdserverpb.DowngradeResponse") - proto.RegisterType((*StatusRequest)(nil), "etcdserverpb.StatusRequest") - proto.RegisterType((*StatusResponse)(nil), "etcdserverpb.StatusResponse") - proto.RegisterType((*AuthEnableRequest)(nil), "etcdserverpb.AuthEnableRequest") - proto.RegisterType((*AuthDisableRequest)(nil), "etcdserverpb.AuthDisableRequest") - proto.RegisterType((*AuthStatusRequest)(nil), "etcdserverpb.AuthStatusRequest") - proto.RegisterType((*AuthenticateRequest)(nil), "etcdserverpb.AuthenticateRequest") - proto.RegisterType((*AuthUserAddRequest)(nil), "etcdserverpb.AuthUserAddRequest") - proto.RegisterType((*AuthUserGetRequest)(nil), "etcdserverpb.AuthUserGetRequest") - proto.RegisterType((*AuthUserDeleteRequest)(nil), "etcdserverpb.AuthUserDeleteRequest") - proto.RegisterType((*AuthUserChangePasswordRequest)(nil), "etcdserverpb.AuthUserChangePasswordRequest") - proto.RegisterType((*AuthUserGrantRoleRequest)(nil), "etcdserverpb.AuthUserGrantRoleRequest") - proto.RegisterType((*AuthUserRevokeRoleRequest)(nil), "etcdserverpb.AuthUserRevokeRoleRequest") - proto.RegisterType((*AuthRoleAddRequest)(nil), "etcdserverpb.AuthRoleAddRequest") - proto.RegisterType((*AuthRoleGetRequest)(nil), "etcdserverpb.AuthRoleGetRequest") - proto.RegisterType((*AuthUserListRequest)(nil), "etcdserverpb.AuthUserListRequest") - proto.RegisterType((*AuthRoleListRequest)(nil), "etcdserverpb.AuthRoleListRequest") - proto.RegisterType((*AuthRoleDeleteRequest)(nil), "etcdserverpb.AuthRoleDeleteRequest") - proto.RegisterType((*AuthRoleGrantPermissionRequest)(nil), "etcdserverpb.AuthRoleGrantPermissionRequest") - proto.RegisterType((*AuthRoleRevokePermissionRequest)(nil), "etcdserverpb.AuthRoleRevokePermissionRequest") - proto.RegisterType((*AuthEnableResponse)(nil), "etcdserverpb.AuthEnableResponse") - proto.RegisterType((*AuthDisableResponse)(nil), "etcdserverpb.AuthDisableResponse") - proto.RegisterType((*AuthStatusResponse)(nil), "etcdserverpb.AuthStatusResponse") - proto.RegisterType((*AuthenticateResponse)(nil), "etcdserverpb.AuthenticateResponse") - proto.RegisterType((*AuthUserAddResponse)(nil), "etcdserverpb.AuthUserAddResponse") - proto.RegisterType((*AuthUserGetResponse)(nil), "etcdserverpb.AuthUserGetResponse") - proto.RegisterType((*AuthUserDeleteResponse)(nil), "etcdserverpb.AuthUserDeleteResponse") - proto.RegisterType((*AuthUserChangePasswordResponse)(nil), "etcdserverpb.AuthUserChangePasswordResponse") - proto.RegisterType((*AuthUserGrantRoleResponse)(nil), "etcdserverpb.AuthUserGrantRoleResponse") - proto.RegisterType((*AuthUserRevokeRoleResponse)(nil), "etcdserverpb.AuthUserRevokeRoleResponse") - proto.RegisterType((*AuthRoleAddResponse)(nil), "etcdserverpb.AuthRoleAddResponse") - proto.RegisterType((*AuthRoleGetResponse)(nil), "etcdserverpb.AuthRoleGetResponse") - proto.RegisterType((*AuthRoleListResponse)(nil), "etcdserverpb.AuthRoleListResponse") - proto.RegisterType((*AuthUserListResponse)(nil), "etcdserverpb.AuthUserListResponse") - proto.RegisterType((*AuthRoleDeleteResponse)(nil), "etcdserverpb.AuthRoleDeleteResponse") - proto.RegisterType((*AuthRoleGrantPermissionResponse)(nil), "etcdserverpb.AuthRoleGrantPermissionResponse") - proto.RegisterType((*AuthRoleRevokePermissionResponse)(nil), "etcdserverpb.AuthRoleRevokePermissionResponse") -} - -func init() { proto.RegisterFile("rpc.proto", fileDescriptor_77a6da22d6a3feb1) } - -var fileDescriptor_77a6da22d6a3feb1 = []byte{ - // 4110 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00,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, 0xf2, 0xe5, 0x4f, 0xf4, 0x21, 0x94, 0x99, 0x90, 0xc0, 0xf2, 0x4e, 0x49, 0xd0, 0x98, - 0x67, 0x52, 0xee, 0xbe, 0x42, 0x4a, 0x97, 0x31, 0x9b, 0x0c, 0x9e, 0xff, 0x46, 0x18, 0x2a, 0x3e, - 0xf1, 0x6c, 0x6b, 0x60, 0x7f, 0x61, 0x9d, 0x0c, 0x48, 0xa3, 0xb0, 0x66, 0xac, 0x17, 0x4d, 0x8d, - 0x46, 0xe7, 0x7f, 0x4e, 0x2e, 0xfd, 0x63, 0xd7, 0x19, 0x5c, 0x36, 0x8a, 0x8c, 0xa1, 0x48, 0x09, - 0x07, 0xce, 0xe0, 0x92, 0x2d, 0x9a, 0x3b, 0x76, 0x02, 0xde, 0x5b, 0x62, 0xbd, 0x25, 0x46, 0x61, - 0xdd, 0xeb, 0x50, 0x1f, 0xda, 0xce, 0xf1, 0xd0, 0xed, 0x1f, 0x87, 0x06, 0x01, 0x66, 0x90, 0xda, - 0xd0, 0x76, 0x9e, 0xba, 0x7d, 0x53, 0x9a, 0x85, 0x72, 0x5a, 0x17, 0x3a, 0x67, 0x59, 0x70, 0x5a, - 0x17, 0x2a, 0xe7, 0x06, 0x2c, 0x51, 0x99, 0x3d, 0x8f, 0x58, 0x01, 0x89, 0x98, 0x2b, 0x8c, 0x79, - 0x71, 0x68, 0x3b, 0x5b, 0xac, 0x47, 0xe3, 0xb7, 0x2e, 0x12, 0xfc, 0x55, 0xc1, 0x6f, 0x5d, 0xe8, - 0xfc, 0x78, 0x03, 0x4a, 0xa1, 0xcd, 0x51, 0x11, 0x66, 0xf7, 0x0f, 0xf6, 0x3b, 0xf5, 0x19, 0x04, - 0x30, 0xdf, 0x3e, 0xda, 0xea, 0xec, 0x6f, 0xd7, 0x0d, 0x54, 0x86, 0xc2, 0x76, 0x87, 0x37, 0x72, - 0xf8, 0x11, 0x40, 0x64, 0x5d, 0x54, 0x80, 0xfc, 0x6e, 0xe7, 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7f, 0x34, 0x53, 0x9e, - 0xfa, 0x32, 0x16, 0x5a, 0x7b, 0x1b, 0xc3, 0xcb, 0x0c, 0xa8, 0x86, 0x4b, 0x14, 0x88, 0xbd, 0x6f, - 0x3d, 0x34, 0xee, 0xaf, 0x1b, 0xef, 0x1b, 0x9b, 0xbf, 0x9e, 0x83, 0x39, 0x56, 0xda, 0x45, 0xe7, - 0x00, 0xd1, 0x6b, 0x4f, 0x7c, 0x76, 0x89, 0xf7, 0xa3, 0xf8, 0xec, 0x92, 0x0f, 0x45, 0xb8, 0xc9, - 0x40, 0x97, 0xf1, 0x02, 0x05, 0x65, 0x15, 0xe3, 0x16, 0x2b, 0x82, 0x53, 0x3b, 0xfe, 0xad, 0x21, - 0x2a, 0xdb, 0xfc, 0x2c, 0xa1, 0x34, 0x69, 0xda, 0x93, 0x4f, 0x7c, 0x3b, 0xa4, 0x3c, 0xf7, 0xe0, - 0xef, 0x32, 0xc0, 0x16, 0xae, 0x47, 0x80, 0x1e, 0xe3, 0x78, 0x68, 0xdc, 0xff, 0xbc, 0x81, 0x97, - 0x84, 0x95, 0x63, 0x3d, 0xe8, 0x47, 0x50, 0xd3, 0x9f, 0x34, 0xd0, 0x9d, 0x14, 0xac, 0xf8, 0xcb, - 0x48, 0xf3, 0xad, 0xab, 0x99, 0x84, 0x4e, 0xab, 0x4c, 0x27, 0x01, 0xce, 0x91, 0xcf, 0x09, 0x19, - 0x59, 0x94, 0x49, 0xac, 0x01, 0xfa, 0x47, 0x43, 0xbc, 0x38, 0x45, 0x6f, 0x14, 0x28, 0x4d, 0x7a, - 0xe2, 0x05, 0xa4, 0x79, 0xf7, 0x15, 0x5c, 0x42, 0x89, 0x3f, 0x66, 0x4a, 0x7c, 0x80, 0x97, 0x23, - 0x25, 0x02, 0x7b, 0x48, 0x02, 0x57, 0x68, 0xf1, 0xf9, 0x4d, 0x7c, 0x5d, 0x33, 0x8e, 0xd6, 0x1b, - 0x2d, 0x16, 0x7f, 0x67, 0x48, 0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, 0xb3, 0xc4, 0xeb, 0x45, 0xda, 0x31, 0x4b, - 0x16, 0xb8, 0x52, 0xd6, 0x91, 0xe1, 0x6a, 0xc7, 0x6c, 0x29, 0xa5, 0x90, 0x85, 0xde, 0xcd, 0x30, - 0x62, 0xea, 0xa3, 0x48, 0xf3, 0xbd, 0xd7, 0xe4, 0xce, 0xdc, 0xe3, 0xdc, 0xfc, 0x72, 0x8f, 0xff, - 0x9d, 0x01, 0xcb, 0x69, 0x45, 0x30, 0x94, 0x81, 0x93, 0xf1, 0x98, 0xd2, 0xdc, 0x78, 0x5d, 0xf6, - 0xab, 0xad, 0x15, 0xee, 0xfa, 0x47, 0xf5, 0x7f, 0xfb, 0x72, 0xd5, 0xf8, 0xcf, 0x2f, 0x57, 0x8d, - 0xff, 0xf9, 0x72, 0xd5, 0xf8, 0xfb, 0xff, 0x5d, 0x9d, 0x39, 0x99, 0x67, 0xff, 0xd5, 0xf8, 0xdb, - 0xbf, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x8b, 0x54, 0x11, 0xdf, 0xef, 0x3c, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// KVClient is the client API for KV service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type KVClient interface { - // Range gets the keys in the range from the key-value store. - Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error) - // Put puts the given key into the key-value store. - // A put request increments the revision of the key-value store - // and generates one event in the event history. - Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) - // DeleteRange deletes the given range from the key-value store. - // A delete request increments the revision of the key-value store - // and generates a delete event in the event history for every deleted key. - DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error) - // Txn processes multiple requests in a single transaction. - // A txn request increments the revision of the key-value store - // and generates events with the same revision for every completed request. - // It is not allowed to modify the same key several times within one txn. - Txn(ctx context.Context, in *TxnRequest, opts ...grpc.CallOption) (*TxnResponse, error) - // Compact compacts the event history in the etcd key-value store. The key-value - // store should be periodically compacted or the event history will continue to grow - // indefinitely. - Compact(ctx context.Context, in *CompactionRequest, opts ...grpc.CallOption) (*CompactionResponse, error) -} - -type kVClient struct { - cc *grpc.ClientConn -} - -func NewKVClient(cc *grpc.ClientConn) KVClient { - return &kVClient{cc} -} - -func (c *kVClient) Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error) { - out := new(RangeResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.KV/Range", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kVClient) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) { - out := new(PutResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.KV/Put", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kVClient) DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error) { - out := new(DeleteRangeResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.KV/DeleteRange", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kVClient) Txn(ctx context.Context, in *TxnRequest, opts ...grpc.CallOption) (*TxnResponse, error) { - out := new(TxnResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.KV/Txn", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kVClient) Compact(ctx context.Context, in *CompactionRequest, opts ...grpc.CallOption) (*CompactionResponse, error) { - out := new(CompactionResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.KV/Compact", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// KVServer is the server API for KV service. -type KVServer interface { - // Range gets the keys in the range from the key-value store. - Range(context.Context, *RangeRequest) (*RangeResponse, error) - // Put puts the given key into the key-value store. - // A put request increments the revision of the key-value store - // and generates one event in the event history. - Put(context.Context, *PutRequest) (*PutResponse, error) - // DeleteRange deletes the given range from the key-value store. - // A delete request increments the revision of the key-value store - // and generates a delete event in the event history for every deleted key. - DeleteRange(context.Context, *DeleteRangeRequest) (*DeleteRangeResponse, error) - // Txn processes multiple requests in a single transaction. - // A txn request increments the revision of the key-value store - // and generates events with the same revision for every completed request. - // It is not allowed to modify the same key several times within one txn. - Txn(context.Context, *TxnRequest) (*TxnResponse, error) - // Compact compacts the event history in the etcd key-value store. The key-value - // store should be periodically compacted or the event history will continue to grow - // indefinitely. - Compact(context.Context, *CompactionRequest) (*CompactionResponse, error) -} - -// UnimplementedKVServer can be embedded to have forward compatible implementations. -type UnimplementedKVServer struct { -} - -func (*UnimplementedKVServer) Range(ctx context.Context, req *RangeRequest) (*RangeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Range not implemented") -} -func (*UnimplementedKVServer) Put(ctx context.Context, req *PutRequest) (*PutResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Put not implemented") -} -func (*UnimplementedKVServer) DeleteRange(ctx context.Context, req *DeleteRangeRequest) (*DeleteRangeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteRange not implemented") -} -func (*UnimplementedKVServer) Txn(ctx context.Context, req *TxnRequest) (*TxnResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Txn not implemented") -} -func (*UnimplementedKVServer) Compact(ctx context.Context, req *CompactionRequest) (*CompactionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Compact not implemented") -} - -func RegisterKVServer(s *grpc.Server, srv KVServer) { - s.RegisterService(&_KV_serviceDesc, srv) -} - -func _KV_Range_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RangeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KVServer).Range(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.KV/Range", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KVServer).Range(ctx, req.(*RangeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KV_Put_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PutRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KVServer).Put(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.KV/Put", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KVServer).Put(ctx, req.(*PutRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KV_DeleteRange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteRangeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KVServer).DeleteRange(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.KV/DeleteRange", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KVServer).DeleteRange(ctx, req.(*DeleteRangeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KV_Txn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TxnRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KVServer).Txn(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.KV/Txn", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KVServer).Txn(ctx, req.(*TxnRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KV_Compact_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CompactionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KVServer).Compact(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.KV/Compact", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KVServer).Compact(ctx, req.(*CompactionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _KV_serviceDesc = grpc.ServiceDesc{ - ServiceName: "etcdserverpb.KV", - HandlerType: (*KVServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Range", - Handler: _KV_Range_Handler, - }, - { - MethodName: "Put", - Handler: _KV_Put_Handler, - }, - { - MethodName: "DeleteRange", - Handler: _KV_DeleteRange_Handler, - }, - { - MethodName: "Txn", - Handler: _KV_Txn_Handler, - }, - { - MethodName: "Compact", - Handler: _KV_Compact_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "rpc.proto", -} - -// WatchClient is the client API for Watch service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type WatchClient interface { - // Watch watches for events happening or that have happened. Both input and output - // are streams; the input stream is for creating and canceling watchers and the output - // stream sends events. One watch RPC can watch on multiple key ranges, streaming events - // for several watches at once. The entire event history can be watched starting from the - // last compaction revision. - Watch(ctx context.Context, opts ...grpc.CallOption) (Watch_WatchClient, error) -} - -type watchClient struct { - cc *grpc.ClientConn -} - -func NewWatchClient(cc *grpc.ClientConn) WatchClient { - return &watchClient{cc} -} - -func (c *watchClient) Watch(ctx context.Context, opts ...grpc.CallOption) (Watch_WatchClient, error) { - stream, err := c.cc.NewStream(ctx, &_Watch_serviceDesc.Streams[0], "/etcdserverpb.Watch/Watch", opts...) - if err != nil { - return nil, err - } - x := &watchWatchClient{stream} - return x, nil -} - -type Watch_WatchClient interface { - Send(*WatchRequest) error - Recv() (*WatchResponse, error) - grpc.ClientStream -} - -type watchWatchClient struct { - grpc.ClientStream -} - -func (x *watchWatchClient) Send(m *WatchRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *watchWatchClient) Recv() (*WatchResponse, error) { - m := new(WatchResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// WatchServer is the server API for Watch service. -type WatchServer interface { - // Watch watches for events happening or that have happened. Both input and output - // are streams; the input stream is for creating and canceling watchers and the output - // stream sends events. One watch RPC can watch on multiple key ranges, streaming events - // for several watches at once. The entire event history can be watched starting from the - // last compaction revision. - Watch(Watch_WatchServer) error -} - -// UnimplementedWatchServer can be embedded to have forward compatible implementations. -type UnimplementedWatchServer struct { -} - -func (*UnimplementedWatchServer) Watch(srv Watch_WatchServer) error { - return status.Errorf(codes.Unimplemented, "method Watch not implemented") -} - -func RegisterWatchServer(s *grpc.Server, srv WatchServer) { - s.RegisterService(&_Watch_serviceDesc, srv) -} - -func _Watch_Watch_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(WatchServer).Watch(&watchWatchServer{stream}) -} - -type Watch_WatchServer interface { - Send(*WatchResponse) error - Recv() (*WatchRequest, error) - grpc.ServerStream -} - -type watchWatchServer struct { - grpc.ServerStream -} - -func (x *watchWatchServer) Send(m *WatchResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *watchWatchServer) Recv() (*WatchRequest, error) { - m := new(WatchRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _Watch_serviceDesc = grpc.ServiceDesc{ - ServiceName: "etcdserverpb.Watch", - HandlerType: (*WatchServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Watch", - Handler: _Watch_Watch_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "rpc.proto", -} - -// LeaseClient is the client API for Lease service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type LeaseClient interface { - // LeaseGrant creates a lease which expires if the server does not receive a keepAlive - // within a given time to live period. All keys attached to the lease will be expired and - // deleted if the lease expires. Each expired key generates a delete event in the event history. - LeaseGrant(ctx context.Context, in *LeaseGrantRequest, opts ...grpc.CallOption) (*LeaseGrantResponse, error) - // LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted. - LeaseRevoke(ctx context.Context, in *LeaseRevokeRequest, opts ...grpc.CallOption) (*LeaseRevokeResponse, error) - // LeaseKeepAlive keeps the lease alive by streaming keep alive requests from the client - // to the server and streaming keep alive responses from the server to the client. - LeaseKeepAlive(ctx context.Context, opts ...grpc.CallOption) (Lease_LeaseKeepAliveClient, error) - // LeaseTimeToLive retrieves lease information. - LeaseTimeToLive(ctx context.Context, in *LeaseTimeToLiveRequest, opts ...grpc.CallOption) (*LeaseTimeToLiveResponse, error) - // LeaseLeases lists all existing leases. - LeaseLeases(ctx context.Context, in *LeaseLeasesRequest, opts ...grpc.CallOption) (*LeaseLeasesResponse, error) -} - -type leaseClient struct { - cc *grpc.ClientConn -} - -func NewLeaseClient(cc *grpc.ClientConn) LeaseClient { - return &leaseClient{cc} -} - -func (c *leaseClient) LeaseGrant(ctx context.Context, in *LeaseGrantRequest, opts ...grpc.CallOption) (*LeaseGrantResponse, error) { - out := new(LeaseGrantResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Lease/LeaseGrant", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *leaseClient) LeaseRevoke(ctx context.Context, in *LeaseRevokeRequest, opts ...grpc.CallOption) (*LeaseRevokeResponse, error) { - out := new(LeaseRevokeResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Lease/LeaseRevoke", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *leaseClient) LeaseKeepAlive(ctx context.Context, opts ...grpc.CallOption) (Lease_LeaseKeepAliveClient, error) { - stream, err := c.cc.NewStream(ctx, &_Lease_serviceDesc.Streams[0], "/etcdserverpb.Lease/LeaseKeepAlive", opts...) - if err != nil { - return nil, err - } - x := &leaseLeaseKeepAliveClient{stream} - return x, nil -} - -type Lease_LeaseKeepAliveClient interface { - Send(*LeaseKeepAliveRequest) error - Recv() (*LeaseKeepAliveResponse, error) - grpc.ClientStream -} - -type leaseLeaseKeepAliveClient struct { - grpc.ClientStream -} - -func (x *leaseLeaseKeepAliveClient) Send(m *LeaseKeepAliveRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *leaseLeaseKeepAliveClient) Recv() (*LeaseKeepAliveResponse, error) { - m := new(LeaseKeepAliveResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *leaseClient) LeaseTimeToLive(ctx context.Context, in *LeaseTimeToLiveRequest, opts ...grpc.CallOption) (*LeaseTimeToLiveResponse, error) { - out := new(LeaseTimeToLiveResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Lease/LeaseTimeToLive", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *leaseClient) LeaseLeases(ctx context.Context, in *LeaseLeasesRequest, opts ...grpc.CallOption) (*LeaseLeasesResponse, error) { - out := new(LeaseLeasesResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Lease/LeaseLeases", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// LeaseServer is the server API for Lease service. -type LeaseServer interface { - // LeaseGrant creates a lease which expires if the server does not receive a keepAlive - // within a given time to live period. All keys attached to the lease will be expired and - // deleted if the lease expires. Each expired key generates a delete event in the event history. - LeaseGrant(context.Context, *LeaseGrantRequest) (*LeaseGrantResponse, error) - // LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted. - LeaseRevoke(context.Context, *LeaseRevokeRequest) (*LeaseRevokeResponse, error) - // LeaseKeepAlive keeps the lease alive by streaming keep alive requests from the client - // to the server and streaming keep alive responses from the server to the client. - LeaseKeepAlive(Lease_LeaseKeepAliveServer) error - // LeaseTimeToLive retrieves lease information. - LeaseTimeToLive(context.Context, *LeaseTimeToLiveRequest) (*LeaseTimeToLiveResponse, error) - // LeaseLeases lists all existing leases. - LeaseLeases(context.Context, *LeaseLeasesRequest) (*LeaseLeasesResponse, error) -} - -// UnimplementedLeaseServer can be embedded to have forward compatible implementations. -type UnimplementedLeaseServer struct { -} - -func (*UnimplementedLeaseServer) LeaseGrant(ctx context.Context, req *LeaseGrantRequest) (*LeaseGrantResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LeaseGrant not implemented") -} -func (*UnimplementedLeaseServer) LeaseRevoke(ctx context.Context, req *LeaseRevokeRequest) (*LeaseRevokeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LeaseRevoke not implemented") -} -func (*UnimplementedLeaseServer) LeaseKeepAlive(srv Lease_LeaseKeepAliveServer) error { - return status.Errorf(codes.Unimplemented, "method LeaseKeepAlive not implemented") -} -func (*UnimplementedLeaseServer) LeaseTimeToLive(ctx context.Context, req *LeaseTimeToLiveRequest) (*LeaseTimeToLiveResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LeaseTimeToLive not implemented") -} -func (*UnimplementedLeaseServer) LeaseLeases(ctx context.Context, req *LeaseLeasesRequest) (*LeaseLeasesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LeaseLeases not implemented") -} - -func RegisterLeaseServer(s *grpc.Server, srv LeaseServer) { - s.RegisterService(&_Lease_serviceDesc, srv) -} - -func _Lease_LeaseGrant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LeaseGrantRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LeaseServer).LeaseGrant(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Lease/LeaseGrant", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LeaseServer).LeaseGrant(ctx, req.(*LeaseGrantRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lease_LeaseRevoke_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LeaseRevokeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LeaseServer).LeaseRevoke(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Lease/LeaseRevoke", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LeaseServer).LeaseRevoke(ctx, req.(*LeaseRevokeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lease_LeaseKeepAlive_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(LeaseServer).LeaseKeepAlive(&leaseLeaseKeepAliveServer{stream}) -} - -type Lease_LeaseKeepAliveServer interface { - Send(*LeaseKeepAliveResponse) error - Recv() (*LeaseKeepAliveRequest, error) - grpc.ServerStream -} - -type leaseLeaseKeepAliveServer struct { - grpc.ServerStream -} - -func (x *leaseLeaseKeepAliveServer) Send(m *LeaseKeepAliveResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *leaseLeaseKeepAliveServer) Recv() (*LeaseKeepAliveRequest, error) { - m := new(LeaseKeepAliveRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Lease_LeaseTimeToLive_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LeaseTimeToLiveRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LeaseServer).LeaseTimeToLive(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Lease/LeaseTimeToLive", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LeaseServer).LeaseTimeToLive(ctx, req.(*LeaseTimeToLiveRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lease_LeaseLeases_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LeaseLeasesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LeaseServer).LeaseLeases(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Lease/LeaseLeases", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LeaseServer).LeaseLeases(ctx, req.(*LeaseLeasesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Lease_serviceDesc = grpc.ServiceDesc{ - ServiceName: "etcdserverpb.Lease", - HandlerType: (*LeaseServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "LeaseGrant", - Handler: _Lease_LeaseGrant_Handler, - }, - { - MethodName: "LeaseRevoke", - Handler: _Lease_LeaseRevoke_Handler, - }, - { - MethodName: "LeaseTimeToLive", - Handler: _Lease_LeaseTimeToLive_Handler, - }, - { - MethodName: "LeaseLeases", - Handler: _Lease_LeaseLeases_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "LeaseKeepAlive", - Handler: _Lease_LeaseKeepAlive_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "rpc.proto", -} - -// ClusterClient is the client API for Cluster service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ClusterClient interface { - // MemberAdd adds a member into the cluster. - MemberAdd(ctx context.Context, in *MemberAddRequest, opts ...grpc.CallOption) (*MemberAddResponse, error) - // MemberRemove removes an existing member from the cluster. - MemberRemove(ctx context.Context, in *MemberRemoveRequest, opts ...grpc.CallOption) (*MemberRemoveResponse, error) - // MemberUpdate updates the member configuration. - MemberUpdate(ctx context.Context, in *MemberUpdateRequest, opts ...grpc.CallOption) (*MemberUpdateResponse, error) - // MemberList lists all the members in the cluster. - MemberList(ctx context.Context, in *MemberListRequest, opts ...grpc.CallOption) (*MemberListResponse, error) - // MemberPromote promotes a member from raft learner (non-voting) to raft voting member. - MemberPromote(ctx context.Context, in *MemberPromoteRequest, opts ...grpc.CallOption) (*MemberPromoteResponse, error) -} - -type clusterClient struct { - cc *grpc.ClientConn -} - -func NewClusterClient(cc *grpc.ClientConn) ClusterClient { - return &clusterClient{cc} -} - -func (c *clusterClient) MemberAdd(ctx context.Context, in *MemberAddRequest, opts ...grpc.CallOption) (*MemberAddResponse, error) { - out := new(MemberAddResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Cluster/MemberAdd", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterClient) MemberRemove(ctx context.Context, in *MemberRemoveRequest, opts ...grpc.CallOption) (*MemberRemoveResponse, error) { - out := new(MemberRemoveResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Cluster/MemberRemove", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterClient) MemberUpdate(ctx context.Context, in *MemberUpdateRequest, opts ...grpc.CallOption) (*MemberUpdateResponse, error) { - out := new(MemberUpdateResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Cluster/MemberUpdate", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterClient) MemberList(ctx context.Context, in *MemberListRequest, opts ...grpc.CallOption) (*MemberListResponse, error) { - out := new(MemberListResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Cluster/MemberList", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterClient) MemberPromote(ctx context.Context, in *MemberPromoteRequest, opts ...grpc.CallOption) (*MemberPromoteResponse, error) { - out := new(MemberPromoteResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Cluster/MemberPromote", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ClusterServer is the server API for Cluster service. -type ClusterServer interface { - // MemberAdd adds a member into the cluster. - MemberAdd(context.Context, *MemberAddRequest) (*MemberAddResponse, error) - // MemberRemove removes an existing member from the cluster. - MemberRemove(context.Context, *MemberRemoveRequest) (*MemberRemoveResponse, error) - // MemberUpdate updates the member configuration. - MemberUpdate(context.Context, *MemberUpdateRequest) (*MemberUpdateResponse, error) - // MemberList lists all the members in the cluster. - MemberList(context.Context, *MemberListRequest) (*MemberListResponse, error) - // MemberPromote promotes a member from raft learner (non-voting) to raft voting member. - MemberPromote(context.Context, *MemberPromoteRequest) (*MemberPromoteResponse, error) -} - -// UnimplementedClusterServer can be embedded to have forward compatible implementations. -type UnimplementedClusterServer struct { -} - -func (*UnimplementedClusterServer) MemberAdd(ctx context.Context, req *MemberAddRequest) (*MemberAddResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MemberAdd not implemented") -} -func (*UnimplementedClusterServer) MemberRemove(ctx context.Context, req *MemberRemoveRequest) (*MemberRemoveResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MemberRemove not implemented") -} -func (*UnimplementedClusterServer) MemberUpdate(ctx context.Context, req *MemberUpdateRequest) (*MemberUpdateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MemberUpdate not implemented") -} -func (*UnimplementedClusterServer) MemberList(ctx context.Context, req *MemberListRequest) (*MemberListResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MemberList not implemented") -} -func (*UnimplementedClusterServer) MemberPromote(ctx context.Context, req *MemberPromoteRequest) (*MemberPromoteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MemberPromote not implemented") -} - -func RegisterClusterServer(s *grpc.Server, srv ClusterServer) { - s.RegisterService(&_Cluster_serviceDesc, srv) -} - -func _Cluster_MemberAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MemberAddRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterServer).MemberAdd(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Cluster/MemberAdd", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterServer).MemberAdd(ctx, req.(*MemberAddRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Cluster_MemberRemove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MemberRemoveRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterServer).MemberRemove(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Cluster/MemberRemove", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterServer).MemberRemove(ctx, req.(*MemberRemoveRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Cluster_MemberUpdate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MemberUpdateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterServer).MemberUpdate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Cluster/MemberUpdate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterServer).MemberUpdate(ctx, req.(*MemberUpdateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Cluster_MemberList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MemberListRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterServer).MemberList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Cluster/MemberList", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterServer).MemberList(ctx, req.(*MemberListRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Cluster_MemberPromote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MemberPromoteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterServer).MemberPromote(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Cluster/MemberPromote", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterServer).MemberPromote(ctx, req.(*MemberPromoteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Cluster_serviceDesc = grpc.ServiceDesc{ - ServiceName: "etcdserverpb.Cluster", - HandlerType: (*ClusterServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "MemberAdd", - Handler: _Cluster_MemberAdd_Handler, - }, - { - MethodName: "MemberRemove", - Handler: _Cluster_MemberRemove_Handler, - }, - { - MethodName: "MemberUpdate", - Handler: _Cluster_MemberUpdate_Handler, - }, - { - MethodName: "MemberList", - Handler: _Cluster_MemberList_Handler, - }, - { - MethodName: "MemberPromote", - Handler: _Cluster_MemberPromote_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "rpc.proto", -} - -// MaintenanceClient is the client API for Maintenance service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MaintenanceClient interface { - // Alarm activates, deactivates, and queries alarms regarding cluster health. - Alarm(ctx context.Context, in *AlarmRequest, opts ...grpc.CallOption) (*AlarmResponse, error) - // Status gets the status of the member. - Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) - // Defragment defragments a member's backend database to recover storage space. - Defragment(ctx context.Context, in *DefragmentRequest, opts ...grpc.CallOption) (*DefragmentResponse, error) - // Hash computes the hash of whole backend keyspace, - // including key, lease, and other buckets in storage. - // This is designed for testing ONLY! - // Do not rely on this in production with ongoing transactions, - // since Hash operation does not hold MVCC locks. - // Use "HashKV" API instead for "key" bucket consistency checks. - Hash(ctx context.Context, in *HashRequest, opts ...grpc.CallOption) (*HashResponse, error) - // HashKV computes the hash of all MVCC keys up to a given revision. - // It only iterates "key" bucket in backend storage. - HashKV(ctx context.Context, in *HashKVRequest, opts ...grpc.CallOption) (*HashKVResponse, error) - // Snapshot sends a snapshot of the entire backend from a member over a stream to a client. - Snapshot(ctx context.Context, in *SnapshotRequest, opts ...grpc.CallOption) (Maintenance_SnapshotClient, error) - // MoveLeader requests current leader node to transfer its leadership to transferee. - MoveLeader(ctx context.Context, in *MoveLeaderRequest, opts ...grpc.CallOption) (*MoveLeaderResponse, error) - // Downgrade requests downgrades, verifies feasibility or cancels downgrade - // on the cluster version. - // Supported since etcd 3.5. - Downgrade(ctx context.Context, in *DowngradeRequest, opts ...grpc.CallOption) (*DowngradeResponse, error) -} - -type maintenanceClient struct { - cc *grpc.ClientConn -} - -func NewMaintenanceClient(cc *grpc.ClientConn) MaintenanceClient { - return &maintenanceClient{cc} -} - -func (c *maintenanceClient) Alarm(ctx context.Context, in *AlarmRequest, opts ...grpc.CallOption) (*AlarmResponse, error) { - out := new(AlarmResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Maintenance/Alarm", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *maintenanceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { - out := new(StatusResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Maintenance/Status", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *maintenanceClient) Defragment(ctx context.Context, in *DefragmentRequest, opts ...grpc.CallOption) (*DefragmentResponse, error) { - out := new(DefragmentResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Maintenance/Defragment", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *maintenanceClient) Hash(ctx context.Context, in *HashRequest, opts ...grpc.CallOption) (*HashResponse, error) { - out := new(HashResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Maintenance/Hash", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *maintenanceClient) HashKV(ctx context.Context, in *HashKVRequest, opts ...grpc.CallOption) (*HashKVResponse, error) { - out := new(HashKVResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Maintenance/HashKV", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *maintenanceClient) Snapshot(ctx context.Context, in *SnapshotRequest, opts ...grpc.CallOption) (Maintenance_SnapshotClient, error) { - stream, err := c.cc.NewStream(ctx, &_Maintenance_serviceDesc.Streams[0], "/etcdserverpb.Maintenance/Snapshot", opts...) - if err != nil { - return nil, err - } - x := &maintenanceSnapshotClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Maintenance_SnapshotClient interface { - Recv() (*SnapshotResponse, error) - grpc.ClientStream -} - -type maintenanceSnapshotClient struct { - grpc.ClientStream -} - -func (x *maintenanceSnapshotClient) Recv() (*SnapshotResponse, error) { - m := new(SnapshotResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *maintenanceClient) MoveLeader(ctx context.Context, in *MoveLeaderRequest, opts ...grpc.CallOption) (*MoveLeaderResponse, error) { - out := new(MoveLeaderResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Maintenance/MoveLeader", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *maintenanceClient) Downgrade(ctx context.Context, in *DowngradeRequest, opts ...grpc.CallOption) (*DowngradeResponse, error) { - out := new(DowngradeResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Maintenance/Downgrade", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MaintenanceServer is the server API for Maintenance service. -type MaintenanceServer interface { - // Alarm activates, deactivates, and queries alarms regarding cluster health. - Alarm(context.Context, *AlarmRequest) (*AlarmResponse, error) - // Status gets the status of the member. - Status(context.Context, *StatusRequest) (*StatusResponse, error) - // Defragment defragments a member's backend database to recover storage space. - Defragment(context.Context, *DefragmentRequest) (*DefragmentResponse, error) - // Hash computes the hash of whole backend keyspace, - // including key, lease, and other buckets in storage. - // This is designed for testing ONLY! - // Do not rely on this in production with ongoing transactions, - // since Hash operation does not hold MVCC locks. - // Use "HashKV" API instead for "key" bucket consistency checks. - Hash(context.Context, *HashRequest) (*HashResponse, error) - // HashKV computes the hash of all MVCC keys up to a given revision. - // It only iterates "key" bucket in backend storage. - HashKV(context.Context, *HashKVRequest) (*HashKVResponse, error) - // Snapshot sends a snapshot of the entire backend from a member over a stream to a client. - Snapshot(*SnapshotRequest, Maintenance_SnapshotServer) error - // MoveLeader requests current leader node to transfer its leadership to transferee. - MoveLeader(context.Context, *MoveLeaderRequest) (*MoveLeaderResponse, error) - // Downgrade requests downgrades, verifies feasibility or cancels downgrade - // on the cluster version. - // Supported since etcd 3.5. - Downgrade(context.Context, *DowngradeRequest) (*DowngradeResponse, error) -} - -// UnimplementedMaintenanceServer can be embedded to have forward compatible implementations. -type UnimplementedMaintenanceServer struct { -} - -func (*UnimplementedMaintenanceServer) Alarm(ctx context.Context, req *AlarmRequest) (*AlarmResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Alarm not implemented") -} -func (*UnimplementedMaintenanceServer) Status(ctx context.Context, req *StatusRequest) (*StatusResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") -} -func (*UnimplementedMaintenanceServer) Defragment(ctx context.Context, req *DefragmentRequest) (*DefragmentResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Defragment not implemented") -} -func (*UnimplementedMaintenanceServer) Hash(ctx context.Context, req *HashRequest) (*HashResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Hash not implemented") -} -func (*UnimplementedMaintenanceServer) HashKV(ctx context.Context, req *HashKVRequest) (*HashKVResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method HashKV not implemented") -} -func (*UnimplementedMaintenanceServer) Snapshot(req *SnapshotRequest, srv Maintenance_SnapshotServer) error { - return status.Errorf(codes.Unimplemented, "method Snapshot not implemented") -} -func (*UnimplementedMaintenanceServer) MoveLeader(ctx context.Context, req *MoveLeaderRequest) (*MoveLeaderResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MoveLeader not implemented") -} -func (*UnimplementedMaintenanceServer) Downgrade(ctx context.Context, req *DowngradeRequest) (*DowngradeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Downgrade not implemented") -} - -func RegisterMaintenanceServer(s *grpc.Server, srv MaintenanceServer) { - s.RegisterService(&_Maintenance_serviceDesc, srv) -} - -func _Maintenance_Alarm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AlarmRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MaintenanceServer).Alarm(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Maintenance/Alarm", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MaintenanceServer).Alarm(ctx, req.(*AlarmRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Maintenance_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MaintenanceServer).Status(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Maintenance/Status", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MaintenanceServer).Status(ctx, req.(*StatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Maintenance_Defragment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DefragmentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MaintenanceServer).Defragment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Maintenance/Defragment", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MaintenanceServer).Defragment(ctx, req.(*DefragmentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Maintenance_Hash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HashRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MaintenanceServer).Hash(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Maintenance/Hash", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MaintenanceServer).Hash(ctx, req.(*HashRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Maintenance_HashKV_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HashKVRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MaintenanceServer).HashKV(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Maintenance/HashKV", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MaintenanceServer).HashKV(ctx, req.(*HashKVRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Maintenance_Snapshot_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(SnapshotRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(MaintenanceServer).Snapshot(m, &maintenanceSnapshotServer{stream}) -} - -type Maintenance_SnapshotServer interface { - Send(*SnapshotResponse) error - grpc.ServerStream -} - -type maintenanceSnapshotServer struct { - grpc.ServerStream -} - -func (x *maintenanceSnapshotServer) Send(m *SnapshotResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _Maintenance_MoveLeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MoveLeaderRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MaintenanceServer).MoveLeader(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Maintenance/MoveLeader", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MaintenanceServer).MoveLeader(ctx, req.(*MoveLeaderRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Maintenance_Downgrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DowngradeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MaintenanceServer).Downgrade(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Maintenance/Downgrade", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MaintenanceServer).Downgrade(ctx, req.(*DowngradeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Maintenance_serviceDesc = grpc.ServiceDesc{ - ServiceName: "etcdserverpb.Maintenance", - HandlerType: (*MaintenanceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Alarm", - Handler: _Maintenance_Alarm_Handler, - }, - { - MethodName: "Status", - Handler: _Maintenance_Status_Handler, - }, - { - MethodName: "Defragment", - Handler: _Maintenance_Defragment_Handler, - }, - { - MethodName: "Hash", - Handler: _Maintenance_Hash_Handler, - }, - { - MethodName: "HashKV", - Handler: _Maintenance_HashKV_Handler, - }, - { - MethodName: "MoveLeader", - Handler: _Maintenance_MoveLeader_Handler, - }, - { - MethodName: "Downgrade", - Handler: _Maintenance_Downgrade_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Snapshot", - Handler: _Maintenance_Snapshot_Handler, - ServerStreams: true, - }, - }, - Metadata: "rpc.proto", -} - -// AuthClient is the client API for Auth service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AuthClient interface { - // AuthEnable enables authentication. - AuthEnable(ctx context.Context, in *AuthEnableRequest, opts ...grpc.CallOption) (*AuthEnableResponse, error) - // AuthDisable disables authentication. - AuthDisable(ctx context.Context, in *AuthDisableRequest, opts ...grpc.CallOption) (*AuthDisableResponse, error) - // AuthStatus displays authentication status. - AuthStatus(ctx context.Context, in *AuthStatusRequest, opts ...grpc.CallOption) (*AuthStatusResponse, error) - // Authenticate processes an authenticate request. - Authenticate(ctx context.Context, in *AuthenticateRequest, opts ...grpc.CallOption) (*AuthenticateResponse, error) - // UserAdd adds a new user. User name cannot be empty. - UserAdd(ctx context.Context, in *AuthUserAddRequest, opts ...grpc.CallOption) (*AuthUserAddResponse, error) - // UserGet gets detailed user information. - UserGet(ctx context.Context, in *AuthUserGetRequest, opts ...grpc.CallOption) (*AuthUserGetResponse, error) - // UserList gets a list of all users. - UserList(ctx context.Context, in *AuthUserListRequest, opts ...grpc.CallOption) (*AuthUserListResponse, error) - // UserDelete deletes a specified user. - UserDelete(ctx context.Context, in *AuthUserDeleteRequest, opts ...grpc.CallOption) (*AuthUserDeleteResponse, error) - // UserChangePassword changes the password of a specified user. - UserChangePassword(ctx context.Context, in *AuthUserChangePasswordRequest, opts ...grpc.CallOption) (*AuthUserChangePasswordResponse, error) - // UserGrant grants a role to a specified user. - UserGrantRole(ctx context.Context, in *AuthUserGrantRoleRequest, opts ...grpc.CallOption) (*AuthUserGrantRoleResponse, error) - // UserRevokeRole revokes a role of specified user. - UserRevokeRole(ctx context.Context, in *AuthUserRevokeRoleRequest, opts ...grpc.CallOption) (*AuthUserRevokeRoleResponse, error) - // RoleAdd adds a new role. Role name cannot be empty. - RoleAdd(ctx context.Context, in *AuthRoleAddRequest, opts ...grpc.CallOption) (*AuthRoleAddResponse, error) - // RoleGet gets detailed role information. - RoleGet(ctx context.Context, in *AuthRoleGetRequest, opts ...grpc.CallOption) (*AuthRoleGetResponse, error) - // RoleList gets lists of all roles. - RoleList(ctx context.Context, in *AuthRoleListRequest, opts ...grpc.CallOption) (*AuthRoleListResponse, error) - // RoleDelete deletes a specified role. - RoleDelete(ctx context.Context, in *AuthRoleDeleteRequest, opts ...grpc.CallOption) (*AuthRoleDeleteResponse, error) - // RoleGrantPermission grants a permission of a specified key or range to a specified role. - RoleGrantPermission(ctx context.Context, in *AuthRoleGrantPermissionRequest, opts ...grpc.CallOption) (*AuthRoleGrantPermissionResponse, error) - // RoleRevokePermission revokes a key or range permission of a specified role. - RoleRevokePermission(ctx context.Context, in *AuthRoleRevokePermissionRequest, opts ...grpc.CallOption) (*AuthRoleRevokePermissionResponse, error) -} - -type authClient struct { - cc *grpc.ClientConn -} - -func NewAuthClient(cc *grpc.ClientConn) AuthClient { - return &authClient{cc} -} - -func (c *authClient) AuthEnable(ctx context.Context, in *AuthEnableRequest, opts ...grpc.CallOption) (*AuthEnableResponse, error) { - out := new(AuthEnableResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/AuthEnable", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) AuthDisable(ctx context.Context, in *AuthDisableRequest, opts ...grpc.CallOption) (*AuthDisableResponse, error) { - out := new(AuthDisableResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/AuthDisable", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) AuthStatus(ctx context.Context, in *AuthStatusRequest, opts ...grpc.CallOption) (*AuthStatusResponse, error) { - out := new(AuthStatusResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/AuthStatus", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) Authenticate(ctx context.Context, in *AuthenticateRequest, opts ...grpc.CallOption) (*AuthenticateResponse, error) { - out := new(AuthenticateResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/Authenticate", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) UserAdd(ctx context.Context, in *AuthUserAddRequest, opts ...grpc.CallOption) (*AuthUserAddResponse, error) { - out := new(AuthUserAddResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/UserAdd", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) UserGet(ctx context.Context, in *AuthUserGetRequest, opts ...grpc.CallOption) (*AuthUserGetResponse, error) { - out := new(AuthUserGetResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/UserGet", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) UserList(ctx context.Context, in *AuthUserListRequest, opts ...grpc.CallOption) (*AuthUserListResponse, error) { - out := new(AuthUserListResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/UserList", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) UserDelete(ctx context.Context, in *AuthUserDeleteRequest, opts ...grpc.CallOption) (*AuthUserDeleteResponse, error) { - out := new(AuthUserDeleteResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/UserDelete", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) UserChangePassword(ctx context.Context, in *AuthUserChangePasswordRequest, opts ...grpc.CallOption) (*AuthUserChangePasswordResponse, error) { - out := new(AuthUserChangePasswordResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/UserChangePassword", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) UserGrantRole(ctx context.Context, in *AuthUserGrantRoleRequest, opts ...grpc.CallOption) (*AuthUserGrantRoleResponse, error) { - out := new(AuthUserGrantRoleResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/UserGrantRole", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) UserRevokeRole(ctx context.Context, in *AuthUserRevokeRoleRequest, opts ...grpc.CallOption) (*AuthUserRevokeRoleResponse, error) { - out := new(AuthUserRevokeRoleResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/UserRevokeRole", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) RoleAdd(ctx context.Context, in *AuthRoleAddRequest, opts ...grpc.CallOption) (*AuthRoleAddResponse, error) { - out := new(AuthRoleAddResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/RoleAdd", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) RoleGet(ctx context.Context, in *AuthRoleGetRequest, opts ...grpc.CallOption) (*AuthRoleGetResponse, error) { - out := new(AuthRoleGetResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/RoleGet", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) RoleList(ctx context.Context, in *AuthRoleListRequest, opts ...grpc.CallOption) (*AuthRoleListResponse, error) { - out := new(AuthRoleListResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/RoleList", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) RoleDelete(ctx context.Context, in *AuthRoleDeleteRequest, opts ...grpc.CallOption) (*AuthRoleDeleteResponse, error) { - out := new(AuthRoleDeleteResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/RoleDelete", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) RoleGrantPermission(ctx context.Context, in *AuthRoleGrantPermissionRequest, opts ...grpc.CallOption) (*AuthRoleGrantPermissionResponse, error) { - out := new(AuthRoleGrantPermissionResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/RoleGrantPermission", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) RoleRevokePermission(ctx context.Context, in *AuthRoleRevokePermissionRequest, opts ...grpc.CallOption) (*AuthRoleRevokePermissionResponse, error) { - out := new(AuthRoleRevokePermissionResponse) - err := c.cc.Invoke(ctx, "/etcdserverpb.Auth/RoleRevokePermission", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AuthServer is the server API for Auth service. -type AuthServer interface { - // AuthEnable enables authentication. - AuthEnable(context.Context, *AuthEnableRequest) (*AuthEnableResponse, error) - // AuthDisable disables authentication. - AuthDisable(context.Context, *AuthDisableRequest) (*AuthDisableResponse, error) - // AuthStatus displays authentication status. - AuthStatus(context.Context, *AuthStatusRequest) (*AuthStatusResponse, error) - // Authenticate processes an authenticate request. - Authenticate(context.Context, *AuthenticateRequest) (*AuthenticateResponse, error) - // UserAdd adds a new user. User name cannot be empty. - UserAdd(context.Context, *AuthUserAddRequest) (*AuthUserAddResponse, error) - // UserGet gets detailed user information. - UserGet(context.Context, *AuthUserGetRequest) (*AuthUserGetResponse, error) - // UserList gets a list of all users. - UserList(context.Context, *AuthUserListRequest) (*AuthUserListResponse, error) - // UserDelete deletes a specified user. - UserDelete(context.Context, *AuthUserDeleteRequest) (*AuthUserDeleteResponse, error) - // UserChangePassword changes the password of a specified user. - UserChangePassword(context.Context, *AuthUserChangePasswordRequest) (*AuthUserChangePasswordResponse, error) - // UserGrant grants a role to a specified user. - UserGrantRole(context.Context, *AuthUserGrantRoleRequest) (*AuthUserGrantRoleResponse, error) - // UserRevokeRole revokes a role of specified user. - UserRevokeRole(context.Context, *AuthUserRevokeRoleRequest) (*AuthUserRevokeRoleResponse, error) - // RoleAdd adds a new role. Role name cannot be empty. - RoleAdd(context.Context, *AuthRoleAddRequest) (*AuthRoleAddResponse, error) - // RoleGet gets detailed role information. - RoleGet(context.Context, *AuthRoleGetRequest) (*AuthRoleGetResponse, error) - // RoleList gets lists of all roles. - RoleList(context.Context, *AuthRoleListRequest) (*AuthRoleListResponse, error) - // RoleDelete deletes a specified role. - RoleDelete(context.Context, *AuthRoleDeleteRequest) (*AuthRoleDeleteResponse, error) - // RoleGrantPermission grants a permission of a specified key or range to a specified role. - RoleGrantPermission(context.Context, *AuthRoleGrantPermissionRequest) (*AuthRoleGrantPermissionResponse, error) - // RoleRevokePermission revokes a key or range permission of a specified role. - RoleRevokePermission(context.Context, *AuthRoleRevokePermissionRequest) (*AuthRoleRevokePermissionResponse, error) -} - -// UnimplementedAuthServer can be embedded to have forward compatible implementations. -type UnimplementedAuthServer struct { -} - -func (*UnimplementedAuthServer) AuthEnable(ctx context.Context, req *AuthEnableRequest) (*AuthEnableResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AuthEnable not implemented") -} -func (*UnimplementedAuthServer) AuthDisable(ctx context.Context, req *AuthDisableRequest) (*AuthDisableResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AuthDisable not implemented") -} -func (*UnimplementedAuthServer) AuthStatus(ctx context.Context, req *AuthStatusRequest) (*AuthStatusResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AuthStatus not implemented") -} -func (*UnimplementedAuthServer) Authenticate(ctx context.Context, req *AuthenticateRequest) (*AuthenticateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Authenticate not implemented") -} -func (*UnimplementedAuthServer) UserAdd(ctx context.Context, req *AuthUserAddRequest) (*AuthUserAddResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UserAdd not implemented") -} -func (*UnimplementedAuthServer) UserGet(ctx context.Context, req *AuthUserGetRequest) (*AuthUserGetResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UserGet not implemented") -} -func (*UnimplementedAuthServer) UserList(ctx context.Context, req *AuthUserListRequest) (*AuthUserListResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UserList not implemented") -} -func (*UnimplementedAuthServer) UserDelete(ctx context.Context, req *AuthUserDeleteRequest) (*AuthUserDeleteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UserDelete not implemented") -} -func (*UnimplementedAuthServer) UserChangePassword(ctx context.Context, req *AuthUserChangePasswordRequest) (*AuthUserChangePasswordResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UserChangePassword not implemented") -} -func (*UnimplementedAuthServer) UserGrantRole(ctx context.Context, req *AuthUserGrantRoleRequest) (*AuthUserGrantRoleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UserGrantRole not implemented") -} -func (*UnimplementedAuthServer) UserRevokeRole(ctx context.Context, req *AuthUserRevokeRoleRequest) (*AuthUserRevokeRoleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UserRevokeRole not implemented") -} -func (*UnimplementedAuthServer) RoleAdd(ctx context.Context, req *AuthRoleAddRequest) (*AuthRoleAddResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RoleAdd not implemented") -} -func (*UnimplementedAuthServer) RoleGet(ctx context.Context, req *AuthRoleGetRequest) (*AuthRoleGetResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RoleGet not implemented") -} -func (*UnimplementedAuthServer) RoleList(ctx context.Context, req *AuthRoleListRequest) (*AuthRoleListResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RoleList not implemented") -} -func (*UnimplementedAuthServer) RoleDelete(ctx context.Context, req *AuthRoleDeleteRequest) (*AuthRoleDeleteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RoleDelete not implemented") -} -func (*UnimplementedAuthServer) RoleGrantPermission(ctx context.Context, req *AuthRoleGrantPermissionRequest) (*AuthRoleGrantPermissionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RoleGrantPermission not implemented") -} -func (*UnimplementedAuthServer) RoleRevokePermission(ctx context.Context, req *AuthRoleRevokePermissionRequest) (*AuthRoleRevokePermissionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RoleRevokePermission not implemented") -} - -func RegisterAuthServer(s *grpc.Server, srv AuthServer) { - s.RegisterService(&_Auth_serviceDesc, srv) -} - -func _Auth_AuthEnable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthEnableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).AuthEnable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/AuthEnable", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).AuthEnable(ctx, req.(*AuthEnableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_AuthDisable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthDisableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).AuthDisable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/AuthDisable", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).AuthDisable(ctx, req.(*AuthDisableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_AuthStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthStatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).AuthStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/AuthStatus", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).AuthStatus(ctx, req.(*AuthStatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthenticateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).Authenticate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/Authenticate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).Authenticate(ctx, req.(*AuthenticateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_UserAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthUserAddRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).UserAdd(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/UserAdd", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).UserAdd(ctx, req.(*AuthUserAddRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_UserGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthUserGetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).UserGet(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/UserGet", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).UserGet(ctx, req.(*AuthUserGetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_UserList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthUserListRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).UserList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/UserList", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).UserList(ctx, req.(*AuthUserListRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_UserDelete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthUserDeleteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).UserDelete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/UserDelete", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).UserDelete(ctx, req.(*AuthUserDeleteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_UserChangePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthUserChangePasswordRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).UserChangePassword(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/UserChangePassword", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).UserChangePassword(ctx, req.(*AuthUserChangePasswordRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_UserGrantRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthUserGrantRoleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).UserGrantRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/UserGrantRole", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).UserGrantRole(ctx, req.(*AuthUserGrantRoleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_UserRevokeRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthUserRevokeRoleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).UserRevokeRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/UserRevokeRole", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).UserRevokeRole(ctx, req.(*AuthUserRevokeRoleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_RoleAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthRoleAddRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).RoleAdd(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/RoleAdd", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).RoleAdd(ctx, req.(*AuthRoleAddRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_RoleGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthRoleGetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).RoleGet(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/RoleGet", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).RoleGet(ctx, req.(*AuthRoleGetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_RoleList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthRoleListRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).RoleList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/RoleList", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).RoleList(ctx, req.(*AuthRoleListRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_RoleDelete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthRoleDeleteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).RoleDelete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/RoleDelete", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).RoleDelete(ctx, req.(*AuthRoleDeleteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_RoleGrantPermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthRoleGrantPermissionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).RoleGrantPermission(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/RoleGrantPermission", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).RoleGrantPermission(ctx, req.(*AuthRoleGrantPermissionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_RoleRevokePermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthRoleRevokePermissionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).RoleRevokePermission(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/RoleRevokePermission", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).RoleRevokePermission(ctx, req.(*AuthRoleRevokePermissionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Auth_serviceDesc = grpc.ServiceDesc{ - ServiceName: "etcdserverpb.Auth", - HandlerType: (*AuthServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "AuthEnable", - Handler: _Auth_AuthEnable_Handler, - }, - { - MethodName: "AuthDisable", - Handler: _Auth_AuthDisable_Handler, - }, - { - MethodName: "AuthStatus", - Handler: _Auth_AuthStatus_Handler, - }, - { - MethodName: "Authenticate", - Handler: _Auth_Authenticate_Handler, - }, - { - MethodName: "UserAdd", - Handler: _Auth_UserAdd_Handler, - }, - { - MethodName: "UserGet", - Handler: _Auth_UserGet_Handler, - }, - { - MethodName: "UserList", - Handler: _Auth_UserList_Handler, - }, - { - MethodName: "UserDelete", - Handler: _Auth_UserDelete_Handler, - }, - { - MethodName: "UserChangePassword", - Handler: _Auth_UserChangePassword_Handler, - }, - { - MethodName: "UserGrantRole", - Handler: _Auth_UserGrantRole_Handler, - }, - { - MethodName: "UserRevokeRole", - Handler: _Auth_UserRevokeRole_Handler, - }, - { - MethodName: "RoleAdd", - Handler: _Auth_RoleAdd_Handler, - }, - { - MethodName: "RoleGet", - Handler: _Auth_RoleGet_Handler, - }, - { - MethodName: "RoleList", - Handler: _Auth_RoleList_Handler, - }, - { - MethodName: "RoleDelete", - Handler: _Auth_RoleDelete_Handler, - }, - { - MethodName: "RoleGrantPermission", - Handler: _Auth_RoleGrantPermission_Handler, - }, - { - MethodName: "RoleRevokePermission", - Handler: _Auth_RoleRevokePermission_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "rpc.proto", -} - -func (m *ResponseHeader) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseHeader) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.RaftTerm != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.RaftTerm)) - i-- - dAtA[i] = 0x20 - } - if m.Revision != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) - i-- - dAtA[i] = 0x18 - } - if m.MemberId != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MemberId)) - i-- - dAtA[i] = 0x10 - } - if m.ClusterId != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.ClusterId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *RangeRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RangeRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RangeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.MaxCreateRevision != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MaxCreateRevision)) - i-- - dAtA[i] = 0x68 - } - if m.MinCreateRevision != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MinCreateRevision)) - i-- - dAtA[i] = 0x60 - } - if m.MaxModRevision != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MaxModRevision)) - i-- - dAtA[i] = 0x58 - } - if m.MinModRevision != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MinModRevision)) - i-- - dAtA[i] = 0x50 - } - if m.CountOnly { - i-- - if m.CountOnly { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x48 - } - if m.KeysOnly { - i-- - if m.KeysOnly { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - if m.Serializable { - i-- - if m.Serializable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x38 - } - if m.SortTarget != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.SortTarget)) - i-- - dAtA[i] = 0x30 - } - if m.SortOrder != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.SortOrder)) - i-- - dAtA[i] = 0x28 - } - if m.Revision != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) - i-- - dAtA[i] = 0x20 - } - if m.Limit != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Limit)) - i-- - dAtA[i] = 0x18 - } - if len(m.RangeEnd) > 0 { - i -= len(m.RangeEnd) - copy(dAtA[i:], m.RangeEnd) - i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RangeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RangeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RangeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Count != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Count)) - i-- - dAtA[i] = 0x20 - } - if m.More { - i-- - if m.More { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(m.Kvs) > 0 { - for iNdEx := len(m.Kvs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Kvs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PutRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PutRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.IgnoreLease { - i-- - if m.IgnoreLease { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if m.IgnoreValue { - i-- - if m.IgnoreValue { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if m.PrevKv { - i-- - if m.PrevKv { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.Lease != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Lease)) - i-- - dAtA[i] = 0x18 - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PutResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PutResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.PrevKv != nil { - { - size, err := m.PrevKv.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DeleteRangeRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DeleteRangeRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DeleteRangeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.PrevKv { - i-- - if m.PrevKv { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(m.RangeEnd) > 0 { - i -= len(m.RangeEnd) - copy(dAtA[i:], m.RangeEnd) - i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DeleteRangeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DeleteRangeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DeleteRangeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.PrevKvs) > 0 { - for iNdEx := len(m.PrevKvs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PrevKvs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.Deleted != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Deleted)) - i-- - dAtA[i] = 0x10 - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RequestOp) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RequestOp) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestOp) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Request != nil { - { - size := m.Request.Size() - i -= size - if _, err := m.Request.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *RequestOp_RequestRange) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestOp_RequestRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.RequestRange != nil { - { - size, err := m.RequestRange.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *RequestOp_RequestPut) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestOp_RequestPut) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.RequestPut != nil { - { - size, err := m.RequestPut.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *RequestOp_RequestDeleteRange) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestOp_RequestDeleteRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.RequestDeleteRange != nil { - { - size, err := m.RequestDeleteRange.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *RequestOp_RequestTxn) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestOp_RequestTxn) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.RequestTxn != nil { - { - size, err := m.RequestTxn.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *ResponseOp) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseOp) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseOp) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Response != nil { - { - size := m.Response.Size() - i -= size - if _, err := m.Response.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *ResponseOp_ResponseRange) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseOp_ResponseRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ResponseRange != nil { - { - size, err := m.ResponseRange.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *ResponseOp_ResponsePut) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseOp_ResponsePut) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ResponsePut != nil { - { - size, err := m.ResponsePut.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *ResponseOp_ResponseDeleteRange) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseOp_ResponseDeleteRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ResponseDeleteRange != nil { - { - size, err := m.ResponseDeleteRange.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *ResponseOp_ResponseTxn) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseOp_ResponseTxn) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ResponseTxn != nil { - { - size, err := m.ResponseTxn.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *Compare) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Compare) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Compare) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.RangeEnd) > 0 { - i -= len(m.RangeEnd) - copy(dAtA[i:], m.RangeEnd) - i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) - i-- - dAtA[i] = 0x4 - i-- - dAtA[i] = 0x82 - } - if m.TargetUnion != nil { - { - size := m.TargetUnion.Size() - i -= size - if _, err := m.TargetUnion.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0x1a - } - if m.Target != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Target)) - i-- - dAtA[i] = 0x10 - } - if m.Result != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Result)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Compare_Version) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Compare_Version) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintRpc(dAtA, i, uint64(m.Version)) - i-- - dAtA[i] = 0x20 - return len(dAtA) - i, nil -} -func (m *Compare_CreateRevision) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Compare_CreateRevision) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintRpc(dAtA, i, uint64(m.CreateRevision)) - i-- - dAtA[i] = 0x28 - return len(dAtA) - i, nil -} -func (m *Compare_ModRevision) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Compare_ModRevision) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintRpc(dAtA, i, uint64(m.ModRevision)) - i-- - dAtA[i] = 0x30 - return len(dAtA) - i, nil -} -func (m *Compare_Value) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Compare_Value) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Value != nil { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x3a - } - return len(dAtA) - i, nil -} -func (m *Compare_Lease) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Compare_Lease) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintRpc(dAtA, i, uint64(m.Lease)) - i-- - dAtA[i] = 0x40 - return len(dAtA) - i, nil -} -func (m *TxnRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TxnRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TxnRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Failure) > 0 { - for iNdEx := len(m.Failure) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Failure[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Success) > 0 { - for iNdEx := len(m.Success) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Success[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Compare) > 0 { - for iNdEx := len(m.Compare) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Compare[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *TxnResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TxnResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TxnResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Responses) > 0 { - for iNdEx := len(m.Responses) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Responses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.Succeeded { - i-- - if m.Succeeded { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *CompactionRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CompactionRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CompactionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Physical { - i-- - if m.Physical { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.Revision != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *CompactionResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CompactionResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CompactionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *HashRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HashRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HashRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} - -func (m *HashKVRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HashKVRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HashKVRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Revision != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *HashKVResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HashKVResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HashKVResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.CompactRevision != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.CompactRevision)) - i-- - dAtA[i] = 0x18 - } - if m.Hash != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Hash)) - i-- - dAtA[i] = 0x10 - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *HashResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HashResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HashResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Hash != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Hash)) - i-- - dAtA[i] = 0x10 - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SnapshotRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SnapshotRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SnapshotRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} - -func (m *SnapshotResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SnapshotResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SnapshotResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Blob) > 0 { - i -= len(m.Blob) - copy(dAtA[i:], m.Blob) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Blob))) - i-- - dAtA[i] = 0x1a - } - if m.RemainingBytes != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.RemainingBytes)) - i-- - dAtA[i] = 0x10 - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *WatchRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WatchRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.RequestUnion != nil { - { - size := m.RequestUnion.Size() - i -= size - if _, err := m.RequestUnion.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *WatchRequest_CreateRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchRequest_CreateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.CreateRequest != nil { - { - size, err := m.CreateRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *WatchRequest_CancelRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchRequest_CancelRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.CancelRequest != nil { - { - size, err := m.CancelRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *WatchRequest_ProgressRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchRequest_ProgressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ProgressRequest != nil { - { - size, err := m.ProgressRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *WatchCreateRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WatchCreateRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchCreateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Fragment { - i-- - if m.Fragment { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - if m.WatchId != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.WatchId)) - i-- - dAtA[i] = 0x38 - } - if m.PrevKv { - i-- - if m.PrevKv { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if len(m.Filters) > 0 { - dAtA22 := make([]byte, len(m.Filters)*10) - var j21 int - for _, num := range m.Filters { - for num >= 1<<7 { - dAtA22[j21] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j21++ - } - dAtA22[j21] = uint8(num) - j21++ - } - i -= j21 - copy(dAtA[i:], dAtA22[:j21]) - i = encodeVarintRpc(dAtA, i, uint64(j21)) - i-- - dAtA[i] = 0x2a - } - if m.ProgressNotify { - i-- - if m.ProgressNotify { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.StartRevision != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.StartRevision)) - i-- - dAtA[i] = 0x18 - } - if len(m.RangeEnd) > 0 { - i -= len(m.RangeEnd) - copy(dAtA[i:], m.RangeEnd) - i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *WatchCancelRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WatchCancelRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchCancelRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.WatchId != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.WatchId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *WatchProgressRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WatchProgressRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchProgressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} - -func (m *WatchResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WatchResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WatchResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Events) > 0 { - for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - } - } - if m.Fragment { - i-- - if m.Fragment { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x38 - } - if len(m.CancelReason) > 0 { - i -= len(m.CancelReason) - copy(dAtA[i:], m.CancelReason) - i = encodeVarintRpc(dAtA, i, uint64(len(m.CancelReason))) - i-- - dAtA[i] = 0x32 - } - if m.CompactRevision != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.CompactRevision)) - i-- - dAtA[i] = 0x28 - } - if m.Canceled { - i-- - if m.Canceled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.Created { - i-- - if m.Created { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if m.WatchId != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.WatchId)) - i-- - dAtA[i] = 0x10 - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LeaseGrantRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseGrantRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LeaseGrantRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ID != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x10 - } - if m.TTL != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.TTL)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *LeaseGrantResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseGrantResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LeaseGrantResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Error) > 0 { - i -= len(m.Error) - copy(dAtA[i:], m.Error) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Error))) - i-- - dAtA[i] = 0x22 - } - if m.TTL != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.TTL)) - i-- - dAtA[i] = 0x18 - } - if m.ID != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x10 - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LeaseRevokeRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseRevokeRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LeaseRevokeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ID != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *LeaseRevokeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseRevokeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LeaseRevokeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LeaseCheckpoint) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseCheckpoint) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LeaseCheckpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Remaining_TTL != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Remaining_TTL)) - i-- - dAtA[i] = 0x10 - } - if m.ID != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *LeaseCheckpointRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseCheckpointRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LeaseCheckpointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Checkpoints) > 0 { - for iNdEx := len(m.Checkpoints) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Checkpoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *LeaseCheckpointResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseCheckpointResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LeaseCheckpointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LeaseKeepAliveRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseKeepAliveRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LeaseKeepAliveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ID != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *LeaseKeepAliveResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseKeepAliveResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LeaseKeepAliveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.TTL != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.TTL)) - i-- - dAtA[i] = 0x18 - } - if m.ID != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x10 - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LeaseTimeToLiveRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseTimeToLiveRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LeaseTimeToLiveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Keys { - i-- - if m.Keys { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.ID != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *LeaseTimeToLiveResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseTimeToLiveResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LeaseTimeToLiveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Keys) > 0 { - for iNdEx := len(m.Keys) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Keys[iNdEx]) - copy(dAtA[i:], m.Keys[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Keys[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if m.GrantedTTL != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.GrantedTTL)) - i-- - dAtA[i] = 0x20 - } - if m.TTL != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.TTL)) - i-- - dAtA[i] = 0x18 - } - if m.ID != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x10 - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LeaseLeasesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseLeasesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LeaseLeasesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} - -func (m *LeaseStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseStatus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LeaseStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ID != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *LeaseLeasesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseLeasesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LeaseLeasesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Leases) > 0 { - for iNdEx := len(m.Leases) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Leases[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Member) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Member) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Member) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.IsLearner { - i-- - if m.IsLearner { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if len(m.ClientURLs) > 0 { - for iNdEx := len(m.ClientURLs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ClientURLs[iNdEx]) - copy(dAtA[i:], m.ClientURLs[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.ClientURLs[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.PeerURLs) > 0 { - for iNdEx := len(m.PeerURLs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.PeerURLs[iNdEx]) - copy(dAtA[i:], m.PeerURLs[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.PeerURLs[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.ID != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MemberAddRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MemberAddRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MemberAddRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.IsLearner { - i-- - if m.IsLearner { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(m.PeerURLs) > 0 { - for iNdEx := len(m.PeerURLs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.PeerURLs[iNdEx]) - copy(dAtA[i:], m.PeerURLs[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.PeerURLs[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *MemberAddResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MemberAddResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MemberAddResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Members) > 0 { - for iNdEx := len(m.Members) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Members[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.Member != nil { - { - size, err := m.Member.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MemberRemoveRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MemberRemoveRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MemberRemoveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ID != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MemberRemoveResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MemberRemoveResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MemberRemoveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Members) > 0 { - for iNdEx := len(m.Members) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Members[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MemberUpdateRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MemberUpdateRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MemberUpdateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.PeerURLs) > 0 { - for iNdEx := len(m.PeerURLs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.PeerURLs[iNdEx]) - copy(dAtA[i:], m.PeerURLs[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.PeerURLs[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if m.ID != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MemberUpdateResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MemberUpdateResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MemberUpdateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Members) > 0 { - for iNdEx := len(m.Members) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Members[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MemberListRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MemberListRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MemberListRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Linearizable { - i-- - if m.Linearizable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MemberListResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MemberListResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MemberListResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Members) > 0 { - for iNdEx := len(m.Members) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Members[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MemberPromoteRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MemberPromoteRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MemberPromoteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ID != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MemberPromoteResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MemberPromoteResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MemberPromoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Members) > 0 { - for iNdEx := len(m.Members) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Members[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DefragmentRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DefragmentRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DefragmentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} - -func (m *DefragmentResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DefragmentResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DefragmentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MoveLeaderRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MoveLeaderRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MoveLeaderRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.TargetID != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.TargetID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MoveLeaderResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MoveLeaderResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MoveLeaderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AlarmRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AlarmRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AlarmRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Alarm != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Alarm)) - i-- - dAtA[i] = 0x18 - } - if m.MemberID != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MemberID)) - i-- - dAtA[i] = 0x10 - } - if m.Action != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Action)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *AlarmMember) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AlarmMember) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AlarmMember) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Alarm != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Alarm)) - i-- - dAtA[i] = 0x10 - } - if m.MemberID != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MemberID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *AlarmResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AlarmResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AlarmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Alarms) > 0 { - for iNdEx := len(m.Alarms) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Alarms[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DowngradeRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DowngradeRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DowngradeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x12 - } - if m.Action != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Action)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *DowngradeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DowngradeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DowngradeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x12 - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *StatusRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StatusRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} - -func (m *StatusResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StatusResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.IsLearner { - i-- - if m.IsLearner { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x50 - } - if m.DbSizeInUse != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.DbSizeInUse)) - i-- - dAtA[i] = 0x48 - } - if len(m.Errors) > 0 { - for iNdEx := len(m.Errors) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Errors[iNdEx]) - copy(dAtA[i:], m.Errors[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Errors[iNdEx]))) - i-- - dAtA[i] = 0x42 - } - } - if m.RaftAppliedIndex != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.RaftAppliedIndex)) - i-- - dAtA[i] = 0x38 - } - if m.RaftTerm != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.RaftTerm)) - i-- - dAtA[i] = 0x30 - } - if m.RaftIndex != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.RaftIndex)) - i-- - dAtA[i] = 0x28 - } - if m.Leader != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Leader)) - i-- - dAtA[i] = 0x20 - } - if m.DbSize != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.DbSize)) - i-- - dAtA[i] = 0x18 - } - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x12 - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthEnableRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthEnableRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthEnableRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} - -func (m *AuthDisableRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthDisableRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthDisableRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} - -func (m *AuthStatusRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthStatusRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} - -func (m *AuthenticateRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthenticateRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthenticateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Password) > 0 { - i -= len(m.Password) - copy(dAtA[i:], m.Password) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Password))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthUserAddRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserAddRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthUserAddRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.HashedPassword) > 0 { - i -= len(m.HashedPassword) - copy(dAtA[i:], m.HashedPassword) - i = encodeVarintRpc(dAtA, i, uint64(len(m.HashedPassword))) - i-- - dAtA[i] = 0x22 - } - if m.Options != nil { - { - size, err := m.Options.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Password) > 0 { - i -= len(m.Password) - copy(dAtA[i:], m.Password) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Password))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthUserGetRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserGetRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthUserGetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthUserDeleteRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserDeleteRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthUserDeleteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthUserChangePasswordRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserChangePasswordRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthUserChangePasswordRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.HashedPassword) > 0 { - i -= len(m.HashedPassword) - copy(dAtA[i:], m.HashedPassword) - i = encodeVarintRpc(dAtA, i, uint64(len(m.HashedPassword))) - i-- - dAtA[i] = 0x1a - } - if len(m.Password) > 0 { - i -= len(m.Password) - copy(dAtA[i:], m.Password) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Password))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthUserGrantRoleRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserGrantRoleRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthUserGrantRoleRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Role) > 0 { - i -= len(m.Role) - copy(dAtA[i:], m.Role) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) - i-- - dAtA[i] = 0x12 - } - if len(m.User) > 0 { - i -= len(m.User) - copy(dAtA[i:], m.User) - i = encodeVarintRpc(dAtA, i, uint64(len(m.User))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthUserRevokeRoleRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserRevokeRoleRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthUserRevokeRoleRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Role) > 0 { - i -= len(m.Role) - copy(dAtA[i:], m.Role) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthRoleAddRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleAddRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthRoleAddRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthRoleGetRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleGetRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthRoleGetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Role) > 0 { - i -= len(m.Role) - copy(dAtA[i:], m.Role) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthUserListRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserListRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthUserListRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} - -func (m *AuthRoleListRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleListRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthRoleListRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} - -func (m *AuthRoleDeleteRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleDeleteRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthRoleDeleteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Role) > 0 { - i -= len(m.Role) - copy(dAtA[i:], m.Role) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthRoleGrantPermissionRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleGrantPermissionRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthRoleGrantPermissionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Perm != nil { - { - size, err := m.Perm.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthRoleRevokePermissionRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleRevokePermissionRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthRoleRevokePermissionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.RangeEnd) > 0 { - i -= len(m.RangeEnd) - copy(dAtA[i:], m.RangeEnd) - i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) - i-- - dAtA[i] = 0x1a - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0x12 - } - if len(m.Role) > 0 { - i -= len(m.Role) - copy(dAtA[i:], m.Role) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthEnableResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthEnableResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthEnableResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthDisableResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthDisableResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthDisableResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthStatusResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthStatusResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.AuthRevision != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.AuthRevision)) - i-- - dAtA[i] = 0x18 - } - if m.Enabled { - i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthenticateResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthenticateResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthenticateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Token) > 0 { - i -= len(m.Token) - copy(dAtA[i:], m.Token) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Token))) - i-- - dAtA[i] = 0x12 - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthUserAddResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserAddResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthUserAddResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthUserGetResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserGetResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthUserGetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Roles) > 0 { - for iNdEx := len(m.Roles) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Roles[iNdEx]) - copy(dAtA[i:], m.Roles[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Roles[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthUserDeleteResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserDeleteResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthUserDeleteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthUserChangePasswordResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserChangePasswordResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthUserChangePasswordResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthUserGrantRoleResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserGrantRoleResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthUserGrantRoleResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthUserRevokeRoleResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserRevokeRoleResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthUserRevokeRoleResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthRoleAddResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleAddResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthRoleAddResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthRoleGetResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleGetResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthRoleGetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Perm) > 0 { - for iNdEx := len(m.Perm) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Perm[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthRoleListResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleListResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthRoleListResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Roles) > 0 { - for iNdEx := len(m.Roles) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Roles[iNdEx]) - copy(dAtA[i:], m.Roles[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Roles[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthUserListResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserListResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthUserListResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Users) > 0 { - for iNdEx := len(m.Users) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Users[iNdEx]) - copy(dAtA[i:], m.Users[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Users[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthRoleDeleteResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleDeleteResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthRoleDeleteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthRoleGrantPermissionResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleGrantPermissionResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthRoleGrantPermissionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthRoleRevokePermissionResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleRevokePermissionResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthRoleRevokePermissionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintRpc(dAtA []byte, offset int, v uint64) int { - offset -= sovRpc(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ResponseHeader) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ClusterId != 0 { - n += 1 + sovRpc(uint64(m.ClusterId)) - } - if m.MemberId != 0 { - n += 1 + sovRpc(uint64(m.MemberId)) - } - if m.Revision != 0 { - n += 1 + sovRpc(uint64(m.Revision)) - } - if m.RaftTerm != 0 { - n += 1 + sovRpc(uint64(m.RaftTerm)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *RangeRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.RangeEnd) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.Limit != 0 { - n += 1 + sovRpc(uint64(m.Limit)) - } - if m.Revision != 0 { - n += 1 + sovRpc(uint64(m.Revision)) - } - if m.SortOrder != 0 { - n += 1 + sovRpc(uint64(m.SortOrder)) - } - if m.SortTarget != 0 { - n += 1 + sovRpc(uint64(m.SortTarget)) - } - if m.Serializable { - n += 2 - } - if m.KeysOnly { - n += 2 - } - if m.CountOnly { - n += 2 - } - if m.MinModRevision != 0 { - n += 1 + sovRpc(uint64(m.MinModRevision)) - } - if m.MaxModRevision != 0 { - n += 1 + sovRpc(uint64(m.MaxModRevision)) - } - if m.MinCreateRevision != 0 { - n += 1 + sovRpc(uint64(m.MinCreateRevision)) - } - if m.MaxCreateRevision != 0 { - n += 1 + sovRpc(uint64(m.MaxCreateRevision)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *RangeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Kvs) > 0 { - for _, e := range m.Kvs { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.More { - n += 2 - } - if m.Count != 0 { - n += 1 + sovRpc(uint64(m.Count)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *PutRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.Lease != 0 { - n += 1 + sovRpc(uint64(m.Lease)) - } - if m.PrevKv { - n += 2 - } - if m.IgnoreValue { - n += 2 - } - if m.IgnoreLease { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *PutResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.PrevKv != nil { - l = m.PrevKv.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *DeleteRangeRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.RangeEnd) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.PrevKv { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *DeleteRangeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.Deleted != 0 { - n += 1 + sovRpc(uint64(m.Deleted)) - } - if len(m.PrevKvs) > 0 { - for _, e := range m.PrevKvs { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *RequestOp) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Request != nil { - n += m.Request.Size() - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *RequestOp_RequestRange) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.RequestRange != nil { - l = m.RequestRange.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *RequestOp_RequestPut) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.RequestPut != nil { - l = m.RequestPut.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *RequestOp_RequestDeleteRange) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.RequestDeleteRange != nil { - l = m.RequestDeleteRange.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *RequestOp_RequestTxn) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.RequestTxn != nil { - l = m.RequestTxn.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *ResponseOp) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Response != nil { - n += m.Response.Size() - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ResponseOp_ResponseRange) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ResponseRange != nil { - l = m.ResponseRange.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *ResponseOp_ResponsePut) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ResponsePut != nil { - l = m.ResponsePut.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *ResponseOp_ResponseDeleteRange) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ResponseDeleteRange != nil { - l = m.ResponseDeleteRange.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *ResponseOp_ResponseTxn) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ResponseTxn != nil { - l = m.ResponseTxn.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *Compare) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Result != 0 { - n += 1 + sovRpc(uint64(m.Result)) - } - if m.Target != 0 { - n += 1 + sovRpc(uint64(m.Target)) - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.TargetUnion != nil { - n += m.TargetUnion.Size() - } - l = len(m.RangeEnd) - if l > 0 { - n += 2 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Compare_Version) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovRpc(uint64(m.Version)) - return n -} -func (m *Compare_CreateRevision) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovRpc(uint64(m.CreateRevision)) - return n -} -func (m *Compare_ModRevision) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovRpc(uint64(m.ModRevision)) - return n -} -func (m *Compare_Value) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Value != nil { - l = len(m.Value) - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *Compare_Lease) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovRpc(uint64(m.Lease)) - return n -} -func (m *TxnRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Compare) > 0 { - for _, e := range m.Compare { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if len(m.Success) > 0 { - for _, e := range m.Success { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if len(m.Failure) > 0 { - for _, e := range m.Failure { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *TxnResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.Succeeded { - n += 2 - } - if len(m.Responses) > 0 { - for _, e := range m.Responses { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *CompactionRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Revision != 0 { - n += 1 + sovRpc(uint64(m.Revision)) - } - if m.Physical { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *CompactionResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *HashRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *HashKVRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Revision != 0 { - n += 1 + sovRpc(uint64(m.Revision)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *HashKVResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.Hash != 0 { - n += 1 + sovRpc(uint64(m.Hash)) - } - if m.CompactRevision != 0 { - n += 1 + sovRpc(uint64(m.CompactRevision)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *HashResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.Hash != 0 { - n += 1 + sovRpc(uint64(m.Hash)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *SnapshotRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *SnapshotResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.RemainingBytes != 0 { - n += 1 + sovRpc(uint64(m.RemainingBytes)) - } - l = len(m.Blob) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *WatchRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.RequestUnion != nil { - n += m.RequestUnion.Size() - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *WatchRequest_CreateRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CreateRequest != nil { - l = m.CreateRequest.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *WatchRequest_CancelRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CancelRequest != nil { - l = m.CancelRequest.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *WatchRequest_ProgressRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProgressRequest != nil { - l = m.ProgressRequest.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *WatchCreateRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.RangeEnd) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.StartRevision != 0 { - n += 1 + sovRpc(uint64(m.StartRevision)) - } - if m.ProgressNotify { - n += 2 - } - if len(m.Filters) > 0 { - l = 0 - for _, e := range m.Filters { - l += sovRpc(uint64(e)) - } - n += 1 + sovRpc(uint64(l)) + l - } - if m.PrevKv { - n += 2 - } - if m.WatchId != 0 { - n += 1 + sovRpc(uint64(m.WatchId)) - } - if m.Fragment { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *WatchCancelRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.WatchId != 0 { - n += 1 + sovRpc(uint64(m.WatchId)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *WatchProgressRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *WatchResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.WatchId != 0 { - n += 1 + sovRpc(uint64(m.WatchId)) - } - if m.Created { - n += 2 - } - if m.Canceled { - n += 2 - } - if m.CompactRevision != 0 { - n += 1 + sovRpc(uint64(m.CompactRevision)) - } - l = len(m.CancelReason) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.Fragment { - n += 2 - } - if len(m.Events) > 0 { - for _, e := range m.Events { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *LeaseGrantRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TTL != 0 { - n += 1 + sovRpc(uint64(m.TTL)) - } - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *LeaseGrantResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - if m.TTL != 0 { - n += 1 + sovRpc(uint64(m.TTL)) - } - l = len(m.Error) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *LeaseRevokeRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *LeaseRevokeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *LeaseCheckpoint) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - if m.Remaining_TTL != 0 { - n += 1 + sovRpc(uint64(m.Remaining_TTL)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *LeaseCheckpointRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Checkpoints) > 0 { - for _, e := range m.Checkpoints { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *LeaseCheckpointResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *LeaseKeepAliveRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *LeaseKeepAliveResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - if m.TTL != 0 { - n += 1 + sovRpc(uint64(m.TTL)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *LeaseTimeToLiveRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - if m.Keys { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *LeaseTimeToLiveResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - if m.TTL != 0 { - n += 1 + sovRpc(uint64(m.TTL)) - } - if m.GrantedTTL != 0 { - n += 1 + sovRpc(uint64(m.GrantedTTL)) - } - if len(m.Keys) > 0 { - for _, b := range m.Keys { - l = len(b) - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *LeaseLeasesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *LeaseStatus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *LeaseLeasesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Leases) > 0 { - for _, e := range m.Leases { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Member) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.PeerURLs) > 0 { - for _, s := range m.PeerURLs { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if len(m.ClientURLs) > 0 { - for _, s := range m.ClientURLs { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.IsLearner { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *MemberAddRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.PeerURLs) > 0 { - for _, s := range m.PeerURLs { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.IsLearner { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *MemberAddResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.Member != nil { - l = m.Member.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Members) > 0 { - for _, e := range m.Members { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *MemberRemoveRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *MemberRemoveResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Members) > 0 { - for _, e := range m.Members { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *MemberUpdateRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - if len(m.PeerURLs) > 0 { - for _, s := range m.PeerURLs { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *MemberUpdateResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Members) > 0 { - for _, e := range m.Members { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *MemberListRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Linearizable { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *MemberListResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Members) > 0 { - for _, e := range m.Members { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *MemberPromoteRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *MemberPromoteResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Members) > 0 { - for _, e := range m.Members { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *DefragmentRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *DefragmentResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *MoveLeaderRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TargetID != 0 { - n += 1 + sovRpc(uint64(m.TargetID)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *MoveLeaderResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AlarmRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Action != 0 { - n += 1 + sovRpc(uint64(m.Action)) - } - if m.MemberID != 0 { - n += 1 + sovRpc(uint64(m.MemberID)) - } - if m.Alarm != 0 { - n += 1 + sovRpc(uint64(m.Alarm)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AlarmMember) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MemberID != 0 { - n += 1 + sovRpc(uint64(m.MemberID)) - } - if m.Alarm != 0 { - n += 1 + sovRpc(uint64(m.Alarm)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AlarmResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Alarms) > 0 { - for _, e := range m.Alarms { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *DowngradeRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Action != 0 { - n += 1 + sovRpc(uint64(m.Action)) - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *DowngradeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *StatusRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *StatusResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.DbSize != 0 { - n += 1 + sovRpc(uint64(m.DbSize)) - } - if m.Leader != 0 { - n += 1 + sovRpc(uint64(m.Leader)) - } - if m.RaftIndex != 0 { - n += 1 + sovRpc(uint64(m.RaftIndex)) - } - if m.RaftTerm != 0 { - n += 1 + sovRpc(uint64(m.RaftTerm)) - } - if m.RaftAppliedIndex != 0 { - n += 1 + sovRpc(uint64(m.RaftAppliedIndex)) - } - if len(m.Errors) > 0 { - for _, s := range m.Errors { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.DbSizeInUse != 0 { - n += 1 + sovRpc(uint64(m.DbSizeInUse)) - } - if m.IsLearner { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthEnableRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthDisableRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthStatusRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthenticateRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Password) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthUserAddRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Password) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.Options != nil { - l = m.Options.Size() - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.HashedPassword) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthUserGetRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthUserDeleteRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthUserChangePasswordRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Password) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.HashedPassword) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthUserGrantRoleRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.User) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Role) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthUserRevokeRoleRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Role) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthRoleAddRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthRoleGetRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Role) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthUserListRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthRoleListRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthRoleDeleteRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Role) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthRoleGrantPermissionRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.Perm != nil { - l = m.Perm.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthRoleRevokePermissionRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Role) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.RangeEnd) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthEnableResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthDisableResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthStatusResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.Enabled { - n += 2 - } - if m.AuthRevision != 0 { - n += 1 + sovRpc(uint64(m.AuthRevision)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthenticateResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Token) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthUserAddResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthUserGetResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Roles) > 0 { - for _, s := range m.Roles { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthUserDeleteResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthUserChangePasswordResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthUserGrantRoleResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthUserRevokeRoleResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthRoleAddResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthRoleGetResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Perm) > 0 { - for _, e := range m.Perm { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthRoleListResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Roles) > 0 { - for _, s := range m.Roles { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthUserListResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Users) > 0 { - for _, s := range m.Users { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthRoleDeleteResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthRoleGrantPermissionResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthRoleRevokePermissionResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovRpc(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRpc(x uint64) (n int) { - return sovRpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: 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 != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ClusterId", wireType) - } - m.ClusterId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ClusterId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemberId", wireType) - } - m.MemberId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MemberId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) - } - m.Revision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Revision |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftTerm", wireType) - } - m.RaftTerm = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RaftTerm |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: 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 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) - if m.RangeEnd == nil { - m.RangeEnd = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) - } - m.Limit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Limit |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) - } - m.Revision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Revision |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SortOrder", wireType) - } - m.SortOrder = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SortOrder |= RangeRequest_SortOrder(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SortTarget", wireType) - } - m.SortTarget = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SortTarget |= RangeRequest_SortTarget(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Serializable", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Serializable = bool(v != 0) - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field KeysOnly", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.KeysOnly = bool(v != 0) - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CountOnly", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.CountOnly = bool(v != 0) - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinModRevision", wireType) - } - m.MinModRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinModRevision |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxModRevision", wireType) - } - m.MaxModRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxModRevision |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinCreateRevision", wireType) - } - m.MinCreateRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinCreateRevision |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxCreateRevision", wireType) - } - m.MaxCreateRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxCreateRevision |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: 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 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kvs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kvs = append(m.Kvs, &mvccpb.KeyValue{}) - if err := m.Kvs[len(m.Kvs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field More", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.More = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) - } - m.Count = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Count |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: 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 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - 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 - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType) - } - m.Lease = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Lease |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.PrevKv = bool(v != 0) - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IgnoreValue", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IgnoreValue = bool(v != 0) - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IgnoreLease", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IgnoreLease = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: 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 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PrevKv == nil { - m.PrevKv = &mvccpb.KeyValue{} - } - if err := m.PrevKv.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: 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 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) - if m.RangeEnd == nil { - m.RangeEnd = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.PrevKv = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: 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 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Deleted", wireType) - } - m.Deleted = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Deleted |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevKvs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PrevKvs = append(m.PrevKvs, &mvccpb.KeyValue{}) - if err := m.PrevKvs[len(m.PrevKvs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestOp) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestOp: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestOp: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestRange", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RangeRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Request = &RequestOp_RequestRange{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestPut", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PutRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Request = &RequestOp_RequestPut{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestDeleteRange", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &DeleteRangeRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Request = &RequestOp_RequestDeleteRange{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestTxn", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &TxnRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Request = &RequestOp_RequestTxn{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponseOp) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseOp: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseOp: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResponseRange", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RangeResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &ResponseOp_ResponseRange{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResponsePut", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PutResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &ResponseOp_ResponsePut{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResponseDeleteRange", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &DeleteRangeResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &ResponseOp_ResponseDeleteRange{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResponseTxn", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &TxnResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &ResponseOp_ResponseTxn{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: 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 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) - } - m.Result = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Result |= Compare_CompareResult(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType) - } - m.Target = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Target |= Compare_CompareTarget(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - 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) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - 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) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - 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) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - 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 - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := make([]byte, postIndex-iNdEx) - copy(v, dAtA[iNdEx:postIndex]) - m.TargetUnion = &Compare_Value{v} - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.TargetUnion = &Compare_Lease{v} - case 64: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) - if m.RangeEnd == nil { - m.RangeEnd = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: 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 { - return fmt.Errorf("proto: wrong wireType = %d for field Compare", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Compare = append(m.Compare, &Compare{}) - if err := m.Compare[len(m.Compare)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Success = append(m.Success, &RequestOp{}) - if err := m.Success[len(m.Success)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Failure", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Failure = append(m.Failure, &RequestOp{}) - if err := m.Failure[len(m.Failure)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: 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 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Succeeded", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Succeeded = bool(v != 0) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Responses", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Responses = append(m.Responses, &ResponseOp{}) - if err := m.Responses[len(m.Responses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: 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 { - return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) - } - m.Revision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Revision |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Physical", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Physical = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: 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 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HashRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HashRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HashRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HashKVRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HashKVRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HashKVRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) - } - m.Revision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Revision |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HashKVResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HashKVResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HashKVResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - m.Hash = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Hash |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CompactRevision", wireType) - } - m.CompactRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CompactRevision |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HashResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HashResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HashResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - m.Hash = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Hash |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SnapshotRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SnapshotRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SnapshotResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SnapshotResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SnapshotResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RemainingBytes", wireType) - } - m.RemainingBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RemainingBytes |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Blob", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Blob = append(m.Blob[:0], dAtA[iNdEx:postIndex]...) - if m.Blob == nil { - m.Blob = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WatchRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WatchRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WatchRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreateRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &WatchCreateRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.RequestUnion = &WatchRequest_CreateRequest{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CancelRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &WatchCancelRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.RequestUnion = &WatchRequest_CancelRequest{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProgressRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &WatchProgressRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.RequestUnion = &WatchRequest_ProgressRequest{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WatchCreateRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WatchCreateRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WatchCreateRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) - if m.RangeEnd == nil { - m.RangeEnd = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartRevision", wireType) - } - m.StartRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartRevision |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProgressNotify", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ProgressNotify = bool(v != 0) - case 5: - if wireType == 0 { - var v WatchCreateRequest_FilterType - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= WatchCreateRequest_FilterType(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Filters = append(m.Filters, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - if elementCount != 0 && len(m.Filters) == 0 { - m.Filters = make([]WatchCreateRequest_FilterType, 0, elementCount) - } - for iNdEx < postIndex { - var v WatchCreateRequest_FilterType - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= WatchCreateRequest_FilterType(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Filters = append(m.Filters, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.PrevKv = bool(v != 0) - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WatchId", wireType) - } - m.WatchId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.WatchId |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Fragment", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Fragment = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WatchCancelRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WatchCancelRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WatchCancelRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WatchId", wireType) - } - m.WatchId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.WatchId |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WatchProgressRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WatchProgressRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WatchProgressRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WatchResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WatchResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WatchResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WatchId", wireType) - } - m.WatchId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.WatchId |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Created", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Created = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Canceled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Canceled = bool(v != 0) - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CompactRevision", wireType) - } - m.CompactRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CompactRevision |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CancelReason", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CancelReason = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Fragment", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Fragment = bool(v != 0) - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Events = append(m.Events, &mvccpb.Event{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseGrantRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseGrantRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseGrantRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) - } - m.TTL = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TTL |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseGrantResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseGrantResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseGrantResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) - } - m.TTL = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TTL |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Error = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseRevokeRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseRevokeRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseRevokeRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseRevokeResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseRevokeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseRevokeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseCheckpoint) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseCheckpoint: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseCheckpoint: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Remaining_TTL", wireType) - } - m.Remaining_TTL = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Remaining_TTL |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseCheckpointRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseCheckpointRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseCheckpointRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Checkpoints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Checkpoints = append(m.Checkpoints, &LeaseCheckpoint{}) - if err := m.Checkpoints[len(m.Checkpoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseCheckpointResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseCheckpointResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseCheckpointResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseKeepAliveRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseKeepAliveRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseKeepAliveRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseKeepAliveResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseKeepAliveResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseKeepAliveResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) - } - m.TTL = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TTL |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseTimeToLiveRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseTimeToLiveRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseTimeToLiveRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Keys = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseTimeToLiveResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseTimeToLiveResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseTimeToLiveResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) - } - m.TTL = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TTL |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GrantedTTL", wireType) - } - m.GrantedTTL = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GrantedTTL |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Keys = append(m.Keys, make([]byte, postIndex-iNdEx)) - copy(m.Keys[len(m.Keys)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseLeasesRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseLeasesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseLeasesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseStatus) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseLeasesResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseLeasesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseLeasesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Leases", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Leases = append(m.Leases, &LeaseStatus{}) - if err := m.Leases[len(m.Leases)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Member) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Member: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Member: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeerURLs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PeerURLs = append(m.PeerURLs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientURLs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientURLs = append(m.ClientURLs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsLearner", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsLearner = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemberAddRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MemberAddRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemberAddRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeerURLs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PeerURLs = append(m.PeerURLs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsLearner", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsLearner = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemberAddResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MemberAddResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemberAddResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Member", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Member == nil { - m.Member = &Member{} - } - if err := m.Member.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Members = append(m.Members, &Member{}) - if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemberRemoveRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MemberRemoveRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemberRemoveRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemberRemoveResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MemberRemoveResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemberRemoveResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Members = append(m.Members, &Member{}) - if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemberUpdateRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MemberUpdateRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemberUpdateRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeerURLs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PeerURLs = append(m.PeerURLs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemberUpdateResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MemberUpdateResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemberUpdateResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Members = append(m.Members, &Member{}) - if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemberListRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MemberListRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemberListRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Linearizable", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Linearizable = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemberListResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MemberListResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemberListResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Members = append(m.Members, &Member{}) - if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemberPromoteRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MemberPromoteRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemberPromoteRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemberPromoteResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MemberPromoteResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemberPromoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Members = append(m.Members, &Member{}) - if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DefragmentRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DefragmentRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DefragmentRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DefragmentResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DefragmentResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DefragmentResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MoveLeaderRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MoveLeaderRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MoveLeaderRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TargetID", wireType) - } - m.TargetID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TargetID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MoveLeaderResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MoveLeaderResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MoveLeaderResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AlarmRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AlarmRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AlarmRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - m.Action = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Action |= AlarmRequest_AlarmAction(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemberID", wireType) - } - m.MemberID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MemberID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType) - } - m.Alarm = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Alarm |= AlarmType(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AlarmMember) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AlarmMember: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AlarmMember: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemberID", wireType) - } - m.MemberID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MemberID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType) - } - m.Alarm = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Alarm |= AlarmType(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AlarmResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AlarmResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AlarmResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Alarms", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Alarms = append(m.Alarms, &AlarmMember{}) - if err := m.Alarms[len(m.Alarms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DowngradeRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DowngradeRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DowngradeRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - m.Action = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Action |= DowngradeRequest_DowngradeAction(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DowngradeResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DowngradeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DowngradeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StatusRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StatusResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DbSize", wireType) - } - m.DbSize = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DbSize |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Leader", wireType) - } - m.Leader = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Leader |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftIndex", wireType) - } - m.RaftIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RaftIndex |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftTerm", wireType) - } - m.RaftTerm = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RaftTerm |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftAppliedIndex", wireType) - } - m.RaftAppliedIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RaftAppliedIndex |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Errors", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Errors = append(m.Errors, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DbSizeInUse", wireType) - } - m.DbSizeInUse = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DbSizeInUse |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsLearner", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsLearner = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthEnableRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthEnableRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthEnableRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthDisableRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthDisableRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthDisableRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthStatusRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthStatusRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthenticateRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthenticateRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthenticateRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Password = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserAddRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserAddRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserAddRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Password = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Options == nil { - m.Options = &authpb.UserAddOptions{} - } - if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HashedPassword", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.HashedPassword = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserGetRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserGetRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserGetRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserDeleteRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserDeleteRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserDeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserChangePasswordRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserChangePasswordRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserChangePasswordRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Password = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HashedPassword", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.HashedPassword = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserGrantRoleRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserGrantRoleRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserGrantRoleRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.User = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Role = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserRevokeRoleRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserRevokeRoleRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserRevokeRoleRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Role = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleAddRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleAddRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleAddRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleGetRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleGetRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleGetRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Role = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserListRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserListRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserListRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleListRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleListRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleListRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleDeleteRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleDeleteRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleDeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Role = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleGrantPermissionRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleGrantPermissionRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleGrantPermissionRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Perm", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Perm == nil { - m.Perm = &authpb.Permission{} - } - if err := m.Perm.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleRevokePermissionRequest) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleRevokePermissionRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleRevokePermissionRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Role = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) - if m.RangeEnd == nil { - m.RangeEnd = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthEnableResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthEnableResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthEnableResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthDisableResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthDisableResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthDisableResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthStatusResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthStatusResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Enabled = bool(v != 0) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthRevision", wireType) - } - m.AuthRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuthRevision |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthenticateResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthenticateResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthenticateResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Token = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserAddResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserAddResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserAddResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserGetResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserGetResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserGetResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserDeleteResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserDeleteResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserDeleteResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserChangePasswordResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserChangePasswordResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserChangePasswordResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserGrantRoleResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserGrantRoleResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserGrantRoleResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserRevokeRoleResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserRevokeRoleResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserRevokeRoleResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleAddResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleAddResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleAddResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleGetResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleGetResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleGetResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Perm", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Perm = append(m.Perm, &authpb.Permission{}) - if err := m.Perm[len(m.Perm)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleListResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleListResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleListResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserListResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserListResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserListResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Users", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Users = append(m.Users, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleDeleteResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleDeleteResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleDeleteResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleGrantPermissionResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleGrantPermissionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleGrantPermissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleRevokePermissionResponse) 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleRevokePermissionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleRevokePermissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRpc(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthRpc - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRpc - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRpc - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRpc = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRpc = fmt.Errorf("proto: unexpected end of group") -) diff --git a/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/rpc.proto b/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/rpc.proto deleted file mode 100644 index 4ccc23474..000000000 --- a/e2e/vendor/go.etcd.io/etcd/api/v3/etcdserverpb/rpc.proto +++ /dev/null @@ -1,1199 +0,0 @@ -syntax = "proto3"; -package etcdserverpb; - -import "gogoproto/gogo.proto"; -import "etcd/api/mvccpb/kv.proto"; -import "etcd/api/authpb/auth.proto"; - -// for grpc-gateway -import "google/api/annotations.proto"; - -option (gogoproto.marshaler_all) = true; -option (gogoproto.unmarshaler_all) = true; - -service KV { - // Range gets the keys in the range from the key-value store. - rpc Range(RangeRequest) returns (RangeResponse) { - option (google.api.http) = { - post: "/v3/kv/range" - body: "*" - }; - } - - // Put puts the given key into the key-value store. - // A put request increments the revision of the key-value store - // and generates one event in the event history. - rpc Put(PutRequest) returns (PutResponse) { - option (google.api.http) = { - post: "/v3/kv/put" - body: "*" - }; - } - - // DeleteRange deletes the given range from the key-value store. - // A delete request increments the revision of the key-value store - // and generates a delete event in the event history for every deleted key. - rpc DeleteRange(DeleteRangeRequest) returns (DeleteRangeResponse) { - option (google.api.http) = { - post: "/v3/kv/deleterange" - body: "*" - }; - } - - // Txn processes multiple requests in a single transaction. - // A txn request increments the revision of the key-value store - // and generates events with the same revision for every completed request. - // It is not allowed to modify the same key several times within one txn. - rpc Txn(TxnRequest) returns (TxnResponse) { - option (google.api.http) = { - post: "/v3/kv/txn" - body: "*" - }; - } - - // Compact compacts the event history in the etcd key-value store. The key-value - // store should be periodically compacted or the event history will continue to grow - // indefinitely. - rpc Compact(CompactionRequest) returns (CompactionResponse) { - option (google.api.http) = { - post: "/v3/kv/compaction" - body: "*" - }; - } -} - -service Watch { - // Watch watches for events happening or that have happened. Both input and output - // are streams; the input stream is for creating and canceling watchers and the output - // stream sends events. One watch RPC can watch on multiple key ranges, streaming events - // for several watches at once. The entire event history can be watched starting from the - // last compaction revision. - rpc Watch(stream WatchRequest) returns (stream WatchResponse) { - option (google.api.http) = { - post: "/v3/watch" - body: "*" - }; - } -} - -service Lease { - // LeaseGrant creates a lease which expires if the server does not receive a keepAlive - // within a given time to live period. All keys attached to the lease will be expired and - // deleted if the lease expires. Each expired key generates a delete event in the event history. - rpc LeaseGrant(LeaseGrantRequest) returns (LeaseGrantResponse) { - option (google.api.http) = { - post: "/v3/lease/grant" - body: "*" - }; - } - - // LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted. - rpc LeaseRevoke(LeaseRevokeRequest) returns (LeaseRevokeResponse) { - option (google.api.http) = { - post: "/v3/lease/revoke" - body: "*" - additional_bindings { - post: "/v3/kv/lease/revoke" - body: "*" - } - }; - } - - // LeaseKeepAlive keeps the lease alive by streaming keep alive requests from the client - // to the server and streaming keep alive responses from the server to the client. - rpc LeaseKeepAlive(stream LeaseKeepAliveRequest) returns (stream LeaseKeepAliveResponse) { - option (google.api.http) = { - post: "/v3/lease/keepalive" - body: "*" - }; - } - - // LeaseTimeToLive retrieves lease information. - rpc LeaseTimeToLive(LeaseTimeToLiveRequest) returns (LeaseTimeToLiveResponse) { - option (google.api.http) = { - post: "/v3/lease/timetolive" - body: "*" - additional_bindings { - post: "/v3/kv/lease/timetolive" - body: "*" - } - }; - } - - // LeaseLeases lists all existing leases. - rpc LeaseLeases(LeaseLeasesRequest) returns (LeaseLeasesResponse) { - option (google.api.http) = { - post: "/v3/lease/leases" - body: "*" - additional_bindings { - post: "/v3/kv/lease/leases" - body: "*" - } - }; - } -} - -service Cluster { - // MemberAdd adds a member into the cluster. - rpc MemberAdd(MemberAddRequest) returns (MemberAddResponse) { - option (google.api.http) = { - post: "/v3/cluster/member/add" - body: "*" - }; - } - - // MemberRemove removes an existing member from the cluster. - rpc MemberRemove(MemberRemoveRequest) returns (MemberRemoveResponse) { - option (google.api.http) = { - post: "/v3/cluster/member/remove" - body: "*" - }; - } - - // MemberUpdate updates the member configuration. - rpc MemberUpdate(MemberUpdateRequest) returns (MemberUpdateResponse) { - option (google.api.http) = { - post: "/v3/cluster/member/update" - body: "*" - }; - } - - // MemberList lists all the members in the cluster. - rpc MemberList(MemberListRequest) returns (MemberListResponse) { - option (google.api.http) = { - post: "/v3/cluster/member/list" - body: "*" - }; - } - - // MemberPromote promotes a member from raft learner (non-voting) to raft voting member. - rpc MemberPromote(MemberPromoteRequest) returns (MemberPromoteResponse) { - option (google.api.http) = { - post: "/v3/cluster/member/promote" - body: "*" - }; - } -} - -service Maintenance { - // Alarm activates, deactivates, and queries alarms regarding cluster health. - rpc Alarm(AlarmRequest) returns (AlarmResponse) { - option (google.api.http) = { - post: "/v3/maintenance/alarm" - body: "*" - }; - } - - // Status gets the status of the member. - rpc Status(StatusRequest) returns (StatusResponse) { - option (google.api.http) = { - post: "/v3/maintenance/status" - body: "*" - }; - } - - // Defragment defragments a member's backend database to recover storage space. - rpc Defragment(DefragmentRequest) returns (DefragmentResponse) { - option (google.api.http) = { - post: "/v3/maintenance/defragment" - body: "*" - }; - } - - // Hash computes the hash of whole backend keyspace, - // including key, lease, and other buckets in storage. - // This is designed for testing ONLY! - // Do not rely on this in production with ongoing transactions, - // since Hash operation does not hold MVCC locks. - // Use "HashKV" API instead for "key" bucket consistency checks. - rpc Hash(HashRequest) returns (HashResponse) { - option (google.api.http) = { - post: "/v3/maintenance/hash" - body: "*" - }; - } - - // HashKV computes the hash of all MVCC keys up to a given revision. - // It only iterates "key" bucket in backend storage. - rpc HashKV(HashKVRequest) returns (HashKVResponse) { - option (google.api.http) = { - post: "/v3/maintenance/hashkv" - body: "*" - }; - } - - // Snapshot sends a snapshot of the entire backend from a member over a stream to a client. - rpc Snapshot(SnapshotRequest) returns (stream SnapshotResponse) { - option (google.api.http) = { - post: "/v3/maintenance/snapshot" - body: "*" - }; - } - - // MoveLeader requests current leader node to transfer its leadership to transferee. - rpc MoveLeader(MoveLeaderRequest) returns (MoveLeaderResponse) { - option (google.api.http) = { - post: "/v3/maintenance/transfer-leadership" - body: "*" - }; - } - - // Downgrade requests downgrades, verifies feasibility or cancels downgrade - // on the cluster version. - // Supported since etcd 3.5. - rpc Downgrade(DowngradeRequest) returns (DowngradeResponse) { - option (google.api.http) = { - post: "/v3/maintenance/downgrade" - body: "*" - }; - } -} - -service Auth { - // AuthEnable enables authentication. - rpc AuthEnable(AuthEnableRequest) returns (AuthEnableResponse) { - option (google.api.http) = { - post: "/v3/auth/enable" - body: "*" - }; - } - - // AuthDisable disables authentication. - rpc AuthDisable(AuthDisableRequest) returns (AuthDisableResponse) { - option (google.api.http) = { - post: "/v3/auth/disable" - body: "*" - }; - } - - // AuthStatus displays authentication status. - rpc AuthStatus(AuthStatusRequest) returns (AuthStatusResponse) { - option (google.api.http) = { - post: "/v3/auth/status" - body: "*" - }; - } - - // Authenticate processes an authenticate request. - rpc Authenticate(AuthenticateRequest) returns (AuthenticateResponse) { - option (google.api.http) = { - post: "/v3/auth/authenticate" - body: "*" - }; - } - - // UserAdd adds a new user. User name cannot be empty. - rpc UserAdd(AuthUserAddRequest) returns (AuthUserAddResponse) { - option (google.api.http) = { - post: "/v3/auth/user/add" - body: "*" - }; - } - - // UserGet gets detailed user information. - rpc UserGet(AuthUserGetRequest) returns (AuthUserGetResponse) { - option (google.api.http) = { - post: "/v3/auth/user/get" - body: "*" - }; - } - - // UserList gets a list of all users. - rpc UserList(AuthUserListRequest) returns (AuthUserListResponse) { - option (google.api.http) = { - post: "/v3/auth/user/list" - body: "*" - }; - } - - // UserDelete deletes a specified user. - rpc UserDelete(AuthUserDeleteRequest) returns (AuthUserDeleteResponse) { - option (google.api.http) = { - post: "/v3/auth/user/delete" - body: "*" - }; - } - - // UserChangePassword changes the password of a specified user. - rpc UserChangePassword(AuthUserChangePasswordRequest) returns (AuthUserChangePasswordResponse) { - option (google.api.http) = { - post: "/v3/auth/user/changepw" - body: "*" - }; - } - - // UserGrant grants a role to a specified user. - rpc UserGrantRole(AuthUserGrantRoleRequest) returns (AuthUserGrantRoleResponse) { - option (google.api.http) = { - post: "/v3/auth/user/grant" - body: "*" - }; - } - - // UserRevokeRole revokes a role of specified user. - rpc UserRevokeRole(AuthUserRevokeRoleRequest) returns (AuthUserRevokeRoleResponse) { - option (google.api.http) = { - post: "/v3/auth/user/revoke" - body: "*" - }; - } - - // RoleAdd adds a new role. Role name cannot be empty. - rpc RoleAdd(AuthRoleAddRequest) returns (AuthRoleAddResponse) { - option (google.api.http) = { - post: "/v3/auth/role/add" - body: "*" - }; - } - - // RoleGet gets detailed role information. - rpc RoleGet(AuthRoleGetRequest) returns (AuthRoleGetResponse) { - option (google.api.http) = { - post: "/v3/auth/role/get" - body: "*" - }; - } - - // RoleList gets lists of all roles. - rpc RoleList(AuthRoleListRequest) returns (AuthRoleListResponse) { - option (google.api.http) = { - post: "/v3/auth/role/list" - body: "*" - }; - } - - // RoleDelete deletes a specified role. - rpc RoleDelete(AuthRoleDeleteRequest) returns (AuthRoleDeleteResponse) { - option (google.api.http) = { - post: "/v3/auth/role/delete" - body: "*" - }; - } - - // RoleGrantPermission grants a permission of a specified key or range to a specified role. - rpc RoleGrantPermission(AuthRoleGrantPermissionRequest) returns (AuthRoleGrantPermissionResponse) { - option (google.api.http) = { - post: "/v3/auth/role/grant" - body: "*" - }; - } - - // RoleRevokePermission revokes a key or range permission of a specified role. - rpc RoleRevokePermission(AuthRoleRevokePermissionRequest) returns (AuthRoleRevokePermissionResponse) { - option (google.api.http) = { - post: "/v3/auth/role/revoke" - body: "*" - }; - } -} - -message ResponseHeader { - // cluster_id is the ID of the cluster which sent the response. - uint64 cluster_id = 1; - // member_id is the ID of the member which sent the response. - uint64 member_id = 2; - // revision is the key-value store revision when the request was applied. - // For watch progress responses, the header.revision indicates progress. All future events - // recieved in this stream are guaranteed to have a higher revision number than the - // header.revision number. - int64 revision = 3; - // raft_term is the raft term when the request was applied. - uint64 raft_term = 4; -} - -message RangeRequest { - enum SortOrder { - NONE = 0; // default, no sorting - ASCEND = 1; // lowest target value first - DESCEND = 2; // highest target value first - } - enum SortTarget { - KEY = 0; - VERSION = 1; - CREATE = 2; - MOD = 3; - VALUE = 4; - } - - // key is the first key for the range. If range_end is not given, the request only looks up key. - bytes key = 1; - // range_end is the upper bound on the requested range [key, range_end). - // If range_end is '\0', the range is all keys >= key. - // If range_end is key plus one (e.g., "aa"+1 == "ab", "a\xff"+1 == "b"), - // then the range request gets all keys prefixed with key. - // If both key and range_end are '\0', then the range request returns all keys. - bytes range_end = 2; - // limit is a limit on the number of keys returned for the request. When limit is set to 0, - // it is treated as no limit. - int64 limit = 3; - // revision is the point-in-time of the key-value store to use for the range. - // If revision is less or equal to zero, the range is over the newest key-value store. - // If the revision has been compacted, ErrCompacted is returned as a response. - int64 revision = 4; - - // sort_order is the order for returned sorted results. - SortOrder sort_order = 5; - - // sort_target is the key-value field to use for sorting. - SortTarget sort_target = 6; - - // serializable sets the range request to use serializable member-local reads. - // Range requests are linearizable by default; linearizable requests have higher - // latency and lower throughput than serializable requests but reflect the current - // consensus of the cluster. For better performance, in exchange for possible stale reads, - // a serializable range request is served locally without needing to reach consensus - // with other nodes in the cluster. - bool serializable = 7; - - // keys_only when set returns only the keys and not the values. - bool keys_only = 8; - - // count_only when set returns only the count of the keys in the range. - bool count_only = 9; - - // min_mod_revision is the lower bound for returned key mod revisions; all keys with - // lesser mod revisions will be filtered away. - int64 min_mod_revision = 10; - - // max_mod_revision is the upper bound for returned key mod revisions; all keys with - // greater mod revisions will be filtered away. - int64 max_mod_revision = 11; - - // min_create_revision is the lower bound for returned key create revisions; all keys with - // lesser create revisions will be filtered away. - int64 min_create_revision = 12; - - // max_create_revision is the upper bound for returned key create revisions; all keys with - // greater create revisions will be filtered away. - int64 max_create_revision = 13; -} - -message RangeResponse { - ResponseHeader header = 1; - // kvs is the list of key-value pairs matched by the range request. - // kvs is empty when count is requested. - repeated mvccpb.KeyValue kvs = 2; - // more indicates if there are more keys to return in the requested range. - bool more = 3; - // count is set to the number of keys within the range when requested. - int64 count = 4; -} - -message PutRequest { - // key is the key, in bytes, to put into the key-value store. - bytes key = 1; - // value is the value, in bytes, to associate with the key in the key-value store. - bytes value = 2; - // lease is the lease ID to associate with the key in the key-value store. A lease - // value of 0 indicates no lease. - int64 lease = 3; - - // If prev_kv is set, etcd gets the previous key-value pair before changing it. - // The previous key-value pair will be returned in the put response. - bool prev_kv = 4; - - // If ignore_value is set, etcd updates the key using its current value. - // Returns an error if the key does not exist. - bool ignore_value = 5; - - // If ignore_lease is set, etcd updates the key using its current lease. - // Returns an error if the key does not exist. - bool ignore_lease = 6; -} - -message PutResponse { - ResponseHeader header = 1; - // if prev_kv is set in the request, the previous key-value pair will be returned. - mvccpb.KeyValue prev_kv = 2; -} - -message DeleteRangeRequest { - // key is the first key to delete in the range. - bytes key = 1; - // range_end is the key following the last key to delete for the range [key, range_end). - // If range_end is not given, the range is defined to contain only the key argument. - // If range_end is one bit larger than the given key, then the range is all the keys - // with the prefix (the given key). - // If range_end is '\0', the range is all keys greater than or equal to the key argument. - bytes range_end = 2; - - // If prev_kv is set, etcd gets the previous key-value pairs before deleting it. - // The previous key-value pairs will be returned in the delete response. - bool prev_kv = 3; -} - -message DeleteRangeResponse { - ResponseHeader header = 1; - // deleted is the number of keys deleted by the delete range request. - int64 deleted = 2; - // if prev_kv is set in the request, the previous key-value pairs will be returned. - repeated mvccpb.KeyValue prev_kvs = 3; -} - -message RequestOp { - // request is a union of request types accepted by a transaction. - oneof request { - RangeRequest request_range = 1; - PutRequest request_put = 2; - DeleteRangeRequest request_delete_range = 3; - TxnRequest request_txn = 4; - } -} - -message ResponseOp { - // response is a union of response types returned by a transaction. - oneof response { - RangeResponse response_range = 1; - PutResponse response_put = 2; - DeleteRangeResponse response_delete_range = 3; - TxnResponse response_txn = 4; - } -} - -message Compare { - enum CompareResult { - EQUAL = 0; - GREATER = 1; - LESS = 2; - NOT_EQUAL = 3; - } - enum CompareTarget { - VERSION = 0; - CREATE = 1; - MOD = 2; - VALUE = 3; - LEASE = 4; - } - // result is logical comparison operation for this comparison. - CompareResult result = 1; - // target is the key-value field to inspect for the comparison. - CompareTarget target = 2; - // key is the subject key for the comparison operation. - bytes key = 3; - oneof target_union { - // version is the version of the given key - int64 version = 4; - // create_revision is the creation revision of the given key - int64 create_revision = 5; - // mod_revision is the last modified revision of the given key. - int64 mod_revision = 6; - // value is the value of the given key, in bytes. - bytes value = 7; - // lease is the lease id of the given key. - int64 lease = 8; - // leave room for more target_union field tags, jump to 64 - } - - // range_end compares the given target to all keys in the range [key, range_end). - // See RangeRequest for more details on key ranges. - bytes range_end = 64; - // TODO: fill out with most of the rest of RangeRequest fields when needed. -} - -// 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 -// and consists of three components: -// 1. A list of tests called guard. Each test in guard checks a single entry in the database. It may check -// for the absence or presence of a value, or compare with a given value. Two different tests in the guard -// may apply to the same or different entries in the database. All tests in the guard are applied and -// MultiOp returns the results. If all tests are true, MultiOp executes t op (see item 2 below), otherwise -// it executes f op (see item 3 below). -// 2. A list of database operations called t op. Each operation in the list is either an insert, delete, or -// lookup operation, and applies to a single database entry. Two different operations in the list may apply -// to the same or different entries in the database. These operations are executed -// if guard evaluates to -// true. -// 3. A list of database operations called f op. Like t op, but executed if guard evaluates to false. -message TxnRequest { - // compare is a list of predicates representing a conjunction of terms. - // If the comparisons succeed, then the success requests will be processed in order, - // and the response will contain their respective responses in order. - // If the comparisons fail, then the failure requests will be processed in order, - // and the response will contain their respective responses in order. - repeated Compare compare = 1; - // success is a list of requests which will be applied when compare evaluates to true. - repeated RequestOp success = 2; - // failure is a list of requests which will be applied when compare evaluates to false. - repeated RequestOp failure = 3; -} - -message TxnResponse { - ResponseHeader header = 1; - // succeeded is set to true if the compare evaluated to true or false otherwise. - bool succeeded = 2; - // responses is a list of responses corresponding to the results from applying - // success if succeeded is true or failure if succeeded is false. - repeated ResponseOp responses = 3; -} - -// CompactionRequest compacts the key-value store up to a given revision. All superseded keys -// with a revision less than the compaction revision will be removed. -message CompactionRequest { - // revision is the key-value store revision for the compaction operation. - int64 revision = 1; - // physical is set so the RPC will wait until the compaction is physically - // applied to the local database such that compacted entries are totally - // removed from the backend database. - bool physical = 2; -} - -message CompactionResponse { - ResponseHeader header = 1; -} - -message HashRequest { -} - -message HashKVRequest { - // revision is the key-value store revision for the hash operation. - int64 revision = 1; -} - -message HashKVResponse { - ResponseHeader header = 1; - // hash is the hash value computed from the responding member's MVCC keys up to a given revision. - uint32 hash = 2; - // compact_revision is the compacted revision of key-value store when hash begins. - int64 compact_revision = 3; -} - -message HashResponse { - ResponseHeader header = 1; - // hash is the hash value computed from the responding member's KV's backend. - uint32 hash = 2; -} - -message SnapshotRequest { -} - -message SnapshotResponse { - // header has the current key-value store information. The first header in the snapshot - // stream indicates the point in time of the snapshot. - ResponseHeader header = 1; - - // remaining_bytes is the number of blob bytes to be sent after this message - uint64 remaining_bytes = 2; - - // blob contains the next chunk of the snapshot in the snapshot stream. - bytes blob = 3; -} - -message WatchRequest { - // request_union is a request to either create a new watcher or cancel an existing watcher. - oneof request_union { - WatchCreateRequest create_request = 1; - WatchCancelRequest cancel_request = 2; - WatchProgressRequest progress_request = 3; - } -} - -message WatchCreateRequest { - // key is the key to register for watching. - bytes key = 1; - - // range_end is the end of the range [key, range_end) to watch. If range_end is not given, - // only the key argument is watched. If range_end is equal to '\0', all keys greater than - // or equal to the key argument are watched. - // If the range_end is one bit larger than the given key, - // then all keys with the prefix (the given key) will be watched. - bytes range_end = 2; - - // start_revision is an optional revision to watch from (inclusive). No start_revision is "now". - int64 start_revision = 3; - - // progress_notify is set so that the etcd server will periodically send a WatchResponse with - // no events to the new watcher if there are no recent events. It is useful when clients - // wish to recover a disconnected watcher starting from a recent known revision. - // The etcd server may decide how often it will send notifications based on current load. - bool progress_notify = 4; - - enum FilterType { - // filter out put event. - NOPUT = 0; - // filter out delete event. - NODELETE = 1; - } - - // filters filter the events at server side before it sends back to the watcher. - repeated FilterType filters = 5; - - // If prev_kv is set, created watcher gets the previous KV before the event happens. - // If the previous KV is already compacted, nothing will be returned. - bool prev_kv = 6; - - // If watch_id is provided and non-zero, it will be assigned to this watcher. - // Since creating a watcher in etcd is not a synchronous operation, - // this can be used ensure that ordering is correct when creating multiple - // watchers on the same stream. Creating a watcher with an ID already in - // use on the stream will cause an error to be returned. - int64 watch_id = 7; - - // fragment enables splitting large revisions into multiple watch responses. - bool fragment = 8; -} - -message WatchCancelRequest { - // watch_id is the watcher id to cancel so that no more events are transmitted. - int64 watch_id = 1; -} - -// Requests the a watch stream progress status be sent in the watch response stream as soon as -// possible. -message WatchProgressRequest { -} - -message WatchResponse { - ResponseHeader header = 1; - // watch_id is the ID of the watcher that corresponds to the response. - int64 watch_id = 2; - - // created is set to true if the response is for a create watch request. - // The client should record the watch_id and expect to receive events for - // the created watcher from the same stream. - // All events sent to the created watcher will attach with the same watch_id. - bool created = 3; - - // canceled is set to true if the response is for a cancel watch request. - // No further events will be sent to the canceled watcher. - bool canceled = 4; - - // compact_revision is set to the minimum index if a watcher tries to watch - // at a compacted index. - // - // This happens when creating a watcher at a compacted revision or the watcher cannot - // catch up with the progress of the key-value store. - // - // The client should treat the watcher as canceled and should not try to create any - // watcher with the same start_revision again. - int64 compact_revision = 5; - - // cancel_reason indicates the reason for canceling the watcher. - string cancel_reason = 6; - - // framgment is true if large watch response was split over multiple responses. - bool fragment = 7; - - repeated mvccpb.Event events = 11; -} - -message LeaseGrantRequest { - // TTL is the advisory time-to-live in seconds. Expired lease will return -1. - int64 TTL = 1; - // ID is the requested ID for the lease. If ID is set to 0, the lessor chooses an ID. - int64 ID = 2; -} - -message LeaseGrantResponse { - ResponseHeader header = 1; - // ID is the lease ID for the granted lease. - int64 ID = 2; - // TTL is the server chosen lease time-to-live in seconds. - int64 TTL = 3; - string error = 4; -} - -message LeaseRevokeRequest { - // ID is the lease ID to revoke. When the ID is revoked, all associated keys will be deleted. - int64 ID = 1; -} - -message LeaseRevokeResponse { - ResponseHeader header = 1; -} - -message LeaseCheckpoint { - // ID is the lease ID to checkpoint. - int64 ID = 1; - - // Remaining_TTL is the remaining time until expiry of the lease. - int64 remaining_TTL = 2; -} - -message LeaseCheckpointRequest { - repeated LeaseCheckpoint checkpoints = 1; -} - -message LeaseCheckpointResponse { - ResponseHeader header = 1; -} - -message LeaseKeepAliveRequest { - // ID is the lease ID for the lease to keep alive. - int64 ID = 1; -} - -message LeaseKeepAliveResponse { - ResponseHeader header = 1; - // ID is the lease ID from the keep alive request. - int64 ID = 2; - // TTL is the new time-to-live for the lease. - int64 TTL = 3; -} - -message LeaseTimeToLiveRequest { - // ID is the lease ID for the lease. - int64 ID = 1; - // keys is true to query all the keys attached to this lease. - bool keys = 2; -} - -message LeaseTimeToLiveResponse { - ResponseHeader header = 1; - // ID is the lease ID from the keep alive request. - int64 ID = 2; - // TTL is the remaining TTL in seconds for the lease; the lease will expire in under TTL+1 seconds. - int64 TTL = 3; - // GrantedTTL is the initial granted time in seconds upon lease creation/renewal. - int64 grantedTTL = 4; - // Keys is the list of keys attached to this lease. - repeated bytes keys = 5; -} - -message LeaseLeasesRequest { -} - -message LeaseStatus { - int64 ID = 1; - // TODO: int64 TTL = 2; -} - -message LeaseLeasesResponse { - ResponseHeader header = 1; - repeated LeaseStatus leases = 2; -} - -message Member { - // ID is the member ID for this member. - uint64 ID = 1; - // name is the human-readable name of the member. If the member is not started, the name will be an empty string. - string name = 2; - // peerURLs is the list of URLs the member exposes to the cluster for communication. - repeated string peerURLs = 3; - // clientURLs is the list of URLs the member exposes to clients for communication. If the member is not started, clientURLs will be empty. - repeated string clientURLs = 4; - // isLearner indicates if the member is raft learner. - bool isLearner = 5; -} - -message MemberAddRequest { - // peerURLs is the list of URLs the added member will use to communicate with the cluster. - repeated string peerURLs = 1; - // isLearner indicates if the added member is raft learner. - bool isLearner = 2; -} - -message MemberAddResponse { - ResponseHeader header = 1; - // member is the member information for the added member. - Member member = 2; - // members is a list of all members after adding the new member. - repeated Member members = 3; -} - -message MemberRemoveRequest { - // ID is the member ID of the member to remove. - uint64 ID = 1; -} - -message MemberRemoveResponse { - ResponseHeader header = 1; - // members is a list of all members after removing the member. - repeated Member members = 2; -} - -message MemberUpdateRequest { - // ID is the member ID of the member to update. - uint64 ID = 1; - // peerURLs is the new list of URLs the member will use to communicate with the cluster. - repeated string peerURLs = 2; -} - -message MemberUpdateResponse{ - ResponseHeader header = 1; - // members is a list of all members after updating the member. - repeated Member members = 2; -} - -message MemberListRequest { - bool linearizable = 1; -} - -message MemberListResponse { - ResponseHeader header = 1; - // members is a list of all members associated with the cluster. - repeated Member members = 2; -} - -message MemberPromoteRequest { - // ID is the member ID of the member to promote. - uint64 ID = 1; -} - -message MemberPromoteResponse { - ResponseHeader header = 1; - // members is a list of all members after promoting the member. - repeated Member members = 2; -} - -message DefragmentRequest { -} - -message DefragmentResponse { - ResponseHeader header = 1; -} - -message MoveLeaderRequest { - // targetID is the node ID for the new leader. - uint64 targetID = 1; -} - -message MoveLeaderResponse { - ResponseHeader header = 1; -} - -enum AlarmType { - NONE = 0; // default, used to query if any alarm is active - NOSPACE = 1; // space quota is exhausted - CORRUPT = 2; // kv store corruption detected -} - -message AlarmRequest { - enum AlarmAction { - GET = 0; - ACTIVATE = 1; - DEACTIVATE = 2; - } - // action is the kind of alarm request to issue. The action - // may GET alarm statuses, ACTIVATE an alarm, or DEACTIVATE a - // raised alarm. - AlarmAction action = 1; - // memberID is the ID of the member associated with the alarm. If memberID is 0, the - // alarm request covers all members. - uint64 memberID = 2; - // alarm is the type of alarm to consider for this request. - AlarmType alarm = 3; -} - -message AlarmMember { - // memberID is the ID of the member associated with the raised alarm. - uint64 memberID = 1; - // alarm is the type of alarm which has been raised. - AlarmType alarm = 2; -} - -message AlarmResponse { - ResponseHeader header = 1; - // alarms is a list of alarms associated with the alarm request. - repeated AlarmMember alarms = 2; -} - -message DowngradeRequest { - enum DowngradeAction { - VALIDATE = 0; - ENABLE = 1; - CANCEL = 2; - } - - // action is the kind of downgrade request to issue. The action may - // VALIDATE the target version, DOWNGRADE the cluster version, - // or CANCEL the current downgrading job. - DowngradeAction action = 1; - // version is the target version to downgrade. - string version = 2; -} - -message DowngradeResponse { - ResponseHeader header = 1; - // version is the current cluster version. - string version = 2; -} - -message StatusRequest { -} - -message StatusResponse { - ResponseHeader header = 1; - // version is the cluster protocol version used by the responding member. - string version = 2; - // dbSize is the size of the backend database physically allocated, in bytes, of the responding member. - int64 dbSize = 3; - // leader is the member ID which the responding member believes is the current leader. - uint64 leader = 4; - // raftIndex is the current raft committed index of the responding member. - uint64 raftIndex = 5; - // raftTerm is the current raft term of the responding member. - uint64 raftTerm = 6; - // raftAppliedIndex is the current raft applied index of the responding member. - uint64 raftAppliedIndex = 7; - // errors contains alarm/health information and status. - repeated string errors = 8; - // dbSizeInUse is the size of the backend database logically in use, in bytes, of the responding member. - int64 dbSizeInUse = 9; - // isLearner indicates if the member is raft learner. - bool isLearner = 10; -} - -message AuthEnableRequest { -} - -message AuthDisableRequest { -} - -message AuthStatusRequest { -} - -message AuthenticateRequest { - string name = 1; - string password = 2; -} - -message AuthUserAddRequest { - string name = 1; - string password = 2; - authpb.UserAddOptions options = 3; - string hashedPassword = 4; -} - -message AuthUserGetRequest { - string name = 1; -} - -message AuthUserDeleteRequest { - // name is the name of the user to delete. - string name = 1; -} - -message AuthUserChangePasswordRequest { - // name is the name of the user whose password is being changed. - string name = 1; - // password is the new password for the user. Note that this field will be removed in the API layer. - string password = 2; - // hashedPassword is the new password for the user. Note that this field will be initialized in the API layer. - string hashedPassword = 3; -} - -message AuthUserGrantRoleRequest { - // user is the name of the user which should be granted a given role. - string user = 1; - // role is the name of the role to grant to the user. - string role = 2; -} - -message AuthUserRevokeRoleRequest { - string name = 1; - string role = 2; -} - -message AuthRoleAddRequest { - // name is the name of the role to add to the authentication system. - string name = 1; -} - -message AuthRoleGetRequest { - string role = 1; -} - -message AuthUserListRequest { -} - -message AuthRoleListRequest { -} - -message AuthRoleDeleteRequest { - string role = 1; -} - -message AuthRoleGrantPermissionRequest { - // name is the name of the role which will be granted the permission. - string name = 1; - // perm is the permission to grant to the role. - authpb.Permission perm = 2; -} - -message AuthRoleRevokePermissionRequest { - string role = 1; - bytes key = 2; - bytes range_end = 3; -} - -message AuthEnableResponse { - ResponseHeader header = 1; -} - -message AuthDisableResponse { - ResponseHeader header = 1; -} - -message AuthStatusResponse { - ResponseHeader header = 1; - bool enabled = 2; - // authRevision is the current revision of auth store - uint64 authRevision = 3; -} - -message AuthenticateResponse { - ResponseHeader header = 1; - // token is an authorized token that can be used in succeeding RPCs - string token = 2; -} - -message AuthUserAddResponse { - ResponseHeader header = 1; -} - -message AuthUserGetResponse { - ResponseHeader header = 1; - - repeated string roles = 2; -} - -message AuthUserDeleteResponse { - ResponseHeader header = 1; -} - -message AuthUserChangePasswordResponse { - ResponseHeader header = 1; -} - -message AuthUserGrantRoleResponse { - ResponseHeader header = 1; -} - -message AuthUserRevokeRoleResponse { - ResponseHeader header = 1; -} - -message AuthRoleAddResponse { - ResponseHeader header = 1; -} - -message AuthRoleGetResponse { - ResponseHeader header = 1; - - repeated authpb.Permission perm = 2; -} - -message AuthRoleListResponse { - ResponseHeader header = 1; - - repeated string roles = 2; -} - -message AuthUserListResponse { - ResponseHeader header = 1; - - repeated string users = 2; -} - -message AuthRoleDeleteResponse { - ResponseHeader header = 1; -} - -message AuthRoleGrantPermissionResponse { - ResponseHeader header = 1; -} - -message AuthRoleRevokePermissionResponse { - ResponseHeader header = 1; -} diff --git a/e2e/vendor/go.etcd.io/etcd/api/v3/membershippb/membership.pb.go b/e2e/vendor/go.etcd.io/etcd/api/v3/membershippb/membership.pb.go deleted file mode 100644 index cf0d42818..000000000 --- a/e2e/vendor/go.etcd.io/etcd/api/v3/membershippb/membership.pb.go +++ /dev/null @@ -1,1454 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: membership.proto - -package membershippb - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/golang/protobuf/proto" -) - -// 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. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// RaftAttributes represents the raft related attributes of an etcd member. -type RaftAttributes struct { - // peerURLs is the list of peers in the raft cluster. - PeerUrls []string `protobuf:"bytes,1,rep,name=peer_urls,json=peerUrls,proto3" json:"peer_urls,omitempty"` - // isLearner indicates if the member is raft learner. - IsLearner bool `protobuf:"varint,2,opt,name=is_learner,json=isLearner,proto3" json:"is_learner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RaftAttributes) Reset() { *m = RaftAttributes{} } -func (m *RaftAttributes) String() string { return proto.CompactTextString(m) } -func (*RaftAttributes) ProtoMessage() {} -func (*RaftAttributes) Descriptor() ([]byte, []int) { - return fileDescriptor_949fe0d019050ef5, []int{0} -} -func (m *RaftAttributes) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RaftAttributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RaftAttributes.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RaftAttributes) XXX_Merge(src proto.Message) { - xxx_messageInfo_RaftAttributes.Merge(m, src) -} -func (m *RaftAttributes) XXX_Size() int { - return m.Size() -} -func (m *RaftAttributes) XXX_DiscardUnknown() { - xxx_messageInfo_RaftAttributes.DiscardUnknown(m) -} - -var xxx_messageInfo_RaftAttributes proto.InternalMessageInfo - -// Attributes represents all the non-raft related attributes of an etcd member. -type Attributes struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - ClientUrls []string `protobuf:"bytes,2,rep,name=client_urls,json=clientUrls,proto3" json:"client_urls,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Attributes) Reset() { *m = Attributes{} } -func (m *Attributes) String() string { return proto.CompactTextString(m) } -func (*Attributes) ProtoMessage() {} -func (*Attributes) Descriptor() ([]byte, []int) { - return fileDescriptor_949fe0d019050ef5, []int{1} -} -func (m *Attributes) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Attributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Attributes.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Attributes) XXX_Merge(src proto.Message) { - xxx_messageInfo_Attributes.Merge(m, src) -} -func (m *Attributes) XXX_Size() int { - return m.Size() -} -func (m *Attributes) XXX_DiscardUnknown() { - xxx_messageInfo_Attributes.DiscardUnknown(m) -} - -var xxx_messageInfo_Attributes proto.InternalMessageInfo - -type Member struct { - ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - RaftAttributes *RaftAttributes `protobuf:"bytes,2,opt,name=raft_attributes,json=raftAttributes,proto3" json:"raft_attributes,omitempty"` - MemberAttributes *Attributes `protobuf:"bytes,3,opt,name=member_attributes,json=memberAttributes,proto3" json:"member_attributes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Member) Reset() { *m = Member{} } -func (m *Member) String() string { return proto.CompactTextString(m) } -func (*Member) ProtoMessage() {} -func (*Member) Descriptor() ([]byte, []int) { - return fileDescriptor_949fe0d019050ef5, []int{2} -} -func (m *Member) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Member) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Member.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Member) XXX_Merge(src proto.Message) { - xxx_messageInfo_Member.Merge(m, src) -} -func (m *Member) XXX_Size() int { - return m.Size() -} -func (m *Member) XXX_DiscardUnknown() { - xxx_messageInfo_Member.DiscardUnknown(m) -} - -var xxx_messageInfo_Member proto.InternalMessageInfo - -type ClusterVersionSetRequest struct { - Ver string `protobuf:"bytes,1,opt,name=ver,proto3" json:"ver,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ClusterVersionSetRequest) Reset() { *m = ClusterVersionSetRequest{} } -func (m *ClusterVersionSetRequest) String() string { return proto.CompactTextString(m) } -func (*ClusterVersionSetRequest) ProtoMessage() {} -func (*ClusterVersionSetRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_949fe0d019050ef5, []int{3} -} -func (m *ClusterVersionSetRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ClusterVersionSetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ClusterVersionSetRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ClusterVersionSetRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClusterVersionSetRequest.Merge(m, src) -} -func (m *ClusterVersionSetRequest) XXX_Size() int { - return m.Size() -} -func (m *ClusterVersionSetRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ClusterVersionSetRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ClusterVersionSetRequest proto.InternalMessageInfo - -type ClusterMemberAttrSetRequest struct { - Member_ID uint64 `protobuf:"varint,1,opt,name=member_ID,json=memberID,proto3" json:"member_ID,omitempty"` - MemberAttributes *Attributes `protobuf:"bytes,2,opt,name=member_attributes,json=memberAttributes,proto3" json:"member_attributes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ClusterMemberAttrSetRequest) Reset() { *m = ClusterMemberAttrSetRequest{} } -func (m *ClusterMemberAttrSetRequest) String() string { return proto.CompactTextString(m) } -func (*ClusterMemberAttrSetRequest) ProtoMessage() {} -func (*ClusterMemberAttrSetRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_949fe0d019050ef5, []int{4} -} -func (m *ClusterMemberAttrSetRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ClusterMemberAttrSetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ClusterMemberAttrSetRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ClusterMemberAttrSetRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClusterMemberAttrSetRequest.Merge(m, src) -} -func (m *ClusterMemberAttrSetRequest) XXX_Size() int { - return m.Size() -} -func (m *ClusterMemberAttrSetRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ClusterMemberAttrSetRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ClusterMemberAttrSetRequest proto.InternalMessageInfo - -type DowngradeInfoSetRequest struct { - Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` - Ver string `protobuf:"bytes,2,opt,name=ver,proto3" json:"ver,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DowngradeInfoSetRequest) Reset() { *m = DowngradeInfoSetRequest{} } -func (m *DowngradeInfoSetRequest) String() string { return proto.CompactTextString(m) } -func (*DowngradeInfoSetRequest) ProtoMessage() {} -func (*DowngradeInfoSetRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_949fe0d019050ef5, []int{5} -} -func (m *DowngradeInfoSetRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DowngradeInfoSetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DowngradeInfoSetRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DowngradeInfoSetRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DowngradeInfoSetRequest.Merge(m, src) -} -func (m *DowngradeInfoSetRequest) XXX_Size() int { - return m.Size() -} -func (m *DowngradeInfoSetRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DowngradeInfoSetRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DowngradeInfoSetRequest proto.InternalMessageInfo - -func init() { - proto.RegisterType((*RaftAttributes)(nil), "membershippb.RaftAttributes") - proto.RegisterType((*Attributes)(nil), "membershippb.Attributes") - proto.RegisterType((*Member)(nil), "membershippb.Member") - proto.RegisterType((*ClusterVersionSetRequest)(nil), "membershippb.ClusterVersionSetRequest") - proto.RegisterType((*ClusterMemberAttrSetRequest)(nil), "membershippb.ClusterMemberAttrSetRequest") - proto.RegisterType((*DowngradeInfoSetRequest)(nil), "membershippb.DowngradeInfoSetRequest") -} - -func init() { proto.RegisterFile("membership.proto", fileDescriptor_949fe0d019050ef5) } - -var fileDescriptor_949fe0d019050ef5 = []byte{ - // 367 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xc1, 0x4e, 0xf2, 0x40, - 0x14, 0x85, 0x99, 0x42, 0xf8, 0xdb, 0xcb, 0x1f, 0xc4, 0x09, 0x89, 0x8d, 0x68, 0x25, 0x5d, 0xb1, - 0x30, 0x98, 0xe8, 0x13, 0xa0, 0xb0, 0x20, 0x81, 0xcd, 0x18, 0xdd, 0x92, 0x56, 0x2e, 0xd8, 0xa4, - 0x74, 0xea, 0xcc, 0x54, 0xd7, 0xbe, 0x85, 0x4f, 0xe0, 0xb3, 0xb0, 0xf4, 0x11, 0x14, 0x5f, 0xc4, - 0x74, 0x5a, 0x4a, 0x49, 0xdc, 0xb8, 0xbb, 0x3d, 0xbd, 0xf7, 0x9c, 0xf3, 0x35, 0x85, 0xd6, 0x0a, -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 0x2a, 0xda, 0x82, 0xea, 0x33, 0x8a, 0x1c, 0x3c, - 0x1d, 0xdd, 0x57, 0x02, 0x9d, 0x7c, 0x7d, 0x5a, 0x38, 0x95, 0x2e, 0x3a, 0x60, 0xe5, 0xa5, 0x0a, - 0x64, 0x33, 0x13, 0x34, 0xf8, 0x2f, 0x8d, 0x8d, 0x3f, 0x37, 0x1e, 0xc1, 0xd1, 0x90, 0xbf, 0x44, - 0x4b, 0xe1, 0xcd, 0x71, 0x1c, 0x2d, 0x78, 0x29, 0xde, 0x86, 0x7f, 0x18, 0x79, 0x7e, 0x88, 0x73, - 0x1d, 0x6e, 0xb2, 0xed, 0xe3, 0x16, 0xc5, 0x28, 0x50, 0xae, 0xdb, 0xeb, 0x2f, 0xa7, 0xb2, 0xde, - 0x38, 0xe4, 0x63, 0xe3, 0x90, 0xcf, 0x8d, 0x43, 0xde, 0xbe, 0x9d, 0x8a, 0x5f, 0xd7, 0xff, 0xd3, - 0xd5, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdc, 0x93, 0x7d, 0x0b, 0x87, 0x02, 0x00, 0x00, -} - -func (m *RaftAttributes) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RaftAttributes) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RaftAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.IsLearner { - i-- - if m.IsLearner { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(m.PeerUrls) > 0 { - for iNdEx := len(m.PeerUrls) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.PeerUrls[iNdEx]) - copy(dAtA[i:], m.PeerUrls[iNdEx]) - i = encodeVarintMembership(dAtA, i, uint64(len(m.PeerUrls[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Attributes) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Attributes) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Attributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.ClientUrls) > 0 { - for iNdEx := len(m.ClientUrls) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ClientUrls[iNdEx]) - copy(dAtA[i:], m.ClientUrls[iNdEx]) - i = encodeVarintMembership(dAtA, i, uint64(len(m.ClientUrls[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintMembership(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Member) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Member) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Member) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.MemberAttributes != nil { - { - size, err := m.MemberAttributes.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMembership(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.RaftAttributes != nil { - { - size, err := m.RaftAttributes.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMembership(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.ID != 0 { - i = encodeVarintMembership(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ClusterVersionSetRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ClusterVersionSetRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ClusterVersionSetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Ver) > 0 { - i -= len(m.Ver) - copy(dAtA[i:], m.Ver) - i = encodeVarintMembership(dAtA, i, uint64(len(m.Ver))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ClusterMemberAttrSetRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ClusterMemberAttrSetRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ClusterMemberAttrSetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.MemberAttributes != nil { - { - size, err := m.MemberAttributes.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMembership(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Member_ID != 0 { - i = encodeVarintMembership(dAtA, i, uint64(m.Member_ID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *DowngradeInfoSetRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DowngradeInfoSetRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DowngradeInfoSetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Ver) > 0 { - i -= len(m.Ver) - copy(dAtA[i:], m.Ver) - i = encodeVarintMembership(dAtA, i, uint64(len(m.Ver))) - i-- - dAtA[i] = 0x12 - } - if m.Enabled { - i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintMembership(dAtA []byte, offset int, v uint64) int { - offset -= sovMembership(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *RaftAttributes) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.PeerUrls) > 0 { - for _, s := range m.PeerUrls { - l = len(s) - n += 1 + l + sovMembership(uint64(l)) - } - } - if m.IsLearner { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Attributes) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovMembership(uint64(l)) - } - if len(m.ClientUrls) > 0 { - for _, s := range m.ClientUrls { - l = len(s) - n += 1 + l + sovMembership(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Member) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ID != 0 { - n += 1 + sovMembership(uint64(m.ID)) - } - if m.RaftAttributes != nil { - l = m.RaftAttributes.Size() - n += 1 + l + sovMembership(uint64(l)) - } - if m.MemberAttributes != nil { - l = m.MemberAttributes.Size() - n += 1 + l + sovMembership(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ClusterVersionSetRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Ver) - if l > 0 { - n += 1 + l + sovMembership(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ClusterMemberAttrSetRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Member_ID != 0 { - n += 1 + sovMembership(uint64(m.Member_ID)) - } - if m.MemberAttributes != nil { - l = m.MemberAttributes.Size() - n += 1 + l + sovMembership(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *DowngradeInfoSetRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Enabled { - n += 2 - } - l = len(m.Ver) - if l > 0 { - n += 1 + l + sovMembership(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovMembership(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozMembership(x uint64) (n int) { - return sovMembership(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *RaftAttributes) 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 ErrIntOverflowMembership - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RaftAttributes: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RaftAttributes: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeerUrls", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMembership - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMembership - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMembership - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PeerUrls = append(m.PeerUrls, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsLearner", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMembership - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsLearner = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipMembership(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMembership - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Attributes) 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 ErrIntOverflowMembership - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Attributes: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Attributes: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMembership - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMembership - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMembership - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientUrls", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMembership - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMembership - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMembership - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientUrls = append(m.ClientUrls, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMembership(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMembership - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Member) 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 ErrIntOverflowMembership - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Member: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Member: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMembership - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftAttributes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMembership - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMembership - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMembership - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.RaftAttributes == nil { - m.RaftAttributes = &RaftAttributes{} - } - if err := m.RaftAttributes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MemberAttributes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMembership - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMembership - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMembership - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MemberAttributes == nil { - m.MemberAttributes = &Attributes{} - } - if err := m.MemberAttributes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMembership(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMembership - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ClusterVersionSetRequest) 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 ErrIntOverflowMembership - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ClusterVersionSetRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ClusterVersionSetRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ver", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMembership - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMembership - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMembership - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Ver = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMembership(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMembership - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ClusterMemberAttrSetRequest) 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 ErrIntOverflowMembership - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ClusterMemberAttrSetRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ClusterMemberAttrSetRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Member_ID", wireType) - } - m.Member_ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMembership - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Member_ID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MemberAttributes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMembership - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMembership - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMembership - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MemberAttributes == nil { - m.MemberAttributes = &Attributes{} - } - if err := m.MemberAttributes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMembership(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMembership - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DowngradeInfoSetRequest) 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 ErrIntOverflowMembership - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DowngradeInfoSetRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DowngradeInfoSetRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMembership - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Enabled = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ver", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMembership - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMembership - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMembership - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Ver = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMembership(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMembership - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipMembership(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMembership - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMembership - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMembership - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthMembership - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupMembership - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthMembership - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthMembership = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowMembership = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupMembership = fmt.Errorf("proto: unexpected end of group") -) diff --git a/e2e/vendor/go.etcd.io/etcd/api/v3/membershippb/membership.proto b/e2e/vendor/go.etcd.io/etcd/api/v3/membershippb/membership.proto deleted file mode 100644 index e63e9ecc9..000000000 --- a/e2e/vendor/go.etcd.io/etcd/api/v3/membershippb/membership.proto +++ /dev/null @@ -1,43 +0,0 @@ -syntax = "proto3"; -package membershippb; - -import "gogoproto/gogo.proto"; - -option (gogoproto.marshaler_all) = true; -option (gogoproto.sizer_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; - -// RaftAttributes represents the raft related attributes of an etcd member. -message RaftAttributes { - // peerURLs is the list of peers in the raft cluster. - repeated string peer_urls = 1; - // isLearner indicates if the member is raft learner. - bool is_learner = 2; -} - -// Attributes represents all the non-raft related attributes of an etcd member. -message Attributes { - string name = 1; - repeated string client_urls = 2; -} - -message Member { - uint64 ID = 1; - RaftAttributes raft_attributes = 2; - Attributes member_attributes = 3; -} - -message ClusterVersionSetRequest { - string ver = 1; -} - -message ClusterMemberAttrSetRequest { - uint64 member_ID = 1; - Attributes member_attributes = 2; -} - -message DowngradeInfoSetRequest { - bool enabled = 1; - string ver = 2; -} \ No newline at end of file diff --git a/e2e/vendor/go.etcd.io/etcd/api/v3/mvccpb/kv.pb.go b/e2e/vendor/go.etcd.io/etcd/api/v3/mvccpb/kv.pb.go deleted file mode 100644 index fc258d6c2..000000000 --- a/e2e/vendor/go.etcd.io/etcd/api/v3/mvccpb/kv.pb.go +++ /dev/null @@ -1,798 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: kv.proto - -package mvccpb - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/golang/protobuf/proto" -) - -// 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. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type Event_EventType int32 - -const ( - PUT Event_EventType = 0 - DELETE Event_EventType = 1 -) - -var Event_EventType_name = map[int32]string{ - 0: "PUT", - 1: "DELETE", -} - -var Event_EventType_value = map[string]int32{ - "PUT": 0, - "DELETE": 1, -} - -func (x Event_EventType) String() string { - return proto.EnumName(Event_EventType_name, int32(x)) -} - -func (Event_EventType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_2216fe83c9c12408, []int{1, 0} -} - -type KeyValue struct { - // key is the key in bytes. An empty key is not allowed. - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // create_revision is the revision of last creation on this key. - CreateRevision int64 `protobuf:"varint,2,opt,name=create_revision,json=createRevision,proto3" json:"create_revision,omitempty"` - // mod_revision is the revision of last modification on this key. - ModRevision int64 `protobuf:"varint,3,opt,name=mod_revision,json=modRevision,proto3" json:"mod_revision,omitempty"` - // version is the version of the key. A deletion resets - // the version to zero and any modification of the key - // increases its version. - Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"` - // value is the value held by the key, in bytes. - Value []byte `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` - // lease is the ID of the lease that attached to key. - // When the attached lease expires, the key will be deleted. - // If lease is 0, then no lease is attached to the key. - Lease int64 `protobuf:"varint,6,opt,name=lease,proto3" json:"lease,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *KeyValue) Reset() { *m = KeyValue{} } -func (m *KeyValue) String() string { return proto.CompactTextString(m) } -func (*KeyValue) ProtoMessage() {} -func (*KeyValue) Descriptor() ([]byte, []int) { - return fileDescriptor_2216fe83c9c12408, []int{0} -} -func (m *KeyValue) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *KeyValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_KeyValue.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *KeyValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_KeyValue.Merge(m, src) -} -func (m *KeyValue) XXX_Size() int { - return m.Size() -} -func (m *KeyValue) XXX_DiscardUnknown() { - xxx_messageInfo_KeyValue.DiscardUnknown(m) -} - -var xxx_messageInfo_KeyValue proto.InternalMessageInfo - -type Event struct { - // type is the kind of event. If type is a PUT, it indicates - // new data has been stored to the key. If type is a DELETE, - // it indicates the key was deleted. - Type Event_EventType `protobuf:"varint,1,opt,name=type,proto3,enum=mvccpb.Event_EventType" json:"type,omitempty"` - // kv holds the KeyValue for the event. - // A PUT event contains current kv pair. - // A PUT event with kv.Version=1 indicates the creation of a key. - // A DELETE/EXPIRE event contains the deleted key with - // its modification revision set to the revision of deletion. - Kv *KeyValue `protobuf:"bytes,2,opt,name=kv,proto3" json:"kv,omitempty"` - // prev_kv holds the key-value pair before the event happens. - PrevKv *KeyValue `protobuf:"bytes,3,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Event) Reset() { *m = Event{} } -func (m *Event) String() string { return proto.CompactTextString(m) } -func (*Event) ProtoMessage() {} -func (*Event) Descriptor() ([]byte, []int) { - return fileDescriptor_2216fe83c9c12408, []int{1} -} -func (m *Event) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Event.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Event) XXX_Merge(src proto.Message) { - xxx_messageInfo_Event.Merge(m, src) -} -func (m *Event) XXX_Size() int { - return m.Size() -} -func (m *Event) XXX_DiscardUnknown() { - xxx_messageInfo_Event.DiscardUnknown(m) -} - -var xxx_messageInfo_Event proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("mvccpb.Event_EventType", Event_EventType_name, Event_EventType_value) - proto.RegisterType((*KeyValue)(nil), "mvccpb.KeyValue") - proto.RegisterType((*Event)(nil), "mvccpb.Event") -} - -func init() { proto.RegisterFile("kv.proto", fileDescriptor_2216fe83c9c12408) } - -var fileDescriptor_2216fe83c9c12408 = []byte{ - // 303 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0x41, 0x4e, 0xc2, 0x40, - 0x14, 0x86, 0x3b, 0x14, 0x0a, 0x3e, 0x08, 0x36, 0x13, 0x12, 0x27, 0x2e, 0x26, 0x95, 0x8d, 0x18, - 0x13, 0x4c, 0xf0, 0x06, 0xc6, 0xae, 0x70, 0x61, 0x1a, 0x74, 0x4b, 0x4a, 0x79, 0x21, 0xa4, 0x94, - 0x69, 0x4a, 0x9d, 0xa4, 0x37, 0x71, 0xef, 0xde, 0x73, 0xb0, 0xe4, 0x08, 0x52, 0x2f, 0x62, 0xfa, - 0xc6, 0xe2, 0xc6, 0xcd, 0xe4, 0xfd, 0xff, 0xff, 0x65, 0xe6, 0x7f, 0x03, 0x9d, 0x58, 0x8f, 0xd3, - 0x4c, 0xe5, 0x8a, 0x3b, 0x89, 0x8e, 0xa2, 0x74, 0x71, 0x39, 0x58, 0xa9, 0x95, 0x22, 0xeb, 0xae, - 0x9a, 0x4c, 0x3a, 0xfc, 0x64, 0xd0, 0x99, 0x62, 0xf1, 0x1a, 0x6e, 0xde, 0x90, 0xbb, 0x60, 0xc7, - 0x58, 0x08, 0xe6, 0xb1, 0x51, 0x2f, 0xa8, 0x46, 0x7e, 0x0d, 0xe7, 0x51, 0x86, 0x61, 0x8e, 0xf3, - 0x0c, 0xf5, 0x7a, 0xb7, 0x56, 0x5b, 0xd1, 0xf0, 0xd8, 0xc8, 0x0e, 0xfa, 0xc6, 0x0e, 0x7e, 0x5d, - 0x7e, 0x05, 0xbd, 0x44, 0x2d, 0xff, 0x28, 0x9b, 0xa8, 0x6e, 0xa2, 0x96, 0x27, 0x44, 0x40, 0x5b, - 0x63, 0x46, 0x69, 0x93, 0xd2, 0x5a, 0xf2, 0x01, 0xb4, 0x74, 0x55, 0x40, 0xb4, 0xe8, 0x65, 0x23, - 0x2a, 0x77, 0x83, 0xe1, 0x0e, 0x85, 0x43, 0xb4, 0x11, 0xc3, 0x0f, 0x06, 0x2d, 0x5f, 0xe3, 0x36, - 0xe7, 0xb7, 0xd0, 0xcc, 0x8b, 0x14, 0xa9, 0x6e, 0x7f, 0x72, 0x31, 0x36, 0x7b, 0x8e, 0x29, 0x34, - 0xe7, 0xac, 0x48, 0x31, 0x20, 0x88, 0x7b, 0xd0, 0x88, 0x35, 0x75, 0xef, 0x4e, 0xdc, 0x1a, 0xad, - 0x17, 0x0f, 0x1a, 0xb1, 0xe6, 0x37, 0xd0, 0x4e, 0x33, 0xd4, 0xf3, 0x58, 0x53, 0xf9, 0xff, 0x30, - 0xa7, 0x02, 0xa6, 0x7a, 0xe8, 0xc1, 0xd9, 0xe9, 0x7e, 0xde, 0x06, 0xfb, 0xf9, 0x65, 0xe6, 0x5a, - 0x1c, 0xc0, 0x79, 0xf4, 0x9f, 0xfc, 0x99, 0xef, 0xb2, 0x07, 0xb1, 0x3f, 0x4a, 0xeb, 0x70, 0x94, - 0xd6, 0xbe, 0x94, 0xec, 0x50, 0x4a, 0xf6, 0x55, 0x4a, 0xf6, 0xfe, 0x2d, 0xad, 0x85, 0x43, 0xff, - 0x7e, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x45, 0x92, 0x5d, 0xa1, 0x01, 0x00, 0x00, -} - -func (m *KeyValue) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *KeyValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *KeyValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Lease != 0 { - i = encodeVarintKv(dAtA, i, uint64(m.Lease)) - i-- - dAtA[i] = 0x30 - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintKv(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x2a - } - if m.Version != 0 { - i = encodeVarintKv(dAtA, i, uint64(m.Version)) - i-- - dAtA[i] = 0x20 - } - if m.ModRevision != 0 { - i = encodeVarintKv(dAtA, i, uint64(m.ModRevision)) - i-- - dAtA[i] = 0x18 - } - if m.CreateRevision != 0 { - i = encodeVarintKv(dAtA, i, uint64(m.CreateRevision)) - i-- - dAtA[i] = 0x10 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintKv(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Event) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Event) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.PrevKv != nil { - { - size, err := m.PrevKv.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintKv(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Kv != nil { - { - size, err := m.Kv.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintKv(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Type != 0 { - i = encodeVarintKv(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintKv(dAtA []byte, offset int, v uint64) int { - offset -= sovKv(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *KeyValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovKv(uint64(l)) - } - if m.CreateRevision != 0 { - n += 1 + sovKv(uint64(m.CreateRevision)) - } - if m.ModRevision != 0 { - n += 1 + sovKv(uint64(m.ModRevision)) - } - if m.Version != 0 { - n += 1 + sovKv(uint64(m.Version)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovKv(uint64(l)) - } - if m.Lease != 0 { - n += 1 + sovKv(uint64(m.Lease)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Event) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovKv(uint64(m.Type)) - } - if m.Kv != nil { - l = m.Kv.Size() - n += 1 + l + sovKv(uint64(l)) - } - if m.PrevKv != nil { - l = m.PrevKv.Size() - n += 1 + l + sovKv(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovKv(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozKv(x uint64) (n int) { - return sovKv(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: 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 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthKv - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthKv - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CreateRevision", wireType) - } - m.CreateRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CreateRevision |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ModRevision", wireType) - } - m.ModRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ModRevision |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - m.Version = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Version |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - 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 ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthKv - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthKv - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType) - } - m.Lease = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Lease |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipKv(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthKv - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: 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 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= Event_EventType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kv", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthKv - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthKv - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Kv == nil { - m.Kv = &KeyValue{} - } - if err := m.Kv.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthKv - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthKv - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PrevKv == nil { - m.PrevKv = &KeyValue{} - } - if err := m.PrevKv.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipKv(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthKv - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipKv(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - 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 - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowKv - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowKv - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthKv - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupKv - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthKv - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthKv = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowKv = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupKv = fmt.Errorf("proto: unexpected end of group") -) diff --git a/e2e/vendor/go.etcd.io/etcd/api/v3/mvccpb/kv.proto b/e2e/vendor/go.etcd.io/etcd/api/v3/mvccpb/kv.proto deleted file mode 100644 index 23c911b7d..000000000 --- a/e2e/vendor/go.etcd.io/etcd/api/v3/mvccpb/kv.proto +++ /dev/null @@ -1,49 +0,0 @@ -syntax = "proto3"; -package mvccpb; - -import "gogoproto/gogo.proto"; - -option (gogoproto.marshaler_all) = true; -option (gogoproto.sizer_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; -option (gogoproto.goproto_enum_prefix_all) = false; - -message KeyValue { - // key is the key in bytes. An empty key is not allowed. - bytes key = 1; - // create_revision is the revision of last creation on this key. - int64 create_revision = 2; - // mod_revision is the revision of last modification on this key. - int64 mod_revision = 3; - // version is the version of the key. A deletion resets - // the version to zero and any modification of the key - // increases its version. - int64 version = 4; - // value is the value held by the key, in bytes. - bytes value = 5; - // lease is the ID of the lease that attached to key. - // When the attached lease expires, the key will be deleted. - // If lease is 0, then no lease is attached to the key. - int64 lease = 6; -} - -message Event { - enum EventType { - PUT = 0; - DELETE = 1; - } - // type is the kind of event. If type is a PUT, it indicates - // new data has been stored to the key. If type is a DELETE, - // it indicates the key was deleted. - EventType type = 1; - // kv holds the KeyValue for the event. - // A PUT event contains current kv pair. - // A PUT event with kv.Version=1 indicates the creation of a key. - // A DELETE/EXPIRE event contains the deleted key with - // its modification revision set to the revision of deletion. - KeyValue kv = 2; - - // prev_kv holds the key-value pair before the event happens. - KeyValue prev_kv = 3; -} diff --git a/e2e/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/doc.go b/e2e/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/doc.go deleted file mode 100644 index f72c6a644..000000000 --- a/e2e/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/doc.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package rpctypes has types and values shared by the etcd server and client for v3 RPC interaction. -package rpctypes diff --git a/e2e/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/error.go b/e2e/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/error.go deleted file mode 100644 index 23201302e..000000000 --- a/e2e/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/error.go +++ /dev/null @@ -1,267 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rpctypes - -import ( - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -// server-side error -var ( - ErrGRPCEmptyKey = status.New(codes.InvalidArgument, "etcdserver: key is not provided").Err() - ErrGRPCKeyNotFound = status.New(codes.InvalidArgument, "etcdserver: key not found").Err() - ErrGRPCValueProvided = status.New(codes.InvalidArgument, "etcdserver: value is provided").Err() - ErrGRPCLeaseProvided = status.New(codes.InvalidArgument, "etcdserver: lease is provided").Err() - ErrGRPCTooManyOps = status.New(codes.InvalidArgument, "etcdserver: too many operations in txn request").Err() - ErrGRPCDuplicateKey = status.New(codes.InvalidArgument, "etcdserver: duplicate key given in txn request").Err() - ErrGRPCCompacted = status.New(codes.OutOfRange, "etcdserver: mvcc: required revision has been compacted").Err() - ErrGRPCFutureRev = status.New(codes.OutOfRange, "etcdserver: mvcc: required revision is a future revision").Err() - ErrGRPCNoSpace = status.New(codes.ResourceExhausted, "etcdserver: mvcc: database space exceeded").Err() - - ErrGRPCLeaseNotFound = status.New(codes.NotFound, "etcdserver: requested lease not found").Err() - ErrGRPCLeaseExist = status.New(codes.FailedPrecondition, "etcdserver: lease already exists").Err() - ErrGRPCLeaseTTLTooLarge = status.New(codes.OutOfRange, "etcdserver: too large lease TTL").Err() - - ErrGRPCWatchCanceled = status.New(codes.Canceled, "etcdserver: watch canceled").Err() - - ErrGRPCMemberExist = status.New(codes.FailedPrecondition, "etcdserver: member ID already exist").Err() - ErrGRPCPeerURLExist = status.New(codes.FailedPrecondition, "etcdserver: Peer URLs already exists").Err() - ErrGRPCMemberNotEnoughStarted = status.New(codes.FailedPrecondition, "etcdserver: re-configuration failed due to not enough started members").Err() - ErrGRPCMemberBadURLs = status.New(codes.InvalidArgument, "etcdserver: given member URLs are invalid").Err() - ErrGRPCMemberNotFound = status.New(codes.NotFound, "etcdserver: member not found").Err() - ErrGRPCMemberNotLearner = status.New(codes.FailedPrecondition, "etcdserver: can only promote a learner member").Err() - ErrGRPCLearnerNotReady = status.New(codes.FailedPrecondition, "etcdserver: can only promote a learner member which is in sync with leader").Err() - ErrGRPCTooManyLearners = status.New(codes.FailedPrecondition, "etcdserver: too many learner members in cluster").Err() - ErrGRPCClusterIdMismatch = status.New(codes.FailedPrecondition, "etcdserver: cluster ID mismatch").Err() - - ErrGRPCRequestTooLarge = status.New(codes.InvalidArgument, "etcdserver: request is too large").Err() - ErrGRPCRequestTooManyRequests = status.New(codes.ResourceExhausted, "etcdserver: too many requests").Err() - - ErrGRPCRootUserNotExist = status.New(codes.FailedPrecondition, "etcdserver: root user does not exist").Err() - ErrGRPCRootRoleNotExist = status.New(codes.FailedPrecondition, "etcdserver: root user does not have root role").Err() - ErrGRPCUserAlreadyExist = status.New(codes.FailedPrecondition, "etcdserver: user name already exists").Err() - ErrGRPCUserEmpty = status.New(codes.InvalidArgument, "etcdserver: user name is empty").Err() - ErrGRPCUserNotFound = status.New(codes.FailedPrecondition, "etcdserver: user name not found").Err() - ErrGRPCRoleAlreadyExist = status.New(codes.FailedPrecondition, "etcdserver: role name already exists").Err() - ErrGRPCRoleNotFound = status.New(codes.FailedPrecondition, "etcdserver: role name not found").Err() - ErrGRPCRoleEmpty = status.New(codes.InvalidArgument, "etcdserver: role name is empty").Err() - ErrGRPCAuthFailed = status.New(codes.InvalidArgument, "etcdserver: authentication failed, invalid user ID or password").Err() - ErrGRPCPermissionNotGiven = status.New(codes.InvalidArgument, "etcdserver: permission not given").Err() - ErrGRPCPermissionDenied = status.New(codes.PermissionDenied, "etcdserver: permission denied").Err() - ErrGRPCRoleNotGranted = status.New(codes.FailedPrecondition, "etcdserver: role is not granted to the user").Err() - ErrGRPCPermissionNotGranted = status.New(codes.FailedPrecondition, "etcdserver: permission is not granted to the role").Err() - ErrGRPCAuthNotEnabled = status.New(codes.FailedPrecondition, "etcdserver: authentication is not enabled").Err() - ErrGRPCInvalidAuthToken = status.New(codes.Unauthenticated, "etcdserver: invalid auth token").Err() - ErrGRPCInvalidAuthMgmt = status.New(codes.InvalidArgument, "etcdserver: invalid auth management").Err() - ErrGRPCAuthOldRevision = status.New(codes.InvalidArgument, "etcdserver: revision of auth store is old").Err() - - ErrGRPCNoLeader = status.New(codes.Unavailable, "etcdserver: no leader").Err() - ErrGRPCNotLeader = status.New(codes.FailedPrecondition, "etcdserver: not leader").Err() - ErrGRPCLeaderChanged = status.New(codes.Unavailable, "etcdserver: leader changed").Err() - ErrGRPCNotCapable = status.New(codes.Unavailable, "etcdserver: not capable").Err() - ErrGRPCStopped = status.New(codes.Unavailable, "etcdserver: server stopped").Err() - ErrGRPCTimeout = status.New(codes.Unavailable, "etcdserver: request timed out").Err() - ErrGRPCTimeoutDueToLeaderFail = status.New(codes.Unavailable, "etcdserver: request timed out, possibly due to previous leader failure").Err() - ErrGRPCTimeoutDueToConnectionLost = status.New(codes.Unavailable, "etcdserver: request timed out, possibly due to connection lost").Err() - ErrGRPCTimeoutWaitAppliedIndex = status.New(codes.Unavailable, "etcdserver: request timed out, waiting for the applied index took too long").Err() - ErrGRPCUnhealthy = status.New(codes.Unavailable, "etcdserver: unhealthy cluster").Err() - ErrGRPCCorrupt = status.New(codes.DataLoss, "etcdserver: corrupt cluster").Err() - ErrGPRCNotSupportedForLearner = status.New(codes.Unavailable, "etcdserver: rpc not supported for learner").Err() - ErrGRPCBadLeaderTransferee = status.New(codes.FailedPrecondition, "etcdserver: bad leader transferee").Err() - - ErrGRPCClusterVersionUnavailable = status.New(codes.Unavailable, "etcdserver: cluster version not found during downgrade").Err() - ErrGRPCWrongDowngradeVersionFormat = status.New(codes.InvalidArgument, "etcdserver: wrong downgrade target version format").Err() - ErrGRPCInvalidDowngradeTargetVersion = status.New(codes.InvalidArgument, "etcdserver: invalid downgrade target version").Err() - ErrGRPCDowngradeInProcess = status.New(codes.FailedPrecondition, "etcdserver: cluster has a downgrade job in progress").Err() - ErrGRPCNoInflightDowngrade = status.New(codes.FailedPrecondition, "etcdserver: no inflight downgrade job").Err() - - ErrGRPCCanceled = status.New(codes.Canceled, "etcdserver: request canceled").Err() - ErrGRPCDeadlineExceeded = status.New(codes.DeadlineExceeded, "etcdserver: context deadline exceeded").Err() - - errStringToError = map[string]error{ - ErrorDesc(ErrGRPCEmptyKey): ErrGRPCEmptyKey, - ErrorDesc(ErrGRPCKeyNotFound): ErrGRPCKeyNotFound, - ErrorDesc(ErrGRPCValueProvided): ErrGRPCValueProvided, - ErrorDesc(ErrGRPCLeaseProvided): ErrGRPCLeaseProvided, - - ErrorDesc(ErrGRPCTooManyOps): ErrGRPCTooManyOps, - ErrorDesc(ErrGRPCDuplicateKey): ErrGRPCDuplicateKey, - ErrorDesc(ErrGRPCCompacted): ErrGRPCCompacted, - ErrorDesc(ErrGRPCFutureRev): ErrGRPCFutureRev, - ErrorDesc(ErrGRPCNoSpace): ErrGRPCNoSpace, - - ErrorDesc(ErrGRPCLeaseNotFound): ErrGRPCLeaseNotFound, - ErrorDesc(ErrGRPCLeaseExist): ErrGRPCLeaseExist, - ErrorDesc(ErrGRPCLeaseTTLTooLarge): ErrGRPCLeaseTTLTooLarge, - - ErrorDesc(ErrGRPCMemberExist): ErrGRPCMemberExist, - ErrorDesc(ErrGRPCPeerURLExist): ErrGRPCPeerURLExist, - ErrorDesc(ErrGRPCMemberNotEnoughStarted): ErrGRPCMemberNotEnoughStarted, - ErrorDesc(ErrGRPCMemberBadURLs): ErrGRPCMemberBadURLs, - ErrorDesc(ErrGRPCMemberNotFound): ErrGRPCMemberNotFound, - ErrorDesc(ErrGRPCMemberNotLearner): ErrGRPCMemberNotLearner, - ErrorDesc(ErrGRPCLearnerNotReady): ErrGRPCLearnerNotReady, - ErrorDesc(ErrGRPCTooManyLearners): ErrGRPCTooManyLearners, - ErrorDesc(ErrGRPCClusterIdMismatch): ErrGRPCClusterIdMismatch, - - ErrorDesc(ErrGRPCRequestTooLarge): ErrGRPCRequestTooLarge, - ErrorDesc(ErrGRPCRequestTooManyRequests): ErrGRPCRequestTooManyRequests, - - ErrorDesc(ErrGRPCRootUserNotExist): ErrGRPCRootUserNotExist, - ErrorDesc(ErrGRPCRootRoleNotExist): ErrGRPCRootRoleNotExist, - ErrorDesc(ErrGRPCUserAlreadyExist): ErrGRPCUserAlreadyExist, - ErrorDesc(ErrGRPCUserEmpty): ErrGRPCUserEmpty, - ErrorDesc(ErrGRPCUserNotFound): ErrGRPCUserNotFound, - ErrorDesc(ErrGRPCRoleAlreadyExist): ErrGRPCRoleAlreadyExist, - ErrorDesc(ErrGRPCRoleNotFound): ErrGRPCRoleNotFound, - ErrorDesc(ErrGRPCRoleEmpty): ErrGRPCRoleEmpty, - ErrorDesc(ErrGRPCAuthFailed): ErrGRPCAuthFailed, - ErrorDesc(ErrGRPCPermissionDenied): ErrGRPCPermissionDenied, - ErrorDesc(ErrGRPCRoleNotGranted): ErrGRPCRoleNotGranted, - ErrorDesc(ErrGRPCPermissionNotGranted): ErrGRPCPermissionNotGranted, - ErrorDesc(ErrGRPCAuthNotEnabled): ErrGRPCAuthNotEnabled, - ErrorDesc(ErrGRPCInvalidAuthToken): ErrGRPCInvalidAuthToken, - ErrorDesc(ErrGRPCInvalidAuthMgmt): ErrGRPCInvalidAuthMgmt, - ErrorDesc(ErrGRPCAuthOldRevision): ErrGRPCAuthOldRevision, - - ErrorDesc(ErrGRPCNoLeader): ErrGRPCNoLeader, - ErrorDesc(ErrGRPCNotLeader): ErrGRPCNotLeader, - ErrorDesc(ErrGRPCLeaderChanged): ErrGRPCLeaderChanged, - ErrorDesc(ErrGRPCNotCapable): ErrGRPCNotCapable, - ErrorDesc(ErrGRPCStopped): ErrGRPCStopped, - ErrorDesc(ErrGRPCTimeout): ErrGRPCTimeout, - ErrorDesc(ErrGRPCTimeoutDueToLeaderFail): ErrGRPCTimeoutDueToLeaderFail, - ErrorDesc(ErrGRPCTimeoutDueToConnectionLost): ErrGRPCTimeoutDueToConnectionLost, - ErrorDesc(ErrGRPCUnhealthy): ErrGRPCUnhealthy, - ErrorDesc(ErrGRPCCorrupt): ErrGRPCCorrupt, - ErrorDesc(ErrGPRCNotSupportedForLearner): ErrGPRCNotSupportedForLearner, - ErrorDesc(ErrGRPCBadLeaderTransferee): ErrGRPCBadLeaderTransferee, - - ErrorDesc(ErrGRPCClusterVersionUnavailable): ErrGRPCClusterVersionUnavailable, - ErrorDesc(ErrGRPCWrongDowngradeVersionFormat): ErrGRPCWrongDowngradeVersionFormat, - ErrorDesc(ErrGRPCInvalidDowngradeTargetVersion): ErrGRPCInvalidDowngradeTargetVersion, - ErrorDesc(ErrGRPCDowngradeInProcess): ErrGRPCDowngradeInProcess, - ErrorDesc(ErrGRPCNoInflightDowngrade): ErrGRPCNoInflightDowngrade, - } -) - -// client-side error -var ( - ErrEmptyKey = Error(ErrGRPCEmptyKey) - ErrKeyNotFound = Error(ErrGRPCKeyNotFound) - ErrValueProvided = Error(ErrGRPCValueProvided) - ErrLeaseProvided = Error(ErrGRPCLeaseProvided) - ErrTooManyOps = Error(ErrGRPCTooManyOps) - ErrDuplicateKey = Error(ErrGRPCDuplicateKey) - ErrCompacted = Error(ErrGRPCCompacted) - ErrFutureRev = Error(ErrGRPCFutureRev) - ErrNoSpace = Error(ErrGRPCNoSpace) - - ErrLeaseNotFound = Error(ErrGRPCLeaseNotFound) - ErrLeaseExist = Error(ErrGRPCLeaseExist) - ErrLeaseTTLTooLarge = Error(ErrGRPCLeaseTTLTooLarge) - - ErrMemberExist = Error(ErrGRPCMemberExist) - ErrPeerURLExist = Error(ErrGRPCPeerURLExist) - ErrMemberNotEnoughStarted = Error(ErrGRPCMemberNotEnoughStarted) - ErrMemberBadURLs = Error(ErrGRPCMemberBadURLs) - ErrMemberNotFound = Error(ErrGRPCMemberNotFound) - ErrMemberNotLearner = Error(ErrGRPCMemberNotLearner) - ErrMemberLearnerNotReady = Error(ErrGRPCLearnerNotReady) - ErrTooManyLearners = Error(ErrGRPCTooManyLearners) - - ErrRequestTooLarge = Error(ErrGRPCRequestTooLarge) - ErrTooManyRequests = Error(ErrGRPCRequestTooManyRequests) - - ErrRootUserNotExist = Error(ErrGRPCRootUserNotExist) - ErrRootRoleNotExist = Error(ErrGRPCRootRoleNotExist) - ErrUserAlreadyExist = Error(ErrGRPCUserAlreadyExist) - ErrUserEmpty = Error(ErrGRPCUserEmpty) - ErrUserNotFound = Error(ErrGRPCUserNotFound) - ErrRoleAlreadyExist = Error(ErrGRPCRoleAlreadyExist) - ErrRoleNotFound = Error(ErrGRPCRoleNotFound) - ErrRoleEmpty = Error(ErrGRPCRoleEmpty) - ErrAuthFailed = Error(ErrGRPCAuthFailed) - ErrPermissionDenied = Error(ErrGRPCPermissionDenied) - ErrRoleNotGranted = Error(ErrGRPCRoleNotGranted) - ErrPermissionNotGranted = Error(ErrGRPCPermissionNotGranted) - ErrAuthNotEnabled = Error(ErrGRPCAuthNotEnabled) - ErrInvalidAuthToken = Error(ErrGRPCInvalidAuthToken) - ErrAuthOldRevision = Error(ErrGRPCAuthOldRevision) - ErrInvalidAuthMgmt = Error(ErrGRPCInvalidAuthMgmt) - ErrClusterIdMismatch = Error(ErrGRPCClusterIdMismatch) - - ErrNoLeader = Error(ErrGRPCNoLeader) - ErrNotLeader = Error(ErrGRPCNotLeader) - ErrLeaderChanged = Error(ErrGRPCLeaderChanged) - ErrNotCapable = Error(ErrGRPCNotCapable) - ErrStopped = Error(ErrGRPCStopped) - ErrTimeout = Error(ErrGRPCTimeout) - ErrTimeoutDueToLeaderFail = Error(ErrGRPCTimeoutDueToLeaderFail) - ErrTimeoutDueToConnectionLost = Error(ErrGRPCTimeoutDueToConnectionLost) - ErrTimeoutWaitAppliedIndex = Error(ErrGRPCTimeoutWaitAppliedIndex) - ErrUnhealthy = Error(ErrGRPCUnhealthy) - ErrCorrupt = Error(ErrGRPCCorrupt) - ErrBadLeaderTransferee = Error(ErrGRPCBadLeaderTransferee) - - ErrClusterVersionUnavailable = Error(ErrGRPCClusterVersionUnavailable) - ErrWrongDowngradeVersionFormat = Error(ErrGRPCWrongDowngradeVersionFormat) - ErrInvalidDowngradeTargetVersion = Error(ErrGRPCInvalidDowngradeTargetVersion) - ErrDowngradeInProcess = Error(ErrGRPCDowngradeInProcess) - ErrNoInflightDowngrade = Error(ErrGRPCNoInflightDowngrade) -) - -// EtcdError defines gRPC server errors. -// (https://github.com/grpc/grpc-go/blob/master/rpc_util.go#L319-L323) -type EtcdError struct { - code codes.Code - desc string -} - -// Code returns grpc/codes.Code. -// TODO: define clientv3/codes.Code. -func (e EtcdError) Code() codes.Code { - return e.code -} - -func (e EtcdError) Error() string { - return e.desc -} - -func Error(err error) error { - if err == nil { - return nil - } - verr, ok := errStringToError[ErrorDesc(err)] - if !ok { // not gRPC error - return err - } - ev, ok := status.FromError(verr) - var desc string - if ok { - desc = ev.Message() - } else { - desc = verr.Error() - } - return EtcdError{code: ev.Code(), desc: desc} -} - -func ErrorDesc(err error) string { - if s, ok := status.FromError(err); ok { - return s.Message() - } - return err.Error() -} diff --git a/e2e/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/md.go b/e2e/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/md.go deleted file mode 100644 index 90b8b835b..000000000 --- a/e2e/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/md.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rpctypes - -var ( - MetadataRequireLeaderKey = "hasleader" - MetadataHasLeader = "true" - - MetadataClientAPIVersionKey = "client-api-version" -) diff --git a/e2e/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/metadatafields.go b/e2e/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/metadatafields.go deleted file mode 100644 index 8f8ac60ff..000000000 --- a/e2e/vendor/go.etcd.io/etcd/api/v3/v3rpc/rpctypes/metadatafields.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rpctypes - -var ( - TokenFieldNameGRPC = "token" - TokenFieldNameSwagger = "authorization" -) diff --git a/e2e/vendor/go.etcd.io/etcd/api/v3/version/version.go b/e2e/vendor/go.etcd.io/etcd/api/v3/version/version.go deleted file mode 100644 index 03449b523..000000000 --- a/e2e/vendor/go.etcd.io/etcd/api/v3/version/version.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package version implements etcd version parsing and contains latest version -// information. -package version - -import ( - "fmt" - "strings" - - "github.com/coreos/go-semver/semver" -) - -var ( - // MinClusterVersion is the min cluster version this etcd binary is compatible with. - MinClusterVersion = "3.0.0" - Version = "3.5.21" - APIVersion = "unknown" - - // Git SHA Value will be set during build - GitSHA = "Not provided (use ./build instead of go build)" -) - -func init() { - ver, err := semver.NewVersion(Version) - if err == nil { - APIVersion = fmt.Sprintf("%d.%d", ver.Major, ver.Minor) - } -} - -type Versions struct { - Server string `json:"etcdserver"` - Cluster string `json:"etcdcluster"` - // TODO: raft state machine version -} - -// Cluster only keeps the major.minor. -func Cluster(v string) string { - vs := strings.Split(v, ".") - if len(vs) <= 2 { - return v - } - return fmt.Sprintf("%s.%s", vs[0], vs[1]) -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/LICENSE b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/dir_unix.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/dir_unix.go deleted file mode 100644 index ca82f765c..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/dir_unix.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build !windows -// +build !windows - -package fileutil - -import "os" - -const ( - // PrivateDirMode grants owner to make/remove files inside the directory. - PrivateDirMode = 0700 -) - -// OpenDir opens a directory for syncing. -func OpenDir(path string) (*os.File, error) { return os.Open(path) } diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/dir_windows.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/dir_windows.go deleted file mode 100644 index 849c63c87..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/dir_windows.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build windows -// +build windows - -package fileutil - -import ( - "os" - "syscall" -) - -const ( - // PrivateDirMode grants owner to make/remove files inside the directory. - PrivateDirMode = 0777 -) - -// OpenDir opens a directory in windows with write access for syncing. -func OpenDir(path string) (*os.File, error) { - fd, err := openDir(path) - if err != nil { - return nil, err - } - return os.NewFile(uintptr(fd), path), nil -} - -func openDir(path string) (fd syscall.Handle, err error) { - if len(path) == 0 { - return syscall.InvalidHandle, syscall.ERROR_FILE_NOT_FOUND - } - pathp, err := syscall.UTF16PtrFromString(path) - if err != nil { - return syscall.InvalidHandle, err - } - access := uint32(syscall.GENERIC_READ | syscall.GENERIC_WRITE) - sharemode := uint32(syscall.FILE_SHARE_READ | syscall.FILE_SHARE_WRITE) - createmode := uint32(syscall.OPEN_EXISTING) - fl := uint32(syscall.FILE_FLAG_BACKUP_SEMANTICS) - return syscall.CreateFile(pathp, access, sharemode, nil, createmode, fl, 0) -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/doc.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/doc.go deleted file mode 100644 index 69dde5a7d..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/doc.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package fileutil implements utility functions related to files and paths. -package fileutil diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/filereader.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/filereader.go deleted file mode 100644 index 55248888c..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/filereader.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2022 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package fileutil - -import ( - "bufio" - "io" - "io/fs" - "os" -) - -// FileReader is a wrapper of io.Reader. It also provides file info. -type FileReader interface { - io.Reader - FileInfo() (fs.FileInfo, error) -} - -type fileReader struct { - *os.File -} - -func NewFileReader(f *os.File) FileReader { - return &fileReader{f} -} - -func (fr *fileReader) FileInfo() (fs.FileInfo, error) { - return fr.Stat() -} - -// FileBufReader is a wrapper of bufio.Reader. It also provides file info. -type FileBufReader struct { - *bufio.Reader - fi fs.FileInfo -} - -func NewFileBufReader(fr FileReader) *FileBufReader { - bufReader := bufio.NewReader(fr) - fi, err := fr.FileInfo() - if err != nil { - // This should never happen. - panic(err) - } - return &FileBufReader{bufReader, fi} -} - -func (fbr *FileBufReader) FileInfo() fs.FileInfo { - return fbr.fi -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/fileutil.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/fileutil.go deleted file mode 100644 index d31ece3e2..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/fileutil.go +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package fileutil - -import ( - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - - "go.uber.org/zap" -) - -const ( - // PrivateFileMode grants owner to read/write a file. - PrivateFileMode = 0600 -) - -// IsDirWriteable checks if dir is writable by writing and removing a file -// to dir. It returns nil if dir is writable. -func IsDirWriteable(dir string) error { - f, err := filepath.Abs(filepath.Join(dir, ".touch")) - if err != nil { - return err - } - if err := ioutil.WriteFile(f, []byte(""), PrivateFileMode); err != nil { - return err - } - return os.Remove(f) -} - -// TouchDirAll is similar 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(lg *zap.Logger, dir string) error { - // If path is already a directory, MkdirAll does nothing and returns nil, so, - // first check if dir exist with an expected permission mode. - if Exist(dir) { - err := CheckDirPermission(dir, PrivateDirMode) - if err != nil { - lg.Warn("check file permission", zap.Error(err)) - } - } else { - err := os.MkdirAll(dir, PrivateDirMode) - if err != nil { - // if mkdirAll("a/text") and "text" is not - // a directory, this will return syscall.ENOTDIR - return err - } - } - - return IsDirWriteable(dir) -} - -// CreateDirAll is similar to TouchDirAll but returns error -// if the deepest directory was not empty. -func CreateDirAll(lg *zap.Logger, dir string) error { - err := TouchDirAll(lg, dir) - if err == nil { - var ns []string - ns, err = ReadDir(dir) - if err != nil { - return err - } - if len(ns) != 0 { - err = fmt.Errorf("expected %q to be empty, got %q", dir, ns) - } - } - return err -} - -// Exist returns true if a file or directory exists. -func Exist(name string) bool { - _, err := os.Stat(name) - return err == nil -} - -// DirEmpty returns true if a directory empty and can access. -func DirEmpty(name string) bool { - ns, err := ReadDir(name) - return len(ns) == 0 && err == nil -} - -// ZeroToEnd zeros a file starting from SEEK_CUR to its SEEK_END. May temporarily -// shorten the length of the file. -func ZeroToEnd(f *os.File) error { - // TODO: support FALLOC_FL_ZERO_RANGE - off, err := f.Seek(0, io.SeekCurrent) - if err != nil { - return err - } - lenf, lerr := f.Seek(0, io.SeekEnd) - if lerr != nil { - return lerr - } - if err = f.Truncate(off); err != nil { - return err - } - // make sure blocks remain allocated - if err = Preallocate(f, lenf, true); err != nil { - return err - } - _, err = f.Seek(off, io.SeekStart) - return err -} - -// CheckDirPermission checks permission on an existing dir. -// Returns error if dir is empty or exist with a different permission than specified. -func CheckDirPermission(dir string, perm os.FileMode) error { - if !Exist(dir) { - return fmt.Errorf("directory %q empty, cannot check permission", dir) - } - //check the existing permission on the directory - dirInfo, err := os.Stat(dir) - if err != nil { - return err - } - dirMode := dirInfo.Mode().Perm() - if dirMode != perm { - err = fmt.Errorf("directory %q exist, but the permission is %q. The recommended permission is %q to prevent possible unprivileged access to the data", dir, dirInfo.Mode(), os.FileMode(PrivateDirMode)) - return err - } - return nil -} - -// RemoveMatchFile deletes file if matchFunc is true on an existing dir -// Returns error if the dir does not exist or remove file fail -func RemoveMatchFile(lg *zap.Logger, dir string, matchFunc func(fileName string) bool) error { - if lg == nil { - lg = zap.NewNop() - } - if !Exist(dir) { - return fmt.Errorf("directory %s does not exist", dir) - } - fileNames, err := ReadDir(dir) - if err != nil { - return err - } - var removeFailedFiles []string - for _, fileName := range fileNames { - if matchFunc(fileName) { - file := filepath.Join(dir, fileName) - if err = os.Remove(file); err != nil { - removeFailedFiles = append(removeFailedFiles, fileName) - lg.Error("remove file failed", - zap.String("file", file), - zap.Error(err)) - continue - } - } - } - if len(removeFailedFiles) != 0 { - return fmt.Errorf("remove file(s) %v error", removeFailedFiles) - } - return nil -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock.go deleted file mode 100644 index 338627f43..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package fileutil - -import ( - "errors" - "os" -) - -var ( - ErrLocked = errors.New("fileutil: file already locked") -) - -type LockedFile struct{ *os.File } diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_flock.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_flock.go deleted file mode 100644 index dcdf226cd..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_flock.go +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build !windows && !plan9 && !solaris -// +build !windows,!plan9,!solaris - -package fileutil - -import ( - "os" - "syscall" -) - -func flockTryLockFile(path string, flag int, perm os.FileMode) (*LockedFile, error) { - f, err := os.OpenFile(path, flag, perm) - if err != nil { - return nil, err - } - if err = syscall.Flock(int(f.Fd()), syscall.LOCK_EX|syscall.LOCK_NB); err != nil { - f.Close() - if err == syscall.EWOULDBLOCK { - err = ErrLocked - } - return nil, err - } - return &LockedFile{f}, nil -} - -func flockLockFile(path string, flag int, perm os.FileMode) (*LockedFile, error) { - f, err := os.OpenFile(path, flag, perm) - if err != nil { - return nil, err - } - if err = syscall.Flock(int(f.Fd()), syscall.LOCK_EX); err != nil { - f.Close() - return nil, err - } - return &LockedFile{f}, err -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_linux.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_linux.go deleted file mode 100644 index d8952cc48..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_linux.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build linux -// +build linux - -package fileutil - -import ( - "fmt" - "io" - "os" - "syscall" - - "golang.org/x/sys/unix" -) - -// This used to call syscall.Flock() but that call fails with EBADF on NFS. -// An alternative is lockf() which works on NFS but that call lets a process lock -// the same file twice. Instead, use Linux's non-standard open file descriptor -// locks which will block if the process already holds the file lock. - -var ( - wrlck = syscall.Flock_t{ - Type: syscall.F_WRLCK, - Whence: int16(io.SeekStart), - Start: 0, - Len: 0, - } - - linuxTryLockFile = flockTryLockFile - linuxLockFile = flockLockFile -) - -func init() { - // use open file descriptor locks if the system supports it - getlk := syscall.Flock_t{Type: syscall.F_RDLCK} - if err := syscall.FcntlFlock(0, unix.F_OFD_GETLK, &getlk); err == nil { - linuxTryLockFile = ofdTryLockFile - linuxLockFile = ofdLockFile - } -} - -func TryLockFile(path string, flag int, perm os.FileMode) (*LockedFile, error) { - return linuxTryLockFile(path, flag, perm) -} - -func ofdTryLockFile(path string, flag int, perm os.FileMode) (*LockedFile, error) { - f, err := os.OpenFile(path, flag, perm) - if err != nil { - return nil, fmt.Errorf("ofdTryLockFile failed to open %q (%v)", path, err) - } - - flock := wrlck - if err = syscall.FcntlFlock(f.Fd(), unix.F_OFD_SETLK, &flock); err != nil { - f.Close() - if err == syscall.EWOULDBLOCK { - err = ErrLocked - } - return nil, err - } - return &LockedFile{f}, nil -} - -func LockFile(path string, flag int, perm os.FileMode) (*LockedFile, error) { - return linuxLockFile(path, flag, perm) -} - -func ofdLockFile(path string, flag int, perm os.FileMode) (*LockedFile, error) { - f, err := os.OpenFile(path, flag, perm) - if err != nil { - return nil, fmt.Errorf("ofdLockFile failed to open %q (%v)", path, err) - } - - flock := wrlck - err = syscall.FcntlFlock(f.Fd(), unix.F_OFD_SETLKW, &flock) - if err != nil { - f.Close() - return nil, err - } - return &LockedFile{f}, nil -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_plan9.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_plan9.go deleted file mode 100644 index fee6a7c8f..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_plan9.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package fileutil - -import ( - "os" - "syscall" - "time" -) - -func TryLockFile(path string, flag int, perm os.FileMode) (*LockedFile, error) { - if err := os.Chmod(path, syscall.DMEXCL|PrivateFileMode); err != nil { - return nil, err - } - f, err := os.Open(path, flag, perm) - if err != nil { - return nil, ErrLocked - } - return &LockedFile{f}, nil -} - -func LockFile(path string, flag int, perm os.FileMode) (*LockedFile, error) { - if err := os.Chmod(path, syscall.DMEXCL|PrivateFileMode); err != nil { - return nil, err - } - for { - f, err := os.OpenFile(path, flag, perm) - if err == nil { - return &LockedFile{f}, nil - } - time.Sleep(10 * time.Millisecond) - } -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_solaris.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_solaris.go deleted file mode 100644 index 683cc1db9..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_solaris.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build solaris -// +build solaris - -package fileutil - -import ( - "os" - "syscall" -) - -func TryLockFile(path string, flag int, perm os.FileMode) (*LockedFile, error) { - var lock syscall.Flock_t - lock.Start = 0 - lock.Len = 0 - lock.Pid = 0 - lock.Type = syscall.F_WRLCK - lock.Whence = 0 - lock.Pid = 0 - f, err := os.OpenFile(path, flag, perm) - if err != nil { - return nil, err - } - if err := syscall.FcntlFlock(f.Fd(), syscall.F_SETLK, &lock); err != nil { - f.Close() - if err == syscall.EAGAIN { - err = ErrLocked - } - return nil, err - } - return &LockedFile{f}, nil -} - -func LockFile(path string, flag int, perm os.FileMode) (*LockedFile, error) { - var lock syscall.Flock_t - lock.Start = 0 - lock.Len = 0 - lock.Pid = 0 - lock.Type = syscall.F_WRLCK - lock.Whence = 0 - f, err := os.OpenFile(path, flag, perm) - if err != nil { - return nil, err - } - if err = syscall.FcntlFlock(f.Fd(), syscall.F_SETLKW, &lock); err != nil { - f.Close() - return nil, err - } - return &LockedFile{f}, nil -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_unix.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_unix.go deleted file mode 100644 index d89027e1f..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_unix.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build !windows && !plan9 && !solaris && !linux -// +build !windows,!plan9,!solaris,!linux - -package fileutil - -import ( - "os" -) - -func TryLockFile(path string, flag int, perm os.FileMode) (*LockedFile, error) { - return flockTryLockFile(path, flag, perm) -} - -func LockFile(path string, flag int, perm os.FileMode) (*LockedFile, error) { - return flockLockFile(path, flag, perm) -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_windows.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_windows.go deleted file mode 100644 index 5cbf2bc3d..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/lock_windows.go +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build windows -// +build windows - -package fileutil - -import ( - "errors" - "fmt" - "os" - "syscall" - "unsafe" -) - -var ( - modkernel32 = syscall.NewLazyDLL("kernel32.dll") - procLockFileEx = modkernel32.NewProc("LockFileEx") - - errLocked = errors.New("the process cannot access the file because another process has locked a portion of the file") -) - -const ( - // https://msdn.microsoft.com/en-us/library/windows/desktop/aa365203(v=vs.85).aspx - LOCKFILE_EXCLUSIVE_LOCK = 2 - LOCKFILE_FAIL_IMMEDIATELY = 1 - - // see https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx - errLockViolation syscall.Errno = 0x21 -) - -func TryLockFile(path string, flag int, perm os.FileMode) (*LockedFile, error) { - f, err := open(path, flag, perm) - if err != nil { - return nil, err - } - if err := lockFile(syscall.Handle(f.Fd()), LOCKFILE_FAIL_IMMEDIATELY); err != nil { - f.Close() - return nil, err - } - return &LockedFile{f}, nil -} - -func LockFile(path string, flag int, perm os.FileMode) (*LockedFile, error) { - f, err := open(path, flag, perm) - if err != nil { - return nil, err - } - if err := lockFile(syscall.Handle(f.Fd()), 0); err != nil { - f.Close() - return nil, err - } - return &LockedFile{f}, nil -} - -func open(path string, flag int, perm os.FileMode) (*os.File, error) { - if path == "" { - return nil, fmt.Errorf("cannot open empty filename") - } - var access uint32 - switch flag { - case syscall.O_RDONLY: - access = syscall.GENERIC_READ - case syscall.O_WRONLY: - access = syscall.GENERIC_WRITE - case syscall.O_RDWR: - access = syscall.GENERIC_READ | syscall.GENERIC_WRITE - case syscall.O_WRONLY | syscall.O_CREAT: - access = syscall.GENERIC_ALL - default: - panic(fmt.Errorf("flag %v is not supported", flag)) - } - fd, err := syscall.CreateFile(&(syscall.StringToUTF16(path)[0]), - access, - syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE|syscall.FILE_SHARE_DELETE, - nil, - syscall.OPEN_ALWAYS, - syscall.FILE_ATTRIBUTE_NORMAL, - 0) - if err != nil { - return nil, err - } - return os.NewFile(uintptr(fd), path), nil -} - -func lockFile(fd syscall.Handle, flags uint32) error { - var flag uint32 = LOCKFILE_EXCLUSIVE_LOCK - flag |= flags - if fd == syscall.InvalidHandle { - return nil - } - err := lockFileEx(fd, flag, 1, 0, &syscall.Overlapped{}) - if err == nil { - return nil - } else if err.Error() == errLocked.Error() { - return ErrLocked - } else if err != errLockViolation { - return err - } - return nil -} - -func lockFileEx(h syscall.Handle, flags, locklow, lockhigh uint32, ol *syscall.Overlapped) (err error) { - var reserved uint32 = 0 - r1, _, e1 := syscall.Syscall6(procLockFileEx.Addr(), 6, uintptr(h), uintptr(flags), uintptr(reserved), uintptr(locklow), uintptr(lockhigh), uintptr(unsafe.Pointer(ol))) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return err -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate.go deleted file mode 100644 index c747b7cf8..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package fileutil - -import ( - "io" - "os" -) - -// Preallocate tries to allocate the space for given -// file. This operation is only supported on linux by a -// few filesystems (btrfs, ext4, etc.). -// If the operation is unsupported, no error will be returned. -// Otherwise, the error encountered will be returned. -func Preallocate(f *os.File, sizeInBytes int64, extendFile bool) error { - if sizeInBytes == 0 { - // fallocate will return EINVAL if length is 0; skip - return nil - } - if extendFile { - return preallocExtend(f, sizeInBytes) - } - return preallocFixed(f, sizeInBytes) -} - -func preallocExtendTrunc(f *os.File, sizeInBytes int64) error { - curOff, err := f.Seek(0, io.SeekCurrent) - if err != nil { - return err - } - size, err := f.Seek(sizeInBytes, io.SeekEnd) - if err != nil { - return err - } - if _, err = f.Seek(curOff, io.SeekStart); err != nil { - return err - } - if sizeInBytes > size { - return nil - } - return f.Truncate(sizeInBytes) -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_darwin.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_darwin.go deleted file mode 100644 index caab143dd..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_darwin.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build darwin -// +build darwin - -package fileutil - -import ( - "os" - "syscall" - - "golang.org/x/sys/unix" -) - -func preallocExtend(f *os.File, sizeInBytes int64) error { - if err := preallocFixed(f, sizeInBytes); err != nil { - return err - } - return preallocExtendTrunc(f, sizeInBytes) -} - -func preallocFixed(f *os.File, sizeInBytes int64) error { - // allocate all requested space or no space at all - // TODO: allocate contiguous space on disk with F_ALLOCATECONTIG flag - fstore := &unix.Fstore_t{ - Flags: unix.F_ALLOCATEALL, - Posmode: unix.F_PEOFPOSMODE, - Length: sizeInBytes, - } - err := unix.FcntlFstore(f.Fd(), unix.F_PREALLOCATE, fstore) - if err == nil || err == unix.ENOTSUP { - return nil - } - - // wrong argument to fallocate syscall - if err == unix.EINVAL { - // filesystem "st_blocks" are allocated in the units of - // "Allocation Block Size" (run "diskutil info /" command) - var stat syscall.Stat_t - syscall.Fstat(int(f.Fd()), &stat) - - // syscall.Statfs_t.Bsize is "optimal transfer block size" - // and contains matching 4096 value when latest OS X kernel - // supports 4,096 KB filesystem block size - var statfs syscall.Statfs_t - syscall.Fstatfs(int(f.Fd()), &statfs) - blockSize := int64(statfs.Bsize) - - if stat.Blocks*blockSize >= sizeInBytes { - // enough blocks are already allocated - return nil - } - } - return err -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_unix.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_unix.go deleted file mode 100644 index ebb8207c3..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/preallocate_unix.go +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build linux -// +build linux - -package fileutil - -import ( - "os" - "syscall" -) - -func preallocExtend(f *os.File, sizeInBytes int64) error { - // use mode = 0 to change size - err := syscall.Fallocate(int(f.Fd()), 0, 0, sizeInBytes) - if err != nil { - errno, ok := err.(syscall.Errno) - // not supported; fallback - // fallocate EINTRs frequently in some environments; fallback - if ok && (errno == syscall.ENOTSUP || errno == syscall.EINTR) { - return preallocExtendTrunc(f, sizeInBytes) - } - } - return err -} - -func preallocFixed(f *os.File, sizeInBytes int64) error { - // use mode = 1 to keep size; see FALLOC_FL_KEEP_SIZE - err := syscall.Fallocate(int(f.Fd()), 1, 0, sizeInBytes) - if err != nil { - errno, ok := err.(syscall.Errno) - // treat not supported as nil error - if ok && errno == syscall.ENOTSUP { - return nil - } - } - return err -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/purge.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/purge.go deleted file mode 100644 index b314e068f..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/purge.go +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package fileutil - -import ( - "os" - "path/filepath" - "sort" - "strings" - "time" - - "go.uber.org/zap" -) - -func PurgeFile(lg *zap.Logger, dirname string, suffix string, max uint, interval time.Duration, stop <-chan struct{}) <-chan error { - return purgeFile(lg, dirname, suffix, max, interval, stop, nil, nil, true) -} - -func PurgeFileWithDoneNotify(lg *zap.Logger, dirname string, suffix string, max uint, interval time.Duration, stop <-chan struct{}) (<-chan struct{}, <-chan error) { - doneC := make(chan struct{}) - errC := purgeFile(lg, dirname, suffix, max, interval, stop, nil, doneC, true) - return doneC, errC -} - -func PurgeFileWithoutFlock(lg *zap.Logger, dirname string, suffix string, max uint, interval time.Duration, stop <-chan struct{}) (<-chan struct{}, <-chan error) { - doneC := make(chan struct{}) - errC := purgeFile(lg, dirname, suffix, max, interval, stop, nil, doneC, false) - return doneC, errC -} - -// purgeFile is the internal implementation for PurgeFile which can post purged files to purgec if non-nil. -// if donec is non-nil, the function closes it to notify its exit. -func purgeFile(lg *zap.Logger, dirname string, suffix string, max uint, interval time.Duration, stop <-chan struct{}, purgec chan<- string, donec chan<- struct{}, flock bool) <-chan error { - if lg == nil { - lg = zap.NewNop() - } - errC := make(chan error, 1) - lg.Info("started to purge file", - zap.String("dir", dirname), - zap.String("suffix", suffix), - zap.Uint("max", max), - zap.Duration("interval", interval)) - - go func() { - if donec != nil { - defer close(donec) - } - for { - fnames, err := ReadDir(dirname) - if err != nil { - errC <- err - return - } - newfnames := make([]string, 0) - for _, fname := range fnames { - if strings.HasSuffix(fname, suffix) { - newfnames = append(newfnames, fname) - } - } - sort.Strings(newfnames) - fnames = newfnames - for len(newfnames) > int(max) { - f := filepath.Join(dirname, newfnames[0]) - var l *LockedFile - if flock { - l, err = TryLockFile(f, os.O_WRONLY, PrivateFileMode) - if err != nil { - lg.Warn("failed to lock file", zap.String("path", f), zap.Error(err)) - break - } - } - if err = os.Remove(f); err != nil { - lg.Error("failed to remove file", zap.String("path", f), zap.Error(err)) - errC <- err - return - } - if flock { - if err = l.Close(); err != nil { - lg.Error("failed to unlock/close", zap.String("path", l.Name()), zap.Error(err)) - errC <- err - return - } - } - lg.Info("purged", zap.String("path", f)) - newfnames = newfnames[1:] - } - if purgec != nil { - for i := 0; i < len(fnames)-len(newfnames); i++ { - purgec <- fnames[i] - } - } - select { - case <-time.After(interval): - case <-stop: - return - } - } - }() - return errC -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/read_dir.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/read_dir.go deleted file mode 100644 index 2eeaa89bc..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/read_dir.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package fileutil - -import ( - "os" - "path/filepath" - "sort" -) - -// ReadDirOp represents an read-directory operation. -type ReadDirOp struct { - ext string -} - -// ReadDirOption configures archiver operations. -type ReadDirOption func(*ReadDirOp) - -// WithExt filters file names by their extensions. -// (e.g. WithExt(".wal") to list only WAL files) -func WithExt(ext string) ReadDirOption { - return func(op *ReadDirOp) { op.ext = ext } -} - -func (op *ReadDirOp) applyOpts(opts []ReadDirOption) { - for _, opt := range opts { - opt(op) - } -} - -// ReadDir returns the filenames in the given directory in sorted order. -func ReadDir(d string, opts ...ReadDirOption) ([]string, error) { - op := &ReadDirOp{} - op.applyOpts(opts) - - dir, err := os.Open(d) - if err != nil { - return nil, err - } - defer dir.Close() - - names, err := dir.Readdirnames(-1) - if err != nil { - return nil, err - } - sort.Strings(names) - - if op.ext != "" { - tss := make([]string, 0) - for _, v := range names { - if filepath.Ext(v) == op.ext { - tss = append(tss, v) - } - } - names = tss - } - return names, nil -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync.go deleted file mode 100644 index 0a0855309..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build !linux && !darwin -// +build !linux,!darwin - -package fileutil - -import "os" - -// Fsync is a wrapper around file.Sync(). Special handling is needed on darwin platform. -func Fsync(f *os.File) error { - return f.Sync() -} - -// Fdatasync is a wrapper around file.Sync(). Special handling is needed on linux platform. -func Fdatasync(f *os.File) error { - return f.Sync() -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync_darwin.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync_darwin.go deleted file mode 100644 index 1923b276e..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync_darwin.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build darwin -// +build darwin - -package fileutil - -import ( - "os" - - "golang.org/x/sys/unix" -) - -// Fsync on HFS/OSX flushes the data on to the physical drive but the drive -// may not write it to the persistent media for quite sometime and it may be -// written in out-of-order sequence. Using F_FULLFSYNC ensures that the -// physical drive's buffer will also get flushed to the media. -func Fsync(f *os.File) error { - _, err := unix.FcntlInt(f.Fd(), unix.F_FULLFSYNC, 0) - return err -} - -// Fdatasync on darwin platform invokes fcntl(F_FULLFSYNC) for actual persistence -// on physical drive media. -func Fdatasync(f *os.File) error { - return Fsync(f) -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync_linux.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync_linux.go deleted file mode 100644 index b9398c23f..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/sync_linux.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build linux -// +build linux - -package fileutil - -import ( - "os" - "syscall" -) - -// Fsync is a wrapper around file.Sync(). Special handling is needed on darwin platform. -func Fsync(f *os.File) error { - return f.Sync() -} - -// Fdatasync is similar to fsync(), but does not flush modified metadata -// unless that metadata is needed in order to allow a subsequent data retrieval -// to be correctly handled. -func Fdatasync(f *os.File) error { - return syscall.Fdatasync(int(f.Fd())) -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/doc.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/doc.go deleted file mode 100644 index e919f2499..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/doc.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package logutil includes utilities to facilitate logging. -package logutil diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/log_level.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/log_level.go deleted file mode 100644 index 6c95bcfe9..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/log_level.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2019 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package logutil - -import ( - "go.uber.org/zap/zapcore" -) - -var DefaultLogLevel = "info" - -// ConvertToZapLevel converts log level string to zapcore.Level. -func ConvertToZapLevel(lvl string) zapcore.Level { - var level zapcore.Level - if err := level.Set(lvl); err != nil { - panic(err) - } - return level -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/zap.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/zap.go deleted file mode 100644 index f0f3739aa..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/zap.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2019 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package logutil - -import ( - "sort" - "time" - - "go.uber.org/zap" - "go.uber.org/zap/zapcore" -) - -// CreateDefaultZapLogger creates a logger with default zap configuration -func CreateDefaultZapLogger(level zapcore.Level) (*zap.Logger, error) { - lcfg := DefaultZapLoggerConfig - lcfg.Level = zap.NewAtomicLevelAt(level) - c, err := lcfg.Build() - if err != nil { - return nil, err - } - return c, nil -} - -// DefaultZapLoggerConfig defines default zap logger configuration. -var DefaultZapLoggerConfig = zap.Config{ - Level: zap.NewAtomicLevelAt(ConvertToZapLevel(DefaultLogLevel)), - - Development: false, - Sampling: &zap.SamplingConfig{ - Initial: 100, - Thereafter: 100, - }, - - Encoding: "json", - - // copied from "zap.NewProductionEncoderConfig" with some updates - EncoderConfig: zapcore.EncoderConfig{ - TimeKey: "ts", - LevelKey: "level", - NameKey: "logger", - CallerKey: "caller", - MessageKey: "msg", - StacktraceKey: "stacktrace", - LineEnding: zapcore.DefaultLineEnding, - EncodeLevel: zapcore.LowercaseLevelEncoder, - - // Custom EncodeTime function to ensure we match format and precision of historic capnslog timestamps - EncodeTime: func(t time.Time, enc zapcore.PrimitiveArrayEncoder) { - enc.AppendString(t.Format("2006-01-02T15:04:05.000000Z0700")) - }, - - EncodeDuration: zapcore.StringDurationEncoder, - EncodeCaller: zapcore.ShortCallerEncoder, - }, - - // Use "/dev/null" to discard all - OutputPaths: []string{"stderr"}, - ErrorOutputPaths: []string{"stderr"}, -} - -// MergeOutputPaths merges logging output paths, resolving conflicts. -func MergeOutputPaths(cfg zap.Config) zap.Config { - outputs := make(map[string]struct{}) - for _, v := range cfg.OutputPaths { - outputs[v] = struct{}{} - } - outputSlice := make([]string, 0) - if _, ok := outputs["/dev/null"]; ok { - // "/dev/null" to discard all - outputSlice = []string{"/dev/null"} - } else { - for k := range outputs { - outputSlice = append(outputSlice, k) - } - } - cfg.OutputPaths = outputSlice - sort.Strings(cfg.OutputPaths) - - errOutputs := make(map[string]struct{}) - for _, v := range cfg.ErrorOutputPaths { - errOutputs[v] = struct{}{} - } - errOutputSlice := make([]string, 0) - if _, ok := errOutputs["/dev/null"]; ok { - // "/dev/null" to discard all - errOutputSlice = []string{"/dev/null"} - } else { - for k := range errOutputs { - errOutputSlice = append(errOutputSlice, k) - } - } - cfg.ErrorOutputPaths = errOutputSlice - sort.Strings(cfg.ErrorOutputPaths) - - return cfg -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/zap_journal.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/zap_journal.go deleted file mode 100644 index 9daa3e0aa..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/logutil/zap_journal.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build !windows -// +build !windows - -package logutil - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "os" - "path/filepath" - - "go.etcd.io/etcd/client/pkg/v3/systemd" - - "github.com/coreos/go-systemd/v22/journal" - "go.uber.org/zap/zapcore" -) - -// NewJournalWriter wraps "io.Writer" to redirect log output -// to the local systemd journal. If journald send fails, it fails -// back to writing to the original writer. -// The decode overhead is only <30µs per write. -// Reference: https://github.com/coreos/pkg/blob/master/capnslog/journald_formatter.go -func NewJournalWriter(wr io.Writer) (io.Writer, error) { - return &journalWriter{Writer: wr}, systemd.DialJournal() -} - -type journalWriter struct { - io.Writer -} - -// WARN: assume that etcd uses default field names in zap encoder config -// make sure to keep this up-to-date! -type logLine struct { - Level string `json:"level"` - Caller string `json:"caller"` -} - -func (w *journalWriter) Write(p []byte) (int, error) { - line := &logLine{} - if err := json.NewDecoder(bytes.NewReader(p)).Decode(line); err != nil { - return 0, err - } - - var pri journal.Priority - switch line.Level { - case zapcore.DebugLevel.String(): - pri = journal.PriDebug - case zapcore.InfoLevel.String(): - pri = journal.PriInfo - - case zapcore.WarnLevel.String(): - pri = journal.PriWarning - case zapcore.ErrorLevel.String(): - pri = journal.PriErr - - case zapcore.DPanicLevel.String(): - pri = journal.PriCrit - case zapcore.PanicLevel.String(): - pri = journal.PriCrit - case zapcore.FatalLevel.String(): - pri = journal.PriCrit - - default: - panic(fmt.Errorf("unknown log level: %q", line.Level)) - } - - err := journal.Send(string(p), pri, map[string]string{ - "PACKAGE": filepath.Dir(line.Caller), - "SYSLOG_IDENTIFIER": filepath.Base(os.Args[0]), - }) - if err != nil { - // "journal" also falls back to stderr - // "fmt.Fprintln(os.Stderr, s)" - return w.Writer.Write(p) - } - return 0, nil -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/systemd/doc.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/systemd/doc.go deleted file mode 100644 index 30e77ce04..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/systemd/doc.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package systemd provides utility functions for systemd. -package systemd diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/systemd/journal.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/systemd/journal.go deleted file mode 100644 index 494ce372e..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/systemd/journal.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package systemd - -import "net" - -// DialJournal returns no error if the process can dial journal socket. -// Returns an error if dial failed, which indicates journald is not available -// (e.g. run embedded etcd as docker daemon). -// Reference: https://github.com/coreos/go-systemd/blob/master/journal/journal.go. -func DialJournal() error { - conn, err := net.Dial("unixgram", "/run/systemd/journal/socket") - if conn != nil { - defer conn.Close() - } - return err -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/cipher_suites.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/cipher_suites.go deleted file mode 100644 index e1f21755d..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/cipher_suites.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tlsutil - -import ( - "crypto/tls" - "fmt" -) - -// GetCipherSuite returns the corresponding cipher suite, -// and boolean value if it is supported. -func GetCipherSuite(s string) (uint16, bool) { - for _, c := range tls.CipherSuites() { - if s == c.Name { - return c.ID, true - } - } - for _, c := range tls.InsecureCipherSuites() { - if s == c.Name { - return c.ID, true - } - } - switch s { - case "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305": - return tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, true - case "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305": - return tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, true - } - return 0, false -} - -// GetCipherSuites returns list of corresponding cipher suite IDs. -func GetCipherSuites(ss []string) ([]uint16, error) { - cs := make([]uint16, len(ss)) - for i, s := range ss { - var ok bool - cs[i], ok = GetCipherSuite(s) - if !ok { - return nil, fmt.Errorf("unexpected TLS cipher suite %q", s) - } - } - - return cs, nil -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/doc.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/doc.go deleted file mode 100644 index 3b6aa670b..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/doc.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package tlsutil provides utility functions for handling TLS. -package tlsutil diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/tlsutil.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/tlsutil.go deleted file mode 100644 index 3a5aef089..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/tlsutil.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tlsutil - -import ( - "crypto/tls" - "crypto/x509" - "encoding/pem" - "io/ioutil" -) - -// NewCertPool creates x509 certPool with provided CA files. -func NewCertPool(CAFiles []string) (*x509.CertPool, error) { - certPool := x509.NewCertPool() - - for _, CAFile := range CAFiles { - pemByte, err := ioutil.ReadFile(CAFile) - if err != nil { - return nil, err - } - - for { - var block *pem.Block - block, pemByte = pem.Decode(pemByte) - if block == nil { - break - } - cert, err := x509.ParseCertificate(block.Bytes) - if err != nil { - return nil, err - } - - certPool.AddCert(cert) - } - } - - return certPool, nil -} - -// NewCert generates TLS cert by using the given cert,key and parse function. -func NewCert(certfile, keyfile string, parseFunc func([]byte, []byte) (tls.Certificate, error)) (*tls.Certificate, error) { - cert, err := ioutil.ReadFile(certfile) - if err != nil { - return nil, err - } - - key, err := ioutil.ReadFile(keyfile) - if err != nil { - return nil, err - } - - if parseFunc == nil { - parseFunc = tls.X509KeyPair - } - - tlsCert, err := parseFunc(cert, key) - if err != nil { - return nil, err - } - return &tlsCert, nil -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/versions.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/versions.go deleted file mode 100644 index ffcecd8c6..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/versions.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2023 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tlsutil - -import ( - "crypto/tls" - "fmt" -) - -type TLSVersion string - -// Constants for TLS versions. -const ( - TLSVersionDefault TLSVersion = "" - TLSVersion12 TLSVersion = "TLS1.2" - TLSVersion13 TLSVersion = "TLS1.3" -) - -// GetTLSVersion returns the corresponding tls.Version or error. -func GetTLSVersion(version string) (uint16, error) { - var v uint16 - - switch version { - case string(TLSVersionDefault): - v = 0 // 0 means let Go decide. - case string(TLSVersion12): - v = tls.VersionTLS12 - case string(TLSVersion13): - v = tls.VersionTLS13 - default: - return 0, fmt.Errorf("unexpected TLS version %q (must be one of: TLS1.2, TLS1.3)", version) - } - - return v, nil -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/doc.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/doc.go deleted file mode 100644 index 37658ce59..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package transport implements various HTTP transport utilities based on Go -// net package. -package transport diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener.go deleted file mode 100644 index d00a93dc1..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener.go +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package transport - -import ( - "crypto/tls" - "fmt" - "net" - "time" -) - -// 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 -// -// Note(ahrtr): -// only `net.TCPConn` supports `SetKeepAlive` and `SetKeepAlivePeriod` -// by default, so if you want to wrap multiple layers of net.Listener, -// the `keepaliveListener` should be the one which is closest to the -// original `net.Listener` implementation, namely `TCPListener`. -func NewKeepAliveListener(l net.Listener, scheme string, tlscfg *tls.Config) (net.Listener, error) { - kal := &keepaliveListener{ - Listener: l, - } - - if scheme == "https" { - if tlscfg == nil { - return nil, fmt.Errorf("cannot listen on TLS for given listener: KeyFile and CertFile are not presented") - } - return newTLSKeepaliveListener(kal, tlscfg), nil - } - - return kal, nil -} - -type keepaliveListener struct{ net.Listener } - -func (kln *keepaliveListener) Accept() (net.Conn, error) { - c, err := kln.Listener.Accept() - if err != nil { - return nil, err - } - - kac, err := createKeepaliveConn(c) - if err != nil { - return nil, fmt.Errorf("create keepalive connection failed, %w", err) - } - // detection time: tcp_keepalive_time + tcp_keepalive_probes + tcp_keepalive_intvl - // default on linux: 30 + 8 * 30 - // default on osx: 30 + 8 * 75 - if err := kac.SetKeepAlive(true); err != nil { - return nil, fmt.Errorf("SetKeepAlive failed, %w", err) - } - if err := kac.SetKeepAlivePeriod(30 * time.Second); err != nil { - return nil, fmt.Errorf("SetKeepAlivePeriod failed, %w", err) - } - return kac, nil -} - -func createKeepaliveConn(c net.Conn) (*keepAliveConn, error) { - tcpc, ok := c.(*net.TCPConn) - if !ok { - return nil, ErrNotTCP - } - return &keepAliveConn{tcpc}, nil -} - -type keepAliveConn struct { - *net.TCPConn -} - -// SetKeepAlive sets keepalive -func (l *keepAliveConn) SetKeepAlive(doKeepAlive bool) error { - return l.TCPConn.SetKeepAlive(doKeepAlive) -} - -// A tlsKeepaliveListener implements a network listener (net.Listener) for TLS connections. -type tlsKeepaliveListener struct { - net.Listener - config *tls.Config -} - -// Accept waits for and returns the next incoming TLS connection. -// The returned connection c is a *tls.Conn. -func (l *tlsKeepaliveListener) Accept() (c net.Conn, err error) { - c, err = l.Listener.Accept() - if err != nil { - return - } - c = tls.Server(c, l.config) - return c, nil -} - -// NewListener creates a Listener which accepts connections from an inner -// Listener and wraps each connection with Server. -// The configuration config must be non-nil and must have -// at least one certificate. -func newTLSKeepaliveListener(inner net.Listener, config *tls.Config) net.Listener { - l := &tlsKeepaliveListener{} - l.Listener = inner - l.config = config - return l -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener_openbsd.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener_openbsd.go deleted file mode 100644 index 024c6c236..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener_openbsd.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2023 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build openbsd - -package transport - -import "time" - -// SetKeepAlivePeriod sets keepalive period -func (l *keepAliveConn) SetKeepAlivePeriod(d time.Duration) error { - // OpenBSD has no user-settable per-socket TCP keepalive options. - // Refer to https://github.com/etcd-io/etcd/issues/15811. - return nil -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener_unix.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener_unix.go deleted file mode 100644 index 08061f726..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener_unix.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2023 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build !openbsd - -package transport - -import "time" - -// SetKeepAlivePeriod sets keepalive period -func (l *keepAliveConn) SetKeepAlivePeriod(d time.Duration) error { - return l.TCPConn.SetKeepAlivePeriod(d) -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/limit_listen.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/limit_listen.go deleted file mode 100644 index 404722ba7..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/limit_listen.go +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2013 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package transport 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 -} - -// SetKeepAlive sets keepalive -// -// Deprecated: use (*keepAliveConn) SetKeepAlive instead. -func (l *limitListenerConn) SetKeepAlive(doKeepAlive bool) error { - tcpc, ok := l.Conn.(*net.TCPConn) - if !ok { - return ErrNotTCP - } - return tcpc.SetKeepAlive(doKeepAlive) -} - -// SetKeepAlivePeriod sets keepalive period -// -// Deprecated: use (*keepAliveConn) SetKeepAlivePeriod instead. -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/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener.go deleted file mode 100644 index a7d37688d..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener.go +++ /dev/null @@ -1,638 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package transport - -import ( - "context" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rand" - "crypto/tls" - "crypto/x509" - "crypto/x509/pkix" - "encoding/pem" - "errors" - "fmt" - "math/big" - "net" - "os" - "path/filepath" - "strings" - "time" - - "go.etcd.io/etcd/client/pkg/v3/fileutil" - "go.etcd.io/etcd/client/pkg/v3/tlsutil" - - "go.uber.org/zap" -) - -// NewListener creates a new listner. -func NewListener(addr, scheme string, tlsinfo *TLSInfo) (l net.Listener, err error) { - return newListener(addr, scheme, WithTLSInfo(tlsinfo)) -} - -// NewListenerWithOpts creates a new listener which accpets listener options. -func NewListenerWithOpts(addr, scheme string, opts ...ListenerOption) (net.Listener, error) { - return newListener(addr, scheme, opts...) -} - -func newListener(addr, scheme string, opts ...ListenerOption) (net.Listener, error) { - if scheme == "unix" || scheme == "unixs" { - // unix sockets via unix://laddr - return NewUnixListener(addr) - } - - lnOpts := newListenOpts(opts...) - - switch { - case lnOpts.IsSocketOpts(): - // new ListenConfig with socket options. - config, err := newListenConfig(lnOpts.socketOpts) - if err != nil { - return nil, err - } - lnOpts.ListenConfig = config - // check for timeout - fallthrough - case lnOpts.IsTimeout(), lnOpts.IsSocketOpts(): - // timeout listener with socket options. - ln, err := newKeepAliveListener(&lnOpts.ListenConfig, addr) - if err != nil { - return nil, err - } - lnOpts.Listener = &rwTimeoutListener{ - Listener: ln, - readTimeout: lnOpts.readTimeout, - writeTimeout: lnOpts.writeTimeout, - } - case lnOpts.IsTimeout(): - ln, err := newKeepAliveListener(nil, addr) - if err != nil { - return nil, err - } - lnOpts.Listener = &rwTimeoutListener{ - Listener: ln, - readTimeout: lnOpts.readTimeout, - writeTimeout: lnOpts.writeTimeout, - } - default: - ln, err := newKeepAliveListener(nil, addr) - if err != nil { - return nil, err - } - lnOpts.Listener = ln - } - - // only skip if not passing TLSInfo - if lnOpts.skipTLSInfoCheck && !lnOpts.IsTLS() { - return lnOpts.Listener, nil - } - return wrapTLS(scheme, lnOpts.tlsInfo, lnOpts.Listener) -} - -func newKeepAliveListener(cfg *net.ListenConfig, addr string) (ln net.Listener, err error) { - if cfg != nil { - ln, err = cfg.Listen(context.TODO(), "tcp", addr) - } else { - ln, err = net.Listen("tcp", addr) - } - if err != nil { - return - } - - return NewKeepAliveListener(ln, "tcp", nil) -} - -func wrapTLS(scheme string, tlsinfo *TLSInfo, l net.Listener) (net.Listener, error) { - if scheme != "https" && scheme != "unixs" { - return l, nil - } - if tlsinfo != nil && tlsinfo.SkipClientSANVerify { - return NewTLSListener(l, tlsinfo) - } - return newTLSListener(l, tlsinfo, checkSAN) -} - -func newListenConfig(sopts *SocketOpts) (net.ListenConfig, error) { - lc := net.ListenConfig{} - if sopts != nil { - ctls := getControls(sopts) - if len(ctls) > 0 { - lc.Control = ctls.Control - } - } - return lc, nil -} - -type TLSInfo struct { - // CertFile is the _server_ cert, it will also be used as a _client_ certificate if ClientCertFile is empty - CertFile string - // KeyFile is the key for the CertFile - KeyFile string - // ClientCertFile is a _client_ cert for initiating connections when ClientCertAuth is defined. If ClientCertAuth - // is true but this value is empty, the CertFile will be used instead. - ClientCertFile string - // ClientKeyFile is the key for the ClientCertFile - ClientKeyFile string - - TrustedCAFile string - ClientCertAuth bool - CRLFile string - InsecureSkipVerify bool - SkipClientSANVerify bool - - // ServerName ensures the cert matches the given host in case of discovery / virtual hosting - ServerName string - - // HandshakeFailure is optionally called when a connection fails to handshake. The - // connection will be closed immediately afterwards. - HandshakeFailure func(*tls.Conn, error) - - // CipherSuites is a list of supported cipher suites. - // If empty, Go auto-populates it by default. - // Note that cipher suites are prioritized in the given order. - CipherSuites []uint16 - - // MinVersion is the minimum TLS version that is acceptable. - // If not set, the minimum version is TLS 1.2. - MinVersion uint16 - - // MaxVersion is the maximum TLS version that is acceptable. - // If not set, the default used by Go is selected (see tls.Config.MaxVersion). - MaxVersion uint16 - - selfCert bool - - // parseFunc exists to simplify testing. Typically, parseFunc - // should be left nil. In that case, tls.X509KeyPair will be used. - parseFunc func([]byte, []byte) (tls.Certificate, error) - - // AllowedCN is a CN which must be provided by a client. - // - // Deprecated: use AllowedCNs instead. - AllowedCN string - - // AllowedHostname is an IP address or hostname that must match the TLS - // certificate provided by a client. - // - // Deprecated: use AllowedHostnames instead. - AllowedHostname string - - // AllowedCNs is a list of acceptable CNs which must be provided by a client. - AllowedCNs []string - - // AllowedHostnames is a list of acceptable IP addresses or hostnames that must match the - // TLS certificate provided by a client. - AllowedHostnames []string - - // Logger logs TLS errors. - // If nil, all logs are discarded. - Logger *zap.Logger - - // EmptyCN indicates that the cert must have empty CN. - // If true, ClientConfig() will return an error for a cert with non empty CN. - EmptyCN bool -} - -func (info TLSInfo) String() string { - return fmt.Sprintf("cert = %s, key = %s, client-cert=%s, client-key=%s, trusted-ca = %s, client-cert-auth = %v, crl-file = %s", info.CertFile, info.KeyFile, info.ClientCertFile, info.ClientKeyFile, info.TrustedCAFile, info.ClientCertAuth, info.CRLFile) -} - -func (info TLSInfo) Empty() bool { - return info.CertFile == "" && info.KeyFile == "" -} - -func SelfCert(lg *zap.Logger, dirpath string, hosts []string, selfSignedCertValidity uint, additionalUsages ...x509.ExtKeyUsage) (info TLSInfo, err error) { - info.Logger = lg - if selfSignedCertValidity == 0 { - err = fmt.Errorf("selfSignedCertValidity is invalid,it should be greater than 0") - info.Logger.Warn( - "cannot generate cert", - zap.Error(err), - ) - return - } - err = fileutil.TouchDirAll(lg, dirpath) - if err != nil { - if info.Logger != nil { - info.Logger.Warn( - "cannot create cert directory", - zap.Error(err), - ) - } - return - } - - certPath, err := filepath.Abs(filepath.Join(dirpath, "cert.pem")) - if err != nil { - return - } - keyPath, err := filepath.Abs(filepath.Join(dirpath, "key.pem")) - if err != nil { - return - } - _, errcert := os.Stat(certPath) - _, errkey := os.Stat(keyPath) - if errcert == nil && errkey == nil { - info.CertFile = certPath - info.KeyFile = keyPath - info.ClientCertFile = certPath - info.ClientKeyFile = keyPath - info.selfCert = true - return - } - - serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128) - serialNumber, err := rand.Int(rand.Reader, serialNumberLimit) - if err != nil { - if info.Logger != nil { - info.Logger.Warn( - "cannot generate random number", - zap.Error(err), - ) - } - return - } - - tmpl := x509.Certificate{ - SerialNumber: serialNumber, - Subject: pkix.Name{Organization: []string{"etcd"}}, - NotBefore: time.Now(), - NotAfter: time.Now().Add(time.Duration(selfSignedCertValidity) * 365 * (24 * time.Hour)), - - KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature, - ExtKeyUsage: append([]x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}, additionalUsages...), - BasicConstraintsValid: true, - } - - if info.Logger != nil { - info.Logger.Warn( - "automatically generate certificates", - zap.Time("certificate-validity-bound-not-after", tmpl.NotAfter), - ) - } - - for _, host := range hosts { - h, _, _ := net.SplitHostPort(host) - if ip := net.ParseIP(h); ip != nil { - tmpl.IPAddresses = append(tmpl.IPAddresses, ip) - } else { - tmpl.DNSNames = append(tmpl.DNSNames, h) - } - } - - priv, err := ecdsa.GenerateKey(elliptic.P521(), rand.Reader) - if err != nil { - if info.Logger != nil { - info.Logger.Warn( - "cannot generate ECDSA key", - zap.Error(err), - ) - } - return - } - - derBytes, err := x509.CreateCertificate(rand.Reader, &tmpl, &tmpl, &priv.PublicKey, priv) - if err != nil { - if info.Logger != nil { - info.Logger.Warn( - "cannot generate x509 certificate", - zap.Error(err), - ) - } - return - } - - certOut, err := os.Create(certPath) - if err != nil { - info.Logger.Warn( - "cannot cert file", - zap.String("path", certPath), - zap.Error(err), - ) - return - } - pem.Encode(certOut, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes}) - certOut.Close() - if info.Logger != nil { - info.Logger.Info("created cert file", zap.String("path", certPath)) - } - - b, err := x509.MarshalECPrivateKey(priv) - if err != nil { - return - } - keyOut, err := os.OpenFile(keyPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600) - if err != nil { - if info.Logger != nil { - info.Logger.Warn( - "cannot key file", - zap.String("path", keyPath), - zap.Error(err), - ) - } - return - } - pem.Encode(keyOut, &pem.Block{Type: "EC PRIVATE KEY", Bytes: b}) - keyOut.Close() - if info.Logger != nil { - info.Logger.Info("created key file", zap.String("path", keyPath)) - } - return SelfCert(lg, dirpath, hosts, selfSignedCertValidity) -} - -// baseConfig is called on initial TLS handshake start. -// -// Previously, -// 1. Server has non-empty (*tls.Config).Certificates on client hello -// 2. Server calls (*tls.Config).GetCertificate iff: -// - Server's (*tls.Config).Certificates is not empty, or -// - Client supplies SNI; non-empty (*tls.ClientHelloInfo).ServerName -// -// When (*tls.Config).Certificates is always populated on initial handshake, -// client is expected to provide a valid matching SNI to pass the TLS -// verification, thus trigger server (*tls.Config).GetCertificate to reload -// TLS assets. However, a cert whose SAN field does not include domain names -// but only IP addresses, has empty (*tls.ClientHelloInfo).ServerName, thus -// it was never able to trigger TLS reload on initial handshake; first -// ceritifcate object was being used, never being updated. -// -// Now, (*tls.Config).Certificates is created empty on initial TLS client -// handshake, in order to trigger (*tls.Config).GetCertificate and populate -// rest of the certificates on every new TLS connection, even when client -// SNI is empty (e.g. cert only includes IPs). -func (info TLSInfo) baseConfig() (*tls.Config, error) { - if info.KeyFile == "" || info.CertFile == "" { - return nil, fmt.Errorf("KeyFile and CertFile must both be present[key: %v, cert: %v]", info.KeyFile, info.CertFile) - } - if info.Logger == nil { - info.Logger = zap.NewNop() - } - - _, err := tlsutil.NewCert(info.CertFile, info.KeyFile, info.parseFunc) - if err != nil { - return nil, err - } - - // Perform prevalidation of client cert and key if either are provided. This makes sure we crash before accepting any connections. - if (info.ClientKeyFile == "") != (info.ClientCertFile == "") { - return nil, fmt.Errorf("ClientKeyFile and ClientCertFile must both be present or both absent: key: %v, cert: %v]", info.ClientKeyFile, info.ClientCertFile) - } - if info.ClientCertFile != "" { - _, err := tlsutil.NewCert(info.ClientCertFile, info.ClientKeyFile, info.parseFunc) - if err != nil { - return nil, err - } - } - - var minVersion uint16 - if info.MinVersion != 0 { - minVersion = info.MinVersion - } else { - // Default minimum version is TLS 1.2, previous versions are insecure and deprecated. - minVersion = tls.VersionTLS12 - } - - cfg := &tls.Config{ - MinVersion: minVersion, - MaxVersion: info.MaxVersion, - ServerName: info.ServerName, - } - - if len(info.CipherSuites) > 0 { - cfg.CipherSuites = info.CipherSuites - } - - // Client certificates may be verified by either an exact match on the CN, - // or a more general check of the CN and SANs. - var verifyCertificate func(*x509.Certificate) bool - - if info.AllowedCN != "" && len(info.AllowedCNs) > 0 { - return nil, fmt.Errorf("AllowedCN and AllowedCNs are mutually exclusive (cn=%q, cns=%q)", info.AllowedCN, info.AllowedCNs) - } - if info.AllowedHostname != "" && len(info.AllowedHostnames) > 0 { - return nil, fmt.Errorf("AllowedHostname and AllowedHostnames are mutually exclusive (hostname=%q, hostnames=%q)", info.AllowedHostname, info.AllowedHostnames) - } - if info.AllowedCN != "" && info.AllowedHostname != "" { - return nil, fmt.Errorf("AllowedCN and AllowedHostname are mutually exclusive (cn=%q, hostname=%q)", info.AllowedCN, info.AllowedHostname) - } - if len(info.AllowedCNs) > 0 && len(info.AllowedHostnames) > 0 { - return nil, fmt.Errorf("AllowedCNs and AllowedHostnames are mutually exclusive (cns=%q, hostnames=%q)", info.AllowedCNs, info.AllowedHostnames) - } - - if info.AllowedCN != "" { - info.Logger.Warn("AllowedCN is deprecated, use AllowedCNs instead") - verifyCertificate = func(cert *x509.Certificate) bool { - return info.AllowedCN == cert.Subject.CommonName - } - } - if info.AllowedHostname != "" { - info.Logger.Warn("AllowedHostname is deprecated, use AllowedHostnames instead") - verifyCertificate = func(cert *x509.Certificate) bool { - return cert.VerifyHostname(info.AllowedHostname) == nil - } - } - if len(info.AllowedCNs) > 0 { - verifyCertificate = func(cert *x509.Certificate) bool { - for _, allowedCN := range info.AllowedCNs { - if allowedCN == cert.Subject.CommonName { - return true - } - } - return false - } - } - if len(info.AllowedHostnames) > 0 { - verifyCertificate = func(cert *x509.Certificate) bool { - for _, allowedHostname := range info.AllowedHostnames { - if cert.VerifyHostname(allowedHostname) == nil { - return true - } - } - return false - } - } - if verifyCertificate != nil { - cfg.VerifyPeerCertificate = func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error { - for _, chains := range verifiedChains { - if len(chains) != 0 { - if verifyCertificate(chains[0]) { - return nil - } - } - } - return errors.New("client certificate authentication failed") - } - } - - // this only reloads certs when there's a client request - // TODO: support server-side refresh (e.g. inotify, SIGHUP), caching - cfg.GetCertificate = func(clientHello *tls.ClientHelloInfo) (cert *tls.Certificate, err error) { - cert, err = tlsutil.NewCert(info.CertFile, info.KeyFile, info.parseFunc) - if os.IsNotExist(err) { - if info.Logger != nil { - info.Logger.Warn( - "failed to find peer cert files", - zap.String("cert-file", info.CertFile), - zap.String("key-file", info.KeyFile), - zap.Error(err), - ) - } - } else if err != nil { - if info.Logger != nil { - info.Logger.Warn( - "failed to create peer certificate", - zap.String("cert-file", info.CertFile), - zap.String("key-file", info.KeyFile), - zap.Error(err), - ) - } - } - return cert, err - } - cfg.GetClientCertificate = func(unused *tls.CertificateRequestInfo) (cert *tls.Certificate, err error) { - certfile, keyfile := info.CertFile, info.KeyFile - if info.ClientCertFile != "" { - certfile, keyfile = info.ClientCertFile, info.ClientKeyFile - } - cert, err = tlsutil.NewCert(certfile, keyfile, info.parseFunc) - if os.IsNotExist(err) { - if info.Logger != nil { - info.Logger.Warn( - "failed to find client cert files", - zap.String("cert-file", certfile), - zap.String("key-file", keyfile), - zap.Error(err), - ) - } - } else if err != nil { - if info.Logger != nil { - info.Logger.Warn( - "failed to create client certificate", - zap.String("cert-file", certfile), - zap.String("key-file", keyfile), - zap.Error(err), - ) - } - } - return cert, err - } - return cfg, nil -} - -// cafiles returns a list of CA file paths. -func (info TLSInfo) cafiles() []string { - cs := make([]string, 0) - if info.TrustedCAFile != "" { - cs = append(cs, info.TrustedCAFile) - } - return cs -} - -// ServerConfig generates a tls.Config object for use by an HTTP server. -func (info TLSInfo) ServerConfig() (*tls.Config, error) { - cfg, err := info.baseConfig() - if err != nil { - return nil, err - } - - if info.Logger == nil { - info.Logger = zap.NewNop() - } - - cfg.ClientAuth = tls.NoClientCert - if info.TrustedCAFile != "" || info.ClientCertAuth { - cfg.ClientAuth = tls.RequireAndVerifyClientCert - } - - cs := info.cafiles() - if len(cs) > 0 { - info.Logger.Info("Loading cert pool", zap.Strings("cs", cs), - zap.Any("tlsinfo", info)) - cp, err := tlsutil.NewCertPool(cs) - if err != nil { - return nil, err - } - cfg.ClientCAs = cp - } - - // "h2" NextProtos is necessary for enabling HTTP2 for go's HTTP server - cfg.NextProtos = []string{"h2"} - - return cfg, nil -} - -// ClientConfig generates a tls.Config object for use by an HTTP client. -func (info TLSInfo) ClientConfig() (*tls.Config, error) { - var cfg *tls.Config - var err error - - if !info.Empty() { - cfg, err = info.baseConfig() - if err != nil { - return nil, err - } - } else { - cfg = &tls.Config{ServerName: info.ServerName} - } - cfg.InsecureSkipVerify = info.InsecureSkipVerify - - cs := info.cafiles() - if len(cs) > 0 { - cfg.RootCAs, err = tlsutil.NewCertPool(cs) - if err != nil { - return nil, err - } - } - - if info.selfCert { - cfg.InsecureSkipVerify = true - } - - if info.EmptyCN { - hasNonEmptyCN := false - cn := "" - _, err := tlsutil.NewCert(info.CertFile, info.KeyFile, func(certPEMBlock []byte, keyPEMBlock []byte) (tls.Certificate, error) { - var block *pem.Block - block, _ = pem.Decode(certPEMBlock) - cert, err := x509.ParseCertificate(block.Bytes) - if err != nil { - return tls.Certificate{}, err - } - if len(cert.Subject.CommonName) != 0 { - hasNonEmptyCN = true - cn = cert.Subject.CommonName - } - return tls.X509KeyPair(certPEMBlock, keyPEMBlock) - }) - if err != nil { - return nil, err - } - if hasNonEmptyCN { - return nil, fmt.Errorf("cert has non empty Common Name (%s): %s", cn, info.CertFile) - } - } - - return cfg, nil -} - -// IsClosedConnError returns true if the error is from closing listener, cmux. -// copied from golang.org/x/net/http2/http2.go -func IsClosedConnError(err error) bool { - // 'use of closed network connection' (Go <=1.8) - // 'use of closed file or network connection' (Go >1.8, internal/poll.ErrClosing) - // 'mux: listener closed' (cmux.ErrListenerClosed) - return err != nil && strings.Contains(err.Error(), "closed") -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_opts.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_opts.go deleted file mode 100644 index ad4f6904d..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_opts.go +++ /dev/null @@ -1,76 +0,0 @@ -package transport - -import ( - "net" - "time" -) - -type ListenerOptions struct { - Listener net.Listener - ListenConfig net.ListenConfig - - socketOpts *SocketOpts - tlsInfo *TLSInfo - skipTLSInfoCheck bool - writeTimeout time.Duration - readTimeout time.Duration -} - -func newListenOpts(opts ...ListenerOption) *ListenerOptions { - lnOpts := &ListenerOptions{} - lnOpts.applyOpts(opts) - return lnOpts -} - -func (lo *ListenerOptions) applyOpts(opts []ListenerOption) { - for _, opt := range opts { - opt(lo) - } -} - -// IsTimeout returns true if the listener has a read/write timeout defined. -func (lo *ListenerOptions) IsTimeout() bool { return lo.readTimeout != 0 || lo.writeTimeout != 0 } - -// IsSocketOpts returns true if the listener options includes socket options. -func (lo *ListenerOptions) IsSocketOpts() bool { - if lo.socketOpts == nil { - return false - } - return lo.socketOpts.ReusePort || lo.socketOpts.ReuseAddress -} - -// IsTLS returns true if listner options includes TLSInfo. -func (lo *ListenerOptions) IsTLS() bool { - if lo.tlsInfo == nil { - return false - } - return !lo.tlsInfo.Empty() -} - -// ListenerOption are options which can be applied to the listener. -type ListenerOption func(*ListenerOptions) - -// WithTimeout allows for a read or write timeout to be applied to the listener. -func WithTimeout(read, write time.Duration) ListenerOption { - return func(lo *ListenerOptions) { - lo.writeTimeout = write - lo.readTimeout = read - } -} - -// WithSocketOpts defines socket options that will be applied to the listener. -func WithSocketOpts(s *SocketOpts) ListenerOption { - return func(lo *ListenerOptions) { lo.socketOpts = s } -} - -// WithTLSInfo adds TLS credentials to the listener. -func WithTLSInfo(t *TLSInfo) ListenerOption { - return func(lo *ListenerOptions) { lo.tlsInfo = t } -} - -// WithSkipTLSInfoCheck when true a transport can be created with an https scheme -// without passing TLSInfo, circumventing not presented error. Skipping this check -// also requires that TLSInfo is not passed. -func WithSkipTLSInfoCheck(skip bool) ListenerOption { - return func(lo *ListenerOptions) { lo.skipTLSInfoCheck = skip } -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_tls.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_tls.go deleted file mode 100644 index 6f1600945..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/listener_tls.go +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright 2017 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package transport - -import ( - "context" - "crypto/tls" - "crypto/x509" - "fmt" - "io/ioutil" - "net" - "strings" - "sync" -) - -// tlsListener overrides a TLS listener so it will reject client -// certificates with insufficient SAN credentials or CRL revoked -// certificates. -type tlsListener struct { - net.Listener - connc chan net.Conn - donec chan struct{} - err error - handshakeFailure func(*tls.Conn, error) - check tlsCheckFunc -} - -type tlsCheckFunc func(context.Context, *tls.Conn) error - -// NewTLSListener handshakes TLS connections and performs optional CRL checking. -func NewTLSListener(l net.Listener, tlsinfo *TLSInfo) (net.Listener, error) { - check := func(context.Context, *tls.Conn) error { return nil } - return newTLSListener(l, tlsinfo, check) -} - -func newTLSListener(l net.Listener, tlsinfo *TLSInfo, check tlsCheckFunc) (net.Listener, error) { - if tlsinfo == nil || tlsinfo.Empty() { - l.Close() - return nil, fmt.Errorf("cannot listen on TLS for %s: KeyFile and CertFile are not presented", l.Addr().String()) - } - tlscfg, err := tlsinfo.ServerConfig() - if err != nil { - return nil, err - } - - hf := tlsinfo.HandshakeFailure - if hf == nil { - hf = func(*tls.Conn, error) {} - } - - if len(tlsinfo.CRLFile) > 0 { - prevCheck := check - check = func(ctx context.Context, tlsConn *tls.Conn) error { - if err := prevCheck(ctx, tlsConn); err != nil { - return err - } - st := tlsConn.ConnectionState() - if certs := st.PeerCertificates; len(certs) > 0 { - return checkCRL(tlsinfo.CRLFile, certs) - } - return nil - } - } - - tlsl := &tlsListener{ - Listener: tls.NewListener(l, tlscfg), - connc: make(chan net.Conn), - donec: make(chan struct{}), - handshakeFailure: hf, - check: check, - } - go tlsl.acceptLoop() - return tlsl, nil -} - -func (l *tlsListener) Accept() (net.Conn, error) { - select { - case conn := <-l.connc: - return conn, nil - case <-l.donec: - return nil, l.err - } -} - -func checkSAN(ctx context.Context, tlsConn *tls.Conn) error { - st := tlsConn.ConnectionState() - if certs := st.PeerCertificates; len(certs) > 0 { - addr := tlsConn.RemoteAddr().String() - return checkCertSAN(ctx, certs[0], addr) - } - return nil -} - -// acceptLoop launches each TLS handshake in a separate goroutine -// to prevent a hanging TLS connection from blocking other connections. -func (l *tlsListener) acceptLoop() { - var wg sync.WaitGroup - var pendingMu sync.Mutex - - pending := make(map[net.Conn]struct{}) - ctx, cancel := context.WithCancel(context.Background()) - defer func() { - cancel() - pendingMu.Lock() - for c := range pending { - c.Close() - } - pendingMu.Unlock() - wg.Wait() - close(l.donec) - }() - - for { - conn, err := l.Listener.Accept() - if err != nil { - l.err = err - return - } - - pendingMu.Lock() - pending[conn] = struct{}{} - pendingMu.Unlock() - - wg.Add(1) - go func() { - defer func() { - if conn != nil { - conn.Close() - } - wg.Done() - }() - - tlsConn := conn.(*tls.Conn) - herr := tlsConn.Handshake() - pendingMu.Lock() - delete(pending, conn) - pendingMu.Unlock() - - if herr != nil { - l.handshakeFailure(tlsConn, herr) - return - } - if err := l.check(ctx, tlsConn); err != nil { - l.handshakeFailure(tlsConn, err) - return - } - - select { - case l.connc <- tlsConn: - conn = nil - case <-ctx.Done(): - } - }() - } -} - -func checkCRL(crlPath string, cert []*x509.Certificate) error { - // TODO: cache - crlBytes, err := ioutil.ReadFile(crlPath) - if err != nil { - return err - } - certList, err := x509.ParseCRL(crlBytes) - if err != nil { - return err - } - revokedSerials := make(map[string]struct{}) - for _, rc := range certList.TBSCertList.RevokedCertificates { - revokedSerials[string(rc.SerialNumber.Bytes())] = struct{}{} - } - for _, c := range cert { - serial := string(c.SerialNumber.Bytes()) - if _, ok := revokedSerials[serial]; ok { - return fmt.Errorf("transport: certificate serial %x revoked", serial) - } - } - return nil -} - -func checkCertSAN(ctx context.Context, cert *x509.Certificate, remoteAddr string) error { - if len(cert.IPAddresses) == 0 && len(cert.DNSNames) == 0 { - return nil - } - h, _, herr := net.SplitHostPort(remoteAddr) - if herr != nil { - return herr - } - if len(cert.IPAddresses) > 0 { - cerr := cert.VerifyHostname(h) - if cerr == nil { - return nil - } - if len(cert.DNSNames) == 0 { - return cerr - } - } - if len(cert.DNSNames) > 0 { - ok, err := isHostInDNS(ctx, h, cert.DNSNames) - if ok { - return nil - } - errStr := "" - if err != nil { - errStr = " (" + err.Error() + ")" - } - return fmt.Errorf("tls: %q does not match any of DNSNames %q"+errStr, h, cert.DNSNames) - } - return nil -} - -func isHostInDNS(ctx context.Context, host string, dnsNames []string) (ok bool, err error) { - // reverse lookup - wildcards, names := []string{}, []string{} - for _, dns := range dnsNames { - if strings.HasPrefix(dns, "*.") { - wildcards = append(wildcards, dns[1:]) - } else { - names = append(names, dns) - } - } - lnames, lerr := net.DefaultResolver.LookupAddr(ctx, host) - for _, name := range lnames { - // strip trailing '.' from PTR record - if name[len(name)-1] == '.' { - name = name[:len(name)-1] - } - for _, wc := range wildcards { - if strings.HasSuffix(name, wc) { - return true, nil - } - } - for _, n := range names { - if n == name { - return true, nil - } - } - } - err = lerr - - // forward lookup - for _, dns := range names { - addrs, lerr := net.DefaultResolver.LookupHost(ctx, dns) - if lerr != nil { - err = lerr - continue - } - for _, addr := range addrs { - if addr == host { - return true, nil - } - } - } - return false, err -} - -func (l *tlsListener) Close() error { - err := l.Listener.Close() - <-l.donec - return err -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt.go deleted file mode 100644 index fe028c613..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt.go +++ /dev/null @@ -1,45 +0,0 @@ -package transport - -import ( - "syscall" -) - -type Controls []func(network, addr string, conn syscall.RawConn) error - -func (ctls Controls) Control(network, addr string, conn syscall.RawConn) error { - for _, s := range ctls { - if err := s(network, addr, conn); err != nil { - return err - } - } - return nil -} - -type SocketOpts struct { - // ReusePort enables socket option SO_REUSEPORT [1] which allows rebind of - // a port already in use. User should keep in mind that flock can fail - // in which case lock on data file could result in unexpected - // condition. User should take caution to protect against lock race. - // [1] https://man7.org/linux/man-pages/man7/socket.7.html - ReusePort bool `json:"reuse-port"` - // ReuseAddress enables a socket option SO_REUSEADDR which allows - // binding to an address in `TIME_WAIT` state. Useful to improve MTTR - // in cases where etcd slow to restart due to excessive `TIME_WAIT`. - // [1] https://man7.org/linux/man-pages/man7/socket.7.html - ReuseAddress bool `json:"reuse-address"` -} - -func getControls(sopts *SocketOpts) Controls { - ctls := Controls{} - if sopts.ReuseAddress { - ctls = append(ctls, setReuseAddress) - } - if sopts.ReusePort { - ctls = append(ctls, setReusePort) - } - return ctls -} - -func (sopts *SocketOpts) Empty() bool { - return !sopts.ReuseAddress && !sopts.ReusePort -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt_solaris.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt_solaris.go deleted file mode 100644 index 495c73636..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt_solaris.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2021 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build solaris -// +build solaris - -package transport - -import ( - "fmt" - "syscall" - - "golang.org/x/sys/unix" -) - -func setReusePort(network, address string, c syscall.RawConn) error { - return fmt.Errorf("port reuse is not supported on Solaris") -} - -func setReuseAddress(network, address string, conn syscall.RawConn) error { - return conn.Control(func(fd uintptr) { - syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, unix.SO_REUSEADDR, 1) - }) -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt_unix.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt_unix.go deleted file mode 100644 index e2cc6f482..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt_unix.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2021 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build !windows && !solaris -// +build !windows,!solaris - -package transport - -import ( - "syscall" - - "golang.org/x/sys/unix" -) - -func setReusePort(network, address string, conn syscall.RawConn) error { - return conn.Control(func(fd uintptr) { - syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, unix.SO_REUSEPORT, 1) - }) -} - -func setReuseAddress(network, address string, conn syscall.RawConn) error { - return conn.Control(func(fd uintptr) { - syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, unix.SO_REUSEADDR, 1) - }) -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt_windows.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt_windows.go deleted file mode 100644 index 4e5af70b1..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/sockopt_windows.go +++ /dev/null @@ -1,19 +0,0 @@ -//go:build windows -// +build windows - -package transport - -import ( - "fmt" - "syscall" -) - -func setReusePort(network, address string, c syscall.RawConn) error { - return fmt.Errorf("port reuse is not supported on Windows") -} - -// Windows supports SO_REUSEADDR, but it may cause undefined behavior, as -// there is no protection against port hijacking. -func setReuseAddress(network, addr string, conn syscall.RawConn) error { - return fmt.Errorf("address reuse is not supported on Windows") -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_conn.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_conn.go deleted file mode 100644 index 80e329394..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_conn.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package transport - -import ( - "net" - "time" -) - -type timeoutConn struct { - net.Conn - writeTimeout time.Duration - readTimeout time.Duration -} - -func (c timeoutConn) Write(b []byte) (n int, err error) { - if c.writeTimeout > 0 { - if err := c.SetWriteDeadline(time.Now().Add(c.writeTimeout)); err != nil { - return 0, err - } - } - return c.Conn.Write(b) -} - -func (c timeoutConn) Read(b []byte) (n int, err error) { - if c.readTimeout > 0 { - if err := c.SetReadDeadline(time.Now().Add(c.readTimeout)); err != nil { - return 0, err - } - } - return c.Conn.Read(b) -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_dialer.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_dialer.go deleted file mode 100644 index 9c0245d31..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_dialer.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package transport - -import ( - "net" - "time" -) - -type rwTimeoutDialer struct { - wtimeoutd time.Duration - rdtimeoutd time.Duration - net.Dialer -} - -func (d *rwTimeoutDialer) Dial(network, address string) (net.Conn, error) { - conn, err := d.Dialer.Dial(network, address) - tconn := &timeoutConn{ - readTimeout: d.rdtimeoutd, - writeTimeout: d.wtimeoutd, - Conn: conn, - } - return tconn, err -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_listener.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_listener.go deleted file mode 100644 index 5d74bd70c..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_listener.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package transport - -import ( - "net" - "time" -) - -// NewTimeoutListener returns a listener that listens on the given address. -// If read/write on the accepted connection blocks longer than its time limit, -// it will return timeout error. -func NewTimeoutListener(addr string, scheme string, tlsinfo *TLSInfo, readTimeout, writeTimeout time.Duration) (net.Listener, error) { - return newListener(addr, scheme, WithTimeout(readTimeout, writeTimeout), WithTLSInfo(tlsinfo)) -} - -type rwTimeoutListener struct { - net.Listener - writeTimeout time.Duration - readTimeout time.Duration -} - -func (rwln *rwTimeoutListener) Accept() (net.Conn, error) { - c, err := rwln.Listener.Accept() - if err != nil { - return nil, err - } - return timeoutConn{ - Conn: c, - writeTimeout: rwln.writeTimeout, - readTimeout: rwln.readTimeout, - }, nil -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_transport.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_transport.go deleted file mode 100644 index ea16b4c0f..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/timeout_transport.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package transport - -import ( - "net" - "net/http" - "time" -) - -// NewTimeoutTransport returns a transport created using the given TLS info. -// If read/write on the created connection blocks longer than its time limit, -// it will return timeout error. -// If read/write timeout is set, transport will not be able to reuse connection. -func NewTimeoutTransport(info TLSInfo, dialtimeoutd, rdtimeoutd, wtimeoutd time.Duration) (*http.Transport, error) { - tr, err := NewTransport(info, dialtimeoutd) - if err != nil { - return nil, err - } - - if rdtimeoutd != 0 || wtimeoutd != 0 { - // the timed out connection will timeout soon after it is idle. - // it should not be put back to http transport as an idle connection for future usage. - tr.MaxIdleConnsPerHost = -1 - } else { - // allow more idle connections between peers to avoid unnecessary port allocation. - tr.MaxIdleConnsPerHost = 1024 - } - - tr.Dial = (&rwTimeoutDialer{ - Dialer: net.Dialer{ - Timeout: dialtimeoutd, - KeepAlive: 30 * time.Second, - }, - rdtimeoutd: rdtimeoutd, - wtimeoutd: wtimeoutd, - }).Dial - return tr, nil -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/tls.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/tls.go deleted file mode 100644 index 8c3a35b14..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/tls.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package transport - -import ( - "context" - "fmt" - "strings" - "time" -) - -// ValidateSecureEndpoints scans the given endpoints against tls info, returning only those -// endpoints that could be validated as secure. -func ValidateSecureEndpoints(tlsInfo TLSInfo, eps []string) ([]string, error) { - t, err := NewTransport(tlsInfo, 5*time.Second) - if err != nil { - return nil, err - } - defer t.CloseIdleConnections() - - var errs []string - var endpoints []string - for _, ep := range eps { - if !strings.HasPrefix(ep, "https://") { - errs = append(errs, fmt.Sprintf("%q is insecure", ep)) - continue - } - conn, cerr := t.DialContext(context.Background(), "tcp", ep[len("https://"):]) - if cerr != nil { - errs = append(errs, fmt.Sprintf("%q failed to dial (%v)", ep, cerr)) - continue - } - conn.Close() - endpoints = append(endpoints, ep) - } - if len(errs) != 0 { - err = fmt.Errorf("%s", strings.Join(errs, ",")) - } - return endpoints, err -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/transport.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/transport.go deleted file mode 100644 index 648512772..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/transport.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package transport - -import ( - "context" - "net" - "net/http" - "strings" - "time" -) - -type unixTransport struct{ *http.Transport } - -func NewTransport(info TLSInfo, dialtimeoutd time.Duration) (*http.Transport, error) { - cfg, err := info.ClientConfig() - if err != nil { - return nil, err - } - - t := &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: dialtimeoutd, - // value taken from http.DefaultTransport - KeepAlive: 30 * time.Second, - }).DialContext, - // value taken from http.DefaultTransport - TLSHandshakeTimeout: 10 * time.Second, - TLSClientConfig: cfg, - } - - dialer := &net.Dialer{ - Timeout: dialtimeoutd, - KeepAlive: 30 * time.Second, - } - - dialContext := func(ctx context.Context, net, addr string) (net.Conn, error) { - return dialer.DialContext(ctx, "unix", addr) - } - tu := &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: dialContext, - TLSHandshakeTimeout: 10 * time.Second, - TLSClientConfig: cfg, - // Cost of reopening connection on sockets is low, and they are mostly used in testing. - // Long living unix-transport connections were leading to 'leak' test flakes. - // Alternativly the returned Transport (t) should override CloseIdleConnections to - // forward it to 'tu' as well. - IdleConnTimeout: time.Microsecond, - } - ut := &unixTransport{tu} - - t.RegisterProtocol("unix", ut) - t.RegisterProtocol("unixs", ut) - - return t, nil -} - -func (urt *unixTransport) RoundTrip(req *http.Request) (*http.Response, error) { - url := *req.URL - req.URL = &url - req.URL.Scheme = strings.Replace(req.URL.Scheme, "unix", "http", 1) - return urt.Transport.RoundTrip(req) -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/unix_listener.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/unix_listener.go deleted file mode 100644 index 123e2036f..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/transport/unix_listener.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package transport - -import ( - "net" - "os" -) - -type unixListener struct{ net.Listener } - -func NewUnixListener(addr string) (net.Listener, error) { - if err := os.Remove(addr); err != nil && !os.IsNotExist(err) { - return nil, err - } - l, err := net.Listen("unix", addr) - if err != nil { - return nil, err - } - return &unixListener{l}, nil -} - -func (ul *unixListener) Close() error { - if err := os.Remove(ul.Addr().String()); err != nil && !os.IsNotExist(err) { - return err - } - return ul.Listener.Close() -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/doc.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/doc.go deleted file mode 100644 index de8ef0bd7..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package types declares various data types and implements type-checking -// functions. -package types diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/id.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/id.go deleted file mode 100644 index ae00388dd..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/id.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import "strconv" - -// ID represents a generic identifier which is canonically -// stored as a uint64 but is typically represented as a -// base-16 string for input/output -type ID uint64 - -func (i ID) String() string { - return strconv.FormatUint(uint64(i), 16) -} - -// IDFromString attempts to create an ID from a base-16 string. -func IDFromString(s string) (ID, error) { - i, err := strconv.ParseUint(s, 16, 64) - return ID(i), err -} - -// IDSlice implements the sort interface -type IDSlice []ID - -func (p IDSlice) Len() int { return len(p) } -func (p IDSlice) Less(i, j int) bool { return uint64(p[i]) < uint64(p[j]) } -func (p IDSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/set.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/set.go deleted file mode 100644 index e7a3cdc9a..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/set.go +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "reflect" - "sort" - "sync" -) - -type Set interface { - Add(string) - Remove(string) - Contains(string) bool - Equals(Set) bool - Length() int - Values() []string - Copy() Set - Sub(Set) Set -} - -func NewUnsafeSet(values ...string) *unsafeSet { - set := &unsafeSet{make(map[string]struct{})} - for _, v := range values { - set.Add(v) - } - return set -} - -func NewThreadsafeSet(values ...string) *tsafeSet { - us := NewUnsafeSet(values...) - return &tsafeSet{us, sync.RWMutex{}} -} - -type unsafeSet struct { - d map[string]struct{} -} - -// Add adds a new value to the set (no-op if the value is already present) -func (us *unsafeSet) Add(value string) { - us.d[value] = struct{}{} -} - -// Remove removes the given value from the set -func (us *unsafeSet) Remove(value string) { - delete(us.d, value) -} - -// Contains returns whether the set contains the given value -func (us *unsafeSet) Contains(value string) (exists bool) { - _, exists = us.d[value] - return exists -} - -// ContainsAll returns whether the set contains all given values -func (us *unsafeSet) ContainsAll(values []string) bool { - for _, s := range values { - if !us.Contains(s) { - return false - } - } - return true -} - -// Equals returns whether the contents of two sets are identical -func (us *unsafeSet) Equals(other Set) bool { - v1 := sort.StringSlice(us.Values()) - v2 := sort.StringSlice(other.Values()) - v1.Sort() - v2.Sort() - return reflect.DeepEqual(v1, v2) -} - -// Length returns the number of elements in the set -func (us *unsafeSet) Length() int { - return len(us.d) -} - -// Values returns the values of the Set in an unspecified order. -func (us *unsafeSet) Values() (values []string) { - values = make([]string, 0) - for val := range us.d { - values = append(values, val) - } - return values -} - -// Copy creates a new Set containing the values of the first -func (us *unsafeSet) Copy() Set { - cp := NewUnsafeSet() - for val := range us.d { - cp.Add(val) - } - - return cp -} - -// Sub removes all elements in other from the set -func (us *unsafeSet) Sub(other Set) Set { - oValues := other.Values() - result := us.Copy().(*unsafeSet) - - for _, val := range oValues { - if _, ok := result.d[val]; !ok { - continue - } - delete(result.d, val) - } - - return result -} - -type tsafeSet struct { - us *unsafeSet - m sync.RWMutex -} - -func (ts *tsafeSet) Add(value string) { - ts.m.Lock() - defer ts.m.Unlock() - ts.us.Add(value) -} - -func (ts *tsafeSet) Remove(value string) { - ts.m.Lock() - defer ts.m.Unlock() - ts.us.Remove(value) -} - -func (ts *tsafeSet) Contains(value string) (exists bool) { - ts.m.RLock() - defer ts.m.RUnlock() - return ts.us.Contains(value) -} - -func (ts *tsafeSet) Equals(other Set) bool { - ts.m.RLock() - defer ts.m.RUnlock() - - // If ts and other represent the same variable, avoid calling - // ts.us.Equals(other), to avoid double RLock bug - if _other, ok := other.(*tsafeSet); ok { - if _other == ts { - return true - } - } - return ts.us.Equals(other) -} - -func (ts *tsafeSet) Length() int { - ts.m.RLock() - defer ts.m.RUnlock() - return ts.us.Length() -} - -func (ts *tsafeSet) Values() (values []string) { - ts.m.RLock() - defer ts.m.RUnlock() - return ts.us.Values() -} - -func (ts *tsafeSet) Copy() Set { - ts.m.RLock() - defer ts.m.RUnlock() - usResult := ts.us.Copy().(*unsafeSet) - return &tsafeSet{usResult, sync.RWMutex{}} -} - -func (ts *tsafeSet) Sub(other Set) Set { - ts.m.RLock() - defer ts.m.RUnlock() - - // If ts and other represent the same variable, avoid calling - // ts.us.Sub(other), to avoid double RLock bug - if _other, ok := other.(*tsafeSet); ok { - if _other == ts { - usResult := NewUnsafeSet() - return &tsafeSet{usResult, sync.RWMutex{}} - } - } - usResult := ts.us.Sub(other).(*unsafeSet) - return &tsafeSet{usResult, sync.RWMutex{}} -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/slice.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/slice.go deleted file mode 100644 index 0dd9ca798..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/slice.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -// Uint64Slice implements sort interface -type Uint64Slice []uint64 - -func (p Uint64Slice) Len() int { return len(p) } -func (p Uint64Slice) Less(i, j int) bool { return p[i] < p[j] } -func (p Uint64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/urls.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/urls.go deleted file mode 100644 index 49a38967e..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/urls.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "errors" - "fmt" - "net" - "net/url" - "sort" - "strings" -) - -type URLs []url.URL - -func NewURLs(strs []string) (URLs, error) { - all := make([]url.URL, len(strs)) - if len(all) == 0 { - return nil, errors.New("no valid URLs given") - } - for i, in := range strs { - in = strings.TrimSpace(in) - u, err := url.Parse(in) - if err != nil { - return nil, err - } - - switch u.Scheme { - case "http", "https": - if _, _, err := net.SplitHostPort(u.Host); err != nil { - return nil, fmt.Errorf(`URL address does not have the form "host:port": %s`, in) - } - - if u.Path != "" { - return nil, fmt.Errorf("URL must not contain a path: %s", in) - } - case "unix", "unixs": - break - default: - return nil, fmt.Errorf("URL scheme must be http, https, unix, or unixs: %s", in) - } - all[i] = *u - } - us := URLs(all) - us.Sort() - return us, nil -} - -func MustNewURLs(strs []string) URLs { - urls, err := NewURLs(strs) - if err != nil { - panic(err) - } - return urls -} - -func (us URLs) String() string { - return strings.Join(us.StringSlice(), ",") -} - -func (us *URLs) Sort() { - sort.Sort(us) -} -func (us URLs) Len() int { return len(us) } -func (us URLs) Less(i, j int) bool { return us[i].String() < us[j].String() } -func (us URLs) Swap(i, j int) { us[i], us[j] = us[j], us[i] } - -func (us URLs) StringSlice() []string { - out := make([]string, len(us)) - for i := range us { - out[i] = us[i].String() - } - - return out -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/urlsmap.go b/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/urlsmap.go deleted file mode 100644 index 47690cc38..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/pkg/v3/types/urlsmap.go +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "fmt" - "sort" - "strings" -) - -// URLsMap is a map from a name to its URLs. -type URLsMap map[string]URLs - -// NewURLsMap returns a URLsMap instantiated from the given string, -// which consists of discovery-formatted names-to-URLs, like: -// mach0=http://1.1.1.1:2380,mach0=http://2.2.2.2::2380,mach1=http://3.3.3.3:2380,mach2=http://4.4.4.4:2380 -func NewURLsMap(s string) (URLsMap, error) { - m := parse(s) - - cl := URLsMap{} - for name, urls := range m { - us, err := NewURLs(urls) - if err != nil { - return nil, err - } - cl[name] = us - } - return cl, nil -} - -// NewURLsMapFromStringMap takes a map of strings and returns a URLsMap. The -// string values in the map can be multiple values separated by the sep string. -func NewURLsMapFromStringMap(m map[string]string, sep string) (URLsMap, error) { - var err error - um := URLsMap{} - for k, v := range m { - um[k], err = NewURLs(strings.Split(v, sep)) - if err != nil { - return nil, err - } - } - return um, nil -} - -// String turns URLsMap into discovery-formatted name-to-URLs sorted by name. -func (c URLsMap) String() string { - var pairs []string - for name, urls := range c { - for _, url := range urls { - pairs = append(pairs, fmt.Sprintf("%s=%s", name, url.String())) - } - } - sort.Strings(pairs) - return strings.Join(pairs, ",") -} - -// URLs returns a list of all URLs. -// The returned list is sorted in ascending lexicographical order. -func (c URLsMap) URLs() []string { - var urls []string - for _, us := range c { - for _, u := range us { - urls = append(urls, u.String()) - } - } - sort.Strings(urls) - return urls -} - -// Len returns the size of URLsMap. -func (c URLsMap) Len() int { - return len(c) -} - -// parse parses the given string and returns a map listing the values specified for each key. -func parse(s string) map[string][]string { - m := make(map[string][]string) - for s != "" { - key := s - if i := strings.IndexAny(key, ","); i >= 0 { - key, s = key[:i], key[i+1:] - } else { - s = "" - } - if key == "" { - continue - } - value := "" - if i := strings.Index(key, "="); i >= 0 { - key, value = key[:i], key[i+1:] - } - m[key] = append(m[key], value) - } - return m -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/LICENSE b/e2e/vendor/go.etcd.io/etcd/client/v3/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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/e2e/vendor/go.etcd.io/etcd/client/v3/README.md b/e2e/vendor/go.etcd.io/etcd/client/v3/README.md deleted file mode 100644 index 16c0fe888..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# etcd/clientv3 - -[![Docs](https://img.shields.io/badge/docs-latest-green.svg)](https://etcd.io/docs) -[![Godoc](https://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://godoc.org/go.etcd.io/etcd/clientv3) - -`etcd/clientv3` is the official Go etcd client for v3. - -## Install - -```bash -go get go.etcd.io/etcd/client/v3 -``` - -## Get started - -Create client using `clientv3.New`: - -```go -cli, err := clientv3.New(clientv3.Config{ - Endpoints: []string{"localhost:2379", "localhost:22379", "localhost:32379"}, - DialTimeout: 5 * time.Second, -}) -if err != nil { - // handle error! -} -defer cli.Close() -``` - -etcd v3 uses [`gRPC`](https://www.grpc.io) for remote procedure calls. And `clientv3` uses -[`grpc-go`](https://github.com/grpc/grpc-go) to connect to etcd. Make sure to close the client after using it. -If the client is not closed, the connection will have leaky goroutines. To specify client request timeout, -pass `context.WithTimeout` to APIs: - -```go -ctx, cancel := context.WithTimeout(context.Background(), timeout) -resp, err := cli.Put(ctx, "sample_key", "sample_value") -cancel() -if err != nil { - // handle error! -} -// use the response -``` - -For full compatibility, it is recommended to install released versions of clients using go modules. - -## Error Handling - -etcd client returns 2 types of errors: - -1. context error: canceled or deadline exceeded. -2. gRPC error: see [api/v3rpc/rpctypes](https://godoc.org/go.etcd.io/etcd/api/v3rpc/rpctypes). - -Here is the example code to handle client errors: - -```go -resp, err := cli.Put(ctx, "", "") -if err != nil { - switch err { - case context.Canceled: - log.Fatalf("ctx is canceled by another routine: %v", err) - case context.DeadlineExceeded: - log.Fatalf("ctx is attached with a deadline is exceeded: %v", err) - case rpctypes.ErrEmptyKey: - log.Fatalf("client-side error: %v", err) - default: - log.Fatalf("bad cluster endpoints, which are not etcd servers: %v", err) - } -} -``` - -## Metrics - -The etcd client optionally exposes RPC metrics through [go-grpc-prometheus](https://github.com/grpc-ecosystem/go-grpc-prometheus). See the [examples](https://github.com/etcd-io/etcd/blob/main/tests/integration/clientv3/examples/example_metrics_test.go). - -## Namespacing - -The [namespace](https://godoc.org/go.etcd.io/etcd/client/v3/namespace) package provides `clientv3` interface wrappers to transparently isolate client requests to a user-defined prefix. - -## Request size limit - -Client request size limit is configurable via `clientv3.Config.MaxCallSendMsgSize` and `MaxCallRecvMsgSize` in bytes. If none given, client request send limit defaults to 2 MiB including gRPC overhead bytes. And receive limit defaults to `math.MaxInt32`. - -## Examples - -More code [examples](https://github.com/etcd-io/etcd/tree/main/tests/integration/clientv3/examples) can be found at [GoDoc](https://pkg.go.dev/go.etcd.io/etcd/client/v3). diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/auth.go b/e2e/vendor/go.etcd.io/etcd/client/v3/auth.go deleted file mode 100644 index 110918a4c..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/auth.go +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - "fmt" - "strings" - - "go.etcd.io/etcd/api/v3/authpb" - pb "go.etcd.io/etcd/api/v3/etcdserverpb" - "google.golang.org/grpc" -) - -type ( - AuthEnableResponse pb.AuthEnableResponse - AuthDisableResponse pb.AuthDisableResponse - AuthStatusResponse pb.AuthStatusResponse - AuthenticateResponse pb.AuthenticateResponse - AuthUserAddResponse pb.AuthUserAddResponse - AuthUserDeleteResponse pb.AuthUserDeleteResponse - AuthUserChangePasswordResponse pb.AuthUserChangePasswordResponse - AuthUserGrantRoleResponse pb.AuthUserGrantRoleResponse - AuthUserGetResponse pb.AuthUserGetResponse - AuthUserRevokeRoleResponse pb.AuthUserRevokeRoleResponse - AuthRoleAddResponse pb.AuthRoleAddResponse - AuthRoleGrantPermissionResponse pb.AuthRoleGrantPermissionResponse - AuthRoleGetResponse pb.AuthRoleGetResponse - AuthRoleRevokePermissionResponse pb.AuthRoleRevokePermissionResponse - AuthRoleDeleteResponse pb.AuthRoleDeleteResponse - AuthUserListResponse pb.AuthUserListResponse - AuthRoleListResponse pb.AuthRoleListResponse - - PermissionType authpb.Permission_Type - Permission authpb.Permission -) - -const ( - PermRead = authpb.READ - PermWrite = authpb.WRITE - PermReadWrite = authpb.READWRITE -) - -type UserAddOptions authpb.UserAddOptions - -type Auth interface { - // Authenticate login and get token - Authenticate(ctx context.Context, name string, password string) (*AuthenticateResponse, error) - - // AuthEnable enables auth of an etcd cluster. - AuthEnable(ctx context.Context) (*AuthEnableResponse, error) - - // AuthDisable disables auth of an etcd cluster. - AuthDisable(ctx context.Context) (*AuthDisableResponse, error) - - // AuthStatus returns the status of auth of an etcd cluster. - AuthStatus(ctx context.Context) (*AuthStatusResponse, error) - - // UserAdd adds a new user to an etcd cluster. - UserAdd(ctx context.Context, name string, password string) (*AuthUserAddResponse, error) - - // UserAddWithOptions adds a new user to an etcd cluster with some options. - UserAddWithOptions(ctx context.Context, name string, password string, opt *UserAddOptions) (*AuthUserAddResponse, error) - - // UserDelete deletes a user from an etcd cluster. - UserDelete(ctx context.Context, name string) (*AuthUserDeleteResponse, error) - - // UserChangePassword changes a password of a user. - UserChangePassword(ctx context.Context, name string, password string) (*AuthUserChangePasswordResponse, error) - - // UserGrantRole grants a role to a user. - UserGrantRole(ctx context.Context, user string, role string) (*AuthUserGrantRoleResponse, error) - - // UserGet gets a detailed information of a user. - UserGet(ctx context.Context, name string) (*AuthUserGetResponse, error) - - // UserList gets a list of all users. - UserList(ctx context.Context) (*AuthUserListResponse, error) - - // UserRevokeRole revokes a role of a user. - UserRevokeRole(ctx context.Context, name string, role string) (*AuthUserRevokeRoleResponse, error) - - // RoleAdd adds a new role to an etcd cluster. - RoleAdd(ctx context.Context, name string) (*AuthRoleAddResponse, error) - - // RoleGrantPermission grants a permission to a role. - RoleGrantPermission(ctx context.Context, name string, key, rangeEnd string, permType PermissionType) (*AuthRoleGrantPermissionResponse, error) - - // RoleGet gets a detailed information of a role. - RoleGet(ctx context.Context, role string) (*AuthRoleGetResponse, error) - - // RoleList gets a list of all roles. - RoleList(ctx context.Context) (*AuthRoleListResponse, error) - - // RoleRevokePermission revokes a permission from a role. - RoleRevokePermission(ctx context.Context, role string, key, rangeEnd string) (*AuthRoleRevokePermissionResponse, error) - - // RoleDelete deletes a role. - RoleDelete(ctx context.Context, role string) (*AuthRoleDeleteResponse, error) -} - -type authClient struct { - remote pb.AuthClient - callOpts []grpc.CallOption -} - -func NewAuth(c *Client) Auth { - api := &authClient{remote: RetryAuthClient(c)} - if c != nil { - api.callOpts = c.callOpts - } - return api -} - -func NewAuthFromAuthClient(remote pb.AuthClient, c *Client) Auth { - api := &authClient{remote: remote} - if c != nil { - api.callOpts = c.callOpts - } - return api -} - -func (auth *authClient) Authenticate(ctx context.Context, name string, password string) (*AuthenticateResponse, error) { - resp, err := auth.remote.Authenticate(ctx, &pb.AuthenticateRequest{Name: name, Password: password}, auth.callOpts...) - return (*AuthenticateResponse)(resp), ContextError(ctx, err) -} - -func (auth *authClient) AuthEnable(ctx context.Context) (*AuthEnableResponse, error) { - resp, err := auth.remote.AuthEnable(ctx, &pb.AuthEnableRequest{}, auth.callOpts...) - return (*AuthEnableResponse)(resp), ContextError(ctx, err) -} - -func (auth *authClient) AuthDisable(ctx context.Context) (*AuthDisableResponse, error) { - resp, err := auth.remote.AuthDisable(ctx, &pb.AuthDisableRequest{}, auth.callOpts...) - return (*AuthDisableResponse)(resp), ContextError(ctx, err) -} - -func (auth *authClient) AuthStatus(ctx context.Context) (*AuthStatusResponse, error) { - resp, err := auth.remote.AuthStatus(ctx, &pb.AuthStatusRequest{}, auth.callOpts...) - return (*AuthStatusResponse)(resp), ContextError(ctx, err) -} - -func (auth *authClient) UserAdd(ctx context.Context, name string, password string) (*AuthUserAddResponse, error) { - resp, err := auth.remote.UserAdd(ctx, &pb.AuthUserAddRequest{Name: name, Password: password, Options: &authpb.UserAddOptions{NoPassword: false}}, auth.callOpts...) - return (*AuthUserAddResponse)(resp), ContextError(ctx, err) -} - -func (auth *authClient) UserAddWithOptions(ctx context.Context, name string, password string, options *UserAddOptions) (*AuthUserAddResponse, error) { - resp, err := auth.remote.UserAdd(ctx, &pb.AuthUserAddRequest{Name: name, Password: password, Options: (*authpb.UserAddOptions)(options)}, auth.callOpts...) - return (*AuthUserAddResponse)(resp), ContextError(ctx, err) -} - -func (auth *authClient) UserDelete(ctx context.Context, name string) (*AuthUserDeleteResponse, error) { - resp, err := auth.remote.UserDelete(ctx, &pb.AuthUserDeleteRequest{Name: name}, auth.callOpts...) - return (*AuthUserDeleteResponse)(resp), ContextError(ctx, err) -} - -func (auth *authClient) UserChangePassword(ctx context.Context, name string, password string) (*AuthUserChangePasswordResponse, error) { - resp, err := auth.remote.UserChangePassword(ctx, &pb.AuthUserChangePasswordRequest{Name: name, Password: password}, auth.callOpts...) - return (*AuthUserChangePasswordResponse)(resp), ContextError(ctx, err) -} - -func (auth *authClient) UserGrantRole(ctx context.Context, user string, role string) (*AuthUserGrantRoleResponse, error) { - resp, err := auth.remote.UserGrantRole(ctx, &pb.AuthUserGrantRoleRequest{User: user, Role: role}, auth.callOpts...) - return (*AuthUserGrantRoleResponse)(resp), ContextError(ctx, err) -} - -func (auth *authClient) UserGet(ctx context.Context, name string) (*AuthUserGetResponse, error) { - resp, err := auth.remote.UserGet(ctx, &pb.AuthUserGetRequest{Name: name}, auth.callOpts...) - return (*AuthUserGetResponse)(resp), ContextError(ctx, err) -} - -func (auth *authClient) UserList(ctx context.Context) (*AuthUserListResponse, error) { - resp, err := auth.remote.UserList(ctx, &pb.AuthUserListRequest{}, auth.callOpts...) - return (*AuthUserListResponse)(resp), ContextError(ctx, err) -} - -func (auth *authClient) UserRevokeRole(ctx context.Context, name string, role string) (*AuthUserRevokeRoleResponse, error) { - resp, err := auth.remote.UserRevokeRole(ctx, &pb.AuthUserRevokeRoleRequest{Name: name, Role: role}, auth.callOpts...) - return (*AuthUserRevokeRoleResponse)(resp), ContextError(ctx, err) -} - -func (auth *authClient) RoleAdd(ctx context.Context, name string) (*AuthRoleAddResponse, error) { - resp, err := auth.remote.RoleAdd(ctx, &pb.AuthRoleAddRequest{Name: name}, auth.callOpts...) - return (*AuthRoleAddResponse)(resp), ContextError(ctx, err) -} - -func (auth *authClient) RoleGrantPermission(ctx context.Context, name string, key, rangeEnd string, permType PermissionType) (*AuthRoleGrantPermissionResponse, error) { - perm := &authpb.Permission{ - Key: []byte(key), - RangeEnd: []byte(rangeEnd), - PermType: authpb.Permission_Type(permType), - } - resp, err := auth.remote.RoleGrantPermission(ctx, &pb.AuthRoleGrantPermissionRequest{Name: name, Perm: perm}, auth.callOpts...) - return (*AuthRoleGrantPermissionResponse)(resp), ContextError(ctx, err) -} - -func (auth *authClient) RoleGet(ctx context.Context, role string) (*AuthRoleGetResponse, error) { - resp, err := auth.remote.RoleGet(ctx, &pb.AuthRoleGetRequest{Role: role}, auth.callOpts...) - return (*AuthRoleGetResponse)(resp), ContextError(ctx, err) -} - -func (auth *authClient) RoleList(ctx context.Context) (*AuthRoleListResponse, error) { - resp, err := auth.remote.RoleList(ctx, &pb.AuthRoleListRequest{}, auth.callOpts...) - return (*AuthRoleListResponse)(resp), ContextError(ctx, err) -} - -func (auth *authClient) RoleRevokePermission(ctx context.Context, role string, key, rangeEnd string) (*AuthRoleRevokePermissionResponse, error) { - resp, err := auth.remote.RoleRevokePermission(ctx, &pb.AuthRoleRevokePermissionRequest{Role: role, Key: []byte(key), RangeEnd: []byte(rangeEnd)}, auth.callOpts...) - return (*AuthRoleRevokePermissionResponse)(resp), ContextError(ctx, err) -} - -func (auth *authClient) RoleDelete(ctx context.Context, role string) (*AuthRoleDeleteResponse, error) { - resp, err := auth.remote.RoleDelete(ctx, &pb.AuthRoleDeleteRequest{Role: role}, auth.callOpts...) - return (*AuthRoleDeleteResponse)(resp), ContextError(ctx, err) -} - -func StrToPermissionType(s string) (PermissionType, error) { - val, ok := authpb.Permission_Type_value[strings.ToUpper(s)] - if ok { - return PermissionType(val), nil - } - return PermissionType(-1), fmt.Errorf("invalid permission type: %s", s) -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/client.go b/e2e/vendor/go.etcd.io/etcd/client/v3/client.go deleted file mode 100644 index f7aa65a0a..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/client.go +++ /dev/null @@ -1,629 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - "errors" - "fmt" - "strconv" - "strings" - "sync" - "time" - - "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" - "go.etcd.io/etcd/client/pkg/v3/logutil" - "go.etcd.io/etcd/client/v3/credentials" - "go.etcd.io/etcd/client/v3/internal/endpoint" - "go.etcd.io/etcd/client/v3/internal/resolver" - "go.uber.org/zap" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - grpccredentials "google.golang.org/grpc/credentials" - "google.golang.org/grpc/keepalive" - "google.golang.org/grpc/status" -) - -var ( - ErrNoAvailableEndpoints = errors.New("etcdclient: no available endpoints") - ErrOldCluster = errors.New("etcdclient: old cluster version") -) - -// Client provides and manages an etcd v3 client session. -type Client struct { - Cluster - KV - Lease - Watcher - Auth - Maintenance - - conn *grpc.ClientConn - - cfg Config - creds grpccredentials.TransportCredentials - resolver *resolver.EtcdManualResolver - mu *sync.RWMutex - - ctx context.Context - cancel context.CancelFunc - - // Username is a user name for authentication. - Username string - // Password is a password for authentication. - Password string - authTokenBundle credentials.Bundle - - callOpts []grpc.CallOption - - lgMu *sync.RWMutex - lg *zap.Logger -} - -// New creates a new etcdv3 client from a given configuration. -func New(cfg Config) (*Client, error) { - if len(cfg.Endpoints) == 0 { - return nil, ErrNoAvailableEndpoints - } - - return newClient(&cfg) -} - -// NewCtxClient creates a client with a context but no underlying grpc -// connection. This is useful for embedded cases that override the -// service interface implementations and do not need connection management. -func NewCtxClient(ctx context.Context, opts ...Option) *Client { - cctx, cancel := context.WithCancel(ctx) - c := &Client{ctx: cctx, cancel: cancel, lgMu: new(sync.RWMutex), mu: new(sync.RWMutex)} - for _, opt := range opts { - opt(c) - } - if c.lg == nil { - c.lg = zap.NewNop() - } - return c -} - -// Option is a function type that can be passed as argument to NewCtxClient to configure client -type Option func(*Client) - -// NewFromURL creates a new etcdv3 client from a URL. -func NewFromURL(url string) (*Client, error) { - return New(Config{Endpoints: []string{url}}) -} - -// NewFromURLs creates a new etcdv3 client from URLs. -func NewFromURLs(urls []string) (*Client, error) { - return New(Config{Endpoints: urls}) -} - -// WithZapLogger is a NewCtxClient option that overrides the logger -func WithZapLogger(lg *zap.Logger) Option { - return func(c *Client) { - c.lg = lg - } -} - -// WithLogger overrides the logger. -// -// Deprecated: Please use WithZapLogger or Logger field in clientv3.Config -// -// Does not changes grpcLogger, that can be explicitly configured -// using grpc_zap.ReplaceGrpcLoggerV2(..) method. -func (c *Client) WithLogger(lg *zap.Logger) *Client { - c.lgMu.Lock() - c.lg = lg - c.lgMu.Unlock() - return c -} - -// GetLogger gets the logger. -// NOTE: This method is for internal use of etcd-client library and should not be used as general-purpose logger. -func (c *Client) GetLogger() *zap.Logger { - c.lgMu.RLock() - l := c.lg - c.lgMu.RUnlock() - return l -} - -// Close shuts down the client's etcd connections. -func (c *Client) Close() error { - c.cancel() - if c.Watcher != nil { - c.Watcher.Close() - } - if c.Lease != nil { - c.Lease.Close() - } - if c.conn != nil { - return ContextError(c.ctx, c.conn.Close()) - } - return c.ctx.Err() -} - -// Ctx is a context for "out of band" messages (e.g., for sending -// "clean up" message when another context is canceled). It is -// canceled on client Close(). -func (c *Client) Ctx() context.Context { return c.ctx } - -// Endpoints lists the registered endpoints for the client. -func (c *Client) Endpoints() []string { - // copy the slice; protect original endpoints from being changed - c.mu.RLock() - defer c.mu.RUnlock() - eps := make([]string, len(c.cfg.Endpoints)) - copy(eps, c.cfg.Endpoints) - return eps -} - -// SetEndpoints updates client's endpoints. -func (c *Client) SetEndpoints(eps ...string) { - c.mu.Lock() - defer c.mu.Unlock() - c.cfg.Endpoints = eps - - c.resolver.SetEndpoints(eps) -} - -// Sync synchronizes client's endpoints with the known endpoints from the etcd membership. -func (c *Client) Sync(ctx context.Context) error { - mresp, err := c.MemberList(ctx) - if err != nil { - return err - } - var eps []string - for _, m := range mresp.Members { - if len(m.Name) != 0 && !m.IsLearner { - eps = append(eps, m.ClientURLs...) - } - } - c.SetEndpoints(eps...) - return nil -} - -func (c *Client) autoSync() { - if c.cfg.AutoSyncInterval == time.Duration(0) { - return - } - - for { - select { - case <-c.ctx.Done(): - return - case <-time.After(c.cfg.AutoSyncInterval): - ctx, cancel := context.WithTimeout(c.ctx, 5*time.Second) - err := c.Sync(ctx) - cancel() - if err != nil && err != c.ctx.Err() { - c.lg.Info("Auto sync endpoints failed.", zap.Error(err)) - } - } - } -} - -// dialSetupOpts gives the dial opts prior to any authentication. -func (c *Client) dialSetupOpts(creds grpccredentials.TransportCredentials, dopts ...grpc.DialOption) (opts []grpc.DialOption, err error) { - if c.cfg.DialKeepAliveTime > 0 { - params := keepalive.ClientParameters{ - Time: c.cfg.DialKeepAliveTime, - Timeout: c.cfg.DialKeepAliveTimeout, - PermitWithoutStream: c.cfg.PermitWithoutStream, - } - opts = append(opts, grpc.WithKeepaliveParams(params)) - } - opts = append(opts, dopts...) - - if creds != nil { - opts = append(opts, grpc.WithTransportCredentials(creds)) - } else { - opts = append(opts, grpc.WithInsecure()) - } - - unaryMaxRetries := defaultUnaryMaxRetries - if c.cfg.MaxUnaryRetries > 0 { - unaryMaxRetries = c.cfg.MaxUnaryRetries - } - - backoffWaitBetween := defaultBackoffWaitBetween - if c.cfg.BackoffWaitBetween > 0 { - backoffWaitBetween = c.cfg.BackoffWaitBetween - } - - backoffJitterFraction := defaultBackoffJitterFraction - if c.cfg.BackoffJitterFraction > 0 { - backoffJitterFraction = c.cfg.BackoffJitterFraction - } - - // Interceptor retry and backoff. - // TODO: Replace all of clientv3/retry.go with RetryPolicy: - // https://github.com/grpc/grpc-proto/blob/cdd9ed5c3d3f87aef62f373b93361cf7bddc620d/grpc/service_config/service_config.proto#L130 - rrBackoff := withBackoff(c.roundRobinQuorumBackoff(backoffWaitBetween, backoffJitterFraction)) - opts = append(opts, - // Disable stream retry by default since go-grpc-middleware/retry does not support client streams. - // Streams that are safe to retry are enabled individually. - grpc.WithStreamInterceptor(c.streamClientInterceptor(withMax(0), rrBackoff)), - grpc.WithUnaryInterceptor(c.unaryClientInterceptor(withMax(unaryMaxRetries), rrBackoff)), - ) - - return opts, nil -} - -// Dial connects to a single endpoint using the client's config. -func (c *Client) Dial(ep string) (*grpc.ClientConn, error) { - creds := c.credentialsForEndpoint(ep) - - // Using ad-hoc created resolver, to guarantee only explicitly given - // endpoint is used. - return c.dial(creds, grpc.WithResolvers(resolver.New(ep))) -} - -func (c *Client) getToken(ctx context.Context) error { - var err error // return last error in a case of fail - - if c.Username == "" || c.Password == "" { - return nil - } - - resp, err := c.Auth.Authenticate(ctx, c.Username, c.Password) - if err != nil { - if err == rpctypes.ErrAuthNotEnabled { - c.authTokenBundle.UpdateAuthToken("") - return nil - } - return err - } - c.authTokenBundle.UpdateAuthToken(resp.Token) - return nil -} - -// dialWithBalancer dials the client's current load balanced resolver group. The scheme of the host -// of the provided endpoint determines the scheme used for all endpoints of the client connection. -func (c *Client) dialWithBalancer(dopts ...grpc.DialOption) (*grpc.ClientConn, error) { - creds := c.credentialsForEndpoint(c.Endpoints()[0]) - opts := append(dopts, grpc.WithResolvers(c.resolver)) - return c.dial(creds, opts...) -} - -// dial configures and dials any grpc balancer target. -func (c *Client) dial(creds grpccredentials.TransportCredentials, dopts ...grpc.DialOption) (*grpc.ClientConn, error) { - opts, err := c.dialSetupOpts(creds, dopts...) - if err != nil { - return nil, fmt.Errorf("failed to configure dialer: %v", err) - } - if c.authTokenBundle != nil { - opts = append(opts, grpc.WithPerRPCCredentials(c.authTokenBundle.PerRPCCredentials())) - } - - opts = append(opts, c.cfg.DialOptions...) - - dctx := c.ctx - if c.cfg.DialTimeout > 0 { - var cancel context.CancelFunc - dctx, cancel = context.WithTimeout(c.ctx, c.cfg.DialTimeout) - defer cancel() // TODO: Is this right for cases where grpc.WithBlock() is not set on the dial options? - } - target := fmt.Sprintf("%s://%p/%s", resolver.Schema, c, authority(c.Endpoints()[0])) - conn, err := grpc.DialContext(dctx, target, opts...) - if err != nil { - return nil, err - } - return conn, nil -} - -func authority(endpoint string) string { - spl := strings.SplitN(endpoint, "://", 2) - if len(spl) < 2 { - if strings.HasPrefix(endpoint, "unix:") { - return endpoint[len("unix:"):] - } - if strings.HasPrefix(endpoint, "unixs:") { - return endpoint[len("unixs:"):] - } - return endpoint - } - return spl[1] -} - -func (c *Client) credentialsForEndpoint(ep string) grpccredentials.TransportCredentials { - r := endpoint.RequiresCredentials(ep) - switch r { - case endpoint.CREDS_DROP: - return nil - case endpoint.CREDS_OPTIONAL: - return c.creds - case endpoint.CREDS_REQUIRE: - if c.creds != nil { - return c.creds - } - return credentials.NewBundle(credentials.Config{}).TransportCredentials() - default: - panic(fmt.Errorf("unsupported CredsRequirement: %v", r)) - } -} - -func newClient(cfg *Config) (*Client, error) { - if cfg == nil { - cfg = &Config{} - } - var creds grpccredentials.TransportCredentials - if cfg.TLS != nil { - creds = credentials.NewBundle(credentials.Config{TLSConfig: cfg.TLS}).TransportCredentials() - } - - // use a temporary skeleton client to bootstrap first connection - baseCtx := context.TODO() - if cfg.Context != nil { - baseCtx = cfg.Context - } - - ctx, cancel := context.WithCancel(baseCtx) - client := &Client{ - conn: nil, - cfg: *cfg, - creds: creds, - ctx: ctx, - cancel: cancel, - mu: new(sync.RWMutex), - callOpts: defaultCallOpts, - lgMu: new(sync.RWMutex), - } - - var err error - if cfg.Logger != nil { - client.lg = cfg.Logger - } else if cfg.LogConfig != nil { - client.lg, err = cfg.LogConfig.Build() - } else { - client.lg, err = logutil.CreateDefaultZapLogger(etcdClientDebugLevel()) - if client.lg != nil { - client.lg = client.lg.Named("etcd-client") - } - } - if err != nil { - return nil, err - } - - if cfg.Username != "" && cfg.Password != "" { - client.Username = cfg.Username - client.Password = cfg.Password - client.authTokenBundle = credentials.NewBundle(credentials.Config{}) - } - if cfg.MaxCallSendMsgSize > 0 || cfg.MaxCallRecvMsgSize > 0 { - if cfg.MaxCallRecvMsgSize > 0 && cfg.MaxCallSendMsgSize > cfg.MaxCallRecvMsgSize { - return nil, fmt.Errorf("gRPC message recv limit (%d bytes) must be greater than send limit (%d bytes)", cfg.MaxCallRecvMsgSize, cfg.MaxCallSendMsgSize) - } - callOpts := []grpc.CallOption{ - defaultWaitForReady, - defaultMaxCallSendMsgSize, - defaultMaxCallRecvMsgSize, - } - if cfg.MaxCallSendMsgSize > 0 { - callOpts[1] = grpc.MaxCallSendMsgSize(cfg.MaxCallSendMsgSize) - } - if cfg.MaxCallRecvMsgSize > 0 { - callOpts[2] = grpc.MaxCallRecvMsgSize(cfg.MaxCallRecvMsgSize) - } - client.callOpts = callOpts - } - - client.resolver = resolver.New(cfg.Endpoints...) - - if len(cfg.Endpoints) < 1 { - client.cancel() - return nil, fmt.Errorf("at least one Endpoint is required in client config") - } - // Use a provided endpoint target so that for https:// without any tls config given, then - // grpc will assume the certificate server name is the endpoint host. - conn, err := client.dialWithBalancer() - if err != nil { - client.cancel() - client.resolver.Close() - // TODO: Error like `fmt.Errorf(dialing [%s] failed: %v, strings.Join(cfg.Endpoints, ";"), err)` would help with debugging a lot. - return nil, err - } - client.conn = conn - - client.Cluster = NewCluster(client) - client.KV = NewKV(client) - client.Lease = NewLease(client) - client.Watcher = NewWatcher(client) - client.Auth = NewAuth(client) - client.Maintenance = NewMaintenance(client) - - //get token with established connection - ctx, cancel = client.ctx, func() {} - if client.cfg.DialTimeout > 0 { - ctx, cancel = context.WithTimeout(ctx, client.cfg.DialTimeout) - } - err = client.getToken(ctx) - if err != nil { - client.Close() - cancel() - //TODO: Consider fmt.Errorf("communicating with [%s] failed: %v", strings.Join(cfg.Endpoints, ";"), err) - return nil, err - } - cancel() - - if cfg.RejectOldCluster { - if err := client.checkVersion(); err != nil { - client.Close() - return nil, err - } - } - - go client.autoSync() - return client, nil -} - -// roundRobinQuorumBackoff retries against quorum between each backoff. -// This is intended for use with a round robin load balancer. -func (c *Client) roundRobinQuorumBackoff(waitBetween time.Duration, jitterFraction float64) backoffFunc { - return func(attempt uint) time.Duration { - // after each round robin across quorum, backoff for our wait between duration - n := uint(len(c.Endpoints())) - quorum := (n/2 + 1) - if attempt%quorum == 0 { - c.lg.Debug("backoff", zap.Uint("attempt", attempt), zap.Uint("quorum", quorum), zap.Duration("waitBetween", waitBetween), zap.Float64("jitterFraction", jitterFraction)) - return jitterUp(waitBetween, jitterFraction) - } - c.lg.Debug("backoff skipped", zap.Uint("attempt", attempt), zap.Uint("quorum", quorum)) - return 0 - } -} - -func (c *Client) checkVersion() (err error) { - var wg sync.WaitGroup - - eps := c.Endpoints() - errc := make(chan error, len(eps)) - ctx, cancel := context.WithCancel(c.ctx) - if c.cfg.DialTimeout > 0 { - cancel() - ctx, cancel = context.WithTimeout(c.ctx, c.cfg.DialTimeout) - } - - wg.Add(len(eps)) - for _, ep := range eps { - // if cluster is current, any endpoint gives a recent version - go func(e string) { - defer wg.Done() - resp, rerr := c.Status(ctx, e) - if rerr != nil { - errc <- rerr - return - } - vs := strings.Split(resp.Version, ".") - maj, min := 0, 0 - if len(vs) >= 2 { - var serr error - if maj, serr = strconv.Atoi(vs[0]); serr != nil { - errc <- serr - return - } - if min, serr = strconv.Atoi(vs[1]); serr != nil { - errc <- serr - return - } - } - if maj < 3 || (maj == 3 && min < 4) { - rerr = ErrOldCluster - } - errc <- rerr - }(ep) - } - // wait for success - for range eps { - if err = <-errc; err != nil { - break - } - } - cancel() - wg.Wait() - return err -} - -// ActiveConnection returns the current in-use connection -func (c *Client) ActiveConnection() *grpc.ClientConn { return c.conn } - -// isHaltErr returns true if the given error and context indicate no forward -// progress can be made, even after reconnecting. -func isHaltErr(ctx context.Context, err error) bool { - if ctx != nil && ctx.Err() != nil { - return true - } - if err == nil { - return false - } - ev, _ := status.FromError(err) - // Unavailable codes mean the system will be right back. - // (e.g., can't connect, lost leader) - // Treat Internal codes as if something failed, leaving the - // system in an inconsistent state, but retrying could make progress. - // (e.g., failed in middle of send, corrupted frame) - // TODO: are permanent Internal errors possible from grpc? - return ev.Code() != codes.Unavailable && ev.Code() != codes.Internal -} - -// isUnavailableErr returns true if the given error is an unavailable error -func isUnavailableErr(ctx context.Context, err error) bool { - if ctx != nil && ctx.Err() != nil { - return false - } - if err == nil { - return false - } - ev, ok := status.FromError(err) - if ok { - // Unavailable codes mean the system will be right back. - // (e.g., can't connect, lost leader) - return ev.Code() == codes.Unavailable - } - return false -} - -// ContextError converts the error into an EtcdError if the error message matches one of -// the defined messages; otherwise, it tries to retrieve the context error. -func ContextError(ctx context.Context, err error) error { - if err == nil { - return nil - } - err = rpctypes.Error(err) - if _, ok := err.(rpctypes.EtcdError); ok { - return err - } - if ev, ok := status.FromError(err); ok { - code := ev.Code() - switch code { - case codes.DeadlineExceeded: - fallthrough - case codes.Canceled: - if ctx.Err() != nil { - err = ctx.Err() - } - } - } - return err -} - -func canceledByCaller(stopCtx context.Context, err error) bool { - if stopCtx.Err() == nil || err == nil { - return false - } - - return err == context.Canceled || err == context.DeadlineExceeded -} - -// IsConnCanceled returns true, if error is from a closed gRPC connection. -// ref. https://github.com/grpc/grpc-go/pull/1854 -func IsConnCanceled(err error) bool { - if err == nil { - return false - } - - // >= gRPC v1.23.x - s, ok := status.FromError(err) - if ok { - // connection is canceled or server has already closed the connection - return s.Code() == codes.Canceled || s.Message() == "transport is closing" - } - - // >= gRPC v1.10.x - if err == context.Canceled { - return true - } - - // <= gRPC v1.7.x returns 'errors.New("grpc: the client connection is closing")' - return strings.Contains(err.Error(), "grpc: the client connection is closing") -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/cluster.go b/e2e/vendor/go.etcd.io/etcd/client/v3/cluster.go deleted file mode 100644 index 1815c1c96..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/cluster.go +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - - pb "go.etcd.io/etcd/api/v3/etcdserverpb" - "go.etcd.io/etcd/client/pkg/v3/types" - - "google.golang.org/grpc" -) - -type ( - Member pb.Member - MemberListResponse pb.MemberListResponse - MemberAddResponse pb.MemberAddResponse - MemberRemoveResponse pb.MemberRemoveResponse - MemberUpdateResponse pb.MemberUpdateResponse - MemberPromoteResponse pb.MemberPromoteResponse -) - -type Cluster interface { - // MemberList lists the current cluster membership. - MemberList(ctx context.Context) (*MemberListResponse, error) - - // MemberAdd adds a new member into the cluster. - MemberAdd(ctx context.Context, peerAddrs []string) (*MemberAddResponse, error) - - // MemberAddAsLearner adds a new learner member into the cluster. - MemberAddAsLearner(ctx context.Context, peerAddrs []string) (*MemberAddResponse, error) - - // MemberRemove removes an existing member from the cluster. - MemberRemove(ctx context.Context, id uint64) (*MemberRemoveResponse, error) - - // MemberUpdate updates the peer addresses of the member. - MemberUpdate(ctx context.Context, id uint64, peerAddrs []string) (*MemberUpdateResponse, error) - - // MemberPromote promotes a member from raft learner (non-voting) to raft voting member. - MemberPromote(ctx context.Context, id uint64) (*MemberPromoteResponse, error) -} - -type cluster struct { - remote pb.ClusterClient - callOpts []grpc.CallOption -} - -func NewCluster(c *Client) Cluster { - api := &cluster{remote: RetryClusterClient(c)} - if c != nil { - api.callOpts = c.callOpts - } - return api -} - -func NewClusterFromClusterClient(remote pb.ClusterClient, c *Client) Cluster { - api := &cluster{remote: remote} - if c != nil { - api.callOpts = c.callOpts - } - return api -} - -func (c *cluster) MemberAdd(ctx context.Context, peerAddrs []string) (*MemberAddResponse, error) { - return c.memberAdd(ctx, peerAddrs, false) -} - -func (c *cluster) MemberAddAsLearner(ctx context.Context, peerAddrs []string) (*MemberAddResponse, error) { - return c.memberAdd(ctx, peerAddrs, true) -} - -func (c *cluster) memberAdd(ctx context.Context, peerAddrs []string, isLearner bool) (*MemberAddResponse, error) { - // fail-fast before panic in rafthttp - if _, err := types.NewURLs(peerAddrs); err != nil { - return nil, err - } - - r := &pb.MemberAddRequest{ - PeerURLs: peerAddrs, - IsLearner: isLearner, - } - resp, err := c.remote.MemberAdd(ctx, r, c.callOpts...) - if err != nil { - return nil, ContextError(ctx, err) - } - return (*MemberAddResponse)(resp), nil -} - -func (c *cluster) MemberRemove(ctx context.Context, id uint64) (*MemberRemoveResponse, error) { - r := &pb.MemberRemoveRequest{ID: id} - resp, err := c.remote.MemberRemove(ctx, r, c.callOpts...) - if err != nil { - return nil, ContextError(ctx, err) - } - return (*MemberRemoveResponse)(resp), nil -} - -func (c *cluster) MemberUpdate(ctx context.Context, id uint64, peerAddrs []string) (*MemberUpdateResponse, error) { - // fail-fast before panic in rafthttp - if _, err := types.NewURLs(peerAddrs); err != nil { - return nil, err - } - - // it is safe to retry on update. - r := &pb.MemberUpdateRequest{ID: id, PeerURLs: peerAddrs} - resp, err := c.remote.MemberUpdate(ctx, r, c.callOpts...) - if err == nil { - return (*MemberUpdateResponse)(resp), nil - } - return nil, ContextError(ctx, err) -} - -func (c *cluster) MemberList(ctx context.Context) (*MemberListResponse, error) { - // it is safe to retry on list. - resp, err := c.remote.MemberList(ctx, &pb.MemberListRequest{Linearizable: true}, c.callOpts...) - if err == nil { - return (*MemberListResponse)(resp), nil - } - return nil, ContextError(ctx, err) -} - -func (c *cluster) MemberPromote(ctx context.Context, id uint64) (*MemberPromoteResponse, error) { - r := &pb.MemberPromoteRequest{ID: id} - resp, err := c.remote.MemberPromote(ctx, r, c.callOpts...) - if err != nil { - return nil, ContextError(ctx, err) - } - return (*MemberPromoteResponse)(resp), nil -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/compact_op.go b/e2e/vendor/go.etcd.io/etcd/client/v3/compact_op.go deleted file mode 100644 index a6e660aa8..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/compact_op.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - pb "go.etcd.io/etcd/api/v3/etcdserverpb" -) - -// CompactOp represents a compact operation. -type CompactOp struct { - revision int64 - physical bool -} - -// CompactOption configures compact operation. -type CompactOption func(*CompactOp) - -func (op *CompactOp) applyCompactOpts(opts []CompactOption) { - for _, opt := range opts { - opt(op) - } -} - -// OpCompact wraps slice CompactOption to create a CompactOp. -func OpCompact(rev int64, opts ...CompactOption) CompactOp { - ret := CompactOp{revision: rev} - ret.applyCompactOpts(opts) - return ret -} - -func (op CompactOp) toRequest() *pb.CompactionRequest { - return &pb.CompactionRequest{Revision: op.revision, Physical: op.physical} -} - -// WithCompactPhysical makes Compact wait until all compacted entries are -// removed from the etcd server's storage. -func WithCompactPhysical() CompactOption { - return func(op *CompactOp) { op.physical = true } -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/compare.go b/e2e/vendor/go.etcd.io/etcd/client/v3/compare.go deleted file mode 100644 index e2967cf38..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/compare.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - pb "go.etcd.io/etcd/api/v3/etcdserverpb" -) - -type CompareTarget int -type CompareResult int - -const ( - CompareVersion CompareTarget = iota - CompareCreated - CompareModified - CompareValue -) - -type Cmp pb.Compare - -func Compare(cmp Cmp, result string, v interface{}) Cmp { - var r pb.Compare_CompareResult - - switch result { - case "=": - r = pb.Compare_EQUAL - case "!=": - r = pb.Compare_NOT_EQUAL - case ">": - r = pb.Compare_GREATER - case "<": - r = pb.Compare_LESS - default: - panic("Unknown result op") - } - - cmp.Result = r - switch cmp.Target { - case pb.Compare_VALUE: - val, ok := v.(string) - if !ok { - panic("bad compare value") - } - cmp.TargetUnion = &pb.Compare_Value{Value: []byte(val)} - case pb.Compare_VERSION: - cmp.TargetUnion = &pb.Compare_Version{Version: mustInt64(v)} - case pb.Compare_CREATE: - cmp.TargetUnion = &pb.Compare_CreateRevision{CreateRevision: mustInt64(v)} - case pb.Compare_MOD: - cmp.TargetUnion = &pb.Compare_ModRevision{ModRevision: mustInt64(v)} - case pb.Compare_LEASE: - cmp.TargetUnion = &pb.Compare_Lease{Lease: mustInt64orLeaseID(v)} - default: - panic("Unknown compare type") - } - return cmp -} - -func Value(key string) Cmp { - return Cmp{Key: []byte(key), Target: pb.Compare_VALUE} -} - -func Version(key string) Cmp { - return Cmp{Key: []byte(key), Target: pb.Compare_VERSION} -} - -func CreateRevision(key string) Cmp { - return Cmp{Key: []byte(key), Target: pb.Compare_CREATE} -} - -func ModRevision(key string) Cmp { - return Cmp{Key: []byte(key), Target: pb.Compare_MOD} -} - -// LeaseValue compares a key's LeaseID to a value of your choosing. The empty -// LeaseID is 0, otherwise known as `NoLease`. -func LeaseValue(key string) Cmp { - return Cmp{Key: []byte(key), Target: pb.Compare_LEASE} -} - -// KeyBytes returns the byte slice holding with the comparison key. -func (cmp *Cmp) KeyBytes() []byte { return cmp.Key } - -// WithKeyBytes sets the byte slice for the comparison key. -func (cmp *Cmp) WithKeyBytes(key []byte) { cmp.Key = key } - -// ValueBytes returns the byte slice holding the comparison value, if any. -func (cmp *Cmp) ValueBytes() []byte { - if tu, ok := cmp.TargetUnion.(*pb.Compare_Value); ok { - return tu.Value - } - return nil -} - -// WithValueBytes sets the byte slice for the comparison's value. -func (cmp *Cmp) WithValueBytes(v []byte) { cmp.TargetUnion.(*pb.Compare_Value).Value = v } - -// WithRange sets the comparison to scan the range [key, end). -func (cmp Cmp) WithRange(end string) Cmp { - cmp.RangeEnd = []byte(end) - return cmp -} - -// WithPrefix sets the comparison to scan all keys prefixed by the key. -func (cmp Cmp) WithPrefix() Cmp { - cmp.RangeEnd = getPrefix(cmp.Key) - return cmp -} - -// mustInt64 panics if val isn't an int or int64. It returns an int64 otherwise. -func mustInt64(val interface{}) int64 { - if v, ok := val.(int64); ok { - return v - } - if v, ok := val.(int); ok { - return int64(v) - } - panic("bad value") -} - -// mustInt64orLeaseID panics if val isn't a LeaseID, int or int64. It returns an -// int64 otherwise. -func mustInt64orLeaseID(val interface{}) int64 { - if v, ok := val.(LeaseID); ok { - return int64(v) - } - return mustInt64(val) -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/config.go b/e2e/vendor/go.etcd.io/etcd/client/v3/config.go deleted file mode 100644 index 6f5b41978..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/config.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - "crypto/tls" - "time" - - "go.uber.org/zap" - "google.golang.org/grpc" -) - -type Config struct { - // Endpoints is a list of URLs. - Endpoints []string `json:"endpoints"` - - // AutoSyncInterval is the interval to update endpoints with its latest members. - // 0 disables auto-sync. By default auto-sync is disabled. - AutoSyncInterval time.Duration `json:"auto-sync-interval"` - - // DialTimeout is the timeout for failing to establish a connection. - DialTimeout time.Duration `json:"dial-timeout"` - - // DialKeepAliveTime is the time after which client pings the server to see if - // transport is alive. - DialKeepAliveTime time.Duration `json:"dial-keep-alive-time"` - - // DialKeepAliveTimeout is the time that the client waits for a response for the - // keep-alive probe. If the response is not received in this time, the connection is closed. - DialKeepAliveTimeout time.Duration `json:"dial-keep-alive-timeout"` - - // MaxCallSendMsgSize is the client-side request send limit in bytes. - // If 0, it defaults to 2.0 MiB (2 * 1024 * 1024). - // Make sure that "MaxCallSendMsgSize" < server-side default send/recv limit. - // ("--max-request-bytes" flag to etcd or "embed.Config.MaxRequestBytes"). - MaxCallSendMsgSize int - - // MaxCallRecvMsgSize is the client-side response receive limit. - // If 0, it defaults to "math.MaxInt32", because range response can - // easily exceed request send limits. - // Make sure that "MaxCallRecvMsgSize" >= server-side default send/recv limit. - // ("--max-request-bytes" flag to etcd or "embed.Config.MaxRequestBytes"). - MaxCallRecvMsgSize int - - // TLS holds the client secure credentials, if any. - TLS *tls.Config - - // Username is a user name for authentication. - Username string `json:"username"` - - // Password is a password for authentication. - Password string `json:"password"` - - // RejectOldCluster when set will refuse to create a client against an outdated cluster. - RejectOldCluster bool `json:"reject-old-cluster"` - - // DialOptions is a list of dial options for the grpc client (e.g., for interceptors). - // For example, pass "grpc.WithBlock()" to block until the underlying connection is up. - // Without this, Dial returns immediately and connecting the server happens in background. - DialOptions []grpc.DialOption - - // Context is the default client context; it can be used to cancel grpc dial out and - // other operations that do not have an explicit context. - Context context.Context - - // Logger sets client-side logger. - // If nil, fallback to building LogConfig. - Logger *zap.Logger - - // LogConfig configures client-side logger. - // If nil, use the default logger. - // TODO: configure gRPC logger - LogConfig *zap.Config - - // PermitWithoutStream when set will allow client to send keepalive pings to server without any active streams(RPCs). - PermitWithoutStream bool `json:"permit-without-stream"` - - // MaxUnaryRetries is the maximum number of retries for unary RPCs. - MaxUnaryRetries uint `json:"max-unary-retries"` - - // BackoffWaitBetween is the wait time before retrying an RPC. - BackoffWaitBetween time.Duration `json:"backoff-wait-between"` - - // BackoffJitterFraction is the jitter fraction to randomize backoff wait time. - BackoffJitterFraction float64 `json:"backoff-jitter-fraction"` - - // TODO: support custom balancer picker -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/credentials/credentials.go b/e2e/vendor/go.etcd.io/etcd/client/v3/credentials/credentials.go deleted file mode 100644 index 42f688eb3..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/credentials/credentials.go +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2019 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package credentials implements gRPC credential interface with etcd specific logic. -// e.g., client handshake with custom authority parameter -package credentials - -import ( - "context" - "crypto/tls" - "net" - "sync" - - "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" - grpccredentials "google.golang.org/grpc/credentials" -) - -// Config defines gRPC credential configuration. -type Config struct { - TLSConfig *tls.Config -} - -// Bundle defines gRPC credential interface. -type Bundle interface { - grpccredentials.Bundle - UpdateAuthToken(token string) -} - -// NewBundle constructs a new gRPC credential bundle. -func NewBundle(cfg Config) Bundle { - return &bundle{ - tc: newTransportCredential(cfg.TLSConfig), - rc: newPerRPCCredential(), - } -} - -// bundle implements "grpccredentials.Bundle" interface. -type bundle struct { - tc *transportCredential - rc *perRPCCredential -} - -func (b *bundle) TransportCredentials() grpccredentials.TransportCredentials { - return b.tc -} - -func (b *bundle) PerRPCCredentials() grpccredentials.PerRPCCredentials { - return b.rc -} - -func (b *bundle) NewWithMode(mode string) (grpccredentials.Bundle, error) { - // no-op - return nil, nil -} - -// transportCredential implements "grpccredentials.TransportCredentials" interface. -type transportCredential struct { - gtc grpccredentials.TransportCredentials -} - -func newTransportCredential(cfg *tls.Config) *transportCredential { - return &transportCredential{ - gtc: grpccredentials.NewTLS(cfg), - } -} - -func (tc *transportCredential) ClientHandshake(ctx context.Context, authority string, rawConn net.Conn) (net.Conn, grpccredentials.AuthInfo, error) { - return tc.gtc.ClientHandshake(ctx, authority, rawConn) -} - -func (tc *transportCredential) ServerHandshake(rawConn net.Conn) (net.Conn, grpccredentials.AuthInfo, error) { - return tc.gtc.ServerHandshake(rawConn) -} - -func (tc *transportCredential) Info() grpccredentials.ProtocolInfo { - return tc.gtc.Info() -} - -func (tc *transportCredential) Clone() grpccredentials.TransportCredentials { - return &transportCredential{ - gtc: tc.gtc.Clone(), - } -} - -func (tc *transportCredential) OverrideServerName(serverNameOverride string) error { - return tc.gtc.OverrideServerName(serverNameOverride) -} - -// perRPCCredential implements "grpccredentials.PerRPCCredentials" interface. -type perRPCCredential struct { - authToken string - authTokenMu sync.RWMutex -} - -func newPerRPCCredential() *perRPCCredential { return &perRPCCredential{} } - -func (rc *perRPCCredential) RequireTransportSecurity() bool { return false } - -func (rc *perRPCCredential) GetRequestMetadata(ctx context.Context, s ...string) (map[string]string, error) { - rc.authTokenMu.RLock() - authToken := rc.authToken - rc.authTokenMu.RUnlock() - if authToken == "" { - return nil, nil - } - return map[string]string{rpctypes.TokenFieldNameGRPC: authToken}, nil -} - -func (b *bundle) UpdateAuthToken(token string) { - if b.rc == nil { - return - } - b.rc.UpdateAuthToken(token) -} - -func (rc *perRPCCredential) UpdateAuthToken(token string) { - rc.authTokenMu.Lock() - rc.authToken = token - rc.authTokenMu.Unlock() -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/ctx.go b/e2e/vendor/go.etcd.io/etcd/client/v3/ctx.go deleted file mode 100644 index 56b69cf2e..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/ctx.go +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2020 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - - "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" - "go.etcd.io/etcd/api/v3/version" - "google.golang.org/grpc/metadata" -) - -// WithRequireLeader requires client requests to only succeed -// when the cluster has a leader. -func WithRequireLeader(ctx context.Context) context.Context { - md, ok := metadata.FromOutgoingContext(ctx) - if !ok { // no outgoing metadata ctx key, create one - md = metadata.Pairs(rpctypes.MetadataRequireLeaderKey, rpctypes.MetadataHasLeader) - return metadata.NewOutgoingContext(ctx, md) - } - copied := md.Copy() // avoid racey updates - // overwrite/add 'hasleader' key/value - copied.Set(rpctypes.MetadataRequireLeaderKey, rpctypes.MetadataHasLeader) - return metadata.NewOutgoingContext(ctx, copied) -} - -// embeds client version -func withVersion(ctx context.Context) context.Context { - md, ok := metadata.FromOutgoingContext(ctx) - if !ok { // no outgoing metadata ctx key, create one - md = metadata.Pairs(rpctypes.MetadataClientAPIVersionKey, version.APIVersion) - return metadata.NewOutgoingContext(ctx, md) - } - copied := md.Copy() // avoid racey updates - // overwrite/add version key/value - copied.Set(rpctypes.MetadataClientAPIVersionKey, version.APIVersion) - return metadata.NewOutgoingContext(ctx, copied) -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/doc.go b/e2e/vendor/go.etcd.io/etcd/client/v3/doc.go deleted file mode 100644 index fd61aff11..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/doc.go +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package clientv3 implements the official Go etcd client for v3. -// -// Create client using `clientv3.New`: -// -// // expect dial time-out on ipv4 blackhole -// _, err := clientv3.New(clientv3.Config{ -// Endpoints: []string{"http://254.0.0.1:12345"}, -// DialTimeout: 2 * time.Second, -// }) -// -// // etcd clientv3 >= v3.2.10, grpc/grpc-go >= v1.7.3 -// if err == context.DeadlineExceeded { -// // handle errors -// } -// -// // etcd clientv3 <= v3.2.9, grpc/grpc-go <= v1.2.1 -// if err == grpc.ErrClientConnTimeout { -// // handle errors -// } -// -// cli, err := clientv3.New(clientv3.Config{ -// Endpoints: []string{"localhost:2379", "localhost:22379", "localhost:32379"}, -// DialTimeout: 5 * time.Second, -// }) -// if err != nil { -// // handle error! -// } -// defer cli.Close() -// -// Make sure to close the client after using it. If the client is not closed, the -// connection will have leaky goroutines. -// -// To specify a client request timeout, wrap the context with context.WithTimeout: -// -// ctx, cancel := context.WithTimeout(context.Background(), timeout) -// resp, err := kvc.Put(ctx, "sample_key", "sample_value") -// cancel() -// if err != nil { -// // handle error! -// } -// // use the response -// -// The Client has internal state (watchers and leases), so Clients should be reused instead of created as needed. -// Clients are safe for concurrent use by multiple goroutines. -// -// etcd client returns 2 types of errors: -// -// 1. context error: canceled or deadline exceeded. -// 2. gRPC error: e.g. when clock drifts in server-side before client's context deadline exceeded. -// -// See https://github.com/etcd-io/etcd/blob/main/api/v3rpc/rpctypes/error.go -// -// Here is the example code to handle client errors: -// -// resp, err := kvc.Put(ctx, "", "") -// if err != nil { -// if err == context.Canceled { -// // ctx is canceled by another routine -// } else if err == context.DeadlineExceeded { -// // ctx is attached with a deadline and it exceeded -// } else if err == rpctypes.ErrEmptyKey { -// // client-side error: key is not provided -// } else if ev, ok := status.FromError(err); ok { -// code := ev.Code() -// if code == codes.DeadlineExceeded { -// // server-side context might have timed-out first (due to clock skew) -// // while original client-side context is not timed-out yet -// } -// } else { -// // bad cluster endpoints, which are not etcd servers -// } -// } -// -// go func() { cli.Close() }() -// _, err := kvc.Get(ctx, "a") -// if err != nil { -// // with etcd clientv3 <= v3.3 -// if err == context.Canceled { -// // grpc balancer calls 'Get' with an inflight client.Close -// } else if err == grpc.ErrClientConnClosing { // <= gRCP v1.7.x -// // grpc balancer calls 'Get' after client.Close. -// } -// // with etcd clientv3 >= v3.4 -// if clientv3.IsConnCanceled(err) { -// // gRPC client connection is closed -// } -// } -// -// The grpc load balancer is registered statically and is shared across etcd clients. -// To enable detailed load balancer logging, set the ETCD_CLIENT_DEBUG environment -// variable. E.g. "ETCD_CLIENT_DEBUG=1". -package clientv3 diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/internal/endpoint/endpoint.go b/e2e/vendor/go.etcd.io/etcd/client/v3/internal/endpoint/endpoint.go deleted file mode 100644 index 35a3fe8c3..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/internal/endpoint/endpoint.go +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2021 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package endpoint - -import ( - "fmt" - "net" - "net/url" - "path" - "strings" -) - -type CredsRequirement int - -const ( - // CREDS_REQUIRE - Credentials/certificate required for thi type of connection. - CREDS_REQUIRE CredsRequirement = iota - // CREDS_DROP - Credentials/certificate not needed and should get ignored. - CREDS_DROP - // CREDS_OPTIONAL - Credentials/certificate might be used if supplied - CREDS_OPTIONAL -) - -func extractHostFromHostPort(ep string) string { - host, _, err := net.SplitHostPort(ep) - if err != nil { - return ep - } - return host -} - -// mustSplit2 returns the values from strings.SplitN(s, sep, 2). -// If sep is not found, it returns ("", "", false) instead. -func mustSplit2(s, sep string) (string, string) { - spl := strings.SplitN(s, sep, 2) - if len(spl) < 2 { - panic(fmt.Errorf("token '%v' expected to have separator sep: `%v`", s, sep)) - } - return spl[0], spl[1] -} - -func schemeToCredsRequirement(schema string) CredsRequirement { - switch schema { - case "https", "unixs": - return CREDS_REQUIRE - case "http": - return CREDS_DROP - case "unix": - // Preserving previous behavior from: - // https://github.com/etcd-io/etcd/blob/dae29bb719dd69dc119146fc297a0628fcc1ccf8/client/v3/client.go#L212 - // that likely was a bug due to missing 'fallthrough'. - // At the same time it seems legit to let the users decide whether they - // want credential control or not (and 'unixs' schema is not a standard thing). - return CREDS_OPTIONAL - case "": - return CREDS_OPTIONAL - default: - return CREDS_OPTIONAL - } -} - -// This function translates endpoints names supported by etcd server into -// endpoints as supported by grpc with additional information -// (server_name for cert validation, requireCreds - whether certs are needed). -// The main differences: -// - etcd supports unixs & https names as opposed to unix & http to -// distinguish need to configure certificates. -// - etcd support http(s) names as opposed to tcp supported by grpc/dial method. -// - etcd supports unix(s)://local-file naming schema -// (as opposed to unix:local-file canonical name used by grpc for current dir files). -// - Within the unix(s) schemas, the last segment (filename) without 'port' (content after colon) -// is considered serverName - to allow local testing of cert-protected communication. -// -// See more: -// - https://github.com/grpc/grpc-go/blob/26c143bd5f59344a4b8a1e491e0f5e18aa97abc7/internal/grpcutil/target.go#L47 -// - https://golang.org/pkg/net/#Dial -// - https://github.com/grpc/grpc/blob/master/doc/naming.md -func translateEndpoint(ep string) (addr string, serverName string, requireCreds CredsRequirement) { - if strings.HasPrefix(ep, "unix:") || strings.HasPrefix(ep, "unixs:") { - if strings.HasPrefix(ep, "unix:///") || strings.HasPrefix(ep, "unixs:///") { - // absolute path case - schema, absolutePath := mustSplit2(ep, "://") - return "unix://" + absolutePath, path.Base(absolutePath), schemeToCredsRequirement(schema) - } - if strings.HasPrefix(ep, "unix://") || strings.HasPrefix(ep, "unixs://") { - // legacy etcd local path - schema, localPath := mustSplit2(ep, "://") - return "unix:" + localPath, path.Base(localPath), schemeToCredsRequirement(schema) - } - schema, localPath := mustSplit2(ep, ":") - return "unix:" + localPath, path.Base(localPath), schemeToCredsRequirement(schema) - } - - if strings.Contains(ep, "://") { - url, err := url.Parse(ep) - if err != nil { - return ep, ep, CREDS_OPTIONAL - } - if url.Scheme == "http" || url.Scheme == "https" { - return url.Host, url.Host, schemeToCredsRequirement(url.Scheme) - } - return ep, url.Host, schemeToCredsRequirement(url.Scheme) - } - // Handles plain addresses like 10.0.0.44:437. - return ep, ep, CREDS_OPTIONAL -} - -// RequiresCredentials returns whether given endpoint requires -// credentials/certificates for connection. -func RequiresCredentials(ep string) CredsRequirement { - _, _, requireCreds := translateEndpoint(ep) - return requireCreds -} - -// Interpret endpoint parses an endpoint of the form -// (http|https)://*|(unix|unixs)://) -// and returns low-level address (supported by 'net') to connect to, -// and a server name used for x509 certificate matching. -func Interpret(ep string) (address string, serverName string) { - addr, serverName, _ := translateEndpoint(ep) - return addr, serverName -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/internal/resolver/resolver.go b/e2e/vendor/go.etcd.io/etcd/client/v3/internal/resolver/resolver.go deleted file mode 100644 index 3ee3cb8e2..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/internal/resolver/resolver.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2021 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package resolver - -import ( - "go.etcd.io/etcd/client/v3/internal/endpoint" - "google.golang.org/grpc/resolver" - "google.golang.org/grpc/resolver/manual" - "google.golang.org/grpc/serviceconfig" -) - -const ( - Schema = "etcd-endpoints" -) - -// EtcdManualResolver is a Resolver (and resolver.Builder) that can be updated -// using SetEndpoints. -type EtcdManualResolver struct { - *manual.Resolver - endpoints []string - serviceConfig *serviceconfig.ParseResult -} - -func New(endpoints ...string) *EtcdManualResolver { - r := manual.NewBuilderWithScheme(Schema) - return &EtcdManualResolver{Resolver: r, endpoints: endpoints, serviceConfig: nil} -} - -// Build returns itself for Resolver, because it's both a builder and a resolver. -func (r *EtcdManualResolver) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) { - r.serviceConfig = cc.ParseServiceConfig(`{"loadBalancingPolicy": "round_robin"}`) - if r.serviceConfig.Err != nil { - return nil, r.serviceConfig.Err - } - res, err := r.Resolver.Build(target, cc, opts) - if err != nil { - return nil, err - } - // Populates endpoints stored in r into ClientConn (cc). - r.updateState() - return res, nil -} - -func (r *EtcdManualResolver) SetEndpoints(endpoints []string) { - r.endpoints = endpoints - r.updateState() -} - -func (r EtcdManualResolver) updateState() { - if r.CC != nil { - addresses := make([]resolver.Address, len(r.endpoints)) - for i, ep := range r.endpoints { - addr, serverName := endpoint.Interpret(ep) - addresses[i] = resolver.Address{Addr: addr, ServerName: serverName} - } - state := resolver.State{ - Addresses: addresses, - ServiceConfig: r.serviceConfig, - } - r.UpdateState(state) - } -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/kubernetes/client.go b/e2e/vendor/go.etcd.io/etcd/client/v3/kubernetes/client.go deleted file mode 100644 index 11f2a4564..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/kubernetes/client.go +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright 2024 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package kubernetes - -import ( - "context" - "fmt" - - pb "go.etcd.io/etcd/api/v3/etcdserverpb" - "go.etcd.io/etcd/api/v3/mvccpb" - clientv3 "go.etcd.io/etcd/client/v3" -) - -// New creates Client from config. -// Caller is responsible to call Close() to clean up client. -func New(cfg clientv3.Config) (*Client, error) { - c, err := clientv3.New(cfg) - if err != nil { - return nil, err - } - kc := &Client{ - Client: c, - } - kc.Kubernetes = kc - return kc, nil -} - -type Client struct { - *clientv3.Client - Kubernetes Interface -} - -var _ Interface = (*Client)(nil) - -func (k Client) Get(ctx context.Context, key string, opts GetOptions) (resp GetResponse, err error) { - rangeResp, err := k.KV.Get(ctx, key, clientv3.WithRev(opts.Revision), clientv3.WithLimit(1)) - if err != nil { - return resp, err - } - resp.Revision = rangeResp.Header.Revision - if len(rangeResp.Kvs) == 1 { - resp.KV = rangeResp.Kvs[0] - } - return resp, nil -} - -func (k Client) List(ctx context.Context, prefix string, opts ListOptions) (resp ListResponse, err error) { - rangeStart := prefix - if opts.Continue != "" { - rangeStart = opts.Continue - } - rangeEnd := clientv3.GetPrefixRangeEnd(prefix) - rangeResp, err := k.KV.Get(ctx, rangeStart, clientv3.WithRange(rangeEnd), clientv3.WithLimit(opts.Limit), clientv3.WithRev(opts.Revision)) - if err != nil { - return resp, err - } - resp.Kvs = rangeResp.Kvs - resp.Count = rangeResp.Count - resp.Revision = rangeResp.Header.Revision - return resp, nil -} - -func (k Client) Count(ctx context.Context, prefix string, _ CountOptions) (int64, error) { - resp, err := k.KV.Get(ctx, prefix, clientv3.WithPrefix(), clientv3.WithCountOnly()) - if err != nil { - return 0, err - } - return resp.Count, nil -} - -func (k Client) OptimisticPut(ctx context.Context, key string, value []byte, expectedRevision int64, opts PutOptions) (resp PutResponse, err error) { - txn := k.KV.Txn(ctx).If( - clientv3.Compare(clientv3.ModRevision(key), "=", expectedRevision), - ).Then( - clientv3.OpPut(key, string(value), clientv3.WithLease(opts.LeaseID)), - ) - - if opts.GetOnFailure { - txn = txn.Else(clientv3.OpGet(key)) - } - - txnResp, err := txn.Commit() - if err != nil { - return resp, err - } - resp.Succeeded = txnResp.Succeeded - resp.Revision = txnResp.Header.Revision - if opts.GetOnFailure && !txnResp.Succeeded { - if len(txnResp.Responses) == 0 { - return resp, fmt.Errorf("invalid OptimisticPut response: %v", txnResp.Responses) - } - resp.KV = kvFromTxnResponse(txnResp.Responses[0]) - } - return resp, nil -} - -func (k Client) OptimisticDelete(ctx context.Context, key string, expectedRevision int64, opts DeleteOptions) (resp DeleteResponse, err error) { - txn := k.KV.Txn(ctx).If( - clientv3.Compare(clientv3.ModRevision(key), "=", expectedRevision), - ).Then( - clientv3.OpDelete(key), - ) - if opts.GetOnFailure { - txn = txn.Else(clientv3.OpGet(key)) - } - txnResp, err := txn.Commit() - if err != nil { - return resp, err - } - resp.Succeeded = txnResp.Succeeded - resp.Revision = txnResp.Header.Revision - if opts.GetOnFailure && !txnResp.Succeeded { - resp.KV = kvFromTxnResponse(txnResp.Responses[0]) - } - return resp, nil -} - -func kvFromTxnResponse(resp *pb.ResponseOp) *mvccpb.KeyValue { - getResponse := resp.GetResponseRange() - if len(getResponse.Kvs) == 1 { - return getResponse.Kvs[0] - } - return nil -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/kubernetes/interface.go b/e2e/vendor/go.etcd.io/etcd/client/v3/kubernetes/interface.go deleted file mode 100644 index 19b82a629..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/kubernetes/interface.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2024 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package kubernetes - -import ( - "context" - - "go.etcd.io/etcd/api/v3/mvccpb" - clientv3 "go.etcd.io/etcd/client/v3" -) - -// Interface defines the minimal client-side interface that Kubernetes requires -// to interact with etcd. Methods below are standard etcd operations with -// semantics adjusted to better suit Kubernetes' needs. -type Interface interface { - // Get retrieves a single key-value pair from etcd. - // - // If opts.Revision is set to a non-zero value, the key-value pair is retrieved at the specified revision. - // If the required revision has been compacted, the request will fail with ErrCompacted. - Get(ctx context.Context, key string, opts GetOptions) (GetResponse, error) - - // List retrieves key-value pairs with the specified prefix, ordered lexicographically by key. - // - // If opts.Revision is non-zero, the key-value pairs are retrieved at the specified revision. - // If the required revision has been compacted, the request will fail with ErrCompacted. - // If opts.Limit is greater than zero, the number of returned key-value pairs is bounded by the limit. - // If opts.Continue is not empty, the listing will start from the key immediately after the one specified by Continue. - // The Continue value should be the last key returned in a previous paginated ListResponse. - List(ctx context.Context, prefix string, opts ListOptions) (ListResponse, error) - - // Count returns the number of keys with the specified prefix. - // - // Currently, there are no options for the Count operation. However, a placeholder options struct (CountOptions) - // is provided for future extensibility in case options become necessary. - Count(ctx context.Context, prefix string, opts CountOptions) (int64, error) - - // OptimisticPut creates or updates a key-value pair if the key has not been modified or created - // since the revision specified in expectedRevision. - // - // An OptimisticPut fails if the key has been modified since expectedRevision. - OptimisticPut(ctx context.Context, key string, value []byte, expectedRevision int64, opts PutOptions) (PutResponse, error) - - // OptimisticDelete deletes the key-value pair if it hasn't been modified since the revision - // specified in expectedRevision. - // - // An OptimisticDelete fails if the key has been modified since expectedRevision. - OptimisticDelete(ctx context.Context, key string, expectedRevision int64, opts DeleteOptions) (DeleteResponse, error) -} - -type GetOptions struct { - // Revision is the point-in-time of the etcd key-value store to use for the Get operation. - // If Revision is 0, it gets the latest value. - Revision int64 -} - -type ListOptions struct { - // Revision is the point-in-time of the etcd key-value store to use for the List operation. - // If Revision is 0, it gets the latest values. - Revision int64 - - // Limit is the maximum number of keys to return for a List operation. - // 0 means no limitation. - Limit int64 - - // Continue is a key from which to resume the List operation, excluding the given key. - // It should be set to the last key from a previous ListResponse when paginating. - Continue string -} - -// CountOptions is a placeholder for potential future options for the Count operation. -type CountOptions struct{} - -type PutOptions struct { - // GetOnFailure specifies whether to return the modified key-value pair if the Put operation fails due to a revision mismatch. - GetOnFailure bool - - // LeaseID is the ID of a lease to associate with the key allowing for automatic deletion after lease expires after it's TTL (time to live). - // Deprecated: Should be replaced with TTL when Interface starts using one lease per object. - LeaseID clientv3.LeaseID -} - -type DeleteOptions struct { - // GetOnFailure specifies whether to return the modified key-value pair if the Delete operation fails due to a revision mismatch. - GetOnFailure bool -} - -type GetResponse struct { - // KV is the key-value pair retrieved from etcd. - KV *mvccpb.KeyValue - - // Revision is the revision of the key-value store at the time of the Get operation. - Revision int64 -} - -type ListResponse struct { - // Kvs is the list of key-value pairs retrieved from etcd, ordered lexicographically by key. - Kvs []*mvccpb.KeyValue - - // Count is the total number of keys with the specified prefix, even if not all were returned due to a limit. - Count int64 - - // Revision is the revision of the key-value store at the time of the List operation. - Revision int64 -} - -type PutResponse struct { - // KV is the created or updated key-value pair. If the Put operation failed and GetOnFailure was true, this - // will be the modified key-value pair that caused the failure. - KV *mvccpb.KeyValue - - // Succeeded indicates whether the Put operation was successful. - Succeeded bool - - // Revision is the revision of the key-value store after the Put operation. - Revision int64 -} - -type DeleteResponse struct { - // KV is the deleted key-value pair. If the Delete operation failed and GetOnFailure was true, this - // will be the modified key-value pair that caused the failure. - KV *mvccpb.KeyValue - - // Succeeded indicates whether the Delete operation was successful. - Succeeded bool - - // Revision is the revision of the key-value store after the Delete operation. - Revision int64 -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/kv.go b/e2e/vendor/go.etcd.io/etcd/client/v3/kv.go deleted file mode 100644 index be5b508dd..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/kv.go +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - - pb "go.etcd.io/etcd/api/v3/etcdserverpb" - - "google.golang.org/grpc" -) - -type ( - CompactResponse pb.CompactionResponse - PutResponse pb.PutResponse - GetResponse pb.RangeResponse - DeleteResponse pb.DeleteRangeResponse - TxnResponse pb.TxnResponse -) - -type KV interface { - // Put puts a key-value pair into etcd. - // Note that key,value can be plain bytes array and string is - // an immutable representation of that bytes array. - // To get a string of bytes, do string([]byte{0x10, 0x20}). - Put(ctx context.Context, key, val string, opts ...OpOption) (*PutResponse, error) - - // Get retrieves keys. - // By default, Get will return the value for "key", if any. - // When passed WithRange(end), Get will return the keys in the range [key, end). - // When passed WithFromKey(), Get returns keys greater than or equal to key. - // When passed WithRev(rev) with rev > 0, Get retrieves keys at the given revision; - // if the required revision is compacted, the request will fail with ErrCompacted . - // When passed WithLimit(limit), the number of returned keys is bounded by limit. - // When passed WithSort(), the keys will be sorted. - Get(ctx context.Context, key string, opts ...OpOption) (*GetResponse, error) - - // Delete deletes a key, or optionally using WithRange(end), [key, end). - Delete(ctx context.Context, key string, opts ...OpOption) (*DeleteResponse, error) - - // Compact compacts etcd KV history before the given rev. - Compact(ctx context.Context, rev int64, opts ...CompactOption) (*CompactResponse, error) - - // Do applies a single Op on KV without a transaction. - // Do is useful when creating arbitrary operations to be issued at a - // later time; the user can range over the operations, calling Do to - // execute them. Get/Put/Delete, on the other hand, are best suited - // for when the operation should be issued at the time of declaration. - Do(ctx context.Context, op Op) (OpResponse, error) - - // Txn creates a transaction. - Txn(ctx context.Context) Txn -} - -type OpResponse struct { - put *PutResponse - get *GetResponse - del *DeleteResponse - txn *TxnResponse -} - -func (op OpResponse) Put() *PutResponse { return op.put } -func (op OpResponse) Get() *GetResponse { return op.get } -func (op OpResponse) Del() *DeleteResponse { return op.del } -func (op OpResponse) Txn() *TxnResponse { return op.txn } - -func (resp *PutResponse) OpResponse() OpResponse { - return OpResponse{put: resp} -} -func (resp *GetResponse) OpResponse() OpResponse { - return OpResponse{get: resp} -} -func (resp *DeleteResponse) OpResponse() OpResponse { - return OpResponse{del: resp} -} -func (resp *TxnResponse) OpResponse() OpResponse { - return OpResponse{txn: resp} -} - -type kv struct { - remote pb.KVClient - callOpts []grpc.CallOption -} - -func NewKV(c *Client) KV { - api := &kv{remote: RetryKVClient(c)} - if c != nil { - api.callOpts = c.callOpts - } - return api -} - -func NewKVFromKVClient(remote pb.KVClient, c *Client) KV { - api := &kv{remote: remote} - if c != nil { - api.callOpts = c.callOpts - } - return api -} - -func (kv *kv) Put(ctx context.Context, key, val string, opts ...OpOption) (*PutResponse, error) { - r, err := kv.Do(ctx, OpPut(key, val, opts...)) - return r.put, ContextError(ctx, err) -} - -func (kv *kv) Get(ctx context.Context, key string, opts ...OpOption) (*GetResponse, error) { - r, err := kv.Do(ctx, OpGet(key, opts...)) - return r.get, ContextError(ctx, err) -} - -func (kv *kv) Delete(ctx context.Context, key string, opts ...OpOption) (*DeleteResponse, error) { - r, err := kv.Do(ctx, OpDelete(key, opts...)) - return r.del, ContextError(ctx, err) -} - -func (kv *kv) Compact(ctx context.Context, rev int64, opts ...CompactOption) (*CompactResponse, error) { - resp, err := kv.remote.Compact(ctx, OpCompact(rev, opts...).toRequest(), kv.callOpts...) - if err != nil { - return nil, ContextError(ctx, err) - } - return (*CompactResponse)(resp), err -} - -func (kv *kv) Txn(ctx context.Context) Txn { - return &txn{ - kv: kv, - ctx: ctx, - callOpts: kv.callOpts, - } -} - -func (kv *kv) Do(ctx context.Context, op Op) (OpResponse, error) { - var err error - switch op.t { - case tRange: - var resp *pb.RangeResponse - resp, err = kv.remote.Range(ctx, op.toRangeRequest(), kv.callOpts...) - if err == nil { - return OpResponse{get: (*GetResponse)(resp)}, nil - } - case tPut: - var resp *pb.PutResponse - r := &pb.PutRequest{Key: op.key, Value: op.val, Lease: int64(op.leaseID), PrevKv: op.prevKV, IgnoreValue: op.ignoreValue, IgnoreLease: op.ignoreLease} - resp, err = kv.remote.Put(ctx, r, kv.callOpts...) - if err == nil { - return OpResponse{put: (*PutResponse)(resp)}, nil - } - case tDeleteRange: - var resp *pb.DeleteRangeResponse - r := &pb.DeleteRangeRequest{Key: op.key, RangeEnd: op.end, PrevKv: op.prevKV} - resp, err = kv.remote.DeleteRange(ctx, r, kv.callOpts...) - if err == nil { - return OpResponse{del: (*DeleteResponse)(resp)}, nil - } - case tTxn: - var resp *pb.TxnResponse - resp, err = kv.remote.Txn(ctx, op.toTxnRequest(), kv.callOpts...) - if err == nil { - return OpResponse{txn: (*TxnResponse)(resp)}, nil - } - default: - panic("Unknown op") - } - return OpResponse{}, ContextError(ctx, err) -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/lease.go b/e2e/vendor/go.etcd.io/etcd/client/v3/lease.go deleted file mode 100644 index 4877ee949..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/lease.go +++ /dev/null @@ -1,617 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - "sync" - "time" - - pb "go.etcd.io/etcd/api/v3/etcdserverpb" - "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" - - "go.uber.org/zap" - "google.golang.org/grpc" - "google.golang.org/grpc/metadata" -) - -type ( - LeaseRevokeResponse pb.LeaseRevokeResponse - LeaseID int64 -) - -// LeaseGrantResponse wraps the protobuf message LeaseGrantResponse. -type LeaseGrantResponse struct { - *pb.ResponseHeader - ID LeaseID - TTL int64 - Error string -} - -// LeaseKeepAliveResponse wraps the protobuf message LeaseKeepAliveResponse. -type LeaseKeepAliveResponse struct { - *pb.ResponseHeader - ID LeaseID - TTL int64 -} - -// LeaseTimeToLiveResponse wraps the protobuf message LeaseTimeToLiveResponse. -type LeaseTimeToLiveResponse struct { - *pb.ResponseHeader - ID LeaseID `json:"id"` - - // TTL is the remaining TTL in seconds for the lease; the lease will expire in under TTL+1 seconds. Expired lease will return -1. - TTL int64 `json:"ttl"` - - // GrantedTTL is the initial granted time in seconds upon lease creation/renewal. - GrantedTTL int64 `json:"granted-ttl"` - - // Keys is the list of keys attached to this lease. - Keys [][]byte `json:"keys"` -} - -// LeaseStatus represents a lease status. -type LeaseStatus struct { - ID LeaseID `json:"id"` - // TODO: TTL int64 -} - -// LeaseLeasesResponse wraps the protobuf message LeaseLeasesResponse. -type LeaseLeasesResponse struct { - *pb.ResponseHeader - Leases []LeaseStatus `json:"leases"` -} - -const ( - // defaultTTL is the assumed lease TTL used for the first keepalive - // deadline before the actual TTL is known to the client. - defaultTTL = 5 * time.Second - // NoLease is a lease ID for the absence of a lease. - NoLease LeaseID = 0 - - // retryConnWait is how long to wait before retrying request due to an error - retryConnWait = 500 * time.Millisecond -) - -// LeaseResponseChSize is the size of buffer to store unsent lease responses. -// WARNING: DO NOT UPDATE. -// Only for testing purposes. -var LeaseResponseChSize = 16 - -// ErrKeepAliveHalted is returned if client keep alive loop halts with an unexpected error. -// -// This usually means that automatic lease renewal via KeepAlive is broken, but KeepAliveOnce will still work as expected. -type ErrKeepAliveHalted struct { - Reason error -} - -func (e ErrKeepAliveHalted) Error() string { - s := "etcdclient: leases keep alive halted" - if e.Reason != nil { - s += ": " + e.Reason.Error() - } - return s -} - -type Lease interface { - // Grant creates a new lease. - Grant(ctx context.Context, ttl int64) (*LeaseGrantResponse, error) - - // Revoke revokes the given lease. - Revoke(ctx context.Context, id LeaseID) (*LeaseRevokeResponse, error) - - // TimeToLive retrieves the lease information of the given lease ID. - TimeToLive(ctx context.Context, id LeaseID, opts ...LeaseOption) (*LeaseTimeToLiveResponse, error) - - // Leases retrieves all leases. - Leases(ctx context.Context) (*LeaseLeasesResponse, error) - - // KeepAlive attempts to keep the given lease alive forever. If the keepalive responses posted - // to the channel are not consumed promptly the channel may become full. When full, the lease - // client will continue sending keep alive requests to the etcd server, but will drop responses - // until there is capacity on the channel to send more responses. - // - // If client keep alive loop halts with an unexpected error (e.g. "etcdserver: no leader") or - // canceled by the caller (e.g. context.Canceled), KeepAlive returns a ErrKeepAliveHalted error - // containing the error reason. - // - // The returned "LeaseKeepAliveResponse" channel closes if underlying keep - // alive stream is interrupted in some way the client cannot handle itself; - // given context "ctx" is canceled or timed out. - // - // TODO(v4.0): post errors to last keep alive message before closing - // (see https://github.com/etcd-io/etcd/pull/7866) - KeepAlive(ctx context.Context, id LeaseID) (<-chan *LeaseKeepAliveResponse, error) - - // KeepAliveOnce renews the lease once. The response corresponds to the - // first message from calling KeepAlive. If the response has a recoverable - // error, KeepAliveOnce will retry the RPC with a new keep alive message. - // - // In most of the cases, Keepalive should be used instead of KeepAliveOnce. - KeepAliveOnce(ctx context.Context, id LeaseID) (*LeaseKeepAliveResponse, error) - - // Close releases all resources Lease keeps for efficient communication - // with the etcd server. - Close() error -} - -type lessor struct { - mu sync.Mutex // guards all fields - - // donec is closed and loopErr is set when recvKeepAliveLoop stops - donec chan struct{} - loopErr error - - remote pb.LeaseClient - - stream pb.Lease_LeaseKeepAliveClient - streamCancel context.CancelFunc - - stopCtx context.Context - stopCancel context.CancelFunc - - keepAlives map[LeaseID]*keepAlive - - // firstKeepAliveTimeout is the timeout for the first keepalive request - // before the actual TTL is known to the lease client - firstKeepAliveTimeout time.Duration - - // firstKeepAliveOnce ensures stream starts after first KeepAlive call. - firstKeepAliveOnce sync.Once - - callOpts []grpc.CallOption - - lg *zap.Logger -} - -// keepAlive multiplexes a keepalive for a lease over multiple channels -type keepAlive struct { - chs []chan<- *LeaseKeepAliveResponse - ctxs []context.Context - // deadline is the time the keep alive channels close if no response - deadline time.Time - // nextKeepAlive is when to send the next keep alive message - nextKeepAlive time.Time - // donec is closed on lease revoke, expiration, or cancel. - donec chan struct{} -} - -func NewLease(c *Client) Lease { - return NewLeaseFromLeaseClient(RetryLeaseClient(c), c, c.cfg.DialTimeout+time.Second) -} - -func NewLeaseFromLeaseClient(remote pb.LeaseClient, c *Client, keepAliveTimeout time.Duration) Lease { - l := &lessor{ - donec: make(chan struct{}), - keepAlives: make(map[LeaseID]*keepAlive), - remote: remote, - firstKeepAliveTimeout: keepAliveTimeout, - lg: c.lg, - } - if l.firstKeepAliveTimeout == time.Second { - l.firstKeepAliveTimeout = defaultTTL - } - if c != nil { - l.callOpts = c.callOpts - } - reqLeaderCtx := WithRequireLeader(context.Background()) - l.stopCtx, l.stopCancel = context.WithCancel(reqLeaderCtx) - return l -} - -func (l *lessor) Grant(ctx context.Context, ttl int64) (*LeaseGrantResponse, error) { - r := &pb.LeaseGrantRequest{TTL: ttl} - resp, err := l.remote.LeaseGrant(ctx, r, l.callOpts...) - if err == nil { - gresp := &LeaseGrantResponse{ - ResponseHeader: resp.GetHeader(), - ID: LeaseID(resp.ID), - TTL: resp.TTL, - Error: resp.Error, - } - return gresp, nil - } - return nil, ContextError(ctx, err) -} - -func (l *lessor) Revoke(ctx context.Context, id LeaseID) (*LeaseRevokeResponse, error) { - r := &pb.LeaseRevokeRequest{ID: int64(id)} - resp, err := l.remote.LeaseRevoke(ctx, r, l.callOpts...) - if err == nil { - return (*LeaseRevokeResponse)(resp), nil - } - return nil, ContextError(ctx, err) -} - -func (l *lessor) TimeToLive(ctx context.Context, id LeaseID, opts ...LeaseOption) (*LeaseTimeToLiveResponse, error) { - r := toLeaseTimeToLiveRequest(id, opts...) - resp, err := l.remote.LeaseTimeToLive(ctx, r, l.callOpts...) - if err != nil { - return nil, ContextError(ctx, err) - } - gresp := &LeaseTimeToLiveResponse{ - ResponseHeader: resp.GetHeader(), - ID: LeaseID(resp.ID), - TTL: resp.TTL, - GrantedTTL: resp.GrantedTTL, - Keys: resp.Keys, - } - return gresp, nil -} - -func (l *lessor) Leases(ctx context.Context) (*LeaseLeasesResponse, error) { - resp, err := l.remote.LeaseLeases(ctx, &pb.LeaseLeasesRequest{}, l.callOpts...) - if err == nil { - leases := make([]LeaseStatus, len(resp.Leases)) - for i := range resp.Leases { - leases[i] = LeaseStatus{ID: LeaseID(resp.Leases[i].ID)} - } - return &LeaseLeasesResponse{ResponseHeader: resp.GetHeader(), Leases: leases}, nil - } - return nil, ContextError(ctx, err) -} - -// To identify the context passed to `KeepAlive`, a key/value pair is -// attached to the context. The key is a `keepAliveCtxKey` object, and -// the value is the pointer to the context object itself, ensuring -// uniqueness as each context has a unique memory address. -type keepAliveCtxKey struct{} - -func (l *lessor) KeepAlive(ctx context.Context, id LeaseID) (<-chan *LeaseKeepAliveResponse, error) { - ch := make(chan *LeaseKeepAliveResponse, LeaseResponseChSize) - - l.mu.Lock() - // ensure that recvKeepAliveLoop is still running - select { - case <-l.donec: - err := l.loopErr - l.mu.Unlock() - close(ch) - return ch, ErrKeepAliveHalted{Reason: err} - default: - } - ka, ok := l.keepAlives[id] - - if ctx.Done() != nil { - ctx = context.WithValue(ctx, keepAliveCtxKey{}, &ctx) - } - if !ok { - // create fresh keep alive - ka = &keepAlive{ - chs: []chan<- *LeaseKeepAliveResponse{ch}, - ctxs: []context.Context{ctx}, - deadline: time.Now().Add(l.firstKeepAliveTimeout), - nextKeepAlive: time.Now(), - donec: make(chan struct{}), - } - l.keepAlives[id] = ka - } else { - // add channel and context to existing keep alive - ka.ctxs = append(ka.ctxs, ctx) - ka.chs = append(ka.chs, ch) - } - l.mu.Unlock() - - if ctx.Done() != nil { - go l.keepAliveCtxCloser(ctx, id, ka.donec) - } - l.firstKeepAliveOnce.Do(func() { - go l.recvKeepAliveLoop() - go l.deadlineLoop() - }) - - return ch, nil -} - -func (l *lessor) KeepAliveOnce(ctx context.Context, id LeaseID) (*LeaseKeepAliveResponse, error) { - for { - resp, err := l.keepAliveOnce(ctx, id) - if err == nil { - if resp.TTL <= 0 { - err = rpctypes.ErrLeaseNotFound - } - return resp, err - } - if isHaltErr(ctx, err) { - return nil, ContextError(ctx, err) - } - } -} - -func (l *lessor) Close() error { - l.stopCancel() - // close for synchronous teardown if stream goroutines never launched - l.firstKeepAliveOnce.Do(func() { close(l.donec) }) - <-l.donec - return nil -} - -func (l *lessor) keepAliveCtxCloser(ctx context.Context, id LeaseID, donec <-chan struct{}) { - select { - case <-donec: - return - case <-l.donec: - return - case <-ctx.Done(): - } - - l.mu.Lock() - defer l.mu.Unlock() - - ka, ok := l.keepAlives[id] - if !ok { - return - } - - // close channel and remove context if still associated with keep alive - for i, c := range ka.ctxs { - if c.Value(keepAliveCtxKey{}) == ctx.Value(keepAliveCtxKey{}) { - close(ka.chs[i]) - ka.ctxs = append(ka.ctxs[:i], ka.ctxs[i+1:]...) - ka.chs = append(ka.chs[:i], ka.chs[i+1:]...) - break - } - } - // remove if no one more listeners - if len(ka.chs) == 0 { - delete(l.keepAlives, id) - } -} - -// closeRequireLeader scans keepAlives for ctxs that have require leader -// and closes the associated channels. -func (l *lessor) closeRequireLeader() { - l.mu.Lock() - defer l.mu.Unlock() - for _, ka := range l.keepAlives { - reqIdxs := 0 - // find all required leader channels, close, mark as nil - for i, ctx := range ka.ctxs { - md, ok := metadata.FromOutgoingContext(ctx) - if !ok { - continue - } - ks := md[rpctypes.MetadataRequireLeaderKey] - if len(ks) < 1 || ks[0] != rpctypes.MetadataHasLeader { - continue - } - close(ka.chs[i]) - ka.chs[i] = nil - reqIdxs++ - } - if reqIdxs == 0 { - continue - } - // remove all channels that required a leader from keepalive - newChs := make([]chan<- *LeaseKeepAliveResponse, len(ka.chs)-reqIdxs) - newCtxs := make([]context.Context, len(newChs)) - newIdx := 0 - for i := range ka.chs { - if ka.chs[i] == nil { - continue - } - newChs[newIdx], newCtxs[newIdx] = ka.chs[i], ka.ctxs[newIdx] - newIdx++ - } - ka.chs, ka.ctxs = newChs, newCtxs - } -} - -func (l *lessor) keepAliveOnce(ctx context.Context, id LeaseID) (karesp *LeaseKeepAliveResponse, ferr error) { - cctx, cancel := context.WithCancel(ctx) - defer cancel() - - stream, err := l.remote.LeaseKeepAlive(cctx, l.callOpts...) - if err != nil { - return nil, ContextError(ctx, err) - } - - defer func() { - if err := stream.CloseSend(); err != nil { - if ferr == nil { - ferr = ContextError(ctx, err) - } - return - } - }() - - err = stream.Send(&pb.LeaseKeepAliveRequest{ID: int64(id)}) - if err != nil { - return nil, ContextError(ctx, err) - } - - resp, rerr := stream.Recv() - if rerr != nil { - return nil, ContextError(ctx, rerr) - } - - karesp = &LeaseKeepAliveResponse{ - ResponseHeader: resp.GetHeader(), - ID: LeaseID(resp.ID), - TTL: resp.TTL, - } - return karesp, nil -} - -func (l *lessor) recvKeepAliveLoop() (gerr error) { - defer func() { - l.mu.Lock() - close(l.donec) - l.loopErr = gerr - for _, ka := range l.keepAlives { - ka.close() - } - l.keepAlives = make(map[LeaseID]*keepAlive) - l.mu.Unlock() - }() - - for { - stream, err := l.resetRecv() - if err != nil { - if canceledByCaller(l.stopCtx, err) { - return err - } - } else { - for { - resp, err := stream.Recv() - if err != nil { - if canceledByCaller(l.stopCtx, err) { - return err - } - - if ContextError(l.stopCtx, err) == rpctypes.ErrNoLeader { - l.closeRequireLeader() - } - break - } - - l.recvKeepAlive(resp) - } - } - - select { - case <-time.After(retryConnWait): - case <-l.stopCtx.Done(): - return l.stopCtx.Err() - } - } -} - -// resetRecv opens a new lease stream and starts sending keep alive requests. -func (l *lessor) resetRecv() (pb.Lease_LeaseKeepAliveClient, error) { - sctx, cancel := context.WithCancel(l.stopCtx) - stream, err := l.remote.LeaseKeepAlive(sctx, append(l.callOpts, withMax(0))...) - if err != nil { - cancel() - return nil, err - } - - l.mu.Lock() - defer l.mu.Unlock() - if l.stream != nil && l.streamCancel != nil { - l.streamCancel() - } - - l.streamCancel = cancel - l.stream = stream - - go l.sendKeepAliveLoop(stream) - return stream, nil -} - -// recvKeepAlive updates a lease based on its LeaseKeepAliveResponse -func (l *lessor) recvKeepAlive(resp *pb.LeaseKeepAliveResponse) { - karesp := &LeaseKeepAliveResponse{ - ResponseHeader: resp.GetHeader(), - ID: LeaseID(resp.ID), - TTL: resp.TTL, - } - - l.mu.Lock() - defer l.mu.Unlock() - - ka, ok := l.keepAlives[karesp.ID] - if !ok { - return - } - - if karesp.TTL <= 0 { - // lease expired; close all keep alive channels - delete(l.keepAlives, karesp.ID) - ka.close() - return - } - - // send update to all channels - nextKeepAlive := time.Now().Add((time.Duration(karesp.TTL) * time.Second) / 3.0) - ka.deadline = time.Now().Add(time.Duration(karesp.TTL) * time.Second) - for _, ch := range ka.chs { - select { - case ch <- karesp: - default: - if l.lg != nil { - l.lg.Warn("lease keepalive response queue is full; dropping response send", - zap.Int("queue-size", len(ch)), - zap.Int("queue-capacity", cap(ch)), - ) - } - } - // still advance in order to rate-limit keep-alive sends - ka.nextKeepAlive = nextKeepAlive - } -} - -// deadlineLoop reaps any keep alive channels that have not received a response -// within the lease TTL -func (l *lessor) deadlineLoop() { - for { - select { - case <-time.After(time.Second): - case <-l.donec: - return - } - now := time.Now() - l.mu.Lock() - for id, ka := range l.keepAlives { - if ka.deadline.Before(now) { - // waited too long for response; lease may be expired - ka.close() - delete(l.keepAlives, id) - } - } - l.mu.Unlock() - } -} - -// sendKeepAliveLoop sends keep alive requests for the lifetime of the given stream. -func (l *lessor) sendKeepAliveLoop(stream pb.Lease_LeaseKeepAliveClient) { - for { - var tosend []LeaseID - - now := time.Now() - l.mu.Lock() - for id, ka := range l.keepAlives { - if ka.nextKeepAlive.Before(now) { - tosend = append(tosend, id) - } - } - l.mu.Unlock() - - for _, id := range tosend { - r := &pb.LeaseKeepAliveRequest{ID: int64(id)} - if err := stream.Send(r); err != nil { - // TODO do something with this error? - return - } - } - - select { - case <-time.After(retryConnWait): - case <-stream.Context().Done(): - return - case <-l.donec: - return - case <-l.stopCtx.Done(): - return - } - } -} - -func (ka *keepAlive) close() { - close(ka.donec) - for _, ch := range ka.chs { - close(ch) - } -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/logger.go b/e2e/vendor/go.etcd.io/etcd/client/v3/logger.go deleted file mode 100644 index eaa35f2d3..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/logger.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "log" - "os" - - "go.etcd.io/etcd/client/pkg/v3/logutil" - "go.uber.org/zap/zapcore" - "go.uber.org/zap/zapgrpc" - "google.golang.org/grpc/grpclog" -) - -func init() { - // We override grpc logger only when the environment variable is set - // in order to not interfere by default with user's code or other libraries. - if os.Getenv("ETCD_CLIENT_DEBUG") != "" { - lg, err := logutil.CreateDefaultZapLogger(etcdClientDebugLevel()) - if err != nil { - panic(err) - } - lg = lg.Named("etcd-client") - grpclog.SetLoggerV2(zapgrpc.NewLogger(lg)) - } -} - -// SetLogger sets grpc logger. -// -// Deprecated: use grpclog.SetLoggerV2 directly or grpc_zap.ReplaceGrpcLoggerV2. -func SetLogger(l grpclog.LoggerV2) { - grpclog.SetLoggerV2(l) -} - -// etcdClientDebugLevel translates ETCD_CLIENT_DEBUG into zap log level. -func etcdClientDebugLevel() zapcore.Level { - envLevel := os.Getenv("ETCD_CLIENT_DEBUG") - if envLevel == "" || envLevel == "true" { - return zapcore.InfoLevel - } - var l zapcore.Level - if err := l.Set(envLevel); err != nil { - log.Printf("Invalid value for environment variable 'ETCD_CLIENT_DEBUG'. Using default level: 'info'") - return zapcore.InfoLevel - } - return l -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/maintenance.go b/e2e/vendor/go.etcd.io/etcd/client/v3/maintenance.go deleted file mode 100644 index 71b28e6dc..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/maintenance.go +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - "fmt" - "io" - - pb "go.etcd.io/etcd/api/v3/etcdserverpb" - "go.uber.org/zap" - "google.golang.org/grpc" -) - -type ( - DefragmentResponse pb.DefragmentResponse - AlarmResponse pb.AlarmResponse - AlarmMember pb.AlarmMember - StatusResponse pb.StatusResponse - HashKVResponse pb.HashKVResponse - MoveLeaderResponse pb.MoveLeaderResponse -) - -type Maintenance interface { - // AlarmList gets all active alarms. - AlarmList(ctx context.Context) (*AlarmResponse, error) - - // AlarmDisarm disarms a given alarm. - AlarmDisarm(ctx context.Context, m *AlarmMember) (*AlarmResponse, error) - - // Defragment releases wasted space from internal fragmentation on a given etcd member. - // Defragment is only needed when deleting a large number of keys and want to reclaim - // the resources. - // Defragment is an expensive operation. User should avoid defragmenting multiple members - // at the same time. - // To defragment multiple members in the cluster, user need to call defragment multiple - // times with different endpoints. - Defragment(ctx context.Context, endpoint string) (*DefragmentResponse, error) - - // Status gets the status of the endpoint. - Status(ctx context.Context, endpoint string) (*StatusResponse, error) - - // HashKV returns a hash of the KV state at the time of the RPC. - // If revision is zero, the hash is computed on all keys. If the revision - // is non-zero, the hash is computed on all keys at or below the given revision. - HashKV(ctx context.Context, endpoint string, rev int64) (*HashKVResponse, error) - - // Snapshot provides a reader for a point-in-time snapshot of etcd. - // If the context "ctx" is canceled or timed out, reading from returned - // "io.ReadCloser" would error out (e.g. context.Canceled, context.DeadlineExceeded). - Snapshot(ctx context.Context) (io.ReadCloser, error) - - // MoveLeader requests current leader to transfer its leadership to the transferee. - // Request must be made to the leader. - MoveLeader(ctx context.Context, transfereeID uint64) (*MoveLeaderResponse, error) -} - -type maintenance struct { - lg *zap.Logger - dial func(endpoint string) (pb.MaintenanceClient, func(), error) - remote pb.MaintenanceClient - callOpts []grpc.CallOption -} - -func NewMaintenance(c *Client) Maintenance { - api := &maintenance{ - lg: c.lg, - dial: func(endpoint string) (pb.MaintenanceClient, func(), error) { - conn, err := c.Dial(endpoint) - if err != nil { - return nil, nil, fmt.Errorf("failed to dial endpoint %s with maintenance client: %v", endpoint, err) - } - - //get token with established connection - dctx := c.ctx - cancel := func() {} - if c.cfg.DialTimeout > 0 { - dctx, cancel = context.WithTimeout(c.ctx, c.cfg.DialTimeout) - } - err = c.getToken(dctx) - cancel() - if err != nil { - conn.Close() - return nil, nil, fmt.Errorf("failed to getToken from endpoint %s with maintenance client: %v", endpoint, err) - } - cancel = func() { conn.Close() } - return RetryMaintenanceClient(c, conn), cancel, nil - }, - remote: RetryMaintenanceClient(c, c.conn), - } - if c != nil { - api.callOpts = c.callOpts - } - return api -} - -func NewMaintenanceFromMaintenanceClient(remote pb.MaintenanceClient, c *Client) Maintenance { - api := &maintenance{ - lg: c.lg, - dial: func(string) (pb.MaintenanceClient, func(), error) { - return remote, func() {}, nil - }, - remote: remote, - } - if c != nil { - api.callOpts = c.callOpts - } - return api -} - -func (m *maintenance) AlarmList(ctx context.Context) (*AlarmResponse, error) { - req := &pb.AlarmRequest{ - Action: pb.AlarmRequest_GET, - MemberID: 0, // all - Alarm: pb.AlarmType_NONE, // all - } - resp, err := m.remote.Alarm(ctx, req, m.callOpts...) - if err == nil { - return (*AlarmResponse)(resp), nil - } - return nil, ContextError(ctx, err) -} - -func (m *maintenance) AlarmDisarm(ctx context.Context, am *AlarmMember) (*AlarmResponse, error) { - req := &pb.AlarmRequest{ - Action: pb.AlarmRequest_DEACTIVATE, - MemberID: am.MemberID, - Alarm: am.Alarm, - } - - if req.MemberID == 0 && req.Alarm == pb.AlarmType_NONE { - ar, err := m.AlarmList(ctx) - if err != nil { - return nil, ContextError(ctx, err) - } - ret := AlarmResponse{} - for _, am := range ar.Alarms { - dresp, derr := m.AlarmDisarm(ctx, (*AlarmMember)(am)) - if derr != nil { - return nil, ContextError(ctx, derr) - } - ret.Alarms = append(ret.Alarms, dresp.Alarms...) - } - return &ret, nil - } - - resp, err := m.remote.Alarm(ctx, req, m.callOpts...) - if err == nil { - return (*AlarmResponse)(resp), nil - } - return nil, ContextError(ctx, err) -} - -func (m *maintenance) Defragment(ctx context.Context, endpoint string) (*DefragmentResponse, error) { - remote, cancel, err := m.dial(endpoint) - if err != nil { - return nil, ContextError(ctx, err) - } - defer cancel() - resp, err := remote.Defragment(ctx, &pb.DefragmentRequest{}, m.callOpts...) - if err != nil { - return nil, ContextError(ctx, err) - } - return (*DefragmentResponse)(resp), nil -} - -func (m *maintenance) Status(ctx context.Context, endpoint string) (*StatusResponse, error) { - remote, cancel, err := m.dial(endpoint) - if err != nil { - return nil, ContextError(ctx, err) - } - defer cancel() - resp, err := remote.Status(ctx, &pb.StatusRequest{}, m.callOpts...) - if err != nil { - return nil, ContextError(ctx, err) - } - return (*StatusResponse)(resp), nil -} - -func (m *maintenance) HashKV(ctx context.Context, endpoint string, rev int64) (*HashKVResponse, error) { - remote, cancel, err := m.dial(endpoint) - if err != nil { - - return nil, ContextError(ctx, err) - } - defer cancel() - resp, err := remote.HashKV(ctx, &pb.HashKVRequest{Revision: rev}, m.callOpts...) - if err != nil { - return nil, ContextError(ctx, err) - } - return (*HashKVResponse)(resp), nil -} - -func (m *maintenance) Snapshot(ctx context.Context) (io.ReadCloser, error) { - ss, err := m.remote.Snapshot(ctx, &pb.SnapshotRequest{}, append(m.callOpts, withMax(defaultStreamMaxRetries))...) - if err != nil { - return nil, ContextError(ctx, err) - } - - m.lg.Info("opened snapshot stream; downloading") - pr, pw := io.Pipe() - go func() { - for { - resp, err := ss.Recv() - if err != nil { - switch err { - case io.EOF: - m.lg.Info("completed snapshot read; closing") - default: - m.lg.Warn("failed to receive from snapshot stream; closing", zap.Error(err)) - } - pw.CloseWithError(err) - return - } - - // can "resp == nil && err == nil" - // before we receive snapshot SHA digest? - // No, server sends EOF with an empty response - // after it sends SHA digest at the end - - if _, werr := pw.Write(resp.Blob); werr != nil { - pw.CloseWithError(werr) - return - } - } - }() - return &snapshotReadCloser{ctx: ctx, ReadCloser: pr}, nil -} - -type snapshotReadCloser struct { - ctx context.Context - io.ReadCloser -} - -func (rc *snapshotReadCloser) Read(p []byte) (n int, err error) { - n, err = rc.ReadCloser.Read(p) - return n, ContextError(rc.ctx, err) -} - -func (m *maintenance) MoveLeader(ctx context.Context, transfereeID uint64) (*MoveLeaderResponse, error) { - resp, err := m.remote.MoveLeader(ctx, &pb.MoveLeaderRequest{TargetID: transfereeID}, m.callOpts...) - return (*MoveLeaderResponse)(resp), ContextError(ctx, err) -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/op.go b/e2e/vendor/go.etcd.io/etcd/client/v3/op.go deleted file mode 100644 index 525190632..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/op.go +++ /dev/null @@ -1,583 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import pb "go.etcd.io/etcd/api/v3/etcdserverpb" - -type opType int - -const ( - // A default Op has opType 0, which is invalid. - tRange opType = iota + 1 - tPut - tDeleteRange - tTxn -) - -var noPrefixEnd = []byte{0} - -// Op represents an Operation that kv can execute. -type Op struct { - t opType - key []byte - end []byte - - // for range - limit int64 - sort *SortOption - serializable bool - keysOnly bool - countOnly bool - minModRev int64 - maxModRev int64 - minCreateRev int64 - maxCreateRev int64 - - // for range, watch - rev int64 - - // for watch, put, delete - prevKV bool - - // for watch - // fragmentation should be disabled by default - // if true, split watch events when total exceeds - // "--max-request-bytes" flag value + 512-byte - fragment bool - - // for put - ignoreValue bool - ignoreLease bool - - // progressNotify is for progress updates. - progressNotify bool - // createdNotify is for created event - createdNotify bool - // filters for watchers - filterPut bool - filterDelete bool - - // for put - val []byte - leaseID LeaseID - - // txn - cmps []Cmp - thenOps []Op - elseOps []Op - - isOptsWithFromKey bool - isOptsWithPrefix bool -} - -// accessors / mutators - -// IsTxn returns true if the "Op" type is transaction. -func (op Op) IsTxn() bool { - return op.t == tTxn -} - -// Txn returns the comparison(if) operations, "then" operations, and "else" operations. -func (op Op) Txn() ([]Cmp, []Op, []Op) { - return op.cmps, op.thenOps, op.elseOps -} - -// KeyBytes returns the byte slice holding the Op's key. -func (op Op) KeyBytes() []byte { return op.key } - -// WithKeyBytes sets the byte slice for the Op's key. -func (op *Op) WithKeyBytes(key []byte) { op.key = key } - -// RangeBytes returns the byte slice holding with the Op's range end, if any. -func (op Op) RangeBytes() []byte { return op.end } - -// Rev returns the requested revision, if any. -func (op Op) Rev() int64 { return op.rev } - -// IsPut returns true iff the operation is a Put. -func (op Op) IsPut() bool { return op.t == tPut } - -// IsGet returns true iff the operation is a Get. -func (op Op) IsGet() bool { return op.t == tRange } - -// IsDelete returns true iff the operation is a Delete. -func (op Op) IsDelete() bool { return op.t == tDeleteRange } - -// IsSerializable returns true if the serializable field is true. -func (op Op) IsSerializable() bool { return op.serializable } - -// IsKeysOnly returns whether keysOnly is set. -func (op Op) IsKeysOnly() bool { return op.keysOnly } - -// IsCountOnly returns whether countOnly is set. -func (op Op) IsCountOnly() bool { return op.countOnly } - -// MinModRev returns the operation's minimum modify revision. -func (op Op) MinModRev() int64 { return op.minModRev } - -// MaxModRev returns the operation's maximum modify revision. -func (op Op) MaxModRev() int64 { return op.maxModRev } - -// MinCreateRev returns the operation's minimum create revision. -func (op Op) MinCreateRev() int64 { return op.minCreateRev } - -// MaxCreateRev returns the operation's maximum create revision. -func (op Op) MaxCreateRev() int64 { return op.maxCreateRev } - -// WithRangeBytes sets the byte slice for the Op's range end. -func (op *Op) WithRangeBytes(end []byte) { op.end = end } - -// ValueBytes returns the byte slice holding the Op's value, if any. -func (op Op) ValueBytes() []byte { return op.val } - -// WithValueBytes sets the byte slice for the Op's value. -func (op *Op) WithValueBytes(v []byte) { op.val = v } - -func (op Op) toRangeRequest() *pb.RangeRequest { - if op.t != tRange { - panic("op.t != tRange") - } - r := &pb.RangeRequest{ - Key: op.key, - RangeEnd: op.end, - Limit: op.limit, - Revision: op.rev, - Serializable: op.serializable, - KeysOnly: op.keysOnly, - CountOnly: op.countOnly, - MinModRevision: op.minModRev, - MaxModRevision: op.maxModRev, - MinCreateRevision: op.minCreateRev, - MaxCreateRevision: op.maxCreateRev, - } - if op.sort != nil { - r.SortOrder = pb.RangeRequest_SortOrder(op.sort.Order) - r.SortTarget = pb.RangeRequest_SortTarget(op.sort.Target) - } - return r -} - -func (op Op) toTxnRequest() *pb.TxnRequest { - thenOps := make([]*pb.RequestOp, len(op.thenOps)) - for i, tOp := range op.thenOps { - thenOps[i] = tOp.toRequestOp() - } - elseOps := make([]*pb.RequestOp, len(op.elseOps)) - for i, eOp := range op.elseOps { - elseOps[i] = eOp.toRequestOp() - } - cmps := make([]*pb.Compare, len(op.cmps)) - for i := range op.cmps { - cmps[i] = (*pb.Compare)(&op.cmps[i]) - } - return &pb.TxnRequest{Compare: cmps, Success: thenOps, Failure: elseOps} -} - -func (op Op) toRequestOp() *pb.RequestOp { - switch op.t { - case tRange: - return &pb.RequestOp{Request: &pb.RequestOp_RequestRange{RequestRange: op.toRangeRequest()}} - case tPut: - r := &pb.PutRequest{Key: op.key, Value: op.val, Lease: int64(op.leaseID), PrevKv: op.prevKV, IgnoreValue: op.ignoreValue, IgnoreLease: op.ignoreLease} - return &pb.RequestOp{Request: &pb.RequestOp_RequestPut{RequestPut: r}} - case tDeleteRange: - r := &pb.DeleteRangeRequest{Key: op.key, RangeEnd: op.end, PrevKv: op.prevKV} - return &pb.RequestOp{Request: &pb.RequestOp_RequestDeleteRange{RequestDeleteRange: r}} - case tTxn: - return &pb.RequestOp{Request: &pb.RequestOp_RequestTxn{RequestTxn: op.toTxnRequest()}} - default: - panic("Unknown Op") - } -} - -func (op Op) isWrite() bool { - if op.t == tTxn { - for _, tOp := range op.thenOps { - if tOp.isWrite() { - return true - } - } - for _, tOp := range op.elseOps { - if tOp.isWrite() { - return true - } - } - return false - } - return op.t != tRange -} - -func NewOp() *Op { - return &Op{key: []byte("")} -} - -// OpGet returns "get" operation based on given key and operation options. -func OpGet(key string, opts ...OpOption) Op { - // WithPrefix and WithFromKey are not supported together - if IsOptsWithPrefix(opts) && IsOptsWithFromKey(opts) { - panic("`WithPrefix` and `WithFromKey` cannot be set at the same time, choose one") - } - ret := Op{t: tRange, key: []byte(key)} - ret.applyOpts(opts) - return ret -} - -// OpDelete returns "delete" operation based on given key and operation options. -func OpDelete(key string, opts ...OpOption) Op { - // WithPrefix and WithFromKey are not supported together - if IsOptsWithPrefix(opts) && IsOptsWithFromKey(opts) { - panic("`WithPrefix` and `WithFromKey` cannot be set at the same time, choose one") - } - ret := Op{t: tDeleteRange, key: []byte(key)} - ret.applyOpts(opts) - switch { - case ret.leaseID != 0: - panic("unexpected lease in delete") - case ret.limit != 0: - panic("unexpected limit in delete") - case ret.rev != 0: - panic("unexpected revision in delete") - case ret.sort != nil: - panic("unexpected sort in delete") - case ret.serializable: - panic("unexpected serializable in delete") - case ret.countOnly: - panic("unexpected countOnly in delete") - case ret.minModRev != 0, ret.maxModRev != 0: - panic("unexpected mod revision filter in delete") - case ret.minCreateRev != 0, ret.maxCreateRev != 0: - panic("unexpected create revision filter in delete") - case ret.filterDelete, ret.filterPut: - panic("unexpected filter in delete") - case ret.createdNotify: - panic("unexpected createdNotify in delete") - } - return ret -} - -// OpPut returns "put" operation based on given key-value and operation options. -func OpPut(key, val string, opts ...OpOption) Op { - ret := Op{t: tPut, key: []byte(key), val: []byte(val)} - ret.applyOpts(opts) - switch { - case ret.end != nil: - panic("unexpected range in put") - case ret.limit != 0: - panic("unexpected limit in put") - case ret.rev != 0: - panic("unexpected revision in put") - case ret.sort != nil: - panic("unexpected sort in put") - case ret.serializable: - panic("unexpected serializable in put") - case ret.countOnly: - panic("unexpected countOnly in put") - case ret.minModRev != 0, ret.maxModRev != 0: - panic("unexpected mod revision filter in put") - case ret.minCreateRev != 0, ret.maxCreateRev != 0: - panic("unexpected create revision filter in put") - case ret.filterDelete, ret.filterPut: - panic("unexpected filter in put") - case ret.createdNotify: - panic("unexpected createdNotify in put") - } - return ret -} - -// OpTxn returns "txn" operation based on given transaction conditions. -func OpTxn(cmps []Cmp, thenOps []Op, elseOps []Op) Op { - return Op{t: tTxn, cmps: cmps, thenOps: thenOps, elseOps: elseOps} -} - -func opWatch(key string, opts ...OpOption) Op { - ret := Op{t: tRange, key: []byte(key)} - ret.applyOpts(opts) - switch { - case ret.leaseID != 0: - panic("unexpected lease in watch") - case ret.limit != 0: - panic("unexpected limit in watch") - case ret.sort != nil: - panic("unexpected sort in watch") - case ret.serializable: - panic("unexpected serializable in watch") - case ret.countOnly: - panic("unexpected countOnly in watch") - case ret.minModRev != 0, ret.maxModRev != 0: - panic("unexpected mod revision filter in watch") - case ret.minCreateRev != 0, ret.maxCreateRev != 0: - panic("unexpected create revision filter in watch") - } - return ret -} - -func (op *Op) applyOpts(opts []OpOption) { - for _, opt := range opts { - opt(op) - } -} - -// OpOption configures Operations like Get, Put, Delete. -type OpOption func(*Op) - -// WithLease attaches a lease ID to a key in 'Put' request. -func WithLease(leaseID LeaseID) OpOption { - return func(op *Op) { op.leaseID = leaseID } -} - -// WithLimit limits the number of results to return from 'Get' request. -// If WithLimit is given a 0 limit, it is treated as no limit. -func WithLimit(n int64) OpOption { return func(op *Op) { op.limit = n } } - -// WithRev specifies the store revision for 'Get' request. -// Or the start revision of 'Watch' request. -func WithRev(rev int64) OpOption { return func(op *Op) { op.rev = rev } } - -// WithSort specifies the ordering in 'Get' request. It requires -// 'WithRange' and/or 'WithPrefix' to be specified too. -// 'target' specifies the target to sort by: key, version, revisions, value. -// 'order' can be either 'SortNone', 'SortAscend', 'SortDescend'. -func WithSort(target SortTarget, order SortOrder) OpOption { - return func(op *Op) { - if target == SortByKey && order == SortAscend { - // If order != SortNone, server fetches the entire key-space, - // and then applies the sort and limit, if provided. - // Since by default the server returns results sorted by keys - // in lexicographically ascending order, the client should ignore - // SortOrder if the target is SortByKey. - order = SortNone - } - op.sort = &SortOption{target, order} - } -} - -// GetPrefixRangeEnd gets the range end of the prefix. -// 'Get(foo, WithPrefix())' is equal to 'Get(foo, WithRange(GetPrefixRangeEnd(foo))'. -func GetPrefixRangeEnd(prefix string) string { - return string(getPrefix([]byte(prefix))) -} - -func getPrefix(key []byte) []byte { - end := make([]byte, len(key)) - copy(end, key) - for i := len(end) - 1; i >= 0; i-- { - if end[i] < 0xff { - end[i] = end[i] + 1 - end = end[:i+1] - return end - } - } - // next prefix does not exist (e.g., 0xffff); - // default to WithFromKey policy - return noPrefixEnd -} - -// WithPrefix enables 'Get', 'Delete', or 'Watch' requests to operate -// on the keys with matching prefix. For example, 'Get(foo, WithPrefix())' -// can return 'foo1', 'foo2', and so on. -func WithPrefix() OpOption { - return func(op *Op) { - op.isOptsWithPrefix = true - if len(op.key) == 0 { - op.key, op.end = []byte{0}, []byte{0} - return - } - op.end = getPrefix(op.key) - } -} - -// WithRange specifies the range of 'Get', 'Delete', 'Watch' requests. -// For example, 'Get' requests with 'WithRange(end)' returns -// the keys in the range [key, end). -// endKey must be lexicographically greater than start key. -func WithRange(endKey string) OpOption { - return func(op *Op) { op.end = []byte(endKey) } -} - -// WithFromKey specifies the range of 'Get', 'Delete', 'Watch' requests -// to be equal or greater than the key in the argument. -func WithFromKey() OpOption { - return func(op *Op) { - if len(op.key) == 0 { - op.key = []byte{0} - } - op.end = []byte("\x00") - op.isOptsWithFromKey = true - } -} - -// WithSerializable makes 'Get' request serializable. By default, -// it's linearizable. Serializable requests are better for lower latency -// requirement. -func WithSerializable() OpOption { - return func(op *Op) { op.serializable = true } -} - -// WithKeysOnly makes the 'Get' request return only the keys and the corresponding -// values will be omitted. -func WithKeysOnly() OpOption { - return func(op *Op) { op.keysOnly = true } -} - -// WithCountOnly makes the 'Get' request return only the count of keys. -func WithCountOnly() OpOption { - return func(op *Op) { op.countOnly = true } -} - -// WithMinModRev filters out keys for Get with modification revisions less than the given revision. -func WithMinModRev(rev int64) OpOption { return func(op *Op) { op.minModRev = rev } } - -// WithMaxModRev filters out keys for Get with modification revisions greater than the given revision. -func WithMaxModRev(rev int64) OpOption { return func(op *Op) { op.maxModRev = rev } } - -// WithMinCreateRev filters out keys for Get with creation revisions less than the given revision. -func WithMinCreateRev(rev int64) OpOption { return func(op *Op) { op.minCreateRev = rev } } - -// WithMaxCreateRev filters out keys for Get with creation revisions greater than the given revision. -func WithMaxCreateRev(rev int64) OpOption { return func(op *Op) { op.maxCreateRev = rev } } - -// WithFirstCreate gets the key with the oldest creation revision in the request range. -func WithFirstCreate() []OpOption { return withTop(SortByCreateRevision, SortAscend) } - -// WithLastCreate gets the key with the latest creation revision in the request range. -func WithLastCreate() []OpOption { return withTop(SortByCreateRevision, SortDescend) } - -// WithFirstKey gets the lexically first key in the request range. -func WithFirstKey() []OpOption { return withTop(SortByKey, SortAscend) } - -// WithLastKey gets the lexically last key in the request range. -func WithLastKey() []OpOption { return withTop(SortByKey, SortDescend) } - -// WithFirstRev gets the key with the oldest modification revision in the request range. -func WithFirstRev() []OpOption { return withTop(SortByModRevision, SortAscend) } - -// WithLastRev gets the key with the latest modification revision in the request range. -func WithLastRev() []OpOption { return withTop(SortByModRevision, SortDescend) } - -// withTop gets the first key over the get's prefix given a sort order -func withTop(target SortTarget, order SortOrder) []OpOption { - return []OpOption{WithPrefix(), WithSort(target, order), WithLimit(1)} -} - -// WithProgressNotify makes watch server send periodic progress updates -// every 10 minutes when there is no incoming events. -// Progress updates have zero events in WatchResponse. -func WithProgressNotify() OpOption { - return func(op *Op) { - op.progressNotify = true - } -} - -// WithCreatedNotify makes watch server sends the created event. -func WithCreatedNotify() OpOption { - return func(op *Op) { - op.createdNotify = true - } -} - -// WithFilterPut discards PUT events from the watcher. -func WithFilterPut() OpOption { - return func(op *Op) { op.filterPut = true } -} - -// WithFilterDelete discards DELETE events from the watcher. -func WithFilterDelete() OpOption { - return func(op *Op) { op.filterDelete = true } -} - -// WithPrevKV gets the previous key-value pair before the event happens. If the previous KV is already compacted, -// nothing will be returned. -func WithPrevKV() OpOption { - return func(op *Op) { - op.prevKV = true - } -} - -// WithFragment to receive raw watch response with fragmentation. -// Fragmentation is disabled by default. If fragmentation is enabled, -// etcd watch server will split watch response before sending to clients -// when the total size of watch events exceed server-side request limit. -// The default server-side request limit is 1.5 MiB, which can be configured -// as "--max-request-bytes" flag value + gRPC-overhead 512 bytes. -// See "etcdserver/api/v3rpc/watch.go" for more details. -func WithFragment() OpOption { - return func(op *Op) { op.fragment = true } -} - -// WithIgnoreValue updates the key using its current value. -// This option can not be combined with non-empty values. -// Returns an error if the key does not exist. -func WithIgnoreValue() OpOption { - return func(op *Op) { - op.ignoreValue = true - } -} - -// WithIgnoreLease updates the key using its current lease. -// This option can not be combined with WithLease. -// Returns an error if the key does not exist. -func WithIgnoreLease() OpOption { - return func(op *Op) { - op.ignoreLease = true - } -} - -// LeaseOp represents an Operation that lease can execute. -type LeaseOp struct { - id LeaseID - - // for TimeToLive - attachedKeys bool -} - -// LeaseOption configures lease operations. -type LeaseOption func(*LeaseOp) - -func (op *LeaseOp) applyOpts(opts []LeaseOption) { - for _, opt := range opts { - opt(op) - } -} - -// WithAttachedKeys makes TimeToLive list the keys attached to the given lease ID. -func WithAttachedKeys() LeaseOption { - return func(op *LeaseOp) { op.attachedKeys = true } -} - -func toLeaseTimeToLiveRequest(id LeaseID, opts ...LeaseOption) *pb.LeaseTimeToLiveRequest { - ret := &LeaseOp{id: id} - ret.applyOpts(opts) - return &pb.LeaseTimeToLiveRequest{ID: int64(id), Keys: ret.attachedKeys} -} - -// IsOptsWithPrefix returns true if WithPrefix option is called in the given opts. -func IsOptsWithPrefix(opts []OpOption) bool { - ret := NewOp() - for _, opt := range opts { - opt(ret) - } - - return ret.isOptsWithPrefix -} - -// IsOptsWithFromKey returns true if WithFromKey option is called in the given opts. -func IsOptsWithFromKey(opts []OpOption) bool { - ret := NewOp() - for _, opt := range opts { - opt(ret) - } - - return ret.isOptsWithFromKey -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/options.go b/e2e/vendor/go.etcd.io/etcd/client/v3/options.go deleted file mode 100644 index cdae1b16a..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/options.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2017 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "math" - "time" - - "google.golang.org/grpc" -) - -var ( - // client-side handling retrying of request failures where data was not written to the wire or - // where server indicates it did not process the data. gRPC default is default is "WaitForReady(false)" - // but for etcd we default to "WaitForReady(true)" to minimize client request error responses due to - // transient failures. - defaultWaitForReady = grpc.WaitForReady(true) - - // client-side request send limit, gRPC default is math.MaxInt32 - // Make sure that "client-side send limit < server-side default send/recv limit" - // Same value as "embed.DefaultMaxRequestBytes" plus gRPC overhead bytes - defaultMaxCallSendMsgSize = grpc.MaxCallSendMsgSize(2 * 1024 * 1024) - - // client-side response receive limit, gRPC default is 4MB - // Make sure that "client-side receive limit >= server-side default send/recv limit" - // because range response can easily exceed request send limits - // Default to math.MaxInt32; writes exceeding server-side send limit fails anyway - defaultMaxCallRecvMsgSize = grpc.MaxCallRecvMsgSize(math.MaxInt32) - - // client-side non-streaming retry limit, only applied to requests where server responds with - // a error code clearly indicating it was unable to process the request such as codes.Unavailable. - // If set to 0, retry is disabled. - defaultUnaryMaxRetries uint = 100 - - // client-side streaming retry limit, only applied to requests where server responds with - // a error code clearly indicating it was unable to process the request such as codes.Unavailable. - // If set to 0, retry is disabled. - defaultStreamMaxRetries = ^uint(0) // max uint - - // client-side retry backoff wait between requests. - defaultBackoffWaitBetween = 25 * time.Millisecond - - // client-side retry backoff default jitter fraction. - defaultBackoffJitterFraction = 0.10 -) - -// defaultCallOpts defines a list of default "gRPC.CallOption". -// Some options are exposed to "clientv3.Config". -// Defaults will be overridden by the settings in "clientv3.Config". -var defaultCallOpts = []grpc.CallOption{ - defaultWaitForReady, - defaultMaxCallSendMsgSize, - defaultMaxCallRecvMsgSize, -} - -// MaxLeaseTTL is the maximum lease TTL value -const MaxLeaseTTL = 9000000000 diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/retry.go b/e2e/vendor/go.etcd.io/etcd/client/v3/retry.go deleted file mode 100644 index 69ecc6314..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/retry.go +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - - pb "go.etcd.io/etcd/api/v3/etcdserverpb" - "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" - - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -type retryPolicy uint8 - -const ( - repeatable retryPolicy = iota - nonRepeatable -) - -func (rp retryPolicy) String() string { - switch rp { - case repeatable: - return "repeatable" - case nonRepeatable: - return "nonRepeatable" - default: - return "UNKNOWN" - } -} - -// isSafeRetryImmutableRPC returns "true" when an immutable request is safe for retry. -// -// immutable requests (e.g. Get) should be retried unless it's -// an obvious server-side error (e.g. rpctypes.ErrRequestTooLarge). -// -// Returning "false" means retry should stop, since client cannot -// handle itself even with retries. -func isSafeRetryImmutableRPC(err error) bool { - eErr := rpctypes.Error(err) - if serverErr, ok := eErr.(rpctypes.EtcdError); ok && serverErr.Code() != codes.Unavailable { - // interrupted by non-transient server-side or gRPC-side error - // client cannot handle itself (e.g. rpctypes.ErrCompacted) - return false - } - // only retry if unavailable - ev, ok := status.FromError(err) - if !ok { - // all errors from RPC is typed "grpc/status.(*statusError)" - // (ref. https://github.com/grpc/grpc-go/pull/1782) - // - // if the error type is not "grpc/status.(*statusError)", - // it could be from "Dial" - // TODO: do not retry for now - // ref. https://github.com/grpc/grpc-go/issues/1581 - return false - } - return ev.Code() == codes.Unavailable -} - -// isSafeRetryMutableRPC returns "true" when a mutable request is safe for retry. -// -// mutable requests (e.g. Put, Delete, Txn) should only be retried -// when the status code is codes.Unavailable when initial connection -// has not been established (no endpoint is up). -// -// Returning "false" means retry should stop, otherwise it violates -// write-at-most-once semantics. -func isSafeRetryMutableRPC(err error) bool { - if ev, ok := status.FromError(err); ok && ev.Code() != codes.Unavailable { - // not safe for mutable RPCs - // e.g. interrupted by non-transient error that client cannot handle itself, - // or transient error while the connection has already been established - return false - } - desc := rpctypes.ErrorDesc(err) - return desc == "there is no address available" || desc == "there is no connection available" -} - -type retryKVClient struct { - kc pb.KVClient -} - -// RetryKVClient implements a KVClient. -func RetryKVClient(c *Client) pb.KVClient { - return &retryKVClient{ - kc: pb.NewKVClient(c.conn), - } -} -func (rkv *retryKVClient) Range(ctx context.Context, in *pb.RangeRequest, opts ...grpc.CallOption) (resp *pb.RangeResponse, err error) { - return rkv.kc.Range(ctx, in, append(opts, withRetryPolicy(repeatable))...) -} - -func (rkv *retryKVClient) Put(ctx context.Context, in *pb.PutRequest, opts ...grpc.CallOption) (resp *pb.PutResponse, err error) { - return rkv.kc.Put(ctx, in, opts...) -} - -func (rkv *retryKVClient) DeleteRange(ctx context.Context, in *pb.DeleteRangeRequest, opts ...grpc.CallOption) (resp *pb.DeleteRangeResponse, err error) { - return rkv.kc.DeleteRange(ctx, in, opts...) -} - -func (rkv *retryKVClient) Txn(ctx context.Context, in *pb.TxnRequest, opts ...grpc.CallOption) (resp *pb.TxnResponse, err error) { - return rkv.kc.Txn(ctx, in, opts...) -} - -func (rkv *retryKVClient) Compact(ctx context.Context, in *pb.CompactionRequest, opts ...grpc.CallOption) (resp *pb.CompactionResponse, err error) { - return rkv.kc.Compact(ctx, in, opts...) -} - -type retryLeaseClient struct { - lc pb.LeaseClient -} - -// RetryLeaseClient implements a LeaseClient. -func RetryLeaseClient(c *Client) pb.LeaseClient { - return &retryLeaseClient{ - lc: pb.NewLeaseClient(c.conn), - } -} - -func (rlc *retryLeaseClient) LeaseTimeToLive(ctx context.Context, in *pb.LeaseTimeToLiveRequest, opts ...grpc.CallOption) (resp *pb.LeaseTimeToLiveResponse, err error) { - return rlc.lc.LeaseTimeToLive(ctx, in, append(opts, withRetryPolicy(repeatable))...) -} - -func (rlc *retryLeaseClient) LeaseLeases(ctx context.Context, in *pb.LeaseLeasesRequest, opts ...grpc.CallOption) (resp *pb.LeaseLeasesResponse, err error) { - return rlc.lc.LeaseLeases(ctx, in, append(opts, withRetryPolicy(repeatable))...) -} - -func (rlc *retryLeaseClient) LeaseGrant(ctx context.Context, in *pb.LeaseGrantRequest, opts ...grpc.CallOption) (resp *pb.LeaseGrantResponse, err error) { - return rlc.lc.LeaseGrant(ctx, in, append(opts, withRetryPolicy(repeatable))...) -} - -func (rlc *retryLeaseClient) LeaseRevoke(ctx context.Context, in *pb.LeaseRevokeRequest, opts ...grpc.CallOption) (resp *pb.LeaseRevokeResponse, err error) { - return rlc.lc.LeaseRevoke(ctx, in, append(opts, withRetryPolicy(repeatable))...) -} - -func (rlc *retryLeaseClient) LeaseKeepAlive(ctx context.Context, opts ...grpc.CallOption) (stream pb.Lease_LeaseKeepAliveClient, err error) { - return rlc.lc.LeaseKeepAlive(ctx, append(opts, withRetryPolicy(repeatable))...) -} - -type retryClusterClient struct { - cc pb.ClusterClient -} - -// RetryClusterClient implements a ClusterClient. -func RetryClusterClient(c *Client) pb.ClusterClient { - return &retryClusterClient{ - cc: pb.NewClusterClient(c.conn), - } -} - -func (rcc *retryClusterClient) MemberList(ctx context.Context, in *pb.MemberListRequest, opts ...grpc.CallOption) (resp *pb.MemberListResponse, err error) { - return rcc.cc.MemberList(ctx, in, append(opts, withRetryPolicy(repeatable))...) -} - -func (rcc *retryClusterClient) MemberAdd(ctx context.Context, in *pb.MemberAddRequest, opts ...grpc.CallOption) (resp *pb.MemberAddResponse, err error) { - return rcc.cc.MemberAdd(ctx, in, opts...) -} - -func (rcc *retryClusterClient) MemberRemove(ctx context.Context, in *pb.MemberRemoveRequest, opts ...grpc.CallOption) (resp *pb.MemberRemoveResponse, err error) { - return rcc.cc.MemberRemove(ctx, in, opts...) -} - -func (rcc *retryClusterClient) MemberUpdate(ctx context.Context, in *pb.MemberUpdateRequest, opts ...grpc.CallOption) (resp *pb.MemberUpdateResponse, err error) { - return rcc.cc.MemberUpdate(ctx, in, opts...) -} - -func (rcc *retryClusterClient) MemberPromote(ctx context.Context, in *pb.MemberPromoteRequest, opts ...grpc.CallOption) (resp *pb.MemberPromoteResponse, err error) { - return rcc.cc.MemberPromote(ctx, in, opts...) -} - -type retryMaintenanceClient struct { - mc pb.MaintenanceClient -} - -// RetryMaintenanceClient implements a Maintenance. -func RetryMaintenanceClient(c *Client, conn *grpc.ClientConn) pb.MaintenanceClient { - return &retryMaintenanceClient{ - mc: pb.NewMaintenanceClient(conn), - } -} - -func (rmc *retryMaintenanceClient) Alarm(ctx context.Context, in *pb.AlarmRequest, opts ...grpc.CallOption) (resp *pb.AlarmResponse, err error) { - return rmc.mc.Alarm(ctx, in, append(opts, withRetryPolicy(repeatable))...) -} - -func (rmc *retryMaintenanceClient) Status(ctx context.Context, in *pb.StatusRequest, opts ...grpc.CallOption) (resp *pb.StatusResponse, err error) { - return rmc.mc.Status(ctx, in, append(opts, withRetryPolicy(repeatable))...) -} - -func (rmc *retryMaintenanceClient) Hash(ctx context.Context, in *pb.HashRequest, opts ...grpc.CallOption) (resp *pb.HashResponse, err error) { - return rmc.mc.Hash(ctx, in, append(opts, withRetryPolicy(repeatable))...) -} - -func (rmc *retryMaintenanceClient) HashKV(ctx context.Context, in *pb.HashKVRequest, opts ...grpc.CallOption) (resp *pb.HashKVResponse, err error) { - return rmc.mc.HashKV(ctx, in, append(opts, withRetryPolicy(repeatable))...) -} - -func (rmc *retryMaintenanceClient) Snapshot(ctx context.Context, in *pb.SnapshotRequest, opts ...grpc.CallOption) (stream pb.Maintenance_SnapshotClient, err error) { - return rmc.mc.Snapshot(ctx, in, append(opts, withRetryPolicy(repeatable))...) -} - -func (rmc *retryMaintenanceClient) MoveLeader(ctx context.Context, in *pb.MoveLeaderRequest, opts ...grpc.CallOption) (resp *pb.MoveLeaderResponse, err error) { - return rmc.mc.MoveLeader(ctx, in, append(opts, withRetryPolicy(repeatable))...) -} - -func (rmc *retryMaintenanceClient) Defragment(ctx context.Context, in *pb.DefragmentRequest, opts ...grpc.CallOption) (resp *pb.DefragmentResponse, err error) { - return rmc.mc.Defragment(ctx, in, opts...) -} - -func (rmc *retryMaintenanceClient) Downgrade(ctx context.Context, in *pb.DowngradeRequest, opts ...grpc.CallOption) (resp *pb.DowngradeResponse, err error) { - return rmc.mc.Downgrade(ctx, in, opts...) -} - -type retryAuthClient struct { - ac pb.AuthClient -} - -// RetryAuthClient implements a AuthClient. -func RetryAuthClient(c *Client) pb.AuthClient { - return &retryAuthClient{ - ac: pb.NewAuthClient(c.conn), - } -} - -func (rac *retryAuthClient) UserList(ctx context.Context, in *pb.AuthUserListRequest, opts ...grpc.CallOption) (resp *pb.AuthUserListResponse, err error) { - return rac.ac.UserList(ctx, in, append(opts, withRetryPolicy(repeatable))...) -} - -func (rac *retryAuthClient) UserGet(ctx context.Context, in *pb.AuthUserGetRequest, opts ...grpc.CallOption) (resp *pb.AuthUserGetResponse, err error) { - return rac.ac.UserGet(ctx, in, append(opts, withRetryPolicy(repeatable))...) -} - -func (rac *retryAuthClient) RoleGet(ctx context.Context, in *pb.AuthRoleGetRequest, opts ...grpc.CallOption) (resp *pb.AuthRoleGetResponse, err error) { - return rac.ac.RoleGet(ctx, in, append(opts, withRetryPolicy(repeatable))...) -} - -func (rac *retryAuthClient) RoleList(ctx context.Context, in *pb.AuthRoleListRequest, opts ...grpc.CallOption) (resp *pb.AuthRoleListResponse, err error) { - return rac.ac.RoleList(ctx, in, append(opts, withRetryPolicy(repeatable))...) -} - -func (rac *retryAuthClient) AuthEnable(ctx context.Context, in *pb.AuthEnableRequest, opts ...grpc.CallOption) (resp *pb.AuthEnableResponse, err error) { - return rac.ac.AuthEnable(ctx, in, opts...) -} - -func (rac *retryAuthClient) AuthDisable(ctx context.Context, in *pb.AuthDisableRequest, opts ...grpc.CallOption) (resp *pb.AuthDisableResponse, err error) { - return rac.ac.AuthDisable(ctx, in, opts...) -} - -func (rac *retryAuthClient) AuthStatus(ctx context.Context, in *pb.AuthStatusRequest, opts ...grpc.CallOption) (resp *pb.AuthStatusResponse, err error) { - return rac.ac.AuthStatus(ctx, in, opts...) -} - -func (rac *retryAuthClient) UserAdd(ctx context.Context, in *pb.AuthUserAddRequest, opts ...grpc.CallOption) (resp *pb.AuthUserAddResponse, err error) { - return rac.ac.UserAdd(ctx, in, opts...) -} - -func (rac *retryAuthClient) UserDelete(ctx context.Context, in *pb.AuthUserDeleteRequest, opts ...grpc.CallOption) (resp *pb.AuthUserDeleteResponse, err error) { - return rac.ac.UserDelete(ctx, in, opts...) -} - -func (rac *retryAuthClient) UserChangePassword(ctx context.Context, in *pb.AuthUserChangePasswordRequest, opts ...grpc.CallOption) (resp *pb.AuthUserChangePasswordResponse, err error) { - return rac.ac.UserChangePassword(ctx, in, opts...) -} - -func (rac *retryAuthClient) UserGrantRole(ctx context.Context, in *pb.AuthUserGrantRoleRequest, opts ...grpc.CallOption) (resp *pb.AuthUserGrantRoleResponse, err error) { - return rac.ac.UserGrantRole(ctx, in, opts...) -} - -func (rac *retryAuthClient) UserRevokeRole(ctx context.Context, in *pb.AuthUserRevokeRoleRequest, opts ...grpc.CallOption) (resp *pb.AuthUserRevokeRoleResponse, err error) { - return rac.ac.UserRevokeRole(ctx, in, opts...) -} - -func (rac *retryAuthClient) RoleAdd(ctx context.Context, in *pb.AuthRoleAddRequest, opts ...grpc.CallOption) (resp *pb.AuthRoleAddResponse, err error) { - return rac.ac.RoleAdd(ctx, in, opts...) -} - -func (rac *retryAuthClient) RoleDelete(ctx context.Context, in *pb.AuthRoleDeleteRequest, opts ...grpc.CallOption) (resp *pb.AuthRoleDeleteResponse, err error) { - return rac.ac.RoleDelete(ctx, in, opts...) -} - -func (rac *retryAuthClient) RoleGrantPermission(ctx context.Context, in *pb.AuthRoleGrantPermissionRequest, opts ...grpc.CallOption) (resp *pb.AuthRoleGrantPermissionResponse, err error) { - return rac.ac.RoleGrantPermission(ctx, in, opts...) -} - -func (rac *retryAuthClient) RoleRevokePermission(ctx context.Context, in *pb.AuthRoleRevokePermissionRequest, opts ...grpc.CallOption) (resp *pb.AuthRoleRevokePermissionResponse, err error) { - return rac.ac.RoleRevokePermission(ctx, in, opts...) -} - -func (rac *retryAuthClient) Authenticate(ctx context.Context, in *pb.AuthenticateRequest, opts ...grpc.CallOption) (resp *pb.AuthenticateResponse, err error) { - return rac.ac.Authenticate(ctx, in, opts...) -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/retry_interceptor.go b/e2e/vendor/go.etcd.io/etcd/client/v3/retry_interceptor.go deleted file mode 100644 index 8c50dcfa9..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/retry_interceptor.go +++ /dev/null @@ -1,445 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Based on github.com/grpc-ecosystem/go-grpc-middleware/retry, but modified to support the more -// fine grained error checking required by write-at-most-once retry semantics of etcd. - -package clientv3 - -import ( - "context" - "errors" - "io" - "sync" - "time" - - "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" - "go.uber.org/zap" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// unaryClientInterceptor returns a new retrying unary client interceptor. -// -// The default configuration of the interceptor is to not retry *at all*. This behaviour can be -// changed through options (e.g. WithMax) on creation of the interceptor or on call (through grpc.CallOptions). -func (c *Client) unaryClientInterceptor(optFuncs ...retryOption) grpc.UnaryClientInterceptor { - intOpts := reuseOrNewWithCallOptions(defaultOptions, optFuncs) - return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { - ctx = withVersion(ctx) - grpcOpts, retryOpts := filterCallOptions(opts) - callOpts := reuseOrNewWithCallOptions(intOpts, retryOpts) - // short circuit for simplicity, and avoiding allocations. - if callOpts.max == 0 { - return invoker(ctx, method, req, reply, cc, grpcOpts...) - } - var lastErr error - for attempt := uint(0); attempt < callOpts.max; attempt++ { - if err := waitRetryBackoff(ctx, attempt, callOpts); err != nil { - return err - } - c.GetLogger().Debug( - "retrying of unary invoker", - zap.String("target", cc.Target()), - zap.Uint("attempt", attempt), - ) - lastErr = invoker(ctx, method, req, reply, cc, grpcOpts...) - if lastErr == nil { - return nil - } - c.GetLogger().Warn( - "retrying of unary invoker failed", - zap.String("target", cc.Target()), - zap.Uint("attempt", attempt), - zap.Error(lastErr), - ) - if isContextError(lastErr) { - if ctx.Err() != nil { - // its the context deadline or cancellation. - return lastErr - } - // its the callCtx deadline or cancellation, in which case try again. - continue - } - if c.shouldRefreshToken(lastErr, callOpts) { - gterr := c.refreshToken(ctx) - if gterr != nil { - c.GetLogger().Warn( - "retrying of unary invoker failed to fetch new auth token", - zap.String("target", cc.Target()), - zap.Error(gterr), - ) - return gterr // lastErr must be invalid auth token - } - continue - } - if !isSafeRetry(c, lastErr, callOpts) { - return lastErr - } - } - return lastErr - } -} - -// streamClientInterceptor returns a new retrying stream client interceptor for server side streaming calls. -// -// The default configuration of the interceptor is to not retry *at all*. This behaviour can be -// changed through options (e.g. WithMax) on creation of the interceptor or on call (through grpc.CallOptions). -// -// Retry logic is available *only for ServerStreams*, i.e. 1:n streams, as the internal logic needs -// to buffer the messages sent by the client. If retry is enabled on any other streams (ClientStreams, -// BidiStreams), the retry interceptor will fail the call. -func (c *Client) streamClientInterceptor(optFuncs ...retryOption) grpc.StreamClientInterceptor { - intOpts := reuseOrNewWithCallOptions(defaultOptions, optFuncs) - return func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) { - ctx = withVersion(ctx) - // getToken automatically - // TODO(cfc4n): keep this code block, remove codes about getToken in client.go after pr #12165 merged. - if c.authTokenBundle != nil { - // equal to c.Username != "" && c.Password != "" - err := c.getToken(ctx) - if err != nil && rpctypes.Error(err) != rpctypes.ErrAuthNotEnabled { - c.GetLogger().Error("clientv3/retry_interceptor: getToken failed", zap.Error(err)) - return nil, err - } - } - grpcOpts, retryOpts := filterCallOptions(opts) - callOpts := reuseOrNewWithCallOptions(intOpts, retryOpts) - // short circuit for simplicity, and avoiding allocations. - if callOpts.max == 0 { - return streamer(ctx, desc, cc, method, grpcOpts...) - } - if desc.ClientStreams { - return nil, status.Errorf(codes.Unimplemented, "clientv3/retry_interceptor: cannot retry on ClientStreams, set Disable()") - } - newStreamer, err := streamer(ctx, desc, cc, method, grpcOpts...) - if err != nil { - c.GetLogger().Error("streamer failed to create ClientStream", zap.Error(err)) - return nil, err // TODO(mwitkow): Maybe dial and transport errors should be retriable? - } - retryingStreamer := &serverStreamingRetryingStream{ - client: c, - ClientStream: newStreamer, - callOpts: callOpts, - ctx: ctx, - streamerCall: func(ctx context.Context) (grpc.ClientStream, error) { - return streamer(ctx, desc, cc, method, grpcOpts...) - }, - } - return retryingStreamer, nil - } -} - -// shouldRefreshToken checks whether there's a need to refresh the token based on the error and callOptions, -// and returns a boolean value. -func (c *Client) shouldRefreshToken(err error, callOpts *options) bool { - if rpctypes.Error(err) == rpctypes.ErrUserEmpty { - // refresh the token when username, password is present but the server returns ErrUserEmpty - // which is possible when the client token is cleared somehow - return c.authTokenBundle != nil // equal to c.Username != "" && c.Password != "" - } - - return callOpts.retryAuth && - (rpctypes.Error(err) == rpctypes.ErrInvalidAuthToken || rpctypes.Error(err) == rpctypes.ErrAuthOldRevision) -} - -func (c *Client) refreshToken(ctx context.Context) error { - if c.authTokenBundle == nil { - // c.authTokenBundle will be initialized only when - // c.Username != "" && c.Password != "". - // - // When users use the TLS CommonName based authentication, the - // authTokenBundle is always nil. But it's possible for the clients - // to get `rpctypes.ErrAuthOldRevision` response when the clients - // concurrently modify auth data (e.g, addUser, deleteUser etc.). - // In this case, there is no need to refresh the token; instead the - // clients just need to retry the operations (e.g. Put, Delete etc). - return nil - } - // clear auth token before refreshing it. - c.authTokenBundle.UpdateAuthToken("") - return c.getToken(ctx) -} - -// type serverStreamingRetryingStream is the implementation of grpc.ClientStream that acts as a -// proxy to the underlying call. If any of the RecvMsg() calls fail, it will try to reestablish -// a new ClientStream according to the retry policy. -type serverStreamingRetryingStream struct { - grpc.ClientStream - client *Client - bufferedSends []interface{} // single message that the client can sen - receivedGood bool // indicates whether any prior receives were successful - wasClosedSend bool // indicates that CloseSend was closed - ctx context.Context - callOpts *options - streamerCall func(ctx context.Context) (grpc.ClientStream, error) - mu sync.RWMutex -} - -func (s *serverStreamingRetryingStream) setStream(clientStream grpc.ClientStream) { - s.mu.Lock() - s.ClientStream = clientStream - s.mu.Unlock() -} - -func (s *serverStreamingRetryingStream) getStream() grpc.ClientStream { - s.mu.RLock() - defer s.mu.RUnlock() - return s.ClientStream -} - -func (s *serverStreamingRetryingStream) SendMsg(m interface{}) error { - s.mu.Lock() - s.bufferedSends = append(s.bufferedSends, m) - s.mu.Unlock() - return s.getStream().SendMsg(m) -} - -func (s *serverStreamingRetryingStream) CloseSend() error { - s.mu.Lock() - s.wasClosedSend = true - s.mu.Unlock() - return s.getStream().CloseSend() -} - -func (s *serverStreamingRetryingStream) Header() (metadata.MD, error) { - return s.getStream().Header() -} - -func (s *serverStreamingRetryingStream) Trailer() metadata.MD { - return s.getStream().Trailer() -} - -func (s *serverStreamingRetryingStream) RecvMsg(m interface{}) error { - attemptRetry, lastErr := s.receiveMsgAndIndicateRetry(m) - if !attemptRetry { - return lastErr // success or hard failure - } - - // We start off from attempt 1, because zeroth was already made on normal SendMsg(). - for attempt := uint(1); attempt < s.callOpts.max; attempt++ { - if err := waitRetryBackoff(s.ctx, attempt, s.callOpts); err != nil { - return err - } - newStream, err := s.reestablishStreamAndResendBuffer(s.ctx) - if err != nil { - s.client.lg.Error("failed reestablishStreamAndResendBuffer", zap.Error(err)) - return err // TODO(mwitkow): Maybe dial and transport errors should be retriable? - } - s.setStream(newStream) - - s.client.lg.Warn("retrying RecvMsg", zap.Error(lastErr)) - attemptRetry, lastErr = s.receiveMsgAndIndicateRetry(m) - if !attemptRetry { - return lastErr - } - } - return lastErr -} - -func (s *serverStreamingRetryingStream) receiveMsgAndIndicateRetry(m interface{}) (bool, error) { - s.mu.RLock() - wasGood := s.receivedGood - s.mu.RUnlock() - err := s.getStream().RecvMsg(m) - if err == nil || err == io.EOF { - s.mu.Lock() - s.receivedGood = true - s.mu.Unlock() - return false, err - } else if wasGood { - // previous RecvMsg in the stream succeeded, no retry logic should interfere - return false, err - } - if isContextError(err) { - if s.ctx.Err() != nil { - return false, err - } - // its the callCtx deadline or cancellation, in which case try again. - return true, err - } - if s.client.shouldRefreshToken(err, s.callOpts) { - gterr := s.client.refreshToken(s.ctx) - if gterr != nil { - s.client.lg.Warn("retry failed to fetch new auth token", zap.Error(gterr)) - return false, err // return the original error for simplicity - } - return true, err - - } - return isSafeRetry(s.client, err, s.callOpts), err -} - -func (s *serverStreamingRetryingStream) reestablishStreamAndResendBuffer(callCtx context.Context) (grpc.ClientStream, error) { - s.mu.RLock() - bufferedSends := s.bufferedSends - s.mu.RUnlock() - newStream, err := s.streamerCall(callCtx) - if err != nil { - return nil, err - } - for _, msg := range bufferedSends { - if err := newStream.SendMsg(msg); err != nil { - return nil, err - } - } - if err := newStream.CloseSend(); err != nil { - return nil, err - } - return newStream, nil -} - -func waitRetryBackoff(ctx context.Context, attempt uint, callOpts *options) error { - waitTime := time.Duration(0) - if attempt > 0 { - waitTime = callOpts.backoffFunc(attempt) - } - if waitTime > 0 { - timer := time.NewTimer(waitTime) - select { - case <-ctx.Done(): - timer.Stop() - return contextErrToGrpcErr(ctx.Err()) - case <-timer.C: - } - } - return nil -} - -// isSafeRetry returns "true", if request is safe for retry with the given error. -func isSafeRetry(c *Client, err error, callOpts *options) bool { - if isContextError(err) { - return false - } - - // Situation when learner refuses RPC it is supposed to not serve is from the server - // perspective not retryable. - // But for backward-compatibility reasons we need to support situation that - // customer provides mix of learners (not yet voters) and voters with an - // expectation to pick voter in the next attempt. - // TODO: Ideally client should be 'aware' which endpoint represents: leader/voter/learner with high probability. - if errors.Is(err, rpctypes.ErrGPRCNotSupportedForLearner) && len(c.Endpoints()) > 1 { - return true - } - - switch callOpts.retryPolicy { - case repeatable: - return isSafeRetryImmutableRPC(err) - case nonRepeatable: - return isSafeRetryMutableRPC(err) - default: - c.lg.Warn("unrecognized retry policy", zap.String("retryPolicy", callOpts.retryPolicy.String())) - return false - } -} - -func isContextError(err error) bool { - return status.Code(err) == codes.DeadlineExceeded || status.Code(err) == codes.Canceled -} - -func contextErrToGrpcErr(err error) error { - switch err { - case context.DeadlineExceeded: - return status.Errorf(codes.DeadlineExceeded, err.Error()) - case context.Canceled: - return status.Errorf(codes.Canceled, err.Error()) - default: - return status.Errorf(codes.Unknown, err.Error()) - } -} - -var ( - defaultOptions = &options{ - retryPolicy: nonRepeatable, - max: 0, // disable - backoffFunc: backoffLinearWithJitter(50*time.Millisecond /*jitter*/, 0.10), - retryAuth: true, - } -) - -// backoffFunc denotes a family of functions that control the backoff duration between call retries. -// -// They are called with an identifier of the attempt, and should return a time the system client should -// hold off for. If the time returned is longer than the `context.Context.Deadline` of the request -// the deadline of the request takes precedence and the wait will be interrupted before proceeding -// with the next iteration. -type backoffFunc func(attempt uint) time.Duration - -// withRetryPolicy sets the retry policy of this call. -func withRetryPolicy(rp retryPolicy) retryOption { - return retryOption{applyFunc: func(o *options) { - o.retryPolicy = rp - }} -} - -// withMax sets the maximum number of retries on this call, or this interceptor. -func withMax(maxRetries uint) retryOption { - return retryOption{applyFunc: func(o *options) { - o.max = maxRetries - }} -} - -// WithBackoff sets the `BackoffFunc `used to control time between retries. -func withBackoff(bf backoffFunc) retryOption { - return retryOption{applyFunc: func(o *options) { - o.backoffFunc = bf - }} -} - -type options struct { - retryPolicy retryPolicy - max uint - backoffFunc backoffFunc - retryAuth bool -} - -// retryOption is a grpc.CallOption that is local to clientv3's retry interceptor. -type retryOption struct { - grpc.EmptyCallOption // make sure we implement private after() and before() fields so we don't panic. - applyFunc func(opt *options) -} - -func reuseOrNewWithCallOptions(opt *options, retryOptions []retryOption) *options { - if len(retryOptions) == 0 { - return opt - } - optCopy := &options{} - *optCopy = *opt - for _, f := range retryOptions { - f.applyFunc(optCopy) - } - return optCopy -} - -func filterCallOptions(callOptions []grpc.CallOption) (grpcOptions []grpc.CallOption, retryOptions []retryOption) { - for _, opt := range callOptions { - if co, ok := opt.(retryOption); ok { - retryOptions = append(retryOptions, co) - } else { - grpcOptions = append(grpcOptions, opt) - } - } - return grpcOptions, retryOptions -} - -// BackoffLinearWithJitter waits a set period of time, allowing for jitter (fractional adjustment). -// -// For example waitBetween=1s and jitter=0.10 can generate waits between 900ms and 1100ms. -func backoffLinearWithJitter(waitBetween time.Duration, jitterFraction float64) backoffFunc { - return func(attempt uint) time.Duration { - return jitterUp(waitBetween, jitterFraction) - } -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/txn.go b/e2e/vendor/go.etcd.io/etcd/client/v3/txn.go deleted file mode 100644 index e31bfe0b9..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/txn.go +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - "sync" - - pb "go.etcd.io/etcd/api/v3/etcdserverpb" - - "google.golang.org/grpc" -) - -// Txn is the interface that wraps mini-transactions. -// -// Txn(context.TODO()).If( -// Compare(Value(k1), ">", v1), -// Compare(Version(k1), "=", 2) -// ).Then( -// OpPut(k2,v2), OpPut(k3,v3) -// ).Else( -// OpPut(k4,v4), OpPut(k5,v5) -// ).Commit() -type Txn interface { - // If takes a list of comparison. If all comparisons passed in succeed, - // the operations passed into Then() will be executed. Or the operations - // passed into Else() will be executed. - If(cs ...Cmp) Txn - - // Then takes a list of operations. The Ops list will be executed, if the - // comparisons passed in If() succeed. - Then(ops ...Op) Txn - - // Else takes a list of operations. The Ops list will be executed, if the - // comparisons passed in If() fail. - Else(ops ...Op) Txn - - // Commit tries to commit the transaction. - Commit() (*TxnResponse, error) -} - -type txn struct { - kv *kv - ctx context.Context - - mu sync.Mutex - cif bool - cthen bool - celse bool - - isWrite bool - - cmps []*pb.Compare - - sus []*pb.RequestOp - fas []*pb.RequestOp - - callOpts []grpc.CallOption -} - -func (txn *txn) If(cs ...Cmp) Txn { - txn.mu.Lock() - defer txn.mu.Unlock() - - if txn.cif { - panic("cannot call If twice!") - } - - if txn.cthen { - panic("cannot call If after Then!") - } - - if txn.celse { - panic("cannot call If after Else!") - } - - txn.cif = true - - for i := range cs { - txn.cmps = append(txn.cmps, (*pb.Compare)(&cs[i])) - } - - return txn -} - -func (txn *txn) Then(ops ...Op) Txn { - txn.mu.Lock() - defer txn.mu.Unlock() - - if txn.cthen { - panic("cannot call Then twice!") - } - if txn.celse { - panic("cannot call Then after Else!") - } - - txn.cthen = true - - for _, op := range ops { - txn.isWrite = txn.isWrite || op.isWrite() - txn.sus = append(txn.sus, op.toRequestOp()) - } - - return txn -} - -func (txn *txn) Else(ops ...Op) Txn { - txn.mu.Lock() - defer txn.mu.Unlock() - - if txn.celse { - panic("cannot call Else twice!") - } - - txn.celse = true - - for _, op := range ops { - txn.isWrite = txn.isWrite || op.isWrite() - txn.fas = append(txn.fas, op.toRequestOp()) - } - - return txn -} - -func (txn *txn) Commit() (*TxnResponse, error) { - txn.mu.Lock() - defer txn.mu.Unlock() - - r := &pb.TxnRequest{Compare: txn.cmps, Success: txn.sus, Failure: txn.fas} - - var resp *pb.TxnResponse - var err error - resp, err = txn.kv.remote.Txn(txn.ctx, r, txn.callOpts...) - if err != nil { - return nil, ContextError(txn.ctx, err) - } - return (*TxnResponse)(resp), nil -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/utils.go b/e2e/vendor/go.etcd.io/etcd/client/v3/utils.go deleted file mode 100644 index 850275877..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/utils.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2018 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "math/rand" - "time" -) - -// jitterUp adds random jitter to the duration. -// -// This adds or subtracts time from the duration within a given jitter fraction. -// For example for 10s and jitter 0.1, it will return a time within [9s, 11s]) -// -// Reference: https://godoc.org/github.com/grpc-ecosystem/go-grpc-middleware/util/backoffutils -func jitterUp(duration time.Duration, jitter float64) time.Duration { - multiplier := jitter * (rand.Float64()*2 - 1) - return time.Duration(float64(duration) * (1 + multiplier)) -} diff --git a/e2e/vendor/go.etcd.io/etcd/client/v3/watch.go b/e2e/vendor/go.etcd.io/etcd/client/v3/watch.go deleted file mode 100644 index 725e8a869..000000000 --- a/e2e/vendor/go.etcd.io/etcd/client/v3/watch.go +++ /dev/null @@ -1,1042 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - "errors" - "fmt" - "sync" - "time" - - pb "go.etcd.io/etcd/api/v3/etcdserverpb" - "go.etcd.io/etcd/api/v3/mvccpb" - v3rpc "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" - - "go.uber.org/zap" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -const ( - EventTypeDelete = mvccpb.DELETE - EventTypePut = mvccpb.PUT - - closeSendErrTimeout = 250 * time.Millisecond - - // AutoWatchID is the watcher ID passed in WatchStream.Watch when no - // user-provided ID is available. If pass, an ID will automatically be assigned. - AutoWatchID = 0 - - // InvalidWatchID represents an invalid watch ID and prevents duplication with an existing watch. - InvalidWatchID = -1 -) - -type Event mvccpb.Event - -type WatchChan <-chan WatchResponse - -type Watcher interface { - // Watch watches on a key or prefix. The watched events will be returned - // through the returned channel. If revisions waiting to be sent over the - // watch are compacted, then the watch will be canceled by the server, the - // client will post a compacted error watch response, and the channel will close. - // If the requested revision is 0 or unspecified, the returned channel will - // return watch events that happen after the server receives the watch request. - // If the context "ctx" is canceled or timed out, returned "WatchChan" is closed, - // and "WatchResponse" from this closed channel has zero events and nil "Err()". - // The context "ctx" MUST be canceled, as soon as watcher is no longer being used, - // to release the associated resources. - // - // If the context is "context.Background/TODO", returned "WatchChan" will - // not be closed and block until event is triggered, except when server - // returns a non-recoverable error (e.g. ErrCompacted). - // For example, when context passed with "WithRequireLeader" and the - // connected server has no leader (e.g. due to network partition), - // error "etcdserver: no leader" (ErrNoLeader) will be returned, - // and then "WatchChan" is closed with non-nil "Err()". - // In order to prevent a watch stream being stuck in a partitioned node, - // make sure to wrap context with "WithRequireLeader". - // - // Otherwise, as long as the context has not been canceled or timed out, - // watch will retry on other recoverable errors forever until reconnected. - // - // TODO: explicitly set context error in the last "WatchResponse" message and close channel? - // Currently, client contexts are overwritten with "valCtx" that never closes. - // TODO(v3.4): configure watch retry policy, limit maximum retry number - // (see https://github.com/etcd-io/etcd/issues/8980) - Watch(ctx context.Context, key string, opts ...OpOption) WatchChan - - // RequestProgress requests a progress notify response be sent in all watch channels. - RequestProgress(ctx context.Context) error - - // Close closes the watcher and cancels all watch requests. - Close() error -} - -type WatchResponse struct { - Header pb.ResponseHeader - Events []*Event - - // CompactRevision is the minimum revision the watcher may receive. - CompactRevision int64 - - // Canceled is used to indicate watch failure. - // If the watch failed and the stream was about to close, before the channel is closed, - // the channel sends a final response that has Canceled set to true with a non-nil Err(). - Canceled bool - - // Created is used to indicate the creation of the watcher. - Created bool - - closeErr error - - // cancelReason is a reason of canceling watch - cancelReason string -} - -// IsCreate returns true if the event tells that the key is newly created. -func (e *Event) IsCreate() bool { - return e.Type == EventTypePut && e.Kv.CreateRevision == e.Kv.ModRevision -} - -// IsModify returns true if the event tells that a new value is put on existing key. -func (e *Event) IsModify() bool { - return e.Type == EventTypePut && e.Kv.CreateRevision != e.Kv.ModRevision -} - -// Err is the error value if this WatchResponse holds an error. -func (wr *WatchResponse) Err() error { - switch { - case wr.closeErr != nil: - return v3rpc.Error(wr.closeErr) - case wr.CompactRevision != 0: - return v3rpc.ErrCompacted - case wr.Canceled: - if len(wr.cancelReason) != 0 { - return v3rpc.Error(status.Error(codes.FailedPrecondition, wr.cancelReason)) - } - return v3rpc.ErrFutureRev - } - return nil -} - -// IsProgressNotify returns true if the WatchResponse is progress notification. -func (wr *WatchResponse) IsProgressNotify() bool { - return len(wr.Events) == 0 && !wr.Canceled && !wr.Created && wr.CompactRevision == 0 && wr.Header.Revision != 0 -} - -// watcher implements the Watcher interface -type watcher struct { - remote pb.WatchClient - callOpts []grpc.CallOption - - // mu protects the grpc streams map - mu sync.Mutex - - // streams holds all the active grpc streams keyed by ctx value. - streams map[string]*watchGrpcStream - lg *zap.Logger -} - -// watchGrpcStream tracks all watch resources attached to a single grpc stream. -type watchGrpcStream struct { - owner *watcher - remote pb.WatchClient - callOpts []grpc.CallOption - - // ctx controls internal remote.Watch requests - ctx context.Context - // ctxKey is the key used when looking up this stream's context - ctxKey string - cancel context.CancelFunc - - // substreams holds all active watchers on this grpc stream - substreams map[int64]*watcherStream - // resuming holds all resuming watchers on this grpc stream - resuming []*watcherStream - - // reqc sends a watch request from Watch() to the main goroutine - reqc chan watchStreamRequest - // respc receives data from the watch client - respc chan *pb.WatchResponse - // donec closes to broadcast shutdown - donec chan struct{} - // errc transmits errors from grpc Recv to the watch stream reconnect logic - errc chan error - // closingc gets the watcherStream of closing watchers - closingc chan *watcherStream - // wg is Done when all substream goroutines have exited - wg sync.WaitGroup - - // resumec closes to signal that all substreams should begin resuming - resumec chan struct{} - // closeErr is the error that closed the watch stream - closeErr error - - lg *zap.Logger -} - -// watchStreamRequest is a union of the supported watch request operation types -type watchStreamRequest interface { - toPB() *pb.WatchRequest -} - -// watchRequest is issued by the subscriber to start a new watcher -type watchRequest struct { - ctx context.Context - key string - end string - rev int64 - - // send created notification event if this field is true - createdNotify bool - // progressNotify is for progress updates - progressNotify bool - // fragmentation should be disabled by default - // if true, split watch events when total exceeds - // "--max-request-bytes" flag value + 512-byte - fragment bool - - // filters is the list of events to filter out - filters []pb.WatchCreateRequest_FilterType - // get the previous key-value pair before the event happens - prevKV bool - // retc receives a chan WatchResponse once the watcher is established - retc chan chan WatchResponse -} - -// progressRequest is issued by the subscriber to request watch progress -type progressRequest struct { -} - -// watcherStream represents a registered watcher -type watcherStream struct { - // initReq is the request that initiated this request - initReq watchRequest - - // outc publishes watch responses to subscriber - outc chan WatchResponse - // recvc buffers watch responses before publishing - recvc chan *WatchResponse - // donec closes when the watcherStream goroutine stops. - donec chan struct{} - // closing is set to true when stream should be scheduled to shutdown. - closing bool - // id is the registered watch id on the grpc stream - id int64 - - // buf holds all events received from etcd but not yet consumed by the client - buf []*WatchResponse -} - -func NewWatcher(c *Client) Watcher { - return NewWatchFromWatchClient(pb.NewWatchClient(c.conn), c) -} - -func NewWatchFromWatchClient(wc pb.WatchClient, c *Client) Watcher { - w := &watcher{ - remote: wc, - streams: make(map[string]*watchGrpcStream), - } - if c != nil { - w.callOpts = c.callOpts - w.lg = c.lg - } - return w -} - -// never closes -var valCtxCh = make(chan struct{}) -var zeroTime = time.Unix(0, 0) - -// ctx with only the values; never Done -type valCtx struct{ context.Context } - -func (vc *valCtx) Deadline() (time.Time, bool) { return zeroTime, false } -func (vc *valCtx) Done() <-chan struct{} { return valCtxCh } -func (vc *valCtx) Err() error { return nil } - -func (w *watcher) newWatcherGrpcStream(inctx context.Context) *watchGrpcStream { - ctx, cancel := context.WithCancel(&valCtx{inctx}) - wgs := &watchGrpcStream{ - owner: w, - remote: w.remote, - callOpts: w.callOpts, - ctx: ctx, - ctxKey: streamKeyFromCtx(inctx), - cancel: cancel, - substreams: make(map[int64]*watcherStream), - respc: make(chan *pb.WatchResponse), - reqc: make(chan watchStreamRequest), - donec: make(chan struct{}), - errc: make(chan error, 1), - closingc: make(chan *watcherStream), - resumec: make(chan struct{}), - lg: w.lg, - } - go wgs.run() - return wgs -} - -// Watch posts a watch request to run() and waits for a new watcher channel -func (w *watcher) Watch(ctx context.Context, key string, opts ...OpOption) WatchChan { - ow := opWatch(key, opts...) - - var filters []pb.WatchCreateRequest_FilterType - if ow.filterPut { - filters = append(filters, pb.WatchCreateRequest_NOPUT) - } - if ow.filterDelete { - filters = append(filters, pb.WatchCreateRequest_NODELETE) - } - - wr := &watchRequest{ - ctx: ctx, - createdNotify: ow.createdNotify, - key: string(ow.key), - end: string(ow.end), - rev: ow.rev, - progressNotify: ow.progressNotify, - fragment: ow.fragment, - filters: filters, - prevKV: ow.prevKV, - retc: make(chan chan WatchResponse, 1), - } - - ok := false - ctxKey := streamKeyFromCtx(ctx) - - var closeCh chan WatchResponse - for { - // find or allocate appropriate grpc watch stream - w.mu.Lock() - if w.streams == nil { - // closed - w.mu.Unlock() - ch := make(chan WatchResponse) - close(ch) - return ch - } - wgs := w.streams[ctxKey] - if wgs == nil { - wgs = w.newWatcherGrpcStream(ctx) - w.streams[ctxKey] = wgs - } - donec := wgs.donec - reqc := wgs.reqc - w.mu.Unlock() - - // couldn't create channel; return closed channel - if closeCh == nil { - closeCh = make(chan WatchResponse, 1) - } - - // submit request - select { - case reqc <- wr: - ok = true - case <-wr.ctx.Done(): - ok = false - case <-donec: - ok = false - if wgs.closeErr != nil { - closeCh <- WatchResponse{Canceled: true, closeErr: wgs.closeErr} - break - } - // retry; may have dropped stream from no ctxs - continue - } - - // receive channel - if ok { - select { - case ret := <-wr.retc: - return ret - case <-ctx.Done(): - case <-donec: - if wgs.closeErr != nil { - closeCh <- WatchResponse{Canceled: true, closeErr: wgs.closeErr} - break - } - // retry; may have dropped stream from no ctxs - continue - } - } - break - } - - close(closeCh) - return closeCh -} - -func (w *watcher) Close() (err error) { - w.mu.Lock() - streams := w.streams - w.streams = nil - w.mu.Unlock() - for _, wgs := range streams { - if werr := wgs.close(); werr != nil { - err = werr - } - } - // Consider context.Canceled as a successful close - if err == context.Canceled { - err = nil - } - return err -} - -// RequestProgress requests a progress notify response be sent in all watch channels. -func (w *watcher) RequestProgress(ctx context.Context) (err error) { - ctxKey := streamKeyFromCtx(ctx) - - w.mu.Lock() - if w.streams == nil { - w.mu.Unlock() - return fmt.Errorf("no stream found for context") - } - wgs := w.streams[ctxKey] - if wgs == nil { - wgs = w.newWatcherGrpcStream(ctx) - w.streams[ctxKey] = wgs - } - donec := wgs.donec - reqc := wgs.reqc - w.mu.Unlock() - - pr := &progressRequest{} - - select { - case reqc <- pr: - return nil - case <-ctx.Done(): - return ctx.Err() - case <-donec: - if wgs.closeErr != nil { - return wgs.closeErr - } - // retry; may have dropped stream from no ctxs - return w.RequestProgress(ctx) - } -} - -func (w *watchGrpcStream) close() (err error) { - w.cancel() - <-w.donec - select { - case err = <-w.errc: - default: - } - return ContextError(w.ctx, err) -} - -func (w *watcher) closeStream(wgs *watchGrpcStream) { - w.mu.Lock() - close(wgs.donec) - wgs.cancel() - if w.streams != nil { - delete(w.streams, wgs.ctxKey) - } - w.mu.Unlock() -} - -func (w *watchGrpcStream) addSubstream(resp *pb.WatchResponse, ws *watcherStream) { - // check watch ID for backward compatibility (<= v3.3) - if resp.WatchId == InvalidWatchID || (resp.Canceled && resp.CancelReason != "") { - w.closeErr = v3rpc.Error(errors.New(resp.CancelReason)) - // failed; no channel - close(ws.recvc) - return - } - ws.id = resp.WatchId - w.substreams[ws.id] = ws -} - -func (w *watchGrpcStream) sendCloseSubstream(ws *watcherStream, resp *WatchResponse) { - select { - case ws.outc <- *resp: - case <-ws.initReq.ctx.Done(): - case <-time.After(closeSendErrTimeout): - } - close(ws.outc) -} - -func (w *watchGrpcStream) closeSubstream(ws *watcherStream) { - // send channel response in case stream was never established - select { - case ws.initReq.retc <- ws.outc: - default: - } - // close subscriber's channel - if closeErr := w.closeErr; closeErr != nil && ws.initReq.ctx.Err() == nil { - go w.sendCloseSubstream(ws, &WatchResponse{Canceled: true, closeErr: w.closeErr}) - } else if ws.outc != nil { - close(ws.outc) - } - if ws.id != InvalidWatchID { - delete(w.substreams, ws.id) - return - } - for i := range w.resuming { - if w.resuming[i] == ws { - w.resuming[i] = nil - return - } - } -} - -// run is the root of the goroutines for managing a watcher client -func (w *watchGrpcStream) run() { - var wc pb.Watch_WatchClient - var closeErr error - - // substreams marked to close but goroutine still running; needed for - // avoiding double-closing recvc on grpc stream teardown - closing := make(map[*watcherStream]struct{}) - - defer func() { - w.closeErr = closeErr - // shutdown substreams and resuming substreams - for _, ws := range w.substreams { - if _, ok := closing[ws]; !ok { - close(ws.recvc) - closing[ws] = struct{}{} - } - } - for _, ws := range w.resuming { - if _, ok := closing[ws]; ws != nil && !ok { - close(ws.recvc) - closing[ws] = struct{}{} - } - } - w.joinSubstreams() - for range closing { - w.closeSubstream(<-w.closingc) - } - w.wg.Wait() - w.owner.closeStream(w) - }() - - // start a stream with the etcd grpc server - if wc, closeErr = w.newWatchClient(); closeErr != nil { - return - } - - cancelSet := make(map[int64]struct{}) - - var cur *pb.WatchResponse - backoff := time.Millisecond - for { - select { - // Watch() requested - case req := <-w.reqc: - switch wreq := req.(type) { - case *watchRequest: - outc := make(chan WatchResponse, 1) - // TODO: pass custom watch ID? - ws := &watcherStream{ - initReq: *wreq, - id: InvalidWatchID, - outc: outc, - // unbuffered so resumes won't cause repeat events - recvc: make(chan *WatchResponse), - } - - ws.donec = make(chan struct{}) - w.wg.Add(1) - go w.serveSubstream(ws, w.resumec) - - // queue up for watcher creation/resume - w.resuming = append(w.resuming, ws) - if len(w.resuming) == 1 { - // head of resume queue, can register a new watcher - if err := wc.Send(ws.initReq.toPB()); err != nil { - w.lg.Debug("error when sending request", zap.Error(err)) - } - } - case *progressRequest: - if err := wc.Send(wreq.toPB()); err != nil { - w.lg.Debug("error when sending request", zap.Error(err)) - } - } - - // new events from the watch client - case pbresp := <-w.respc: - if cur == nil || pbresp.Created || pbresp.Canceled { - cur = pbresp - } else if cur != nil && cur.WatchId == pbresp.WatchId { - // merge new events - cur.Events = append(cur.Events, pbresp.Events...) - // update "Fragment" field; last response with "Fragment" == false - cur.Fragment = pbresp.Fragment - } - - switch { - case pbresp.Created: - // response to head of queue creation - if len(w.resuming) != 0 { - if ws := w.resuming[0]; ws != nil { - w.addSubstream(pbresp, ws) - w.dispatchEvent(pbresp) - w.resuming[0] = nil - } - } - - if ws := w.nextResume(); ws != nil { - if err := wc.Send(ws.initReq.toPB()); err != nil { - w.lg.Debug("error when sending request", zap.Error(err)) - } - } - - // reset for next iteration - cur = nil - - case pbresp.Canceled && pbresp.CompactRevision == 0: - delete(cancelSet, pbresp.WatchId) - if ws, ok := w.substreams[pbresp.WatchId]; ok { - // signal to stream goroutine to update closingc - close(ws.recvc) - closing[ws] = struct{}{} - } - - // reset for next iteration - cur = nil - - case cur.Fragment: - // watch response events are still fragmented - // continue to fetch next fragmented event arrival - continue - - default: - // dispatch to appropriate watch stream - ok := w.dispatchEvent(cur) - - // reset for next iteration - cur = nil - - if ok { - break - } - - // watch response on unexpected watch id; cancel id - if _, ok := cancelSet[pbresp.WatchId]; ok { - break - } - - cancelSet[pbresp.WatchId] = struct{}{} - cr := &pb.WatchRequest_CancelRequest{ - CancelRequest: &pb.WatchCancelRequest{ - WatchId: pbresp.WatchId, - }, - } - req := &pb.WatchRequest{RequestUnion: cr} - w.lg.Debug("sending watch cancel request for failed dispatch", zap.Int64("watch-id", pbresp.WatchId)) - if err := wc.Send(req); err != nil { - w.lg.Debug("failed to send watch cancel request", zap.Int64("watch-id", pbresp.WatchId), zap.Error(err)) - } - } - - // watch client failed on Recv; spawn another if possible - case err := <-w.errc: - if isHaltErr(w.ctx, err) || ContextError(w.ctx, err) == v3rpc.ErrNoLeader { - closeErr = err - return - } - backoff = w.backoffIfUnavailable(backoff, err) - if wc, closeErr = w.newWatchClient(); closeErr != nil { - return - } - if ws := w.nextResume(); ws != nil { - if err := wc.Send(ws.initReq.toPB()); err != nil { - w.lg.Debug("error when sending request", zap.Error(err)) - } - } - cancelSet = make(map[int64]struct{}) - - case <-w.ctx.Done(): - return - - case ws := <-w.closingc: - w.closeSubstream(ws) - delete(closing, ws) - // no more watchers on this stream, shutdown, skip cancellation - if len(w.substreams)+len(w.resuming) == 0 { - return - } - if ws.id != InvalidWatchID { - // client is closing an established watch; close it on the server proactively instead of waiting - // to close when the next message arrives - cancelSet[ws.id] = struct{}{} - cr := &pb.WatchRequest_CancelRequest{ - CancelRequest: &pb.WatchCancelRequest{ - WatchId: ws.id, - }, - } - req := &pb.WatchRequest{RequestUnion: cr} - w.lg.Debug("sending watch cancel request for closed watcher", zap.Int64("watch-id", ws.id)) - if err := wc.Send(req); err != nil { - w.lg.Debug("failed to send watch cancel request", zap.Int64("watch-id", ws.id), zap.Error(err)) - } - } - } - } -} - -// nextResume chooses the next resuming to register with the grpc stream. Abandoned -// streams are marked as nil in the queue since the head must wait for its inflight registration. -func (w *watchGrpcStream) nextResume() *watcherStream { - for len(w.resuming) != 0 { - if w.resuming[0] != nil { - return w.resuming[0] - } - w.resuming = w.resuming[1:len(w.resuming)] - } - return nil -} - -// dispatchEvent sends a WatchResponse to the appropriate watcher stream -func (w *watchGrpcStream) dispatchEvent(pbresp *pb.WatchResponse) bool { - events := make([]*Event, len(pbresp.Events)) - for i, ev := range pbresp.Events { - events[i] = (*Event)(ev) - } - // TODO: return watch ID? - wr := &WatchResponse{ - Header: *pbresp.Header, - Events: events, - CompactRevision: pbresp.CompactRevision, - Created: pbresp.Created, - Canceled: pbresp.Canceled, - cancelReason: pbresp.CancelReason, - } - - // watch IDs are zero indexed, so request notify watch responses are assigned a watch ID of InvalidWatchID to - // indicate they should be broadcast. - if wr.IsProgressNotify() && pbresp.WatchId == InvalidWatchID { - return w.broadcastResponse(wr) - } - - return w.unicastResponse(wr, pbresp.WatchId) - -} - -// broadcastResponse send a watch response to all watch substreams. -func (w *watchGrpcStream) broadcastResponse(wr *WatchResponse) bool { - for _, ws := range w.substreams { - select { - case ws.recvc <- wr: - case <-ws.donec: - } - } - return true -} - -// unicastResponse sends a watch response to a specific watch substream. -func (w *watchGrpcStream) unicastResponse(wr *WatchResponse, watchId int64) bool { - ws, ok := w.substreams[watchId] - if !ok { - return false - } - select { - case ws.recvc <- wr: - case <-ws.donec: - return false - } - return true -} - -// serveWatchClient forwards messages from the grpc stream to run() -func (w *watchGrpcStream) serveWatchClient(wc pb.Watch_WatchClient) { - for { - resp, err := wc.Recv() - if err != nil { - select { - case w.errc <- err: - case <-w.donec: - } - return - } - select { - case w.respc <- resp: - case <-w.donec: - return - } - } -} - -// serveSubstream forwards watch responses from run() to the subscriber -func (w *watchGrpcStream) serveSubstream(ws *watcherStream, resumec chan struct{}) { - if ws.closing { - panic("created substream goroutine but substream is closing") - } - - // nextRev is the minimum expected next revision - nextRev := ws.initReq.rev - resuming := false - defer func() { - if !resuming { - ws.closing = true - } - close(ws.donec) - if !resuming { - w.closingc <- ws - } - w.wg.Done() - }() - - emptyWr := &WatchResponse{} - for { - curWr := emptyWr - outc := ws.outc - - if len(ws.buf) > 0 { - curWr = ws.buf[0] - } else { - outc = nil - } - select { - case outc <- *curWr: - if ws.buf[0].Err() != nil { - return - } - ws.buf[0] = nil - ws.buf = ws.buf[1:] - case wr, ok := <-ws.recvc: - if !ok { - // shutdown from closeSubstream - return - } - - if wr.Created { - if ws.initReq.retc != nil { - ws.initReq.retc <- ws.outc - // to prevent next write from taking the slot in buffered channel - // and posting duplicate create events - ws.initReq.retc = nil - - // send first creation event only if requested - if ws.initReq.createdNotify { - ws.outc <- *wr - } - // once the watch channel is returned, a current revision - // watch must resume at the store revision. This is necessary - // for the following case to work as expected: - // wch := m1.Watch("a") - // m2.Put("a", "b") - // <-wch - // If the revision is only bound on the first observed event, - // if wch is disconnected before the Put is issued, then reconnects - // after it is committed, it'll miss the Put. - if ws.initReq.rev == 0 { - nextRev = wr.Header.Revision - } - } - } else { - // current progress of watch; <= store revision - nextRev = wr.Header.Revision + 1 - } - - if len(wr.Events) > 0 { - nextRev = wr.Events[len(wr.Events)-1].Kv.ModRevision + 1 - } - ws.initReq.rev = nextRev - - // created event is already sent above, - // watcher should not post duplicate events - if wr.Created { - continue - } - - // TODO pause channel if buffer gets too large - ws.buf = append(ws.buf, wr) - case <-w.ctx.Done(): - return - case <-ws.initReq.ctx.Done(): - return - case <-resumec: - resuming = true - return - } - } - // lazily send cancel message if events on missing id -} - -func (w *watchGrpcStream) newWatchClient() (pb.Watch_WatchClient, error) { - // mark all substreams as resuming - close(w.resumec) - w.resumec = make(chan struct{}) - w.joinSubstreams() - for _, ws := range w.substreams { - ws.id = InvalidWatchID - w.resuming = append(w.resuming, ws) - } - // strip out nils, if any - var resuming []*watcherStream - for _, ws := range w.resuming { - if ws != nil { - resuming = append(resuming, ws) - } - } - w.resuming = resuming - w.substreams = make(map[int64]*watcherStream) - - // connect to grpc stream while accepting watcher cancelation - stopc := make(chan struct{}) - donec := w.waitCancelSubstreams(stopc) - wc, err := w.openWatchClient() - close(stopc) - <-donec - - // serve all non-closing streams, even if there's a client error - // so that the teardown path can shutdown the streams as expected. - for _, ws := range w.resuming { - if ws.closing { - continue - } - ws.donec = make(chan struct{}) - w.wg.Add(1) - go w.serveSubstream(ws, w.resumec) - } - - if err != nil { - return nil, v3rpc.Error(err) - } - - // receive data from new grpc stream - go w.serveWatchClient(wc) - return wc, nil -} - -func (w *watchGrpcStream) waitCancelSubstreams(stopc <-chan struct{}) <-chan struct{} { - var wg sync.WaitGroup - wg.Add(len(w.resuming)) - donec := make(chan struct{}) - for i := range w.resuming { - go func(ws *watcherStream) { - defer wg.Done() - if ws.closing { - if ws.initReq.ctx.Err() != nil && ws.outc != nil { - close(ws.outc) - ws.outc = nil - } - return - } - select { - case <-ws.initReq.ctx.Done(): - // closed ws will be removed from resuming - ws.closing = true - close(ws.outc) - ws.outc = nil - w.wg.Add(1) - go func() { - defer w.wg.Done() - w.closingc <- ws - }() - case <-stopc: - } - }(w.resuming[i]) - } - go func() { - defer close(donec) - wg.Wait() - }() - return donec -} - -// joinSubstreams waits for all substream goroutines to complete. -func (w *watchGrpcStream) joinSubstreams() { - for _, ws := range w.substreams { - <-ws.donec - } - for _, ws := range w.resuming { - if ws != nil { - <-ws.donec - } - } -} - -var maxBackoff = 100 * time.Millisecond - -func (w *watchGrpcStream) backoffIfUnavailable(backoff time.Duration, err error) time.Duration { - if isUnavailableErr(w.ctx, err) { - // retry, but backoff - if backoff < maxBackoff { - // 25% backoff factor - backoff = backoff + backoff/4 - if backoff > maxBackoff { - backoff = maxBackoff - } - } - time.Sleep(backoff) - } - return backoff -} - -// openWatchClient retries opening a watch client until success or halt. -// manually retry in case "ws==nil && err==nil" -// TODO: remove FailFast=false -func (w *watchGrpcStream) openWatchClient() (ws pb.Watch_WatchClient, err error) { - backoff := time.Millisecond - for { - select { - case <-w.ctx.Done(): - if err == nil { - return nil, w.ctx.Err() - } - return nil, err - default: - } - if ws, err = w.remote.Watch(w.ctx, w.callOpts...); ws != nil && err == nil { - break - } - if isHaltErr(w.ctx, err) { - return nil, v3rpc.Error(err) - } - backoff = w.backoffIfUnavailable(backoff, err) - } - return ws, nil -} - -// toPB converts an internal watch request structure to its protobuf WatchRequest structure. -func (wr *watchRequest) toPB() *pb.WatchRequest { - req := &pb.WatchCreateRequest{ - StartRevision: wr.rev, - Key: []byte(wr.key), - RangeEnd: []byte(wr.end), - ProgressNotify: wr.progressNotify, - Filters: wr.filters, - PrevKv: wr.prevKV, - Fragment: wr.fragment, - } - cr := &pb.WatchRequest_CreateRequest{CreateRequest: req} - return &pb.WatchRequest{RequestUnion: cr} -} - -// toPB converts an internal progress request structure to its protobuf WatchRequest structure. -func (pr *progressRequest) toPB() *pb.WatchRequest { - req := &pb.WatchProgressRequest{} - cr := &pb.WatchRequest_ProgressRequest{ProgressRequest: req} - return &pb.WatchRequest{RequestUnion: cr} -} - -func streamKeyFromCtx(ctx context.Context) string { - if md, ok := metadata.FromOutgoingContext(ctx); ok { - return fmt.Sprintf("%+v", map[string][]string(md)) - } - return "" -} diff --git a/e2e/vendor/go.opentelemetry.io/otel/semconv/internal/http.go b/e2e/vendor/go.opentelemetry.io/otel/semconv/internal/http.go deleted file mode 100644 index d5197e16c..000000000 --- a/e2e/vendor/go.opentelemetry.io/otel/semconv/internal/http.go +++ /dev/null @@ -1,327 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package internal // import "go.opentelemetry.io/otel/semconv/internal" - -import ( - "fmt" - "net" - "net/http" - "strconv" - "strings" - - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/trace" -) - -// SemanticConventions are the semantic convention values defined for a -// version of the OpenTelemetry specification. -type SemanticConventions struct { - EnduserIDKey attribute.Key - HTTPClientIPKey attribute.Key - HTTPFlavorKey attribute.Key - HTTPHostKey attribute.Key - HTTPMethodKey attribute.Key - HTTPRequestContentLengthKey attribute.Key - HTTPRouteKey attribute.Key - HTTPSchemeHTTP attribute.KeyValue - HTTPSchemeHTTPS attribute.KeyValue - HTTPServerNameKey attribute.Key - HTTPStatusCodeKey attribute.Key - HTTPTargetKey attribute.Key - HTTPURLKey attribute.Key - HTTPUserAgentKey attribute.Key - NetHostIPKey attribute.Key - NetHostNameKey attribute.Key - NetHostPortKey attribute.Key - NetPeerIPKey attribute.Key - NetPeerNameKey attribute.Key - NetPeerPortKey attribute.Key - NetTransportIP attribute.KeyValue - NetTransportOther attribute.KeyValue - NetTransportTCP attribute.KeyValue - NetTransportUDP attribute.KeyValue - NetTransportUnix attribute.KeyValue -} - -// NetAttributesFromHTTPRequest generates attributes of the net -// namespace as specified by the OpenTelemetry specification for a -// span. The network parameter is a string that net.Dial function -// from standard library can understand. -func (sc *SemanticConventions) NetAttributesFromHTTPRequest(network string, request *http.Request) []attribute.KeyValue { - attrs := []attribute.KeyValue{} - - switch network { - case "tcp", "tcp4", "tcp6": - attrs = append(attrs, sc.NetTransportTCP) - case "udp", "udp4", "udp6": - attrs = append(attrs, sc.NetTransportUDP) - case "ip", "ip4", "ip6": - attrs = append(attrs, sc.NetTransportIP) - case "unix", "unixgram", "unixpacket": - attrs = append(attrs, sc.NetTransportUnix) - default: - attrs = append(attrs, sc.NetTransportOther) - } - - peerIP, peerName, peerPort := hostIPNamePort(request.RemoteAddr) - if peerIP != "" { - attrs = append(attrs, sc.NetPeerIPKey.String(peerIP)) - } - if peerName != "" { - attrs = append(attrs, sc.NetPeerNameKey.String(peerName)) - } - if peerPort != 0 { - attrs = append(attrs, sc.NetPeerPortKey.Int(peerPort)) - } - - hostIP, hostName, hostPort := "", "", 0 - for _, someHost := range []string{request.Host, request.Header.Get("Host"), request.URL.Host} { - hostIP, hostName, hostPort = hostIPNamePort(someHost) - if hostIP != "" || hostName != "" || hostPort != 0 { - break - } - } - if hostIP != "" { - attrs = append(attrs, sc.NetHostIPKey.String(hostIP)) - } - if hostName != "" { - attrs = append(attrs, sc.NetHostNameKey.String(hostName)) - } - if hostPort != 0 { - attrs = append(attrs, sc.NetHostPortKey.Int(hostPort)) - } - - return attrs -} - -// hostIPNamePort extracts the IP address, name and (optional) port from hostWithPort. -// It handles both IPv4 and IPv6 addresses. If the host portion is not recognized -// as a valid IPv4 or IPv6 address, the `ip` result will be empty and the -// host portion will instead be returned in `name`. -func hostIPNamePort(hostWithPort string) (ip string, name string, port int) { - var ( - hostPart, portPart string - parsedPort uint64 - err error - ) - if hostPart, portPart, err = net.SplitHostPort(hostWithPort); err != nil { - hostPart, portPart = hostWithPort, "" - } - if parsedIP := net.ParseIP(hostPart); parsedIP != nil { - ip = parsedIP.String() - } else { - name = hostPart - } - if parsedPort, err = strconv.ParseUint(portPart, 10, 16); err == nil { - port = int(parsedPort) // nolint: gosec // Bit size of 16 checked above. - } - return -} - -// EndUserAttributesFromHTTPRequest generates attributes of the -// enduser namespace as specified by the OpenTelemetry specification -// for a span. -func (sc *SemanticConventions) EndUserAttributesFromHTTPRequest(request *http.Request) []attribute.KeyValue { - if username, _, ok := request.BasicAuth(); ok { - return []attribute.KeyValue{sc.EnduserIDKey.String(username)} - } - return nil -} - -// HTTPClientAttributesFromHTTPRequest generates attributes of the -// http namespace as specified by the OpenTelemetry specification for -// a span on the client side. -func (sc *SemanticConventions) HTTPClientAttributesFromHTTPRequest(request *http.Request) []attribute.KeyValue { - attrs := []attribute.KeyValue{} - - // remove any username/password info that may be in the URL - // before adding it to the attributes - userinfo := request.URL.User - request.URL.User = nil - - attrs = append(attrs, sc.HTTPURLKey.String(request.URL.String())) - - // restore any username/password info that was removed - request.URL.User = userinfo - - return append(attrs, sc.httpCommonAttributesFromHTTPRequest(request)...) -} - -func (sc *SemanticConventions) httpCommonAttributesFromHTTPRequest(request *http.Request) []attribute.KeyValue { - attrs := []attribute.KeyValue{} - if ua := request.UserAgent(); ua != "" { - attrs = append(attrs, sc.HTTPUserAgentKey.String(ua)) - } - if request.ContentLength > 0 { - attrs = append(attrs, sc.HTTPRequestContentLengthKey.Int64(request.ContentLength)) - } - - return append(attrs, sc.httpBasicAttributesFromHTTPRequest(request)...) -} - -func (sc *SemanticConventions) httpBasicAttributesFromHTTPRequest(request *http.Request) []attribute.KeyValue { - // as these attributes are used by HTTPServerMetricAttributesFromHTTPRequest, they should be low-cardinality - attrs := []attribute.KeyValue{} - - if request.TLS != nil { - attrs = append(attrs, sc.HTTPSchemeHTTPS) - } else { - attrs = append(attrs, sc.HTTPSchemeHTTP) - } - - if request.Host != "" { - attrs = append(attrs, sc.HTTPHostKey.String(request.Host)) - } else if request.URL != nil && request.URL.Host != "" { - attrs = append(attrs, sc.HTTPHostKey.String(request.URL.Host)) - } - - flavor := "" - if request.ProtoMajor == 1 { - flavor = fmt.Sprintf("1.%d", request.ProtoMinor) - } else if request.ProtoMajor == 2 { - flavor = "2" - } - if flavor != "" { - attrs = append(attrs, sc.HTTPFlavorKey.String(flavor)) - } - - if request.Method != "" { - attrs = append(attrs, sc.HTTPMethodKey.String(request.Method)) - } else { - attrs = append(attrs, sc.HTTPMethodKey.String(http.MethodGet)) - } - - return attrs -} - -// HTTPServerMetricAttributesFromHTTPRequest generates low-cardinality attributes -// to be used with server-side HTTP metrics. -func (sc *SemanticConventions) HTTPServerMetricAttributesFromHTTPRequest(serverName string, request *http.Request) []attribute.KeyValue { - attrs := []attribute.KeyValue{} - if serverName != "" { - attrs = append(attrs, sc.HTTPServerNameKey.String(serverName)) - } - return append(attrs, sc.httpBasicAttributesFromHTTPRequest(request)...) -} - -// HTTPServerAttributesFromHTTPRequest generates attributes of the -// http namespace as specified by the OpenTelemetry specification for -// a span on the server side. Currently, only basic authentication is -// supported. -func (sc *SemanticConventions) HTTPServerAttributesFromHTTPRequest(serverName, route string, request *http.Request) []attribute.KeyValue { - attrs := []attribute.KeyValue{ - sc.HTTPTargetKey.String(request.RequestURI), - } - - if serverName != "" { - attrs = append(attrs, sc.HTTPServerNameKey.String(serverName)) - } - if route != "" { - attrs = append(attrs, sc.HTTPRouteKey.String(route)) - } - if values := request.Header["X-Forwarded-For"]; len(values) > 0 { - addr := values[0] - if i := strings.Index(addr, ","); i > 0 { - addr = addr[:i] - } - attrs = append(attrs, sc.HTTPClientIPKey.String(addr)) - } - - return append(attrs, sc.httpCommonAttributesFromHTTPRequest(request)...) -} - -// HTTPAttributesFromHTTPStatusCode generates attributes of the http -// namespace as specified by the OpenTelemetry specification for a -// span. -func (sc *SemanticConventions) HTTPAttributesFromHTTPStatusCode(code int) []attribute.KeyValue { - attrs := []attribute.KeyValue{ - sc.HTTPStatusCodeKey.Int(code), - } - return attrs -} - -type codeRange struct { - fromInclusive int - toInclusive int -} - -func (r codeRange) contains(code int) bool { - return r.fromInclusive <= code && code <= r.toInclusive -} - -var validRangesPerCategory = map[int][]codeRange{ - 1: { - {http.StatusContinue, http.StatusEarlyHints}, - }, - 2: { - {http.StatusOK, http.StatusAlreadyReported}, - {http.StatusIMUsed, http.StatusIMUsed}, - }, - 3: { - {http.StatusMultipleChoices, http.StatusUseProxy}, - {http.StatusTemporaryRedirect, http.StatusPermanentRedirect}, - }, - 4: { - {http.StatusBadRequest, http.StatusTeapot}, // yes, teapot is so useful… - {http.StatusMisdirectedRequest, http.StatusUpgradeRequired}, - {http.StatusPreconditionRequired, http.StatusTooManyRequests}, - {http.StatusRequestHeaderFieldsTooLarge, http.StatusRequestHeaderFieldsTooLarge}, - {http.StatusUnavailableForLegalReasons, http.StatusUnavailableForLegalReasons}, - }, - 5: { - {http.StatusInternalServerError, http.StatusLoopDetected}, - {http.StatusNotExtended, http.StatusNetworkAuthenticationRequired}, - }, -} - -// SpanStatusFromHTTPStatusCode generates a status code and a message -// as specified by the OpenTelemetry specification for a span. -func SpanStatusFromHTTPStatusCode(code int) (codes.Code, string) { - spanCode, valid := validateHTTPStatusCode(code) - if !valid { - return spanCode, fmt.Sprintf("Invalid HTTP status code %d", code) - } - return spanCode, "" -} - -// SpanStatusFromHTTPStatusCodeAndSpanKind generates a status code and a message -// as specified by the OpenTelemetry specification for a span. -// Exclude 4xx for SERVER to set the appropriate status. -func SpanStatusFromHTTPStatusCodeAndSpanKind(code int, spanKind trace.SpanKind) (codes.Code, string) { - spanCode, valid := validateHTTPStatusCode(code) - if !valid { - return spanCode, fmt.Sprintf("Invalid HTTP status code %d", code) - } - category := code / 100 - if spanKind == trace.SpanKindServer && category == 4 { - return codes.Unset, "" - } - return spanCode, "" -} - -// validateHTTPStatusCode validates the HTTP status code and returns -// corresponding span status code. If the `code` is not a valid HTTP status -// code, returns span status Error and false. -func validateHTTPStatusCode(code int) (codes.Code, bool) { - category := code / 100 - ranges, ok := validRangesPerCategory[category] - if !ok { - return codes.Error, false - } - ok = false - for _, crange := range ranges { - ok = crange.contains(code) - if ok { - break - } - } - if !ok { - return codes.Error, false - } - if category > 0 && category < 4 { - return codes.Unset, true - } - return codes.Error, true -} diff --git a/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/README.md b/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/README.md deleted file mode 100644 index 6a273180f..000000000 --- a/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Semconv v1.12.0 - -[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.12.0)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.12.0) diff --git a/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/doc.go b/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/doc.go deleted file mode 100644 index fc255ef05..000000000 --- a/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/doc.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Package semconv implements OpenTelemetry semantic conventions. -// -// OpenTelemetry semantic conventions are agreed standardized naming -// patterns for OpenTelemetry things. This package represents the conventions -// as of the v1.12.0 version of the OpenTelemetry specification. -package semconv // import "go.opentelemetry.io/otel/semconv/v1.12.0" diff --git a/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/exception.go b/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/exception.go deleted file mode 100644 index f0e12957e..000000000 --- a/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/exception.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package semconv // import "go.opentelemetry.io/otel/semconv/v1.12.0" - -const ( - // ExceptionEventName is the name of the Span event representing an exception. - ExceptionEventName = "exception" -) diff --git a/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/http.go b/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/http.go deleted file mode 100644 index 4e19ca342..000000000 --- a/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/http.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package semconv // import "go.opentelemetry.io/otel/semconv/v1.12.0" - -import ( - "net/http" - - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/semconv/internal" - "go.opentelemetry.io/otel/trace" -) - -// HTTP scheme attributes. -var ( - HTTPSchemeHTTP = HTTPSchemeKey.String("http") - HTTPSchemeHTTPS = HTTPSchemeKey.String("https") -) - -var sc = &internal.SemanticConventions{ - EnduserIDKey: EnduserIDKey, - HTTPClientIPKey: HTTPClientIPKey, - HTTPFlavorKey: HTTPFlavorKey, - HTTPHostKey: HTTPHostKey, - HTTPMethodKey: HTTPMethodKey, - HTTPRequestContentLengthKey: HTTPRequestContentLengthKey, - HTTPRouteKey: HTTPRouteKey, - HTTPSchemeHTTP: HTTPSchemeHTTP, - HTTPSchemeHTTPS: HTTPSchemeHTTPS, - HTTPServerNameKey: HTTPServerNameKey, - HTTPStatusCodeKey: HTTPStatusCodeKey, - HTTPTargetKey: HTTPTargetKey, - HTTPURLKey: HTTPURLKey, - HTTPUserAgentKey: HTTPUserAgentKey, - NetHostIPKey: NetHostIPKey, - NetHostNameKey: NetHostNameKey, - NetHostPortKey: NetHostPortKey, - NetPeerIPKey: NetPeerIPKey, - NetPeerNameKey: NetPeerNameKey, - NetPeerPortKey: NetPeerPortKey, - NetTransportIP: NetTransportIP, - NetTransportOther: NetTransportOther, - NetTransportTCP: NetTransportTCP, - NetTransportUDP: NetTransportUDP, - NetTransportUnix: NetTransportUnix, -} - -// NetAttributesFromHTTPRequest generates attributes of the net -// namespace as specified by the OpenTelemetry specification for a -// span. The network parameter is a string that net.Dial function -// from standard library can understand. -func NetAttributesFromHTTPRequest(network string, request *http.Request) []attribute.KeyValue { - return sc.NetAttributesFromHTTPRequest(network, request) -} - -// EndUserAttributesFromHTTPRequest generates attributes of the -// enduser namespace as specified by the OpenTelemetry specification -// for a span. -func EndUserAttributesFromHTTPRequest(request *http.Request) []attribute.KeyValue { - return sc.EndUserAttributesFromHTTPRequest(request) -} - -// HTTPClientAttributesFromHTTPRequest generates attributes of the -// http namespace as specified by the OpenTelemetry specification for -// a span on the client side. -func HTTPClientAttributesFromHTTPRequest(request *http.Request) []attribute.KeyValue { - return sc.HTTPClientAttributesFromHTTPRequest(request) -} - -// HTTPServerMetricAttributesFromHTTPRequest generates low-cardinality attributes -// to be used with server-side HTTP metrics. -func HTTPServerMetricAttributesFromHTTPRequest(serverName string, request *http.Request) []attribute.KeyValue { - return sc.HTTPServerMetricAttributesFromHTTPRequest(serverName, request) -} - -// HTTPServerAttributesFromHTTPRequest generates attributes of the -// http namespace as specified by the OpenTelemetry specification for -// a span on the server side. Currently, only basic authentication is -// supported. -func HTTPServerAttributesFromHTTPRequest(serverName, route string, request *http.Request) []attribute.KeyValue { - return sc.HTTPServerAttributesFromHTTPRequest(serverName, route, request) -} - -// HTTPAttributesFromHTTPStatusCode generates attributes of the http -// namespace as specified by the OpenTelemetry specification for a -// span. -func HTTPAttributesFromHTTPStatusCode(code int) []attribute.KeyValue { - return sc.HTTPAttributesFromHTTPStatusCode(code) -} - -// SpanStatusFromHTTPStatusCode generates a status code and a message -// as specified by the OpenTelemetry specification for a span. -func SpanStatusFromHTTPStatusCode(code int) (codes.Code, string) { - return internal.SpanStatusFromHTTPStatusCode(code) -} - -// SpanStatusFromHTTPStatusCodeAndSpanKind generates a status code and a message -// as specified by the OpenTelemetry specification for a span. -// Exclude 4xx for SERVER to set the appropriate status. -func SpanStatusFromHTTPStatusCodeAndSpanKind(code int, spanKind trace.SpanKind) (codes.Code, string) { - return internal.SpanStatusFromHTTPStatusCodeAndSpanKind(code, spanKind) -} diff --git a/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/resource.go b/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/resource.go deleted file mode 100644 index 45951685a..000000000 --- a/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/resource.go +++ /dev/null @@ -1,1031 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Code generated from semantic convention specification. DO NOT EDIT. - -package semconv // import "go.opentelemetry.io/otel/semconv/v1.12.0" - -import "go.opentelemetry.io/otel/attribute" - -// The web browser in which the application represented by the resource is running. The `browser.*` attributes MUST be used only for resources that represent applications running in a web browser (regardless of whether running on a mobile or desktop device). -const ( - // Array of brand name and version separated by a space - // - // Type: string[] - // Required: No - // Stability: stable - // Examples: ' Not A;Brand 99', 'Chromium 99', 'Chrome 99' - // Note: This value is intended to be taken from the [UA client hints - // API](https://wicg.github.io/ua-client-hints/#interface) - // (navigator.userAgentData.brands). - BrowserBrandsKey = attribute.Key("browser.brands") - // The platform on which the browser is running - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'Windows', 'macOS', 'Android' - // Note: This value is intended to be taken from the [UA client hints - // API](https://wicg.github.io/ua-client-hints/#interface) - // (navigator.userAgentData.platform). If unavailable, the legacy - // `navigator.platform` API SHOULD NOT be used instead and this attribute SHOULD - // be left unset in order for the values to be consistent. - // The list of possible values is defined in the [W3C User-Agent Client Hints - // specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). - // Note that some (but not all) of these values can overlap with values in the - // [os.type and os.name attributes](./os.md). However, for consistency, the values - // in the `browser.platform` attribute should capture the exact value that the - // user agent provides. - BrowserPlatformKey = attribute.Key("browser.platform") - // Full user-agent string provided by the browser - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 - // (KHTML, ' - // 'like Gecko) Chrome/95.0.4638.54 Safari/537.36' - // Note: The user-agent value SHOULD be provided only from browsers that do not - // have a mechanism to retrieve brands and platform individually from the User- - // Agent Client Hints API. To retrieve the value, the legacy `navigator.userAgent` - // API can be used. - BrowserUserAgentKey = attribute.Key("browser.user_agent") -) - -// A cloud environment (e.g. GCP, Azure, AWS) -const ( - // Name of the cloud provider. - // - // Type: Enum - // Required: No - // Stability: stable - CloudProviderKey = attribute.Key("cloud.provider") - // The cloud account ID the resource is assigned to. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '111111111111', 'opentelemetry' - CloudAccountIDKey = attribute.Key("cloud.account.id") - // The geographical region the resource is running. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'us-central1', 'us-east-1' - // Note: Refer to your provider's docs to see the available regions, for example - // [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc- - // detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global- - // infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/en- - // us/global-infrastructure/geographies/), [Google Cloud - // regions](https://cloud.google.com/about/locations), or [Tencent Cloud - // regions](https://intl.cloud.tencent.com/document/product/213/6091). - CloudRegionKey = attribute.Key("cloud.region") - // Cloud regions often have multiple, isolated locations known as zones to - // increase availability. Availability zone represents the zone where the resource - // is running. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'us-east-1c' - // Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud. - CloudAvailabilityZoneKey = attribute.Key("cloud.availability_zone") - // The cloud platform in use. - // - // Type: Enum - // Required: No - // Stability: stable - // Note: The prefix of the service SHOULD match the one specified in - // `cloud.provider`. - CloudPlatformKey = attribute.Key("cloud.platform") -) - -var ( - // Alibaba Cloud - CloudProviderAlibabaCloud = CloudProviderKey.String("alibaba_cloud") - // Amazon Web Services - CloudProviderAWS = CloudProviderKey.String("aws") - // Microsoft Azure - CloudProviderAzure = CloudProviderKey.String("azure") - // Google Cloud Platform - CloudProviderGCP = CloudProviderKey.String("gcp") - // Tencent Cloud - CloudProviderTencentCloud = CloudProviderKey.String("tencent_cloud") -) - -var ( - // Alibaba Cloud Elastic Compute Service - CloudPlatformAlibabaCloudECS = CloudPlatformKey.String("alibaba_cloud_ecs") - // Alibaba Cloud Function Compute - CloudPlatformAlibabaCloudFc = CloudPlatformKey.String("alibaba_cloud_fc") - // AWS Elastic Compute Cloud - CloudPlatformAWSEC2 = CloudPlatformKey.String("aws_ec2") - // AWS Elastic Container Service - CloudPlatformAWSECS = CloudPlatformKey.String("aws_ecs") - // AWS Elastic Kubernetes Service - CloudPlatformAWSEKS = CloudPlatformKey.String("aws_eks") - // AWS Lambda - CloudPlatformAWSLambda = CloudPlatformKey.String("aws_lambda") - // AWS Elastic Beanstalk - CloudPlatformAWSElasticBeanstalk = CloudPlatformKey.String("aws_elastic_beanstalk") - // AWS App Runner - CloudPlatformAWSAppRunner = CloudPlatformKey.String("aws_app_runner") - // Azure Virtual Machines - CloudPlatformAzureVM = CloudPlatformKey.String("azure_vm") - // Azure Container Instances - CloudPlatformAzureContainerInstances = CloudPlatformKey.String("azure_container_instances") - // Azure Kubernetes Service - CloudPlatformAzureAKS = CloudPlatformKey.String("azure_aks") - // Azure Functions - CloudPlatformAzureFunctions = CloudPlatformKey.String("azure_functions") - // Azure App Service - CloudPlatformAzureAppService = CloudPlatformKey.String("azure_app_service") - // Google Cloud Compute Engine (GCE) - CloudPlatformGCPComputeEngine = CloudPlatformKey.String("gcp_compute_engine") - // Google Cloud Run - CloudPlatformGCPCloudRun = CloudPlatformKey.String("gcp_cloud_run") - // Google Cloud Kubernetes Engine (GKE) - CloudPlatformGCPKubernetesEngine = CloudPlatformKey.String("gcp_kubernetes_engine") - // Google Cloud Functions (GCF) - CloudPlatformGCPCloudFunctions = CloudPlatformKey.String("gcp_cloud_functions") - // Google Cloud App Engine (GAE) - CloudPlatformGCPAppEngine = CloudPlatformKey.String("gcp_app_engine") - // Tencent Cloud Cloud Virtual Machine (CVM) - CloudPlatformTencentCloudCvm = CloudPlatformKey.String("tencent_cloud_cvm") - // Tencent Cloud Elastic Kubernetes Service (EKS) - CloudPlatformTencentCloudEKS = CloudPlatformKey.String("tencent_cloud_eks") - // Tencent Cloud Serverless Cloud Function (SCF) - CloudPlatformTencentCloudScf = CloudPlatformKey.String("tencent_cloud_scf") -) - -// Resources used by AWS Elastic Container Service (ECS). -const ( - // The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws. - // amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'arn:aws:ecs:us- - // west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9' - AWSECSContainerARNKey = attribute.Key("aws.ecs.container.arn") - // The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/develo - // perguide/clusters.html). - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster' - AWSECSClusterARNKey = attribute.Key("aws.ecs.cluster.arn") - // The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/l - // aunch_types.html) for an ECS task. - // - // Type: Enum - // Required: No - // Stability: stable - AWSECSLaunchtypeKey = attribute.Key("aws.ecs.launchtype") - // The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/lates - // t/developerguide/task_definitions.html). - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'arn:aws:ecs:us- - // west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b' - AWSECSTaskARNKey = attribute.Key("aws.ecs.task.arn") - // The task definition family this task definition is a member of. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'opentelemetry-family' - AWSECSTaskFamilyKey = attribute.Key("aws.ecs.task.family") - // The revision for this task definition. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '8', '26' - AWSECSTaskRevisionKey = attribute.Key("aws.ecs.task.revision") -) - -var ( - // ec2 - AWSECSLaunchtypeEC2 = AWSECSLaunchtypeKey.String("ec2") - // fargate - AWSECSLaunchtypeFargate = AWSECSLaunchtypeKey.String("fargate") -) - -// Resources used by AWS Elastic Kubernetes Service (EKS). -const ( - // The ARN of an EKS cluster. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster' - AWSEKSClusterARNKey = attribute.Key("aws.eks.cluster.arn") -) - -// Resources specific to Amazon Web Services. -const ( - // The name(s) of the AWS log group(s) an application is writing to. - // - // Type: string[] - // Required: No - // Stability: stable - // Examples: '/aws/lambda/my-function', 'opentelemetry-service' - // Note: Multiple log groups must be supported for cases like multi-container - // applications, where a single application has sidecar containers, and each write - // to their own log group. - AWSLogGroupNamesKey = attribute.Key("aws.log.group.names") - // The Amazon Resource Name(s) (ARN) of the AWS log group(s). - // - // Type: string[] - // Required: No - // Stability: stable - // Examples: 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*' - // Note: See the [log group ARN format - // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam- - // access-control-overview-cwl.html#CWL_ARN_Format). - AWSLogGroupARNsKey = attribute.Key("aws.log.group.arns") - // The name(s) of the AWS log stream(s) an application is writing to. - // - // Type: string[] - // Required: No - // Stability: stable - // Examples: 'logs/main/10838bed-421f-43ef-870a-f43feacbbb5b' - AWSLogStreamNamesKey = attribute.Key("aws.log.stream.names") - // The ARN(s) of the AWS log stream(s). - // - // Type: string[] - // Required: No - // Stability: stable - // Examples: 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log- - // stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b' - // Note: See the [log stream ARN format - // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam- - // access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain - // several log streams, so these ARNs necessarily identify both a log group and a - // log stream. - AWSLogStreamARNsKey = attribute.Key("aws.log.stream.arns") -) - -// A container instance. -const ( - // Container name used by container runtime. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'opentelemetry-autoconf' - ContainerNameKey = attribute.Key("container.name") - // Container ID. Usually a UUID, as for example used to [identify Docker - // containers](https://docs.docker.com/engine/reference/run/#container- - // identification). The UUID might be abbreviated. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'a3bf90e006b2' - ContainerIDKey = attribute.Key("container.id") - // The container runtime managing this container. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'docker', 'containerd', 'rkt' - ContainerRuntimeKey = attribute.Key("container.runtime") - // Name of the image the container was built on. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'gcr.io/opentelemetry/operator' - ContainerImageNameKey = attribute.Key("container.image.name") - // Container image tag. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '0.1' - ContainerImageTagKey = attribute.Key("container.image.tag") -) - -// The software deployment. -const ( - // Name of the [deployment - // environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka - // deployment tier). - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'staging', 'production' - DeploymentEnvironmentKey = attribute.Key("deployment.environment") -) - -// The device on which the process represented by this resource is running. -const ( - // A unique identifier representing the device - // - // Type: string - // Required: No - // Stability: stable - // Examples: '2ab2916d-a51f-4ac8-80ee-45ac31a28092' - // Note: The device identifier MUST only be defined using the values outlined - // below. This value is not an advertising identifier and MUST NOT be used as - // such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor id - // entifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-iden - // tifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the - // Firebase Installation ID or a globally unique UUID which is persisted across - // sessions in your application. More information can be found - // [here](https://developer.android.com/training/articles/user-data-ids) on best - // practices and exact implementation details. Caution should be taken when - // storing personal data or anything which can identify a user. GDPR and data - // protection laws may apply, ensure you do your own due diligence. - DeviceIDKey = attribute.Key("device.id") - // The model identifier for the device - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'iPhone3,4', 'SM-G920F' - // Note: It's recommended this value represents a machine readable version of the - // model identifier rather than the market or consumer-friendly name of the - // device. - DeviceModelIdentifierKey = attribute.Key("device.model.identifier") - // The marketing name for the device model - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'iPhone 6s Plus', 'Samsung Galaxy S6' - // Note: It's recommended this value represents a human readable version of the - // device model rather than a machine readable alternative. - DeviceModelNameKey = attribute.Key("device.model.name") - // The name of the device manufacturer - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'Apple', 'Samsung' - // Note: The Android OS provides this field via - // [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). - // iOS apps SHOULD hardcode the value `Apple`. - DeviceManufacturerKey = attribute.Key("device.manufacturer") -) - -// A serverless instance. -const ( - // The name of the single function that this runtime instance executes. - // - // Type: string - // Required: Always - // Stability: stable - // Examples: 'my-function', 'myazurefunctionapp/some-function-name' - // Note: This is the name of the function as configured/deployed on the FaaS - // platform and is usually different from the name of the callback - // function (which may be stored in the - // [`code.namespace`/`code.function`](../../trace/semantic_conventions/span- - // general.md#source-code-attributes) - // span attributes). - - // For some cloud providers, the above definition is ambiguous. The following - // definition of function name MUST be used for this attribute - // (and consequently the span name) for the listed cloud providers/products: - - // * **Azure:** The full name `/`, i.e., function app name - // followed by a forward slash followed by the function name (this form - // can also be seen in the resource JSON for the function). - // This means that a span attribute MUST be used, as an Azure function - // app can host multiple functions that would usually share - // a TracerProvider (see also the `faas.id` attribute). - FaaSNameKey = attribute.Key("faas.name") - // The unique ID of the single function that this runtime instance executes. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'arn:aws:lambda:us-west-2:123456789012:function:my-function' - // Note: On some cloud providers, it may not be possible to determine the full ID - // at startup, - // so consider setting `faas.id` as a span attribute instead. - - // The exact value to use for `faas.id` depends on the cloud provider: - - // * **AWS Lambda:** The function - // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and- - // namespaces.html). - // Take care not to use the "invoked ARN" directly but replace any - // [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration- - // aliases.html) - // with the resolved function version, as the same runtime instance may be - // invokable with - // multiple different aliases. - // * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full- - // resource-names) - // * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en- - // us/rest/api/resources/resources/get-by-id) of the invoked function, - // *not* the function app, having the form - // `/subscriptions//resourceGroups//providers/Microsoft.We - // b/sites//functions/`. - // This means that a span attribute MUST be used, as an Azure function app can - // host multiple functions that would usually share - // a TracerProvider. - FaaSIDKey = attribute.Key("faas.id") - // The immutable version of the function being executed. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '26', 'pinkfroid-00002' - // Note: Depending on the cloud provider and platform, use: - - // * **AWS Lambda:** The [function - // version](https://docs.aws.amazon.com/lambda/latest/dg/configuration- - // versions.html) - // (an integer represented as a decimal string). - // * **Google Cloud Run:** The - // [revision](https://cloud.google.com/run/docs/managing/revisions) - // (i.e., the function name plus the revision suffix). - // * **Google Cloud Functions:** The value of the - // [`K_REVISION` environment - // variable](https://cloud.google.com/functions/docs/env- - // var#runtime_environment_variables_set_automatically). - // * **Azure Functions:** Not applicable. Do not set this attribute. - FaaSVersionKey = attribute.Key("faas.version") - // The execution environment ID as a string, that will be potentially reused for - // other invocations to the same function/function version. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de' - // Note: * **AWS Lambda:** Use the (full) log stream name. - FaaSInstanceKey = attribute.Key("faas.instance") - // The amount of memory available to the serverless function in MiB. - // - // Type: int - // Required: No - // Stability: stable - // Examples: 128 - // Note: It's recommended to set this attribute since e.g. too little memory can - // easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, - // the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this - // information. - FaaSMaxMemoryKey = attribute.Key("faas.max_memory") -) - -// A host is defined as a general computing instance. -const ( - // Unique host ID. For Cloud, this must be the instance_id assigned by the cloud - // provider. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'opentelemetry-test' - HostIDKey = attribute.Key("host.id") - // Name of the host. On Unix systems, it may contain what the hostname command - // returns, or the fully qualified hostname, or another name specified by the - // user. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'opentelemetry-test' - HostNameKey = attribute.Key("host.name") - // Type of host. For Cloud, this must be the machine type. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'n1-standard-1' - HostTypeKey = attribute.Key("host.type") - // The CPU architecture the host system is running on. - // - // Type: Enum - // Required: No - // Stability: stable - HostArchKey = attribute.Key("host.arch") - // Name of the VM image or OS install the host was instantiated from. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'infra-ami-eks-worker-node-7d4ec78312', 'CentOS-8-x86_64-1905' - HostImageNameKey = attribute.Key("host.image.name") - // VM image ID. For Cloud, this value is from the provider. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'ami-07b06b442921831e5' - HostImageIDKey = attribute.Key("host.image.id") - // The version string of the VM image as defined in [Version - // Attributes](README.md#version-attributes). - // - // Type: string - // Required: No - // Stability: stable - // Examples: '0.1' - HostImageVersionKey = attribute.Key("host.image.version") -) - -var ( - // AMD64 - HostArchAMD64 = HostArchKey.String("amd64") - // ARM32 - HostArchARM32 = HostArchKey.String("arm32") - // ARM64 - HostArchARM64 = HostArchKey.String("arm64") - // Itanium - HostArchIA64 = HostArchKey.String("ia64") - // 32-bit PowerPC - HostArchPPC32 = HostArchKey.String("ppc32") - // 64-bit PowerPC - HostArchPPC64 = HostArchKey.String("ppc64") - // IBM z/Architecture - HostArchS390x = HostArchKey.String("s390x") - // 32-bit x86 - HostArchX86 = HostArchKey.String("x86") -) - -// A Kubernetes Cluster. -const ( - // The name of the cluster. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'opentelemetry-cluster' - K8SClusterNameKey = attribute.Key("k8s.cluster.name") -) - -// A Kubernetes Node object. -const ( - // The name of the Node. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'node-1' - K8SNodeNameKey = attribute.Key("k8s.node.name") - // The UID of the Node. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2' - K8SNodeUIDKey = attribute.Key("k8s.node.uid") -) - -// A Kubernetes Namespace. -const ( - // The name of the namespace that the pod is running in. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'default' - K8SNamespaceNameKey = attribute.Key("k8s.namespace.name") -) - -// A Kubernetes Pod object. -const ( - // The UID of the Pod. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SPodUIDKey = attribute.Key("k8s.pod.uid") - // The name of the Pod. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'opentelemetry-pod-autoconf' - K8SPodNameKey = attribute.Key("k8s.pod.name") -) - -// A container in a [PodTemplate](https://kubernetes.io/docs/concepts/workloads/pods/#pod-templates). -const ( - // The name of the Container from Pod specification, must be unique within a Pod. - // Container runtime usually uses different globally unique name - // (`container.name`). - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'redis' - K8SContainerNameKey = attribute.Key("k8s.container.name") - // Number of times the container was restarted. This attribute can be used to - // identify a particular container (running or stopped) within a container spec. - // - // Type: int - // Required: No - // Stability: stable - // Examples: 0, 2 - K8SContainerRestartCountKey = attribute.Key("k8s.container.restart_count") -) - -// A Kubernetes ReplicaSet object. -const ( - // The UID of the ReplicaSet. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SReplicaSetUIDKey = attribute.Key("k8s.replicaset.uid") - // The name of the ReplicaSet. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'opentelemetry' - K8SReplicaSetNameKey = attribute.Key("k8s.replicaset.name") -) - -// A Kubernetes Deployment object. -const ( - // The UID of the Deployment. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SDeploymentUIDKey = attribute.Key("k8s.deployment.uid") - // The name of the Deployment. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'opentelemetry' - K8SDeploymentNameKey = attribute.Key("k8s.deployment.name") -) - -// A Kubernetes StatefulSet object. -const ( - // The UID of the StatefulSet. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SStatefulSetUIDKey = attribute.Key("k8s.statefulset.uid") - // The name of the StatefulSet. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'opentelemetry' - K8SStatefulSetNameKey = attribute.Key("k8s.statefulset.name") -) - -// A Kubernetes DaemonSet object. -const ( - // The UID of the DaemonSet. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SDaemonSetUIDKey = attribute.Key("k8s.daemonset.uid") - // The name of the DaemonSet. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'opentelemetry' - K8SDaemonSetNameKey = attribute.Key("k8s.daemonset.name") -) - -// A Kubernetes Job object. -const ( - // The UID of the Job. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SJobUIDKey = attribute.Key("k8s.job.uid") - // The name of the Job. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'opentelemetry' - K8SJobNameKey = attribute.Key("k8s.job.name") -) - -// A Kubernetes CronJob object. -const ( - // The UID of the CronJob. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SCronJobUIDKey = attribute.Key("k8s.cronjob.uid") - // The name of the CronJob. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'opentelemetry' - K8SCronJobNameKey = attribute.Key("k8s.cronjob.name") -) - -// The operating system (OS) on which the process represented by this resource is running. -const ( - // The operating system type. - // - // Type: Enum - // Required: Always - // Stability: stable - OSTypeKey = attribute.Key("os.type") - // Human readable (not intended to be parsed) OS version information, like e.g. - // reported by `ver` or `lsb_release -a` commands. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'Microsoft Windows [Version 10.0.18363.778]', 'Ubuntu 18.04.1 LTS' - OSDescriptionKey = attribute.Key("os.description") - // Human readable operating system name. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'iOS', 'Android', 'Ubuntu' - OSNameKey = attribute.Key("os.name") - // The version string of the operating system as defined in [Version - // Attributes](../../resource/semantic_conventions/README.md#version-attributes). - // - // Type: string - // Required: No - // Stability: stable - // Examples: '14.2.1', '18.04.1' - OSVersionKey = attribute.Key("os.version") -) - -var ( - // Microsoft Windows - OSTypeWindows = OSTypeKey.String("windows") - // Linux - OSTypeLinux = OSTypeKey.String("linux") - // Apple Darwin - OSTypeDarwin = OSTypeKey.String("darwin") - // FreeBSD - OSTypeFreeBSD = OSTypeKey.String("freebsd") - // NetBSD - OSTypeNetBSD = OSTypeKey.String("netbsd") - // OpenBSD - OSTypeOpenBSD = OSTypeKey.String("openbsd") - // DragonFly BSD - OSTypeDragonflyBSD = OSTypeKey.String("dragonflybsd") - // HP-UX (Hewlett Packard Unix) - OSTypeHPUX = OSTypeKey.String("hpux") - // AIX (Advanced Interactive eXecutive) - OSTypeAIX = OSTypeKey.String("aix") - // SunOS, Oracle Solaris - OSTypeSolaris = OSTypeKey.String("solaris") - // IBM z/OS - OSTypeZOS = OSTypeKey.String("z_os") -) - -// An operating system process. -const ( - // Process identifier (PID). - // - // Type: int - // Required: No - // Stability: stable - // Examples: 1234 - ProcessPIDKey = attribute.Key("process.pid") - // The name of the process executable. On Linux based systems, can be set to the - // `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of - // `GetProcessImageFileNameW`. - // - // Type: string - // Required: See below - // Stability: stable - // Examples: 'otelcol' - ProcessExecutableNameKey = attribute.Key("process.executable.name") - // The full path to the process executable. On Linux based systems, can be set to - // the target of `proc/[pid]/exe`. On Windows, can be set to the result of - // `GetProcessImageFileNameW`. - // - // Type: string - // Required: See below - // Stability: stable - // Examples: '/usr/bin/cmd/otelcol' - ProcessExecutablePathKey = attribute.Key("process.executable.path") - // The command used to launch the process (i.e. the command name). On Linux based - // systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, - // can be set to the first parameter extracted from `GetCommandLineW`. - // - // Type: string - // Required: See below - // Stability: stable - // Examples: 'cmd/otelcol' - ProcessCommandKey = attribute.Key("process.command") - // The full command used to launch the process as a single string representing the - // full command. On Windows, can be set to the result of `GetCommandLineW`. Do not - // set this if you have to assemble it just for monitoring; use - // `process.command_args` instead. - // - // Type: string - // Required: See below - // Stability: stable - // Examples: 'C:\\cmd\\otecol --config="my directory\\config.yaml"' - ProcessCommandLineKey = attribute.Key("process.command_line") - // All the command arguments (including the command/executable itself) as received - // by the process. On Linux-based systems (and some other Unixoid systems - // supporting procfs), can be set according to the list of null-delimited strings - // extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be - // the full argv vector passed to `main`. - // - // Type: string[] - // Required: See below - // Stability: stable - // Examples: 'cmd/otecol', '--config=config.yaml' - ProcessCommandArgsKey = attribute.Key("process.command_args") - // The username of the user that owns the process. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'root' - ProcessOwnerKey = attribute.Key("process.owner") -) - -// The single (language) runtime instance which is monitored. -const ( - // The name of the runtime of this process. For compiled native binaries, this - // SHOULD be the name of the compiler. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'OpenJDK Runtime Environment' - ProcessRuntimeNameKey = attribute.Key("process.runtime.name") - // The version of the runtime of this process, as returned by the runtime without - // modification. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '14.0.2' - ProcessRuntimeVersionKey = attribute.Key("process.runtime.version") - // An additional description about the runtime of the process, for example a - // specific vendor customization of the runtime environment. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0' - ProcessRuntimeDescriptionKey = attribute.Key("process.runtime.description") -) - -// A service instance. -const ( - // Logical name of the service. - // - // Type: string - // Required: Always - // Stability: stable - // Examples: 'shoppingcart' - // Note: MUST be the same for all instances of horizontally scaled services. If - // the value was not specified, SDKs MUST fallback to `unknown_service:` - // concatenated with [`process.executable.name`](process.md#process), e.g. - // `unknown_service:bash`. If `process.executable.name` is not available, the - // value MUST be set to `unknown_service`. - ServiceNameKey = attribute.Key("service.name") - // A namespace for `service.name`. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'Shop' - // Note: A string value having a meaning that helps to distinguish a group of - // services, for example the team name that owns a group of services. - // `service.name` is expected to be unique within the same namespace. If - // `service.namespace` is not specified in the Resource then `service.name` is - // expected to be unique for all services that have no explicit namespace defined - // (so the empty/unspecified namespace is simply one more valid namespace). Zero- - // length namespace string is assumed equal to unspecified namespace. - ServiceNamespaceKey = attribute.Key("service.namespace") - // The string ID of the service instance. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '627cc493-f310-47de-96bd-71410b7dec09' - // Note: MUST be unique for each instance of the same - // `service.namespace,service.name` pair (in other words - // `service.namespace,service.name,service.instance.id` triplet MUST be globally - // unique). The ID helps to distinguish instances of the same service that exist - // at the same time (e.g. instances of a horizontally scaled service). It is - // preferable for the ID to be persistent and stay the same for the lifetime of - // the service instance, however it is acceptable that the ID is ephemeral and - // changes during important lifetime events for the service (e.g. service - // restarts). If the service has no inherent unique ID that can be used as the - // value of this attribute it is recommended to generate a random Version 1 or - // Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use - // Version 5, see RFC 4122 for more recommendations). - ServiceInstanceIDKey = attribute.Key("service.instance.id") - // The version string of the service API or implementation. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '2.0.0' - ServiceVersionKey = attribute.Key("service.version") -) - -// The telemetry SDK used to capture data recorded by the instrumentation libraries. -const ( - // The name of the telemetry SDK as defined above. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'opentelemetry' - TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name") - // The language of the telemetry SDK. - // - // Type: Enum - // Required: No - // Stability: stable - TelemetrySDKLanguageKey = attribute.Key("telemetry.sdk.language") - // The version string of the telemetry SDK. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '1.2.3' - TelemetrySDKVersionKey = attribute.Key("telemetry.sdk.version") - // The version string of the auto instrumentation agent, if used. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '1.2.3' - TelemetryAutoVersionKey = attribute.Key("telemetry.auto.version") -) - -var ( - // cpp - TelemetrySDKLanguageCPP = TelemetrySDKLanguageKey.String("cpp") - // dotnet - TelemetrySDKLanguageDotnet = TelemetrySDKLanguageKey.String("dotnet") - // erlang - TelemetrySDKLanguageErlang = TelemetrySDKLanguageKey.String("erlang") - // go - TelemetrySDKLanguageGo = TelemetrySDKLanguageKey.String("go") - // java - TelemetrySDKLanguageJava = TelemetrySDKLanguageKey.String("java") - // nodejs - TelemetrySDKLanguageNodejs = TelemetrySDKLanguageKey.String("nodejs") - // php - TelemetrySDKLanguagePHP = TelemetrySDKLanguageKey.String("php") - // python - TelemetrySDKLanguagePython = TelemetrySDKLanguageKey.String("python") - // ruby - TelemetrySDKLanguageRuby = TelemetrySDKLanguageKey.String("ruby") - // webjs - TelemetrySDKLanguageWebjs = TelemetrySDKLanguageKey.String("webjs") - // swift - TelemetrySDKLanguageSwift = TelemetrySDKLanguageKey.String("swift") -) - -// Resource describing the packaged software running the application code. Web engines are typically executed using process.runtime. -const ( - // The name of the web engine. - // - // Type: string - // Required: Always - // Stability: stable - // Examples: 'WildFly' - WebEngineNameKey = attribute.Key("webengine.name") - // The version of the web engine. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '21.0.0' - WebEngineVersionKey = attribute.Key("webengine.version") - // Additional description of the web engine (e.g. detailed version and edition - // information). - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final' - WebEngineDescriptionKey = attribute.Key("webengine.description") -) diff --git a/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/schema.go b/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/schema.go deleted file mode 100644 index f01d515bc..000000000 --- a/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/schema.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package semconv // import "go.opentelemetry.io/otel/semconv/v1.12.0" - -// SchemaURL is the schema URL that matches the version of the semantic conventions -// that this package defines. Semconv packages starting from v1.4.0 must declare -// non-empty schema URL in the form https://opentelemetry.io/schemas/ -const SchemaURL = "https://opentelemetry.io/schemas/1.12.0" diff --git a/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/trace.go b/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/trace.go deleted file mode 100644 index 70c25dc21..000000000 --- a/e2e/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/trace.go +++ /dev/null @@ -1,1693 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Code generated from semantic convention specification. DO NOT EDIT. - -package semconv // import "go.opentelemetry.io/otel/semconv/v1.12.0" - -import "go.opentelemetry.io/otel/attribute" - -// Span attributes used by AWS Lambda (in addition to general `faas` attributes). -const ( - // The full invoked ARN as provided on the `Context` passed to the function - // (`Lambda-Runtime-Invoked-Function-ARN` header on the `/runtime/invocation/next` - // applicable). - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'arn:aws:lambda:us-east-1:123456:function:myfunction:myalias' - // Note: This may be different from `faas.id` if an alias is involved. - AWSLambdaInvokedARNKey = attribute.Key("aws.lambda.invoked_arn") -) - -// This document defines attributes for CloudEvents. CloudEvents is a specification on how to define event data in a standard way. These attributes can be attached to spans when performing operations with CloudEvents, regardless of the protocol being used. -const ( - // The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec - // .md#id) uniquely identifies the event. - // - // Type: string - // Required: Always - // Stability: stable - // Examples: '123e4567-e89b-12d3-a456-426614174000', '0001' - CloudeventsEventIDKey = attribute.Key("cloudevents.event_id") - // The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.m - // d#source-1) identifies the context in which an event happened. - // - // Type: string - // Required: Always - // Stability: stable - // Examples: 'https://github.com/cloudevents', '/cloudevents/spec/pull/123', 'my- - // service' - CloudeventsEventSourceKey = attribute.Key("cloudevents.event_source") - // The [version of the CloudEvents specification](https://github.com/cloudevents/s - // pec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. - // - // Type: string - // Required: Always - // Stability: stable - // Examples: '1.0' - CloudeventsEventSpecVersionKey = attribute.Key("cloudevents.event_spec_version") - // The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/sp - // ec.md#type) contains a value describing the type of event related to the - // originating occurrence. - // - // Type: string - // Required: Always - // Stability: stable - // Examples: 'com.github.pull_request.opened', 'com.example.object.deleted.v2' - CloudeventsEventTypeKey = attribute.Key("cloudevents.event_type") - // The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec. - // md#subject) of the event in the context of the event producer (identified by - // source). - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'mynewfile.jpg' - CloudeventsEventSubjectKey = attribute.Key("cloudevents.event_subject") -) - -// This document defines semantic conventions for the OpenTracing Shim -const ( - // Parent-child Reference type - // - // Type: Enum - // Required: No - // Stability: stable - // Note: The causal relationship between a child Span and a parent Span. - OpentracingRefTypeKey = attribute.Key("opentracing.ref_type") -) - -var ( - // The parent Span depends on the child Span in some capacity - OpentracingRefTypeChildOf = OpentracingRefTypeKey.String("child_of") - // The parent Span does not depend in any way on the result of the child Span - OpentracingRefTypeFollowsFrom = OpentracingRefTypeKey.String("follows_from") -) - -// This document defines the attributes used to perform database client calls. -const ( - // An identifier for the database management system (DBMS) product being used. See - // below for a list of well-known identifiers. - // - // Type: Enum - // Required: Always - // Stability: stable - DBSystemKey = attribute.Key("db.system") - // The connection string used to connect to the database. It is recommended to - // remove embedded credentials. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'Server=(localdb)\\v11.0;Integrated Security=true;' - DBConnectionStringKey = attribute.Key("db.connection_string") - // Username for accessing the database. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'readonly_user', 'reporting_user' - DBUserKey = attribute.Key("db.user") - // The fully-qualified class name of the [Java Database Connectivity - // (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver - // used to connect. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'org.postgresql.Driver', - // 'com.microsoft.sqlserver.jdbc.SQLServerDriver' - DBJDBCDriverClassnameKey = attribute.Key("db.jdbc.driver_classname") - // This attribute is used to report the name of the database being accessed. For - // commands that switch the database, this should be set to the target database - // (even if the command fails). - // - // Type: string - // Required: Required, if applicable. - // Stability: stable - // Examples: 'customers', 'main' - // Note: In some SQL databases, the database name to be used is called "schema - // name". In case there are multiple layers that could be considered for database - // name (e.g. Oracle instance name and schema name), the database name to be used - // is the more specific layer (e.g. Oracle schema name). - DBNameKey = attribute.Key("db.name") - // The database statement being executed. - // - // Type: string - // Required: Required if applicable and not explicitly disabled via - // instrumentation configuration. - // Stability: stable - // Examples: 'SELECT * FROM wuser_table', 'SET mykey "WuValue"' - // Note: The value may be sanitized to exclude sensitive information. - DBStatementKey = attribute.Key("db.statement") - // The name of the operation being executed, e.g. the [MongoDB command - // name](https://docs.mongodb.com/manual/reference/command/#database-operations) - // such as `findAndModify`, or the SQL keyword. - // - // Type: string - // Required: Required, if `db.statement` is not applicable. - // Stability: stable - // Examples: 'findAndModify', 'HMSET', 'SELECT' - // Note: When setting this to an SQL keyword, it is not recommended to attempt any - // client-side parsing of `db.statement` just to get this property, but it should - // be set if the operation name is provided by the library being instrumented. If - // the SQL statement has an ambiguous operation, or performs more than one - // operation, this value may be omitted. - DBOperationKey = attribute.Key("db.operation") -) - -var ( - // Some other SQL database. Fallback only. See notes - DBSystemOtherSQL = DBSystemKey.String("other_sql") - // Microsoft SQL Server - DBSystemMSSQL = DBSystemKey.String("mssql") - // MySQL - DBSystemMySQL = DBSystemKey.String("mysql") - // Oracle Database - DBSystemOracle = DBSystemKey.String("oracle") - // IBM DB2 - DBSystemDB2 = DBSystemKey.String("db2") - // PostgreSQL - DBSystemPostgreSQL = DBSystemKey.String("postgresql") - // Amazon Redshift - DBSystemRedshift = DBSystemKey.String("redshift") - // Apache Hive - DBSystemHive = DBSystemKey.String("hive") - // Cloudscape - DBSystemCloudscape = DBSystemKey.String("cloudscape") - // HyperSQL DataBase - DBSystemHSQLDB = DBSystemKey.String("hsqldb") - // Progress Database - DBSystemProgress = DBSystemKey.String("progress") - // SAP MaxDB - DBSystemMaxDB = DBSystemKey.String("maxdb") - // SAP HANA - DBSystemHanaDB = DBSystemKey.String("hanadb") - // Ingres - DBSystemIngres = DBSystemKey.String("ingres") - // FirstSQL - DBSystemFirstSQL = DBSystemKey.String("firstsql") - // EnterpriseDB - DBSystemEDB = DBSystemKey.String("edb") - // InterSystems Caché - DBSystemCache = DBSystemKey.String("cache") - // Adabas (Adaptable Database System) - DBSystemAdabas = DBSystemKey.String("adabas") - // Firebird - DBSystemFirebird = DBSystemKey.String("firebird") - // Apache Derby - DBSystemDerby = DBSystemKey.String("derby") - // FileMaker - DBSystemFilemaker = DBSystemKey.String("filemaker") - // Informix - DBSystemInformix = DBSystemKey.String("informix") - // InstantDB - DBSystemInstantDB = DBSystemKey.String("instantdb") - // InterBase - DBSystemInterbase = DBSystemKey.String("interbase") - // MariaDB - DBSystemMariaDB = DBSystemKey.String("mariadb") - // Netezza - DBSystemNetezza = DBSystemKey.String("netezza") - // Pervasive PSQL - DBSystemPervasive = DBSystemKey.String("pervasive") - // PointBase - DBSystemPointbase = DBSystemKey.String("pointbase") - // SQLite - DBSystemSqlite = DBSystemKey.String("sqlite") - // Sybase - DBSystemSybase = DBSystemKey.String("sybase") - // Teradata - DBSystemTeradata = DBSystemKey.String("teradata") - // Vertica - DBSystemVertica = DBSystemKey.String("vertica") - // H2 - DBSystemH2 = DBSystemKey.String("h2") - // ColdFusion IMQ - DBSystemColdfusion = DBSystemKey.String("coldfusion") - // Apache Cassandra - DBSystemCassandra = DBSystemKey.String("cassandra") - // Apache HBase - DBSystemHBase = DBSystemKey.String("hbase") - // MongoDB - DBSystemMongoDB = DBSystemKey.String("mongodb") - // Redis - DBSystemRedis = DBSystemKey.String("redis") - // Couchbase - DBSystemCouchbase = DBSystemKey.String("couchbase") - // CouchDB - DBSystemCouchDB = DBSystemKey.String("couchdb") - // Microsoft Azure Cosmos DB - DBSystemCosmosDB = DBSystemKey.String("cosmosdb") - // Amazon DynamoDB - DBSystemDynamoDB = DBSystemKey.String("dynamodb") - // Neo4j - DBSystemNeo4j = DBSystemKey.String("neo4j") - // Apache Geode - DBSystemGeode = DBSystemKey.String("geode") - // Elasticsearch - DBSystemElasticsearch = DBSystemKey.String("elasticsearch") - // Memcached - DBSystemMemcached = DBSystemKey.String("memcached") - // CockroachDB - DBSystemCockroachdb = DBSystemKey.String("cockroachdb") -) - -// Connection-level attributes for Microsoft SQL Server -const ( - // The Microsoft SQL Server [instance name](https://docs.microsoft.com/en- - // us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) - // connecting to. This name is used to determine the port of a named instance. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'MSSQLSERVER' - // Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no longer - // required (but still recommended if non-standard). - DBMSSQLInstanceNameKey = attribute.Key("db.mssql.instance_name") -) - -// Call-level attributes for Cassandra -const ( - // The fetch size used for paging, i.e. how many rows will be returned at once. - // - // Type: int - // Required: No - // Stability: stable - // Examples: 5000 - DBCassandraPageSizeKey = attribute.Key("db.cassandra.page_size") - // The consistency level of the query. Based on consistency values from - // [CQL](https://docs.datastax.com/en/cassandra- - // oss/3.0/cassandra/dml/dmlConfigConsistency.html). - // - // Type: Enum - // Required: No - // Stability: stable - DBCassandraConsistencyLevelKey = attribute.Key("db.cassandra.consistency_level") - // The name of the primary table that the operation is acting upon, including the - // keyspace name (if applicable). - // - // Type: string - // Required: Recommended if available. - // Stability: stable - // Examples: 'mytable' - // Note: This mirrors the db.sql.table attribute but references cassandra rather - // than sql. It is not recommended to attempt any client-side parsing of - // `db.statement` just to get this property, but it should be set if it is - // provided by the library being instrumented. If the operation is acting upon an - // anonymous table, or more than one table, this value MUST NOT be set. - DBCassandraTableKey = attribute.Key("db.cassandra.table") - // Whether or not the query is idempotent. - // - // Type: boolean - // Required: No - // Stability: stable - DBCassandraIdempotenceKey = attribute.Key("db.cassandra.idempotence") - // The number of times a query was speculatively executed. Not set or `0` if the - // query was not executed speculatively. - // - // Type: int - // Required: No - // Stability: stable - // Examples: 0, 2 - DBCassandraSpeculativeExecutionCountKey = attribute.Key("db.cassandra.speculative_execution_count") - // The ID of the coordinating node for a query. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'be13faa2-8574-4d71-926d-27f16cf8a7af' - DBCassandraCoordinatorIDKey = attribute.Key("db.cassandra.coordinator.id") - // The data center of the coordinating node for a query. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'us-west-2' - DBCassandraCoordinatorDCKey = attribute.Key("db.cassandra.coordinator.dc") -) - -var ( - // all - DBCassandraConsistencyLevelAll = DBCassandraConsistencyLevelKey.String("all") - // each_quorum - DBCassandraConsistencyLevelEachQuorum = DBCassandraConsistencyLevelKey.String("each_quorum") - // quorum - DBCassandraConsistencyLevelQuorum = DBCassandraConsistencyLevelKey.String("quorum") - // local_quorum - DBCassandraConsistencyLevelLocalQuorum = DBCassandraConsistencyLevelKey.String("local_quorum") - // one - DBCassandraConsistencyLevelOne = DBCassandraConsistencyLevelKey.String("one") - // two - DBCassandraConsistencyLevelTwo = DBCassandraConsistencyLevelKey.String("two") - // three - DBCassandraConsistencyLevelThree = DBCassandraConsistencyLevelKey.String("three") - // local_one - DBCassandraConsistencyLevelLocalOne = DBCassandraConsistencyLevelKey.String("local_one") - // any - DBCassandraConsistencyLevelAny = DBCassandraConsistencyLevelKey.String("any") - // serial - DBCassandraConsistencyLevelSerial = DBCassandraConsistencyLevelKey.String("serial") - // local_serial - DBCassandraConsistencyLevelLocalSerial = DBCassandraConsistencyLevelKey.String("local_serial") -) - -// Call-level attributes for Redis -const ( - // The index of the database being accessed as used in the [`SELECT` - // command](https://redis.io/commands/select), provided as an integer. To be used - // instead of the generic `db.name` attribute. - // - // Type: int - // Required: Required, if other than the default database (`0`). - // Stability: stable - // Examples: 0, 1, 15 - DBRedisDBIndexKey = attribute.Key("db.redis.database_index") -) - -// Call-level attributes for MongoDB -const ( - // The collection being accessed within the database stated in `db.name`. - // - // Type: string - // Required: Always - // Stability: stable - // Examples: 'customers', 'products' - DBMongoDBCollectionKey = attribute.Key("db.mongodb.collection") -) - -// Call-level attributes for SQL databases -const ( - // The name of the primary table that the operation is acting upon, including the - // database name (if applicable). - // - // Type: string - // Required: Recommended if available. - // Stability: stable - // Examples: 'public.users', 'customers' - // Note: It is not recommended to attempt any client-side parsing of - // `db.statement` just to get this property, but it should be set if it is - // provided by the library being instrumented. If the operation is acting upon an - // anonymous table, or more than one table, this value MUST NOT be set. - DBSQLTableKey = attribute.Key("db.sql.table") -) - -// This document defines the attributes used to report a single exception associated with a span. -const ( - // The type of the exception (its fully-qualified class name, if applicable). The - // dynamic type of the exception should be preferred over the static type in - // languages that support it. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'java.net.ConnectException', 'OSError' - ExceptionTypeKey = attribute.Key("exception.type") - // The exception message. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'Division by zero', "Can't convert 'int' object to str implicitly" - ExceptionMessageKey = attribute.Key("exception.message") - // A stacktrace as a string in the natural representation for the language - // runtime. The representation is to be determined and documented by each language - // SIG. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'Exception in thread "main" java.lang.RuntimeException: Test - // exception\\n at ' - // 'com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at ' - // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at ' - // 'com.example.GenerateTrace.main(GenerateTrace.java:5)' - ExceptionStacktraceKey = attribute.Key("exception.stacktrace") - // SHOULD be set to true if the exception event is recorded at a point where it is - // known that the exception is escaping the scope of the span. - // - // Type: boolean - // Required: No - // Stability: stable - // Note: An exception is considered to have escaped (or left) the scope of a span, - // if that span is ended while the exception is still logically "in flight". - // This may be actually "in flight" in some languages (e.g. if the exception - // is passed to a Context manager's `__exit__` method in Python) but will - // usually be caught at the point of recording the exception in most languages. - - // It is usually not possible to determine at the point where an exception is - // thrown - // whether it will escape the scope of a span. - // However, it is trivial to know that an exception - // will escape, if one checks for an active exception just before ending the span, - // as done in the [example above](#recording-an-exception). - - // It follows that an exception may still escape the scope of the span - // even if the `exception.escaped` attribute was not set or set to false, - // since the event might have been recorded at a time where it was not - // clear whether the exception will escape. - ExceptionEscapedKey = attribute.Key("exception.escaped") -) - -// This semantic convention describes an instance of a function that runs without provisioning or managing of servers (also known as serverless functions or Function as a Service (FaaS)) with spans. -const ( - // Type of the trigger which caused this function execution. - // - // Type: Enum - // Required: No - // Stability: stable - // Note: For the server/consumer span on the incoming side, - // `faas.trigger` MUST be set. - - // Clients invoking FaaS instances usually cannot set `faas.trigger`, - // since they would typically need to look in the payload to determine - // the event type. If clients set it, it should be the same as the - // trigger that corresponding incoming would have (i.e., this has - // nothing to do with the underlying transport used to make the API - // call to invoke the lambda, which is often HTTP). - FaaSTriggerKey = attribute.Key("faas.trigger") - // The execution ID of the current function execution. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'af9d5aa4-a685-4c5f-a22b-444f80b3cc28' - FaaSExecutionKey = attribute.Key("faas.execution") -) - -var ( - // A response to some data source operation such as a database or filesystem read/write - FaaSTriggerDatasource = FaaSTriggerKey.String("datasource") - // To provide an answer to an inbound HTTP request - FaaSTriggerHTTP = FaaSTriggerKey.String("http") - // A function is set to be executed when messages are sent to a messaging system - FaaSTriggerPubsub = FaaSTriggerKey.String("pubsub") - // A function is scheduled to be executed regularly - FaaSTriggerTimer = FaaSTriggerKey.String("timer") - // If none of the others apply - FaaSTriggerOther = FaaSTriggerKey.String("other") -) - -// Semantic Convention for FaaS triggered as a response to some data source operation such as a database or filesystem read/write. -const ( - // The name of the source on which the triggering operation was performed. For - // example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos - // DB to the database name. - // - // Type: string - // Required: Always - // Stability: stable - // Examples: 'myBucketName', 'myDBName' - FaaSDocumentCollectionKey = attribute.Key("faas.document.collection") - // Describes the type of the operation that was performed on the data. - // - // Type: Enum - // Required: Always - // Stability: stable - FaaSDocumentOperationKey = attribute.Key("faas.document.operation") - // A string containing the time when the data was accessed in the [ISO - // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed - // in [UTC](https://www.w3.org/TR/NOTE-datetime). - // - // Type: string - // Required: Always - // Stability: stable - // Examples: '2020-01-23T13:47:06Z' - FaaSDocumentTimeKey = attribute.Key("faas.document.time") - // The document name/table subjected to the operation. For example, in Cloud - // Storage or S3 is the name of the file, and in Cosmos DB the table name. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'myFile.txt', 'myTableName' - FaaSDocumentNameKey = attribute.Key("faas.document.name") -) - -var ( - // When a new object is created - FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert") - // When an object is modified - FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit") - // When an object is deleted - FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete") -) - -// Semantic Convention for FaaS scheduled to be executed regularly. -const ( - // A string containing the function invocation time in the [ISO - // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed - // in [UTC](https://www.w3.org/TR/NOTE-datetime). - // - // Type: string - // Required: Always - // Stability: stable - // Examples: '2020-01-23T13:47:06Z' - FaaSTimeKey = attribute.Key("faas.time") - // A string containing the schedule period as [Cron Expression](https://docs.oracl - // e.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). - // - // Type: string - // Required: No - // Stability: stable - // Examples: '0/5 * * * ? *' - FaaSCronKey = attribute.Key("faas.cron") -) - -// Contains additional attributes for incoming FaaS spans. -const ( - // A boolean that is true if the serverless function is executed for the first - // time (aka cold-start). - // - // Type: boolean - // Required: No - // Stability: stable - FaaSColdstartKey = attribute.Key("faas.coldstart") -) - -// Contains additional attributes for outgoing FaaS spans. -const ( - // The name of the invoked function. - // - // Type: string - // Required: Always - // Stability: stable - // Examples: 'my-function' - // Note: SHOULD be equal to the `faas.name` resource attribute of the invoked - // function. - FaaSInvokedNameKey = attribute.Key("faas.invoked_name") - // The cloud provider of the invoked function. - // - // Type: Enum - // Required: Always - // Stability: stable - // Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked - // function. - FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider") - // The cloud region of the invoked function. - // - // Type: string - // Required: For some cloud providers, like AWS or GCP, the region in which a - // function is hosted is essential to uniquely identify the function and also part - // of its endpoint. Since it's part of the endpoint being called, the region is - // always known to clients. In these cases, `faas.invoked_region` MUST be set - // accordingly. If the region is unknown to the client or not required for - // identifying the invoked function, setting `faas.invoked_region` is optional. - // Stability: stable - // Examples: 'eu-central-1' - // Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked - // function. - FaaSInvokedRegionKey = attribute.Key("faas.invoked_region") -) - -var ( - // Alibaba Cloud - FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud") - // Amazon Web Services - FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws") - // Microsoft Azure - FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure") - // Google Cloud Platform - FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp") - // Tencent Cloud - FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud") -) - -// These attributes may be used for any network related operation. -const ( - // Transport protocol used. See note below. - // - // Type: Enum - // Required: No - // Stability: stable - NetTransportKey = attribute.Key("net.transport") - // Remote address of the peer (dotted decimal for IPv4 or - // [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6) - // - // Type: string - // Required: No - // Stability: stable - // Examples: '127.0.0.1' - NetPeerIPKey = attribute.Key("net.peer.ip") - // Remote port number. - // - // Type: int - // Required: No - // Stability: stable - // Examples: 80, 8080, 443 - NetPeerPortKey = attribute.Key("net.peer.port") - // Remote hostname or similar, see note below. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'example.com' - // Note: `net.peer.name` SHOULD NOT be set if capturing it would require an extra - // DNS lookup. - NetPeerNameKey = attribute.Key("net.peer.name") - // Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '192.168.0.1' - NetHostIPKey = attribute.Key("net.host.ip") - // Like `net.peer.port` but for the host port. - // - // Type: int - // Required: No - // Stability: stable - // Examples: 35555 - NetHostPortKey = attribute.Key("net.host.port") - // Local hostname or similar, see note below. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'localhost' - NetHostNameKey = attribute.Key("net.host.name") - // The internet connection type currently being used by the host. - // - // Type: Enum - // Required: No - // Stability: stable - // Examples: 'wifi' - NetHostConnectionTypeKey = attribute.Key("net.host.connection.type") - // This describes more details regarding the connection.type. It may be the type - // of cell technology connection, but it could be used for describing details - // about a wifi connection. - // - // Type: Enum - // Required: No - // Stability: stable - // Examples: 'LTE' - NetHostConnectionSubtypeKey = attribute.Key("net.host.connection.subtype") - // The name of the mobile carrier. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'sprint' - NetHostCarrierNameKey = attribute.Key("net.host.carrier.name") - // The mobile carrier country code. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '310' - NetHostCarrierMccKey = attribute.Key("net.host.carrier.mcc") - // The mobile carrier network code. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '001' - NetHostCarrierMncKey = attribute.Key("net.host.carrier.mnc") - // The ISO 3166-1 alpha-2 2-character country code associated with the mobile - // carrier network. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'DE' - NetHostCarrierIccKey = attribute.Key("net.host.carrier.icc") -) - -var ( - // ip_tcp - NetTransportTCP = NetTransportKey.String("ip_tcp") - // ip_udp - NetTransportUDP = NetTransportKey.String("ip_udp") - // Another IP-based protocol - NetTransportIP = NetTransportKey.String("ip") - // Unix Domain socket. See below - NetTransportUnix = NetTransportKey.String("unix") - // Named or anonymous pipe. See note below - NetTransportPipe = NetTransportKey.String("pipe") - // In-process communication - NetTransportInProc = NetTransportKey.String("inproc") - // Something else (non IP-based) - NetTransportOther = NetTransportKey.String("other") -) - -var ( - // wifi - NetHostConnectionTypeWifi = NetHostConnectionTypeKey.String("wifi") - // wired - NetHostConnectionTypeWired = NetHostConnectionTypeKey.String("wired") - // cell - NetHostConnectionTypeCell = NetHostConnectionTypeKey.String("cell") - // unavailable - NetHostConnectionTypeUnavailable = NetHostConnectionTypeKey.String("unavailable") - // unknown - NetHostConnectionTypeUnknown = NetHostConnectionTypeKey.String("unknown") -) - -var ( - // GPRS - NetHostConnectionSubtypeGprs = NetHostConnectionSubtypeKey.String("gprs") - // EDGE - NetHostConnectionSubtypeEdge = NetHostConnectionSubtypeKey.String("edge") - // UMTS - NetHostConnectionSubtypeUmts = NetHostConnectionSubtypeKey.String("umts") - // CDMA - NetHostConnectionSubtypeCdma = NetHostConnectionSubtypeKey.String("cdma") - // EVDO Rel. 0 - NetHostConnectionSubtypeEvdo0 = NetHostConnectionSubtypeKey.String("evdo_0") - // EVDO Rev. A - NetHostConnectionSubtypeEvdoA = NetHostConnectionSubtypeKey.String("evdo_a") - // CDMA2000 1XRTT - NetHostConnectionSubtypeCdma20001xrtt = NetHostConnectionSubtypeKey.String("cdma2000_1xrtt") - // HSDPA - NetHostConnectionSubtypeHsdpa = NetHostConnectionSubtypeKey.String("hsdpa") - // HSUPA - NetHostConnectionSubtypeHsupa = NetHostConnectionSubtypeKey.String("hsupa") - // HSPA - NetHostConnectionSubtypeHspa = NetHostConnectionSubtypeKey.String("hspa") - // IDEN - NetHostConnectionSubtypeIden = NetHostConnectionSubtypeKey.String("iden") - // EVDO Rev. B - NetHostConnectionSubtypeEvdoB = NetHostConnectionSubtypeKey.String("evdo_b") - // LTE - NetHostConnectionSubtypeLte = NetHostConnectionSubtypeKey.String("lte") - // EHRPD - NetHostConnectionSubtypeEhrpd = NetHostConnectionSubtypeKey.String("ehrpd") - // HSPAP - NetHostConnectionSubtypeHspap = NetHostConnectionSubtypeKey.String("hspap") - // GSM - NetHostConnectionSubtypeGsm = NetHostConnectionSubtypeKey.String("gsm") - // TD-SCDMA - NetHostConnectionSubtypeTdScdma = NetHostConnectionSubtypeKey.String("td_scdma") - // IWLAN - NetHostConnectionSubtypeIwlan = NetHostConnectionSubtypeKey.String("iwlan") - // 5G NR (New Radio) - NetHostConnectionSubtypeNr = NetHostConnectionSubtypeKey.String("nr") - // 5G NRNSA (New Radio Non-Standalone) - NetHostConnectionSubtypeNrnsa = NetHostConnectionSubtypeKey.String("nrnsa") - // LTE CA - NetHostConnectionSubtypeLteCa = NetHostConnectionSubtypeKey.String("lte_ca") -) - -// Operations that access some remote service. -const ( - // The [`service.name`](../../resource/semantic_conventions/README.md#service) of - // the remote service. SHOULD be equal to the actual `service.name` resource - // attribute of the remote service if any. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'AuthTokenCache' - PeerServiceKey = attribute.Key("peer.service") -) - -// These attributes may be used for any operation with an authenticated and/or authorized enduser. -const ( - // Username or client_id extracted from the access token or - // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the - // inbound request from outside the system. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'username' - EnduserIDKey = attribute.Key("enduser.id") - // Actual/assumed role the client is making the request under extracted from token - // or application security context. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'admin' - EnduserRoleKey = attribute.Key("enduser.role") - // Scopes or granted authorities the client currently possesses extracted from - // token or application security context. The value would come from the scope - // associated with an [OAuth 2.0 Access - // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value - // in a [SAML 2.0 Assertion](http://docs.oasis- - // open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'read:message, write:files' - EnduserScopeKey = attribute.Key("enduser.scope") -) - -// These attributes may be used for any operation to store information about a thread that started a span. -const ( - // Current "managed" thread ID (as opposed to OS thread ID). - // - // Type: int - // Required: No - // Stability: stable - // Examples: 42 - ThreadIDKey = attribute.Key("thread.id") - // Current thread name. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'main' - ThreadNameKey = attribute.Key("thread.name") -) - -// These attributes allow to report this unit of code and therefore to provide more context about the span. -const ( - // The method or function name, or equivalent (usually rightmost part of the code - // unit's name). - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'serveRequest' - CodeFunctionKey = attribute.Key("code.function") - // The "namespace" within which `code.function` is defined. Usually the qualified - // class or module name, such that `code.namespace` + some separator + - // `code.function` form a unique identifier for the code unit. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'com.example.MyHTTPService' - CodeNamespaceKey = attribute.Key("code.namespace") - // The source code file name that identifies the code unit as uniquely as possible - // (preferably an absolute file path). - // - // Type: string - // Required: No - // Stability: stable - // Examples: '/usr/local/MyApplication/content_root/app/index.php' - CodeFilepathKey = attribute.Key("code.filepath") - // The line number in `code.filepath` best representing the operation. It SHOULD - // point within the code unit named in `code.function`. - // - // Type: int - // Required: No - // Stability: stable - // Examples: 42 - CodeLineNumberKey = attribute.Key("code.lineno") -) - -// This document defines semantic conventions for HTTP client and server Spans. -const ( - // HTTP request method. - // - // Type: string - // Required: Always - // Stability: stable - // Examples: 'GET', 'POST', 'HEAD' - HTTPMethodKey = attribute.Key("http.method") - // Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. - // Usually the fragment is not transmitted over HTTP, but if it is known, it - // should be included nevertheless. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv' - // Note: `http.url` MUST NOT contain credentials passed via URL in form of - // `https://username:password@www.example.com/`. In such case the attribute's - // value should be `https://www.example.com/`. - HTTPURLKey = attribute.Key("http.url") - // The full request target as passed in a HTTP request line or equivalent. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '/path/12314/?q=ddds#123' - HTTPTargetKey = attribute.Key("http.target") - // The value of the [HTTP host - // header](https://tools.ietf.org/html/rfc7230#section-5.4). An empty Host header - // should also be reported, see note. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'www.example.org' - // Note: When the header is present but empty the attribute SHOULD be set to the - // empty string. Note that this is a valid situation that is expected in certain - // cases, according the aforementioned [section of RFC - // 7230](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is not - // set the attribute MUST NOT be set. - HTTPHostKey = attribute.Key("http.host") - // The URI scheme identifying the used protocol. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'http', 'https' - HTTPSchemeKey = attribute.Key("http.scheme") - // [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). - // - // Type: int - // Required: If and only if one was received/sent. - // Stability: stable - // Examples: 200 - HTTPStatusCodeKey = attribute.Key("http.status_code") - // Kind of HTTP protocol used. - // - // Type: Enum - // Required: No - // Stability: stable - // Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` - // except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. - HTTPFlavorKey = attribute.Key("http.flavor") - // Value of the [HTTP User- - // Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the - // client. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'CERN-LineMode/2.15 libwww/2.17b3' - HTTPUserAgentKey = attribute.Key("http.user_agent") - // The size of the request payload body in bytes. This is the number of bytes - // transferred excluding headers and is often, but not always, present as the - // [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For - // requests using transport encoding, this should be the compressed size. - // - // Type: int - // Required: No - // Stability: stable - // Examples: 3495 - HTTPRequestContentLengthKey = attribute.Key("http.request_content_length") - // The size of the uncompressed request payload body after transport decoding. Not - // set if transport encoding not used. - // - // Type: int - // Required: No - // Stability: stable - // Examples: 5493 - HTTPRequestContentLengthUncompressedKey = attribute.Key("http.request_content_length_uncompressed") - // The size of the response payload body in bytes. This is the number of bytes - // transferred excluding headers and is often, but not always, present as the - // [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For - // requests using transport encoding, this should be the compressed size. - // - // Type: int - // Required: No - // Stability: stable - // Examples: 3495 - HTTPResponseContentLengthKey = attribute.Key("http.response_content_length") - // The size of the uncompressed response payload body after transport decoding. - // Not set if transport encoding not used. - // - // Type: int - // Required: No - // Stability: stable - // Examples: 5493 - HTTPResponseContentLengthUncompressedKey = attribute.Key("http.response_content_length_uncompressed") - // The ordinal number of request re-sending attempt. - // - // Type: int - // Required: If and only if a request was retried. - // Stability: stable - // Examples: 3 - HTTPRetryCountKey = attribute.Key("http.retry_count") -) - -var ( - // HTTP/1.0 - HTTPFlavorHTTP10 = HTTPFlavorKey.String("1.0") - // HTTP/1.1 - HTTPFlavorHTTP11 = HTTPFlavorKey.String("1.1") - // HTTP/2 - HTTPFlavorHTTP20 = HTTPFlavorKey.String("2.0") - // HTTP/3 - HTTPFlavorHTTP30 = HTTPFlavorKey.String("3.0") - // SPDY protocol - HTTPFlavorSPDY = HTTPFlavorKey.String("SPDY") - // QUIC protocol - HTTPFlavorQUIC = HTTPFlavorKey.String("QUIC") -) - -// Semantic Convention for HTTP Server -const ( - // The primary server name of the matched virtual host. This should be obtained - // via configuration. If no such configuration can be obtained, this attribute - // MUST NOT be set ( `net.host.name` should be used instead). - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'example.com' - // Note: `http.url` is usually not readily available on the server side but would - // have to be assembled in a cumbersome and sometimes lossy process from other - // information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus - // preferred to supply the raw data that is available. - HTTPServerNameKey = attribute.Key("http.server_name") - // The matched route (path template). - // - // Type: string - // Required: No - // Stability: stable - // Examples: '/users/:userID?' - HTTPRouteKey = attribute.Key("http.route") - // The IP address of the original client behind all proxies, if known (e.g. from - // [X-Forwarded-For](https://developer.mozilla.org/en- - // US/docs/Web/HTTP/Headers/X-Forwarded-For)). - // - // Type: string - // Required: No - // Stability: stable - // Examples: '83.164.160.102' - // Note: This is not necessarily the same as `net.peer.ip`, which would - // identify the network-level peer, which may be a proxy. - - // This attribute should be set when a source of information different - // from the one used for `net.peer.ip`, is available even if that other - // source just confirms the same value as `net.peer.ip`. - // Rationale: For `net.peer.ip`, one typically does not know if it - // comes from a proxy, reverse proxy, or the actual client. Setting - // `http.client_ip` when it's the same as `net.peer.ip` means that - // one is at least somewhat confident that the address is not that of - // the closest proxy. - HTTPClientIPKey = attribute.Key("http.client_ip") -) - -// Attributes that exist for multiple DynamoDB request types. -const ( - // The keys in the `RequestItems` object field. - // - // Type: string[] - // Required: No - // Stability: stable - // Examples: 'Users', 'Cats' - AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names") - // The JSON-serialized value of each item in the `ConsumedCapacity` response - // field. - // - // Type: string[] - // Required: No - // Stability: stable - // Examples: '{ "CapacityUnits": number, "GlobalSecondaryIndexes": { "string" : { - // "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": - // number } }, "LocalSecondaryIndexes": { "string" : { "CapacityUnits": number, - // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }, - // "ReadCapacityUnits": number, "Table": { "CapacityUnits": number, - // "ReadCapacityUnits": number, "WriteCapacityUnits": number }, "TableName": - // "string", "WriteCapacityUnits": number }' - AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity") - // The JSON-serialized value of the `ItemCollectionMetrics` response field. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '{ "string" : [ { "ItemCollectionKey": { "string" : { "B": blob, - // "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { "string" : - // "AttributeValue" }, "N": "string", "NS": [ "string" ], "NULL": boolean, "S": - // "string", "SS": [ "string" ] } }, "SizeEstimateRangeGB": [ number ] } ] }' - AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics") - // The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. - // - // Type: double - // Required: No - // Stability: stable - // Examples: 1.0, 2.0 - AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity") - // The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. - // - // Type: double - // Required: No - // Stability: stable - // Examples: 1.0, 2.0 - AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity") - // The value of the `ConsistentRead` request parameter. - // - // Type: boolean - // Required: No - // Stability: stable - AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read") - // The value of the `ProjectionExpression` request parameter. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'Title', 'Title, Price, Color', 'Title, Description, RelatedItems, - // ProductReviews' - AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection") - // The value of the `Limit` request parameter. - // - // Type: int - // Required: No - // Stability: stable - // Examples: 10 - AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit") - // The value of the `AttributesToGet` request parameter. - // - // Type: string[] - // Required: No - // Stability: stable - // Examples: 'lives', 'id' - AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get") - // The value of the `IndexName` request parameter. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'name_to_group' - AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name") - // The value of the `Select` request parameter. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'ALL_ATTRIBUTES', 'COUNT' - AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select") -) - -// DynamoDB.CreateTable -const ( - // The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request - // field - // - // Type: string[] - // Required: No - // Stability: stable - // Examples: '{ "IndexName": "string", "KeySchema": [ { "AttributeName": "string", - // "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], - // "ProjectionType": "string" }, "ProvisionedThroughput": { "ReadCapacityUnits": - // number, "WriteCapacityUnits": number } }' - AWSDynamoDBGlobalSecondaryIndexesKey = attribute.Key("aws.dynamodb.global_secondary_indexes") - // The JSON-serialized value of each item of the `LocalSecondaryIndexes` request - // field. - // - // Type: string[] - // Required: No - // Stability: stable - // Examples: '{ "IndexARN": "string", "IndexName": "string", "IndexSizeBytes": - // number, "ItemCount": number, "KeySchema": [ { "AttributeName": "string", - // "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], - // "ProjectionType": "string" } }' - AWSDynamoDBLocalSecondaryIndexesKey = attribute.Key("aws.dynamodb.local_secondary_indexes") -) - -// DynamoDB.ListTables -const ( - // The value of the `ExclusiveStartTableName` request parameter. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'Users', 'CatsTable' - AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table") - // The number of items in the `TableNames` response parameter. - // - // Type: int - // Required: No - // Stability: stable - // Examples: 20 - AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count") -) - -// DynamoDB.Query -const ( - // The value of the `ScanIndexForward` request parameter. - // - // Type: boolean - // Required: No - // Stability: stable - AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward") -) - -// DynamoDB.Scan -const ( - // The value of the `Segment` request parameter. - // - // Type: int - // Required: No - // Stability: stable - // Examples: 10 - AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment") - // The value of the `TotalSegments` request parameter. - // - // Type: int - // Required: No - // Stability: stable - // Examples: 100 - AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments") - // The value of the `Count` response parameter. - // - // Type: int - // Required: No - // Stability: stable - // Examples: 10 - AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count") - // The value of the `ScannedCount` response parameter. - // - // Type: int - // Required: No - // Stability: stable - // Examples: 50 - AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count") -) - -// DynamoDB.UpdateTable -const ( - // The JSON-serialized value of each item in the `AttributeDefinitions` request - // field. - // - // Type: string[] - // Required: No - // Stability: stable - // Examples: '{ "AttributeName": "string", "AttributeType": "string" }' - AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions") - // The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` - // request field. - // - // Type: string[] - // Required: No - // Stability: stable - // Examples: '{ "Create": { "IndexName": "string", "KeySchema": [ { - // "AttributeName": "string", "KeyType": "string" } ], "Projection": { - // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, - // "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits": - // number } }' - AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates") -) - -// This document defines the attributes used in messaging systems. -const ( - // A string identifying the messaging system. - // - // Type: string - // Required: Always - // Stability: stable - // Examples: 'kafka', 'rabbitmq', 'rocketmq', 'activemq', 'AmazonSQS' - MessagingSystemKey = attribute.Key("messaging.system") - // The message destination name. This might be equal to the span name but is - // required nevertheless. - // - // Type: string - // Required: Always - // Stability: stable - // Examples: 'MyQueue', 'MyTopic' - MessagingDestinationKey = attribute.Key("messaging.destination") - // The kind of message destination - // - // Type: Enum - // Required: Required only if the message destination is either a `queue` or - // `topic`. - // Stability: stable - MessagingDestinationKindKey = attribute.Key("messaging.destination_kind") - // A boolean that is true if the message destination is temporary. - // - // Type: boolean - // Required: If missing, it is assumed to be false. - // Stability: stable - MessagingTempDestinationKey = attribute.Key("messaging.temp_destination") - // The name of the transport protocol. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'AMQP', 'MQTT' - MessagingProtocolKey = attribute.Key("messaging.protocol") - // The version of the transport protocol. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '0.9.1' - MessagingProtocolVersionKey = attribute.Key("messaging.protocol_version") - // Connection string. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'tibjmsnaming://localhost:7222', - // 'https://queue.amazonaws.com/80398EXAMPLE/MyQueue' - MessagingURLKey = attribute.Key("messaging.url") - // A value used by the messaging system as an identifier for the message, - // represented as a string. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '452a7c7c7c7048c2f887f61572b18fc2' - MessagingMessageIDKey = attribute.Key("messaging.message_id") - // The [conversation ID](#conversations) identifying the conversation to which the - // message belongs, represented as a string. Sometimes called "Correlation ID". - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'MyConversationID' - MessagingConversationIDKey = attribute.Key("messaging.conversation_id") - // The (uncompressed) size of the message payload in bytes. Also use this - // attribute if it is unknown whether the compressed or uncompressed payload size - // is reported. - // - // Type: int - // Required: No - // Stability: stable - // Examples: 2738 - MessagingMessagePayloadSizeBytesKey = attribute.Key("messaging.message_payload_size_bytes") - // The compressed size of the message payload in bytes. - // - // Type: int - // Required: No - // Stability: stable - // Examples: 2048 - MessagingMessagePayloadCompressedSizeBytesKey = attribute.Key("messaging.message_payload_compressed_size_bytes") -) - -var ( - // A message sent to a queue - MessagingDestinationKindQueue = MessagingDestinationKindKey.String("queue") - // A message sent to a topic - MessagingDestinationKindTopic = MessagingDestinationKindKey.String("topic") -) - -// Semantic convention for a consumer of messages received from a messaging system -const ( - // A string identifying the kind of message consumption as defined in the - // [Operation names](#operation-names) section above. If the operation is "send", - // this attribute MUST NOT be set, since the operation can be inferred from the - // span kind in that case. - // - // Type: Enum - // Required: No - // Stability: stable - MessagingOperationKey = attribute.Key("messaging.operation") - // The identifier for the consumer receiving a message. For Kafka, set it to - // `{messaging.kafka.consumer_group} - {messaging.kafka.client_id}`, if both are - // present, or only `messaging.kafka.consumer_group`. For brokers, such as - // RabbitMQ and Artemis, set it to the `client_id` of the client consuming the - // message. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'mygroup - client-6' - MessagingConsumerIDKey = attribute.Key("messaging.consumer_id") -) - -var ( - // receive - MessagingOperationReceive = MessagingOperationKey.String("receive") - // process - MessagingOperationProcess = MessagingOperationKey.String("process") -) - -// Attributes for RabbitMQ -const ( - // RabbitMQ message routing key. - // - // Type: string - // Required: Unless it is empty. - // Stability: stable - // Examples: 'myKey' - MessagingRabbitmqRoutingKeyKey = attribute.Key("messaging.rabbitmq.routing_key") -) - -// Attributes for Apache Kafka -const ( - // Message keys in Kafka are used for grouping alike messages to ensure they're - // processed on the same partition. They differ from `messaging.message_id` in - // that they're not unique. If the key is `null`, the attribute MUST NOT be set. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'myKey' - // Note: If the key type is not string, it's string representation has to be - // supplied for the attribute. If the key has no unambiguous, canonical string - // form, don't include its value. - MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message_key") - // Name of the Kafka Consumer Group that is handling the message. Only applies to - // consumers, not producers. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'my-group' - MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer_group") - // Client ID for the Consumer or Producer that is handling the message. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'client-5' - MessagingKafkaClientIDKey = attribute.Key("messaging.kafka.client_id") - // Partition the message is sent to. - // - // Type: int - // Required: No - // Stability: stable - // Examples: 2 - MessagingKafkaPartitionKey = attribute.Key("messaging.kafka.partition") - // A boolean that is true if the message is a tombstone. - // - // Type: boolean - // Required: If missing, it is assumed to be false. - // Stability: stable - MessagingKafkaTombstoneKey = attribute.Key("messaging.kafka.tombstone") -) - -// Attributes for Apache RocketMQ -const ( - // Namespace of RocketMQ resources, resources in different namespaces are - // individual. - // - // Type: string - // Required: Always - // Stability: stable - // Examples: 'myNamespace' - MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace") - // Name of the RocketMQ producer/consumer group that is handling the message. The - // client type is identified by the SpanKind. - // - // Type: string - // Required: Always - // Stability: stable - // Examples: 'myConsumerGroup' - MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group") - // The unique identifier for each client. - // - // Type: string - // Required: Always - // Stability: stable - // Examples: 'myhost@8742@s8083jm' - MessagingRocketmqClientIDKey = attribute.Key("messaging.rocketmq.client_id") - // Type of message. - // - // Type: Enum - // Required: No - // Stability: stable - MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message_type") - // The secondary classifier of message besides topic. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'tagA' - MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message_tag") - // Key(s) of message, another way to mark message besides message id. - // - // Type: string[] - // Required: No - // Stability: stable - // Examples: 'keyA', 'keyB' - MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message_keys") - // Model of message consumption. This only applies to consumer spans. - // - // Type: Enum - // Required: No - // Stability: stable - MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model") -) - -var ( - // Normal message - MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal") - // FIFO message - MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo") - // Delay message - MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay") - // Transaction message - MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction") -) - -var ( - // Clustering consumption model - MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering") - // Broadcasting consumption model - MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting") -) - -// This document defines semantic conventions for remote procedure calls. -const ( - // A string identifying the remoting system. See below for a list of well-known - // identifiers. - // - // Type: Enum - // Required: Always - // Stability: stable - RPCSystemKey = attribute.Key("rpc.system") - // The full (logical) name of the service being called, including its package - // name, if applicable. - // - // Type: string - // Required: No, but recommended - // Stability: stable - // Examples: 'myservice.EchoService' - // Note: This is the logical name of the service from the RPC interface - // perspective, which can be different from the name of any implementing class. - // The `code.namespace` attribute may be used to store the latter (despite the - // attribute name, it may include a class name; e.g., class with method actually - // executing the call on the server side, RPC client stub class on the client - // side). - RPCServiceKey = attribute.Key("rpc.service") - // The name of the (logical) method being called, must be equal to the $method - // part in the span name. - // - // Type: string - // Required: No, but recommended - // Stability: stable - // Examples: 'exampleMethod' - // Note: This is the logical name of the method from the RPC interface - // perspective, which can be different from the name of any implementing - // method/function. The `code.function` attribute may be used to store the latter - // (e.g., method actually executing the call on the server side, RPC client stub - // method on the client side). - RPCMethodKey = attribute.Key("rpc.method") -) - -var ( - // gRPC - RPCSystemGRPC = RPCSystemKey.String("grpc") - // Java RMI - RPCSystemJavaRmi = RPCSystemKey.String("java_rmi") - // .NET WCF - RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf") - // Apache Dubbo - RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo") -) - -// Tech-specific attributes for gRPC. -const ( - // The [numeric status - // code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC - // request. - // - // Type: Enum - // Required: Always - // Stability: stable - RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code") -) - -var ( - // OK - RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0) - // CANCELLED - RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1) - // UNKNOWN - RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2) - // INVALID_ARGUMENT - RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3) - // DEADLINE_EXCEEDED - RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4) - // NOT_FOUND - RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5) - // ALREADY_EXISTS - RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6) - // PERMISSION_DENIED - RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7) - // RESOURCE_EXHAUSTED - RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8) - // FAILED_PRECONDITION - RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9) - // ABORTED - RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10) - // OUT_OF_RANGE - RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11) - // UNIMPLEMENTED - RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12) - // INTERNAL - RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13) - // UNAVAILABLE - RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14) - // DATA_LOSS - RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15) - // UNAUTHENTICATED - RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16) -) - -// Tech-specific attributes for [JSON RPC](https://www.jsonrpc.org/). -const ( - // Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC - // 1.0 does not specify this, the value can be omitted. - // - // Type: string - // Required: If missing, it is assumed to be "1.0". - // Stability: stable - // Examples: '2.0', '1.0' - RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version") - // `id` property of request or response. Since protocol allows id to be int, - // string, `null` or missing (for notifications), value is expected to be cast to - // string for simplicity. Use empty string in case of `null` value. Omit entirely - // if this is a notification. - // - // Type: string - // Required: No - // Stability: stable - // Examples: '10', 'request-7', '' - RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id") - // `error.code` property of response if it is an error response. - // - // Type: int - // Required: If missing, response is assumed to be successful. - // Stability: stable - // Examples: -32700, 100 - RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code") - // `error.message` property of response if it is an error response. - // - // Type: string - // Required: No - // Stability: stable - // Examples: 'Parse error', 'User already exists' - RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message") -) - -// RPC received/sent message. -const ( - // Whether this is a received or sent message. - // - // Type: Enum - // Required: No - // Stability: stable - MessageTypeKey = attribute.Key("message.type") - // MUST be calculated as two different counters starting from `1` one for sent - // messages and one for received message. - // - // Type: int - // Required: No - // Stability: stable - // Note: This way we guarantee that the values will be consistent between - // different implementations. - MessageIDKey = attribute.Key("message.id") - // Compressed size of the message in bytes. - // - // Type: int - // Required: No - // Stability: stable - MessageCompressedSizeKey = attribute.Key("message.compressed_size") - // Uncompressed size of the message in bytes. - // - // Type: int - // Required: No - // Stability: stable - MessageUncompressedSizeKey = attribute.Key("message.uncompressed_size") -) - -var ( - // sent - MessageTypeSent = MessageTypeKey.String("SENT") - // received - MessageTypeReceived = MessageTypeKey.String("RECEIVED") -) diff --git a/e2e/vendor/go.uber.org/multierr/.codecov.yml b/e2e/vendor/go.uber.org/multierr/.codecov.yml deleted file mode 100644 index 6d4d1be7b..000000000 --- a/e2e/vendor/go.uber.org/multierr/.codecov.yml +++ /dev/null @@ -1,15 +0,0 @@ -coverage: - range: 80..100 - round: down - precision: 2 - - status: - project: # measuring the overall project coverage - default: # context, you can create multiple ones with custom titles - enabled: yes # must be yes|true to enable this status - target: 100 # specify the target coverage for each commit status - # option: "auto" (must increase from parent commit or pull request base) - # option: "X%" a static target percentage to hit - if_not_found: success # if parent is not found report status as success, error, or failure - if_ci_failed: error # if ci fails report status as success, error, or failure - diff --git a/e2e/vendor/go.uber.org/multierr/.gitignore b/e2e/vendor/go.uber.org/multierr/.gitignore deleted file mode 100644 index b9a05e3da..000000000 --- a/e2e/vendor/go.uber.org/multierr/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/vendor -cover.html -cover.out -/bin diff --git a/e2e/vendor/go.uber.org/multierr/CHANGELOG.md b/e2e/vendor/go.uber.org/multierr/CHANGELOG.md deleted file mode 100644 index f8177b978..000000000 --- a/e2e/vendor/go.uber.org/multierr/CHANGELOG.md +++ /dev/null @@ -1,95 +0,0 @@ -Releases -======== - -v1.11.0 (2023-03-28) -==================== -- `Errors` now supports any error that implements multiple-error - interface. -- Add `Every` function to allow checking if all errors in the chain - satisfies `errors.Is` against the target error. - -v1.10.0 (2023-03-08) -==================== - -- Comply with Go 1.20's multiple-error interface. -- Drop Go 1.18 support. - Per the support policy, only Go 1.19 and 1.20 are supported now. -- Drop all non-test external dependencies. - -v1.9.0 (2022-12-12) -=================== - -- Add `AppendFunc` that allow passsing functions to similar to - `AppendInvoke`. - -- Bump up yaml.v3 dependency to 3.0.1. - -v1.8.0 (2022-02-28) -=================== - -- `Combine`: perform zero allocations when there are no errors. - - -v1.7.0 (2021-05-06) -=================== - -- Add `AppendInvoke` to append into errors from `defer` blocks. - - -v1.6.0 (2020-09-14) -=================== - -- Actually drop library dependency on development-time tooling. - - -v1.5.0 (2020-02-24) -=================== - -- Drop library dependency on development-time tooling. - - -v1.4.0 (2019-11-04) -=================== - -- Add `AppendInto` function to more ergonomically build errors inside a - loop. - - -v1.3.0 (2019-10-29) -=================== - -- Switch to Go modules. - - -v1.2.0 (2019-09-26) -=================== - -- Support extracting and matching against wrapped errors with `errors.As` - and `errors.Is`. - - -v1.1.0 (2017-06-30) -=================== - -- Added an `Errors(error) []error` function to extract the underlying list of - errors for a multierr error. - - -v1.0.0 (2017-05-31) -=================== - -No changes since v0.2.0. This release is committing to making no breaking -changes to the current API in the 1.X series. - - -v0.2.0 (2017-04-11) -=================== - -- Repeatedly appending to the same error is now faster due to fewer - allocations. - - -v0.1.0 (2017-31-03) -=================== - -- Initial release diff --git a/e2e/vendor/go.uber.org/multierr/LICENSE.txt b/e2e/vendor/go.uber.org/multierr/LICENSE.txt deleted file mode 100644 index 413e30f7c..000000000 --- a/e2e/vendor/go.uber.org/multierr/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2017-2021 Uber Technologies, Inc. - -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/e2e/vendor/go.uber.org/multierr/Makefile b/e2e/vendor/go.uber.org/multierr/Makefile deleted file mode 100644 index dcb6fe723..000000000 --- a/e2e/vendor/go.uber.org/multierr/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -# Directory to put `go install`ed binaries in. -export GOBIN ?= $(shell pwd)/bin - -GO_FILES := $(shell \ - find . '(' -path '*/.*' -o -path './vendor' ')' -prune \ - -o -name '*.go' -print | cut -b3-) - -.PHONY: build -build: - go build ./... - -.PHONY: test -test: - go test -race ./... - -.PHONY: gofmt -gofmt: - $(eval FMT_LOG := $(shell mktemp -t gofmt.XXXXX)) - @gofmt -e -s -l $(GO_FILES) > $(FMT_LOG) || true - @[ ! -s "$(FMT_LOG)" ] || (echo "gofmt failed:" | cat - $(FMT_LOG) && false) - -.PHONY: golint -golint: - @cd tools && go install golang.org/x/lint/golint - @$(GOBIN)/golint ./... - -.PHONY: staticcheck -staticcheck: - @cd tools && go install honnef.co/go/tools/cmd/staticcheck - @$(GOBIN)/staticcheck ./... - -.PHONY: lint -lint: gofmt golint staticcheck - -.PHONY: cover -cover: - go test -race -coverprofile=cover.out -coverpkg=./... -v ./... - go tool cover -html=cover.out -o cover.html diff --git a/e2e/vendor/go.uber.org/multierr/README.md b/e2e/vendor/go.uber.org/multierr/README.md deleted file mode 100644 index 5ab6ac40f..000000000 --- a/e2e/vendor/go.uber.org/multierr/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# multierr [![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov] - -`multierr` allows combining one or more Go `error`s together. - -## Features - -- **Idiomatic**: - multierr follows best practices in Go, and keeps your code idiomatic. - - It keeps the underlying error type hidden, - allowing you to deal in `error` values exclusively. - - It provides APIs to safely append into an error from a `defer` statement. -- **Performant**: - multierr is optimized for performance: - - It avoids allocations where possible. - - It utilizes slice resizing semantics to optimize common cases - like appending into the same error object from a loop. -- **Interoperable**: - multierr interoperates with the Go standard library's error APIs seamlessly: - - The `errors.Is` and `errors.As` functions *just work*. -- **Lightweight**: - multierr comes with virtually no dependencies. - -## Installation - -```bash -go get -u go.uber.org/multierr@latest -``` - -## Status - -Stable: No breaking changes will be made before 2.0. - -------------------------------------------------------------------------------- - -Released under the [MIT License]. - -[MIT License]: LICENSE.txt -[doc-img]: https://pkg.go.dev/badge/go.uber.org/multierr -[doc]: https://pkg.go.dev/go.uber.org/multierr -[ci-img]: https://github.com/uber-go/multierr/actions/workflows/go.yml/badge.svg -[cov-img]: https://codecov.io/gh/uber-go/multierr/branch/master/graph/badge.svg -[ci]: https://github.com/uber-go/multierr/actions/workflows/go.yml -[cov]: https://codecov.io/gh/uber-go/multierr diff --git a/e2e/vendor/go.uber.org/multierr/error.go b/e2e/vendor/go.uber.org/multierr/error.go deleted file mode 100644 index 3a828b2df..000000000 --- a/e2e/vendor/go.uber.org/multierr/error.go +++ /dev/null @@ -1,646 +0,0 @@ -// Copyright (c) 2017-2023 Uber Technologies, Inc. -// -// 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. - -// Package multierr allows combining one or more errors together. -// -// # Overview -// -// Errors can be combined with the use of the Combine function. -// -// multierr.Combine( -// reader.Close(), -// writer.Close(), -// conn.Close(), -// ) -// -// If only two errors are being combined, the Append function may be used -// instead. -// -// err = multierr.Append(reader.Close(), writer.Close()) -// -// The underlying list of errors for a returned error object may be retrieved -// with the Errors function. -// -// errors := multierr.Errors(err) -// if len(errors) > 0 { -// fmt.Println("The following errors occurred:", errors) -// } -// -// # Appending from a loop -// -// You sometimes need to append into an error from a loop. -// -// var err error -// for _, item := range items { -// err = multierr.Append(err, process(item)) -// } -// -// Cases like this may require knowledge of whether an individual instance -// failed. This usually requires introduction of a new variable. -// -// var err error -// for _, item := range items { -// if perr := process(item); perr != nil { -// log.Warn("skipping item", item) -// err = multierr.Append(err, perr) -// } -// } -// -// multierr includes AppendInto to simplify cases like this. -// -// var err error -// for _, item := range items { -// if multierr.AppendInto(&err, process(item)) { -// log.Warn("skipping item", item) -// } -// } -// -// This will append the error into the err variable, and return true if that -// individual error was non-nil. -// -// See [AppendInto] for more information. -// -// # Deferred Functions -// -// Go makes it possible to modify the return value of a function in a defer -// block if the function was using named returns. This makes it possible to -// record resource cleanup failures from deferred blocks. -// -// func sendRequest(req Request) (err error) { -// conn, err := openConnection() -// if err != nil { -// return err -// } -// defer func() { -// err = multierr.Append(err, conn.Close()) -// }() -// // ... -// } -// -// multierr provides the Invoker type and AppendInvoke function to make cases -// like the above simpler and obviate the need for a closure. The following is -// roughly equivalent to the example above. -// -// func sendRequest(req Request) (err error) { -// conn, err := openConnection() -// if err != nil { -// return err -// } -// defer multierr.AppendInvoke(&err, multierr.Close(conn)) -// // ... -// } -// -// See [AppendInvoke] and [Invoker] for more information. -// -// NOTE: If you're modifying an error from inside a defer, you MUST use a named -// return value for that function. -// -// # Advanced Usage -// -// Errors returned by Combine and Append MAY implement the following -// interface. -// -// type errorGroup interface { -// // Returns a slice containing the underlying list of errors. -// // -// // This slice MUST NOT be modified by the caller. -// Errors() []error -// } -// -// Note that if you need access to list of errors behind a multierr error, you -// should prefer using the Errors function. That said, if you need cheap -// read-only access to the underlying errors slice, you can attempt to cast -// the error to this interface. You MUST handle the failure case gracefully -// because errors returned by Combine and Append are not guaranteed to -// implement this interface. -// -// var errors []error -// group, ok := err.(errorGroup) -// if ok { -// errors = group.Errors() -// } else { -// errors = []error{err} -// } -package multierr // import "go.uber.org/multierr" - -import ( - "bytes" - "errors" - "fmt" - "io" - "strings" - "sync" - "sync/atomic" -) - -var ( - // Separator for single-line error messages. - _singlelineSeparator = []byte("; ") - - // Prefix for multi-line messages - _multilinePrefix = []byte("the following errors occurred:") - - // Prefix for the first and following lines of an item in a list of - // multi-line error messages. - // - // For example, if a single item is: - // - // foo - // bar - // - // It will become, - // - // - foo - // bar - _multilineSeparator = []byte("\n - ") - _multilineIndent = []byte(" ") -) - -// _bufferPool is a pool of bytes.Buffers. -var _bufferPool = sync.Pool{ - New: func() interface{} { - return &bytes.Buffer{} - }, -} - -type errorGroup interface { - Errors() []error -} - -// Errors returns a slice containing zero or more errors that the supplied -// error is composed of. If the error is nil, a nil slice is returned. -// -// err := multierr.Append(r.Close(), w.Close()) -// errors := multierr.Errors(err) -// -// If the error is not composed of other errors, the returned slice contains -// just the error that was passed in. -// -// Callers of this function are free to modify the returned slice. -func Errors(err error) []error { - return extractErrors(err) -} - -// multiError is an error that holds one or more errors. -// -// An instance of this is guaranteed to be non-empty and flattened. That is, -// none of the errors inside multiError are other multiErrors. -// -// multiError formats to a semi-colon delimited list of error messages with -// %v and with a more readable multi-line format with %+v. -type multiError struct { - copyNeeded atomic.Bool - errors []error -} - -// Errors returns the list of underlying errors. -// -// This slice MUST NOT be modified. -func (merr *multiError) Errors() []error { - if merr == nil { - return nil - } - return merr.errors -} - -func (merr *multiError) Error() string { - if merr == nil { - return "" - } - - buff := _bufferPool.Get().(*bytes.Buffer) - buff.Reset() - - merr.writeSingleline(buff) - - result := buff.String() - _bufferPool.Put(buff) - return result -} - -// Every compares every error in the given err against the given target error -// using [errors.Is], and returns true only if every comparison returned true. -func Every(err error, target error) bool { - for _, e := range extractErrors(err) { - if !errors.Is(e, target) { - return false - } - } - return true -} - -func (merr *multiError) Format(f fmt.State, c rune) { - if c == 'v' && f.Flag('+') { - merr.writeMultiline(f) - } else { - merr.writeSingleline(f) - } -} - -func (merr *multiError) writeSingleline(w io.Writer) { - first := true - for _, item := range merr.errors { - if first { - first = false - } else { - w.Write(_singlelineSeparator) - } - io.WriteString(w, item.Error()) - } -} - -func (merr *multiError) writeMultiline(w io.Writer) { - w.Write(_multilinePrefix) - for _, item := range merr.errors { - w.Write(_multilineSeparator) - writePrefixLine(w, _multilineIndent, fmt.Sprintf("%+v", item)) - } -} - -// Writes s to the writer with the given prefix added before each line after -// the first. -func writePrefixLine(w io.Writer, prefix []byte, s string) { - first := true - for len(s) > 0 { - if first { - first = false - } else { - w.Write(prefix) - } - - idx := strings.IndexByte(s, '\n') - if idx < 0 { - idx = len(s) - 1 - } - - io.WriteString(w, s[:idx+1]) - s = s[idx+1:] - } -} - -type inspectResult struct { - // Number of top-level non-nil errors - Count int - - // Total number of errors including multiErrors - Capacity int - - // Index of the first non-nil error in the list. Value is meaningless if - // Count is zero. - FirstErrorIdx int - - // Whether the list contains at least one multiError - ContainsMultiError bool -} - -// Inspects the given slice of errors so that we can efficiently allocate -// space for it. -func inspect(errors []error) (res inspectResult) { - first := true - for i, err := range errors { - if err == nil { - continue - } - - res.Count++ - if first { - first = false - res.FirstErrorIdx = i - } - - if merr, ok := err.(*multiError); ok { - res.Capacity += len(merr.errors) - res.ContainsMultiError = true - } else { - res.Capacity++ - } - } - return -} - -// fromSlice converts the given list of errors into a single error. -func fromSlice(errors []error) error { - // Don't pay to inspect small slices. - switch len(errors) { - case 0: - return nil - case 1: - return errors[0] - } - - res := inspect(errors) - switch res.Count { - case 0: - return nil - case 1: - // only one non-nil entry - return errors[res.FirstErrorIdx] - case len(errors): - if !res.ContainsMultiError { - // Error list is flat. Make a copy of it - // Otherwise "errors" escapes to the heap - // unconditionally for all other cases. - // This lets us optimize for the "no errors" case. - out := append(([]error)(nil), errors...) - return &multiError{errors: out} - } - } - - nonNilErrs := make([]error, 0, res.Capacity) - for _, err := range errors[res.FirstErrorIdx:] { - if err == nil { - continue - } - - if nested, ok := err.(*multiError); ok { - nonNilErrs = append(nonNilErrs, nested.errors...) - } else { - nonNilErrs = append(nonNilErrs, err) - } - } - - return &multiError{errors: nonNilErrs} -} - -// Combine combines the passed errors into a single error. -// -// If zero arguments were passed or if all items are nil, a nil error is -// returned. -// -// Combine(nil, nil) // == nil -// -// If only a single error was passed, it is returned as-is. -// -// Combine(err) // == err -// -// Combine skips over nil arguments so this function may be used to combine -// together errors from operations that fail independently of each other. -// -// multierr.Combine( -// reader.Close(), -// writer.Close(), -// pipe.Close(), -// ) -// -// If any of the passed errors is a multierr error, it will be flattened along -// with the other errors. -// -// multierr.Combine(multierr.Combine(err1, err2), err3) -// // is the same as -// multierr.Combine(err1, err2, err3) -// -// The returned error formats into a readable multi-line error message if -// formatted with %+v. -// -// fmt.Sprintf("%+v", multierr.Combine(err1, err2)) -func Combine(errors ...error) error { - return fromSlice(errors) -} - -// Append appends the given errors together. Either value may be nil. -// -// This function is a specialization of Combine for the common case where -// there are only two errors. -// -// err = multierr.Append(reader.Close(), writer.Close()) -// -// The following pattern may also be used to record failure of deferred -// operations without losing information about the original error. -// -// func doSomething(..) (err error) { -// f := acquireResource() -// defer func() { -// err = multierr.Append(err, f.Close()) -// }() -// -// Note that the variable MUST be a named return to append an error to it from -// the defer statement. See also [AppendInvoke]. -func Append(left error, right error) error { - switch { - case left == nil: - return right - case right == nil: - return left - } - - if _, ok := right.(*multiError); !ok { - if l, ok := left.(*multiError); ok && !l.copyNeeded.Swap(true) { - // Common case where the error on the left is constantly being - // appended to. - errs := append(l.errors, right) - return &multiError{errors: errs} - } else if !ok { - // Both errors are single errors. - return &multiError{errors: []error{left, right}} - } - } - - // Either right or both, left and right, are multiErrors. Rely on usual - // expensive logic. - errors := [2]error{left, right} - return fromSlice(errors[0:]) -} - -// AppendInto appends an error into the destination of an error pointer and -// returns whether the error being appended was non-nil. -// -// var err error -// multierr.AppendInto(&err, r.Close()) -// multierr.AppendInto(&err, w.Close()) -// -// The above is equivalent to, -// -// err := multierr.Append(r.Close(), w.Close()) -// -// As AppendInto reports whether the provided error was non-nil, it may be -// used to build a multierr error in a loop more ergonomically. For example: -// -// var err error -// for line := range lines { -// var item Item -// if multierr.AppendInto(&err, parse(line, &item)) { -// continue -// } -// items = append(items, item) -// } -// -// Compare this with a version that relies solely on Append: -// -// var err error -// for line := range lines { -// var item Item -// if parseErr := parse(line, &item); parseErr != nil { -// err = multierr.Append(err, parseErr) -// continue -// } -// items = append(items, item) -// } -func AppendInto(into *error, err error) (errored bool) { - if into == nil { - // We panic if 'into' is nil. This is not documented above - // because suggesting that the pointer must be non-nil may - // confuse users into thinking that the error that it points - // to must be non-nil. - panic("misuse of multierr.AppendInto: into pointer must not be nil") - } - - if err == nil { - return false - } - *into = Append(*into, err) - return true -} - -// Invoker is an operation that may fail with an error. Use it with -// AppendInvoke to append the result of calling the function into an error. -// This allows you to conveniently defer capture of failing operations. -// -// See also, [Close] and [Invoke]. -type Invoker interface { - Invoke() error -} - -// Invoke wraps a function which may fail with an error to match the Invoker -// interface. Use it to supply functions matching this signature to -// AppendInvoke. -// -// For example, -// -// func processReader(r io.Reader) (err error) { -// scanner := bufio.NewScanner(r) -// defer multierr.AppendInvoke(&err, multierr.Invoke(scanner.Err)) -// for scanner.Scan() { -// // ... -// } -// // ... -// } -// -// In this example, the following line will construct the Invoker right away, -// but defer the invocation of scanner.Err() until the function returns. -// -// defer multierr.AppendInvoke(&err, multierr.Invoke(scanner.Err)) -// -// Note that the error you're appending to from the defer statement MUST be a -// named return. -type Invoke func() error - -// Invoke calls the supplied function and returns its result. -func (i Invoke) Invoke() error { return i() } - -// Close builds an Invoker that closes the provided io.Closer. Use it with -// AppendInvoke to close io.Closers and append their results into an error. -// -// For example, -// -// func processFile(path string) (err error) { -// f, err := os.Open(path) -// if err != nil { -// return err -// } -// defer multierr.AppendInvoke(&err, multierr.Close(f)) -// return processReader(f) -// } -// -// In this example, multierr.Close will construct the Invoker right away, but -// defer the invocation of f.Close until the function returns. -// -// defer multierr.AppendInvoke(&err, multierr.Close(f)) -// -// Note that the error you're appending to from the defer statement MUST be a -// named return. -func Close(closer io.Closer) Invoker { - return Invoke(closer.Close) -} - -// AppendInvoke appends the result of calling the given Invoker into the -// provided error pointer. Use it with named returns to safely defer -// invocation of fallible operations until a function returns, and capture the -// resulting errors. -// -// func doSomething(...) (err error) { -// // ... -// f, err := openFile(..) -// if err != nil { -// return err -// } -// -// // multierr will call f.Close() when this function returns and -// // if the operation fails, its append its error into the -// // returned error. -// defer multierr.AppendInvoke(&err, multierr.Close(f)) -// -// scanner := bufio.NewScanner(f) -// // Similarly, this scheduled scanner.Err to be called and -// // inspected when the function returns and append its error -// // into the returned error. -// defer multierr.AppendInvoke(&err, multierr.Invoke(scanner.Err)) -// -// // ... -// } -// -// NOTE: If used with a defer, the error variable MUST be a named return. -// -// Without defer, AppendInvoke behaves exactly like AppendInto. -// -// err := // ... -// multierr.AppendInvoke(&err, mutltierr.Invoke(foo)) -// -// // ...is roughly equivalent to... -// -// err := // ... -// multierr.AppendInto(&err, foo()) -// -// The advantage of the indirection introduced by Invoker is to make it easy -// to defer the invocation of a function. Without this indirection, the -// invoked function will be evaluated at the time of the defer block rather -// than when the function returns. -// -// // BAD: This is likely not what the caller intended. This will evaluate -// // foo() right away and append its result into the error when the -// // function returns. -// defer multierr.AppendInto(&err, foo()) -// -// // GOOD: This will defer invocation of foo unutil the function returns. -// defer multierr.AppendInvoke(&err, multierr.Invoke(foo)) -// -// multierr provides a few Invoker implementations out of the box for -// convenience. See [Invoker] for more information. -func AppendInvoke(into *error, invoker Invoker) { - AppendInto(into, invoker.Invoke()) -} - -// AppendFunc is a shorthand for [AppendInvoke]. -// It allows using function or method value directly -// without having to wrap it into an [Invoker] interface. -// -// func doSomething(...) (err error) { -// w, err := startWorker(...) -// if err != nil { -// return err -// } -// -// // multierr will call w.Stop() when this function returns and -// // if the operation fails, it appends its error into the -// // returned error. -// defer multierr.AppendFunc(&err, w.Stop) -// } -func AppendFunc(into *error, fn func() error) { - AppendInvoke(into, Invoke(fn)) -} diff --git a/e2e/vendor/go.uber.org/multierr/error_post_go120.go b/e2e/vendor/go.uber.org/multierr/error_post_go120.go deleted file mode 100644 index a173f9c25..000000000 --- a/e2e/vendor/go.uber.org/multierr/error_post_go120.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2017-2023 Uber Technologies, Inc. -// -// 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. - -//go:build go1.20 -// +build go1.20 - -package multierr - -// Unwrap returns a list of errors wrapped by this multierr. -func (merr *multiError) Unwrap() []error { - return merr.Errors() -} - -type multipleErrors interface { - Unwrap() []error -} - -func extractErrors(err error) []error { - if err == nil { - return nil - } - - // check if the given err is an Unwrapable error that - // implements multipleErrors interface. - eg, ok := err.(multipleErrors) - if !ok { - return []error{err} - } - - return append(([]error)(nil), eg.Unwrap()...) -} diff --git a/e2e/vendor/go.uber.org/multierr/error_pre_go120.go b/e2e/vendor/go.uber.org/multierr/error_pre_go120.go deleted file mode 100644 index 93872a3fc..000000000 --- a/e2e/vendor/go.uber.org/multierr/error_pre_go120.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) 2017-2023 Uber Technologies, Inc. -// -// 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. - -//go:build !go1.20 -// +build !go1.20 - -package multierr - -import "errors" - -// Versions of Go before 1.20 did not support the Unwrap() []error method. -// This provides a similar behavior by implementing the Is(..) and As(..) -// methods. -// See the errors.Join proposal for details: -// https://github.com/golang/go/issues/53435 - -// As attempts to find the first error in the error list that matches the type -// of the value that target points to. -// -// This function allows errors.As to traverse the values stored on the -// multierr error. -func (merr *multiError) As(target interface{}) bool { - for _, err := range merr.Errors() { - if errors.As(err, target) { - return true - } - } - return false -} - -// Is attempts to match the provided error against errors in the error list. -// -// This function allows errors.Is to traverse the values stored on the -// multierr error. -func (merr *multiError) Is(target error) bool { - for _, err := range merr.Errors() { - if errors.Is(err, target) { - return true - } - } - return false -} - -func extractErrors(err error) []error { - if err == nil { - return nil - } - - // Note that we're casting to multiError, not errorGroup. Our contract is - // that returned errors MAY implement errorGroup. Errors, however, only - // has special behavior for multierr-specific error objects. - // - // This behavior can be expanded in the future but I think it's prudent to - // start with as little as possible in terms of contract and possibility - // of misuse. - eg, ok := err.(*multiError) - if !ok { - return []error{err} - } - - return append(([]error)(nil), eg.Errors()...) -} diff --git a/e2e/vendor/go.uber.org/zap/.codecov.yml b/e2e/vendor/go.uber.org/zap/.codecov.yml deleted file mode 100644 index 8e5ca7d3e..000000000 --- a/e2e/vendor/go.uber.org/zap/.codecov.yml +++ /dev/null @@ -1,17 +0,0 @@ -coverage: - range: 80..100 - round: down - precision: 2 - - status: - project: # measuring the overall project coverage - default: # context, you can create multiple ones with custom titles - enabled: yes # must be yes|true to enable this status - target: 95% # specify the target coverage for each commit status - # option: "auto" (must increase from parent commit or pull request base) - # option: "X%" a static target percentage to hit - if_not_found: success # if parent is not found report status as success, error, or failure - if_ci_failed: error # if ci fails report status as success, error, or failure -ignore: - - internal/readme/readme.go - diff --git a/e2e/vendor/go.uber.org/zap/.gitignore b/e2e/vendor/go.uber.org/zap/.gitignore deleted file mode 100644 index da9d9d00b..000000000 --- a/e2e/vendor/go.uber.org/zap/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test -vendor - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof -*.pprof -*.out -*.log - -/bin -cover.out -cover.html diff --git a/e2e/vendor/go.uber.org/zap/.golangci.yml b/e2e/vendor/go.uber.org/zap/.golangci.yml deleted file mode 100644 index 2346df135..000000000 --- a/e2e/vendor/go.uber.org/zap/.golangci.yml +++ /dev/null @@ -1,77 +0,0 @@ -output: - # Make output more digestible with quickfix in vim/emacs/etc. - sort-results: true - print-issued-lines: false - -linters: - # We'll track the golangci-lint default linters manually - # instead of letting them change without our control. - disable-all: true - enable: - # golangci-lint defaults: - - errcheck - - gosimple - - govet - - ineffassign - - staticcheck - - unused - - # Our own extras: - - gofumpt - - nolintlint # lints nolint directives - - revive - -linters-settings: - govet: - # These govet checks are disabled by default, but they're useful. - enable: - - niliness - - reflectvaluecompare - - sortslice - - unusedwrite - - errcheck: - exclude-functions: - # These methods can not fail. - # They operate on an in-memory buffer. - - (*go.uber.org/zap/buffer.Buffer).Write - - (*go.uber.org/zap/buffer.Buffer).WriteByte - - (*go.uber.org/zap/buffer.Buffer).WriteString - - - (*go.uber.org/zap/zapio.Writer).Close - - (*go.uber.org/zap/zapio.Writer).Sync - - (*go.uber.org/zap/zapio.Writer).Write - # Write to zapio.Writer cannot fail, - # so io.WriteString on it cannot fail. - - io.WriteString(*go.uber.org/zap/zapio.Writer) - - # Writing a plain string to a fmt.State cannot fail. - - io.WriteString(fmt.State) - -issues: - # Print all issues reported by all linters. - max-issues-per-linter: 0 - max-same-issues: 0 - - # Don't ignore some of the issues that golangci-lint considers okay. - # This includes documenting all exported entities. - exclude-use-default: false - - exclude-rules: - # Don't warn on unused parameters. - # Parameter names are useful; replacing them with '_' is undesirable. - - linters: [revive] - text: 'unused-parameter: parameter \S+ seems to be unused, consider removing or renaming it as _' - - # staticcheck already has smarter checks for empty blocks. - # revive's empty-block linter has false positives. - # For example, as of writing this, the following is not allowed. - # for foo() { } - - linters: [revive] - text: 'empty-block: this block is empty, you can remove it' - - # Ignore logger.Sync() errcheck failures in example_test.go - # since those are intended to be uncomplicated examples. - - linters: [errcheck] - path: example_test.go - text: 'Error return value of `logger.Sync` is not checked' diff --git a/e2e/vendor/go.uber.org/zap/.readme.tmpl b/e2e/vendor/go.uber.org/zap/.readme.tmpl deleted file mode 100644 index 4fea3027a..000000000 --- a/e2e/vendor/go.uber.org/zap/.readme.tmpl +++ /dev/null @@ -1,117 +0,0 @@ -# :zap: zap [![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov] - -
- -Blazing fast, structured, leveled logging in Go. - -![Zap logo](assets/logo.png) - -[![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov] - -
- -## Installation - -`go get -u go.uber.org/zap` - -Note that zap only supports the two most recent minor versions of Go. - -## Quick Start - -In contexts where performance is nice, but not critical, use the -`SugaredLogger`. It's 4-10x faster than other structured logging -packages and includes both structured and `printf`-style APIs. - -```go -logger, _ := zap.NewProduction() -defer logger.Sync() // flushes buffer, if any -sugar := logger.Sugar() -sugar.Infow("failed to fetch URL", - // Structured context as loosely typed key-value pairs. - "url", url, - "attempt", 3, - "backoff", time.Second, -) -sugar.Infof("Failed to fetch URL: %s", url) -``` - -When performance and type safety are critical, use the `Logger`. It's even -faster than the `SugaredLogger` and allocates far less, but it only supports -structured logging. - -```go -logger, _ := zap.NewProduction() -defer logger.Sync() -logger.Info("failed to fetch URL", - // Structured context as strongly typed Field values. - zap.String("url", url), - zap.Int("attempt", 3), - zap.Duration("backoff", time.Second), -) -``` - -See the [documentation][doc] and [FAQ](FAQ.md) for more details. - -## Performance - -For applications that log in the hot path, reflection-based serialization and -string formatting are prohibitively expensive — they're CPU-intensive -and make many small allocations. Put differently, using `encoding/json` and -`fmt.Fprintf` to log tons of `interface{}`s makes your application slow. - -Zap takes a different approach. It includes a reflection-free, zero-allocation -JSON encoder, and the base `Logger` strives to avoid serialization overhead -and allocations wherever possible. By building the high-level `SugaredLogger` -on that foundation, zap lets users *choose* when they need to count every -allocation and when they'd prefer a more familiar, loosely typed API. - -As measured by its own [benchmarking suite][], not only is zap more performant -than comparable structured logging packages — it's also faster than the -standard library. Like all benchmarks, take these with a grain of salt.[1](#footnote-versions) - -Log a message and 10 fields: - -{{.BenchmarkAddingFields}} - -Log a message with a logger that already has 10 fields of context: - -{{.BenchmarkAccumulatedContext}} - -Log a static string, without any context or `printf`-style templating: - -{{.BenchmarkWithoutFields}} - -## Development Status: Stable - -All APIs are finalized, and no breaking changes will be made in the 1.x series -of releases. Users of semver-aware dependency management systems should pin -zap to `^1`. - -## Contributing - -We encourage and support an active, healthy community of contributors — -including you! Details are in the [contribution guide](CONTRIBUTING.md) and -the [code of conduct](CODE_OF_CONDUCT.md). The zap maintainers keep an eye on -issues and pull requests, but you can also report any negative conduct to -oss-conduct@uber.com. That email list is a private, safe space; even the zap -maintainers don't have access, so don't hesitate to hold us to a high -standard. - -
- -Released under the [MIT License](LICENSE). - -1 In particular, keep in mind that we may be -benchmarking against slightly older versions of other packages. Versions are -pinned in the [benchmarks/go.mod][] file. [↩](#anchor-versions) - -[doc-img]: https://pkg.go.dev/badge/go.uber.org/zap -[doc]: https://pkg.go.dev/go.uber.org/zap -[ci-img]: https://github.com/uber-go/zap/actions/workflows/go.yml/badge.svg -[ci]: https://github.com/uber-go/zap/actions/workflows/go.yml -[cov-img]: https://codecov.io/gh/uber-go/zap/branch/master/graph/badge.svg -[cov]: https://codecov.io/gh/uber-go/zap -[benchmarking suite]: https://github.com/uber-go/zap/tree/master/benchmarks -[benchmarks/go.mod]: https://github.com/uber-go/zap/blob/master/benchmarks/go.mod - diff --git a/e2e/vendor/go.uber.org/zap/CHANGELOG.md b/e2e/vendor/go.uber.org/zap/CHANGELOG.md deleted file mode 100644 index 6d6cd5f4d..000000000 --- a/e2e/vendor/go.uber.org/zap/CHANGELOG.md +++ /dev/null @@ -1,687 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. - -This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## 1.27.0 (20 Feb 2024) -Enhancements: -* [#1378][]: Add `WithLazy` method for `SugaredLogger`. -* [#1399][]: zaptest: Add `NewTestingWriter` for customizing TestingWriter with more flexibility than `NewLogger`. -* [#1406][]: Add `Log`, `Logw`, `Logln` methods for `SugaredLogger`. -* [#1416][]: Add `WithPanicHook` option for testing panic logs. - -Thanks to @defval, @dimmo, @arxeiss, and @MKrupauskas for their contributions to this release. - -[#1378]: https://github.com/uber-go/zap/pull/1378 -[#1399]: https://github.com/uber-go/zap/pull/1399 -[#1406]: https://github.com/uber-go/zap/pull/1406 -[#1416]: https://github.com/uber-go/zap/pull/1416 - -## 1.26.0 (14 Sep 2023) -Enhancements: -* [#1297][]: Add Dict as a Field. -* [#1319][]: Add `WithLazy` method to `Logger` which lazily evaluates the structured -context. -* [#1350][]: String encoding is much (~50%) faster now. - -Thanks to @hhk7734, @jquirke, and @cdvr1993 for their contributions to this release. - -[#1297]: https://github.com/uber-go/zap/pull/1297 -[#1319]: https://github.com/uber-go/zap/pull/1319 -[#1350]: https://github.com/uber-go/zap/pull/1350 - -## 1.25.0 (1 Aug 2023) - -This release contains several improvements including performance, API additions, -and two new experimental packages whose APIs are unstable and may change in the -future. - -Enhancements: -* [#1246][]: Add `zap/exp/zapslog` package for integration with slog. -* [#1273][]: Add `Name` to `Logger` which returns the Logger's name if one is set. -* [#1281][]: Add `zap/exp/expfield` package which contains helper methods -`Str` and `Strs` for constructing String-like zap.Fields. -* [#1310][]: Reduce stack size on `Any`. - -Thanks to @knight42, @dzakaammar, @bcspragu, and @rexywork for their contributions -to this release. - -[#1246]: https://github.com/uber-go/zap/pull/1246 -[#1273]: https://github.com/uber-go/zap/pull/1273 -[#1281]: https://github.com/uber-go/zap/pull/1281 -[#1310]: https://github.com/uber-go/zap/pull/1310 - -## 1.24.0 (30 Nov 2022) - -Enhancements: -* [#1148][]: Add `Level` to both `Logger` and `SugaredLogger` that reports the - current minimum enabled log level. -* [#1185][]: `SugaredLogger` turns errors to zap.Error automatically. - -Thanks to @Abirdcfly, @craigpastro, @nnnkkk7, and @sashamelentyev for their -contributions to this release. - -[#1148]: https://github.coml/uber-go/zap/pull/1148 -[#1185]: https://github.coml/uber-go/zap/pull/1185 - -## 1.23.0 (24 Aug 2022) - -Enhancements: -* [#1147][]: Add a `zapcore.LevelOf` function to determine the level of a - `LevelEnabler` or `Core`. -* [#1155][]: Add `zap.Stringers` field constructor to log arrays of objects - that implement `String() string`. - -[#1147]: https://github.com/uber-go/zap/pull/1147 -[#1155]: https://github.com/uber-go/zap/pull/1155 - -## 1.22.0 (8 Aug 2022) - -Enhancements: -* [#1071][]: Add `zap.Objects` and `zap.ObjectValues` field constructors to log - arrays of objects. With these two constructors, you don't need to implement - `zapcore.ArrayMarshaler` for use with `zap.Array` if those objects implement - `zapcore.ObjectMarshaler`. -* [#1079][]: Add `SugaredLogger.WithOptions` to build a copy of an existing - `SugaredLogger` with the provided options applied. -* [#1080][]: Add `*ln` variants to `SugaredLogger` for each log level. - These functions provide a string joining behavior similar to `fmt.Println`. -* [#1088][]: Add `zap.WithFatalHook` option to control the behavior of the - logger for `Fatal`-level log entries. This defaults to exiting the program. -* [#1108][]: Add a `zap.Must` function that you can use with `NewProduction` or - `NewDevelopment` to panic if the system was unable to build the logger. -* [#1118][]: Add a `Logger.Log` method that allows specifying the log level for - a statement dynamically. - -Thanks to @cardil, @craigpastro, @sashamelentyev, @shota3506, and @zhupeijun -for their contributions to this release. - -[#1071]: https://github.com/uber-go/zap/pull/1071 -[#1079]: https://github.com/uber-go/zap/pull/1079 -[#1080]: https://github.com/uber-go/zap/pull/1080 -[#1088]: https://github.com/uber-go/zap/pull/1088 -[#1108]: https://github.com/uber-go/zap/pull/1108 -[#1118]: https://github.com/uber-go/zap/pull/1118 - -## 1.21.0 (7 Feb 2022) - -Enhancements: -* [#1047][]: Add `zapcore.ParseLevel` to parse a `Level` from a string. -* [#1048][]: Add `zap.ParseAtomicLevel` to parse an `AtomicLevel` from a - string. - -Bugfixes: -* [#1058][]: Fix panic in JSON encoder when `EncodeLevel` is unset. - -Other changes: -* [#1052][]: Improve encoding performance when the `AddCaller` and - `AddStacktrace` options are used together. - -[#1047]: https://github.com/uber-go/zap/pull/1047 -[#1048]: https://github.com/uber-go/zap/pull/1048 -[#1052]: https://github.com/uber-go/zap/pull/1052 -[#1058]: https://github.com/uber-go/zap/pull/1058 - -Thanks to @aerosol and @Techassi for their contributions to this release. - -## 1.20.0 (4 Jan 2022) - -Enhancements: -* [#989][]: Add `EncoderConfig.SkipLineEnding` flag to disable adding newline - characters between log statements. -* [#1039][]: Add `EncoderConfig.NewReflectedEncoder` field to customize JSON - encoding of reflected log fields. - -Bugfixes: -* [#1011][]: Fix inaccurate precision when encoding complex64 as JSON. -* [#554][], [#1017][]: Close JSON namespaces opened in `MarshalLogObject` - methods when the methods return. -* [#1033][]: Avoid panicking in Sampler core if `thereafter` is zero. - -Other changes: -* [#1028][]: Drop support for Go < 1.15. - -[#554]: https://github.com/uber-go/zap/pull/554 -[#989]: https://github.com/uber-go/zap/pull/989 -[#1011]: https://github.com/uber-go/zap/pull/1011 -[#1017]: https://github.com/uber-go/zap/pull/1017 -[#1028]: https://github.com/uber-go/zap/pull/1028 -[#1033]: https://github.com/uber-go/zap/pull/1033 -[#1039]: https://github.com/uber-go/zap/pull/1039 - -Thanks to @psrajat, @lruggieri, @sammyrnycreal for their contributions to this release. - -## 1.19.1 (8 Sep 2021) - -Bugfixes: -* [#1001][]: JSON: Fix complex number encoding with negative imaginary part. Thanks to @hemantjadon. -* [#1003][]: JSON: Fix inaccurate precision when encoding float32. - -[#1001]: https://github.com/uber-go/zap/pull/1001 -[#1003]: https://github.com/uber-go/zap/pull/1003 - -## 1.19.0 (9 Aug 2021) - -Enhancements: -* [#975][]: Avoid panicking in Sampler core if the level is out of bounds. -* [#984][]: Reduce the size of BufferedWriteSyncer by aligning the fields - better. - -[#975]: https://github.com/uber-go/zap/pull/975 -[#984]: https://github.com/uber-go/zap/pull/984 - -Thanks to @lancoLiu and @thockin for their contributions to this release. - -## 1.18.1 (28 Jun 2021) - -Bugfixes: -* [#974][]: Fix nil dereference in logger constructed by `zap.NewNop`. - -[#974]: https://github.com/uber-go/zap/pull/974 - -## 1.18.0 (28 Jun 2021) - -Enhancements: -* [#961][]: Add `zapcore.BufferedWriteSyncer`, a new `WriteSyncer` that buffers - messages in-memory and flushes them periodically. -* [#971][]: Add `zapio.Writer` to use a Zap logger as an `io.Writer`. -* [#897][]: Add `zap.WithClock` option to control the source of time via the - new `zapcore.Clock` interface. -* [#949][]: Avoid panicking in `zap.SugaredLogger` when arguments of `*w` - methods don't match expectations. -* [#943][]: Add support for filtering by level or arbitrary matcher function to - `zaptest/observer`. -* [#691][]: Comply with `io.StringWriter` and `io.ByteWriter` in Zap's - `buffer.Buffer`. - -Thanks to @atrn0, @ernado, @heyanfu, @hnlq715, @zchee -for their contributions to this release. - -[#691]: https://github.com/uber-go/zap/pull/691 -[#897]: https://github.com/uber-go/zap/pull/897 -[#943]: https://github.com/uber-go/zap/pull/943 -[#949]: https://github.com/uber-go/zap/pull/949 -[#961]: https://github.com/uber-go/zap/pull/961 -[#971]: https://github.com/uber-go/zap/pull/971 - -## 1.17.0 (25 May 2021) - -Bugfixes: -* [#867][]: Encode `` for nil `error` instead of a panic. -* [#931][], [#936][]: Update minimum version constraints to address - vulnerabilities in dependencies. - -Enhancements: -* [#865][]: Improve alignment of fields of the Logger struct, reducing its - size from 96 to 80 bytes. -* [#881][]: Support `grpclog.LoggerV2` in zapgrpc. -* [#903][]: Support URL-encoded POST requests to the AtomicLevel HTTP handler - with the `application/x-www-form-urlencoded` content type. -* [#912][]: Support multi-field encoding with `zap.Inline`. -* [#913][]: Speed up SugaredLogger for calls with a single string. -* [#928][]: Add support for filtering by field name to `zaptest/observer`. - -Thanks to @ash2k, @FMLS, @jimmystewpot, @Oncilla, @tsoslow, @tylitianrui, @withshubh, and @wziww for their contributions to this release. - -[#865]: https://github.com/uber-go/zap/pull/865 -[#867]: https://github.com/uber-go/zap/pull/867 -[#881]: https://github.com/uber-go/zap/pull/881 -[#903]: https://github.com/uber-go/zap/pull/903 -[#912]: https://github.com/uber-go/zap/pull/912 -[#913]: https://github.com/uber-go/zap/pull/913 -[#928]: https://github.com/uber-go/zap/pull/928 -[#931]: https://github.com/uber-go/zap/pull/931 -[#936]: https://github.com/uber-go/zap/pull/936 - -## 1.16.0 (1 Sep 2020) - -Bugfixes: -* [#828][]: Fix missing newline in IncreaseLevel error messages. -* [#835][]: Fix panic in JSON encoder when encoding times or durations - without specifying a time or duration encoder. -* [#843][]: Honor CallerSkip when taking stack traces. -* [#862][]: Fix the default file permissions to use `0666` and rely on the umask instead. -* [#854][]: Encode `` for nil `Stringer` instead of a panic error log. - -Enhancements: -* [#629][]: Added `zapcore.TimeEncoderOfLayout` to easily create time encoders - for custom layouts. -* [#697][]: Added support for a configurable delimiter in the console encoder. -* [#852][]: Optimize console encoder by pooling the underlying JSON encoder. -* [#844][]: Add ability to include the calling function as part of logs. -* [#843][]: Add `StackSkip` for including truncated stacks as a field. -* [#861][]: Add options to customize Fatal behaviour for better testability. - -Thanks to @SteelPhase, @tmshn, @lixingwang, @wyxloading, @moul, @segevfiner, @andy-retailnext and @jcorbin for their contributions to this release. - -[#629]: https://github.com/uber-go/zap/pull/629 -[#697]: https://github.com/uber-go/zap/pull/697 -[#828]: https://github.com/uber-go/zap/pull/828 -[#835]: https://github.com/uber-go/zap/pull/835 -[#843]: https://github.com/uber-go/zap/pull/843 -[#844]: https://github.com/uber-go/zap/pull/844 -[#852]: https://github.com/uber-go/zap/pull/852 -[#854]: https://github.com/uber-go/zap/pull/854 -[#861]: https://github.com/uber-go/zap/pull/861 -[#862]: https://github.com/uber-go/zap/pull/862 - -## 1.15.0 (23 Apr 2020) - -Bugfixes: -* [#804][]: Fix handling of `Time` values out of `UnixNano` range. -* [#812][]: Fix `IncreaseLevel` being reset after a call to `With`. - -Enhancements: -* [#806][]: Add `WithCaller` option to supersede the `AddCaller` option. This - allows disabling annotation of log entries with caller information if - previously enabled with `AddCaller`. -* [#813][]: Deprecate `NewSampler` constructor in favor of - `NewSamplerWithOptions` which supports a `SamplerHook` option. This option - adds support for monitoring sampling decisions through a hook. - -Thanks to @danielbprice for their contributions to this release. - -[#804]: https://github.com/uber-go/zap/pull/804 -[#812]: https://github.com/uber-go/zap/pull/812 -[#806]: https://github.com/uber-go/zap/pull/806 -[#813]: https://github.com/uber-go/zap/pull/813 - -## 1.14.1 (14 Mar 2020) - -Bugfixes: -* [#791][]: Fix panic on attempting to build a logger with an invalid Config. -* [#795][]: Vendoring Zap with `go mod vendor` no longer includes Zap's - development-time dependencies. -* [#799][]: Fix issue introduced in 1.14.0 that caused invalid JSON output to - be generated for arrays of `time.Time` objects when using string-based time - formats. - -Thanks to @YashishDua for their contributions to this release. - -[#791]: https://github.com/uber-go/zap/pull/791 -[#795]: https://github.com/uber-go/zap/pull/795 -[#799]: https://github.com/uber-go/zap/pull/799 - -## 1.14.0 (20 Feb 2020) - -Enhancements: -* [#771][]: Optimize calls for disabled log levels. -* [#773][]: Add millisecond duration encoder. -* [#775][]: Add option to increase the level of a logger. -* [#786][]: Optimize time formatters using `Time.AppendFormat` where possible. - -Thanks to @caibirdme for their contributions to this release. - -[#771]: https://github.com/uber-go/zap/pull/771 -[#773]: https://github.com/uber-go/zap/pull/773 -[#775]: https://github.com/uber-go/zap/pull/775 -[#786]: https://github.com/uber-go/zap/pull/786 - -## 1.13.0 (13 Nov 2019) - -Enhancements: -* [#758][]: Add `Intp`, `Stringp`, and other similar `*p` field constructors - to log pointers to primitives with support for `nil` values. - -Thanks to @jbizzle for their contributions to this release. - -[#758]: https://github.com/uber-go/zap/pull/758 - -## 1.12.0 (29 Oct 2019) - -Enhancements: -* [#751][]: Migrate to Go modules. - -[#751]: https://github.com/uber-go/zap/pull/751 - -## 1.11.0 (21 Oct 2019) - -Enhancements: -* [#725][]: Add `zapcore.OmitKey` to omit keys in an `EncoderConfig`. -* [#736][]: Add `RFC3339` and `RFC3339Nano` time encoders. - -Thanks to @juicemia, @uhthomas for their contributions to this release. - -[#725]: https://github.com/uber-go/zap/pull/725 -[#736]: https://github.com/uber-go/zap/pull/736 - -## 1.10.0 (29 Apr 2019) - -Bugfixes: -* [#657][]: Fix `MapObjectEncoder.AppendByteString` not adding value as a - string. -* [#706][]: Fix incorrect call depth to determine caller in Go 1.12. - -Enhancements: -* [#610][]: Add `zaptest.WrapOptions` to wrap `zap.Option` for creating test - loggers. -* [#675][]: Don't panic when encoding a String field. -* [#704][]: Disable HTML escaping for JSON objects encoded using the - reflect-based encoder. - -Thanks to @iaroslav-ciupin, @lelenanam, @joa, @NWilson for their contributions -to this release. - -[#657]: https://github.com/uber-go/zap/pull/657 -[#706]: https://github.com/uber-go/zap/pull/706 -[#610]: https://github.com/uber-go/zap/pull/610 -[#675]: https://github.com/uber-go/zap/pull/675 -[#704]: https://github.com/uber-go/zap/pull/704 - -## 1.9.1 (06 Aug 2018) - -Bugfixes: - -* [#614][]: MapObjectEncoder should not ignore empty slices. - -[#614]: https://github.com/uber-go/zap/pull/614 - -## 1.9.0 (19 Jul 2018) - -Enhancements: -* [#602][]: Reduce number of allocations when logging with reflection. -* [#572][], [#606][]: Expose a registry for third-party logging sinks. - -Thanks to @nfarah86, @AlekSi, @JeanMertz, @philippgille, @etsangsplk, and -@dimroc for their contributions to this release. - -[#602]: https://github.com/uber-go/zap/pull/602 -[#572]: https://github.com/uber-go/zap/pull/572 -[#606]: https://github.com/uber-go/zap/pull/606 - -## 1.8.0 (13 Apr 2018) - -Enhancements: -* [#508][]: Make log level configurable when redirecting the standard - library's logger. -* [#518][]: Add a logger that writes to a `*testing.TB`. -* [#577][]: Add a top-level alias for `zapcore.Field` to clean up GoDoc. - -Bugfixes: -* [#574][]: Add a missing import comment to `go.uber.org/zap/buffer`. - -Thanks to @DiSiqueira and @djui for their contributions to this release. - -[#508]: https://github.com/uber-go/zap/pull/508 -[#518]: https://github.com/uber-go/zap/pull/518 -[#577]: https://github.com/uber-go/zap/pull/577 -[#574]: https://github.com/uber-go/zap/pull/574 - -## 1.7.1 (25 Sep 2017) - -Bugfixes: -* [#504][]: Store strings when using AddByteString with the map encoder. - -[#504]: https://github.com/uber-go/zap/pull/504 - -## 1.7.0 (21 Sep 2017) - -Enhancements: - -* [#487][]: Add `NewStdLogAt`, which extends `NewStdLog` by allowing the user - to specify the level of the logged messages. - -[#487]: https://github.com/uber-go/zap/pull/487 - -## 1.6.0 (30 Aug 2017) - -Enhancements: - -* [#491][]: Omit zap stack frames from stacktraces. -* [#490][]: Add a `ContextMap` method to observer logs for simpler - field validation in tests. - -[#490]: https://github.com/uber-go/zap/pull/490 -[#491]: https://github.com/uber-go/zap/pull/491 - -## 1.5.0 (22 Jul 2017) - -Enhancements: - -* [#460][] and [#470][]: Support errors produced by `go.uber.org/multierr`. -* [#465][]: Support user-supplied encoders for logger names. - -Bugfixes: - -* [#477][]: Fix a bug that incorrectly truncated deep stacktraces. - -Thanks to @richard-tunein and @pavius for their contributions to this release. - -[#477]: https://github.com/uber-go/zap/pull/477 -[#465]: https://github.com/uber-go/zap/pull/465 -[#460]: https://github.com/uber-go/zap/pull/460 -[#470]: https://github.com/uber-go/zap/pull/470 - -## 1.4.1 (08 Jun 2017) - -This release fixes two bugs. - -Bugfixes: - -* [#435][]: Support a variety of case conventions when unmarshaling levels. -* [#444][]: Fix a panic in the observer. - -[#435]: https://github.com/uber-go/zap/pull/435 -[#444]: https://github.com/uber-go/zap/pull/444 - -## 1.4.0 (12 May 2017) - -This release adds a few small features and is fully backward-compatible. - -Enhancements: - -* [#424][]: Add a `LineEnding` field to `EncoderConfig`, allowing users to - override the Unix-style default. -* [#425][]: Preserve time zones when logging times. -* [#431][]: Make `zap.AtomicLevel` implement `fmt.Stringer`, which makes a - variety of operations a bit simpler. - -[#424]: https://github.com/uber-go/zap/pull/424 -[#425]: https://github.com/uber-go/zap/pull/425 -[#431]: https://github.com/uber-go/zap/pull/431 - -## 1.3.0 (25 Apr 2017) - -This release adds an enhancement to zap's testing helpers as well as the -ability to marshal an AtomicLevel. It is fully backward-compatible. - -Enhancements: - -* [#415][]: Add a substring-filtering helper to zap's observer. This is - particularly useful when testing the `SugaredLogger`. -* [#416][]: Make `AtomicLevel` implement `encoding.TextMarshaler`. - -[#415]: https://github.com/uber-go/zap/pull/415 -[#416]: https://github.com/uber-go/zap/pull/416 - -## 1.2.0 (13 Apr 2017) - -This release adds a gRPC compatibility wrapper. It is fully backward-compatible. - -Enhancements: - -* [#402][]: Add a `zapgrpc` package that wraps zap's Logger and implements - `grpclog.Logger`. - -[#402]: https://github.com/uber-go/zap/pull/402 - -## 1.1.0 (31 Mar 2017) - -This release fixes two bugs and adds some enhancements to zap's testing helpers. -It is fully backward-compatible. - -Bugfixes: - -* [#385][]: Fix caller path trimming on Windows. -* [#396][]: Fix a panic when attempting to use non-existent directories with - zap's configuration struct. - -Enhancements: - -* [#386][]: Add filtering helpers to zaptest's observing logger. - -Thanks to @moitias for contributing to this release. - -[#385]: https://github.com/uber-go/zap/pull/385 -[#396]: https://github.com/uber-go/zap/pull/396 -[#386]: https://github.com/uber-go/zap/pull/386 - -## 1.0.0 (14 Mar 2017) - -This is zap's first stable release. All exported APIs are now final, and no -further breaking changes will be made in the 1.x release series. Anyone using a -semver-aware dependency manager should now pin to `^1`. - -Breaking changes: - -* [#366][]: Add byte-oriented APIs to encoders to log UTF-8 encoded text without - casting from `[]byte` to `string`. -* [#364][]: To support buffering outputs, add `Sync` methods to `zapcore.Core`, - `zap.Logger`, and `zap.SugaredLogger`. -* [#371][]: Rename the `testutils` package to `zaptest`, which is less likely to - clash with other testing helpers. - -Bugfixes: - -* [#362][]: Make the ISO8601 time formatters fixed-width, which is friendlier - for tab-separated console output. -* [#369][]: Remove the automatic locks in `zapcore.NewCore`, which allows zap to - work with concurrency-safe `WriteSyncer` implementations. -* [#347][]: Stop reporting errors when trying to `fsync` standard out on Linux - systems. -* [#373][]: Report the correct caller from zap's standard library - interoperability wrappers. - -Enhancements: - -* [#348][]: Add a registry allowing third-party encodings to work with zap's - built-in `Config`. -* [#327][]: Make the representation of logger callers configurable (like times, - levels, and durations). -* [#376][]: Allow third-party encoders to use their own buffer pools, which - removes the last performance advantage that zap's encoders have over plugins. -* [#346][]: Add `CombineWriteSyncers`, a convenience function to tee multiple - `WriteSyncer`s and lock the result. -* [#365][]: Make zap's stacktraces compatible with mid-stack inlining (coming in - Go 1.9). -* [#372][]: Export zap's observing logger as `zaptest/observer`. This makes it - easier for particularly punctilious users to unit test their application's - logging. - -Thanks to @suyash, @htrendev, @flisky, @Ulexus, and @skipor for their -contributions to this release. - -[#366]: https://github.com/uber-go/zap/pull/366 -[#364]: https://github.com/uber-go/zap/pull/364 -[#371]: https://github.com/uber-go/zap/pull/371 -[#362]: https://github.com/uber-go/zap/pull/362 -[#369]: https://github.com/uber-go/zap/pull/369 -[#347]: https://github.com/uber-go/zap/pull/347 -[#373]: https://github.com/uber-go/zap/pull/373 -[#348]: https://github.com/uber-go/zap/pull/348 -[#327]: https://github.com/uber-go/zap/pull/327 -[#376]: https://github.com/uber-go/zap/pull/376 -[#346]: https://github.com/uber-go/zap/pull/346 -[#365]: https://github.com/uber-go/zap/pull/365 -[#372]: https://github.com/uber-go/zap/pull/372 - -## 1.0.0-rc.3 (7 Mar 2017) - -This is the third release candidate for zap's stable release. There are no -breaking changes. - -Bugfixes: - -* [#339][]: Byte slices passed to `zap.Any` are now correctly treated as binary blobs - rather than `[]uint8`. - -Enhancements: - -* [#307][]: Users can opt into colored output for log levels. -* [#353][]: In addition to hijacking the output of the standard library's - package-global logging functions, users can now construct a zap-backed - `log.Logger` instance. -* [#311][]: Frames from common runtime functions and some of zap's internal - machinery are now omitted from stacktraces. - -Thanks to @ansel1 and @suyash for their contributions to this release. - -[#339]: https://github.com/uber-go/zap/pull/339 -[#307]: https://github.com/uber-go/zap/pull/307 -[#353]: https://github.com/uber-go/zap/pull/353 -[#311]: https://github.com/uber-go/zap/pull/311 - -## 1.0.0-rc.2 (21 Feb 2017) - -This is the second release candidate for zap's stable release. It includes two -breaking changes. - -Breaking changes: - -* [#316][]: Zap's global loggers are now fully concurrency-safe - (previously, users had to ensure that `ReplaceGlobals` was called before the - loggers were in use). However, they must now be accessed via the `L()` and - `S()` functions. Users can update their projects with - - ``` - gofmt -r "zap.L -> zap.L()" -w . - gofmt -r "zap.S -> zap.S()" -w . - ``` -* [#309][] and [#317][]: RC1 was mistakenly shipped with invalid - JSON and YAML struct tags on all config structs. This release fixes the tags - and adds static analysis to prevent similar bugs in the future. - -Bugfixes: - -* [#321][]: Redirecting the standard library's `log` output now - correctly reports the logger's caller. - -Enhancements: - -* [#325][] and [#333][]: Zap now transparently supports non-standard, rich - errors like those produced by `github.com/pkg/errors`. -* [#326][]: Though `New(nil)` continues to return a no-op logger, `NewNop()` is - now preferred. Users can update their projects with `gofmt -r 'zap.New(nil) -> - zap.NewNop()' -w .`. -* [#300][]: Incorrectly importing zap as `github.com/uber-go/zap` now returns a - more informative error. - -Thanks to @skipor and @chapsuk for their contributions to this release. - -[#316]: https://github.com/uber-go/zap/pull/316 -[#309]: https://github.com/uber-go/zap/pull/309 -[#317]: https://github.com/uber-go/zap/pull/317 -[#321]: https://github.com/uber-go/zap/pull/321 -[#325]: https://github.com/uber-go/zap/pull/325 -[#333]: https://github.com/uber-go/zap/pull/333 -[#326]: https://github.com/uber-go/zap/pull/326 -[#300]: https://github.com/uber-go/zap/pull/300 - -## 1.0.0-rc.1 (14 Feb 2017) - -This is the first release candidate for zap's stable release. There are multiple -breaking changes and improvements from the pre-release version. Most notably: - -* **Zap's import path is now "go.uber.org/zap"** — all users will - need to update their code. -* User-facing types and functions remain in the `zap` package. Code relevant - largely to extension authors is now in the `zapcore` package. -* The `zapcore.Core` type makes it easy for third-party packages to use zap's - internals but provide a different user-facing API. -* `Logger` is now a concrete type instead of an interface. -* A less verbose (though slower) logging API is included by default. -* Package-global loggers `L` and `S` are included. -* A human-friendly console encoder is included. -* A declarative config struct allows common logger configurations to be managed - as configuration instead of code. -* Sampling is more accurate, and doesn't depend on the standard library's shared - timer heap. - -## 0.1.0-beta.1 (6 Feb 2017) - -This is a minor version, tagged to allow users to pin to the pre-1.0 APIs and -upgrade at their leisure. Since this is the first tagged release, there are no -backward compatibility concerns and all functionality is new. - -Early zap adopters should pin to the 0.1.x minor version until they're ready to -upgrade to the upcoming stable release. diff --git a/e2e/vendor/go.uber.org/zap/CODE_OF_CONDUCT.md b/e2e/vendor/go.uber.org/zap/CODE_OF_CONDUCT.md deleted file mode 100644 index e327d9aa5..000000000 --- a/e2e/vendor/go.uber.org/zap/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,75 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, -body size, disability, ethnicity, gender identity and expression, level of -experience, nationality, personal appearance, race, religion, or sexual -identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an -appointed representative at an online or offline event. Representation of a -project may be further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at oss-conduct@uber.com. The project -team will review and investigate all complaints, and will respond in a way -that it deems appropriate to the circumstances. The project team is obligated -to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 1.4, available at -[http://contributor-covenant.org/version/1/4][version]. - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/e2e/vendor/go.uber.org/zap/CONTRIBUTING.md b/e2e/vendor/go.uber.org/zap/CONTRIBUTING.md deleted file mode 100644 index ea02f3cae..000000000 --- a/e2e/vendor/go.uber.org/zap/CONTRIBUTING.md +++ /dev/null @@ -1,70 +0,0 @@ -# Contributing - -We'd love your help making zap the very best structured logging library in Go! - -If you'd like to add new exported APIs, please [open an issue][open-issue] -describing your proposal — discussing API changes ahead of time makes -pull request review much smoother. In your issue, pull request, and any other -communications, please remember to treat your fellow contributors with -respect! We take our [code of conduct](CODE_OF_CONDUCT.md) seriously. - -Note that you'll need to sign [Uber's Contributor License Agreement][cla] -before we can accept any of your contributions. If necessary, a bot will remind -you to accept the CLA when you open your pull request. - -## Setup - -[Fork][fork], then clone the repository: - -```bash -mkdir -p $GOPATH/src/go.uber.org -cd $GOPATH/src/go.uber.org -git clone git@github.com:your_github_username/zap.git -cd zap -git remote add upstream https://github.com/uber-go/zap.git -git fetch upstream -``` - -Make sure that the tests and the linters pass: - -```bash -make test -make lint -``` - -## Making Changes - -Start by creating a new branch for your changes: - -```bash -cd $GOPATH/src/go.uber.org/zap -git checkout master -git fetch upstream -git rebase upstream/master -git checkout -b cool_new_feature -``` - -Make your changes, then ensure that `make lint` and `make test` still pass. If -you're satisfied with your changes, push them to your fork. - -```bash -git push origin cool_new_feature -``` - -Then use the GitHub UI to open a pull request. - -At this point, you're waiting on us to review your changes. We _try_ to respond -to issues and pull requests within a few business days, and we may suggest some -improvements or alternatives. Once your changes are approved, one of the -project maintainers will merge them. - -We're much more likely to approve your changes if you: - -- Add tests for new functionality. -- Write a [good commit message][commit-message]. -- Maintain backward compatibility. - -[fork]: https://github.com/uber-go/zap/fork -[open-issue]: https://github.com/uber-go/zap/issues/new -[cla]: https://cla-assistant.io/uber-go/zap -[commit-message]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html diff --git a/e2e/vendor/go.uber.org/zap/FAQ.md b/e2e/vendor/go.uber.org/zap/FAQ.md deleted file mode 100644 index b183b20bc..000000000 --- a/e2e/vendor/go.uber.org/zap/FAQ.md +++ /dev/null @@ -1,164 +0,0 @@ -# Frequently Asked Questions - -## Design - -### Why spend so much effort on logger performance? - -Of course, most applications won't notice the impact of a slow logger: they -already take tens or hundreds of milliseconds for each operation, so an extra -millisecond doesn't matter. - -On the other hand, why *not* make structured logging fast? The `SugaredLogger` -isn't any harder to use than other logging packages, and the `Logger` makes -structured logging possible in performance-sensitive contexts. Across a fleet -of Go microservices, making each application even slightly more efficient adds -up quickly. - -### Why aren't `Logger` and `SugaredLogger` interfaces? - -Unlike the familiar `io.Writer` and `http.Handler`, `Logger` and -`SugaredLogger` interfaces would include *many* methods. As [Rob Pike points -out][go-proverbs], "The bigger the interface, the weaker the abstraction." -Interfaces are also rigid — *any* change requires releasing a new major -version, since it breaks all third-party implementations. - -Making the `Logger` and `SugaredLogger` concrete types doesn't sacrifice much -abstraction, and it lets us add methods without introducing breaking changes. -Your applications should define and depend upon an interface that includes -just the methods you use. - -### Why are some of my logs missing? - -Logs are dropped intentionally by zap when sampling is enabled. The production -configuration (as returned by `NewProductionConfig()` enables sampling which will -cause repeated logs within a second to be sampled. See more details on why sampling -is enabled in [Why sample application logs](https://github.com/uber-go/zap/blob/master/FAQ.md#why-sample-application-logs). - -### Why sample application logs? - -Applications often experience runs of errors, either because of a bug or -because of a misbehaving user. Logging errors is usually a good idea, but it -can easily make this bad situation worse: not only is your application coping -with a flood of errors, it's also spending extra CPU cycles and I/O logging -those errors. Since writes are typically serialized, logging limits throughput -when you need it most. - -Sampling fixes this problem by dropping repetitive log entries. Under normal -conditions, your application writes out every entry. When similar entries are -logged hundreds or thousands of times each second, though, zap begins dropping -duplicates to preserve throughput. - -### Why do the structured logging APIs take a message in addition to fields? - -Subjectively, we find it helpful to accompany structured context with a brief -description. This isn't critical during development, but it makes debugging -and operating unfamiliar systems much easier. - -More concretely, zap's sampling algorithm uses the message to identify -duplicate entries. In our experience, this is a practical middle ground -between random sampling (which often drops the exact entry that you need while -debugging) and hashing the complete entry (which is prohibitively expensive). - -### Why include package-global loggers? - -Since so many other logging packages include a global logger, many -applications aren't designed to accept loggers as explicit parameters. -Changing function signatures is often a breaking change, so zap includes -global loggers to simplify migration. - -Avoid them where possible. - -### Why include dedicated Panic and Fatal log levels? - -In general, application code should handle errors gracefully instead of using -`panic` or `os.Exit`. However, every rule has exceptions, and it's common to -crash when an error is truly unrecoverable. To avoid losing any information -— especially the reason for the crash — the logger must flush any -buffered entries before the process exits. - -Zap makes this easy by offering `Panic` and `Fatal` logging methods that -automatically flush before exiting. Of course, this doesn't guarantee that -logs will never be lost, but it eliminates a common error. - -See the discussion in uber-go/zap#207 for more details. - -### What's `DPanic`? - -`DPanic` stands for "panic in development." In development, it logs at -`PanicLevel`; otherwise, it logs at `ErrorLevel`. `DPanic` makes it easier to -catch errors that are theoretically possible, but shouldn't actually happen, -*without* crashing in production. - -If you've ever written code like this, you need `DPanic`: - -```go -if err != nil { - panic(fmt.Sprintf("shouldn't ever get here: %v", err)) -} -``` - -## Installation - -### What does the error `expects import "go.uber.org/zap"` mean? - -Either zap was installed incorrectly or you're referencing the wrong package -name in your code. - -Zap's source code happens to be hosted on GitHub, but the [import -path][import-path] is `go.uber.org/zap`. This gives us, the project -maintainers, the freedom to move the source code if necessary. However, it -means that you need to take a little care when installing and using the -package. - -If you follow two simple rules, everything should work: install zap with `go -get -u go.uber.org/zap`, and always import it in your code with `import -"go.uber.org/zap"`. Your code shouldn't contain *any* references to -`github.com/uber-go/zap`. - -## Usage - -### Does zap support log rotation? - -Zap doesn't natively support rotating log files, since we prefer to leave this -to an external program like `logrotate`. - -However, it's easy to integrate a log rotation package like -[`gopkg.in/natefinch/lumberjack.v2`][lumberjack] as a `zapcore.WriteSyncer`. - -```go -// lumberjack.Logger is already safe for concurrent use, so we don't need to -// lock it. -w := zapcore.AddSync(&lumberjack.Logger{ - Filename: "/var/log/myapp/foo.log", - MaxSize: 500, // megabytes - MaxBackups: 3, - MaxAge: 28, // days -}) -core := zapcore.NewCore( - zapcore.NewJSONEncoder(zap.NewProductionEncoderConfig()), - w, - zap.InfoLevel, -) -logger := zap.New(core) -``` - -## Extensions - -We'd love to support every logging need within zap itself, but we're only -familiar with a handful of log ingestion systems, flag-parsing packages, and -the like. Rather than merging code that we can't effectively debug and -support, we'd rather grow an ecosystem of zap extensions. - -We're aware of the following extensions, but haven't used them ourselves: - -| Package | Integration | -| --- | --- | -| `github.com/tchap/zapext` | Sentry, syslog | -| `github.com/fgrosse/zaptest` | Ginkgo | -| `github.com/blendle/zapdriver` | Stackdriver | -| `github.com/moul/zapgorm` | Gorm | -| `github.com/moul/zapfilter` | Advanced filtering rules | - -[go-proverbs]: https://go-proverbs.github.io/ -[import-path]: https://golang.org/cmd/go/#hdr-Remote_import_paths -[lumberjack]: https://godoc.org/gopkg.in/natefinch/lumberjack.v2 diff --git a/e2e/vendor/go.uber.org/zap/LICENSE b/e2e/vendor/go.uber.org/zap/LICENSE deleted file mode 100644 index 6652bed45..000000000 --- a/e2e/vendor/go.uber.org/zap/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2016-2017 Uber Technologies, Inc. - -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/e2e/vendor/go.uber.org/zap/Makefile b/e2e/vendor/go.uber.org/zap/Makefile deleted file mode 100644 index eb1cee53b..000000000 --- a/e2e/vendor/go.uber.org/zap/Makefile +++ /dev/null @@ -1,76 +0,0 @@ -# Directory containing the Makefile. -PROJECT_ROOT = $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) - -export GOBIN ?= $(PROJECT_ROOT)/bin -export PATH := $(GOBIN):$(PATH) - -GOVULNCHECK = $(GOBIN)/govulncheck -BENCH_FLAGS ?= -cpuprofile=cpu.pprof -memprofile=mem.pprof -benchmem - -# Directories containing independent Go modules. -MODULE_DIRS = . ./exp ./benchmarks ./zapgrpc/internal/test - -# Directories that we want to track coverage for. -COVER_DIRS = . ./exp - -.PHONY: all -all: lint test - -.PHONY: lint -lint: golangci-lint tidy-lint license-lint - -.PHONY: golangci-lint -golangci-lint: - @$(foreach mod,$(MODULE_DIRS), \ - (cd $(mod) && \ - echo "[lint] golangci-lint: $(mod)" && \ - golangci-lint run --path-prefix $(mod)) &&) true - -.PHONY: tidy -tidy: - @$(foreach dir,$(MODULE_DIRS), \ - (cd $(dir) && go mod tidy) &&) true - -.PHONY: tidy-lint -tidy-lint: - @$(foreach mod,$(MODULE_DIRS), \ - (cd $(mod) && \ - echo "[lint] tidy: $(mod)" && \ - go mod tidy && \ - git diff --exit-code -- go.mod go.sum) &&) true - - -.PHONY: license-lint -license-lint: - ./checklicense.sh - -$(GOVULNCHECK): - cd tools && go install golang.org/x/vuln/cmd/govulncheck - -.PHONY: test -test: - @$(foreach dir,$(MODULE_DIRS),(cd $(dir) && go test -race ./...) &&) true - -.PHONY: cover -cover: - @$(foreach dir,$(COVER_DIRS), ( \ - cd $(dir) && \ - go test -race -coverprofile=cover.out -coverpkg=./... ./... \ - && go tool cover -html=cover.out -o cover.html) &&) true - -.PHONY: bench -BENCH ?= . -bench: - @$(foreach dir,$(MODULE_DIRS), ( \ - cd $(dir) && \ - go list ./... | xargs -n1 go test -bench=$(BENCH) -run="^$$" $(BENCH_FLAGS) \ - ) &&) true - -.PHONY: updatereadme -updatereadme: - rm -f README.md - cat .readme.tmpl | go run internal/readme/readme.go > README.md - -.PHONY: vulncheck -vulncheck: $(GOVULNCHECK) - $(GOVULNCHECK) ./... diff --git a/e2e/vendor/go.uber.org/zap/README.md b/e2e/vendor/go.uber.org/zap/README.md deleted file mode 100644 index a17035cb6..000000000 --- a/e2e/vendor/go.uber.org/zap/README.md +++ /dev/null @@ -1,149 +0,0 @@ -# :zap: zap - - -
- -Blazing fast, structured, leveled logging in Go. - -![Zap logo](assets/logo.png) - -[![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov] - -
- -## Installation - -`go get -u go.uber.org/zap` - -Note that zap only supports the two most recent minor versions of Go. - -## Quick Start - -In contexts where performance is nice, but not critical, use the -`SugaredLogger`. It's 4-10x faster than other structured logging -packages and includes both structured and `printf`-style APIs. - -```go -logger, _ := zap.NewProduction() -defer logger.Sync() // flushes buffer, if any -sugar := logger.Sugar() -sugar.Infow("failed to fetch URL", - // Structured context as loosely typed key-value pairs. - "url", url, - "attempt", 3, - "backoff", time.Second, -) -sugar.Infof("Failed to fetch URL: %s", url) -``` - -When performance and type safety are critical, use the `Logger`. It's even -faster than the `SugaredLogger` and allocates far less, but it only supports -structured logging. - -```go -logger, _ := zap.NewProduction() -defer logger.Sync() -logger.Info("failed to fetch URL", - // Structured context as strongly typed Field values. - zap.String("url", url), - zap.Int("attempt", 3), - zap.Duration("backoff", time.Second), -) -``` - -See the [documentation][doc] and [FAQ](FAQ.md) for more details. - -## Performance - -For applications that log in the hot path, reflection-based serialization and -string formatting are prohibitively expensive — they're CPU-intensive -and make many small allocations. Put differently, using `encoding/json` and -`fmt.Fprintf` to log tons of `interface{}`s makes your application slow. - -Zap takes a different approach. It includes a reflection-free, zero-allocation -JSON encoder, and the base `Logger` strives to avoid serialization overhead -and allocations wherever possible. By building the high-level `SugaredLogger` -on that foundation, zap lets users *choose* when they need to count every -allocation and when they'd prefer a more familiar, loosely typed API. - -As measured by its own [benchmarking suite][], not only is zap more performant -than comparable structured logging packages — it's also faster than the -standard library. Like all benchmarks, take these with a grain of salt.[1](#footnote-versions) - -Log a message and 10 fields: - -| Package | Time | Time % to zap | Objects Allocated | -| :------ | :--: | :-----------: | :---------------: | -| :zap: zap | 656 ns/op | +0% | 5 allocs/op -| :zap: zap (sugared) | 935 ns/op | +43% | 10 allocs/op -| zerolog | 380 ns/op | -42% | 1 allocs/op -| go-kit | 2249 ns/op | +243% | 57 allocs/op -| slog (LogAttrs) | 2479 ns/op | +278% | 40 allocs/op -| slog | 2481 ns/op | +278% | 42 allocs/op -| apex/log | 9591 ns/op | +1362% | 63 allocs/op -| log15 | 11393 ns/op | +1637% | 75 allocs/op -| logrus | 11654 ns/op | +1677% | 79 allocs/op - -Log a message with a logger that already has 10 fields of context: - -| Package | Time | Time % to zap | Objects Allocated | -| :------ | :--: | :-----------: | :---------------: | -| :zap: zap | 67 ns/op | +0% | 0 allocs/op -| :zap: zap (sugared) | 84 ns/op | +25% | 1 allocs/op -| zerolog | 35 ns/op | -48% | 0 allocs/op -| slog | 193 ns/op | +188% | 0 allocs/op -| slog (LogAttrs) | 200 ns/op | +199% | 0 allocs/op -| go-kit | 2460 ns/op | +3572% | 56 allocs/op -| log15 | 9038 ns/op | +13390% | 70 allocs/op -| apex/log | 9068 ns/op | +13434% | 53 allocs/op -| logrus | 10521 ns/op | +15603% | 68 allocs/op - -Log a static string, without any context or `printf`-style templating: - -| Package | Time | Time % to zap | Objects Allocated | -| :------ | :--: | :-----------: | :---------------: | -| :zap: zap | 63 ns/op | +0% | 0 allocs/op -| :zap: zap (sugared) | 81 ns/op | +29% | 1 allocs/op -| zerolog | 32 ns/op | -49% | 0 allocs/op -| standard library | 124 ns/op | +97% | 1 allocs/op -| slog | 196 ns/op | +211% | 0 allocs/op -| slog (LogAttrs) | 200 ns/op | +217% | 0 allocs/op -| go-kit | 213 ns/op | +238% | 9 allocs/op -| apex/log | 771 ns/op | +1124% | 5 allocs/op -| logrus | 1439 ns/op | +2184% | 23 allocs/op -| log15 | 2069 ns/op | +3184% | 20 allocs/op - -## Development Status: Stable - -All APIs are finalized, and no breaking changes will be made in the 1.x series -of releases. Users of semver-aware dependency management systems should pin -zap to `^1`. - -## Contributing - -We encourage and support an active, healthy community of contributors — -including you! Details are in the [contribution guide](CONTRIBUTING.md) and -the [code of conduct](CODE_OF_CONDUCT.md). The zap maintainers keep an eye on -issues and pull requests, but you can also report any negative conduct to -oss-conduct@uber.com. That email list is a private, safe space; even the zap -maintainers don't have access, so don't hesitate to hold us to a high -standard. - -
- -Released under the [MIT License](LICENSE). - -1 In particular, keep in mind that we may be -benchmarking against slightly older versions of other packages. Versions are -pinned in the [benchmarks/go.mod][] file. [↩](#anchor-versions) - -[doc-img]: https://pkg.go.dev/badge/go.uber.org/zap -[doc]: https://pkg.go.dev/go.uber.org/zap -[ci-img]: https://github.com/uber-go/zap/actions/workflows/go.yml/badge.svg -[ci]: https://github.com/uber-go/zap/actions/workflows/go.yml -[cov-img]: https://codecov.io/gh/uber-go/zap/branch/master/graph/badge.svg -[cov]: https://codecov.io/gh/uber-go/zap -[benchmarking suite]: https://github.com/uber-go/zap/tree/master/benchmarks -[benchmarks/go.mod]: https://github.com/uber-go/zap/blob/master/benchmarks/go.mod - diff --git a/e2e/vendor/go.uber.org/zap/array.go b/e2e/vendor/go.uber.org/zap/array.go deleted file mode 100644 index abfccb566..000000000 --- a/e2e/vendor/go.uber.org/zap/array.go +++ /dev/null @@ -1,447 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zap - -import ( - "fmt" - "time" - - "go.uber.org/zap/zapcore" -) - -// Array constructs a field with the given key and ArrayMarshaler. It provides -// a flexible, but still type-safe and efficient, way to add array-like types -// to the logging context. The struct's MarshalLogArray method is called lazily. -func Array(key string, val zapcore.ArrayMarshaler) Field { - return Field{Key: key, Type: zapcore.ArrayMarshalerType, Interface: val} -} - -// Bools constructs a field that carries a slice of bools. -func Bools(key string, bs []bool) Field { - return Array(key, bools(bs)) -} - -// ByteStrings constructs a field that carries a slice of []byte, each of which -// must be UTF-8 encoded text. -func ByteStrings(key string, bss [][]byte) Field { - return Array(key, byteStringsArray(bss)) -} - -// Complex128s constructs a field that carries a slice of complex numbers. -func Complex128s(key string, nums []complex128) Field { - return Array(key, complex128s(nums)) -} - -// Complex64s constructs a field that carries a slice of complex numbers. -func Complex64s(key string, nums []complex64) Field { - return Array(key, complex64s(nums)) -} - -// Durations constructs a field that carries a slice of time.Durations. -func Durations(key string, ds []time.Duration) Field { - return Array(key, durations(ds)) -} - -// Float64s constructs a field that carries a slice of floats. -func Float64s(key string, nums []float64) Field { - return Array(key, float64s(nums)) -} - -// Float32s constructs a field that carries a slice of floats. -func Float32s(key string, nums []float32) Field { - return Array(key, float32s(nums)) -} - -// Ints constructs a field that carries a slice of integers. -func Ints(key string, nums []int) Field { - return Array(key, ints(nums)) -} - -// Int64s constructs a field that carries a slice of integers. -func Int64s(key string, nums []int64) Field { - return Array(key, int64s(nums)) -} - -// Int32s constructs a field that carries a slice of integers. -func Int32s(key string, nums []int32) Field { - return Array(key, int32s(nums)) -} - -// Int16s constructs a field that carries a slice of integers. -func Int16s(key string, nums []int16) Field { - return Array(key, int16s(nums)) -} - -// Int8s constructs a field that carries a slice of integers. -func Int8s(key string, nums []int8) Field { - return Array(key, int8s(nums)) -} - -// Objects constructs a field with the given key, holding a list of the -// provided objects that can be marshaled by Zap. -// -// Note that these objects must implement zapcore.ObjectMarshaler directly. -// That is, if you're trying to marshal a []Request, the MarshalLogObject -// method must be declared on the Request type, not its pointer (*Request). -// If it's on the pointer, use ObjectValues. -// -// Given an object that implements MarshalLogObject on the value receiver, you -// can log a slice of those objects with Objects like so: -// -// type Author struct{ ... } -// func (a Author) MarshalLogObject(enc zapcore.ObjectEncoder) error -// -// var authors []Author = ... -// logger.Info("loading article", zap.Objects("authors", authors)) -// -// Similarly, given a type that implements MarshalLogObject on its pointer -// receiver, you can log a slice of pointers to that object with Objects like -// so: -// -// type Request struct{ ... } -// func (r *Request) MarshalLogObject(enc zapcore.ObjectEncoder) error -// -// var requests []*Request = ... -// logger.Info("sending requests", zap.Objects("requests", requests)) -// -// If instead, you have a slice of values of such an object, use the -// ObjectValues constructor. -// -// var requests []Request = ... -// logger.Info("sending requests", zap.ObjectValues("requests", requests)) -func Objects[T zapcore.ObjectMarshaler](key string, values []T) Field { - return Array(key, objects[T](values)) -} - -type objects[T zapcore.ObjectMarshaler] []T - -func (os objects[T]) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for _, o := range os { - if err := arr.AppendObject(o); err != nil { - return err - } - } - return nil -} - -// ObjectMarshalerPtr is a constraint that specifies that the given type -// implements zapcore.ObjectMarshaler on a pointer receiver. -type ObjectMarshalerPtr[T any] interface { - *T - zapcore.ObjectMarshaler -} - -// ObjectValues constructs a field with the given key, holding a list of the -// provided objects, where pointers to these objects can be marshaled by Zap. -// -// Note that pointers to these objects must implement zapcore.ObjectMarshaler. -// That is, if you're trying to marshal a []Request, the MarshalLogObject -// method must be declared on the *Request type, not the value (Request). -// If it's on the value, use Objects. -// -// Given an object that implements MarshalLogObject on the pointer receiver, -// you can log a slice of those objects with ObjectValues like so: -// -// type Request struct{ ... } -// func (r *Request) MarshalLogObject(enc zapcore.ObjectEncoder) error -// -// var requests []Request = ... -// logger.Info("sending requests", zap.ObjectValues("requests", requests)) -// -// If instead, you have a slice of pointers of such an object, use the Objects -// field constructor. -// -// var requests []*Request = ... -// logger.Info("sending requests", zap.Objects("requests", requests)) -func ObjectValues[T any, P ObjectMarshalerPtr[T]](key string, values []T) Field { - return Array(key, objectValues[T, P](values)) -} - -type objectValues[T any, P ObjectMarshalerPtr[T]] []T - -func (os objectValues[T, P]) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range os { - // It is necessary for us to explicitly reference the "P" type. - // We cannot simply pass "&os[i]" to AppendObject because its type - // is "*T", which the type system does not consider as - // implementing ObjectMarshaler. - // Only the type "P" satisfies ObjectMarshaler, which we have - // to convert "*T" to explicitly. - var p P = &os[i] - if err := arr.AppendObject(p); err != nil { - return err - } - } - return nil -} - -// Strings constructs a field that carries a slice of strings. -func Strings(key string, ss []string) Field { - return Array(key, stringArray(ss)) -} - -// Stringers constructs a field with the given key, holding a list of the -// output provided by the value's String method -// -// Given an object that implements String on the value receiver, you -// can log a slice of those objects with Objects like so: -// -// type Request struct{ ... } -// func (a Request) String() string -// -// var requests []Request = ... -// logger.Info("sending requests", zap.Stringers("requests", requests)) -// -// Note that these objects must implement fmt.Stringer directly. -// That is, if you're trying to marshal a []Request, the String method -// must be declared on the Request type, not its pointer (*Request). -func Stringers[T fmt.Stringer](key string, values []T) Field { - return Array(key, stringers[T](values)) -} - -type stringers[T fmt.Stringer] []T - -func (os stringers[T]) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for _, o := range os { - arr.AppendString(o.String()) - } - return nil -} - -// Times constructs a field that carries a slice of time.Times. -func Times(key string, ts []time.Time) Field { - return Array(key, times(ts)) -} - -// Uints constructs a field that carries a slice of unsigned integers. -func Uints(key string, nums []uint) Field { - return Array(key, uints(nums)) -} - -// Uint64s constructs a field that carries a slice of unsigned integers. -func Uint64s(key string, nums []uint64) Field { - return Array(key, uint64s(nums)) -} - -// Uint32s constructs a field that carries a slice of unsigned integers. -func Uint32s(key string, nums []uint32) Field { - return Array(key, uint32s(nums)) -} - -// Uint16s constructs a field that carries a slice of unsigned integers. -func Uint16s(key string, nums []uint16) Field { - return Array(key, uint16s(nums)) -} - -// Uint8s constructs a field that carries a slice of unsigned integers. -func Uint8s(key string, nums []uint8) Field { - return Array(key, uint8s(nums)) -} - -// Uintptrs constructs a field that carries a slice of pointer addresses. -func Uintptrs(key string, us []uintptr) Field { - return Array(key, uintptrs(us)) -} - -// Errors constructs a field that carries a slice of errors. -func Errors(key string, errs []error) Field { - return Array(key, errArray(errs)) -} - -type bools []bool - -func (bs bools) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range bs { - arr.AppendBool(bs[i]) - } - return nil -} - -type byteStringsArray [][]byte - -func (bss byteStringsArray) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range bss { - arr.AppendByteString(bss[i]) - } - return nil -} - -type complex128s []complex128 - -func (nums complex128s) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range nums { - arr.AppendComplex128(nums[i]) - } - return nil -} - -type complex64s []complex64 - -func (nums complex64s) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range nums { - arr.AppendComplex64(nums[i]) - } - return nil -} - -type durations []time.Duration - -func (ds durations) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range ds { - arr.AppendDuration(ds[i]) - } - return nil -} - -type float64s []float64 - -func (nums float64s) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range nums { - arr.AppendFloat64(nums[i]) - } - return nil -} - -type float32s []float32 - -func (nums float32s) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range nums { - arr.AppendFloat32(nums[i]) - } - return nil -} - -type ints []int - -func (nums ints) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range nums { - arr.AppendInt(nums[i]) - } - return nil -} - -type int64s []int64 - -func (nums int64s) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range nums { - arr.AppendInt64(nums[i]) - } - return nil -} - -type int32s []int32 - -func (nums int32s) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range nums { - arr.AppendInt32(nums[i]) - } - return nil -} - -type int16s []int16 - -func (nums int16s) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range nums { - arr.AppendInt16(nums[i]) - } - return nil -} - -type int8s []int8 - -func (nums int8s) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range nums { - arr.AppendInt8(nums[i]) - } - return nil -} - -type stringArray []string - -func (ss stringArray) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range ss { - arr.AppendString(ss[i]) - } - return nil -} - -type times []time.Time - -func (ts times) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range ts { - arr.AppendTime(ts[i]) - } - return nil -} - -type uints []uint - -func (nums uints) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range nums { - arr.AppendUint(nums[i]) - } - return nil -} - -type uint64s []uint64 - -func (nums uint64s) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range nums { - arr.AppendUint64(nums[i]) - } - return nil -} - -type uint32s []uint32 - -func (nums uint32s) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range nums { - arr.AppendUint32(nums[i]) - } - return nil -} - -type uint16s []uint16 - -func (nums uint16s) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range nums { - arr.AppendUint16(nums[i]) - } - return nil -} - -type uint8s []uint8 - -func (nums uint8s) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range nums { - arr.AppendUint8(nums[i]) - } - return nil -} - -type uintptrs []uintptr - -func (nums uintptrs) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range nums { - arr.AppendUintptr(nums[i]) - } - return nil -} diff --git a/e2e/vendor/go.uber.org/zap/buffer/buffer.go b/e2e/vendor/go.uber.org/zap/buffer/buffer.go deleted file mode 100644 index 0b8540c21..000000000 --- a/e2e/vendor/go.uber.org/zap/buffer/buffer.go +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -// Package buffer provides a thin wrapper around a byte slice. Unlike the -// standard library's bytes.Buffer, it supports a portion of the strconv -// package's zero-allocation formatters. -package buffer // import "go.uber.org/zap/buffer" - -import ( - "strconv" - "time" -) - -const _size = 1024 // by default, create 1 KiB buffers - -// Buffer is a thin wrapper around a byte slice. It's intended to be pooled, so -// the only way to construct one is via a Pool. -type Buffer struct { - bs []byte - pool Pool -} - -// AppendByte writes a single byte to the Buffer. -func (b *Buffer) AppendByte(v byte) { - b.bs = append(b.bs, v) -} - -// AppendBytes writes the given slice of bytes to the Buffer. -func (b *Buffer) AppendBytes(v []byte) { - b.bs = append(b.bs, v...) -} - -// AppendString writes a string to the Buffer. -func (b *Buffer) AppendString(s string) { - b.bs = append(b.bs, s...) -} - -// AppendInt appends an integer to the underlying buffer (assuming base 10). -func (b *Buffer) AppendInt(i int64) { - b.bs = strconv.AppendInt(b.bs, i, 10) -} - -// AppendTime appends the time formatted using the specified layout. -func (b *Buffer) AppendTime(t time.Time, layout string) { - b.bs = t.AppendFormat(b.bs, layout) -} - -// AppendUint appends an unsigned integer to the underlying buffer (assuming -// base 10). -func (b *Buffer) AppendUint(i uint64) { - b.bs = strconv.AppendUint(b.bs, i, 10) -} - -// AppendBool appends a bool to the underlying buffer. -func (b *Buffer) AppendBool(v bool) { - b.bs = strconv.AppendBool(b.bs, v) -} - -// AppendFloat appends a float to the underlying buffer. It doesn't quote NaN -// or +/- Inf. -func (b *Buffer) AppendFloat(f float64, bitSize int) { - b.bs = strconv.AppendFloat(b.bs, f, 'f', -1, bitSize) -} - -// Len returns the length of the underlying byte slice. -func (b *Buffer) Len() int { - return len(b.bs) -} - -// Cap returns the capacity of the underlying byte slice. -func (b *Buffer) Cap() int { - return cap(b.bs) -} - -// Bytes returns a mutable reference to the underlying byte slice. -func (b *Buffer) Bytes() []byte { - return b.bs -} - -// String returns a string copy of the underlying byte slice. -func (b *Buffer) String() string { - return string(b.bs) -} - -// Reset resets the underlying byte slice. Subsequent writes re-use the slice's -// backing array. -func (b *Buffer) Reset() { - b.bs = b.bs[:0] -} - -// Write implements io.Writer. -func (b *Buffer) Write(bs []byte) (int, error) { - b.bs = append(b.bs, bs...) - return len(bs), nil -} - -// WriteByte writes a single byte to the Buffer. -// -// Error returned is always nil, function signature is compatible -// with bytes.Buffer and bufio.Writer -func (b *Buffer) WriteByte(v byte) error { - b.AppendByte(v) - return nil -} - -// WriteString writes a string to the Buffer. -// -// Error returned is always nil, function signature is compatible -// with bytes.Buffer and bufio.Writer -func (b *Buffer) WriteString(s string) (int, error) { - b.AppendString(s) - return len(s), nil -} - -// TrimNewline trims any final "\n" byte from the end of the buffer. -func (b *Buffer) TrimNewline() { - if i := len(b.bs) - 1; i >= 0 { - if b.bs[i] == '\n' { - b.bs = b.bs[:i] - } - } -} - -// Free returns the Buffer to its Pool. -// -// Callers must not retain references to the Buffer after calling Free. -func (b *Buffer) Free() { - b.pool.put(b) -} diff --git a/e2e/vendor/go.uber.org/zap/buffer/pool.go b/e2e/vendor/go.uber.org/zap/buffer/pool.go deleted file mode 100644 index 846323360..000000000 --- a/e2e/vendor/go.uber.org/zap/buffer/pool.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package buffer - -import ( - "go.uber.org/zap/internal/pool" -) - -// A Pool is a type-safe wrapper around a sync.Pool. -type Pool struct { - p *pool.Pool[*Buffer] -} - -// NewPool constructs a new Pool. -func NewPool() Pool { - return Pool{ - p: pool.New(func() *Buffer { - return &Buffer{ - bs: make([]byte, 0, _size), - } - }), - } -} - -// Get retrieves a Buffer from the pool, creating one if necessary. -func (p Pool) Get() *Buffer { - buf := p.p.Get() - buf.Reset() - buf.pool = p - return buf -} - -func (p Pool) put(buf *Buffer) { - p.p.Put(buf) -} diff --git a/e2e/vendor/go.uber.org/zap/checklicense.sh b/e2e/vendor/go.uber.org/zap/checklicense.sh deleted file mode 100644 index 345ac8b89..000000000 --- a/e2e/vendor/go.uber.org/zap/checklicense.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -e - -ERROR_COUNT=0 -while read -r file -do - case "$(head -1 "${file}")" in - *"Copyright (c) "*" Uber Technologies, Inc.") - # everything's cool - ;; - *) - echo "$file is missing license header." - (( ERROR_COUNT++ )) - ;; - esac -done < <(git ls-files "*\.go") - -exit $ERROR_COUNT diff --git a/e2e/vendor/go.uber.org/zap/config.go b/e2e/vendor/go.uber.org/zap/config.go deleted file mode 100644 index e76e4e64f..000000000 --- a/e2e/vendor/go.uber.org/zap/config.go +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zap - -import ( - "errors" - "sort" - "time" - - "go.uber.org/zap/zapcore" -) - -// SamplingConfig sets a sampling strategy for the logger. Sampling caps the -// global CPU and I/O load that logging puts on your process while attempting -// to preserve a representative subset of your logs. -// -// If specified, the Sampler will invoke the Hook after each decision. -// -// Values configured here are per-second. See zapcore.NewSamplerWithOptions for -// details. -type SamplingConfig struct { - Initial int `json:"initial" yaml:"initial"` - Thereafter int `json:"thereafter" yaml:"thereafter"` - Hook func(zapcore.Entry, zapcore.SamplingDecision) `json:"-" yaml:"-"` -} - -// Config offers a declarative way to construct a logger. It doesn't do -// anything that can't be done with New, Options, and the various -// zapcore.WriteSyncer and zapcore.Core wrappers, but it's a simpler way to -// toggle common options. -// -// Note that Config intentionally supports only the most common options. More -// unusual logging setups (logging to network connections or message queues, -// splitting output between multiple files, etc.) are possible, but require -// direct use of the zapcore package. For sample code, see the package-level -// BasicConfiguration and AdvancedConfiguration examples. -// -// For an example showing runtime log level changes, see the documentation for -// AtomicLevel. -type Config struct { - // Level is the minimum enabled logging level. Note that this is a dynamic - // level, so calling Config.Level.SetLevel will atomically change the log - // level of all loggers descended from this config. - Level AtomicLevel `json:"level" yaml:"level"` - // Development puts the logger in development mode, which changes the - // behavior of DPanicLevel and takes stacktraces more liberally. - Development bool `json:"development" yaml:"development"` - // DisableCaller stops annotating logs with the calling function's file - // name and line number. By default, all logs are annotated. - DisableCaller bool `json:"disableCaller" yaml:"disableCaller"` - // DisableStacktrace completely disables automatic stacktrace capturing. By - // default, stacktraces are captured for WarnLevel and above logs in - // development and ErrorLevel and above in production. - DisableStacktrace bool `json:"disableStacktrace" yaml:"disableStacktrace"` - // Sampling sets a sampling policy. A nil SamplingConfig disables sampling. - Sampling *SamplingConfig `json:"sampling" yaml:"sampling"` - // Encoding sets the logger's encoding. Valid values are "json" and - // "console", as well as any third-party encodings registered via - // RegisterEncoder. - Encoding string `json:"encoding" yaml:"encoding"` - // EncoderConfig sets options for the chosen encoder. See - // zapcore.EncoderConfig for details. - EncoderConfig zapcore.EncoderConfig `json:"encoderConfig" yaml:"encoderConfig"` - // OutputPaths is a list of URLs or file paths to write logging output to. - // See Open for details. - OutputPaths []string `json:"outputPaths" yaml:"outputPaths"` - // ErrorOutputPaths is a list of URLs to write internal logger errors to. - // The default is standard error. - // - // Note that this setting only affects internal errors; for sample code that - // sends error-level logs to a different location from info- and debug-level - // logs, see the package-level AdvancedConfiguration example. - ErrorOutputPaths []string `json:"errorOutputPaths" yaml:"errorOutputPaths"` - // InitialFields is a collection of fields to add to the root logger. - InitialFields map[string]interface{} `json:"initialFields" yaml:"initialFields"` -} - -// NewProductionEncoderConfig returns an opinionated EncoderConfig for -// production environments. -// -// Messages encoded with this configuration will be JSON-formatted -// and will have the following keys by default: -// -// - "level": The logging level (e.g. "info", "error"). -// - "ts": The current time in number of seconds since the Unix epoch. -// - "msg": The message passed to the log statement. -// - "caller": If available, a short path to the file and line number -// where the log statement was issued. -// The logger configuration determines whether this field is captured. -// - "stacktrace": If available, a stack trace from the line -// where the log statement was issued. -// The logger configuration determines whether this field is captured. -// -// By default, the following formats are used for different types: -// -// - Time is formatted as floating-point number of seconds since the Unix -// epoch. -// - Duration is formatted as floating-point number of seconds. -// -// You may change these by setting the appropriate fields in the returned -// object. -// For example, use the following to change the time encoding format: -// -// cfg := zap.NewProductionEncoderConfig() -// cfg.EncodeTime = zapcore.ISO8601TimeEncoder -func NewProductionEncoderConfig() zapcore.EncoderConfig { - return zapcore.EncoderConfig{ - TimeKey: "ts", - LevelKey: "level", - NameKey: "logger", - CallerKey: "caller", - FunctionKey: zapcore.OmitKey, - MessageKey: "msg", - StacktraceKey: "stacktrace", - LineEnding: zapcore.DefaultLineEnding, - EncodeLevel: zapcore.LowercaseLevelEncoder, - EncodeTime: zapcore.EpochTimeEncoder, - EncodeDuration: zapcore.SecondsDurationEncoder, - EncodeCaller: zapcore.ShortCallerEncoder, - } -} - -// NewProductionConfig builds a reasonable default production logging -// configuration. -// Logging is enabled at InfoLevel and above, and uses a JSON encoder. -// Logs are written to standard error. -// Stacktraces are included on logs of ErrorLevel and above. -// DPanicLevel logs will not panic, but will write a stacktrace. -// -// Sampling is enabled at 100:100 by default, -// meaning that after the first 100 log entries -// with the same level and message in the same second, -// it will log every 100th entry -// with the same level and message in the same second. -// You may disable this behavior by setting Sampling to nil. -// -// See [NewProductionEncoderConfig] for information -// on the default encoder configuration. -func NewProductionConfig() Config { - return Config{ - Level: NewAtomicLevelAt(InfoLevel), - Development: false, - Sampling: &SamplingConfig{ - Initial: 100, - Thereafter: 100, - }, - Encoding: "json", - EncoderConfig: NewProductionEncoderConfig(), - OutputPaths: []string{"stderr"}, - ErrorOutputPaths: []string{"stderr"}, - } -} - -// NewDevelopmentEncoderConfig returns an opinionated EncoderConfig for -// development environments. -// -// Messages encoded with this configuration will use Zap's console encoder -// intended to print human-readable output. -// It will print log messages with the following information: -// -// - The log level (e.g. "INFO", "ERROR"). -// - The time in ISO8601 format (e.g. "2017-01-01T12:00:00Z"). -// - The message passed to the log statement. -// - If available, a short path to the file and line number -// where the log statement was issued. -// The logger configuration determines whether this field is captured. -// - If available, a stacktrace from the line -// where the log statement was issued. -// The logger configuration determines whether this field is captured. -// -// By default, the following formats are used for different types: -// -// - Time is formatted in ISO8601 format (e.g. "2017-01-01T12:00:00Z"). -// - Duration is formatted as a string (e.g. "1.234s"). -// -// You may change these by setting the appropriate fields in the returned -// object. -// For example, use the following to change the time encoding format: -// -// cfg := zap.NewDevelopmentEncoderConfig() -// cfg.EncodeTime = zapcore.ISO8601TimeEncoder -func NewDevelopmentEncoderConfig() zapcore.EncoderConfig { - return zapcore.EncoderConfig{ - // Keys can be anything except the empty string. - TimeKey: "T", - LevelKey: "L", - NameKey: "N", - CallerKey: "C", - FunctionKey: zapcore.OmitKey, - MessageKey: "M", - StacktraceKey: "S", - LineEnding: zapcore.DefaultLineEnding, - EncodeLevel: zapcore.CapitalLevelEncoder, - EncodeTime: zapcore.ISO8601TimeEncoder, - EncodeDuration: zapcore.StringDurationEncoder, - EncodeCaller: zapcore.ShortCallerEncoder, - } -} - -// NewDevelopmentConfig builds a reasonable default development logging -// configuration. -// Logging is enabled at DebugLevel and above, and uses a console encoder. -// Logs are written to standard error. -// Stacktraces are included on logs of WarnLevel and above. -// DPanicLevel logs will panic. -// -// See [NewDevelopmentEncoderConfig] for information -// on the default encoder configuration. -func NewDevelopmentConfig() Config { - return Config{ - Level: NewAtomicLevelAt(DebugLevel), - Development: true, - Encoding: "console", - EncoderConfig: NewDevelopmentEncoderConfig(), - OutputPaths: []string{"stderr"}, - ErrorOutputPaths: []string{"stderr"}, - } -} - -// Build constructs a logger from the Config and Options. -func (cfg Config) Build(opts ...Option) (*Logger, error) { - enc, err := cfg.buildEncoder() - if err != nil { - return nil, err - } - - sink, errSink, err := cfg.openSinks() - if err != nil { - return nil, err - } - - if cfg.Level == (AtomicLevel{}) { - return nil, errors.New("missing Level") - } - - log := New( - zapcore.NewCore(enc, sink, cfg.Level), - cfg.buildOptions(errSink)..., - ) - if len(opts) > 0 { - log = log.WithOptions(opts...) - } - return log, nil -} - -func (cfg Config) buildOptions(errSink zapcore.WriteSyncer) []Option { - opts := []Option{ErrorOutput(errSink)} - - if cfg.Development { - opts = append(opts, Development()) - } - - if !cfg.DisableCaller { - opts = append(opts, AddCaller()) - } - - stackLevel := ErrorLevel - if cfg.Development { - stackLevel = WarnLevel - } - if !cfg.DisableStacktrace { - opts = append(opts, AddStacktrace(stackLevel)) - } - - if scfg := cfg.Sampling; scfg != nil { - opts = append(opts, WrapCore(func(core zapcore.Core) zapcore.Core { - var samplerOpts []zapcore.SamplerOption - if scfg.Hook != nil { - samplerOpts = append(samplerOpts, zapcore.SamplerHook(scfg.Hook)) - } - return zapcore.NewSamplerWithOptions( - core, - time.Second, - cfg.Sampling.Initial, - cfg.Sampling.Thereafter, - samplerOpts..., - ) - })) - } - - if len(cfg.InitialFields) > 0 { - fs := make([]Field, 0, len(cfg.InitialFields)) - keys := make([]string, 0, len(cfg.InitialFields)) - for k := range cfg.InitialFields { - keys = append(keys, k) - } - sort.Strings(keys) - for _, k := range keys { - fs = append(fs, Any(k, cfg.InitialFields[k])) - } - opts = append(opts, Fields(fs...)) - } - - return opts -} - -func (cfg Config) openSinks() (zapcore.WriteSyncer, zapcore.WriteSyncer, error) { - sink, closeOut, err := Open(cfg.OutputPaths...) - if err != nil { - return nil, nil, err - } - errSink, _, err := Open(cfg.ErrorOutputPaths...) - if err != nil { - closeOut() - return nil, nil, err - } - return sink, errSink, nil -} - -func (cfg Config) buildEncoder() (zapcore.Encoder, error) { - return newEncoder(cfg.Encoding, cfg.EncoderConfig) -} diff --git a/e2e/vendor/go.uber.org/zap/doc.go b/e2e/vendor/go.uber.org/zap/doc.go deleted file mode 100644 index 3c50d7b4d..000000000 --- a/e2e/vendor/go.uber.org/zap/doc.go +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -// Package zap provides fast, structured, leveled logging. -// -// For applications that log in the hot path, reflection-based serialization -// and string formatting are prohibitively expensive - they're CPU-intensive -// and make many small allocations. Put differently, using json.Marshal and -// fmt.Fprintf to log tons of interface{} makes your application slow. -// -// Zap takes a different approach. It includes a reflection-free, -// zero-allocation JSON encoder, and the base Logger strives to avoid -// serialization overhead and allocations wherever possible. By building the -// high-level SugaredLogger on that foundation, zap lets users choose when -// they need to count every allocation and when they'd prefer a more familiar, -// loosely typed API. -// -// # Choosing a Logger -// -// In contexts where performance is nice, but not critical, use the -// SugaredLogger. It's 4-10x faster than other structured logging packages and -// supports both structured and printf-style logging. Like log15 and go-kit, -// the SugaredLogger's structured logging APIs are loosely typed and accept a -// variadic number of key-value pairs. (For more advanced use cases, they also -// accept strongly typed fields - see the SugaredLogger.With documentation for -// details.) -// -// sugar := zap.NewExample().Sugar() -// defer sugar.Sync() -// sugar.Infow("failed to fetch URL", -// "url", "http://example.com", -// "attempt", 3, -// "backoff", time.Second, -// ) -// sugar.Infof("failed to fetch URL: %s", "http://example.com") -// -// By default, loggers are unbuffered. However, since zap's low-level APIs -// allow buffering, calling Sync before letting your process exit is a good -// habit. -// -// In the rare contexts where every microsecond and every allocation matter, -// use the Logger. It's even faster than the SugaredLogger and allocates far -// less, but it only supports strongly-typed, structured logging. -// -// logger := zap.NewExample() -// defer logger.Sync() -// logger.Info("failed to fetch URL", -// zap.String("url", "http://example.com"), -// zap.Int("attempt", 3), -// zap.Duration("backoff", time.Second), -// ) -// -// Choosing between the Logger and SugaredLogger doesn't need to be an -// application-wide decision: converting between the two is simple and -// inexpensive. -// -// logger := zap.NewExample() -// defer logger.Sync() -// sugar := logger.Sugar() -// plain := sugar.Desugar() -// -// # Configuring Zap -// -// The simplest way to build a Logger is to use zap's opinionated presets: -// NewExample, NewProduction, and NewDevelopment. These presets build a logger -// with a single function call: -// -// logger, err := zap.NewProduction() -// if err != nil { -// log.Fatalf("can't initialize zap logger: %v", err) -// } -// defer logger.Sync() -// -// Presets are fine for small projects, but larger projects and organizations -// naturally require a bit more customization. For most users, zap's Config -// struct strikes the right balance between flexibility and convenience. See -// the package-level BasicConfiguration example for sample code. -// -// More unusual configurations (splitting output between files, sending logs -// to a message queue, etc.) are possible, but require direct use of -// go.uber.org/zap/zapcore. See the package-level AdvancedConfiguration -// example for sample code. -// -// # Extending Zap -// -// The zap package itself is a relatively thin wrapper around the interfaces -// in go.uber.org/zap/zapcore. Extending zap to support a new encoding (e.g., -// BSON), a new log sink (e.g., Kafka), or something more exotic (perhaps an -// exception aggregation service, like Sentry or Rollbar) typically requires -// implementing the zapcore.Encoder, zapcore.WriteSyncer, or zapcore.Core -// interfaces. See the zapcore documentation for details. -// -// Similarly, package authors can use the high-performance Encoder and Core -// implementations in the zapcore package to build their own loggers. -// -// # Frequently Asked Questions -// -// An FAQ covering everything from installation errors to design decisions is -// available at https://github.com/uber-go/zap/blob/master/FAQ.md. -package zap // import "go.uber.org/zap" diff --git a/e2e/vendor/go.uber.org/zap/encoder.go b/e2e/vendor/go.uber.org/zap/encoder.go deleted file mode 100644 index caa04ceef..000000000 --- a/e2e/vendor/go.uber.org/zap/encoder.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zap - -import ( - "errors" - "fmt" - "sync" - - "go.uber.org/zap/zapcore" -) - -var ( - errNoEncoderNameSpecified = errors.New("no encoder name specified") - - _encoderNameToConstructor = map[string]func(zapcore.EncoderConfig) (zapcore.Encoder, error){ - "console": func(encoderConfig zapcore.EncoderConfig) (zapcore.Encoder, error) { - return zapcore.NewConsoleEncoder(encoderConfig), nil - }, - "json": func(encoderConfig zapcore.EncoderConfig) (zapcore.Encoder, error) { - return zapcore.NewJSONEncoder(encoderConfig), nil - }, - } - _encoderMutex sync.RWMutex -) - -// RegisterEncoder registers an encoder constructor, which the Config struct -// can then reference. By default, the "json" and "console" encoders are -// registered. -// -// Attempting to register an encoder whose name is already taken returns an -// error. -func RegisterEncoder(name string, constructor func(zapcore.EncoderConfig) (zapcore.Encoder, error)) error { - _encoderMutex.Lock() - defer _encoderMutex.Unlock() - if name == "" { - return errNoEncoderNameSpecified - } - if _, ok := _encoderNameToConstructor[name]; ok { - return fmt.Errorf("encoder already registered for name %q", name) - } - _encoderNameToConstructor[name] = constructor - return nil -} - -func newEncoder(name string, encoderConfig zapcore.EncoderConfig) (zapcore.Encoder, error) { - if encoderConfig.TimeKey != "" && encoderConfig.EncodeTime == nil { - return nil, errors.New("missing EncodeTime in EncoderConfig") - } - - _encoderMutex.RLock() - defer _encoderMutex.RUnlock() - if name == "" { - return nil, errNoEncoderNameSpecified - } - constructor, ok := _encoderNameToConstructor[name] - if !ok { - return nil, fmt.Errorf("no encoder registered for name %q", name) - } - return constructor(encoderConfig) -} diff --git a/e2e/vendor/go.uber.org/zap/error.go b/e2e/vendor/go.uber.org/zap/error.go deleted file mode 100644 index 45f7b838d..000000000 --- a/e2e/vendor/go.uber.org/zap/error.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) 2017 Uber Technologies, Inc. -// -// 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. - -package zap - -import ( - "go.uber.org/zap/internal/pool" - "go.uber.org/zap/zapcore" -) - -var _errArrayElemPool = pool.New(func() *errArrayElem { - return &errArrayElem{} -}) - -// Error is shorthand for the common idiom NamedError("error", err). -func Error(err error) Field { - return NamedError("error", err) -} - -// NamedError constructs a field that lazily stores err.Error() under the -// provided key. Errors which also implement fmt.Formatter (like those produced -// by github.com/pkg/errors) will also have their verbose representation stored -// under key+"Verbose". If passed a nil error, the field is a no-op. -// -// For the common case in which the key is simply "error", the Error function -// is shorter and less repetitive. -func NamedError(key string, err error) Field { - if err == nil { - return Skip() - } - return Field{Key: key, Type: zapcore.ErrorType, Interface: err} -} - -type errArray []error - -func (errs errArray) MarshalLogArray(arr zapcore.ArrayEncoder) error { - for i := range errs { - if errs[i] == nil { - continue - } - // To represent each error as an object with an "error" attribute and - // potentially an "errorVerbose" attribute, we need to wrap it in a - // type that implements LogObjectMarshaler. To prevent this from - // allocating, pool the wrapper type. - elem := _errArrayElemPool.Get() - elem.error = errs[i] - err := arr.AppendObject(elem) - elem.error = nil - _errArrayElemPool.Put(elem) - if err != nil { - return err - } - } - return nil -} - -type errArrayElem struct { - error -} - -func (e *errArrayElem) MarshalLogObject(enc zapcore.ObjectEncoder) error { - // Re-use the error field's logic, which supports non-standard error types. - Error(e.error).AddTo(enc) - return nil -} diff --git a/e2e/vendor/go.uber.org/zap/field.go b/e2e/vendor/go.uber.org/zap/field.go deleted file mode 100644 index 6743930b8..000000000 --- a/e2e/vendor/go.uber.org/zap/field.go +++ /dev/null @@ -1,615 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zap - -import ( - "fmt" - "math" - "time" - - "go.uber.org/zap/internal/stacktrace" - "go.uber.org/zap/zapcore" -) - -// Field is an alias for Field. Aliasing this type dramatically -// improves the navigability of this package's API documentation. -type Field = zapcore.Field - -var ( - _minTimeInt64 = time.Unix(0, math.MinInt64) - _maxTimeInt64 = time.Unix(0, math.MaxInt64) -) - -// Skip constructs a no-op field, which is often useful when handling invalid -// inputs in other Field constructors. -func Skip() Field { - return Field{Type: zapcore.SkipType} -} - -// nilField returns a field which will marshal explicitly as nil. See motivation -// in https://github.com/uber-go/zap/issues/753 . If we ever make breaking -// changes and add zapcore.NilType and zapcore.ObjectEncoder.AddNil, the -// implementation here should be changed to reflect that. -func nilField(key string) Field { return Reflect(key, nil) } - -// Binary constructs a field that carries an opaque binary blob. -// -// Binary data is serialized in an encoding-appropriate format. For example, -// zap's JSON encoder base64-encodes binary blobs. To log UTF-8 encoded text, -// use ByteString. -func Binary(key string, val []byte) Field { - return Field{Key: key, Type: zapcore.BinaryType, Interface: val} -} - -// Bool constructs a field that carries a bool. -func Bool(key string, val bool) Field { - var ival int64 - if val { - ival = 1 - } - return Field{Key: key, Type: zapcore.BoolType, Integer: ival} -} - -// Boolp constructs a field that carries a *bool. The returned Field will safely -// and explicitly represent `nil` when appropriate. -func Boolp(key string, val *bool) Field { - if val == nil { - return nilField(key) - } - return Bool(key, *val) -} - -// ByteString constructs a field that carries UTF-8 encoded text as a []byte. -// To log opaque binary blobs (which aren't necessarily valid UTF-8), use -// Binary. -func ByteString(key string, val []byte) Field { - return Field{Key: key, Type: zapcore.ByteStringType, Interface: val} -} - -// Complex128 constructs a field that carries a complex number. Unlike most -// numeric fields, this costs an allocation (to convert the complex128 to -// interface{}). -func Complex128(key string, val complex128) Field { - return Field{Key: key, Type: zapcore.Complex128Type, Interface: val} -} - -// Complex128p constructs a field that carries a *complex128. The returned Field will safely -// and explicitly represent `nil` when appropriate. -func Complex128p(key string, val *complex128) Field { - if val == nil { - return nilField(key) - } - return Complex128(key, *val) -} - -// Complex64 constructs a field that carries a complex number. Unlike most -// numeric fields, this costs an allocation (to convert the complex64 to -// interface{}). -func Complex64(key string, val complex64) Field { - return Field{Key: key, Type: zapcore.Complex64Type, Interface: val} -} - -// Complex64p constructs a field that carries a *complex64. The returned Field will safely -// and explicitly represent `nil` when appropriate. -func Complex64p(key string, val *complex64) Field { - if val == nil { - return nilField(key) - } - return Complex64(key, *val) -} - -// Float64 constructs a field that carries a float64. The way the -// floating-point value is represented is encoder-dependent, so marshaling is -// necessarily lazy. -func Float64(key string, val float64) Field { - return Field{Key: key, Type: zapcore.Float64Type, Integer: int64(math.Float64bits(val))} -} - -// Float64p constructs a field that carries a *float64. The returned Field will safely -// and explicitly represent `nil` when appropriate. -func Float64p(key string, val *float64) Field { - if val == nil { - return nilField(key) - } - return Float64(key, *val) -} - -// Float32 constructs a field that carries a float32. The way the -// floating-point value is represented is encoder-dependent, so marshaling is -// necessarily lazy. -func Float32(key string, val float32) Field { - return Field{Key: key, Type: zapcore.Float32Type, Integer: int64(math.Float32bits(val))} -} - -// Float32p constructs a field that carries a *float32. The returned Field will safely -// and explicitly represent `nil` when appropriate. -func Float32p(key string, val *float32) Field { - if val == nil { - return nilField(key) - } - return Float32(key, *val) -} - -// Int constructs a field with the given key and value. -func Int(key string, val int) Field { - return Int64(key, int64(val)) -} - -// Intp constructs a field that carries a *int. The returned Field will safely -// and explicitly represent `nil` when appropriate. -func Intp(key string, val *int) Field { - if val == nil { - return nilField(key) - } - return Int(key, *val) -} - -// Int64 constructs a field with the given key and value. -func Int64(key string, val int64) Field { - return Field{Key: key, Type: zapcore.Int64Type, Integer: val} -} - -// Int64p constructs a field that carries a *int64. The returned Field will safely -// and explicitly represent `nil` when appropriate. -func Int64p(key string, val *int64) Field { - if val == nil { - return nilField(key) - } - return Int64(key, *val) -} - -// Int32 constructs a field with the given key and value. -func Int32(key string, val int32) Field { - return Field{Key: key, Type: zapcore.Int32Type, Integer: int64(val)} -} - -// Int32p constructs a field that carries a *int32. The returned Field will safely -// and explicitly represent `nil` when appropriate. -func Int32p(key string, val *int32) Field { - if val == nil { - return nilField(key) - } - return Int32(key, *val) -} - -// Int16 constructs a field with the given key and value. -func Int16(key string, val int16) Field { - return Field{Key: key, Type: zapcore.Int16Type, Integer: int64(val)} -} - -// Int16p constructs a field that carries a *int16. The returned Field will safely -// and explicitly represent `nil` when appropriate. -func Int16p(key string, val *int16) Field { - if val == nil { - return nilField(key) - } - return Int16(key, *val) -} - -// Int8 constructs a field with the given key and value. -func Int8(key string, val int8) Field { - return Field{Key: key, Type: zapcore.Int8Type, Integer: int64(val)} -} - -// Int8p constructs a field that carries a *int8. The returned Field will safely -// and explicitly represent `nil` when appropriate. -func Int8p(key string, val *int8) Field { - if val == nil { - return nilField(key) - } - return Int8(key, *val) -} - -// String constructs a field with the given key and value. -func String(key string, val string) Field { - return Field{Key: key, Type: zapcore.StringType, String: val} -} - -// Stringp constructs a field that carries a *string. The returned Field will safely -// and explicitly represent `nil` when appropriate. -func Stringp(key string, val *string) Field { - if val == nil { - return nilField(key) - } - return String(key, *val) -} - -// Uint constructs a field with the given key and value. -func Uint(key string, val uint) Field { - return Uint64(key, uint64(val)) -} - -// Uintp constructs a field that carries a *uint. The returned Field will safely -// and explicitly represent `nil` when appropriate. -func Uintp(key string, val *uint) Field { - if val == nil { - return nilField(key) - } - return Uint(key, *val) -} - -// Uint64 constructs a field with the given key and value. -func Uint64(key string, val uint64) Field { - return Field{Key: key, Type: zapcore.Uint64Type, Integer: int64(val)} -} - -// Uint64p constructs a field that carries a *uint64. The returned Field will safely -// and explicitly represent `nil` when appropriate. -func Uint64p(key string, val *uint64) Field { - if val == nil { - return nilField(key) - } - return Uint64(key, *val) -} - -// Uint32 constructs a field with the given key and value. -func Uint32(key string, val uint32) Field { - return Field{Key: key, Type: zapcore.Uint32Type, Integer: int64(val)} -} - -// Uint32p constructs a field that carries a *uint32. The returned Field will safely -// and explicitly represent `nil` when appropriate. -func Uint32p(key string, val *uint32) Field { - if val == nil { - return nilField(key) - } - return Uint32(key, *val) -} - -// Uint16 constructs a field with the given key and value. -func Uint16(key string, val uint16) Field { - return Field{Key: key, Type: zapcore.Uint16Type, Integer: int64(val)} -} - -// Uint16p constructs a field that carries a *uint16. The returned Field will safely -// and explicitly represent `nil` when appropriate. -func Uint16p(key string, val *uint16) Field { - if val == nil { - return nilField(key) - } - return Uint16(key, *val) -} - -// Uint8 constructs a field with the given key and value. -func Uint8(key string, val uint8) Field { - return Field{Key: key, Type: zapcore.Uint8Type, Integer: int64(val)} -} - -// Uint8p constructs a field that carries a *uint8. The returned Field will safely -// and explicitly represent `nil` when appropriate. -func Uint8p(key string, val *uint8) Field { - if val == nil { - return nilField(key) - } - return Uint8(key, *val) -} - -// Uintptr constructs a field with the given key and value. -func Uintptr(key string, val uintptr) Field { - return Field{Key: key, Type: zapcore.UintptrType, Integer: int64(val)} -} - -// Uintptrp constructs a field that carries a *uintptr. The returned Field will safely -// and explicitly represent `nil` when appropriate. -func Uintptrp(key string, val *uintptr) Field { - if val == nil { - return nilField(key) - } - return Uintptr(key, *val) -} - -// Reflect constructs a field with the given key and an arbitrary object. It uses -// an encoding-appropriate, reflection-based function to lazily serialize nearly -// any object into the logging context, but it's relatively slow and -// allocation-heavy. Outside tests, Any is always a better choice. -// -// If encoding fails (e.g., trying to serialize a map[int]string to JSON), Reflect -// includes the error message in the final log output. -func Reflect(key string, val interface{}) Field { - return Field{Key: key, Type: zapcore.ReflectType, Interface: val} -} - -// Namespace creates a named, isolated scope within the logger's context. All -// subsequent fields will be added to the new namespace. -// -// This helps prevent key collisions when injecting loggers into sub-components -// or third-party libraries. -func Namespace(key string) Field { - return Field{Key: key, Type: zapcore.NamespaceType} -} - -// Stringer constructs a field with the given key and the output of the value's -// String method. The Stringer's String method is called lazily. -func Stringer(key string, val fmt.Stringer) Field { - return Field{Key: key, Type: zapcore.StringerType, Interface: val} -} - -// Time constructs a Field with the given key and value. The encoder -// controls how the time is serialized. -func Time(key string, val time.Time) Field { - if val.Before(_minTimeInt64) || val.After(_maxTimeInt64) { - return Field{Key: key, Type: zapcore.TimeFullType, Interface: val} - } - return Field{Key: key, Type: zapcore.TimeType, Integer: val.UnixNano(), Interface: val.Location()} -} - -// Timep constructs a field that carries a *time.Time. The returned Field will safely -// and explicitly represent `nil` when appropriate. -func Timep(key string, val *time.Time) Field { - if val == nil { - return nilField(key) - } - return Time(key, *val) -} - -// Stack constructs a field that stores a stacktrace of the current goroutine -// under provided key. Keep in mind that taking a stacktrace is eager and -// expensive (relatively speaking); this function both makes an allocation and -// takes about two microseconds. -func Stack(key string) Field { - return StackSkip(key, 1) // skip Stack -} - -// StackSkip constructs a field similarly to Stack, but also skips the given -// number of frames from the top of the stacktrace. -func StackSkip(key string, skip int) Field { - // Returning the stacktrace as a string costs an allocation, but saves us - // from expanding the zapcore.Field union struct to include a byte slice. Since - // taking a stacktrace is already so expensive (~10us), the extra allocation - // is okay. - return String(key, stacktrace.Take(skip+1)) // skip StackSkip -} - -// Duration constructs a field with the given key and value. The encoder -// controls how the duration is serialized. -func Duration(key string, val time.Duration) Field { - return Field{Key: key, Type: zapcore.DurationType, Integer: int64(val)} -} - -// Durationp constructs a field that carries a *time.Duration. The returned Field will safely -// and explicitly represent `nil` when appropriate. -func Durationp(key string, val *time.Duration) Field { - if val == nil { - return nilField(key) - } - return Duration(key, *val) -} - -// Object constructs a field with the given key and ObjectMarshaler. It -// provides a flexible, but still type-safe and efficient, way to add map- or -// struct-like user-defined types to the logging context. The struct's -// MarshalLogObject method is called lazily. -func Object(key string, val zapcore.ObjectMarshaler) Field { - return Field{Key: key, Type: zapcore.ObjectMarshalerType, Interface: val} -} - -// Inline constructs a Field that is similar to Object, but it -// will add the elements of the provided ObjectMarshaler to the -// current namespace. -func Inline(val zapcore.ObjectMarshaler) Field { - return zapcore.Field{ - Type: zapcore.InlineMarshalerType, - Interface: val, - } -} - -// Dict constructs a field containing the provided key-value pairs. -// It acts similar to [Object], but with the fields specified as arguments. -func Dict(key string, val ...Field) Field { - return dictField(key, val) -} - -// We need a function with the signature (string, T) for zap.Any. -func dictField(key string, val []Field) Field { - return Object(key, dictObject(val)) -} - -type dictObject []Field - -func (d dictObject) MarshalLogObject(enc zapcore.ObjectEncoder) error { - for _, f := range d { - f.AddTo(enc) - } - return nil -} - -// We discovered an issue where zap.Any can cause a performance degradation -// when used in new goroutines. -// -// This happens because the compiler assigns 4.8kb (one zap.Field per arm of -// switch statement) of stack space for zap.Any when it takes the form: -// -// switch v := v.(type) { -// case string: -// return String(key, v) -// case int: -// return Int(key, v) -// // ... -// default: -// return Reflect(key, v) -// } -// -// To avoid this, we use the type switch to assign a value to a single local variable -// and then call a function on it. -// The local variable is just a function reference so it doesn't allocate -// when converted to an interface{}. -// -// A fair bit of experimentation went into this. -// See also: -// -// - https://github.com/uber-go/zap/pull/1301 -// - https://github.com/uber-go/zap/pull/1303 -// - https://github.com/uber-go/zap/pull/1304 -// - https://github.com/uber-go/zap/pull/1305 -// - https://github.com/uber-go/zap/pull/1308 -// -// See https://github.com/golang/go/issues/62077 for upstream issue. -type anyFieldC[T any] func(string, T) Field - -func (f anyFieldC[T]) Any(key string, val any) Field { - v, _ := val.(T) - // val is guaranteed to be a T, except when it's nil. - return f(key, v) -} - -// Any takes a key and an arbitrary value and chooses the best way to represent -// them as a field, falling back to a reflection-based approach only if -// necessary. -// -// Since byte/uint8 and rune/int32 are aliases, Any can't differentiate between -// them. To minimize surprises, []byte values are treated as binary blobs, byte -// values are treated as uint8, and runes are always treated as integers. -func Any(key string, value interface{}) Field { - var c interface{ Any(string, any) Field } - - switch value.(type) { - case zapcore.ObjectMarshaler: - c = anyFieldC[zapcore.ObjectMarshaler](Object) - case zapcore.ArrayMarshaler: - c = anyFieldC[zapcore.ArrayMarshaler](Array) - case []Field: - c = anyFieldC[[]Field](dictField) - case bool: - c = anyFieldC[bool](Bool) - case *bool: - c = anyFieldC[*bool](Boolp) - case []bool: - c = anyFieldC[[]bool](Bools) - case complex128: - c = anyFieldC[complex128](Complex128) - case *complex128: - c = anyFieldC[*complex128](Complex128p) - case []complex128: - c = anyFieldC[[]complex128](Complex128s) - case complex64: - c = anyFieldC[complex64](Complex64) - case *complex64: - c = anyFieldC[*complex64](Complex64p) - case []complex64: - c = anyFieldC[[]complex64](Complex64s) - case float64: - c = anyFieldC[float64](Float64) - case *float64: - c = anyFieldC[*float64](Float64p) - case []float64: - c = anyFieldC[[]float64](Float64s) - case float32: - c = anyFieldC[float32](Float32) - case *float32: - c = anyFieldC[*float32](Float32p) - case []float32: - c = anyFieldC[[]float32](Float32s) - case int: - c = anyFieldC[int](Int) - case *int: - c = anyFieldC[*int](Intp) - case []int: - c = anyFieldC[[]int](Ints) - case int64: - c = anyFieldC[int64](Int64) - case *int64: - c = anyFieldC[*int64](Int64p) - case []int64: - c = anyFieldC[[]int64](Int64s) - case int32: - c = anyFieldC[int32](Int32) - case *int32: - c = anyFieldC[*int32](Int32p) - case []int32: - c = anyFieldC[[]int32](Int32s) - case int16: - c = anyFieldC[int16](Int16) - case *int16: - c = anyFieldC[*int16](Int16p) - case []int16: - c = anyFieldC[[]int16](Int16s) - case int8: - c = anyFieldC[int8](Int8) - case *int8: - c = anyFieldC[*int8](Int8p) - case []int8: - c = anyFieldC[[]int8](Int8s) - case string: - c = anyFieldC[string](String) - case *string: - c = anyFieldC[*string](Stringp) - case []string: - c = anyFieldC[[]string](Strings) - case uint: - c = anyFieldC[uint](Uint) - case *uint: - c = anyFieldC[*uint](Uintp) - case []uint: - c = anyFieldC[[]uint](Uints) - case uint64: - c = anyFieldC[uint64](Uint64) - case *uint64: - c = anyFieldC[*uint64](Uint64p) - case []uint64: - c = anyFieldC[[]uint64](Uint64s) - case uint32: - c = anyFieldC[uint32](Uint32) - case *uint32: - c = anyFieldC[*uint32](Uint32p) - case []uint32: - c = anyFieldC[[]uint32](Uint32s) - case uint16: - c = anyFieldC[uint16](Uint16) - case *uint16: - c = anyFieldC[*uint16](Uint16p) - case []uint16: - c = anyFieldC[[]uint16](Uint16s) - case uint8: - c = anyFieldC[uint8](Uint8) - case *uint8: - c = anyFieldC[*uint8](Uint8p) - case []byte: - c = anyFieldC[[]byte](Binary) - case uintptr: - c = anyFieldC[uintptr](Uintptr) - case *uintptr: - c = anyFieldC[*uintptr](Uintptrp) - case []uintptr: - c = anyFieldC[[]uintptr](Uintptrs) - case time.Time: - c = anyFieldC[time.Time](Time) - case *time.Time: - c = anyFieldC[*time.Time](Timep) - case []time.Time: - c = anyFieldC[[]time.Time](Times) - case time.Duration: - c = anyFieldC[time.Duration](Duration) - case *time.Duration: - c = anyFieldC[*time.Duration](Durationp) - case []time.Duration: - c = anyFieldC[[]time.Duration](Durations) - case error: - c = anyFieldC[error](NamedError) - case []error: - c = anyFieldC[[]error](Errors) - case fmt.Stringer: - c = anyFieldC[fmt.Stringer](Stringer) - default: - c = anyFieldC[any](Reflect) - } - - return c.Any(key, value) -} diff --git a/e2e/vendor/go.uber.org/zap/flag.go b/e2e/vendor/go.uber.org/zap/flag.go deleted file mode 100644 index 131287507..000000000 --- a/e2e/vendor/go.uber.org/zap/flag.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zap - -import ( - "flag" - - "go.uber.org/zap/zapcore" -) - -// LevelFlag uses the standard library's flag.Var to declare a global flag -// with the specified name, default, and usage guidance. The returned value is -// a pointer to the value of the flag. -// -// If you don't want to use the flag package's global state, you can use any -// non-nil *Level as a flag.Value with your own *flag.FlagSet. -func LevelFlag(name string, defaultLevel zapcore.Level, usage string) *zapcore.Level { - lvl := defaultLevel - flag.Var(&lvl, name, usage) - return &lvl -} diff --git a/e2e/vendor/go.uber.org/zap/glide.yaml b/e2e/vendor/go.uber.org/zap/glide.yaml deleted file mode 100644 index 8e1d05e9a..000000000 --- a/e2e/vendor/go.uber.org/zap/glide.yaml +++ /dev/null @@ -1,34 +0,0 @@ -package: go.uber.org/zap -license: MIT -import: -- package: go.uber.org/atomic - version: ^1 -- package: go.uber.org/multierr - version: ^1 -testImport: -- package: github.com/satori/go.uuid -- package: github.com/sirupsen/logrus -- package: github.com/apex/log - subpackages: - - handlers/json -- package: github.com/go-kit/kit - subpackages: - - log -- package: github.com/stretchr/testify - subpackages: - - assert - - require -- package: gopkg.in/inconshreveable/log15.v2 -- package: github.com/mattn/goveralls -- package: github.com/pborman/uuid -- package: github.com/pkg/errors -- package: github.com/rs/zerolog -- package: golang.org/x/tools - subpackages: - - cover -- package: golang.org/x/lint - subpackages: - - golint -- package: github.com/axw/gocov - subpackages: - - gocov diff --git a/e2e/vendor/go.uber.org/zap/global.go b/e2e/vendor/go.uber.org/zap/global.go deleted file mode 100644 index 3cb46c9e0..000000000 --- a/e2e/vendor/go.uber.org/zap/global.go +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zap - -import ( - "bytes" - "fmt" - "log" - "os" - "sync" - - "go.uber.org/zap/zapcore" -) - -const ( - _stdLogDefaultDepth = 1 - _loggerWriterDepth = 2 - _programmerErrorTemplate = "You've found a bug in zap! Please file a bug at " + - "https://github.com/uber-go/zap/issues/new and reference this error: %v" -) - -var ( - _globalMu sync.RWMutex - _globalL = NewNop() - _globalS = _globalL.Sugar() -) - -// L returns the global Logger, which can be reconfigured with ReplaceGlobals. -// It's safe for concurrent use. -func L() *Logger { - _globalMu.RLock() - l := _globalL - _globalMu.RUnlock() - return l -} - -// S returns the global SugaredLogger, which can be reconfigured with -// ReplaceGlobals. It's safe for concurrent use. -func S() *SugaredLogger { - _globalMu.RLock() - s := _globalS - _globalMu.RUnlock() - return s -} - -// ReplaceGlobals replaces the global Logger and SugaredLogger, and returns a -// function to restore the original values. It's safe for concurrent use. -func ReplaceGlobals(logger *Logger) func() { - _globalMu.Lock() - prev := _globalL - _globalL = logger - _globalS = logger.Sugar() - _globalMu.Unlock() - return func() { ReplaceGlobals(prev) } -} - -// NewStdLog returns a *log.Logger which writes to the supplied zap Logger at -// InfoLevel. To redirect the standard library's package-global logging -// functions, use RedirectStdLog instead. -func NewStdLog(l *Logger) *log.Logger { - logger := l.WithOptions(AddCallerSkip(_stdLogDefaultDepth + _loggerWriterDepth)) - f := logger.Info - return log.New(&loggerWriter{f}, "" /* prefix */, 0 /* flags */) -} - -// NewStdLogAt returns *log.Logger which writes to supplied zap logger at -// required level. -func NewStdLogAt(l *Logger, level zapcore.Level) (*log.Logger, error) { - logger := l.WithOptions(AddCallerSkip(_stdLogDefaultDepth + _loggerWriterDepth)) - logFunc, err := levelToFunc(logger, level) - if err != nil { - return nil, err - } - return log.New(&loggerWriter{logFunc}, "" /* prefix */, 0 /* flags */), nil -} - -// RedirectStdLog redirects output from the standard library's package-global -// logger to the supplied logger at InfoLevel. Since zap already handles caller -// annotations, timestamps, etc., it automatically disables the standard -// library's annotations and prefixing. -// -// It returns a function to restore the original prefix and flags and reset the -// standard library's output to os.Stderr. -func RedirectStdLog(l *Logger) func() { - f, err := redirectStdLogAt(l, InfoLevel) - if err != nil { - // Can't get here, since passing InfoLevel to redirectStdLogAt always - // works. - panic(fmt.Sprintf(_programmerErrorTemplate, err)) - } - return f -} - -// RedirectStdLogAt redirects output from the standard library's package-global -// logger to the supplied logger at the specified level. Since zap already -// handles caller annotations, timestamps, etc., it automatically disables the -// standard library's annotations and prefixing. -// -// It returns a function to restore the original prefix and flags and reset the -// standard library's output to os.Stderr. -func RedirectStdLogAt(l *Logger, level zapcore.Level) (func(), error) { - return redirectStdLogAt(l, level) -} - -func redirectStdLogAt(l *Logger, level zapcore.Level) (func(), error) { - flags := log.Flags() - prefix := log.Prefix() - log.SetFlags(0) - log.SetPrefix("") - logger := l.WithOptions(AddCallerSkip(_stdLogDefaultDepth + _loggerWriterDepth)) - logFunc, err := levelToFunc(logger, level) - if err != nil { - return nil, err - } - log.SetOutput(&loggerWriter{logFunc}) - return func() { - log.SetFlags(flags) - log.SetPrefix(prefix) - log.SetOutput(os.Stderr) - }, nil -} - -func levelToFunc(logger *Logger, lvl zapcore.Level) (func(string, ...Field), error) { - switch lvl { - case DebugLevel: - return logger.Debug, nil - case InfoLevel: - return logger.Info, nil - case WarnLevel: - return logger.Warn, nil - case ErrorLevel: - return logger.Error, nil - case DPanicLevel: - return logger.DPanic, nil - case PanicLevel: - return logger.Panic, nil - case FatalLevel: - return logger.Fatal, nil - } - return nil, fmt.Errorf("unrecognized level: %q", lvl) -} - -type loggerWriter struct { - logFunc func(msg string, fields ...Field) -} - -func (l *loggerWriter) Write(p []byte) (int, error) { - p = bytes.TrimSpace(p) - l.logFunc(string(p)) - return len(p), nil -} diff --git a/e2e/vendor/go.uber.org/zap/http_handler.go b/e2e/vendor/go.uber.org/zap/http_handler.go deleted file mode 100644 index 2be8f6515..000000000 --- a/e2e/vendor/go.uber.org/zap/http_handler.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zap - -import ( - "encoding/json" - "errors" - "fmt" - "io" - "net/http" - - "go.uber.org/zap/zapcore" -) - -// ServeHTTP is a simple JSON endpoint that can report on or change the current -// logging level. -// -// # GET -// -// The GET request returns a JSON description of the current logging level like: -// -// {"level":"info"} -// -// # PUT -// -// The PUT request changes the logging level. It is perfectly safe to change the -// logging level while a program is running. Two content types are supported: -// -// Content-Type: application/x-www-form-urlencoded -// -// With this content type, the level can be provided through the request body or -// a query parameter. The log level is URL encoded like: -// -// level=debug -// -// The request body takes precedence over the query parameter, if both are -// specified. -// -// This content type is the default for a curl PUT request. Following are two -// example curl requests that both set the logging level to debug. -// -// curl -X PUT localhost:8080/log/level?level=debug -// curl -X PUT localhost:8080/log/level -d level=debug -// -// For any other content type, the payload is expected to be JSON encoded and -// look like: -// -// {"level":"info"} -// -// An example curl request could look like this: -// -// curl -X PUT localhost:8080/log/level -H "Content-Type: application/json" -d '{"level":"debug"}' -func (lvl AtomicLevel) ServeHTTP(w http.ResponseWriter, r *http.Request) { - if err := lvl.serveHTTP(w, r); err != nil { - w.WriteHeader(http.StatusInternalServerError) - fmt.Fprintf(w, "internal error: %v", err) - } -} - -func (lvl AtomicLevel) serveHTTP(w http.ResponseWriter, r *http.Request) error { - type errorResponse struct { - Error string `json:"error"` - } - type payload struct { - Level zapcore.Level `json:"level"` - } - - enc := json.NewEncoder(w) - - switch r.Method { - case http.MethodGet: - return enc.Encode(payload{Level: lvl.Level()}) - - case http.MethodPut: - requestedLvl, err := decodePutRequest(r.Header.Get("Content-Type"), r) - if err != nil { - w.WriteHeader(http.StatusBadRequest) - return enc.Encode(errorResponse{Error: err.Error()}) - } - lvl.SetLevel(requestedLvl) - return enc.Encode(payload{Level: lvl.Level()}) - - default: - w.WriteHeader(http.StatusMethodNotAllowed) - return enc.Encode(errorResponse{ - Error: "Only GET and PUT are supported.", - }) - } -} - -// Decodes incoming PUT requests and returns the requested logging level. -func decodePutRequest(contentType string, r *http.Request) (zapcore.Level, error) { - if contentType == "application/x-www-form-urlencoded" { - return decodePutURL(r) - } - return decodePutJSON(r.Body) -} - -func decodePutURL(r *http.Request) (zapcore.Level, error) { - lvl := r.FormValue("level") - if lvl == "" { - return 0, errors.New("must specify logging level") - } - var l zapcore.Level - if err := l.UnmarshalText([]byte(lvl)); err != nil { - return 0, err - } - return l, nil -} - -func decodePutJSON(body io.Reader) (zapcore.Level, error) { - var pld struct { - Level *zapcore.Level `json:"level"` - } - if err := json.NewDecoder(body).Decode(&pld); err != nil { - return 0, fmt.Errorf("malformed request body: %v", err) - } - if pld.Level == nil { - return 0, errors.New("must specify logging level") - } - return *pld.Level, nil -} diff --git a/e2e/vendor/go.uber.org/zap/internal/bufferpool/bufferpool.go b/e2e/vendor/go.uber.org/zap/internal/bufferpool/bufferpool.go deleted file mode 100644 index dad583aaa..000000000 --- a/e2e/vendor/go.uber.org/zap/internal/bufferpool/bufferpool.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -// Package bufferpool houses zap's shared internal buffer pool. Third-party -// packages can recreate the same functionality with buffers.NewPool. -package bufferpool - -import "go.uber.org/zap/buffer" - -var ( - _pool = buffer.NewPool() - // Get retrieves a buffer from the pool, creating one if necessary. - Get = _pool.Get -) diff --git a/e2e/vendor/go.uber.org/zap/internal/color/color.go b/e2e/vendor/go.uber.org/zap/internal/color/color.go deleted file mode 100644 index c4d5d02ab..000000000 --- a/e2e/vendor/go.uber.org/zap/internal/color/color.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -// Package color adds coloring functionality for TTY output. -package color - -import "fmt" - -// Foreground colors. -const ( - Black Color = iota + 30 - Red - Green - Yellow - Blue - Magenta - Cyan - White -) - -// Color represents a text color. -type Color uint8 - -// Add adds the coloring to the given string. -func (c Color) Add(s string) string { - return fmt.Sprintf("\x1b[%dm%s\x1b[0m", uint8(c), s) -} diff --git a/e2e/vendor/go.uber.org/zap/internal/exit/exit.go b/e2e/vendor/go.uber.org/zap/internal/exit/exit.go deleted file mode 100644 index f673f9947..000000000 --- a/e2e/vendor/go.uber.org/zap/internal/exit/exit.go +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -// Package exit provides stubs so that unit tests can exercise code that calls -// os.Exit(1). -package exit - -import "os" - -var _exit = os.Exit - -// With terminates the process by calling os.Exit(code). If the package is -// stubbed, it instead records a call in the testing spy. -func With(code int) { - _exit(code) -} - -// A StubbedExit is a testing fake for os.Exit. -type StubbedExit struct { - Exited bool - Code int - prev func(code int) -} - -// Stub substitutes a fake for the call to os.Exit(1). -func Stub() *StubbedExit { - s := &StubbedExit{prev: _exit} - _exit = s.exit - return s -} - -// WithStub runs the supplied function with Exit stubbed. It returns the stub -// used, so that users can test whether the process would have crashed. -func WithStub(f func()) *StubbedExit { - s := Stub() - defer s.Unstub() - f() - return s -} - -// Unstub restores the previous exit function. -func (se *StubbedExit) Unstub() { - _exit = se.prev -} - -func (se *StubbedExit) exit(code int) { - se.Exited = true - se.Code = code -} diff --git a/e2e/vendor/go.uber.org/zap/internal/level_enabler.go b/e2e/vendor/go.uber.org/zap/internal/level_enabler.go deleted file mode 100644 index 40bfed81e..000000000 --- a/e2e/vendor/go.uber.org/zap/internal/level_enabler.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2022 Uber Technologies, Inc. -// -// 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. - -// Package internal and its subpackages hold types and functionality -// that are not part of Zap's public API. -package internal - -import "go.uber.org/zap/zapcore" - -// LeveledEnabler is an interface satisfied by LevelEnablers that are able to -// report their own level. -// -// This interface is defined to use more conveniently in tests and non-zapcore -// packages. -// This cannot be imported from zapcore because of the cyclic dependency. -type LeveledEnabler interface { - zapcore.LevelEnabler - - Level() zapcore.Level -} diff --git a/e2e/vendor/go.uber.org/zap/internal/pool/pool.go b/e2e/vendor/go.uber.org/zap/internal/pool/pool.go deleted file mode 100644 index 60e9d2c43..000000000 --- a/e2e/vendor/go.uber.org/zap/internal/pool/pool.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) 2023 Uber Technologies, Inc. -// -// 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. - -// Package pool provides internal pool utilities. -package pool - -import ( - "sync" -) - -// A Pool is a generic wrapper around [sync.Pool] to provide strongly-typed -// object pooling. -// -// Note that SA6002 (ref: https://staticcheck.io/docs/checks/#SA6002) will -// not be detected, so all internal pool use must take care to only store -// pointer types. -type Pool[T any] struct { - pool sync.Pool -} - -// New returns a new [Pool] for T, and will use fn to construct new Ts when -// the pool is empty. -func New[T any](fn func() T) *Pool[T] { - return &Pool[T]{ - pool: sync.Pool{ - New: func() any { - return fn() - }, - }, - } -} - -// Get gets a T from the pool, or creates a new one if the pool is empty. -func (p *Pool[T]) Get() T { - return p.pool.Get().(T) -} - -// Put returns x into the pool. -func (p *Pool[T]) Put(x T) { - p.pool.Put(x) -} diff --git a/e2e/vendor/go.uber.org/zap/internal/stacktrace/stack.go b/e2e/vendor/go.uber.org/zap/internal/stacktrace/stack.go deleted file mode 100644 index 82af7551f..000000000 --- a/e2e/vendor/go.uber.org/zap/internal/stacktrace/stack.go +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) 2023 Uber Technologies, Inc. -// -// 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. - -// Package stacktrace provides support for gathering stack traces -// efficiently. -package stacktrace - -import ( - "runtime" - - "go.uber.org/zap/buffer" - "go.uber.org/zap/internal/bufferpool" - "go.uber.org/zap/internal/pool" -) - -var _stackPool = pool.New(func() *Stack { - return &Stack{ - storage: make([]uintptr, 64), - } -}) - -// Stack is a captured stack trace. -type Stack struct { - pcs []uintptr // program counters; always a subslice of storage - frames *runtime.Frames - - // The size of pcs varies depending on requirements: - // it will be one if the only the first frame was requested, - // and otherwise it will reflect the depth of the call stack. - // - // storage decouples the slice we need (pcs) from the slice we pool. - // We will always allocate a reasonably large storage, but we'll use - // only as much of it as we need. - storage []uintptr -} - -// Depth specifies how deep of a stack trace should be captured. -type Depth int - -const ( - // First captures only the first frame. - First Depth = iota - - // Full captures the entire call stack, allocating more - // storage for it if needed. - Full -) - -// Capture captures a stack trace of the specified depth, skipping -// the provided number of frames. skip=0 identifies the caller of -// Capture. -// -// The caller must call Free on the returned stacktrace after using it. -func Capture(skip int, depth Depth) *Stack { - stack := _stackPool.Get() - - switch depth { - case First: - stack.pcs = stack.storage[:1] - case Full: - stack.pcs = stack.storage - } - - // Unlike other "skip"-based APIs, skip=0 identifies runtime.Callers - // itself. +2 to skip captureStacktrace and runtime.Callers. - numFrames := runtime.Callers( - skip+2, - stack.pcs, - ) - - // runtime.Callers truncates the recorded stacktrace if there is no - // room in the provided slice. For the full stack trace, keep expanding - // storage until there are fewer frames than there is room. - if depth == Full { - pcs := stack.pcs - for numFrames == len(pcs) { - pcs = make([]uintptr, len(pcs)*2) - numFrames = runtime.Callers(skip+2, pcs) - } - - // Discard old storage instead of returning it to the pool. - // This will adjust the pool size over time if stack traces are - // consistently very deep. - stack.storage = pcs - stack.pcs = pcs[:numFrames] - } else { - stack.pcs = stack.pcs[:numFrames] - } - - stack.frames = runtime.CallersFrames(stack.pcs) - return stack -} - -// Free releases resources associated with this stacktrace -// and returns it back to the pool. -func (st *Stack) Free() { - st.frames = nil - st.pcs = nil - _stackPool.Put(st) -} - -// Count reports the total number of frames in this stacktrace. -// Count DOES NOT change as Next is called. -func (st *Stack) Count() int { - return len(st.pcs) -} - -// Next returns the next frame in the stack trace, -// and a boolean indicating whether there are more after it. -func (st *Stack) Next() (_ runtime.Frame, more bool) { - return st.frames.Next() -} - -// Take returns a string representation of the current stacktrace. -// -// skip is the number of frames to skip before recording the stack trace. -// skip=0 identifies the caller of Take. -func Take(skip int) string { - stack := Capture(skip+1, Full) - defer stack.Free() - - buffer := bufferpool.Get() - defer buffer.Free() - - stackfmt := NewFormatter(buffer) - stackfmt.FormatStack(stack) - return buffer.String() -} - -// Formatter formats a stack trace into a readable string representation. -type Formatter struct { - b *buffer.Buffer - nonEmpty bool // whehther we've written at least one frame already -} - -// NewFormatter builds a new Formatter. -func NewFormatter(b *buffer.Buffer) Formatter { - return Formatter{b: b} -} - -// FormatStack formats all remaining frames in the provided stacktrace -- minus -// the final runtime.main/runtime.goexit frame. -func (sf *Formatter) FormatStack(stack *Stack) { - // Note: On the last iteration, frames.Next() returns false, with a valid - // frame, but we ignore this frame. The last frame is a runtime frame which - // adds noise, since it's only either runtime.main or runtime.goexit. - for frame, more := stack.Next(); more; frame, more = stack.Next() { - sf.FormatFrame(frame) - } -} - -// FormatFrame formats the given frame. -func (sf *Formatter) FormatFrame(frame runtime.Frame) { - if sf.nonEmpty { - sf.b.AppendByte('\n') - } - sf.nonEmpty = true - sf.b.AppendString(frame.Function) - sf.b.AppendByte('\n') - sf.b.AppendByte('\t') - sf.b.AppendString(frame.File) - sf.b.AppendByte(':') - sf.b.AppendInt(int64(frame.Line)) -} diff --git a/e2e/vendor/go.uber.org/zap/level.go b/e2e/vendor/go.uber.org/zap/level.go deleted file mode 100644 index 155b208bd..000000000 --- a/e2e/vendor/go.uber.org/zap/level.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zap - -import ( - "sync/atomic" - - "go.uber.org/zap/internal" - "go.uber.org/zap/zapcore" -) - -const ( - // DebugLevel logs are typically voluminous, and are usually disabled in - // production. - DebugLevel = zapcore.DebugLevel - // InfoLevel is the default logging priority. - InfoLevel = zapcore.InfoLevel - // WarnLevel logs are more important than Info, but don't need individual - // human review. - WarnLevel = zapcore.WarnLevel - // ErrorLevel logs are high-priority. If an application is running smoothly, - // it shouldn't generate any error-level logs. - ErrorLevel = zapcore.ErrorLevel - // DPanicLevel logs are particularly important errors. In development the - // logger panics after writing the message. - DPanicLevel = zapcore.DPanicLevel - // PanicLevel logs a message, then panics. - PanicLevel = zapcore.PanicLevel - // FatalLevel logs a message, then calls os.Exit(1). - FatalLevel = zapcore.FatalLevel -) - -// LevelEnablerFunc is a convenient way to implement zapcore.LevelEnabler with -// an anonymous function. -// -// It's particularly useful when splitting log output between different -// outputs (e.g., standard error and standard out). For sample code, see the -// package-level AdvancedConfiguration example. -type LevelEnablerFunc func(zapcore.Level) bool - -// Enabled calls the wrapped function. -func (f LevelEnablerFunc) Enabled(lvl zapcore.Level) bool { return f(lvl) } - -// An AtomicLevel is an atomically changeable, dynamic logging level. It lets -// you safely change the log level of a tree of loggers (the root logger and -// any children created by adding context) at runtime. -// -// The AtomicLevel itself is an http.Handler that serves a JSON endpoint to -// alter its level. -// -// AtomicLevels must be created with the NewAtomicLevel constructor to allocate -// their internal atomic pointer. -type AtomicLevel struct { - l *atomic.Int32 -} - -var _ internal.LeveledEnabler = AtomicLevel{} - -// NewAtomicLevel creates an AtomicLevel with InfoLevel and above logging -// enabled. -func NewAtomicLevel() AtomicLevel { - lvl := AtomicLevel{l: new(atomic.Int32)} - lvl.l.Store(int32(InfoLevel)) - return lvl -} - -// NewAtomicLevelAt is a convenience function that creates an AtomicLevel -// and then calls SetLevel with the given level. -func NewAtomicLevelAt(l zapcore.Level) AtomicLevel { - a := NewAtomicLevel() - a.SetLevel(l) - return a -} - -// ParseAtomicLevel parses an AtomicLevel based on a lowercase or all-caps ASCII -// representation of the log level. If the provided ASCII representation is -// invalid an error is returned. -// -// This is particularly useful when dealing with text input to configure log -// levels. -func ParseAtomicLevel(text string) (AtomicLevel, error) { - a := NewAtomicLevel() - l, err := zapcore.ParseLevel(text) - if err != nil { - return a, err - } - - a.SetLevel(l) - return a, nil -} - -// Enabled implements the zapcore.LevelEnabler interface, which allows the -// AtomicLevel to be used in place of traditional static levels. -func (lvl AtomicLevel) Enabled(l zapcore.Level) bool { - return lvl.Level().Enabled(l) -} - -// Level returns the minimum enabled log level. -func (lvl AtomicLevel) Level() zapcore.Level { - return zapcore.Level(int8(lvl.l.Load())) -} - -// SetLevel alters the logging level. -func (lvl AtomicLevel) SetLevel(l zapcore.Level) { - lvl.l.Store(int32(l)) -} - -// String returns the string representation of the underlying Level. -func (lvl AtomicLevel) String() string { - return lvl.Level().String() -} - -// UnmarshalText unmarshals the text to an AtomicLevel. It uses the same text -// representations as the static zapcore.Levels ("debug", "info", "warn", -// "error", "dpanic", "panic", and "fatal"). -func (lvl *AtomicLevel) UnmarshalText(text []byte) error { - if lvl.l == nil { - lvl.l = &atomic.Int32{} - } - - var l zapcore.Level - if err := l.UnmarshalText(text); err != nil { - return err - } - - lvl.SetLevel(l) - return nil -} - -// MarshalText marshals the AtomicLevel to a byte slice. It uses the same -// text representation as the static zapcore.Levels ("debug", "info", "warn", -// "error", "dpanic", "panic", and "fatal"). -func (lvl AtomicLevel) MarshalText() (text []byte, err error) { - return lvl.Level().MarshalText() -} diff --git a/e2e/vendor/go.uber.org/zap/logger.go b/e2e/vendor/go.uber.org/zap/logger.go deleted file mode 100644 index c4d300323..000000000 --- a/e2e/vendor/go.uber.org/zap/logger.go +++ /dev/null @@ -1,435 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zap - -import ( - "fmt" - "io" - "os" - "strings" - - "go.uber.org/zap/internal/bufferpool" - "go.uber.org/zap/internal/stacktrace" - "go.uber.org/zap/zapcore" -) - -// A Logger provides fast, leveled, structured logging. All methods are safe -// for concurrent use. -// -// The Logger is designed for contexts in which every microsecond and every -// allocation matters, so its API intentionally favors performance and type -// safety over brevity. For most applications, the SugaredLogger strikes a -// better balance between performance and ergonomics. -type Logger struct { - core zapcore.Core - - development bool - addCaller bool - onPanic zapcore.CheckWriteHook // default is WriteThenPanic - onFatal zapcore.CheckWriteHook // default is WriteThenFatal - - name string - errorOutput zapcore.WriteSyncer - - addStack zapcore.LevelEnabler - - callerSkip int - - clock zapcore.Clock -} - -// New constructs a new Logger from the provided zapcore.Core and Options. If -// the passed zapcore.Core is nil, it falls back to using a no-op -// implementation. -// -// This is the most flexible way to construct a Logger, but also the most -// verbose. For typical use cases, the highly-opinionated presets -// (NewProduction, NewDevelopment, and NewExample) or the Config struct are -// more convenient. -// -// For sample code, see the package-level AdvancedConfiguration example. -func New(core zapcore.Core, options ...Option) *Logger { - if core == nil { - return NewNop() - } - log := &Logger{ - core: core, - errorOutput: zapcore.Lock(os.Stderr), - addStack: zapcore.FatalLevel + 1, - clock: zapcore.DefaultClock, - } - return log.WithOptions(options...) -} - -// NewNop returns a no-op Logger. It never writes out logs or internal errors, -// and it never runs user-defined hooks. -// -// Using WithOptions to replace the Core or error output of a no-op Logger can -// re-enable logging. -func NewNop() *Logger { - return &Logger{ - core: zapcore.NewNopCore(), - errorOutput: zapcore.AddSync(io.Discard), - addStack: zapcore.FatalLevel + 1, - clock: zapcore.DefaultClock, - } -} - -// NewProduction builds a sensible production Logger that writes InfoLevel and -// above logs to standard error as JSON. -// -// It's a shortcut for NewProductionConfig().Build(...Option). -func NewProduction(options ...Option) (*Logger, error) { - return NewProductionConfig().Build(options...) -} - -// NewDevelopment builds a development Logger that writes DebugLevel and above -// logs to standard error in a human-friendly format. -// -// It's a shortcut for NewDevelopmentConfig().Build(...Option). -func NewDevelopment(options ...Option) (*Logger, error) { - return NewDevelopmentConfig().Build(options...) -} - -// Must is a helper that wraps a call to a function returning (*Logger, error) -// and panics if the error is non-nil. It is intended for use in variable -// initialization such as: -// -// var logger = zap.Must(zap.NewProduction()) -func Must(logger *Logger, err error) *Logger { - if err != nil { - panic(err) - } - - return logger -} - -// NewExample builds a Logger that's designed for use in zap's testable -// examples. It writes DebugLevel and above logs to standard out as JSON, but -// omits the timestamp and calling function to keep example output -// short and deterministic. -func NewExample(options ...Option) *Logger { - encoderCfg := zapcore.EncoderConfig{ - MessageKey: "msg", - LevelKey: "level", - NameKey: "logger", - EncodeLevel: zapcore.LowercaseLevelEncoder, - EncodeTime: zapcore.ISO8601TimeEncoder, - EncodeDuration: zapcore.StringDurationEncoder, - } - core := zapcore.NewCore(zapcore.NewJSONEncoder(encoderCfg), os.Stdout, DebugLevel) - return New(core).WithOptions(options...) -} - -// Sugar wraps the Logger to provide a more ergonomic, but slightly slower, -// API. Sugaring a Logger is quite inexpensive, so it's reasonable for a -// single application to use both Loggers and SugaredLoggers, converting -// between them on the boundaries of performance-sensitive code. -func (log *Logger) Sugar() *SugaredLogger { - core := log.clone() - core.callerSkip += 2 - return &SugaredLogger{core} -} - -// Named adds a new path segment to the logger's name. Segments are joined by -// periods. By default, Loggers are unnamed. -func (log *Logger) Named(s string) *Logger { - if s == "" { - return log - } - l := log.clone() - if log.name == "" { - l.name = s - } else { - l.name = strings.Join([]string{l.name, s}, ".") - } - return l -} - -// WithOptions clones the current Logger, applies the supplied Options, and -// returns the resulting Logger. It's safe to use concurrently. -func (log *Logger) WithOptions(opts ...Option) *Logger { - c := log.clone() - for _, opt := range opts { - opt.apply(c) - } - return c -} - -// With creates a child logger and adds structured context to it. Fields added -// to the child don't affect the parent, and vice versa. Any fields that -// require evaluation (such as Objects) are evaluated upon invocation of With. -func (log *Logger) With(fields ...Field) *Logger { - if len(fields) == 0 { - return log - } - l := log.clone() - l.core = l.core.With(fields) - return l -} - -// WithLazy creates a child logger and adds structured context to it lazily. -// -// The fields are evaluated only if the logger is further chained with [With] -// or is written to with any of the log level methods. -// Until that occurs, the logger may retain references to objects inside the fields, -// and logging will reflect the state of an object at the time of logging, -// not the time of WithLazy(). -// -// WithLazy provides a worthwhile performance optimization for contextual loggers -// when the likelihood of using the child logger is low, -// such as error paths and rarely taken branches. -// -// Similar to [With], fields added to the child don't affect the parent, and vice versa. -func (log *Logger) WithLazy(fields ...Field) *Logger { - if len(fields) == 0 { - return log - } - return log.WithOptions(WrapCore(func(core zapcore.Core) zapcore.Core { - return zapcore.NewLazyWith(core, fields) - })) -} - -// Level reports the minimum enabled level for this logger. -// -// For NopLoggers, this is [zapcore.InvalidLevel]. -func (log *Logger) Level() zapcore.Level { - return zapcore.LevelOf(log.core) -} - -// Check returns a CheckedEntry if logging a message at the specified level -// is enabled. It's a completely optional optimization; in high-performance -// applications, Check can help avoid allocating a slice to hold fields. -func (log *Logger) Check(lvl zapcore.Level, msg string) *zapcore.CheckedEntry { - return log.check(lvl, msg) -} - -// Log logs a message at the specified level. The message includes any fields -// passed at the log site, as well as any fields accumulated on the logger. -// Any Fields that require evaluation (such as Objects) are evaluated upon -// invocation of Log. -func (log *Logger) Log(lvl zapcore.Level, msg string, fields ...Field) { - if ce := log.check(lvl, msg); ce != nil { - ce.Write(fields...) - } -} - -// Debug logs a message at DebugLevel. The message includes any fields passed -// at the log site, as well as any fields accumulated on the logger. -func (log *Logger) Debug(msg string, fields ...Field) { - if ce := log.check(DebugLevel, msg); ce != nil { - ce.Write(fields...) - } -} - -// Info logs a message at InfoLevel. The message includes any fields passed -// at the log site, as well as any fields accumulated on the logger. -func (log *Logger) Info(msg string, fields ...Field) { - if ce := log.check(InfoLevel, msg); ce != nil { - ce.Write(fields...) - } -} - -// Warn logs a message at WarnLevel. The message includes any fields passed -// at the log site, as well as any fields accumulated on the logger. -func (log *Logger) Warn(msg string, fields ...Field) { - if ce := log.check(WarnLevel, msg); ce != nil { - ce.Write(fields...) - } -} - -// Error logs a message at ErrorLevel. The message includes any fields passed -// at the log site, as well as any fields accumulated on the logger. -func (log *Logger) Error(msg string, fields ...Field) { - if ce := log.check(ErrorLevel, msg); ce != nil { - ce.Write(fields...) - } -} - -// DPanic logs a message at DPanicLevel. The message includes any fields -// passed at the log site, as well as any fields accumulated on the logger. -// -// If the logger is in development mode, it then panics (DPanic means -// "development panic"). This is useful for catching errors that are -// recoverable, but shouldn't ever happen. -func (log *Logger) DPanic(msg string, fields ...Field) { - if ce := log.check(DPanicLevel, msg); ce != nil { - ce.Write(fields...) - } -} - -// Panic logs a message at PanicLevel. The message includes any fields passed -// at the log site, as well as any fields accumulated on the logger. -// -// The logger then panics, even if logging at PanicLevel is disabled. -func (log *Logger) Panic(msg string, fields ...Field) { - if ce := log.check(PanicLevel, msg); ce != nil { - ce.Write(fields...) - } -} - -// Fatal logs a message at FatalLevel. The message includes any fields passed -// at the log site, as well as any fields accumulated on the logger. -// -// The logger then calls os.Exit(1), even if logging at FatalLevel is -// disabled. -func (log *Logger) Fatal(msg string, fields ...Field) { - if ce := log.check(FatalLevel, msg); ce != nil { - ce.Write(fields...) - } -} - -// Sync calls the underlying Core's Sync method, flushing any buffered log -// entries. Applications should take care to call Sync before exiting. -func (log *Logger) Sync() error { - return log.core.Sync() -} - -// Core returns the Logger's underlying zapcore.Core. -func (log *Logger) Core() zapcore.Core { - return log.core -} - -// Name returns the Logger's underlying name, -// or an empty string if the logger is unnamed. -func (log *Logger) Name() string { - return log.name -} - -func (log *Logger) clone() *Logger { - clone := *log - return &clone -} - -func (log *Logger) check(lvl zapcore.Level, msg string) *zapcore.CheckedEntry { - // Logger.check must always be called directly by a method in the - // Logger interface (e.g., Check, Info, Fatal). - // This skips Logger.check and the Info/Fatal/Check/etc. method that - // called it. - const callerSkipOffset = 2 - - // Check the level first to reduce the cost of disabled log calls. - // Since Panic and higher may exit, we skip the optimization for those levels. - if lvl < zapcore.DPanicLevel && !log.core.Enabled(lvl) { - return nil - } - - // Create basic checked entry thru the core; this will be non-nil if the - // log message will actually be written somewhere. - ent := zapcore.Entry{ - LoggerName: log.name, - Time: log.clock.Now(), - Level: lvl, - Message: msg, - } - ce := log.core.Check(ent, nil) - willWrite := ce != nil - - // Set up any required terminal behavior. - switch ent.Level { - case zapcore.PanicLevel: - ce = ce.After(ent, terminalHookOverride(zapcore.WriteThenPanic, log.onPanic)) - case zapcore.FatalLevel: - ce = ce.After(ent, terminalHookOverride(zapcore.WriteThenFatal, log.onFatal)) - case zapcore.DPanicLevel: - if log.development { - ce = ce.After(ent, terminalHookOverride(zapcore.WriteThenPanic, log.onPanic)) - } - } - - // Only do further annotation if we're going to write this message; checked - // entries that exist only for terminal behavior don't benefit from - // annotation. - if !willWrite { - return ce - } - - // Thread the error output through to the CheckedEntry. - ce.ErrorOutput = log.errorOutput - - addStack := log.addStack.Enabled(ce.Level) - if !log.addCaller && !addStack { - return ce - } - - // Adding the caller or stack trace requires capturing the callers of - // this function. We'll share information between these two. - stackDepth := stacktrace.First - if addStack { - stackDepth = stacktrace.Full - } - stack := stacktrace.Capture(log.callerSkip+callerSkipOffset, stackDepth) - defer stack.Free() - - if stack.Count() == 0 { - if log.addCaller { - fmt.Fprintf(log.errorOutput, "%v Logger.check error: failed to get caller\n", ent.Time.UTC()) - _ = log.errorOutput.Sync() - } - return ce - } - - frame, more := stack.Next() - - if log.addCaller { - ce.Caller = zapcore.EntryCaller{ - Defined: frame.PC != 0, - PC: frame.PC, - File: frame.File, - Line: frame.Line, - Function: frame.Function, - } - } - - if addStack { - buffer := bufferpool.Get() - defer buffer.Free() - - stackfmt := stacktrace.NewFormatter(buffer) - - // We've already extracted the first frame, so format that - // separately and defer to stackfmt for the rest. - stackfmt.FormatFrame(frame) - if more { - stackfmt.FormatStack(stack) - } - ce.Stack = buffer.String() - } - - return ce -} - -func terminalHookOverride(defaultHook, override zapcore.CheckWriteHook) zapcore.CheckWriteHook { - // A nil or WriteThenNoop hook will lead to continued execution after - // a Panic or Fatal log entry, which is unexpected. For example, - // - // f, err := os.Open(..) - // if err != nil { - // log.Fatal("cannot open", zap.Error(err)) - // } - // fmt.Println(f.Name()) - // - // The f.Name() will panic if we continue execution after the log.Fatal. - if override == nil || override == zapcore.WriteThenNoop { - return defaultHook - } - return override -} diff --git a/e2e/vendor/go.uber.org/zap/options.go b/e2e/vendor/go.uber.org/zap/options.go deleted file mode 100644 index 43d357ac9..000000000 --- a/e2e/vendor/go.uber.org/zap/options.go +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zap - -import ( - "fmt" - - "go.uber.org/zap/zapcore" -) - -// An Option configures a Logger. -type Option interface { - apply(*Logger) -} - -// optionFunc wraps a func so it satisfies the Option interface. -type optionFunc func(*Logger) - -func (f optionFunc) apply(log *Logger) { - f(log) -} - -// WrapCore wraps or replaces the Logger's underlying zapcore.Core. -func WrapCore(f func(zapcore.Core) zapcore.Core) Option { - return optionFunc(func(log *Logger) { - log.core = f(log.core) - }) -} - -// Hooks registers functions which will be called each time the Logger writes -// out an Entry. Repeated use of Hooks is additive. -// -// Hooks are useful for simple side effects, like capturing metrics for the -// number of emitted logs. More complex side effects, including anything that -// requires access to the Entry's structured fields, should be implemented as -// a zapcore.Core instead. See zapcore.RegisterHooks for details. -func Hooks(hooks ...func(zapcore.Entry) error) Option { - return optionFunc(func(log *Logger) { - log.core = zapcore.RegisterHooks(log.core, hooks...) - }) -} - -// Fields adds fields to the Logger. -func Fields(fs ...Field) Option { - return optionFunc(func(log *Logger) { - log.core = log.core.With(fs) - }) -} - -// ErrorOutput sets the destination for errors generated by the Logger. Note -// that this option only affects internal errors; for sample code that sends -// error-level logs to a different location from info- and debug-level logs, -// see the package-level AdvancedConfiguration example. -// -// The supplied WriteSyncer must be safe for concurrent use. The Open and -// zapcore.Lock functions are the simplest ways to protect files with a mutex. -func ErrorOutput(w zapcore.WriteSyncer) Option { - return optionFunc(func(log *Logger) { - log.errorOutput = w - }) -} - -// Development puts the logger in development mode, which makes DPanic-level -// logs panic instead of simply logging an error. -func Development() Option { - return optionFunc(func(log *Logger) { - log.development = true - }) -} - -// AddCaller configures the Logger to annotate each message with the filename, -// line number, and function name of zap's caller. See also WithCaller. -func AddCaller() Option { - return WithCaller(true) -} - -// WithCaller configures the Logger to annotate each message with the filename, -// line number, and function name of zap's caller, or not, depending on the -// value of enabled. This is a generalized form of AddCaller. -func WithCaller(enabled bool) Option { - return optionFunc(func(log *Logger) { - log.addCaller = enabled - }) -} - -// AddCallerSkip increases the number of callers skipped by caller annotation -// (as enabled by the AddCaller option). When building wrappers around the -// Logger and SugaredLogger, supplying this Option prevents zap from always -// reporting the wrapper code as the caller. -func AddCallerSkip(skip int) Option { - return optionFunc(func(log *Logger) { - log.callerSkip += skip - }) -} - -// AddStacktrace configures the Logger to record a stack trace for all messages at -// or above a given level. -func AddStacktrace(lvl zapcore.LevelEnabler) Option { - return optionFunc(func(log *Logger) { - log.addStack = lvl - }) -} - -// IncreaseLevel increase the level of the logger. It has no effect if -// the passed in level tries to decrease the level of the logger. -func IncreaseLevel(lvl zapcore.LevelEnabler) Option { - return optionFunc(func(log *Logger) { - core, err := zapcore.NewIncreaseLevelCore(log.core, lvl) - if err != nil { - fmt.Fprintf(log.errorOutput, "failed to IncreaseLevel: %v\n", err) - } else { - log.core = core - } - }) -} - -// WithPanicHook sets a CheckWriteHook to run on Panic/DPanic logs. -// Zap will call this hook after writing a log statement with a Panic/DPanic level. -// -// For example, the following builds a logger that will exit the current -// goroutine after writing a Panic/DPanic log message, but it will not start a panic. -// -// zap.New(core, zap.WithPanicHook(zapcore.WriteThenGoexit)) -// -// This is useful for testing Panic/DPanic log output. -func WithPanicHook(hook zapcore.CheckWriteHook) Option { - return optionFunc(func(log *Logger) { - log.onPanic = hook - }) -} - -// OnFatal sets the action to take on fatal logs. -// -// Deprecated: Use [WithFatalHook] instead. -func OnFatal(action zapcore.CheckWriteAction) Option { - return WithFatalHook(action) -} - -// WithFatalHook sets a CheckWriteHook to run on fatal logs. -// Zap will call this hook after writing a log statement with a Fatal level. -// -// For example, the following builds a logger that will exit the current -// goroutine after writing a fatal log message, but it will not exit the -// program. -// -// zap.New(core, zap.WithFatalHook(zapcore.WriteThenGoexit)) -// -// It is important that the provided CheckWriteHook stops the control flow at -// the current statement to meet expectations of callers of the logger. -// We recommend calling os.Exit or runtime.Goexit inside custom hooks at -// minimum. -func WithFatalHook(hook zapcore.CheckWriteHook) Option { - return optionFunc(func(log *Logger) { - log.onFatal = hook - }) -} - -// WithClock specifies the clock used by the logger to determine the current -// time for logged entries. Defaults to the system clock with time.Now. -func WithClock(clock zapcore.Clock) Option { - return optionFunc(func(log *Logger) { - log.clock = clock - }) -} diff --git a/e2e/vendor/go.uber.org/zap/sink.go b/e2e/vendor/go.uber.org/zap/sink.go deleted file mode 100644 index 499772a00..000000000 --- a/e2e/vendor/go.uber.org/zap/sink.go +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) 2016-2022 Uber Technologies, Inc. -// -// 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. - -package zap - -import ( - "errors" - "fmt" - "io" - "net/url" - "os" - "path/filepath" - "strings" - "sync" - - "go.uber.org/zap/zapcore" -) - -const schemeFile = "file" - -var _sinkRegistry = newSinkRegistry() - -// Sink defines the interface to write to and close logger destinations. -type Sink interface { - zapcore.WriteSyncer - io.Closer -} - -type errSinkNotFound struct { - scheme string -} - -func (e *errSinkNotFound) Error() string { - return fmt.Sprintf("no sink found for scheme %q", e.scheme) -} - -type nopCloserSink struct{ zapcore.WriteSyncer } - -func (nopCloserSink) Close() error { return nil } - -type sinkRegistry struct { - mu sync.Mutex - factories map[string]func(*url.URL) (Sink, error) // keyed by scheme - openFile func(string, int, os.FileMode) (*os.File, error) // type matches os.OpenFile -} - -func newSinkRegistry() *sinkRegistry { - sr := &sinkRegistry{ - factories: make(map[string]func(*url.URL) (Sink, error)), - openFile: os.OpenFile, - } - // Infallible operation: the registry is empty, so we can't have a conflict. - _ = sr.RegisterSink(schemeFile, sr.newFileSinkFromURL) - return sr -} - -// RegisterScheme registers the given factory for the specific scheme. -func (sr *sinkRegistry) RegisterSink(scheme string, factory func(*url.URL) (Sink, error)) error { - sr.mu.Lock() - defer sr.mu.Unlock() - - if scheme == "" { - return errors.New("can't register a sink factory for empty string") - } - normalized, err := normalizeScheme(scheme) - if err != nil { - return fmt.Errorf("%q is not a valid scheme: %v", scheme, err) - } - if _, ok := sr.factories[normalized]; ok { - return fmt.Errorf("sink factory already registered for scheme %q", normalized) - } - sr.factories[normalized] = factory - return nil -} - -func (sr *sinkRegistry) newSink(rawURL string) (Sink, error) { - // URL parsing doesn't work well for Windows paths such as `c:\log.txt`, as scheme is set to - // the drive, and path is unset unless `c:/log.txt` is used. - // To avoid Windows-specific URL handling, we instead check IsAbs to open as a file. - // filepath.IsAbs is OS-specific, so IsAbs('c:/log.txt') is false outside of Windows. - if filepath.IsAbs(rawURL) { - return sr.newFileSinkFromPath(rawURL) - } - - u, err := url.Parse(rawURL) - if err != nil { - return nil, fmt.Errorf("can't parse %q as a URL: %v", rawURL, err) - } - if u.Scheme == "" { - u.Scheme = schemeFile - } - - sr.mu.Lock() - factory, ok := sr.factories[u.Scheme] - sr.mu.Unlock() - if !ok { - return nil, &errSinkNotFound{u.Scheme} - } - return factory(u) -} - -// RegisterSink registers a user-supplied factory for all sinks with a -// particular scheme. -// -// All schemes must be ASCII, valid under section 0.1 of RFC 3986 -// (https://tools.ietf.org/html/rfc3983#section-3.1), and must not already -// have a factory registered. Zap automatically registers a factory for the -// "file" scheme. -func RegisterSink(scheme string, factory func(*url.URL) (Sink, error)) error { - return _sinkRegistry.RegisterSink(scheme, factory) -} - -func (sr *sinkRegistry) newFileSinkFromURL(u *url.URL) (Sink, error) { - if u.User != nil { - return nil, fmt.Errorf("user and password not allowed with file URLs: got %v", u) - } - if u.Fragment != "" { - return nil, fmt.Errorf("fragments not allowed with file URLs: got %v", u) - } - if u.RawQuery != "" { - return nil, fmt.Errorf("query parameters not allowed with file URLs: got %v", u) - } - // Error messages are better if we check hostname and port separately. - if u.Port() != "" { - return nil, fmt.Errorf("ports not allowed with file URLs: got %v", u) - } - if hn := u.Hostname(); hn != "" && hn != "localhost" { - return nil, fmt.Errorf("file URLs must leave host empty or use localhost: got %v", u) - } - - return sr.newFileSinkFromPath(u.Path) -} - -func (sr *sinkRegistry) newFileSinkFromPath(path string) (Sink, error) { - switch path { - case "stdout": - return nopCloserSink{os.Stdout}, nil - case "stderr": - return nopCloserSink{os.Stderr}, nil - } - return sr.openFile(path, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0o666) -} - -func normalizeScheme(s string) (string, error) { - // https://tools.ietf.org/html/rfc3986#section-3.1 - s = strings.ToLower(s) - if first := s[0]; 'a' > first || 'z' < first { - return "", errors.New("must start with a letter") - } - for i := 1; i < len(s); i++ { // iterate over bytes, not runes - c := s[i] - switch { - case 'a' <= c && c <= 'z': - continue - case '0' <= c && c <= '9': - continue - case c == '.' || c == '+' || c == '-': - continue - } - return "", fmt.Errorf("may not contain %q", c) - } - return s, nil -} diff --git a/e2e/vendor/go.uber.org/zap/sugar.go b/e2e/vendor/go.uber.org/zap/sugar.go deleted file mode 100644 index 8904cd087..000000000 --- a/e2e/vendor/go.uber.org/zap/sugar.go +++ /dev/null @@ -1,476 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zap - -import ( - "fmt" - - "go.uber.org/zap/zapcore" - - "go.uber.org/multierr" -) - -const ( - _oddNumberErrMsg = "Ignored key without a value." - _nonStringKeyErrMsg = "Ignored key-value pairs with non-string keys." - _multipleErrMsg = "Multiple errors without a key." -) - -// A SugaredLogger wraps the base Logger functionality in a slower, but less -// verbose, API. Any Logger can be converted to a SugaredLogger with its Sugar -// method. -// -// Unlike the Logger, the SugaredLogger doesn't insist on structured logging. -// For each log level, it exposes four methods: -// -// - methods named after the log level for log.Print-style logging -// - methods ending in "w" for loosely-typed structured logging -// - methods ending in "f" for log.Printf-style logging -// - methods ending in "ln" for log.Println-style logging -// -// For example, the methods for InfoLevel are: -// -// Info(...any) Print-style logging -// Infow(...any) Structured logging (read as "info with") -// Infof(string, ...any) Printf-style logging -// Infoln(...any) Println-style logging -type SugaredLogger struct { - base *Logger -} - -// Desugar unwraps a SugaredLogger, exposing the original Logger. Desugaring -// is quite inexpensive, so it's reasonable for a single application to use -// both Loggers and SugaredLoggers, converting between them on the boundaries -// of performance-sensitive code. -func (s *SugaredLogger) Desugar() *Logger { - base := s.base.clone() - base.callerSkip -= 2 - return base -} - -// Named adds a sub-scope to the logger's name. See Logger.Named for details. -func (s *SugaredLogger) Named(name string) *SugaredLogger { - return &SugaredLogger{base: s.base.Named(name)} -} - -// WithOptions clones the current SugaredLogger, applies the supplied Options, -// and returns the result. It's safe to use concurrently. -func (s *SugaredLogger) WithOptions(opts ...Option) *SugaredLogger { - base := s.base.clone() - for _, opt := range opts { - opt.apply(base) - } - return &SugaredLogger{base: base} -} - -// With adds a variadic number of fields to the logging context. It accepts a -// mix of strongly-typed Field objects and loosely-typed key-value pairs. When -// processing pairs, the first element of the pair is used as the field key -// and the second as the field value. -// -// For example, -// -// sugaredLogger.With( -// "hello", "world", -// "failure", errors.New("oh no"), -// Stack(), -// "count", 42, -// "user", User{Name: "alice"}, -// ) -// -// is the equivalent of -// -// unsugared.With( -// String("hello", "world"), -// String("failure", "oh no"), -// Stack(), -// Int("count", 42), -// Object("user", User{Name: "alice"}), -// ) -// -// Note that the keys in key-value pairs should be strings. In development, -// passing a non-string key panics. In production, the logger is more -// forgiving: a separate error is logged, but the key-value pair is skipped -// and execution continues. Passing an orphaned key triggers similar behavior: -// panics in development and errors in production. -func (s *SugaredLogger) With(args ...interface{}) *SugaredLogger { - return &SugaredLogger{base: s.base.With(s.sweetenFields(args)...)} -} - -// WithLazy adds a variadic number of fields to the logging context lazily. -// The fields are evaluated only if the logger is further chained with [With] -// or is written to with any of the log level methods. -// Until that occurs, the logger may retain references to objects inside the fields, -// and logging will reflect the state of an object at the time of logging, -// not the time of WithLazy(). -// -// Similar to [With], fields added to the child don't affect the parent, -// and vice versa. Also, the keys in key-value pairs should be strings. In development, -// passing a non-string key panics, while in production it logs an error and skips the pair. -// Passing an orphaned key has the same behavior. -func (s *SugaredLogger) WithLazy(args ...interface{}) *SugaredLogger { - return &SugaredLogger{base: s.base.WithLazy(s.sweetenFields(args)...)} -} - -// Level reports the minimum enabled level for this logger. -// -// For NopLoggers, this is [zapcore.InvalidLevel]. -func (s *SugaredLogger) Level() zapcore.Level { - return zapcore.LevelOf(s.base.core) -} - -// Log logs the provided arguments at provided level. -// Spaces are added between arguments when neither is a string. -func (s *SugaredLogger) Log(lvl zapcore.Level, args ...interface{}) { - s.log(lvl, "", args, nil) -} - -// Debug logs the provided arguments at [DebugLevel]. -// Spaces are added between arguments when neither is a string. -func (s *SugaredLogger) Debug(args ...interface{}) { - s.log(DebugLevel, "", args, nil) -} - -// Info logs the provided arguments at [InfoLevel]. -// Spaces are added between arguments when neither is a string. -func (s *SugaredLogger) Info(args ...interface{}) { - s.log(InfoLevel, "", args, nil) -} - -// Warn logs the provided arguments at [WarnLevel]. -// Spaces are added between arguments when neither is a string. -func (s *SugaredLogger) Warn(args ...interface{}) { - s.log(WarnLevel, "", args, nil) -} - -// Error logs the provided arguments at [ErrorLevel]. -// Spaces are added between arguments when neither is a string. -func (s *SugaredLogger) Error(args ...interface{}) { - s.log(ErrorLevel, "", args, nil) -} - -// DPanic logs the provided arguments at [DPanicLevel]. -// In development, the logger then panics. (See [DPanicLevel] for details.) -// Spaces are added between arguments when neither is a string. -func (s *SugaredLogger) DPanic(args ...interface{}) { - s.log(DPanicLevel, "", args, nil) -} - -// Panic constructs a message with the provided arguments and panics. -// Spaces are added between arguments when neither is a string. -func (s *SugaredLogger) Panic(args ...interface{}) { - s.log(PanicLevel, "", args, nil) -} - -// Fatal constructs a message with the provided arguments and calls os.Exit. -// Spaces are added between arguments when neither is a string. -func (s *SugaredLogger) Fatal(args ...interface{}) { - s.log(FatalLevel, "", args, nil) -} - -// Logf formats the message according to the format specifier -// and logs it at provided level. -func (s *SugaredLogger) Logf(lvl zapcore.Level, template string, args ...interface{}) { - s.log(lvl, template, args, nil) -} - -// Debugf formats the message according to the format specifier -// and logs it at [DebugLevel]. -func (s *SugaredLogger) Debugf(template string, args ...interface{}) { - s.log(DebugLevel, template, args, nil) -} - -// Infof formats the message according to the format specifier -// and logs it at [InfoLevel]. -func (s *SugaredLogger) Infof(template string, args ...interface{}) { - s.log(InfoLevel, template, args, nil) -} - -// Warnf formats the message according to the format specifier -// and logs it at [WarnLevel]. -func (s *SugaredLogger) Warnf(template string, args ...interface{}) { - s.log(WarnLevel, template, args, nil) -} - -// Errorf formats the message according to the format specifier -// and logs it at [ErrorLevel]. -func (s *SugaredLogger) Errorf(template string, args ...interface{}) { - s.log(ErrorLevel, template, args, nil) -} - -// DPanicf formats the message according to the format specifier -// and logs it at [DPanicLevel]. -// In development, the logger then panics. (See [DPanicLevel] for details.) -func (s *SugaredLogger) DPanicf(template string, args ...interface{}) { - s.log(DPanicLevel, template, args, nil) -} - -// Panicf formats the message according to the format specifier -// and panics. -func (s *SugaredLogger) Panicf(template string, args ...interface{}) { - s.log(PanicLevel, template, args, nil) -} - -// Fatalf formats the message according to the format specifier -// and calls os.Exit. -func (s *SugaredLogger) Fatalf(template string, args ...interface{}) { - s.log(FatalLevel, template, args, nil) -} - -// Logw logs a message with some additional context. The variadic key-value -// pairs are treated as they are in With. -func (s *SugaredLogger) Logw(lvl zapcore.Level, msg string, keysAndValues ...interface{}) { - s.log(lvl, msg, nil, keysAndValues) -} - -// Debugw logs a message with some additional context. The variadic key-value -// pairs are treated as they are in With. -// -// When debug-level logging is disabled, this is much faster than -// -// s.With(keysAndValues).Debug(msg) -func (s *SugaredLogger) Debugw(msg string, keysAndValues ...interface{}) { - s.log(DebugLevel, msg, nil, keysAndValues) -} - -// Infow logs a message with some additional context. The variadic key-value -// pairs are treated as they are in With. -func (s *SugaredLogger) Infow(msg string, keysAndValues ...interface{}) { - s.log(InfoLevel, msg, nil, keysAndValues) -} - -// Warnw logs a message with some additional context. The variadic key-value -// pairs are treated as they are in With. -func (s *SugaredLogger) Warnw(msg string, keysAndValues ...interface{}) { - s.log(WarnLevel, msg, nil, keysAndValues) -} - -// Errorw logs a message with some additional context. The variadic key-value -// pairs are treated as they are in With. -func (s *SugaredLogger) Errorw(msg string, keysAndValues ...interface{}) { - s.log(ErrorLevel, msg, nil, keysAndValues) -} - -// DPanicw logs a message with some additional context. In development, the -// logger then panics. (See DPanicLevel for details.) The variadic key-value -// pairs are treated as they are in With. -func (s *SugaredLogger) DPanicw(msg string, keysAndValues ...interface{}) { - s.log(DPanicLevel, msg, nil, keysAndValues) -} - -// Panicw logs a message with some additional context, then panics. The -// variadic key-value pairs are treated as they are in With. -func (s *SugaredLogger) Panicw(msg string, keysAndValues ...interface{}) { - s.log(PanicLevel, msg, nil, keysAndValues) -} - -// Fatalw logs a message with some additional context, then calls os.Exit. The -// variadic key-value pairs are treated as they are in With. -func (s *SugaredLogger) Fatalw(msg string, keysAndValues ...interface{}) { - s.log(FatalLevel, msg, nil, keysAndValues) -} - -// Logln logs a message at provided level. -// Spaces are always added between arguments. -func (s *SugaredLogger) Logln(lvl zapcore.Level, args ...interface{}) { - s.logln(lvl, args, nil) -} - -// Debugln logs a message at [DebugLevel]. -// Spaces are always added between arguments. -func (s *SugaredLogger) Debugln(args ...interface{}) { - s.logln(DebugLevel, args, nil) -} - -// Infoln logs a message at [InfoLevel]. -// Spaces are always added between arguments. -func (s *SugaredLogger) Infoln(args ...interface{}) { - s.logln(InfoLevel, args, nil) -} - -// Warnln logs a message at [WarnLevel]. -// Spaces are always added between arguments. -func (s *SugaredLogger) Warnln(args ...interface{}) { - s.logln(WarnLevel, args, nil) -} - -// Errorln logs a message at [ErrorLevel]. -// Spaces are always added between arguments. -func (s *SugaredLogger) Errorln(args ...interface{}) { - s.logln(ErrorLevel, args, nil) -} - -// DPanicln logs a message at [DPanicLevel]. -// In development, the logger then panics. (See [DPanicLevel] for details.) -// Spaces are always added between arguments. -func (s *SugaredLogger) DPanicln(args ...interface{}) { - s.logln(DPanicLevel, args, nil) -} - -// Panicln logs a message at [PanicLevel] and panics. -// Spaces are always added between arguments. -func (s *SugaredLogger) Panicln(args ...interface{}) { - s.logln(PanicLevel, args, nil) -} - -// Fatalln logs a message at [FatalLevel] and calls os.Exit. -// Spaces are always added between arguments. -func (s *SugaredLogger) Fatalln(args ...interface{}) { - s.logln(FatalLevel, args, nil) -} - -// Sync flushes any buffered log entries. -func (s *SugaredLogger) Sync() error { - return s.base.Sync() -} - -// log message with Sprint, Sprintf, or neither. -func (s *SugaredLogger) log(lvl zapcore.Level, template string, fmtArgs []interface{}, context []interface{}) { - // If logging at this level is completely disabled, skip the overhead of - // string formatting. - if lvl < DPanicLevel && !s.base.Core().Enabled(lvl) { - return - } - - msg := getMessage(template, fmtArgs) - if ce := s.base.Check(lvl, msg); ce != nil { - ce.Write(s.sweetenFields(context)...) - } -} - -// logln message with Sprintln -func (s *SugaredLogger) logln(lvl zapcore.Level, fmtArgs []interface{}, context []interface{}) { - if lvl < DPanicLevel && !s.base.Core().Enabled(lvl) { - return - } - - msg := getMessageln(fmtArgs) - if ce := s.base.Check(lvl, msg); ce != nil { - ce.Write(s.sweetenFields(context)...) - } -} - -// getMessage format with Sprint, Sprintf, or neither. -func getMessage(template string, fmtArgs []interface{}) string { - if len(fmtArgs) == 0 { - return template - } - - if template != "" { - return fmt.Sprintf(template, fmtArgs...) - } - - if len(fmtArgs) == 1 { - if str, ok := fmtArgs[0].(string); ok { - return str - } - } - return fmt.Sprint(fmtArgs...) -} - -// getMessageln format with Sprintln. -func getMessageln(fmtArgs []interface{}) string { - msg := fmt.Sprintln(fmtArgs...) - return msg[:len(msg)-1] -} - -func (s *SugaredLogger) sweetenFields(args []interface{}) []Field { - if len(args) == 0 { - return nil - } - - var ( - // Allocate enough space for the worst case; if users pass only structured - // fields, we shouldn't penalize them with extra allocations. - fields = make([]Field, 0, len(args)) - invalid invalidPairs - seenError bool - ) - - for i := 0; i < len(args); { - // This is a strongly-typed field. Consume it and move on. - if f, ok := args[i].(Field); ok { - fields = append(fields, f) - i++ - continue - } - - // If it is an error, consume it and move on. - if err, ok := args[i].(error); ok { - if !seenError { - seenError = true - fields = append(fields, Error(err)) - } else { - s.base.Error(_multipleErrMsg, Error(err)) - } - i++ - continue - } - - // Make sure this element isn't a dangling key. - if i == len(args)-1 { - s.base.Error(_oddNumberErrMsg, Any("ignored", args[i])) - break - } - - // Consume this value and the next, treating them as a key-value pair. If the - // key isn't a string, add this pair to the slice of invalid pairs. - key, val := args[i], args[i+1] - if keyStr, ok := key.(string); !ok { - // Subsequent errors are likely, so allocate once up front. - if cap(invalid) == 0 { - invalid = make(invalidPairs, 0, len(args)/2) - } - invalid = append(invalid, invalidPair{i, key, val}) - } else { - fields = append(fields, Any(keyStr, val)) - } - i += 2 - } - - // If we encountered any invalid key-value pairs, log an error. - if len(invalid) > 0 { - s.base.Error(_nonStringKeyErrMsg, Array("invalid", invalid)) - } - return fields -} - -type invalidPair struct { - position int - key, value interface{} -} - -func (p invalidPair) MarshalLogObject(enc zapcore.ObjectEncoder) error { - enc.AddInt64("position", int64(p.position)) - Any("key", p.key).AddTo(enc) - Any("value", p.value).AddTo(enc) - return nil -} - -type invalidPairs []invalidPair - -func (ps invalidPairs) MarshalLogArray(enc zapcore.ArrayEncoder) error { - var err error - for i := range ps { - err = multierr.Append(err, enc.AppendObject(ps[i])) - } - return err -} diff --git a/e2e/vendor/go.uber.org/zap/time.go b/e2e/vendor/go.uber.org/zap/time.go deleted file mode 100644 index c5a1f1622..000000000 --- a/e2e/vendor/go.uber.org/zap/time.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zap - -import "time" - -func timeToMillis(t time.Time) int64 { - return t.UnixNano() / int64(time.Millisecond) -} diff --git a/e2e/vendor/go.uber.org/zap/writer.go b/e2e/vendor/go.uber.org/zap/writer.go deleted file mode 100644 index 06768c679..000000000 --- a/e2e/vendor/go.uber.org/zap/writer.go +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) 2016-2022 Uber Technologies, Inc. -// -// 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. - -package zap - -import ( - "fmt" - "io" - - "go.uber.org/zap/zapcore" - - "go.uber.org/multierr" -) - -// Open is a high-level wrapper that takes a variadic number of URLs, opens or -// creates each of the specified resources, and combines them into a locked -// WriteSyncer. It also returns any error encountered and a function to close -// any opened files. -// -// Passing no URLs returns a no-op WriteSyncer. Zap handles URLs without a -// scheme and URLs with the "file" scheme. Third-party code may register -// factories for other schemes using RegisterSink. -// -// URLs with the "file" scheme must use absolute paths on the local -// filesystem. No user, password, port, fragments, or query parameters are -// allowed, and the hostname must be empty or "localhost". -// -// Since it's common to write logs to the local filesystem, URLs without a -// scheme (e.g., "/var/log/foo.log") are treated as local file paths. Without -// a scheme, the special paths "stdout" and "stderr" are interpreted as -// os.Stdout and os.Stderr. When specified without a scheme, relative file -// paths also work. -func Open(paths ...string) (zapcore.WriteSyncer, func(), error) { - writers, closeAll, err := open(paths) - if err != nil { - return nil, nil, err - } - - writer := CombineWriteSyncers(writers...) - return writer, closeAll, nil -} - -func open(paths []string) ([]zapcore.WriteSyncer, func(), error) { - writers := make([]zapcore.WriteSyncer, 0, len(paths)) - closers := make([]io.Closer, 0, len(paths)) - closeAll := func() { - for _, c := range closers { - _ = c.Close() - } - } - - var openErr error - for _, path := range paths { - sink, err := _sinkRegistry.newSink(path) - if err != nil { - openErr = multierr.Append(openErr, fmt.Errorf("open sink %q: %w", path, err)) - continue - } - writers = append(writers, sink) - closers = append(closers, sink) - } - if openErr != nil { - closeAll() - return nil, nil, openErr - } - - return writers, closeAll, nil -} - -// CombineWriteSyncers is a utility that combines multiple WriteSyncers into a -// single, locked WriteSyncer. If no inputs are supplied, it returns a no-op -// WriteSyncer. -// -// It's provided purely as a convenience; the result is no different from -// using zapcore.NewMultiWriteSyncer and zapcore.Lock individually. -func CombineWriteSyncers(writers ...zapcore.WriteSyncer) zapcore.WriteSyncer { - if len(writers) == 0 { - return zapcore.AddSync(io.Discard) - } - return zapcore.Lock(zapcore.NewMultiWriteSyncer(writers...)) -} diff --git a/e2e/vendor/go.uber.org/zap/zapcore/buffered_write_syncer.go b/e2e/vendor/go.uber.org/zap/zapcore/buffered_write_syncer.go deleted file mode 100644 index a40e93b3e..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/buffered_write_syncer.go +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) 2021 Uber Technologies, Inc. -// -// 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. - -package zapcore - -import ( - "bufio" - "sync" - "time" - - "go.uber.org/multierr" -) - -const ( - // _defaultBufferSize specifies the default size used by Buffer. - _defaultBufferSize = 256 * 1024 // 256 kB - - // _defaultFlushInterval specifies the default flush interval for - // Buffer. - _defaultFlushInterval = 30 * time.Second -) - -// A BufferedWriteSyncer is a WriteSyncer that buffers writes in-memory before -// flushing them to a wrapped WriteSyncer after reaching some limit, or at some -// fixed interval--whichever comes first. -// -// BufferedWriteSyncer is safe for concurrent use. You don't need to use -// zapcore.Lock for WriteSyncers with BufferedWriteSyncer. -// -// To set up a BufferedWriteSyncer, construct a WriteSyncer for your log -// destination (*os.File is a valid WriteSyncer), wrap it with -// BufferedWriteSyncer, and defer a Stop() call for when you no longer need the -// object. -// -// func main() { -// ws := ... // your log destination -// bws := &zapcore.BufferedWriteSyncer{WS: ws} -// defer bws.Stop() -// -// // ... -// core := zapcore.NewCore(enc, bws, lvl) -// logger := zap.New(core) -// -// // ... -// } -// -// By default, a BufferedWriteSyncer will buffer up to 256 kilobytes of logs, -// waiting at most 30 seconds between flushes. -// You can customize these parameters by setting the Size or FlushInterval -// fields. -// For example, the following buffers up to 512 kB of logs before flushing them -// to Stderr, with a maximum of one minute between each flush. -// -// ws := &BufferedWriteSyncer{ -// WS: os.Stderr, -// Size: 512 * 1024, // 512 kB -// FlushInterval: time.Minute, -// } -// defer ws.Stop() -type BufferedWriteSyncer struct { - // WS is the WriteSyncer around which BufferedWriteSyncer will buffer - // writes. - // - // This field is required. - WS WriteSyncer - - // Size specifies the maximum amount of data the writer will buffered - // before flushing. - // - // Defaults to 256 kB if unspecified. - Size int - - // FlushInterval specifies how often the writer should flush data if - // there have been no writes. - // - // Defaults to 30 seconds if unspecified. - FlushInterval time.Duration - - // Clock, if specified, provides control of the source of time for the - // writer. - // - // Defaults to the system clock. - Clock Clock - - // unexported fields for state - mu sync.Mutex - initialized bool // whether initialize() has run - stopped bool // whether Stop() has run - writer *bufio.Writer - ticker *time.Ticker - stop chan struct{} // closed when flushLoop should stop - done chan struct{} // closed when flushLoop has stopped -} - -func (s *BufferedWriteSyncer) initialize() { - size := s.Size - if size == 0 { - size = _defaultBufferSize - } - - flushInterval := s.FlushInterval - if flushInterval == 0 { - flushInterval = _defaultFlushInterval - } - - if s.Clock == nil { - s.Clock = DefaultClock - } - - s.ticker = s.Clock.NewTicker(flushInterval) - s.writer = bufio.NewWriterSize(s.WS, size) - s.stop = make(chan struct{}) - s.done = make(chan struct{}) - s.initialized = true - go s.flushLoop() -} - -// Write writes log data into buffer syncer directly, multiple Write calls will be batched, -// and log data will be flushed to disk when the buffer is full or periodically. -func (s *BufferedWriteSyncer) Write(bs []byte) (int, error) { - s.mu.Lock() - defer s.mu.Unlock() - - if !s.initialized { - s.initialize() - } - - // To avoid partial writes from being flushed, we manually flush the existing buffer if: - // * The current write doesn't fit into the buffer fully, and - // * The buffer is not empty (since bufio will not split large writes when the buffer is empty) - if len(bs) > s.writer.Available() && s.writer.Buffered() > 0 { - if err := s.writer.Flush(); err != nil { - return 0, err - } - } - - return s.writer.Write(bs) -} - -// Sync flushes buffered log data into disk directly. -func (s *BufferedWriteSyncer) Sync() error { - s.mu.Lock() - defer s.mu.Unlock() - - var err error - if s.initialized { - err = s.writer.Flush() - } - - return multierr.Append(err, s.WS.Sync()) -} - -// flushLoop flushes the buffer at the configured interval until Stop is -// called. -func (s *BufferedWriteSyncer) flushLoop() { - defer close(s.done) - - for { - select { - case <-s.ticker.C: - // we just simply ignore error here - // because the underlying bufio writer stores any errors - // and we return any error from Sync() as part of the close - _ = s.Sync() - case <-s.stop: - return - } - } -} - -// Stop closes the buffer, cleans up background goroutines, and flushes -// remaining unwritten data. -func (s *BufferedWriteSyncer) Stop() (err error) { - var stopped bool - - // Critical section. - func() { - s.mu.Lock() - defer s.mu.Unlock() - - if !s.initialized { - return - } - - stopped = s.stopped - if stopped { - return - } - s.stopped = true - - s.ticker.Stop() - close(s.stop) // tell flushLoop to stop - <-s.done // and wait until it has - }() - - // Don't call Sync on consecutive Stops. - if !stopped { - err = s.Sync() - } - - return err -} diff --git a/e2e/vendor/go.uber.org/zap/zapcore/clock.go b/e2e/vendor/go.uber.org/zap/zapcore/clock.go deleted file mode 100644 index 422fd82a6..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/clock.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2021 Uber Technologies, Inc. -// -// 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. - -package zapcore - -import "time" - -// DefaultClock is the default clock used by Zap in operations that require -// time. This clock uses the system clock for all operations. -var DefaultClock = systemClock{} - -// Clock is a source of time for logged entries. -type Clock interface { - // Now returns the current local time. - Now() time.Time - - // NewTicker returns *time.Ticker that holds a channel - // that delivers "ticks" of a clock. - NewTicker(time.Duration) *time.Ticker -} - -// systemClock implements default Clock that uses system time. -type systemClock struct{} - -func (systemClock) Now() time.Time { - return time.Now() -} - -func (systemClock) NewTicker(duration time.Duration) *time.Ticker { - return time.NewTicker(duration) -} diff --git a/e2e/vendor/go.uber.org/zap/zapcore/console_encoder.go b/e2e/vendor/go.uber.org/zap/zapcore/console_encoder.go deleted file mode 100644 index cc2b4e07b..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/console_encoder.go +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zapcore - -import ( - "fmt" - - "go.uber.org/zap/buffer" - "go.uber.org/zap/internal/bufferpool" - "go.uber.org/zap/internal/pool" -) - -var _sliceEncoderPool = pool.New(func() *sliceArrayEncoder { - return &sliceArrayEncoder{ - elems: make([]interface{}, 0, 2), - } -}) - -func getSliceEncoder() *sliceArrayEncoder { - return _sliceEncoderPool.Get() -} - -func putSliceEncoder(e *sliceArrayEncoder) { - e.elems = e.elems[:0] - _sliceEncoderPool.Put(e) -} - -type consoleEncoder struct { - *jsonEncoder -} - -// NewConsoleEncoder creates an encoder whose output is designed for human - -// rather than machine - consumption. It serializes the core log entry data -// (message, level, timestamp, etc.) in a plain-text format and leaves the -// structured context as JSON. -// -// Note that although the console encoder doesn't use the keys specified in the -// encoder configuration, it will omit any element whose key is set to the empty -// string. -func NewConsoleEncoder(cfg EncoderConfig) Encoder { - if cfg.ConsoleSeparator == "" { - // Use a default delimiter of '\t' for backwards compatibility - cfg.ConsoleSeparator = "\t" - } - return consoleEncoder{newJSONEncoder(cfg, true)} -} - -func (c consoleEncoder) Clone() Encoder { - return consoleEncoder{c.jsonEncoder.Clone().(*jsonEncoder)} -} - -func (c consoleEncoder) EncodeEntry(ent Entry, fields []Field) (*buffer.Buffer, error) { - line := bufferpool.Get() - - // We don't want the entry's metadata to be quoted and escaped (if it's - // encoded as strings), which means that we can't use the JSON encoder. The - // simplest option is to use the memory encoder and fmt.Fprint. - // - // If this ever becomes a performance bottleneck, we can implement - // ArrayEncoder for our plain-text format. - arr := getSliceEncoder() - if c.TimeKey != "" && c.EncodeTime != nil && !ent.Time.IsZero() { - c.EncodeTime(ent.Time, arr) - } - if c.LevelKey != "" && c.EncodeLevel != nil { - c.EncodeLevel(ent.Level, arr) - } - if ent.LoggerName != "" && c.NameKey != "" { - nameEncoder := c.EncodeName - - if nameEncoder == nil { - // Fall back to FullNameEncoder for backward compatibility. - nameEncoder = FullNameEncoder - } - - nameEncoder(ent.LoggerName, arr) - } - if ent.Caller.Defined { - if c.CallerKey != "" && c.EncodeCaller != nil { - c.EncodeCaller(ent.Caller, arr) - } - if c.FunctionKey != "" { - arr.AppendString(ent.Caller.Function) - } - } - for i := range arr.elems { - if i > 0 { - line.AppendString(c.ConsoleSeparator) - } - fmt.Fprint(line, arr.elems[i]) - } - putSliceEncoder(arr) - - // Add the message itself. - if c.MessageKey != "" { - c.addSeparatorIfNecessary(line) - line.AppendString(ent.Message) - } - - // Add any structured context. - c.writeContext(line, fields) - - // If there's no stacktrace key, honor that; this allows users to force - // single-line output. - if ent.Stack != "" && c.StacktraceKey != "" { - line.AppendByte('\n') - line.AppendString(ent.Stack) - } - - line.AppendString(c.LineEnding) - return line, nil -} - -func (c consoleEncoder) writeContext(line *buffer.Buffer, extra []Field) { - context := c.jsonEncoder.Clone().(*jsonEncoder) - defer func() { - // putJSONEncoder assumes the buffer is still used, but we write out the buffer so - // we can free it. - context.buf.Free() - putJSONEncoder(context) - }() - - addFields(context, extra) - context.closeOpenNamespaces() - if context.buf.Len() == 0 { - return - } - - c.addSeparatorIfNecessary(line) - line.AppendByte('{') - line.Write(context.buf.Bytes()) - line.AppendByte('}') -} - -func (c consoleEncoder) addSeparatorIfNecessary(line *buffer.Buffer) { - if line.Len() > 0 { - line.AppendString(c.ConsoleSeparator) - } -} diff --git a/e2e/vendor/go.uber.org/zap/zapcore/core.go b/e2e/vendor/go.uber.org/zap/zapcore/core.go deleted file mode 100644 index 776e93f6f..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/core.go +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zapcore - -// Core is a minimal, fast logger interface. It's designed for library authors -// to wrap in a more user-friendly API. -type Core interface { - LevelEnabler - - // With adds structured context to the Core. - With([]Field) Core - // Check determines whether the supplied Entry should be logged (using the - // embedded LevelEnabler and possibly some extra logic). If the entry - // should be logged, the Core adds itself to the CheckedEntry and returns - // the result. - // - // Callers must use Check before calling Write. - Check(Entry, *CheckedEntry) *CheckedEntry - // Write serializes the Entry and any Fields supplied at the log site and - // writes them to their destination. - // - // If called, Write should always log the Entry and Fields; it should not - // replicate the logic of Check. - Write(Entry, []Field) error - // Sync flushes buffered logs (if any). - Sync() error -} - -type nopCore struct{} - -// NewNopCore returns a no-op Core. -func NewNopCore() Core { return nopCore{} } -func (nopCore) Enabled(Level) bool { return false } -func (n nopCore) With([]Field) Core { return n } -func (nopCore) Check(_ Entry, ce *CheckedEntry) *CheckedEntry { return ce } -func (nopCore) Write(Entry, []Field) error { return nil } -func (nopCore) Sync() error { return nil } - -// NewCore creates a Core that writes logs to a WriteSyncer. -func NewCore(enc Encoder, ws WriteSyncer, enab LevelEnabler) Core { - return &ioCore{ - LevelEnabler: enab, - enc: enc, - out: ws, - } -} - -type ioCore struct { - LevelEnabler - enc Encoder - out WriteSyncer -} - -var ( - _ Core = (*ioCore)(nil) - _ leveledEnabler = (*ioCore)(nil) -) - -func (c *ioCore) Level() Level { - return LevelOf(c.LevelEnabler) -} - -func (c *ioCore) With(fields []Field) Core { - clone := c.clone() - addFields(clone.enc, fields) - return clone -} - -func (c *ioCore) Check(ent Entry, ce *CheckedEntry) *CheckedEntry { - if c.Enabled(ent.Level) { - return ce.AddCore(ent, c) - } - return ce -} - -func (c *ioCore) Write(ent Entry, fields []Field) error { - buf, err := c.enc.EncodeEntry(ent, fields) - if err != nil { - return err - } - _, err = c.out.Write(buf.Bytes()) - buf.Free() - if err != nil { - return err - } - if ent.Level > ErrorLevel { - // Since we may be crashing the program, sync the output. - // Ignore Sync errors, pending a clean solution to issue #370. - _ = c.Sync() - } - return nil -} - -func (c *ioCore) Sync() error { - return c.out.Sync() -} - -func (c *ioCore) clone() *ioCore { - return &ioCore{ - LevelEnabler: c.LevelEnabler, - enc: c.enc.Clone(), - out: c.out, - } -} diff --git a/e2e/vendor/go.uber.org/zap/zapcore/doc.go b/e2e/vendor/go.uber.org/zap/zapcore/doc.go deleted file mode 100644 index 31000e91f..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/doc.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -// Package zapcore defines and implements the low-level interfaces upon which -// zap is built. By providing alternate implementations of these interfaces, -// external packages can extend zap's capabilities. -package zapcore // import "go.uber.org/zap/zapcore" diff --git a/e2e/vendor/go.uber.org/zap/zapcore/encoder.go b/e2e/vendor/go.uber.org/zap/zapcore/encoder.go deleted file mode 100644 index 044625415..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/encoder.go +++ /dev/null @@ -1,466 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zapcore - -import ( - "encoding/json" - "io" - "time" - - "go.uber.org/zap/buffer" -) - -// DefaultLineEnding defines the default line ending when writing logs. -// Alternate line endings specified in EncoderConfig can override this -// behavior. -const DefaultLineEnding = "\n" - -// OmitKey defines the key to use when callers want to remove a key from log output. -const OmitKey = "" - -// A LevelEncoder serializes a Level to a primitive type. -// -// This function must make exactly one call -// to a PrimitiveArrayEncoder's Append* method. -type LevelEncoder func(Level, PrimitiveArrayEncoder) - -// LowercaseLevelEncoder serializes a Level to a lowercase string. For example, -// InfoLevel is serialized to "info". -func LowercaseLevelEncoder(l Level, enc PrimitiveArrayEncoder) { - enc.AppendString(l.String()) -} - -// LowercaseColorLevelEncoder serializes a Level to a lowercase string and adds coloring. -// For example, InfoLevel is serialized to "info" and colored blue. -func LowercaseColorLevelEncoder(l Level, enc PrimitiveArrayEncoder) { - s, ok := _levelToLowercaseColorString[l] - if !ok { - s = _unknownLevelColor.Add(l.String()) - } - enc.AppendString(s) -} - -// CapitalLevelEncoder serializes a Level to an all-caps string. For example, -// InfoLevel is serialized to "INFO". -func CapitalLevelEncoder(l Level, enc PrimitiveArrayEncoder) { - enc.AppendString(l.CapitalString()) -} - -// CapitalColorLevelEncoder serializes a Level to an all-caps string and adds color. -// For example, InfoLevel is serialized to "INFO" and colored blue. -func CapitalColorLevelEncoder(l Level, enc PrimitiveArrayEncoder) { - s, ok := _levelToCapitalColorString[l] - if !ok { - s = _unknownLevelColor.Add(l.CapitalString()) - } - enc.AppendString(s) -} - -// UnmarshalText unmarshals text to a LevelEncoder. "capital" is unmarshaled to -// CapitalLevelEncoder, "coloredCapital" is unmarshaled to CapitalColorLevelEncoder, -// "colored" is unmarshaled to LowercaseColorLevelEncoder, and anything else -// is unmarshaled to LowercaseLevelEncoder. -func (e *LevelEncoder) UnmarshalText(text []byte) error { - switch string(text) { - case "capital": - *e = CapitalLevelEncoder - case "capitalColor": - *e = CapitalColorLevelEncoder - case "color": - *e = LowercaseColorLevelEncoder - default: - *e = LowercaseLevelEncoder - } - return nil -} - -// A TimeEncoder serializes a time.Time to a primitive type. -// -// This function must make exactly one call -// to a PrimitiveArrayEncoder's Append* method. -type TimeEncoder func(time.Time, PrimitiveArrayEncoder) - -// EpochTimeEncoder serializes a time.Time to a floating-point number of seconds -// since the Unix epoch. -func EpochTimeEncoder(t time.Time, enc PrimitiveArrayEncoder) { - nanos := t.UnixNano() - sec := float64(nanos) / float64(time.Second) - enc.AppendFloat64(sec) -} - -// EpochMillisTimeEncoder serializes a time.Time to a floating-point number of -// milliseconds since the Unix epoch. -func EpochMillisTimeEncoder(t time.Time, enc PrimitiveArrayEncoder) { - nanos := t.UnixNano() - millis := float64(nanos) / float64(time.Millisecond) - enc.AppendFloat64(millis) -} - -// EpochNanosTimeEncoder serializes a time.Time to an integer number of -// nanoseconds since the Unix epoch. -func EpochNanosTimeEncoder(t time.Time, enc PrimitiveArrayEncoder) { - enc.AppendInt64(t.UnixNano()) -} - -func encodeTimeLayout(t time.Time, layout string, enc PrimitiveArrayEncoder) { - type appendTimeEncoder interface { - AppendTimeLayout(time.Time, string) - } - - if enc, ok := enc.(appendTimeEncoder); ok { - enc.AppendTimeLayout(t, layout) - return - } - - enc.AppendString(t.Format(layout)) -} - -// ISO8601TimeEncoder serializes a time.Time to an ISO8601-formatted string -// with millisecond precision. -// -// If enc supports AppendTimeLayout(t time.Time,layout string), it's used -// instead of appending a pre-formatted string value. -func ISO8601TimeEncoder(t time.Time, enc PrimitiveArrayEncoder) { - encodeTimeLayout(t, "2006-01-02T15:04:05.000Z0700", enc) -} - -// RFC3339TimeEncoder serializes a time.Time to an RFC3339-formatted string. -// -// If enc supports AppendTimeLayout(t time.Time,layout string), it's used -// instead of appending a pre-formatted string value. -func RFC3339TimeEncoder(t time.Time, enc PrimitiveArrayEncoder) { - encodeTimeLayout(t, time.RFC3339, enc) -} - -// RFC3339NanoTimeEncoder serializes a time.Time to an RFC3339-formatted string -// with nanosecond precision. -// -// If enc supports AppendTimeLayout(t time.Time,layout string), it's used -// instead of appending a pre-formatted string value. -func RFC3339NanoTimeEncoder(t time.Time, enc PrimitiveArrayEncoder) { - encodeTimeLayout(t, time.RFC3339Nano, enc) -} - -// TimeEncoderOfLayout returns TimeEncoder which serializes a time.Time using -// given layout. -func TimeEncoderOfLayout(layout string) TimeEncoder { - return func(t time.Time, enc PrimitiveArrayEncoder) { - encodeTimeLayout(t, layout, enc) - } -} - -// UnmarshalText unmarshals text to a TimeEncoder. -// "rfc3339nano" and "RFC3339Nano" are unmarshaled to RFC3339NanoTimeEncoder. -// "rfc3339" and "RFC3339" are unmarshaled to RFC3339TimeEncoder. -// "iso8601" and "ISO8601" are unmarshaled to ISO8601TimeEncoder. -// "millis" is unmarshaled to EpochMillisTimeEncoder. -// "nanos" is unmarshaled to EpochNanosEncoder. -// Anything else is unmarshaled to EpochTimeEncoder. -func (e *TimeEncoder) UnmarshalText(text []byte) error { - switch string(text) { - case "rfc3339nano", "RFC3339Nano": - *e = RFC3339NanoTimeEncoder - case "rfc3339", "RFC3339": - *e = RFC3339TimeEncoder - case "iso8601", "ISO8601": - *e = ISO8601TimeEncoder - case "millis": - *e = EpochMillisTimeEncoder - case "nanos": - *e = EpochNanosTimeEncoder - default: - *e = EpochTimeEncoder - } - return nil -} - -// UnmarshalYAML unmarshals YAML to a TimeEncoder. -// If value is an object with a "layout" field, it will be unmarshaled to TimeEncoder with given layout. -// -// timeEncoder: -// layout: 06/01/02 03:04pm -// -// If value is string, it uses UnmarshalText. -// -// timeEncoder: iso8601 -func (e *TimeEncoder) UnmarshalYAML(unmarshal func(interface{}) error) error { - var o struct { - Layout string `json:"layout" yaml:"layout"` - } - if err := unmarshal(&o); err == nil { - *e = TimeEncoderOfLayout(o.Layout) - return nil - } - - var s string - if err := unmarshal(&s); err != nil { - return err - } - return e.UnmarshalText([]byte(s)) -} - -// UnmarshalJSON unmarshals JSON to a TimeEncoder as same way UnmarshalYAML does. -func (e *TimeEncoder) UnmarshalJSON(data []byte) error { - return e.UnmarshalYAML(func(v interface{}) error { - return json.Unmarshal(data, v) - }) -} - -// A DurationEncoder serializes a time.Duration to a primitive type. -// -// This function must make exactly one call -// to a PrimitiveArrayEncoder's Append* method. -type DurationEncoder func(time.Duration, PrimitiveArrayEncoder) - -// SecondsDurationEncoder serializes a time.Duration to a floating-point number of seconds elapsed. -func SecondsDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) { - enc.AppendFloat64(float64(d) / float64(time.Second)) -} - -// NanosDurationEncoder serializes a time.Duration to an integer number of -// nanoseconds elapsed. -func NanosDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) { - enc.AppendInt64(int64(d)) -} - -// MillisDurationEncoder serializes a time.Duration to an integer number of -// milliseconds elapsed. -func MillisDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) { - enc.AppendInt64(d.Nanoseconds() / 1e6) -} - -// StringDurationEncoder serializes a time.Duration using its built-in String -// method. -func StringDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) { - enc.AppendString(d.String()) -} - -// UnmarshalText unmarshals text to a DurationEncoder. "string" is unmarshaled -// to StringDurationEncoder, and anything else is unmarshaled to -// NanosDurationEncoder. -func (e *DurationEncoder) UnmarshalText(text []byte) error { - switch string(text) { - case "string": - *e = StringDurationEncoder - case "nanos": - *e = NanosDurationEncoder - case "ms": - *e = MillisDurationEncoder - default: - *e = SecondsDurationEncoder - } - return nil -} - -// A CallerEncoder serializes an EntryCaller to a primitive type. -// -// This function must make exactly one call -// to a PrimitiveArrayEncoder's Append* method. -type CallerEncoder func(EntryCaller, PrimitiveArrayEncoder) - -// FullCallerEncoder serializes a caller in /full/path/to/package/file:line -// format. -func FullCallerEncoder(caller EntryCaller, enc PrimitiveArrayEncoder) { - // TODO: consider using a byte-oriented API to save an allocation. - enc.AppendString(caller.String()) -} - -// ShortCallerEncoder serializes a caller in package/file:line format, trimming -// all but the final directory from the full path. -func ShortCallerEncoder(caller EntryCaller, enc PrimitiveArrayEncoder) { - // TODO: consider using a byte-oriented API to save an allocation. - enc.AppendString(caller.TrimmedPath()) -} - -// UnmarshalText unmarshals text to a CallerEncoder. "full" is unmarshaled to -// FullCallerEncoder and anything else is unmarshaled to ShortCallerEncoder. -func (e *CallerEncoder) UnmarshalText(text []byte) error { - switch string(text) { - case "full": - *e = FullCallerEncoder - default: - *e = ShortCallerEncoder - } - return nil -} - -// A NameEncoder serializes a period-separated logger name to a primitive -// type. -// -// This function must make exactly one call -// to a PrimitiveArrayEncoder's Append* method. -type NameEncoder func(string, PrimitiveArrayEncoder) - -// FullNameEncoder serializes the logger name as-is. -func FullNameEncoder(loggerName string, enc PrimitiveArrayEncoder) { - enc.AppendString(loggerName) -} - -// UnmarshalText unmarshals text to a NameEncoder. Currently, everything is -// unmarshaled to FullNameEncoder. -func (e *NameEncoder) UnmarshalText(text []byte) error { - switch string(text) { - case "full": - *e = FullNameEncoder - default: - *e = FullNameEncoder - } - return nil -} - -// An EncoderConfig allows users to configure the concrete encoders supplied by -// zapcore. -type EncoderConfig struct { - // Set the keys used for each log entry. If any key is empty, that portion - // of the entry is omitted. - MessageKey string `json:"messageKey" yaml:"messageKey"` - LevelKey string `json:"levelKey" yaml:"levelKey"` - TimeKey string `json:"timeKey" yaml:"timeKey"` - NameKey string `json:"nameKey" yaml:"nameKey"` - CallerKey string `json:"callerKey" yaml:"callerKey"` - FunctionKey string `json:"functionKey" yaml:"functionKey"` - StacktraceKey string `json:"stacktraceKey" yaml:"stacktraceKey"` - SkipLineEnding bool `json:"skipLineEnding" yaml:"skipLineEnding"` - LineEnding string `json:"lineEnding" yaml:"lineEnding"` - // Configure the primitive representations of common complex types. For - // example, some users may want all time.Times serialized as floating-point - // seconds since epoch, while others may prefer ISO8601 strings. - EncodeLevel LevelEncoder `json:"levelEncoder" yaml:"levelEncoder"` - EncodeTime TimeEncoder `json:"timeEncoder" yaml:"timeEncoder"` - EncodeDuration DurationEncoder `json:"durationEncoder" yaml:"durationEncoder"` - EncodeCaller CallerEncoder `json:"callerEncoder" yaml:"callerEncoder"` - // Unlike the other primitive type encoders, EncodeName is optional. The - // zero value falls back to FullNameEncoder. - EncodeName NameEncoder `json:"nameEncoder" yaml:"nameEncoder"` - // Configure the encoder for interface{} type objects. - // If not provided, objects are encoded using json.Encoder - NewReflectedEncoder func(io.Writer) ReflectedEncoder `json:"-" yaml:"-"` - // Configures the field separator used by the console encoder. Defaults - // to tab. - ConsoleSeparator string `json:"consoleSeparator" yaml:"consoleSeparator"` -} - -// ObjectEncoder is a strongly-typed, encoding-agnostic interface for adding a -// map- or struct-like object to the logging context. Like maps, ObjectEncoders -// aren't safe for concurrent use (though typical use shouldn't require locks). -type ObjectEncoder interface { - // Logging-specific marshalers. - AddArray(key string, marshaler ArrayMarshaler) error - AddObject(key string, marshaler ObjectMarshaler) error - - // Built-in types. - AddBinary(key string, value []byte) // for arbitrary bytes - AddByteString(key string, value []byte) // for UTF-8 encoded bytes - AddBool(key string, value bool) - AddComplex128(key string, value complex128) - AddComplex64(key string, value complex64) - AddDuration(key string, value time.Duration) - AddFloat64(key string, value float64) - AddFloat32(key string, value float32) - AddInt(key string, value int) - AddInt64(key string, value int64) - AddInt32(key string, value int32) - AddInt16(key string, value int16) - AddInt8(key string, value int8) - AddString(key, value string) - AddTime(key string, value time.Time) - AddUint(key string, value uint) - AddUint64(key string, value uint64) - AddUint32(key string, value uint32) - AddUint16(key string, value uint16) - AddUint8(key string, value uint8) - AddUintptr(key string, value uintptr) - - // AddReflected uses reflection to serialize arbitrary objects, so it can be - // slow and allocation-heavy. - AddReflected(key string, value interface{}) error - // OpenNamespace opens an isolated namespace where all subsequent fields will - // be added. Applications can use namespaces to prevent key collisions when - // injecting loggers into sub-components or third-party libraries. - OpenNamespace(key string) -} - -// ArrayEncoder is a strongly-typed, encoding-agnostic interface for adding -// array-like objects to the logging context. Of note, it supports mixed-type -// arrays even though they aren't typical in Go. Like slices, ArrayEncoders -// aren't safe for concurrent use (though typical use shouldn't require locks). -type ArrayEncoder interface { - // Built-in types. - PrimitiveArrayEncoder - - // Time-related types. - AppendDuration(time.Duration) - AppendTime(time.Time) - - // Logging-specific marshalers. - AppendArray(ArrayMarshaler) error - AppendObject(ObjectMarshaler) error - - // AppendReflected uses reflection to serialize arbitrary objects, so it's - // slow and allocation-heavy. - AppendReflected(value interface{}) error -} - -// PrimitiveArrayEncoder is the subset of the ArrayEncoder interface that deals -// only in Go's built-in types. It's included only so that Duration- and -// TimeEncoders cannot trigger infinite recursion. -type PrimitiveArrayEncoder interface { - // Built-in types. - AppendBool(bool) - AppendByteString([]byte) // for UTF-8 encoded bytes - AppendComplex128(complex128) - AppendComplex64(complex64) - AppendFloat64(float64) - AppendFloat32(float32) - AppendInt(int) - AppendInt64(int64) - AppendInt32(int32) - AppendInt16(int16) - AppendInt8(int8) - AppendString(string) - AppendUint(uint) - AppendUint64(uint64) - AppendUint32(uint32) - AppendUint16(uint16) - AppendUint8(uint8) - AppendUintptr(uintptr) -} - -// Encoder is a format-agnostic interface for all log entry marshalers. Since -// log encoders don't need to support the same wide range of use cases as -// general-purpose marshalers, it's possible to make them faster and -// lower-allocation. -// -// Implementations of the ObjectEncoder interface's methods can, of course, -// freely modify the receiver. However, the Clone and EncodeEntry methods will -// be called concurrently and shouldn't modify the receiver. -type Encoder interface { - ObjectEncoder - - // Clone copies the encoder, ensuring that adding fields to the copy doesn't - // affect the original. - Clone() Encoder - - // EncodeEntry encodes an entry and fields, along with any accumulated - // context, into a byte buffer and returns it. Any fields that are empty, - // including fields on the `Entry` type, should be omitted. - EncodeEntry(Entry, []Field) (*buffer.Buffer, error) -} diff --git a/e2e/vendor/go.uber.org/zap/zapcore/entry.go b/e2e/vendor/go.uber.org/zap/zapcore/entry.go deleted file mode 100644 index 459a5d7ce..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/entry.go +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zapcore - -import ( - "fmt" - "runtime" - "strings" - "time" - - "go.uber.org/multierr" - "go.uber.org/zap/internal/bufferpool" - "go.uber.org/zap/internal/exit" - "go.uber.org/zap/internal/pool" -) - -var _cePool = pool.New(func() *CheckedEntry { - // Pre-allocate some space for cores. - return &CheckedEntry{ - cores: make([]Core, 4), - } -}) - -func getCheckedEntry() *CheckedEntry { - ce := _cePool.Get() - ce.reset() - return ce -} - -func putCheckedEntry(ce *CheckedEntry) { - if ce == nil { - return - } - _cePool.Put(ce) -} - -// NewEntryCaller makes an EntryCaller from the return signature of -// runtime.Caller. -func NewEntryCaller(pc uintptr, file string, line int, ok bool) EntryCaller { - if !ok { - return EntryCaller{} - } - return EntryCaller{ - PC: pc, - File: file, - Line: line, - Defined: true, - } -} - -// EntryCaller represents the caller of a logging function. -type EntryCaller struct { - Defined bool - PC uintptr - File string - Line int - Function string -} - -// String returns the full path and line number of the caller. -func (ec EntryCaller) String() string { - return ec.FullPath() -} - -// FullPath returns a /full/path/to/package/file:line description of the -// caller. -func (ec EntryCaller) FullPath() string { - if !ec.Defined { - return "undefined" - } - buf := bufferpool.Get() - buf.AppendString(ec.File) - buf.AppendByte(':') - buf.AppendInt(int64(ec.Line)) - caller := buf.String() - buf.Free() - return caller -} - -// TrimmedPath returns a package/file:line description of the caller, -// preserving only the leaf directory name and file name. -func (ec EntryCaller) TrimmedPath() string { - if !ec.Defined { - return "undefined" - } - // nb. To make sure we trim the path correctly on Windows too, we - // counter-intuitively need to use '/' and *not* os.PathSeparator here, - // because the path given originates from Go stdlib, specifically - // runtime.Caller() which (as of Mar/17) returns forward slashes even on - // Windows. - // - // See https://github.com/golang/go/issues/3335 - // and https://github.com/golang/go/issues/18151 - // - // for discussion on the issue on Go side. - // - // Find the last separator. - // - idx := strings.LastIndexByte(ec.File, '/') - if idx == -1 { - return ec.FullPath() - } - // Find the penultimate separator. - idx = strings.LastIndexByte(ec.File[:idx], '/') - if idx == -1 { - return ec.FullPath() - } - buf := bufferpool.Get() - // Keep everything after the penultimate separator. - buf.AppendString(ec.File[idx+1:]) - buf.AppendByte(':') - buf.AppendInt(int64(ec.Line)) - caller := buf.String() - buf.Free() - return caller -} - -// An Entry represents a complete log message. The entry's structured context -// is already serialized, but the log level, time, message, and call site -// information are available for inspection and modification. Any fields left -// empty will be omitted when encoding. -// -// Entries are pooled, so any functions that accept them MUST be careful not to -// retain references to them. -type Entry struct { - Level Level - Time time.Time - LoggerName string - Message string - Caller EntryCaller - Stack string -} - -// CheckWriteHook is a custom action that may be executed after an entry is -// written. -// -// Register one on a CheckedEntry with the After method. -// -// if ce := logger.Check(...); ce != nil { -// ce = ce.After(hook) -// ce.Write(...) -// } -// -// You can configure the hook for Fatal log statements at the logger level with -// the zap.WithFatalHook option. -type CheckWriteHook interface { - // OnWrite is invoked with the CheckedEntry that was written and a list - // of fields added with that entry. - // - // The list of fields DOES NOT include fields that were already added - // to the logger with the With method. - OnWrite(*CheckedEntry, []Field) -} - -// CheckWriteAction indicates what action to take after a log entry is -// processed. Actions are ordered in increasing severity. -type CheckWriteAction uint8 - -const ( - // WriteThenNoop indicates that nothing special needs to be done. It's the - // default behavior. - WriteThenNoop CheckWriteAction = iota - // WriteThenGoexit runs runtime.Goexit after Write. - WriteThenGoexit - // WriteThenPanic causes a panic after Write. - WriteThenPanic - // WriteThenFatal causes an os.Exit(1) after Write. - WriteThenFatal -) - -// OnWrite implements the OnWrite method to keep CheckWriteAction compatible -// with the new CheckWriteHook interface which deprecates CheckWriteAction. -func (a CheckWriteAction) OnWrite(ce *CheckedEntry, _ []Field) { - switch a { - case WriteThenGoexit: - runtime.Goexit() - case WriteThenPanic: - panic(ce.Message) - case WriteThenFatal: - exit.With(1) - } -} - -var _ CheckWriteHook = CheckWriteAction(0) - -// CheckedEntry is an Entry together with a collection of Cores that have -// already agreed to log it. -// -// CheckedEntry references should be created by calling AddCore or After on a -// nil *CheckedEntry. References are returned to a pool after Write, and MUST -// NOT be retained after calling their Write method. -type CheckedEntry struct { - Entry - ErrorOutput WriteSyncer - dirty bool // best-effort detection of pool misuse - after CheckWriteHook - cores []Core -} - -func (ce *CheckedEntry) reset() { - ce.Entry = Entry{} - ce.ErrorOutput = nil - ce.dirty = false - ce.after = nil - for i := range ce.cores { - // don't keep references to cores - ce.cores[i] = nil - } - ce.cores = ce.cores[:0] -} - -// Write writes the entry to the stored Cores, returns any errors, and returns -// the CheckedEntry reference to a pool for immediate re-use. Finally, it -// executes any required CheckWriteAction. -func (ce *CheckedEntry) Write(fields ...Field) { - if ce == nil { - return - } - - if ce.dirty { - if ce.ErrorOutput != nil { - // Make a best effort to detect unsafe re-use of this CheckedEntry. - // If the entry is dirty, log an internal error; because the - // CheckedEntry is being used after it was returned to the pool, - // the message may be an amalgamation from multiple call sites. - fmt.Fprintf(ce.ErrorOutput, "%v Unsafe CheckedEntry re-use near Entry %+v.\n", ce.Time, ce.Entry) - _ = ce.ErrorOutput.Sync() // ignore error - } - return - } - ce.dirty = true - - var err error - for i := range ce.cores { - err = multierr.Append(err, ce.cores[i].Write(ce.Entry, fields)) - } - if err != nil && ce.ErrorOutput != nil { - fmt.Fprintf(ce.ErrorOutput, "%v write error: %v\n", ce.Time, err) - _ = ce.ErrorOutput.Sync() // ignore error - } - - hook := ce.after - if hook != nil { - hook.OnWrite(ce, fields) - } - putCheckedEntry(ce) -} - -// AddCore adds a Core that has agreed to log this CheckedEntry. It's intended to be -// used by Core.Check implementations, and is safe to call on nil CheckedEntry -// references. -func (ce *CheckedEntry) AddCore(ent Entry, core Core) *CheckedEntry { - if ce == nil { - ce = getCheckedEntry() - ce.Entry = ent - } - ce.cores = append(ce.cores, core) - return ce -} - -// Should sets this CheckedEntry's CheckWriteAction, which controls whether a -// Core will panic or fatal after writing this log entry. Like AddCore, it's -// safe to call on nil CheckedEntry references. -// -// Deprecated: Use [CheckedEntry.After] instead. -func (ce *CheckedEntry) Should(ent Entry, should CheckWriteAction) *CheckedEntry { - return ce.After(ent, should) -} - -// After sets this CheckEntry's CheckWriteHook, which will be called after this -// log entry has been written. It's safe to call this on nil CheckedEntry -// references. -func (ce *CheckedEntry) After(ent Entry, hook CheckWriteHook) *CheckedEntry { - if ce == nil { - ce = getCheckedEntry() - ce.Entry = ent - } - ce.after = hook - return ce -} diff --git a/e2e/vendor/go.uber.org/zap/zapcore/error.go b/e2e/vendor/go.uber.org/zap/zapcore/error.go deleted file mode 100644 index c40df1326..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/error.go +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) 2017 Uber Technologies, Inc. -// -// 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. - -package zapcore - -import ( - "fmt" - "reflect" - - "go.uber.org/zap/internal/pool" -) - -// Encodes the given error into fields of an object. A field with the given -// name is added for the error message. -// -// If the error implements fmt.Formatter, a field with the name ${key}Verbose -// is also added with the full verbose error message. -// -// Finally, if the error implements errorGroup (from go.uber.org/multierr) or -// causer (from github.com/pkg/errors), a ${key}Causes field is added with an -// array of objects containing the errors this error was comprised of. -// -// { -// "error": err.Error(), -// "errorVerbose": fmt.Sprintf("%+v", err), -// "errorCauses": [ -// ... -// ], -// } -func encodeError(key string, err error, enc ObjectEncoder) (retErr error) { - // Try to capture panics (from nil references or otherwise) when calling - // the Error() method - defer func() { - if rerr := recover(); rerr != nil { - // If it's a nil pointer, just say "". The likeliest causes are a - // error that fails to guard against nil or a nil pointer for a - // value receiver, and in either case, "" is a nice result. - if v := reflect.ValueOf(err); v.Kind() == reflect.Ptr && v.IsNil() { - enc.AddString(key, "") - return - } - - retErr = fmt.Errorf("PANIC=%v", rerr) - } - }() - - basic := err.Error() - enc.AddString(key, basic) - - switch e := err.(type) { - case errorGroup: - return enc.AddArray(key+"Causes", errArray(e.Errors())) - case fmt.Formatter: - verbose := fmt.Sprintf("%+v", e) - if verbose != basic { - // This is a rich error type, like those produced by - // github.com/pkg/errors. - enc.AddString(key+"Verbose", verbose) - } - } - return nil -} - -type errorGroup interface { - // Provides read-only access to the underlying list of errors, preferably - // without causing any allocs. - Errors() []error -} - -// Note that errArray and errArrayElem are very similar to the version -// implemented in the top-level error.go file. We can't re-use this because -// that would require exporting errArray as part of the zapcore API. - -// Encodes a list of errors using the standard error encoding logic. -type errArray []error - -func (errs errArray) MarshalLogArray(arr ArrayEncoder) error { - for i := range errs { - if errs[i] == nil { - continue - } - - el := newErrArrayElem(errs[i]) - err := arr.AppendObject(el) - el.Free() - if err != nil { - return err - } - } - return nil -} - -var _errArrayElemPool = pool.New(func() *errArrayElem { - return &errArrayElem{} -}) - -// Encodes any error into a {"error": ...} re-using the same errors logic. -// -// May be passed in place of an array to build a single-element array. -type errArrayElem struct{ err error } - -func newErrArrayElem(err error) *errArrayElem { - e := _errArrayElemPool.Get() - e.err = err - return e -} - -func (e *errArrayElem) MarshalLogArray(arr ArrayEncoder) error { - return arr.AppendObject(e) -} - -func (e *errArrayElem) MarshalLogObject(enc ObjectEncoder) error { - return encodeError("error", e.err, enc) -} - -func (e *errArrayElem) Free() { - e.err = nil - _errArrayElemPool.Put(e) -} diff --git a/e2e/vendor/go.uber.org/zap/zapcore/field.go b/e2e/vendor/go.uber.org/zap/zapcore/field.go deleted file mode 100644 index 308c9781e..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/field.go +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zapcore - -import ( - "bytes" - "fmt" - "math" - "reflect" - "time" -) - -// A FieldType indicates which member of the Field union struct should be used -// and how it should be serialized. -type FieldType uint8 - -const ( - // UnknownType is the default field type. Attempting to add it to an encoder will panic. - UnknownType FieldType = iota - // ArrayMarshalerType indicates that the field carries an ArrayMarshaler. - ArrayMarshalerType - // ObjectMarshalerType indicates that the field carries an ObjectMarshaler. - ObjectMarshalerType - // BinaryType indicates that the field carries an opaque binary blob. - BinaryType - // BoolType indicates that the field carries a bool. - BoolType - // ByteStringType indicates that the field carries UTF-8 encoded bytes. - ByteStringType - // Complex128Type indicates that the field carries a complex128. - Complex128Type - // Complex64Type indicates that the field carries a complex64. - Complex64Type - // DurationType indicates that the field carries a time.Duration. - DurationType - // Float64Type indicates that the field carries a float64. - Float64Type - // Float32Type indicates that the field carries a float32. - Float32Type - // Int64Type indicates that the field carries an int64. - Int64Type - // Int32Type indicates that the field carries an int32. - Int32Type - // Int16Type indicates that the field carries an int16. - Int16Type - // Int8Type indicates that the field carries an int8. - Int8Type - // StringType indicates that the field carries a string. - StringType - // TimeType indicates that the field carries a time.Time that is - // representable by a UnixNano() stored as an int64. - TimeType - // TimeFullType indicates that the field carries a time.Time stored as-is. - TimeFullType - // Uint64Type indicates that the field carries a uint64. - Uint64Type - // Uint32Type indicates that the field carries a uint32. - Uint32Type - // Uint16Type indicates that the field carries a uint16. - Uint16Type - // Uint8Type indicates that the field carries a uint8. - Uint8Type - // UintptrType indicates that the field carries a uintptr. - UintptrType - // ReflectType indicates that the field carries an interface{}, which should - // be serialized using reflection. - ReflectType - // NamespaceType signals the beginning of an isolated namespace. All - // subsequent fields should be added to the new namespace. - NamespaceType - // StringerType indicates that the field carries a fmt.Stringer. - StringerType - // ErrorType indicates that the field carries an error. - ErrorType - // SkipType indicates that the field is a no-op. - SkipType - - // InlineMarshalerType indicates that the field carries an ObjectMarshaler - // that should be inlined. - InlineMarshalerType -) - -// A Field is a marshaling operation used to add a key-value pair to a logger's -// context. Most fields are lazily marshaled, so it's inexpensive to add fields -// to disabled debug-level log statements. -type Field struct { - Key string - Type FieldType - Integer int64 - String string - Interface interface{} -} - -// AddTo exports a field through the ObjectEncoder interface. It's primarily -// useful to library authors, and shouldn't be necessary in most applications. -func (f Field) AddTo(enc ObjectEncoder) { - var err error - - switch f.Type { - case ArrayMarshalerType: - err = enc.AddArray(f.Key, f.Interface.(ArrayMarshaler)) - case ObjectMarshalerType: - err = enc.AddObject(f.Key, f.Interface.(ObjectMarshaler)) - case InlineMarshalerType: - err = f.Interface.(ObjectMarshaler).MarshalLogObject(enc) - case BinaryType: - enc.AddBinary(f.Key, f.Interface.([]byte)) - case BoolType: - enc.AddBool(f.Key, f.Integer == 1) - case ByteStringType: - enc.AddByteString(f.Key, f.Interface.([]byte)) - case Complex128Type: - enc.AddComplex128(f.Key, f.Interface.(complex128)) - case Complex64Type: - enc.AddComplex64(f.Key, f.Interface.(complex64)) - case DurationType: - enc.AddDuration(f.Key, time.Duration(f.Integer)) - case Float64Type: - enc.AddFloat64(f.Key, math.Float64frombits(uint64(f.Integer))) - case Float32Type: - enc.AddFloat32(f.Key, math.Float32frombits(uint32(f.Integer))) - case Int64Type: - enc.AddInt64(f.Key, f.Integer) - case Int32Type: - enc.AddInt32(f.Key, int32(f.Integer)) - case Int16Type: - enc.AddInt16(f.Key, int16(f.Integer)) - case Int8Type: - enc.AddInt8(f.Key, int8(f.Integer)) - case StringType: - enc.AddString(f.Key, f.String) - case TimeType: - if f.Interface != nil { - enc.AddTime(f.Key, time.Unix(0, f.Integer).In(f.Interface.(*time.Location))) - } else { - // Fall back to UTC if location is nil. - enc.AddTime(f.Key, time.Unix(0, f.Integer)) - } - case TimeFullType: - enc.AddTime(f.Key, f.Interface.(time.Time)) - case Uint64Type: - enc.AddUint64(f.Key, uint64(f.Integer)) - case Uint32Type: - enc.AddUint32(f.Key, uint32(f.Integer)) - case Uint16Type: - enc.AddUint16(f.Key, uint16(f.Integer)) - case Uint8Type: - enc.AddUint8(f.Key, uint8(f.Integer)) - case UintptrType: - enc.AddUintptr(f.Key, uintptr(f.Integer)) - case ReflectType: - err = enc.AddReflected(f.Key, f.Interface) - case NamespaceType: - enc.OpenNamespace(f.Key) - case StringerType: - err = encodeStringer(f.Key, f.Interface, enc) - case ErrorType: - err = encodeError(f.Key, f.Interface.(error), enc) - case SkipType: - break - default: - panic(fmt.Sprintf("unknown field type: %v", f)) - } - - if err != nil { - enc.AddString(fmt.Sprintf("%sError", f.Key), err.Error()) - } -} - -// Equals returns whether two fields are equal. For non-primitive types such as -// errors, marshalers, or reflect types, it uses reflect.DeepEqual. -func (f Field) Equals(other Field) bool { - if f.Type != other.Type { - return false - } - if f.Key != other.Key { - return false - } - - switch f.Type { - case BinaryType, ByteStringType: - return bytes.Equal(f.Interface.([]byte), other.Interface.([]byte)) - case ArrayMarshalerType, ObjectMarshalerType, ErrorType, ReflectType: - return reflect.DeepEqual(f.Interface, other.Interface) - default: - return f == other - } -} - -func addFields(enc ObjectEncoder, fields []Field) { - for i := range fields { - fields[i].AddTo(enc) - } -} - -func encodeStringer(key string, stringer interface{}, enc ObjectEncoder) (retErr error) { - // Try to capture panics (from nil references or otherwise) when calling - // the String() method, similar to https://golang.org/src/fmt/print.go#L540 - defer func() { - if err := recover(); err != nil { - // If it's a nil pointer, just say "". The likeliest causes are a - // Stringer that fails to guard against nil or a nil pointer for a - // value receiver, and in either case, "" is a nice result. - if v := reflect.ValueOf(stringer); v.Kind() == reflect.Ptr && v.IsNil() { - enc.AddString(key, "") - return - } - - retErr = fmt.Errorf("PANIC=%v", err) - } - }() - - enc.AddString(key, stringer.(fmt.Stringer).String()) - return nil -} diff --git a/e2e/vendor/go.uber.org/zap/zapcore/hook.go b/e2e/vendor/go.uber.org/zap/zapcore/hook.go deleted file mode 100644 index 198def991..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/hook.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zapcore - -import "go.uber.org/multierr" - -type hooked struct { - Core - funcs []func(Entry) error -} - -var ( - _ Core = (*hooked)(nil) - _ leveledEnabler = (*hooked)(nil) -) - -// RegisterHooks wraps a Core and runs a collection of user-defined callback -// hooks each time a message is logged. Execution of the callbacks is blocking. -// -// This offers users an easy way to register simple callbacks (e.g., metrics -// collection) without implementing the full Core interface. -func RegisterHooks(core Core, hooks ...func(Entry) error) Core { - funcs := append([]func(Entry) error{}, hooks...) - return &hooked{ - Core: core, - funcs: funcs, - } -} - -func (h *hooked) Level() Level { - return LevelOf(h.Core) -} - -func (h *hooked) Check(ent Entry, ce *CheckedEntry) *CheckedEntry { - // Let the wrapped Core decide whether to log this message or not. This - // also gives the downstream a chance to register itself directly with the - // CheckedEntry. - if downstream := h.Core.Check(ent, ce); downstream != nil { - return downstream.AddCore(ent, h) - } - return ce -} - -func (h *hooked) With(fields []Field) Core { - return &hooked{ - Core: h.Core.With(fields), - funcs: h.funcs, - } -} - -func (h *hooked) Write(ent Entry, _ []Field) error { - // Since our downstream had a chance to register itself directly with the - // CheckedMessage, we don't need to call it here. - var err error - for i := range h.funcs { - err = multierr.Append(err, h.funcs[i](ent)) - } - return err -} diff --git a/e2e/vendor/go.uber.org/zap/zapcore/increase_level.go b/e2e/vendor/go.uber.org/zap/zapcore/increase_level.go deleted file mode 100644 index 7a11237ae..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/increase_level.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) 2020 Uber Technologies, Inc. -// -// 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. - -package zapcore - -import "fmt" - -type levelFilterCore struct { - core Core - level LevelEnabler -} - -var ( - _ Core = (*levelFilterCore)(nil) - _ leveledEnabler = (*levelFilterCore)(nil) -) - -// NewIncreaseLevelCore creates a core that can be used to increase the level of -// an existing Core. It cannot be used to decrease the logging level, as it acts -// as a filter before calling the underlying core. If level decreases the log level, -// an error is returned. -func NewIncreaseLevelCore(core Core, level LevelEnabler) (Core, error) { - for l := _maxLevel; l >= _minLevel; l-- { - if !core.Enabled(l) && level.Enabled(l) { - return nil, fmt.Errorf("invalid increase level, as level %q is allowed by increased level, but not by existing core", l) - } - } - - return &levelFilterCore{core, level}, nil -} - -func (c *levelFilterCore) Enabled(lvl Level) bool { - return c.level.Enabled(lvl) -} - -func (c *levelFilterCore) Level() Level { - return LevelOf(c.level) -} - -func (c *levelFilterCore) With(fields []Field) Core { - return &levelFilterCore{c.core.With(fields), c.level} -} - -func (c *levelFilterCore) Check(ent Entry, ce *CheckedEntry) *CheckedEntry { - if !c.Enabled(ent.Level) { - return ce - } - - return c.core.Check(ent, ce) -} - -func (c *levelFilterCore) Write(ent Entry, fields []Field) error { - return c.core.Write(ent, fields) -} - -func (c *levelFilterCore) Sync() error { - return c.core.Sync() -} diff --git a/e2e/vendor/go.uber.org/zap/zapcore/json_encoder.go b/e2e/vendor/go.uber.org/zap/zapcore/json_encoder.go deleted file mode 100644 index 9685169b2..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/json_encoder.go +++ /dev/null @@ -1,583 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zapcore - -import ( - "encoding/base64" - "math" - "time" - "unicode/utf8" - - "go.uber.org/zap/buffer" - "go.uber.org/zap/internal/bufferpool" - "go.uber.org/zap/internal/pool" -) - -// For JSON-escaping; see jsonEncoder.safeAddString below. -const _hex = "0123456789abcdef" - -var _jsonPool = pool.New(func() *jsonEncoder { - return &jsonEncoder{} -}) - -func putJSONEncoder(enc *jsonEncoder) { - if enc.reflectBuf != nil { - enc.reflectBuf.Free() - } - enc.EncoderConfig = nil - enc.buf = nil - enc.spaced = false - enc.openNamespaces = 0 - enc.reflectBuf = nil - enc.reflectEnc = nil - _jsonPool.Put(enc) -} - -type jsonEncoder struct { - *EncoderConfig - buf *buffer.Buffer - spaced bool // include spaces after colons and commas - openNamespaces int - - // for encoding generic values by reflection - reflectBuf *buffer.Buffer - reflectEnc ReflectedEncoder -} - -// NewJSONEncoder creates a fast, low-allocation JSON encoder. The encoder -// appropriately escapes all field keys and values. -// -// Note that the encoder doesn't deduplicate keys, so it's possible to produce -// a message like -// -// {"foo":"bar","foo":"baz"} -// -// This is permitted by the JSON specification, but not encouraged. Many -// libraries will ignore duplicate key-value pairs (typically keeping the last -// pair) when unmarshaling, but users should attempt to avoid adding duplicate -// keys. -func NewJSONEncoder(cfg EncoderConfig) Encoder { - return newJSONEncoder(cfg, false) -} - -func newJSONEncoder(cfg EncoderConfig, spaced bool) *jsonEncoder { - if cfg.SkipLineEnding { - cfg.LineEnding = "" - } else if cfg.LineEnding == "" { - cfg.LineEnding = DefaultLineEnding - } - - // If no EncoderConfig.NewReflectedEncoder is provided by the user, then use default - if cfg.NewReflectedEncoder == nil { - cfg.NewReflectedEncoder = defaultReflectedEncoder - } - - return &jsonEncoder{ - EncoderConfig: &cfg, - buf: bufferpool.Get(), - spaced: spaced, - } -} - -func (enc *jsonEncoder) AddArray(key string, arr ArrayMarshaler) error { - enc.addKey(key) - return enc.AppendArray(arr) -} - -func (enc *jsonEncoder) AddObject(key string, obj ObjectMarshaler) error { - enc.addKey(key) - return enc.AppendObject(obj) -} - -func (enc *jsonEncoder) AddBinary(key string, val []byte) { - enc.AddString(key, base64.StdEncoding.EncodeToString(val)) -} - -func (enc *jsonEncoder) AddByteString(key string, val []byte) { - enc.addKey(key) - enc.AppendByteString(val) -} - -func (enc *jsonEncoder) AddBool(key string, val bool) { - enc.addKey(key) - enc.AppendBool(val) -} - -func (enc *jsonEncoder) AddComplex128(key string, val complex128) { - enc.addKey(key) - enc.AppendComplex128(val) -} - -func (enc *jsonEncoder) AddComplex64(key string, val complex64) { - enc.addKey(key) - enc.AppendComplex64(val) -} - -func (enc *jsonEncoder) AddDuration(key string, val time.Duration) { - enc.addKey(key) - enc.AppendDuration(val) -} - -func (enc *jsonEncoder) AddFloat64(key string, val float64) { - enc.addKey(key) - enc.AppendFloat64(val) -} - -func (enc *jsonEncoder) AddFloat32(key string, val float32) { - enc.addKey(key) - enc.AppendFloat32(val) -} - -func (enc *jsonEncoder) AddInt64(key string, val int64) { - enc.addKey(key) - enc.AppendInt64(val) -} - -func (enc *jsonEncoder) resetReflectBuf() { - if enc.reflectBuf == nil { - enc.reflectBuf = bufferpool.Get() - enc.reflectEnc = enc.NewReflectedEncoder(enc.reflectBuf) - } else { - enc.reflectBuf.Reset() - } -} - -var nullLiteralBytes = []byte("null") - -// Only invoke the standard JSON encoder if there is actually something to -// encode; otherwise write JSON null literal directly. -func (enc *jsonEncoder) encodeReflected(obj interface{}) ([]byte, error) { - if obj == nil { - return nullLiteralBytes, nil - } - enc.resetReflectBuf() - if err := enc.reflectEnc.Encode(obj); err != nil { - return nil, err - } - enc.reflectBuf.TrimNewline() - return enc.reflectBuf.Bytes(), nil -} - -func (enc *jsonEncoder) AddReflected(key string, obj interface{}) error { - valueBytes, err := enc.encodeReflected(obj) - if err != nil { - return err - } - enc.addKey(key) - _, err = enc.buf.Write(valueBytes) - return err -} - -func (enc *jsonEncoder) OpenNamespace(key string) { - enc.addKey(key) - enc.buf.AppendByte('{') - enc.openNamespaces++ -} - -func (enc *jsonEncoder) AddString(key, val string) { - enc.addKey(key) - enc.AppendString(val) -} - -func (enc *jsonEncoder) AddTime(key string, val time.Time) { - enc.addKey(key) - enc.AppendTime(val) -} - -func (enc *jsonEncoder) AddUint64(key string, val uint64) { - enc.addKey(key) - enc.AppendUint64(val) -} - -func (enc *jsonEncoder) AppendArray(arr ArrayMarshaler) error { - enc.addElementSeparator() - enc.buf.AppendByte('[') - err := arr.MarshalLogArray(enc) - enc.buf.AppendByte(']') - return err -} - -func (enc *jsonEncoder) AppendObject(obj ObjectMarshaler) error { - // Close ONLY new openNamespaces that are created during - // AppendObject(). - old := enc.openNamespaces - enc.openNamespaces = 0 - enc.addElementSeparator() - enc.buf.AppendByte('{') - err := obj.MarshalLogObject(enc) - enc.buf.AppendByte('}') - enc.closeOpenNamespaces() - enc.openNamespaces = old - return err -} - -func (enc *jsonEncoder) AppendBool(val bool) { - enc.addElementSeparator() - enc.buf.AppendBool(val) -} - -func (enc *jsonEncoder) AppendByteString(val []byte) { - enc.addElementSeparator() - enc.buf.AppendByte('"') - enc.safeAddByteString(val) - enc.buf.AppendByte('"') -} - -// appendComplex appends the encoded form of the provided complex128 value. -// precision specifies the encoding precision for the real and imaginary -// components of the complex number. -func (enc *jsonEncoder) appendComplex(val complex128, precision int) { - enc.addElementSeparator() - // Cast to a platform-independent, fixed-size type. - r, i := float64(real(val)), float64(imag(val)) - enc.buf.AppendByte('"') - // Because we're always in a quoted string, we can use strconv without - // special-casing NaN and +/-Inf. - enc.buf.AppendFloat(r, precision) - // If imaginary part is less than 0, minus (-) sign is added by default - // by AppendFloat. - if i >= 0 { - enc.buf.AppendByte('+') - } - enc.buf.AppendFloat(i, precision) - enc.buf.AppendByte('i') - enc.buf.AppendByte('"') -} - -func (enc *jsonEncoder) AppendDuration(val time.Duration) { - cur := enc.buf.Len() - if e := enc.EncodeDuration; e != nil { - e(val, enc) - } - if cur == enc.buf.Len() { - // User-supplied EncodeDuration is a no-op. Fall back to nanoseconds to keep - // JSON valid. - enc.AppendInt64(int64(val)) - } -} - -func (enc *jsonEncoder) AppendInt64(val int64) { - enc.addElementSeparator() - enc.buf.AppendInt(val) -} - -func (enc *jsonEncoder) AppendReflected(val interface{}) error { - valueBytes, err := enc.encodeReflected(val) - if err != nil { - return err - } - enc.addElementSeparator() - _, err = enc.buf.Write(valueBytes) - return err -} - -func (enc *jsonEncoder) AppendString(val string) { - enc.addElementSeparator() - enc.buf.AppendByte('"') - enc.safeAddString(val) - enc.buf.AppendByte('"') -} - -func (enc *jsonEncoder) AppendTimeLayout(time time.Time, layout string) { - enc.addElementSeparator() - enc.buf.AppendByte('"') - enc.buf.AppendTime(time, layout) - enc.buf.AppendByte('"') -} - -func (enc *jsonEncoder) AppendTime(val time.Time) { - cur := enc.buf.Len() - if e := enc.EncodeTime; e != nil { - e(val, enc) - } - if cur == enc.buf.Len() { - // User-supplied EncodeTime is a no-op. Fall back to nanos since epoch to keep - // output JSON valid. - enc.AppendInt64(val.UnixNano()) - } -} - -func (enc *jsonEncoder) AppendUint64(val uint64) { - enc.addElementSeparator() - enc.buf.AppendUint(val) -} - -func (enc *jsonEncoder) AddInt(k string, v int) { enc.AddInt64(k, int64(v)) } -func (enc *jsonEncoder) AddInt32(k string, v int32) { enc.AddInt64(k, int64(v)) } -func (enc *jsonEncoder) AddInt16(k string, v int16) { enc.AddInt64(k, int64(v)) } -func (enc *jsonEncoder) AddInt8(k string, v int8) { enc.AddInt64(k, int64(v)) } -func (enc *jsonEncoder) AddUint(k string, v uint) { enc.AddUint64(k, uint64(v)) } -func (enc *jsonEncoder) AddUint32(k string, v uint32) { enc.AddUint64(k, uint64(v)) } -func (enc *jsonEncoder) AddUint16(k string, v uint16) { enc.AddUint64(k, uint64(v)) } -func (enc *jsonEncoder) AddUint8(k string, v uint8) { enc.AddUint64(k, uint64(v)) } -func (enc *jsonEncoder) AddUintptr(k string, v uintptr) { enc.AddUint64(k, uint64(v)) } -func (enc *jsonEncoder) AppendComplex64(v complex64) { enc.appendComplex(complex128(v), 32) } -func (enc *jsonEncoder) AppendComplex128(v complex128) { enc.appendComplex(complex128(v), 64) } -func (enc *jsonEncoder) AppendFloat64(v float64) { enc.appendFloat(v, 64) } -func (enc *jsonEncoder) AppendFloat32(v float32) { enc.appendFloat(float64(v), 32) } -func (enc *jsonEncoder) AppendInt(v int) { enc.AppendInt64(int64(v)) } -func (enc *jsonEncoder) AppendInt32(v int32) { enc.AppendInt64(int64(v)) } -func (enc *jsonEncoder) AppendInt16(v int16) { enc.AppendInt64(int64(v)) } -func (enc *jsonEncoder) AppendInt8(v int8) { enc.AppendInt64(int64(v)) } -func (enc *jsonEncoder) AppendUint(v uint) { enc.AppendUint64(uint64(v)) } -func (enc *jsonEncoder) AppendUint32(v uint32) { enc.AppendUint64(uint64(v)) } -func (enc *jsonEncoder) AppendUint16(v uint16) { enc.AppendUint64(uint64(v)) } -func (enc *jsonEncoder) AppendUint8(v uint8) { enc.AppendUint64(uint64(v)) } -func (enc *jsonEncoder) AppendUintptr(v uintptr) { enc.AppendUint64(uint64(v)) } - -func (enc *jsonEncoder) Clone() Encoder { - clone := enc.clone() - clone.buf.Write(enc.buf.Bytes()) - return clone -} - -func (enc *jsonEncoder) clone() *jsonEncoder { - clone := _jsonPool.Get() - clone.EncoderConfig = enc.EncoderConfig - clone.spaced = enc.spaced - clone.openNamespaces = enc.openNamespaces - clone.buf = bufferpool.Get() - return clone -} - -func (enc *jsonEncoder) EncodeEntry(ent Entry, fields []Field) (*buffer.Buffer, error) { - final := enc.clone() - final.buf.AppendByte('{') - - if final.LevelKey != "" && final.EncodeLevel != nil { - final.addKey(final.LevelKey) - cur := final.buf.Len() - final.EncodeLevel(ent.Level, final) - if cur == final.buf.Len() { - // User-supplied EncodeLevel was a no-op. Fall back to strings to keep - // output JSON valid. - final.AppendString(ent.Level.String()) - } - } - if final.TimeKey != "" && !ent.Time.IsZero() { - final.AddTime(final.TimeKey, ent.Time) - } - if ent.LoggerName != "" && final.NameKey != "" { - final.addKey(final.NameKey) - cur := final.buf.Len() - nameEncoder := final.EncodeName - - // if no name encoder provided, fall back to FullNameEncoder for backwards - // compatibility - if nameEncoder == nil { - nameEncoder = FullNameEncoder - } - - nameEncoder(ent.LoggerName, final) - if cur == final.buf.Len() { - // User-supplied EncodeName was a no-op. Fall back to strings to - // keep output JSON valid. - final.AppendString(ent.LoggerName) - } - } - if ent.Caller.Defined { - if final.CallerKey != "" { - final.addKey(final.CallerKey) - cur := final.buf.Len() - final.EncodeCaller(ent.Caller, final) - if cur == final.buf.Len() { - // User-supplied EncodeCaller was a no-op. Fall back to strings to - // keep output JSON valid. - final.AppendString(ent.Caller.String()) - } - } - if final.FunctionKey != "" { - final.addKey(final.FunctionKey) - final.AppendString(ent.Caller.Function) - } - } - if final.MessageKey != "" { - final.addKey(enc.MessageKey) - final.AppendString(ent.Message) - } - if enc.buf.Len() > 0 { - final.addElementSeparator() - final.buf.Write(enc.buf.Bytes()) - } - addFields(final, fields) - final.closeOpenNamespaces() - if ent.Stack != "" && final.StacktraceKey != "" { - final.AddString(final.StacktraceKey, ent.Stack) - } - final.buf.AppendByte('}') - final.buf.AppendString(final.LineEnding) - - ret := final.buf - putJSONEncoder(final) - return ret, nil -} - -func (enc *jsonEncoder) truncate() { - enc.buf.Reset() -} - -func (enc *jsonEncoder) closeOpenNamespaces() { - for i := 0; i < enc.openNamespaces; i++ { - enc.buf.AppendByte('}') - } - enc.openNamespaces = 0 -} - -func (enc *jsonEncoder) addKey(key string) { - enc.addElementSeparator() - enc.buf.AppendByte('"') - enc.safeAddString(key) - enc.buf.AppendByte('"') - enc.buf.AppendByte(':') - if enc.spaced { - enc.buf.AppendByte(' ') - } -} - -func (enc *jsonEncoder) addElementSeparator() { - last := enc.buf.Len() - 1 - if last < 0 { - return - } - switch enc.buf.Bytes()[last] { - case '{', '[', ':', ',', ' ': - return - default: - enc.buf.AppendByte(',') - if enc.spaced { - enc.buf.AppendByte(' ') - } - } -} - -func (enc *jsonEncoder) appendFloat(val float64, bitSize int) { - enc.addElementSeparator() - switch { - case math.IsNaN(val): - enc.buf.AppendString(`"NaN"`) - case math.IsInf(val, 1): - enc.buf.AppendString(`"+Inf"`) - case math.IsInf(val, -1): - enc.buf.AppendString(`"-Inf"`) - default: - enc.buf.AppendFloat(val, bitSize) - } -} - -// safeAddString JSON-escapes a string and appends it to the internal buffer. -// Unlike the standard library's encoder, it doesn't attempt to protect the -// user from browser vulnerabilities or JSONP-related problems. -func (enc *jsonEncoder) safeAddString(s string) { - safeAppendStringLike( - (*buffer.Buffer).AppendString, - utf8.DecodeRuneInString, - enc.buf, - s, - ) -} - -// safeAddByteString is no-alloc equivalent of safeAddString(string(s)) for s []byte. -func (enc *jsonEncoder) safeAddByteString(s []byte) { - safeAppendStringLike( - (*buffer.Buffer).AppendBytes, - utf8.DecodeRune, - enc.buf, - s, - ) -} - -// safeAppendStringLike is a generic implementation of safeAddString and safeAddByteString. -// It appends a string or byte slice to the buffer, escaping all special characters. -func safeAppendStringLike[S []byte | string]( - // appendTo appends this string-like object to the buffer. - appendTo func(*buffer.Buffer, S), - // decodeRune decodes the next rune from the string-like object - // and returns its value and width in bytes. - decodeRune func(S) (rune, int), - buf *buffer.Buffer, - s S, -) { - // The encoding logic below works by skipping over characters - // that can be safely copied as-is, - // until a character is found that needs special handling. - // At that point, we copy everything we've seen so far, - // and then handle that special character. - // - // last is the index of the last byte that was copied to the buffer. - last := 0 - for i := 0; i < len(s); { - if s[i] >= utf8.RuneSelf { - // Character >= RuneSelf may be part of a multi-byte rune. - // They need to be decoded before we can decide how to handle them. - r, size := decodeRune(s[i:]) - if r != utf8.RuneError || size != 1 { - // No special handling required. - // Skip over this rune and continue. - i += size - continue - } - - // Invalid UTF-8 sequence. - // Replace it with the Unicode replacement character. - appendTo(buf, s[last:i]) - buf.AppendString(`\ufffd`) - - i++ - last = i - } else { - // Character < RuneSelf is a single-byte UTF-8 rune. - if s[i] >= 0x20 && s[i] != '\\' && s[i] != '"' { - // No escaping necessary. - // Skip over this character and continue. - i++ - continue - } - - // This character needs to be escaped. - appendTo(buf, s[last:i]) - switch s[i] { - case '\\', '"': - buf.AppendByte('\\') - buf.AppendByte(s[i]) - case '\n': - buf.AppendByte('\\') - buf.AppendByte('n') - case '\r': - buf.AppendByte('\\') - buf.AppendByte('r') - case '\t': - buf.AppendByte('\\') - buf.AppendByte('t') - default: - // Encode bytes < 0x20, except for the escape sequences above. - buf.AppendString(`\u00`) - buf.AppendByte(_hex[s[i]>>4]) - buf.AppendByte(_hex[s[i]&0xF]) - } - - i++ - last = i - } - } - - // add remaining - appendTo(buf, s[last:]) -} diff --git a/e2e/vendor/go.uber.org/zap/zapcore/lazy_with.go b/e2e/vendor/go.uber.org/zap/zapcore/lazy_with.go deleted file mode 100644 index 05288d6a8..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/lazy_with.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2023 Uber Technologies, Inc. -// -// 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. - -package zapcore - -import "sync" - -type lazyWithCore struct { - Core - sync.Once - fields []Field -} - -// NewLazyWith wraps a Core with a "lazy" Core that will only encode fields if -// the logger is written to (or is further chained in a lon-lazy manner). -func NewLazyWith(core Core, fields []Field) Core { - return &lazyWithCore{ - Core: core, - fields: fields, - } -} - -func (d *lazyWithCore) initOnce() { - d.Once.Do(func() { - d.Core = d.Core.With(d.fields) - }) -} - -func (d *lazyWithCore) With(fields []Field) Core { - d.initOnce() - return d.Core.With(fields) -} - -func (d *lazyWithCore) Check(e Entry, ce *CheckedEntry) *CheckedEntry { - d.initOnce() - return d.Core.Check(e, ce) -} diff --git a/e2e/vendor/go.uber.org/zap/zapcore/level.go b/e2e/vendor/go.uber.org/zap/zapcore/level.go deleted file mode 100644 index e01a24131..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/level.go +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zapcore - -import ( - "bytes" - "errors" - "fmt" -) - -var errUnmarshalNilLevel = errors.New("can't unmarshal a nil *Level") - -// A Level is a logging priority. Higher levels are more important. -type Level int8 - -const ( - // DebugLevel logs are typically voluminous, and are usually disabled in - // production. - DebugLevel Level = iota - 1 - // InfoLevel is the default logging priority. - InfoLevel - // WarnLevel logs are more important than Info, but don't need individual - // human review. - WarnLevel - // ErrorLevel logs are high-priority. If an application is running smoothly, - // it shouldn't generate any error-level logs. - ErrorLevel - // DPanicLevel logs are particularly important errors. In development the - // logger panics after writing the message. - DPanicLevel - // PanicLevel logs a message, then panics. - PanicLevel - // FatalLevel logs a message, then calls os.Exit(1). - FatalLevel - - _minLevel = DebugLevel - _maxLevel = FatalLevel - - // InvalidLevel is an invalid value for Level. - // - // Core implementations may panic if they see messages of this level. - InvalidLevel = _maxLevel + 1 -) - -// ParseLevel parses a level based on the lower-case or all-caps ASCII -// representation of the log level. If the provided ASCII representation is -// invalid an error is returned. -// -// This is particularly useful when dealing with text input to configure log -// levels. -func ParseLevel(text string) (Level, error) { - var level Level - err := level.UnmarshalText([]byte(text)) - return level, err -} - -type leveledEnabler interface { - LevelEnabler - - Level() Level -} - -// LevelOf reports the minimum enabled log level for the given LevelEnabler -// from Zap's supported log levels, or [InvalidLevel] if none of them are -// enabled. -// -// A LevelEnabler may implement a 'Level() Level' method to override the -// behavior of this function. -// -// func (c *core) Level() Level { -// return c.currentLevel -// } -// -// It is recommended that [Core] implementations that wrap other cores use -// LevelOf to retrieve the level of the wrapped core. For example, -// -// func (c *coreWrapper) Level() Level { -// return zapcore.LevelOf(c.wrappedCore) -// } -func LevelOf(enab LevelEnabler) Level { - if lvler, ok := enab.(leveledEnabler); ok { - return lvler.Level() - } - - for lvl := _minLevel; lvl <= _maxLevel; lvl++ { - if enab.Enabled(lvl) { - return lvl - } - } - - return InvalidLevel -} - -// String returns a lower-case ASCII representation of the log level. -func (l Level) String() string { - switch l { - case DebugLevel: - return "debug" - case InfoLevel: - return "info" - case WarnLevel: - return "warn" - case ErrorLevel: - return "error" - case DPanicLevel: - return "dpanic" - case PanicLevel: - return "panic" - case FatalLevel: - return "fatal" - default: - return fmt.Sprintf("Level(%d)", l) - } -} - -// CapitalString returns an all-caps ASCII representation of the log level. -func (l Level) CapitalString() string { - // Printing levels in all-caps is common enough that we should export this - // functionality. - switch l { - case DebugLevel: - return "DEBUG" - case InfoLevel: - return "INFO" - case WarnLevel: - return "WARN" - case ErrorLevel: - return "ERROR" - case DPanicLevel: - return "DPANIC" - case PanicLevel: - return "PANIC" - case FatalLevel: - return "FATAL" - default: - return fmt.Sprintf("LEVEL(%d)", l) - } -} - -// MarshalText marshals the Level to text. Note that the text representation -// drops the -Level suffix (see example). -func (l Level) MarshalText() ([]byte, error) { - return []byte(l.String()), nil -} - -// UnmarshalText unmarshals text to a level. Like MarshalText, UnmarshalText -// expects the text representation of a Level to drop the -Level suffix (see -// example). -// -// In particular, this makes it easy to configure logging levels using YAML, -// TOML, or JSON files. -func (l *Level) UnmarshalText(text []byte) error { - if l == nil { - return errUnmarshalNilLevel - } - if !l.unmarshalText(text) && !l.unmarshalText(bytes.ToLower(text)) { - return fmt.Errorf("unrecognized level: %q", text) - } - return nil -} - -func (l *Level) unmarshalText(text []byte) bool { - switch string(text) { - case "debug", "DEBUG": - *l = DebugLevel - case "info", "INFO", "": // make the zero value useful - *l = InfoLevel - case "warn", "WARN": - *l = WarnLevel - case "error", "ERROR": - *l = ErrorLevel - case "dpanic", "DPANIC": - *l = DPanicLevel - case "panic", "PANIC": - *l = PanicLevel - case "fatal", "FATAL": - *l = FatalLevel - default: - return false - } - return true -} - -// Set sets the level for the flag.Value interface. -func (l *Level) Set(s string) error { - return l.UnmarshalText([]byte(s)) -} - -// Get gets the level for the flag.Getter interface. -func (l *Level) Get() interface{} { - return *l -} - -// Enabled returns true if the given level is at or above this level. -func (l Level) Enabled(lvl Level) bool { - return lvl >= l -} - -// LevelEnabler decides whether a given logging level is enabled when logging a -// message. -// -// Enablers are intended to be used to implement deterministic filters; -// concerns like sampling are better implemented as a Core. -// -// Each concrete Level value implements a static LevelEnabler which returns -// true for itself and all higher logging levels. For example WarnLevel.Enabled() -// will return true for WarnLevel, ErrorLevel, DPanicLevel, PanicLevel, and -// FatalLevel, but return false for InfoLevel and DebugLevel. -type LevelEnabler interface { - Enabled(Level) bool -} diff --git a/e2e/vendor/go.uber.org/zap/zapcore/level_strings.go b/e2e/vendor/go.uber.org/zap/zapcore/level_strings.go deleted file mode 100644 index 7af8dadcb..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/level_strings.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zapcore - -import "go.uber.org/zap/internal/color" - -var ( - _levelToColor = map[Level]color.Color{ - DebugLevel: color.Magenta, - InfoLevel: color.Blue, - WarnLevel: color.Yellow, - ErrorLevel: color.Red, - DPanicLevel: color.Red, - PanicLevel: color.Red, - FatalLevel: color.Red, - } - _unknownLevelColor = color.Red - - _levelToLowercaseColorString = make(map[Level]string, len(_levelToColor)) - _levelToCapitalColorString = make(map[Level]string, len(_levelToColor)) -) - -func init() { - for level, color := range _levelToColor { - _levelToLowercaseColorString[level] = color.Add(level.String()) - _levelToCapitalColorString[level] = color.Add(level.CapitalString()) - } -} diff --git a/e2e/vendor/go.uber.org/zap/zapcore/marshaler.go b/e2e/vendor/go.uber.org/zap/zapcore/marshaler.go deleted file mode 100644 index c3c55ba0d..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/marshaler.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zapcore - -// ObjectMarshaler allows user-defined types to efficiently add themselves to the -// logging context, and to selectively omit information which shouldn't be -// included in logs (e.g., passwords). -// -// Note: ObjectMarshaler is only used when zap.Object is used or when -// passed directly to zap.Any. It is not used when reflection-based -// encoding is used. -type ObjectMarshaler interface { - MarshalLogObject(ObjectEncoder) error -} - -// ObjectMarshalerFunc is a type adapter that turns a function into an -// ObjectMarshaler. -type ObjectMarshalerFunc func(ObjectEncoder) error - -// MarshalLogObject calls the underlying function. -func (f ObjectMarshalerFunc) MarshalLogObject(enc ObjectEncoder) error { - return f(enc) -} - -// ArrayMarshaler allows user-defined types to efficiently add themselves to the -// logging context, and to selectively omit information which shouldn't be -// included in logs (e.g., passwords). -// -// Note: ArrayMarshaler is only used when zap.Array is used or when -// passed directly to zap.Any. It is not used when reflection-based -// encoding is used. -type ArrayMarshaler interface { - MarshalLogArray(ArrayEncoder) error -} - -// ArrayMarshalerFunc is a type adapter that turns a function into an -// ArrayMarshaler. -type ArrayMarshalerFunc func(ArrayEncoder) error - -// MarshalLogArray calls the underlying function. -func (f ArrayMarshalerFunc) MarshalLogArray(enc ArrayEncoder) error { - return f(enc) -} diff --git a/e2e/vendor/go.uber.org/zap/zapcore/memory_encoder.go b/e2e/vendor/go.uber.org/zap/zapcore/memory_encoder.go deleted file mode 100644 index dfead0829..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/memory_encoder.go +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zapcore - -import "time" - -// MapObjectEncoder is an ObjectEncoder backed by a simple -// map[string]interface{}. It's not fast enough for production use, but it's -// helpful in tests. -type MapObjectEncoder struct { - // Fields contains the entire encoded log context. - Fields map[string]interface{} - // cur is a pointer to the namespace we're currently writing to. - cur map[string]interface{} -} - -// NewMapObjectEncoder creates a new map-backed ObjectEncoder. -func NewMapObjectEncoder() *MapObjectEncoder { - m := make(map[string]interface{}) - return &MapObjectEncoder{ - Fields: m, - cur: m, - } -} - -// AddArray implements ObjectEncoder. -func (m *MapObjectEncoder) AddArray(key string, v ArrayMarshaler) error { - arr := &sliceArrayEncoder{elems: make([]interface{}, 0)} - err := v.MarshalLogArray(arr) - m.cur[key] = arr.elems - return err -} - -// AddObject implements ObjectEncoder. -func (m *MapObjectEncoder) AddObject(k string, v ObjectMarshaler) error { - newMap := NewMapObjectEncoder() - m.cur[k] = newMap.Fields - return v.MarshalLogObject(newMap) -} - -// AddBinary implements ObjectEncoder. -func (m *MapObjectEncoder) AddBinary(k string, v []byte) { m.cur[k] = v } - -// AddByteString implements ObjectEncoder. -func (m *MapObjectEncoder) AddByteString(k string, v []byte) { m.cur[k] = string(v) } - -// AddBool implements ObjectEncoder. -func (m *MapObjectEncoder) AddBool(k string, v bool) { m.cur[k] = v } - -// AddDuration implements ObjectEncoder. -func (m MapObjectEncoder) AddDuration(k string, v time.Duration) { m.cur[k] = v } - -// AddComplex128 implements ObjectEncoder. -func (m *MapObjectEncoder) AddComplex128(k string, v complex128) { m.cur[k] = v } - -// AddComplex64 implements ObjectEncoder. -func (m *MapObjectEncoder) AddComplex64(k string, v complex64) { m.cur[k] = v } - -// AddFloat64 implements ObjectEncoder. -func (m *MapObjectEncoder) AddFloat64(k string, v float64) { m.cur[k] = v } - -// AddFloat32 implements ObjectEncoder. -func (m *MapObjectEncoder) AddFloat32(k string, v float32) { m.cur[k] = v } - -// AddInt implements ObjectEncoder. -func (m *MapObjectEncoder) AddInt(k string, v int) { m.cur[k] = v } - -// AddInt64 implements ObjectEncoder. -func (m *MapObjectEncoder) AddInt64(k string, v int64) { m.cur[k] = v } - -// AddInt32 implements ObjectEncoder. -func (m *MapObjectEncoder) AddInt32(k string, v int32) { m.cur[k] = v } - -// AddInt16 implements ObjectEncoder. -func (m *MapObjectEncoder) AddInt16(k string, v int16) { m.cur[k] = v } - -// AddInt8 implements ObjectEncoder. -func (m *MapObjectEncoder) AddInt8(k string, v int8) { m.cur[k] = v } - -// AddString implements ObjectEncoder. -func (m *MapObjectEncoder) AddString(k string, v string) { m.cur[k] = v } - -// AddTime implements ObjectEncoder. -func (m MapObjectEncoder) AddTime(k string, v time.Time) { m.cur[k] = v } - -// AddUint implements ObjectEncoder. -func (m *MapObjectEncoder) AddUint(k string, v uint) { m.cur[k] = v } - -// AddUint64 implements ObjectEncoder. -func (m *MapObjectEncoder) AddUint64(k string, v uint64) { m.cur[k] = v } - -// AddUint32 implements ObjectEncoder. -func (m *MapObjectEncoder) AddUint32(k string, v uint32) { m.cur[k] = v } - -// AddUint16 implements ObjectEncoder. -func (m *MapObjectEncoder) AddUint16(k string, v uint16) { m.cur[k] = v } - -// AddUint8 implements ObjectEncoder. -func (m *MapObjectEncoder) AddUint8(k string, v uint8) { m.cur[k] = v } - -// AddUintptr implements ObjectEncoder. -func (m *MapObjectEncoder) AddUintptr(k string, v uintptr) { m.cur[k] = v } - -// AddReflected implements ObjectEncoder. -func (m *MapObjectEncoder) AddReflected(k string, v interface{}) error { - m.cur[k] = v - return nil -} - -// OpenNamespace implements ObjectEncoder. -func (m *MapObjectEncoder) OpenNamespace(k string) { - ns := make(map[string]interface{}) - m.cur[k] = ns - m.cur = ns -} - -// sliceArrayEncoder is an ArrayEncoder backed by a simple []interface{}. Like -// the MapObjectEncoder, it's not designed for production use. -type sliceArrayEncoder struct { - elems []interface{} -} - -func (s *sliceArrayEncoder) AppendArray(v ArrayMarshaler) error { - enc := &sliceArrayEncoder{} - err := v.MarshalLogArray(enc) - s.elems = append(s.elems, enc.elems) - return err -} - -func (s *sliceArrayEncoder) AppendObject(v ObjectMarshaler) error { - m := NewMapObjectEncoder() - err := v.MarshalLogObject(m) - s.elems = append(s.elems, m.Fields) - return err -} - -func (s *sliceArrayEncoder) AppendReflected(v interface{}) error { - s.elems = append(s.elems, v) - return nil -} - -func (s *sliceArrayEncoder) AppendBool(v bool) { s.elems = append(s.elems, v) } -func (s *sliceArrayEncoder) AppendByteString(v []byte) { s.elems = append(s.elems, string(v)) } -func (s *sliceArrayEncoder) AppendComplex128(v complex128) { s.elems = append(s.elems, v) } -func (s *sliceArrayEncoder) AppendComplex64(v complex64) { s.elems = append(s.elems, v) } -func (s *sliceArrayEncoder) AppendDuration(v time.Duration) { s.elems = append(s.elems, v) } -func (s *sliceArrayEncoder) AppendFloat64(v float64) { s.elems = append(s.elems, v) } -func (s *sliceArrayEncoder) AppendFloat32(v float32) { s.elems = append(s.elems, v) } -func (s *sliceArrayEncoder) AppendInt(v int) { s.elems = append(s.elems, v) } -func (s *sliceArrayEncoder) AppendInt64(v int64) { s.elems = append(s.elems, v) } -func (s *sliceArrayEncoder) AppendInt32(v int32) { s.elems = append(s.elems, v) } -func (s *sliceArrayEncoder) AppendInt16(v int16) { s.elems = append(s.elems, v) } -func (s *sliceArrayEncoder) AppendInt8(v int8) { s.elems = append(s.elems, v) } -func (s *sliceArrayEncoder) AppendString(v string) { s.elems = append(s.elems, v) } -func (s *sliceArrayEncoder) AppendTime(v time.Time) { s.elems = append(s.elems, v) } -func (s *sliceArrayEncoder) AppendUint(v uint) { s.elems = append(s.elems, v) } -func (s *sliceArrayEncoder) AppendUint64(v uint64) { s.elems = append(s.elems, v) } -func (s *sliceArrayEncoder) AppendUint32(v uint32) { s.elems = append(s.elems, v) } -func (s *sliceArrayEncoder) AppendUint16(v uint16) { s.elems = append(s.elems, v) } -func (s *sliceArrayEncoder) AppendUint8(v uint8) { s.elems = append(s.elems, v) } -func (s *sliceArrayEncoder) AppendUintptr(v uintptr) { s.elems = append(s.elems, v) } diff --git a/e2e/vendor/go.uber.org/zap/zapcore/reflected_encoder.go b/e2e/vendor/go.uber.org/zap/zapcore/reflected_encoder.go deleted file mode 100644 index 8746360ec..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/reflected_encoder.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zapcore - -import ( - "encoding/json" - "io" -) - -// ReflectedEncoder serializes log fields that can't be serialized with Zap's -// JSON encoder. These have the ReflectType field type. -// Use EncoderConfig.NewReflectedEncoder to set this. -type ReflectedEncoder interface { - // Encode encodes and writes to the underlying data stream. - Encode(interface{}) error -} - -func defaultReflectedEncoder(w io.Writer) ReflectedEncoder { - enc := json.NewEncoder(w) - // For consistency with our custom JSON encoder. - enc.SetEscapeHTML(false) - return enc -} diff --git a/e2e/vendor/go.uber.org/zap/zapcore/sampler.go b/e2e/vendor/go.uber.org/zap/zapcore/sampler.go deleted file mode 100644 index b7c093a4f..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/sampler.go +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (c) 2016-2022 Uber Technologies, Inc. -// -// 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. - -package zapcore - -import ( - "sync/atomic" - "time" -) - -const ( - _numLevels = _maxLevel - _minLevel + 1 - _countersPerLevel = 4096 -) - -type counter struct { - resetAt atomic.Int64 - counter atomic.Uint64 -} - -type counters [_numLevels][_countersPerLevel]counter - -func newCounters() *counters { - return &counters{} -} - -func (cs *counters) get(lvl Level, key string) *counter { - i := lvl - _minLevel - j := fnv32a(key) % _countersPerLevel - return &cs[i][j] -} - -// fnv32a, adapted from "hash/fnv", but without a []byte(string) alloc -func fnv32a(s string) uint32 { - const ( - offset32 = 2166136261 - prime32 = 16777619 - ) - hash := uint32(offset32) - for i := 0; i < len(s); i++ { - hash ^= uint32(s[i]) - hash *= prime32 - } - return hash -} - -func (c *counter) IncCheckReset(t time.Time, tick time.Duration) uint64 { - tn := t.UnixNano() - resetAfter := c.resetAt.Load() - if resetAfter > tn { - return c.counter.Add(1) - } - - c.counter.Store(1) - - newResetAfter := tn + tick.Nanoseconds() - if !c.resetAt.CompareAndSwap(resetAfter, newResetAfter) { - // We raced with another goroutine trying to reset, and it also reset - // the counter to 1, so we need to reincrement the counter. - return c.counter.Add(1) - } - - return 1 -} - -// SamplingDecision is a decision represented as a bit field made by sampler. -// More decisions may be added in the future. -type SamplingDecision uint32 - -const ( - // LogDropped indicates that the Sampler dropped a log entry. - LogDropped SamplingDecision = 1 << iota - // LogSampled indicates that the Sampler sampled a log entry. - LogSampled -) - -// optionFunc wraps a func so it satisfies the SamplerOption interface. -type optionFunc func(*sampler) - -func (f optionFunc) apply(s *sampler) { - f(s) -} - -// SamplerOption configures a Sampler. -type SamplerOption interface { - apply(*sampler) -} - -// nopSamplingHook is the default hook used by sampler. -func nopSamplingHook(Entry, SamplingDecision) {} - -// SamplerHook registers a function which will be called when Sampler makes a -// decision. -// -// This hook may be used to get visibility into the performance of the sampler. -// For example, use it to track metrics of dropped versus sampled logs. -// -// var dropped atomic.Int64 -// zapcore.SamplerHook(func(ent zapcore.Entry, dec zapcore.SamplingDecision) { -// if dec&zapcore.LogDropped > 0 { -// dropped.Inc() -// } -// }) -func SamplerHook(hook func(entry Entry, dec SamplingDecision)) SamplerOption { - return optionFunc(func(s *sampler) { - s.hook = hook - }) -} - -// NewSamplerWithOptions creates a Core that samples incoming entries, which -// caps the CPU and I/O load of logging while attempting to preserve a -// representative subset of your logs. -// -// Zap samples by logging the first N entries with a given level and message -// each tick. If more Entries with the same level and message are seen during -// the same interval, every Mth message is logged and the rest are dropped. -// -// For example, -// -// core = NewSamplerWithOptions(core, time.Second, 10, 5) -// -// This will log the first 10 log entries with the same level and message -// in a one second interval as-is. Following that, it will allow through -// every 5th log entry with the same level and message in that interval. -// -// If thereafter is zero, the Core will drop all log entries after the first N -// in that interval. -// -// Sampler can be configured to report sampling decisions with the SamplerHook -// option. -// -// Keep in mind that Zap's sampling implementation is optimized for speed over -// absolute precision; under load, each tick may be slightly over- or -// under-sampled. -func NewSamplerWithOptions(core Core, tick time.Duration, first, thereafter int, opts ...SamplerOption) Core { - s := &sampler{ - Core: core, - tick: tick, - counts: newCounters(), - first: uint64(first), - thereafter: uint64(thereafter), - hook: nopSamplingHook, - } - for _, opt := range opts { - opt.apply(s) - } - - return s -} - -type sampler struct { - Core - - counts *counters - tick time.Duration - first, thereafter uint64 - hook func(Entry, SamplingDecision) -} - -var ( - _ Core = (*sampler)(nil) - _ leveledEnabler = (*sampler)(nil) -) - -// NewSampler creates a Core that samples incoming entries, which -// caps the CPU and I/O load of logging while attempting to preserve a -// representative subset of your logs. -// -// Zap samples by logging the first N entries with a given level and message -// each tick. If more Entries with the same level and message are seen during -// the same interval, every Mth message is logged and the rest are dropped. -// -// Keep in mind that zap's sampling implementation is optimized for speed over -// absolute precision; under load, each tick may be slightly over- or -// under-sampled. -// -// Deprecated: use NewSamplerWithOptions. -func NewSampler(core Core, tick time.Duration, first, thereafter int) Core { - return NewSamplerWithOptions(core, tick, first, thereafter) -} - -func (s *sampler) Level() Level { - return LevelOf(s.Core) -} - -func (s *sampler) With(fields []Field) Core { - return &sampler{ - Core: s.Core.With(fields), - tick: s.tick, - counts: s.counts, - first: s.first, - thereafter: s.thereafter, - hook: s.hook, - } -} - -func (s *sampler) Check(ent Entry, ce *CheckedEntry) *CheckedEntry { - if !s.Enabled(ent.Level) { - return ce - } - - if ent.Level >= _minLevel && ent.Level <= _maxLevel { - counter := s.counts.get(ent.Level, ent.Message) - n := counter.IncCheckReset(ent.Time, s.tick) - if n > s.first && (s.thereafter == 0 || (n-s.first)%s.thereafter != 0) { - s.hook(ent, LogDropped) - return ce - } - s.hook(ent, LogSampled) - } - return s.Core.Check(ent, ce) -} diff --git a/e2e/vendor/go.uber.org/zap/zapcore/tee.go b/e2e/vendor/go.uber.org/zap/zapcore/tee.go deleted file mode 100644 index 9bb32f055..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/tee.go +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) 2016-2022 Uber Technologies, Inc. -// -// 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. - -package zapcore - -import "go.uber.org/multierr" - -type multiCore []Core - -var ( - _ leveledEnabler = multiCore(nil) - _ Core = multiCore(nil) -) - -// NewTee creates a Core that duplicates log entries into two or more -// underlying Cores. -// -// Calling it with a single Core returns the input unchanged, and calling -// it with no input returns a no-op Core. -func NewTee(cores ...Core) Core { - switch len(cores) { - case 0: - return NewNopCore() - case 1: - return cores[0] - default: - return multiCore(cores) - } -} - -func (mc multiCore) With(fields []Field) Core { - clone := make(multiCore, len(mc)) - for i := range mc { - clone[i] = mc[i].With(fields) - } - return clone -} - -func (mc multiCore) Level() Level { - minLvl := _maxLevel // mc is never empty - for i := range mc { - if lvl := LevelOf(mc[i]); lvl < minLvl { - minLvl = lvl - } - } - return minLvl -} - -func (mc multiCore) Enabled(lvl Level) bool { - for i := range mc { - if mc[i].Enabled(lvl) { - return true - } - } - return false -} - -func (mc multiCore) Check(ent Entry, ce *CheckedEntry) *CheckedEntry { - for i := range mc { - ce = mc[i].Check(ent, ce) - } - return ce -} - -func (mc multiCore) Write(ent Entry, fields []Field) error { - var err error - for i := range mc { - err = multierr.Append(err, mc[i].Write(ent, fields)) - } - return err -} - -func (mc multiCore) Sync() error { - var err error - for i := range mc { - err = multierr.Append(err, mc[i].Sync()) - } - return err -} diff --git a/e2e/vendor/go.uber.org/zap/zapcore/write_syncer.go b/e2e/vendor/go.uber.org/zap/zapcore/write_syncer.go deleted file mode 100644 index d4a1af3d0..000000000 --- a/e2e/vendor/go.uber.org/zap/zapcore/write_syncer.go +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -package zapcore - -import ( - "io" - "sync" - - "go.uber.org/multierr" -) - -// A WriteSyncer is an io.Writer that can also flush any buffered data. Note -// that *os.File (and thus, os.Stderr and os.Stdout) implement WriteSyncer. -type WriteSyncer interface { - io.Writer - Sync() error -} - -// AddSync converts an io.Writer to a WriteSyncer. It attempts to be -// intelligent: if the concrete type of the io.Writer implements WriteSyncer, -// we'll use the existing Sync method. If it doesn't, we'll add a no-op Sync. -func AddSync(w io.Writer) WriteSyncer { - switch w := w.(type) { - case WriteSyncer: - return w - default: - return writerWrapper{w} - } -} - -type lockedWriteSyncer struct { - sync.Mutex - ws WriteSyncer -} - -// Lock wraps a WriteSyncer in a mutex to make it safe for concurrent use. In -// particular, *os.Files must be locked before use. -func Lock(ws WriteSyncer) WriteSyncer { - if _, ok := ws.(*lockedWriteSyncer); ok { - // no need to layer on another lock - return ws - } - return &lockedWriteSyncer{ws: ws} -} - -func (s *lockedWriteSyncer) Write(bs []byte) (int, error) { - s.Lock() - n, err := s.ws.Write(bs) - s.Unlock() - return n, err -} - -func (s *lockedWriteSyncer) Sync() error { - s.Lock() - err := s.ws.Sync() - s.Unlock() - return err -} - -type writerWrapper struct { - io.Writer -} - -func (w writerWrapper) Sync() error { - return nil -} - -type multiWriteSyncer []WriteSyncer - -// NewMultiWriteSyncer creates a WriteSyncer that duplicates its writes -// and sync calls, much like io.MultiWriter. -func NewMultiWriteSyncer(ws ...WriteSyncer) WriteSyncer { - if len(ws) == 1 { - return ws[0] - } - return multiWriteSyncer(ws) -} - -// See https://golang.org/src/io/multi.go -// When not all underlying syncers write the same number of bytes, -// the smallest number is returned even though Write() is called on -// all of them. -func (ws multiWriteSyncer) Write(p []byte) (int, error) { - var writeErr error - nWritten := 0 - for _, w := range ws { - n, err := w.Write(p) - writeErr = multierr.Append(writeErr, err) - if nWritten == 0 && n != 0 { - nWritten = n - } else if n < nWritten { - nWritten = n - } - } - return nWritten, writeErr -} - -func (ws multiWriteSyncer) Sync() error { - var err error - for _, w := range ws { - err = multierr.Append(err, w.Sync()) - } - return err -} diff --git a/e2e/vendor/go.uber.org/zap/zapgrpc/zapgrpc.go b/e2e/vendor/go.uber.org/zap/zapgrpc/zapgrpc.go deleted file mode 100644 index 682de254d..000000000 --- a/e2e/vendor/go.uber.org/zap/zapgrpc/zapgrpc.go +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) 2016 Uber Technologies, Inc. -// -// 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. - -// Package zapgrpc provides a logger that is compatible with grpclog. -package zapgrpc // import "go.uber.org/zap/zapgrpc" - -import ( - "fmt" - - "go.uber.org/zap" - "go.uber.org/zap/zapcore" -) - -// See https://github.com/grpc/grpc-go/blob/v1.35.0/grpclog/loggerv2.go#L77-L86 -const ( - grpcLvlInfo int = iota - grpcLvlWarn - grpcLvlError - grpcLvlFatal -) - -// _grpcToZapLevel maps gRPC log levels to zap log levels. -// See https://pkg.go.dev/go.uber.org/zap@v1.16.0/zapcore#Level -var _grpcToZapLevel = map[int]zapcore.Level{ - grpcLvlInfo: zapcore.InfoLevel, - grpcLvlWarn: zapcore.WarnLevel, - grpcLvlError: zapcore.ErrorLevel, - grpcLvlFatal: zapcore.FatalLevel, -} - -// An Option overrides a Logger's default configuration. -type Option interface { - apply(*Logger) -} - -type optionFunc func(*Logger) - -func (f optionFunc) apply(log *Logger) { - f(log) -} - -// WithDebug configures a Logger to print at zap's DebugLevel instead of -// InfoLevel. -// It only affects the Printf, Println and Print methods, which are only used in the gRPC v1 grpclog.Logger API. -// -// Deprecated: use grpclog.SetLoggerV2() for v2 API. -func WithDebug() Option { - return optionFunc(func(logger *Logger) { - logger.print = &printer{ - enab: logger.levelEnabler, - level: zapcore.DebugLevel, - print: logger.delegate.Debug, - printf: logger.delegate.Debugf, - } - }) -} - -// withWarn redirects the fatal level to the warn level, which makes testing -// easier. This is intentionally unexported. -func withWarn() Option { - return optionFunc(func(logger *Logger) { - logger.fatal = &printer{ - enab: logger.levelEnabler, - level: zapcore.WarnLevel, - print: logger.delegate.Warn, - printf: logger.delegate.Warnf, - } - }) -} - -// NewLogger returns a new Logger. -func NewLogger(l *zap.Logger, options ...Option) *Logger { - logger := &Logger{ - delegate: l.Sugar(), - levelEnabler: l.Core(), - } - logger.print = &printer{ - enab: logger.levelEnabler, - level: zapcore.InfoLevel, - print: logger.delegate.Info, - printf: logger.delegate.Infof, - } - logger.fatal = &printer{ - enab: logger.levelEnabler, - level: zapcore.FatalLevel, - print: logger.delegate.Fatal, - printf: logger.delegate.Fatalf, - } - for _, option := range options { - option.apply(logger) - } - return logger -} - -// printer implements Print, Printf, and Println operations for a Zap level. -// -// We use it to customize Debug vs Info, and Warn vs Fatal for Print and Fatal -// respectively. -type printer struct { - enab zapcore.LevelEnabler - level zapcore.Level - print func(...interface{}) - printf func(string, ...interface{}) -} - -func (v *printer) Print(args ...interface{}) { - v.print(args...) -} - -func (v *printer) Printf(format string, args ...interface{}) { - v.printf(format, args...) -} - -func (v *printer) Println(args ...interface{}) { - if v.enab.Enabled(v.level) { - v.print(sprintln(args)) - } -} - -// Logger adapts zap's Logger to be compatible with grpclog.LoggerV2 and the deprecated grpclog.Logger. -type Logger struct { - delegate *zap.SugaredLogger - levelEnabler zapcore.LevelEnabler - print *printer - fatal *printer - // printToDebug bool - // fatalToWarn bool -} - -// Print implements grpclog.Logger. -// -// Deprecated: use [Logger.Info]. -func (l *Logger) Print(args ...interface{}) { - l.print.Print(args...) -} - -// Printf implements grpclog.Logger. -// -// Deprecated: use [Logger.Infof]. -func (l *Logger) Printf(format string, args ...interface{}) { - l.print.Printf(format, args...) -} - -// Println implements grpclog.Logger. -// -// Deprecated: use [Logger.Info]. -func (l *Logger) Println(args ...interface{}) { - l.print.Println(args...) -} - -// Info implements grpclog.LoggerV2. -func (l *Logger) Info(args ...interface{}) { - l.delegate.Info(args...) -} - -// Infoln implements grpclog.LoggerV2. -func (l *Logger) Infoln(args ...interface{}) { - if l.levelEnabler.Enabled(zapcore.InfoLevel) { - l.delegate.Info(sprintln(args)) - } -} - -// Infof implements grpclog.LoggerV2. -func (l *Logger) Infof(format string, args ...interface{}) { - l.delegate.Infof(format, args...) -} - -// Warning implements grpclog.LoggerV2. -func (l *Logger) Warning(args ...interface{}) { - l.delegate.Warn(args...) -} - -// Warningln implements grpclog.LoggerV2. -func (l *Logger) Warningln(args ...interface{}) { - if l.levelEnabler.Enabled(zapcore.WarnLevel) { - l.delegate.Warn(sprintln(args)) - } -} - -// Warningf implements grpclog.LoggerV2. -func (l *Logger) Warningf(format string, args ...interface{}) { - l.delegate.Warnf(format, args...) -} - -// Error implements grpclog.LoggerV2. -func (l *Logger) Error(args ...interface{}) { - l.delegate.Error(args...) -} - -// Errorln implements grpclog.LoggerV2. -func (l *Logger) Errorln(args ...interface{}) { - if l.levelEnabler.Enabled(zapcore.ErrorLevel) { - l.delegate.Error(sprintln(args)) - } -} - -// Errorf implements grpclog.LoggerV2. -func (l *Logger) Errorf(format string, args ...interface{}) { - l.delegate.Errorf(format, args...) -} - -// Fatal implements grpclog.LoggerV2. -func (l *Logger) Fatal(args ...interface{}) { - l.fatal.Print(args...) -} - -// Fatalln implements grpclog.LoggerV2. -func (l *Logger) Fatalln(args ...interface{}) { - l.fatal.Println(args...) -} - -// Fatalf implements grpclog.LoggerV2. -func (l *Logger) Fatalf(format string, args ...interface{}) { - l.fatal.Printf(format, args...) -} - -// V implements grpclog.LoggerV2. -func (l *Logger) V(level int) bool { - return l.levelEnabler.Enabled(_grpcToZapLevel[level]) -} - -func sprintln(args []interface{}) string { - s := fmt.Sprintln(args...) - // Drop the new line character added by Sprintln - return s[:len(s)-1] -} diff --git a/e2e/vendor/golang.org/x/crypto/cryptobyte/asn1.go b/e2e/vendor/golang.org/x/crypto/cryptobyte/asn1.go deleted file mode 100644 index d25979d9f..000000000 --- a/e2e/vendor/golang.org/x/crypto/cryptobyte/asn1.go +++ /dev/null @@ -1,825 +0,0 @@ -// Copyright 2017 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 cryptobyte - -import ( - encoding_asn1 "encoding/asn1" - "fmt" - "math/big" - "reflect" - "time" - - "golang.org/x/crypto/cryptobyte/asn1" -) - -// This file contains ASN.1-related methods for String and Builder. - -// Builder - -// AddASN1Int64 appends a DER-encoded ASN.1 INTEGER. -func (b *Builder) AddASN1Int64(v int64) { - b.addASN1Signed(asn1.INTEGER, v) -} - -// AddASN1Int64WithTag appends a DER-encoded ASN.1 INTEGER with the -// given tag. -func (b *Builder) AddASN1Int64WithTag(v int64, tag asn1.Tag) { - b.addASN1Signed(tag, v) -} - -// AddASN1Enum appends a DER-encoded ASN.1 ENUMERATION. -func (b *Builder) AddASN1Enum(v int64) { - b.addASN1Signed(asn1.ENUM, v) -} - -func (b *Builder) addASN1Signed(tag asn1.Tag, v int64) { - b.AddASN1(tag, func(c *Builder) { - length := 1 - for i := v; i >= 0x80 || i < -0x80; i >>= 8 { - length++ - } - - for ; length > 0; length-- { - i := v >> uint((length-1)*8) & 0xff - c.AddUint8(uint8(i)) - } - }) -} - -// AddASN1Uint64 appends a DER-encoded ASN.1 INTEGER. -func (b *Builder) AddASN1Uint64(v uint64) { - b.AddASN1(asn1.INTEGER, func(c *Builder) { - length := 1 - for i := v; i >= 0x80; i >>= 8 { - length++ - } - - for ; length > 0; length-- { - i := v >> uint((length-1)*8) & 0xff - c.AddUint8(uint8(i)) - } - }) -} - -// AddASN1BigInt appends a DER-encoded ASN.1 INTEGER. -func (b *Builder) AddASN1BigInt(n *big.Int) { - if b.err != nil { - return - } - - b.AddASN1(asn1.INTEGER, func(c *Builder) { - if n.Sign() < 0 { - // A negative number has to be converted to two's-complement form. So we - // invert and subtract 1. If the most-significant-bit isn't set then - // we'll need to pad the beginning with 0xff in order to keep the number - // negative. - nMinus1 := new(big.Int).Neg(n) - nMinus1.Sub(nMinus1, bigOne) - bytes := nMinus1.Bytes() - for i := range bytes { - bytes[i] ^= 0xff - } - if len(bytes) == 0 || bytes[0]&0x80 == 0 { - c.add(0xff) - } - c.add(bytes...) - } else if n.Sign() == 0 { - c.add(0) - } else { - bytes := n.Bytes() - if bytes[0]&0x80 != 0 { - c.add(0) - } - c.add(bytes...) - } - }) -} - -// AddASN1OctetString appends a DER-encoded ASN.1 OCTET STRING. -func (b *Builder) AddASN1OctetString(bytes []byte) { - b.AddASN1(asn1.OCTET_STRING, func(c *Builder) { - c.AddBytes(bytes) - }) -} - -const generalizedTimeFormatStr = "20060102150405Z0700" - -// AddASN1GeneralizedTime appends a DER-encoded ASN.1 GENERALIZEDTIME. -func (b *Builder) AddASN1GeneralizedTime(t time.Time) { - if t.Year() < 0 || t.Year() > 9999 { - b.err = fmt.Errorf("cryptobyte: cannot represent %v as a GeneralizedTime", t) - return - } - b.AddASN1(asn1.GeneralizedTime, func(c *Builder) { - c.AddBytes([]byte(t.Format(generalizedTimeFormatStr))) - }) -} - -// AddASN1UTCTime appends a DER-encoded ASN.1 UTCTime. -func (b *Builder) AddASN1UTCTime(t time.Time) { - b.AddASN1(asn1.UTCTime, func(c *Builder) { - // As utilized by the X.509 profile, UTCTime can only - // represent the years 1950 through 2049. - if t.Year() < 1950 || t.Year() >= 2050 { - b.err = fmt.Errorf("cryptobyte: cannot represent %v as a UTCTime", t) - return - } - c.AddBytes([]byte(t.Format(defaultUTCTimeFormatStr))) - }) -} - -// AddASN1BitString appends a DER-encoded ASN.1 BIT STRING. This does not -// support BIT STRINGs that are not a whole number of bytes. -func (b *Builder) AddASN1BitString(data []byte) { - b.AddASN1(asn1.BIT_STRING, func(b *Builder) { - b.AddUint8(0) - b.AddBytes(data) - }) -} - -func (b *Builder) addBase128Int(n int64) { - var length int - if n == 0 { - length = 1 - } else { - for i := n; i > 0; i >>= 7 { - length++ - } - } - - for i := length - 1; i >= 0; i-- { - o := byte(n >> uint(i*7)) - o &= 0x7f - if i != 0 { - o |= 0x80 - } - - b.add(o) - } -} - -func isValidOID(oid encoding_asn1.ObjectIdentifier) bool { - if len(oid) < 2 { - return false - } - - if oid[0] > 2 || (oid[0] <= 1 && oid[1] >= 40) { - return false - } - - for _, v := range oid { - if v < 0 { - return false - } - } - - return true -} - -func (b *Builder) AddASN1ObjectIdentifier(oid encoding_asn1.ObjectIdentifier) { - b.AddASN1(asn1.OBJECT_IDENTIFIER, func(b *Builder) { - if !isValidOID(oid) { - b.err = fmt.Errorf("cryptobyte: invalid OID: %v", oid) - return - } - - b.addBase128Int(int64(oid[0])*40 + int64(oid[1])) - for _, v := range oid[2:] { - b.addBase128Int(int64(v)) - } - }) -} - -func (b *Builder) AddASN1Boolean(v bool) { - b.AddASN1(asn1.BOOLEAN, func(b *Builder) { - if v { - b.AddUint8(0xff) - } else { - b.AddUint8(0) - } - }) -} - -func (b *Builder) AddASN1NULL() { - b.add(uint8(asn1.NULL), 0) -} - -// MarshalASN1 calls encoding_asn1.Marshal on its input and appends the result if -// successful or records an error if one occurred. -func (b *Builder) MarshalASN1(v interface{}) { - // NOTE(martinkr): This is somewhat of a hack to allow propagation of - // encoding_asn1.Marshal errors into Builder.err. N.B. if you call MarshalASN1 with a - // value embedded into a struct, its tag information is lost. - if b.err != nil { - return - } - bytes, err := encoding_asn1.Marshal(v) - if err != nil { - b.err = err - return - } - b.AddBytes(bytes) -} - -// AddASN1 appends an ASN.1 object. The object is prefixed with the given tag. -// Tags greater than 30 are not supported and result in an error (i.e. -// low-tag-number form only). The child builder passed to the -// BuilderContinuation can be used to build the content of the ASN.1 object. -func (b *Builder) AddASN1(tag asn1.Tag, f BuilderContinuation) { - if b.err != nil { - return - } - // Identifiers with the low five bits set indicate high-tag-number format - // (two or more octets), which we don't support. - if tag&0x1f == 0x1f { - b.err = fmt.Errorf("cryptobyte: high-tag number identifier octets not supported: 0x%x", tag) - return - } - b.AddUint8(uint8(tag)) - b.addLengthPrefixed(1, true, f) -} - -// String - -// ReadASN1Boolean decodes an ASN.1 BOOLEAN and converts it to a boolean -// representation into out and advances. It reports whether the read -// was successful. -func (s *String) ReadASN1Boolean(out *bool) bool { - var bytes String - if !s.ReadASN1(&bytes, asn1.BOOLEAN) || len(bytes) != 1 { - return false - } - - switch bytes[0] { - case 0: - *out = false - case 0xff: - *out = true - default: - return false - } - - return true -} - -// ReadASN1Integer decodes an ASN.1 INTEGER into out and advances. If out does -// not point to an integer, to a big.Int, or to a []byte it panics. Only -// positive and zero values can be decoded into []byte, and they are returned as -// big-endian binary values that share memory with s. Positive values will have -// no leading zeroes, and zero will be returned as a single zero byte. -// ReadASN1Integer reports whether the read was successful. -func (s *String) ReadASN1Integer(out interface{}) bool { - switch out := out.(type) { - case *int, *int8, *int16, *int32, *int64: - var i int64 - if !s.readASN1Int64(&i) || reflect.ValueOf(out).Elem().OverflowInt(i) { - return false - } - reflect.ValueOf(out).Elem().SetInt(i) - return true - case *uint, *uint8, *uint16, *uint32, *uint64: - var u uint64 - if !s.readASN1Uint64(&u) || reflect.ValueOf(out).Elem().OverflowUint(u) { - return false - } - reflect.ValueOf(out).Elem().SetUint(u) - return true - case *big.Int: - return s.readASN1BigInt(out) - case *[]byte: - return s.readASN1Bytes(out) - default: - panic("out does not point to an integer type") - } -} - -func checkASN1Integer(bytes []byte) bool { - if len(bytes) == 0 { - // An INTEGER is encoded with at least one octet. - return false - } - if len(bytes) == 1 { - return true - } - if bytes[0] == 0 && bytes[1]&0x80 == 0 || bytes[0] == 0xff && bytes[1]&0x80 == 0x80 { - // Value is not minimally encoded. - return false - } - return true -} - -var bigOne = big.NewInt(1) - -func (s *String) readASN1BigInt(out *big.Int) bool { - var bytes String - if !s.ReadASN1(&bytes, asn1.INTEGER) || !checkASN1Integer(bytes) { - return false - } - if bytes[0]&0x80 == 0x80 { - // Negative number. - neg := make([]byte, len(bytes)) - for i, b := range bytes { - neg[i] = ^b - } - out.SetBytes(neg) - out.Add(out, bigOne) - out.Neg(out) - } else { - out.SetBytes(bytes) - } - return true -} - -func (s *String) readASN1Bytes(out *[]byte) bool { - var bytes String - if !s.ReadASN1(&bytes, asn1.INTEGER) || !checkASN1Integer(bytes) { - return false - } - if bytes[0]&0x80 == 0x80 { - return false - } - for len(bytes) > 1 && bytes[0] == 0 { - bytes = bytes[1:] - } - *out = bytes - return true -} - -func (s *String) readASN1Int64(out *int64) bool { - var bytes String - if !s.ReadASN1(&bytes, asn1.INTEGER) || !checkASN1Integer(bytes) || !asn1Signed(out, bytes) { - return false - } - return true -} - -func asn1Signed(out *int64, n []byte) bool { - length := len(n) - if length > 8 { - return false - } - for i := 0; i < length; i++ { - *out <<= 8 - *out |= int64(n[i]) - } - // Shift up and down in order to sign extend the result. - *out <<= 64 - uint8(length)*8 - *out >>= 64 - uint8(length)*8 - return true -} - -func (s *String) readASN1Uint64(out *uint64) bool { - var bytes String - if !s.ReadASN1(&bytes, asn1.INTEGER) || !checkASN1Integer(bytes) || !asn1Unsigned(out, bytes) { - return false - } - return true -} - -func asn1Unsigned(out *uint64, n []byte) bool { - length := len(n) - if length > 9 || length == 9 && n[0] != 0 { - // Too large for uint64. - return false - } - if n[0]&0x80 != 0 { - // Negative number. - return false - } - for i := 0; i < length; i++ { - *out <<= 8 - *out |= uint64(n[i]) - } - return true -} - -// ReadASN1Int64WithTag decodes an ASN.1 INTEGER with the given tag into out -// and advances. It reports whether the read was successful and resulted in a -// value that can be represented in an int64. -func (s *String) ReadASN1Int64WithTag(out *int64, tag asn1.Tag) bool { - var bytes String - return s.ReadASN1(&bytes, tag) && checkASN1Integer(bytes) && asn1Signed(out, bytes) -} - -// ReadASN1Enum decodes an ASN.1 ENUMERATION into out and advances. It reports -// whether the read was successful. -func (s *String) ReadASN1Enum(out *int) bool { - var bytes String - var i int64 - if !s.ReadASN1(&bytes, asn1.ENUM) || !checkASN1Integer(bytes) || !asn1Signed(&i, bytes) { - return false - } - if int64(int(i)) != i { - return false - } - *out = int(i) - return true -} - -func (s *String) readBase128Int(out *int) bool { - ret := 0 - for i := 0; len(*s) > 0; i++ { - if i == 5 { - return false - } - // Avoid overflowing int on a 32-bit platform. - // We don't want different behavior based on the architecture. - if ret >= 1<<(31-7) { - return false - } - ret <<= 7 - b := s.read(1)[0] - - // ITU-T X.690, section 8.19.2: - // The subidentifier shall be encoded in the fewest possible octets, - // that is, the leading octet of the subidentifier shall not have the value 0x80. - if i == 0 && b == 0x80 { - return false - } - - ret |= int(b & 0x7f) - if b&0x80 == 0 { - *out = ret - return true - } - } - return false // truncated -} - -// ReadASN1ObjectIdentifier decodes an ASN.1 OBJECT IDENTIFIER into out and -// advances. It reports whether the read was successful. -func (s *String) ReadASN1ObjectIdentifier(out *encoding_asn1.ObjectIdentifier) bool { - var bytes String - if !s.ReadASN1(&bytes, asn1.OBJECT_IDENTIFIER) || len(bytes) == 0 { - return false - } - - // In the worst case, we get two elements from the first byte (which is - // encoded differently) and then every varint is a single byte long. - components := make([]int, len(bytes)+1) - - // The first varint is 40*value1 + value2: - // According to this packing, value1 can take the values 0, 1 and 2 only. - // When value1 = 0 or value1 = 1, then value2 is <= 39. When value1 = 2, - // then there are no restrictions on value2. - var v int - if !bytes.readBase128Int(&v) { - return false - } - if v < 80 { - components[0] = v / 40 - components[1] = v % 40 - } else { - components[0] = 2 - components[1] = v - 80 - } - - i := 2 - for ; len(bytes) > 0; i++ { - if !bytes.readBase128Int(&v) { - return false - } - components[i] = v - } - *out = components[:i] - return true -} - -// ReadASN1GeneralizedTime decodes an ASN.1 GENERALIZEDTIME into out and -// advances. It reports whether the read was successful. -func (s *String) ReadASN1GeneralizedTime(out *time.Time) bool { - var bytes String - if !s.ReadASN1(&bytes, asn1.GeneralizedTime) { - return false - } - t := string(bytes) - res, err := time.Parse(generalizedTimeFormatStr, t) - if err != nil { - return false - } - if serialized := res.Format(generalizedTimeFormatStr); serialized != t { - return false - } - *out = res - return true -} - -const defaultUTCTimeFormatStr = "060102150405Z0700" - -// ReadASN1UTCTime decodes an ASN.1 UTCTime into out and advances. -// It reports whether the read was successful. -func (s *String) ReadASN1UTCTime(out *time.Time) bool { - var bytes String - if !s.ReadASN1(&bytes, asn1.UTCTime) { - return false - } - t := string(bytes) - - formatStr := defaultUTCTimeFormatStr - var err error - res, err := time.Parse(formatStr, t) - if err != nil { - // Fallback to minute precision if we can't parse second - // precision. If we are following X.509 or X.690 we shouldn't - // support this, but we do. - formatStr = "0601021504Z0700" - res, err = time.Parse(formatStr, t) - } - if err != nil { - return false - } - - if serialized := res.Format(formatStr); serialized != t { - return false - } - - if res.Year() >= 2050 { - // UTCTime interprets the low order digits 50-99 as 1950-99. - // This only applies to its use in the X.509 profile. - // See https://tools.ietf.org/html/rfc5280#section-4.1.2.5.1 - res = res.AddDate(-100, 0, 0) - } - *out = res - return true -} - -// ReadASN1BitString decodes an ASN.1 BIT STRING into out and advances. -// It reports whether the read was successful. -func (s *String) ReadASN1BitString(out *encoding_asn1.BitString) bool { - var bytes String - if !s.ReadASN1(&bytes, asn1.BIT_STRING) || len(bytes) == 0 || - len(bytes)*8/8 != len(bytes) { - return false - } - - paddingBits := bytes[0] - bytes = bytes[1:] - if paddingBits > 7 || - len(bytes) == 0 && paddingBits != 0 || - len(bytes) > 0 && bytes[len(bytes)-1]&(1< 4 || len(*s) < int(2+lenLen) { - return false - } - - lenBytes := String((*s)[2 : 2+lenLen]) - if !lenBytes.readUnsigned(&len32, int(lenLen)) { - return false - } - - // ITU-T X.690 section 10.1 (DER length forms) requires encoding the length - // with the minimum number of octets. - if len32 < 128 { - // Length should have used short-form encoding. - return false - } - if len32>>((lenLen-1)*8) == 0 { - // Leading octet is 0. Length should have been at least one byte shorter. - return false - } - - headerLen = 2 + uint32(lenLen) - if headerLen+len32 < len32 { - // Overflow. - return false - } - length = headerLen + len32 - } - - if int(length) < 0 || !s.ReadBytes((*[]byte)(out), int(length)) { - return false - } - if skipHeader && !out.Skip(int(headerLen)) { - panic("cryptobyte: internal error") - } - - return true -} diff --git a/e2e/vendor/golang.org/x/crypto/cryptobyte/asn1/asn1.go b/e2e/vendor/golang.org/x/crypto/cryptobyte/asn1/asn1.go deleted file mode 100644 index 90ef6a241..000000000 --- a/e2e/vendor/golang.org/x/crypto/cryptobyte/asn1/asn1.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2017 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 asn1 contains supporting types for parsing and building ASN.1 -// messages with the cryptobyte package. -package asn1 - -// Tag represents an ASN.1 identifier octet, consisting of a tag number -// (indicating a type) and class (such as context-specific or constructed). -// -// Methods in the cryptobyte package only support the low-tag-number form, i.e. -// a single identifier octet with bits 7-8 encoding the class and bits 1-6 -// encoding the tag number. -type Tag uint8 - -const ( - classConstructed = 0x20 - classContextSpecific = 0x80 -) - -// Constructed returns t with the constructed class bit set. -func (t Tag) Constructed() Tag { return t | classConstructed } - -// ContextSpecific returns t with the context-specific class bit set. -func (t Tag) ContextSpecific() Tag { return t | classContextSpecific } - -// The following is a list of standard tag and class combinations. -const ( - BOOLEAN = Tag(1) - INTEGER = Tag(2) - BIT_STRING = Tag(3) - OCTET_STRING = Tag(4) - NULL = Tag(5) - OBJECT_IDENTIFIER = Tag(6) - ENUM = Tag(10) - UTF8String = Tag(12) - SEQUENCE = Tag(16 | classConstructed) - SET = Tag(17 | classConstructed) - PrintableString = Tag(19) - T61String = Tag(20) - IA5String = Tag(22) - UTCTime = Tag(23) - GeneralizedTime = Tag(24) - GeneralString = Tag(27) -) diff --git a/e2e/vendor/golang.org/x/crypto/cryptobyte/builder.go b/e2e/vendor/golang.org/x/crypto/cryptobyte/builder.go deleted file mode 100644 index cf254f5f1..000000000 --- a/e2e/vendor/golang.org/x/crypto/cryptobyte/builder.go +++ /dev/null @@ -1,350 +0,0 @@ -// Copyright 2017 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 cryptobyte - -import ( - "errors" - "fmt" -) - -// A Builder builds byte strings from fixed-length and length-prefixed values. -// Builders either allocate space as needed, or are ‘fixed’, which means that -// they write into a given buffer and produce an error if it's exhausted. -// -// The zero value is a usable Builder that allocates space as needed. -// -// Simple values are marshaled and appended to a Builder using methods on the -// Builder. Length-prefixed values are marshaled by providing a -// BuilderContinuation, which is a function that writes the inner contents of -// the value to a given Builder. See the documentation for BuilderContinuation -// for details. -type Builder struct { - err error - result []byte - fixedSize bool - child *Builder - offset int - pendingLenLen int - pendingIsASN1 bool - inContinuation *bool -} - -// NewBuilder creates a Builder that appends its output to the given buffer. -// Like append(), the slice will be reallocated if its capacity is exceeded. -// Use Bytes to get the final buffer. -func NewBuilder(buffer []byte) *Builder { - return &Builder{ - result: buffer, - } -} - -// NewFixedBuilder creates a Builder that appends its output into the given -// buffer. This builder does not reallocate the output buffer. Writes that -// would exceed the buffer's capacity are treated as an error. -func NewFixedBuilder(buffer []byte) *Builder { - return &Builder{ - result: buffer, - fixedSize: true, - } -} - -// SetError sets the value to be returned as the error from Bytes. Writes -// performed after calling SetError are ignored. -func (b *Builder) SetError(err error) { - b.err = err -} - -// Bytes returns the bytes written by the builder or an error if one has -// occurred during building. -func (b *Builder) Bytes() ([]byte, error) { - if b.err != nil { - return nil, b.err - } - return b.result[b.offset:], nil -} - -// BytesOrPanic returns the bytes written by the builder or panics if an error -// has occurred during building. -func (b *Builder) BytesOrPanic() []byte { - if b.err != nil { - panic(b.err) - } - return b.result[b.offset:] -} - -// AddUint8 appends an 8-bit value to the byte string. -func (b *Builder) AddUint8(v uint8) { - b.add(byte(v)) -} - -// AddUint16 appends a big-endian, 16-bit value to the byte string. -func (b *Builder) AddUint16(v uint16) { - b.add(byte(v>>8), byte(v)) -} - -// AddUint24 appends a big-endian, 24-bit value to the byte string. The highest -// byte of the 32-bit input value is silently truncated. -func (b *Builder) AddUint24(v uint32) { - b.add(byte(v>>16), byte(v>>8), byte(v)) -} - -// AddUint32 appends a big-endian, 32-bit value to the byte string. -func (b *Builder) AddUint32(v uint32) { - b.add(byte(v>>24), byte(v>>16), byte(v>>8), byte(v)) -} - -// AddUint48 appends a big-endian, 48-bit value to the byte string. -func (b *Builder) AddUint48(v uint64) { - b.add(byte(v>>40), byte(v>>32), byte(v>>24), byte(v>>16), byte(v>>8), byte(v)) -} - -// AddUint64 appends a big-endian, 64-bit value to the byte string. -func (b *Builder) AddUint64(v uint64) { - b.add(byte(v>>56), byte(v>>48), byte(v>>40), byte(v>>32), byte(v>>24), byte(v>>16), byte(v>>8), byte(v)) -} - -// AddBytes appends a sequence of bytes to the byte string. -func (b *Builder) AddBytes(v []byte) { - b.add(v...) -} - -// BuilderContinuation is a continuation-passing interface for building -// length-prefixed byte sequences. Builder methods for length-prefixed -// sequences (AddUint8LengthPrefixed etc) will invoke the BuilderContinuation -// supplied to them. The child builder passed to the continuation can be used -// to build the content of the length-prefixed sequence. For example: -// -// parent := cryptobyte.NewBuilder() -// parent.AddUint8LengthPrefixed(func (child *Builder) { -// child.AddUint8(42) -// child.AddUint8LengthPrefixed(func (grandchild *Builder) { -// grandchild.AddUint8(5) -// }) -// }) -// -// It is an error to write more bytes to the child than allowed by the reserved -// length prefix. After the continuation returns, the child must be considered -// invalid, i.e. users must not store any copies or references of the child -// that outlive the continuation. -// -// If the continuation panics with a value of type BuildError then the inner -// error will be returned as the error from Bytes. If the child panics -// otherwise then Bytes will repanic with the same value. -type BuilderContinuation func(child *Builder) - -// BuildError wraps an error. If a BuilderContinuation panics with this value, -// the panic will be recovered and the inner error will be returned from -// Builder.Bytes. -type BuildError struct { - Err error -} - -// AddUint8LengthPrefixed adds a 8-bit length-prefixed byte sequence. -func (b *Builder) AddUint8LengthPrefixed(f BuilderContinuation) { - b.addLengthPrefixed(1, false, f) -} - -// AddUint16LengthPrefixed adds a big-endian, 16-bit length-prefixed byte sequence. -func (b *Builder) AddUint16LengthPrefixed(f BuilderContinuation) { - b.addLengthPrefixed(2, false, f) -} - -// AddUint24LengthPrefixed adds a big-endian, 24-bit length-prefixed byte sequence. -func (b *Builder) AddUint24LengthPrefixed(f BuilderContinuation) { - b.addLengthPrefixed(3, false, f) -} - -// AddUint32LengthPrefixed adds a big-endian, 32-bit length-prefixed byte sequence. -func (b *Builder) AddUint32LengthPrefixed(f BuilderContinuation) { - b.addLengthPrefixed(4, false, f) -} - -func (b *Builder) callContinuation(f BuilderContinuation, arg *Builder) { - if !*b.inContinuation { - *b.inContinuation = true - - defer func() { - *b.inContinuation = false - - r := recover() - if r == nil { - return - } - - if buildError, ok := r.(BuildError); ok { - b.err = buildError.Err - } else { - panic(r) - } - }() - } - - f(arg) -} - -func (b *Builder) addLengthPrefixed(lenLen int, isASN1 bool, f BuilderContinuation) { - // Subsequent writes can be ignored if the builder has encountered an error. - if b.err != nil { - return - } - - offset := len(b.result) - b.add(make([]byte, lenLen)...) - - if b.inContinuation == nil { - b.inContinuation = new(bool) - } - - b.child = &Builder{ - result: b.result, - fixedSize: b.fixedSize, - offset: offset, - pendingLenLen: lenLen, - pendingIsASN1: isASN1, - inContinuation: b.inContinuation, - } - - b.callContinuation(f, b.child) - b.flushChild() - if b.child != nil { - panic("cryptobyte: internal error") - } -} - -func (b *Builder) flushChild() { - if b.child == nil { - return - } - b.child.flushChild() - child := b.child - b.child = nil - - if child.err != nil { - b.err = child.err - return - } - - length := len(child.result) - child.pendingLenLen - child.offset - - if length < 0 { - panic("cryptobyte: internal error") // result unexpectedly shrunk - } - - if child.pendingIsASN1 { - // For ASN.1, we reserved a single byte for the length. If that turned out - // to be incorrect, we have to move the contents along in order to make - // space. - if child.pendingLenLen != 1 { - panic("cryptobyte: internal error") - } - var lenLen, lenByte uint8 - if int64(length) > 0xfffffffe { - b.err = errors.New("pending ASN.1 child too long") - return - } else if length > 0xffffff { - lenLen = 5 - lenByte = 0x80 | 4 - } else if length > 0xffff { - lenLen = 4 - lenByte = 0x80 | 3 - } else if length > 0xff { - lenLen = 3 - lenByte = 0x80 | 2 - } else if length > 0x7f { - lenLen = 2 - lenByte = 0x80 | 1 - } else { - lenLen = 1 - lenByte = uint8(length) - length = 0 - } - - // Insert the initial length byte, make space for successive length bytes, - // and adjust the offset. - child.result[child.offset] = lenByte - extraBytes := int(lenLen - 1) - if extraBytes != 0 { - child.add(make([]byte, extraBytes)...) - childStart := child.offset + child.pendingLenLen - copy(child.result[childStart+extraBytes:], child.result[childStart:]) - } - child.offset++ - child.pendingLenLen = extraBytes - } - - l := length - for i := child.pendingLenLen - 1; i >= 0; i-- { - child.result[child.offset+i] = uint8(l) - l >>= 8 - } - if l != 0 { - b.err = fmt.Errorf("cryptobyte: pending child length %d exceeds %d-byte length prefix", length, child.pendingLenLen) - return - } - - if b.fixedSize && &b.result[0] != &child.result[0] { - panic("cryptobyte: BuilderContinuation reallocated a fixed-size buffer") - } - - b.result = child.result -} - -func (b *Builder) add(bytes ...byte) { - if b.err != nil { - return - } - if b.child != nil { - panic("cryptobyte: attempted write while child is pending") - } - if len(b.result)+len(bytes) < len(bytes) { - b.err = errors.New("cryptobyte: length overflow") - } - if b.fixedSize && len(b.result)+len(bytes) > cap(b.result) { - b.err = errors.New("cryptobyte: Builder is exceeding its fixed-size buffer") - return - } - b.result = append(b.result, bytes...) -} - -// Unwrite rolls back non-negative n bytes written directly to the Builder. -// An attempt by a child builder passed to a continuation to unwrite bytes -// from its parent will panic. -func (b *Builder) Unwrite(n int) { - if b.err != nil { - return - } - if b.child != nil { - panic("cryptobyte: attempted unwrite while child is pending") - } - length := len(b.result) - b.pendingLenLen - b.offset - if length < 0 { - panic("cryptobyte: internal error") - } - if n < 0 { - panic("cryptobyte: attempted to unwrite negative number of bytes") - } - if n > length { - panic("cryptobyte: attempted to unwrite more than was written") - } - b.result = b.result[:len(b.result)-n] -} - -// A MarshalingValue marshals itself into a Builder. -type MarshalingValue interface { - // Marshal is called by Builder.AddValue. It receives a pointer to a builder - // to marshal itself into. It may return an error that occurred during - // marshaling, such as unset or invalid values. - Marshal(b *Builder) error -} - -// AddValue calls Marshal on v, passing a pointer to the builder to append to. -// If Marshal returns an error, it is set on the Builder so that subsequent -// appends don't have an effect. -func (b *Builder) AddValue(v MarshalingValue) { - err := v.Marshal(b) - if err != nil { - b.err = err - } -} diff --git a/e2e/vendor/golang.org/x/crypto/cryptobyte/string.go b/e2e/vendor/golang.org/x/crypto/cryptobyte/string.go deleted file mode 100644 index 4b0f8097f..000000000 --- a/e2e/vendor/golang.org/x/crypto/cryptobyte/string.go +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright 2017 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 cryptobyte contains types that help with parsing and constructing -// length-prefixed, binary messages, including ASN.1 DER. (The asn1 subpackage -// contains useful ASN.1 constants.) -// -// The String type is for parsing. It wraps a []byte slice and provides helper -// functions for consuming structures, value by value. -// -// The Builder type is for constructing messages. It providers helper functions -// for appending values and also for appending length-prefixed submessages – -// without having to worry about calculating the length prefix ahead of time. -// -// See the documentation and examples for the Builder and String types to get -// started. -package cryptobyte - -// String represents a string of bytes. It provides methods for parsing -// fixed-length and length-prefixed values from it. -type String []byte - -// read advances a String by n bytes and returns them. If less than n bytes -// remain, it returns nil. -func (s *String) read(n int) []byte { - if len(*s) < n || n < 0 { - return nil - } - v := (*s)[:n] - *s = (*s)[n:] - return v -} - -// Skip advances the String by n byte and reports whether it was successful. -func (s *String) Skip(n int) bool { - return s.read(n) != nil -} - -// ReadUint8 decodes an 8-bit value into out and advances over it. -// It reports whether the read was successful. -func (s *String) ReadUint8(out *uint8) bool { - v := s.read(1) - if v == nil { - return false - } - *out = uint8(v[0]) - return true -} - -// ReadUint16 decodes a big-endian, 16-bit value into out and advances over it. -// It reports whether the read was successful. -func (s *String) ReadUint16(out *uint16) bool { - v := s.read(2) - if v == nil { - return false - } - *out = uint16(v[0])<<8 | uint16(v[1]) - return true -} - -// ReadUint24 decodes a big-endian, 24-bit value into out and advances over it. -// It reports whether the read was successful. -func (s *String) ReadUint24(out *uint32) bool { - v := s.read(3) - if v == nil { - return false - } - *out = uint32(v[0])<<16 | uint32(v[1])<<8 | uint32(v[2]) - return true -} - -// ReadUint32 decodes a big-endian, 32-bit value into out and advances over it. -// It reports whether the read was successful. -func (s *String) ReadUint32(out *uint32) bool { - v := s.read(4) - if v == nil { - return false - } - *out = uint32(v[0])<<24 | uint32(v[1])<<16 | uint32(v[2])<<8 | uint32(v[3]) - return true -} - -// ReadUint48 decodes a big-endian, 48-bit value into out and advances over it. -// It reports whether the read was successful. -func (s *String) ReadUint48(out *uint64) bool { - v := s.read(6) - if v == nil { - return false - } - *out = uint64(v[0])<<40 | uint64(v[1])<<32 | uint64(v[2])<<24 | uint64(v[3])<<16 | uint64(v[4])<<8 | uint64(v[5]) - return true -} - -// ReadUint64 decodes a big-endian, 64-bit value into out and advances over it. -// It reports whether the read was successful. -func (s *String) ReadUint64(out *uint64) bool { - v := s.read(8) - if v == nil { - return false - } - *out = uint64(v[0])<<56 | uint64(v[1])<<48 | uint64(v[2])<<40 | uint64(v[3])<<32 | uint64(v[4])<<24 | uint64(v[5])<<16 | uint64(v[6])<<8 | uint64(v[7]) - return true -} - -func (s *String) readUnsigned(out *uint32, length int) bool { - v := s.read(length) - if v == nil { - return false - } - var result uint32 - for i := 0; i < length; i++ { - result <<= 8 - result |= uint32(v[i]) - } - *out = result - return true -} - -func (s *String) readLengthPrefixed(lenLen int, outChild *String) bool { - lenBytes := s.read(lenLen) - if lenBytes == nil { - return false - } - var length uint32 - for _, b := range lenBytes { - length = length << 8 - length = length | uint32(b) - } - v := s.read(int(length)) - if v == nil { - return false - } - *outChild = v - return true -} - -// ReadUint8LengthPrefixed reads the content of an 8-bit length-prefixed value -// into out and advances over it. It reports whether the read was successful. -func (s *String) ReadUint8LengthPrefixed(out *String) bool { - return s.readLengthPrefixed(1, out) -} - -// ReadUint16LengthPrefixed reads the content of a big-endian, 16-bit -// length-prefixed value into out and advances over it. It reports whether the -// read was successful. -func (s *String) ReadUint16LengthPrefixed(out *String) bool { - return s.readLengthPrefixed(2, out) -} - -// ReadUint24LengthPrefixed reads the content of a big-endian, 24-bit -// length-prefixed value into out and advances over it. It reports whether -// the read was successful. -func (s *String) ReadUint24LengthPrefixed(out *String) bool { - return s.readLengthPrefixed(3, out) -} - -// ReadBytes reads n bytes into out and advances over them. It reports -// whether the read was successful. -func (s *String) ReadBytes(out *[]byte, n int) bool { - v := s.read(n) - if v == nil { - return false - } - *out = v - return true -} - -// CopyBytes copies len(out) bytes into out and advances over them. It reports -// whether the copy operation was successful -func (s *String) CopyBytes(out []byte) bool { - n := len(out) - v := s.read(n) - if v == nil { - return false - } - return copy(out, v) == n -} - -// Empty reports whether the string does not contain any bytes. -func (s String) Empty() bool { - return len(s) == 0 -} diff --git a/e2e/vendor/golang.org/x/crypto/hkdf/hkdf.go b/e2e/vendor/golang.org/x/crypto/hkdf/hkdf.go deleted file mode 100644 index 3bee66294..000000000 --- a/e2e/vendor/golang.org/x/crypto/hkdf/hkdf.go +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2014 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 hkdf implements the HMAC-based Extract-and-Expand Key Derivation -// Function (HKDF) as defined in RFC 5869. -// -// HKDF is a cryptographic key derivation function (KDF) with the goal of -// expanding limited input keying material into one or more cryptographically -// strong secret keys. -package hkdf - -import ( - "crypto/hmac" - "errors" - "hash" - "io" -) - -// Extract generates a pseudorandom key for use with Expand from an input secret -// and an optional independent salt. -// -// Only use this function if you need to reuse the extracted key with multiple -// Expand invocations and different context values. Most common scenarios, -// including the generation of multiple keys, should use New instead. -func Extract(hash func() hash.Hash, secret, salt []byte) []byte { - if salt == nil { - salt = make([]byte, hash().Size()) - } - extractor := hmac.New(hash, salt) - extractor.Write(secret) - return extractor.Sum(nil) -} - -type hkdf struct { - expander hash.Hash - size int - - info []byte - counter byte - - prev []byte - buf []byte -} - -func (f *hkdf) Read(p []byte) (int, error) { - // Check whether enough data can be generated - need := len(p) - remains := len(f.buf) + int(255-f.counter+1)*f.size - if remains < need { - return 0, errors.New("hkdf: entropy limit reached") - } - // Read any leftover from the buffer - n := copy(p, f.buf) - p = p[n:] - - // Fill the rest of the buffer - for len(p) > 0 { - if f.counter > 1 { - f.expander.Reset() - } - f.expander.Write(f.prev) - f.expander.Write(f.info) - f.expander.Write([]byte{f.counter}) - f.prev = f.expander.Sum(f.prev[:0]) - f.counter++ - - // Copy the new batch into p - f.buf = f.prev - n = copy(p, f.buf) - p = p[n:] - } - // Save leftovers for next run - f.buf = f.buf[n:] - - return need, nil -} - -// Expand returns a Reader, from which keys can be read, using the given -// pseudorandom key and optional context info, skipping the extraction step. -// -// The pseudorandomKey should have been generated by Extract, or be a uniformly -// random or pseudorandom cryptographically strong key. See RFC 5869, Section -// 3.3. Most common scenarios will want to use New instead. -func Expand(hash func() hash.Hash, pseudorandomKey, info []byte) io.Reader { - expander := hmac.New(hash, pseudorandomKey) - return &hkdf{expander, expander.Size(), info, 1, nil, nil} -} - -// New returns a Reader, from which keys can be read, using the given hash, -// secret, salt and context info. Salt and info can be nil. -func New(hash func() hash.Hash, secret, salt, info []byte) io.Reader { - prk := Extract(hash, secret, salt) - return Expand(hash, prk, info) -} diff --git a/e2e/vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go b/e2e/vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go deleted file mode 100644 index 1fe600ad0..000000000 --- a/e2e/vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright 2012 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 secretbox encrypts and authenticates small messages. - -Secretbox uses XSalsa20 and Poly1305 to encrypt and authenticate messages with -secret-key cryptography. The length of messages is not hidden. - -It is the caller's responsibility to ensure the uniqueness of nonces—for -example, by using nonce 1 for the first message, nonce 2 for the second -message, etc. Nonces are long enough that randomly generated nonces have -negligible risk of collision. - -Messages should be small because: - -1. The whole message needs to be held in memory to be processed. - -2. Using large messages pressures implementations on small machines to decrypt -and process plaintext before authenticating it. This is very dangerous, and -this API does not allow it, but a protocol that uses excessive message sizes -might present some implementations with no other choice. - -3. Fixed overheads will be sufficiently amortised by messages as small as 8KB. - -4. Performance may be improved by working with messages that fit into data caches. - -Thus large amounts of data should be chunked so that each message is small. -(Each message still needs a unique nonce.) If in doubt, 16KB is a reasonable -chunk size. - -This package is interoperable with NaCl: https://nacl.cr.yp.to/secretbox.html. -*/ -package secretbox - -import ( - "golang.org/x/crypto/internal/alias" - "golang.org/x/crypto/internal/poly1305" - "golang.org/x/crypto/salsa20/salsa" -) - -// Overhead is the number of bytes of overhead when boxing a message. -const Overhead = poly1305.TagSize - -// setup produces a sub-key and Salsa20 counter given a nonce and key. -func setup(subKey *[32]byte, counter *[16]byte, nonce *[24]byte, key *[32]byte) { - // We use XSalsa20 for encryption so first we need to generate a - // key and nonce with HSalsa20. - var hNonce [16]byte - copy(hNonce[:], nonce[:]) - salsa.HSalsa20(subKey, &hNonce, key, &salsa.Sigma) - - // The final 8 bytes of the original nonce form the new nonce. - copy(counter[:], nonce[16:]) -} - -// sliceForAppend takes a slice and a requested number of bytes. It returns a -// slice with the contents of the given slice followed by that many bytes and a -// second slice that aliases into it and contains only the extra bytes. If the -// original slice has sufficient capacity then no allocation is performed. -func sliceForAppend(in []byte, n int) (head, tail []byte) { - if total := len(in) + n; cap(in) >= total { - head = in[:total] - } else { - head = make([]byte, total) - copy(head, in) - } - tail = head[len(in):] - return -} - -// Seal appends an encrypted and authenticated copy of message to out, which -// must not overlap message. The key and nonce pair must be unique for each -// distinct message and the output will be Overhead bytes longer than message. -func Seal(out, message []byte, nonce *[24]byte, key *[32]byte) []byte { - var subKey [32]byte - var counter [16]byte - setup(&subKey, &counter, nonce, key) - - // The Poly1305 key is generated by encrypting 32 bytes of zeros. Since - // Salsa20 works with 64-byte blocks, we also generate 32 bytes of - // keystream as a side effect. - var firstBlock [64]byte - salsa.XORKeyStream(firstBlock[:], firstBlock[:], &counter, &subKey) - - var poly1305Key [32]byte - copy(poly1305Key[:], firstBlock[:]) - - ret, out := sliceForAppend(out, len(message)+poly1305.TagSize) - if alias.AnyOverlap(out, message) { - panic("nacl: invalid buffer overlap") - } - - // We XOR up to 32 bytes of message with the keystream generated from - // the first block. - firstMessageBlock := message - if len(firstMessageBlock) > 32 { - firstMessageBlock = firstMessageBlock[:32] - } - - tagOut := out - out = out[poly1305.TagSize:] - for i, x := range firstMessageBlock { - out[i] = firstBlock[32+i] ^ x - } - message = message[len(firstMessageBlock):] - ciphertext := out - out = out[len(firstMessageBlock):] - - // Now encrypt the rest. - counter[8] = 1 - salsa.XORKeyStream(out, message, &counter, &subKey) - - var tag [poly1305.TagSize]byte - poly1305.Sum(&tag, ciphertext, &poly1305Key) - copy(tagOut, tag[:]) - - return ret -} - -// Open authenticates and decrypts a box produced by Seal and appends the -// message to out, which must not overlap box. The output will be Overhead -// bytes smaller than box. -func Open(out, box []byte, nonce *[24]byte, key *[32]byte) ([]byte, bool) { - if len(box) < Overhead { - return nil, false - } - - var subKey [32]byte - var counter [16]byte - setup(&subKey, &counter, nonce, key) - - // The Poly1305 key is generated by encrypting 32 bytes of zeros. Since - // Salsa20 works with 64-byte blocks, we also generate 32 bytes of - // keystream as a side effect. - var firstBlock [64]byte - salsa.XORKeyStream(firstBlock[:], firstBlock[:], &counter, &subKey) - - var poly1305Key [32]byte - copy(poly1305Key[:], firstBlock[:]) - var tag [poly1305.TagSize]byte - copy(tag[:], box) - - if !poly1305.Verify(&tag, box[poly1305.TagSize:], &poly1305Key) { - return nil, false - } - - ret, out := sliceForAppend(out, len(box)-Overhead) - if alias.AnyOverlap(out, box) { - panic("nacl: invalid buffer overlap") - } - - // We XOR up to 32 bytes of box with the keystream generated from - // the first block. - box = box[Overhead:] - firstMessageBlock := box - if len(firstMessageBlock) > 32 { - firstMessageBlock = firstMessageBlock[:32] - } - for i, x := range firstMessageBlock { - out[i] = firstBlock[32+i] ^ x - } - - box = box[len(firstMessageBlock):] - out = out[len(firstMessageBlock):] - - // Now decrypt the rest. - counter[8] = 1 - salsa.XORKeyStream(out, box, &counter, &subKey) - - return ret, true -} diff --git a/e2e/vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go b/e2e/vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go deleted file mode 100644 index 3685b3445..000000000 --- a/e2e/vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright 2012 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 salsa provides low-level access to functions in the Salsa family. -package salsa - -import "math/bits" - -// Sigma is the Salsa20 constant for 256-bit keys. -var Sigma = [16]byte{'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', '2', '-', 'b', 'y', 't', 'e', ' ', 'k'} - -// HSalsa20 applies the HSalsa20 core function to a 16-byte input in, 32-byte -// key k, and 16-byte constant c, and puts the result into the 32-byte array -// out. -func HSalsa20(out *[32]byte, in *[16]byte, k *[32]byte, c *[16]byte) { - x0 := uint32(c[0]) | uint32(c[1])<<8 | uint32(c[2])<<16 | uint32(c[3])<<24 - x1 := uint32(k[0]) | uint32(k[1])<<8 | uint32(k[2])<<16 | uint32(k[3])<<24 - x2 := uint32(k[4]) | uint32(k[5])<<8 | uint32(k[6])<<16 | uint32(k[7])<<24 - x3 := uint32(k[8]) | uint32(k[9])<<8 | uint32(k[10])<<16 | uint32(k[11])<<24 - x4 := uint32(k[12]) | uint32(k[13])<<8 | uint32(k[14])<<16 | uint32(k[15])<<24 - x5 := uint32(c[4]) | uint32(c[5])<<8 | uint32(c[6])<<16 | uint32(c[7])<<24 - x6 := uint32(in[0]) | uint32(in[1])<<8 | uint32(in[2])<<16 | uint32(in[3])<<24 - x7 := uint32(in[4]) | uint32(in[5])<<8 | uint32(in[6])<<16 | uint32(in[7])<<24 - x8 := uint32(in[8]) | uint32(in[9])<<8 | uint32(in[10])<<16 | uint32(in[11])<<24 - x9 := uint32(in[12]) | uint32(in[13])<<8 | uint32(in[14])<<16 | uint32(in[15])<<24 - x10 := uint32(c[8]) | uint32(c[9])<<8 | uint32(c[10])<<16 | uint32(c[11])<<24 - x11 := uint32(k[16]) | uint32(k[17])<<8 | uint32(k[18])<<16 | uint32(k[19])<<24 - x12 := uint32(k[20]) | uint32(k[21])<<8 | uint32(k[22])<<16 | uint32(k[23])<<24 - x13 := uint32(k[24]) | uint32(k[25])<<8 | uint32(k[26])<<16 | uint32(k[27])<<24 - x14 := uint32(k[28]) | uint32(k[29])<<8 | uint32(k[30])<<16 | uint32(k[31])<<24 - x15 := uint32(c[12]) | uint32(c[13])<<8 | uint32(c[14])<<16 | uint32(c[15])<<24 - - for i := 0; i < 20; i += 2 { - u := x0 + x12 - x4 ^= bits.RotateLeft32(u, 7) - u = x4 + x0 - x8 ^= bits.RotateLeft32(u, 9) - u = x8 + x4 - x12 ^= bits.RotateLeft32(u, 13) - u = x12 + x8 - x0 ^= bits.RotateLeft32(u, 18) - - u = x5 + x1 - x9 ^= bits.RotateLeft32(u, 7) - u = x9 + x5 - x13 ^= bits.RotateLeft32(u, 9) - u = x13 + x9 - x1 ^= bits.RotateLeft32(u, 13) - u = x1 + x13 - x5 ^= bits.RotateLeft32(u, 18) - - u = x10 + x6 - x14 ^= bits.RotateLeft32(u, 7) - u = x14 + x10 - x2 ^= bits.RotateLeft32(u, 9) - u = x2 + x14 - x6 ^= bits.RotateLeft32(u, 13) - u = x6 + x2 - x10 ^= bits.RotateLeft32(u, 18) - - u = x15 + x11 - x3 ^= bits.RotateLeft32(u, 7) - u = x3 + x15 - x7 ^= bits.RotateLeft32(u, 9) - u = x7 + x3 - x11 ^= bits.RotateLeft32(u, 13) - u = x11 + x7 - x15 ^= bits.RotateLeft32(u, 18) - - u = x0 + x3 - x1 ^= bits.RotateLeft32(u, 7) - u = x1 + x0 - x2 ^= bits.RotateLeft32(u, 9) - u = x2 + x1 - x3 ^= bits.RotateLeft32(u, 13) - u = x3 + x2 - x0 ^= bits.RotateLeft32(u, 18) - - u = x5 + x4 - x6 ^= bits.RotateLeft32(u, 7) - u = x6 + x5 - x7 ^= bits.RotateLeft32(u, 9) - u = x7 + x6 - x4 ^= bits.RotateLeft32(u, 13) - u = x4 + x7 - x5 ^= bits.RotateLeft32(u, 18) - - u = x10 + x9 - x11 ^= bits.RotateLeft32(u, 7) - u = x11 + x10 - x8 ^= bits.RotateLeft32(u, 9) - u = x8 + x11 - x9 ^= bits.RotateLeft32(u, 13) - u = x9 + x8 - x10 ^= bits.RotateLeft32(u, 18) - - u = x15 + x14 - x12 ^= bits.RotateLeft32(u, 7) - u = x12 + x15 - x13 ^= bits.RotateLeft32(u, 9) - u = x13 + x12 - x14 ^= bits.RotateLeft32(u, 13) - u = x14 + x13 - x15 ^= bits.RotateLeft32(u, 18) - } - out[0] = byte(x0) - out[1] = byte(x0 >> 8) - out[2] = byte(x0 >> 16) - out[3] = byte(x0 >> 24) - - out[4] = byte(x5) - out[5] = byte(x5 >> 8) - out[6] = byte(x5 >> 16) - out[7] = byte(x5 >> 24) - - out[8] = byte(x10) - out[9] = byte(x10 >> 8) - out[10] = byte(x10 >> 16) - out[11] = byte(x10 >> 24) - - out[12] = byte(x15) - out[13] = byte(x15 >> 8) - out[14] = byte(x15 >> 16) - out[15] = byte(x15 >> 24) - - out[16] = byte(x6) - out[17] = byte(x6 >> 8) - out[18] = byte(x6 >> 16) - out[19] = byte(x6 >> 24) - - out[20] = byte(x7) - out[21] = byte(x7 >> 8) - out[22] = byte(x7 >> 16) - out[23] = byte(x7 >> 24) - - out[24] = byte(x8) - out[25] = byte(x8 >> 8) - out[26] = byte(x8 >> 16) - out[27] = byte(x8 >> 24) - - out[28] = byte(x9) - out[29] = byte(x9 >> 8) - out[30] = byte(x9 >> 16) - out[31] = byte(x9 >> 24) -} diff --git a/e2e/vendor/golang.org/x/crypto/salsa20/salsa/salsa208.go b/e2e/vendor/golang.org/x/crypto/salsa20/salsa/salsa208.go deleted file mode 100644 index 7ec7bb39b..000000000 --- a/e2e/vendor/golang.org/x/crypto/salsa20/salsa/salsa208.go +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright 2012 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 salsa - -import "math/bits" - -// Core208 applies the Salsa20/8 core function to the 64-byte array in and puts -// the result into the 64-byte array out. The input and output may be the same array. -func Core208(out *[64]byte, in *[64]byte) { - j0 := uint32(in[0]) | uint32(in[1])<<8 | uint32(in[2])<<16 | uint32(in[3])<<24 - j1 := uint32(in[4]) | uint32(in[5])<<8 | uint32(in[6])<<16 | uint32(in[7])<<24 - j2 := uint32(in[8]) | uint32(in[9])<<8 | uint32(in[10])<<16 | uint32(in[11])<<24 - j3 := uint32(in[12]) | uint32(in[13])<<8 | uint32(in[14])<<16 | uint32(in[15])<<24 - j4 := uint32(in[16]) | uint32(in[17])<<8 | uint32(in[18])<<16 | uint32(in[19])<<24 - j5 := uint32(in[20]) | uint32(in[21])<<8 | uint32(in[22])<<16 | uint32(in[23])<<24 - j6 := uint32(in[24]) | uint32(in[25])<<8 | uint32(in[26])<<16 | uint32(in[27])<<24 - j7 := uint32(in[28]) | uint32(in[29])<<8 | uint32(in[30])<<16 | uint32(in[31])<<24 - j8 := uint32(in[32]) | uint32(in[33])<<8 | uint32(in[34])<<16 | uint32(in[35])<<24 - j9 := uint32(in[36]) | uint32(in[37])<<8 | uint32(in[38])<<16 | uint32(in[39])<<24 - j10 := uint32(in[40]) | uint32(in[41])<<8 | uint32(in[42])<<16 | uint32(in[43])<<24 - j11 := uint32(in[44]) | uint32(in[45])<<8 | uint32(in[46])<<16 | uint32(in[47])<<24 - j12 := uint32(in[48]) | uint32(in[49])<<8 | uint32(in[50])<<16 | uint32(in[51])<<24 - j13 := uint32(in[52]) | uint32(in[53])<<8 | uint32(in[54])<<16 | uint32(in[55])<<24 - j14 := uint32(in[56]) | uint32(in[57])<<8 | uint32(in[58])<<16 | uint32(in[59])<<24 - j15 := uint32(in[60]) | uint32(in[61])<<8 | uint32(in[62])<<16 | uint32(in[63])<<24 - - x0, x1, x2, x3, x4, x5, x6, x7, x8 := j0, j1, j2, j3, j4, j5, j6, j7, j8 - x9, x10, x11, x12, x13, x14, x15 := j9, j10, j11, j12, j13, j14, j15 - - for i := 0; i < 8; i += 2 { - u := x0 + x12 - x4 ^= bits.RotateLeft32(u, 7) - u = x4 + x0 - x8 ^= bits.RotateLeft32(u, 9) - u = x8 + x4 - x12 ^= bits.RotateLeft32(u, 13) - u = x12 + x8 - x0 ^= bits.RotateLeft32(u, 18) - - u = x5 + x1 - x9 ^= bits.RotateLeft32(u, 7) - u = x9 + x5 - x13 ^= bits.RotateLeft32(u, 9) - u = x13 + x9 - x1 ^= bits.RotateLeft32(u, 13) - u = x1 + x13 - x5 ^= bits.RotateLeft32(u, 18) - - u = x10 + x6 - x14 ^= bits.RotateLeft32(u, 7) - u = x14 + x10 - x2 ^= bits.RotateLeft32(u, 9) - u = x2 + x14 - x6 ^= bits.RotateLeft32(u, 13) - u = x6 + x2 - x10 ^= bits.RotateLeft32(u, 18) - - u = x15 + x11 - x3 ^= bits.RotateLeft32(u, 7) - u = x3 + x15 - x7 ^= bits.RotateLeft32(u, 9) - u = x7 + x3 - x11 ^= bits.RotateLeft32(u, 13) - u = x11 + x7 - x15 ^= bits.RotateLeft32(u, 18) - - u = x0 + x3 - x1 ^= bits.RotateLeft32(u, 7) - u = x1 + x0 - x2 ^= bits.RotateLeft32(u, 9) - u = x2 + x1 - x3 ^= bits.RotateLeft32(u, 13) - u = x3 + x2 - x0 ^= bits.RotateLeft32(u, 18) - - u = x5 + x4 - x6 ^= bits.RotateLeft32(u, 7) - u = x6 + x5 - x7 ^= bits.RotateLeft32(u, 9) - u = x7 + x6 - x4 ^= bits.RotateLeft32(u, 13) - u = x4 + x7 - x5 ^= bits.RotateLeft32(u, 18) - - u = x10 + x9 - x11 ^= bits.RotateLeft32(u, 7) - u = x11 + x10 - x8 ^= bits.RotateLeft32(u, 9) - u = x8 + x11 - x9 ^= bits.RotateLeft32(u, 13) - u = x9 + x8 - x10 ^= bits.RotateLeft32(u, 18) - - u = x15 + x14 - x12 ^= bits.RotateLeft32(u, 7) - u = x12 + x15 - x13 ^= bits.RotateLeft32(u, 9) - u = x13 + x12 - x14 ^= bits.RotateLeft32(u, 13) - u = x14 + x13 - x15 ^= bits.RotateLeft32(u, 18) - } - x0 += j0 - x1 += j1 - x2 += j2 - x3 += j3 - x4 += j4 - x5 += j5 - x6 += j6 - x7 += j7 - x8 += j8 - x9 += j9 - x10 += j10 - x11 += j11 - x12 += j12 - x13 += j13 - x14 += j14 - x15 += j15 - - out[0] = byte(x0) - out[1] = byte(x0 >> 8) - out[2] = byte(x0 >> 16) - out[3] = byte(x0 >> 24) - - out[4] = byte(x1) - out[5] = byte(x1 >> 8) - out[6] = byte(x1 >> 16) - out[7] = byte(x1 >> 24) - - out[8] = byte(x2) - out[9] = byte(x2 >> 8) - out[10] = byte(x2 >> 16) - out[11] = byte(x2 >> 24) - - out[12] = byte(x3) - out[13] = byte(x3 >> 8) - out[14] = byte(x3 >> 16) - out[15] = byte(x3 >> 24) - - out[16] = byte(x4) - out[17] = byte(x4 >> 8) - out[18] = byte(x4 >> 16) - out[19] = byte(x4 >> 24) - - out[20] = byte(x5) - out[21] = byte(x5 >> 8) - out[22] = byte(x5 >> 16) - out[23] = byte(x5 >> 24) - - out[24] = byte(x6) - out[25] = byte(x6 >> 8) - out[26] = byte(x6 >> 16) - out[27] = byte(x6 >> 24) - - out[28] = byte(x7) - out[29] = byte(x7 >> 8) - out[30] = byte(x7 >> 16) - out[31] = byte(x7 >> 24) - - out[32] = byte(x8) - out[33] = byte(x8 >> 8) - out[34] = byte(x8 >> 16) - out[35] = byte(x8 >> 24) - - out[36] = byte(x9) - out[37] = byte(x9 >> 8) - out[38] = byte(x9 >> 16) - out[39] = byte(x9 >> 24) - - out[40] = byte(x10) - out[41] = byte(x10 >> 8) - out[42] = byte(x10 >> 16) - out[43] = byte(x10 >> 24) - - out[44] = byte(x11) - out[45] = byte(x11 >> 8) - out[46] = byte(x11 >> 16) - out[47] = byte(x11 >> 24) - - out[48] = byte(x12) - out[49] = byte(x12 >> 8) - out[50] = byte(x12 >> 16) - out[51] = byte(x12 >> 24) - - out[52] = byte(x13) - out[53] = byte(x13 >> 8) - out[54] = byte(x13 >> 16) - out[55] = byte(x13 >> 24) - - out[56] = byte(x14) - out[57] = byte(x14 >> 8) - out[58] = byte(x14 >> 16) - out[59] = byte(x14 >> 24) - - out[60] = byte(x15) - out[61] = byte(x15 >> 8) - out[62] = byte(x15 >> 16) - out[63] = byte(x15 >> 24) -} diff --git a/e2e/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go b/e2e/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go deleted file mode 100644 index e76b44fe5..000000000 --- a/e2e/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2012 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. - -//go:build amd64 && !purego && gc - -package salsa - -//go:noescape - -// salsa2020XORKeyStream is implemented in salsa20_amd64.s. -func salsa2020XORKeyStream(out, in *byte, n uint64, nonce, key *byte) - -// XORKeyStream crypts bytes from in to out using the given key and counters. -// In and out must overlap entirely or not at all. Counter -// contains the raw salsa20 counter bytes (both nonce and block counter). -func XORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) { - if len(in) == 0 { - return - } - _ = out[len(in)-1] - salsa2020XORKeyStream(&out[0], &in[0], uint64(len(in)), &counter[0], &key[0]) -} diff --git a/e2e/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s b/e2e/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s deleted file mode 100644 index 3883e0ec2..000000000 --- a/e2e/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s +++ /dev/null @@ -1,880 +0,0 @@ -// Code generated by command: go run salsa20_amd64_asm.go -out ../salsa20_amd64.s -pkg salsa. DO NOT EDIT. - -//go:build amd64 && !purego && gc - -// func salsa2020XORKeyStream(out *byte, in *byte, n uint64, nonce *byte, key *byte) -// Requires: SSE2 -TEXT ·salsa2020XORKeyStream(SB), $456-40 - // This needs up to 64 bytes at 360(R12); hence the non-obvious frame size. - MOVQ out+0(FP), DI - MOVQ in+8(FP), SI - MOVQ n+16(FP), DX - MOVQ nonce+24(FP), CX - MOVQ key+32(FP), R8 - MOVQ SP, R12 - ADDQ $0x1f, R12 - ANDQ $-32, R12 - MOVQ DX, R9 - MOVQ CX, DX - MOVQ R8, R10 - CMPQ R9, $0x00 - JBE DONE - MOVL 20(R10), CX - MOVL (R10), R8 - MOVL (DX), AX - MOVL 16(R10), R11 - MOVL CX, (R12) - MOVL R8, 4(R12) - MOVL AX, 8(R12) - MOVL R11, 12(R12) - MOVL 8(DX), CX - MOVL 24(R10), R8 - MOVL 4(R10), AX - MOVL 4(DX), R11 - MOVL CX, 16(R12) - MOVL R8, 20(R12) - MOVL AX, 24(R12) - MOVL R11, 28(R12) - MOVL 12(DX), CX - MOVL 12(R10), DX - MOVL 28(R10), R8 - MOVL 8(R10), AX - MOVL DX, 32(R12) - MOVL CX, 36(R12) - MOVL R8, 40(R12) - MOVL AX, 44(R12) - MOVQ $0x61707865, DX - MOVQ $0x3320646e, CX - MOVQ $0x79622d32, R8 - MOVQ $0x6b206574, AX - MOVL DX, 48(R12) - MOVL CX, 52(R12) - MOVL R8, 56(R12) - MOVL AX, 60(R12) - CMPQ R9, $0x00000100 - JB BYTESBETWEEN1AND255 - MOVOA 48(R12), X0 - PSHUFL $0x55, X0, X1 - PSHUFL $0xaa, X0, X2 - PSHUFL $0xff, X0, X3 - PSHUFL $0x00, X0, X0 - MOVOA X1, 64(R12) - MOVOA X2, 80(R12) - MOVOA X3, 96(R12) - MOVOA X0, 112(R12) - MOVOA (R12), X0 - PSHUFL $0xaa, X0, X1 - PSHUFL $0xff, X0, X2 - PSHUFL $0x00, X0, X3 - PSHUFL $0x55, X0, X0 - MOVOA X1, 128(R12) - MOVOA X2, 144(R12) - MOVOA X3, 160(R12) - MOVOA X0, 176(R12) - MOVOA 16(R12), X0 - PSHUFL $0xff, X0, X1 - PSHUFL $0x55, X0, X2 - PSHUFL $0xaa, X0, X0 - MOVOA X1, 192(R12) - MOVOA X2, 208(R12) - MOVOA X0, 224(R12) - MOVOA 32(R12), X0 - PSHUFL $0x00, X0, X1 - PSHUFL $0xaa, X0, X2 - PSHUFL $0xff, X0, X0 - MOVOA X1, 240(R12) - MOVOA X2, 256(R12) - MOVOA X0, 272(R12) - -BYTESATLEAST256: - MOVL 16(R12), DX - MOVL 36(R12), CX - MOVL DX, 288(R12) - MOVL CX, 304(R12) - SHLQ $0x20, CX - ADDQ CX, DX - ADDQ $0x01, DX - MOVQ DX, CX - SHRQ $0x20, CX - MOVL DX, 292(R12) - MOVL CX, 308(R12) - ADDQ $0x01, DX - MOVQ DX, CX - SHRQ $0x20, CX - MOVL DX, 296(R12) - MOVL CX, 312(R12) - ADDQ $0x01, DX - MOVQ DX, CX - SHRQ $0x20, CX - MOVL DX, 300(R12) - MOVL CX, 316(R12) - ADDQ $0x01, DX - MOVQ DX, CX - SHRQ $0x20, CX - MOVL DX, 16(R12) - MOVL CX, 36(R12) - MOVQ R9, 352(R12) - MOVQ $0x00000014, DX - MOVOA 64(R12), X0 - MOVOA 80(R12), X1 - MOVOA 96(R12), X2 - MOVOA 256(R12), X3 - MOVOA 272(R12), X4 - MOVOA 128(R12), X5 - MOVOA 144(R12), X6 - MOVOA 176(R12), X7 - MOVOA 192(R12), X8 - MOVOA 208(R12), X9 - MOVOA 224(R12), X10 - MOVOA 304(R12), X11 - MOVOA 112(R12), X12 - MOVOA 160(R12), X13 - MOVOA 240(R12), X14 - MOVOA 288(R12), X15 - -MAINLOOP1: - MOVOA X1, 320(R12) - MOVOA X2, 336(R12) - MOVOA X13, X1 - PADDL X12, X1 - MOVOA X1, X2 - PSLLL $0x07, X1 - PXOR X1, X14 - PSRLL $0x19, X2 - PXOR X2, X14 - MOVOA X7, X1 - PADDL X0, X1 - MOVOA X1, X2 - PSLLL $0x07, X1 - PXOR X1, X11 - PSRLL $0x19, X2 - PXOR X2, X11 - MOVOA X12, X1 - PADDL X14, X1 - MOVOA X1, X2 - PSLLL $0x09, X1 - PXOR X1, X15 - PSRLL $0x17, X2 - PXOR X2, X15 - MOVOA X0, X1 - PADDL X11, X1 - MOVOA X1, X2 - PSLLL $0x09, X1 - PXOR X1, X9 - PSRLL $0x17, X2 - PXOR X2, X9 - MOVOA X14, X1 - PADDL X15, X1 - MOVOA X1, X2 - PSLLL $0x0d, X1 - PXOR X1, X13 - PSRLL $0x13, X2 - PXOR X2, X13 - MOVOA X11, X1 - PADDL X9, X1 - MOVOA X1, X2 - PSLLL $0x0d, X1 - PXOR X1, X7 - PSRLL $0x13, X2 - PXOR X2, X7 - MOVOA X15, X1 - PADDL X13, X1 - MOVOA X1, X2 - PSLLL $0x12, X1 - PXOR X1, X12 - PSRLL $0x0e, X2 - PXOR X2, X12 - MOVOA 320(R12), X1 - MOVOA X12, 320(R12) - MOVOA X9, X2 - PADDL X7, X2 - MOVOA X2, X12 - PSLLL $0x12, X2 - PXOR X2, X0 - PSRLL $0x0e, X12 - PXOR X12, X0 - MOVOA X5, X2 - PADDL X1, X2 - MOVOA X2, X12 - PSLLL $0x07, X2 - PXOR X2, X3 - PSRLL $0x19, X12 - PXOR X12, X3 - MOVOA 336(R12), X2 - MOVOA X0, 336(R12) - MOVOA X6, X0 - PADDL X2, X0 - MOVOA X0, X12 - PSLLL $0x07, X0 - PXOR X0, X4 - PSRLL $0x19, X12 - PXOR X12, X4 - MOVOA X1, X0 - PADDL X3, X0 - MOVOA X0, X12 - PSLLL $0x09, X0 - PXOR X0, X10 - PSRLL $0x17, X12 - PXOR X12, X10 - MOVOA X2, X0 - PADDL X4, X0 - MOVOA X0, X12 - PSLLL $0x09, X0 - PXOR X0, X8 - PSRLL $0x17, X12 - PXOR X12, X8 - MOVOA X3, X0 - PADDL X10, X0 - MOVOA X0, X12 - PSLLL $0x0d, X0 - PXOR X0, X5 - PSRLL $0x13, X12 - PXOR X12, X5 - MOVOA X4, X0 - PADDL X8, X0 - MOVOA X0, X12 - PSLLL $0x0d, X0 - PXOR X0, X6 - PSRLL $0x13, X12 - PXOR X12, X6 - MOVOA X10, X0 - PADDL X5, X0 - MOVOA X0, X12 - PSLLL $0x12, X0 - PXOR X0, X1 - PSRLL $0x0e, X12 - PXOR X12, X1 - MOVOA 320(R12), X0 - MOVOA X1, 320(R12) - MOVOA X4, X1 - PADDL X0, X1 - MOVOA X1, X12 - PSLLL $0x07, X1 - PXOR X1, X7 - PSRLL $0x19, X12 - PXOR X12, X7 - MOVOA X8, X1 - PADDL X6, X1 - MOVOA X1, X12 - PSLLL $0x12, X1 - PXOR X1, X2 - PSRLL $0x0e, X12 - PXOR X12, X2 - MOVOA 336(R12), X12 - MOVOA X2, 336(R12) - MOVOA X14, X1 - PADDL X12, X1 - MOVOA X1, X2 - PSLLL $0x07, X1 - PXOR X1, X5 - PSRLL $0x19, X2 - PXOR X2, X5 - MOVOA X0, X1 - PADDL X7, X1 - MOVOA X1, X2 - PSLLL $0x09, X1 - PXOR X1, X10 - PSRLL $0x17, X2 - PXOR X2, X10 - MOVOA X12, X1 - PADDL X5, X1 - MOVOA X1, X2 - PSLLL $0x09, X1 - PXOR X1, X8 - PSRLL $0x17, X2 - PXOR X2, X8 - MOVOA X7, X1 - PADDL X10, X1 - MOVOA X1, X2 - PSLLL $0x0d, X1 - PXOR X1, X4 - PSRLL $0x13, X2 - PXOR X2, X4 - MOVOA X5, X1 - PADDL X8, X1 - MOVOA X1, X2 - PSLLL $0x0d, X1 - PXOR X1, X14 - PSRLL $0x13, X2 - PXOR X2, X14 - MOVOA X10, X1 - PADDL X4, X1 - MOVOA X1, X2 - PSLLL $0x12, X1 - PXOR X1, X0 - PSRLL $0x0e, X2 - PXOR X2, X0 - MOVOA 320(R12), X1 - MOVOA X0, 320(R12) - MOVOA X8, X0 - PADDL X14, X0 - MOVOA X0, X2 - PSLLL $0x12, X0 - PXOR X0, X12 - PSRLL $0x0e, X2 - PXOR X2, X12 - MOVOA X11, X0 - PADDL X1, X0 - MOVOA X0, X2 - PSLLL $0x07, X0 - PXOR X0, X6 - PSRLL $0x19, X2 - PXOR X2, X6 - MOVOA 336(R12), X2 - MOVOA X12, 336(R12) - MOVOA X3, X0 - PADDL X2, X0 - MOVOA X0, X12 - PSLLL $0x07, X0 - PXOR X0, X13 - PSRLL $0x19, X12 - PXOR X12, X13 - MOVOA X1, X0 - PADDL X6, X0 - MOVOA X0, X12 - PSLLL $0x09, X0 - PXOR X0, X15 - PSRLL $0x17, X12 - PXOR X12, X15 - MOVOA X2, X0 - PADDL X13, X0 - MOVOA X0, X12 - PSLLL $0x09, X0 - PXOR X0, X9 - PSRLL $0x17, X12 - PXOR X12, X9 - MOVOA X6, X0 - PADDL X15, X0 - MOVOA X0, X12 - PSLLL $0x0d, X0 - PXOR X0, X11 - PSRLL $0x13, X12 - PXOR X12, X11 - MOVOA X13, X0 - PADDL X9, X0 - MOVOA X0, X12 - PSLLL $0x0d, X0 - PXOR X0, X3 - PSRLL $0x13, X12 - PXOR X12, X3 - MOVOA X15, X0 - PADDL X11, X0 - MOVOA X0, X12 - PSLLL $0x12, X0 - PXOR X0, X1 - PSRLL $0x0e, X12 - PXOR X12, X1 - MOVOA X9, X0 - PADDL X3, X0 - MOVOA X0, X12 - PSLLL $0x12, X0 - PXOR X0, X2 - PSRLL $0x0e, X12 - PXOR X12, X2 - MOVOA 320(R12), X12 - MOVOA 336(R12), X0 - SUBQ $0x02, DX - JA MAINLOOP1 - PADDL 112(R12), X12 - PADDL 176(R12), X7 - PADDL 224(R12), X10 - PADDL 272(R12), X4 - MOVD X12, DX - MOVD X7, CX - MOVD X10, R8 - MOVD X4, R9 - PSHUFL $0x39, X12, X12 - PSHUFL $0x39, X7, X7 - PSHUFL $0x39, X10, X10 - PSHUFL $0x39, X4, X4 - XORL (SI), DX - XORL 4(SI), CX - XORL 8(SI), R8 - XORL 12(SI), R9 - MOVL DX, (DI) - MOVL CX, 4(DI) - MOVL R8, 8(DI) - MOVL R9, 12(DI) - MOVD X12, DX - MOVD X7, CX - MOVD X10, R8 - MOVD X4, R9 - PSHUFL $0x39, X12, X12 - PSHUFL $0x39, X7, X7 - PSHUFL $0x39, X10, X10 - PSHUFL $0x39, X4, X4 - XORL 64(SI), DX - XORL 68(SI), CX - XORL 72(SI), R8 - XORL 76(SI), R9 - MOVL DX, 64(DI) - MOVL CX, 68(DI) - MOVL R8, 72(DI) - MOVL R9, 76(DI) - MOVD X12, DX - MOVD X7, CX - MOVD X10, R8 - MOVD X4, R9 - PSHUFL $0x39, X12, X12 - PSHUFL $0x39, X7, X7 - PSHUFL $0x39, X10, X10 - PSHUFL $0x39, X4, X4 - XORL 128(SI), DX - XORL 132(SI), CX - XORL 136(SI), R8 - XORL 140(SI), R9 - MOVL DX, 128(DI) - MOVL CX, 132(DI) - MOVL R8, 136(DI) - MOVL R9, 140(DI) - MOVD X12, DX - MOVD X7, CX - MOVD X10, R8 - MOVD X4, R9 - XORL 192(SI), DX - XORL 196(SI), CX - XORL 200(SI), R8 - XORL 204(SI), R9 - MOVL DX, 192(DI) - MOVL CX, 196(DI) - MOVL R8, 200(DI) - MOVL R9, 204(DI) - PADDL 240(R12), X14 - PADDL 64(R12), X0 - PADDL 128(R12), X5 - PADDL 192(R12), X8 - MOVD X14, DX - MOVD X0, CX - MOVD X5, R8 - MOVD X8, R9 - PSHUFL $0x39, X14, X14 - PSHUFL $0x39, X0, X0 - PSHUFL $0x39, X5, X5 - PSHUFL $0x39, X8, X8 - XORL 16(SI), DX - XORL 20(SI), CX - XORL 24(SI), R8 - XORL 28(SI), R9 - MOVL DX, 16(DI) - MOVL CX, 20(DI) - MOVL R8, 24(DI) - MOVL R9, 28(DI) - MOVD X14, DX - MOVD X0, CX - MOVD X5, R8 - MOVD X8, R9 - PSHUFL $0x39, X14, X14 - PSHUFL $0x39, X0, X0 - PSHUFL $0x39, X5, X5 - PSHUFL $0x39, X8, X8 - XORL 80(SI), DX - XORL 84(SI), CX - XORL 88(SI), R8 - XORL 92(SI), R9 - MOVL DX, 80(DI) - MOVL CX, 84(DI) - MOVL R8, 88(DI) - MOVL R9, 92(DI) - MOVD X14, DX - MOVD X0, CX - MOVD X5, R8 - MOVD X8, R9 - PSHUFL $0x39, X14, X14 - PSHUFL $0x39, X0, X0 - PSHUFL $0x39, X5, X5 - PSHUFL $0x39, X8, X8 - XORL 144(SI), DX - XORL 148(SI), CX - XORL 152(SI), R8 - XORL 156(SI), R9 - MOVL DX, 144(DI) - MOVL CX, 148(DI) - MOVL R8, 152(DI) - MOVL R9, 156(DI) - MOVD X14, DX - MOVD X0, CX - MOVD X5, R8 - MOVD X8, R9 - XORL 208(SI), DX - XORL 212(SI), CX - XORL 216(SI), R8 - XORL 220(SI), R9 - MOVL DX, 208(DI) - MOVL CX, 212(DI) - MOVL R8, 216(DI) - MOVL R9, 220(DI) - PADDL 288(R12), X15 - PADDL 304(R12), X11 - PADDL 80(R12), X1 - PADDL 144(R12), X6 - MOVD X15, DX - MOVD X11, CX - MOVD X1, R8 - MOVD X6, R9 - PSHUFL $0x39, X15, X15 - PSHUFL $0x39, X11, X11 - PSHUFL $0x39, X1, X1 - PSHUFL $0x39, X6, X6 - XORL 32(SI), DX - XORL 36(SI), CX - XORL 40(SI), R8 - XORL 44(SI), R9 - MOVL DX, 32(DI) - MOVL CX, 36(DI) - MOVL R8, 40(DI) - MOVL R9, 44(DI) - MOVD X15, DX - MOVD X11, CX - MOVD X1, R8 - MOVD X6, R9 - PSHUFL $0x39, X15, X15 - PSHUFL $0x39, X11, X11 - PSHUFL $0x39, X1, X1 - PSHUFL $0x39, X6, X6 - XORL 96(SI), DX - XORL 100(SI), CX - XORL 104(SI), R8 - XORL 108(SI), R9 - MOVL DX, 96(DI) - MOVL CX, 100(DI) - MOVL R8, 104(DI) - MOVL R9, 108(DI) - MOVD X15, DX - MOVD X11, CX - MOVD X1, R8 - MOVD X6, R9 - PSHUFL $0x39, X15, X15 - PSHUFL $0x39, X11, X11 - PSHUFL $0x39, X1, X1 - PSHUFL $0x39, X6, X6 - XORL 160(SI), DX - XORL 164(SI), CX - XORL 168(SI), R8 - XORL 172(SI), R9 - MOVL DX, 160(DI) - MOVL CX, 164(DI) - MOVL R8, 168(DI) - MOVL R9, 172(DI) - MOVD X15, DX - MOVD X11, CX - MOVD X1, R8 - MOVD X6, R9 - XORL 224(SI), DX - XORL 228(SI), CX - XORL 232(SI), R8 - XORL 236(SI), R9 - MOVL DX, 224(DI) - MOVL CX, 228(DI) - MOVL R8, 232(DI) - MOVL R9, 236(DI) - PADDL 160(R12), X13 - PADDL 208(R12), X9 - PADDL 256(R12), X3 - PADDL 96(R12), X2 - MOVD X13, DX - MOVD X9, CX - MOVD X3, R8 - MOVD X2, R9 - PSHUFL $0x39, X13, X13 - PSHUFL $0x39, X9, X9 - PSHUFL $0x39, X3, X3 - PSHUFL $0x39, X2, X2 - XORL 48(SI), DX - XORL 52(SI), CX - XORL 56(SI), R8 - XORL 60(SI), R9 - MOVL DX, 48(DI) - MOVL CX, 52(DI) - MOVL R8, 56(DI) - MOVL R9, 60(DI) - MOVD X13, DX - MOVD X9, CX - MOVD X3, R8 - MOVD X2, R9 - PSHUFL $0x39, X13, X13 - PSHUFL $0x39, X9, X9 - PSHUFL $0x39, X3, X3 - PSHUFL $0x39, X2, X2 - XORL 112(SI), DX - XORL 116(SI), CX - XORL 120(SI), R8 - XORL 124(SI), R9 - MOVL DX, 112(DI) - MOVL CX, 116(DI) - MOVL R8, 120(DI) - MOVL R9, 124(DI) - MOVD X13, DX - MOVD X9, CX - MOVD X3, R8 - MOVD X2, R9 - PSHUFL $0x39, X13, X13 - PSHUFL $0x39, X9, X9 - PSHUFL $0x39, X3, X3 - PSHUFL $0x39, X2, X2 - XORL 176(SI), DX - XORL 180(SI), CX - XORL 184(SI), R8 - XORL 188(SI), R9 - MOVL DX, 176(DI) - MOVL CX, 180(DI) - MOVL R8, 184(DI) - MOVL R9, 188(DI) - MOVD X13, DX - MOVD X9, CX - MOVD X3, R8 - MOVD X2, R9 - XORL 240(SI), DX - XORL 244(SI), CX - XORL 248(SI), R8 - XORL 252(SI), R9 - MOVL DX, 240(DI) - MOVL CX, 244(DI) - MOVL R8, 248(DI) - MOVL R9, 252(DI) - MOVQ 352(R12), R9 - SUBQ $0x00000100, R9 - ADDQ $0x00000100, SI - ADDQ $0x00000100, DI - CMPQ R9, $0x00000100 - JAE BYTESATLEAST256 - CMPQ R9, $0x00 - JBE DONE - -BYTESBETWEEN1AND255: - CMPQ R9, $0x40 - JAE NOCOPY - MOVQ DI, DX - LEAQ 360(R12), DI - MOVQ R9, CX - REP; MOVSB - LEAQ 360(R12), DI - LEAQ 360(R12), SI - -NOCOPY: - MOVQ R9, 352(R12) - MOVOA 48(R12), X0 - MOVOA (R12), X1 - MOVOA 16(R12), X2 - MOVOA 32(R12), X3 - MOVOA X1, X4 - MOVQ $0x00000014, CX - -MAINLOOP2: - PADDL X0, X4 - MOVOA X0, X5 - MOVOA X4, X6 - PSLLL $0x07, X4 - PSRLL $0x19, X6 - PXOR X4, X3 - PXOR X6, X3 - PADDL X3, X5 - MOVOA X3, X4 - MOVOA X5, X6 - PSLLL $0x09, X5 - PSRLL $0x17, X6 - PXOR X5, X2 - PSHUFL $0x93, X3, X3 - PXOR X6, X2 - PADDL X2, X4 - MOVOA X2, X5 - MOVOA X4, X6 - PSLLL $0x0d, X4 - PSRLL $0x13, X6 - PXOR X4, X1 - PSHUFL $0x4e, X2, X2 - PXOR X6, X1 - PADDL X1, X5 - MOVOA X3, X4 - MOVOA X5, X6 - PSLLL $0x12, X5 - PSRLL $0x0e, X6 - PXOR X5, X0 - PSHUFL $0x39, X1, X1 - PXOR X6, X0 - PADDL X0, X4 - MOVOA X0, X5 - MOVOA X4, X6 - PSLLL $0x07, X4 - PSRLL $0x19, X6 - PXOR X4, X1 - PXOR X6, X1 - PADDL X1, X5 - MOVOA X1, X4 - MOVOA X5, X6 - PSLLL $0x09, X5 - PSRLL $0x17, X6 - PXOR X5, X2 - PSHUFL $0x93, X1, X1 - PXOR X6, X2 - PADDL X2, X4 - MOVOA X2, X5 - MOVOA X4, X6 - PSLLL $0x0d, X4 - PSRLL $0x13, X6 - PXOR X4, X3 - PSHUFL $0x4e, X2, X2 - PXOR X6, X3 - PADDL X3, X5 - MOVOA X1, X4 - MOVOA X5, X6 - PSLLL $0x12, X5 - PSRLL $0x0e, X6 - PXOR X5, X0 - PSHUFL $0x39, X3, X3 - PXOR X6, X0 - PADDL X0, X4 - MOVOA X0, X5 - MOVOA X4, X6 - PSLLL $0x07, X4 - PSRLL $0x19, X6 - PXOR X4, X3 - PXOR X6, X3 - PADDL X3, X5 - MOVOA X3, X4 - MOVOA X5, X6 - PSLLL $0x09, X5 - PSRLL $0x17, X6 - PXOR X5, X2 - PSHUFL $0x93, X3, X3 - PXOR X6, X2 - PADDL X2, X4 - MOVOA X2, X5 - MOVOA X4, X6 - PSLLL $0x0d, X4 - PSRLL $0x13, X6 - PXOR X4, X1 - PSHUFL $0x4e, X2, X2 - PXOR X6, X1 - PADDL X1, X5 - MOVOA X3, X4 - MOVOA X5, X6 - PSLLL $0x12, X5 - PSRLL $0x0e, X6 - PXOR X5, X0 - PSHUFL $0x39, X1, X1 - PXOR X6, X0 - PADDL X0, X4 - MOVOA X0, X5 - MOVOA X4, X6 - PSLLL $0x07, X4 - PSRLL $0x19, X6 - PXOR X4, X1 - PXOR X6, X1 - PADDL X1, X5 - MOVOA X1, X4 - MOVOA X5, X6 - PSLLL $0x09, X5 - PSRLL $0x17, X6 - PXOR X5, X2 - PSHUFL $0x93, X1, X1 - PXOR X6, X2 - PADDL X2, X4 - MOVOA X2, X5 - MOVOA X4, X6 - PSLLL $0x0d, X4 - PSRLL $0x13, X6 - PXOR X4, X3 - PSHUFL $0x4e, X2, X2 - PXOR X6, X3 - SUBQ $0x04, CX - PADDL X3, X5 - MOVOA X1, X4 - MOVOA X5, X6 - PSLLL $0x12, X5 - PXOR X7, X7 - PSRLL $0x0e, X6 - PXOR X5, X0 - PSHUFL $0x39, X3, X3 - PXOR X6, X0 - JA MAINLOOP2 - PADDL 48(R12), X0 - PADDL (R12), X1 - PADDL 16(R12), X2 - PADDL 32(R12), X3 - MOVD X0, CX - MOVD X1, R8 - MOVD X2, R9 - MOVD X3, AX - PSHUFL $0x39, X0, X0 - PSHUFL $0x39, X1, X1 - PSHUFL $0x39, X2, X2 - PSHUFL $0x39, X3, X3 - XORL (SI), CX - XORL 48(SI), R8 - XORL 32(SI), R9 - XORL 16(SI), AX - MOVL CX, (DI) - MOVL R8, 48(DI) - MOVL R9, 32(DI) - MOVL AX, 16(DI) - MOVD X0, CX - MOVD X1, R8 - MOVD X2, R9 - MOVD X3, AX - PSHUFL $0x39, X0, X0 - PSHUFL $0x39, X1, X1 - PSHUFL $0x39, X2, X2 - PSHUFL $0x39, X3, X3 - XORL 20(SI), CX - XORL 4(SI), R8 - XORL 52(SI), R9 - XORL 36(SI), AX - MOVL CX, 20(DI) - MOVL R8, 4(DI) - MOVL R9, 52(DI) - MOVL AX, 36(DI) - MOVD X0, CX - MOVD X1, R8 - MOVD X2, R9 - MOVD X3, AX - PSHUFL $0x39, X0, X0 - PSHUFL $0x39, X1, X1 - PSHUFL $0x39, X2, X2 - PSHUFL $0x39, X3, X3 - XORL 40(SI), CX - XORL 24(SI), R8 - XORL 8(SI), R9 - XORL 56(SI), AX - MOVL CX, 40(DI) - MOVL R8, 24(DI) - MOVL R9, 8(DI) - MOVL AX, 56(DI) - MOVD X0, CX - MOVD X1, R8 - MOVD X2, R9 - MOVD X3, AX - XORL 60(SI), CX - XORL 44(SI), R8 - XORL 28(SI), R9 - XORL 12(SI), AX - MOVL CX, 60(DI) - MOVL R8, 44(DI) - MOVL R9, 28(DI) - MOVL AX, 12(DI) - MOVQ 352(R12), R9 - MOVL 16(R12), CX - MOVL 36(R12), R8 - ADDQ $0x01, CX - SHLQ $0x20, R8 - ADDQ R8, CX - MOVQ CX, R8 - SHRQ $0x20, R8 - MOVL CX, 16(R12) - MOVL R8, 36(R12) - CMPQ R9, $0x40 - JA BYTESATLEAST65 - JAE BYTESATLEAST64 - MOVQ DI, SI - MOVQ DX, DI - MOVQ R9, CX - REP; MOVSB - -BYTESATLEAST64: -DONE: - RET - -BYTESATLEAST65: - SUBQ $0x40, R9 - ADDQ $0x40, DI - ADDQ $0x40, SI - JMP BYTESBETWEEN1AND255 diff --git a/e2e/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_noasm.go b/e2e/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_noasm.go deleted file mode 100644 index 9448760f2..000000000 --- a/e2e/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_noasm.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2019 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. - -//go:build !amd64 || purego || !gc - -package salsa - -// XORKeyStream crypts bytes from in to out using the given key and counters. -// In and out must overlap entirely or not at all. Counter -// contains the raw salsa20 counter bytes (both nonce and block counter). -func XORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) { - genericXORKeyStream(out, in, counter, key) -} diff --git a/e2e/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_ref.go b/e2e/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_ref.go deleted file mode 100644 index e5cdb9a25..000000000 --- a/e2e/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_ref.go +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2012 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 salsa - -import "math/bits" - -const rounds = 20 - -// core applies the Salsa20 core function to 16-byte input in, 32-byte key k, -// and 16-byte constant c, and puts the result into 64-byte array out. -func core(out *[64]byte, in *[16]byte, k *[32]byte, c *[16]byte) { - j0 := uint32(c[0]) | uint32(c[1])<<8 | uint32(c[2])<<16 | uint32(c[3])<<24 - j1 := uint32(k[0]) | uint32(k[1])<<8 | uint32(k[2])<<16 | uint32(k[3])<<24 - j2 := uint32(k[4]) | uint32(k[5])<<8 | uint32(k[6])<<16 | uint32(k[7])<<24 - j3 := uint32(k[8]) | uint32(k[9])<<8 | uint32(k[10])<<16 | uint32(k[11])<<24 - j4 := uint32(k[12]) | uint32(k[13])<<8 | uint32(k[14])<<16 | uint32(k[15])<<24 - j5 := uint32(c[4]) | uint32(c[5])<<8 | uint32(c[6])<<16 | uint32(c[7])<<24 - j6 := uint32(in[0]) | uint32(in[1])<<8 | uint32(in[2])<<16 | uint32(in[3])<<24 - j7 := uint32(in[4]) | uint32(in[5])<<8 | uint32(in[6])<<16 | uint32(in[7])<<24 - j8 := uint32(in[8]) | uint32(in[9])<<8 | uint32(in[10])<<16 | uint32(in[11])<<24 - j9 := uint32(in[12]) | uint32(in[13])<<8 | uint32(in[14])<<16 | uint32(in[15])<<24 - j10 := uint32(c[8]) | uint32(c[9])<<8 | uint32(c[10])<<16 | uint32(c[11])<<24 - j11 := uint32(k[16]) | uint32(k[17])<<8 | uint32(k[18])<<16 | uint32(k[19])<<24 - j12 := uint32(k[20]) | uint32(k[21])<<8 | uint32(k[22])<<16 | uint32(k[23])<<24 - j13 := uint32(k[24]) | uint32(k[25])<<8 | uint32(k[26])<<16 | uint32(k[27])<<24 - j14 := uint32(k[28]) | uint32(k[29])<<8 | uint32(k[30])<<16 | uint32(k[31])<<24 - j15 := uint32(c[12]) | uint32(c[13])<<8 | uint32(c[14])<<16 | uint32(c[15])<<24 - - x0, x1, x2, x3, x4, x5, x6, x7, x8 := j0, j1, j2, j3, j4, j5, j6, j7, j8 - x9, x10, x11, x12, x13, x14, x15 := j9, j10, j11, j12, j13, j14, j15 - - for i := 0; i < rounds; i += 2 { - u := x0 + x12 - x4 ^= bits.RotateLeft32(u, 7) - u = x4 + x0 - x8 ^= bits.RotateLeft32(u, 9) - u = x8 + x4 - x12 ^= bits.RotateLeft32(u, 13) - u = x12 + x8 - x0 ^= bits.RotateLeft32(u, 18) - - u = x5 + x1 - x9 ^= bits.RotateLeft32(u, 7) - u = x9 + x5 - x13 ^= bits.RotateLeft32(u, 9) - u = x13 + x9 - x1 ^= bits.RotateLeft32(u, 13) - u = x1 + x13 - x5 ^= bits.RotateLeft32(u, 18) - - u = x10 + x6 - x14 ^= bits.RotateLeft32(u, 7) - u = x14 + x10 - x2 ^= bits.RotateLeft32(u, 9) - u = x2 + x14 - x6 ^= bits.RotateLeft32(u, 13) - u = x6 + x2 - x10 ^= bits.RotateLeft32(u, 18) - - u = x15 + x11 - x3 ^= bits.RotateLeft32(u, 7) - u = x3 + x15 - x7 ^= bits.RotateLeft32(u, 9) - u = x7 + x3 - x11 ^= bits.RotateLeft32(u, 13) - u = x11 + x7 - x15 ^= bits.RotateLeft32(u, 18) - - u = x0 + x3 - x1 ^= bits.RotateLeft32(u, 7) - u = x1 + x0 - x2 ^= bits.RotateLeft32(u, 9) - u = x2 + x1 - x3 ^= bits.RotateLeft32(u, 13) - u = x3 + x2 - x0 ^= bits.RotateLeft32(u, 18) - - u = x5 + x4 - x6 ^= bits.RotateLeft32(u, 7) - u = x6 + x5 - x7 ^= bits.RotateLeft32(u, 9) - u = x7 + x6 - x4 ^= bits.RotateLeft32(u, 13) - u = x4 + x7 - x5 ^= bits.RotateLeft32(u, 18) - - u = x10 + x9 - x11 ^= bits.RotateLeft32(u, 7) - u = x11 + x10 - x8 ^= bits.RotateLeft32(u, 9) - u = x8 + x11 - x9 ^= bits.RotateLeft32(u, 13) - u = x9 + x8 - x10 ^= bits.RotateLeft32(u, 18) - - u = x15 + x14 - x12 ^= bits.RotateLeft32(u, 7) - u = x12 + x15 - x13 ^= bits.RotateLeft32(u, 9) - u = x13 + x12 - x14 ^= bits.RotateLeft32(u, 13) - u = x14 + x13 - x15 ^= bits.RotateLeft32(u, 18) - } - x0 += j0 - x1 += j1 - x2 += j2 - x3 += j3 - x4 += j4 - x5 += j5 - x6 += j6 - x7 += j7 - x8 += j8 - x9 += j9 - x10 += j10 - x11 += j11 - x12 += j12 - x13 += j13 - x14 += j14 - x15 += j15 - - out[0] = byte(x0) - out[1] = byte(x0 >> 8) - out[2] = byte(x0 >> 16) - out[3] = byte(x0 >> 24) - - out[4] = byte(x1) - out[5] = byte(x1 >> 8) - out[6] = byte(x1 >> 16) - out[7] = byte(x1 >> 24) - - out[8] = byte(x2) - out[9] = byte(x2 >> 8) - out[10] = byte(x2 >> 16) - out[11] = byte(x2 >> 24) - - out[12] = byte(x3) - out[13] = byte(x3 >> 8) - out[14] = byte(x3 >> 16) - out[15] = byte(x3 >> 24) - - out[16] = byte(x4) - out[17] = byte(x4 >> 8) - out[18] = byte(x4 >> 16) - out[19] = byte(x4 >> 24) - - out[20] = byte(x5) - out[21] = byte(x5 >> 8) - out[22] = byte(x5 >> 16) - out[23] = byte(x5 >> 24) - - out[24] = byte(x6) - out[25] = byte(x6 >> 8) - out[26] = byte(x6 >> 16) - out[27] = byte(x6 >> 24) - - out[28] = byte(x7) - out[29] = byte(x7 >> 8) - out[30] = byte(x7 >> 16) - out[31] = byte(x7 >> 24) - - out[32] = byte(x8) - out[33] = byte(x8 >> 8) - out[34] = byte(x8 >> 16) - out[35] = byte(x8 >> 24) - - out[36] = byte(x9) - out[37] = byte(x9 >> 8) - out[38] = byte(x9 >> 16) - out[39] = byte(x9 >> 24) - - out[40] = byte(x10) - out[41] = byte(x10 >> 8) - out[42] = byte(x10 >> 16) - out[43] = byte(x10 >> 24) - - out[44] = byte(x11) - out[45] = byte(x11 >> 8) - out[46] = byte(x11 >> 16) - out[47] = byte(x11 >> 24) - - out[48] = byte(x12) - out[49] = byte(x12 >> 8) - out[50] = byte(x12 >> 16) - out[51] = byte(x12 >> 24) - - out[52] = byte(x13) - out[53] = byte(x13 >> 8) - out[54] = byte(x13 >> 16) - out[55] = byte(x13 >> 24) - - out[56] = byte(x14) - out[57] = byte(x14 >> 8) - out[58] = byte(x14 >> 16) - out[59] = byte(x14 >> 24) - - out[60] = byte(x15) - out[61] = byte(x15 >> 8) - out[62] = byte(x15 >> 16) - out[63] = byte(x15 >> 24) -} - -// genericXORKeyStream is the generic implementation of XORKeyStream to be used -// when no assembly implementation is available. -func genericXORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) { - var block [64]byte - var counterCopy [16]byte - copy(counterCopy[:], counter[:]) - - for len(in) >= 64 { - core(&block, &counterCopy, key, &Sigma) - for i, x := range block { - out[i] = in[i] ^ x - } - u := uint32(1) - for i := 8; i < 16; i++ { - u += uint32(counterCopy[i]) - counterCopy[i] = byte(u) - u >>= 8 - } - in = in[64:] - out = out[64:] - } - - if len(in) > 0 { - core(&block, &counterCopy, key, &Sigma) - for i, v := range in { - out[i] = v ^ block[i] - } - } -} diff --git a/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go b/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go deleted file mode 100644 index 8b462f3df..000000000 --- a/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v4.24.4 -// source: google/api/annotations.proto - -package annotations - -import ( - reflect "reflect" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -var file_google_api_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.MethodOptions)(nil), - ExtensionType: (*HttpRule)(nil), - Field: 72295728, - Name: "google.api.http", - Tag: "bytes,72295728,opt,name=http", - Filename: "google/api/annotations.proto", - }, -} - -// Extension fields to descriptorpb.MethodOptions. -var ( - // See `HttpRule`. - // - // optional google.api.HttpRule http = 72295728; - E_Http = &file_google_api_annotations_proto_extTypes[0] -) - -var File_google_api_annotations_proto protoreflect.FileDescriptor - -var file_google_api_annotations_proto_rawDesc = []byte{ - 0x0a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x15, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x3a, 0x4b, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, 0x1e, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb0, 0xca, 0xbc, 0x22, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, - 0x42, 0x6e, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, - 0x70, 0x69, 0x42, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, - 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var file_google_api_annotations_proto_goTypes = []interface{}{ - (*descriptorpb.MethodOptions)(nil), // 0: google.protobuf.MethodOptions - (*HttpRule)(nil), // 1: google.api.HttpRule -} -var file_google_api_annotations_proto_depIdxs = []int32{ - 0, // 0: google.api.http:extendee -> google.protobuf.MethodOptions - 1, // 1: google.api.http:type_name -> google.api.HttpRule - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 1, // [1:2] is the sub-list for extension type_name - 0, // [0:1] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_google_api_annotations_proto_init() } -func file_google_api_annotations_proto_init() { - if File_google_api_annotations_proto != nil { - return - } - file_google_api_http_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_api_annotations_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 1, - NumServices: 0, - }, - GoTypes: file_google_api_annotations_proto_goTypes, - DependencyIndexes: file_google_api_annotations_proto_depIdxs, - ExtensionInfos: file_google_api_annotations_proto_extTypes, - }.Build() - File_google_api_annotations_proto = out.File - file_google_api_annotations_proto_rawDesc = nil - file_google_api_annotations_proto_goTypes = nil - file_google_api_annotations_proto_depIdxs = nil -} diff --git a/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go b/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go deleted file mode 100644 index db7806cb9..000000000 --- a/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go +++ /dev/null @@ -1,2103 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v4.24.4 -// source: google/api/client.proto - -package annotations - -import ( - reflect "reflect" - sync "sync" - - api "google.golang.org/genproto/googleapis/api" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" - durationpb "google.golang.org/protobuf/types/known/durationpb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// The organization for which the client libraries are being published. -// Affects the url where generated docs are published, etc. -type ClientLibraryOrganization int32 - -const ( - // Not useful. - ClientLibraryOrganization_CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED ClientLibraryOrganization = 0 - // Google Cloud Platform Org. - ClientLibraryOrganization_CLOUD ClientLibraryOrganization = 1 - // Ads (Advertising) Org. - ClientLibraryOrganization_ADS ClientLibraryOrganization = 2 - // Photos Org. - ClientLibraryOrganization_PHOTOS ClientLibraryOrganization = 3 - // Street View Org. - ClientLibraryOrganization_STREET_VIEW ClientLibraryOrganization = 4 - // Shopping Org. - ClientLibraryOrganization_SHOPPING ClientLibraryOrganization = 5 - // Geo Org. - ClientLibraryOrganization_GEO ClientLibraryOrganization = 6 - // Generative AI - https://developers.generativeai.google - ClientLibraryOrganization_GENERATIVE_AI ClientLibraryOrganization = 7 -) - -// Enum value maps for ClientLibraryOrganization. -var ( - ClientLibraryOrganization_name = map[int32]string{ - 0: "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED", - 1: "CLOUD", - 2: "ADS", - 3: "PHOTOS", - 4: "STREET_VIEW", - 5: "SHOPPING", - 6: "GEO", - 7: "GENERATIVE_AI", - } - ClientLibraryOrganization_value = map[string]int32{ - "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, - "CLOUD": 1, - "ADS": 2, - "PHOTOS": 3, - "STREET_VIEW": 4, - "SHOPPING": 5, - "GEO": 6, - "GENERATIVE_AI": 7, - } -) - -func (x ClientLibraryOrganization) Enum() *ClientLibraryOrganization { - p := new(ClientLibraryOrganization) - *p = x - return p -} - -func (x ClientLibraryOrganization) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ClientLibraryOrganization) Descriptor() protoreflect.EnumDescriptor { - return file_google_api_client_proto_enumTypes[0].Descriptor() -} - -func (ClientLibraryOrganization) Type() protoreflect.EnumType { - return &file_google_api_client_proto_enumTypes[0] -} - -func (x ClientLibraryOrganization) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ClientLibraryOrganization.Descriptor instead. -func (ClientLibraryOrganization) EnumDescriptor() ([]byte, []int) { - return file_google_api_client_proto_rawDescGZIP(), []int{0} -} - -// To where should client libraries be published? -type ClientLibraryDestination int32 - -const ( - // Client libraries will neither be generated nor published to package - // managers. - ClientLibraryDestination_CLIENT_LIBRARY_DESTINATION_UNSPECIFIED ClientLibraryDestination = 0 - // Generate the client library in a repo under github.com/googleapis, - // but don't publish it to package managers. - ClientLibraryDestination_GITHUB ClientLibraryDestination = 10 - // Publish the library to package managers like nuget.org and npmjs.com. - ClientLibraryDestination_PACKAGE_MANAGER ClientLibraryDestination = 20 -) - -// Enum value maps for ClientLibraryDestination. -var ( - ClientLibraryDestination_name = map[int32]string{ - 0: "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED", - 10: "GITHUB", - 20: "PACKAGE_MANAGER", - } - ClientLibraryDestination_value = map[string]int32{ - "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, - "GITHUB": 10, - "PACKAGE_MANAGER": 20, - } -) - -func (x ClientLibraryDestination) Enum() *ClientLibraryDestination { - p := new(ClientLibraryDestination) - *p = x - return p -} - -func (x ClientLibraryDestination) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ClientLibraryDestination) Descriptor() protoreflect.EnumDescriptor { - return file_google_api_client_proto_enumTypes[1].Descriptor() -} - -func (ClientLibraryDestination) Type() protoreflect.EnumType { - return &file_google_api_client_proto_enumTypes[1] -} - -func (x ClientLibraryDestination) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ClientLibraryDestination.Descriptor instead. -func (ClientLibraryDestination) EnumDescriptor() ([]byte, []int) { - return file_google_api_client_proto_rawDescGZIP(), []int{1} -} - -// Required information for every language. -type CommonLanguageSettings struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Link to automatically generated reference documentation. Example: - // https://cloud.google.com/nodejs/docs/reference/asset/latest - // - // Deprecated: Do not use. - ReferenceDocsUri string `protobuf:"bytes,1,opt,name=reference_docs_uri,json=referenceDocsUri,proto3" json:"reference_docs_uri,omitempty"` - // The destination where API teams want this client library to be published. - Destinations []ClientLibraryDestination `protobuf:"varint,2,rep,packed,name=destinations,proto3,enum=google.api.ClientLibraryDestination" json:"destinations,omitempty"` - // Configuration for which RPCs should be generated in the GAPIC client. - SelectiveGapicGeneration *SelectiveGapicGeneration `protobuf:"bytes,3,opt,name=selective_gapic_generation,json=selectiveGapicGeneration,proto3" json:"selective_gapic_generation,omitempty"` -} - -func (x *CommonLanguageSettings) Reset() { - *x = CommonLanguageSettings{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_client_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CommonLanguageSettings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommonLanguageSettings) ProtoMessage() {} - -func (x *CommonLanguageSettings) ProtoReflect() protoreflect.Message { - mi := &file_google_api_client_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CommonLanguageSettings.ProtoReflect.Descriptor instead. -func (*CommonLanguageSettings) Descriptor() ([]byte, []int) { - return file_google_api_client_proto_rawDescGZIP(), []int{0} -} - -// Deprecated: Do not use. -func (x *CommonLanguageSettings) GetReferenceDocsUri() string { - if x != nil { - return x.ReferenceDocsUri - } - return "" -} - -func (x *CommonLanguageSettings) GetDestinations() []ClientLibraryDestination { - if x != nil { - return x.Destinations - } - return nil -} - -func (x *CommonLanguageSettings) GetSelectiveGapicGeneration() *SelectiveGapicGeneration { - if x != nil { - return x.SelectiveGapicGeneration - } - return nil -} - -// Details about how and where to publish client libraries. -type ClientLibrarySettings struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Version of the API to apply these settings to. This is the full protobuf - // package for the API, ending in the version element. - // Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // Launch stage of this version of the API. - LaunchStage api.LaunchStage `protobuf:"varint,2,opt,name=launch_stage,json=launchStage,proto3,enum=google.api.LaunchStage" json:"launch_stage,omitempty"` - // When using transport=rest, the client request will encode enums as - // numbers rather than strings. - RestNumericEnums bool `protobuf:"varint,3,opt,name=rest_numeric_enums,json=restNumericEnums,proto3" json:"rest_numeric_enums,omitempty"` - // Settings for legacy Java features, supported in the Service YAML. - JavaSettings *JavaSettings `protobuf:"bytes,21,opt,name=java_settings,json=javaSettings,proto3" json:"java_settings,omitempty"` - // Settings for C++ client libraries. - CppSettings *CppSettings `protobuf:"bytes,22,opt,name=cpp_settings,json=cppSettings,proto3" json:"cpp_settings,omitempty"` - // Settings for PHP client libraries. - PhpSettings *PhpSettings `protobuf:"bytes,23,opt,name=php_settings,json=phpSettings,proto3" json:"php_settings,omitempty"` - // Settings for Python client libraries. - PythonSettings *PythonSettings `protobuf:"bytes,24,opt,name=python_settings,json=pythonSettings,proto3" json:"python_settings,omitempty"` - // Settings for Node client libraries. - NodeSettings *NodeSettings `protobuf:"bytes,25,opt,name=node_settings,json=nodeSettings,proto3" json:"node_settings,omitempty"` - // Settings for .NET client libraries. - DotnetSettings *DotnetSettings `protobuf:"bytes,26,opt,name=dotnet_settings,json=dotnetSettings,proto3" json:"dotnet_settings,omitempty"` - // Settings for Ruby client libraries. - RubySettings *RubySettings `protobuf:"bytes,27,opt,name=ruby_settings,json=rubySettings,proto3" json:"ruby_settings,omitempty"` - // Settings for Go client libraries. - GoSettings *GoSettings `protobuf:"bytes,28,opt,name=go_settings,json=goSettings,proto3" json:"go_settings,omitempty"` -} - -func (x *ClientLibrarySettings) Reset() { - *x = ClientLibrarySettings{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_client_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ClientLibrarySettings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClientLibrarySettings) ProtoMessage() {} - -func (x *ClientLibrarySettings) ProtoReflect() protoreflect.Message { - mi := &file_google_api_client_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClientLibrarySettings.ProtoReflect.Descriptor instead. -func (*ClientLibrarySettings) Descriptor() ([]byte, []int) { - return file_google_api_client_proto_rawDescGZIP(), []int{1} -} - -func (x *ClientLibrarySettings) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *ClientLibrarySettings) GetLaunchStage() api.LaunchStage { - if x != nil { - return x.LaunchStage - } - return api.LaunchStage_LAUNCH_STAGE_UNSPECIFIED -} - -func (x *ClientLibrarySettings) GetRestNumericEnums() bool { - if x != nil { - return x.RestNumericEnums - } - return false -} - -func (x *ClientLibrarySettings) GetJavaSettings() *JavaSettings { - if x != nil { - return x.JavaSettings - } - return nil -} - -func (x *ClientLibrarySettings) GetCppSettings() *CppSettings { - if x != nil { - return x.CppSettings - } - return nil -} - -func (x *ClientLibrarySettings) GetPhpSettings() *PhpSettings { - if x != nil { - return x.PhpSettings - } - return nil -} - -func (x *ClientLibrarySettings) GetPythonSettings() *PythonSettings { - if x != nil { - return x.PythonSettings - } - return nil -} - -func (x *ClientLibrarySettings) GetNodeSettings() *NodeSettings { - if x != nil { - return x.NodeSettings - } - return nil -} - -func (x *ClientLibrarySettings) GetDotnetSettings() *DotnetSettings { - if x != nil { - return x.DotnetSettings - } - return nil -} - -func (x *ClientLibrarySettings) GetRubySettings() *RubySettings { - if x != nil { - return x.RubySettings - } - return nil -} - -func (x *ClientLibrarySettings) GetGoSettings() *GoSettings { - if x != nil { - return x.GoSettings - } - return nil -} - -// This message configures the settings for publishing [Google Cloud Client -// libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) -// generated from the service config. -type Publishing struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // A list of API method settings, e.g. the behavior for methods that use the - // long-running operation pattern. - MethodSettings []*MethodSettings `protobuf:"bytes,2,rep,name=method_settings,json=methodSettings,proto3" json:"method_settings,omitempty"` - // Link to a *public* URI where users can report issues. Example: - // https://issuetracker.google.com/issues/new?component=190865&template=1161103 - NewIssueUri string `protobuf:"bytes,101,opt,name=new_issue_uri,json=newIssueUri,proto3" json:"new_issue_uri,omitempty"` - // Link to product home page. Example: - // https://cloud.google.com/asset-inventory/docs/overview - DocumentationUri string `protobuf:"bytes,102,opt,name=documentation_uri,json=documentationUri,proto3" json:"documentation_uri,omitempty"` - // Used as a tracking tag when collecting data about the APIs developer - // relations artifacts like docs, packages delivered to package managers, - // etc. Example: "speech". - ApiShortName string `protobuf:"bytes,103,opt,name=api_short_name,json=apiShortName,proto3" json:"api_short_name,omitempty"` - // GitHub label to apply to issues and pull requests opened for this API. - GithubLabel string `protobuf:"bytes,104,opt,name=github_label,json=githubLabel,proto3" json:"github_label,omitempty"` - // GitHub teams to be added to CODEOWNERS in the directory in GitHub - // containing source code for the client libraries for this API. - CodeownerGithubTeams []string `protobuf:"bytes,105,rep,name=codeowner_github_teams,json=codeownerGithubTeams,proto3" json:"codeowner_github_teams,omitempty"` - // A prefix used in sample code when demarking regions to be included in - // documentation. - DocTagPrefix string `protobuf:"bytes,106,opt,name=doc_tag_prefix,json=docTagPrefix,proto3" json:"doc_tag_prefix,omitempty"` - // For whom the client library is being published. - Organization ClientLibraryOrganization `protobuf:"varint,107,opt,name=organization,proto3,enum=google.api.ClientLibraryOrganization" json:"organization,omitempty"` - // Client library settings. If the same version string appears multiple - // times in this list, then the last one wins. Settings from earlier - // settings with the same version string are discarded. - LibrarySettings []*ClientLibrarySettings `protobuf:"bytes,109,rep,name=library_settings,json=librarySettings,proto3" json:"library_settings,omitempty"` - // Optional link to proto reference documentation. Example: - // https://cloud.google.com/pubsub/lite/docs/reference/rpc - ProtoReferenceDocumentationUri string `protobuf:"bytes,110,opt,name=proto_reference_documentation_uri,json=protoReferenceDocumentationUri,proto3" json:"proto_reference_documentation_uri,omitempty"` - // Optional link to REST reference documentation. Example: - // https://cloud.google.com/pubsub/lite/docs/reference/rest - RestReferenceDocumentationUri string `protobuf:"bytes,111,opt,name=rest_reference_documentation_uri,json=restReferenceDocumentationUri,proto3" json:"rest_reference_documentation_uri,omitempty"` -} - -func (x *Publishing) Reset() { - *x = Publishing{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_client_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Publishing) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Publishing) ProtoMessage() {} - -func (x *Publishing) ProtoReflect() protoreflect.Message { - mi := &file_google_api_client_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Publishing.ProtoReflect.Descriptor instead. -func (*Publishing) Descriptor() ([]byte, []int) { - return file_google_api_client_proto_rawDescGZIP(), []int{2} -} - -func (x *Publishing) GetMethodSettings() []*MethodSettings { - if x != nil { - return x.MethodSettings - } - return nil -} - -func (x *Publishing) GetNewIssueUri() string { - if x != nil { - return x.NewIssueUri - } - return "" -} - -func (x *Publishing) GetDocumentationUri() string { - if x != nil { - return x.DocumentationUri - } - return "" -} - -func (x *Publishing) GetApiShortName() string { - if x != nil { - return x.ApiShortName - } - return "" -} - -func (x *Publishing) GetGithubLabel() string { - if x != nil { - return x.GithubLabel - } - return "" -} - -func (x *Publishing) GetCodeownerGithubTeams() []string { - if x != nil { - return x.CodeownerGithubTeams - } - return nil -} - -func (x *Publishing) GetDocTagPrefix() string { - if x != nil { - return x.DocTagPrefix - } - return "" -} - -func (x *Publishing) GetOrganization() ClientLibraryOrganization { - if x != nil { - return x.Organization - } - return ClientLibraryOrganization_CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED -} - -func (x *Publishing) GetLibrarySettings() []*ClientLibrarySettings { - if x != nil { - return x.LibrarySettings - } - return nil -} - -func (x *Publishing) GetProtoReferenceDocumentationUri() string { - if x != nil { - return x.ProtoReferenceDocumentationUri - } - return "" -} - -func (x *Publishing) GetRestReferenceDocumentationUri() string { - if x != nil { - return x.RestReferenceDocumentationUri - } - return "" -} - -// Settings for Java client libraries. -type JavaSettings struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The package name to use in Java. Clobbers the java_package option - // set in the protobuf. This should be used **only** by APIs - // who have already set the language_settings.java.package_name" field - // in gapic.yaml. API teams should use the protobuf java_package option - // where possible. - // - // Example of a YAML configuration:: - // - // publishing: - // java_settings: - // library_package: com.google.cloud.pubsub.v1 - LibraryPackage string `protobuf:"bytes,1,opt,name=library_package,json=libraryPackage,proto3" json:"library_package,omitempty"` - // Configure the Java class name to use instead of the service's for its - // corresponding generated GAPIC client. Keys are fully-qualified - // service names as they appear in the protobuf (including the full - // the language_settings.java.interface_names" field in gapic.yaml. API - // teams should otherwise use the service name as it appears in the - // protobuf. - // - // Example of a YAML configuration:: - // - // publishing: - // java_settings: - // service_class_names: - // - google.pubsub.v1.Publisher: TopicAdmin - // - google.pubsub.v1.Subscriber: SubscriptionAdmin - ServiceClassNames map[string]string `protobuf:"bytes,2,rep,name=service_class_names,json=serviceClassNames,proto3" json:"service_class_names,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Some settings. - Common *CommonLanguageSettings `protobuf:"bytes,3,opt,name=common,proto3" json:"common,omitempty"` -} - -func (x *JavaSettings) Reset() { - *x = JavaSettings{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_client_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *JavaSettings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JavaSettings) ProtoMessage() {} - -func (x *JavaSettings) ProtoReflect() protoreflect.Message { - mi := &file_google_api_client_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use JavaSettings.ProtoReflect.Descriptor instead. -func (*JavaSettings) Descriptor() ([]byte, []int) { - return file_google_api_client_proto_rawDescGZIP(), []int{3} -} - -func (x *JavaSettings) GetLibraryPackage() string { - if x != nil { - return x.LibraryPackage - } - return "" -} - -func (x *JavaSettings) GetServiceClassNames() map[string]string { - if x != nil { - return x.ServiceClassNames - } - return nil -} - -func (x *JavaSettings) GetCommon() *CommonLanguageSettings { - if x != nil { - return x.Common - } - return nil -} - -// Settings for C++ client libraries. -type CppSettings struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Some settings. - Common *CommonLanguageSettings `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"` -} - -func (x *CppSettings) Reset() { - *x = CppSettings{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_client_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CppSettings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CppSettings) ProtoMessage() {} - -func (x *CppSettings) ProtoReflect() protoreflect.Message { - mi := &file_google_api_client_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CppSettings.ProtoReflect.Descriptor instead. -func (*CppSettings) Descriptor() ([]byte, []int) { - return file_google_api_client_proto_rawDescGZIP(), []int{4} -} - -func (x *CppSettings) GetCommon() *CommonLanguageSettings { - if x != nil { - return x.Common - } - return nil -} - -// Settings for Php client libraries. -type PhpSettings struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Some settings. - Common *CommonLanguageSettings `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"` -} - -func (x *PhpSettings) Reset() { - *x = PhpSettings{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_client_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PhpSettings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PhpSettings) ProtoMessage() {} - -func (x *PhpSettings) ProtoReflect() protoreflect.Message { - mi := &file_google_api_client_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PhpSettings.ProtoReflect.Descriptor instead. -func (*PhpSettings) Descriptor() ([]byte, []int) { - return file_google_api_client_proto_rawDescGZIP(), []int{5} -} - -func (x *PhpSettings) GetCommon() *CommonLanguageSettings { - if x != nil { - return x.Common - } - return nil -} - -// Settings for Python client libraries. -type PythonSettings struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Some settings. - Common *CommonLanguageSettings `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"` - // Experimental features to be included during client library generation. - ExperimentalFeatures *PythonSettings_ExperimentalFeatures `protobuf:"bytes,2,opt,name=experimental_features,json=experimentalFeatures,proto3" json:"experimental_features,omitempty"` -} - -func (x *PythonSettings) Reset() { - *x = PythonSettings{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_client_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PythonSettings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PythonSettings) ProtoMessage() {} - -func (x *PythonSettings) ProtoReflect() protoreflect.Message { - mi := &file_google_api_client_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PythonSettings.ProtoReflect.Descriptor instead. -func (*PythonSettings) Descriptor() ([]byte, []int) { - return file_google_api_client_proto_rawDescGZIP(), []int{6} -} - -func (x *PythonSettings) GetCommon() *CommonLanguageSettings { - if x != nil { - return x.Common - } - return nil -} - -func (x *PythonSettings) GetExperimentalFeatures() *PythonSettings_ExperimentalFeatures { - if x != nil { - return x.ExperimentalFeatures - } - return nil -} - -// Settings for Node client libraries. -type NodeSettings struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Some settings. - Common *CommonLanguageSettings `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"` -} - -func (x *NodeSettings) Reset() { - *x = NodeSettings{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_client_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NodeSettings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NodeSettings) ProtoMessage() {} - -func (x *NodeSettings) ProtoReflect() protoreflect.Message { - mi := &file_google_api_client_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NodeSettings.ProtoReflect.Descriptor instead. -func (*NodeSettings) Descriptor() ([]byte, []int) { - return file_google_api_client_proto_rawDescGZIP(), []int{7} -} - -func (x *NodeSettings) GetCommon() *CommonLanguageSettings { - if x != nil { - return x.Common - } - return nil -} - -// Settings for Dotnet client libraries. -type DotnetSettings struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Some settings. - Common *CommonLanguageSettings `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"` - // Map from original service names to renamed versions. - // This is used when the default generated types - // would cause a naming conflict. (Neither name is - // fully-qualified.) - // Example: Subscriber to SubscriberServiceApi. - RenamedServices map[string]string `protobuf:"bytes,2,rep,name=renamed_services,json=renamedServices,proto3" json:"renamed_services,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Map from full resource types to the effective short name - // for the resource. This is used when otherwise resource - // named from different services would cause naming collisions. - // Example entry: - // "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - RenamedResources map[string]string `protobuf:"bytes,3,rep,name=renamed_resources,json=renamedResources,proto3" json:"renamed_resources,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // List of full resource types to ignore during generation. - // This is typically used for API-specific Location resources, - // which should be handled by the generator as if they were actually - // the common Location resources. - // Example entry: "documentai.googleapis.com/Location" - IgnoredResources []string `protobuf:"bytes,4,rep,name=ignored_resources,json=ignoredResources,proto3" json:"ignored_resources,omitempty"` - // Namespaces which must be aliased in snippets due to - // a known (but non-generator-predictable) naming collision - ForcedNamespaceAliases []string `protobuf:"bytes,5,rep,name=forced_namespace_aliases,json=forcedNamespaceAliases,proto3" json:"forced_namespace_aliases,omitempty"` - // Method signatures (in the form "service.method(signature)") - // which are provided separately, so shouldn't be generated. - // Snippets *calling* these methods are still generated, however. - HandwrittenSignatures []string `protobuf:"bytes,6,rep,name=handwritten_signatures,json=handwrittenSignatures,proto3" json:"handwritten_signatures,omitempty"` -} - -func (x *DotnetSettings) Reset() { - *x = DotnetSettings{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_client_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DotnetSettings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DotnetSettings) ProtoMessage() {} - -func (x *DotnetSettings) ProtoReflect() protoreflect.Message { - mi := &file_google_api_client_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DotnetSettings.ProtoReflect.Descriptor instead. -func (*DotnetSettings) Descriptor() ([]byte, []int) { - return file_google_api_client_proto_rawDescGZIP(), []int{8} -} - -func (x *DotnetSettings) GetCommon() *CommonLanguageSettings { - if x != nil { - return x.Common - } - return nil -} - -func (x *DotnetSettings) GetRenamedServices() map[string]string { - if x != nil { - return x.RenamedServices - } - return nil -} - -func (x *DotnetSettings) GetRenamedResources() map[string]string { - if x != nil { - return x.RenamedResources - } - return nil -} - -func (x *DotnetSettings) GetIgnoredResources() []string { - if x != nil { - return x.IgnoredResources - } - return nil -} - -func (x *DotnetSettings) GetForcedNamespaceAliases() []string { - if x != nil { - return x.ForcedNamespaceAliases - } - return nil -} - -func (x *DotnetSettings) GetHandwrittenSignatures() []string { - if x != nil { - return x.HandwrittenSignatures - } - return nil -} - -// Settings for Ruby client libraries. -type RubySettings struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Some settings. - Common *CommonLanguageSettings `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"` -} - -func (x *RubySettings) Reset() { - *x = RubySettings{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_client_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RubySettings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RubySettings) ProtoMessage() {} - -func (x *RubySettings) ProtoReflect() protoreflect.Message { - mi := &file_google_api_client_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RubySettings.ProtoReflect.Descriptor instead. -func (*RubySettings) Descriptor() ([]byte, []int) { - return file_google_api_client_proto_rawDescGZIP(), []int{9} -} - -func (x *RubySettings) GetCommon() *CommonLanguageSettings { - if x != nil { - return x.Common - } - return nil -} - -// Settings for Go client libraries. -type GoSettings struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Some settings. - Common *CommonLanguageSettings `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"` - // Map of service names to renamed services. Keys are the package relative - // service names and values are the name to be used for the service client - // and call options. - // - // publishing: - // - // go_settings: - // renamed_services: - // Publisher: TopicAdmin - RenamedServices map[string]string `protobuf:"bytes,2,rep,name=renamed_services,json=renamedServices,proto3" json:"renamed_services,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *GoSettings) Reset() { - *x = GoSettings{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_client_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GoSettings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GoSettings) ProtoMessage() {} - -func (x *GoSettings) ProtoReflect() protoreflect.Message { - mi := &file_google_api_client_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GoSettings.ProtoReflect.Descriptor instead. -func (*GoSettings) Descriptor() ([]byte, []int) { - return file_google_api_client_proto_rawDescGZIP(), []int{10} -} - -func (x *GoSettings) GetCommon() *CommonLanguageSettings { - if x != nil { - return x.Common - } - return nil -} - -func (x *GoSettings) GetRenamedServices() map[string]string { - if x != nil { - return x.RenamedServices - } - return nil -} - -// Describes the generator configuration for a method. -type MethodSettings struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The fully qualified name of the method, for which the options below apply. - // This is used to find the method to apply the options. - // - // Example: - // - // publishing: - // method_settings: - // - selector: google.storage.control.v2.StorageControl.CreateFolder - // # method settings for CreateFolder... - Selector string `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"` - // Describes settings to use for long-running operations when generating - // API methods for RPCs. Complements RPCs that use the annotations in - // google/longrunning/operations.proto. - // - // Example of a YAML configuration:: - // - // publishing: - // method_settings: - // - selector: google.cloud.speech.v2.Speech.BatchRecognize - // long_running: - // initial_poll_delay: 60s # 1 minute - // poll_delay_multiplier: 1.5 - // max_poll_delay: 360s # 6 minutes - // total_poll_timeout: 54000s # 90 minutes - LongRunning *MethodSettings_LongRunning `protobuf:"bytes,2,opt,name=long_running,json=longRunning,proto3" json:"long_running,omitempty"` - // List of top-level fields of the request message, that should be - // automatically populated by the client libraries based on their - // (google.api.field_info).format. Currently supported format: UUID4. - // - // Example of a YAML configuration: - // - // publishing: - // method_settings: - // - selector: google.example.v1.ExampleService.CreateExample - // auto_populated_fields: - // - request_id - AutoPopulatedFields []string `protobuf:"bytes,3,rep,name=auto_populated_fields,json=autoPopulatedFields,proto3" json:"auto_populated_fields,omitempty"` -} - -func (x *MethodSettings) Reset() { - *x = MethodSettings{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_client_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MethodSettings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MethodSettings) ProtoMessage() {} - -func (x *MethodSettings) ProtoReflect() protoreflect.Message { - mi := &file_google_api_client_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MethodSettings.ProtoReflect.Descriptor instead. -func (*MethodSettings) Descriptor() ([]byte, []int) { - return file_google_api_client_proto_rawDescGZIP(), []int{11} -} - -func (x *MethodSettings) GetSelector() string { - if x != nil { - return x.Selector - } - return "" -} - -func (x *MethodSettings) GetLongRunning() *MethodSettings_LongRunning { - if x != nil { - return x.LongRunning - } - return nil -} - -func (x *MethodSettings) GetAutoPopulatedFields() []string { - if x != nil { - return x.AutoPopulatedFields - } - return nil -} - -// This message is used to configure the generation of a subset of the RPCs in -// a service for client libraries. -type SelectiveGapicGeneration struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // An allowlist of the fully qualified names of RPCs that should be included - // on public client surfaces. - Methods []string `protobuf:"bytes,1,rep,name=methods,proto3" json:"methods,omitempty"` - // Setting this to true indicates to the client generators that methods - // that would be excluded from the generation should instead be generated - // in a way that indicates these methods should not be consumed by - // end users. How this is expressed is up to individual language - // implementations to decide. Some examples may be: added annotations, - // obfuscated identifiers, or other language idiomatic patterns. - GenerateOmittedAsInternal bool `protobuf:"varint,2,opt,name=generate_omitted_as_internal,json=generateOmittedAsInternal,proto3" json:"generate_omitted_as_internal,omitempty"` -} - -func (x *SelectiveGapicGeneration) Reset() { - *x = SelectiveGapicGeneration{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_client_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SelectiveGapicGeneration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SelectiveGapicGeneration) ProtoMessage() {} - -func (x *SelectiveGapicGeneration) ProtoReflect() protoreflect.Message { - mi := &file_google_api_client_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SelectiveGapicGeneration.ProtoReflect.Descriptor instead. -func (*SelectiveGapicGeneration) Descriptor() ([]byte, []int) { - return file_google_api_client_proto_rawDescGZIP(), []int{12} -} - -func (x *SelectiveGapicGeneration) GetMethods() []string { - if x != nil { - return x.Methods - } - return nil -} - -func (x *SelectiveGapicGeneration) GetGenerateOmittedAsInternal() bool { - if x != nil { - return x.GenerateOmittedAsInternal - } - return false -} - -// Experimental features to be included during client library generation. -// These fields will be deprecated once the feature graduates and is enabled -// by default. -type PythonSettings_ExperimentalFeatures struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Enables generation of asynchronous REST clients if `rest` transport is - // enabled. By default, asynchronous REST clients will not be generated. - // This feature will be enabled by default 1 month after launching the - // feature in preview packages. - RestAsyncIoEnabled bool `protobuf:"varint,1,opt,name=rest_async_io_enabled,json=restAsyncIoEnabled,proto3" json:"rest_async_io_enabled,omitempty"` - // Enables generation of protobuf code using new types that are more - // Pythonic which are included in `protobuf>=5.29.x`. This feature will be - // enabled by default 1 month after launching the feature in preview - // packages. - ProtobufPythonicTypesEnabled bool `protobuf:"varint,2,opt,name=protobuf_pythonic_types_enabled,json=protobufPythonicTypesEnabled,proto3" json:"protobuf_pythonic_types_enabled,omitempty"` - // Disables generation of an unversioned Python package for this client - // library. This means that the module names will need to be versioned in - // import statements. For example `import google.cloud.library_v2` instead - // of `import google.cloud.library`. - UnversionedPackageDisabled bool `protobuf:"varint,3,opt,name=unversioned_package_disabled,json=unversionedPackageDisabled,proto3" json:"unversioned_package_disabled,omitempty"` -} - -func (x *PythonSettings_ExperimentalFeatures) Reset() { - *x = PythonSettings_ExperimentalFeatures{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_client_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PythonSettings_ExperimentalFeatures) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PythonSettings_ExperimentalFeatures) ProtoMessage() {} - -func (x *PythonSettings_ExperimentalFeatures) ProtoReflect() protoreflect.Message { - mi := &file_google_api_client_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PythonSettings_ExperimentalFeatures.ProtoReflect.Descriptor instead. -func (*PythonSettings_ExperimentalFeatures) Descriptor() ([]byte, []int) { - return file_google_api_client_proto_rawDescGZIP(), []int{6, 0} -} - -func (x *PythonSettings_ExperimentalFeatures) GetRestAsyncIoEnabled() bool { - if x != nil { - return x.RestAsyncIoEnabled - } - return false -} - -func (x *PythonSettings_ExperimentalFeatures) GetProtobufPythonicTypesEnabled() bool { - if x != nil { - return x.ProtobufPythonicTypesEnabled - } - return false -} - -func (x *PythonSettings_ExperimentalFeatures) GetUnversionedPackageDisabled() bool { - if x != nil { - return x.UnversionedPackageDisabled - } - return false -} - -// Describes settings to use when generating API methods that use the -// long-running operation pattern. -// All default values below are from those used in the client library -// generators (e.g. -// [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). -type MethodSettings_LongRunning struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Initial delay after which the first poll request will be made. - // Default value: 5 seconds. - InitialPollDelay *durationpb.Duration `protobuf:"bytes,1,opt,name=initial_poll_delay,json=initialPollDelay,proto3" json:"initial_poll_delay,omitempty"` - // Multiplier to gradually increase delay between subsequent polls until it - // reaches max_poll_delay. - // Default value: 1.5. - PollDelayMultiplier float32 `protobuf:"fixed32,2,opt,name=poll_delay_multiplier,json=pollDelayMultiplier,proto3" json:"poll_delay_multiplier,omitempty"` - // Maximum time between two subsequent poll requests. - // Default value: 45 seconds. - MaxPollDelay *durationpb.Duration `protobuf:"bytes,3,opt,name=max_poll_delay,json=maxPollDelay,proto3" json:"max_poll_delay,omitempty"` - // Total polling timeout. - // Default value: 5 minutes. - TotalPollTimeout *durationpb.Duration `protobuf:"bytes,4,opt,name=total_poll_timeout,json=totalPollTimeout,proto3" json:"total_poll_timeout,omitempty"` -} - -func (x *MethodSettings_LongRunning) Reset() { - *x = MethodSettings_LongRunning{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_client_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MethodSettings_LongRunning) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MethodSettings_LongRunning) ProtoMessage() {} - -func (x *MethodSettings_LongRunning) ProtoReflect() protoreflect.Message { - mi := &file_google_api_client_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MethodSettings_LongRunning.ProtoReflect.Descriptor instead. -func (*MethodSettings_LongRunning) Descriptor() ([]byte, []int) { - return file_google_api_client_proto_rawDescGZIP(), []int{11, 0} -} - -func (x *MethodSettings_LongRunning) GetInitialPollDelay() *durationpb.Duration { - if x != nil { - return x.InitialPollDelay - } - return nil -} - -func (x *MethodSettings_LongRunning) GetPollDelayMultiplier() float32 { - if x != nil { - return x.PollDelayMultiplier - } - return 0 -} - -func (x *MethodSettings_LongRunning) GetMaxPollDelay() *durationpb.Duration { - if x != nil { - return x.MaxPollDelay - } - return nil -} - -func (x *MethodSettings_LongRunning) GetTotalPollTimeout() *durationpb.Duration { - if x != nil { - return x.TotalPollTimeout - } - return nil -} - -var file_google_api_client_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.MethodOptions)(nil), - ExtensionType: ([]string)(nil), - Field: 1051, - Name: "google.api.method_signature", - Tag: "bytes,1051,rep,name=method_signature", - Filename: "google/api/client.proto", - }, - { - ExtendedType: (*descriptorpb.ServiceOptions)(nil), - ExtensionType: (*string)(nil), - Field: 1049, - Name: "google.api.default_host", - Tag: "bytes,1049,opt,name=default_host", - Filename: "google/api/client.proto", - }, - { - ExtendedType: (*descriptorpb.ServiceOptions)(nil), - ExtensionType: (*string)(nil), - Field: 1050, - Name: "google.api.oauth_scopes", - Tag: "bytes,1050,opt,name=oauth_scopes", - Filename: "google/api/client.proto", - }, - { - ExtendedType: (*descriptorpb.ServiceOptions)(nil), - ExtensionType: (*string)(nil), - Field: 525000001, - Name: "google.api.api_version", - Tag: "bytes,525000001,opt,name=api_version", - Filename: "google/api/client.proto", - }, -} - -// Extension fields to descriptorpb.MethodOptions. -var ( - // A definition of a client library method signature. - // - // In client libraries, each proto RPC corresponds to one or more methods - // which the end user is able to call, and calls the underlying RPC. - // Normally, this method receives a single argument (a struct or instance - // corresponding to the RPC request object). Defining this field will - // add one or more overloads providing flattened or simpler method signatures - // in some languages. - // - // The fields on the method signature are provided as a comma-separated - // string. - // - // For example, the proto RPC and annotation: - // - // rpc CreateSubscription(CreateSubscriptionRequest) - // returns (Subscription) { - // option (google.api.method_signature) = "name,topic"; - // } - // - // Would add the following Java overload (in addition to the method accepting - // the request object): - // - // public final Subscription createSubscription(String name, String topic) - // - // The following backwards-compatibility guidelines apply: - // - // - Adding this annotation to an unannotated method is backwards - // compatible. - // - Adding this annotation to a method which already has existing - // method signature annotations is backwards compatible if and only if - // the new method signature annotation is last in the sequence. - // - Modifying or removing an existing method signature annotation is - // a breaking change. - // - Re-ordering existing method signature annotations is a breaking - // change. - // - // repeated string method_signature = 1051; - E_MethodSignature = &file_google_api_client_proto_extTypes[0] -) - -// Extension fields to descriptorpb.ServiceOptions. -var ( - // The hostname for this service. - // This should be specified with no prefix or protocol. - // - // Example: - // - // service Foo { - // option (google.api.default_host) = "foo.googleapi.com"; - // ... - // } - // - // optional string default_host = 1049; - E_DefaultHost = &file_google_api_client_proto_extTypes[1] - // OAuth scopes needed for the client. - // - // Example: - // - // service Foo { - // option (google.api.oauth_scopes) = \ - // "https://www.googleapis.com/auth/cloud-platform"; - // ... - // } - // - // If there is more than one scope, use a comma-separated string: - // - // Example: - // - // service Foo { - // option (google.api.oauth_scopes) = \ - // "https://www.googleapis.com/auth/cloud-platform," - // "https://www.googleapis.com/auth/monitoring"; - // ... - // } - // - // optional string oauth_scopes = 1050; - E_OauthScopes = &file_google_api_client_proto_extTypes[2] - // The API version of this service, which should be sent by version-aware - // clients to the service. This allows services to abide by the schema and - // behavior of the service at the time this API version was deployed. - // The format of the API version must be treated as opaque by clients. - // Services may use a format with an apparent structure, but clients must - // not rely on this to determine components within an API version, or attempt - // to construct other valid API versions. Note that this is for upcoming - // functionality and may not be implemented for all services. - // - // Example: - // - // service Foo { - // option (google.api.api_version) = "v1_20230821_preview"; - // } - // - // optional string api_version = 525000001; - E_ApiVersion = &file_google_api_client_proto_extTypes[3] -) - -var File_google_api_client_proto protoreflect.FileDescriptor - -var file_google_api_client_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x1d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x5f, 0x73, 0x74, 0x61, 0x67, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf8, 0x01, 0x0a, 0x16, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x12, 0x30, 0x0a, 0x12, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x64, - 0x6f, 0x63, 0x73, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, - 0x01, 0x52, 0x10, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x44, 0x6f, 0x63, 0x73, - 0x55, 0x72, 0x69, 0x12, 0x48, 0x0a, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x62, - 0x72, 0x61, 0x72, 0x79, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x0c, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x62, 0x0a, - 0x1a, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x67, 0x61, 0x70, 0x69, 0x63, - 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, - 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x47, 0x61, 0x70, 0x69, 0x63, 0x47, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x18, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x47, 0x61, 0x70, 0x69, 0x63, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x22, 0x93, 0x05, 0x0a, 0x15, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x62, 0x72, - 0x61, 0x72, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x0c, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x5f, - 0x73, 0x74, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x53, - 0x74, 0x61, 0x67, 0x65, 0x52, 0x0b, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x53, 0x74, 0x61, 0x67, - 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x72, 0x65, 0x73, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x69, - 0x63, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x72, - 0x65, 0x73, 0x74, 0x4e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x12, - 0x3d, 0x0a, 0x0d, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x4a, 0x61, 0x76, 0x61, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x52, 0x0c, 0x6a, 0x61, 0x76, 0x61, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3a, - 0x0a, 0x0c, 0x63, 0x70, 0x70, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x16, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x43, 0x70, 0x70, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0b, 0x63, - 0x70, 0x70, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x0c, 0x70, 0x68, - 0x70, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x68, - 0x70, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0b, 0x70, 0x68, 0x70, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x43, 0x0a, 0x0f, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, - 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x79, 0x74, - 0x68, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0e, 0x70, 0x79, 0x74, - 0x68, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3d, 0x0a, 0x0d, 0x6e, - 0x6f, 0x64, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x19, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0c, 0x6e, 0x6f, - 0x64, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x43, 0x0a, 0x0f, 0x64, 0x6f, - 0x74, 0x6e, 0x65, 0x74, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x1a, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x44, 0x6f, 0x74, 0x6e, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, - 0x0e, 0x64, 0x6f, 0x74, 0x6e, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, - 0x3d, 0x0a, 0x0d, 0x72, 0x75, 0x62, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x52, 0x75, 0x62, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x52, 0x0c, 0x72, 0x75, 0x62, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x37, - 0x0a, 0x0b, 0x67, 0x6f, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x1c, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x47, 0x6f, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0a, 0x67, 0x6f, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0xf4, 0x04, 0x0a, 0x0a, 0x50, 0x75, 0x62, 0x6c, - 0x69, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x12, 0x43, 0x0a, 0x0f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0e, 0x6d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x6e, - 0x65, 0x77, 0x5f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x65, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x49, 0x73, 0x73, 0x75, 0x65, 0x55, 0x72, 0x69, 0x12, - 0x2b, 0x0a, 0x11, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x75, 0x72, 0x69, 0x18, 0x66, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x64, 0x6f, 0x63, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x72, 0x69, 0x12, 0x24, 0x0a, 0x0e, - 0x61, 0x70, 0x69, 0x5f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x67, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x70, 0x69, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x5f, 0x6c, 0x61, 0x62, - 0x65, 0x6c, 0x18, 0x68, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x34, 0x0a, 0x16, 0x63, 0x6f, 0x64, 0x65, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x5f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x18, - 0x69, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x6f, 0x64, 0x65, 0x6f, 0x77, 0x6e, 0x65, 0x72, - 0x47, 0x69, 0x74, 0x68, 0x75, 0x62, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x64, - 0x6f, 0x63, 0x5f, 0x74, 0x61, 0x67, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x6a, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x6f, 0x63, 0x54, 0x61, 0x67, 0x50, 0x72, 0x65, 0x66, 0x69, - 0x78, 0x12, 0x49, 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x6b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, - 0x72, 0x79, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, - 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4c, 0x0a, 0x10, - 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x18, 0x6d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, - 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0f, 0x6c, 0x69, 0x62, 0x72, 0x61, - 0x72, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x49, 0x0a, 0x21, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x69, 0x18, - 0x6e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x55, 0x72, 0x69, 0x12, 0x47, 0x0a, 0x20, 0x72, 0x65, 0x73, 0x74, 0x5f, 0x72, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x6f, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x1d, 0x72, 0x65, 0x73, 0x74, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x44, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x72, 0x69, 0x22, 0x9a, - 0x02, 0x0a, 0x0c, 0x4a, 0x61, 0x76, 0x61, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, - 0x27, 0x0a, 0x0f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, - 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, - 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x5f, 0x0a, 0x13, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x4a, 0x61, 0x76, 0x61, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, - 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4c, 0x61, 0x6e, - 0x67, 0x75, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x06, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x1a, 0x44, 0x0a, 0x16, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x49, 0x0a, 0x0b, 0x43, - 0x70, 0x70, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4c, 0x61, - 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x06, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0x49, 0x0a, 0x0b, 0x50, 0x68, 0x70, 0x53, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, - 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x22, 0x87, 0x03, 0x0a, 0x0e, 0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, - 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x12, 0x64, 0x0a, 0x15, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, - 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x79, 0x74, - 0x68, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x45, 0x78, 0x70, 0x65, - 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, - 0x52, 0x14, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x46, 0x65, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x1a, 0xd2, 0x01, 0x0a, 0x14, 0x45, 0x78, 0x70, 0x65, 0x72, - 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, - 0x31, 0x0a, 0x15, 0x72, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x6f, - 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, - 0x72, 0x65, 0x73, 0x74, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x49, 0x6f, 0x45, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x12, 0x45, 0x0a, 0x1f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x70, - 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x69, 0x63, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x5f, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1c, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x69, 0x63, 0x54, 0x79, 0x70, - 0x65, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x40, 0x0a, 0x1c, 0x75, 0x6e, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, - 0x5f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x1a, 0x75, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x50, 0x61, 0x63, 0x6b, - 0x61, 0x67, 0x65, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x4a, 0x0a, 0x0c, 0x4e, - 0x6f, 0x64, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4c, - 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, - 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0xae, 0x04, 0x0a, 0x0e, 0x44, 0x6f, 0x74, 0x6e, - 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4c, 0x61, - 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x06, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x5a, 0x0a, 0x10, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, - 0x64, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x6f, - 0x74, 0x6e, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x52, 0x65, 0x6e, - 0x61, 0x6d, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x0f, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x12, 0x5d, 0x0a, 0x11, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x5f, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x6f, 0x74, 0x6e, 0x65, - 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, - 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x10, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x69, 0x67, - 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x38, - 0x0a, 0x18, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x16, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x16, 0x68, 0x61, 0x6e, 0x64, - 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x15, 0x68, 0x61, 0x6e, 0x64, 0x77, 0x72, - 0x69, 0x74, 0x74, 0x65, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x1a, - 0x42, 0x0a, 0x14, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x1a, 0x43, 0x0a, 0x15, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x4a, 0x0a, 0x0c, 0x52, 0x75, 0x62, 0x79, - 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4c, 0x61, 0x6e, 0x67, - 0x75, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x06, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0xe4, 0x01, 0x0a, 0x0a, 0x47, 0x6f, 0x53, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, - 0x56, 0x0a, 0x10, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x6f, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x2e, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x1a, 0x42, 0x0a, 0x14, 0x52, 0x65, 0x6e, 0x61, 0x6d, - 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc2, 0x03, 0x0a, 0x0e, - 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x1a, - 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x49, 0x0a, 0x0c, 0x6c, 0x6f, - 0x6e, 0x67, 0x5f, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x4c, 0x6f, 0x6e, - 0x67, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x6c, 0x6f, 0x6e, 0x67, 0x52, 0x75, - 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x32, 0x0a, 0x15, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x70, 0x6f, - 0x70, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x61, 0x75, 0x74, 0x6f, 0x50, 0x6f, 0x70, 0x75, 0x6c, 0x61, - 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x1a, 0x94, 0x02, 0x0a, 0x0b, 0x4c, 0x6f, - 0x6e, 0x67, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x47, 0x0a, 0x12, 0x69, 0x6e, 0x69, - 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x6c, 0x6c, 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x10, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x50, 0x6f, 0x6c, 0x6c, 0x44, 0x65, 0x6c, - 0x61, 0x79, 0x12, 0x32, 0x0a, 0x15, 0x70, 0x6f, 0x6c, 0x6c, 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, - 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x02, 0x52, 0x13, 0x70, 0x6f, 0x6c, 0x6c, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x75, 0x6c, 0x74, - 0x69, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x6f, - 0x6c, 0x6c, 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x50, 0x6f, - 0x6c, 0x6c, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x47, 0x0a, 0x12, 0x74, 0x6f, 0x74, 0x61, 0x6c, - 0x5f, 0x70, 0x6f, 0x6c, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x6f, 0x6c, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, - 0x22, 0x75, 0x0a, 0x18, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x47, 0x61, 0x70, - 0x69, 0x63, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, - 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x3f, 0x0a, 0x1c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x65, 0x5f, 0x6f, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x73, 0x5f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x19, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x4f, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x41, 0x73, 0x49, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2a, 0xa3, 0x01, 0x0a, 0x19, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x27, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, - 0x4c, 0x49, 0x42, 0x52, 0x41, 0x52, 0x59, 0x5f, 0x4f, 0x52, 0x47, 0x41, 0x4e, 0x49, 0x5a, 0x41, - 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x4c, 0x4f, 0x55, 0x44, 0x10, 0x01, 0x12, 0x07, 0x0a, - 0x03, 0x41, 0x44, 0x53, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x48, 0x4f, 0x54, 0x4f, 0x53, - 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x54, 0x52, 0x45, 0x45, 0x54, 0x5f, 0x56, 0x49, 0x45, - 0x57, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x48, 0x4f, 0x50, 0x50, 0x49, 0x4e, 0x47, 0x10, - 0x05, 0x12, 0x07, 0x0a, 0x03, 0x47, 0x45, 0x4f, 0x10, 0x06, 0x12, 0x11, 0x0a, 0x0d, 0x47, 0x45, - 0x4e, 0x45, 0x52, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5f, 0x41, 0x49, 0x10, 0x07, 0x2a, 0x67, 0x0a, - 0x18, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x44, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x26, 0x43, 0x4c, 0x49, - 0x45, 0x4e, 0x54, 0x5f, 0x4c, 0x49, 0x42, 0x52, 0x41, 0x52, 0x59, 0x5f, 0x44, 0x45, 0x53, 0x54, - 0x49, 0x4e, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x47, 0x49, 0x54, 0x48, 0x55, 0x42, 0x10, - 0x0a, 0x12, 0x13, 0x0a, 0x0f, 0x50, 0x41, 0x43, 0x4b, 0x41, 0x47, 0x45, 0x5f, 0x4d, 0x41, 0x4e, - 0x41, 0x47, 0x45, 0x52, 0x10, 0x14, 0x3a, 0x4a, 0x0a, 0x10, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9b, 0x08, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x0f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x3a, 0x43, 0x0a, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x68, 0x6f, - 0x73, 0x74, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x99, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x48, 0x6f, 0x73, 0x74, 0x3a, 0x43, 0x0a, 0x0c, 0x6f, 0x61, 0x75, 0x74, 0x68, - 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9a, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x3a, 0x44, 0x0a, 0x0b, - 0x61, 0x70, 0x69, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc1, 0xba, 0xab, - 0xfa, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x42, 0x69, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x61, 0x70, 0x69, 0x42, 0x0b, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, - 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, - 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_api_client_proto_rawDescOnce sync.Once - file_google_api_client_proto_rawDescData = file_google_api_client_proto_rawDesc -) - -func file_google_api_client_proto_rawDescGZIP() []byte { - file_google_api_client_proto_rawDescOnce.Do(func() { - file_google_api_client_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_client_proto_rawDescData) - }) - return file_google_api_client_proto_rawDescData -} - -var file_google_api_client_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_google_api_client_proto_msgTypes = make([]protoimpl.MessageInfo, 19) -var file_google_api_client_proto_goTypes = []interface{}{ - (ClientLibraryOrganization)(0), // 0: google.api.ClientLibraryOrganization - (ClientLibraryDestination)(0), // 1: google.api.ClientLibraryDestination - (*CommonLanguageSettings)(nil), // 2: google.api.CommonLanguageSettings - (*ClientLibrarySettings)(nil), // 3: google.api.ClientLibrarySettings - (*Publishing)(nil), // 4: google.api.Publishing - (*JavaSettings)(nil), // 5: google.api.JavaSettings - (*CppSettings)(nil), // 6: google.api.CppSettings - (*PhpSettings)(nil), // 7: google.api.PhpSettings - (*PythonSettings)(nil), // 8: google.api.PythonSettings - (*NodeSettings)(nil), // 9: google.api.NodeSettings - (*DotnetSettings)(nil), // 10: google.api.DotnetSettings - (*RubySettings)(nil), // 11: google.api.RubySettings - (*GoSettings)(nil), // 12: google.api.GoSettings - (*MethodSettings)(nil), // 13: google.api.MethodSettings - (*SelectiveGapicGeneration)(nil), // 14: google.api.SelectiveGapicGeneration - nil, // 15: google.api.JavaSettings.ServiceClassNamesEntry - (*PythonSettings_ExperimentalFeatures)(nil), // 16: google.api.PythonSettings.ExperimentalFeatures - nil, // 17: google.api.DotnetSettings.RenamedServicesEntry - nil, // 18: google.api.DotnetSettings.RenamedResourcesEntry - nil, // 19: google.api.GoSettings.RenamedServicesEntry - (*MethodSettings_LongRunning)(nil), // 20: google.api.MethodSettings.LongRunning - (api.LaunchStage)(0), // 21: google.api.LaunchStage - (*durationpb.Duration)(nil), // 22: google.protobuf.Duration - (*descriptorpb.MethodOptions)(nil), // 23: google.protobuf.MethodOptions - (*descriptorpb.ServiceOptions)(nil), // 24: google.protobuf.ServiceOptions -} -var file_google_api_client_proto_depIdxs = []int32{ - 1, // 0: google.api.CommonLanguageSettings.destinations:type_name -> google.api.ClientLibraryDestination - 14, // 1: google.api.CommonLanguageSettings.selective_gapic_generation:type_name -> google.api.SelectiveGapicGeneration - 21, // 2: google.api.ClientLibrarySettings.launch_stage:type_name -> google.api.LaunchStage - 5, // 3: google.api.ClientLibrarySettings.java_settings:type_name -> google.api.JavaSettings - 6, // 4: google.api.ClientLibrarySettings.cpp_settings:type_name -> google.api.CppSettings - 7, // 5: google.api.ClientLibrarySettings.php_settings:type_name -> google.api.PhpSettings - 8, // 6: google.api.ClientLibrarySettings.python_settings:type_name -> google.api.PythonSettings - 9, // 7: google.api.ClientLibrarySettings.node_settings:type_name -> google.api.NodeSettings - 10, // 8: google.api.ClientLibrarySettings.dotnet_settings:type_name -> google.api.DotnetSettings - 11, // 9: google.api.ClientLibrarySettings.ruby_settings:type_name -> google.api.RubySettings - 12, // 10: google.api.ClientLibrarySettings.go_settings:type_name -> google.api.GoSettings - 13, // 11: google.api.Publishing.method_settings:type_name -> google.api.MethodSettings - 0, // 12: google.api.Publishing.organization:type_name -> google.api.ClientLibraryOrganization - 3, // 13: google.api.Publishing.library_settings:type_name -> google.api.ClientLibrarySettings - 15, // 14: google.api.JavaSettings.service_class_names:type_name -> google.api.JavaSettings.ServiceClassNamesEntry - 2, // 15: google.api.JavaSettings.common:type_name -> google.api.CommonLanguageSettings - 2, // 16: google.api.CppSettings.common:type_name -> google.api.CommonLanguageSettings - 2, // 17: google.api.PhpSettings.common:type_name -> google.api.CommonLanguageSettings - 2, // 18: google.api.PythonSettings.common:type_name -> google.api.CommonLanguageSettings - 16, // 19: google.api.PythonSettings.experimental_features:type_name -> google.api.PythonSettings.ExperimentalFeatures - 2, // 20: google.api.NodeSettings.common:type_name -> google.api.CommonLanguageSettings - 2, // 21: google.api.DotnetSettings.common:type_name -> google.api.CommonLanguageSettings - 17, // 22: google.api.DotnetSettings.renamed_services:type_name -> google.api.DotnetSettings.RenamedServicesEntry - 18, // 23: google.api.DotnetSettings.renamed_resources:type_name -> google.api.DotnetSettings.RenamedResourcesEntry - 2, // 24: google.api.RubySettings.common:type_name -> google.api.CommonLanguageSettings - 2, // 25: google.api.GoSettings.common:type_name -> google.api.CommonLanguageSettings - 19, // 26: google.api.GoSettings.renamed_services:type_name -> google.api.GoSettings.RenamedServicesEntry - 20, // 27: google.api.MethodSettings.long_running:type_name -> google.api.MethodSettings.LongRunning - 22, // 28: google.api.MethodSettings.LongRunning.initial_poll_delay:type_name -> google.protobuf.Duration - 22, // 29: google.api.MethodSettings.LongRunning.max_poll_delay:type_name -> google.protobuf.Duration - 22, // 30: google.api.MethodSettings.LongRunning.total_poll_timeout:type_name -> google.protobuf.Duration - 23, // 31: google.api.method_signature:extendee -> google.protobuf.MethodOptions - 24, // 32: google.api.default_host:extendee -> google.protobuf.ServiceOptions - 24, // 33: google.api.oauth_scopes:extendee -> google.protobuf.ServiceOptions - 24, // 34: google.api.api_version:extendee -> google.protobuf.ServiceOptions - 35, // [35:35] is the sub-list for method output_type - 35, // [35:35] is the sub-list for method input_type - 35, // [35:35] is the sub-list for extension type_name - 31, // [31:35] is the sub-list for extension extendee - 0, // [0:31] is the sub-list for field type_name -} - -func init() { file_google_api_client_proto_init() } -func file_google_api_client_proto_init() { - if File_google_api_client_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_google_api_client_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommonLanguageSettings); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_client_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientLibrarySettings); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_client_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Publishing); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_client_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JavaSettings); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_client_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CppSettings); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_client_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PhpSettings); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_client_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PythonSettings); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_client_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NodeSettings); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_client_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DotnetSettings); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_client_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RubySettings); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_client_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GoSettings); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_client_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MethodSettings); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_client_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SelectiveGapicGeneration); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_client_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PythonSettings_ExperimentalFeatures); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_client_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MethodSettings_LongRunning); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_api_client_proto_rawDesc, - NumEnums: 2, - NumMessages: 19, - NumExtensions: 4, - NumServices: 0, - }, - GoTypes: file_google_api_client_proto_goTypes, - DependencyIndexes: file_google_api_client_proto_depIdxs, - EnumInfos: file_google_api_client_proto_enumTypes, - MessageInfos: file_google_api_client_proto_msgTypes, - ExtensionInfos: file_google_api_client_proto_extTypes, - }.Build() - File_google_api_client_proto = out.File - file_google_api_client_proto_rawDesc = nil - file_google_api_client_proto_goTypes = nil - file_google_api_client_proto_depIdxs = nil -} diff --git a/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go b/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go deleted file mode 100644 index 08505ba3f..000000000 --- a/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go +++ /dev/null @@ -1,266 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v4.24.4 -// source: google/api/field_behavior.proto - -package annotations - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// An indicator of the behavior of a given field (for example, that a field -// is required in requests, or given as output but ignored as input). -// This **does not** change the behavior in protocol buffers itself; it only -// denotes the behavior and may affect how API tooling handles the field. -// -// Note: This enum **may** receive new values in the future. -type FieldBehavior int32 - -const ( - // Conventional default for enums. Do not use this. - FieldBehavior_FIELD_BEHAVIOR_UNSPECIFIED FieldBehavior = 0 - // Specifically denotes a field as optional. - // While all fields in protocol buffers are optional, this may be specified - // for emphasis if appropriate. - FieldBehavior_OPTIONAL FieldBehavior = 1 - // Denotes a field as required. - // This indicates that the field **must** be provided as part of the request, - // and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - FieldBehavior_REQUIRED FieldBehavior = 2 - // Denotes a field as output only. - // This indicates that the field is provided in responses, but including the - // field in a request does nothing (the server *must* ignore it and - // *must not* throw an error as a result of the field's presence). - FieldBehavior_OUTPUT_ONLY FieldBehavior = 3 - // Denotes a field as input only. - // This indicates that the field is provided in requests, and the - // corresponding field is not included in output. - FieldBehavior_INPUT_ONLY FieldBehavior = 4 - // Denotes a field as immutable. - // This indicates that the field may be set once in a request to create a - // resource, but may not be changed thereafter. - FieldBehavior_IMMUTABLE FieldBehavior = 5 - // Denotes that a (repeated) field is an unordered list. - // This indicates that the service may provide the elements of the list - // in any arbitrary order, rather than the order the user originally - // provided. Additionally, the list's order may or may not be stable. - FieldBehavior_UNORDERED_LIST FieldBehavior = 6 - // Denotes that this field returns a non-empty default value if not set. - // This indicates that if the user provides the empty value in a request, - // a non-empty value will be returned. The user will not be aware of what - // non-empty value to expect. - FieldBehavior_NON_EMPTY_DEFAULT FieldBehavior = 7 - // Denotes that the field in a resource (a message annotated with - // google.api.resource) is used in the resource name to uniquely identify the - // resource. For AIP-compliant APIs, this should only be applied to the - // `name` field on the resource. - // - // This behavior should not be applied to references to other resources within - // the message. - // - // The identifier field of resources often have different field behavior - // depending on the request it is embedded in (e.g. for Create methods name - // is optional and unused, while for Update methods it is required). Instead - // of method-specific annotations, only `IDENTIFIER` is required. - FieldBehavior_IDENTIFIER FieldBehavior = 8 -) - -// Enum value maps for FieldBehavior. -var ( - FieldBehavior_name = map[int32]string{ - 0: "FIELD_BEHAVIOR_UNSPECIFIED", - 1: "OPTIONAL", - 2: "REQUIRED", - 3: "OUTPUT_ONLY", - 4: "INPUT_ONLY", - 5: "IMMUTABLE", - 6: "UNORDERED_LIST", - 7: "NON_EMPTY_DEFAULT", - 8: "IDENTIFIER", - } - FieldBehavior_value = map[string]int32{ - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5, - "UNORDERED_LIST": 6, - "NON_EMPTY_DEFAULT": 7, - "IDENTIFIER": 8, - } -) - -func (x FieldBehavior) Enum() *FieldBehavior { - p := new(FieldBehavior) - *p = x - return p -} - -func (x FieldBehavior) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (FieldBehavior) Descriptor() protoreflect.EnumDescriptor { - return file_google_api_field_behavior_proto_enumTypes[0].Descriptor() -} - -func (FieldBehavior) Type() protoreflect.EnumType { - return &file_google_api_field_behavior_proto_enumTypes[0] -} - -func (x FieldBehavior) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use FieldBehavior.Descriptor instead. -func (FieldBehavior) EnumDescriptor() ([]byte, []int) { - return file_google_api_field_behavior_proto_rawDescGZIP(), []int{0} -} - -var file_google_api_field_behavior_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: ([]FieldBehavior)(nil), - Field: 1052, - Name: "google.api.field_behavior", - Tag: "varint,1052,rep,name=field_behavior,enum=google.api.FieldBehavior", - Filename: "google/api/field_behavior.proto", - }, -} - -// Extension fields to descriptorpb.FieldOptions. -var ( - // A designation of a specific field behavior (required, output only, etc.) - // in protobuf messages. - // - // Examples: - // - // string name = 1 [(google.api.field_behavior) = REQUIRED]; - // State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - // google.protobuf.Duration ttl = 1 - // [(google.api.field_behavior) = INPUT_ONLY]; - // google.protobuf.Timestamp expire_time = 1 - // [(google.api.field_behavior) = OUTPUT_ONLY, - // (google.api.field_behavior) = IMMUTABLE]; - // - // repeated google.api.FieldBehavior field_behavior = 1052; - E_FieldBehavior = &file_google_api_field_behavior_proto_extTypes[0] -) - -var File_google_api_field_behavior_proto protoreflect.FileDescriptor - -var file_google_api_field_behavior_proto_rawDesc = []byte{ - 0x0a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x20, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2a, - 0xb6, 0x01, 0x0a, 0x0d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, - 0x72, 0x12, 0x1e, 0x0a, 0x1a, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x42, 0x45, 0x48, 0x41, 0x56, - 0x49, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x10, 0x01, 0x12, - 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0f, 0x0a, - 0x0b, 0x4f, 0x55, 0x54, 0x50, 0x55, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x03, 0x12, 0x0e, - 0x0a, 0x0a, 0x49, 0x4e, 0x50, 0x55, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x04, 0x12, 0x0d, - 0x0a, 0x09, 0x49, 0x4d, 0x4d, 0x55, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x05, 0x12, 0x12, 0x0a, - 0x0e, 0x55, 0x4e, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x45, 0x44, 0x5f, 0x4c, 0x49, 0x53, 0x54, 0x10, - 0x06, 0x12, 0x15, 0x0a, 0x11, 0x4e, 0x4f, 0x4e, 0x5f, 0x45, 0x4d, 0x50, 0x54, 0x59, 0x5f, 0x44, - 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x07, 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x44, 0x45, 0x4e, - 0x54, 0x49, 0x46, 0x49, 0x45, 0x52, 0x10, 0x08, 0x3a, 0x64, 0x0a, 0x0e, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9c, 0x08, 0x20, 0x03, 0x28, 0x0e, - 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x42, 0x02, 0x10, 0x00, 0x52, - 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x42, 0x70, - 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, - 0x42, 0x12, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, - 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_api_field_behavior_proto_rawDescOnce sync.Once - file_google_api_field_behavior_proto_rawDescData = file_google_api_field_behavior_proto_rawDesc -) - -func file_google_api_field_behavior_proto_rawDescGZIP() []byte { - file_google_api_field_behavior_proto_rawDescOnce.Do(func() { - file_google_api_field_behavior_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_field_behavior_proto_rawDescData) - }) - return file_google_api_field_behavior_proto_rawDescData -} - -var file_google_api_field_behavior_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_google_api_field_behavior_proto_goTypes = []interface{}{ - (FieldBehavior)(0), // 0: google.api.FieldBehavior - (*descriptorpb.FieldOptions)(nil), // 1: google.protobuf.FieldOptions -} -var file_google_api_field_behavior_proto_depIdxs = []int32{ - 1, // 0: google.api.field_behavior:extendee -> google.protobuf.FieldOptions - 0, // 1: google.api.field_behavior:type_name -> google.api.FieldBehavior - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 1, // [1:2] is the sub-list for extension type_name - 0, // [0:1] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_google_api_field_behavior_proto_init() } -func file_google_api_field_behavior_proto_init() { - if File_google_api_field_behavior_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_api_field_behavior_proto_rawDesc, - NumEnums: 1, - NumMessages: 0, - NumExtensions: 1, - NumServices: 0, - }, - GoTypes: file_google_api_field_behavior_proto_goTypes, - DependencyIndexes: file_google_api_field_behavior_proto_depIdxs, - EnumInfos: file_google_api_field_behavior_proto_enumTypes, - ExtensionInfos: file_google_api_field_behavior_proto_extTypes, - }.Build() - File_google_api_field_behavior_proto = out.File - file_google_api_field_behavior_proto_rawDesc = nil - file_google_api_field_behavior_proto_goTypes = nil - file_google_api_field_behavior_proto_depIdxs = nil -} diff --git a/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/field_info.pb.go b/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/field_info.pb.go deleted file mode 100644 index a462e7d01..000000000 --- a/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/field_info.pb.go +++ /dev/null @@ -1,392 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v4.24.4 -// source: google/api/field_info.proto - -package annotations - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// The standard format of a field value. The supported formats are all backed -// by either an RFC defined by the IETF or a Google-defined AIP. -type FieldInfo_Format int32 - -const ( - // Default, unspecified value. - FieldInfo_FORMAT_UNSPECIFIED FieldInfo_Format = 0 - // Universally Unique Identifier, version 4, value as defined by - // https://datatracker.ietf.org/doc/html/rfc4122. The value may be - // normalized to entirely lowercase letters. For example, the value - // `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to - // `f47ac10b-58cc-0372-8567-0e02b2c3d479`. - FieldInfo_UUID4 FieldInfo_Format = 1 - // Internet Protocol v4 value as defined by [RFC - // 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be - // condensed, with leading zeros in each octet stripped. For example, - // `001.022.233.040` would be condensed to `1.22.233.40`. - FieldInfo_IPV4 FieldInfo_Format = 2 - // Internet Protocol v6 value as defined by [RFC - // 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be - // normalized to entirely lowercase letters with zeros compressed, following - // [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, - // the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. - FieldInfo_IPV6 FieldInfo_Format = 3 - // An IP address in either v4 or v6 format as described by the individual - // values defined herein. See the comments on the IPV4 and IPV6 types for - // allowed normalizations of each. - FieldInfo_IPV4_OR_IPV6 FieldInfo_Format = 4 -) - -// Enum value maps for FieldInfo_Format. -var ( - FieldInfo_Format_name = map[int32]string{ - 0: "FORMAT_UNSPECIFIED", - 1: "UUID4", - 2: "IPV4", - 3: "IPV6", - 4: "IPV4_OR_IPV6", - } - FieldInfo_Format_value = map[string]int32{ - "FORMAT_UNSPECIFIED": 0, - "UUID4": 1, - "IPV4": 2, - "IPV6": 3, - "IPV4_OR_IPV6": 4, - } -) - -func (x FieldInfo_Format) Enum() *FieldInfo_Format { - p := new(FieldInfo_Format) - *p = x - return p -} - -func (x FieldInfo_Format) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (FieldInfo_Format) Descriptor() protoreflect.EnumDescriptor { - return file_google_api_field_info_proto_enumTypes[0].Descriptor() -} - -func (FieldInfo_Format) Type() protoreflect.EnumType { - return &file_google_api_field_info_proto_enumTypes[0] -} - -func (x FieldInfo_Format) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use FieldInfo_Format.Descriptor instead. -func (FieldInfo_Format) EnumDescriptor() ([]byte, []int) { - return file_google_api_field_info_proto_rawDescGZIP(), []int{0, 0} -} - -// Rich semantic information of an API field beyond basic typing. -type FieldInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The standard format of a field value. This does not explicitly configure - // any API consumer, just documents the API's format for the field it is - // applied to. - Format FieldInfo_Format `protobuf:"varint,1,opt,name=format,proto3,enum=google.api.FieldInfo_Format" json:"format,omitempty"` - // The type(s) that the annotated, generic field may represent. - // - // Currently, this must only be used on fields of type `google.protobuf.Any`. - // Supporting other generic types may be considered in the future. - ReferencedTypes []*TypeReference `protobuf:"bytes,2,rep,name=referenced_types,json=referencedTypes,proto3" json:"referenced_types,omitempty"` -} - -func (x *FieldInfo) Reset() { - *x = FieldInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_field_info_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FieldInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FieldInfo) ProtoMessage() {} - -func (x *FieldInfo) ProtoReflect() protoreflect.Message { - mi := &file_google_api_field_info_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FieldInfo.ProtoReflect.Descriptor instead. -func (*FieldInfo) Descriptor() ([]byte, []int) { - return file_google_api_field_info_proto_rawDescGZIP(), []int{0} -} - -func (x *FieldInfo) GetFormat() FieldInfo_Format { - if x != nil { - return x.Format - } - return FieldInfo_FORMAT_UNSPECIFIED -} - -func (x *FieldInfo) GetReferencedTypes() []*TypeReference { - if x != nil { - return x.ReferencedTypes - } - return nil -} - -// A reference to a message type, for use in [FieldInfo][google.api.FieldInfo]. -type TypeReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The name of the type that the annotated, generic field may represent. - // If the type is in the same protobuf package, the value can be the simple - // message name e.g., `"MyMessage"`. Otherwise, the value must be the - // fully-qualified message name e.g., `"google.library.v1.Book"`. - // - // If the type(s) are unknown to the service (e.g. the field accepts generic - // user input), use the wildcard `"*"` to denote this behavior. - // - // See [AIP-202](https://google.aip.dev/202#type-references) for more details. - TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` -} - -func (x *TypeReference) Reset() { - *x = TypeReference{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_field_info_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TypeReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TypeReference) ProtoMessage() {} - -func (x *TypeReference) ProtoReflect() protoreflect.Message { - mi := &file_google_api_field_info_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TypeReference.ProtoReflect.Descriptor instead. -func (*TypeReference) Descriptor() ([]byte, []int) { - return file_google_api_field_info_proto_rawDescGZIP(), []int{1} -} - -func (x *TypeReference) GetTypeName() string { - if x != nil { - return x.TypeName - } - return "" -} - -var file_google_api_field_info_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*FieldInfo)(nil), - Field: 291403980, - Name: "google.api.field_info", - Tag: "bytes,291403980,opt,name=field_info", - Filename: "google/api/field_info.proto", - }, -} - -// Extension fields to descriptorpb.FieldOptions. -var ( - // Rich semantic descriptor of an API field beyond the basic typing. - // - // Examples: - // - // string request_id = 1 [(google.api.field_info).format = UUID4]; - // string old_ip_address = 2 [(google.api.field_info).format = IPV4]; - // string new_ip_address = 3 [(google.api.field_info).format = IPV6]; - // string actual_ip_address = 4 [ - // (google.api.field_info).format = IPV4_OR_IPV6 - // ]; - // google.protobuf.Any generic_field = 5 [ - // (google.api.field_info).referenced_types = {type_name: "ActualType"}, - // (google.api.field_info).referenced_types = {type_name: "OtherType"}, - // ]; - // google.protobuf.Any generic_user_input = 5 [ - // (google.api.field_info).referenced_types = {type_name: "*"}, - // ]; - // - // optional google.api.FieldInfo field_info = 291403980; - E_FieldInfo = &file_google_api_field_info_proto_extTypes[0] -) - -var File_google_api_field_info_proto protoreflect.FileDescriptor - -var file_google_api_field_info_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xda, 0x01, 0x0a, 0x09, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x34, 0x0a, 0x06, 0x66, 0x6f, 0x72, - 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, - 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, - 0x44, 0x0a, 0x10, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x64, - 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x51, 0x0a, 0x06, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, - 0x16, 0x0a, 0x12, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x55, 0x49, 0x44, 0x34, - 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x50, 0x56, 0x34, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, - 0x49, 0x50, 0x56, 0x36, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x49, 0x50, 0x56, 0x34, 0x5f, 0x4f, - 0x52, 0x5f, 0x49, 0x50, 0x56, 0x36, 0x10, 0x04, 0x22, 0x2c, 0x0a, 0x0d, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x79, 0x70, - 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x79, - 0x70, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x3a, 0x57, 0x0a, 0x0a, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, - 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0xcc, 0xf1, 0xf9, 0x8a, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x42, - 0x6c, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, - 0x69, 0x42, 0x0e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, - 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, - 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_api_field_info_proto_rawDescOnce sync.Once - file_google_api_field_info_proto_rawDescData = file_google_api_field_info_proto_rawDesc -) - -func file_google_api_field_info_proto_rawDescGZIP() []byte { - file_google_api_field_info_proto_rawDescOnce.Do(func() { - file_google_api_field_info_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_field_info_proto_rawDescData) - }) - return file_google_api_field_info_proto_rawDescData -} - -var file_google_api_field_info_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_google_api_field_info_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_google_api_field_info_proto_goTypes = []interface{}{ - (FieldInfo_Format)(0), // 0: google.api.FieldInfo.Format - (*FieldInfo)(nil), // 1: google.api.FieldInfo - (*TypeReference)(nil), // 2: google.api.TypeReference - (*descriptorpb.FieldOptions)(nil), // 3: google.protobuf.FieldOptions -} -var file_google_api_field_info_proto_depIdxs = []int32{ - 0, // 0: google.api.FieldInfo.format:type_name -> google.api.FieldInfo.Format - 2, // 1: google.api.FieldInfo.referenced_types:type_name -> google.api.TypeReference - 3, // 2: google.api.field_info:extendee -> google.protobuf.FieldOptions - 1, // 3: google.api.field_info:type_name -> google.api.FieldInfo - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 3, // [3:4] is the sub-list for extension type_name - 2, // [2:3] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_google_api_field_info_proto_init() } -func file_google_api_field_info_proto_init() { - if File_google_api_field_info_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_google_api_field_info_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FieldInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_field_info_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TypeReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_api_field_info_proto_rawDesc, - NumEnums: 1, - NumMessages: 2, - NumExtensions: 1, - NumServices: 0, - }, - GoTypes: file_google_api_field_info_proto_goTypes, - DependencyIndexes: file_google_api_field_info_proto_depIdxs, - EnumInfos: file_google_api_field_info_proto_enumTypes, - MessageInfos: file_google_api_field_info_proto_msgTypes, - ExtensionInfos: file_google_api_field_info_proto_extTypes, - }.Build() - File_google_api_field_info_proto = out.File - file_google_api_field_info_proto_rawDesc = nil - file_google_api_field_info_proto_goTypes = nil - file_google_api_field_info_proto_depIdxs = nil -} diff --git a/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go b/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go deleted file mode 100644 index c93b4f524..000000000 --- a/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go +++ /dev/null @@ -1,774 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v4.24.4 -// source: google/api/http.proto - -package annotations - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Defines the HTTP configuration for an API service. It contains a list of -// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method -// to one or more HTTP REST API methods. -type Http struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // A list of HTTP configuration rules that apply to individual API methods. - // - // **NOTE:** All service configuration rules follow "last one wins" order. - Rules []*HttpRule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"` - // When set to true, URL path parameters will be fully URI-decoded except in - // cases of single segment matches in reserved expansion, where "%2F" will be - // left encoded. - // - // The default behavior is to not decode RFC 6570 reserved characters in multi - // segment matches. - FullyDecodeReservedExpansion bool `protobuf:"varint,2,opt,name=fully_decode_reserved_expansion,json=fullyDecodeReservedExpansion,proto3" json:"fully_decode_reserved_expansion,omitempty"` -} - -func (x *Http) Reset() { - *x = Http{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_http_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Http) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Http) ProtoMessage() {} - -func (x *Http) ProtoReflect() protoreflect.Message { - mi := &file_google_api_http_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Http.ProtoReflect.Descriptor instead. -func (*Http) Descriptor() ([]byte, []int) { - return file_google_api_http_proto_rawDescGZIP(), []int{0} -} - -func (x *Http) GetRules() []*HttpRule { - if x != nil { - return x.Rules - } - return nil -} - -func (x *Http) GetFullyDecodeReservedExpansion() bool { - if x != nil { - return x.FullyDecodeReservedExpansion - } - return false -} - -// gRPC Transcoding -// -// gRPC Transcoding is a feature for mapping between a gRPC method and one or -// more HTTP REST endpoints. It allows developers to build a single API service -// that supports both gRPC APIs and REST APIs. Many systems, including [Google -// APIs](https://github.com/googleapis/googleapis), -// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC -// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), -// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature -// and use it for large scale production services. -// -// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies -// how different portions of the gRPC request message are mapped to the URL -// path, URL query parameters, and HTTP request body. It also controls how the -// gRPC response message is mapped to the HTTP response body. `HttpRule` is -// typically specified as an `google.api.http` annotation on the gRPC method. -// -// Each mapping specifies a URL path template and an HTTP method. The path -// template may refer to one or more fields in the gRPC request message, as long -// as each field is a non-repeated field with a primitive (non-message) type. -// The path template controls how fields of the request message are mapped to -// the URL path. -// -// Example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get: "/v1/{name=messages/*}" -// }; -// } -// } -// message GetMessageRequest { -// string name = 1; // Mapped to URL path. -// } -// message Message { -// string text = 1; // The resource content. -// } -// -// This enables an HTTP REST to gRPC mapping as below: -// -// - HTTP: `GET /v1/messages/123456` -// - gRPC: `GetMessage(name: "messages/123456")` -// -// Any fields in the request message which are not bound by the path template -// automatically become HTTP query parameters if there is no HTTP request body. -// For example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get:"/v1/messages/{message_id}" -// }; -// } -// } -// message GetMessageRequest { -// message SubMessage { -// string subfield = 1; -// } -// string message_id = 1; // Mapped to URL path. -// int64 revision = 2; // Mapped to URL query parameter `revision`. -// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. -// } -// -// This enables a HTTP JSON to RPC mapping as below: -// -// - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo` -// - gRPC: `GetMessage(message_id: "123456" revision: 2 sub: -// SubMessage(subfield: "foo"))` -// -// Note that fields which are mapped to URL query parameters must have a -// primitive type or a repeated primitive type or a non-repeated message type. -// In the case of a repeated type, the parameter can be repeated in the URL -// as `...?param=A¶m=B`. In the case of a message type, each field of the -// message is mapped to a separate parameter, such as -// `...?foo.a=A&foo.b=B&foo.c=C`. -// -// For HTTP methods that allow a request body, the `body` field -// specifies the mapping. Consider a REST update method on the -// message resource collection: -// -// service Messaging { -// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { -// option (google.api.http) = { -// patch: "/v1/messages/{message_id}" -// body: "message" -// }; -// } -// } -// message UpdateMessageRequest { -// string message_id = 1; // mapped to the URL -// Message message = 2; // mapped to the body -// } -// -// The following HTTP JSON to RPC mapping is enabled, where the -// representation of the JSON in the request body is determined by -// protos JSON encoding: -// -// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` -// - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })` -// -// The special name `*` can be used in the body mapping to define that -// every field not bound by the path template should be mapped to the -// request body. This enables the following alternative definition of -// the update method: -// -// service Messaging { -// rpc UpdateMessage(Message) returns (Message) { -// option (google.api.http) = { -// patch: "/v1/messages/{message_id}" -// body: "*" -// }; -// } -// } -// message Message { -// string message_id = 1; -// string text = 2; -// } -// -// The following HTTP JSON to RPC mapping is enabled: -// -// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` -// - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")` -// -// Note that when using `*` in the body mapping, it is not possible to -// have HTTP parameters, as all fields not bound by the path end in -// the body. This makes this option more rarely used in practice when -// defining REST APIs. The common usage of `*` is in custom methods -// which don't use the URL at all for transferring data. -// -// It is possible to define multiple HTTP methods for one RPC by using -// the `additional_bindings` option. Example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get: "/v1/messages/{message_id}" -// additional_bindings { -// get: "/v1/users/{user_id}/messages/{message_id}" -// } -// }; -// } -// } -// message GetMessageRequest { -// string message_id = 1; -// string user_id = 2; -// } -// -// This enables the following two alternative HTTP JSON to RPC mappings: -// -// - HTTP: `GET /v1/messages/123456` -// - gRPC: `GetMessage(message_id: "123456")` -// -// - HTTP: `GET /v1/users/me/messages/123456` -// - gRPC: `GetMessage(user_id: "me" message_id: "123456")` -// -// # Rules for HTTP mapping -// -// 1. Leaf request fields (recursive expansion nested messages in the request -// message) are classified into three categories: -// - Fields referred by the path template. They are passed via the URL path. -// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They -// are passed via the HTTP -// request body. -// - All other fields are passed via the URL query parameters, and the -// parameter name is the field path in the request message. A repeated -// field can be represented as multiple query parameters under the same -// name. -// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL -// query parameter, all fields -// are passed via URL path and HTTP request body. -// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP -// request body, all -// fields are passed via URL path and URL query parameters. -// -// Path template syntax -// -// Template = "/" Segments [ Verb ] ; -// Segments = Segment { "/" Segment } ; -// Segment = "*" | "**" | LITERAL | Variable ; -// Variable = "{" FieldPath [ "=" Segments ] "}" ; -// FieldPath = IDENT { "." IDENT } ; -// Verb = ":" LITERAL ; -// -// The syntax `*` matches a single URL path segment. The syntax `**` matches -// zero or more URL path segments, which must be the last part of the URL path -// except the `Verb`. -// -// The syntax `Variable` matches part of the URL path as specified by its -// template. A variable template must not contain other variables. If a variable -// matches a single path segment, its template may be omitted, e.g. `{var}` -// is equivalent to `{var=*}`. -// -// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` -// contains any reserved character, such characters should be percent-encoded -// before the matching. -// -// If a variable contains exactly one path segment, such as `"{var}"` or -// `"{var=*}"`, when such a variable is expanded into a URL path on the client -// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The -// server side does the reverse decoding. Such variables show up in the -// [Discovery -// Document](https://developers.google.com/discovery/v1/reference/apis) as -// `{var}`. -// -// If a variable contains multiple path segments, such as `"{var=foo/*}"` -// or `"{var=**}"`, when such a variable is expanded into a URL path on the -// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. -// The server side does the reverse decoding, except "%2F" and "%2f" are left -// unchanged. Such variables show up in the -// [Discovery -// Document](https://developers.google.com/discovery/v1/reference/apis) as -// `{+var}`. -// -// # Using gRPC API Service Configuration -// -// gRPC API Service Configuration (service config) is a configuration language -// for configuring a gRPC service to become a user-facing product. The -// service config is simply the YAML representation of the `google.api.Service` -// proto message. -// -// As an alternative to annotating your proto file, you can configure gRPC -// transcoding in your service config YAML files. You do this by specifying a -// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same -// effect as the proto annotation. This can be particularly useful if you -// have a proto that is reused in multiple services. Note that any transcoding -// specified in the service config will override any matching transcoding -// configuration in the proto. -// -// The following example selects a gRPC method and applies an `HttpRule` to it: -// -// http: -// rules: -// - selector: example.v1.Messaging.GetMessage -// get: /v1/messages/{message_id}/{sub.subfield} -// -// # Special notes -// -// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the -// proto to JSON conversion must follow the [proto3 -// specification](https://developers.google.com/protocol-buffers/docs/proto3#json). -// -// While the single segment variable follows the semantics of -// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String -// Expansion, the multi segment variable **does not** follow RFC 6570 Section -// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion -// does not expand special characters like `?` and `#`, which would lead -// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding -// for multi segment variables. -// -// The path variables **must not** refer to any repeated or mapped field, -// because client libraries are not capable of handling such variable expansion. -// -// The path variables **must not** capture the leading "/" character. The reason -// is that the most common use case "{var}" does not capture the leading "/" -// character. For consistency, all path variables must share the same behavior. -// -// Repeated message fields must not be mapped to URL query parameters, because -// no client library can support such complicated mapping. -// -// If an API needs to use a JSON array for request or response body, it can map -// the request or response body to a repeated field. However, some gRPC -// Transcoding implementations may not support this feature. -type HttpRule struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Selects a method to which this rule applies. - // - // Refer to [selector][google.api.DocumentationRule.selector] for syntax - // details. - Selector string `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"` - // Determines the URL pattern is matched by this rules. This pattern can be - // used with any of the {get|put|post|delete|patch} methods. A custom method - // can be defined using the 'custom' field. - // - // Types that are assignable to Pattern: - // - // *HttpRule_Get - // *HttpRule_Put - // *HttpRule_Post - // *HttpRule_Delete - // *HttpRule_Patch - // *HttpRule_Custom - Pattern isHttpRule_Pattern `protobuf_oneof:"pattern"` - // The name of the request field whose value is mapped to the HTTP request - // body, or `*` for mapping all request fields not captured by the path - // pattern to the HTTP body, or omitted for not having any HTTP request body. - // - // NOTE: the referred field must be present at the top-level of the request - // message type. - Body string `protobuf:"bytes,7,opt,name=body,proto3" json:"body,omitempty"` - // Optional. The name of the response field whose value is mapped to the HTTP - // response body. When omitted, the entire response message will be used - // as the HTTP response body. - // - // NOTE: The referred field must be present at the top-level of the response - // message type. - ResponseBody string `protobuf:"bytes,12,opt,name=response_body,json=responseBody,proto3" json:"response_body,omitempty"` - // Additional HTTP bindings for the selector. Nested bindings must - // not contain an `additional_bindings` field themselves (that is, - // the nesting may only be one level deep). - AdditionalBindings []*HttpRule `protobuf:"bytes,11,rep,name=additional_bindings,json=additionalBindings,proto3" json:"additional_bindings,omitempty"` -} - -func (x *HttpRule) Reset() { - *x = HttpRule{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_http_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HttpRule) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HttpRule) ProtoMessage() {} - -func (x *HttpRule) ProtoReflect() protoreflect.Message { - mi := &file_google_api_http_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HttpRule.ProtoReflect.Descriptor instead. -func (*HttpRule) Descriptor() ([]byte, []int) { - return file_google_api_http_proto_rawDescGZIP(), []int{1} -} - -func (x *HttpRule) GetSelector() string { - if x != nil { - return x.Selector - } - return "" -} - -func (m *HttpRule) GetPattern() isHttpRule_Pattern { - if m != nil { - return m.Pattern - } - return nil -} - -func (x *HttpRule) GetGet() string { - if x, ok := x.GetPattern().(*HttpRule_Get); ok { - return x.Get - } - return "" -} - -func (x *HttpRule) GetPut() string { - if x, ok := x.GetPattern().(*HttpRule_Put); ok { - return x.Put - } - return "" -} - -func (x *HttpRule) GetPost() string { - if x, ok := x.GetPattern().(*HttpRule_Post); ok { - return x.Post - } - return "" -} - -func (x *HttpRule) GetDelete() string { - if x, ok := x.GetPattern().(*HttpRule_Delete); ok { - return x.Delete - } - return "" -} - -func (x *HttpRule) GetPatch() string { - if x, ok := x.GetPattern().(*HttpRule_Patch); ok { - return x.Patch - } - return "" -} - -func (x *HttpRule) GetCustom() *CustomHttpPattern { - if x, ok := x.GetPattern().(*HttpRule_Custom); ok { - return x.Custom - } - return nil -} - -func (x *HttpRule) GetBody() string { - if x != nil { - return x.Body - } - return "" -} - -func (x *HttpRule) GetResponseBody() string { - if x != nil { - return x.ResponseBody - } - return "" -} - -func (x *HttpRule) GetAdditionalBindings() []*HttpRule { - if x != nil { - return x.AdditionalBindings - } - return nil -} - -type isHttpRule_Pattern interface { - isHttpRule_Pattern() -} - -type HttpRule_Get struct { - // Maps to HTTP GET. Used for listing and getting information about - // resources. - Get string `protobuf:"bytes,2,opt,name=get,proto3,oneof"` -} - -type HttpRule_Put struct { - // Maps to HTTP PUT. Used for replacing a resource. - Put string `protobuf:"bytes,3,opt,name=put,proto3,oneof"` -} - -type HttpRule_Post struct { - // Maps to HTTP POST. Used for creating a resource or performing an action. - Post string `protobuf:"bytes,4,opt,name=post,proto3,oneof"` -} - -type HttpRule_Delete struct { - // Maps to HTTP DELETE. Used for deleting a resource. - Delete string `protobuf:"bytes,5,opt,name=delete,proto3,oneof"` -} - -type HttpRule_Patch struct { - // Maps to HTTP PATCH. Used for updating a resource. - Patch string `protobuf:"bytes,6,opt,name=patch,proto3,oneof"` -} - -type HttpRule_Custom struct { - // The custom pattern is used for specifying an HTTP method that is not - // included in the `pattern` field, such as HEAD, or "*" to leave the - // HTTP method unspecified for this rule. The wild-card rule is useful - // for services that provide content to Web (HTML) clients. - Custom *CustomHttpPattern `protobuf:"bytes,8,opt,name=custom,proto3,oneof"` -} - -func (*HttpRule_Get) isHttpRule_Pattern() {} - -func (*HttpRule_Put) isHttpRule_Pattern() {} - -func (*HttpRule_Post) isHttpRule_Pattern() {} - -func (*HttpRule_Delete) isHttpRule_Pattern() {} - -func (*HttpRule_Patch) isHttpRule_Pattern() {} - -func (*HttpRule_Custom) isHttpRule_Pattern() {} - -// A custom pattern is used for defining custom HTTP verb. -type CustomHttpPattern struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The name of this custom HTTP verb. - Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` - // The path matched by this custom verb. - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` -} - -func (x *CustomHttpPattern) Reset() { - *x = CustomHttpPattern{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_http_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CustomHttpPattern) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CustomHttpPattern) ProtoMessage() {} - -func (x *CustomHttpPattern) ProtoReflect() protoreflect.Message { - mi := &file_google_api_http_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CustomHttpPattern.ProtoReflect.Descriptor instead. -func (*CustomHttpPattern) Descriptor() ([]byte, []int) { - return file_google_api_http_proto_rawDescGZIP(), []int{2} -} - -func (x *CustomHttpPattern) GetKind() string { - if x != nil { - return x.Kind - } - return "" -} - -func (x *CustomHttpPattern) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -var File_google_api_http_proto protoreflect.FileDescriptor - -var file_google_api_http_proto_rawDesc = []byte{ - 0x0a, 0x15, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x68, 0x74, 0x74, - 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x61, 0x70, 0x69, 0x22, 0x79, 0x0a, 0x04, 0x48, 0x74, 0x74, 0x70, 0x12, 0x2a, 0x0a, 0x05, 0x72, - 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x52, 0x75, 0x6c, 0x65, - 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x45, 0x0a, 0x1f, 0x66, 0x75, 0x6c, 0x6c, 0x79, - 0x5f, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, - 0x5f, 0x65, 0x78, 0x70, 0x61, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x1c, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x64, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xda, - 0x02, 0x0a, 0x08, 0x48, 0x74, 0x74, 0x70, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, - 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, - 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x03, 0x67, 0x65, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x03, 0x70, - 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x70, 0x75, 0x74, 0x12, - 0x14, 0x0a, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, - 0x04, 0x70, 0x6f, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, - 0x16, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, - 0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x12, 0x37, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x48, 0x74, 0x74, 0x70, 0x50, - 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x62, 0x6f, 0x64, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x13, 0x61, 0x64, 0x64, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, - 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x12, 0x61, 0x64, - 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, - 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x22, 0x3b, 0x0a, 0x11, 0x43, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x48, 0x74, 0x74, 0x70, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, - 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x42, 0x67, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x09, 0x48, 0x74, 0x74, 0x70, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, - 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, - 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_api_http_proto_rawDescOnce sync.Once - file_google_api_http_proto_rawDescData = file_google_api_http_proto_rawDesc -) - -func file_google_api_http_proto_rawDescGZIP() []byte { - file_google_api_http_proto_rawDescOnce.Do(func() { - file_google_api_http_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_http_proto_rawDescData) - }) - return file_google_api_http_proto_rawDescData -} - -var file_google_api_http_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_google_api_http_proto_goTypes = []interface{}{ - (*Http)(nil), // 0: google.api.Http - (*HttpRule)(nil), // 1: google.api.HttpRule - (*CustomHttpPattern)(nil), // 2: google.api.CustomHttpPattern -} -var file_google_api_http_proto_depIdxs = []int32{ - 1, // 0: google.api.Http.rules:type_name -> google.api.HttpRule - 2, // 1: google.api.HttpRule.custom:type_name -> google.api.CustomHttpPattern - 1, // 2: google.api.HttpRule.additional_bindings:type_name -> google.api.HttpRule - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_google_api_http_proto_init() } -func file_google_api_http_proto_init() { - if File_google_api_http_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_google_api_http_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Http); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_http_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HttpRule); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_http_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CustomHttpPattern); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_google_api_http_proto_msgTypes[1].OneofWrappers = []interface{}{ - (*HttpRule_Get)(nil), - (*HttpRule_Put)(nil), - (*HttpRule_Post)(nil), - (*HttpRule_Delete)(nil), - (*HttpRule_Patch)(nil), - (*HttpRule_Custom)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_api_http_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_google_api_http_proto_goTypes, - DependencyIndexes: file_google_api_http_proto_depIdxs, - MessageInfos: file_google_api_http_proto_msgTypes, - }.Build() - File_google_api_http_proto = out.File - file_google_api_http_proto_rawDesc = nil - file_google_api_http_proto_goTypes = nil - file_google_api_http_proto_depIdxs = nil -} diff --git a/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go b/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go deleted file mode 100644 index a1c543a94..000000000 --- a/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go +++ /dev/null @@ -1,659 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v4.24.4 -// source: google/api/resource.proto - -package annotations - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// A description of the historical or future-looking state of the -// resource pattern. -type ResourceDescriptor_History int32 - -const ( - // The "unset" value. - ResourceDescriptor_HISTORY_UNSPECIFIED ResourceDescriptor_History = 0 - // The resource originally had one pattern and launched as such, and - // additional patterns were added later. - ResourceDescriptor_ORIGINALLY_SINGLE_PATTERN ResourceDescriptor_History = 1 - // The resource has one pattern, but the API owner expects to add more - // later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - // that from being necessary once there are multiple patterns.) - ResourceDescriptor_FUTURE_MULTI_PATTERN ResourceDescriptor_History = 2 -) - -// Enum value maps for ResourceDescriptor_History. -var ( - ResourceDescriptor_History_name = map[int32]string{ - 0: "HISTORY_UNSPECIFIED", - 1: "ORIGINALLY_SINGLE_PATTERN", - 2: "FUTURE_MULTI_PATTERN", - } - ResourceDescriptor_History_value = map[string]int32{ - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2, - } -) - -func (x ResourceDescriptor_History) Enum() *ResourceDescriptor_History { - p := new(ResourceDescriptor_History) - *p = x - return p -} - -func (x ResourceDescriptor_History) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ResourceDescriptor_History) Descriptor() protoreflect.EnumDescriptor { - return file_google_api_resource_proto_enumTypes[0].Descriptor() -} - -func (ResourceDescriptor_History) Type() protoreflect.EnumType { - return &file_google_api_resource_proto_enumTypes[0] -} - -func (x ResourceDescriptor_History) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ResourceDescriptor_History.Descriptor instead. -func (ResourceDescriptor_History) EnumDescriptor() ([]byte, []int) { - return file_google_api_resource_proto_rawDescGZIP(), []int{0, 0} -} - -// A flag representing a specific style that a resource claims to conform to. -type ResourceDescriptor_Style int32 - -const ( - // The unspecified value. Do not use. - ResourceDescriptor_STYLE_UNSPECIFIED ResourceDescriptor_Style = 0 - // This resource is intended to be "declarative-friendly". - // - // Declarative-friendly resources must be more strictly consistent, and - // setting this to true communicates to tools that this resource should - // adhere to declarative-friendly expectations. - // - // Note: This is used by the API linter (linter.aip.dev) to enable - // additional checks. - ResourceDescriptor_DECLARATIVE_FRIENDLY ResourceDescriptor_Style = 1 -) - -// Enum value maps for ResourceDescriptor_Style. -var ( - ResourceDescriptor_Style_name = map[int32]string{ - 0: "STYLE_UNSPECIFIED", - 1: "DECLARATIVE_FRIENDLY", - } - ResourceDescriptor_Style_value = map[string]int32{ - "STYLE_UNSPECIFIED": 0, - "DECLARATIVE_FRIENDLY": 1, - } -) - -func (x ResourceDescriptor_Style) Enum() *ResourceDescriptor_Style { - p := new(ResourceDescriptor_Style) - *p = x - return p -} - -func (x ResourceDescriptor_Style) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ResourceDescriptor_Style) Descriptor() protoreflect.EnumDescriptor { - return file_google_api_resource_proto_enumTypes[1].Descriptor() -} - -func (ResourceDescriptor_Style) Type() protoreflect.EnumType { - return &file_google_api_resource_proto_enumTypes[1] -} - -func (x ResourceDescriptor_Style) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ResourceDescriptor_Style.Descriptor instead. -func (ResourceDescriptor_Style) EnumDescriptor() ([]byte, []int) { - return file_google_api_resource_proto_rawDescGZIP(), []int{0, 1} -} - -// A simple descriptor of a resource type. -// -// ResourceDescriptor annotates a resource message (either by means of a -// protobuf annotation or use in the service config), and associates the -// resource's schema, the resource type, and the pattern of the resource name. -// -// Example: -// -// message Topic { -// // Indicates this message defines a resource schema. -// // Declares the resource type in the format of {service}/{kind}. -// // For Kubernetes resources, the format is {api group}/{kind}. -// option (google.api.resource) = { -// type: "pubsub.googleapis.com/Topic" -// pattern: "projects/{project}/topics/{topic}" -// }; -// } -// -// The ResourceDescriptor Yaml config will look like: -// -// resources: -// - type: "pubsub.googleapis.com/Topic" -// pattern: "projects/{project}/topics/{topic}" -// -// Sometimes, resources have multiple patterns, typically because they can -// live under multiple parents. -// -// Example: -// -// message LogEntry { -// option (google.api.resource) = { -// type: "logging.googleapis.com/LogEntry" -// pattern: "projects/{project}/logs/{log}" -// pattern: "folders/{folder}/logs/{log}" -// pattern: "organizations/{organization}/logs/{log}" -// pattern: "billingAccounts/{billing_account}/logs/{log}" -// }; -// } -// -// The ResourceDescriptor Yaml config will look like: -// -// resources: -// - type: 'logging.googleapis.com/LogEntry' -// pattern: "projects/{project}/logs/{log}" -// pattern: "folders/{folder}/logs/{log}" -// pattern: "organizations/{organization}/logs/{log}" -// pattern: "billingAccounts/{billing_account}/logs/{log}" -type ResourceDescriptor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The resource type. It must be in the format of - // {service_name}/{resource_type_kind}. The `resource_type_kind` must be - // singular and must not include version numbers. - // - // Example: `storage.googleapis.com/Bucket` - // - // The value of the resource_type_kind must follow the regular expression - // /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - // should use PascalCase (UpperCamelCase). The maximum number of - // characters allowed for the `resource_type_kind` is 100. - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - // Optional. The relative resource name pattern associated with this resource - // type. The DNS prefix of the full resource name shouldn't be specified here. - // - // The path pattern must follow the syntax, which aligns with HTTP binding - // syntax: - // - // Template = Segment { "/" Segment } ; - // Segment = LITERAL | Variable ; - // Variable = "{" LITERAL "}" ; - // - // Examples: - // - // - "projects/{project}/topics/{topic}" - // - "projects/{project}/knowledgeBases/{knowledge_base}" - // - // The components in braces correspond to the IDs for each resource in the - // hierarchy. It is expected that, if multiple patterns are provided, - // the same component name (e.g. "project") refers to IDs of the same - // type of resource. - Pattern []string `protobuf:"bytes,2,rep,name=pattern,proto3" json:"pattern,omitempty"` - // Optional. The field on the resource that designates the resource name - // field. If omitted, this is assumed to be "name". - NameField string `protobuf:"bytes,3,opt,name=name_field,json=nameField,proto3" json:"name_field,omitempty"` - // Optional. The historical or future-looking state of the resource pattern. - // - // Example: - // - // // The InspectTemplate message originally only supported resource - // // names with organization, and project was added later. - // message InspectTemplate { - // option (google.api.resource) = { - // type: "dlp.googleapis.com/InspectTemplate" - // pattern: - // "organizations/{organization}/inspectTemplates/{inspect_template}" - // pattern: "projects/{project}/inspectTemplates/{inspect_template}" - // history: ORIGINALLY_SINGLE_PATTERN - // }; - // } - History ResourceDescriptor_History `protobuf:"varint,4,opt,name=history,proto3,enum=google.api.ResourceDescriptor_History" json:"history,omitempty"` - // The plural name used in the resource name and permission names, such as - // 'projects' for the resource name of 'projects/{project}' and the permission - // name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - // to this is for Nested Collections that have stuttering names, as defined - // in [AIP-122](https://google.aip.dev/122#nested-collections), where the - // collection ID in the resource name pattern does not necessarily directly - // match the `plural` value. - // - // It is the same concept of the `plural` field in k8s CRD spec - // https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - // - // Note: The plural form is required even for singleton resources. See - // https://aip.dev/156 - Plural string `protobuf:"bytes,5,opt,name=plural,proto3" json:"plural,omitempty"` - // The same concept of the `singular` field in k8s CRD spec - // https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - // Such as "project" for the `resourcemanager.googleapis.com/Project` type. - Singular string `protobuf:"bytes,6,opt,name=singular,proto3" json:"singular,omitempty"` - // Style flag(s) for this resource. - // These indicate that a resource is expected to conform to a given - // style. See the specific style flags for additional information. - Style []ResourceDescriptor_Style `protobuf:"varint,10,rep,packed,name=style,proto3,enum=google.api.ResourceDescriptor_Style" json:"style,omitempty"` -} - -func (x *ResourceDescriptor) Reset() { - *x = ResourceDescriptor{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_resource_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResourceDescriptor) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResourceDescriptor) ProtoMessage() {} - -func (x *ResourceDescriptor) ProtoReflect() protoreflect.Message { - mi := &file_google_api_resource_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResourceDescriptor.ProtoReflect.Descriptor instead. -func (*ResourceDescriptor) Descriptor() ([]byte, []int) { - return file_google_api_resource_proto_rawDescGZIP(), []int{0} -} - -func (x *ResourceDescriptor) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *ResourceDescriptor) GetPattern() []string { - if x != nil { - return x.Pattern - } - return nil -} - -func (x *ResourceDescriptor) GetNameField() string { - if x != nil { - return x.NameField - } - return "" -} - -func (x *ResourceDescriptor) GetHistory() ResourceDescriptor_History { - if x != nil { - return x.History - } - return ResourceDescriptor_HISTORY_UNSPECIFIED -} - -func (x *ResourceDescriptor) GetPlural() string { - if x != nil { - return x.Plural - } - return "" -} - -func (x *ResourceDescriptor) GetSingular() string { - if x != nil { - return x.Singular - } - return "" -} - -func (x *ResourceDescriptor) GetStyle() []ResourceDescriptor_Style { - if x != nil { - return x.Style - } - return nil -} - -// Defines a proto annotation that describes a string field that refers to -// an API resource. -type ResourceReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The resource type that the annotated field references. - // - // Example: - // - // message Subscription { - // string topic = 2 [(google.api.resource_reference) = { - // type: "pubsub.googleapis.com/Topic" - // }]; - // } - // - // Occasionally, a field may reference an arbitrary resource. In this case, - // APIs use the special value * in their resource reference. - // - // Example: - // - // message GetIamPolicyRequest { - // string resource = 2 [(google.api.resource_reference) = { - // type: "*" - // }]; - // } - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - // The resource type of a child collection that the annotated field - // references. This is useful for annotating the `parent` field that - // doesn't have a fixed resource type. - // - // Example: - // - // message ListLogEntriesRequest { - // string parent = 1 [(google.api.resource_reference) = { - // child_type: "logging.googleapis.com/LogEntry" - // }; - // } - ChildType string `protobuf:"bytes,2,opt,name=child_type,json=childType,proto3" json:"child_type,omitempty"` -} - -func (x *ResourceReference) Reset() { - *x = ResourceReference{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_resource_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResourceReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResourceReference) ProtoMessage() {} - -func (x *ResourceReference) ProtoReflect() protoreflect.Message { - mi := &file_google_api_resource_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResourceReference.ProtoReflect.Descriptor instead. -func (*ResourceReference) Descriptor() ([]byte, []int) { - return file_google_api_resource_proto_rawDescGZIP(), []int{1} -} - -func (x *ResourceReference) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *ResourceReference) GetChildType() string { - if x != nil { - return x.ChildType - } - return "" -} - -var file_google_api_resource_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*ResourceReference)(nil), - Field: 1055, - Name: "google.api.resource_reference", - Tag: "bytes,1055,opt,name=resource_reference", - Filename: "google/api/resource.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: ([]*ResourceDescriptor)(nil), - Field: 1053, - Name: "google.api.resource_definition", - Tag: "bytes,1053,rep,name=resource_definition", - Filename: "google/api/resource.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*ResourceDescriptor)(nil), - Field: 1053, - Name: "google.api.resource", - Tag: "bytes,1053,opt,name=resource", - Filename: "google/api/resource.proto", - }, -} - -// Extension fields to descriptorpb.FieldOptions. -var ( - // An annotation that describes a resource reference, see - // [ResourceReference][]. - // - // optional google.api.ResourceReference resource_reference = 1055; - E_ResourceReference = &file_google_api_resource_proto_extTypes[0] -) - -// Extension fields to descriptorpb.FileOptions. -var ( - // An annotation that describes a resource definition without a corresponding - // message; see [ResourceDescriptor][]. - // - // repeated google.api.ResourceDescriptor resource_definition = 1053; - E_ResourceDefinition = &file_google_api_resource_proto_extTypes[1] -) - -// Extension fields to descriptorpb.MessageOptions. -var ( - // An annotation that describes a resource definition, see - // [ResourceDescriptor][]. - // - // optional google.api.ResourceDescriptor resource = 1053; - E_Resource = &file_google_api_resource_proto_extTypes[2] -) - -var File_google_api_resource_proto protoreflect.FileDescriptor - -var file_google_api_resource_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaa, 0x03, 0x0a, 0x12, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, - 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1d, - 0x0a, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x40, 0x0a, - 0x07, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x48, - 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x07, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, - 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x72, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x70, 0x6c, 0x75, 0x72, 0x61, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x69, 0x6e, 0x67, 0x75, - 0x6c, 0x61, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x69, 0x6e, 0x67, 0x75, - 0x6c, 0x61, 0x72, 0x12, 0x3a, 0x0a, 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x03, - 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x2e, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x22, - 0x5b, 0x0a, 0x07, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x17, 0x0a, 0x13, 0x48, 0x49, - 0x53, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x4f, 0x52, 0x49, 0x47, 0x49, 0x4e, 0x41, 0x4c, 0x4c, - 0x59, 0x5f, 0x53, 0x49, 0x4e, 0x47, 0x4c, 0x45, 0x5f, 0x50, 0x41, 0x54, 0x54, 0x45, 0x52, 0x4e, - 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x46, 0x55, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x4d, 0x55, 0x4c, - 0x54, 0x49, 0x5f, 0x50, 0x41, 0x54, 0x54, 0x45, 0x52, 0x4e, 0x10, 0x02, 0x22, 0x38, 0x0a, 0x05, - 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, - 0x44, 0x45, 0x43, 0x4c, 0x41, 0x52, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5f, 0x46, 0x52, 0x49, 0x45, - 0x4e, 0x44, 0x4c, 0x59, 0x10, 0x01, 0x22, 0x46, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, - 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x6c, - 0x0a, 0x12, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x9f, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x11, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x3a, 0x6e, 0x0a, 0x13, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x9d, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x12, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x5c, 0x0a, 0x08, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9d, 0x08, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, - 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x6b, 0x0a, 0x0e, 0x63, 0x6f, - 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x0d, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, - 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_api_resource_proto_rawDescOnce sync.Once - file_google_api_resource_proto_rawDescData = file_google_api_resource_proto_rawDesc -) - -func file_google_api_resource_proto_rawDescGZIP() []byte { - file_google_api_resource_proto_rawDescOnce.Do(func() { - file_google_api_resource_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_resource_proto_rawDescData) - }) - return file_google_api_resource_proto_rawDescData -} - -var file_google_api_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_google_api_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_google_api_resource_proto_goTypes = []interface{}{ - (ResourceDescriptor_History)(0), // 0: google.api.ResourceDescriptor.History - (ResourceDescriptor_Style)(0), // 1: google.api.ResourceDescriptor.Style - (*ResourceDescriptor)(nil), // 2: google.api.ResourceDescriptor - (*ResourceReference)(nil), // 3: google.api.ResourceReference - (*descriptorpb.FieldOptions)(nil), // 4: google.protobuf.FieldOptions - (*descriptorpb.FileOptions)(nil), // 5: google.protobuf.FileOptions - (*descriptorpb.MessageOptions)(nil), // 6: google.protobuf.MessageOptions -} -var file_google_api_resource_proto_depIdxs = []int32{ - 0, // 0: google.api.ResourceDescriptor.history:type_name -> google.api.ResourceDescriptor.History - 1, // 1: google.api.ResourceDescriptor.style:type_name -> google.api.ResourceDescriptor.Style - 4, // 2: google.api.resource_reference:extendee -> google.protobuf.FieldOptions - 5, // 3: google.api.resource_definition:extendee -> google.protobuf.FileOptions - 6, // 4: google.api.resource:extendee -> google.protobuf.MessageOptions - 3, // 5: google.api.resource_reference:type_name -> google.api.ResourceReference - 2, // 6: google.api.resource_definition:type_name -> google.api.ResourceDescriptor - 2, // 7: google.api.resource:type_name -> google.api.ResourceDescriptor - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 5, // [5:8] is the sub-list for extension type_name - 2, // [2:5] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_google_api_resource_proto_init() } -func file_google_api_resource_proto_init() { - if File_google_api_resource_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_google_api_resource_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResourceDescriptor); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_resource_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResourceReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_api_resource_proto_rawDesc, - NumEnums: 2, - NumMessages: 2, - NumExtensions: 3, - NumServices: 0, - }, - GoTypes: file_google_api_resource_proto_goTypes, - DependencyIndexes: file_google_api_resource_proto_depIdxs, - EnumInfos: file_google_api_resource_proto_enumTypes, - MessageInfos: file_google_api_resource_proto_msgTypes, - ExtensionInfos: file_google_api_resource_proto_extTypes, - }.Build() - File_google_api_resource_proto = out.File - file_google_api_resource_proto_rawDesc = nil - file_google_api_resource_proto_goTypes = nil - file_google_api_resource_proto_depIdxs = nil -} diff --git a/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/routing.pb.go b/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/routing.pb.go deleted file mode 100644 index 2b54db304..000000000 --- a/e2e/vendor/google.golang.org/genproto/googleapis/api/annotations/routing.pb.go +++ /dev/null @@ -1,693 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v4.24.4 -// source: google/api/routing.proto - -package annotations - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Specifies the routing information that should be sent along with the request -// in the form of routing header. -// **NOTE:** All service configuration rules follow the "last one wins" order. -// -// The examples below will apply to an RPC which has the following request type: -// -// Message Definition: -// -// message Request { -// // The name of the Table -// // Values can be of the following formats: -// // - `projects//tables/` -// // - `projects//instances//tables/
` -// // - `region//zones//tables/
` -// string table_name = 1; -// -// // This value specifies routing for replication. -// // It can be in the following formats: -// // - `profiles/` -// // - a legacy `profile_id` that can be any string -// string app_profile_id = 2; -// } -// -// Example message: -// -// { -// table_name: projects/proj_foo/instances/instance_bar/table/table_baz, -// app_profile_id: profiles/prof_qux -// } -// -// The routing header consists of one or multiple key-value pairs. Every key -// and value must be percent-encoded, and joined together in the format of -// `key1=value1&key2=value2`. -// The examples below skip the percent-encoding for readability. -// -// # Example 1 -// -// Extracting a field from the request to put into the routing header -// unchanged, with the key equal to the field name. -// -// annotation: -// -// option (google.api.routing) = { -// // Take the `app_profile_id`. -// routing_parameters { -// field: "app_profile_id" -// } -// }; -// -// result: -// -// x-goog-request-params: app_profile_id=profiles/prof_qux -// -// # Example 2 -// -// Extracting a field from the request to put into the routing header -// unchanged, with the key different from the field name. -// -// annotation: -// -// option (google.api.routing) = { -// // Take the `app_profile_id`, but name it `routing_id` in the header. -// routing_parameters { -// field: "app_profile_id" -// path_template: "{routing_id=**}" -// } -// }; -// -// result: -// -// x-goog-request-params: routing_id=profiles/prof_qux -// -// # Example 3 -// -// Extracting a field from the request to put into the routing -// header, while matching a path template syntax on the field's value. -// -// NB: it is more useful to send nothing than to send garbage for the purpose -// of dynamic routing, since garbage pollutes cache. Thus the matching. -// -// # Sub-example 3a -// -// The field matches the template. -// -// annotation: -// -// option (google.api.routing) = { -// // Take the `table_name`, if it's well-formed (with project-based -// // syntax). -// routing_parameters { -// field: "table_name" -// path_template: "{table_name=projects/*/instances/*/**}" -// } -// }; -// -// result: -// -// x-goog-request-params: -// table_name=projects/proj_foo/instances/instance_bar/table/table_baz -// -// # Sub-example 3b -// -// The field does not match the template. -// -// annotation: -// -// option (google.api.routing) = { -// // Take the `table_name`, if it's well-formed (with region-based -// // syntax). -// routing_parameters { -// field: "table_name" -// path_template: "{table_name=regions/*/zones/*/**}" -// } -// }; -// -// result: -// -// -// -// # Sub-example 3c -// -// Multiple alternative conflictingly named path templates are -// specified. The one that matches is used to construct the header. -// -// annotation: -// -// option (google.api.routing) = { -// // Take the `table_name`, if it's well-formed, whether -// // using the region- or projects-based syntax. -// -// routing_parameters { -// field: "table_name" -// path_template: "{table_name=regions/*/zones/*/**}" -// } -// routing_parameters { -// field: "table_name" -// path_template: "{table_name=projects/*/instances/*/**}" -// } -// }; -// -// result: -// -// x-goog-request-params: -// table_name=projects/proj_foo/instances/instance_bar/table/table_baz -// -// # Example 4 -// -// Extracting a single routing header key-value pair by matching a -// template syntax on (a part of) a single request field. -// -// annotation: -// -// option (google.api.routing) = { -// // Take just the project id from the `table_name` field. -// routing_parameters { -// field: "table_name" -// path_template: "{routing_id=projects/*}/**" -// } -// }; -// -// result: -// -// x-goog-request-params: routing_id=projects/proj_foo -// -// # Example 5 -// -// Extracting a single routing header key-value pair by matching -// several conflictingly named path templates on (parts of) a single request -// field. The last template to match "wins" the conflict. -// -// annotation: -// -// option (google.api.routing) = { -// // If the `table_name` does not have instances information, -// // take just the project id for routing. -// // Otherwise take project + instance. -// -// routing_parameters { -// field: "table_name" -// path_template: "{routing_id=projects/*}/**" -// } -// routing_parameters { -// field: "table_name" -// path_template: "{routing_id=projects/*/instances/*}/**" -// } -// }; -// -// result: -// -// x-goog-request-params: -// routing_id=projects/proj_foo/instances/instance_bar -// -// # Example 6 -// -// Extracting multiple routing header key-value pairs by matching -// several non-conflicting path templates on (parts of) a single request field. -// -// # Sub-example 6a -// -// Make the templates strict, so that if the `table_name` does not -// have an instance information, nothing is sent. -// -// annotation: -// -// option (google.api.routing) = { -// // The routing code needs two keys instead of one composite -// // but works only for the tables with the "project-instance" name -// // syntax. -// -// routing_parameters { -// field: "table_name" -// path_template: "{project_id=projects/*}/instances/*/**" -// } -// routing_parameters { -// field: "table_name" -// path_template: "projects/*/{instance_id=instances/*}/**" -// } -// }; -// -// result: -// -// x-goog-request-params: -// project_id=projects/proj_foo&instance_id=instances/instance_bar -// -// # Sub-example 6b -// -// Make the templates loose, so that if the `table_name` does not -// have an instance information, just the project id part is sent. -// -// annotation: -// -// option (google.api.routing) = { -// // The routing code wants two keys instead of one composite -// // but will work with just the `project_id` for tables without -// // an instance in the `table_name`. -// -// routing_parameters { -// field: "table_name" -// path_template: "{project_id=projects/*}/**" -// } -// routing_parameters { -// field: "table_name" -// path_template: "projects/*/{instance_id=instances/*}/**" -// } -// }; -// -// result (is the same as 6a for our example message because it has the instance -// information): -// -// x-goog-request-params: -// project_id=projects/proj_foo&instance_id=instances/instance_bar -// -// # Example 7 -// -// Extracting multiple routing header key-value pairs by matching -// several path templates on multiple request fields. -// -// NB: note that here there is no way to specify sending nothing if one of the -// fields does not match its template. E.g. if the `table_name` is in the wrong -// format, the `project_id` will not be sent, but the `routing_id` will be. -// The backend routing code has to be aware of that and be prepared to not -// receive a full complement of keys if it expects multiple. -// -// annotation: -// -// option (google.api.routing) = { -// // The routing needs both `project_id` and `routing_id` -// // (from the `app_profile_id` field) for routing. -// -// routing_parameters { -// field: "table_name" -// path_template: "{project_id=projects/*}/**" -// } -// routing_parameters { -// field: "app_profile_id" -// path_template: "{routing_id=**}" -// } -// }; -// -// result: -// -// x-goog-request-params: -// project_id=projects/proj_foo&routing_id=profiles/prof_qux -// -// # Example 8 -// -// Extracting a single routing header key-value pair by matching -// several conflictingly named path templates on several request fields. The -// last template to match "wins" the conflict. -// -// annotation: -// -// option (google.api.routing) = { -// // The `routing_id` can be a project id or a region id depending on -// // the table name format, but only if the `app_profile_id` is not set. -// // If `app_profile_id` is set it should be used instead. -// -// routing_parameters { -// field: "table_name" -// path_template: "{routing_id=projects/*}/**" -// } -// routing_parameters { -// field: "table_name" -// path_template: "{routing_id=regions/*}/**" -// } -// routing_parameters { -// field: "app_profile_id" -// path_template: "{routing_id=**}" -// } -// }; -// -// result: -// -// x-goog-request-params: routing_id=profiles/prof_qux -// -// # Example 9 -// -// Bringing it all together. -// -// annotation: -// -// option (google.api.routing) = { -// // For routing both `table_location` and a `routing_id` are needed. -// // -// // table_location can be either an instance id or a region+zone id. -// // -// // For `routing_id`, take the value of `app_profile_id` -// // - If it's in the format `profiles/`, send -// // just the `` part. -// // - If it's any other literal, send it as is. -// // If the `app_profile_id` is empty, and the `table_name` starts with -// // the project_id, send that instead. -// -// routing_parameters { -// field: "table_name" -// path_template: "projects/*/{table_location=instances/*}/tables/*" -// } -// routing_parameters { -// field: "table_name" -// path_template: "{table_location=regions/*/zones/*}/tables/*" -// } -// routing_parameters { -// field: "table_name" -// path_template: "{routing_id=projects/*}/**" -// } -// routing_parameters { -// field: "app_profile_id" -// path_template: "{routing_id=**}" -// } -// routing_parameters { -// field: "app_profile_id" -// path_template: "profiles/{routing_id=*}" -// } -// }; -// -// result: -// -// x-goog-request-params: -// table_location=instances/instance_bar&routing_id=prof_qux -type RoutingRule struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // A collection of Routing Parameter specifications. - // **NOTE:** If multiple Routing Parameters describe the same key - // (via the `path_template` field or via the `field` field when - // `path_template` is not provided), "last one wins" rule - // determines which Parameter gets used. - // See the examples for more details. - RoutingParameters []*RoutingParameter `protobuf:"bytes,2,rep,name=routing_parameters,json=routingParameters,proto3" json:"routing_parameters,omitempty"` -} - -func (x *RoutingRule) Reset() { - *x = RoutingRule{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_routing_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RoutingRule) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RoutingRule) ProtoMessage() {} - -func (x *RoutingRule) ProtoReflect() protoreflect.Message { - mi := &file_google_api_routing_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RoutingRule.ProtoReflect.Descriptor instead. -func (*RoutingRule) Descriptor() ([]byte, []int) { - return file_google_api_routing_proto_rawDescGZIP(), []int{0} -} - -func (x *RoutingRule) GetRoutingParameters() []*RoutingParameter { - if x != nil { - return x.RoutingParameters - } - return nil -} - -// A projection from an input message to the GRPC or REST header. -type RoutingParameter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // A request field to extract the header key-value pair from. - Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` - // A pattern matching the key-value field. Optional. - // If not specified, the whole field specified in the `field` field will be - // taken as value, and its name used as key. If specified, it MUST contain - // exactly one named segment (along with any number of unnamed segments) The - // pattern will be matched over the field specified in the `field` field, then - // if the match is successful: - // - the name of the single named segment will be used as a header name, - // - the match value of the segment will be used as a header value; - // if the match is NOT successful, nothing will be sent. - // - // Example: - // - // -- This is a field in the request message - // | that the header value will be extracted from. - // | - // | -- This is the key name in the - // | | routing header. - // V | - // field: "table_name" v - // path_template: "projects/*/{table_location=instances/*}/tables/*" - // ^ ^ - // | | - // In the {} brackets is the pattern that -- | - // specifies what to extract from the | - // field as a value to be sent. | - // | - // The string in the field must match the whole pattern -- - // before brackets, inside brackets, after brackets. - // - // When looking at this specific example, we can see that: - // - A key-value pair with the key `table_location` - // and the value matching `instances/*` should be added - // to the x-goog-request-params routing header. - // - The value is extracted from the request message's `table_name` field - // if it matches the full pattern specified: - // `projects/*/instances/*/tables/*`. - // - // **NB:** If the `path_template` field is not provided, the key name is - // equal to the field name, and the whole field should be sent as a value. - // This makes the pattern for the field and the value functionally equivalent - // to `**`, and the configuration - // - // { - // field: "table_name" - // } - // - // is a functionally equivalent shorthand to: - // - // { - // field: "table_name" - // path_template: "{table_name=**}" - // } - // - // See Example 1 for more details. - PathTemplate string `protobuf:"bytes,2,opt,name=path_template,json=pathTemplate,proto3" json:"path_template,omitempty"` -} - -func (x *RoutingParameter) Reset() { - *x = RoutingParameter{} - if protoimpl.UnsafeEnabled { - mi := &file_google_api_routing_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RoutingParameter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RoutingParameter) ProtoMessage() {} - -func (x *RoutingParameter) ProtoReflect() protoreflect.Message { - mi := &file_google_api_routing_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RoutingParameter.ProtoReflect.Descriptor instead. -func (*RoutingParameter) Descriptor() ([]byte, []int) { - return file_google_api_routing_proto_rawDescGZIP(), []int{1} -} - -func (x *RoutingParameter) GetField() string { - if x != nil { - return x.Field - } - return "" -} - -func (x *RoutingParameter) GetPathTemplate() string { - if x != nil { - return x.PathTemplate - } - return "" -} - -var file_google_api_routing_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.MethodOptions)(nil), - ExtensionType: (*RoutingRule)(nil), - Field: 72295729, - Name: "google.api.routing", - Tag: "bytes,72295729,opt,name=routing", - Filename: "google/api/routing.proto", - }, -} - -// Extension fields to descriptorpb.MethodOptions. -var ( - // See RoutingRule. - // - // optional google.api.RoutingRule routing = 72295729; - E_Routing = &file_google_api_routing_proto_extTypes[0] -) - -var File_google_api_routing_proto protoreflect.FileDescriptor - -var file_google_api_routing_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x6f, 0x75, - 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5a, 0x0a, 0x0b, 0x52, 0x6f, 0x75, 0x74, - 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x4b, 0x0a, 0x12, 0x72, 0x6f, 0x75, 0x74, 0x69, - 0x6e, 0x67, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x52, 0x11, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, - 0x74, 0x65, 0x72, 0x73, 0x22, 0x4d, 0x0a, 0x10, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x23, - 0x0a, 0x0d, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x61, 0x74, 0x68, 0x54, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x3a, 0x54, 0x0a, 0x07, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1e, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb1, - 0xca, 0xbc, 0x22, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, - 0x52, 0x07, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x6a, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x0c, 0x52, 0x6f, 0x75, - 0x74, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, - 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, - 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa2, 0x02, - 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_api_routing_proto_rawDescOnce sync.Once - file_google_api_routing_proto_rawDescData = file_google_api_routing_proto_rawDesc -) - -func file_google_api_routing_proto_rawDescGZIP() []byte { - file_google_api_routing_proto_rawDescOnce.Do(func() { - file_google_api_routing_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_routing_proto_rawDescData) - }) - return file_google_api_routing_proto_rawDescData -} - -var file_google_api_routing_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_google_api_routing_proto_goTypes = []interface{}{ - (*RoutingRule)(nil), // 0: google.api.RoutingRule - (*RoutingParameter)(nil), // 1: google.api.RoutingParameter - (*descriptorpb.MethodOptions)(nil), // 2: google.protobuf.MethodOptions -} -var file_google_api_routing_proto_depIdxs = []int32{ - 1, // 0: google.api.RoutingRule.routing_parameters:type_name -> google.api.RoutingParameter - 2, // 1: google.api.routing:extendee -> google.protobuf.MethodOptions - 0, // 2: google.api.routing:type_name -> google.api.RoutingRule - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 2, // [2:3] is the sub-list for extension type_name - 1, // [1:2] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_google_api_routing_proto_init() } -func file_google_api_routing_proto_init() { - if File_google_api_routing_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_google_api_routing_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RoutingRule); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_api_routing_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RoutingParameter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_api_routing_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 1, - NumServices: 0, - }, - GoTypes: file_google_api_routing_proto_goTypes, - DependencyIndexes: file_google_api_routing_proto_depIdxs, - MessageInfos: file_google_api_routing_proto_msgTypes, - ExtensionInfos: file_google_api_routing_proto_extTypes, - }.Build() - File_google_api_routing_proto = out.File - file_google_api_routing_proto_rawDesc = nil - file_google_api_routing_proto_goTypes = nil - file_google_api_routing_proto_depIdxs = nil -} diff --git a/e2e/vendor/google.golang.org/genproto/googleapis/api/launch_stage.pb.go b/e2e/vendor/google.golang.org/genproto/googleapis/api/launch_stage.pb.go deleted file mode 100644 index 498020e33..000000000 --- a/e2e/vendor/google.golang.org/genproto/googleapis/api/launch_stage.pb.go +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v4.24.4 -// source: google/api/launch_stage.proto - -package api - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// The launch stage as defined by [Google Cloud Platform -// Launch Stages](https://cloud.google.com/terms/launch-stages). -type LaunchStage int32 - -const ( - // Do not use this default value. - LaunchStage_LAUNCH_STAGE_UNSPECIFIED LaunchStage = 0 - // The feature is not yet implemented. Users can not use it. - LaunchStage_UNIMPLEMENTED LaunchStage = 6 - // Prelaunch features are hidden from users and are only visible internally. - LaunchStage_PRELAUNCH LaunchStage = 7 - // Early Access features are limited to a closed group of testers. To use - // these features, you must sign up in advance and sign a Trusted Tester - // agreement (which includes confidentiality provisions). These features may - // be unstable, changed in backward-incompatible ways, and are not - // guaranteed to be released. - LaunchStage_EARLY_ACCESS LaunchStage = 1 - // Alpha is a limited availability test for releases before they are cleared - // for widespread use. By Alpha, all significant design issues are resolved - // and we are in the process of verifying functionality. Alpha customers - // need to apply for access, agree to applicable terms, and have their - // projects allowlisted. Alpha releases don't have to be feature complete, - // no SLAs are provided, and there are no technical support obligations, but - // they will be far enough along that customers can actually use them in - // test environments or for limited-use tests -- just like they would in - // normal production cases. - LaunchStage_ALPHA LaunchStage = 2 - // Beta is the point at which we are ready to open a release for any - // customer to use. There are no SLA or technical support obligations in a - // Beta release. Products will be complete from a feature perspective, but - // may have some open outstanding issues. Beta releases are suitable for - // limited production use cases. - LaunchStage_BETA LaunchStage = 3 - // GA features are open to all developers and are considered stable and - // fully qualified for production use. - LaunchStage_GA LaunchStage = 4 - // Deprecated features are scheduled to be shut down and removed. For more - // information, see the "Deprecation Policy" section of our [Terms of - // Service](https://cloud.google.com/terms/) - // and the [Google Cloud Platform Subject to the Deprecation - // Policy](https://cloud.google.com/terms/deprecation) documentation. - LaunchStage_DEPRECATED LaunchStage = 5 -) - -// Enum value maps for LaunchStage. -var ( - LaunchStage_name = map[int32]string{ - 0: "LAUNCH_STAGE_UNSPECIFIED", - 6: "UNIMPLEMENTED", - 7: "PRELAUNCH", - 1: "EARLY_ACCESS", - 2: "ALPHA", - 3: "BETA", - 4: "GA", - 5: "DEPRECATED", - } - LaunchStage_value = map[string]int32{ - "LAUNCH_STAGE_UNSPECIFIED": 0, - "UNIMPLEMENTED": 6, - "PRELAUNCH": 7, - "EARLY_ACCESS": 1, - "ALPHA": 2, - "BETA": 3, - "GA": 4, - "DEPRECATED": 5, - } -) - -func (x LaunchStage) Enum() *LaunchStage { - p := new(LaunchStage) - *p = x - return p -} - -func (x LaunchStage) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (LaunchStage) Descriptor() protoreflect.EnumDescriptor { - return file_google_api_launch_stage_proto_enumTypes[0].Descriptor() -} - -func (LaunchStage) Type() protoreflect.EnumType { - return &file_google_api_launch_stage_proto_enumTypes[0] -} - -func (x LaunchStage) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use LaunchStage.Descriptor instead. -func (LaunchStage) EnumDescriptor() ([]byte, []int) { - return file_google_api_launch_stage_proto_rawDescGZIP(), []int{0} -} - -var File_google_api_launch_stage_proto protoreflect.FileDescriptor - -var file_google_api_launch_stage_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6c, 0x61, 0x75, - 0x6e, 0x63, 0x68, 0x5f, 0x73, 0x74, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2a, 0x8c, 0x01, 0x0a, 0x0b, - 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x53, 0x74, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x4c, - 0x41, 0x55, 0x4e, 0x43, 0x48, 0x5f, 0x53, 0x54, 0x41, 0x47, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x55, 0x4e, 0x49, - 0x4d, 0x50, 0x4c, 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x45, 0x44, 0x10, 0x06, 0x12, 0x0d, 0x0a, 0x09, - 0x50, 0x52, 0x45, 0x4c, 0x41, 0x55, 0x4e, 0x43, 0x48, 0x10, 0x07, 0x12, 0x10, 0x0a, 0x0c, 0x45, - 0x41, 0x52, 0x4c, 0x59, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x01, 0x12, 0x09, 0x0a, - 0x05, 0x41, 0x4c, 0x50, 0x48, 0x41, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x45, 0x54, 0x41, - 0x10, 0x03, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x41, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x45, - 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x10, 0x05, 0x42, 0x5a, 0x0a, 0x0e, 0x63, 0x6f, - 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x10, 0x4c, 0x61, - 0x75, 0x6e, 0x63, 0x68, 0x53, 0x74, 0x61, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x2d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, - 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x3b, 0x61, 0x70, 0x69, 0xa2, - 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_api_launch_stage_proto_rawDescOnce sync.Once - file_google_api_launch_stage_proto_rawDescData = file_google_api_launch_stage_proto_rawDesc -) - -func file_google_api_launch_stage_proto_rawDescGZIP() []byte { - file_google_api_launch_stage_proto_rawDescOnce.Do(func() { - file_google_api_launch_stage_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_api_launch_stage_proto_rawDescData) - }) - return file_google_api_launch_stage_proto_rawDescData -} - -var file_google_api_launch_stage_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_google_api_launch_stage_proto_goTypes = []interface{}{ - (LaunchStage)(0), // 0: google.api.LaunchStage -} -var file_google_api_launch_stage_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_google_api_launch_stage_proto_init() } -func file_google_api_launch_stage_proto_init() { - if File_google_api_launch_stage_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_api_launch_stage_proto_rawDesc, - NumEnums: 1, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_google_api_launch_stage_proto_goTypes, - DependencyIndexes: file_google_api_launch_stage_proto_depIdxs, - EnumInfos: file_google_api_launch_stage_proto_enumTypes, - }.Build() - File_google_api_launch_stage_proto = out.File - file_google_api_launch_stage_proto_rawDesc = nil - file_google_api_launch_stage_proto_goTypes = nil - file_google_api_launch_stage_proto_depIdxs = nil -} diff --git a/e2e/vendor/google.golang.org/grpc/resolver/manual/manual.go b/e2e/vendor/google.golang.org/grpc/resolver/manual/manual.go deleted file mode 100644 index 82fcc2e35..000000000 --- a/e2e/vendor/google.golang.org/grpc/resolver/manual/manual.go +++ /dev/null @@ -1,130 +0,0 @@ -/* - * - * Copyright 2017 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// Package manual defines a resolver that can be used to manually send resolved -// addresses to ClientConn. -package manual - -import ( - "sync" - - "google.golang.org/grpc/resolver" -) - -// NewBuilderWithScheme creates a new manual resolver builder with the given -// scheme. Every instance of the manual resolver may only ever be used with a -// single grpc.ClientConn. Otherwise, bad things will happen. -func NewBuilderWithScheme(scheme string) *Resolver { - return &Resolver{ - BuildCallback: func(resolver.Target, resolver.ClientConn, resolver.BuildOptions) {}, - UpdateStateCallback: func(error) {}, - ResolveNowCallback: func(resolver.ResolveNowOptions) {}, - CloseCallback: func() {}, - scheme: scheme, - } -} - -// Resolver is also a resolver builder. -// It's build() function always returns itself. -type Resolver struct { - // BuildCallback is called when the Build method is called. Must not be - // nil. Must not be changed after the resolver may be built. - BuildCallback func(resolver.Target, resolver.ClientConn, resolver.BuildOptions) - // UpdateStateCallback is called when the UpdateState method is called on - // the resolver. The value passed as argument to this callback is the value - // returned by the resolver.ClientConn. Must not be nil. Must not be - // changed after the resolver may be built. - UpdateStateCallback func(err error) - // ResolveNowCallback is called when the ResolveNow method is called on the - // resolver. Must not be nil. Must not be changed after the resolver may - // be built. - ResolveNowCallback func(resolver.ResolveNowOptions) - // CloseCallback is called when the Close method is called. Must not be - // nil. Must not be changed after the resolver may be built. - CloseCallback func() - scheme string - - // Fields actually belong to the resolver. - // Guards access to below fields. - mu sync.Mutex - cc resolver.ClientConn - // Storing the most recent state update makes this resolver resilient to - // restarts, which is possible with channel idleness. - lastSeenState *resolver.State -} - -// InitialState adds initial state to the resolver so that UpdateState doesn't -// need to be explicitly called after Dial. -func (r *Resolver) InitialState(s resolver.State) { - r.lastSeenState = &s -} - -// Build returns itself for Resolver, because it's both a builder and a resolver. -func (r *Resolver) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) { - r.mu.Lock() - defer r.mu.Unlock() - // Call BuildCallback after locking to avoid a race when UpdateState or CC - // is called before Build returns. - r.BuildCallback(target, cc, opts) - r.cc = cc - if r.lastSeenState != nil { - err := r.cc.UpdateState(*r.lastSeenState) - go r.UpdateStateCallback(err) - } - return r, nil -} - -// Scheme returns the manual resolver's scheme. -func (r *Resolver) Scheme() string { - return r.scheme -} - -// ResolveNow is a noop for Resolver. -func (r *Resolver) ResolveNow(o resolver.ResolveNowOptions) { - r.ResolveNowCallback(o) -} - -// Close is a noop for Resolver. -func (r *Resolver) Close() { - r.CloseCallback() -} - -// UpdateState calls UpdateState(s) on the channel. If the resolver has not -// been Built before, this instead sets the initial state of the resolver, like -// InitialState. -func (r *Resolver) UpdateState(s resolver.State) { - r.mu.Lock() - defer r.mu.Unlock() - r.lastSeenState = &s - if r.cc == nil { - return - } - err := r.cc.UpdateState(s) - r.UpdateStateCallback(err) -} - -// CC returns r's ClientConn when r was last Built. Panics if the resolver has -// not been Built before. -func (r *Resolver) CC() resolver.ClientConn { - r.mu.Lock() - defer r.mu.Unlock() - if r.cc == nil { - panic("Manual resolver instance has not yet been built.") - } - return r.cc -} diff --git a/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/.gitignore b/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/.gitignore deleted file mode 100644 index 836562412..000000000 --- a/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test diff --git a/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/.travis.yml b/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/.travis.yml deleted file mode 100644 index 21166f5c7..000000000 --- a/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: go - -go: - - tip - - 1.15.x - - 1.14.x - - 1.13.x - - 1.12.x - -env: - - GO111MODULE=on diff --git a/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/LICENSE b/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/LICENSE deleted file mode 100644 index c3d4cc307..000000000 --- a/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Nate Finch - -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. \ No newline at end of file diff --git a/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/README.md b/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/README.md deleted file mode 100644 index 060eae52a..000000000 --- a/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/README.md +++ /dev/null @@ -1,179 +0,0 @@ -# lumberjack [![GoDoc](https://godoc.org/gopkg.in/natefinch/lumberjack.v2?status.png)](https://godoc.org/gopkg.in/natefinch/lumberjack.v2) [![Build Status](https://travis-ci.org/natefinch/lumberjack.svg?branch=v2.0)](https://travis-ci.org/natefinch/lumberjack) [![Build status](https://ci.appveyor.com/api/projects/status/00gchpxtg4gkrt5d)](https://ci.appveyor.com/project/natefinch/lumberjack) [![Coverage Status](https://coveralls.io/repos/natefinch/lumberjack/badge.svg?branch=v2.0)](https://coveralls.io/r/natefinch/lumberjack?branch=v2.0) - -### Lumberjack is a Go package for writing logs to rolling files. - -Package lumberjack provides a rolling logger. - -Note that this is v2.0 of lumberjack, and should be imported using gopkg.in -thusly: - - import "gopkg.in/natefinch/lumberjack.v2" - -The package name remains simply lumberjack, and the code resides at -https://github.com/natefinch/lumberjack under the v2.0 branch. - -Lumberjack is intended to be one part of a logging infrastructure. -It is not an all-in-one solution, but instead is a pluggable -component at the bottom of the logging stack that simply controls the files -to which logs are written. - -Lumberjack plays well with any logging package that can write to an -io.Writer, including the standard library's log package. - -Lumberjack assumes that only one process is writing to the output files. -Using the same lumberjack configuration from multiple processes on the same -machine will result in improper behavior. - - -**Example** - -To use lumberjack with the standard library's log package, just pass it into the SetOutput function when your application starts. - -Code: - -```go -log.SetOutput(&lumberjack.Logger{ - Filename: "/var/log/myapp/foo.log", - MaxSize: 500, // megabytes - MaxBackups: 3, - MaxAge: 28, //days - Compress: true, // disabled by default -}) -``` - - - -## type Logger -``` go -type Logger struct { - // Filename is the file to write logs to. Backup log files will be retained - // in the same directory. It uses -lumberjack.log in - // os.TempDir() if empty. - Filename string `json:"filename" yaml:"filename"` - - // MaxSize is the maximum size in megabytes of the log file before it gets - // rotated. It defaults to 100 megabytes. - MaxSize int `json:"maxsize" yaml:"maxsize"` - - // MaxAge is the maximum number of days to retain old log files based on the - // timestamp encoded in their filename. Note that a day is defined as 24 - // hours and may not exactly correspond to calendar days due to daylight - // savings, leap seconds, etc. The default is not to remove old log files - // based on age. - MaxAge int `json:"maxage" yaml:"maxage"` - - // MaxBackups is the maximum number of old log files to retain. The default - // is to retain all old log files (though MaxAge may still cause them to get - // deleted.) - MaxBackups int `json:"maxbackups" yaml:"maxbackups"` - - // LocalTime determines if the time used for formatting the timestamps in - // backup files is the computer's local time. The default is to use UTC - // time. - LocalTime bool `json:"localtime" yaml:"localtime"` - - // Compress determines if the rotated log files should be compressed - // using gzip. The default is not to perform compression. - Compress bool `json:"compress" yaml:"compress"` - // contains filtered or unexported fields -} -``` -Logger is an io.WriteCloser that writes to the specified filename. - -Logger opens or creates the logfile on first Write. If the file exists and -is less than MaxSize megabytes, lumberjack will open and append to that file. -If the file exists and its size is >= MaxSize megabytes, the file is renamed -by putting the current time in a timestamp in the name immediately before the -file's extension (or the end of the filename if there's no extension). A new -log file is then created using original filename. - -Whenever a write would cause the current log file exceed MaxSize megabytes, -the current file is closed, renamed, and a new log file created with the -original name. Thus, the filename you give Logger is always the "current" log -file. - -Backups use the log file name given to Logger, in the form `name-timestamp.ext` -where name is the filename without the extension, timestamp is the time at which -the log was rotated formatted with the time.Time format of -`2006-01-02T15-04-05.000` and the extension is the original extension. For -example, if your Logger.Filename is `/var/log/foo/server.log`, a backup created -at 6:30pm on Nov 11 2016 would use the filename -`/var/log/foo/server-2016-11-04T18-30-00.000.log` - -### Cleaning Up Old Log Files -Whenever a new logfile gets created, old log files may be deleted. The most -recent files according to the encoded timestamp will be retained, up to a -number equal to MaxBackups (or all of them if MaxBackups is 0). Any files -with an encoded timestamp older than MaxAge days are deleted, regardless of -MaxBackups. Note that the time encoded in the timestamp is the rotation -time, which may differ from the last time that file was written to. - -If MaxBackups and MaxAge are both 0, no old log files will be deleted. - - - - - - - - - - - -### func (\*Logger) Close -``` go -func (l *Logger) Close() error -``` -Close implements io.Closer, and closes the current logfile. - - - -### func (\*Logger) Rotate -``` go -func (l *Logger) Rotate() error -``` -Rotate causes Logger to close the existing log file and immediately create a -new one. This is a helper function for applications that want to initiate -rotations outside of the normal rotation rules, such as in response to -SIGHUP. After rotating, this initiates a cleanup of old log files according -to the normal rules. - -**Example** - -Example of how to rotate in response to SIGHUP. - -Code: - -```go -l := &lumberjack.Logger{} -log.SetOutput(l) -c := make(chan os.Signal, 1) -signal.Notify(c, syscall.SIGHUP) - -go func() { - for { - <-c - l.Rotate() - } -}() -``` - -### func (\*Logger) Write -``` go -func (l *Logger) Write(p []byte) (n int, err error) -``` -Write implements io.Writer. If a write would cause the log file to be larger -than MaxSize, the file is closed, renamed to include a timestamp of the -current time, and a new log file is created using the original log file name. -If the length of the write is greater than MaxSize, an error is returned. - - - - - - - - - -- - - -Generated by [godoc2md](http://godoc.org/github.com/davecheney/godoc2md) diff --git a/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/chown.go b/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/chown.go deleted file mode 100644 index 11d066972..000000000 --- a/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/chown.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build !linux - -package lumberjack - -import ( - "os" -) - -func chown(_ string, _ os.FileInfo) error { - return nil -} diff --git a/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/chown_linux.go b/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/chown_linux.go deleted file mode 100644 index 465f56927..000000000 --- a/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/chown_linux.go +++ /dev/null @@ -1,19 +0,0 @@ -package lumberjack - -import ( - "os" - "syscall" -) - -// osChown is a var so we can mock it out during tests. -var osChown = os.Chown - -func chown(name string, info os.FileInfo) error { - f, err := os.OpenFile(name, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, info.Mode()) - if err != nil { - return err - } - f.Close() - stat := info.Sys().(*syscall.Stat_t) - return osChown(name, int(stat.Uid), int(stat.Gid)) -} diff --git a/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/lumberjack.go b/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/lumberjack.go deleted file mode 100644 index 3447cdc05..000000000 --- a/e2e/vendor/gopkg.in/natefinch/lumberjack.v2/lumberjack.go +++ /dev/null @@ -1,541 +0,0 @@ -// Package lumberjack provides a rolling logger. -// -// Note that this is v2.0 of lumberjack, and should be imported using gopkg.in -// thusly: -// -// import "gopkg.in/natefinch/lumberjack.v2" -// -// The package name remains simply lumberjack, and the code resides at -// https://github.com/natefinch/lumberjack under the v2.0 branch. -// -// Lumberjack is intended to be one part of a logging infrastructure. -// It is not an all-in-one solution, but instead is a pluggable -// component at the bottom of the logging stack that simply controls the files -// to which logs are written. -// -// Lumberjack plays well with any logging package that can write to an -// io.Writer, including the standard library's log package. -// -// Lumberjack assumes that only one process is writing to the output files. -// Using the same lumberjack configuration from multiple processes on the same -// machine will result in improper behavior. -package lumberjack - -import ( - "compress/gzip" - "errors" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "sort" - "strings" - "sync" - "time" -) - -const ( - backupTimeFormat = "2006-01-02T15-04-05.000" - compressSuffix = ".gz" - defaultMaxSize = 100 -) - -// ensure we always implement io.WriteCloser -var _ io.WriteCloser = (*Logger)(nil) - -// Logger is an io.WriteCloser that writes to the specified filename. -// -// Logger opens or creates the logfile on first Write. If the file exists and -// is less than MaxSize megabytes, lumberjack will open and append to that file. -// If the file exists and its size is >= MaxSize megabytes, the file is renamed -// by putting the current time in a timestamp in the name immediately before the -// file's extension (or the end of the filename if there's no extension). A new -// log file is then created using original filename. -// -// Whenever a write would cause the current log file exceed MaxSize megabytes, -// the current file is closed, renamed, and a new log file created with the -// original name. Thus, the filename you give Logger is always the "current" log -// file. -// -// Backups use the log file name given to Logger, in the form -// `name-timestamp.ext` where name is the filename without the extension, -// timestamp is the time at which the log was rotated formatted with the -// time.Time format of `2006-01-02T15-04-05.000` and the extension is the -// original extension. For example, if your Logger.Filename is -// `/var/log/foo/server.log`, a backup created at 6:30pm on Nov 11 2016 would -// use the filename `/var/log/foo/server-2016-11-04T18-30-00.000.log` -// -// Cleaning Up Old Log Files -// -// Whenever a new logfile gets created, old log files may be deleted. The most -// recent files according to the encoded timestamp will be retained, up to a -// number equal to MaxBackups (or all of them if MaxBackups is 0). Any files -// with an encoded timestamp older than MaxAge days are deleted, regardless of -// MaxBackups. Note that the time encoded in the timestamp is the rotation -// time, which may differ from the last time that file was written to. -// -// If MaxBackups and MaxAge are both 0, no old log files will be deleted. -type Logger struct { - // Filename is the file to write logs to. Backup log files will be retained - // in the same directory. It uses -lumberjack.log in - // os.TempDir() if empty. - Filename string `json:"filename" yaml:"filename"` - - // MaxSize is the maximum size in megabytes of the log file before it gets - // rotated. It defaults to 100 megabytes. - MaxSize int `json:"maxsize" yaml:"maxsize"` - - // MaxAge is the maximum number of days to retain old log files based on the - // timestamp encoded in their filename. Note that a day is defined as 24 - // hours and may not exactly correspond to calendar days due to daylight - // savings, leap seconds, etc. The default is not to remove old log files - // based on age. - MaxAge int `json:"maxage" yaml:"maxage"` - - // MaxBackups is the maximum number of old log files to retain. The default - // is to retain all old log files (though MaxAge may still cause them to get - // deleted.) - MaxBackups int `json:"maxbackups" yaml:"maxbackups"` - - // LocalTime determines if the time used for formatting the timestamps in - // backup files is the computer's local time. The default is to use UTC - // time. - LocalTime bool `json:"localtime" yaml:"localtime"` - - // Compress determines if the rotated log files should be compressed - // using gzip. The default is not to perform compression. - Compress bool `json:"compress" yaml:"compress"` - - size int64 - file *os.File - mu sync.Mutex - - millCh chan bool - startMill sync.Once -} - -var ( - // currentTime exists so it can be mocked out by tests. - currentTime = time.Now - - // os_Stat exists so it can be mocked out by tests. - osStat = os.Stat - - // megabyte is the conversion factor between MaxSize and bytes. It is a - // variable so tests can mock it out and not need to write megabytes of data - // to disk. - megabyte = 1024 * 1024 -) - -// Write implements io.Writer. If a write would cause the log file to be larger -// than MaxSize, the file is closed, renamed to include a timestamp of the -// current time, and a new log file is created using the original log file name. -// If the length of the write is greater than MaxSize, an error is returned. -func (l *Logger) Write(p []byte) (n int, err error) { - l.mu.Lock() - defer l.mu.Unlock() - - writeLen := int64(len(p)) - if writeLen > l.max() { - return 0, fmt.Errorf( - "write length %d exceeds maximum file size %d", writeLen, l.max(), - ) - } - - if l.file == nil { - if err = l.openExistingOrNew(len(p)); err != nil { - return 0, err - } - } - - if l.size+writeLen > l.max() { - if err := l.rotate(); err != nil { - return 0, err - } - } - - n, err = l.file.Write(p) - l.size += int64(n) - - return n, err -} - -// Close implements io.Closer, and closes the current logfile. -func (l *Logger) Close() error { - l.mu.Lock() - defer l.mu.Unlock() - return l.close() -} - -// close closes the file if it is open. -func (l *Logger) close() error { - if l.file == nil { - return nil - } - err := l.file.Close() - l.file = nil - return err -} - -// Rotate causes Logger to close the existing log file and immediately create a -// new one. This is a helper function for applications that want to initiate -// rotations outside of the normal rotation rules, such as in response to -// SIGHUP. After rotating, this initiates compression and removal of old log -// files according to the configuration. -func (l *Logger) Rotate() error { - l.mu.Lock() - defer l.mu.Unlock() - return l.rotate() -} - -// rotate closes the current file, moves it aside with a timestamp in the name, -// (if it exists), opens a new file with the original filename, and then runs -// post-rotation processing and removal. -func (l *Logger) rotate() error { - if err := l.close(); err != nil { - return err - } - if err := l.openNew(); err != nil { - return err - } - l.mill() - return nil -} - -// openNew opens a new log file for writing, moving any old log file out of the -// way. This methods assumes the file has already been closed. -func (l *Logger) openNew() error { - err := os.MkdirAll(l.dir(), 0755) - if err != nil { - return fmt.Errorf("can't make directories for new logfile: %s", err) - } - - name := l.filename() - mode := os.FileMode(0600) - info, err := osStat(name) - if err == nil { - // Copy the mode off the old logfile. - mode = info.Mode() - // move the existing file - newname := backupName(name, l.LocalTime) - if err := os.Rename(name, newname); err != nil { - return fmt.Errorf("can't rename log file: %s", err) - } - - // this is a no-op anywhere but linux - if err := chown(name, info); err != nil { - return err - } - } - - // we use truncate here because this should only get called when we've moved - // the file ourselves. if someone else creates the file in the meantime, - // just wipe out the contents. - f, err := os.OpenFile(name, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, mode) - if err != nil { - return fmt.Errorf("can't open new logfile: %s", err) - } - l.file = f - l.size = 0 - return nil -} - -// backupName creates a new filename from the given name, inserting a timestamp -// between the filename and the extension, using the local time if requested -// (otherwise UTC). -func backupName(name string, local bool) string { - dir := filepath.Dir(name) - filename := filepath.Base(name) - ext := filepath.Ext(filename) - prefix := filename[:len(filename)-len(ext)] - t := currentTime() - if !local { - t = t.UTC() - } - - timestamp := t.Format(backupTimeFormat) - return filepath.Join(dir, fmt.Sprintf("%s-%s%s", prefix, timestamp, ext)) -} - -// openExistingOrNew opens the logfile if it exists and if the current write -// would not put it over MaxSize. If there is no such file or the write would -// put it over the MaxSize, a new file is created. -func (l *Logger) openExistingOrNew(writeLen int) error { - l.mill() - - filename := l.filename() - info, err := osStat(filename) - if os.IsNotExist(err) { - return l.openNew() - } - if err != nil { - return fmt.Errorf("error getting log file info: %s", err) - } - - if info.Size()+int64(writeLen) >= l.max() { - return l.rotate() - } - - file, err := os.OpenFile(filename, os.O_APPEND|os.O_WRONLY, 0644) - if err != nil { - // if we fail to open the old log file for some reason, just ignore - // it and open a new log file. - return l.openNew() - } - l.file = file - l.size = info.Size() - return nil -} - -// filename generates the name of the logfile from the current time. -func (l *Logger) filename() string { - if l.Filename != "" { - return l.Filename - } - name := filepath.Base(os.Args[0]) + "-lumberjack.log" - return filepath.Join(os.TempDir(), name) -} - -// millRunOnce performs compression and removal of stale log files. -// Log files are compressed if enabled via configuration and old log -// files are removed, keeping at most l.MaxBackups files, as long as -// none of them are older than MaxAge. -func (l *Logger) millRunOnce() error { - if l.MaxBackups == 0 && l.MaxAge == 0 && !l.Compress { - return nil - } - - files, err := l.oldLogFiles() - if err != nil { - return err - } - - var compress, remove []logInfo - - if l.MaxBackups > 0 && l.MaxBackups < len(files) { - preserved := make(map[string]bool) - var remaining []logInfo - for _, f := range files { - // Only count the uncompressed log file or the - // compressed log file, not both. - fn := f.Name() - if strings.HasSuffix(fn, compressSuffix) { - fn = fn[:len(fn)-len(compressSuffix)] - } - preserved[fn] = true - - if len(preserved) > l.MaxBackups { - remove = append(remove, f) - } else { - remaining = append(remaining, f) - } - } - files = remaining - } - if l.MaxAge > 0 { - diff := time.Duration(int64(24*time.Hour) * int64(l.MaxAge)) - cutoff := currentTime().Add(-1 * diff) - - var remaining []logInfo - for _, f := range files { - if f.timestamp.Before(cutoff) { - remove = append(remove, f) - } else { - remaining = append(remaining, f) - } - } - files = remaining - } - - if l.Compress { - for _, f := range files { - if !strings.HasSuffix(f.Name(), compressSuffix) { - compress = append(compress, f) - } - } - } - - for _, f := range remove { - errRemove := os.Remove(filepath.Join(l.dir(), f.Name())) - if err == nil && errRemove != nil { - err = errRemove - } - } - for _, f := range compress { - fn := filepath.Join(l.dir(), f.Name()) - errCompress := compressLogFile(fn, fn+compressSuffix) - if err == nil && errCompress != nil { - err = errCompress - } - } - - return err -} - -// millRun runs in a goroutine to manage post-rotation compression and removal -// of old log files. -func (l *Logger) millRun() { - for range l.millCh { - // what am I going to do, log this? - _ = l.millRunOnce() - } -} - -// mill performs post-rotation compression and removal of stale log files, -// starting the mill goroutine if necessary. -func (l *Logger) mill() { - l.startMill.Do(func() { - l.millCh = make(chan bool, 1) - go l.millRun() - }) - select { - case l.millCh <- true: - default: - } -} - -// oldLogFiles returns the list of backup log files stored in the same -// directory as the current log file, sorted by ModTime -func (l *Logger) oldLogFiles() ([]logInfo, error) { - files, err := ioutil.ReadDir(l.dir()) - if err != nil { - return nil, fmt.Errorf("can't read log file directory: %s", err) - } - logFiles := []logInfo{} - - prefix, ext := l.prefixAndExt() - - for _, f := range files { - if f.IsDir() { - continue - } - if t, err := l.timeFromName(f.Name(), prefix, ext); err == nil { - logFiles = append(logFiles, logInfo{t, f}) - continue - } - if t, err := l.timeFromName(f.Name(), prefix, ext+compressSuffix); err == nil { - logFiles = append(logFiles, logInfo{t, f}) - continue - } - // error parsing means that the suffix at the end was not generated - // by lumberjack, and therefore it's not a backup file. - } - - sort.Sort(byFormatTime(logFiles)) - - return logFiles, nil -} - -// timeFromName extracts the formatted time from the filename by stripping off -// the filename's prefix and extension. This prevents someone's filename from -// confusing time.parse. -func (l *Logger) timeFromName(filename, prefix, ext string) (time.Time, error) { - if !strings.HasPrefix(filename, prefix) { - return time.Time{}, errors.New("mismatched prefix") - } - if !strings.HasSuffix(filename, ext) { - return time.Time{}, errors.New("mismatched extension") - } - ts := filename[len(prefix) : len(filename)-len(ext)] - return time.Parse(backupTimeFormat, ts) -} - -// max returns the maximum size in bytes of log files before rolling. -func (l *Logger) max() int64 { - if l.MaxSize == 0 { - return int64(defaultMaxSize * megabyte) - } - return int64(l.MaxSize) * int64(megabyte) -} - -// dir returns the directory for the current filename. -func (l *Logger) dir() string { - return filepath.Dir(l.filename()) -} - -// prefixAndExt returns the filename part and extension part from the Logger's -// filename. -func (l *Logger) prefixAndExt() (prefix, ext string) { - filename := filepath.Base(l.filename()) - ext = filepath.Ext(filename) - prefix = filename[:len(filename)-len(ext)] + "-" - return prefix, ext -} - -// compressLogFile compresses the given log file, removing the -// uncompressed log file if successful. -func compressLogFile(src, dst string) (err error) { - f, err := os.Open(src) - if err != nil { - return fmt.Errorf("failed to open log file: %v", err) - } - defer f.Close() - - fi, err := osStat(src) - if err != nil { - return fmt.Errorf("failed to stat log file: %v", err) - } - - if err := chown(dst, fi); err != nil { - return fmt.Errorf("failed to chown compressed log file: %v", err) - } - - // If this file already exists, we presume it was created by - // a previous attempt to compress the log file. - gzf, err := os.OpenFile(dst, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, fi.Mode()) - if err != nil { - return fmt.Errorf("failed to open compressed log file: %v", err) - } - defer gzf.Close() - - gz := gzip.NewWriter(gzf) - - defer func() { - if err != nil { - os.Remove(dst) - err = fmt.Errorf("failed to compress log file: %v", err) - } - }() - - if _, err := io.Copy(gz, f); err != nil { - return err - } - if err := gz.Close(); err != nil { - return err - } - if err := gzf.Close(); err != nil { - return err - } - - if err := f.Close(); err != nil { - return err - } - if err := os.Remove(src); err != nil { - return err - } - - return nil -} - -// logInfo is a convenience struct to return the filename and its embedded -// timestamp. -type logInfo struct { - timestamp time.Time - os.FileInfo -} - -// byFormatTime sorts by newest time formatted in the name. -type byFormatTime []logInfo - -func (b byFormatTime) Less(i, j int) bool { - return b[i].timestamp.After(b[j].timestamp) -} - -func (b byFormatTime) Swap(i, j int) { - b[i], b[j] = b[j], b[i] -} - -func (b byFormatTime) Len() int { - return len(b) -} diff --git a/e2e/vendor/k8s.io/api/admission/v1/doc.go b/e2e/vendor/k8s.io/api/admission/v1/doc.go index e7df9f629..cab652821 100644 --- a/e2e/vendor/k8s.io/api/admission/v1/doc.go +++ b/e2e/vendor/k8s.io/api/admission/v1/doc.go @@ -20,4 +20,4 @@ limitations under the License. // +k8s:prerelease-lifecycle-gen=true // +groupName=admission.k8s.io -package v1 // import "k8s.io/api/admission/v1" +package v1 diff --git a/e2e/vendor/k8s.io/api/admission/v1beta1/doc.go b/e2e/vendor/k8s.io/api/admission/v1beta1/doc.go index a5669022a..447495684 100644 --- a/e2e/vendor/k8s.io/api/admission/v1beta1/doc.go +++ b/e2e/vendor/k8s.io/api/admission/v1beta1/doc.go @@ -21,4 +21,4 @@ limitations under the License. // +groupName=admission.k8s.io -package v1beta1 // import "k8s.io/api/admission/v1beta1" +package v1beta1 diff --git a/e2e/vendor/k8s.io/api/admissionregistration/v1/doc.go b/e2e/vendor/k8s.io/api/admissionregistration/v1/doc.go index ca0086188..ec0ebb9c4 100644 --- a/e2e/vendor/k8s.io/api/admissionregistration/v1/doc.go +++ b/e2e/vendor/k8s.io/api/admissionregistration/v1/doc.go @@ -24,4 +24,4 @@ limitations under the License. // AdmissionConfiguration and AdmissionPluginConfiguration are legacy static admission plugin configuration // MutatingWebhookConfiguration and ValidatingWebhookConfiguration are for the // new dynamic admission controller configuration. -package v1 // import "k8s.io/api/admissionregistration/v1" +package v1 diff --git a/e2e/vendor/k8s.io/api/admissionregistration/v1alpha1/doc.go b/e2e/vendor/k8s.io/api/admissionregistration/v1alpha1/doc.go index 98066211d..344af9ae0 100644 --- a/e2e/vendor/k8s.io/api/admissionregistration/v1alpha1/doc.go +++ b/e2e/vendor/k8s.io/api/admissionregistration/v1alpha1/doc.go @@ -21,4 +21,4 @@ limitations under the License. // +groupName=admissionregistration.k8s.io // Package v1alpha1 is the v1alpha1 version of the API. -package v1alpha1 // import "k8s.io/api/admissionregistration/v1alpha1" +package v1alpha1 diff --git a/e2e/vendor/k8s.io/api/admissionregistration/v1alpha1/generated.proto b/e2e/vendor/k8s.io/api/admissionregistration/v1alpha1/generated.proto index 88344ce87..d23f21cc8 100644 --- a/e2e/vendor/k8s.io/api/admissionregistration/v1alpha1/generated.proto +++ b/e2e/vendor/k8s.io/api/admissionregistration/v1alpha1/generated.proto @@ -272,9 +272,9 @@ message MatchResources { // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 1; - // ObjectSelector decides whether to run the validation based on if the + // ObjectSelector decides whether to run the policy based on if the // object has matching labels. objectSelector is evaluated against both - // the oldObject and newObject that would be sent to the cel validation, and + // the oldObject and newObject that would be sent to the policy's expression (CEL), and // is considered to match if either object matches the selector. A null // object (oldObject in the case of create, or newObject in the case of // delete) or an object that cannot have labels (like a @@ -286,13 +286,13 @@ message MatchResources { // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 2; - // ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. + // ResourceRules describes what operations on what resources/subresources the admission policy matches. // The policy cares about an operation if it matches _any_ Rule. // +listType=atomic // +optional repeated NamedRuleWithOperations resourceRules = 3; - // ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about. + // ExcludeResourceRules describes what operations on what resources/subresources the policy should not care about. // The exclude rules take precedence over include rules (if a resource matches both, it is excluded) // +listType=atomic // +optional @@ -304,12 +304,13 @@ message MatchResources { // - Exact: match a request only if it exactly matches a specified rule. // For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, // but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, - // a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy. + // the admission policy does not consider requests to apps/v1beta1 or extensions/v1beta1 API groups. // // - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. // For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, // and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, - // a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy. + // the admission policy **does** consider requests made to apps/v1beta1 or extensions/v1beta1 + // API groups. The API server translates the request to a matched resource API if necessary. // // Defaults to "Equivalent" // +optional diff --git a/e2e/vendor/k8s.io/api/admissionregistration/v1alpha1/types.go b/e2e/vendor/k8s.io/api/admissionregistration/v1alpha1/types.go index ee50fbe2d..f183498a5 100644 --- a/e2e/vendor/k8s.io/api/admissionregistration/v1alpha1/types.go +++ b/e2e/vendor/k8s.io/api/admissionregistration/v1alpha1/types.go @@ -56,9 +56,9 @@ const ( type FailurePolicyType string const ( - // Ignore means that an error calling the webhook is ignored. + // Ignore means that an error calling the admission webhook or admission policy is ignored. Ignore FailurePolicyType = "Ignore" - // Fail means that an error calling the webhook causes the admission to fail. + // Fail means that an error calling the admission webhook or admission policy causes resource admission to fail. Fail FailurePolicyType = "Fail" ) @@ -67,9 +67,11 @@ const ( type MatchPolicyType string const ( - // Exact means requests should only be sent to the webhook if they exactly match a given rule. + // Exact means requests should only be sent to the admission webhook or admission policy if they exactly match a given rule. Exact MatchPolicyType = "Exact" - // Equivalent means requests should be sent to the webhook if they modify a resource listed in rules via another API group or version. + // Equivalent means requests should be sent to the admission webhook or admission policy if they modify a resource listed + // in rules via an equivalent API group or version. For example, `autoscaling/v1` and `autoscaling/v2` + // HorizontalPodAutoscalers are equivalent: the same set of resources appear via both APIs. Equivalent MatchPolicyType = "Equivalent" ) @@ -577,9 +579,9 @@ type MatchResources struct { // Default to the empty LabelSelector, which matches everything. // +optional NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty" protobuf:"bytes,1,opt,name=namespaceSelector"` - // ObjectSelector decides whether to run the validation based on if the + // ObjectSelector decides whether to run the policy based on if the // object has matching labels. objectSelector is evaluated against both - // the oldObject and newObject that would be sent to the cel validation, and + // the oldObject and newObject that would be sent to the policy's expression (CEL), and // is considered to match if either object matches the selector. A null // object (oldObject in the case of create, or newObject in the case of // delete) or an object that cannot have labels (like a @@ -590,12 +592,12 @@ type MatchResources struct { // Default to the empty LabelSelector, which matches everything. // +optional ObjectSelector *metav1.LabelSelector `json:"objectSelector,omitempty" protobuf:"bytes,2,opt,name=objectSelector"` - // ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. + // ResourceRules describes what operations on what resources/subresources the admission policy matches. // The policy cares about an operation if it matches _any_ Rule. // +listType=atomic // +optional ResourceRules []NamedRuleWithOperations `json:"resourceRules,omitempty" protobuf:"bytes,3,rep,name=resourceRules"` - // ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about. + // ExcludeResourceRules describes what operations on what resources/subresources the policy should not care about. // The exclude rules take precedence over include rules (if a resource matches both, it is excluded) // +listType=atomic // +optional @@ -606,12 +608,13 @@ type MatchResources struct { // - Exact: match a request only if it exactly matches a specified rule. // For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, // but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, - // a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy. + // the admission policy does not consider requests to apps/v1beta1 or extensions/v1beta1 API groups. // // - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. // For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, // and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, - // a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy. + // the admission policy **does** consider requests made to apps/v1beta1 or extensions/v1beta1 + // API groups. The API server translates the request to a matched resource API if necessary. // // Defaults to "Equivalent" // +optional diff --git a/e2e/vendor/k8s.io/api/admissionregistration/v1alpha1/types_swagger_doc_generated.go b/e2e/vendor/k8s.io/api/admissionregistration/v1alpha1/types_swagger_doc_generated.go index 32222a81b..116e56e06 100644 --- a/e2e/vendor/k8s.io/api/admissionregistration/v1alpha1/types_swagger_doc_generated.go +++ b/e2e/vendor/k8s.io/api/admissionregistration/v1alpha1/types_swagger_doc_generated.go @@ -68,10 +68,10 @@ func (JSONPatch) SwaggerDoc() map[string]string { var map_MatchResources = map[string]string{ "": "MatchResources decides whether to run the admission control policy on an object based on whether it meets the match criteria. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)", "namespaceSelector": "NamespaceSelector decides whether to run the admission control policy on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the policy.\n\nFor example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"runlevel\",\n \"operator\": \"NotIn\",\n \"values\": [\n \"0\",\n \"1\"\n ]\n }\n ]\n}\n\nIf instead you want to only run the policy on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"environment\",\n \"operator\": \"In\",\n \"values\": [\n \"prod\",\n \"staging\"\n ]\n }\n ]\n}\n\nSee https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.\n\nDefault to the empty LabelSelector, which matches everything.", - "objectSelector": "ObjectSelector decides whether to run the validation based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the cel validation, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.", - "resourceRules": "ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.", - "excludeResourceRules": "ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)", - "matchPolicy": "matchPolicy defines how the \"MatchResources\" list is used to match incoming requests. Allowed values are \"Exact\" or \"Equivalent\".\n\n- Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy.\n\n- Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy.\n\nDefaults to \"Equivalent\"", + "objectSelector": "ObjectSelector decides whether to run the policy based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the policy's expression (CEL), and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.", + "resourceRules": "ResourceRules describes what operations on what resources/subresources the admission policy matches. The policy cares about an operation if it matches _any_ Rule.", + "excludeResourceRules": "ExcludeResourceRules describes what operations on what resources/subresources the policy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)", + "matchPolicy": "matchPolicy defines how the \"MatchResources\" list is used to match incoming requests. Allowed values are \"Exact\" or \"Equivalent\".\n\n- Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, the admission policy does not consider requests to apps/v1beta1 or extensions/v1beta1 API groups.\n\n- Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, the admission policy **does** consider requests made to apps/v1beta1 or extensions/v1beta1 API groups. The API server translates the request to a matched resource API if necessary.\n\nDefaults to \"Equivalent\"", } func (MatchResources) SwaggerDoc() map[string]string { diff --git a/e2e/vendor/k8s.io/api/admissionregistration/v1beta1/doc.go b/e2e/vendor/k8s.io/api/admissionregistration/v1beta1/doc.go index 0095cb257..40d831573 100644 --- a/e2e/vendor/k8s.io/api/admissionregistration/v1beta1/doc.go +++ b/e2e/vendor/k8s.io/api/admissionregistration/v1beta1/doc.go @@ -24,4 +24,4 @@ limitations under the License. // AdmissionConfiguration and AdmissionPluginConfiguration are legacy static admission plugin configuration // MutatingWebhookConfiguration and ValidatingWebhookConfiguration are for the // new dynamic admission controller configuration. -package v1beta1 // import "k8s.io/api/admissionregistration/v1beta1" +package v1beta1 diff --git a/e2e/vendor/k8s.io/api/apidiscovery/v2/doc.go b/e2e/vendor/k8s.io/api/apidiscovery/v2/doc.go index 4f3ad5f13..f46d33e94 100644 --- a/e2e/vendor/k8s.io/api/apidiscovery/v2/doc.go +++ b/e2e/vendor/k8s.io/api/apidiscovery/v2/doc.go @@ -20,4 +20,4 @@ limitations under the License. // +k8s:prerelease-lifecycle-gen=true // +groupName=apidiscovery.k8s.io -package v2 // import "k8s.io/api/apidiscovery/v2" +package v2 diff --git a/e2e/vendor/k8s.io/api/apidiscovery/v2beta1/doc.go b/e2e/vendor/k8s.io/api/apidiscovery/v2beta1/doc.go index e85da226e..d4fceab68 100644 --- a/e2e/vendor/k8s.io/api/apidiscovery/v2beta1/doc.go +++ b/e2e/vendor/k8s.io/api/apidiscovery/v2beta1/doc.go @@ -21,4 +21,4 @@ limitations under the License. // +groupName=apidiscovery.k8s.io -package v2beta1 // import "k8s.io/api/apidiscovery/v2beta1" +package v2beta1 diff --git a/e2e/vendor/k8s.io/api/apiserverinternal/v1alpha1/doc.go b/e2e/vendor/k8s.io/api/apiserverinternal/v1alpha1/doc.go index a4da95d44..867d74165 100644 --- a/e2e/vendor/k8s.io/api/apiserverinternal/v1alpha1/doc.go +++ b/e2e/vendor/k8s.io/api/apiserverinternal/v1alpha1/doc.go @@ -22,4 +22,4 @@ limitations under the License. // Package v1alpha1 contains the v1alpha1 version of the API used by the // apiservers themselves. -package v1alpha1 // import "k8s.io/api/apiserverinternal/v1alpha1" +package v1alpha1 diff --git a/e2e/vendor/k8s.io/api/apps/v1/doc.go b/e2e/vendor/k8s.io/api/apps/v1/doc.go index d189e860f..51fe12c53 100644 --- a/e2e/vendor/k8s.io/api/apps/v1/doc.go +++ b/e2e/vendor/k8s.io/api/apps/v1/doc.go @@ -19,4 +19,4 @@ limitations under the License. // +k8s:openapi-gen=true // +k8s:prerelease-lifecycle-gen=true -package v1 // import "k8s.io/api/apps/v1" +package v1 diff --git a/e2e/vendor/k8s.io/api/apps/v1/generated.pb.go b/e2e/vendor/k8s.io/api/apps/v1/generated.pb.go index ea62a099f..eacc25931 100644 --- a/e2e/vendor/k8s.io/api/apps/v1/generated.pb.go +++ b/e2e/vendor/k8s.io/api/apps/v1/generated.pb.go @@ -928,145 +928,147 @@ func init() { } var fileDescriptor_5b781835628d5338 = []byte{ - // 2194 bytes of a gzipped FileDescriptorProto + // 2225 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5a, 0xcd, 0x6f, 0x1b, 0xc7, - 0x15, 0xd7, 0xf2, 0x43, 0xa2, 0x86, 0x96, 0x64, 0x8f, 0x54, 0x89, 0xb1, 0x1b, 0xd2, 0xdd, 0xb8, - 0xb6, 0x12, 0xc7, 0x64, 0xed, 0x38, 0x41, 0xe0, 0x14, 0x09, 0x44, 0x2a, 0x4d, 0xd3, 0xe8, 0xab, - 0x43, 0xcb, 0x01, 0xdc, 0xb4, 0xe8, 0x68, 0x39, 0xa6, 0x36, 0xde, 0x2f, 0xec, 0x0e, 0x15, 0x0b, - 0xbd, 0x14, 0x05, 0x7a, 0xeb, 0xa1, 0x7f, 0x43, 0xff, 0x81, 0xa2, 0x28, 0x9a, 0x5b, 0x10, 0x04, - 0xbd, 0xf8, 0x52, 0x20, 0xe8, 0xa5, 0x39, 0x11, 0x35, 0x73, 0x2a, 0x8a, 0xde, 0xda, 0x8b, 0x2f, - 0x2d, 0x66, 0x76, 0xf6, 0x7b, 0x56, 0xa4, 0xe4, 0x58, 0x69, 0x82, 0xdc, 0xb8, 0x33, 0xbf, 0xf7, - 0xdb, 0x37, 0x33, 0xef, 0xcd, 0xfb, 0xcd, 0x2c, 0x81, 0x7a, 0xff, 0x55, 0xaf, 0xa9, 0xdb, 0x2d, - 0xec, 0xe8, 0x2d, 0xec, 0x38, 0x5e, 0xeb, 0xe0, 0x7a, 0xab, 0x4f, 0x2c, 0xe2, 0x62, 0x4a, 0x7a, - 0x4d, 0xc7, 0xb5, 0xa9, 0x0d, 0xa1, 0x8f, 0x69, 0x62, 0x47, 0x6f, 0x32, 0x4c, 0xf3, 0xe0, 0xfa, - 0xf9, 0x6b, 0x7d, 0x9d, 0xee, 0x0f, 0xf6, 0x9a, 0x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 0x74, 0x8b, 0x04, - 0x03, 0xf0, 0xab, 0xde, 0x85, 0xd1, 0xb0, 0xb1, 0xb2, 0x23, 0x87, 0xa0, 0x3c, 0x5b, 0xf5, 0xa3, - 0x12, 0x38, 0x9b, 0xde, 0x11, 0x73, 0x84, 0x88, 0x72, 0x22, 0x21, 0xf2, 0x62, 0x2c, 0x44, 0x7d, - 0x95, 0x16, 0x3b, 0xf3, 0x67, 0xc2, 0x74, 0x0d, 0x2c, 0x08, 0xe1, 0x11, 0x74, 0x0a, 0x29, 0x16, - 0x2e, 0xcf, 0x6e, 0xb2, 0x1b, 0xa5, 0xf1, 0xf0, 0x35, 0x30, 0xe7, 0x72, 0x6d, 0x15, 0x10, 0xf8, - 0xfa, 0xe4, 0x5b, 0x82, 0x60, 0x0e, 0xc5, 0x3b, 0x51, 0x12, 0xcb, 0xb4, 0x49, 0x24, 0x39, 0x02, - 0x82, 0x52, 0x52, 0x9b, 0xac, 0xa5, 0x01, 0x28, 0x6b, 0x03, 0x37, 0xc1, 0xe2, 0xc0, 0xca, 0x52, - 0xf9, 0xb1, 0x76, 0x41, 0x50, 0x2d, 0xee, 0x66, 0x21, 0x48, 0x66, 0x07, 0x7f, 0x92, 0x90, 0x2b, - 0xd3, 0x7c, 0x17, 0xb9, 0x72, 0x74, 0x3a, 0x4c, 0xac, 0x57, 0x24, 0x3a, 0xaa, 0x32, 0xa9, 0x8e, - 0x52, 0x3f, 0x54, 0x00, 0xcc, 0xa6, 0xe0, 0xd8, 0xc3, 0x7d, 0xc6, 0x22, 0x56, 0x22, 0x7b, 0x72, - 0x85, 0x73, 0x75, 0xbc, 0xc2, 0x89, 0x76, 0xd0, 0xc9, 0x24, 0x8e, 0x98, 0xde, 0xd3, 0xb9, 0x98, - 0x99, 0x40, 0xe2, 0x44, 0xfe, 0x3c, 0x99, 0xc4, 0x89, 0xf1, 0x1c, 0x2d, 0x71, 0xfe, 0x59, 0x00, - 0x8b, 0x11, 0x78, 0x62, 0x89, 0x23, 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x65, 0x89, 0x17, 0xca, 0x70, 0x68, 0x5b, + 0x19, 0x0d, 0x24, 0xb1, 0x62, 0x43, 0xf3, 0xa3, 0x26, 0x33, 0xb4, 0xa9, 0xe4, 0xd0, 0x76, 0xa5, + 0x5a, 0x28, 0xc7, 0x9a, 0xc5, 0x9e, 0xef, 0xf2, 0xea, 0x01, 0xd6, 0x0d, 0xbc, 0x67, 0x90, 0xea, + 0x74, 0x32, 0xf6, 0x36, 0x93, 0x62, 0x94, 0xd6, 0x87, 0xef, 0x80, 0x73, 0x7e, 0xd3, 0xae, 0x85, + 0x43, 0x90, 0x32, 0x07, 0x79, 0x4e, 0x80, 0x9c, 0xdb, 0x4c, 0x2b, 0xa0, 0xac, 0x0d, 0xbc, 0x05, + 0xe6, 0x34, 0xdb, 0x30, 0x78, 0x3c, 0xb6, 0xed, 0xbe, 0x45, 0xab, 0x33, 0x1c, 0x05, 0xb2, 0x1c, + 0x6a, 0x27, 0x24, 0x28, 0xa5, 0x09, 0xef, 0x02, 0xa0, 0x05, 0xe5, 0xc0, 0xab, 0x82, 0xfc, 0x42, + 0x9f, 0xad, 0x43, 0x51, 0x01, 0x0e, 0x9b, 0x3c, 0x14, 0x43, 0x53, 0x3f, 0x51, 0xc0, 0x72, 0x4e, + 0x8e, 0xc3, 0xb7, 0x12, 0x55, 0xef, 0x6a, 0xaa, 0xea, 0x5d, 0xc8, 0x31, 0x8b, 0x95, 0x3e, 0x0d, + 0xcc, 0x32, 0xde, 0xa1, 0x5b, 0x3d, 0x5f, 0x45, 0xec, 0x60, 0x2f, 0xc9, 0x7c, 0x47, 0x71, 0xc5, + 0x68, 0x1b, 0x3e, 0x37, 0x1c, 0xd4, 0x67, 0x13, 0x32, 0x94, 0xc4, 0x54, 0x7f, 0x51, 0x00, 0x60, + 0x8d, 0x38, 0x86, 0x7d, 0x68, 0x12, 0xeb, 0x34, 0x58, 0xcb, 0x5a, 0x82, 0xb5, 0xa8, 0xd2, 0x85, + 0x08, 0xfd, 0x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x79, 0x5b, 0xae, 0x82, 0xf2, 0x6c, + 0xd5, 0x5f, 0x95, 0xc0, 0xd9, 0xf4, 0x8e, 0x98, 0x43, 0x44, 0x94, 0x13, 0x11, 0x91, 0x97, 0x63, + 0x21, 0xea, 0xb3, 0xb4, 0xd8, 0x99, 0x3f, 0x13, 0xa6, 0xab, 0x60, 0x5e, 0x10, 0x8f, 0x40, 0x28, + 0xa8, 0x58, 0xb8, 0x3c, 0xbb, 0x49, 0x31, 0x4a, 0xeb, 0xc3, 0x37, 0xc0, 0xac, 0xcb, 0xb9, 0x55, + 0x00, 0xe0, 0xf3, 0x93, 0x6f, 0x08, 0x80, 0x59, 0x14, 0x17, 0xa2, 0xa4, 0x2e, 0xe3, 0x26, 0x11, + 0xe5, 0x08, 0x00, 0x8a, 0x49, 0x6e, 0xb2, 0x9a, 0x56, 0x40, 0x59, 0x1b, 0xb8, 0x01, 0x16, 0xfa, + 0x56, 0x16, 0xca, 0x8f, 0xb5, 0x0b, 0x02, 0x6a, 0x61, 0x37, 0xab, 0x82, 0x64, 0x76, 0xf0, 0x36, + 0x58, 0xa0, 0xc4, 0x35, 0x75, 0x0b, 0x53, 0xdd, 0xea, 0x85, 0x70, 0xfe, 0xca, 0x2f, 0x33, 0xa8, + 0x9d, 0xac, 0x18, 0xc9, 0x6c, 0xe0, 0x8f, 0x12, 0xcc, 0x67, 0x8a, 0x6f, 0x48, 0x57, 0x8e, 0xce, + 0xac, 0xb1, 0xa9, 0x8f, 0x84, 0x92, 0x95, 0xc7, 0xa5, 0x64, 0xea, 0xc7, 0x0a, 0x80, 0xd9, 0x6c, + 0x1e, 0x79, 0x4f, 0x90, 0xb1, 0x88, 0x55, 0xdb, 0xae, 0x9c, 0x2c, 0x5d, 0x1d, 0x4d, 0x96, 0xa2, + 0xcd, 0x78, 0x3c, 0xb6, 0x24, 0xa6, 0xf7, 0x74, 0xee, 0x78, 0xc6, 0x60, 0x4b, 0x91, 0x3f, 0x4f, + 0xc6, 0x96, 0x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 0xca, 0xc3, 0x61, 0x4d, 0xf9, 0x74, + 0x58, 0x53, 0x3e, 0x1b, 0xd6, 0x94, 0xbf, 0x0f, 0x6b, 0xca, 0xaf, 0x3f, 0xaf, 0x4d, 0xdc, 0x85, + 0xd9, 0xff, 0x8a, 0xfe, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x5f, 0x0a, 0xea, 0xf9, 0x40, 0x2a, 0x00, + 0x00, } func (m *ControllerRevision) Marshal() (dAtA []byte, err error) { @@ -1748,6 +1750,11 @@ func (m *DeploymentStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.TerminatingReplicas != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.TerminatingReplicas)) + i-- + dAtA[i] = 0x48 + } if m.CollisionCount != nil { i = encodeVarintGenerated(dAtA, i, uint64(*m.CollisionCount)) i-- @@ -2054,6 +2061,11 @@ func (m *ReplicaSetStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.TerminatingReplicas != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.TerminatingReplicas)) + i-- + dAtA[i] = 0x38 + } if len(m.Conditions) > 0 { for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { { @@ -2915,6 +2927,9 @@ func (m *DeploymentStatus) Size() (n int) { if m.CollisionCount != nil { n += 1 + sovGenerated(uint64(*m.CollisionCount)) } + if m.TerminatingReplicas != nil { + n += 1 + sovGenerated(uint64(*m.TerminatingReplicas)) + } return n } @@ -3020,6 +3035,9 @@ func (m *ReplicaSetStatus) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } + if m.TerminatingReplicas != nil { + n += 1 + sovGenerated(uint64(*m.TerminatingReplicas)) + } return n } @@ -3435,6 +3453,7 @@ func (this *DeploymentStatus) String() string { `Conditions:` + repeatedStringForConditions + `,`, `ReadyReplicas:` + fmt.Sprintf("%v", this.ReadyReplicas) + `,`, `CollisionCount:` + valueToStringGenerated(this.CollisionCount) + `,`, + `TerminatingReplicas:` + valueToStringGenerated(this.TerminatingReplicas) + `,`, `}`, }, "") return s @@ -3521,6 +3540,7 @@ func (this *ReplicaSetStatus) String() string { `ReadyReplicas:` + fmt.Sprintf("%v", this.ReadyReplicas) + `,`, `AvailableReplicas:` + fmt.Sprintf("%v", this.AvailableReplicas) + `,`, `Conditions:` + repeatedStringForConditions + `,`, + `TerminatingReplicas:` + valueToStringGenerated(this.TerminatingReplicas) + `,`, `}`, }, "") return s @@ -5941,6 +5961,26 @@ func (m *DeploymentStatus) Unmarshal(dAtA []byte) error { } } m.CollisionCount = &v + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TerminatingReplicas", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TerminatingReplicas = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -6873,6 +6913,26 @@ func (m *ReplicaSetStatus) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TerminatingReplicas", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TerminatingReplicas = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/e2e/vendor/k8s.io/api/apps/v1/generated.proto b/e2e/vendor/k8s.io/api/apps/v1/generated.proto index 388e638f4..38c8997e9 100644 --- a/e2e/vendor/k8s.io/api/apps/v1/generated.proto +++ b/e2e/vendor/k8s.io/api/apps/v1/generated.proto @@ -318,19 +318,19 @@ message DeploymentStatus { // +optional optional int64 observedGeneration = 1; - // Total number of non-terminated pods targeted by this deployment (their labels match the selector). + // Total number of non-terminating pods targeted by this deployment (their labels match the selector). // +optional optional int32 replicas = 2; - // Total number of non-terminated pods targeted by this deployment that have the desired template spec. + // Total number of non-terminating pods targeted by this deployment that have the desired template spec. // +optional optional int32 updatedReplicas = 3; - // readyReplicas is the number of pods targeted by this Deployment with a Ready Condition. + // Total number of non-terminating pods targeted by this Deployment with a Ready Condition. // +optional optional int32 readyReplicas = 7; - // Total number of available pods (ready for at least minReadySeconds) targeted by this deployment. + // Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment. // +optional optional int32 availableReplicas = 4; @@ -340,6 +340,13 @@ message DeploymentStatus { // +optional optional int32 unavailableReplicas = 5; + // Total number of terminating pods targeted by this deployment. Terminating pods have a non-null + // .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. + // + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. + // +optional + optional int32 terminatingReplicas = 9; + // Represents the latest available observations of a deployment's current state. // +patchMergeKey=type // +patchStrategy=merge @@ -421,16 +428,16 @@ message ReplicaSetList { optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; // List of ReplicaSets. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset repeated ReplicaSet items = 2; } // ReplicaSetSpec is the specification of a ReplicaSet. message ReplicaSetSpec { - // Replicas is the number of desired replicas. + // Replicas is the number of desired pods. // This is a pointer to distinguish between explicit zero and unspecified. // Defaults to 1. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset // +optional optional int32 replicas = 1; @@ -448,29 +455,36 @@ message ReplicaSetSpec { // Template is the object that describes the pod that will be created if // insufficient replicas are detected. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/#pod-template // +optional optional .k8s.io.api.core.v1.PodTemplateSpec template = 3; } // ReplicaSetStatus represents the current status of a ReplicaSet. message ReplicaSetStatus { - // Replicas is the most recently observed number of replicas. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller + // Replicas is the most recently observed number of non-terminating pods. + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset optional int32 replicas = 1; - // The number of pods that have labels matching the labels of the pod template of the replicaset. + // The number of non-terminating pods that have labels matching the labels of the pod template of the replicaset. // +optional optional int32 fullyLabeledReplicas = 2; - // readyReplicas is the number of pods targeted by this ReplicaSet with a Ready Condition. + // The number of non-terminating pods targeted by this ReplicaSet with a Ready Condition. // +optional optional int32 readyReplicas = 4; - // The number of available replicas (ready for at least minReadySeconds) for this replica set. + // The number of available non-terminating pods (ready for at least minReadySeconds) for this replica set. // +optional optional int32 availableReplicas = 5; + // The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp + // and have not yet reached the Failed or Succeeded .status.phase. + // + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. + // +optional + optional int32 terminatingReplicas = 7; + // ObservedGeneration reflects the generation of the most recently observed ReplicaSet. // +optional optional int64 observedGeneration = 3; @@ -702,6 +716,7 @@ message StatefulSetSpec { // the network identity of the set. Pods get DNS/hostnames that follow the // pattern: pod-specific-string.serviceName.default.svc.cluster.local // where "pod-specific-string" is managed by the StatefulSet controller. + // +optional optional string serviceName = 5; // podManagementPolicy controls how pods are created during initial scale up, diff --git a/e2e/vendor/k8s.io/api/apps/v1/types.go b/e2e/vendor/k8s.io/api/apps/v1/types.go index a68690b44..1362d875d 100644 --- a/e2e/vendor/k8s.io/api/apps/v1/types.go +++ b/e2e/vendor/k8s.io/api/apps/v1/types.go @@ -220,6 +220,7 @@ type StatefulSetSpec struct { // the network identity of the set. Pods get DNS/hostnames that follow the // pattern: pod-specific-string.serviceName.default.svc.cluster.local // where "pod-specific-string" is managed by the StatefulSet controller. + // +optional ServiceName string `json:"serviceName" protobuf:"bytes,5,opt,name=serviceName"` // podManagementPolicy controls how pods are created during initial scale up, @@ -486,19 +487,19 @@ type DeploymentStatus struct { // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"` - // Total number of non-terminated pods targeted by this deployment (their labels match the selector). + // Total number of non-terminating pods targeted by this deployment (their labels match the selector). // +optional Replicas int32 `json:"replicas,omitempty" protobuf:"varint,2,opt,name=replicas"` - // Total number of non-terminated pods targeted by this deployment that have the desired template spec. + // Total number of non-terminating pods targeted by this deployment that have the desired template spec. // +optional UpdatedReplicas int32 `json:"updatedReplicas,omitempty" protobuf:"varint,3,opt,name=updatedReplicas"` - // readyReplicas is the number of pods targeted by this Deployment with a Ready Condition. + // Total number of non-terminating pods targeted by this Deployment with a Ready Condition. // +optional ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,7,opt,name=readyReplicas"` - // Total number of available pods (ready for at least minReadySeconds) targeted by this deployment. + // Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment. // +optional AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,4,opt,name=availableReplicas"` @@ -508,6 +509,13 @@ type DeploymentStatus struct { // +optional UnavailableReplicas int32 `json:"unavailableReplicas,omitempty" protobuf:"varint,5,opt,name=unavailableReplicas"` + // Total number of terminating pods targeted by this deployment. Terminating pods have a non-null + // .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. + // + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. + // +optional + TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty" protobuf:"varint,9,opt,name=terminatingReplicas"` + // Represents the latest available observations of a deployment's current state. // +patchMergeKey=type // +patchStrategy=merge @@ -839,16 +847,16 @@ type ReplicaSetList struct { metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // List of ReplicaSets. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset Items []ReplicaSet `json:"items" protobuf:"bytes,2,rep,name=items"` } // ReplicaSetSpec is the specification of a ReplicaSet. type ReplicaSetSpec struct { - // Replicas is the number of desired replicas. + // Replicas is the number of desired pods. // This is a pointer to distinguish between explicit zero and unspecified. // Defaults to 1. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset // +optional Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"` @@ -866,29 +874,36 @@ type ReplicaSetSpec struct { // Template is the object that describes the pod that will be created if // insufficient replicas are detected. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/#pod-template // +optional Template v1.PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,3,opt,name=template"` } // ReplicaSetStatus represents the current status of a ReplicaSet. type ReplicaSetStatus struct { - // Replicas is the most recently observed number of replicas. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller + // Replicas is the most recently observed number of non-terminating pods. + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset Replicas int32 `json:"replicas" protobuf:"varint,1,opt,name=replicas"` - // The number of pods that have labels matching the labels of the pod template of the replicaset. + // The number of non-terminating pods that have labels matching the labels of the pod template of the replicaset. // +optional FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty" protobuf:"varint,2,opt,name=fullyLabeledReplicas"` - // readyReplicas is the number of pods targeted by this ReplicaSet with a Ready Condition. + // The number of non-terminating pods targeted by this ReplicaSet with a Ready Condition. // +optional ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,4,opt,name=readyReplicas"` - // The number of available replicas (ready for at least minReadySeconds) for this replica set. + // The number of available non-terminating pods (ready for at least minReadySeconds) for this replica set. // +optional AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,5,opt,name=availableReplicas"` + // The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp + // and have not yet reached the Failed or Succeeded .status.phase. + // + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. + // +optional + TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty" protobuf:"varint,7,opt,name=terminatingReplicas"` + // ObservedGeneration reflects the generation of the most recently observed ReplicaSet. // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,3,opt,name=observedGeneration"` diff --git a/e2e/vendor/k8s.io/api/apps/v1/types_swagger_doc_generated.go b/e2e/vendor/k8s.io/api/apps/v1/types_swagger_doc_generated.go index 341ecdadb..f44ba7bc3 100644 --- a/e2e/vendor/k8s.io/api/apps/v1/types_swagger_doc_generated.go +++ b/e2e/vendor/k8s.io/api/apps/v1/types_swagger_doc_generated.go @@ -177,11 +177,12 @@ func (DeploymentSpec) SwaggerDoc() map[string]string { var map_DeploymentStatus = map[string]string{ "": "DeploymentStatus is the most recently observed status of the Deployment.", "observedGeneration": "The generation observed by the deployment controller.", - "replicas": "Total number of non-terminated pods targeted by this deployment (their labels match the selector).", - "updatedReplicas": "Total number of non-terminated pods targeted by this deployment that have the desired template spec.", - "readyReplicas": "readyReplicas is the number of pods targeted by this Deployment with a Ready Condition.", - "availableReplicas": "Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.", + "replicas": "Total number of non-terminating pods targeted by this deployment (their labels match the selector).", + "updatedReplicas": "Total number of non-terminating pods targeted by this deployment that have the desired template spec.", + "readyReplicas": "Total number of non-terminating pods targeted by this Deployment with a Ready Condition.", + "availableReplicas": "Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment.", "unavailableReplicas": "Total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created.", + "terminatingReplicas": "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", "conditions": "Represents the latest available observations of a deployment's current state.", "collisionCount": "Count of hash collisions for the Deployment. The Deployment controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ReplicaSet.", } @@ -227,7 +228,7 @@ func (ReplicaSetCondition) SwaggerDoc() map[string]string { var map_ReplicaSetList = map[string]string{ "": "ReplicaSetList is a collection of ReplicaSets.", "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "items": "List of ReplicaSets. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller", + "items": "List of ReplicaSets. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset", } func (ReplicaSetList) SwaggerDoc() map[string]string { @@ -236,10 +237,10 @@ func (ReplicaSetList) SwaggerDoc() map[string]string { var map_ReplicaSetSpec = map[string]string{ "": "ReplicaSetSpec is the specification of a ReplicaSet.", - "replicas": "Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller", + "replicas": "Replicas is the number of desired pods. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset", "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)", "selector": "Selector is a label query over pods that should match the replica count. Label keys and values that must match in order to be controlled by this replica set. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors", - "template": "Template is the object that describes the pod that will be created if insufficient replicas are detected. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template", + "template": "Template is the object that describes the pod that will be created if insufficient replicas are detected. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/#pod-template", } func (ReplicaSetSpec) SwaggerDoc() map[string]string { @@ -248,10 +249,11 @@ func (ReplicaSetSpec) SwaggerDoc() map[string]string { var map_ReplicaSetStatus = map[string]string{ "": "ReplicaSetStatus represents the current status of a ReplicaSet.", - "replicas": "Replicas is the most recently observed number of replicas. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller", - "fullyLabeledReplicas": "The number of pods that have labels matching the labels of the pod template of the replicaset.", - "readyReplicas": "readyReplicas is the number of pods targeted by this ReplicaSet with a Ready Condition.", - "availableReplicas": "The number of available replicas (ready for at least minReadySeconds) for this replica set.", + "replicas": "Replicas is the most recently observed number of non-terminating pods. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset", + "fullyLabeledReplicas": "The number of non-terminating pods that have labels matching the labels of the pod template of the replicaset.", + "readyReplicas": "The number of non-terminating pods targeted by this ReplicaSet with a Ready Condition.", + "availableReplicas": "The number of available non-terminating pods (ready for at least minReadySeconds) for this replica set.", + "terminatingReplicas": "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", "observedGeneration": "ObservedGeneration reflects the generation of the most recently observed ReplicaSet.", "conditions": "Represents the latest available observations of a replica set's current state.", } diff --git a/e2e/vendor/k8s.io/api/apps/v1/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/api/apps/v1/zz_generated.deepcopy.go index 6912986ac..9e67658ba 100644 --- a/e2e/vendor/k8s.io/api/apps/v1/zz_generated.deepcopy.go +++ b/e2e/vendor/k8s.io/api/apps/v1/zz_generated.deepcopy.go @@ -363,6 +363,11 @@ func (in *DeploymentSpec) DeepCopy() *DeploymentSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DeploymentStatus) DeepCopyInto(out *DeploymentStatus) { *out = *in + if in.TerminatingReplicas != nil { + in, out := &in.TerminatingReplicas, &out.TerminatingReplicas + *out = new(int32) + **out = **in + } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions *out = make([]DeploymentCondition, len(*in)) @@ -517,6 +522,11 @@ func (in *ReplicaSetSpec) DeepCopy() *ReplicaSetSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ReplicaSetStatus) DeepCopyInto(out *ReplicaSetStatus) { *out = *in + if in.TerminatingReplicas != nil { + in, out := &in.TerminatingReplicas, &out.TerminatingReplicas + *out = new(int32) + **out = **in + } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions *out = make([]ReplicaSetCondition, len(*in)) diff --git a/e2e/vendor/k8s.io/api/apps/v1beta1/doc.go b/e2e/vendor/k8s.io/api/apps/v1beta1/doc.go index 38a358551..7770fab5d 100644 --- a/e2e/vendor/k8s.io/api/apps/v1beta1/doc.go +++ b/e2e/vendor/k8s.io/api/apps/v1beta1/doc.go @@ -19,4 +19,4 @@ limitations under the License. // +k8s:openapi-gen=true // +k8s:prerelease-lifecycle-gen=true -package v1beta1 // import "k8s.io/api/apps/v1beta1" +package v1beta1 diff --git a/e2e/vendor/k8s.io/api/apps/v1beta1/generated.pb.go b/e2e/vendor/k8s.io/api/apps/v1beta1/generated.pb.go index 76e755b4a..ae84aaf48 100644 --- a/e2e/vendor/k8s.io/api/apps/v1beta1/generated.pb.go +++ b/e2e/vendor/k8s.io/api/apps/v1beta1/generated.pb.go @@ -728,134 +728,135 @@ func init() { } var fileDescriptor_2747f709ac7c95e7 = []byte{ - // 2018 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0xcd, 0x6f, 0x1b, 0xc7,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0x8c, 0xa7, 0x1e, - 0x00, 0x00, + // 2041 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0xdd, 0x6f, 0x1b, 0xc7, + 0x11, 0xd7, 0x51, 0xa2, 0x44, 0x8d, 0x22, 0xca, 0x5e, 0xa9, 0x16, 0xa3, 0xb4, 0x92, 0x70, 0x31, + 0x62, 0x25, 0xb1, 0x8f, 0xb1, 0x92, 0x06, 0x89, 0xdd, 0xba, 0x10, 0x25, 0x37, 0x56, 0x20, 0x45, + 0xca, 0x4a, 0xb2, 0xd1, 0xf4, 0x03, 0x59, 0x91, 0x6b, 0xea, 0xa2, 0xfb, 0xc2, 0xdd, 0x52, 0x31, + 0xd1, 0x97, 0xfe, 0x01, 0x2d, 0xd2, 0xe7, 0xfe, 0x15, 0xed, 0x53, 0x8b, 0x16, 0x7d, 0x2d, 0xfc, + 0x18, 0xf4, 0xa5, 0x79, 0x22, 0x6a, 0xe6, 0xb5, 0x7d, 0x6b, 0x5f, 0x0c, 0x14, 0x28, 0x76, 0x6f, + 0xef, 0xfb, 0x4e, 0x3a, 0x16, 0xb0, 0x80, 0xe6, 0x8d, 0xb7, 0x33, 0xf3, 0x9b, 0xd9, 0xd9, 0x99, + 0xd9, 0x99, 0x25, 0xdc, 0x38, 0x7d, 0xcf, 0xd3, 0x74, 0xbb, 0x49, 0x1c, 0xbd, 0x49, 0x1c, 0xc7, + 0x6b, 0x9e, 0xdd, 0x3e, 0xa6, 0x8c, 0xdc, 0x6e, 0x76, 0xa9, 0x45, 0x5d, 0xc2, 0x68, 0x47, 0x73, + 0x5c, 0x9b, 0xd9, 0x68, 0xd1, 0x67, 0xd4, 0x88, 0xa3, 0x6b, 0x9c, 0x51, 0x93, 0x8c, 0x4b, 0xb7, + 0xba, 0x3a, 0x3b, 0xe9, 0x1d, 0x6b, 0x6d, 0xdb, 0x6c, 0x76, 0xed, 0xae, 0x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0x15, 0x21, 0xfe, 0x4e, 0x52, 0xf9, 0xf3, 0xc1, 0x4a, 0x4e, + 0x01, 0xd1, 0x42, 0xa4, 0xa4, 0x89, 0xe8, 0x33, 0xa8, 0x1b, 0xc4, 0x63, 0x47, 0x4e, 0x87, 0x30, + 0x7a, 0xa8, 0x9b, 0xb4, 0x31, 0x29, 0x76, 0xff, 0x46, 0xb9, 0x83, 0xe2, 0x12, 0xad, 0x6b, 0xd2, + 0x82, 0xfa, 0x4e, 0x02, 0x09, 0xa7, 0x90, 0xd1, 0x19, 0x20, 0xbe, 0x72, 0xe8, 0x12, 0xcb, 0xf3, + 0x77, 0xc5, 0xf5, 0x4d, 0x8d, 0xac, 0x6f, 0x49, 0xea, 0x43, 0x3b, 0x19, 0x34, 0x9c, 0xa3, 0x01, + 0xbd, 0x06, 0x93, 0x2e, 0x25, 0x9e, 0x6d, 0x35, 0x26, 0x84, 0xc7, 0xc2, 0xe3, 0xc2, 0x62, 0x15, + 0x4b, 0x2a, 0x7a, 0x1d, 0xa6, 0x4c, 0xea, 0x79, 0xa4, 0x4b, 0x1b, 0x55, 0xc1, 0x38, 0x27, 0x19, + 0xa7, 0x76, 0xfd, 0x65, 0x1c, 0xd0, 0xd5, 0x3f, 0x28, 0x50, 0x8f, 0x8e, 0xe9, 0x12, 0x72, 0xf5, + 0x41, 0x32, 0x57, 0x5f, 0x2d, 0x11, 0x9c, 0x05, 0x39, 0xfa, 0x8f, 0x0a, 0xa0, 0x88, 0x09, 0xdb, + 0x86, 0x71, 0x4c, 0xda, 0xa7, 0x68, 0x15, 0x26, 0x2c, 0x62, 0x06, 0x31, 0x19, 0x26, 0xc8, 0x47, + 0xc4, 0xa4, 0x58, 0x50, 0xd0, 0x17, 0x0a, 0xa0, 0x9e, 0x38, 0xcd, 0xce, 0x86, 0x65, 0xd9, 0x8c, + 0x70, 0x07, 0x07, 0x06, 0x6d, 0x96, 0x30, 0x28, 0xd0, 0xa5, 0x1d, 0x65, 0x50, 0xee, 0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x12, 0x60, 0x16, 0xc7, + 0x89, 0x38, 0xc9, 0x8b, 0x3e, 0x80, 0xab, 0xe4, 0x8c, 0xe8, 0x06, 0x39, 0x36, 0x68, 0x08, 0x30, + 0x21, 0x00, 0x5e, 0x96, 0x00, 0x57, 0x37, 0xd2, 0x0c, 0x38, 0x2b, 0x83, 0x76, 0x61, 0xbe, 0x67, + 0x65, 0xa1, 0xfc, 0x20, 0x7e, 0x45, 0x42, 0xcd, 0x1f, 0x65, 0x59, 0x70, 0x9e, 0x1c, 0xda, 0x86, + 0x79, 0x46, 0x5d, 0x53, 0xb7, 0x08, 0xd3, 0xad, 0x6e, 0x08, 0xe7, 0x9f, 0xfc, 0x22, 0x87, 0x3a, + 0xcc, 0x92, 0x71, 0x9e, 0x0c, 0xfa, 0x14, 0xa0, 0x1d, 0x34, 0x08, 0x5e, 0x63, 0x52, 0x54, 0xf4, + 0x9b, 0x25, 0xf2, 0x36, 0xec, 0x2a, 0xa2, 0x6a, 0x1a, 0x2e, 0x79, 0x38, 0x86, 0x89, 0xee, 0x40, + 0xbd, 0x6d, 0x1b, 0x86, 0x48, 0xa2, 0x4d, 0xbb, 0x67, 0x31, 0x91, 0x07, 0xd5, 0x16, 0xe2, 0x7d, + 0xc3, 0x66, 0x82, 0x82, 0x53, 0x9c, 0xea, 0x9f, 0x94, 0xf8, 0x8d, 0x15, 0x54, 0x06, 0x74, 0x27, + 0xd1, 0x45, 0xbd, 0x96, 0xea, 0xa2, 0xae, 0x65, 0x25, 0x62, 0x4d, 0x94, 0x0e, 0xb3, 0x3c, 0x8f, + 0x74, 0xab, 0xeb, 0xc7, 0x8e, 0xac, 0xae, 0x6f, 0x9d, 0x9b, 0x95, 0x21, 0x77, 0xec, 0x8e, 0xbd, + 0x2a, 0xc2, 0x27, 0x4e, 0xc4, 0x49, 0x64, 0xf5, 0x1e, 0xd4, 0x93, 0x29, 0x9d, 0x18, 0x0f, 0x94, + 0x0b, 0xc7, 0x83, 0xaf, 0x15, 0x58,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 0xd5, 0xb3, 0xe5, 0xb1, 0x5f, 0x0c, 0x97, + 0x95, 0xa7, 0xc3, 0x65, 0xe5, 0xcb, 0xe1, 0xb2, 0xf2, 0xd5, 0x70, 0x59, 0xf9, 0xfb, 0x70, 0x59, + 0xf9, 0xf5, 0xd7, 0xcb, 0x63, 0x9f, 0x2c, 0x16, 0xfc, 0xb1, 0xfd, 0xdf, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x40, 0xa4, 0x4b, 0xb9, 0xf2, 0x1e, 0x00, 0x00, } func (m *ControllerRevision) Marshal() (dAtA []byte, err error) { @@ -1289,6 +1290,11 @@ func (m *DeploymentStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.TerminatingReplicas != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.TerminatingReplicas)) + i-- + dAtA[i] = 0x48 + } if m.CollisionCount != nil { i = encodeVarintGenerated(dAtA, i, uint64(*m.CollisionCount)) i-- @@ -2225,6 +2231,9 @@ func (m *DeploymentStatus) Size() (n int) { if m.CollisionCount != nil { n += 1 + sovGenerated(uint64(*m.CollisionCount)) } + if m.TerminatingReplicas != nil { + n += 1 + sovGenerated(uint64(*m.TerminatingReplicas)) + } return n } @@ -2627,6 +2636,7 @@ func (this *DeploymentStatus) String() string { `Conditions:` + repeatedStringForConditions + `,`, `ReadyReplicas:` + fmt.Sprintf("%v", this.ReadyReplicas) + `,`, `CollisionCount:` + valueToStringGenerated(this.CollisionCount) + `,`, + `TerminatingReplicas:` + valueToStringGenerated(this.TerminatingReplicas) + `,`, `}`, }, "") return s @@ -4337,6 +4347,26 @@ func (m *DeploymentStatus) Unmarshal(dAtA []byte) error { } } m.CollisionCount = &v + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TerminatingReplicas", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TerminatingReplicas = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/e2e/vendor/k8s.io/api/apps/v1beta1/generated.proto b/e2e/vendor/k8s.io/api/apps/v1beta1/generated.proto index 46d7bfdf9..0601efc3c 100644 --- a/e2e/vendor/k8s.io/api/apps/v1beta1/generated.proto +++ b/e2e/vendor/k8s.io/api/apps/v1beta1/generated.proto @@ -179,33 +179,40 @@ message DeploymentSpec { // DeploymentStatus is the most recently observed status of the Deployment. message DeploymentStatus { - // observedGeneration is the generation observed by the deployment controller. + // The generation observed by the deployment controller. // +optional optional int64 observedGeneration = 1; - // replicas is the total number of non-terminated pods targeted by this deployment (their labels match the selector). + // Total number of non-terminating pods targeted by this deployment (their labels match the selector). // +optional optional int32 replicas = 2; - // updatedReplicas is the total number of non-terminated pods targeted by this deployment that have the desired template spec. + // Total number of non-terminating pods targeted by this deployment that have the desired template spec. // +optional optional int32 updatedReplicas = 3; - // readyReplicas is the number of pods targeted by this Deployment controller with a Ready Condition. + // Total number of non-terminating pods targeted by this Deployment with a Ready Condition. // +optional optional int32 readyReplicas = 7; - // Total number of available pods (ready for at least minReadySeconds) targeted by this deployment. + // Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment. // +optional optional int32 availableReplicas = 4; - // unavailableReplicas is the total number of unavailable pods targeted by this deployment. This is the total number of + // Total number of unavailable pods targeted by this deployment. This is the total number of // pods that are still required for the deployment to have 100% available capacity. They may // either be pods that are running but not yet available or pods that still have not been created. // +optional optional int32 unavailableReplicas = 5; - // Conditions represent the latest available observations of a deployment's current state. + // Total number of terminating pods targeted by this deployment. Terminating pods have a non-null + // .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. + // + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. + // +optional + optional int32 terminatingReplicas = 9; + + // Represents the latest available observations of a deployment's current state. // +patchMergeKey=type // +patchStrategy=merge // +listType=map @@ -455,6 +462,7 @@ message StatefulSetSpec { // the network identity of the set. Pods get DNS/hostnames that follow the // pattern: pod-specific-string.serviceName.default.svc.cluster.local // where "pod-specific-string" is managed by the StatefulSet controller. + // +optional optional string serviceName = 5; // podManagementPolicy controls how pods are created during initial scale up, diff --git a/e2e/vendor/k8s.io/api/apps/v1beta1/types.go b/e2e/vendor/k8s.io/api/apps/v1beta1/types.go index bc4851957..5530c990d 100644 --- a/e2e/vendor/k8s.io/api/apps/v1beta1/types.go +++ b/e2e/vendor/k8s.io/api/apps/v1beta1/types.go @@ -259,6 +259,7 @@ type StatefulSetSpec struct { // the network identity of the set. Pods get DNS/hostnames that follow the // pattern: pod-specific-string.serviceName.default.svc.cluster.local // where "pod-specific-string" is managed by the StatefulSet controller. + // +optional ServiceName string `json:"serviceName" protobuf:"bytes,5,opt,name=serviceName"` // podManagementPolicy controls how pods are created during initial scale up, @@ -548,33 +549,40 @@ type RollingUpdateDeployment struct { // DeploymentStatus is the most recently observed status of the Deployment. type DeploymentStatus struct { - // observedGeneration is the generation observed by the deployment controller. + // The generation observed by the deployment controller. // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"` - // replicas is the total number of non-terminated pods targeted by this deployment (their labels match the selector). + // Total number of non-terminating pods targeted by this deployment (their labels match the selector). // +optional Replicas int32 `json:"replicas,omitempty" protobuf:"varint,2,opt,name=replicas"` - // updatedReplicas is the total number of non-terminated pods targeted by this deployment that have the desired template spec. + // Total number of non-terminating pods targeted by this deployment that have the desired template spec. // +optional UpdatedReplicas int32 `json:"updatedReplicas,omitempty" protobuf:"varint,3,opt,name=updatedReplicas"` - // readyReplicas is the number of pods targeted by this Deployment controller with a Ready Condition. + // Total number of non-terminating pods targeted by this Deployment with a Ready Condition. // +optional ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,7,opt,name=readyReplicas"` - // Total number of available pods (ready for at least minReadySeconds) targeted by this deployment. + // Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment. // +optional AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,4,opt,name=availableReplicas"` - // unavailableReplicas is the total number of unavailable pods targeted by this deployment. This is the total number of + // Total number of unavailable pods targeted by this deployment. This is the total number of // pods that are still required for the deployment to have 100% available capacity. They may // either be pods that are running but not yet available or pods that still have not been created. // +optional UnavailableReplicas int32 `json:"unavailableReplicas,omitempty" protobuf:"varint,5,opt,name=unavailableReplicas"` - // Conditions represent the latest available observations of a deployment's current state. + // Total number of terminating pods targeted by this deployment. Terminating pods have a non-null + // .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. + // + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. + // +optional + TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty" protobuf:"varint,9,opt,name=terminatingReplicas"` + + // Represents the latest available observations of a deployment's current state. // +patchMergeKey=type // +patchStrategy=merge // +listType=map diff --git a/e2e/vendor/k8s.io/api/apps/v1beta1/types_swagger_doc_generated.go b/e2e/vendor/k8s.io/api/apps/v1beta1/types_swagger_doc_generated.go index 1381d75dc..02ea5f7f2 100644 --- a/e2e/vendor/k8s.io/api/apps/v1beta1/types_swagger_doc_generated.go +++ b/e2e/vendor/k8s.io/api/apps/v1beta1/types_swagger_doc_generated.go @@ -113,13 +113,14 @@ func (DeploymentSpec) SwaggerDoc() map[string]string { var map_DeploymentStatus = map[string]string{ "": "DeploymentStatus is the most recently observed status of the Deployment.", - "observedGeneration": "observedGeneration is the generation observed by the deployment controller.", - "replicas": "replicas is the total number of non-terminated pods targeted by this deployment (their labels match the selector).", - "updatedReplicas": "updatedReplicas is the total number of non-terminated pods targeted by this deployment that have the desired template spec.", - "readyReplicas": "readyReplicas is the number of pods targeted by this Deployment controller with a Ready Condition.", - "availableReplicas": "Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.", - "unavailableReplicas": "unavailableReplicas is the total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created.", - "conditions": "Conditions represent the latest available observations of a deployment's current state.", + "observedGeneration": "The generation observed by the deployment controller.", + "replicas": "Total number of non-terminating pods targeted by this deployment (their labels match the selector).", + "updatedReplicas": "Total number of non-terminating pods targeted by this deployment that have the desired template spec.", + "readyReplicas": "Total number of non-terminating pods targeted by this Deployment with a Ready Condition.", + "availableReplicas": "Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment.", + "unavailableReplicas": "Total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created.", + "terminatingReplicas": "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", + "conditions": "Represents the latest available observations of a deployment's current state.", "collisionCount": "collisionCount is the count of hash collisions for the Deployment. The Deployment controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ReplicaSet.", } diff --git a/e2e/vendor/k8s.io/api/apps/v1beta1/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/api/apps/v1beta1/zz_generated.deepcopy.go index dd73f1a5a..e8594766c 100644 --- a/e2e/vendor/k8s.io/api/apps/v1beta1/zz_generated.deepcopy.go +++ b/e2e/vendor/k8s.io/api/apps/v1beta1/zz_generated.deepcopy.go @@ -246,6 +246,11 @@ func (in *DeploymentSpec) DeepCopy() *DeploymentSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DeploymentStatus) DeepCopyInto(out *DeploymentStatus) { *out = *in + if in.TerminatingReplicas != nil { + in, out := &in.TerminatingReplicas, &out.TerminatingReplicas + *out = new(int32) + **out = **in + } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions *out = make([]DeploymentCondition, len(*in)) diff --git a/e2e/vendor/k8s.io/api/apps/v1beta2/doc.go b/e2e/vendor/k8s.io/api/apps/v1beta2/doc.go index ac91fddfd..7d28fe42d 100644 --- a/e2e/vendor/k8s.io/api/apps/v1beta2/doc.go +++ b/e2e/vendor/k8s.io/api/apps/v1beta2/doc.go @@ -19,4 +19,4 @@ limitations under the License. // +k8s:openapi-gen=true // +k8s:prerelease-lifecycle-gen=true -package v1beta2 // import "k8s.io/api/apps/v1beta2" +package v1beta2 diff --git a/e2e/vendor/k8s.io/api/apps/v1beta2/generated.pb.go b/e2e/vendor/k8s.io/api/apps/v1beta2/generated.pb.go index 1c3d3be5b..9fcba6feb 100644 --- a/e2e/vendor/k8s.io/api/apps/v1beta2/generated.pb.go +++ b/e2e/vendor/k8s.io/api/apps/v1beta2/generated.pb.go @@ -1017,153 +1017,155 @@ func init() { } var fileDescriptor_c423c016abf485d4 = []byte{ - // 2328 bytes of a gzipped FileDescriptorProto + // 2359 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5a, 0xcd, 0x6f, 0x1b, 0xc7, - 0x15, 0xf7, 0xf2, 0x43, 0x26, 0x87, 0x96, 0x64, 0x8f, 0x54, 0x89, 0xb1, 0x5b, 0xd2, 0x58, 0x1b, - 0xb6, 0x12, 0xdb, 0xa4, 0xad, 0x7c, 0x20, 0xb1, 0xdb, 0x04, 0xa2, 0x94, 0xda, 0x0e, 0xf4, 0xc1, - 0x0c, 0x2d, 0x07, 0x0d, 0xfa, 0xe1, 0x11, 0x39, 0xa6, 0x36, 0xde, 0x2f, 0xec, 0x0e, 0x15, 0x13, - 0xbd, 0xf4, 0x5a, 0xa0, 0x40, 0xdb, 0x6b, 0xff, 0x89, 0xa2, 0x97, 0xa2, 0x68, 0xd0, 0x4b, 0x11, - 0x04, 0x3e, 0x06, 0xbd, 0x24, 0x27, 0xa2, 0x66, 0x4e, 0x45, 0xd1, 0x5b, 0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, 0xa0, 0xeb, - 0x16, 0x06, 0xbb, 0x0a, 0x26, 0x30, 0x80, 0x78, 0x59, 0xf2, 0x2b, 0xb3, 0xd7, 0x64, 0xa3, 0x00, - 0xa4, 0xfc, 0xb1, 0x04, 0x96, 0x53, 0x12, 0x1d, 0xbe, 0x15, 0x2a, 0x82, 0x97, 0x22, 0x45, 0xf0, - 0x4c, 0x8a, 0x59, 0xa0, 0x12, 0xee, 0x83, 0x59, 0x46, 0x48, 0x14, 0xbd, 0xef, 0xa8, 0x88, 0xbd, - 0xac, 0x99, 0x3a, 0x00, 0x14, 0xd4, 0xf6, 0x77, 0xe5, 0x53, 0xe3, 0x51, 0x7d, 0x36, 0x24, 0x43, - 0x61, 0x60, 0xf9, 0x57, 0x39, 0x00, 0x36, 0x88, 0xa9, 0x1a, 0x43, 0x8d, 0xe8, 0x47, 0xc1, 0x69, - 0x6e, 0x87, 0x38, 0xcd, 0xc5, 0xf4, 0x25, 0xf1, 0x9c, 0x4a, 0x25, 0x35, 0xef, 0x46, 0x48, 0xcd, - 0x8b, 0x59, 0xc0, 0x9e, 0xce, 0x6a, 0x3e, 0xcb, 0x83, 0x05, 0x5f, 0xd9, 0xa7, 0x35, 0x37, 0x42, - 0x2b, 0x7a, 0x31, 0xb2, 0xa2, 0xcb, 0x09, 0x26, 0xcf, 0x8d, 0xd7, 0x7c, 0x00, 0xe6, 0x18, 0xeb, - 0x70, 0xd6, 0x8f, 0x73, 0x9a, 0x99, 0xa9, 0x39, 0x8d, 0x57, 0x89, 0x36, 0x43, 0x48, 0x28, 0x82, - 0x9c, 0xc2, 0xa1, 0x8e, 0x7f, 0x1d, 0x39, 0xd4, 0x9f, 0x24, 0x30, 0xe7, 0x2f, 0xd3, 0x11, 0x90, - 0xa8, 0x5b, 0x61, 0x12, 0x75, 0x2e, 0x43, 0x70, 0xa6, 0xb0, 0xa8, 0xcf, 0x0a, 0x41, 0xd7, 0x39, - 0x8d, 0x5a, 0x61, 0x47, 0x30, 0x53, 0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db, 0x60, 0x86, 0xa3, 0xe7, 0x38, + 0xfa, 0xe5, 0x54, 0x74, 0xb1, 0xe8, 0x06, 0xc2, 0x1f, 0xbe, 0xfd, 0x90, 0x12, 0x9d, 0xb9, 0xd7, + 0x3a, 0x2e, 0xa0, 0x67, 0x36, 0x31, 0xc5, 0x88, 0x03, 0xc1, 0x4b, 0xa0, 0x68, 0x09, 0xf7, 0xab, + 0xf9, 0x33, 0xd2, 0x6a, 0xbe, 0x75, 0x42, 0x68, 0x15, 0xdd, 0x65, 0x21, 0x4f, 0x43, 0x7e, 0x24, + 0x81, 0x95, 0xf8, 0xba, 0xb7, 0x14, 0x9b, 0xc2, 0x1f, 0xc7, 0xd6, 0xde, 0xc8, 0xb6, 0x76, 0x66, + 0xcd, 0x57, 0xee, 0x4d, 0xec, 0x8e, 0x04, 0xd6, 0xdd, 0x06, 0x05, 0x85, 0x12, 0xcd, 0xae, 0xe6, + 0xce, 0xe4, 0x57, 0xcb, 0x6b, 0x17, 0x1b, 0x29, 0x01, 0xdc, 0x88, 0x7b, 0xd7, 0x9a, 0x17, 0xb8, + 0x85, 0x5b, 0x0c, 0x01, 0x39, 0x40, 0xf2, 0x2f, 0x73, 0xa0, 0xb4, 0x89, 0x89, 0x66, 0xe8, 0x1d, + 0x42, 0x8f, 0xe0, 0xe4, 0x6e, 0x82, 0x19, 0xdb, 0x24, 0x5d, 0x71, 0x72, 0xe7, 0x53, 0x17, 0xe0, + 0xf9, 0xd4, 0x31, 0x49, 0xd7, 0x3f, 0x32, 0xf6, 0x84, 0x38, 0x02, 0x6c, 0x83, 0x59, 0x9b, 0x62, + 0x3a, 0xb0, 0xf9, 0x81, 0x95, 0xd7, 0x56, 0x33, 0x60, 0x71, 0xfd, 0xd6, 0x82, 0x40, 0x9b, 0x75, + 0x9e, 0x91, 0xc0, 0x91, 0xff, 0x91, 0x03, 0xd0, 0xd3, 0xdd, 0x30, 0xf4, 0x9e, 0x42, 0x59, 0x38, + 0x5f, 0x03, 0x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 0x3e, 0x85, 0xfe, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd4, + 0x01, 0x82, 0xf5, 0x24, 0x2d, 0x00, 0x00, } func (m *ControllerRevision) Marshal() (dAtA []byte, err error) { @@ -1845,6 +1847,11 @@ func (m *DeploymentStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.TerminatingReplicas != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.TerminatingReplicas)) + i-- + dAtA[i] = 0x48 + } if m.CollisionCount != nil { i = encodeVarintGenerated(dAtA, i, uint64(*m.CollisionCount)) i-- @@ -2151,6 +2158,11 @@ func (m *ReplicaSetStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.TerminatingReplicas != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.TerminatingReplicas)) + i-- + dAtA[i] = 0x38 + } if len(m.Conditions) > 0 { for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { { @@ -3146,6 +3158,9 @@ func (m *DeploymentStatus) Size() (n int) { if m.CollisionCount != nil { n += 1 + sovGenerated(uint64(*m.CollisionCount)) } + if m.TerminatingReplicas != nil { + n += 1 + sovGenerated(uint64(*m.TerminatingReplicas)) + } return n } @@ -3251,6 +3266,9 @@ func (m *ReplicaSetStatus) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } + if m.TerminatingReplicas != nil { + n += 1 + sovGenerated(uint64(*m.TerminatingReplicas)) + } return n } @@ -3711,6 +3729,7 @@ func (this *DeploymentStatus) String() string { `Conditions:` + repeatedStringForConditions + `,`, `ReadyReplicas:` + fmt.Sprintf("%v", this.ReadyReplicas) + `,`, `CollisionCount:` + valueToStringGenerated(this.CollisionCount) + `,`, + `TerminatingReplicas:` + valueToStringGenerated(this.TerminatingReplicas) + `,`, `}`, }, "") return s @@ -3797,6 +3816,7 @@ func (this *ReplicaSetStatus) String() string { `ReadyReplicas:` + fmt.Sprintf("%v", this.ReadyReplicas) + `,`, `AvailableReplicas:` + fmt.Sprintf("%v", this.AvailableReplicas) + `,`, `Conditions:` + repeatedStringForConditions + `,`, + `TerminatingReplicas:` + valueToStringGenerated(this.TerminatingReplicas) + `,`, `}`, }, "") return s @@ -6261,6 +6281,26 @@ func (m *DeploymentStatus) Unmarshal(dAtA []byte) error { } } m.CollisionCount = &v + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TerminatingReplicas", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TerminatingReplicas = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -7193,6 +7233,26 @@ func (m *ReplicaSetStatus) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TerminatingReplicas", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TerminatingReplicas = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/e2e/vendor/k8s.io/api/apps/v1beta2/generated.proto b/e2e/vendor/k8s.io/api/apps/v1beta2/generated.proto index c08a4c78b..68c463e25 100644 --- a/e2e/vendor/k8s.io/api/apps/v1beta2/generated.proto +++ b/e2e/vendor/k8s.io/api/apps/v1beta2/generated.proto @@ -323,19 +323,19 @@ message DeploymentStatus { // +optional optional int64 observedGeneration = 1; - // Total number of non-terminated pods targeted by this deployment (their labels match the selector). + // Total number of non-terminating pods targeted by this deployment (their labels match the selector). // +optional optional int32 replicas = 2; - // Total number of non-terminated pods targeted by this deployment that have the desired template spec. + // Total number of non-terminating pods targeted by this deployment that have the desired template spec. // +optional optional int32 updatedReplicas = 3; - // readyReplicas is the number of pods targeted by this Deployment controller with a Ready Condition. + // Total number of non-terminating pods targeted by this Deployment with a Ready Condition. // +optional optional int32 readyReplicas = 7; - // Total number of available pods (ready for at least minReadySeconds) targeted by this deployment. + // Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment. // +optional optional int32 availableReplicas = 4; @@ -345,6 +345,13 @@ message DeploymentStatus { // +optional optional int32 unavailableReplicas = 5; + // Total number of terminating pods targeted by this deployment. Terminating pods have a non-null + // .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. + // + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. + // +optional + optional int32 terminatingReplicas = 9; + // Represents the latest available observations of a deployment's current state. // +patchMergeKey=type // +patchStrategy=merge @@ -427,16 +434,16 @@ message ReplicaSetList { optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; // List of ReplicaSets. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset repeated ReplicaSet items = 2; } // ReplicaSetSpec is the specification of a ReplicaSet. message ReplicaSetSpec { - // Replicas is the number of desired replicas. + // Replicas is the number of desired pods. // This is a pointer to distinguish between explicit zero and unspecified. // Defaults to 1. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset // +optional optional int32 replicas = 1; @@ -454,29 +461,36 @@ message ReplicaSetSpec { // Template is the object that describes the pod that will be created if // insufficient replicas are detected. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/#pod-template // +optional optional .k8s.io.api.core.v1.PodTemplateSpec template = 3; } // ReplicaSetStatus represents the current status of a ReplicaSet. message ReplicaSetStatus { - // Replicas is the most recently observed number of replicas. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller + // Replicas is the most recently observed number of non-terminating pods. + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset optional int32 replicas = 1; - // The number of pods that have labels matching the labels of the pod template of the replicaset. + // The number of non-terminating pods that have labels matching the labels of the pod template of the replicaset. // +optional optional int32 fullyLabeledReplicas = 2; - // readyReplicas is the number of pods targeted by this ReplicaSet controller with a Ready Condition. + // The number of non-terminating pods targeted by this ReplicaSet with a Ready Condition. // +optional optional int32 readyReplicas = 4; - // The number of available replicas (ready for at least minReadySeconds) for this replica set. + // The number of available non-terminating pods (ready for at least minReadySeconds) for this replica set. // +optional optional int32 availableReplicas = 5; + // The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp + // and have not yet reached the Failed or Succeeded .status.phase. + // + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. + // +optional + optional int32 terminatingReplicas = 7; + // ObservedGeneration reflects the generation of the most recently observed ReplicaSet. // +optional optional int64 observedGeneration = 3; @@ -747,6 +761,7 @@ message StatefulSetSpec { // the network identity of the set. Pods get DNS/hostnames that follow the // pattern: pod-specific-string.serviceName.default.svc.cluster.local // where "pod-specific-string" is managed by the StatefulSet controller. + // +optional optional string serviceName = 5; // podManagementPolicy controls how pods are created during initial scale up, diff --git a/e2e/vendor/k8s.io/api/apps/v1beta2/types.go b/e2e/vendor/k8s.io/api/apps/v1beta2/types.go index c2624a941..491afc59f 100644 --- a/e2e/vendor/k8s.io/api/apps/v1beta2/types.go +++ b/e2e/vendor/k8s.io/api/apps/v1beta2/types.go @@ -269,6 +269,7 @@ type StatefulSetSpec struct { // the network identity of the set. Pods get DNS/hostnames that follow the // pattern: pod-specific-string.serviceName.default.svc.cluster.local // where "pod-specific-string" is managed by the StatefulSet controller. + // +optional ServiceName string `json:"serviceName" protobuf:"bytes,5,opt,name=serviceName"` // podManagementPolicy controls how pods are created during initial scale up, @@ -530,19 +531,19 @@ type DeploymentStatus struct { // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"` - // Total number of non-terminated pods targeted by this deployment (their labels match the selector). + // Total number of non-terminating pods targeted by this deployment (their labels match the selector). // +optional Replicas int32 `json:"replicas,omitempty" protobuf:"varint,2,opt,name=replicas"` - // Total number of non-terminated pods targeted by this deployment that have the desired template spec. + // Total number of non-terminating pods targeted by this deployment that have the desired template spec. // +optional UpdatedReplicas int32 `json:"updatedReplicas,omitempty" protobuf:"varint,3,opt,name=updatedReplicas"` - // readyReplicas is the number of pods targeted by this Deployment controller with a Ready Condition. + // Total number of non-terminating pods targeted by this Deployment with a Ready Condition. // +optional ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,7,opt,name=readyReplicas"` - // Total number of available pods (ready for at least minReadySeconds) targeted by this deployment. + // Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment. // +optional AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,4,opt,name=availableReplicas"` @@ -552,6 +553,13 @@ type DeploymentStatus struct { // +optional UnavailableReplicas int32 `json:"unavailableReplicas,omitempty" protobuf:"varint,5,opt,name=unavailableReplicas"` + // Total number of terminating pods targeted by this deployment. Terminating pods have a non-null + // .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. + // + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. + // +optional + TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty" protobuf:"varint,9,opt,name=terminatingReplicas"` + // Represents the latest available observations of a deployment's current state. // +patchMergeKey=type // +patchStrategy=merge @@ -897,16 +905,16 @@ type ReplicaSetList struct { metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // List of ReplicaSets. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset Items []ReplicaSet `json:"items" protobuf:"bytes,2,rep,name=items"` } // ReplicaSetSpec is the specification of a ReplicaSet. type ReplicaSetSpec struct { - // Replicas is the number of desired replicas. + // Replicas is the number of desired pods. // This is a pointer to distinguish between explicit zero and unspecified. // Defaults to 1. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset // +optional Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"` @@ -924,29 +932,36 @@ type ReplicaSetSpec struct { // Template is the object that describes the pod that will be created if // insufficient replicas are detected. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/#pod-template // +optional Template v1.PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,3,opt,name=template"` } // ReplicaSetStatus represents the current status of a ReplicaSet. type ReplicaSetStatus struct { - // Replicas is the most recently observed number of replicas. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller + // Replicas is the most recently observed number of non-terminating pods. + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset Replicas int32 `json:"replicas" protobuf:"varint,1,opt,name=replicas"` - // The number of pods that have labels matching the labels of the pod template of the replicaset. + // The number of non-terminating pods that have labels matching the labels of the pod template of the replicaset. // +optional FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty" protobuf:"varint,2,opt,name=fullyLabeledReplicas"` - // readyReplicas is the number of pods targeted by this ReplicaSet controller with a Ready Condition. + // The number of non-terminating pods targeted by this ReplicaSet with a Ready Condition. // +optional ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,4,opt,name=readyReplicas"` - // The number of available replicas (ready for at least minReadySeconds) for this replica set. + // The number of available non-terminating pods (ready for at least minReadySeconds) for this replica set. // +optional AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,5,opt,name=availableReplicas"` + // The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp + // and have not yet reached the Failed or Succeeded .status.phase. + // + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. + // +optional + TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty" protobuf:"varint,7,opt,name=terminatingReplicas"` + // ObservedGeneration reflects the generation of the most recently observed ReplicaSet. // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,3,opt,name=observedGeneration"` diff --git a/e2e/vendor/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go b/e2e/vendor/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go index beec4b755..408943415 100644 --- a/e2e/vendor/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go +++ b/e2e/vendor/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go @@ -177,11 +177,12 @@ func (DeploymentSpec) SwaggerDoc() map[string]string { var map_DeploymentStatus = map[string]string{ "": "DeploymentStatus is the most recently observed status of the Deployment.", "observedGeneration": "The generation observed by the deployment controller.", - "replicas": "Total number of non-terminated pods targeted by this deployment (their labels match the selector).", - "updatedReplicas": "Total number of non-terminated pods targeted by this deployment that have the desired template spec.", - "readyReplicas": "readyReplicas is the number of pods targeted by this Deployment controller with a Ready Condition.", - "availableReplicas": "Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.", + "replicas": "Total number of non-terminating pods targeted by this deployment (their labels match the selector).", + "updatedReplicas": "Total number of non-terminating pods targeted by this deployment that have the desired template spec.", + "readyReplicas": "Total number of non-terminating pods targeted by this Deployment with a Ready Condition.", + "availableReplicas": "Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment.", "unavailableReplicas": "Total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created.", + "terminatingReplicas": "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", "conditions": "Represents the latest available observations of a deployment's current state.", "collisionCount": "Count of hash collisions for the Deployment. The Deployment controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ReplicaSet.", } @@ -227,7 +228,7 @@ func (ReplicaSetCondition) SwaggerDoc() map[string]string { var map_ReplicaSetList = map[string]string{ "": "ReplicaSetList is a collection of ReplicaSets.", "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "items": "List of ReplicaSets. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller", + "items": "List of ReplicaSets. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset", } func (ReplicaSetList) SwaggerDoc() map[string]string { @@ -236,10 +237,10 @@ func (ReplicaSetList) SwaggerDoc() map[string]string { var map_ReplicaSetSpec = map[string]string{ "": "ReplicaSetSpec is the specification of a ReplicaSet.", - "replicas": "Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller", + "replicas": "Replicas is the number of desired pods. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset", "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)", "selector": "Selector is a label query over pods that should match the replica count. Label keys and values that must match in order to be controlled by this replica set. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors", - "template": "Template is the object that describes the pod that will be created if insufficient replicas are detected. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template", + "template": "Template is the object that describes the pod that will be created if insufficient replicas are detected. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/#pod-template", } func (ReplicaSetSpec) SwaggerDoc() map[string]string { @@ -248,10 +249,11 @@ func (ReplicaSetSpec) SwaggerDoc() map[string]string { var map_ReplicaSetStatus = map[string]string{ "": "ReplicaSetStatus represents the current status of a ReplicaSet.", - "replicas": "Replicas is the most recently observed number of replicas. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller", - "fullyLabeledReplicas": "The number of pods that have labels matching the labels of the pod template of the replicaset.", - "readyReplicas": "readyReplicas is the number of pods targeted by this ReplicaSet controller with a Ready Condition.", - "availableReplicas": "The number of available replicas (ready for at least minReadySeconds) for this replica set.", + "replicas": "Replicas is the most recently observed number of non-terminating pods. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset", + "fullyLabeledReplicas": "The number of non-terminating pods that have labels matching the labels of the pod template of the replicaset.", + "readyReplicas": "The number of non-terminating pods targeted by this ReplicaSet with a Ready Condition.", + "availableReplicas": "The number of available non-terminating pods (ready for at least minReadySeconds) for this replica set.", + "terminatingReplicas": "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", "observedGeneration": "ObservedGeneration reflects the generation of the most recently observed ReplicaSet.", "conditions": "Represents the latest available observations of a replica set's current state.", } diff --git a/e2e/vendor/k8s.io/api/apps/v1beta2/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/api/apps/v1beta2/zz_generated.deepcopy.go index cd92792db..917ad4a22 100644 --- a/e2e/vendor/k8s.io/api/apps/v1beta2/zz_generated.deepcopy.go +++ b/e2e/vendor/k8s.io/api/apps/v1beta2/zz_generated.deepcopy.go @@ -363,6 +363,11 @@ func (in *DeploymentSpec) DeepCopy() *DeploymentSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DeploymentStatus) DeepCopyInto(out *DeploymentStatus) { *out = *in + if in.TerminatingReplicas != nil { + in, out := &in.TerminatingReplicas, &out.TerminatingReplicas + *out = new(int32) + **out = **in + } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions *out = make([]DeploymentCondition, len(*in)) @@ -517,6 +522,11 @@ func (in *ReplicaSetSpec) DeepCopy() *ReplicaSetSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ReplicaSetStatus) DeepCopyInto(out *ReplicaSetStatus) { *out = *in + if in.TerminatingReplicas != nil { + in, out := &in.TerminatingReplicas, &out.TerminatingReplicas + *out = new(int32) + **out = **in + } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions *out = make([]ReplicaSetCondition, len(*in)) diff --git a/e2e/vendor/k8s.io/api/authentication/v1/doc.go b/e2e/vendor/k8s.io/api/authentication/v1/doc.go index 3bdc89bad..dc3aed4e4 100644 --- a/e2e/vendor/k8s.io/api/authentication/v1/doc.go +++ b/e2e/vendor/k8s.io/api/authentication/v1/doc.go @@ -20,4 +20,4 @@ limitations under the License. // +k8s:openapi-gen=true // +k8s:prerelease-lifecycle-gen=true -package v1 // import "k8s.io/api/authentication/v1" +package v1 diff --git a/e2e/vendor/k8s.io/api/authentication/v1alpha1/doc.go b/e2e/vendor/k8s.io/api/authentication/v1alpha1/doc.go index eb32def90..c199ccd49 100644 --- a/e2e/vendor/k8s.io/api/authentication/v1alpha1/doc.go +++ b/e2e/vendor/k8s.io/api/authentication/v1alpha1/doc.go @@ -20,4 +20,4 @@ limitations under the License. // +k8s:openapi-gen=true // +k8s:prerelease-lifecycle-gen=true -package v1alpha1 // import "k8s.io/api/authentication/v1alpha1" +package v1alpha1 diff --git a/e2e/vendor/k8s.io/api/authentication/v1beta1/doc.go b/e2e/vendor/k8s.io/api/authentication/v1beta1/doc.go index 2a2b176e4..af63dc845 100644 --- a/e2e/vendor/k8s.io/api/authentication/v1beta1/doc.go +++ b/e2e/vendor/k8s.io/api/authentication/v1beta1/doc.go @@ -20,4 +20,4 @@ limitations under the License. // +k8s:openapi-gen=true // +k8s:prerelease-lifecycle-gen=true -package v1beta1 // import "k8s.io/api/authentication/v1beta1" +package v1beta1 diff --git a/e2e/vendor/k8s.io/api/authorization/v1/doc.go b/e2e/vendor/k8s.io/api/authorization/v1/doc.go index 77e5a19c4..40bf8006e 100644 --- a/e2e/vendor/k8s.io/api/authorization/v1/doc.go +++ b/e2e/vendor/k8s.io/api/authorization/v1/doc.go @@ -20,4 +20,4 @@ limitations under the License. // +k8s:prerelease-lifecycle-gen=true // +groupName=authorization.k8s.io -package v1 // import "k8s.io/api/authorization/v1" +package v1 diff --git a/e2e/vendor/k8s.io/api/authorization/v1beta1/doc.go b/e2e/vendor/k8s.io/api/authorization/v1beta1/doc.go index c996e35cc..9f7332d49 100644 --- a/e2e/vendor/k8s.io/api/authorization/v1beta1/doc.go +++ b/e2e/vendor/k8s.io/api/authorization/v1beta1/doc.go @@ -21,4 +21,4 @@ limitations under the License. // +groupName=authorization.k8s.io -package v1beta1 // import "k8s.io/api/authorization/v1beta1" +package v1beta1 diff --git a/e2e/vendor/k8s.io/api/autoscaling/v1/doc.go b/e2e/vendor/k8s.io/api/autoscaling/v1/doc.go index d64c9cbc1..4ee085e16 100644 --- a/e2e/vendor/k8s.io/api/autoscaling/v1/doc.go +++ b/e2e/vendor/k8s.io/api/autoscaling/v1/doc.go @@ -19,4 +19,4 @@ limitations under the License. // +k8s:openapi-gen=true // +k8s:prerelease-lifecycle-gen=true -package v1 // import "k8s.io/api/autoscaling/v1" +package v1 diff --git a/e2e/vendor/k8s.io/api/autoscaling/v2/doc.go b/e2e/vendor/k8s.io/api/autoscaling/v2/doc.go index aafa2d4de..8dea6339d 100644 --- a/e2e/vendor/k8s.io/api/autoscaling/v2/doc.go +++ b/e2e/vendor/k8s.io/api/autoscaling/v2/doc.go @@ -19,4 +19,4 @@ limitations under the License. // +k8s:openapi-gen=true // +k8s:prerelease-lifecycle-gen=true -package v2 // import "k8s.io/api/autoscaling/v2" +package v2 diff --git a/e2e/vendor/k8s.io/api/autoscaling/v2/generated.pb.go b/e2e/vendor/k8s.io/api/autoscaling/v2/generated.pb.go index ece6dedad..40b60ebec 100644 --- a/e2e/vendor/k8s.io/api/autoscaling/v2/generated.pb.go +++ b/e2e/vendor/k8s.io/api/autoscaling/v2/generated.pb.go @@ -751,115 +751,116 @@ func init() { } var fileDescriptor_4d5f2c8767749221 = []byte{ - // 1722 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x59, 0xcb, 0x8f, 0x1b, 0x49, - 0x19, 0x9f, 0xb6, 0x3d, 0xaf, 0xf2, 0x3c, 0x2b, 0x2f, 0x67, 0xa2, 0xd8, 0xa3, 0x26, 0x90, 0x07, - 0xa4, 0x4d, 0x4c, 0x88, 0x22, 0x72, 0x40, 0xd3, 0x13, 0x20, 0xa3, 0xcc, 0x30, 0x4e, 0x39, 0xc9, - 0x00, 0x02, 0x94, 0x72, 0x77, 0x8d, 0xa7, 0x18, 0xbb, 0xdb, 0xea, 0x6e, 0x3b, 0x99, 0x48, 0x48, - 0x5c, 0xb8, 0x23, 0x50, 0x84, 0xf8, 0x1f, 0x22, 0x4e, 0xa0, 0x70, 0x00, 0x09, 0x69, 0xf7, 0x90, - 0xcb, 0x4a, 0x39, 0xec, 0x21, 0x27, 0x6b, 0xe3, 0x95, 0xf6, 0xb8, 0x7f, 0x40, 0x4e, 0xab, 0x7a, - 0xf4, 0xd3, 0xaf, 0x71, 0x76, 0x32, 0xd2, 0xdc, 0x5c, 0x55, 0xdf, 0xf7, 0xfb, 0x1e, 0xf5, 0xbd, - 0xaa, 0x0d, 0xae, 0xee, 0xdf, 0x76, 0x35, 0x6a, 0x17, 0x71, 0x93, 0x16, 0x71, 0xcb, 0xb3, 0x5d, - 0x03, 0xd7, 0xa9, 0x55, 0x2b, 0xb6, 0x4b, 0xc5, 0x1a, 0xb1, 0x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, 0x01, 0xb2, 0x0d, 0x6a, 0x21, - 0xd2, 0xac, 0x53, 0x03, 0xbb, 0xb2, 0x09, 0x2d, 0x76, 0x3b, 0x85, 0xec, 0x56, 0xb8, 0x8d, 0xa2, - 0x34, 0xf0, 0xc7, 0x20, 0xdb, 0xc0, 0xcf, 0x02, 0x16, 0xd1, 0x2c, 0x4e, 0x49, 0x79, 0xd9, 0xad, - 0xf0, 0x08, 0x45, 0xe9, 0x60, 0x99, 0xc5, 0x00, 0x6b, 0xb3, 0x6e, 0x2e, 0xc3, 0x9d, 0xfb, 0xdd, - 0x91, 0x0d, 0x99, 0x97, 0xb7, 0x48, 0xa8, 0x70, 0x6e, 0xe4, 0xc3, 0x40, 0x13, 0xcc, 0x54, 0x65, - 0xa9, 0xe1, 0x61, 0x95, 0x2d, 0xfd, 0xe4, 0x03, 0xee, 0x4b, 0x22, 0xe8, 0x73, 0x2c, 0x24, 0xfc, - 0x15, 0x0a, 0x90, 0xd5, 0x97, 0x19, 0x70, 0x71, 0x68, 0x89, 0x84, 0x3f, 0x07, 0xd0, 0xae, 0xba, - 0xc4, 0x69, 0x13, 0xf3, 0x17, 0xe2, 0x91, 0xc0, 0x66, 0x3a, 0x76, 0x7f, 0x69, 0xfd, 0x2c, 0xcb, - 0xa6, 0xed, 0x9e, 0x53, 0xd4, 0x87, 0x03, 0x1a, 0x60, 0x9e, 0xe5, 0x98, 0xb8, 0x31, 0x2a, 0xc7, - 0xc7, 0xf1, 0x12, 0x78, 0x99, 0x4d, 0x03, 0x9b, 0x51, 0x10, 0x14, 0xc7, 0x84, 0x6b, 0x60, 0x51, - 0x4e, 0x32, 0x89, 0x1b, 0x3c, 0x27, 0xfd, 0xbc, 0xb8, 0x1e, 0x3f, 0x46, 0x49, 0x7a, 0x06, 0x61, - 0x12, 0x97, 0x3a, 0xc4, 0x0c, 0x20, 0x32, 0x71, 0x88, 0xbb, 0xf1, 0x63, 0x94, 0xa4, 0x87, 0x35, - 0xb0, 0x20, 0x51,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85, 0x45, 0x49, 0x39, 0x47, 0xff, 0x91, 0x35, 0xfc, 0xa4, 0x95, 0x3e, 0xb2, 0x4f, 0x5a, - 0xea, 0xff, 0x92, 0x7e, 0x3b, 0x81, 0x9f, 0xcf, 0xfa, 0xdd, 0x72, 0xfa, 0x78, 0x6e, 0x59, 0xfd, - 0x8f, 0x02, 0x96, 0x92, 0x63, 0xc4, 0x09, 0xf9, 0x76, 0xfa, 0xff, 0xb8, 0xea, 0x27, 0xf1, 0xbb, - 0xe9, 0x4b, 0x05, 0x9c, 0x3e, 0x39, 0x7f, 0x93, 0xa8, 0xff, 0xea, 0x55, 0xf7, 0x04, 0xfc, 0xd9, - 0xa1, 0xff, 0xf4, 0xf5, 0xbb, 0xfc, 0xc4, 0x9b, 0x77, 0xf9, 0x89, 0xb7, 0xef, 0xf2, 0x13, 0x7f, - 0xea, 0xe6, 0x95, 0xd7, 0xdd, 0xbc, 0xf2, 0xa6, 0x9b, 0x57, 0xde, 0x76, 0xf3, 0xca, 0x17, 0xdd, - 0xbc, 0xf2, 0x97, 0x2f, 0xf3, 0x13, 0xbf, 0x39, 0x3f, 0xf0, 0x9f, 0xc2, 0x6f, 0x02, 0x00, 0x00, - 0xff, 0xff, 0xca, 0x8b, 0x47, 0xba, 0x45, 0x1c, 0x00, 0x00, + // 1742 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x59, 0xc9, 0x8f, 0x1b, 0x4b, + 0x19, 0x9f, 0xb6, 0x3d, 0x5b, 0x79, 0xd6, 0xca, 0xe6, 0x4c, 0x14, 0x7b, 0xd4, 0x04, 0xb2, 0x40, + 0xda, 0xc4, 0x84, 0x28, 0x22, 0x07, 0x34, 0x3d, 0x01, 0x32, 0xca, 0x0c, 0xe3, 0x94, 0x27, 0x19, + 0x76, 0xa5, 0xdc, 0x5d, 0xe3, 0x29, 0xc6, 0xee, 0xb6, 0xba, 0xdb, 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 0x60, + 0xc5, 0xf5, 0x70, 0x95, 0xd6, 0xe9, 0x0b, 0xec, 0x51, 0xdb, 0xda, 0xa5, 0x96, 0x69, 0x3f, 0x8b, + 0xa3, 0xe7, 0xbb, 0x9d, 0xc2, 0x4a, 0x65, 0x20, 0x15, 0x1a, 0x82, 0x00, 0x1f, 0x82, 0x39, 0x97, + 0xd4, 0x89, 0xe1, 0x09, 0x7b, 0xa5, 0x5f, 0xae, 0x76, 0x3b, 0x85, 0xb9, 0x4a, 0x64, 0xff, 0x43, + 0xa7, 0x70, 0x26, 0xe6, 0x18, 0x71, 0x88, 0x62, 0xcc, 0xf0, 0xa7, 0x60, 0xa6, 0xc9, 0x7e, 0x51, + 0xe2, 0xe6, 0x52, 0xab, 0xe9, 0x11, 0x11, 0x92, 0xf4, 0xb5, 0xbe, 0x24, 0xbd, 0x34, 0x53, 0x96, + 0x20, 0x28, 0x80, 0x83, 0x3f, 0x07, 0xb3, 0x9e, 0x5d, 0x27, 0x0e, 0xb6, 0x0c, 0x92, 0xcb, 0xf0, + 0x38, 0xd1, 0x22, 0xd8, 0x41, 0x43, 0xd0, 0x9a, 0x07, 0x35, 0x2e, 0xcc, 0xef, 0x56, 0xda, 0xa3, + 0x16, 0xb6, 0x3c, 0xea, 0x1d, 0xea, 0xf3, 0xac, 0x8e, 0xec, 0xf8, 0x20, 0x28, 0xc4, 0x53, 0x5f, + 0xa7, 0xc0, 0x85, 0x07, 0xb6, 0x43, 0x5f, 0xb0, 0xca, 0x52, 0x2f, 0xdb, 0xe6, 0x9a, 0xd4, 0x94, + 0x38, 0xf0, 0x29, 0x98, 0x61, 0x1d, 0xcc, 0xc4, 0x1e, 0x96, 0x51, 0xff, 0xed, 0x61, 0x72, 0x5d, + 0x8d, 0x51, 0x6b, 0xed, 0x5b, 0x9a, 0x28, 0x46, 0x5b, 0xc4, 0xc3, 0x61, 0xbd, 0x08, 0xf7, 0x50, + 0x80, 0x0a, 0x7f, 0x02, 0x32, 0x6e, 0x93,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 0x64, 0x15, 0x41, + 0xec, 0xaf, 0x50, 0x00, 0xa9, 0xbe, 0xcc, 0x00, 0x10, 0xe6, 0x14, 0xbc, 0x1d, 0xeb, 0x63, 0xab, + 0x89, 0x3e, 0xb6, 0x14, 0x7d, 0xb9, 0x44, 0x7a, 0xd6, 0x23, 0x30, 0x65, 0xf3, 0x32, 0x23, 0x35, + 0xbc, 0x39, 0xc4, 0x8f, 0xc1, 0xbc, 0x13, 0x00, 0xe9, 0x80, 0x35, 0x06, 0x59, 0xa7, 0x24, 0x10, + 0xdc, 0x00, 0x99, 0xa6, 0x6d, 0xfa, 0x53, 0xca, 0xb0, 0x99, 0xb1, 0x6c, 0x9b, 0x6e, 0x0c, 0x6e, + 0x86, 0x69, 0xcc, 0x76, 0x11, 0x87, 0x60, 0x23, 0xa8, 0x3f, 0xf9, 0xc9, 0x31, 0xb1, 0x38, 0x04, + 0xae, 0xdf, 0xd7, 0x00, 0xe1, 0x3d, 0xff, 0x04, 0x05, 0x70, 0xf0, 0x37, 0x60, 0xd9, 0x48, 0xbe, + 0xae, 0x73, 0xd3, 0x23, 0x07, 0xab, 0xa1, 0x9f, 0x1e, 0xf4, 0x73, 0xdd, 0x4e, 0x61, 0xb9, 0x87, + 0x04, 0xf5, 0x4a, 0x62, 0x96, 0x11, 0xf9, 0x28, 0x93, 0x75, 0x6e, 0x98, 0x65, 0xfd, 0x9e, 0x9f, + 0xc2, 0x32, 0xff, 0x04, 0x05, 0x70, 0xea, 0x9f, 0x32, 0x60, 0x2e, 0xf6, 0xd0, 0x3b, 0xe1, 0xc8, + 0x10, 0xc9, 0x7c, 0x6c, 0x91, 0x21, 0xe0, 0x8e, 0x35, 0x32, 0x04, 0xe4, 0x09, 0x45, 0x86, 0x10, + 0x76, 0x42, 0x91, 0x11, 0xb1, 0xac, 0x4f, 0x64, 0xfc, 0x2b, 0xe5, 0x47, 0x86, 0x18, 0x16, 0x8e, + 0x16, 0x19, 0x82, 0x36, 0x12, 0x19, 0xdb,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x9b, 0x57, 0xde, 0x75, + 0xf3, 0xca, 0xff, 0xba, 0x79, 0xe5, 0xf7, 0xff, 0xcf, 0x4f, 0xfc, 0xec, 0xe2, 0xc0, 0xbf, 0x21, + 0xbf, 0x0c, 0x00, 0x00, 0xff, 0xff, 0xbe, 0x23, 0xae, 0x54, 0xa2, 0x1c, 0x00, 0x00, } func (m *ContainerResourceMetricSource) Marshal() (dAtA []byte, err error) { @@ -1126,6 +1127,18 @@ func (m *HPAScalingRules) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Tolerance != nil { + { + size, err := m.Tolerance.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } if m.StabilizationWindowSeconds != nil { i = encodeVarintGenerated(dAtA, i, uint64(*m.StabilizationWindowSeconds)) i-- @@ -2203,6 +2216,10 @@ func (m *HPAScalingRules) Size() (n int) { if m.StabilizationWindowSeconds != nil { n += 1 + sovGenerated(uint64(*m.StabilizationWindowSeconds)) } + if m.Tolerance != nil { + l = m.Tolerance.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -2619,6 +2636,7 @@ func (this *HPAScalingRules) String() string { `SelectPolicy:` + valueToStringGenerated(this.SelectPolicy) + `,`, `Policies:` + repeatedStringForPolicies + `,`, `StabilizationWindowSeconds:` + valueToStringGenerated(this.StabilizationWindowSeconds) + `,`, + `Tolerance:` + strings.Replace(fmt.Sprintf("%v", this.Tolerance), "Quantity", "resource.Quantity", 1) + `,`, `}`, }, "") return s @@ -3770,6 +3788,42 @@ func (m *HPAScalingRules) Unmarshal(dAtA []byte) error { } } m.StabilizationWindowSeconds = &v + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tolerance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Tolerance == nil { + m.Tolerance = &resource.Quantity{} + } + if err := m.Tolerance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/e2e/vendor/k8s.io/api/autoscaling/v2/generated.proto b/e2e/vendor/k8s.io/api/autoscaling/v2/generated.proto index 4e6dc0592..04c34d6e1 100644 --- a/e2e/vendor/k8s.io/api/autoscaling/v2/generated.proto +++ b/e2e/vendor/k8s.io/api/autoscaling/v2/generated.proto @@ -112,12 +112,18 @@ message HPAScalingPolicy { optional int32 periodSeconds = 3; } -// HPAScalingRules configures the scaling behavior for one direction. -// These Rules are applied after calculating DesiredReplicas from metrics for the HPA. +// HPAScalingRules configures the scaling behavior for one direction via +// scaling Policy Rules and a configurable metric tolerance. +// +// Scaling Policy Rules are applied after calculating DesiredReplicas from metrics for the HPA. // They can limit the scaling velocity by specifying scaling policies. // They can prevent flapping by specifying the stabilization window, so that the // number of replicas is not set instantly, instead, the safest value from the stabilization // window is chosen. +// +// The tolerance is applied to the metric values and prevents scaling too +// eagerly for small metric variations. (Note that setting a tolerance requires +// enabling the alpha HPAConfigurableTolerance feature gate.) message HPAScalingRules { // stabilizationWindowSeconds is the number of seconds for which past recommendations should be // considered while scaling up or scaling down. @@ -134,10 +140,28 @@ message HPAScalingRules { optional string selectPolicy = 1; // policies is a list of potential scaling polices which can be used during scaling. - // At least one policy must be specified, otherwise the HPAScalingRules will be discarded as invalid + // If not set, use the default values: + // - For scale up: allow doubling the number of pods, or an absolute change of 4 pods in a 15s window. + // - For scale down: allow all pods to be removed in a 15s window. // +listType=atomic // +optional repeated HPAScalingPolicy policies = 2; + + // tolerance is the tolerance on the ratio between the current and desired + // metric value under which no updates are made to the desired number of + // replicas (e.g. 0.01 for 1%). Must be greater than or equal to zero. If not + // set, the default cluster-wide tolerance is applied (by default 10%). + // + // For example, if autoscaling is configured with a memory consumption target of 100Mi, + // and scale-down and scale-up tolerances of 5% and 1% respectively, scaling will be + // triggered when the actual consumption falls below 95Mi or exceeds 101Mi. + // + // This is an alpha field and requires enabling the HPAConfigurableTolerance + // feature gate. + // + // +featureGate=HPAConfigurableTolerance + // +optional + optional .k8s.io.apimachinery.pkg.api.resource.Quantity tolerance = 4; } // HorizontalPodAutoscaler is the configuration for a horizontal pod diff --git a/e2e/vendor/k8s.io/api/autoscaling/v2/types.go b/e2e/vendor/k8s.io/api/autoscaling/v2/types.go index 99e8db09d..9ce69b1ed 100644 --- a/e2e/vendor/k8s.io/api/autoscaling/v2/types.go +++ b/e2e/vendor/k8s.io/api/autoscaling/v2/types.go @@ -171,12 +171,18 @@ const ( DisabledPolicySelect ScalingPolicySelect = "Disabled" ) -// HPAScalingRules configures the scaling behavior for one direction. -// These Rules are applied after calculating DesiredReplicas from metrics for the HPA. +// HPAScalingRules configures the scaling behavior for one direction via +// scaling Policy Rules and a configurable metric tolerance. +// +// Scaling Policy Rules are applied after calculating DesiredReplicas from metrics for the HPA. // They can limit the scaling velocity by specifying scaling policies. // They can prevent flapping by specifying the stabilization window, so that the // number of replicas is not set instantly, instead, the safest value from the stabilization // window is chosen. +// +// The tolerance is applied to the metric values and prevents scaling too +// eagerly for small metric variations. (Note that setting a tolerance requires +// enabling the alpha HPAConfigurableTolerance feature gate.) type HPAScalingRules struct { // stabilizationWindowSeconds is the number of seconds for which past recommendations should be // considered while scaling up or scaling down. @@ -193,10 +199,28 @@ type HPAScalingRules struct { SelectPolicy *ScalingPolicySelect `json:"selectPolicy,omitempty" protobuf:"bytes,1,opt,name=selectPolicy"` // policies is a list of potential scaling polices which can be used during scaling. - // At least one policy must be specified, otherwise the HPAScalingRules will be discarded as invalid + // If not set, use the default values: + // - For scale up: allow doubling the number of pods, or an absolute change of 4 pods in a 15s window. + // - For scale down: allow all pods to be removed in a 15s window. // +listType=atomic // +optional Policies []HPAScalingPolicy `json:"policies,omitempty" listType:"atomic" protobuf:"bytes,2,rep,name=policies"` + + // tolerance is the tolerance on the ratio between the current and desired + // metric value under which no updates are made to the desired number of + // replicas (e.g. 0.01 for 1%). Must be greater than or equal to zero. If not + // set, the default cluster-wide tolerance is applied (by default 10%). + // + // For example, if autoscaling is configured with a memory consumption target of 100Mi, + // and scale-down and scale-up tolerances of 5% and 1% respectively, scaling will be + // triggered when the actual consumption falls below 95Mi or exceeds 101Mi. + // + // This is an alpha field and requires enabling the HPAConfigurableTolerance + // feature gate. + // + // +featureGate=HPAConfigurableTolerance + // +optional + Tolerance *resource.Quantity `json:"tolerance,omitempty" protobuf:"bytes,4,opt,name=tolerance"` } // HPAScalingPolicyType is the type of the policy which could be used while making scaling decisions. diff --git a/e2e/vendor/k8s.io/api/autoscaling/v2/types_swagger_doc_generated.go b/e2e/vendor/k8s.io/api/autoscaling/v2/types_swagger_doc_generated.go index 649cd04a0..017fefcde 100644 --- a/e2e/vendor/k8s.io/api/autoscaling/v2/types_swagger_doc_generated.go +++ b/e2e/vendor/k8s.io/api/autoscaling/v2/types_swagger_doc_generated.go @@ -92,10 +92,11 @@ func (HPAScalingPolicy) SwaggerDoc() map[string]string { } var map_HPAScalingRules = map[string]string{ - "": "HPAScalingRules configures the scaling behavior for one direction. These Rules are applied after calculating DesiredReplicas from metrics for the HPA. They can limit the scaling velocity by specifying scaling policies. They can prevent flapping by specifying the stabilization window, so that the number of replicas is not set instantly, instead, the safest value from the stabilization window is chosen.", + "": "HPAScalingRules configures the scaling behavior for one direction via scaling Policy Rules and a configurable metric tolerance.\n\nScaling Policy Rules are applied after calculating DesiredReplicas from metrics for the HPA. They can limit the scaling velocity by specifying scaling policies. They can prevent flapping by specifying the stabilization window, so that the number of replicas is not set instantly, instead, the safest value from the stabilization window is chosen.\n\nThe tolerance is applied to the metric values and prevents scaling too eagerly for small metric variations. (Note that setting a tolerance requires enabling the alpha HPAConfigurableTolerance feature gate.)", "stabilizationWindowSeconds": "stabilizationWindowSeconds is the number of seconds for which past recommendations should be considered while scaling up or scaling down. StabilizationWindowSeconds must be greater than or equal to zero and less than or equal to 3600 (one hour). If not set, use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale down: 300 (i.e. the stabilization window is 300 seconds long).", "selectPolicy": "selectPolicy is used to specify which policy should be used. If not set, the default value Max is used.", - "policies": "policies is a list of potential scaling polices which can be used during scaling. At least one policy must be specified, otherwise the HPAScalingRules will be discarded as invalid", + "policies": "policies is a list of potential scaling polices which can be used during scaling. If not set, use the default values: - For scale up: allow doubling the number of pods, or an absolute change of 4 pods in a 15s window. - For scale down: allow all pods to be removed in a 15s window.", + "tolerance": "tolerance is the tolerance on the ratio between the current and desired metric value under which no updates are made to the desired number of replicas (e.g. 0.01 for 1%). Must be greater than or equal to zero. If not set, the default cluster-wide tolerance is applied (by default 10%).\n\nFor example, if autoscaling is configured with a memory consumption target of 100Mi, and scale-down and scale-up tolerances of 5% and 1% respectively, scaling will be triggered when the actual consumption falls below 95Mi or exceeds 101Mi.\n\nThis is an alpha field and requires enabling the HPAConfigurableTolerance feature gate.", } func (HPAScalingRules) SwaggerDoc() map[string]string { diff --git a/e2e/vendor/k8s.io/api/autoscaling/v2/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/api/autoscaling/v2/zz_generated.deepcopy.go index 125708d6f..5fbcf9f80 100644 --- a/e2e/vendor/k8s.io/api/autoscaling/v2/zz_generated.deepcopy.go +++ b/e2e/vendor/k8s.io/api/autoscaling/v2/zz_generated.deepcopy.go @@ -146,6 +146,11 @@ func (in *HPAScalingRules) DeepCopyInto(out *HPAScalingRules) { *out = make([]HPAScalingPolicy, len(*in)) copy(*out, *in) } + if in.Tolerance != nil { + in, out := &in.Tolerance, &out.Tolerance + x := (*in).DeepCopy() + *out = &x + } return } diff --git a/e2e/vendor/k8s.io/api/autoscaling/v2beta1/doc.go b/e2e/vendor/k8s.io/api/autoscaling/v2beta1/doc.go index 25ca507bb..eac92e86e 100644 --- a/e2e/vendor/k8s.io/api/autoscaling/v2beta1/doc.go +++ b/e2e/vendor/k8s.io/api/autoscaling/v2beta1/doc.go @@ -19,4 +19,4 @@ limitations under the License. // +k8s:openapi-gen=true // +k8s:prerelease-lifecycle-gen=true -package v2beta1 // import "k8s.io/api/autoscaling/v2beta1" +package v2beta1 diff --git a/e2e/vendor/k8s.io/api/autoscaling/v2beta2/doc.go b/e2e/vendor/k8s.io/api/autoscaling/v2beta2/doc.go index 76fb0aff8..150037297 100644 --- a/e2e/vendor/k8s.io/api/autoscaling/v2beta2/doc.go +++ b/e2e/vendor/k8s.io/api/autoscaling/v2beta2/doc.go @@ -19,4 +19,4 @@ limitations under the License. // +k8s:openapi-gen=true // +k8s:prerelease-lifecycle-gen=true -package v2beta2 // import "k8s.io/api/autoscaling/v2beta2" +package v2beta2 diff --git a/e2e/vendor/k8s.io/api/batch/v1/doc.go b/e2e/vendor/k8s.io/api/batch/v1/doc.go index cb5cbb600..69088e2c5 100644 --- a/e2e/vendor/k8s.io/api/batch/v1/doc.go +++ b/e2e/vendor/k8s.io/api/batch/v1/doc.go @@ -18,4 +18,4 @@ limitations under the License. // +k8s:protobuf-gen=package // +k8s:openapi-gen=true // +k8s:prerelease-lifecycle-gen=true -package v1 // import "k8s.io/api/batch/v1" +package v1 diff --git a/e2e/vendor/k8s.io/api/batch/v1/generated.proto b/e2e/vendor/k8s.io/api/batch/v1/generated.proto index 361ebdca1..d3aeae0ad 100644 --- a/e2e/vendor/k8s.io/api/batch/v1/generated.proto +++ b/e2e/vendor/k8s.io/api/batch/v1/generated.proto @@ -222,8 +222,6 @@ message JobSpec { // When the field is specified, it must be immutable and works only for the Indexed Jobs. // Once the Job meets the SuccessPolicy, the lingering pods are terminated. // - // This field is beta-level. To use this field, you must enable the - // `JobSuccessPolicy` feature gate (enabled by default). // +optional optional SuccessPolicy successPolicy = 16; @@ -238,8 +236,6 @@ message JobSpec { // batch.kubernetes.io/job-index-failure-count annotation. It can only // be set when Job's completionMode=Indexed, and the Pod's restart // policy is Never. The field is immutable. - // This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` - // feature gate is enabled (enabled by default). // +optional optional int32 backoffLimitPerIndex = 12; @@ -251,8 +247,6 @@ message JobSpec { // It can only be specified when backoffLimitPerIndex is set. // It can be null or up to completions. It is required and must be // less than or equal to 10^4 when is completions greater than 10^5. - // This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` - // feature gate is enabled (enabled by default). // +optional optional int32 maxFailedIndexes = 13; @@ -442,8 +436,6 @@ message JobStatus { // represented as "1,3-5,7". // The set of failed indexes cannot overlap with the set of completed indexes. // - // This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` - // feature gate is enabled (enabled by default). // +optional optional string failedIndexes = 10; @@ -554,8 +546,6 @@ message PodFailurePolicyRule { // running pods are terminated. // - FailIndex: indicates that the pod's index is marked as Failed and will // not be restarted. - // This value is beta-level. It can be used when the - // `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default). // - Ignore: indicates that the counter towards the .backoffLimit is not // incremented and a replacement pod is created. // - Count: indicates that the pod is handled in the default way - the diff --git a/e2e/vendor/k8s.io/api/batch/v1/types.go b/e2e/vendor/k8s.io/api/batch/v1/types.go index 8e9a761b9..6c0007c21 100644 --- a/e2e/vendor/k8s.io/api/batch/v1/types.go +++ b/e2e/vendor/k8s.io/api/batch/v1/types.go @@ -128,7 +128,6 @@ const ( // This is an action which might be taken on a pod failure - mark the // Job's index as failed to avoid restarts within this index. This action // can only be used when backoffLimitPerIndex is set. - // This value is beta-level. PodFailurePolicyActionFailIndex PodFailurePolicyAction = "FailIndex" // This is an action which might be taken on a pod failure - the counter towards @@ -223,8 +222,6 @@ type PodFailurePolicyRule struct { // running pods are terminated. // - FailIndex: indicates that the pod's index is marked as Failed and will // not be restarted. - // This value is beta-level. It can be used when the - // `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default). // - Ignore: indicates that the counter towards the .backoffLimit is not // incremented and a replacement pod is created. // - Count: indicates that the pod is handled in the default way - the @@ -346,8 +343,6 @@ type JobSpec struct { // When the field is specified, it must be immutable and works only for the Indexed Jobs. // Once the Job meets the SuccessPolicy, the lingering pods are terminated. // - // This field is beta-level. To use this field, you must enable the - // `JobSuccessPolicy` feature gate (enabled by default). // +optional SuccessPolicy *SuccessPolicy `json:"successPolicy,omitempty" protobuf:"bytes,16,opt,name=successPolicy"` @@ -362,8 +357,6 @@ type JobSpec struct { // batch.kubernetes.io/job-index-failure-count annotation. It can only // be set when Job's completionMode=Indexed, and the Pod's restart // policy is Never. The field is immutable. - // This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` - // feature gate is enabled (enabled by default). // +optional BackoffLimitPerIndex *int32 `json:"backoffLimitPerIndex,omitempty" protobuf:"varint,12,opt,name=backoffLimitPerIndex"` @@ -375,8 +368,6 @@ type JobSpec struct { // It can only be specified when backoffLimitPerIndex is set. // It can be null or up to completions. It is required and must be // less than or equal to 10^4 when is completions greater than 10^5. - // This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` - // feature gate is enabled (enabled by default). // +optional MaxFailedIndexes *int32 `json:"maxFailedIndexes,omitempty" protobuf:"varint,13,opt,name=maxFailedIndexes"` @@ -571,8 +562,6 @@ type JobStatus struct { // represented as "1,3-5,7". // The set of failed indexes cannot overlap with the set of completed indexes. // - // This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` - // feature gate is enabled (enabled by default). // +optional FailedIndexes *string `json:"failedIndexes,omitempty" protobuf:"bytes,10,opt,name=failedIndexes"` @@ -647,13 +636,9 @@ const ( JobReasonFailedIndexes string = "FailedIndexes" // JobReasonSuccessPolicy reason indicates a SuccessCriteriaMet condition is added due to // a Job met successPolicy. - // https://kep.k8s.io/3998 - // This is currently a beta field. JobReasonSuccessPolicy string = "SuccessPolicy" // JobReasonCompletionsReached reason indicates a SuccessCriteriaMet condition is added due to // a number of succeeded Job pods met completions. - // - https://kep.k8s.io/3998 - // This is currently a beta field. JobReasonCompletionsReached string = "CompletionsReached" ) diff --git a/e2e/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go b/e2e/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go index 893f3371f..ffd4e4f5f 100644 --- a/e2e/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go +++ b/e2e/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go @@ -116,10 +116,10 @@ var map_JobSpec = map[string]string{ "completions": "Specifies the desired number of successfully finished pods the job should be run with. Setting to null means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/", "activeDeadlineSeconds": "Specifies the duration in seconds relative to the startTime that the job may be continuously active before the system tries to terminate it; value must be positive integer. If a Job is suspended (at creation or through an update), this timer will effectively be stopped and reset when the Job is resumed again.", "podFailurePolicy": "Specifies the policy of handling failed pods. In particular, it allows to specify the set of actions and conditions which need to be satisfied to take the associated action. If empty, the default behaviour applies - the counter of failed pods, represented by the jobs's .status.failed field, is incremented and it is checked against the backoffLimit. This field cannot be used in combination with restartPolicy=OnFailure.", - "successPolicy": "successPolicy specifies the policy when the Job can be declared as succeeded. If empty, the default behavior applies - the Job is declared as succeeded only when the number of succeeded pods equals to the completions. When the field is specified, it must be immutable and works only for the Indexed Jobs. Once the Job meets the SuccessPolicy, the lingering pods are terminated.\n\nThis field is beta-level. To use this field, you must enable the `JobSuccessPolicy` feature gate (enabled by default).", + "successPolicy": "successPolicy specifies the policy when the Job can be declared as succeeded. If empty, the default behavior applies - the Job is declared as succeeded only when the number of succeeded pods equals to the completions. When the field is specified, it must be immutable and works only for the Indexed Jobs. Once the Job meets the SuccessPolicy, the lingering pods are terminated.", "backoffLimit": "Specifies the number of retries before marking this job failed. Defaults to 6", - "backoffLimitPerIndex": "Specifies the limit for the number of retries within an index before marking this index as failed. When enabled the number of failures per index is kept in the pod's batch.kubernetes.io/job-index-failure-count annotation. It can only be set when Job's completionMode=Indexed, and the Pod's restart policy is Never. The field is immutable. This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).", - "maxFailedIndexes": "Specifies the maximal number of failed indexes before marking the Job as failed, when backoffLimitPerIndex is set. Once the number of failed indexes exceeds this number the entire Job is marked as Failed and its execution is terminated. When left as null the job continues execution of all of its indexes and is marked with the `Complete` Job condition. It can only be specified when backoffLimitPerIndex is set. It can be null or up to completions. It is required and must be less than or equal to 10^4 when is completions greater than 10^5. This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).", + "backoffLimitPerIndex": "Specifies the limit for the number of retries within an index before marking this index as failed. When enabled the number of failures per index is kept in the pod's batch.kubernetes.io/job-index-failure-count annotation. It can only be set when Job's completionMode=Indexed, and the Pod's restart policy is Never. The field is immutable.", + "maxFailedIndexes": "Specifies the maximal number of failed indexes before marking the Job as failed, when backoffLimitPerIndex is set. Once the number of failed indexes exceeds this number the entire Job is marked as Failed and its execution is terminated. When left as null the job continues execution of all of its indexes and is marked with the `Complete` Job condition. It can only be specified when backoffLimitPerIndex is set. It can be null or up to completions. It is required and must be less than or equal to 10^4 when is completions greater than 10^5.", "selector": "A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors", "manualSelector": "manualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector", "template": "Describes the pod that will be created when executing a job. The only allowed template.spec.restartPolicy values are \"Never\" or \"OnFailure\". More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/", @@ -144,7 +144,7 @@ var map_JobStatus = map[string]string{ "failed": "The number of pods which reached phase Failed. The value increases monotonically.", "terminating": "The number of pods which are terminating (in phase Pending or Running and have a deletionTimestamp).\n\nThis field is beta-level. The job controller populates the field when the feature gate JobPodReplacementPolicy is enabled (enabled by default).", "completedIndexes": "completedIndexes holds the completed indexes when .spec.completionMode = \"Indexed\" in a text format. The indexes are represented as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the completed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\".", - "failedIndexes": "FailedIndexes holds the failed indexes when spec.backoffLimitPerIndex is set. The indexes are represented in the text format analogous as for the `completedIndexes` field, ie. they are kept as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the failed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\". The set of failed indexes cannot overlap with the set of completed indexes.\n\nThis field is beta-level. It can be used when the `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).", + "failedIndexes": "FailedIndexes holds the failed indexes when spec.backoffLimitPerIndex is set. The indexes are represented in the text format analogous as for the `completedIndexes` field, ie. they are kept as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the failed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\". The set of failed indexes cannot overlap with the set of completed indexes.", "uncountedTerminatedPods": "uncountedTerminatedPods holds the UIDs of Pods that have terminated but the job controller hasn't yet accounted for in the status counters.\n\nThe job controller creates pods with a finalizer. When a pod terminates (succeeded or failed), the controller does three steps to account for it in the job status:\n\n1. Add the pod UID to the arrays in this field. 2. Remove the pod finalizer. 3. Remove the pod UID from the arrays while increasing the corresponding\n counter.\n\nOld jobs might not be tracked using this field, in which case the field remains null. The structure is empty for finished jobs.", "ready": "The number of active pods which have a Ready condition and are not terminating (without a deletionTimestamp).", } @@ -195,7 +195,7 @@ func (PodFailurePolicyOnPodConditionsPattern) SwaggerDoc() map[string]string { var map_PodFailurePolicyRule = map[string]string{ "": "PodFailurePolicyRule describes how a pod failure is handled when the requirements are met. One of onExitCodes and onPodConditions, but not both, can be used in each rule.", - "action": "Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are:\n\n- FailJob: indicates that the pod's job is marked as Failed and all\n running pods are terminated.\n- FailIndex: indicates that the pod's index is marked as Failed and will\n not be restarted.\n This value is beta-level. It can be used when the\n `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).\n- Ignore: indicates that the counter towards the .backoffLimit is not\n incremented and a replacement pod is created.\n- Count: indicates that the pod is handled in the default way - the\n counter towards the .backoffLimit is incremented.\nAdditional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule.", + "action": "Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are:\n\n- FailJob: indicates that the pod's job is marked as Failed and all\n running pods are terminated.\n- FailIndex: indicates that the pod's index is marked as Failed and will\n not be restarted.\n- Ignore: indicates that the counter towards the .backoffLimit is not\n incremented and a replacement pod is created.\n- Count: indicates that the pod is handled in the default way - the\n counter towards the .backoffLimit is incremented.\nAdditional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule.", "onExitCodes": "Represents the requirement on the container exit codes.", "onPodConditions": "Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed.", } diff --git a/e2e/vendor/k8s.io/api/batch/v1beta1/doc.go b/e2e/vendor/k8s.io/api/batch/v1beta1/doc.go index cb2572f5d..3430d6939 100644 --- a/e2e/vendor/k8s.io/api/batch/v1beta1/doc.go +++ b/e2e/vendor/k8s.io/api/batch/v1beta1/doc.go @@ -19,4 +19,4 @@ limitations under the License. // +k8s:openapi-gen=true // +k8s:prerelease-lifecycle-gen=true -package v1beta1 // import "k8s.io/api/batch/v1beta1" +package v1beta1 diff --git a/e2e/vendor/k8s.io/api/certificates/v1/doc.go b/e2e/vendor/k8s.io/api/certificates/v1/doc.go index 78434478e..6c16fc29b 100644 --- a/e2e/vendor/k8s.io/api/certificates/v1/doc.go +++ b/e2e/vendor/k8s.io/api/certificates/v1/doc.go @@ -20,4 +20,4 @@ limitations under the License. // +k8s:prerelease-lifecycle-gen=true // +groupName=certificates.k8s.io -package v1 // import "k8s.io/api/certificates/v1" +package v1 diff --git a/e2e/vendor/k8s.io/api/certificates/v1alpha1/doc.go b/e2e/vendor/k8s.io/api/certificates/v1alpha1/doc.go index d83d0e820..01481df8e 100644 --- a/e2e/vendor/k8s.io/api/certificates/v1alpha1/doc.go +++ b/e2e/vendor/k8s.io/api/certificates/v1alpha1/doc.go @@ -21,4 +21,4 @@ limitations under the License. // +groupName=certificates.k8s.io -package v1alpha1 // import "k8s.io/api/certificates/v1alpha1" +package v1alpha1 diff --git a/e2e/vendor/k8s.io/api/certificates/v1beta1/doc.go b/e2e/vendor/k8s.io/api/certificates/v1beta1/doc.go index 1165518c6..81608a554 100644 --- a/e2e/vendor/k8s.io/api/certificates/v1beta1/doc.go +++ b/e2e/vendor/k8s.io/api/certificates/v1beta1/doc.go @@ -21,4 +21,4 @@ limitations under the License. // +groupName=certificates.k8s.io -package v1beta1 // import "k8s.io/api/certificates/v1beta1" +package v1beta1 diff --git a/e2e/vendor/k8s.io/api/certificates/v1beta1/generated.pb.go b/e2e/vendor/k8s.io/api/certificates/v1beta1/generated.pb.go index b6d8ab3f5..199a54496 100644 --- a/e2e/vendor/k8s.io/api/certificates/v1beta1/generated.pb.go +++ b/e2e/vendor/k8s.io/api/certificates/v1beta1/generated.pb.go @@ -186,10 +186,94 @@ func (m *CertificateSigningRequestStatus) XXX_DiscardUnknown() { var xxx_messageInfo_CertificateSigningRequestStatus proto.InternalMessageInfo +func (m *ClusterTrustBundle) Reset() { *m = ClusterTrustBundle{} } +func (*ClusterTrustBundle) ProtoMessage() {} +func (*ClusterTrustBundle) Descriptor() ([]byte, []int) { + return fileDescriptor_6529c11a462c48a5, []int{5} +} +func (m *ClusterTrustBundle) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClusterTrustBundle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ClusterTrustBundle) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClusterTrustBundle.Merge(m, src) +} +func (m *ClusterTrustBundle) XXX_Size() int { + return m.Size() +} +func (m *ClusterTrustBundle) XXX_DiscardUnknown() { + xxx_messageInfo_ClusterTrustBundle.DiscardUnknown(m) +} + +var xxx_messageInfo_ClusterTrustBundle proto.InternalMessageInfo + +func (m *ClusterTrustBundleList) Reset() { *m = ClusterTrustBundleList{} } +func (*ClusterTrustBundleList) ProtoMessage() {} +func (*ClusterTrustBundleList) Descriptor() ([]byte, []int) { + return fileDescriptor_6529c11a462c48a5, []int{6} +} +func (m *ClusterTrustBundleList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClusterTrustBundleList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ClusterTrustBundleList) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClusterTrustBundleList.Merge(m, src) +} +func (m *ClusterTrustBundleList) XXX_Size() int { + return m.Size() +} +func (m *ClusterTrustBundleList) XXX_DiscardUnknown() { + xxx_messageInfo_ClusterTrustBundleList.DiscardUnknown(m) +} + +var xxx_messageInfo_ClusterTrustBundleList proto.InternalMessageInfo + +func (m *ClusterTrustBundleSpec) Reset() { *m = ClusterTrustBundleSpec{} } +func (*ClusterTrustBundleSpec) ProtoMessage() {} +func (*ClusterTrustBundleSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_6529c11a462c48a5, []int{7} +} +func (m *ClusterTrustBundleSpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClusterTrustBundleSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ClusterTrustBundleSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClusterTrustBundleSpec.Merge(m, src) +} +func (m *ClusterTrustBundleSpec) XXX_Size() int { + return m.Size() +} +func (m *ClusterTrustBundleSpec) XXX_DiscardUnknown() { + xxx_messageInfo_ClusterTrustBundleSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_ClusterTrustBundleSpec proto.InternalMessageInfo + func (m *ExtraValue) Reset() { *m = ExtraValue{} } func (*ExtraValue) ProtoMessage() {} func (*ExtraValue) Descriptor() ([]byte, []int) { - return fileDescriptor_6529c11a462c48a5, []int{5} + return fileDescriptor_6529c11a462c48a5, []int{8} } func (m *ExtraValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -221,6 +305,9 @@ func init() { proto.RegisterType((*CertificateSigningRequestSpec)(nil), "k8s.io.api.certificates.v1beta1.CertificateSigningRequestSpec") proto.RegisterMapType((map[string]ExtraValue)(nil), "k8s.io.api.certificates.v1beta1.CertificateSigningRequestSpec.ExtraEntry") proto.RegisterType((*CertificateSigningRequestStatus)(nil), "k8s.io.api.certificates.v1beta1.CertificateSigningRequestStatus") + proto.RegisterType((*ClusterTrustBundle)(nil), "k8s.io.api.certificates.v1beta1.ClusterTrustBundle") + proto.RegisterType((*ClusterTrustBundleList)(nil), "k8s.io.api.certificates.v1beta1.ClusterTrustBundleList") + proto.RegisterType((*ClusterTrustBundleSpec)(nil), "k8s.io.api.certificates.v1beta1.ClusterTrustBundleSpec") proto.RegisterType((*ExtraValue)(nil), "k8s.io.api.certificates.v1beta1.ExtraValue") } @@ -229,64 +316,69 @@ func init() { } var fileDescriptor_6529c11a462c48a5 = []byte{ - // 901 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4d, 0x6f, 0x1b, 0x45, - 0x18, 0xf6, 0xc6, 0x1f, 0xb1, 0xc7, 0x21, 0x6d, 0x47, 0x50, 0x2d, 0x96, 0xea, 0xb5, 0x56, 0x80, - 0xc2, 0xd7, 0x2c, 0xa9, 0x2a, 0x88, 0x72, 0x40, 0xb0, 0x21, 0x42, 0x11, 0x29, 0x48, 0x93, 0x84, - 0x03, 0x42, 0xa2, 0x93, 0xf5, 0xdb, 0xcd, 0x34, 0xdd, 0x0f, 0x76, 0x66, 0x4d, 0x7d, 0xeb, 0x4f, - 0xe0, 0xc8, 0x91, 0xff, 0xc0, 0x9f, 0x08, 0x07, 0xa4, 0x1e, 0x7b, 0x40, 0x16, 0x71, 0xff, 0x45, - 0x4e, 0x68, 0x66, 0xc7, 0x6b, 0xc7, 0x4e, 0x70, 0x69, 0x6f, 0x3b, 0xcf, 0xbc, 0xcf, 0xf3, 0xbc, - 0xf3, 0xce, 0xfb, 0x8e, 0x8d, 0xbc, 0xd3, 0x2d, 0x41, 0x78, 0xe2, 0xb1, 0x94, 0x7b, 0x01, 0x64, - 0x92, 0x3f, 0xe4, 0x01, 0x93, 0x20, 0xbc, 0xc1, 0xe6, 0x31, 0x48, 0xb6, 0xe9, 0x85, 0x10, 0x43, - 0xc6, 0x24, 0xf4, 0x49, 0x9a, 0x25, 0x32, 0xc1, 0x4e, 0x41, 0x20, 0x2c, 0xe5, 0x64, 0x96, 0x40, - 0x0c, 0xa1, 0xf3, 0x71, 0xc8, 0xe5, 0x49, 0x7e, 0x4c, 0x82, 0x24, 0xf2, 0xc2, 0x24, 0x4c, 0x3c, - 0xcd, 0x3b, 0xce, 0x1f, 0xea, 0x95, 0x5e, 0xe8,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xff, 0xff, 0x35, 0x2f, 0x11, - 0xe8, 0xdd, 0x08, 0x00, 0x00, + // 991 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0x8f, 0x9b, 0x3f, 0x4d, 0x26, 0xa5, 0xbb, 0x3b, 0x40, 0x65, 0x22, 0x6d, 0x1c, 0x59, 0x80, + 0xca, 0x3f, 0x9b, 0x96, 0x85, 0xad, 0x7a, 0x40, 0xe0, 0x50, 0xa1, 0x8a, 0x2e, 0x48, 0xd3, 0x16, + 0x01, 0x42, 0x62, 0xa7, 0xce, 0x5b, 0xd7, 0xdb, 0xc6, 0x36, 0x9e, 0x71, 0xd8, 0xdc, 0x56, 0xe2, + 0x0b, 0x70, 0xe4, 0xc8, 0x77, 0xe0, 0x4b, 0x94, 0x03, 0x52, 0xb9, 0xed, 0x01, 0x45, 0x34, 0xfb, + 0x2d, 0x7a, 0x42, 0x33, 0x9e, 0x38, 0x4e, 0xd2, 0x90, 0xa5, 0x2b, 0xed, 0x2d, 0xf3, 0xe6, 0xfd, + 0x7e, 0xbf, 0xf7, 0x9e, 0xdf, 0x7b, 0x13, 0x64, 0x9f, 0x6c, 0x31, 0xcb, 0x0f, 0x6d, 0x1a, 0xf9, + 0xb6, 0x0b, 0x31, 0xf7, 0x1f, 0xf8, 0x2e, 0xe5, 0xc0, 0xec, 0xde, 0xc6, 0x11, 0x70, 0xba, 0x61, + 0x7b, 0x10, 0x40, 0x4c, 0x39, 0x74, 0xac, 0x28, 0x0e, 0x79, 0x88, 0x8d, 0x14, 0x60, 0xd1, 0xc8, + 0xb7, 0xf2, 0x00, 0x4b, 0x01, 0x1a, 0xef, 0x79, 0x3e, 0x3f, 0x4e, 0x8e, 0x2c, 0x37, 0xec, 0xda, + 0x5e, 0xe8, 0x85, 0xb6, 0xc4, 0x1d, 0x25, 0x0f, 0xe4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, 0x9c, 0x15, 0xf4, + 0x21, 0xaa, 0xf3, 0x31, 0x8d, 0x5a, 0x08, 0x2f, 0x2b, 0x50, 0x3d, 0xa7, 0x40, 0xf2, 0x7e, 0xe6, + 0x5d, 0x35, 0x63, 0x72, 0x2a, 0xb0, 0x31, 0xca, 0x56, 0x93, 0x4b, 0xa0, 0x36, 0x1d, 0xf4, 0x76, + 0xf5, 0xd7, 0xdf, 0x8c, 0xc2, 0xe3, 0xbf, 0x5b, 0x05, 0x67, 0xe7, 0xec, 0xa2, 0x59, 0x38, 0xbf, + 0x68, 0x16, 0x9e, 0x5c, 0x34, 0x0b, 0x8f, 0x87, 0x4d, 0xed, 0x6c, 0xd8, 0xd4, 0xce, 0x87, 0x4d, + 0xed, 0xc9, 0xb0, 0xa9, 0xfd, 0x33, 0x6c, 0x6a, 0xbf, 0x3c, 0x6d, 0x16, 0xbe, 0x33, 0x16, 0xfc, + 0xd1, 0xfd, 0x37, 0x00, 0x00, 0xff, 0xff, 0x17, 0xbe, 0xe3, 0x02, 0x0a, 0x0b, 0x00, 0x00, } func (m *CertificateSigningRequest) Marshal() (dAtA []byte, err error) { @@ -595,6 +687,129 @@ func (m *CertificateSigningRequestStatus) MarshalToSizedBuffer(dAtA []byte) (int return len(dAtA) - i, nil } +func (m *ClusterTrustBundle) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ClusterTrustBundle) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClusterTrustBundle) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ClusterTrustBundleList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ClusterTrustBundleList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClusterTrustBundleList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ClusterTrustBundleSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ClusterTrustBundleSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClusterTrustBundleSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.TrustBundle) + copy(dAtA[i:], m.TrustBundle) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.TrustBundle))) + i-- + dAtA[i] = 0x12 + i -= len(m.SignerName) + copy(dAtA[i:], m.SignerName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.SignerName))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m ExtraValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -755,6 +970,49 @@ func (m *CertificateSigningRequestStatus) Size() (n int) { return n } +func (m *ClusterTrustBundle) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *ClusterTrustBundleList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *ClusterTrustBundleSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SignerName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.TrustBundle) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func (m ExtraValue) Size() (n int) { if m == nil { return 0 @@ -862,6 +1120,44 @@ func (this *CertificateSigningRequestStatus) String() string { }, "") return s } +func (this *ClusterTrustBundle) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ClusterTrustBundle{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ClusterTrustBundleSpec", "ClusterTrustBundleSpec", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *ClusterTrustBundleList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]ClusterTrustBundle{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "ClusterTrustBundle", "ClusterTrustBundle", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&ClusterTrustBundleList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *ClusterTrustBundleSpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ClusterTrustBundleSpec{`, + `SignerName:` + fmt.Sprintf("%v", this.SignerName) + `,`, + `TrustBundle:` + fmt.Sprintf("%v", this.TrustBundle) + `,`, + `}`, + }, "") + return s +} func valueToStringGenerated(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -1892,6 +2188,353 @@ func (m *CertificateSigningRequestStatus) Unmarshal(dAtA []byte) error { } return nil } +func (m *ClusterTrustBundle) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ClusterTrustBundle: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClusterTrustBundle: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClusterTrustBundleList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ClusterTrustBundleList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClusterTrustBundleList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, ClusterTrustBundle{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClusterTrustBundleSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ClusterTrustBundleSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClusterTrustBundleSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SignerName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SignerName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TrustBundle", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TrustBundle = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ExtraValue) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/e2e/vendor/k8s.io/api/certificates/v1beta1/generated.proto b/e2e/vendor/k8s.io/api/certificates/v1beta1/generated.proto index f3ec4c06e..7c48270f6 100644 --- a/e2e/vendor/k8s.io/api/certificates/v1beta1/generated.proto +++ b/e2e/vendor/k8s.io/api/certificates/v1beta1/generated.proto @@ -190,6 +190,79 @@ message CertificateSigningRequestStatus { optional bytes certificate = 2; } +// ClusterTrustBundle is a cluster-scoped container for X.509 trust anchors +// (root certificates). +// +// ClusterTrustBundle objects are considered to be readable by any authenticated +// user in the cluster, because they can be mounted by pods using the +// `clusterTrustBundle` projection. All service accounts have read access to +// ClusterTrustBundles by default. Users who only have namespace-level access +// to a cluster can read ClusterTrustBundles by impersonating a serviceaccount +// that they have access to. +// +// It can be optionally associated with a particular assigner, in which case it +// contains one valid set of trust anchors for that signer. Signers may have +// multiple associated ClusterTrustBundles; each is an independent set of trust +// anchors for that signer. Admission control is used to enforce that only users +// with permissions on the signer can create or modify the corresponding bundle. +message ClusterTrustBundle { + // metadata contains the object metadata. + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // spec contains the signer (if any) and trust anchors. + optional ClusterTrustBundleSpec spec = 2; +} + +// ClusterTrustBundleList is a collection of ClusterTrustBundle objects +message ClusterTrustBundleList { + // metadata contains the list metadata. + // + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // items is a collection of ClusterTrustBundle objects + repeated ClusterTrustBundle items = 2; +} + +// ClusterTrustBundleSpec contains the signer and trust anchors. +message ClusterTrustBundleSpec { + // signerName indicates the associated signer, if any. + // + // In order to create or update a ClusterTrustBundle that sets signerName, + // you must have the following cluster-scoped permission: + // group=certificates.k8s.io resource=signers resourceName= + // verb=attest. + // + // If signerName is not empty, then the ClusterTrustBundle object must be + // named with the signer name as a prefix (translating slashes to colons). + // For example, for the signer name `example.com/foo`, valid + // ClusterTrustBundle object names include `example.com:foo:abc` and + // `example.com:foo:v1`. + // + // If signerName is empty, then the ClusterTrustBundle object's name must + // not have such a prefix. + // + // List/watch requests for ClusterTrustBundles can filter on this field + // using a `spec.signerName=NAME` field selector. + // + // +optional + optional string signerName = 1; + + // trustBundle contains the individual X.509 trust anchors for this + // bundle, as PEM bundle of PEM-wrapped, DER-formatted X.509 certificates. + // + // The data must consist only of PEM certificate blocks that parse as valid + // X.509 certificates. Each certificate must include a basic constraints + // extension with the CA bit set. The API server will reject objects that + // contain duplicate certificates, or that use PEM block headers. + // + // Users of ClusterTrustBundles, including Kubelet, are free to reorder and + // deduplicate certificate blocks in this file according to their own logic, + // as well as to drop PEM block headers and inter-block data. + optional string trustBundle = 2; +} + // ExtraValue masks the value so protobuf can generate // +protobuf.nullable=true // +protobuf.options.(gogoproto.goproto_stringer)=false diff --git a/e2e/vendor/k8s.io/api/certificates/v1beta1/register.go b/e2e/vendor/k8s.io/api/certificates/v1beta1/register.go index b4f3af9b9..800dccd07 100644 --- a/e2e/vendor/k8s.io/api/certificates/v1beta1/register.go +++ b/e2e/vendor/k8s.io/api/certificates/v1beta1/register.go @@ -51,6 +51,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &CertificateSigningRequest{}, &CertificateSigningRequestList{}, + &ClusterTrustBundle{}, + &ClusterTrustBundleList{}, ) // Add the watch version that applies diff --git a/e2e/vendor/k8s.io/api/certificates/v1beta1/types.go b/e2e/vendor/k8s.io/api/certificates/v1beta1/types.go index 7e5a5c198..1ce104807 100644 --- a/e2e/vendor/k8s.io/api/certificates/v1beta1/types.go +++ b/e2e/vendor/k8s.io/api/certificates/v1beta1/types.go @@ -262,3 +262,88 @@ const ( UsageMicrosoftSGC KeyUsage = "microsoft sgc" UsageNetscapeSGC KeyUsage = "netscape sgc" ) + +// +genclient +// +genclient:nonNamespaced +// +k8s:prerelease-lifecycle-gen:introduced=1.33 +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ClusterTrustBundle is a cluster-scoped container for X.509 trust anchors +// (root certificates). +// +// ClusterTrustBundle objects are considered to be readable by any authenticated +// user in the cluster, because they can be mounted by pods using the +// `clusterTrustBundle` projection. All service accounts have read access to +// ClusterTrustBundles by default. Users who only have namespace-level access +// to a cluster can read ClusterTrustBundles by impersonating a serviceaccount +// that they have access to. +// +// It can be optionally associated with a particular assigner, in which case it +// contains one valid set of trust anchors for that signer. Signers may have +// multiple associated ClusterTrustBundles; each is an independent set of trust +// anchors for that signer. Admission control is used to enforce that only users +// with permissions on the signer can create or modify the corresponding bundle. +type ClusterTrustBundle struct { + metav1.TypeMeta `json:",inline"` + + // metadata contains the object metadata. + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // spec contains the signer (if any) and trust anchors. + Spec ClusterTrustBundleSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` +} + +// ClusterTrustBundleSpec contains the signer and trust anchors. +type ClusterTrustBundleSpec struct { + // signerName indicates the associated signer, if any. + // + // In order to create or update a ClusterTrustBundle that sets signerName, + // you must have the following cluster-scoped permission: + // group=certificates.k8s.io resource=signers resourceName= + // verb=attest. + // + // If signerName is not empty, then the ClusterTrustBundle object must be + // named with the signer name as a prefix (translating slashes to colons). + // For example, for the signer name `example.com/foo`, valid + // ClusterTrustBundle object names include `example.com:foo:abc` and + // `example.com:foo:v1`. + // + // If signerName is empty, then the ClusterTrustBundle object's name must + // not have such a prefix. + // + // List/watch requests for ClusterTrustBundles can filter on this field + // using a `spec.signerName=NAME` field selector. + // + // +optional + SignerName string `json:"signerName,omitempty" protobuf:"bytes,1,opt,name=signerName"` + + // trustBundle contains the individual X.509 trust anchors for this + // bundle, as PEM bundle of PEM-wrapped, DER-formatted X.509 certificates. + // + // The data must consist only of PEM certificate blocks that parse as valid + // X.509 certificates. Each certificate must include a basic constraints + // extension with the CA bit set. The API server will reject objects that + // contain duplicate certificates, or that use PEM block headers. + // + // Users of ClusterTrustBundles, including Kubelet, are free to reorder and + // deduplicate certificate blocks in this file according to their own logic, + // as well as to drop PEM block headers and inter-block data. + TrustBundle string `json:"trustBundle" protobuf:"bytes,2,opt,name=trustBundle"` +} + +// +k8s:prerelease-lifecycle-gen:introduced=1.33 +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ClusterTrustBundleList is a collection of ClusterTrustBundle objects +type ClusterTrustBundleList struct { + metav1.TypeMeta `json:",inline"` + + // metadata contains the list metadata. + // + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // items is a collection of ClusterTrustBundle objects + Items []ClusterTrustBundle `json:"items" protobuf:"bytes,2,rep,name=items"` +} diff --git a/e2e/vendor/k8s.io/api/certificates/v1beta1/types_swagger_doc_generated.go b/e2e/vendor/k8s.io/api/certificates/v1beta1/types_swagger_doc_generated.go index f9ab1f13d..58c69e54d 100644 --- a/e2e/vendor/k8s.io/api/certificates/v1beta1/types_swagger_doc_generated.go +++ b/e2e/vendor/k8s.io/api/certificates/v1beta1/types_swagger_doc_generated.go @@ -75,4 +75,34 @@ func (CertificateSigningRequestStatus) SwaggerDoc() map[string]string { return map_CertificateSigningRequestStatus } +var map_ClusterTrustBundle = map[string]string{ + "": "ClusterTrustBundle is a cluster-scoped container for X.509 trust anchors (root certificates).\n\nClusterTrustBundle objects are considered to be readable by any authenticated user in the cluster, because they can be mounted by pods using the `clusterTrustBundle` projection. All service accounts have read access to ClusterTrustBundles by default. Users who only have namespace-level access to a cluster can read ClusterTrustBundles by impersonating a serviceaccount that they have access to.\n\nIt can be optionally associated with a particular assigner, in which case it contains one valid set of trust anchors for that signer. Signers may have multiple associated ClusterTrustBundles; each is an independent set of trust anchors for that signer. Admission control is used to enforce that only users with permissions on the signer can create or modify the corresponding bundle.", + "metadata": "metadata contains the object metadata.", + "spec": "spec contains the signer (if any) and trust anchors.", +} + +func (ClusterTrustBundle) SwaggerDoc() map[string]string { + return map_ClusterTrustBundle +} + +var map_ClusterTrustBundleList = map[string]string{ + "": "ClusterTrustBundleList is a collection of ClusterTrustBundle objects", + "metadata": "metadata contains the list metadata.", + "items": "items is a collection of ClusterTrustBundle objects", +} + +func (ClusterTrustBundleList) SwaggerDoc() map[string]string { + return map_ClusterTrustBundleList +} + +var map_ClusterTrustBundleSpec = map[string]string{ + "": "ClusterTrustBundleSpec contains the signer and trust anchors.", + "signerName": "signerName indicates the associated signer, if any.\n\nIn order to create or update a ClusterTrustBundle that sets signerName, you must have the following cluster-scoped permission: group=certificates.k8s.io resource=signers resourceName= verb=attest.\n\nIf signerName is not empty, then the ClusterTrustBundle object must be named with the signer name as a prefix (translating slashes to colons). For example, for the signer name `example.com/foo`, valid ClusterTrustBundle object names include `example.com:foo:abc` and `example.com:foo:v1`.\n\nIf signerName is empty, then the ClusterTrustBundle object's name must not have such a prefix.\n\nList/watch requests for ClusterTrustBundles can filter on this field using a `spec.signerName=NAME` field selector.", + "trustBundle": "trustBundle contains the individual X.509 trust anchors for this bundle, as PEM bundle of PEM-wrapped, DER-formatted X.509 certificates.\n\nThe data must consist only of PEM certificate blocks that parse as valid X.509 certificates. Each certificate must include a basic constraints extension with the CA bit set. The API server will reject objects that contain duplicate certificates, or that use PEM block headers.\n\nUsers of ClusterTrustBundles, including Kubelet, are free to reorder and deduplicate certificate blocks in this file according to their own logic, as well as to drop PEM block headers and inter-block data.", +} + +func (ClusterTrustBundleSpec) SwaggerDoc() map[string]string { + return map_ClusterTrustBundleSpec +} + // AUTO-GENERATED FUNCTIONS END HERE diff --git a/e2e/vendor/k8s.io/api/certificates/v1beta1/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/api/certificates/v1beta1/zz_generated.deepcopy.go index a315e2ac6..854e83473 100644 --- a/e2e/vendor/k8s.io/api/certificates/v1beta1/zz_generated.deepcopy.go +++ b/e2e/vendor/k8s.io/api/certificates/v1beta1/zz_generated.deepcopy.go @@ -188,6 +188,82 @@ func (in *CertificateSigningRequestStatus) DeepCopy() *CertificateSigningRequest return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterTrustBundle) DeepCopyInto(out *ClusterTrustBundle) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTrustBundle. +func (in *ClusterTrustBundle) DeepCopy() *ClusterTrustBundle { + if in == nil { + return nil + } + out := new(ClusterTrustBundle) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterTrustBundle) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterTrustBundleList) DeepCopyInto(out *ClusterTrustBundleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterTrustBundle, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTrustBundleList. +func (in *ClusterTrustBundleList) DeepCopy() *ClusterTrustBundleList { + if in == nil { + return nil + } + out := new(ClusterTrustBundleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterTrustBundleList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterTrustBundleSpec) DeepCopyInto(out *ClusterTrustBundleSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTrustBundleSpec. +func (in *ClusterTrustBundleSpec) DeepCopy() *ClusterTrustBundleSpec { + if in == nil { + return nil + } + out := new(ClusterTrustBundleSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in ExtraValue) DeepCopyInto(out *ExtraValue) { { diff --git a/e2e/vendor/k8s.io/api/certificates/v1beta1/zz_generated.prerelease-lifecycle.go b/e2e/vendor/k8s.io/api/certificates/v1beta1/zz_generated.prerelease-lifecycle.go index 480a32936..062b46f16 100644 --- a/e2e/vendor/k8s.io/api/certificates/v1beta1/zz_generated.prerelease-lifecycle.go +++ b/e2e/vendor/k8s.io/api/certificates/v1beta1/zz_generated.prerelease-lifecycle.go @@ -72,3 +72,39 @@ func (in *CertificateSigningRequestList) APILifecycleReplacement() schema.GroupV func (in *CertificateSigningRequestList) APILifecycleRemoved() (major, minor int) { return 1, 22 } + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *ClusterTrustBundle) APILifecycleIntroduced() (major, minor int) { + return 1, 33 +} + +// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. +func (in *ClusterTrustBundle) APILifecycleDeprecated() (major, minor int) { + return 1, 36 +} + +// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. +func (in *ClusterTrustBundle) APILifecycleRemoved() (major, minor int) { + return 1, 39 +} + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *ClusterTrustBundleList) APILifecycleIntroduced() (major, minor int) { + return 1, 33 +} + +// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. +func (in *ClusterTrustBundleList) APILifecycleDeprecated() (major, minor int) { + return 1, 36 +} + +// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. +func (in *ClusterTrustBundleList) APILifecycleRemoved() (major, minor int) { + return 1, 39 +} diff --git a/e2e/vendor/k8s.io/api/coordination/v1/doc.go b/e2e/vendor/k8s.io/api/coordination/v1/doc.go index 9b2fbbda3..82ae6340c 100644 --- a/e2e/vendor/k8s.io/api/coordination/v1/doc.go +++ b/e2e/vendor/k8s.io/api/coordination/v1/doc.go @@ -21,4 +21,4 @@ limitations under the License. // +groupName=coordination.k8s.io -package v1 // import "k8s.io/api/coordination/v1" +package v1 diff --git a/e2e/vendor/k8s.io/api/coordination/v1alpha2/doc.go b/e2e/vendor/k8s.io/api/coordination/v1alpha2/doc.go index 5e6d65530..dff7df47f 100644 --- a/e2e/vendor/k8s.io/api/coordination/v1alpha2/doc.go +++ b/e2e/vendor/k8s.io/api/coordination/v1alpha2/doc.go @@ -21,4 +21,4 @@ limitations under the License. // +groupName=coordination.k8s.io -package v1alpha2 // import "k8s.io/api/coordination/v1alpha2" +package v1alpha2 diff --git a/e2e/vendor/k8s.io/api/coordination/v1alpha2/generated.proto b/e2e/vendor/k8s.io/api/coordination/v1alpha2/generated.proto index 7e56cd7f9..250c6113e 100644 --- a/e2e/vendor/k8s.io/api/coordination/v1alpha2/generated.proto +++ b/e2e/vendor/k8s.io/api/coordination/v1alpha2/generated.proto @@ -92,8 +92,6 @@ message LeaseCandidateSpec { // If multiple candidates for the same Lease return different strategies, the strategy provided // by the candidate with the latest BinaryVersion will be used. If there is still conflict, // this is a user error and coordinated leader election will not operate the Lease until resolved. - // (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled. - // +featureGate=CoordinatedLeaderElection // +required optional string strategy = 6; } diff --git a/e2e/vendor/k8s.io/api/coordination/v1alpha2/types.go b/e2e/vendor/k8s.io/api/coordination/v1alpha2/types.go index 2f53b097a..13e1deb06 100644 --- a/e2e/vendor/k8s.io/api/coordination/v1alpha2/types.go +++ b/e2e/vendor/k8s.io/api/coordination/v1alpha2/types.go @@ -73,8 +73,6 @@ type LeaseCandidateSpec struct { // If multiple candidates for the same Lease return different strategies, the strategy provided // by the candidate with the latest BinaryVersion will be used. If there is still conflict, // this is a user error and coordinated leader election will not operate the Lease until resolved. - // (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled. - // +featureGate=CoordinatedLeaderElection // +required Strategy v1.CoordinatedLeaseStrategy `json:"strategy,omitempty" protobuf:"bytes,6,opt,name=strategy"` } diff --git a/e2e/vendor/k8s.io/api/coordination/v1alpha2/types_swagger_doc_generated.go b/e2e/vendor/k8s.io/api/coordination/v1alpha2/types_swagger_doc_generated.go index 39534e6ad..f7e29849e 100644 --- a/e2e/vendor/k8s.io/api/coordination/v1alpha2/types_swagger_doc_generated.go +++ b/e2e/vendor/k8s.io/api/coordination/v1alpha2/types_swagger_doc_generated.go @@ -54,7 +54,7 @@ var map_LeaseCandidateSpec = map[string]string{ "renewTime": "RenewTime is the time that the LeaseCandidate was last updated. Any time a Lease needs to do leader election, the PingTime field is updated to signal to the LeaseCandidate that they should update the RenewTime. Old LeaseCandidate objects are also garbage collected if it has been hours since the last renew. The PingTime field is updated regularly to prevent garbage collection for still active LeaseCandidates.", "binaryVersion": "BinaryVersion is the binary version. It must be in a semver format without leading `v`. This field is required.", "emulationVersion": "EmulationVersion is the emulation version. It must be in a semver format without leading `v`. EmulationVersion must be less than or equal to BinaryVersion. This field is required when strategy is \"OldestEmulationVersion\"", - "strategy": "Strategy is the strategy that coordinated leader election will use for picking the leader. If multiple candidates for the same Lease return different strategies, the strategy provided by the candidate with the latest BinaryVersion will be used. If there is still conflict, this is a user error and coordinated leader election will not operate the Lease until resolved. (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.", + "strategy": "Strategy is the strategy that coordinated leader election will use for picking the leader. If multiple candidates for the same Lease return different strategies, the strategy provided by the candidate with the latest BinaryVersion will be used. If there is still conflict, this is a user error and coordinated leader election will not operate the Lease until resolved.", } func (LeaseCandidateSpec) SwaggerDoc() map[string]string { diff --git a/e2e/vendor/k8s.io/api/coordination/v1beta1/doc.go b/e2e/vendor/k8s.io/api/coordination/v1beta1/doc.go index e733411aa..cab8becf6 100644 --- a/e2e/vendor/k8s.io/api/coordination/v1beta1/doc.go +++ b/e2e/vendor/k8s.io/api/coordination/v1beta1/doc.go @@ -21,4 +21,4 @@ limitations under the License. // +groupName=coordination.k8s.io -package v1beta1 // import "k8s.io/api/coordination/v1beta1" +package v1beta1 diff --git a/e2e/vendor/k8s.io/api/coordination/v1beta1/generated.pb.go b/e2e/vendor/k8s.io/api/coordination/v1beta1/generated.pb.go index bea9b8146..52fd4167f 100644 --- a/e2e/vendor/k8s.io/api/coordination/v1beta1/generated.pb.go +++ b/e2e/vendor/k8s.io/api/coordination/v1beta1/generated.pb.go @@ -74,10 +74,94 @@ func (m *Lease) XXX_DiscardUnknown() { var xxx_messageInfo_Lease proto.InternalMessageInfo +func (m *LeaseCandidate) Reset() { *m = LeaseCandidate{} } +func (*LeaseCandidate) ProtoMessage() {} +func (*LeaseCandidate) Descriptor() ([]byte, []int) { + return fileDescriptor_8d4e223b8bb23da3, []int{1} +} +func (m *LeaseCandidate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LeaseCandidate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *LeaseCandidate) XXX_Merge(src proto.Message) { + xxx_messageInfo_LeaseCandidate.Merge(m, src) +} +func (m *LeaseCandidate) XXX_Size() int { + return m.Size() +} +func (m *LeaseCandidate) XXX_DiscardUnknown() { + xxx_messageInfo_LeaseCandidate.DiscardUnknown(m) +} + +var xxx_messageInfo_LeaseCandidate proto.InternalMessageInfo + +func (m *LeaseCandidateList) Reset() { *m = LeaseCandidateList{} } +func (*LeaseCandidateList) ProtoMessage() {} +func (*LeaseCandidateList) Descriptor() ([]byte, []int) { + return fileDescriptor_8d4e223b8bb23da3, []int{2} +} +func (m *LeaseCandidateList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LeaseCandidateList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *LeaseCandidateList) XXX_Merge(src proto.Message) { + xxx_messageInfo_LeaseCandidateList.Merge(m, src) +} +func (m *LeaseCandidateList) XXX_Size() int { + return m.Size() +} +func (m *LeaseCandidateList) XXX_DiscardUnknown() { + xxx_messageInfo_LeaseCandidateList.DiscardUnknown(m) +} + +var xxx_messageInfo_LeaseCandidateList proto.InternalMessageInfo + +func (m *LeaseCandidateSpec) Reset() { *m = LeaseCandidateSpec{} } +func (*LeaseCandidateSpec) ProtoMessage() {} +func (*LeaseCandidateSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_8d4e223b8bb23da3, []int{3} +} +func (m *LeaseCandidateSpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LeaseCandidateSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *LeaseCandidateSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_LeaseCandidateSpec.Merge(m, src) +} +func (m *LeaseCandidateSpec) XXX_Size() int { + return m.Size() +} +func (m *LeaseCandidateSpec) XXX_DiscardUnknown() { + xxx_messageInfo_LeaseCandidateSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_LeaseCandidateSpec proto.InternalMessageInfo + func (m *LeaseList) Reset() { *m = LeaseList{} } func (*LeaseList) ProtoMessage() {} func (*LeaseList) Descriptor() ([]byte, []int) { - return fileDescriptor_8d4e223b8bb23da3, []int{1} + return fileDescriptor_8d4e223b8bb23da3, []int{4} } func (m *LeaseList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -105,7 +189,7 @@ var xxx_messageInfo_LeaseList proto.InternalMessageInfo func (m *LeaseSpec) Reset() { *m = LeaseSpec{} } func (*LeaseSpec) ProtoMessage() {} func (*LeaseSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_8d4e223b8bb23da3, []int{2} + return fileDescriptor_8d4e223b8bb23da3, []int{5} } func (m *LeaseSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -132,6 +216,9 @@ var xxx_messageInfo_LeaseSpec proto.InternalMessageInfo func init() { proto.RegisterType((*Lease)(nil), "k8s.io.api.coordination.v1beta1.Lease") + proto.RegisterType((*LeaseCandidate)(nil), "k8s.io.api.coordination.v1beta1.LeaseCandidate") + proto.RegisterType((*LeaseCandidateList)(nil), "k8s.io.api.coordination.v1beta1.LeaseCandidateList") + proto.RegisterType((*LeaseCandidateSpec)(nil), "k8s.io.api.coordination.v1beta1.LeaseCandidateSpec") proto.RegisterType((*LeaseList)(nil), "k8s.io.api.coordination.v1beta1.LeaseList") proto.RegisterType((*LeaseSpec)(nil), "k8s.io.api.coordination.v1beta1.LeaseSpec") } @@ -141,45 +228,54 @@ func init() { } var fileDescriptor_8d4e223b8bb23da3 = []byte{ - // 600 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xdf, 0x4e, 0xd4, 0x4e, - 0x14, 0xc7, 0xb7, 0xb0, 0xfb, 0xfb, 0xb1, 0xb3, 0xf2, 0x27, 0x23, 0x17, 0x0d, 0x17, 0x2d, 0xe1, - 0xc2, 0x10, 0x12, 0xa7, 0x82, 0xc6, 0x18, 0x13, 0x13, 0x2d, 0x9a, 0x48, 0x2c, 0xd1, 0x14, 0xae, - 0x0c, 0x89, 0xce, 0xb6, 0x87, 0xee, 0x08, 0xed, 0xd4, 0x99, 0x59, 0x0c, 0x77, 0x3e, 0x82, 0x4f, - 0xa3, 0xf1, 0x0d, 0xb8, 0xe4, 0x92, 0xab, 0x46, 0xc6, 0xb7, 0xf0, 0xca, 0xcc, 0x6c, 0x61, 0x61, - 0x81, 0xb0, 0xf1, 0x6e, 0xe7, 0x9c, 0xf3, 0xfd, 0x9c, 0xef, 0x9c, 0xb3, 0x53, 0x14, 0xec, 0x3d, - 0x91, 0x84, 0xf1, 0x80, 0x96, 0x2c, 0x48, 0x38, 0x17, 0x29, 0x2b, 0xa8, 0x62, 0xbc, 0x08, 0x0e, - 0x56, 0xbb, 0xa0, 0xe8, 0x6a, 0x90, 0x41, 0x01, 0x82, 0x2a, 0x48, 0x49, 0x29, 0xb8, 0xe2, 0xd8, - 0x1f, 0x08, 0x08, 0x2d, 0x19, 0xb9, 0x28, 0x20, 0xb5, 0x60, 0xe1, 0x7e, 0xc6, 0x54, 0xaf, 0xdf, - 0x25, 0x09, 0xcf, 0x83, 0x8c, 0x67, 0x3c, 0xb0, 0xba, 0x6e, 0x7f, 0xd7, 0x9e, 0xec, 0xc1, 0xfe, - 0x1a, 0xf0, 0x16, 0x56, 0x6e, 0x36, 0x30, 0xda, 0x7b, 0xe1, 0xd1, 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, 0xfb, 0xdc, 0xd5, 0x95, 0x3f, 0xfb, 0xee, - 0x72, 0x2a, 0x1e, 0xad, 0x0d, 0x5f, 0x1d, 0x9d, 0x7a, 0x8d, 0xe3, 0x53, 0xaf, 0x71, 0x72, 0xea, - 0x35, 0xbe, 0x6a, 0xcf, 0x39, 0xd2, 0x9e, 0x73, 0xac, 0x3d, 0xe7, 0x44, 0x7b, 0xce, 0x2f, 0xed, - 0x39, 0xdf, 0x7e, 0x7b, 0x8d, 0xf7, 0xfe, 0x2d, 0x1f, 0xc8, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x57, 0x93, 0xf3, 0xef, 0x42, 0x05, 0x00, 0x00, + // 750 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xdd, 0x4e, 0x1b, 0x39, + 0x18, 0xcd, 0x40, 0xb2, 0x9b, 0x38, 0x04, 0xb2, 0x5e, 0x56, 0x1a, 0x71, 0x31, 0x83, 0x72, 0xb1, + 0x42, 0x48, 0xeb, 0x59, 0x60, 0xb5, 0x5a, 0x6d, 0x55, 0xa9, 0x1d, 0x40, 0x2d, 0x6a, 0x68, 0x91, + 0xa1, 0x95, 0x5a, 0x21, 0xb5, 0xce, 0x8c, 0x99, 0xb8, 0x30, 0x3f, 0xf5, 0x38, 0x54, 0xb9, 0xeb, + 0x23, 0xf4, 0x69, 0x5a, 0xf5, 0x0d, 0xd2, 0x3b, 0x2e, 0xb9, 0x8a, 0xca, 0x54, 0xea, 0x43, 0xf4, + 0xaa, 0xb2, 0x33, 0xf9, 0x27, 0x22, 0x6d, 0x11, 0x77, 0xf1, 0xf7, 0x9d, 0x73, 0xfc, 0x1d, 0xfb, + 0x38, 0x1a, 0x60, 0x1d, 0xff, 0x17, 0x23, 0x16, 0x5a, 0x24, 0x62, 0x96, 0x13, 0x86, 0xdc, 0x65, + 0x01, 0x11, 0x2c, 0x0c, 0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86, 0xcf, 0xc7, 0x92, 0xbb, 0x79, 0xad, 0xa9, + 0x85, 0xb7, 0xc1, 0x42, 0xc4, 0xe9, 0x11, 0xe5, 0x9c, 0xba, 0x9d, 0xdb, 0xd5, 0x7f, 0x55, 0xfb, + 0xfc, 0x9e, 0xb4, 0xcd, 0x85, 0xbd, 0xe1, 0x16, 0x1e, 0xc5, 0xda, 0xdb, 0xad, 0x0b, 0x23, 0x73, + 0x76, 0x61, 0x64, 0xce, 0x2f, 0x8c, 0xcc, 0x9b, 0xc4, 0xd0, 0x5a, 0x89, 0xa1, 0x9d, 0x25, 0x86, + 0x76, 0x9e, 0x18, 0xda, 0xa7, 0xc4, 0xd0, 0xde, 0x7e, 0x36, 0x32, 0xcf, 0xcc, 0x2b, 0x3e, 0x50, + 0xbe, 0x05, 0x00, 0x00, 0xff, 0xff, 0xff, 0x56, 0x51, 0x57, 0xc2, 0x08, 0x00, 0x00, } func (m *Lease) Marshal() (dAtA []byte, err error) { @@ -225,6 +321,163 @@ func (m *Lease) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *LeaseCandidate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LeaseCandidate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaseCandidate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *LeaseCandidateList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LeaseCandidateList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaseCandidateList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *LeaseCandidateSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LeaseCandidateSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaseCandidateSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Strategy) + copy(dAtA[i:], m.Strategy) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Strategy))) + i-- + dAtA[i] = 0x32 + i -= len(m.EmulationVersion) + copy(dAtA[i:], m.EmulationVersion) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.EmulationVersion))) + i-- + dAtA[i] = 0x2a + i -= len(m.BinaryVersion) + copy(dAtA[i:], m.BinaryVersion) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.BinaryVersion))) + i-- + dAtA[i] = 0x22 + if m.RenewTime != nil { + { + size, err := m.RenewTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.PingTime != nil { + { + size, err := m.PingTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.LeaseName) + copy(dAtA[i:], m.LeaseName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.LeaseName))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *LeaseList) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -374,6 +627,61 @@ func (m *Lease) Size() (n int) { return n } +func (m *LeaseCandidate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *LeaseCandidateList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *LeaseCandidateSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.LeaseName) + n += 1 + l + sovGenerated(uint64(l)) + if m.PingTime != nil { + l = m.PingTime.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.RenewTime != nil { + l = m.RenewTime.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.BinaryVersion) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.EmulationVersion) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Strategy) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func (m *LeaseList) Size() (n int) { if m == nil { return 0 @@ -443,6 +751,48 @@ func (this *Lease) String() string { }, "") return s } +func (this *LeaseCandidate) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&LeaseCandidate{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "LeaseCandidateSpec", "LeaseCandidateSpec", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *LeaseCandidateList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]LeaseCandidate{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "LeaseCandidate", "LeaseCandidate", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&LeaseCandidateList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *LeaseCandidateSpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&LeaseCandidateSpec{`, + `LeaseName:` + fmt.Sprintf("%v", this.LeaseName) + `,`, + `PingTime:` + strings.Replace(fmt.Sprintf("%v", this.PingTime), "MicroTime", "v1.MicroTime", 1) + `,`, + `RenewTime:` + strings.Replace(fmt.Sprintf("%v", this.RenewTime), "MicroTime", "v1.MicroTime", 1) + `,`, + `BinaryVersion:` + fmt.Sprintf("%v", this.BinaryVersion) + `,`, + `EmulationVersion:` + fmt.Sprintf("%v", this.EmulationVersion) + `,`, + `Strategy:` + fmt.Sprintf("%v", this.Strategy) + `,`, + `}`, + }, "") + return s +} func (this *LeaseList) String() string { if this == nil { return "nil" @@ -599,6 +949,489 @@ func (m *Lease) Unmarshal(dAtA []byte) error { } return nil } +func (m *LeaseCandidate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LeaseCandidate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LeaseCandidate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LeaseCandidateList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LeaseCandidateList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LeaseCandidateList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, LeaseCandidate{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LeaseCandidateSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LeaseCandidateSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LeaseCandidateSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LeaseName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LeaseName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PingTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PingTime == nil { + m.PingTime = &v1.MicroTime{} + } + if err := m.PingTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RenewTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RenewTime == nil { + m.RenewTime = &v1.MicroTime{} + } + if err := m.RenewTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BinaryVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BinaryVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EmulationVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EmulationVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Strategy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Strategy = k8s_io_api_coordination_v1.CoordinatedLeaseStrategy(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *LeaseList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/e2e/vendor/k8s.io/api/coordination/v1beta1/generated.proto b/e2e/vendor/k8s.io/api/coordination/v1beta1/generated.proto index 088811a74..7ca043f52 100644 --- a/e2e/vendor/k8s.io/api/coordination/v1beta1/generated.proto +++ b/e2e/vendor/k8s.io/api/coordination/v1beta1/generated.proto @@ -41,6 +41,75 @@ message Lease { optional LeaseSpec spec = 2; } +// LeaseCandidate defines a candidate for a Lease object. +// Candidates are created such that coordinated leader election will pick the best leader from the list of candidates. +message LeaseCandidate { + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // spec contains the specification of the Lease. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional + optional LeaseCandidateSpec spec = 2; +} + +// LeaseCandidateList is a list of Lease objects. +message LeaseCandidateList { + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // items is a list of schema objects. + repeated LeaseCandidate items = 2; +} + +// LeaseCandidateSpec is a specification of a Lease. +message LeaseCandidateSpec { + // LeaseName is the name of the lease for which this candidate is contending. + // The limits on this field are the same as on Lease.name. Multiple lease candidates + // may reference the same Lease.name. + // This field is immutable. + // +required + optional string leaseName = 1; + + // PingTime is the last time that the server has requested the LeaseCandidate + // to renew. It is only done during leader election to check if any + // LeaseCandidates have become ineligible. When PingTime is updated, the + // LeaseCandidate will respond by updating RenewTime. + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime pingTime = 2; + + // RenewTime is the time that the LeaseCandidate was last updated. + // Any time a Lease needs to do leader election, the PingTime field + // is updated to signal to the LeaseCandidate that they should update + // the RenewTime. + // Old LeaseCandidate objects are also garbage collected if it has been hours + // since the last renew. The PingTime field is updated regularly to prevent + // garbage collection for still active LeaseCandidates. + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime renewTime = 3; + + // BinaryVersion is the binary version. It must be in a semver format without leading `v`. + // This field is required. + // +required + optional string binaryVersion = 4; + + // EmulationVersion is the emulation version. It must be in a semver format without leading `v`. + // EmulationVersion must be less than or equal to BinaryVersion. + // This field is required when strategy is "OldestEmulationVersion" + // +optional + optional string emulationVersion = 5; + + // Strategy is the strategy that coordinated leader election will use for picking the leader. + // If multiple candidates for the same Lease return different strategies, the strategy provided + // by the candidate with the latest BinaryVersion will be used. If there is still conflict, + // this is a user error and coordinated leader election will not operate the Lease until resolved. + // +required + optional string strategy = 6; +} + // LeaseList is a list of Lease objects. message LeaseList { // Standard list metadata. diff --git a/e2e/vendor/k8s.io/api/coordination/v1beta1/register.go b/e2e/vendor/k8s.io/api/coordination/v1beta1/register.go index 85efaa64e..bd0016423 100644 --- a/e2e/vendor/k8s.io/api/coordination/v1beta1/register.go +++ b/e2e/vendor/k8s.io/api/coordination/v1beta1/register.go @@ -46,6 +46,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &Lease{}, &LeaseList{}, + &LeaseCandidate{}, + &LeaseCandidateList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) diff --git a/e2e/vendor/k8s.io/api/coordination/v1beta1/types.go b/e2e/vendor/k8s.io/api/coordination/v1beta1/types.go index d63fc30a9..781d29efc 100644 --- a/e2e/vendor/k8s.io/api/coordination/v1beta1/types.go +++ b/e2e/vendor/k8s.io/api/coordination/v1beta1/types.go @@ -91,3 +91,76 @@ type LeaseList struct { // items is a list of schema objects. Items []Lease `json:"items" protobuf:"bytes,2,rep,name=items"` } + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.33 + +// LeaseCandidate defines a candidate for a Lease object. +// Candidates are created such that coordinated leader election will pick the best leader from the list of candidates. +type LeaseCandidate struct { + metav1.TypeMeta `json:",inline"` + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // spec contains the specification of the Lease. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional + Spec LeaseCandidateSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` +} + +// LeaseCandidateSpec is a specification of a Lease. +type LeaseCandidateSpec struct { + // LeaseName is the name of the lease for which this candidate is contending. + // The limits on this field are the same as on Lease.name. Multiple lease candidates + // may reference the same Lease.name. + // This field is immutable. + // +required + LeaseName string `json:"leaseName" protobuf:"bytes,1,name=leaseName"` + // PingTime is the last time that the server has requested the LeaseCandidate + // to renew. It is only done during leader election to check if any + // LeaseCandidates have become ineligible. When PingTime is updated, the + // LeaseCandidate will respond by updating RenewTime. + // +optional + PingTime *metav1.MicroTime `json:"pingTime,omitempty" protobuf:"bytes,2,opt,name=pingTime"` + // RenewTime is the time that the LeaseCandidate was last updated. + // Any time a Lease needs to do leader election, the PingTime field + // is updated to signal to the LeaseCandidate that they should update + // the RenewTime. + // Old LeaseCandidate objects are also garbage collected if it has been hours + // since the last renew. The PingTime field is updated regularly to prevent + // garbage collection for still active LeaseCandidates. + // +optional + RenewTime *metav1.MicroTime `json:"renewTime,omitempty" protobuf:"bytes,3,opt,name=renewTime"` + // BinaryVersion is the binary version. It must be in a semver format without leading `v`. + // This field is required. + // +required + BinaryVersion string `json:"binaryVersion" protobuf:"bytes,4,name=binaryVersion"` + // EmulationVersion is the emulation version. It must be in a semver format without leading `v`. + // EmulationVersion must be less than or equal to BinaryVersion. + // This field is required when strategy is "OldestEmulationVersion" + // +optional + EmulationVersion string `json:"emulationVersion,omitempty" protobuf:"bytes,5,opt,name=emulationVersion"` + // Strategy is the strategy that coordinated leader election will use for picking the leader. + // If multiple candidates for the same Lease return different strategies, the strategy provided + // by the candidate with the latest BinaryVersion will be used. If there is still conflict, + // this is a user error and coordinated leader election will not operate the Lease until resolved. + // +required + Strategy v1.CoordinatedLeaseStrategy `json:"strategy,omitempty" protobuf:"bytes,6,opt,name=strategy"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.33 + +// LeaseCandidateList is a list of Lease objects. +type LeaseCandidateList struct { + metav1.TypeMeta `json:",inline"` + // Standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // items is a list of schema objects. + Items []LeaseCandidate `json:"items" protobuf:"bytes,2,rep,name=items"` +} diff --git a/e2e/vendor/k8s.io/api/coordination/v1beta1/types_swagger_doc_generated.go b/e2e/vendor/k8s.io/api/coordination/v1beta1/types_swagger_doc_generated.go index 50fe8ea18..35812b77f 100644 --- a/e2e/vendor/k8s.io/api/coordination/v1beta1/types_swagger_doc_generated.go +++ b/e2e/vendor/k8s.io/api/coordination/v1beta1/types_swagger_doc_generated.go @@ -37,6 +37,40 @@ func (Lease) SwaggerDoc() map[string]string { return map_Lease } +var map_LeaseCandidate = map[string]string{ + "": "LeaseCandidate defines a candidate for a Lease object. Candidates are created such that coordinated leader election will pick the best leader from the list of candidates.", + "metadata": "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec contains the specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", +} + +func (LeaseCandidate) SwaggerDoc() map[string]string { + return map_LeaseCandidate +} + +var map_LeaseCandidateList = map[string]string{ + "": "LeaseCandidateList is a list of Lease objects.", + "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "items": "items is a list of schema objects.", +} + +func (LeaseCandidateList) SwaggerDoc() map[string]string { + return map_LeaseCandidateList +} + +var map_LeaseCandidateSpec = map[string]string{ + "": "LeaseCandidateSpec is a specification of a Lease.", + "leaseName": "LeaseName is the name of the lease for which this candidate is contending. The limits on this field are the same as on Lease.name. Multiple lease candidates may reference the same Lease.name. This field is immutable.", + "pingTime": "PingTime is the last time that the server has requested the LeaseCandidate to renew. It is only done during leader election to check if any LeaseCandidates have become ineligible. When PingTime is updated, the LeaseCandidate will respond by updating RenewTime.", + "renewTime": "RenewTime is the time that the LeaseCandidate was last updated. Any time a Lease needs to do leader election, the PingTime field is updated to signal to the LeaseCandidate that they should update the RenewTime. Old LeaseCandidate objects are also garbage collected if it has been hours since the last renew. The PingTime field is updated regularly to prevent garbage collection for still active LeaseCandidates.", + "binaryVersion": "BinaryVersion is the binary version. It must be in a semver format without leading `v`. This field is required.", + "emulationVersion": "EmulationVersion is the emulation version. It must be in a semver format without leading `v`. EmulationVersion must be less than or equal to BinaryVersion. This field is required when strategy is \"OldestEmulationVersion\"", + "strategy": "Strategy is the strategy that coordinated leader election will use for picking the leader. If multiple candidates for the same Lease return different strategies, the strategy provided by the candidate with the latest BinaryVersion will be used. If there is still conflict, this is a user error and coordinated leader election will not operate the Lease until resolved.", +} + +func (LeaseCandidateSpec) SwaggerDoc() map[string]string { + return map_LeaseCandidateSpec +} + var map_LeaseList = map[string]string{ "": "LeaseList is a list of Lease objects.", "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", diff --git a/e2e/vendor/k8s.io/api/coordination/v1beta1/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/api/coordination/v1beta1/zz_generated.deepcopy.go index dcef1e346..b990ee247 100644 --- a/e2e/vendor/k8s.io/api/coordination/v1beta1/zz_generated.deepcopy.go +++ b/e2e/vendor/k8s.io/api/coordination/v1beta1/zz_generated.deepcopy.go @@ -53,6 +53,90 @@ func (in *Lease) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LeaseCandidate) DeepCopyInto(out *LeaseCandidate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaseCandidate. +func (in *LeaseCandidate) DeepCopy() *LeaseCandidate { + if in == nil { + return nil + } + out := new(LeaseCandidate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LeaseCandidate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LeaseCandidateList) DeepCopyInto(out *LeaseCandidateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]LeaseCandidate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaseCandidateList. +func (in *LeaseCandidateList) DeepCopy() *LeaseCandidateList { + if in == nil { + return nil + } + out := new(LeaseCandidateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LeaseCandidateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LeaseCandidateSpec) DeepCopyInto(out *LeaseCandidateSpec) { + *out = *in + if in.PingTime != nil { + in, out := &in.PingTime, &out.PingTime + *out = (*in).DeepCopy() + } + if in.RenewTime != nil { + in, out := &in.RenewTime, &out.RenewTime + *out = (*in).DeepCopy() + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaseCandidateSpec. +func (in *LeaseCandidateSpec) DeepCopy() *LeaseCandidateSpec { + if in == nil { + return nil + } + out := new(LeaseCandidateSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LeaseList) DeepCopyInto(out *LeaseList) { *out = *in diff --git a/e2e/vendor/k8s.io/api/coordination/v1beta1/zz_generated.prerelease-lifecycle.go b/e2e/vendor/k8s.io/api/coordination/v1beta1/zz_generated.prerelease-lifecycle.go index 18926aa10..73636edfa 100644 --- a/e2e/vendor/k8s.io/api/coordination/v1beta1/zz_generated.prerelease-lifecycle.go +++ b/e2e/vendor/k8s.io/api/coordination/v1beta1/zz_generated.prerelease-lifecycle.go @@ -49,6 +49,42 @@ func (in *Lease) APILifecycleRemoved() (major, minor int) { return 1, 22 } +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *LeaseCandidate) APILifecycleIntroduced() (major, minor int) { + return 1, 33 +} + +// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. +func (in *LeaseCandidate) APILifecycleDeprecated() (major, minor int) { + return 1, 36 +} + +// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. +func (in *LeaseCandidate) APILifecycleRemoved() (major, minor int) { + return 1, 39 +} + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *LeaseCandidateList) APILifecycleIntroduced() (major, minor int) { + return 1, 33 +} + +// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. +func (in *LeaseCandidateList) APILifecycleDeprecated() (major, minor int) { + return 1, 36 +} + +// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. +func (in *LeaseCandidateList) APILifecycleRemoved() (major, minor int) { + return 1, 39 +} + // APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. func (in *LeaseList) APILifecycleIntroduced() (major, minor int) { diff --git a/e2e/vendor/k8s.io/api/core/v1/doc.go b/e2e/vendor/k8s.io/api/core/v1/doc.go index bc0041b33..e4e9196ae 100644 --- a/e2e/vendor/k8s.io/api/core/v1/doc.go +++ b/e2e/vendor/k8s.io/api/core/v1/doc.go @@ -21,4 +21,4 @@ limitations under the License. // +groupName= // Package v1 is the v1 version of the core API. -package v1 // import "k8s.io/api/core/v1" +package v1 diff --git a/e2e/vendor/k8s.io/api/core/v1/generated.pb.go b/e2e/vendor/k8s.io/api/core/v1/generated.pb.go index 9d466c6d7..a4b8f5842 100644 --- a/e2e/vendor/k8s.io/api/core/v1/generated.pb.go +++ b/e2e/vendor/k8s.io/api/core/v1/generated.pb.go @@ -3213,10 +3213,38 @@ func (m *NodeStatus) XXX_DiscardUnknown() { var xxx_messageInfo_NodeStatus proto.InternalMessageInfo +func (m *NodeSwapStatus) Reset() { *m = NodeSwapStatus{} } +func (*NodeSwapStatus) ProtoMessage() {} +func (*NodeSwapStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_6c07b07c062484ab, []int{113} +} +func (m *NodeSwapStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NodeSwapStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *NodeSwapStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeSwapStatus.Merge(m, src) +} +func (m *NodeSwapStatus) XXX_Size() int { + return m.Size() +} +func (m *NodeSwapStatus) XXX_DiscardUnknown() { + xxx_messageInfo_NodeSwapStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeSwapStatus proto.InternalMessageInfo + func (m *NodeSystemInfo) Reset() { *m = NodeSystemInfo{} } func (*NodeSystemInfo) ProtoMessage() {} func (*NodeSystemInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{113} + return fileDescriptor_6c07b07c062484ab, []int{114} } func (m *NodeSystemInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3244,7 +3272,7 @@ var xxx_messageInfo_NodeSystemInfo proto.InternalMessageInfo func (m *ObjectFieldSelector) Reset() { *m = ObjectFieldSelector{} } func (*ObjectFieldSelector) ProtoMessage() {} func (*ObjectFieldSelector) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{114} + return fileDescriptor_6c07b07c062484ab, []int{115} } func (m *ObjectFieldSelector) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3272,7 +3300,7 @@ var xxx_messageInfo_ObjectFieldSelector proto.InternalMessageInfo func (m *ObjectReference) Reset() { *m = ObjectReference{} } func (*ObjectReference) ProtoMessage() {} func (*ObjectReference) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{115} + return fileDescriptor_6c07b07c062484ab, []int{116} } func (m *ObjectReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3300,7 +3328,7 @@ var xxx_messageInfo_ObjectReference proto.InternalMessageInfo func (m *PersistentVolume) Reset() { *m = PersistentVolume{} } func (*PersistentVolume) ProtoMessage() {} func (*PersistentVolume) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{116} + return fileDescriptor_6c07b07c062484ab, []int{117} } func (m *PersistentVolume) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3328,7 +3356,7 @@ var xxx_messageInfo_PersistentVolume proto.InternalMessageInfo func (m *PersistentVolumeClaim) Reset() { *m = PersistentVolumeClaim{} } func (*PersistentVolumeClaim) ProtoMessage() {} func (*PersistentVolumeClaim) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{117} + return fileDescriptor_6c07b07c062484ab, []int{118} } func (m *PersistentVolumeClaim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3356,7 +3384,7 @@ var xxx_messageInfo_PersistentVolumeClaim proto.InternalMessageInfo func (m *PersistentVolumeClaimCondition) Reset() { *m = PersistentVolumeClaimCondition{} } func (*PersistentVolumeClaimCondition) ProtoMessage() {} func (*PersistentVolumeClaimCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{118} + return fileDescriptor_6c07b07c062484ab, []int{119} } func (m *PersistentVolumeClaimCondition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3384,7 +3412,7 @@ var xxx_messageInfo_PersistentVolumeClaimCondition proto.InternalMessageInfo func (m *PersistentVolumeClaimList) Reset() { *m = PersistentVolumeClaimList{} } func (*PersistentVolumeClaimList) ProtoMessage() {} func (*PersistentVolumeClaimList) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{119} + return fileDescriptor_6c07b07c062484ab, []int{120} } func (m *PersistentVolumeClaimList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3412,7 +3440,7 @@ var xxx_messageInfo_PersistentVolumeClaimList proto.InternalMessageInfo func (m *PersistentVolumeClaimSpec) Reset() { *m = PersistentVolumeClaimSpec{} } func (*PersistentVolumeClaimSpec) ProtoMessage() {} func (*PersistentVolumeClaimSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{120} + return fileDescriptor_6c07b07c062484ab, []int{121} } func (m *PersistentVolumeClaimSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3440,7 +3468,7 @@ var xxx_messageInfo_PersistentVolumeClaimSpec proto.InternalMessageInfo func (m *PersistentVolumeClaimStatus) Reset() { *m = PersistentVolumeClaimStatus{} } func (*PersistentVolumeClaimStatus) ProtoMessage() {} func (*PersistentVolumeClaimStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{121} + return fileDescriptor_6c07b07c062484ab, []int{122} } func (m *PersistentVolumeClaimStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3468,7 +3496,7 @@ var xxx_messageInfo_PersistentVolumeClaimStatus proto.InternalMessageInfo func (m *PersistentVolumeClaimTemplate) Reset() { *m = PersistentVolumeClaimTemplate{} } func (*PersistentVolumeClaimTemplate) ProtoMessage() {} func (*PersistentVolumeClaimTemplate) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{122} + return fileDescriptor_6c07b07c062484ab, []int{123} } func (m *PersistentVolumeClaimTemplate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3496,7 +3524,7 @@ var xxx_messageInfo_PersistentVolumeClaimTemplate proto.InternalMessageInfo func (m *PersistentVolumeClaimVolumeSource) Reset() { *m = PersistentVolumeClaimVolumeSource{} } func (*PersistentVolumeClaimVolumeSource) ProtoMessage() {} func (*PersistentVolumeClaimVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{123} + return fileDescriptor_6c07b07c062484ab, []int{124} } func (m *PersistentVolumeClaimVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3524,7 +3552,7 @@ var xxx_messageInfo_PersistentVolumeClaimVolumeSource proto.InternalMessageInfo func (m *PersistentVolumeList) Reset() { *m = PersistentVolumeList{} } func (*PersistentVolumeList) ProtoMessage() {} func (*PersistentVolumeList) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{124} + return fileDescriptor_6c07b07c062484ab, []int{125} } func (m *PersistentVolumeList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3552,7 +3580,7 @@ var xxx_messageInfo_PersistentVolumeList proto.InternalMessageInfo func (m *PersistentVolumeSource) Reset() { *m = PersistentVolumeSource{} } func (*PersistentVolumeSource) ProtoMessage() {} func (*PersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{125} + return fileDescriptor_6c07b07c062484ab, []int{126} } func (m *PersistentVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3580,7 +3608,7 @@ var xxx_messageInfo_PersistentVolumeSource proto.InternalMessageInfo func (m *PersistentVolumeSpec) Reset() { *m = PersistentVolumeSpec{} } func (*PersistentVolumeSpec) ProtoMessage() {} func (*PersistentVolumeSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{126} + return fileDescriptor_6c07b07c062484ab, []int{127} } func (m *PersistentVolumeSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3608,7 +3636,7 @@ var xxx_messageInfo_PersistentVolumeSpec proto.InternalMessageInfo func (m *PersistentVolumeStatus) Reset() { *m = PersistentVolumeStatus{} } func (*PersistentVolumeStatus) ProtoMessage() {} func (*PersistentVolumeStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{127} + return fileDescriptor_6c07b07c062484ab, []int{128} } func (m *PersistentVolumeStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3636,7 +3664,7 @@ var xxx_messageInfo_PersistentVolumeStatus proto.InternalMessageInfo func (m *PhotonPersistentDiskVolumeSource) Reset() { *m = PhotonPersistentDiskVolumeSource{} } func (*PhotonPersistentDiskVolumeSource) ProtoMessage() {} func (*PhotonPersistentDiskVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{128} + return fileDescriptor_6c07b07c062484ab, []int{129} } func (m *PhotonPersistentDiskVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3664,7 +3692,7 @@ var xxx_messageInfo_PhotonPersistentDiskVolumeSource proto.InternalMessageInfo func (m *Pod) Reset() { *m = Pod{} } func (*Pod) ProtoMessage() {} func (*Pod) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{129} + return fileDescriptor_6c07b07c062484ab, []int{130} } func (m *Pod) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3692,7 +3720,7 @@ var xxx_messageInfo_Pod proto.InternalMessageInfo func (m *PodAffinity) Reset() { *m = PodAffinity{} } func (*PodAffinity) ProtoMessage() {} func (*PodAffinity) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{130} + return fileDescriptor_6c07b07c062484ab, []int{131} } func (m *PodAffinity) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3720,7 +3748,7 @@ var xxx_messageInfo_PodAffinity proto.InternalMessageInfo func (m *PodAffinityTerm) Reset() { *m = PodAffinityTerm{} } func (*PodAffinityTerm) ProtoMessage() {} func (*PodAffinityTerm) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{131} + return fileDescriptor_6c07b07c062484ab, []int{132} } func (m *PodAffinityTerm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3748,7 +3776,7 @@ var xxx_messageInfo_PodAffinityTerm proto.InternalMessageInfo func (m *PodAntiAffinity) Reset() { *m = PodAntiAffinity{} } func (*PodAntiAffinity) ProtoMessage() {} func (*PodAntiAffinity) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{132} + return fileDescriptor_6c07b07c062484ab, []int{133} } func (m *PodAntiAffinity) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3776,7 +3804,7 @@ var xxx_messageInfo_PodAntiAffinity proto.InternalMessageInfo func (m *PodAttachOptions) Reset() { *m = PodAttachOptions{} } func (*PodAttachOptions) ProtoMessage() {} func (*PodAttachOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{133} + return fileDescriptor_6c07b07c062484ab, []int{134} } func (m *PodAttachOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3804,7 +3832,7 @@ var xxx_messageInfo_PodAttachOptions proto.InternalMessageInfo func (m *PodCondition) Reset() { *m = PodCondition{} } func (*PodCondition) ProtoMessage() {} func (*PodCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{134} + return fileDescriptor_6c07b07c062484ab, []int{135} } func (m *PodCondition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3832,7 +3860,7 @@ var xxx_messageInfo_PodCondition proto.InternalMessageInfo func (m *PodDNSConfig) Reset() { *m = PodDNSConfig{} } func (*PodDNSConfig) ProtoMessage() {} func (*PodDNSConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{135} + return fileDescriptor_6c07b07c062484ab, []int{136} } func (m *PodDNSConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3860,7 +3888,7 @@ var xxx_messageInfo_PodDNSConfig proto.InternalMessageInfo func (m *PodDNSConfigOption) Reset() { *m = PodDNSConfigOption{} } func (*PodDNSConfigOption) ProtoMessage() {} func (*PodDNSConfigOption) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{136} + return fileDescriptor_6c07b07c062484ab, []int{137} } func (m *PodDNSConfigOption) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3888,7 +3916,7 @@ var xxx_messageInfo_PodDNSConfigOption proto.InternalMessageInfo func (m *PodExecOptions) Reset() { *m = PodExecOptions{} } func (*PodExecOptions) ProtoMessage() {} func (*PodExecOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{137} + return fileDescriptor_6c07b07c062484ab, []int{138} } func (m *PodExecOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3916,7 +3944,7 @@ var xxx_messageInfo_PodExecOptions proto.InternalMessageInfo func (m *PodIP) Reset() { *m = PodIP{} } func (*PodIP) ProtoMessage() {} func (*PodIP) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{138} + return fileDescriptor_6c07b07c062484ab, []int{139} } func (m *PodIP) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3944,7 +3972,7 @@ var xxx_messageInfo_PodIP proto.InternalMessageInfo func (m *PodList) Reset() { *m = PodList{} } func (*PodList) ProtoMessage() {} func (*PodList) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{139} + return fileDescriptor_6c07b07c062484ab, []int{140} } func (m *PodList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3972,7 +4000,7 @@ var xxx_messageInfo_PodList proto.InternalMessageInfo func (m *PodLogOptions) Reset() { *m = PodLogOptions{} } func (*PodLogOptions) ProtoMessage() {} func (*PodLogOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{140} + return fileDescriptor_6c07b07c062484ab, []int{141} } func (m *PodLogOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4000,7 +4028,7 @@ var xxx_messageInfo_PodLogOptions proto.InternalMessageInfo func (m *PodOS) Reset() { *m = PodOS{} } func (*PodOS) ProtoMessage() {} func (*PodOS) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{141} + return fileDescriptor_6c07b07c062484ab, []int{142} } func (m *PodOS) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4028,7 +4056,7 @@ var xxx_messageInfo_PodOS proto.InternalMessageInfo func (m *PodPortForwardOptions) Reset() { *m = PodPortForwardOptions{} } func (*PodPortForwardOptions) ProtoMessage() {} func (*PodPortForwardOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{142} + return fileDescriptor_6c07b07c062484ab, []int{143} } func (m *PodPortForwardOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4056,7 +4084,7 @@ var xxx_messageInfo_PodPortForwardOptions proto.InternalMessageInfo func (m *PodProxyOptions) Reset() { *m = PodProxyOptions{} } func (*PodProxyOptions) ProtoMessage() {} func (*PodProxyOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{143} + return fileDescriptor_6c07b07c062484ab, []int{144} } func (m *PodProxyOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4084,7 +4112,7 @@ var xxx_messageInfo_PodProxyOptions proto.InternalMessageInfo func (m *PodReadinessGate) Reset() { *m = PodReadinessGate{} } func (*PodReadinessGate) ProtoMessage() {} func (*PodReadinessGate) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{144} + return fileDescriptor_6c07b07c062484ab, []int{145} } func (m *PodReadinessGate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4112,7 +4140,7 @@ var xxx_messageInfo_PodReadinessGate proto.InternalMessageInfo func (m *PodResourceClaim) Reset() { *m = PodResourceClaim{} } func (*PodResourceClaim) ProtoMessage() {} func (*PodResourceClaim) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{145} + return fileDescriptor_6c07b07c062484ab, []int{146} } func (m *PodResourceClaim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4140,7 +4168,7 @@ var xxx_messageInfo_PodResourceClaim proto.InternalMessageInfo func (m *PodResourceClaimStatus) Reset() { *m = PodResourceClaimStatus{} } func (*PodResourceClaimStatus) ProtoMessage() {} func (*PodResourceClaimStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{146} + return fileDescriptor_6c07b07c062484ab, []int{147} } func (m *PodResourceClaimStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4168,7 +4196,7 @@ var xxx_messageInfo_PodResourceClaimStatus proto.InternalMessageInfo func (m *PodSchedulingGate) Reset() { *m = PodSchedulingGate{} } func (*PodSchedulingGate) ProtoMessage() {} func (*PodSchedulingGate) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{147} + return fileDescriptor_6c07b07c062484ab, []int{148} } func (m *PodSchedulingGate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4196,7 +4224,7 @@ var xxx_messageInfo_PodSchedulingGate proto.InternalMessageInfo func (m *PodSecurityContext) Reset() { *m = PodSecurityContext{} } func (*PodSecurityContext) ProtoMessage() {} func (*PodSecurityContext) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{148} + return fileDescriptor_6c07b07c062484ab, []int{149} } func (m *PodSecurityContext) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4224,7 +4252,7 @@ var xxx_messageInfo_PodSecurityContext proto.InternalMessageInfo func (m *PodSignature) Reset() { *m = PodSignature{} } func (*PodSignature) ProtoMessage() {} func (*PodSignature) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{149} + return fileDescriptor_6c07b07c062484ab, []int{150} } func (m *PodSignature) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4252,7 +4280,7 @@ var xxx_messageInfo_PodSignature proto.InternalMessageInfo func (m *PodSpec) Reset() { *m = PodSpec{} } func (*PodSpec) ProtoMessage() {} func (*PodSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{150} + return fileDescriptor_6c07b07c062484ab, []int{151} } func (m *PodSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4280,7 +4308,7 @@ var xxx_messageInfo_PodSpec proto.InternalMessageInfo func (m *PodStatus) Reset() { *m = PodStatus{} } func (*PodStatus) ProtoMessage() {} func (*PodStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{151} + return fileDescriptor_6c07b07c062484ab, []int{152} } func (m *PodStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4308,7 +4336,7 @@ var xxx_messageInfo_PodStatus proto.InternalMessageInfo func (m *PodStatusResult) Reset() { *m = PodStatusResult{} } func (*PodStatusResult) ProtoMessage() {} func (*PodStatusResult) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{152} + return fileDescriptor_6c07b07c062484ab, []int{153} } func (m *PodStatusResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4336,7 +4364,7 @@ var xxx_messageInfo_PodStatusResult proto.InternalMessageInfo func (m *PodTemplate) Reset() { *m = PodTemplate{} } func (*PodTemplate) ProtoMessage() {} func (*PodTemplate) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{153} + return fileDescriptor_6c07b07c062484ab, []int{154} } func (m *PodTemplate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4364,7 +4392,7 @@ var xxx_messageInfo_PodTemplate proto.InternalMessageInfo func (m *PodTemplateList) Reset() { *m = PodTemplateList{} } func (*PodTemplateList) ProtoMessage() {} func (*PodTemplateList) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{154} + return fileDescriptor_6c07b07c062484ab, []int{155} } func (m *PodTemplateList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4392,7 +4420,7 @@ var xxx_messageInfo_PodTemplateList proto.InternalMessageInfo func (m *PodTemplateSpec) Reset() { *m = PodTemplateSpec{} } func (*PodTemplateSpec) ProtoMessage() {} func (*PodTemplateSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{155} + return fileDescriptor_6c07b07c062484ab, []int{156} } func (m *PodTemplateSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4420,7 +4448,7 @@ var xxx_messageInfo_PodTemplateSpec proto.InternalMessageInfo func (m *PortStatus) Reset() { *m = PortStatus{} } func (*PortStatus) ProtoMessage() {} func (*PortStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{156} + return fileDescriptor_6c07b07c062484ab, []int{157} } func (m *PortStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4448,7 +4476,7 @@ var xxx_messageInfo_PortStatus proto.InternalMessageInfo func (m *PortworxVolumeSource) Reset() { *m = PortworxVolumeSource{} } func (*PortworxVolumeSource) ProtoMessage() {} func (*PortworxVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{157} + return fileDescriptor_6c07b07c062484ab, []int{158} } func (m *PortworxVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4476,7 +4504,7 @@ var xxx_messageInfo_PortworxVolumeSource proto.InternalMessageInfo func (m *Preconditions) Reset() { *m = Preconditions{} } func (*Preconditions) ProtoMessage() {} func (*Preconditions) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{158} + return fileDescriptor_6c07b07c062484ab, []int{159} } func (m *Preconditions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4504,7 +4532,7 @@ var xxx_messageInfo_Preconditions proto.InternalMessageInfo func (m *PreferAvoidPodsEntry) Reset() { *m = PreferAvoidPodsEntry{} } func (*PreferAvoidPodsEntry) ProtoMessage() {} func (*PreferAvoidPodsEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{159} + return fileDescriptor_6c07b07c062484ab, []int{160} } func (m *PreferAvoidPodsEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4532,7 +4560,7 @@ var xxx_messageInfo_PreferAvoidPodsEntry proto.InternalMessageInfo func (m *PreferredSchedulingTerm) Reset() { *m = PreferredSchedulingTerm{} } func (*PreferredSchedulingTerm) ProtoMessage() {} func (*PreferredSchedulingTerm) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{160} + return fileDescriptor_6c07b07c062484ab, []int{161} } func (m *PreferredSchedulingTerm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4560,7 +4588,7 @@ var xxx_messageInfo_PreferredSchedulingTerm proto.InternalMessageInfo func (m *Probe) Reset() { *m = Probe{} } func (*Probe) ProtoMessage() {} func (*Probe) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{161} + return fileDescriptor_6c07b07c062484ab, []int{162} } func (m *Probe) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4588,7 +4616,7 @@ var xxx_messageInfo_Probe proto.InternalMessageInfo func (m *ProbeHandler) Reset() { *m = ProbeHandler{} } func (*ProbeHandler) ProtoMessage() {} func (*ProbeHandler) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{162} + return fileDescriptor_6c07b07c062484ab, []int{163} } func (m *ProbeHandler) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4616,7 +4644,7 @@ var xxx_messageInfo_ProbeHandler proto.InternalMessageInfo func (m *ProjectedVolumeSource) Reset() { *m = ProjectedVolumeSource{} } func (*ProjectedVolumeSource) ProtoMessage() {} func (*ProjectedVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{163} + return fileDescriptor_6c07b07c062484ab, []int{164} } func (m *ProjectedVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4644,7 +4672,7 @@ var xxx_messageInfo_ProjectedVolumeSource proto.InternalMessageInfo func (m *QuobyteVolumeSource) Reset() { *m = QuobyteVolumeSource{} } func (*QuobyteVolumeSource) ProtoMessage() {} func (*QuobyteVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{164} + return fileDescriptor_6c07b07c062484ab, []int{165} } func (m *QuobyteVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4672,7 +4700,7 @@ var xxx_messageInfo_QuobyteVolumeSource proto.InternalMessageInfo func (m *RBDPersistentVolumeSource) Reset() { *m = RBDPersistentVolumeSource{} } func (*RBDPersistentVolumeSource) ProtoMessage() {} func (*RBDPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{165} + return fileDescriptor_6c07b07c062484ab, []int{166} } func (m *RBDPersistentVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4700,7 +4728,7 @@ var xxx_messageInfo_RBDPersistentVolumeSource proto.InternalMessageInfo func (m *RBDVolumeSource) Reset() { *m = RBDVolumeSource{} } func (*RBDVolumeSource) ProtoMessage() {} func (*RBDVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{166} + return fileDescriptor_6c07b07c062484ab, []int{167} } func (m *RBDVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4728,7 +4756,7 @@ var xxx_messageInfo_RBDVolumeSource proto.InternalMessageInfo func (m *RangeAllocation) Reset() { *m = RangeAllocation{} } func (*RangeAllocation) ProtoMessage() {} func (*RangeAllocation) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{167} + return fileDescriptor_6c07b07c062484ab, []int{168} } func (m *RangeAllocation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4756,7 +4784,7 @@ var xxx_messageInfo_RangeAllocation proto.InternalMessageInfo func (m *ReplicationController) Reset() { *m = ReplicationController{} } func (*ReplicationController) ProtoMessage() {} func (*ReplicationController) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{168} + return fileDescriptor_6c07b07c062484ab, []int{169} } func (m *ReplicationController) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4784,7 +4812,7 @@ var xxx_messageInfo_ReplicationController proto.InternalMessageInfo func (m *ReplicationControllerCondition) Reset() { *m = ReplicationControllerCondition{} } func (*ReplicationControllerCondition) ProtoMessage() {} func (*ReplicationControllerCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{169} + return fileDescriptor_6c07b07c062484ab, []int{170} } func (m *ReplicationControllerCondition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4812,7 +4840,7 @@ var xxx_messageInfo_ReplicationControllerCondition proto.InternalMessageInfo func (m *ReplicationControllerList) Reset() { *m = ReplicationControllerList{} } func (*ReplicationControllerList) ProtoMessage() {} func (*ReplicationControllerList) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{170} + return fileDescriptor_6c07b07c062484ab, []int{171} } func (m *ReplicationControllerList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4840,7 +4868,7 @@ var xxx_messageInfo_ReplicationControllerList proto.InternalMessageInfo func (m *ReplicationControllerSpec) Reset() { *m = ReplicationControllerSpec{} } func (*ReplicationControllerSpec) ProtoMessage() {} func (*ReplicationControllerSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{171} + return fileDescriptor_6c07b07c062484ab, []int{172} } func (m *ReplicationControllerSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4868,7 +4896,7 @@ var xxx_messageInfo_ReplicationControllerSpec proto.InternalMessageInfo func (m *ReplicationControllerStatus) Reset() { *m = ReplicationControllerStatus{} } func (*ReplicationControllerStatus) ProtoMessage() {} func (*ReplicationControllerStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{172} + return fileDescriptor_6c07b07c062484ab, []int{173} } func (m *ReplicationControllerStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4896,7 +4924,7 @@ var xxx_messageInfo_ReplicationControllerStatus proto.InternalMessageInfo func (m *ResourceClaim) Reset() { *m = ResourceClaim{} } func (*ResourceClaim) ProtoMessage() {} func (*ResourceClaim) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{173} + return fileDescriptor_6c07b07c062484ab, []int{174} } func (m *ResourceClaim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4924,7 +4952,7 @@ var xxx_messageInfo_ResourceClaim proto.InternalMessageInfo func (m *ResourceFieldSelector) Reset() { *m = ResourceFieldSelector{} } func (*ResourceFieldSelector) ProtoMessage() {} func (*ResourceFieldSelector) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{174} + return fileDescriptor_6c07b07c062484ab, []int{175} } func (m *ResourceFieldSelector) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4952,7 +4980,7 @@ var xxx_messageInfo_ResourceFieldSelector proto.InternalMessageInfo func (m *ResourceHealth) Reset() { *m = ResourceHealth{} } func (*ResourceHealth) ProtoMessage() {} func (*ResourceHealth) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{175} + return fileDescriptor_6c07b07c062484ab, []int{176} } func (m *ResourceHealth) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4980,7 +5008,7 @@ var xxx_messageInfo_ResourceHealth proto.InternalMessageInfo func (m *ResourceQuota) Reset() { *m = ResourceQuota{} } func (*ResourceQuota) ProtoMessage() {} func (*ResourceQuota) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{176} + return fileDescriptor_6c07b07c062484ab, []int{177} } func (m *ResourceQuota) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5008,7 +5036,7 @@ var xxx_messageInfo_ResourceQuota proto.InternalMessageInfo func (m *ResourceQuotaList) Reset() { *m = ResourceQuotaList{} } func (*ResourceQuotaList) ProtoMessage() {} func (*ResourceQuotaList) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{177} + return fileDescriptor_6c07b07c062484ab, []int{178} } func (m *ResourceQuotaList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5036,7 +5064,7 @@ var xxx_messageInfo_ResourceQuotaList proto.InternalMessageInfo func (m *ResourceQuotaSpec) Reset() { *m = ResourceQuotaSpec{} } func (*ResourceQuotaSpec) ProtoMessage() {} func (*ResourceQuotaSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{178} + return fileDescriptor_6c07b07c062484ab, []int{179} } func (m *ResourceQuotaSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5064,7 +5092,7 @@ var xxx_messageInfo_ResourceQuotaSpec proto.InternalMessageInfo func (m *ResourceQuotaStatus) Reset() { *m = ResourceQuotaStatus{} } func (*ResourceQuotaStatus) ProtoMessage() {} func (*ResourceQuotaStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{179} + return fileDescriptor_6c07b07c062484ab, []int{180} } func (m *ResourceQuotaStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5092,7 +5120,7 @@ var xxx_messageInfo_ResourceQuotaStatus proto.InternalMessageInfo func (m *ResourceRequirements) Reset() { *m = ResourceRequirements{} } func (*ResourceRequirements) ProtoMessage() {} func (*ResourceRequirements) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{180} + return fileDescriptor_6c07b07c062484ab, []int{181} } func (m *ResourceRequirements) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5120,7 +5148,7 @@ var xxx_messageInfo_ResourceRequirements proto.InternalMessageInfo func (m *ResourceStatus) Reset() { *m = ResourceStatus{} } func (*ResourceStatus) ProtoMessage() {} func (*ResourceStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{181} + return fileDescriptor_6c07b07c062484ab, []int{182} } func (m *ResourceStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5148,7 +5176,7 @@ var xxx_messageInfo_ResourceStatus proto.InternalMessageInfo func (m *SELinuxOptions) Reset() { *m = SELinuxOptions{} } func (*SELinuxOptions) ProtoMessage() {} func (*SELinuxOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{182} + return fileDescriptor_6c07b07c062484ab, []int{183} } func (m *SELinuxOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5176,7 +5204,7 @@ var xxx_messageInfo_SELinuxOptions proto.InternalMessageInfo func (m *ScaleIOPersistentVolumeSource) Reset() { *m = ScaleIOPersistentVolumeSource{} } func (*ScaleIOPersistentVolumeSource) ProtoMessage() {} func (*ScaleIOPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{183} + return fileDescriptor_6c07b07c062484ab, []int{184} } func (m *ScaleIOPersistentVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5204,7 +5232,7 @@ var xxx_messageInfo_ScaleIOPersistentVolumeSource proto.InternalMessageInfo func (m *ScaleIOVolumeSource) Reset() { *m = ScaleIOVolumeSource{} } func (*ScaleIOVolumeSource) ProtoMessage() {} func (*ScaleIOVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{184} + return fileDescriptor_6c07b07c062484ab, []int{185} } func (m *ScaleIOVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5232,7 +5260,7 @@ var xxx_messageInfo_ScaleIOVolumeSource proto.InternalMessageInfo func (m *ScopeSelector) Reset() { *m = ScopeSelector{} } func (*ScopeSelector) ProtoMessage() {} func (*ScopeSelector) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{185} + return fileDescriptor_6c07b07c062484ab, []int{186} } func (m *ScopeSelector) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5260,7 +5288,7 @@ var xxx_messageInfo_ScopeSelector proto.InternalMessageInfo func (m *ScopedResourceSelectorRequirement) Reset() { *m = ScopedResourceSelectorRequirement{} } func (*ScopedResourceSelectorRequirement) ProtoMessage() {} func (*ScopedResourceSelectorRequirement) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{186} + return fileDescriptor_6c07b07c062484ab, []int{187} } func (m *ScopedResourceSelectorRequirement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5288,7 +5316,7 @@ var xxx_messageInfo_ScopedResourceSelectorRequirement proto.InternalMessageInfo func (m *SeccompProfile) Reset() { *m = SeccompProfile{} } func (*SeccompProfile) ProtoMessage() {} func (*SeccompProfile) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{187} + return fileDescriptor_6c07b07c062484ab, []int{188} } func (m *SeccompProfile) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5316,7 +5344,7 @@ var xxx_messageInfo_SeccompProfile proto.InternalMessageInfo func (m *Secret) Reset() { *m = Secret{} } func (*Secret) ProtoMessage() {} func (*Secret) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{188} + return fileDescriptor_6c07b07c062484ab, []int{189} } func (m *Secret) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5344,7 +5372,7 @@ var xxx_messageInfo_Secret proto.InternalMessageInfo func (m *SecretEnvSource) Reset() { *m = SecretEnvSource{} } func (*SecretEnvSource) ProtoMessage() {} func (*SecretEnvSource) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{189} + return fileDescriptor_6c07b07c062484ab, []int{190} } func (m *SecretEnvSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5372,7 +5400,7 @@ var xxx_messageInfo_SecretEnvSource proto.InternalMessageInfo func (m *SecretKeySelector) Reset() { *m = SecretKeySelector{} } func (*SecretKeySelector) ProtoMessage() {} func (*SecretKeySelector) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{190} + return fileDescriptor_6c07b07c062484ab, []int{191} } func (m *SecretKeySelector) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5400,7 +5428,7 @@ var xxx_messageInfo_SecretKeySelector proto.InternalMessageInfo func (m *SecretList) Reset() { *m = SecretList{} } func (*SecretList) ProtoMessage() {} func (*SecretList) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{191} + return fileDescriptor_6c07b07c062484ab, []int{192} } func (m *SecretList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5428,7 +5456,7 @@ var xxx_messageInfo_SecretList proto.InternalMessageInfo func (m *SecretProjection) Reset() { *m = SecretProjection{} } func (*SecretProjection) ProtoMessage() {} func (*SecretProjection) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{192} + return fileDescriptor_6c07b07c062484ab, []int{193} } func (m *SecretProjection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5456,7 +5484,7 @@ var xxx_messageInfo_SecretProjection proto.InternalMessageInfo func (m *SecretReference) Reset() { *m = SecretReference{} } func (*SecretReference) ProtoMessage() {} func (*SecretReference) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{193} + return fileDescriptor_6c07b07c062484ab, []int{194} } func (m *SecretReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5484,7 +5512,7 @@ var xxx_messageInfo_SecretReference proto.InternalMessageInfo func (m *SecretVolumeSource) Reset() { *m = SecretVolumeSource{} } func (*SecretVolumeSource) ProtoMessage() {} func (*SecretVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{194} + return fileDescriptor_6c07b07c062484ab, []int{195} } func (m *SecretVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5512,7 +5540,7 @@ var xxx_messageInfo_SecretVolumeSource proto.InternalMessageInfo func (m *SecurityContext) Reset() { *m = SecurityContext{} } func (*SecurityContext) ProtoMessage() {} func (*SecurityContext) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{195} + return fileDescriptor_6c07b07c062484ab, []int{196} } func (m *SecurityContext) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5540,7 +5568,7 @@ var xxx_messageInfo_SecurityContext proto.InternalMessageInfo func (m *SerializedReference) Reset() { *m = SerializedReference{} } func (*SerializedReference) ProtoMessage() {} func (*SerializedReference) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{196} + return fileDescriptor_6c07b07c062484ab, []int{197} } func (m *SerializedReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5568,7 +5596,7 @@ var xxx_messageInfo_SerializedReference proto.InternalMessageInfo func (m *Service) Reset() { *m = Service{} } func (*Service) ProtoMessage() {} func (*Service) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{197} + return fileDescriptor_6c07b07c062484ab, []int{198} } func (m *Service) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5596,7 +5624,7 @@ var xxx_messageInfo_Service proto.InternalMessageInfo func (m *ServiceAccount) Reset() { *m = ServiceAccount{} } func (*ServiceAccount) ProtoMessage() {} func (*ServiceAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{198} + return fileDescriptor_6c07b07c062484ab, []int{199} } func (m *ServiceAccount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5624,7 +5652,7 @@ var xxx_messageInfo_ServiceAccount proto.InternalMessageInfo func (m *ServiceAccountList) Reset() { *m = ServiceAccountList{} } func (*ServiceAccountList) ProtoMessage() {} func (*ServiceAccountList) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{199} + return fileDescriptor_6c07b07c062484ab, []int{200} } func (m *ServiceAccountList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5652,7 +5680,7 @@ var xxx_messageInfo_ServiceAccountList proto.InternalMessageInfo func (m *ServiceAccountTokenProjection) Reset() { *m = ServiceAccountTokenProjection{} } func (*ServiceAccountTokenProjection) ProtoMessage() {} func (*ServiceAccountTokenProjection) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{200} + return fileDescriptor_6c07b07c062484ab, []int{201} } func (m *ServiceAccountTokenProjection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5680,7 +5708,7 @@ var xxx_messageInfo_ServiceAccountTokenProjection proto.InternalMessageInfo func (m *ServiceList) Reset() { *m = ServiceList{} } func (*ServiceList) ProtoMessage() {} func (*ServiceList) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{201} + return fileDescriptor_6c07b07c062484ab, []int{202} } func (m *ServiceList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5708,7 +5736,7 @@ var xxx_messageInfo_ServiceList proto.InternalMessageInfo func (m *ServicePort) Reset() { *m = ServicePort{} } func (*ServicePort) ProtoMessage() {} func (*ServicePort) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{202} + return fileDescriptor_6c07b07c062484ab, []int{203} } func (m *ServicePort) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5736,7 +5764,7 @@ var xxx_messageInfo_ServicePort proto.InternalMessageInfo func (m *ServiceProxyOptions) Reset() { *m = ServiceProxyOptions{} } func (*ServiceProxyOptions) ProtoMessage() {} func (*ServiceProxyOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{203} + return fileDescriptor_6c07b07c062484ab, []int{204} } func (m *ServiceProxyOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5764,7 +5792,7 @@ var xxx_messageInfo_ServiceProxyOptions proto.InternalMessageInfo func (m *ServiceSpec) Reset() { *m = ServiceSpec{} } func (*ServiceSpec) ProtoMessage() {} func (*ServiceSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{204} + return fileDescriptor_6c07b07c062484ab, []int{205} } func (m *ServiceSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5792,7 +5820,7 @@ var xxx_messageInfo_ServiceSpec proto.InternalMessageInfo func (m *ServiceStatus) Reset() { *m = ServiceStatus{} } func (*ServiceStatus) ProtoMessage() {} func (*ServiceStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{205} + return fileDescriptor_6c07b07c062484ab, []int{206} } func (m *ServiceStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5820,7 +5848,7 @@ var xxx_messageInfo_ServiceStatus proto.InternalMessageInfo func (m *SessionAffinityConfig) Reset() { *m = SessionAffinityConfig{} } func (*SessionAffinityConfig) ProtoMessage() {} func (*SessionAffinityConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{206} + return fileDescriptor_6c07b07c062484ab, []int{207} } func (m *SessionAffinityConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5848,7 +5876,7 @@ var xxx_messageInfo_SessionAffinityConfig proto.InternalMessageInfo func (m *SleepAction) Reset() { *m = SleepAction{} } func (*SleepAction) ProtoMessage() {} func (*SleepAction) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{207} + return fileDescriptor_6c07b07c062484ab, []int{208} } func (m *SleepAction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5876,7 +5904,7 @@ var xxx_messageInfo_SleepAction proto.InternalMessageInfo func (m *StorageOSPersistentVolumeSource) Reset() { *m = StorageOSPersistentVolumeSource{} } func (*StorageOSPersistentVolumeSource) ProtoMessage() {} func (*StorageOSPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{208} + return fileDescriptor_6c07b07c062484ab, []int{209} } func (m *StorageOSPersistentVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5904,7 +5932,7 @@ var xxx_messageInfo_StorageOSPersistentVolumeSource proto.InternalMessageInfo func (m *StorageOSVolumeSource) Reset() { *m = StorageOSVolumeSource{} } func (*StorageOSVolumeSource) ProtoMessage() {} func (*StorageOSVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{209} + return fileDescriptor_6c07b07c062484ab, []int{210} } func (m *StorageOSVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5932,7 +5960,7 @@ var xxx_messageInfo_StorageOSVolumeSource proto.InternalMessageInfo func (m *Sysctl) Reset() { *m = Sysctl{} } func (*Sysctl) ProtoMessage() {} func (*Sysctl) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{210} + return fileDescriptor_6c07b07c062484ab, []int{211} } func (m *Sysctl) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5960,7 +5988,7 @@ var xxx_messageInfo_Sysctl proto.InternalMessageInfo func (m *TCPSocketAction) Reset() { *m = TCPSocketAction{} } func (*TCPSocketAction) ProtoMessage() {} func (*TCPSocketAction) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{211} + return fileDescriptor_6c07b07c062484ab, []int{212} } func (m *TCPSocketAction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5988,7 +6016,7 @@ var xxx_messageInfo_TCPSocketAction proto.InternalMessageInfo func (m *Taint) Reset() { *m = Taint{} } func (*Taint) ProtoMessage() {} func (*Taint) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{212} + return fileDescriptor_6c07b07c062484ab, []int{213} } func (m *Taint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6016,7 +6044,7 @@ var xxx_messageInfo_Taint proto.InternalMessageInfo func (m *Toleration) Reset() { *m = Toleration{} } func (*Toleration) ProtoMessage() {} func (*Toleration) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{213} + return fileDescriptor_6c07b07c062484ab, []int{214} } func (m *Toleration) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6044,7 +6072,7 @@ var xxx_messageInfo_Toleration proto.InternalMessageInfo func (m *TopologySelectorLabelRequirement) Reset() { *m = TopologySelectorLabelRequirement{} } func (*TopologySelectorLabelRequirement) ProtoMessage() {} func (*TopologySelectorLabelRequirement) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{214} + return fileDescriptor_6c07b07c062484ab, []int{215} } func (m *TopologySelectorLabelRequirement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6072,7 +6100,7 @@ var xxx_messageInfo_TopologySelectorLabelRequirement proto.InternalMessageInfo func (m *TopologySelectorTerm) Reset() { *m = TopologySelectorTerm{} } func (*TopologySelectorTerm) ProtoMessage() {} func (*TopologySelectorTerm) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{215} + return fileDescriptor_6c07b07c062484ab, []int{216} } func (m *TopologySelectorTerm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6100,7 +6128,7 @@ var xxx_messageInfo_TopologySelectorTerm proto.InternalMessageInfo func (m *TopologySpreadConstraint) Reset() { *m = TopologySpreadConstraint{} } func (*TopologySpreadConstraint) ProtoMessage() {} func (*TopologySpreadConstraint) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{216} + return fileDescriptor_6c07b07c062484ab, []int{217} } func (m *TopologySpreadConstraint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6128,7 +6156,7 @@ var xxx_messageInfo_TopologySpreadConstraint proto.InternalMessageInfo func (m *TypedLocalObjectReference) Reset() { *m = TypedLocalObjectReference{} } func (*TypedLocalObjectReference) ProtoMessage() {} func (*TypedLocalObjectReference) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{217} + return fileDescriptor_6c07b07c062484ab, []int{218} } func (m *TypedLocalObjectReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6156,7 +6184,7 @@ var xxx_messageInfo_TypedLocalObjectReference proto.InternalMessageInfo func (m *TypedObjectReference) Reset() { *m = TypedObjectReference{} } func (*TypedObjectReference) ProtoMessage() {} func (*TypedObjectReference) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{218} + return fileDescriptor_6c07b07c062484ab, []int{219} } func (m *TypedObjectReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6184,7 +6212,7 @@ var xxx_messageInfo_TypedObjectReference proto.InternalMessageInfo func (m *Volume) Reset() { *m = Volume{} } func (*Volume) ProtoMessage() {} func (*Volume) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{219} + return fileDescriptor_6c07b07c062484ab, []int{220} } func (m *Volume) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6212,7 +6240,7 @@ var xxx_messageInfo_Volume proto.InternalMessageInfo func (m *VolumeDevice) Reset() { *m = VolumeDevice{} } func (*VolumeDevice) ProtoMessage() {} func (*VolumeDevice) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{220} + return fileDescriptor_6c07b07c062484ab, []int{221} } func (m *VolumeDevice) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6240,7 +6268,7 @@ var xxx_messageInfo_VolumeDevice proto.InternalMessageInfo func (m *VolumeMount) Reset() { *m = VolumeMount{} } func (*VolumeMount) ProtoMessage() {} func (*VolumeMount) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{221} + return fileDescriptor_6c07b07c062484ab, []int{222} } func (m *VolumeMount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6268,7 +6296,7 @@ var xxx_messageInfo_VolumeMount proto.InternalMessageInfo func (m *VolumeMountStatus) Reset() { *m = VolumeMountStatus{} } func (*VolumeMountStatus) ProtoMessage() {} func (*VolumeMountStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{222} + return fileDescriptor_6c07b07c062484ab, []int{223} } func (m *VolumeMountStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6296,7 +6324,7 @@ var xxx_messageInfo_VolumeMountStatus proto.InternalMessageInfo func (m *VolumeNodeAffinity) Reset() { *m = VolumeNodeAffinity{} } func (*VolumeNodeAffinity) ProtoMessage() {} func (*VolumeNodeAffinity) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{223} + return fileDescriptor_6c07b07c062484ab, []int{224} } func (m *VolumeNodeAffinity) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6324,7 +6352,7 @@ var xxx_messageInfo_VolumeNodeAffinity proto.InternalMessageInfo func (m *VolumeProjection) Reset() { *m = VolumeProjection{} } func (*VolumeProjection) ProtoMessage() {} func (*VolumeProjection) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{224} + return fileDescriptor_6c07b07c062484ab, []int{225} } func (m *VolumeProjection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6352,7 +6380,7 @@ var xxx_messageInfo_VolumeProjection proto.InternalMessageInfo func (m *VolumeResourceRequirements) Reset() { *m = VolumeResourceRequirements{} } func (*VolumeResourceRequirements) ProtoMessage() {} func (*VolumeResourceRequirements) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{225} + return fileDescriptor_6c07b07c062484ab, []int{226} } func (m *VolumeResourceRequirements) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6380,7 +6408,7 @@ var xxx_messageInfo_VolumeResourceRequirements proto.InternalMessageInfo func (m *VolumeSource) Reset() { *m = VolumeSource{} } func (*VolumeSource) ProtoMessage() {} func (*VolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{226} + return fileDescriptor_6c07b07c062484ab, []int{227} } func (m *VolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6408,7 +6436,7 @@ var xxx_messageInfo_VolumeSource proto.InternalMessageInfo func (m *VsphereVirtualDiskVolumeSource) Reset() { *m = VsphereVirtualDiskVolumeSource{} } func (*VsphereVirtualDiskVolumeSource) ProtoMessage() {} func (*VsphereVirtualDiskVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{227} + return fileDescriptor_6c07b07c062484ab, []int{228} } func (m *VsphereVirtualDiskVolumeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6436,7 +6464,7 @@ var xxx_messageInfo_VsphereVirtualDiskVolumeSource proto.InternalMessageInfo func (m *WeightedPodAffinityTerm) Reset() { *m = WeightedPodAffinityTerm{} } func (*WeightedPodAffinityTerm) ProtoMessage() {} func (*WeightedPodAffinityTerm) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{228} + return fileDescriptor_6c07b07c062484ab, []int{229} } func (m *WeightedPodAffinityTerm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6464,7 +6492,7 @@ var xxx_messageInfo_WeightedPodAffinityTerm proto.InternalMessageInfo func (m *WindowsSecurityContextOptions) Reset() { *m = WindowsSecurityContextOptions{} } func (*WindowsSecurityContextOptions) ProtoMessage() {} func (*WindowsSecurityContextOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_6c07b07c062484ab, []int{229} + return fileDescriptor_6c07b07c062484ab, []int{230} } func (m *WindowsSecurityContextOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6617,6 +6645,7 @@ func init() { proto.RegisterType((*NodeStatus)(nil), "k8s.io.api.core.v1.NodeStatus") proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.NodeStatus.AllocatableEntry") proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.NodeStatus.CapacityEntry") + proto.RegisterType((*NodeSwapStatus)(nil), "k8s.io.api.core.v1.NodeSwapStatus") proto.RegisterType((*NodeSystemInfo)(nil), "k8s.io.api.core.v1.NodeSystemInfo") proto.RegisterType((*ObjectFieldSelector)(nil), "k8s.io.api.core.v1.ObjectFieldSelector") proto.RegisterType((*ObjectReference)(nil), "k8s.io.api.core.v1.ObjectReference") @@ -6758,1015 +6787,1020 @@ func init() { } var fileDescriptor_6c07b07c062484ab = []byte{ - // 16114 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x69, 0x90, 0x64, 0xd9, - 0x59, 0x28, 0xa6, 0x9b, 0x59, 0xeb, 0x57, 0xfb, 0xa9, 0x5e, 0xaa, 0x6b, 0xba, 0x3b, 0x7b, 0xee, - 0xcc, 0xf4, 0xf4, 0x6c, 0xd5, 0xea, 0x59, 0x34, 0xad, 0x99, 0xd1, 0x30, 0xb5, 0x76, 0xd7, 0x74, - 0x57, 0x75, 0xce, 0xc9, 0xaa, 0x6e, 0x69, 0x34, 0x12, 0xba, 0x9d, 0x79, 0xaa, 0xea, 0xaa, 0x32, - 0xef, 0xcd, 0xb9, 0xf7, 0x66, 0x75, 0x57, 0x5b, 0x04, 0x20, 0x8c, 0x40, 0x02, 0x47, 0x28, 0x08, - 0x6c, 0x1c, 0x82, 0xe0, 0x07, 0x60, 0x16, 0xcb, 0x60, 0x64, 0x61, 0xc0, 0x88, 0xcd, 0x36, 0x8e, - 0x00, 0xff, 0xc0, 0x98, 0x08, 0x4b, 0x84, 0x09, 0x17, 0x56, 0xe1, 0x08, 0x82, 0x1f, 0x06, 0x82, - 0xf7, 0x7e, 0xbc, 0x57, 0xc1, 0x7b, 0xbc, 0x38, 0xeb, 0x3d, 0xe7, 0x2e, 0x99, 0x59, 0x3d, 0xdd, - 0xa5, 0x91, 0x62, 0xfe, 0x65, 0x9e, 0xef, 0x3b, 0xdf, 0x39, 0xf7, 0xac, 0xdf, 0xf9, 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92, 0xa0, 0xfd, 0x93, 0x16, 0x8c, 0xcd, - 0x36, 0x9b, 0xb3, 0x41, 0xc3, 0x0f, 0xca, 0x81, 0xbf, 0xe1, 0xd6, 0x09, 0x7a, 0x19, 0x7a, 0x22, - 0x3a, 0x6b, 0x7c, 0x86, 0x1f, 0x13, 0x43, 0xdb, 0x43, 0xe7, 0xea, 0x60, 0xaf, 0x34, 0x99, 0x40, - 0x67, 0x53, 0xc9, 0x2a, 0xa0, 0x37, 0x60, 0xbc, 0xee, 0x57, 0x9d, 0xfa, 0x96, 0x1f, 0x46, 0x02, - 0x2a, 0xa6, 0xfe, 0xd8, 0xfe, 0x5e, 0x69, 0xfc, 0x7a, 0x02, 0x86, 0x53, 0xd8, 0xf6, 0x3d, 0x18, - 0x9d, 0x8d, 0x22, 0xa7, 0xba, 0x45, 0x6a, 0x7c, 0x41, 0xa1, 0x17, 0xa1, 0xc7, 0x73, 0x1a, 0xb2, - 0x33, 0xe7, 0x64, 0x67, 0x56, 0x9d, 0x06, 0xed, 0xcc, 0xf8, 0xba, 0xe7, 0xbe, 0xdb, 0x12, 0x8b, - 0x94, 0x96, 0x61, 0x86, 0x8d, 0x9e, 0x07, 0xa8, 0x91, 0x1d, 0xb7, 0x4a, 0xca, 0x4e, 0xb4, 0x25, - 0xfa, 0x80, 0x44, 0x5d, 0x58, 0x50, 0x10, 0xac, 0x61, 0xd9, 0x77, 0x61, 0x70, 0x76, 0xc7, 0x77, - 0x6b, 0x65, 0xbf, 0x16, 0xa2, 0x6d, 0x18, 0x6b, 0x06, 0x64, 0x83, 0x04, 0xaa, 0x68, 0xca, 0x3a, - 0x57, 0xbc, 0x30, 0xf4, 0xfc, 0x85, 0xcc, 0xb1, 0x37, 0x51, 0x17, 0xbd, 0x28, 0xd8, 0x9d, 0x3b, - 0x29, 0xda, 0x1b, 0x4b, 0x40, 0x71, 0x92, 0xb2, 0xfd, 0x27, 0x05, 0x38, 0x3e, 0x7b, 0xaf, 0x15, - 0x90, 0x05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1, 0x4b, 0x43, 0x6c, - 0x52, 0x43, 0x18, 0x46, 0xea, 0xee, 0x0e, 0xf1, 0x48, 0x18, 0x96, 0x03, 0xff, 0x36, 0x11, 0x12, - 0xe2, 0x53, 0xd9, 0x2a, 0x58, 0xff, 0x36, 0x11, 0x8f, 0x40, 0xbd, 0x0e, 0x36, 0x49, 0xa0, 0x75, - 0x18, 0xa5, 0x4f, 0x72, 0x37, 0x26, 0x3a, 0xd4, 0x89, 0x28, 0x7b, 0x38, 0x63, 0xa3, 0x12, 0x4e, - 0x10, 0x41, 0x37, 0x60, 0x98, 0x8d, 0x79, 0xab, 0xc9, 0x89, 0x9e, 0xe8, 0x44, 0x94, 0x19, 0x14, - 0x54, 0xb4, 0x2a, 0xd8, 0x20, 0x80, 0xde, 0x84, 0xc1, 0xba, 0xbb, 0x41, 0xaa, 0xbb, 0xd5, 0x3a, - 0x99, 0x1a, 0x66, 0xd4, 0x32, 0x0f, 0xc3, 0xeb, 0x12, 0x89, 0xf3, 0xe7, 0xea, 0x2f, 0x8e, 0xab, - 0xa3, 0x9b, 0x70, 0x22, 0x22, 0x41, 0xc3, 0xf5, 0x1c, 0x7a, 0x88, 0x89, 0x27, 0x21, 0xd3, 0x8c, - 0x8f, 0xb0, 0xd5, 0x75, 0x56, 0xcc, 0xc6, 0x89, 0xb5, 0x4c, 0x2c, 0x9c, 0x53, 0x1b, 0xdd, 0x85, - 0xa9, 0x0c, 0x08, 0x5f, 0xb7, 0xc7, 0x18, 0xe5, 0xd7, 0x04, 0xe5, 0xa9, 0xb5, 0x1c, 0xbc, 0x83, - 0x36, 0x30, 0x9c, 0x4b, 0x1d, 0xdd, 0x80, 0x31, 0x76, 0x72, 0x96, 0x5b, 0xf5, 0xba, 0x68, 0x70, - 0x94, 0x35, 0xf8, 0x84, 0xe4, 0x23, 0x96, 0x4d, 0xf0, 0xc1, 0x5e, 0x09, 0xe2, 0x7f, 0x38, 0x59, - 0x1b, 0xdd, 0x66, 0x4a, 0xd8, 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xb0, - 0x49, 0x97, 0x6e, 0xa7, 0x2a, 0x53, 0x6b, 0x0c, 0x30, 0x71, 0x86, 0xda, 0x4e, 0x5c, 0x9f, 0xc1, - 0x61, 0x94, 0x41, 0x63, 0xee, 0x06, 0x83, 0x26, 0x83, 0xa6, 0x39, 0x15, 0x7c, 0x06, 0x06, 0x09, - 0x1d, 0x42, 0x4a, 0x58, 0x5c, 0x30, 0x17, 0xbb, 0xeb, 0xeb, 0x8a, 0x5b, 0x0d, 0x7c, 0x53, 0x1b, - 0xb7, 0x28, 0x29, 0xe1, 0x98, 0x28, 0x9a, 0x87, 0xbe, 0x90, 0x04, 0xae, 0x92, 0xf8, 0xb7, 0x99, - 0x46, 0x86, 0xc6, 0x5d, 0x1a, 0xf9, 0x6f, 0x2c, 0xaa, 0xd2, 0xe5, 0xe5, 0x30, 0x51, 0x2c, 0xbb, - 0x0c, 0xb4, 0xe5, 0x35, 0xcb, 0x4a, 0xb1, 0x80, 0xa2, 0x37, 0xa1, 0x3f, 0x20, 0x75, 0xa6, 0xee, - 0x1d, 0xe9, 0x7e, 0x91, 0x73, 0xed, 0x31, 0xaf, 0x87, 0x25, 0x01, 0x74, 0x0d, 0x50, 0x40, 0x28, - 0x83, 0xe7, 0x7a, 0x9b, 0xca, 0x08, 0x5f, 0x1c, 0xb4, 0x8a, 0x91, 0xc6, 0x31, 0x86, 0xf4, 0x66, - 0xc5, 0x19, 0xd5, 0xd0, 0x15, 0x98, 0x50, 0xa5, 0xcb, 0x5e, 0x18, 0x39, 0xf4, 0x80, 0x1b, 0x63, - 0xb4, 0x94, 0x7c, 0x05, 0x27, 0x11, 0x70, 0xba, 0x8e, 0xfd, 0x6b, 0x16, 0xf0, 0x71, 0x3e, 0x02, - 0xa9, 0xc2, 0xeb, 0xa6, 0x54, 0xe1, 0x54, 0xee, 0xcc, 0xe5, 0x48, 0x14, 0x7e, 0xcd, 0x82, 0x21, - 0x6d, 0x66, 0xe3, 0x35, 0x6b, 0xb5, 0x59, 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, 0x1e, 0x6f, 0xab, 0x22, 0xe1, 0x71, 0x02, 0x03, 0x3e, 0x1d, 0x65, 0x59, 0x15, - 0xc7, 0x54, 0xd0, 0x35, 0xe8, 0x6f, 0x06, 0xa4, 0x12, 0xb1, 0x20, 0x56, 0xdd, 0x13, 0xe4, 0xcb, - 0x97, 0x57, 0xc4, 0x92, 0x82, 0xfd, 0x1b, 0x05, 0x18, 0x4f, 0xa2, 0xa2, 0xd7, 0xa0, 0x87, 0xdc, - 0x25, 0x55, 0xd1, 0xdf, 0x4c, 0x9e, 0x20, 0x96, 0x91, 0xf0, 0x01, 0xa0, 0xff, 0x31, 0xab, 0x85, - 0xae, 0x42, 0x3f, 0x65, 0x08, 0xae, 0xa8, 0x80, 0x8d, 0x8f, 0xe6, 0x31, 0x15, 0x8a, 0xb3, 0xe2, - 0x9d, 0x13, 0x45, 0x58, 0x56, 0x67, 0x06, 0x69, 0xd5, 0x66, 0x85, 0xbe, 0xb5, 0xa2, 0x76, 0x22, - 0x81, 0xb5, 0xf9, 0x32, 0x47, 0x12, 0xd4, 0xb8, 0x41, 0x9a, 0x2c, 0xc4, 0x31, 0x11, 0xf4, 0x06, - 0xf4, 0x86, 0x75, 0x42, 0x9a, 0xc2, 0xe2, 0x20, 0x53, 0xca, 0x59, 0xa1, 0x08, 0x82, 0x12, 0x93, - 0x8a, 0xb0, 0x02, 0xcc, 0x2b, 0xda, 0xbf, 0x65, 0x01, 0x70, 0x0b, 0x3e, 0xc7, 0xdb, 0x24, 0x47, - 0xa0, 0x18, 0x58, 0x80, 0x9e, 0xb0, 0x49, 0xaa, 0xed, 0xac, 0xfd, 0xe3, 0xfe, 0x54, 0x9a, 0xa4, - 0x1a, 0xaf, 0x59, 0xfa, 0x0f, 0xb3, 0xda, 0xf6, 0x8f, 0x02, 0x8c, 0xc6, 0x68, 0xcb, 0x11, 0x69, - 0xa0, 0xe7, 0x8c, 0x28, 0x37, 0xa7, 0x12, 0x51, 0x6e, 0x06, 0x19, 0xb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xcf, 0xd8, 0x41, - 0x2f, 0x26, 0x67, 0xff, 0x66, 0xc1, 0x68, 0x90, 0x4f, 0xe2, 0x2a, 0x0c, 0x38, 0x21, 0x0b, 0xe2, - 0x5d, 0x6b, 0x27, 0x97, 0x4e, 0x35, 0xc3, 0x1c, 0xd5, 0x66, 0x45, 0x4d, 0xac, 0x68, 0xa0, 0xab, - 0xdc, 0xf6, 0x73, 0x87, 0xb4, 0x13, 0x4a, 0xa7, 0xa8, 0x81, 0xb4, 0x0e, 0xdd, 0x21, 0x58, 0xd4, - 0x47, 0x9f, 0xe2, 0xc6, 0xb9, 0xd7, 0x3c, 0xff, 0x8e, 0x77, 0xc5, 0xf7, 0x65, 0x48, 0xa0, 0xee, - 0x08, 0x4e, 0x48, 0x93, 0x5c, 0x55, 0x1d, 0x9b, 0xd4, 0xba, 0x0b, 0x9d, 0xfd, 0x39, 0x60, 0x79, - 0x49, 0xcc, 0x98, 0x04, 0x21, 0x22, 0x30, 0x26, 0x62, 0x90, 0xca, 0x32, 0x31, 0x76, 0x99, 0xcf, - 0x6f, 0xb3, 0x76, 0xac, 0xc7, 0xb9, 0x66, 0x92, 0xc0, 0x49, 0x9a, 0xf6, 0x16, 0x3f, 0x84, 0x97, - 0x88, 0x13, 0xb5, 0x02, 0x12, 0xa2, 0x8f, 0xc3, 0x54, 0xfa, 0x65, 0x2c, 0xd4, 0x21, 0x16, 0xe3, - 0x9e, 0x4f, 0xef, 0xef, 0x95, 0xa6, 0x2a, 0x39, 0x38, 0x38, 0xb7, 0xb6, 0xfd, 0x2b, 0x16, 0x30, - 0x4f, 0xf0, 0x23, 0xe0, 0x7c, 0x3e, 0x66, 0x72, 0x3e, 0x53, 0x79, 0xd3, 0x99, 0xc3, 0xf4, 0xbc, - 0xc8, 0xd7, 0x70, 0x39, 0xf0, 0xef, 0xee, 0x0a, 0xdb, 0xad, 0xce, 0xcf, 0x38, 0xfb, 0xcb, 0x16, - 0xb0, 0x24, 0x3e, 0x98, 0xbf, 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6f, 0x38, 0x51, 0x75, 0x6b, 0xf1, - 0x6e, 0x33, 0xe0, 0x2a, 0x5a, 0x39, 0x4e, 0xcf, 0x74, 0x1a, 0x27, 0xed, 0x23, 0x63, 0x03, 0xe9, - 0x95, 0x04, 0x31, 0x9c, 0x22, 0x8f, 0x6e, 0xc3, 0x10, 0x2b, 0x63, 0x3e, 0xbd, 0x61, 0x3b, 0x5e, - 0x26, 0xaf, 0x35, 0x65, 0xe2, 0xb3, 0x12, 0xd3, 0xc1, 0x3a, 0x51, 0xfb, 0xab, 0x45, 0x7e, 0x68, - 0xb0, 0xb7, 0xc7, 0x53, 0xd0, 0xdf, 0xf4, 0x6b, 0xf3, 0xcb, 0x0b, 0x58, 0xcc, 0x82, 0xba, 0xf7, - 0xca, 0xbc, 0x18, 0x4b, 0x38, 0xba, 0x00, 0x03, 0xe2, 0xa7, 0x54, 0xa9, 0xb3, 0x3d, 0x22, 0xf0, - 0x42, 0xac, 0xa0, 0xe8, 0x79, 0x80, 0x66, 0xe0, 0xef, 0xb8, 0x35, 0x16, 0x89, 0xa9, 0x68, 0x5a, - 0xe7, 0x95, 0x15, 0x04, 0x6b, 0x58, 0xe8, 0x55, 0x18, 0x69, 0x79, 0x21, 0xe7, 0x9f, 0xb4, 0x78, - 0xf7, 0xca, 0x6e, 0x6c, 0x5d, 0x07, 0x62, 0x13, 0x17, 0xcd, 0x42, 0x5f, 0xe4, 0x30, 0x6b, 0xb3, - 0xde, 0x7c, 0x23, 0xfa, 0x35, 0x8a, 0xa1, 0x67, 0x96, 0xa3, 0x15, 0xb0, 0xa8, 0x88, 0xde, 0x96, - 0xee, 0xf5, 0xfc, 0x26, 0x12, 0xde, 0x2b, 0xdd, 0xdd, 0x5a, 0x9a, 0x73, 0xbd, 0xf0, 0x8a, 0x31, - 0x68, 0xa1, 0x57, 0x00, 0xc8, 0xdd, 0x88, 0x04, 0x9e, 0x53, 0x57, 0x36, 0xa2, 0x8a, 0x91, 0x59, - 0xf0, 0x57, 0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4d, 0x27, 0x49, 0xc4, 0x60, 0xac, - 0x53, 0x40, 0x9f, 0x82, 0x81, 0x50, 0x66, 0xb2, 0xec, 0xb9, 0xff, 0x4c, 0x96, 0x8c, 0xc9, 0x55, - 0x02, 0x16, 0x45, 0x12, 0x7d, 0xbf, 0x1e, 0xfd, 0xa9, 0x8d, 0x68, 0x91, 0x77, 0xf2, 0x3e, 0x62, - 0x40, 0x3d, 0x0f, 0xb0, 0xa3, 0x5e, 0x32, 0x49, 0xe1, 0x89, 0xf6, 0xc6, 0xd1, 0xb0, 0xd0, 0x1b, - 0x30, 0x1e, 0xf2, 0xc0, 0xa7, 0xb1, 0x91, 0x0a, 0x5f, 0x8b, 0x2c, 0x76, 0x5c, 0x25, 0x01, 0xc3, - 0x29, 0x6c, 0xb4, 0x24, 0x5b, 0x65, 0xe6, 0x48, 0x7c, 0x79, 0x9e, 0x8f, 0x5b, 0x14, 0x26, 0x49, - 0xc7, 0x92, 0x93, 0xc0, 0x86, 0x5f, 0xab, 0x89, 0x3e, 0x05, 0x40, 0x17, 0x91, 0x10, 0xa2, 0xf4, - 0xe7, 0x1f, 0xa1, 0xf4, 0x6c, 0xa9, 0x65, 0x7a, 0x32, 0x30, 0x37, 0xfb, 0x05, 0x45, 0x04, 0x6b, - 0x04, 0x91, 0x03, 0x23, 0xf1, 0xbf, 0x38, 0x47, 0xfb, 0x85, 0xdc, 0x16, 0x92, 0xc4, 0x99, 0x82, - 0x61, 0x41, 0x27, 0x81, 0x4d, 0x8a, 0xe8, 0x93, 0x70, 0x6a, 0x27, 0xd7, 0xf2, 0x87, 0x73, 0x82, - 0x2c, 0xe9, 0x7a, 0xbe, 0xbd, 0x4f, 0x7e, 0x7d, 0xfb, 0x7f, 0x07, 0x78, 0xa4, 0xcd, 0x49, 0x8f, - 0x66, 0x4d, 0xad, 0xfd, 0x33, 0x49, 0xc9, 0xc6, 0x74, 0x66, 0x65, 0x43, 0xd4, 0x91, 0xd8, 0x50, - 0x85, 0xf7, 0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, 0x10, 0x7b, 0xd6, 0xdc, 0xd4, 0x89, 0x61, 0x93, 0x36, 0x1d, 0xfe, - 0x77, 0x5b, 0xfe, 0xed, 0xdd, 0x88, 0x88, 0xa8, 0xa3, 0x99, 0xc3, 0xff, 0x16, 0x47, 0x49, 0x0f, - 0xbf, 0x00, 0x60, 0x49, 0x04, 0xdd, 0x14, 0xc3, 0xc3, 0x4e, 0xcf, 0xf1, 0xfc, 0x90, 0xe6, 0xb3, - 0x12, 0x29, 0x67, 0x50, 0xd8, 0x69, 0x19, 0x93, 0x62, 0xa7, 0x64, 0x73, 0xcb, 0x8f, 0x7c, 0x2f, - 0x71, 0x42, 0x4f, 0xe4, 0x9f, 0x92, 0xe5, 0x0c, 0xfc, 0xf4, 0x29, 0x99, 0x85, 0x85, 0x33, 0xdb, - 0x42, 0x35, 0x18, 0x6d, 0xfa, 0x41, 0x74, 0xc7, 0x0f, 0xe4, 0xfa, 0x42, 0x6d, 0x04, 0xa5, 0x06, - 0xa6, 0x68, 0x91, 0x19, 0xe6, 0x98, 0x10, 0x9c, 0xa0, 0x89, 0x3e, 0x0e, 0xfd, 0x61, 0xd5, 0xa9, - 0x93, 0xe5, 0x1b, 0x53, 0x93, 0xf9, 0xd7, 0x4f, 0x85, 0xa3, 0xe4, 0xac, 0x2e, 0x1e, 0x36, 0x89, - 0xa3, 0x60, 0x49, 0x0e, 0x2d, 0x41, 0x2f, 0x4b, 0xec, 0xcc, 0x42, 0xe4, 0xe6, 0x44, 0x66, 0x4f, - 0xb9, 0xd5, 0xf0, 0xb3, 0x89, 0x15, 0x63, 0x5e, 0x9d, 0xee, 0x01, 0x21, 0x29, 0xf0, 0xc3, 0xa9, - 0xe3, 0xf9, 0x7b, 0x40, 0x08, 0x18, 0x6e, 0x54, 0xda, 0xed, 0x01, 0x85, 0x84, 0x63, 0xa2, 0xf4, - 0x64, 0xa6, 0xa7, 0xe9, 0x89, 0x36, 0x26, 0x93, 0xb9, 0x67, 0x29, 0x3b, 0x99,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xb9, - 0xe4, 0x13, 0xf9, 0x31, 0x71, 0xd7, 0x14, 0x9a, 0xae, 0xf3, 0x50, 0x55, 0xb1, 0x4e, 0x07, 0xad, - 0xf1, 0xf5, 0xce, 0xd2, 0x16, 0x91, 0x50, 0x24, 0x63, 0x3f, 0x93, 0x67, 0x2e, 0xc9, 0xd0, 0xcc, - 0xed, 0x20, 0x6a, 0x62, 0x9d, 0x0c, 0xba, 0x02, 0x13, 0xcd, 0xc0, 0xf5, 0xd9, 0x9a, 0x50, 0x9a, - 0xf2, 0x29, 0x33, 0x49, 0x69, 0x39, 0x89, 0x80, 0xd3, 0x75, 0x58, 0x3c, 0x16, 0x51, 0x38, 0x75, - 0x8a, 0x27, 0x5a, 0xe3, 0x72, 0x10, 0x5e, 0x86, 0x15, 0x14, 0xad, 0xb0, 0x93, 0x98, 0x8b, 0xf0, - 0xa6, 0xa6, 0xf3, 0xbd, 0xfc, 0x75, 0x51, 0x1f, 0xe7, 0xfd, 0xd5, 0x5f, 0x1c, 0x53, 0x40, 0x35, - 0x2d, 0xbf, 0x39, 0x7d, 0x41, 0x85, 0x53, 0xa7, 0xdb, 0xd8, 0xeb, 0x26, 0x9e, 0xcb, 0x31, 0x43, - 0x60, 0x14, 0x87, 0x38, 0x41, 0x13, 0xbd, 0x01, 0xe3, 0x22, 0x58, 0x41, 0x3c, 0x4c, 0x67, 0x62, - 0x9f, 0x26, 0x9c, 0x80, 0xe1, 0x14, 0x36, 0x4f, 0x74, 0xe6, 0xdc, 0xae, 0x13, 0x71, 0xf4, 0x5d, - 0x77, 0xbd, 0xed, 0x70, 0xea, 0x2c, 0x3b, 0x1f, 0x44, 0xa2, 0xb3, 0x24, 0x14, 0x67, 0xd4, 0x40, - 0x6b, 0x30, 0xde, 0x0c, 0x08, 0x69, 0xb0, 0x77, 0x92, 0xb8, 0xcf, 0x4a, 0x3c, 0x1c, 0x11, 0xed, - 0x49, 0x39, 0x01, 0x3b, 0xc8, 0x28, 0xc3, 0x29, 0x0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d9, 0x3f, 0x51, - 0x88, 0xe7, 0xf4, 0xad, 0x96, 0x1f, 0x39, 0x47, 0xc0, 0x89, 0x5c, 0x31, 0x38, 0x91, 0x27, 0xda, - 0xe9, 0x73, 0x59, 0x97, 0x72, 0x39, 0x90, 0x1b, 0x09, 0x0e, 0xe4, 0xc9, 0xce, 0xa4, 0xda, 0x73, - 0x1e, 0xff, 0x93, 0x05, 0x13, 0x06, 0xfe, 0x11, 0x5c, 0x80, 0x4b, 0xe6, 0x05, 0xf8, 0x68, 0xc7, - 0x6f, 0xc8, 0xb9, 0xf8, 0x7e, 0xb4, 0x98, 0xe8, 0x3b, 0xbb, 0xf0, 0xde, 0x85, 0x9e, 0x2d, 0x27, - 0xa8, 0x89, 0x77, 0xfd, 0xc5, 0xae, 0xc6, 0x7a, 0xe6, 0xaa, 0x13, 0x08, 0x03, 0x8e, 0x67, 0xe5, - 0xa8, 0xd3, 0xa2, 0x8e, 0xc6, 0x1b, 0xac, 0x29, 0x74, 0x19, 0xfa, 0xc2, 0xaa, 0xdf, 0x54, 0x7e, - 0x80, 0x2c, 0x5d, 0x78, 0x85, 0x95, 0x1c, 0xec, 0x95, 0x90, 0xd9, 0x1c, 0x2d, 0xc6, 0x02, 0x1f, - 0xbd, 0x0d, 0x23, 0xec, 0x97, 0xb2, 0xa6, 0x2c, 0xe6, 0x4b, 0x60, 0x2a, 0x3a, 0x22, 0x37, 0x35, - 0x36, 0x8a, 0xb0, 0x49, 0x6a, 0x7a, 0x13, 0x06, 0xd5, 0x67, 0x3d, 0x54, 0x6d, 0xfd, 0xff, 0x59, - 0x84, 0xc9, 0x8c, 0x35, 0x87, 0x42, 0x63, 0x26, 0x2e, 0x75, 0xb9, 0x54, 0xdf, 0xe3, 0x5c, 0x84, - 0xec, 0x01, 0x58, 0x13, 0x6b, 0xab, 0xeb, 0x46, 0xd7, 0x43, 0x92, 0x6c, 0x94, 0x16, 0x75, 0x6e, - 0x94, 0x36, 0x76, 0x64, 0x43, 0x4d,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86, 0xd4, 0xeb, 0xb4, 0x10, - 0x73, 0x98, 0xfd, 0xdb, 0x3d, 0x70, 0xa6, 0x6d, 0x64, 0x39, 0xca, 0x60, 0x6e, 0x3a, 0x11, 0xb9, - 0xe3, 0xec, 0x26, 0x33, 0x03, 0x5e, 0xe1, 0xc5, 0x58, 0xc2, 0x99, 0xb3, 0x35, 0xcf, 0x94, 0x93, - 0x10, 0x0e, 0x8b, 0x04, 0x39, 0x02, 0x6a, 0x0a, 0x1b, 0x8b, 0x0f, 0x42, 0xd8, 0xf8, 0x3c, 0x40, - 0x18, 0xd6, 0xb9, 0x1d, 0x67, 0x4d, 0x78, 0x71, 0xc7, 0x19, 0x95, 0x2a, 0xd7, 0x05, 0x04, 0x6b, - 0x58, 0x68, 0x01, 0xc6, 0x9b, 0x81, 0x1f, 0x71, 0x59, 0xfb, 0x02, 0x37, 0x75, 0xee, 0x35, 0x83, - 0x7a, 0x95, 0x13, 0x70, 0x9c, 0xaa, 0x81, 0x5e, 0x82, 0x21, 0x11, 0xe8, 0xab, 0xec, 0xfb, 0x75, - 0x21, 0xde, 0x53, 0xd6, 0xbf, 0x95, 0x18, 0x84, 0x75, 0x3c, 0xad, 0x1a, 0x13, 0xe0, 0xf7, 0x67, - 0x56, 0xe3, 0x42, 0x7c, 0x0d, 0x2f, 0x91, 0x14, 0x60, 0xa0, 0xab, 0xa4, 0x00, 0xb1, 0xc0, 0x73, - 0xb0, 0x6b, 0x7d, 0x32, 0x74, 0x14, 0x11, 0x7e, 0xad, 0x07, 0x26, 0xc5, 0xc2, 0x79, 0xd8, 0xcb, - 0x65, 0x3d, 0xbd, 0x5c, 0x1e, 0x84, 0x48, 0xf4, 0x83, 0x35, 0x73, 0xd4, 0x6b, 0xe6, 0x27, 0x2d, - 0x30, 0x79, 0x48, 0xf4, 0x9f, 0xe5, 0xa6, 0x56, 0x7d, 0x29, 0x97, 0x27, 0x8d, 0x23, 0x86, 0xbf, - 0xb7, 0x24, 0xab, 0xf6, 0xff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xda, - 0x39, 0xc3, 0xfc, 0x97, 0x05, 0xd5, 0xdf, 0xb2, 0x1f, 0x44, 0x5d, 0x70, 0x89, 0xf7, 0xef, 0xf6, - 0x72, 0x09, 0x86, 0x9c, 0x66, 0x53, 0x02, 0xa4, 0xfd, 0x22, 0x4b, 0x15, 0x11, 0x17, 0x63, 0x1d, - 0x47, 0x79, 0xe1, 0x14, 0x73, 0xbd, 0x70, 0x6a, 0x00, 0x91, 0x13, 0x6c, 0x92, 0x88, 0x96, 0x09, - 0x73, 0xeb, 0xfc, 0xf3, 0xa6, 0x15, 0xb9, 0xf5, 0x19, 0xd7, 0x8b, 0xc2, 0x28, 0x98, 0x59, 0xf6, - 0xa2, 0x1b, 0x01, 0x7f, 0xa6, 0x6a, 0x41, 0x13, 0x15, 0x2d, 0xac, 0xd1, 0x95, 0x61, 0x4d, 0x58, - 0x1b, 0xbd, 0xa6, 0x21, 0xcc, 0xaa, 0x28, 0xc7, 0x0a, 0xc3, 0x7e, 0x99, 0xdd, 0x3e, 0x6c, 0x4c, - 0x0f, 0x17, 0x0c, 0xf0, 0x1f, 0x86, 0xd5, 0x6c, 0x30, 0x95, 0xf0, 0x82, 0x1e, 0x72, 0xb0, 0xfd, - 0x61, 0x4f, 0x1b, 0xd6, 0xfd, 0x59, 0xe3, 0xb8, 0x84, 0xe8, 0x93, 0x29, 0xe3, 0xa6, 0xe7, 0x3a, - 0xdc, 0x1a, 0x87, 0x30, 0x67, 0x62, 0x79, 0xe3, 0x58, 0x56, 0xad, 0xe5, 0xb2, 0xd8, 0x17, 0x5a, - 0xde, 0x38, 0x01, 0xc0, 0x31, 0x0e, 0x65, 0xd8, 0xd4, 0x9f, 0x70, 0x0a, 0xc5, 0xe1, 0xc5, 0x15, - 0x76, 0x88, 0x35, 0x0c, 0x74, 0x51, 0x08, 0x2d, 0xb8, 0xee, 0xe1, 0x91, 0x84, 0xd0, 0x42, 0x0e, - 0x97, 0x26, 0x69, 0xba, 0x04, 0x43, 0xe4, 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 0xa1, - 0xcf, 0xc1, 0x64, 0x98, 0xa3, 0x12, 0xcb, 0x4b, 0x67, 0xde, 0x4e, 0x4b, 0xc4, 0x85, 0x29, 0x59, - 0xca, 0xb3, 0xac, 0x66, 0xd0, 0x5d, 0x40, 0x42, 0xf4, 0xbc, 0x16, 0xb4, 0xc2, 0x68, 0xae, 0xe5, - 0xd5, 0xea, 0x32, 0x65, 0xd3, 0x87, 0xb3, 0xe5, 0x04, 0x49, 0x6c, 0xad, 0x6d, 0x16, 0x12, 0x38, - 0x8d, 0x81, 0x33, 0xda, 0xb0, 0xbf, 0xd0, 0x03, 0xd3, 0x32, 0x61, 0x74, 0x86, 0xf7, 0xca, 0xe7, - 0xad, 0x84, 0xfb, 0xca, 0x2b, 0xf9, 0x07, 0xfd, 0x43, 0x73, 0x62, 0xf9, 0x52, 0xda, 0x89, 0xe5, - 0xb5, 0x43, 0x76, 0xe3, 0x81, 0xb9, 0xb2, 0x7c, 0xcf, 0xfa, 0x9f, 0xec, 0x1f, 0x03, 0xe3, 0x6a, - 0x46, 0x98, 0xc7, 0x5b, 0x2f, 0x4b, 0xd5, 0x51, 0xce, 0xf3, 0xff, 0xaa, 0xc0, 0x31, 0x2e, 0xfb, - 0x61, 0x19, 0x95, 0x9d, 0x9d, 0xb3, 0x8a, 0x0e, 0xa5, 0x49, 0x1a, 0xcd, 0x68, 0x77, 0xc1, 0x0d, - 0x44, 0x8f, 0x33, 0x69, 0x2e, 0x0a, 0x9c, 0x34, 0x4d, 0x09, 0xc1, 0x8a, 0x0e, 0xda, 0x81, 0x89, - 0x4d, 0x16, 0xf1, 0x49, 0xcb, 0xdd, 0x2c, 0xce, 0x85, 0xcc, 0x7d, 0x7b, 0x65, 0x7e, 0x31, 0x3f, - 0xd1, 0x33, 0x7f, 0xfc, 0xa5, 0x50, 0x70, 0xba, 0x09, 0xba, 0x35, 0x8e, 0x39, 0x77, 0xc2, 0xc5, - 0xba, 0x13, 0x46, 0x6e, 0x75, 0xae, 0xee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c, 0xb3, 0x0b, 0x02, 0xeb, 0x00, 0x6c, 0xe2, 0xa1, 0x4b, 0x3c, 0x6d, 0x92, 0x48, 0xb0, - 0x25, 0x54, 0xa6, 0x63, 0x32, 0x27, 0x92, 0x28, 0xc6, 0x3a, 0xce, 0xdc, 0xe5, 0x3f, 0xfd, 0xf6, - 0xd9, 0x0f, 0xfd, 0xc5, 0xb7, 0xcf, 0x7e, 0xe8, 0xaf, 0xbe, 0x7d, 0xf6, 0x43, 0x3f, 0xb4, 0x7f, - 0xd6, 0xfa, 0xd3, 0xfd, 0xb3, 0xd6, 0x5f, 0xec, 0x9f, 0xb5, 0xfe, 0x6a, 0xff, 0xac, 0xf5, 0xff, - 0xee, 0x9f, 0xb5, 0xbe, 0xfc, 0xb7, 0x67, 0x3f, 0xf4, 0x36, 0x8a, 0x23, 0x54, 0x5f, 0xa4, 0xb3, - 0x73, 0x71, 0xe7, 0xd2, 0x7f, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x60, 0x45, 0x7a, 0xd6, 0xa3, 0x24, - 0x01, 0x00, + // 16206 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x69, 0x90, 0x1c, 0xc9, + 0x75, 0x30, 0xc6, 0xea, 0x9e, 0xf3, 0xcd, 0x9d, 0xb8, 0x06, 0xb3, 0x00, 0x1a, 0x5b, 0xbb, 0x8b, + 0xc5, 0x5e, 0x03, 0x62, 0x0f, 0x2e, 0xb8, 0xbb, 0x5c, 0xed, 0x9c, 0x40, 0x2f, 0x30, 0x83, 0xde, + 0xec, 0x01, 0x40, 0x2e, 0x97, 0x14, 0x0b, 0xdd, 0x39, 0x33, 0xc5, 0xe9, 0xae, 0xea, 0xad, 0xaa, + 0x1e, 0x60, 0x60, 0x2a, 0x24, 0x51, 0x16, 0x25, 0x52, 0x72, 0x04, 0x43, 0x21, 0x59, 0x0e, 0x4a, + 0xa1, 0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e, 0xaf, 0x65, 0x62, 0xe1, 0x9c, 0xda, 0xe8, 0x2e, 0x4c, 0x67, 0x40, + 0xf8, 0xba, 0x3d, 0xca, 0x28, 0xbf, 0x26, 0x28, 0x4f, 0xaf, 0xe5, 0xe0, 0xed, 0x77, 0x80, 0xe1, + 0x5c, 0xea, 0xe8, 0x3a, 0x4c, 0xb0, 0x93, 0xb3, 0xd2, 0x6e, 0x34, 0x44, 0x83, 0xe3, 0xac, 0xc1, + 0x27, 0x24, 0x1f, 0x51, 0x36, 0xc1, 0xfb, 0xbb, 0x25, 0x88, 0xff, 0xe1, 0x64, 0x6d, 0x74, 0x9b, + 0x29, 0x61, 0xdb, 0x81, 0x1b, 0xed, 0xd0, 0x5d, 0x45, 0xee, 0x46, 0xd3, 0x13, 0x1d, 0x05, 0x52, + 0x3a, 0xaa, 0xd2, 0xd4, 0xea, 0x85, 0x38, 0x49, 0x90, 0x5e, 0x05, 0x61, 0x54, 0x77, 0xbd, 0xe9, + 0x49, 0xfe, 0x9e, 0x92, 0x27, 0x69, 0x95, 0x16, 0x62, 0x0e, 0x63, 0x0a, 0x58, 0xfa, 0xe3, 0x3a, + 0xbd, 0x71, 0xa7, 0x18, 0x62, 0xac, 0x80, 0x95, 0x00, 0x1c, 0xe3, 0x50, 0x26, 0x38, 0x8a, 0x76, + 0xa6, 0x11, 0x43, 0x55, 0x07, 0xe2, 0xda, 0xda, 0x27, 0x30, 0x2d, 0xb7, 0x6f, 0xc3, 0xb8, 0x3a, + 0x26, 0xd8, 0x98, 0xa0, 0x12, 0xf4, 0x33, 0xb6, 0x4f, 0x88, 0x4f, 0x87, 0x69, 0x17, 0x18, 0x4b, + 0x88, 0x79, 0x39, 0xeb, 0x82, 0x7b, 0x8f, 0xcc, 0xef, 0x44, 0x84, 0xcb, 0x22, 0x8a, 0x5a, 0x17, + 0x24, 0x00, 0xc7, 0x38, 0xf6, 0xbf, 0xe7, 0xec, 0x73, 0x7c, 0x4b, 0xf4, 0x70, 0x2f,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, 0x16, 0xfd, 0x3b, 0xde, 0x1d, 0x27, 0xa8, 0xcf, 0x55, 0xca, 0x9a, 0xbc, 0x70, + 0x55, 0xca, 0xab, 0xac, 0x7c, 0x69, 0x80, 0x56, 0x93, 0x2f, 0xc2, 0x65, 0xb7, 0x41, 0x72, 0xa4, + 0xba, 0x3f, 0x5b, 0x30, 0x5a, 0x8a, 0xf1, 0x95, 0x4e, 0xd2, 0xca, 0x35, 0x67, 0x78, 0x0b, 0x86, + 0xd6, 0x5d, 0xd2, 0xa8, 0x63, 0xb2, 0x2e, 0x66, 0xe3, 0xc9, 0x7c, 0x83, 0xc7, 0x65, 0x8a, 0xa9, + 0x94, 0xa7, 0x4c, 0xda, 0xb5, 0x2c, 0x2a, 0x63, 0x45, 0x06, 0x6d, 0xc1, 0xa4, 0x9c, 0x33, 0x09, + 0x15, 0xe7, 0xfd, 0x53, 0x9d, 0x96, 0xaf, 0x49, 0x9c, 0x19, 0x7f, 0xe3, 0x04, 0x19, 0x9c, 0x22, + 0x8c, 0x4e, 0x41, 0x5f, 0x93, 0x72, 0x36, 0x7d, 0x6c, 0xf8, 0x99, 0x78, 0x8b, 0x49, 0xea, 0x58, + 0xa9, 0xfd, 0xf3, 0x16, 0x9c, 0x48, 0x8d, 0x8c, 0x90, 0x58, 0x3e, 0xe0, 0x59, 0x48, 0x4a, 0x10, + 0x0b, 0xdd, 0x25, 0x88, 0xf6, 0x7f, 0x61, 0xc1, 0xd1, 0xa5, 0x66, 0x2b, 0xda, 0x59, 0x74, 0x4d, + 0xdb, 0x83, 0x97, 0x61, 0xa0, 0x49, 0xea, 0x6e, 0xbb, 0x29, 0x66, 0xae, 0x24, 0x6f, 0xff, 0x15, + 0x56, 0x4a, 0x4f, 0x90, 0x6a, 0xe4, 0x07, 0xce, 0x06, 0xe1, 0x05, 0x58, 0xa0, 0x33, 0x1e, 0xca, + 0xbd, 0x47, 0xae, 0xb9, 0x4d, 0x37, 0xba, 0xbf, 0xdd, 0x25, 0xcc,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x77, 0xbd, 0x6d, 0xbf, + 0xb1, 0x4d, 0xea, 0x1c, 0x7e, 0x90, 0x17, 0xf8, 0x71, 0x41, 0x7a, 0xbc, 0x6c, 0x90, 0xc0, 0x09, + 0x92, 0x0f, 0x43, 0xbb, 0x74, 0x19, 0x06, 0xf8, 0xe5, 0x23, 0x54, 0x4b, 0x99, 0x67, 0x36, 0x1b, + 0x44, 0x71, 0xa5, 0xc6, 0x9a, 0x2f, 0x7e, 0xb9, 0x89, 0xea, 0xe8, 0xb3, 0x30, 0xbe, 0xee, 0x06, + 0x61, 0xb4, 0xe6, 0x36, 0xe9, 0xd5, 0xd0, 0x6c, 0xdd, 0x87, 0x36, 0x49, 0x8d, 0xc3, 0xb2, 0x41, + 0x09, 0x27, 0x28, 0xa3, 0x0d, 0x18, 0x6b, 0x38, 0x7a, 0x53, 0x83, 0x07, 0x6e, 0x4a, 0xdd, 0x0e, + 0xd7, 0x74, 0x42, 0xd8, 0xa4, 0x4b, 0xb7, 0x53, 0x8d, 0x29, 0x44, 0x86, 0x98, 0x38, 0x43, 0x6d, + 0x27, 0xae, 0x09, 0xe1, 0x30, 0xca, 0xa0, 0x31, 0x47, 0x85, 0x61, 0x93, 0x41, 0xd3, 0xdc, 0x11, + 0x3e, 0x03, 0xc3, 0x84, 0x0e, 0x21, 0x25, 0x2c, 0x2e, 0x98, 0x0b, 0xbd, 0xf5, 0x75, 0xc5, 0xad, + 0x05, 0xbe, 0xa9, 0xc7, 0x5b, 0x92, 0x94, 0x70, 0x4c, 0x14, 0x2d, 0xc0, 0x40, 0x48, 0x02, 0x57, + 0xe9, 0x0a, 0x3a, 0x4c, 0x23, 0x43, 0xe3, 0xce, 0x90, 0xfc, 0x37, 0x16, 0x55, 0xe9, 0xf2, 0x72, + 0x98, 0x28, 0x96, 0x5d, 0x06, 0xda, 0xf2, 0x9a, 0x63, 0xa5, 0x58, 0x40, 0xd1, 0x9b, 0x30, 0x18, + 0x90, 0x06, 0x53, 0x14, 0x8f, 0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, 0x04, 0x26, 0x44, 0xdc, 0x53, 0x59, 0x26, 0xc6, 0x2e, 0xf3, 0xf9, 0x6d, 0xd6, 0x8e, 0x35, + 0x40, 0x57, 0x4d, 0x12, 0x38, 0x49, 0xd3, 0xde, 0xe4, 0x87, 0xf0, 0x32, 0x71, 0xa2, 0x76, 0x40, + 0x42, 0xf4, 0x71, 0x98, 0x4e, 0xbf, 0x8c, 0x85, 0x22, 0xc5, 0x62, 0xdc, 0xf3, 0xa9, 0xbd, 0xdd, + 0xd2, 0x74, 0x35, 0x07, 0x07, 0xe7, 0xd6, 0xb6, 0x7f, 0xcd, 0x02, 0xe6, 0x43, 0x7e, 0x08, 0x9c, + 0xcf, 0xc7, 0x4c, 0xce, 0x67, 0x3a, 0x6f, 0x3a, 0x73, 0x98, 0x9e, 0x17, 0xf9, 0x1a, 0xae, 0x04, + 0xfe, 0xdd, 0x1d, 0x61, 0xf5, 0xd5, 0xfd, 0x19, 0x67, 0x7f, 0xd9, 0x02, 0x96, 0x38, 0x08, 0xf3, + 0x57, 0xbb, 0x54, 0x70, 0x74, 0x37, 0x68, 0xf8, 0x38, 0x0c, 0xad, 0x8b, 0xe1, 0xcf, 0x10, 0x3a, + 0x19, 0x1d, 0x36, 0x69, 0xcb, 0x49, 0x13, 0xbe, 0xa0, 0xe2, 0x1f, 0x56, 0xd4, 0xec, 0xff, 0xd2, + 0x82, 0x99, 0xfc, 0x6a, 0xe8, 0x06, 0x9c, 0x08, 0x48, 0xad, 0x1d, 0x84, 0x74, 0x4b, 0x88, 0x07, + 0x90, 0x70, 0xa7, 0xe2, 0x53, 0xfd, 0xc8, 0xde, 0x6e, 0xe9, 0x04, 0xce, 0x46, 0xc1, 0x79, 0x75, + 0xd1, 0x2b, 0x30, 0xde, 0x0e, 0x39, 0xe7, 0xc7, 0x98, 0xae, 0x50, 0x44, 0xa7, 0x66, 0x1e, 0x47, + 0x37, 0x0c, 0x08, 0x4e, 0x60, 0xda, 0x3f, 0xc0, 0x97, 0x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1d, 0x19, 0xa9, 0x99, 0x71, + 0xd8, 0x2b, 0x06, 0x04, 0x27, 0x30, 0xd1, 0x02, 0x4c, 0x35, 0xdd, 0x30, 0x51, 0x7d, 0x80, 0x55, + 0x67, 0x1d, 0x58, 0x49, 0x02, 0x71, 0x1a, 0xdf, 0xfe, 0x75, 0x31, 0xc7, 0x5e, 0xe4, 0x7e, 0xb0, + 0x1d, 0xdf, 0xdf, 0xdb, 0xf1, 0x9b, 0x16, 0x4c, 0xd2, 0xd6, 0x99, 0x41, 0xa8, 0x64, 0xa4, 0x54, + 0x2e, 0x0f, 0xab, 0x43, 0x2e, 0x8f, 0x73, 0xf4, 0xd8, 0xae, 0xfb, 0xed, 0x48, 0x48, 0x47, 0xb5, + 0x73, 0x99, 0x96, 0x62, 0x01, 0x15, 0x78, 0x24, 0x08, 0x84, 0xd7, 0xbd, 0x8e, 0x47, 0x82, 0x00, + 0x0b, 0xa8, 0x4c, 0xf5, 0xd1, 0x97, 0x9d, 0xea, 0x83, 0x47, 0x6c, 0x17, 0x76, 0x74, 0x82, 0xa5, + 0xd5, 0x22, 0xb6, 0x4b, 0x03, 0xbb, 0x18, 0xc7, 0xfe, 0x76, 0x11, 0x46, 0x2b, 0x7e, 0x3d, 0x36, + 0xec, 0x78, 0xd1, 0x30, 0xec, 0x38, 0x9b, 0x30, 0xec, 0x98, 0xd4, 0x71, 0x35, 0x33, 0x8e, 0x37, + 0x01, 0xf9, 0x22, 0x90, 0xfc, 0x65, 0xe2, 0x31, 0xbb, 0x37, 0x61, 0xa8, 0x57, 0x8c, 0xcd, 0x1e, + 0xae, 0xa7, 0x30, 0x70, 0x46, 0xad, 0x0f, 0x4c, 0x42, 0x0e, 0xd7, 0x24, 0xe4, 0x4f, 0x2c, 0xb6, + 0x02, 0x16, 0x57, 0xab, 0xdc, 0x56, 0x19, 0x5d, 0x84, 0x11, 0x76, 0x5a, 0xb2, 0x90, 0x11, 0xd2, + 0x72, 0x82, 0xa5, 0xf1, 0x5c,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0x22, 0xee, 0x4c, 0x07, 0x5d, 0x87, 0x63, 0x3c, 0x16, 0xcd, 0x22, 0x71, 0xea, 0x0d, 0xd7, 0x53, + 0x5c, 0x33, 0x3f, 0xbb, 0x4e, 0xee, 0xed, 0x96, 0x8e, 0xcd, 0x65, 0x21, 0xe0, 0xec, 0x7a, 0xe8, + 0x35, 0x18, 0xae, 0x7b, 0xf2, 0x94, 0x1d, 0x30, 0x32, 0xe1, 0x0e, 0x2f, 0xae, 0x56, 0xd5, 0xf7, + 0xc7, 0x7f, 0x70, 0x5c, 0x01, 0x6d, 0x70, 0x15, 0x98, 0x92, 0x5b, 0x0e, 0xa6, 0x42, 0x94, 0x26, + 0x45, 0xfb, 0x46, 0x70, 0x07, 0xae, 0xfb, 0x55, 0x0e, 0x80, 0x46, 0xdc, 0x07, 0x83, 0x30, 0x7a, + 0x13, 0x90, 0xc8, 0xb8, 0x34, 0x57, 0x63, 0x09, 0x02, 0x35, 0xbb, 0x54, 0x25, 0x42, 0xa8, 0xa6, + 0x30, 0x70, 0x46, 0x2d, 0x74, 0x85, 0x1e, 0x8f, 0x7a, 0xa9, 0x38, 0x7e, 0x55, 0xbe, 0xf5, 0x45, + 0xd2, 0x0a, 0x08, 0x33, 0xa5, 0x34, 0x29, 0xe2, 0x44, 0x3d, 0x54, 0x87, 0x53, 0x4e, 0x3b, 0xf2, + 0x99, 0x76, 0xd1, 0x44, 0x5d, 0xf3, 0xb7, 0x88, 0xc7, 0x14, 0xfb, 0x43, 0x2c, 0xf4, 0xe9, 0xa9, + 0xb9, 0x0e, 0x78, 0xb8, 0x23, 0x15, 0xfa, 0x9c, 0xa2, 0x63, 0xa1, 0x29, 0xfe, 0x0c, 0x3f, 0x75, + 0xae, 0x0d, 0x97, 0x18, 0xe8, 0x25, 0x18, 0xd9, 0xf4, 0xc3, 0x68, 0x95, 0x44, 0x77, 0xfc, 0x60, + 0x4b, 0xa4, 0x78, 0x88, 0xd3, 0xea, 0xc4, 0x20, 0xac, 0x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0xbf, 0xf7, 0x53, + 0x5c, 0x89, 0x21, 0xb3, 0xa0, 0x38, 0xb3, 0x0d, 0x74, 0x9e, 0xee, 0x38, 0x7a, 0xea, 0x3a, 0x0d, + 0x11, 0x99, 0x64, 0x94, 0xef, 0x36, 0x5e, 0x86, 0x15, 0xd4, 0xfe, 0x5b, 0x0b, 0xa6, 0x78, 0xcf, + 0xaf, 0x92, 0x1d, 0x75, 0x36, 0x7d, 0x27, 0xfb, 0x2e, 0xd2, 0x84, 0x17, 0x72, 0xd2, 0x84, 0xeb, + 0x9f, 0x56, 0xec, 0xf8, 0x69, 0x5f, 0xb5, 0x40, 0xac, 0x90, 0x43, 0x90, 0xb4, 0x7c, 0x9f, 0x29, + 0x69, 0x99, 0xc9, 0xdf, 0x04, 0x39, 0x22, 0x96, 0x7f, 0xb3, 0x60, 0x92, 0x23, 0xc4, 0x56, 0x10, + 0xdf, 0xd1, 0x79, 0x98, 0x37, 0xbf, 0x28, 0xd3, 0xac, 0xf5, 0x2a, 0xd9, 0x59, 0xf3, 0x2b, 0x4e, + 0xb4, 0x99, 0xfd, 0x51, 0xc6, 0x64, 0xf5, 0x75, 0x9c, 0xac, 0xba, 0xdc, 0x40, 0x46, 0x42, 0xc8, + 0x2e, 0x02, 0xe0, 0x83, 0x26, 0x84, 0xb4, 0xff, 0xd1, 0x02, 0xc4, 0x9b, 0x31, 0x18, 0x37, 0xca, + 0x0e, 0xb1, 0x52, 0xed, 0xa2, 0x8b, 0x8f, 0x26, 0x05, 0xc1, 0x1a, 0xd6, 0x03, 0x19, 0x9e, 0x84, + 0x29, 0x4b, 0xb1, 0xbb, 0x29, 0xcb, 0x01, 0x46, 0xf4, 0xab, 0x83, 0x90, 0x74, 0xeb, 0x44, 0x37, + 0x61, 0xb4, 0xe6, 0xb4, 0x9c, 0xdb, 0x6e, 0xc3, 0x8d, 0x5c, 0x12, 0x76, 0xb2, 0x73, 0x5b, 0xd0, + 0xf0, 0x84, 0xf1, 0x81, 0x56, 0x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 0x3a, 0x67, 0xa8, + 0x64, 0x4a, 0xd9, 0x93, 0xc2, 0x3a, 0x93, 0xab, 0x8c, 0x29, 0x27, 0x94, 0x31, 0x8f, 0x76, 0x22, + 0xd2, 0x59, 0x0d, 0xf3, 0x9f, 0x15, 0xe9, 0x0b, 0xc1, 0x08, 0x5a, 0xf0, 0xf0, 0x87, 0x60, 0x15, + 0x06, 0x43, 0xe1, 0x34, 0x5f, 0xc8, 0xf7, 0xe5, 0x49, 0x4e, 0x62, 0x6c, 0x03, 0x29, 0xdc, 0xe4, + 0x25, 0x91, 0x4c, 0x6f, 0xfc, 0xe2, 0x43, 0xf4, 0xc6, 0xef, 0x16, 0xd6, 0xa1, 0xef, 0x41, 0x84, + 0x75, 0xb0, 0xbf, 0xce, 0x6e, 0x67, 0xbd, 0xfc, 0x10, 0x18, 0xb7, 0xcb, 0xe6, 0x3d, 0x6e, 0x77, + 0x58, 0x59, 0xa2, 0x53, 0x39, 0x0c, 0xdc, 0xef, 0x5a, 0x70, 0x3a, 0xe3, 0xab, 0x34, 0x6e, 0xee, + 0x59, 0x18, 0x72, 0xda, 0x75, 0x57, 0xed, 0x65, 0x4d, 0x5b, 0x3c, 0x27, 0xca, 0xb1, 0xc2, 0x40, + 0x0b, 0x30, 0x45, 0xee, 0xb6, 0x5c, 0xae, 0x86, 0xd7, 0x4d, 0xc7, 0x8b, 0xdc, 0xbf, 0x78, 0x29, + 0x09, 0xc4, 0x69, 0x7c, 0x15, 0x1a, 0xae, 0x98, 0x1b, 0x1a, 0xee, 0x37, 0x2d, 0x18, 0x51, 0x6e, + 0xe3, 0x0f, 0x7d, 0xb4, 0xdf, 0x30, 0x47, 0xfb, 0x91, 0x0e, 0xa3, 0x9d, 0x33, 0xcc, 0x7f, 0x53, + 0x50, 0xfd, 0xad, 0xf8, 0x41, 0xd4, 0x03, 0x97, 0x78, 0xff, 0x6e, 0x2f, 0x17, 0x61, 0xc4, 0x69, + 0xb5, 0x24, 0x40, 0xda, 0x2f, 0xb2, 0x14, 0x16, 0x71, 0x31, 0xd6, 0x71, 0x94, 0x17, 0x4e, 0x31, + 0xd7, 0x0b, 0xa7, 0x0e, 0x10, 0x39, 0xc1, 0x06, 0x89, 0x68, 0x99, 0x30, 0xb7, 0xce, 0x3f, 0x6f, + 0xda, 0x91, 0xdb, 0x98, 0x75, 0xbd, 0x28, 0x8c, 0x82, 0xd9, 0xb2, 0x17, 0x5d, 0x0f, 0xf8, 0x33, + 0x55, 0x0b, 0xc0, 0xa8, 0x68, 0x61, 0x8d, 0xae, 0x0c, 0x91, 0xc2, 0xda, 0xe8, 0x37, 0x0d, 0x61, + 0x56, 0x45, 0x39, 0x56, 0x18, 0xf6, 0xcb, 0xec, 0xf6, 0x61, 0x63, 0x7a, 0xb0, 0xc0, 0x82, 0xff, + 0x34, 0xaa, 0x66, 0x83, 0xa9, 0x84, 0x17, 0xf5, 0xf0, 0x85, 0x9d, 0x0f, 0x7b, 0xda, 0xb0, 0xee, + 0xcf, 0x1a, 0xc7, 0x38, 0x44, 0x9f, 0x4c, 0x19, 0x37, 0x3d, 0xd7, 0xe5, 0xd6, 0x38, 0x80, 0x39, + 0x13, 0xcb, 0x67, 0xc7, 0xb2, 0x7d, 0x95, 0x2b, 0x62, 0x5f, 0x68, 0xf9, 0xec, 0x04, 0x00, 0xc7, + 0x38, 0x94, 0x61, 0x53, 0x7f, 0xc2, 0x69, 0x14, 0x87, 0x3d, 0x57, 0xd8, 0x21, 0xd6, 0x30, 0xd0, + 0x05, 0x21, 0xb4, 0xe0, 0xba, 0x87, 0x47, 0x12, 0x42, 0x0b, 0x39, 0x5c, 0x9a, 0xa4, 0xe9, 0x22, + 0x8c, 0x90, 0xbb, 0x11, 0x09, 0x3c, 0xa7, 0x41, 0x5b, 0xe8, 0x8f, 0xa3, 0xeb, 0x2e, 0xc5, 0xc5, + 0x58, 0xc7, 0x41, 0x6b, 0x30, 0x11, 0x72, 0x59, 0x9e, 0x4a, 0xb6, 0xc1, 0x65, 0xa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7a, 0x75, 0x12, 0x30, 0xe5, 0x56, 0xce, 0x52, + 0x5a, 0x60, 0x18, 0xe9, 0xa5, 0xc4, 0xcb, 0xb1, 0xa0, 0xc0, 0x68, 0x91, 0xd6, 0xe6, 0x7a, 0xd8, + 0x29, 0x2b, 0xc6, 0x02, 0x69, 0x6d, 0x26, 0x16, 0x14, 0xa7, 0xc5, 0xca, 0xb1, 0xa0, 0x40, 0xb7, + 0xcc, 0x3a, 0xdd, 0x40, 0x24, 0x98, 0x9e, 0xc8, 0xdf, 0x32, 0xcb, 0x1c, 0x25, 0xbd, 0x65, 0x04, + 0x00, 0x4b, 0x22, 0xe8, 0xd3, 0x26, 0xb7, 0x33, 0xc9, 0x68, 0x3e, 0xd3, 0x85, 0xdb, 0x31, 0xe8, + 0x76, 0xe6, 0x77, 0x5e, 0x81, 0xc2, 0x7a, 0x8d, 0x29, 0xc5, 0x72, 0x74, 0x06, 0xcb, 0x0b, 0x06, + 0x35, 0x16, 0x65, 0x7e, 0x79, 0x01, 0x17, 0xd6, 0x6b, 0x74, 0xe9, 0x3b, 0xf7, 0xda, 0x01, 0x59, + 0x76, 0x1b, 0x44, 0x64, 0xc8, 0xc8, 0x5c, 0xfa, 0x73, 0x12, 0x29, 0xbd, 0xf4, 0x15, 0x08, 0xc7, + 0xa4, 0x28, 0xdd, 0x98, 0x07, 0x3b, 0x92, 0x4f, 0x57, 0xb1, 0x5a, 0x69, 0xba, 0x99, 0x5c, 0xd8, + 0x16, 0x8c, 0x6d, 0x87, 0xad, 0x4d, 0x22, 0x4f, 0x45, 0xa6, 0xae, 0xcb, 0x89, 0x54, 0x71, 0x53, + 0x20, 0xba, 0x41, 0xd4, 0x76, 0x1a, 0xa9, 0x83, 0x9c, 0x89, 0x56, 0x6e, 0xea, 0xc4, 0xb0, 0x49, + 0x9b, 0x2e, 0x84, 0x77, 0x79, 0x38, 0x39, 0xa6, 0xb8, 0xcb, 0x59, 0x08, 0x19, 0x11, 0xe7, 0xf8, + 0x42,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 0xea, + 0x5b, 0x67, 0x3e, 0xf4, 0xb7, 0xdf, 0x3a, 0xf3, 0xa1, 0x1f, 0xda, 0x3b, 0x63, 0xfd, 0xc5, 0xde, + 0x19, 0xeb, 0xaf, 0xf6, 0xce, 0x58, 0x7f, 0xbb, 0x77, 0xc6, 0xfa, 0xdf, 0xf7, 0xce, 0x58, 0x5f, + 0xfe, 0x3f, 0xce, 0x7c, 0xe8, 0x6d, 0x14, 0x47, 0xa8, 0xbe, 0x40, 0x67, 0xe7, 0xc2, 0xf6, 0xc5, + 0xff, 0x10, 0x00, 0x00, 0xff, 0xff, 0xf5, 0xf1, 0x8c, 0x4c, 0x2d, 0x26, 0x01, 0x00, } func (m *AWSElasticBlockStoreVolumeSource) Marshal() (dAtA []byte, err error) { @@ -9887,6 +9921,13 @@ func (m *ContainerStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.StopSignal != nil { + i -= len(*m.StopSignal) + copy(dAtA[i:], *m.StopSignal) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.StopSignal))) + i-- + dAtA[i] = 0x7a + } if len(m.AllocatedResourcesStatus) > 0 { for iNdEx := len(m.AllocatedResourcesStatus) - 1; iNdEx >= 0; iNdEx-- { { @@ -12258,6 +12299,13 @@ func (m *Lifecycle) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.StopSignal != nil { + i -= len(*m.StopSignal) + copy(dAtA[i:], *m.StopSignal) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.StopSignal))) + i-- + dAtA[i] = 0x1a + } if m.PreStop != nil { { size, err := m.PreStop.MarshalToSizedBuffer(dAtA[:i]) @@ -14135,6 +14183,34 @@ func (m *NodeStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *NodeSwapStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NodeSwapStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeSwapStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Capacity != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Capacity)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *NodeSystemInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -14155,6 +14231,18 @@ func (m *NodeSystemInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Swap != nil { + { + size, err := m.Swap.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } i -= len(m.Architecture) copy(dAtA[i:], m.Architecture) i = encodeVarintGenerated(dAtA, i, uint64(len(m.Architecture))) @@ -15723,6 +15811,9 @@ func (m *PodCondition) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.ObservedGeneration)) + i-- + dAtA[i] = 0x38 i -= len(m.Message) copy(dAtA[i:], m.Message) i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message))) @@ -16994,6 +17085,11 @@ func (m *PodStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.ObservedGeneration)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x88 if len(m.HostIPs) > 0 { for iNdEx := len(m.HostIPs) - 1; iNdEx >= 0; iNdEx-- { { @@ -22542,6 +22638,10 @@ func (m *ContainerStatus) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } + if m.StopSignal != nil { + l = len(*m.StopSignal) + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -23382,6 +23482,10 @@ func (m *Lifecycle) Size() (n int) { l = m.PreStop.Size() n += 1 + l + sovGenerated(uint64(l)) } + if m.StopSignal != nil { + l = len(*m.StopSignal) + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -24067,6 +24171,18 @@ func (m *NodeStatus) Size() (n int) { return n } +func (m *NodeSwapStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Capacity != nil { + n += 1 + sovGenerated(uint64(*m.Capacity)) + } + return n +} + func (m *NodeSystemInfo) Size() (n int) { if m == nil { return 0 @@ -24093,6 +24209,10 @@ func (m *NodeSystemInfo) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = len(m.Architecture) n += 1 + l + sovGenerated(uint64(l)) + if m.Swap != nil { + l = m.Swap.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -24650,6 +24770,7 @@ func (m *PodCondition) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = len(m.Message) n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.ObservedGeneration)) return n } @@ -25174,6 +25295,7 @@ func (m *PodStatus) Size() (n int) { n += 2 + l + sovGenerated(uint64(l)) } } + n += 2 + sovGenerated(uint64(m.ObservedGeneration)) return n } @@ -27457,6 +27579,7 @@ func (this *ContainerStatus) String() string { `VolumeMounts:` + repeatedStringForVolumeMounts + `,`, `User:` + strings.Replace(this.User.String(), "ContainerUser", "ContainerUser", 1) + `,`, `AllocatedResourcesStatus:` + repeatedStringForAllocatedResourcesStatus + `,`, + `StopSignal:` + valueToStringGenerated(this.StopSignal) + `,`, `}`, }, "") return s @@ -28080,6 +28203,7 @@ func (this *Lifecycle) String() string { s := strings.Join([]string{`&Lifecycle{`, `PostStart:` + strings.Replace(this.PostStart.String(), "LifecycleHandler", "LifecycleHandler", 1) + `,`, `PreStop:` + strings.Replace(this.PreStop.String(), "LifecycleHandler", "LifecycleHandler", 1) + `,`, + `StopSignal:` + valueToStringGenerated(this.StopSignal) + `,`, `}`, }, "") return s @@ -28658,6 +28782,16 @@ func (this *NodeStatus) String() string { }, "") return s } +func (this *NodeSwapStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NodeSwapStatus{`, + `Capacity:` + valueToStringGenerated(this.Capacity) + `,`, + `}`, + }, "") + return s +} func (this *NodeSystemInfo) String() string { if this == nil { return "nil" @@ -28673,6 +28807,7 @@ func (this *NodeSystemInfo) String() string { `KubeProxyVersion:` + fmt.Sprintf("%v", this.KubeProxyVersion) + `,`, `OperatingSystem:` + fmt.Sprintf("%v", this.OperatingSystem) + `,`, `Architecture:` + fmt.Sprintf("%v", this.Architecture) + `,`, + `Swap:` + strings.Replace(this.Swap.String(), "NodeSwapStatus", "NodeSwapStatus", 1) + `,`, `}`, }, "") return s @@ -29045,6 +29180,7 @@ func (this *PodCondition) String() string { `LastTransitionTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastTransitionTime), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, `Message:` + fmt.Sprintf("%v", this.Message) + `,`, + `ObservedGeneration:` + fmt.Sprintf("%v", this.ObservedGeneration) + `,`, `}`, }, "") return s @@ -29427,6 +29563,7 @@ func (this *PodStatus) String() string { `Resize:` + fmt.Sprintf("%v", this.Resize) + `,`, `ResourceClaimStatuses:` + repeatedStringForResourceClaimStatuses + `,`, `HostIPs:` + repeatedStringForHostIPs + `,`, + `ObservedGeneration:` + fmt.Sprintf("%v", this.ObservedGeneration) + `,`, `}`, }, "") return s @@ -37905,6 +38042,39 @@ func (m *ContainerStatus) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StopSignal", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := Signal(dAtA[iNdEx:postIndex]) + m.StopSignal = &s + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -45056,6 +45226,39 @@ func (m *Lifecycle) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StopSignal", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := Signal(dAtA[iNdEx:postIndex]) + m.StopSignal = &s + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -50743,6 +50946,76 @@ func (m *NodeStatus) Unmarshal(dAtA []byte) error { } return nil } +func (m *NodeSwapStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NodeSwapStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NodeSwapStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Capacity", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Capacity = &v + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *NodeSystemInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -51092,6 +51365,42 @@ func (m *NodeSystemInfo) Unmarshal(dAtA []byte) error { } m.Architecture = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Swap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Swap == nil { + m.Swap = &NodeSwapStatus{} + } + if err := m.Swap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -56087,6 +56396,25 @@ func (m *PodCondition) Unmarshal(dAtA []byte) error { } m.Message = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ObservedGeneration", wireType) + } + m.ObservedGeneration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ObservedGeneration |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -60340,6 +60668,25 @@ func (m *PodStatus) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 17: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ObservedGeneration", wireType) + } + m.ObservedGeneration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ObservedGeneration |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/e2e/vendor/k8s.io/api/core/v1/generated.proto b/e2e/vendor/k8s.io/api/core/v1/generated.proto index 08706987c..9b48fb1c3 100644 --- a/e2e/vendor/k8s.io/api/core/v1/generated.proto +++ b/e2e/vendor/k8s.io/api/core/v1/generated.proto @@ -1103,6 +1103,11 @@ message ContainerStatus { // +listType=map // +listMapKey=name repeated ResourceStatus allocatedResourcesStatus = 14; + + // StopSignal reports the effective stop signal for this container + // +featureGate=ContainerStopSignals + // +optional + optional string stopSignal = 15; } // ContainerUser represents user identity information @@ -1194,6 +1199,7 @@ message EmptyDirVolumeSource { } // EndpointAddress is a tuple that describes single IP address. +// Deprecated: This API is deprecated in v1.33+. // +structType=atomic message EndpointAddress { // The IP of this endpoint. @@ -1215,6 +1221,7 @@ message EndpointAddress { } // EndpointPort is a tuple that describes a single port. +// Deprecated: This API is deprecated in v1.33+. // +structType=atomic message EndpointPort { // The name of this port. This must match the 'name' field in the @@ -1265,6 +1272,8 @@ message EndpointPort { // // a: [ 10.10.1.1:8675, 10.10.2.2:8675 ], // b: [ 10.10.1.1:309, 10.10.2.2:309 ] +// +// Deprecated: This API is deprecated in v1.33+. message EndpointSubset { // IP addresses which offer the related ports that are marked as ready. These endpoints // should be considered safe for load balancers and clients to utilize. @@ -1298,6 +1307,11 @@ message EndpointSubset { // Ports: [{"name": "a", "port": 93}, {"name": "b", "port": 76}] // }, // ] +// +// Endpoints is a legacy API and does not contain information about all Service features. +// Use discoveryv1.EndpointSlice for complete information about Service endpoints. +// +// Deprecated: This API is deprecated in v1.33+. Use discoveryv1.EndpointSlice. message Endpoints { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -1317,6 +1331,7 @@ message Endpoints { } // EndpointsList is a list of endpoints. +// Deprecated: This API is deprecated in v1.33+. message EndpointsList { // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds @@ -1327,9 +1342,9 @@ message EndpointsList { repeated Endpoints items = 2; } -// EnvFromSource represents the source of a set of ConfigMaps +// EnvFromSource represents the source of a set of ConfigMaps or Secrets message EnvFromSource { - // An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. + // Optional text to prepend to the name of each environment variable. Must be a C_IDENTIFIER. // +optional optional string prefix = 1; @@ -2198,6 +2213,12 @@ message Lifecycle { // More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks // +optional optional LifecycleHandler preStop = 2; + + // StopSignal defines which signal will be sent to a container when it is being stopped. + // If not specified, the default is defined by the container runtime in use. + // StopSignal can only be set for Pods with a non-empty .spec.os.name + // +optional + optional string stopSignal = 3; } // LifecycleHandler defines a specific action that should be taken in a lifecycle @@ -2862,6 +2883,13 @@ message NodeStatus { optional NodeFeatures features = 13; } +// NodeSwapStatus represents swap memory information. +message NodeSwapStatus { + // Total amount of swap memory in bytes. + // +optional + optional int64 capacity = 1; +} + // NodeSystemInfo is a set of ids/uuids to uniquely identify the node. message NodeSystemInfo { // MachineID reported by the node. For unique machine identification @@ -2897,6 +2925,9 @@ message NodeSystemInfo { // The Architecture reported by the node optional string architecture = 10; + + // Swap Info reported by the node. + optional NodeSwapStatus swap = 11; } // ObjectFieldSelector selects an APIVersioned field of an object. @@ -3615,7 +3646,6 @@ message PodAffinityTerm { // pod labels will be ignored. The default value is empty. // The same key is forbidden to exist in both matchLabelKeys and labelSelector. // Also, matchLabelKeys cannot be set when labelSelector isn't set. - // This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). // // +listType=atomic // +optional @@ -3629,7 +3659,6 @@ message PodAffinityTerm { // pod labels will be ignored. The default value is empty. // The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. // Also, mismatchLabelKeys cannot be set when labelSelector isn't set. - // This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). // // +listType=atomic // +optional @@ -3702,6 +3731,12 @@ message PodCondition { // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions optional string type = 1; + // If set, this represents the .metadata.generation that the pod condition was set based upon. + // This is an alpha field. Enable PodObservedGenerationTracking to be able to use this field. + // +featureGate=PodObservedGenerationTracking + // +optional + optional int64 observedGeneration = 7; + // Status is the status of the condition. // Can be True, False, Unknown. // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions @@ -4138,7 +4173,7 @@ message PodSpec { // Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. // The resourceRequirements of an init container are taken into account during scheduling // by finding the highest request/limit for each resource type, and then using the max of - // of that value or the sum of the normal containers. Limits are applied to init containers + // that value or the sum of the normal containers. Limits are applied to init containers // in a similar fashion. // Init containers cannot currently be added or removed. // Cannot be updated. @@ -4487,6 +4522,12 @@ message PodSpec { // state of a system, especially if the node that hosts the pod cannot contact the control // plane. message PodStatus { + // If set, this represents the .metadata.generation that the pod status was set based upon. + // This is an alpha field. Enable PodObservedGenerationTracking to be able to use this field. + // +featureGate=PodObservedGenerationTracking + // +optional + optional int64 observedGeneration = 17; + // The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. // The conditions array, the reason and message fields, and the individual container status // arrays contain more detail about the pod's status. @@ -4618,6 +4659,9 @@ message PodStatus { // Status of resources resize desired for pod's containers. // It is empty if no resources resize is pending. // Any changes to container resources will automatically set this to "Proposed" + // Deprecated: Resize status is moved to two pod conditions PodResizePending and PodResizeInProgress. + // PodResizePending will track states where the spec has been resized, but the Kubelet has not yet allocated the resources. + // PodResizeInProgress will track in-progress resizes, and should be present whenever allocated resources != acknowledged resources. // +featureGate=InPlacePodVerticalScaling // +optional optional string resize = 14; @@ -5063,12 +5107,18 @@ message ReplicationControllerSpec { // Defaults to 1. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller // +optional + // +k8s:optional + // +default=1 + // +k8s:minimum=0 optional int32 replicas = 1; // 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) // +optional + // +k8s:optional + // +default=0 + // +k8s:minimum=0 optional int32 minReadySeconds = 4; // Selector is a label query over pods that should match the Replicas count. @@ -6110,13 +6160,12 @@ message ServiceSpec { // +optional optional string internalTrafficPolicy = 22; - // TrafficDistribution offers a way to express preferences for how traffic is - // distributed to Service endpoints. Implementations can use this field as a - // hint, but are not required to guarantee strict adherence. If the field is - // not set, the implementation will apply its default routing strategy. If set - // to "PreferClose", implementations should prioritize endpoints that are - // topologically close (e.g., same zone). - // This is a beta field and requires enabling ServiceTrafficDistribution feature. + // TrafficDistribution offers a way to express preferences for how traffic + // is distributed to Service endpoints. Implementations can use this field + // as a hint, but are not required to guarantee strict adherence. If the + // field is not set, the implementation will apply its default routing + // strategy. If set to "PreferClose", implementations should prioritize + // endpoints that are in the same zone. // +featureGate=ServiceTrafficDistribution // +optional optional string trafficDistribution = 23; @@ -6411,7 +6460,6 @@ message TopologySpreadConstraint { // - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations. // // If this value is nil, the behavior is equivalent to the Honor policy. - // This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. // +optional optional string nodeAffinityPolicy = 6; @@ -6422,7 +6470,6 @@ message TopologySpreadConstraint { // - Ignore: node taints are ignored. All nodes are included. // // If this value is nil, the behavior is equivalent to the Ignore policy. - // This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. // +optional optional string nodeTaintsPolicy = 7; @@ -6854,7 +6901,7 @@ message VolumeSource { // The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. // The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. // The volume will be mounted read-only (ro) and non-executable files (noexec). - // Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath). + // Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. // The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type. // +featureGate=ImageVolume // +optional diff --git a/e2e/vendor/k8s.io/api/core/v1/lifecycle.go b/e2e/vendor/k8s.io/api/core/v1/lifecycle.go index 21ca90e81..21b931b67 100644 --- a/e2e/vendor/k8s.io/api/core/v1/lifecycle.go +++ b/e2e/vendor/k8s.io/api/core/v1/lifecycle.go @@ -16,6 +16,10 @@ limitations under the License. package v1 +import ( + "k8s.io/apimachinery/pkg/runtime/schema" +) + // APILifecycleIntroduced returns the release in which the API struct was introduced as int versions of major and minor for comparison. func (in *ComponentStatus) APILifecycleIntroduced() (major, minor int) { return 1, 0 @@ -35,3 +39,23 @@ func (in *ComponentStatusList) APILifecycleIntroduced() (major, minor int) { func (in *ComponentStatusList) APILifecycleDeprecated() (major, minor int) { return 1, 19 } + +// APILifecycleDeprecated returns the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. +func (in *Endpoints) APILifecycleDeprecated() (major, minor int) { + return 1, 33 +} + +// APILifecycleReplacement returns the GVK of the replacement for the given API +func (in *Endpoints) APILifecycleReplacement() schema.GroupVersionKind { + return schema.GroupVersionKind{Group: "discovery.k8s.io", Version: "v1", Kind: "EndpointSlice"} +} + +// APILifecycleDeprecated returns the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. +func (in *EndpointsList) APILifecycleDeprecated() (major, minor int) { + return 1, 33 +} + +// APILifecycleReplacement returns the GVK of the replacement for the given API +func (in *EndpointsList) APILifecycleReplacement() schema.GroupVersionKind { + return schema.GroupVersionKind{Group: "discovery.k8s.io", Version: "v1", Kind: "EndpointSliceList"} +} diff --git a/e2e/vendor/k8s.io/api/core/v1/types.go b/e2e/vendor/k8s.io/api/core/v1/types.go index fb2c1c745..f7641e485 100644 --- a/e2e/vendor/k8s.io/api/core/v1/types.go +++ b/e2e/vendor/k8s.io/api/core/v1/types.go @@ -217,7 +217,7 @@ type VolumeSource struct { // The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. // The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. // The volume will be mounted read-only (ro) and non-executable files (noexec). - // Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath). + // Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. // The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type. // +featureGate=ImageVolume // +optional @@ -2437,9 +2437,9 @@ type SecretKeySelector struct { Optional *bool `json:"optional,omitempty" protobuf:"varint,3,opt,name=optional"` } -// EnvFromSource represents the source of a set of ConfigMaps +// EnvFromSource represents the source of a set of ConfigMaps or Secrets type EnvFromSource struct { - // An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. + // Optional text to prepend to the name of each environment variable. Must be a C_IDENTIFIER. // +optional Prefix string `json:"prefix,omitempty" protobuf:"bytes,1,opt,name=prefix"` // The ConfigMap to select from @@ -2980,6 +2980,78 @@ type LifecycleHandler struct { Sleep *SleepAction `json:"sleep,omitempty" protobuf:"bytes,4,opt,name=sleep"` } +// Signal defines the stop signal of containers +// +enum +type Signal string + +const ( + SIGABRT Signal = "SIGABRT" + SIGALRM Signal = "SIGALRM" + SIGBUS Signal = "SIGBUS" + SIGCHLD Signal = "SIGCHLD" + SIGCLD Signal = "SIGCLD" + SIGCONT Signal = "SIGCONT" + SIGFPE Signal = "SIGFPE" + SIGHUP Signal = "SIGHUP" + SIGILL Signal = "SIGILL" + SIGINT Signal = "SIGINT" + SIGIO Signal = "SIGIO" + SIGIOT Signal = "SIGIOT" + SIGKILL Signal = "SIGKILL" + SIGPIPE Signal = "SIGPIPE" + SIGPOLL Signal = "SIGPOLL" + SIGPROF Signal = "SIGPROF" + SIGPWR Signal = "SIGPWR" + SIGQUIT Signal = "SIGQUIT" + SIGSEGV Signal = "SIGSEGV" + SIGSTKFLT Signal = "SIGSTKFLT" + SIGSTOP Signal = "SIGSTOP" + SIGSYS Signal = "SIGSYS" + SIGTERM Signal = "SIGTERM" + SIGTRAP Signal = "SIGTRAP" + SIGTSTP Signal = "SIGTSTP" + SIGTTIN Signal = "SIGTTIN" + SIGTTOU Signal = "SIGTTOU" + SIGURG Signal = "SIGURG" + SIGUSR1 Signal = "SIGUSR1" + SIGUSR2 Signal = "SIGUSR2" + SIGVTALRM Signal = "SIGVTALRM" + SIGWINCH Signal = "SIGWINCH" + SIGXCPU Signal = "SIGXCPU" + SIGXFSZ Signal = "SIGXFSZ" + SIGRTMIN Signal = "SIGRTMIN" + SIGRTMINPLUS1 Signal = "SIGRTMIN+1" + SIGRTMINPLUS2 Signal = "SIGRTMIN+2" + SIGRTMINPLUS3 Signal = "SIGRTMIN+3" + SIGRTMINPLUS4 Signal = "SIGRTMIN+4" + SIGRTMINPLUS5 Signal = "SIGRTMIN+5" + SIGRTMINPLUS6 Signal = "SIGRTMIN+6" + SIGRTMINPLUS7 Signal = "SIGRTMIN+7" + SIGRTMINPLUS8 Signal = "SIGRTMIN+8" + SIGRTMINPLUS9 Signal = "SIGRTMIN+9" + SIGRTMINPLUS10 Signal = "SIGRTMIN+10" + SIGRTMINPLUS11 Signal = "SIGRTMIN+11" + SIGRTMINPLUS12 Signal = "SIGRTMIN+12" + SIGRTMINPLUS13 Signal = "SIGRTMIN+13" + SIGRTMINPLUS14 Signal = "SIGRTMIN+14" + SIGRTMINPLUS15 Signal = "SIGRTMIN+15" + SIGRTMAXMINUS14 Signal = "SIGRTMAX-14" + SIGRTMAXMINUS13 Signal = "SIGRTMAX-13" + SIGRTMAXMINUS12 Signal = "SIGRTMAX-12" + SIGRTMAXMINUS11 Signal = "SIGRTMAX-11" + SIGRTMAXMINUS10 Signal = "SIGRTMAX-10" + SIGRTMAXMINUS9 Signal = "SIGRTMAX-9" + SIGRTMAXMINUS8 Signal = "SIGRTMAX-8" + SIGRTMAXMINUS7 Signal = "SIGRTMAX-7" + SIGRTMAXMINUS6 Signal = "SIGRTMAX-6" + SIGRTMAXMINUS5 Signal = "SIGRTMAX-5" + SIGRTMAXMINUS4 Signal = "SIGRTMAX-4" + SIGRTMAXMINUS3 Signal = "SIGRTMAX-3" + SIGRTMAXMINUS2 Signal = "SIGRTMAX-2" + SIGRTMAXMINUS1 Signal = "SIGRTMAX-1" + SIGRTMAX Signal = "SIGRTMAX" +) + // Lifecycle describes actions that the management system should take in response to container lifecycle // events. For the PostStart and PreStop lifecycle handlers, management of the container blocks // until the action is complete, unless the container process fails, in which case the handler is aborted. @@ -3001,6 +3073,11 @@ type Lifecycle struct { // More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks // +optional PreStop *LifecycleHandler `json:"preStop,omitempty" protobuf:"bytes,2,opt,name=preStop"` + // StopSignal defines which signal will be sent to a container when it is being stopped. + // If not specified, the default is defined by the container runtime in use. + // StopSignal can only be set for Pods with a non-empty .spec.os.name + // +optional + StopSignal *Signal `json:"stopSignal,omitempty" protobuf:"bytes,3,opt,name=stopSignal"` } type ConditionStatus string @@ -3154,6 +3231,10 @@ type ContainerStatus struct { // +listType=map // +listMapKey=name AllocatedResourcesStatus []ResourceStatus `json:"allocatedResourcesStatus,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,14,rep,name=allocatedResourcesStatus"` + // StopSignal reports the effective stop signal for this container + // +featureGate=ContainerStopSignals + // +optional + StopSignal *Signal `json:"stopSignal,omitempty" protobuf:"bytes,15,opt,name=stopSignal"` } // ResourceStatus represents the status of a single resource allocated to a Pod. @@ -3278,6 +3359,17 @@ const ( // PodReadyToStartContainers pod sandbox is successfully configured and // the pod is ready to launch containers. PodReadyToStartContainers PodConditionType = "PodReadyToStartContainers" + // PodResizePending indicates that the pod has been resized, but kubelet has not + // yet allocated the resources. If both PodResizePending and PodResizeInProgress + // are set, it means that a new resize was requested in the middle of a previous + // pod resize that is still in progress. + PodResizePending PodConditionType = "PodResizePending" + // PodResizeInProgress indicates that a resize is in progress, and is present whenever + // the Kubelet has allocated resources for the resize, but has not yet actuated all of + // the required changes. + // If both PodResizePending and PodResizeInProgress are set, it means that a new resize was + // requested in the middle of a previous pod resize that is still in progress. + PodResizeInProgress PodConditionType = "PodResizeInProgress" ) // These are reasons for a pod's transition to a condition. @@ -3301,6 +3393,18 @@ const ( // PodReasonPreemptionByScheduler reason in DisruptionTarget pod condition indicates that the // disruption was initiated by scheduler's preemption. PodReasonPreemptionByScheduler = "PreemptionByScheduler" + + // PodReasonDeferred reason in PodResizePending pod condition indicates the proposed resize is feasible in + // theory (it fits on this node) but is not possible right now. + PodReasonDeferred = "Deferred" + + // PodReasonInfeasible reason in PodResizePending pod condition indicates the proposed resize is not + // feasible and is rejected; it may not be re-evaluated + PodReasonInfeasible = "Infeasible" + + // PodReasonError reason in PodResizeInProgress pod condition indicates that an error occurred while + // actuating the resize. + PodReasonError = "Error" ) // PodCondition contains details for the current condition of this pod. @@ -3308,6 +3412,11 @@ type PodCondition struct { // Type is the type of the condition. // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions Type PodConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=PodConditionType"` + // If set, this represents the .metadata.generation that the pod condition was set based upon. + // This is an alpha field. Enable PodObservedGenerationTracking to be able to use this field. + // +featureGate=PodObservedGenerationTracking + // +optional + ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,7,opt,name=observedGeneration"` // Status is the status of the condition. // Can be True, False, Unknown. // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions @@ -3326,12 +3435,10 @@ type PodCondition struct { Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"` } -// PodResizeStatus shows status of desired resize of a pod's containers. +// Deprecated: PodResizeStatus shows status of desired resize of a pod's containers. type PodResizeStatus string const ( - // Pod resources resize has been requested and will be evaluated by node. - PodResizeStatusProposed PodResizeStatus = "Proposed" // Pod resources resize has been accepted by node and is being actuated. PodResizeStatusInProgress PodResizeStatus = "InProgress" // Node cannot resize the pod at this time and will keep retrying. @@ -3627,7 +3734,6 @@ type PodAffinityTerm struct { // pod labels will be ignored. The default value is empty. // The same key is forbidden to exist in both matchLabelKeys and labelSelector. // Also, matchLabelKeys cannot be set when labelSelector isn't set. - // This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). // // +listType=atomic // +optional @@ -3640,7 +3746,6 @@ type PodAffinityTerm struct { // pod labels will be ignored. The default value is empty. // The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. // Also, mismatchLabelKeys cannot be set when labelSelector isn't set. - // This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). // // +listType=atomic // +optional @@ -3792,7 +3897,7 @@ type PodSpec struct { // Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. // The resourceRequirements of an init container are taken into account during scheduling // by finding the highest request/limit for each resource type, and then using the max of - // of that value or the sum of the normal containers. Limits are applied to init containers + // that value or the sum of the normal containers. Limits are applied to init containers // in a similar fashion. // Init containers cannot currently be added or removed. // Cannot be updated. @@ -4301,7 +4406,6 @@ type TopologySpreadConstraint struct { // - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations. // // If this value is nil, the behavior is equivalent to the Honor policy. - // This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. // +optional NodeAffinityPolicy *NodeInclusionPolicy `json:"nodeAffinityPolicy,omitempty" protobuf:"bytes,6,opt,name=nodeAffinityPolicy"` // NodeTaintsPolicy indicates how we will treat node taints when calculating @@ -4311,7 +4415,6 @@ type TopologySpreadConstraint struct { // - Ignore: node taints are ignored. All nodes are included. // // If this value is nil, the behavior is equivalent to the Ignore policy. - // This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. // +optional NodeTaintsPolicy *NodeInclusionPolicy `json:"nodeTaintsPolicy,omitempty" protobuf:"bytes,7,opt,name=nodeTaintsPolicy"` // MatchLabelKeys is a set of pod label keys to select the pods over which @@ -4841,6 +4944,11 @@ type EphemeralContainer struct { // state of a system, especially if the node that hosts the pod cannot contact the control // plane. type PodStatus struct { + // If set, this represents the .metadata.generation that the pod status was set based upon. + // This is an alpha field. Enable PodObservedGenerationTracking to be able to use this field. + // +featureGate=PodObservedGenerationTracking + // +optional + ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,17,opt,name=observedGeneration"` // The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. // The conditions array, the reason and message fields, and the individual container status // arrays contain more detail about the pod's status. @@ -4968,6 +5076,9 @@ type PodStatus struct { // Status of resources resize desired for pod's containers. // It is empty if no resources resize is pending. // Any changes to container resources will automatically set this to "Proposed" + // Deprecated: Resize status is moved to two pod conditions PodResizePending and PodResizeInProgress. + // PodResizePending will track states where the spec has been resized, but the Kubelet has not yet allocated the resources. + // PodResizeInProgress will track in-progress resizes, and should be present whenever allocated resources != acknowledged resources. // +featureGate=InPlacePodVerticalScaling // +optional Resize PodResizeStatus `json:"resize,omitempty" protobuf:"bytes,14,opt,name=resize,casttype=PodResizeStatus"` @@ -5099,12 +5210,18 @@ type ReplicationControllerSpec struct { // Defaults to 1. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller // +optional + // +k8s:optional + // +default=1 + // +k8s:minimum=0 Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"` // 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) // +optional + // +k8s:optional + // +default=0 + // +k8s:minimum=0 MinReadySeconds int32 `json:"minReadySeconds,omitempty" protobuf:"varint,4,opt,name=minReadySeconds"` // Selector is a label query over pods that should match the Replicas count. @@ -5334,14 +5451,27 @@ const ( // These are valid values for the TrafficDistribution field of a Service. const ( - // Indicates a preference for routing traffic to endpoints that are - // topologically proximate to the client. The interpretation of "topologically - // proximate" may vary across implementations and could encompass endpoints - // within the same node, rack, zone, or even region. Setting this value gives - // implementations permission to make different tradeoffs, e.g. optimizing for - // proximity rather than equal distribution of load. Users should not set this - // value if such tradeoffs are not acceptable. + // Indicates a preference for routing traffic to endpoints that are in the same + // zone as the client. Users should not set this value unless they have ensured + // that clients and endpoints are distributed in such a way that the "same zone" + // preference will not result in endpoints getting overloaded. ServiceTrafficDistributionPreferClose = "PreferClose" + + // Indicates a preference for routing traffic to endpoints that are in the same + // zone as the client. Users should not set this value unless they have ensured + // that clients and endpoints are distributed in such a way that the "same zone" + // preference will not result in endpoints getting overloaded. + // This is an alias for "PreferClose", but it is an Alpha feature and is only + // recognized if the PreferSameTrafficDistribution feature gate is enabled. + ServiceTrafficDistributionPreferSameZone = "PreferSameZone" + + // Indicates a preference for routing traffic to endpoints that are on the same + // node as the client. Users should not set this value unless they have ensured + // that clients and endpoints are distributed in such a way that the "same node" + // preference will not result in endpoints getting overloaded. + // This is an Alpha feature and is only recognized if the + // PreferSameTrafficDistribution feature gate is enabled. + ServiceTrafficDistributionPreferSameNode = "PreferSameNode" ) // These are the valid conditions of a service. @@ -5689,13 +5819,12 @@ type ServiceSpec struct { // +optional InternalTrafficPolicy *ServiceInternalTrafficPolicy `json:"internalTrafficPolicy,omitempty" protobuf:"bytes,22,opt,name=internalTrafficPolicy"` - // TrafficDistribution offers a way to express preferences for how traffic is - // distributed to Service endpoints. Implementations can use this field as a - // hint, but are not required to guarantee strict adherence. If the field is - // not set, the implementation will apply its default routing strategy. If set - // to "PreferClose", implementations should prioritize endpoints that are - // topologically close (e.g., same zone). - // This is a beta field and requires enabling ServiceTrafficDistribution feature. + // TrafficDistribution offers a way to express preferences for how traffic + // is distributed to Service endpoints. Implementations can use this field + // as a hint, but are not required to guarantee strict adherence. If the + // field is not set, the implementation will apply its default routing + // strategy. If set to "PreferClose", implementations should prioritize + // endpoints that are in the same zone. // +featureGate=ServiceTrafficDistribution // +optional TrafficDistribution *string `json:"trafficDistribution,omitempty" protobuf:"bytes,23,opt,name=trafficDistribution"` @@ -5888,6 +6017,11 @@ type ServiceAccountList struct { // Ports: [{"name": "a", "port": 93}, {"name": "b", "port": 76}] // }, // ] +// +// Endpoints is a legacy API and does not contain information about all Service features. +// Use discoveryv1.EndpointSlice for complete information about Service endpoints. +// +// Deprecated: This API is deprecated in v1.33+. Use discoveryv1.EndpointSlice. type Endpoints struct { metav1.TypeMeta `json:",inline"` // Standard object's metadata. @@ -5920,6 +6054,8 @@ type Endpoints struct { // // a: [ 10.10.1.1:8675, 10.10.2.2:8675 ], // b: [ 10.10.1.1:309, 10.10.2.2:309 ] +// +// Deprecated: This API is deprecated in v1.33+. type EndpointSubset struct { // IP addresses which offer the related ports that are marked as ready. These endpoints // should be considered safe for load balancers and clients to utilize. @@ -5939,6 +6075,7 @@ type EndpointSubset struct { } // EndpointAddress is a tuple that describes single IP address. +// Deprecated: This API is deprecated in v1.33+. // +structType=atomic type EndpointAddress struct { // The IP of this endpoint. @@ -5957,6 +6094,7 @@ type EndpointAddress struct { } // EndpointPort is a tuple that describes a single port. +// Deprecated: This API is deprecated in v1.33+. // +structType=atomic type EndpointPort struct { // The name of this port. This must match the 'name' field in the @@ -5998,6 +6136,7 @@ type EndpointPort struct { // +k8s:prerelease-lifecycle-gen:introduced=1.0 // EndpointsList is a list of endpoints. +// Deprecated: This API is deprecated in v1.33+. type EndpointsList struct { metav1.TypeMeta `json:",inline"` // Standard list metadata. @@ -6166,6 +6305,15 @@ type NodeSystemInfo struct { OperatingSystem string `json:"operatingSystem" protobuf:"bytes,9,opt,name=operatingSystem"` // The Architecture reported by the node Architecture string `json:"architecture" protobuf:"bytes,10,opt,name=architecture"` + // Swap Info reported by the node. + Swap *NodeSwapStatus `json:"swap,omitempty" protobuf:"bytes,11,opt,name=swap"` +} + +// NodeSwapStatus represents swap memory information. +type NodeSwapStatus struct { + // Total amount of swap memory in bytes. + // +optional + Capacity *int64 `json:"capacity,omitempty" protobuf:"varint,1,opt,name=capacity"` } // NodeConfigStatus describes the status of the config assigned by Node.Spec.ConfigSource. @@ -7267,6 +7415,9 @@ const ( ResourceQuotaScopePriorityClass ResourceQuotaScope = "PriorityClass" // Match all pod objects that have cross-namespace pod (anti)affinity mentioned. ResourceQuotaScopeCrossNamespacePodAffinity ResourceQuotaScope = "CrossNamespacePodAffinity" + + // Match all pvc objects that have volume attributes class mentioned. + ResourceQuotaScopeVolumeAttributesClass ResourceQuotaScope = "VolumeAttributesClass" ) // ResourceQuotaSpec defines the desired hard limits to enforce for Quota. diff --git a/e2e/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go b/e2e/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go index 89ce3d230..9e987eefd 100644 --- a/e2e/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go +++ b/e2e/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go @@ -474,6 +474,7 @@ var map_ContainerStatus = map[string]string{ "volumeMounts": "Status of volume mounts.", "user": "User represents user identity information initially attached to the first process of the container", "allocatedResourcesStatus": "AllocatedResourcesStatus represents the status of various resources allocated for this Pod.", + "stopSignal": "StopSignal reports the effective stop signal for this container", } func (ContainerStatus) SwaggerDoc() map[string]string { @@ -540,7 +541,7 @@ func (EmptyDirVolumeSource) SwaggerDoc() map[string]string { } var map_EndpointAddress = map[string]string{ - "": "EndpointAddress is a tuple that describes single IP address.", + "": "EndpointAddress is a tuple that describes single IP address. Deprecated: This API is deprecated in v1.33+.", "ip": "The IP of this endpoint. May not be loopback (127.0.0.0/8 or ::1), link-local (169.254.0.0/16 or fe80::/10), or link-local multicast (224.0.0.0/24 or ff02::/16).", "hostname": "The Hostname of this endpoint", "nodeName": "Optional: Node hosting this endpoint. This can be used to determine endpoints local to a node.", @@ -552,7 +553,7 @@ func (EndpointAddress) SwaggerDoc() map[string]string { } var map_EndpointPort = map[string]string{ - "": "EndpointPort is a tuple that describes a single port.", + "": "EndpointPort is a tuple that describes a single port. Deprecated: This API is deprecated in v1.33+.", "name": "The name of this port. This must match the 'name' field in the corresponding ServicePort. Must be a DNS_LABEL. Optional only if one port is defined.", "port": "The port number of the endpoint.", "protocol": "The IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP.", @@ -564,7 +565,7 @@ func (EndpointPort) SwaggerDoc() map[string]string { } var map_EndpointSubset = map[string]string{ - "": "EndpointSubset is a group of addresses with a common set of ports. The expanded set of endpoints is the Cartesian product of Addresses x Ports. For example, given:\n\n\t{\n\t Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}]\n\t}\n\nThe resulting set of endpoints can be viewed as:\n\n\ta: [ 10.10.1.1:8675, 10.10.2.2:8675 ],\n\tb: [ 10.10.1.1:309, 10.10.2.2:309 ]", + "": "EndpointSubset is a group of addresses with a common set of ports. The expanded set of endpoints is the Cartesian product of Addresses x Ports. For example, given:\n\n\t{\n\t Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}]\n\t}\n\nThe resulting set of endpoints can be viewed as:\n\n\ta: [ 10.10.1.1:8675, 10.10.2.2:8675 ],\n\tb: [ 10.10.1.1:309, 10.10.2.2:309 ]\n\nDeprecated: This API is deprecated in v1.33+.", "addresses": "IP addresses which offer the related ports that are marked as ready. These endpoints should be considered safe for load balancers and clients to utilize.", "notReadyAddresses": "IP addresses which offer the related ports but are not currently marked as ready because they have not yet finished starting, have recently failed a readiness check, or have recently failed a liveness check.", "ports": "Port numbers available on the related IP addresses.", @@ -575,7 +576,7 @@ func (EndpointSubset) SwaggerDoc() map[string]string { } var map_Endpoints = map[string]string{ - "": "Endpoints is a collection of endpoints that implement the actual service. Example:\n\n\t Name: \"mysvc\",\n\t Subsets: [\n\t {\n\t Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}]\n\t },\n\t {\n\t Addresses: [{\"ip\": \"10.10.3.3\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 93}, {\"name\": \"b\", \"port\": 76}]\n\t },\n\t]", + "": "Endpoints is a collection of endpoints that implement the actual service. Example:\n\n\t Name: \"mysvc\",\n\t Subsets: [\n\t {\n\t Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}]\n\t },\n\t {\n\t Addresses: [{\"ip\": \"10.10.3.3\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 93}, {\"name\": \"b\", \"port\": 76}]\n\t },\n\t]\n\nEndpoints is a legacy API and does not contain information about all Service features. Use discoveryv1.EndpointSlice for complete information about Service endpoints.\n\nDeprecated: This API is deprecated in v1.33+. Use discoveryv1.EndpointSlice.", "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "subsets": "The set of all endpoints is the union of all subsets. Addresses are placed into subsets according to the IPs they share. A single address with multiple ports, some of which are ready and some of which are not (because they come from different containers) will result in the address being displayed in different subsets for the different ports. No address will appear in both Addresses and NotReadyAddresses in the same subset. Sets of addresses and ports that comprise a service.", } @@ -585,7 +586,7 @@ func (Endpoints) SwaggerDoc() map[string]string { } var map_EndpointsList = map[string]string{ - "": "EndpointsList is a list of endpoints.", + "": "EndpointsList is a list of endpoints. Deprecated: This API is deprecated in v1.33+.", "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", "items": "List of endpoints.", } @@ -595,8 +596,8 @@ func (EndpointsList) SwaggerDoc() map[string]string { } var map_EnvFromSource = map[string]string{ - "": "EnvFromSource represents the source of a set of ConfigMaps", - "prefix": "An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.", + "": "EnvFromSource represents the source of a set of ConfigMaps or Secrets", + "prefix": "Optional text to prepend to the name of each environment variable. Must be a C_IDENTIFIER.", "configMapRef": "The ConfigMap to select from", "secretRef": "The Secret to select from", } @@ -957,9 +958,10 @@ func (KeyToPath) SwaggerDoc() map[string]string { } var map_Lifecycle = map[string]string{ - "": "Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.", - "postStart": "PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks", - "preStop": "PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The Pod's termination grace period countdown begins before the PreStop hook is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period (unless delayed by finalizers). Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks", + "": "Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.", + "postStart": "PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks", + "preStop": "PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The Pod's termination grace period countdown begins before the PreStop hook is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period (unless delayed by finalizers). Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks", + "stopSignal": "StopSignal defines which signal will be sent to a container when it is being stopped. If not specified, the default is defined by the container runtime in use. StopSignal can only be set for Pods with a non-empty .spec.os.name", } func (Lifecycle) SwaggerDoc() map[string]string { @@ -1335,6 +1337,15 @@ func (NodeStatus) SwaggerDoc() map[string]string { return map_NodeStatus } +var map_NodeSwapStatus = map[string]string{ + "": "NodeSwapStatus represents swap memory information.", + "capacity": "Total amount of swap memory in bytes.", +} + +func (NodeSwapStatus) SwaggerDoc() map[string]string { + return map_NodeSwapStatus +} + var map_NodeSystemInfo = map[string]string{ "": "NodeSystemInfo is a set of ids/uuids to uniquely identify the node.", "machineID": "MachineID reported by the node. For unique machine identification in the cluster this field is preferred. Learn more from man(5) machine-id: http://man7.org/linux/man-pages/man5/machine-id.5.html", @@ -1347,6 +1358,7 @@ var map_NodeSystemInfo = map[string]string{ "kubeProxyVersion": "Deprecated: KubeProxy Version reported by the node.", "operatingSystem": "The Operating System reported by the node", "architecture": "The Architecture reported by the node", + "swap": "Swap Info reported by the node.", } func (NodeSystemInfo) SwaggerDoc() map[string]string { @@ -1583,8 +1595,8 @@ var map_PodAffinityTerm = map[string]string{ "namespaces": "namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\".", "topologyKey": "This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.", "namespaceSelector": "A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means \"this pod's namespace\". An empty selector ({}) matches all namespaces.", - "matchLabelKeys": "MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).", - "mismatchLabelKeys": "MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).", + "matchLabelKeys": "MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set.", + "mismatchLabelKeys": "MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set.", } func (PodAffinityTerm) SwaggerDoc() map[string]string { @@ -1617,6 +1629,7 @@ func (PodAttachOptions) SwaggerDoc() map[string]string { var map_PodCondition = map[string]string{ "": "PodCondition contains details for the current condition of this pod.", "type": "Type is the type of the condition. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions", + "observedGeneration": "If set, this represents the .metadata.generation that the pod condition was set based upon. This is an alpha field. Enable PodObservedGenerationTracking to be able to use this field.", "status": "Status is the status of the condition. Can be True, False, Unknown. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions", "lastProbeTime": "Last time we probed the condition.", "lastTransitionTime": "Last time the condition transitioned from one status to another.", @@ -1799,7 +1812,7 @@ func (PodSignature) SwaggerDoc() map[string]string { var map_PodSpec = map[string]string{ "": "PodSpec is a description of a pod.", "volumes": "List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes", - "initContainers": "List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/", + "initContainers": "List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/", "containers": "List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.", "ephemeralContainers": "List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource.", "restartPolicy": "Restart policy for all containers within the pod. One of Always, OnFailure, Never. In some contexts, only a subset of those values may be permitted. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy", @@ -1846,6 +1859,7 @@ func (PodSpec) SwaggerDoc() map[string]string { var map_PodStatus = map[string]string{ "": "PodStatus represents information about the status of a pod. Status may trail the actual state of a system, especially if the node that hosts the pod cannot contact the control plane.", + "observedGeneration": "If set, this represents the .metadata.generation that the pod status was set based upon. This is an alpha field. Enable PodObservedGenerationTracking to be able to use this field.", "phase": "The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. The conditions array, the reason and message fields, and the individual container status arrays contain more detail about the pod's status. There are five possible phase values:\n\nPending: The pod has been accepted by the Kubernetes system, but one or more of the container images has not been created. This includes time before being scheduled as well as time spent downloading images over the network, which could take a while. Running: The pod has been bound to a node, and all of the containers have been created. At least one container is still running, or is in the process of starting or restarting. Succeeded: All containers in the pod have terminated in success, and will not be restarted. Failed: All containers in the pod have terminated, and at least one container has terminated in failure. The container either exited with non-zero status or was terminated by the system. Unknown: For some reason the state of the pod could not be obtained, typically due to an error in communicating with the host of the pod.\n\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-phase", "conditions": "Current service state of pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions", "message": "A human readable message indicating details about why the pod is in this condition.", @@ -1860,7 +1874,7 @@ var map_PodStatus = map[string]string{ "containerStatuses": "Statuses of containers in this pod. Each container in the pod should have at most one status in this list, and all statuses should be for containers in the pod. However this is not enforced. If a status for a non-existent container is present in the list, or the list has duplicate names, the behavior of various Kubernetes components is not defined and those statuses might be ignored. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status", "qosClass": "The Quality of Service (QOS) classification assigned to the pod based on resource requirements See PodQOSClass type for available QOS classes More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-qos/#quality-of-service-classes", "ephemeralContainerStatuses": "Statuses for any ephemeral containers that have run in this pod. Each ephemeral container in the pod should have at most one status in this list, and all statuses should be for containers in the pod. However this is not enforced. If a status for a non-existent container is present in the list, or the list has duplicate names, the behavior of various Kubernetes components is not defined and those statuses might be ignored. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status", - "resize": "Status of resources resize desired for pod's containers. It is empty if no resources resize is pending. Any changes to container resources will automatically set this to \"Proposed\"", + "resize": "Status of resources resize desired for pod's containers. It is empty if no resources resize is pending. Any changes to container resources will automatically set this to \"Proposed\" Deprecated: Resize status is moved to two pod conditions PodResizePending and PodResizeInProgress. PodResizePending will track states where the spec has been resized, but the Kubelet has not yet allocated the resources. PodResizeInProgress will track in-progress resizes, and should be present whenever allocated resources != acknowledged resources.", "resourceClaimStatuses": "Status of resource claims.", } @@ -2487,7 +2501,7 @@ var map_ServiceSpec = map[string]string{ "allocateLoadBalancerNodePorts": "allocateLoadBalancerNodePorts defines if NodePorts will be automatically allocated for services with type LoadBalancer. Default is \"true\". It may be set to \"false\" if the cluster load-balancer does not rely on NodePorts. If the caller requests specific NodePorts (by specifying a value), those requests will be respected, regardless of this field. This field may only be set for services with type LoadBalancer and will be cleared if the type is changed to any other type.", "loadBalancerClass": "loadBalancerClass is the class of the load balancer implementation this Service belongs to. If specified, the value of this field must be a label-style identifier, with an optional prefix, e.g. \"internal-vip\" or \"example.com/internal-vip\". Unprefixed names are reserved for end-users. This field can only be set when the Service type is 'LoadBalancer'. If not set, the default load balancer implementation is used, today this is typically done through the cloud provider integration, but should apply for any default implementation. If set, it is assumed that a load balancer implementation is watching for Services with a matching class. Any default load balancer implementation (e.g. cloud providers) should ignore Services that set this field. This field can only be set when creating or updating a Service to type 'LoadBalancer'. Once set, it can not be changed. This field will be wiped when a service is updated to a non 'LoadBalancer' type.", "internalTrafficPolicy": "InternalTrafficPolicy describes how nodes distribute service traffic they receive on the ClusterIP. If set to \"Local\", the proxy will assume that pods only want to talk to endpoints of the service on the same node as the pod, dropping the traffic if there are no local endpoints. The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features).", - "trafficDistribution": "TrafficDistribution offers a way to express preferences for how traffic is distributed to Service endpoints. Implementations can use this field as a hint, but are not required to guarantee strict adherence. If the field is not set, the implementation will apply its default routing strategy. If set to \"PreferClose\", implementations should prioritize endpoints that are topologically close (e.g., same zone). This is a beta field and requires enabling ServiceTrafficDistribution feature.", + "trafficDistribution": "TrafficDistribution offers a way to express preferences for how traffic is distributed to Service endpoints. Implementations can use this field as a hint, but are not required to guarantee strict adherence. If the field is not set, the implementation will apply its default routing strategy. If set to \"PreferClose\", implementations should prioritize endpoints that are in the same zone.", } func (ServiceSpec) SwaggerDoc() map[string]string { @@ -2619,8 +2633,8 @@ var map_TopologySpreadConstraint = map[string]string{ "whenUnsatisfiable": "WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location,\n but giving higher precedence to topologies that would help reduce the\n skew.\nA constraint is considered \"Unsatisfiable\" for an incoming pod if and only if every possible node assignment for that pod would violate \"MaxSkew\" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: ", "labelSelector": "LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain.", "minDomains": "MinDomains indicates a minimum number of eligible domains. When the number of eligible domains with matching topology keys is less than minDomains, Pod Topology Spread treats \"global minimum\" as 0, and then the calculation of Skew is performed. And when the number of eligible domains with matching topology keys equals or greater than minDomains, this value has no effect on scheduling. As a result, when the number of eligible domains is less than minDomains, scheduler won't schedule more than maxSkew Pods to those domains. If value is nil, the constraint behaves as if MinDomains is equal to 1. Valid values are integers greater than 0. When value is not nil, WhenUnsatisfiable must be DoNotSchedule.\n\nFor example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same labelSelector spread as 2/2/2: ", - "nodeAffinityPolicy": "NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.\n\nIf this value is nil, the behavior is equivalent to the Honor policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.", - "nodeTaintsPolicy": "NodeTaintsPolicy indicates how we will treat node taints when calculating pod topology spread skew. Options are: - Honor: nodes without taints, along with tainted nodes for which the incoming pod has a toleration, are included. - Ignore: node taints are ignored. All nodes are included.\n\nIf this value is nil, the behavior is equivalent to the Ignore policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.", + "nodeAffinityPolicy": "NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.\n\nIf this value is nil, the behavior is equivalent to the Honor policy.", + "nodeTaintsPolicy": "NodeTaintsPolicy indicates how we will treat node taints when calculating pod topology spread skew. Options are: - Honor: nodes without taints, along with tainted nodes for which the incoming pod has a toleration, are included. - Ignore: node taints are ignored. All nodes are included.\n\nIf this value is nil, the behavior is equivalent to the Ignore policy.", "matchLabelKeys": "MatchLabelKeys is a set of pod label keys to select the pods over which spreading will be calculated. The keys are used to lookup values from the incoming pod labels, those key-value labels are ANDed with labelSelector to select the group of existing pods over which spreading will be calculated for the incoming pod. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector. MatchLabelKeys cannot be set when LabelSelector isn't set. Keys that don't exist in the incoming pod labels will be ignored. A null or empty list means only match against labelSelector.\n\nThis is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default).", } @@ -2760,7 +2774,7 @@ var map_VolumeSource = map[string]string{ "storageos": "storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. Deprecated: StorageOS is deprecated and the in-tree storageos type is no longer supported.", "csi": "csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers.", "ephemeral": "ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.\n\nUse this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity\n tracking are needed,\nc) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n\nUse PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.\n\nA pod can use both types of ephemeral volumes and persistent volumes at the same time.", - "image": "image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. The volume is resolved at pod startup depending on which PullPolicy value is provided:\n\n- Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.\n\nThe volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. The volume will be mounted read-only (ro) and non-executable files (noexec). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath). The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.", + "image": "image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. The volume is resolved at pod startup depending on which PullPolicy value is provided:\n\n- Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.\n\nThe volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. The volume will be mounted read-only (ro) and non-executable files (noexec). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.", } func (VolumeSource) SwaggerDoc() map[string]string { diff --git a/e2e/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go index 3f669092e..619c52542 100644 --- a/e2e/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go +++ b/e2e/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go @@ -1055,6 +1055,11 @@ func (in *ContainerStatus) DeepCopyInto(out *ContainerStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.StopSignal != nil { + in, out := &in.StopSignal, &out.StopSignal + *out = new(Signal) + **out = **in + } return } @@ -2101,6 +2106,11 @@ func (in *Lifecycle) DeepCopyInto(out *Lifecycle) { *out = new(LifecycleHandler) (*in).DeepCopyInto(*out) } + if in.StopSignal != nil { + in, out := &in.StopSignal, &out.StopSignal + *out = new(Signal) + **out = **in + } return } @@ -3002,7 +3012,7 @@ func (in *NodeStatus) DeepCopyInto(out *NodeStatus) { copy(*out, *in) } out.DaemonEndpoints = in.DaemonEndpoints - out.NodeInfo = in.NodeInfo + in.NodeInfo.DeepCopyInto(&out.NodeInfo) if in.Images != nil { in, out := &in.Images, &out.Images *out = make([]ContainerImage, len(*in)) @@ -3050,9 +3060,35 @@ func (in *NodeStatus) DeepCopy() *NodeStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeSwapStatus) DeepCopyInto(out *NodeSwapStatus) { + *out = *in + if in.Capacity != nil { + in, out := &in.Capacity, &out.Capacity + *out = new(int64) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeSwapStatus. +func (in *NodeSwapStatus) DeepCopy() *NodeSwapStatus { + if in == nil { + return nil + } + out := new(NodeSwapStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodeSystemInfo) DeepCopyInto(out *NodeSystemInfo) { *out = *in + if in.Swap != nil { + in, out := &in.Swap, &out.Swap + *out = new(NodeSwapStatus) + (*in).DeepCopyInto(*out) + } return } diff --git a/e2e/vendor/k8s.io/api/discovery/v1/doc.go b/e2e/vendor/k8s.io/api/discovery/v1/doc.go index 01913669f..43e30b7f4 100644 --- a/e2e/vendor/k8s.io/api/discovery/v1/doc.go +++ b/e2e/vendor/k8s.io/api/discovery/v1/doc.go @@ -20,4 +20,4 @@ limitations under the License. // +k8s:prerelease-lifecycle-gen=true // +groupName=discovery.k8s.io -package v1 // import "k8s.io/api/discovery/v1" +package v1 diff --git a/e2e/vendor/k8s.io/api/discovery/v1/generated.pb.go b/e2e/vendor/k8s.io/api/discovery/v1/generated.pb.go index 5792481dc..443ff8f8f 100644 --- a/e2e/vendor/k8s.io/api/discovery/v1/generated.pb.go +++ b/e2e/vendor/k8s.io/api/discovery/v1/generated.pb.go @@ -214,10 +214,38 @@ func (m *EndpointSliceList) XXX_DiscardUnknown() { var xxx_messageInfo_EndpointSliceList proto.InternalMessageInfo +func (m *ForNode) Reset() { *m = ForNode{} } +func (*ForNode) ProtoMessage() {} +func (*ForNode) Descriptor() ([]byte, []int) { + return fileDescriptor_2237b452324cf77e, []int{6} +} +func (m *ForNode) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ForNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ForNode) XXX_Merge(src proto.Message) { + xxx_messageInfo_ForNode.Merge(m, src) +} +func (m *ForNode) XXX_Size() int { + return m.Size() +} +func (m *ForNode) XXX_DiscardUnknown() { + xxx_messageInfo_ForNode.DiscardUnknown(m) +} + +var xxx_messageInfo_ForNode proto.InternalMessageInfo + func (m *ForZone) Reset() { *m = ForZone{} } func (*ForZone) ProtoMessage() {} func (*ForZone) Descriptor() ([]byte, []int) { - return fileDescriptor_2237b452324cf77e, []int{6} + return fileDescriptor_2237b452324cf77e, []int{7} } func (m *ForZone) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -250,6 +278,7 @@ func init() { proto.RegisterType((*EndpointPort)(nil), "k8s.io.api.discovery.v1.EndpointPort") proto.RegisterType((*EndpointSlice)(nil), "k8s.io.api.discovery.v1.EndpointSlice") proto.RegisterType((*EndpointSliceList)(nil), "k8s.io.api.discovery.v1.EndpointSliceList") + proto.RegisterType((*ForNode)(nil), "k8s.io.api.discovery.v1.ForNode") proto.RegisterType((*ForZone)(nil), "k8s.io.api.discovery.v1.ForZone") } @@ -258,62 +287,64 @@ func init() { } var fileDescriptor_2237b452324cf77e = []byte{ - // 877 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x4d, 0x6f, 0xdc, 0x44, - 0x18, 0x5e, 0x67, 0x63, 0x62, 0x8f, 0x13, 0xd1, 0x8e, 0x90, 0x62, 0x2d, 0xc8, 0x5e, 0x8c, 0x0a, - 0x2b, 0x45, 0x78, 0x49, 0x84, 0x50, 0x41, 0xe2, 0x10, 0xd3, 0xd0, 0xf2, 0x15, 0xa2, 0x69, 0x4e, - 0x15, 0x52, 0x71, 0xec, 0x37, 0x5e, 0x93, 0xd8, 0x63, 0x79, 0x26, 0x2b, 0x2d, 0x27, 0x2e, 0x9c, - 0xe1, 0x17, 0x71, 0x44, 0x39, 0xf6, 0x46, 0x4f, 0x16, 0x31, 0x7f, 0x81, 0x53, 0x4f, 0x68, 0xc6, - 0x9f, 0x61, 0xb3, 0xda, 0xde, 0x3c, 0xcf, 0x3c, 0xcf, 0xfb, 0xf1, 0xcc, 0xcc, 0x6b, 0xf4, 0xc1, - 0xc5, 0x43, 0xe6, 0xc6, 0x74, 0xea, 0x67, 0xf1, 0x34, 0x8c, 0x59, 0x40, 0xe7, 0x90, 0x2f, 0xa6, - 0xf3, 0xfd, 0x69, 0x04, 0x29, 0xe4, 0x3e, 0x87, 0xd0, 0xcd, 0x72, 0xca, 0x29, 0xde, 0xad, 0x88, - 0xae, 0x9f, 0xc5, 0x6e, 0x4b, 0x74, 0xe7, 0xfb, 0xa3, 0x0f, 0xa3, 0x98, 0xcf, 0xae, 0xce, 0xdc, - 0x80, 0x26, 0xd3, 0x88, 0x46, 0x74, 0x2a, 0xf9, 0x67, 0x57, 0xe7, 0x72, 0x25, 0x17, 0xf2, 0xab, - 0x8a, 0x33, 0x72, 0x7a, 0x09, 0x03, 0x9a, 0xc3, 0x1d, 0xb9, 0x46, 0x1f, 0x77, 0x9c, 0xc4, 0x0f, - 0x66, 0x71, 0x2a, 0x6a, 0xca, 0x2e, 0x22, 0x01, 0xb0, 0x69, 0x02, 0xdc, 0xbf, 0x4b, 0x35, 0x5d, - 0xa5, 0xca, 0xaf, 0x52, 0x1e, 0x27, 0xb0, 0x24, 0xf8, 0x64, 0x9d, 0x80, 0x05, 0x33, 0x48, 0xfc, - 0xff, 0xeb, 0x9c, 0x7f, 0x37, 0x91, 0x76, 0x94, 0x86, 0x19, 0x8d, 0x53, 0x8e, 0xf7, 0x90, 0xee, - 0x87, 0x61, 0x0e, 0x8c, 0x01, 0x33, 0x95, 0xf1, 0x70, 0xa2, 0x7b, 0x3b, 0x65, 0x61, 0xeb, 0x87, - 0x0d, 0x48, 0xba, 0x7d, 0xfc, 0x1c, 0xa1, 0x80, 0xa6, 0x61, 0xcc, 0x63, 0x9a, 0x32, 0x73, 0x63, - 0xac, 0x4c, 0x8c, 0x83, 0x3d, 0x77, 0x85, 0xb3, 0x6e, 0x93, 0xe3, 0x8b, 0x56, 0xe2, 0xe1, 0xeb, - 0xc2, 0x1e, 0x94, 0x85, 0x8d, 0x3a, 0x8c, 0xf4, 0x42, 0xe2, 0x09, 0xd2, 0x66, 0x94, 0xf1, 0xd4, - 0x4f, 0xc0, 0x1c, 0x8e, 0x95, 0x89, 0xee, 0x6d, 0x97, 0x85, 0xad, 0x3d, 0xa9, 0x31, 0xd2, 0xee, - 0xe2, 0x13, 0xa4, 0x73, 0x3f, 0x8f, 0x80, 0x13, 0x38, 0x37, 0x37, 0x65, 0x25, 0xef, 0xf5, 0x2b, - 0x11, 0x67, 0x23, 0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ff, 0x76, 0x4b, 0x26, 0xe3, 0xee, 0x07, 0x00, 0x00, + // 902 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0x8e, 0x9b, 0x9a, 0xda, 0xe3, 0x56, 0xec, 0x8e, 0x90, 0x6a, 0x05, 0x64, 0x07, 0xa3, 0x85, + 0x48, 0x15, 0x0e, 0xad, 0x10, 0x5a, 0x90, 0x38, 0xd4, 0x6c, 0xd9, 0xe5, 0x57, 0xa9, 0x66, 0x7b, + 0x5a, 0x21, 0x81, 0x6b, 0xbf, 0x3a, 0xa6, 0x8d, 0xc7, 0xf2, 0x4c, 0x22, 0x85, 0x13, 0x17, 0xce, + 0xf0, 0x9f, 0xf0, 0x1f, 0x70, 0x44, 0x3d, 0xee, 0x8d, 0x3d, 0x59, 0xd4, 0xfc, 0x0b, 0x9c, 0xf6, + 0x84, 0x66, 0xfc, 0x33, 0xa4, 0x51, 0xf6, 0xe6, 0xf9, 0xe6, 0x7b, 0xdf, 0x7b, 0xf3, 0xcd, 0x7b, + 0x23, 0xa3, 0xf7, 0xae, 0x1e, 0x32, 0x37, 0xa6, 0x63, 0x3f, 0x8d, 0xc7, 0x61, 0xcc, 0x02, 0x3a, + 0x87, 0x6c, 0x31, 0x9e, 0x1f, 0x8e, 0x23, 0x48, 0x20, 0xf3, 0x39, 0x84, 0x6e, 0x9a, 0x51, 0x4e, + 0xf1, 0x7e, 0x49, 0x74, 0xfd, 0x34, 0x76, 0x1b, 0xa2, 0x3b, 0x3f, 0x1c, 0xbc, 0x1f, 0xc5, 0x7c, + 0x32, 0xbb, 0x70, 0x03, 0x3a, 0x1d, 0x47, 0x34, 0xa2, 0x63, 0xc9, 0xbf, 0x98, 0x5d, 0xca, 0x95, + 0x5c, 0xc8, 0xaf, 0x52, 0x67, 0xe0, 0x74, 0x12, 0x06, 0x34, 0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 0xad, 0x6c, 0x08, 0x00, 0x00, } func (m *Endpoint) Marshal() (dAtA []byte, err error) { @@ -500,6 +531,20 @@ func (m *EndpointHints) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.ForNodes) > 0 { + for iNdEx := len(m.ForNodes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ForNodes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } if len(m.ForZones) > 0 { for iNdEx := len(m.ForZones) - 1; iNdEx >= 0; iNdEx-- { { @@ -679,6 +724,34 @@ func (m *EndpointSliceList) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ForNode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ForNode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ForNode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *ForZone) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -793,6 +866,12 @@ func (m *EndpointHints) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } + if len(m.ForNodes) > 0 { + for _, e := range m.ForNodes { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -862,6 +941,17 @@ func (m *EndpointSliceList) Size() (n int) { return n } +func (m *ForNode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func (m *ForZone) Size() (n int) { if m == nil { return 0 @@ -927,8 +1017,14 @@ func (this *EndpointHints) String() string { repeatedStringForForZones += strings.Replace(strings.Replace(f.String(), "ForZone", "ForZone", 1), `&`, ``, 1) + "," } repeatedStringForForZones += "}" + repeatedStringForForNodes := "[]ForNode{" + for _, f := range this.ForNodes { + repeatedStringForForNodes += strings.Replace(strings.Replace(f.String(), "ForNode", "ForNode", 1), `&`, ``, 1) + "," + } + repeatedStringForForNodes += "}" s := strings.Join([]string{`&EndpointHints{`, `ForZones:` + repeatedStringForForZones + `,`, + `ForNodes:` + repeatedStringForForNodes + `,`, `}`, }, "") return s @@ -985,6 +1081,16 @@ func (this *EndpointSliceList) String() string { }, "") return s } +func (this *ForNode) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ForNode{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `}`, + }, "") + return s +} func (this *ForZone) String() string { if this == nil { return "nil" @@ -1592,6 +1698,40 @@ func (m *EndpointHints) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ForNodes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ForNodes = append(m.ForNodes, ForNode{}) + if err := m.ForNodes[len(m.ForNodes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -2082,6 +2222,88 @@ func (m *EndpointSliceList) Unmarshal(dAtA []byte) error { } return nil } +func (m *ForNode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ForNode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ForNode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ForZone) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/e2e/vendor/k8s.io/api/discovery/v1/generated.proto b/e2e/vendor/k8s.io/api/discovery/v1/generated.proto index 8ddf0dc5d..569d8a916 100644 --- a/e2e/vendor/k8s.io/api/discovery/v1/generated.proto +++ b/e2e/vendor/k8s.io/api/discovery/v1/generated.proto @@ -31,12 +31,12 @@ option go_package = "k8s.io/api/discovery/v1"; // Endpoint represents a single logical "backend" implementing a service. message Endpoint { - // addresses of this endpoint. The contents of this field are interpreted - // according to the corresponding EndpointSlice addressType field. Consumers - // must handle different types of addresses in the context of their own - // capabilities. This must contain at least one address but no more than - // 100. These are all assumed to be fungible and clients may choose to only - // use the first element. Refer to: https://issue.k8s.io/106267 + // addresses of this endpoint. For EndpointSlices of addressType "IPv4" or "IPv6", + // the values are IP addresses in canonical form. The syntax and semantics of + // other addressType values are not defined. This must contain at least one + // address but no more than 100. EndpointSlices generated by the EndpointSlice + // controller will always have exactly 1 address. No semantics are defined for + // additional addresses beyond the first, and kube-proxy does not look at them. // +listType=set repeated string addresses = 1; @@ -82,36 +82,42 @@ message Endpoint { // EndpointConditions represents the current condition of an endpoint. message EndpointConditions { - // ready indicates that this endpoint is prepared to receive traffic, + // ready indicates that this endpoint is ready to receive traffic, // according to whatever system is managing the endpoint. A nil value - // indicates an unknown state. In most cases consumers should interpret this - // unknown state as ready. For compatibility reasons, ready should never be - // "true" for terminating endpoints, except when the normal readiness - // behavior is being explicitly overridden, for example when the associated - // Service has set the publishNotReadyAddresses flag. + // should be interpreted as "true". In general, an endpoint should be + // marked ready if it is serving and not terminating, though this can + // be overridden in some cases, such as when the associated Service has + // set the publishNotReadyAddresses flag. // +optional optional bool ready = 1; - // serving is identical to ready except that it is set regardless of the - // terminating state of endpoints. This condition should be set to true for - // a ready endpoint that is terminating. If nil, consumers should defer to - // the ready condition. + // serving indicates that this endpoint is able to receive traffic, + // according to whatever system is managing the endpoint. For endpoints + // backed by pods, the EndpointSlice controller will mark the endpoint + // as serving if the pod's Ready condition is True. A nil value should be + // interpreted as "true". // +optional optional bool serving = 2; // terminating indicates that this endpoint is terminating. A nil value - // indicates an unknown state. Consumers should interpret this unknown state - // to mean that the endpoint is not terminating. + // should be interpreted as "false". // +optional optional bool terminating = 3; } // EndpointHints provides hints describing how an endpoint should be consumed. message EndpointHints { - // forZones indicates the zone(s) this endpoint should be consumed by to - // enable topology aware routing. + // forZones indicates the zone(s) this endpoint should be consumed by when + // using topology aware routing. May contain a maximum of 8 entries. // +listType=atomic repeated ForZone forZones = 1; + + // forNodes indicates the node(s) this endpoint should be consumed by when + // using topology aware routing. May contain a maximum of 8 entries. + // This is an Alpha feature and is only used when the PreferSameTrafficDistribution + // feature gate is enabled. + // +listType=atomic + repeated ForNode forNodes = 2; } // EndpointPort represents a Port used by an EndpointSlice @@ -132,8 +138,9 @@ message EndpointPort { optional string protocol = 2; // port represents the port number of the endpoint. - // If this is not specified, ports are not restricted and must be - // interpreted in the context of the specific consumer. + // If the EndpointSlice is derived from a Kubernetes service, this must be set + // to the service's target port. EndpointSlices used for other purposes may have + // a nil port. optional int32 port = 3; // The application protocol for this port. @@ -155,9 +162,12 @@ message EndpointPort { optional string appProtocol = 4; } -// EndpointSlice represents a subset of the endpoints that implement a service. -// For a given service there may be multiple EndpointSlice objects, selected by -// labels, which must be joined to produce the full set of endpoints. +// EndpointSlice represents a set of service endpoints. Most EndpointSlices are created by +// the EndpointSlice controller to represent the Pods selected by Service objects. For a +// given service there may be multiple EndpointSlice objects which must be joined to +// produce the full set of endpoints; you can find all of the slices for a given service +// by listing EndpointSlices in the service's namespace whose `kubernetes.io/service-name` +// label contains the service's name. message EndpointSlice { // Standard object's metadata. // +optional @@ -169,7 +179,10 @@ message EndpointSlice { // supported: // * IPv4: Represents an IPv4 Address. // * IPv6: Represents an IPv6 Address. - // * FQDN: Represents a Fully Qualified Domain Name. + // * FQDN: Represents a Fully Qualified Domain Name. (Deprecated) + // The EndpointSlice controller only generates, and kube-proxy only processes, + // slices of addressType "IPv4" and "IPv6". No semantics are defined for + // the "FQDN" type. optional string addressType = 4; // endpoints is a list of unique endpoints in this slice. Each slice may @@ -178,10 +191,11 @@ message EndpointSlice { repeated Endpoint endpoints = 2; // ports specifies the list of network ports exposed by each endpoint in - // this slice. Each port must have a unique name. When ports is empty, it - // indicates that there are no defined ports. When a port is defined with a - // nil port value, it indicates "all ports". Each slice may include a + // this slice. Each port must have a unique name. Each slice may include a // maximum of 100 ports. + // Services always have at least 1 port, so EndpointSlices generated by the + // EndpointSlice controller will likewise always have at least 1 port. + // EndpointSlices used for other purposes may have an empty ports list. // +optional // +listType=atomic repeated EndpointPort ports = 3; @@ -197,6 +211,12 @@ message EndpointSliceList { repeated EndpointSlice items = 2; } +// ForNode provides information about which nodes should consume this endpoint. +message ForNode { + // name represents the name of the node. + optional string name = 1; +} + // ForZone provides information about which zones should consume this endpoint. message ForZone { // name represents the name of the zone. diff --git a/e2e/vendor/k8s.io/api/discovery/v1/types.go b/e2e/vendor/k8s.io/api/discovery/v1/types.go index d6a9d0fce..6f2695316 100644 --- a/e2e/vendor/k8s.io/api/discovery/v1/types.go +++ b/e2e/vendor/k8s.io/api/discovery/v1/types.go @@ -25,9 +25,12 @@ import ( // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.21 -// EndpointSlice represents a subset of the endpoints that implement a service. -// For a given service there may be multiple EndpointSlice objects, selected by -// labels, which must be joined to produce the full set of endpoints. +// EndpointSlice represents a set of service endpoints. Most EndpointSlices are created by +// the EndpointSlice controller to represent the Pods selected by Service objects. For a +// given service there may be multiple EndpointSlice objects which must be joined to +// produce the full set of endpoints; you can find all of the slices for a given service +// by listing EndpointSlices in the service's namespace whose `kubernetes.io/service-name` +// label contains the service's name. type EndpointSlice struct { metav1.TypeMeta `json:",inline"` @@ -41,7 +44,10 @@ type EndpointSlice struct { // supported: // * IPv4: Represents an IPv4 Address. // * IPv6: Represents an IPv6 Address. - // * FQDN: Represents a Fully Qualified Domain Name. + // * FQDN: Represents a Fully Qualified Domain Name. (Deprecated) + // The EndpointSlice controller only generates, and kube-proxy only processes, + // slices of addressType "IPv4" and "IPv6". No semantics are defined for + // the "FQDN" type. AddressType AddressType `json:"addressType" protobuf:"bytes,4,rep,name=addressType"` // endpoints is a list of unique endpoints in this slice. Each slice may @@ -50,10 +56,11 @@ type EndpointSlice struct { Endpoints []Endpoint `json:"endpoints" protobuf:"bytes,2,rep,name=endpoints"` // ports specifies the list of network ports exposed by each endpoint in - // this slice. Each port must have a unique name. When ports is empty, it - // indicates that there are no defined ports. When a port is defined with a - // nil port value, it indicates "all ports". Each slice may include a + // this slice. Each port must have a unique name. Each slice may include a // maximum of 100 ports. + // Services always have at least 1 port, so EndpointSlices generated by the + // EndpointSlice controller will likewise always have at least 1 port. + // EndpointSlices used for other purposes may have an empty ports list. // +optional // +listType=atomic Ports []EndpointPort `json:"ports" protobuf:"bytes,3,rep,name=ports"` @@ -76,12 +83,12 @@ const ( // Endpoint represents a single logical "backend" implementing a service. type Endpoint struct { - // addresses of this endpoint. The contents of this field are interpreted - // according to the corresponding EndpointSlice addressType field. Consumers - // must handle different types of addresses in the context of their own - // capabilities. This must contain at least one address but no more than - // 100. These are all assumed to be fungible and clients may choose to only - // use the first element. Refer to: https://issue.k8s.io/106267 + // addresses of this endpoint. For EndpointSlices of addressType "IPv4" or "IPv6", + // the values are IP addresses in canonical form. The syntax and semantics of + // other addressType values are not defined. This must contain at least one + // address but no more than 100. EndpointSlices generated by the EndpointSlice + // controller will always have exactly 1 address. No semantics are defined for + // additional addresses beyond the first, and kube-proxy does not look at them. // +listType=set Addresses []string `json:"addresses" protobuf:"bytes,1,rep,name=addresses"` @@ -127,36 +134,42 @@ type Endpoint struct { // EndpointConditions represents the current condition of an endpoint. type EndpointConditions struct { - // ready indicates that this endpoint is prepared to receive traffic, + // ready indicates that this endpoint is ready to receive traffic, // according to whatever system is managing the endpoint. A nil value - // indicates an unknown state. In most cases consumers should interpret this - // unknown state as ready. For compatibility reasons, ready should never be - // "true" for terminating endpoints, except when the normal readiness - // behavior is being explicitly overridden, for example when the associated - // Service has set the publishNotReadyAddresses flag. + // should be interpreted as "true". In general, an endpoint should be + // marked ready if it is serving and not terminating, though this can + // be overridden in some cases, such as when the associated Service has + // set the publishNotReadyAddresses flag. // +optional Ready *bool `json:"ready,omitempty" protobuf:"bytes,1,name=ready"` - // serving is identical to ready except that it is set regardless of the - // terminating state of endpoints. This condition should be set to true for - // a ready endpoint that is terminating. If nil, consumers should defer to - // the ready condition. + // serving indicates that this endpoint is able to receive traffic, + // according to whatever system is managing the endpoint. For endpoints + // backed by pods, the EndpointSlice controller will mark the endpoint + // as serving if the pod's Ready condition is True. A nil value should be + // interpreted as "true". // +optional Serving *bool `json:"serving,omitempty" protobuf:"bytes,2,name=serving"` // terminating indicates that this endpoint is terminating. A nil value - // indicates an unknown state. Consumers should interpret this unknown state - // to mean that the endpoint is not terminating. + // should be interpreted as "false". // +optional Terminating *bool `json:"terminating,omitempty" protobuf:"bytes,3,name=terminating"` } // EndpointHints provides hints describing how an endpoint should be consumed. type EndpointHints struct { - // forZones indicates the zone(s) this endpoint should be consumed by to - // enable topology aware routing. + // forZones indicates the zone(s) this endpoint should be consumed by when + // using topology aware routing. May contain a maximum of 8 entries. // +listType=atomic ForZones []ForZone `json:"forZones,omitempty" protobuf:"bytes,1,name=forZones"` + + // forNodes indicates the node(s) this endpoint should be consumed by when + // using topology aware routing. May contain a maximum of 8 entries. + // This is an Alpha feature and is only used when the PreferSameTrafficDistribution + // feature gate is enabled. + // +listType=atomic + ForNodes []ForNode `json:"forNodes,omitempty" protobuf:"bytes,2,name=forNodes"` } // ForZone provides information about which zones should consume this endpoint. @@ -165,6 +178,12 @@ type ForZone struct { Name string `json:"name" protobuf:"bytes,1,name=name"` } +// ForNode provides information about which nodes should consume this endpoint. +type ForNode struct { + // name represents the name of the node. + Name string `json:"name" protobuf:"bytes,1,name=name"` +} + // EndpointPort represents a Port used by an EndpointSlice // +structType=atomic type EndpointPort struct { @@ -183,8 +202,9 @@ type EndpointPort struct { Protocol *v1.Protocol `json:"protocol,omitempty" protobuf:"bytes,2,name=protocol"` // port represents the port number of the endpoint. - // If this is not specified, ports are not restricted and must be - // interpreted in the context of the specific consumer. + // If the EndpointSlice is derived from a Kubernetes service, this must be set + // to the service's target port. EndpointSlices used for other purposes may have + // a nil port. Port *int32 `json:"port,omitempty" protobuf:"bytes,3,opt,name=port"` // The application protocol for this port. diff --git a/e2e/vendor/k8s.io/api/discovery/v1/types_swagger_doc_generated.go b/e2e/vendor/k8s.io/api/discovery/v1/types_swagger_doc_generated.go index 41c306056..ac5b853b9 100644 --- a/e2e/vendor/k8s.io/api/discovery/v1/types_swagger_doc_generated.go +++ b/e2e/vendor/k8s.io/api/discovery/v1/types_swagger_doc_generated.go @@ -29,7 +29,7 @@ package v1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_Endpoint = map[string]string{ "": "Endpoint represents a single logical \"backend\" implementing a service.", - "addresses": "addresses of this endpoint. The contents of this field are interpreted according to the corresponding EndpointSlice addressType field. Consumers must handle different types of addresses in the context of their own capabilities. This must contain at least one address but no more than 100. These are all assumed to be fungible and clients may choose to only use the first element. Refer to: https://issue.k8s.io/106267", + "addresses": "addresses of this endpoint. For EndpointSlices of addressType \"IPv4\" or \"IPv6\", the values are IP addresses in canonical form. The syntax and semantics of other addressType values are not defined. This must contain at least one address but no more than 100. EndpointSlices generated by the EndpointSlice controller will always have exactly 1 address. No semantics are defined for additional addresses beyond the first, and kube-proxy does not look at them.", "conditions": "conditions contains information about the current status of the endpoint.", "hostname": "hostname of this endpoint. This field may be used by consumers of endpoints to distinguish endpoints from each other (e.g. in DNS names). Multiple endpoints which use the same hostname should be considered fungible (e.g. multiple A values in DNS). Must be lowercase and pass DNS Label (RFC 1123) validation.", "targetRef": "targetRef is a reference to a Kubernetes object that represents this endpoint.", @@ -45,9 +45,9 @@ func (Endpoint) SwaggerDoc() map[string]string { var map_EndpointConditions = map[string]string{ "": "EndpointConditions represents the current condition of an endpoint.", - "ready": "ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. A nil value indicates an unknown state. In most cases consumers should interpret this unknown state as ready. For compatibility reasons, ready should never be \"true\" for terminating endpoints, except when the normal readiness behavior is being explicitly overridden, for example when the associated Service has set the publishNotReadyAddresses flag.", - "serving": "serving is identical to ready except that it is set regardless of the terminating state of endpoints. This condition should be set to true for a ready endpoint that is terminating. If nil, consumers should defer to the ready condition.", - "terminating": "terminating indicates that this endpoint is terminating. A nil value indicates an unknown state. Consumers should interpret this unknown state to mean that the endpoint is not terminating.", + "ready": "ready indicates that this endpoint is ready to receive traffic, according to whatever system is managing the endpoint. A nil value should be interpreted as \"true\". In general, an endpoint should be marked ready if it is serving and not terminating, though this can be overridden in some cases, such as when the associated Service has set the publishNotReadyAddresses flag.", + "serving": "serving indicates that this endpoint is able to receive traffic, according to whatever system is managing the endpoint. For endpoints backed by pods, the EndpointSlice controller will mark the endpoint as serving if the pod's Ready condition is True. A nil value should be interpreted as \"true\".", + "terminating": "terminating indicates that this endpoint is terminating. A nil value should be interpreted as \"false\".", } func (EndpointConditions) SwaggerDoc() map[string]string { @@ -56,7 +56,8 @@ func (EndpointConditions) SwaggerDoc() map[string]string { var map_EndpointHints = map[string]string{ "": "EndpointHints provides hints describing how an endpoint should be consumed.", - "forZones": "forZones indicates the zone(s) this endpoint should be consumed by to enable topology aware routing.", + "forZones": "forZones indicates the zone(s) this endpoint should be consumed by when using topology aware routing. May contain a maximum of 8 entries.", + "forNodes": "forNodes indicates the node(s) this endpoint should be consumed by when using topology aware routing. May contain a maximum of 8 entries. This is an Alpha feature and is only used when the PreferSameTrafficDistribution feature gate is enabled.", } func (EndpointHints) SwaggerDoc() map[string]string { @@ -67,7 +68,7 @@ var map_EndpointPort = map[string]string{ "": "EndpointPort represents a Port used by an EndpointSlice", "name": "name represents the name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is derived from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string.", "protocol": "protocol represents the IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP.", - "port": "port represents the port number of the endpoint. If this is not specified, ports are not restricted and must be interpreted in the context of the specific consumer.", + "port": "port represents the port number of the endpoint. If the EndpointSlice is derived from a Kubernetes service, this must be set to the service's target port. EndpointSlices used for other purposes may have a nil port.", "appProtocol": "The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either:\n\n* Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names).\n\n* Kubernetes-defined prefixed names:\n * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior-\n * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455\n * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455\n\n* Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol.", } @@ -76,11 +77,11 @@ func (EndpointPort) SwaggerDoc() map[string]string { } var map_EndpointSlice = map[string]string{ - "": "EndpointSlice represents a subset of the endpoints that implement a service. For a given service there may be multiple EndpointSlice objects, selected by labels, which must be joined to produce the full set of endpoints.", + "": "EndpointSlice represents a set of service endpoints. Most EndpointSlices are created by the EndpointSlice controller to represent the Pods selected by Service objects. For a given service there may be multiple EndpointSlice objects which must be joined to produce the full set of endpoints; you can find all of the slices for a given service by listing EndpointSlices in the service's namespace whose `kubernetes.io/service-name` label contains the service's name.", "metadata": "Standard object's metadata.", - "addressType": "addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name.", + "addressType": "addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name. (Deprecated) The EndpointSlice controller only generates, and kube-proxy only processes, slices of addressType \"IPv4\" and \"IPv6\". No semantics are defined for the \"FQDN\" type.", "endpoints": "endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints.", - "ports": "ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates \"all ports\". Each slice may include a maximum of 100 ports.", + "ports": "ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. Each slice may include a maximum of 100 ports. Services always have at least 1 port, so EndpointSlices generated by the EndpointSlice controller will likewise always have at least 1 port. EndpointSlices used for other purposes may have an empty ports list.", } func (EndpointSlice) SwaggerDoc() map[string]string { @@ -97,6 +98,15 @@ func (EndpointSliceList) SwaggerDoc() map[string]string { return map_EndpointSliceList } +var map_ForNode = map[string]string{ + "": "ForNode provides information about which nodes should consume this endpoint.", + "name": "name represents the name of the node.", +} + +func (ForNode) SwaggerDoc() map[string]string { + return map_ForNode +} + var map_ForZone = map[string]string{ "": "ForZone provides information about which zones should consume this endpoint.", "name": "name represents the name of the zone.", diff --git a/e2e/vendor/k8s.io/api/discovery/v1/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/api/discovery/v1/zz_generated.deepcopy.go index caa872af0..60eada3b9 100644 --- a/e2e/vendor/k8s.io/api/discovery/v1/zz_generated.deepcopy.go +++ b/e2e/vendor/k8s.io/api/discovery/v1/zz_generated.deepcopy.go @@ -119,6 +119,11 @@ func (in *EndpointHints) DeepCopyInto(out *EndpointHints) { *out = make([]ForZone, len(*in)) copy(*out, *in) } + if in.ForNodes != nil { + in, out := &in.ForNodes, &out.ForNodes + *out = make([]ForNode, len(*in)) + copy(*out, *in) + } return } @@ -241,6 +246,22 @@ func (in *EndpointSliceList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ForNode) DeepCopyInto(out *ForNode) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ForNode. +func (in *ForNode) DeepCopy() *ForNode { + if in == nil { + return nil + } + out := new(ForNode) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ForZone) DeepCopyInto(out *ForZone) { *out = *in diff --git a/e2e/vendor/k8s.io/api/discovery/v1beta1/doc.go b/e2e/vendor/k8s.io/api/discovery/v1beta1/doc.go index 7d7084802..f12087eff 100644 --- a/e2e/vendor/k8s.io/api/discovery/v1beta1/doc.go +++ b/e2e/vendor/k8s.io/api/discovery/v1beta1/doc.go @@ -20,4 +20,4 @@ limitations under the License. // +k8s:prerelease-lifecycle-gen=true // +groupName=discovery.k8s.io -package v1beta1 // import "k8s.io/api/discovery/v1beta1" +package v1beta1 diff --git a/e2e/vendor/k8s.io/api/discovery/v1beta1/generated.pb.go b/e2e/vendor/k8s.io/api/discovery/v1beta1/generated.pb.go index 46935574b..de3257786 100644 --- a/e2e/vendor/k8s.io/api/discovery/v1beta1/generated.pb.go +++ b/e2e/vendor/k8s.io/api/discovery/v1beta1/generated.pb.go @@ -214,10 +214,38 @@ func (m *EndpointSliceList) XXX_DiscardUnknown() { var xxx_messageInfo_EndpointSliceList proto.InternalMessageInfo +func (m *ForNode) Reset() { *m = ForNode{} } +func (*ForNode) ProtoMessage() {} +func (*ForNode) Descriptor() ([]byte, []int) { + return fileDescriptor_6555bad15de200e0, []int{6} +} +func (m *ForNode) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ForNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ForNode) XXX_Merge(src proto.Message) { + xxx_messageInfo_ForNode.Merge(m, src) +} +func (m *ForNode) XXX_Size() int { + return m.Size() +} +func (m *ForNode) XXX_DiscardUnknown() { + xxx_messageInfo_ForNode.DiscardUnknown(m) +} + +var xxx_messageInfo_ForNode proto.InternalMessageInfo + func (m *ForZone) Reset() { *m = ForZone{} } func (*ForZone) ProtoMessage() {} func (*ForZone) Descriptor() ([]byte, []int) { - return fileDescriptor_6555bad15de200e0, []int{6} + return fileDescriptor_6555bad15de200e0, []int{7} } func (m *ForZone) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -250,6 +278,7 @@ func init() { proto.RegisterType((*EndpointPort)(nil), "k8s.io.api.discovery.v1beta1.EndpointPort") proto.RegisterType((*EndpointSlice)(nil), "k8s.io.api.discovery.v1beta1.EndpointSlice") proto.RegisterType((*EndpointSliceList)(nil), "k8s.io.api.discovery.v1beta1.EndpointSliceList") + proto.RegisterType((*ForNode)(nil), "k8s.io.api.discovery.v1beta1.ForNode") proto.RegisterType((*ForZone)(nil), "k8s.io.api.discovery.v1beta1.ForZone") } @@ -258,61 +287,62 @@ func init() { } var fileDescriptor_6555bad15de200e0 = []byte{ - // 857 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x4f, 0x6f, 0xe4, 0x34, - 0x14, 0x9f, 0x74, 0x1a, 0x9a, 0x78, 0x5a, 0xb1, 0x6b, 0x71, 0x18, 0x95, 0x2a, 0x19, 0x05, 0x2d, + // 877 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0x4f, 0x6f, 0xe4, 0x34, + 0x1c, 0x9d, 0x74, 0x1a, 0x9a, 0x78, 0x5a, 0xb1, 0x6b, 0x71, 0x18, 0x95, 0x2a, 0x19, 0x05, 0x2d, 0x1a, 0x51, 0x48, 0x68, 0xb5, 0x42, 0x2b, 0x38, 0x35, 0xb0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, 0xd6, 0xdb, 0xd5, 0x25, 0xea, 0xcb, 0xe0, 0xf7, 0xc0, 0x26, 0x3a, 0xf1, 0x66, + 0xb0, 0x1f, 0x6e, 0x76, 0xbf, 0xc2, 0x87, 0x3a, 0x96, 0xdd, 0x20, 0x1c, 0x75, 0x5e, 0xf0, 0x25, + 0x30, 0x65, 0x37, 0xf9, 0x78, 0xa8, 0x4c, 0x3f, 0xda, 0xcc, 0x54, 0x8e, 0x21, 0xdc, 0xd3, 0xc6, + 0xa6, 0x5c, 0x71, 0x54, 0xfb, 0x78, 0x7f, 0x18, 0xe0, 0xe1, 0x4a, 0x8f, 0x9f, 0x53, 0x2e, 0xe0, + 0x0f, 0x6b, 0x7d, 0xf6, 0x37, 0xeb, 0xb3, 0x54, 0xab, 0x2e, 0xb7, 0x07, 0xb4, 0x41, 0x7a, 0x3d, + 0x3e, 0x05, 0x26, 0x15, 0x24, 0x6d, 0x3a, 0xb3, 0xe1, 0xcb, 0xa3, 0xb2, 0xeb, 0xaa, 0xf8, 0x56, + 0x3a, 0xa0, 0xda, 0xc8, 0x3b, 0x04, 0x3b, 0xfa, 0x22, 0xc0, 0xc9, 0xca, 0x61, 0xdf, 0xd5, 0xf4, + 0xde, 0x81, 0xd7, 0x64, 0x79, 0x01, 0xef, 0x27, 0x87, 0xe1, 0xcd, 0xad, 0x33, 0x78, 0x7d, 0xeb, + 0x0c, 0xde, 0xdc, 0x3a, 0x83, 0x9f, 0x2b, 0xc7, 0xb8, 0xa9, 0x1c, 0xe3, 0x75, 0xe5, 0x18, 0x6f, + 0x2a, 0xc7, 0xf8, 0xab, 0x72, 0x8c, 0x5f, 0xff, 0x76, 0x06, 0xaf, 0x0e, 0xee, 0xfa, 0x67, 0xf8, + 0x27, 0x00, 0x00, 0xff, 0xff, 0x76, 0x8e, 0x48, 0x7e, 0x52, 0x08, 0x00, 0x00, } func (m *Endpoint) Marshal() (dAtA []byte, err error) { @@ -492,6 +522,20 @@ func (m *EndpointHints) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.ForNodes) > 0 { + for iNdEx := len(m.ForNodes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ForNodes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } if len(m.ForZones) > 0 { for iNdEx := len(m.ForZones) - 1; iNdEx >= 0; iNdEx-- { { @@ -671,6 +715,34 @@ func (m *EndpointSliceList) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ForNode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ForNode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ForNode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *ForZone) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -781,6 +853,12 @@ func (m *EndpointHints) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } + if len(m.ForNodes) > 0 { + for _, e := range m.ForNodes { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -850,6 +928,17 @@ func (m *EndpointSliceList) Size() (n int) { return n } +func (m *ForNode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func (m *ForZone) Size() (n int) { if m == nil { return 0 @@ -914,8 +1003,14 @@ func (this *EndpointHints) String() string { repeatedStringForForZones += strings.Replace(strings.Replace(f.String(), "ForZone", "ForZone", 1), `&`, ``, 1) + "," } repeatedStringForForZones += "}" + repeatedStringForForNodes := "[]ForNode{" + for _, f := range this.ForNodes { + repeatedStringForForNodes += strings.Replace(strings.Replace(f.String(), "ForNode", "ForNode", 1), `&`, ``, 1) + "," + } + repeatedStringForForNodes += "}" s := strings.Join([]string{`&EndpointHints{`, `ForZones:` + repeatedStringForForZones + `,`, + `ForNodes:` + repeatedStringForForNodes + `,`, `}`, }, "") return s @@ -972,6 +1067,16 @@ func (this *EndpointSliceList) String() string { }, "") return s } +func (this *ForNode) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ForNode{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `}`, + }, "") + return s +} func (this *ForZone) String() string { if this == nil { return "nil" @@ -1546,6 +1651,40 @@ func (m *EndpointHints) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ForNodes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ForNodes = append(m.ForNodes, ForNode{}) + if err := m.ForNodes[len(m.ForNodes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -2036,6 +2175,88 @@ func (m *EndpointSliceList) Unmarshal(dAtA []byte) error { } return nil } +func (m *ForNode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ForNode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ForNode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ForZone) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/e2e/vendor/k8s.io/api/discovery/v1beta1/generated.proto b/e2e/vendor/k8s.io/api/discovery/v1beta1/generated.proto index 55828dd97..907050da1 100644 --- a/e2e/vendor/k8s.io/api/discovery/v1beta1/generated.proto +++ b/e2e/vendor/k8s.io/api/discovery/v1beta1/generated.proto @@ -114,6 +114,13 @@ message EndpointHints { // enable topology aware routing. May contain a maximum of 8 entries. // +listType=atomic repeated ForZone forZones = 1; + + // forNodes indicates the node(s) this endpoint should be consumed by when + // using topology aware routing. May contain a maximum of 8 entries. + // This is an Alpha feature and is only used when the PreferSameTrafficDistribution + // feature gate is enabled. + // +listType=atomic + repeated ForNode forNodes = 2; } // EndpointPort represents a Port used by an EndpointSlice @@ -189,6 +196,12 @@ message EndpointSliceList { repeated EndpointSlice items = 2; } +// ForNode provides information about which nodes should consume this endpoint. +message ForNode { + // name represents the name of the node. + optional string name = 1; +} + // ForZone provides information about which zones should consume this endpoint. message ForZone { // name represents the name of the zone. diff --git a/e2e/vendor/k8s.io/api/discovery/v1beta1/types.go b/e2e/vendor/k8s.io/api/discovery/v1beta1/types.go index defd8e2ce..fa9d1eae4 100644 --- a/e2e/vendor/k8s.io/api/discovery/v1beta1/types.go +++ b/e2e/vendor/k8s.io/api/discovery/v1beta1/types.go @@ -161,6 +161,13 @@ type EndpointHints struct { // enable topology aware routing. May contain a maximum of 8 entries. // +listType=atomic ForZones []ForZone `json:"forZones,omitempty" protobuf:"bytes,1,name=forZones"` + + // forNodes indicates the node(s) this endpoint should be consumed by when + // using topology aware routing. May contain a maximum of 8 entries. + // This is an Alpha feature and is only used when the PreferSameTrafficDistribution + // feature gate is enabled. + // +listType=atomic + ForNodes []ForNode `json:"forNodes,omitempty" protobuf:"bytes,2,name=forNodes"` } // ForZone provides information about which zones should consume this endpoint. @@ -169,6 +176,12 @@ type ForZone struct { Name string `json:"name" protobuf:"bytes,1,name=name"` } +// ForNode provides information about which nodes should consume this endpoint. +type ForNode struct { + // name represents the name of the node. + Name string `json:"name" protobuf:"bytes,1,name=name"` +} + // EndpointPort represents a Port used by an EndpointSlice type EndpointPort struct { // name represents the name of this port. All ports in an EndpointSlice must have a unique name. diff --git a/e2e/vendor/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go b/e2e/vendor/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go index 847d4d58e..72aa0cb9b 100644 --- a/e2e/vendor/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go +++ b/e2e/vendor/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go @@ -56,6 +56,7 @@ func (EndpointConditions) SwaggerDoc() map[string]string { var map_EndpointHints = map[string]string{ "": "EndpointHints provides hints describing how an endpoint should be consumed.", "forZones": "forZones indicates the zone(s) this endpoint should be consumed by to enable topology aware routing. May contain a maximum of 8 entries.", + "forNodes": "forNodes indicates the node(s) this endpoint should be consumed by when using topology aware routing. May contain a maximum of 8 entries. This is an Alpha feature and is only used when the PreferSameTrafficDistribution feature gate is enabled.", } func (EndpointHints) SwaggerDoc() map[string]string { @@ -96,6 +97,15 @@ func (EndpointSliceList) SwaggerDoc() map[string]string { return map_EndpointSliceList } +var map_ForNode = map[string]string{ + "": "ForNode provides information about which nodes should consume this endpoint.", + "name": "name represents the name of the node.", +} + +func (ForNode) SwaggerDoc() map[string]string { + return map_ForNode +} + var map_ForZone = map[string]string{ "": "ForZone provides information about which zones should consume this endpoint.", "name": "name represents the name of the zone.", diff --git a/e2e/vendor/k8s.io/api/discovery/v1beta1/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/api/discovery/v1beta1/zz_generated.deepcopy.go index 13b9544b0..72490d6ad 100644 --- a/e2e/vendor/k8s.io/api/discovery/v1beta1/zz_generated.deepcopy.go +++ b/e2e/vendor/k8s.io/api/discovery/v1beta1/zz_generated.deepcopy.go @@ -114,6 +114,11 @@ func (in *EndpointHints) DeepCopyInto(out *EndpointHints) { *out = make([]ForZone, len(*in)) copy(*out, *in) } + if in.ForNodes != nil { + in, out := &in.ForNodes, &out.ForNodes + *out = make([]ForNode, len(*in)) + copy(*out, *in) + } return } @@ -236,6 +241,22 @@ func (in *EndpointSliceList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ForNode) DeepCopyInto(out *ForNode) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ForNode. +func (in *ForNode) DeepCopy() *ForNode { + if in == nil { + return nil + } + out := new(ForNode) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ForZone) DeepCopyInto(out *ForZone) { *out = *in diff --git a/e2e/vendor/k8s.io/api/events/v1/doc.go b/e2e/vendor/k8s.io/api/events/v1/doc.go index 5fe700ffc..911639044 100644 --- a/e2e/vendor/k8s.io/api/events/v1/doc.go +++ b/e2e/vendor/k8s.io/api/events/v1/doc.go @@ -20,4 +20,4 @@ limitations under the License. // +k8s:prerelease-lifecycle-gen=true // +groupName=events.k8s.io -package v1 // import "k8s.io/api/events/v1" +package v1 diff --git a/e2e/vendor/k8s.io/api/events/v1beta1/doc.go b/e2e/vendor/k8s.io/api/events/v1beta1/doc.go index 46048a65b..e4864294f 100644 --- a/e2e/vendor/k8s.io/api/events/v1beta1/doc.go +++ b/e2e/vendor/k8s.io/api/events/v1beta1/doc.go @@ -21,4 +21,4 @@ limitations under the License. // +groupName=events.k8s.io -package v1beta1 // import "k8s.io/api/events/v1beta1" +package v1beta1 diff --git a/e2e/vendor/k8s.io/api/extensions/v1beta1/doc.go b/e2e/vendor/k8s.io/api/extensions/v1beta1/doc.go index c9af49d55..7770fab5d 100644 --- a/e2e/vendor/k8s.io/api/extensions/v1beta1/doc.go +++ b/e2e/vendor/k8s.io/api/extensions/v1beta1/doc.go @@ -19,4 +19,4 @@ limitations under the License. // +k8s:openapi-gen=true // +k8s:prerelease-lifecycle-gen=true -package v1beta1 // import "k8s.io/api/extensions/v1beta1" +package v1beta1 diff --git a/e2e/vendor/k8s.io/api/extensions/v1beta1/generated.pb.go b/e2e/vendor/k8s.io/api/extensions/v1beta1/generated.pb.go index 818486f39..35b9a4ff2 100644 --- a/e2e/vendor/k8s.io/api/extensions/v1beta1/generated.pb.go +++ b/e2e/vendor/k8s.io/api/extensions/v1beta1/generated.pb.go @@ -1364,185 +1364,187 @@ func init() { } var fileDescriptor_90a532284de28347 = []byte{ - // 2842 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5b, 0xcd, 0x6f, 0x24, 0x47, - 0x15, 0xdf, 0x9e, 0xf1, 0xd8, 0xe3, 0xe7, 0xb5, 0xbd, 0x5b, 0xeb, 0xac, 0x1d, 0x2f, 0xb1, 0xa3, - 0x46, 0x84, 0x4d, 0xd8, 0x9d, 0x61, 0x37, 0xc9, 0x92, 0x0f, 0x29, 0x61, 0xc7, 0xbb, 0xc9, 0x3a, - 0xb1, 0xc7, 0x93, 0x9a, 0x71, 0x82, 0x22, 0x02, 0xb4, 0x7b, 0xca, 0xe3, 0x8e, 0x7b, 0xba, 0x47, - 0xdd, 0x35, 0x66, 0x7d, 0x03, 0xc1, 0x25, 0x27, 0xb8, 0x04, 0x38, 0x22, 0x21, 0x71, 0xe5, 0xca, - 0x21, 0x44, 0x20, 0x82, 0xb4, 0x42, 0x1c, 0x22, 0x71, 0x20, 0x27, 0x8b, 0x38, 0x27, 0xc4, 0x3f, - 0x80, 0xf6, 0x84, 0xea, 0xa3, 0xab, 0xbf, 0xed, 0x1e, 0xe3, 0x58, 0x04, 0x71, 0x5a, 0x4f, 0xbd, - 0xf7, 0x7e, 0xf5, 0xaa, 0xea, 0xd5, 0x7b, 0xbf, 0xaa, 0xea, 0x85, 0xeb, 0xbb, 0xcf, 0xf9, 0x35, - 0xcb, 0xad, 0x1b, 0x03, 0xab, 0x4e, 0xee, 0x53, 0xe2, 0xf8, 0x96, 0xeb, 0xf8, 0xf5, 0xbd, 0x1b, - 0x5b, 0x84, 0x1a, 0x37, 0xea, 0x3d, 0xe2, 0x10, 0xcf, 0xa0, 0xa4, 0x5b, 0x1b, 0x78, 0x2e, 0x75, - 0xd1, 0x63, 0x42, 0xbd, 0x66, 0x0c, 0xac, 0x5a, 0xa8, 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x1a, 0x3a, 0x69, 0x28, 0x11, 0xca, 0x57, 0x24, 0xd4, 0xa5, 0xcd, 0xb4, 0x0a, - 0xce, 0xb2, 0x43, 0xdb, 0x31, 0x2a, 0x3b, 0xce, 0xd3, 0xf3, 0xcd, 0xc2, 0x1b, 0xaf, 0x30, 0x97, - 0xcd, 0xa0, 0xdb, 0xd5, 0xa2, 0x74, 0x5b, 0xff, 0x83, 0x16, 0x2d, 0x42, 0x8a, 0x02, 0x1f, 0x77, - 0xcb, 0x94, 0xb2, 0x88, 0xb0, 0x23, 0x37, 0x9b, 0xfd, 0xde, 0x1a, 0x89, 0xfd, 0x86, 0xc5, 0xf3, - 0x78, 0xfa, 0xfb, 0x47, 0x0d, 0x66, 0xef, 0x75, 0x3a, 0xad, 0x55, 0x87, 0xef, 0x96, 0x96, 0x41, - 0x77, 0x58, 0x15, 0x1d, 0x18, 0x74, 0x27, 0x59, 0x45, 0x99, 0x0c, 0x73, 0x09, 0x7a, 0x06, 0xaa, - 0xec, 0x5f, 0xe6, 0x38, 0x0f, 0xd7, 0x49, 0x9e, 0x64, 0xaa, 0x2d, 0xd9, 0xf6, 0x30, 0xf2, 0x37, - 0x56, 0x9a, 0xe8, 0x5b, 0x30, 0xc1, 0xf6, 0x36, 0x71, 0xba, 0x05, 0xc9, 0xaf, 0x74, 0xaa, 0x21, - 0x8c, 0x42, 0x3e, 0x23, 0x1b, 0x70, 0x00, 0xa7, 0xef, 0xc2, 0x5c, 0x64, 0x10, 0x78, 0x68, 0x93, - 0x37, 0x59, 0xbd, 0x42, 0x6d, 0xa8, 0xb0, 0xde, 0x59, 0x55, 0x2a, 0x17, 0xb8, 0x5e, 0x4c, 0x4c, - 0x44, 0xc8, 0x3d, 0xd8, 0x2f, 0x1f, 0x0b, 0x2c, 0x7d, 0x03, 0x26, 0x56, 0x5b, 0x0d, 0xdb, 0x15, - 0x7c, 0xc3, 0xb4, 0xba, 0x5e, 0x72, 0xa6, 0x56, 0x56, 0xef, 0x60, 0xcc, 0x25, 0x48, 0x87, 0x71, - 0x72, 0xdf, 0x24, 0x03, 0xca, 0x29, 0xc6, 0x64, 0x03, 0x58, 0x22, 0xbd, 0xcb, 0x5b, 0xb0, 0x94, - 0xe8, 0x3f, 0x29, 0xc1, 0x84, 0xec, 0xf6, 0x0c, 0xce, 0x1f, 0x6b, 0xb1, 0xf3, 0xc7, 0x53, 0xc5, - 0x96, 0x20, 0xf7, 0xf0, 0xd1, 0x49, 0x1c, 0x3e, 0xae, 0x15, 0xc4, 0x3b, 0xfa, 0xe4, 0xf1, 0x5e, - 0x09, 0x66, 0xe2, 0x8b, 0x8f, 0x9e, 0x85, 0x29, 0x96, 0x6a, 0x2d, 0x93, 0x34, 0x43, 0x86, 0xa7, - 0xae, 0x1f, 0xda, 0xa1, 0x08, 0x47, 0xf5, 0x50, 0x4f, 0x99, 0xb5, 0x5c, 0x8f, 0xca, 0x41, 0xe7, - 0x4f, 0xe9, 0x90, 0x5a, 0x76, 0x4d, 0x5c, 0xb6, 0xd7, 0x56, 0x1d, 0xba, 0xe1, 0xb5, 0xa9, 0x67, - 0x39, 0xbd, 0x54, 0x47, 0x0c, 0x0c, 0x47, 0x91, 0xd1, 0x5b, 0x2c, 0xed, 0xfb, 0xee, 0xd0, 0x33, - 0x49, 0x16, 0x7d, 0x0b, 0xa8, 0x07, 0xdb, 0x08, 0xdd, 0x35, 0xd7, 0x34, 0x6c, 0xb1, 0x38, 0x98, - 0x6c, 0x13, 0x8f, 0x38, 0x26, 0x09, 0x28, 0x93, 0x80, 0xc0, 0x0a, 0x4c, 0xff, 0xad, 0x06, 0x53, - 0x72, 0x2e, 0xce, 0x80, 0xa8, 0xbf, 0x1e, 0x27, 0xea, 0x4f, 0x14, 0xdc, 0xa1, 0xd9, 0x2c, 0xfd, - 0x77, 0x1a, 0x2c, 0x06, 0xae, 0xbb, 0x46, 0xb7, 0x61, 0xd8, 0x86, 0x63, 0x12, 0x2f, 0x88, 0xf5, - 0x45, 0x28, 0x59, 0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, - 0x6e, 0xfa, 0x2f, 0x4b, 0x30, 0x15, 0xe9, 0x62, 0xc4, 0xdc, 0xb8, 0x1d, 0x2b, 0x08, 0xe5, 0x02, - 0x37, 0x2d, 0x91, 0xbe, 0x6a, 0x41, 0x09, 0x10, 0x5f, 0x43, 0x84, 0xef, 0xdf, 0xe9, 0xca, 0xf0, - 0x12, 0xcc, 0x50, 0xc3, 0xeb, 0x11, 0xaa, 0x68, 0xbb, 0xb8, 0x64, 0x54, 0x9f, 0xe5, 0x74, 0x62, - 0x52, 0x9c, 0xd0, 0x5e, 0x7c, 0x11, 0xa6, 0x63, 0x9d, 0x8d, 0xf2, 0x31, 0x43, 0x63, 0xe5, 0xc1, - 0xa7, 0x4b, 0xe7, 0x3e, 0xfe, 0x74, 0xe9, 0xdc, 0x27, 0x9f, 0x2e, 0x9d, 0xfb, 0xc1, 0xe1, 0x92, - 0xf6, 0xe0, 0x70, 0x49, 0xfb, 0xf8, 0x70, 0x49, 0xfb, 0xe4, 0x70, 0x49, 0xfb, 0xfb, 0xe1, 0x92, - 0xf6, 0xd3, 0xcf, 0x96, 0xce, 0xbd, 0xfd, 0xd8, 0x91, 0xff, 0xb7, 0xe1, 0xdf, 0x01, 0x00, 0x00, - 0xff, 0xff, 0x5f, 0xd8, 0x14, 0x50, 0xfb, 0x30, 0x00, 0x00, + // 2875 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5b, 0xcf, 0x6f, 0x24, 0x47, + 0xf5, 0xdf, 0x9e, 0xf1, 0xd8, 0xe3, 0xe7, 0xb5, 0xbd, 0x5b, 0xeb, 0xac, 0x1d, 0xef, 0x37, 0x76, + 0xd4, 0x5f, 0x11, 0x36, 0x61, 0x77, 0x86, 0xdd, 0x24, 0x4b, 0x7e, 0x48, 0x09, 0x3b, 0xde, 0x4d, + 0xd6, 0x89, 0x7f, 0x4c, 0x6a, 0xc6, 0x09, 0x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, 0x4e, + 0x2c, 0x64, 0xab, 0xa3, 0x84, 0xec, 0x4c, 0x7e, 0xb8, 0xa2, 0x2d, 0x98, 0xef, 0x7b, 0x6e, 0xd7, + 0x23, 0xbe, 0x7f, 0x87, 0x18, 0x1d, 0xdb, 0x72, 0x48, 0x30, 0x3f, 0x82, 0x11, 0x5d, 0x39, 0x3a, + 0x5c, 0x9e, 0x6f, 0x66, 0xab, 0xe0, 0x3c, 0x5b, 0xfd, 0x67, 0x15, 0xb8, 0x90, 0xac, 0x80, 0x39, + 0x24, 0x55, 0x1b, 0x89, 0xa4, 0x5e, 0x8b, 0x6c, 0x06, 0xc1, 0xe0, 0xd5, 0xea, 0x67, 0x6c, 0x88, + 0xdb, 0x30, 0x2b, 0xb3, 0x41, 0x20, 0x94, 0x34, 0x5d, 0xad, 0xfe, 0x56, 0x5c, 0x8c, 0x93, 0xfa, + 0xe8, 0x45, 0x98, 0xf6, 0x38, 0xef, 0x0e, 0x00, 0x04, 0x77, 0x7d, 0x44, 0x02, 0x4c, 0xe3, 0xa8, + 0x10, 0xc7, 0x75, 0x19, 0x6f, 0x0d, 0xe9, 0x68, 0x00, 0x30, 0x16, 0xe7, 0xad, 0xb7, 0x93, 0x0a, + 0x38, 0x6d, 0x83, 0xd6, 0xe1, 0xd2, 0xc0, 0x49, 0x43, 0x89, 0x50, 0xbe, 0x22, 0xa1, 0x2e, 0x6d, + 0xa5, 0x55, 0x70, 0x96, 0x1d, 0x5a, 0x85, 0x4b, 0x94, 0x78, 0x3d, 0xcb, 0x31, 0xa8, 0xe5, 0x74, + 0x15, 0x9c, 0x58, 0xf9, 0x79, 0x06, 0xd5, 0x4e, 0x8b, 0x71, 0x96, 0x0d, 0xda, 0x89, 0xb1, 0xe2, + 0x71, 0x9e, 0xe9, 0x6f, 0x16, 0xde, 0xc3, 0x85, 0x69, 0x71, 0x06, 0x73, 0xaf, 0x16, 0x65, 0xee, + 0xfa, 0x1f, 0xb4, 0x68, 0x3d, 0x53, 0x6c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, 0x75, 0x02, 0x10, 0xf7, 0x95, 0xea, 0x63, 0xa1, 0x76, + 0x4c, 0x8a, 0x13, 0xda, 0x8b, 0x2f, 0xc2, 0x74, 0xac, 0xb3, 0x61, 0x3e, 0xb1, 0x68, 0xac, 0x7c, + 0xf2, 0xf9, 0xd2, 0xb9, 0x4f, 0x3f, 0x5f, 0x3a, 0xf7, 0xd9, 0xe7, 0x4b, 0xe7, 0x7e, 0x70, 0xb4, + 0xa4, 0x7d, 0x72, 0xb4, 0xa4, 0x7d, 0x7a, 0xb4, 0xa4, 0x7d, 0x76, 0xb4, 0xa4, 0xfd, 0xed, 0x68, + 0x49, 0xfb, 0xe9, 0x17, 0x4b, 0xe7, 0xde, 0x7e, 0xec, 0xd8, 0xff, 0x71, 0xf1, 0xaf, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x6a, 0x79, 0xb9, 0xab, 0x91, 0x31, 0x00, 0x00, } func (m *DaemonSet) Marshal() (dAtA []byte, err error) { @@ -2208,6 +2210,11 @@ func (m *DeploymentStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.TerminatingReplicas != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.TerminatingReplicas)) + i-- + dAtA[i] = 0x48 + } if m.CollisionCount != nil { i = encodeVarintGenerated(dAtA, i, uint64(*m.CollisionCount)) i-- @@ -3486,6 +3493,11 @@ func (m *ReplicaSetStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.TerminatingReplicas != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.TerminatingReplicas)) + i-- + dAtA[i] = 0x38 + } if len(m.Conditions) > 0 { for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { { @@ -4024,6 +4036,9 @@ func (m *DeploymentStatus) Size() (n int) { if m.CollisionCount != nil { n += 1 + sovGenerated(uint64(*m.CollisionCount)) } + if m.TerminatingReplicas != nil { + n += 1 + sovGenerated(uint64(*m.TerminatingReplicas)) + } return n } @@ -4502,6 +4517,9 @@ func (m *ReplicaSetStatus) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } + if m.TerminatingReplicas != nil { + n += 1 + sovGenerated(uint64(*m.TerminatingReplicas)) + } return n } @@ -4793,6 +4811,7 @@ func (this *DeploymentStatus) String() string { `Conditions:` + repeatedStringForConditions + `,`, `ReadyReplicas:` + fmt.Sprintf("%v", this.ReadyReplicas) + `,`, `CollisionCount:` + valueToStringGenerated(this.CollisionCount) + `,`, + `TerminatingReplicas:` + valueToStringGenerated(this.TerminatingReplicas) + `,`, `}`, }, "") return s @@ -5182,6 +5201,7 @@ func (this *ReplicaSetStatus) String() string { `ReadyReplicas:` + fmt.Sprintf("%v", this.ReadyReplicas) + `,`, `AvailableReplicas:` + fmt.Sprintf("%v", this.AvailableReplicas) + `,`, `Conditions:` + repeatedStringForConditions + `,`, + `TerminatingReplicas:` + valueToStringGenerated(this.TerminatingReplicas) + `,`, `}`, }, "") return s @@ -7567,6 +7587,26 @@ func (m *DeploymentStatus) Unmarshal(dAtA []byte) error { } } m.CollisionCount = &v + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TerminatingReplicas", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TerminatingReplicas = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -11162,6 +11202,26 @@ func (m *ReplicaSetStatus) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TerminatingReplicas", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TerminatingReplicas = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/e2e/vendor/k8s.io/api/extensions/v1beta1/generated.proto b/e2e/vendor/k8s.io/api/extensions/v1beta1/generated.proto index 9bbcaa0e2..70fcec0cc 100644 --- a/e2e/vendor/k8s.io/api/extensions/v1beta1/generated.proto +++ b/e2e/vendor/k8s.io/api/extensions/v1beta1/generated.proto @@ -320,19 +320,19 @@ message DeploymentStatus { // +optional optional int64 observedGeneration = 1; - // Total number of non-terminated pods targeted by this deployment (their labels match the selector). + // Total number of non-terminating pods targeted by this deployment (their labels match the selector). // +optional optional int32 replicas = 2; - // Total number of non-terminated pods targeted by this deployment that have the desired template spec. + // Total number of non-terminating pods targeted by this deployment that have the desired template spec. // +optional optional int32 updatedReplicas = 3; - // Total number of ready pods targeted by this deployment. + // Total number of non-terminating pods targeted by this Deployment with a Ready Condition. // +optional optional int32 readyReplicas = 7; - // Total number of available pods (ready for at least minReadySeconds) targeted by this deployment. + // Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment. // +optional optional int32 availableReplicas = 4; @@ -342,6 +342,13 @@ message DeploymentStatus { // +optional optional int32 unavailableReplicas = 5; + // Total number of terminating pods targeted by this deployment. Terminating pods have a non-null + // .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. + // + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. + // +optional + optional int32 terminatingReplicas = 9; + // Represents the latest available observations of a deployment's current state. // +patchMergeKey=type // +patchStrategy=merge @@ -863,16 +870,16 @@ message ReplicaSetList { optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; // List of ReplicaSets. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset repeated ReplicaSet items = 2; } // ReplicaSetSpec is the specification of a ReplicaSet. message ReplicaSetSpec { - // Replicas is the number of desired replicas. + // Replicas is the number of desired pods. // This is a pointer to distinguish between explicit zero and unspecified. // Defaults to 1. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset // +optional optional int32 replicas = 1; @@ -891,29 +898,36 @@ message ReplicaSetSpec { // Template is the object that describes the pod that will be created if // insufficient replicas are detected. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/#pod-template // +optional optional .k8s.io.api.core.v1.PodTemplateSpec template = 3; } // ReplicaSetStatus represents the current status of a ReplicaSet. message ReplicaSetStatus { - // Replicas is the most recently observed number of replicas. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller + // Replicas is the most recently observed number of non-terminating pods. + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset optional int32 replicas = 1; - // The number of pods that have labels matching the labels of the pod template of the replicaset. + // The number of non-terminating pods that have labels matching the labels of the pod template of the replicaset. // +optional optional int32 fullyLabeledReplicas = 2; - // The number of ready replicas for this replica set. + // The number of non-terminating pods targeted by this ReplicaSet with a Ready Condition. // +optional optional int32 readyReplicas = 4; - // The number of available replicas (ready for at least minReadySeconds) for this replica set. + // The number of available non-terminating pods (ready for at least minReadySeconds) for this replica set. // +optional optional int32 availableReplicas = 5; + // The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp + // and have not yet reached the Failed or Succeeded .status.phase. + // + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. + // +optional + optional int32 terminatingReplicas = 7; + // ObservedGeneration reflects the generation of the most recently observed ReplicaSet. // +optional optional int64 observedGeneration = 3; diff --git a/e2e/vendor/k8s.io/api/extensions/v1beta1/types.go b/e2e/vendor/k8s.io/api/extensions/v1beta1/types.go index 09f58692f..b80a7a7e1 100644 --- a/e2e/vendor/k8s.io/api/extensions/v1beta1/types.go +++ b/e2e/vendor/k8s.io/api/extensions/v1beta1/types.go @@ -245,19 +245,19 @@ type DeploymentStatus struct { // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"` - // Total number of non-terminated pods targeted by this deployment (their labels match the selector). + // Total number of non-terminating pods targeted by this deployment (their labels match the selector). // +optional Replicas int32 `json:"replicas,omitempty" protobuf:"varint,2,opt,name=replicas"` - // Total number of non-terminated pods targeted by this deployment that have the desired template spec. + // Total number of non-terminating pods targeted by this deployment that have the desired template spec. // +optional UpdatedReplicas int32 `json:"updatedReplicas,omitempty" protobuf:"varint,3,opt,name=updatedReplicas"` - // Total number of ready pods targeted by this deployment. + // Total number of non-terminating pods targeted by this Deployment with a Ready Condition. // +optional ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,7,opt,name=readyReplicas"` - // Total number of available pods (ready for at least minReadySeconds) targeted by this deployment. + // Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment. // +optional AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,4,opt,name=availableReplicas"` @@ -267,6 +267,13 @@ type DeploymentStatus struct { // +optional UnavailableReplicas int32 `json:"unavailableReplicas,omitempty" protobuf:"varint,5,opt,name=unavailableReplicas"` + // Total number of terminating pods targeted by this deployment. Terminating pods have a non-null + // .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. + // + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. + // +optional + TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty" protobuf:"varint,9,opt,name=terminatingReplicas"` + // Represents the latest available observations of a deployment's current state. // +patchMergeKey=type // +patchStrategy=merge @@ -941,16 +948,16 @@ type ReplicaSetList struct { metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // List of ReplicaSets. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset Items []ReplicaSet `json:"items" protobuf:"bytes,2,rep,name=items"` } // ReplicaSetSpec is the specification of a ReplicaSet. type ReplicaSetSpec struct { - // Replicas is the number of desired replicas. + // Replicas is the number of desired pods. // This is a pointer to distinguish between explicit zero and unspecified. // Defaults to 1. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset // +optional Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"` @@ -969,29 +976,36 @@ type ReplicaSetSpec struct { // Template is the object that describes the pod that will be created if // insufficient replicas are detected. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/#pod-template // +optional Template v1.PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,3,opt,name=template"` } // ReplicaSetStatus represents the current status of a ReplicaSet. type ReplicaSetStatus struct { - // Replicas is the most recently observed number of replicas. - // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller + // Replicas is the most recently observed number of non-terminating pods. + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset Replicas int32 `json:"replicas" protobuf:"varint,1,opt,name=replicas"` - // The number of pods that have labels matching the labels of the pod template of the replicaset. + // The number of non-terminating pods that have labels matching the labels of the pod template of the replicaset. // +optional FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty" protobuf:"varint,2,opt,name=fullyLabeledReplicas"` - // The number of ready replicas for this replica set. + // The number of non-terminating pods targeted by this ReplicaSet with a Ready Condition. // +optional ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,4,opt,name=readyReplicas"` - // The number of available replicas (ready for at least minReadySeconds) for this replica set. + // The number of available non-terminating pods (ready for at least minReadySeconds) for this replica set. // +optional AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,5,opt,name=availableReplicas"` + // The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp + // and have not yet reached the Failed or Succeeded .status.phase. + // + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. + // +optional + TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty" protobuf:"varint,7,opt,name=terminatingReplicas"` + // ObservedGeneration reflects the generation of the most recently observed ReplicaSet. // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,3,opt,name=observedGeneration"` diff --git a/e2e/vendor/k8s.io/api/extensions/v1beta1/types_swagger_doc_generated.go b/e2e/vendor/k8s.io/api/extensions/v1beta1/types_swagger_doc_generated.go index 408022c9d..923fab3aa 100644 --- a/e2e/vendor/k8s.io/api/extensions/v1beta1/types_swagger_doc_generated.go +++ b/e2e/vendor/k8s.io/api/extensions/v1beta1/types_swagger_doc_generated.go @@ -169,11 +169,12 @@ func (DeploymentSpec) SwaggerDoc() map[string]string { var map_DeploymentStatus = map[string]string{ "": "DeploymentStatus is the most recently observed status of the Deployment.", "observedGeneration": "The generation observed by the deployment controller.", - "replicas": "Total number of non-terminated pods targeted by this deployment (their labels match the selector).", - "updatedReplicas": "Total number of non-terminated pods targeted by this deployment that have the desired template spec.", - "readyReplicas": "Total number of ready pods targeted by this deployment.", - "availableReplicas": "Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.", + "replicas": "Total number of non-terminating pods targeted by this deployment (their labels match the selector).", + "updatedReplicas": "Total number of non-terminating pods targeted by this deployment that have the desired template spec.", + "readyReplicas": "Total number of non-terminating pods targeted by this Deployment with a Ready Condition.", + "availableReplicas": "Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment.", "unavailableReplicas": "Total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created.", + "terminatingReplicas": "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", "conditions": "Represents the latest available observations of a deployment's current state.", "collisionCount": "Count of hash collisions for the Deployment. The Deployment controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ReplicaSet.", } @@ -435,7 +436,7 @@ func (ReplicaSetCondition) SwaggerDoc() map[string]string { var map_ReplicaSetList = map[string]string{ "": "ReplicaSetList is a collection of ReplicaSets.", "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - "items": "List of ReplicaSets. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller", + "items": "List of ReplicaSets. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset", } func (ReplicaSetList) SwaggerDoc() map[string]string { @@ -444,10 +445,10 @@ func (ReplicaSetList) SwaggerDoc() map[string]string { var map_ReplicaSetSpec = map[string]string{ "": "ReplicaSetSpec is the specification of a ReplicaSet.", - "replicas": "Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller", + "replicas": "Replicas is the number of desired pods. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset", "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)", "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: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors", - "template": "Template is the object that describes the pod that will be created if insufficient replicas are detected. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template", + "template": "Template is the object that describes the pod that will be created if insufficient replicas are detected. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/#pod-template", } func (ReplicaSetSpec) SwaggerDoc() map[string]string { @@ -456,10 +457,11 @@ func (ReplicaSetSpec) SwaggerDoc() map[string]string { var map_ReplicaSetStatus = map[string]string{ "": "ReplicaSetStatus represents the current status of a ReplicaSet.", - "replicas": "Replicas is the most recently observed number of replicas. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller", - "fullyLabeledReplicas": "The number of pods that have labels matching the labels of the pod template of the replicaset.", - "readyReplicas": "The number of ready replicas for this replica set.", - "availableReplicas": "The number of available replicas (ready for at least minReadySeconds) for this replica set.", + "replicas": "Replicas is the most recently observed number of non-terminating pods. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset", + "fullyLabeledReplicas": "The number of non-terminating pods that have labels matching the labels of the pod template of the replicaset.", + "readyReplicas": "The number of non-terminating pods targeted by this ReplicaSet with a Ready Condition.", + "availableReplicas": "The number of available non-terminating pods (ready for at least minReadySeconds) for this replica set.", + "terminatingReplicas": "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", "observedGeneration": "ObservedGeneration reflects the generation of the most recently observed ReplicaSet.", "conditions": "Represents the latest available observations of a replica set's current state.", } diff --git a/e2e/vendor/k8s.io/api/extensions/v1beta1/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/api/extensions/v1beta1/zz_generated.deepcopy.go index 6b474ae48..2c7a8524e 100644 --- a/e2e/vendor/k8s.io/api/extensions/v1beta1/zz_generated.deepcopy.go +++ b/e2e/vendor/k8s.io/api/extensions/v1beta1/zz_generated.deepcopy.go @@ -341,6 +341,11 @@ func (in *DeploymentSpec) DeepCopy() *DeploymentSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DeploymentStatus) DeepCopyInto(out *DeploymentStatus) { *out = *in + if in.TerminatingReplicas != nil { + in, out := &in.TerminatingReplicas, &out.TerminatingReplicas + *out = new(int32) + **out = **in + } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions *out = make([]DeploymentCondition, len(*in)) @@ -1045,6 +1050,11 @@ func (in *ReplicaSetSpec) DeepCopy() *ReplicaSetSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ReplicaSetStatus) DeepCopyInto(out *ReplicaSetStatus) { *out = *in + if in.TerminatingReplicas != nil { + in, out := &in.TerminatingReplicas, &out.TerminatingReplicas + *out = new(int32) + **out = **in + } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions *out = make([]ReplicaSetCondition, len(*in)) diff --git a/e2e/vendor/k8s.io/api/flowcontrol/v1/doc.go b/e2e/vendor/k8s.io/api/flowcontrol/v1/doc.go index c9e7db158..ad5f45791 100644 --- a/e2e/vendor/k8s.io/api/flowcontrol/v1/doc.go +++ b/e2e/vendor/k8s.io/api/flowcontrol/v1/doc.go @@ -22,4 +22,4 @@ limitations under the License. // +groupName=flowcontrol.apiserver.k8s.io // Package v1 holds api types of version v1 for group "flowcontrol.apiserver.k8s.io". -package v1 // import "k8s.io/api/flowcontrol/v1" +package v1 diff --git a/e2e/vendor/k8s.io/api/flowcontrol/v1beta1/doc.go b/e2e/vendor/k8s.io/api/flowcontrol/v1beta1/doc.go index 50897b7eb..20268c1f2 100644 --- a/e2e/vendor/k8s.io/api/flowcontrol/v1beta1/doc.go +++ b/e2e/vendor/k8s.io/api/flowcontrol/v1beta1/doc.go @@ -22,4 +22,4 @@ limitations under the License. // +groupName=flowcontrol.apiserver.k8s.io // Package v1beta1 holds api types of version v1alpha1 for group "flowcontrol.apiserver.k8s.io". -package v1beta1 // import "k8s.io/api/flowcontrol/v1beta1" +package v1beta1 diff --git a/e2e/vendor/k8s.io/api/flowcontrol/v1beta2/doc.go b/e2e/vendor/k8s.io/api/flowcontrol/v1beta2/doc.go index 53b460d37..2dcad11ad 100644 --- a/e2e/vendor/k8s.io/api/flowcontrol/v1beta2/doc.go +++ b/e2e/vendor/k8s.io/api/flowcontrol/v1beta2/doc.go @@ -22,4 +22,4 @@ limitations under the License. // +groupName=flowcontrol.apiserver.k8s.io // Package v1beta2 holds api types of version v1alpha1 for group "flowcontrol.apiserver.k8s.io". -package v1beta2 // import "k8s.io/api/flowcontrol/v1beta2" +package v1beta2 diff --git a/e2e/vendor/k8s.io/api/flowcontrol/v1beta3/doc.go b/e2e/vendor/k8s.io/api/flowcontrol/v1beta3/doc.go index cd60cfef7..95f4430d3 100644 --- a/e2e/vendor/k8s.io/api/flowcontrol/v1beta3/doc.go +++ b/e2e/vendor/k8s.io/api/flowcontrol/v1beta3/doc.go @@ -22,4 +22,4 @@ limitations under the License. // +groupName=flowcontrol.apiserver.k8s.io // Package v1beta3 holds api types of version v1beta3 for group "flowcontrol.apiserver.k8s.io". -package v1beta3 // import "k8s.io/api/flowcontrol/v1beta3" +package v1beta3 diff --git a/e2e/vendor/k8s.io/api/imagepolicy/v1alpha1/doc.go b/e2e/vendor/k8s.io/api/imagepolicy/v1alpha1/doc.go index 5db6d52d4..f5fbbdbf0 100644 --- a/e2e/vendor/k8s.io/api/imagepolicy/v1alpha1/doc.go +++ b/e2e/vendor/k8s.io/api/imagepolicy/v1alpha1/doc.go @@ -20,4 +20,4 @@ limitations under the License. // +groupName=imagepolicy.k8s.io -package v1alpha1 // import "k8s.io/api/imagepolicy/v1alpha1" +package v1alpha1 diff --git a/e2e/vendor/k8s.io/api/networking/v1/doc.go b/e2e/vendor/k8s.io/api/networking/v1/doc.go index 1d13e7bab..e2093b7df 100644 --- a/e2e/vendor/k8s.io/api/networking/v1/doc.go +++ b/e2e/vendor/k8s.io/api/networking/v1/doc.go @@ -20,4 +20,4 @@ limitations under the License. // +k8s:prerelease-lifecycle-gen=true // +groupName=networking.k8s.io -package v1 // import "k8s.io/api/networking/v1" +package v1 diff --git a/e2e/vendor/k8s.io/api/networking/v1/generated.pb.go b/e2e/vendor/k8s.io/api/networking/v1/generated.pb.go index 7c023e690..062382b63 100644 --- a/e2e/vendor/k8s.io/api/networking/v1/generated.pb.go +++ b/e2e/vendor/k8s.io/api/networking/v1/generated.pb.go @@ -104,10 +104,94 @@ func (m *HTTPIngressRuleValue) XXX_DiscardUnknown() { var xxx_messageInfo_HTTPIngressRuleValue proto.InternalMessageInfo +func (m *IPAddress) Reset() { *m = IPAddress{} } +func (*IPAddress) ProtoMessage() {} +func (*IPAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_2c41434372fec1d7, []int{2} +} +func (m *IPAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IPAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *IPAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_IPAddress.Merge(m, src) +} +func (m *IPAddress) XXX_Size() int { + return m.Size() +} +func (m *IPAddress) XXX_DiscardUnknown() { + xxx_messageInfo_IPAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_IPAddress proto.InternalMessageInfo + +func (m *IPAddressList) Reset() { *m = IPAddressList{} } +func (*IPAddressList) ProtoMessage() {} +func (*IPAddressList) Descriptor() ([]byte, []int) { + return fileDescriptor_2c41434372fec1d7, []int{3} +} +func (m *IPAddressList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IPAddressList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *IPAddressList) XXX_Merge(src proto.Message) { + xxx_messageInfo_IPAddressList.Merge(m, src) +} +func (m *IPAddressList) XXX_Size() int { + return m.Size() +} +func (m *IPAddressList) XXX_DiscardUnknown() { + xxx_messageInfo_IPAddressList.DiscardUnknown(m) +} + +var xxx_messageInfo_IPAddressList proto.InternalMessageInfo + +func (m *IPAddressSpec) Reset() { *m = IPAddressSpec{} } +func (*IPAddressSpec) ProtoMessage() {} +func (*IPAddressSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_2c41434372fec1d7, []int{4} +} +func (m *IPAddressSpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IPAddressSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *IPAddressSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_IPAddressSpec.Merge(m, src) +} +func (m *IPAddressSpec) XXX_Size() int { + return m.Size() +} +func (m *IPAddressSpec) XXX_DiscardUnknown() { + xxx_messageInfo_IPAddressSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_IPAddressSpec proto.InternalMessageInfo + func (m *IPBlock) Reset() { *m = IPBlock{} } func (*IPBlock) ProtoMessage() {} func (*IPBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{2} + return fileDescriptor_2c41434372fec1d7, []int{5} } func (m *IPBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -135,7 +219,7 @@ var xxx_messageInfo_IPBlock proto.InternalMessageInfo func (m *Ingress) Reset() { *m = Ingress{} } func (*Ingress) ProtoMessage() {} func (*Ingress) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{3} + return fileDescriptor_2c41434372fec1d7, []int{6} } func (m *Ingress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -163,7 +247,7 @@ var xxx_messageInfo_Ingress proto.InternalMessageInfo func (m *IngressBackend) Reset() { *m = IngressBackend{} } func (*IngressBackend) ProtoMessage() {} func (*IngressBackend) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{4} + return fileDescriptor_2c41434372fec1d7, []int{7} } func (m *IngressBackend) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -191,7 +275,7 @@ var xxx_messageInfo_IngressBackend proto.InternalMessageInfo func (m *IngressClass) Reset() { *m = IngressClass{} } func (*IngressClass) ProtoMessage() {} func (*IngressClass) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{5} + return fileDescriptor_2c41434372fec1d7, []int{8} } func (m *IngressClass) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -219,7 +303,7 @@ var xxx_messageInfo_IngressClass proto.InternalMessageInfo func (m *IngressClassList) Reset() { *m = IngressClassList{} } func (*IngressClassList) ProtoMessage() {} func (*IngressClassList) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{6} + return fileDescriptor_2c41434372fec1d7, []int{9} } func (m *IngressClassList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -247,7 +331,7 @@ var xxx_messageInfo_IngressClassList proto.InternalMessageInfo func (m *IngressClassParametersReference) Reset() { *m = IngressClassParametersReference{} } func (*IngressClassParametersReference) ProtoMessage() {} func (*IngressClassParametersReference) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{7} + return fileDescriptor_2c41434372fec1d7, []int{10} } func (m *IngressClassParametersReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -275,7 +359,7 @@ var xxx_messageInfo_IngressClassParametersReference proto.InternalMessageInfo func (m *IngressClassSpec) Reset() { *m = IngressClassSpec{} } func (*IngressClassSpec) ProtoMessage() {} func (*IngressClassSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{8} + return fileDescriptor_2c41434372fec1d7, []int{11} } func (m *IngressClassSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -303,7 +387,7 @@ var xxx_messageInfo_IngressClassSpec proto.InternalMessageInfo func (m *IngressList) Reset() { *m = IngressList{} } func (*IngressList) ProtoMessage() {} func (*IngressList) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{9} + return fileDescriptor_2c41434372fec1d7, []int{12} } func (m *IngressList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -331,7 +415,7 @@ var xxx_messageInfo_IngressList proto.InternalMessageInfo func (m *IngressLoadBalancerIngress) Reset() { *m = IngressLoadBalancerIngress{} } func (*IngressLoadBalancerIngress) ProtoMessage() {} func (*IngressLoadBalancerIngress) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{10} + return fileDescriptor_2c41434372fec1d7, []int{13} } func (m *IngressLoadBalancerIngress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -359,7 +443,7 @@ var xxx_messageInfo_IngressLoadBalancerIngress proto.InternalMessageInfo func (m *IngressLoadBalancerStatus) Reset() { *m = IngressLoadBalancerStatus{} } func (*IngressLoadBalancerStatus) ProtoMessage() {} func (*IngressLoadBalancerStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{11} + return fileDescriptor_2c41434372fec1d7, []int{14} } func (m *IngressLoadBalancerStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -387,7 +471,7 @@ var xxx_messageInfo_IngressLoadBalancerStatus proto.InternalMessageInfo func (m *IngressPortStatus) Reset() { *m = IngressPortStatus{} } func (*IngressPortStatus) ProtoMessage() {} func (*IngressPortStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{12} + return fileDescriptor_2c41434372fec1d7, []int{15} } func (m *IngressPortStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -415,7 +499,7 @@ var xxx_messageInfo_IngressPortStatus proto.InternalMessageInfo func (m *IngressRule) Reset() { *m = IngressRule{} } func (*IngressRule) ProtoMessage() {} func (*IngressRule) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{13} + return fileDescriptor_2c41434372fec1d7, []int{16} } func (m *IngressRule) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -443,7 +527,7 @@ var xxx_messageInfo_IngressRule proto.InternalMessageInfo func (m *IngressRuleValue) Reset() { *m = IngressRuleValue{} } func (*IngressRuleValue) ProtoMessage() {} func (*IngressRuleValue) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{14} + return fileDescriptor_2c41434372fec1d7, []int{17} } func (m *IngressRuleValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -471,7 +555,7 @@ var xxx_messageInfo_IngressRuleValue proto.InternalMessageInfo func (m *IngressServiceBackend) Reset() { *m = IngressServiceBackend{} } func (*IngressServiceBackend) ProtoMessage() {} func (*IngressServiceBackend) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{15} + return fileDescriptor_2c41434372fec1d7, []int{18} } func (m *IngressServiceBackend) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -499,7 +583,7 @@ var xxx_messageInfo_IngressServiceBackend proto.InternalMessageInfo func (m *IngressSpec) Reset() { *m = IngressSpec{} } func (*IngressSpec) ProtoMessage() {} func (*IngressSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{16} + return fileDescriptor_2c41434372fec1d7, []int{19} } func (m *IngressSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -527,7 +611,7 @@ var xxx_messageInfo_IngressSpec proto.InternalMessageInfo func (m *IngressStatus) Reset() { *m = IngressStatus{} } func (*IngressStatus) ProtoMessage() {} func (*IngressStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{17} + return fileDescriptor_2c41434372fec1d7, []int{20} } func (m *IngressStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -555,7 +639,7 @@ var xxx_messageInfo_IngressStatus proto.InternalMessageInfo func (m *IngressTLS) Reset() { *m = IngressTLS{} } func (*IngressTLS) ProtoMessage() {} func (*IngressTLS) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{18} + return fileDescriptor_2c41434372fec1d7, []int{21} } func (m *IngressTLS) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -583,7 +667,7 @@ var xxx_messageInfo_IngressTLS proto.InternalMessageInfo func (m *NetworkPolicy) Reset() { *m = NetworkPolicy{} } func (*NetworkPolicy) ProtoMessage() {} func (*NetworkPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{19} + return fileDescriptor_2c41434372fec1d7, []int{22} } func (m *NetworkPolicy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -611,7 +695,7 @@ var xxx_messageInfo_NetworkPolicy proto.InternalMessageInfo func (m *NetworkPolicyEgressRule) Reset() { *m = NetworkPolicyEgressRule{} } func (*NetworkPolicyEgressRule) ProtoMessage() {} func (*NetworkPolicyEgressRule) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{20} + return fileDescriptor_2c41434372fec1d7, []int{23} } func (m *NetworkPolicyEgressRule) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -639,7 +723,7 @@ var xxx_messageInfo_NetworkPolicyEgressRule proto.InternalMessageInfo func (m *NetworkPolicyIngressRule) Reset() { *m = NetworkPolicyIngressRule{} } func (*NetworkPolicyIngressRule) ProtoMessage() {} func (*NetworkPolicyIngressRule) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{21} + return fileDescriptor_2c41434372fec1d7, []int{24} } func (m *NetworkPolicyIngressRule) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -667,7 +751,7 @@ var xxx_messageInfo_NetworkPolicyIngressRule proto.InternalMessageInfo func (m *NetworkPolicyList) Reset() { *m = NetworkPolicyList{} } func (*NetworkPolicyList) ProtoMessage() {} func (*NetworkPolicyList) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{22} + return fileDescriptor_2c41434372fec1d7, []int{25} } func (m *NetworkPolicyList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -695,7 +779,7 @@ var xxx_messageInfo_NetworkPolicyList proto.InternalMessageInfo func (m *NetworkPolicyPeer) Reset() { *m = NetworkPolicyPeer{} } func (*NetworkPolicyPeer) ProtoMessage() {} func (*NetworkPolicyPeer) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{23} + return fileDescriptor_2c41434372fec1d7, []int{26} } func (m *NetworkPolicyPeer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -723,7 +807,7 @@ var xxx_messageInfo_NetworkPolicyPeer proto.InternalMessageInfo func (m *NetworkPolicyPort) Reset() { *m = NetworkPolicyPort{} } func (*NetworkPolicyPort) ProtoMessage() {} func (*NetworkPolicyPort) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{24} + return fileDescriptor_2c41434372fec1d7, []int{27} } func (m *NetworkPolicyPort) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -751,7 +835,7 @@ var xxx_messageInfo_NetworkPolicyPort proto.InternalMessageInfo func (m *NetworkPolicySpec) Reset() { *m = NetworkPolicySpec{} } func (*NetworkPolicySpec) ProtoMessage() {} func (*NetworkPolicySpec) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{25} + return fileDescriptor_2c41434372fec1d7, []int{28} } func (m *NetworkPolicySpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -776,10 +860,38 @@ func (m *NetworkPolicySpec) XXX_DiscardUnknown() { var xxx_messageInfo_NetworkPolicySpec proto.InternalMessageInfo +func (m *ParentReference) Reset() { *m = ParentReference{} } +func (*ParentReference) ProtoMessage() {} +func (*ParentReference) Descriptor() ([]byte, []int) { + return fileDescriptor_2c41434372fec1d7, []int{29} +} +func (m *ParentReference) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ParentReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ParentReference) XXX_Merge(src proto.Message) { + xxx_messageInfo_ParentReference.Merge(m, src) +} +func (m *ParentReference) XXX_Size() int { + return m.Size() +} +func (m *ParentReference) XXX_DiscardUnknown() { + xxx_messageInfo_ParentReference.DiscardUnknown(m) +} + +var xxx_messageInfo_ParentReference proto.InternalMessageInfo + func (m *ServiceBackendPort) Reset() { *m = ServiceBackendPort{} } func (*ServiceBackendPort) ProtoMessage() {} func (*ServiceBackendPort) Descriptor() ([]byte, []int) { - return fileDescriptor_2c41434372fec1d7, []int{26} + return fileDescriptor_2c41434372fec1d7, []int{30} } func (m *ServiceBackendPort) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -804,9 +916,124 @@ func (m *ServiceBackendPort) XXX_DiscardUnknown() { var xxx_messageInfo_ServiceBackendPort proto.InternalMessageInfo +func (m *ServiceCIDR) Reset() { *m = ServiceCIDR{} } +func (*ServiceCIDR) ProtoMessage() {} +func (*ServiceCIDR) Descriptor() ([]byte, []int) { + return fileDescriptor_2c41434372fec1d7, []int{31} +} +func (m *ServiceCIDR) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ServiceCIDR) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ServiceCIDR) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceCIDR.Merge(m, src) +} +func (m *ServiceCIDR) XXX_Size() int { + return m.Size() +} +func (m *ServiceCIDR) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceCIDR.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceCIDR proto.InternalMessageInfo + +func (m *ServiceCIDRList) Reset() { *m = ServiceCIDRList{} } +func (*ServiceCIDRList) ProtoMessage() {} +func (*ServiceCIDRList) Descriptor() ([]byte, []int) { + return fileDescriptor_2c41434372fec1d7, []int{32} +} +func (m *ServiceCIDRList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ServiceCIDRList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ServiceCIDRList) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceCIDRList.Merge(m, src) +} +func (m *ServiceCIDRList) XXX_Size() int { + return m.Size() +} +func (m *ServiceCIDRList) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceCIDRList.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceCIDRList proto.InternalMessageInfo + +func (m *ServiceCIDRSpec) Reset() { *m = ServiceCIDRSpec{} } +func (*ServiceCIDRSpec) ProtoMessage() {} +func (*ServiceCIDRSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_2c41434372fec1d7, []int{33} +} +func (m *ServiceCIDRSpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ServiceCIDRSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ServiceCIDRSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceCIDRSpec.Merge(m, src) +} +func (m *ServiceCIDRSpec) XXX_Size() int { + return m.Size() +} +func (m *ServiceCIDRSpec) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceCIDRSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceCIDRSpec proto.InternalMessageInfo + +func (m *ServiceCIDRStatus) Reset() { *m = ServiceCIDRStatus{} } +func (*ServiceCIDRStatus) ProtoMessage() {} +func (*ServiceCIDRStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_2c41434372fec1d7, []int{34} +} +func (m *ServiceCIDRStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ServiceCIDRStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ServiceCIDRStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceCIDRStatus.Merge(m, src) +} +func (m *ServiceCIDRStatus) XXX_Size() int { + return m.Size() +} +func (m *ServiceCIDRStatus) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceCIDRStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceCIDRStatus proto.InternalMessageInfo + func init() { proto.RegisterType((*HTTPIngressPath)(nil), "k8s.io.api.networking.v1.HTTPIngressPath") proto.RegisterType((*HTTPIngressRuleValue)(nil), "k8s.io.api.networking.v1.HTTPIngressRuleValue") + proto.RegisterType((*IPAddress)(nil), "k8s.io.api.networking.v1.IPAddress") + proto.RegisterType((*IPAddressList)(nil), "k8s.io.api.networking.v1.IPAddressList") + proto.RegisterType((*IPAddressSpec)(nil), "k8s.io.api.networking.v1.IPAddressSpec") proto.RegisterType((*IPBlock)(nil), "k8s.io.api.networking.v1.IPBlock") proto.RegisterType((*Ingress)(nil), "k8s.io.api.networking.v1.Ingress") proto.RegisterType((*IngressBackend)(nil), "k8s.io.api.networking.v1.IngressBackend") @@ -831,7 +1058,12 @@ func init() { proto.RegisterType((*NetworkPolicyPeer)(nil), "k8s.io.api.networking.v1.NetworkPolicyPeer") proto.RegisterType((*NetworkPolicyPort)(nil), "k8s.io.api.networking.v1.NetworkPolicyPort") proto.RegisterType((*NetworkPolicySpec)(nil), "k8s.io.api.networking.v1.NetworkPolicySpec") + proto.RegisterType((*ParentReference)(nil), "k8s.io.api.networking.v1.ParentReference") proto.RegisterType((*ServiceBackendPort)(nil), "k8s.io.api.networking.v1.ServiceBackendPort") + proto.RegisterType((*ServiceCIDR)(nil), "k8s.io.api.networking.v1.ServiceCIDR") + proto.RegisterType((*ServiceCIDRList)(nil), "k8s.io.api.networking.v1.ServiceCIDRList") + proto.RegisterType((*ServiceCIDRSpec)(nil), "k8s.io.api.networking.v1.ServiceCIDRSpec") + proto.RegisterType((*ServiceCIDRStatus)(nil), "k8s.io.api.networking.v1.ServiceCIDRStatus") } func init() { @@ -839,111 +1071,125 @@ func init() { } var fileDescriptor_2c41434372fec1d7 = []byte{ - // 1652 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4b, 0x6f, 0x1b, 0x55, - 0x14, 0xce, 0x38, 0x71, 0xec, 0x1c, 0x27, 0x69, 0x72, 0x69, 0x85, 0x09, 0xc2, 0x0e, 0x23, 0xda, - 0x06, 0xda, 0xda, 0x34, 0xad, 0x10, 0x6c, 0x78, 0x4c, 0x9a, 0xa6, 0xa1, 0xa9, 0x63, 0x5d, 0x5b, - 0x45, 0x20, 0x1e, 0x9d, 0x8c, 0x6f, 0x9c, 0x69, 0xc6, 0x33, 0xa3, 0x3b, 0xd7, 0xa5, 0x95, 0x10, - 0x62, 0xc3, 0x82, 0x1d, 0x7f, 0x01, 0xf1, 0x0b, 0x10, 0x2c, 0x90, 0x10, 0x14, 0x36, 0xa8, 0xcb, - 0x4a, 0x6c, 0xba, 0xc1, 0xa2, 0xe6, 0x5f, 0x64, 0x85, 0xee, 0x63, 0x1e, 0x7e, 0xd5, 0xa6, 0xaa, - 0xb2, 0x4a, 0xee, 0x39, 0xe7, 0x7e, 0xe7, 0x71, 0xcf, 0x6b, 0x0c, 0x6b, 0x87, 0x6f, 0x06, 0x25, - 0xdb, 0x2b, 0x9b, 0xbe, 0x5d, 0x76, 0x09, 0xfb, 0xdc, 0xa3, 0x87, 0xb6, 0xdb, 0x2c, 0xdf, 0xb9, - 0x58, 0x6e, 0x12, 0x97, 0x50, 0x93, 0x91, 0x46, 0xc9, 0xa7, 0x1e, 0xf3, 0x50, 0x5e, 0x4a, 0x96, - 0x4c, 0xdf, 0x2e, 0xc5, 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xc2, 0xd4, 0xa3, 0xc7, 0x85, 0xa9, 0xaf, 0xba, 0x05, 0xed, 0x41, 0xb7, - 0xa0, 0x3d, 0xec, 0x16, 0xb4, 0x47, 0xdd, 0x82, 0xf6, 0x4f, 0xb7, 0xa0, 0x7d, 0xfb, 0x6f, 0x61, - 0xea, 0xa3, 0xfc, 0xa8, 0x5f, 0x4b, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x24, 0x03, 0xec, 0x04, - 0x48, 0x15, 0x00, 0x00, + // 1884 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xcd, 0x8f, 0x1b, 0x49, + 0x15, 0x9f, 0xf6, 0x8c, 0x67, 0xec, 0xe7, 0xf9, 0xc8, 0x14, 0x59, 0x61, 0x06, 0x61, 0x87, 0x5e, + 0xb2, 0x3b, 0x4b, 0x76, 0x6d, 0x32, 0x1b, 0x21, 0xb8, 0x00, 0xdb, 0x93, 0x6c, 0xe2, 0xcd, 0xc4, + 0xb1, 0xca, 0x56, 0x10, 0x88, 0x8f, 0xed, 0x69, 0xd7, 0x78, 0x7a, 0xa7, 0xdd, 0xd5, 0xaa, 0x2e, + 0x87, 0x44, 0x42, 0x88, 0x0b, 0x07, 0x6e, 0xf0, 0x27, 0x20, 0xfe, 0x02, 0x04, 0xd2, 0xae, 0xb4, + 0x82, 0x85, 0x0b, 0xca, 0x71, 0x25, 0x2e, 0x7b, 0xc1, 0x22, 0xe6, 0xbf, 0xc8, 0x09, 0xd5, 0x47, + 0x7f, 0xd9, 0xee, 0xb1, 0x89, 0x22, 0x9f, 0xc6, 0xfd, 0xde, 0xab, 0xdf, 0x7b, 0xf5, 0xea, 0x7d, + 0x55, 0x0d, 0x1c, 0x5e, 0x7c, 0x27, 0x6c, 0xb8, 0xb4, 0x69, 0x07, 0x6e, 0xd3, 0x27, 0xfc, 0x17, + 0x94, 0x5d, 0xb8, 0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 0xaf, 0xa0, 0x05, 0x7d, 0x90, 0x6d, 0x41, 0xd7, 0x97, 0xda, 0x45, + 0x4e, 0x03, 0x3a, 0xca, 0x18, 0x2f, 0xab, 0x4c, 0x1d, 0x8a, 0x8e, 0xdb, 0x67, 0x99, 0x11, 0x4f, + 0x30, 0x43, 0xac, 0xe8, 0xe6, 0x13, 0xd8, 0x9f, 0x71, 0x0f, 0x72, 0xe4, 0xab, 0x45, 0xdf, 0xe5, + 0x2e, 0xf5, 0xa3, 0x89, 0xa1, 0xb9, 0xdc, 0xa6, 0x8f, 0xa3, 0x75, 0x99, 0x67, 0x0e, 0x0d, 0x85, + 0x53, 0xb0, 0xd6, 0xf7, 0x9e, 0x3d, 0xaf, 0xad, 0x7d, 0xfe, 0xbc, 0xb6, 0xf6, 0xc5, 0xf3, 0xda, + 0xda, 0xaf, 0x27, 0x35, 0xe3, 0xd9, 0xa4, 0x66, 0x7c, 0x3e, 0xa9, 0x19, 0x5f, 0x4c, 0x6a, 0xc6, + 0x7f, 0x26, 0x35, 0xe3, 0x77, 0xff, 0xad, 0xad, 0xfd, 0xb8, 0x9a, 0xf7, 0x5f, 0xa4, 0xff, 0x05, + 0x00, 0x00, 0xff, 0xff, 0xb5, 0x6b, 0x8c, 0x52, 0x60, 0x1a, 0x00, 0x00, } func (m *HTTPIngressPath) Marshal() (dAtA []byte, err error) { @@ -1028,6 +1274,131 @@ func (m *HTTPIngressRuleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *IPAddress) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IPAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IPAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *IPAddressList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IPAddressList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IPAddressList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *IPAddressSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IPAddressSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IPAddressSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ParentRef != nil { + { + size, err := m.ParentRef.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *IPBlock) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2137,6 +2508,49 @@ func (m *NetworkPolicySpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ParentReference) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ParentReference) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ParentReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x22 + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0x1a + i -= len(m.Resource) + copy(dAtA[i:], m.Resource) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Resource))) + i-- + dAtA[i] = 0x12 + i -= len(m.Group) + copy(dAtA[i:], m.Group) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Group))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *ServiceBackendPort) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2168,6 +2582,175 @@ func (m *ServiceBackendPort) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ServiceCIDR) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ServiceCIDR) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceCIDR) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ServiceCIDRList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ServiceCIDRList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceCIDRList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ServiceCIDRSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ServiceCIDRSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceCIDRSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CIDRs) > 0 { + for iNdEx := len(m.CIDRs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CIDRs[iNdEx]) + copy(dAtA[i:], m.CIDRs[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.CIDRs[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ServiceCIDRStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ServiceCIDRStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceCIDRStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Conditions) > 0 { + for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { offset -= sovGenerated(v) base := offset @@ -2211,6 +2794,49 @@ func (m *HTTPIngressRuleValue) Size() (n int) { return n } +func (m *IPAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *IPAddressList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *IPAddressSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParentRef != nil { + l = m.ParentRef.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + func (m *IPBlock) Size() (n int) { if m == nil { return 0 @@ -2635,6 +3261,23 @@ func (m *NetworkPolicySpec) Size() (n int) { return n } +func (m *ParentReference) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Group) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Resource) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Namespace) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func (m *ServiceBackendPort) Size() (n int) { if m == nil { return 0 @@ -2647,6 +3290,68 @@ func (m *ServiceBackendPort) Size() (n int) { return n } +func (m *ServiceCIDR) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *ServiceCIDRList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *ServiceCIDRSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.CIDRs) > 0 { + for _, s := range m.CIDRs { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *ServiceCIDRStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Conditions) > 0 { + for _, e := range m.Conditions { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + func sovGenerated(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2680,6 +3385,43 @@ func (this *HTTPIngressRuleValue) String() string { }, "") return s } +func (this *IPAddress) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&IPAddress{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "IPAddressSpec", "IPAddressSpec", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *IPAddressList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]IPAddress{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "IPAddress", "IPAddress", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&IPAddressList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *IPAddressSpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&IPAddressSpec{`, + `ParentRef:` + strings.Replace(this.ParentRef.String(), "ParentReference", "ParentReference", 1) + `,`, + `}`, + }, "") + return s +} func (this *IPBlock) String() string { if this == nil { return "nil" @@ -3018,6 +3760,19 @@ func (this *NetworkPolicySpec) String() string { }, "") return s } +func (this *ParentReference) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ParentReference{`, + `Group:` + fmt.Sprintf("%v", this.Group) + `,`, + `Resource:` + fmt.Sprintf("%v", this.Resource) + `,`, + `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `}`, + }, "") + return s +} func (this *ServiceBackendPort) String() string { if this == nil { return "nil" @@ -3029,6 +3784,59 @@ func (this *ServiceBackendPort) String() string { }, "") return s } +func (this *ServiceCIDR) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ServiceCIDR{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ServiceCIDRSpec", "ServiceCIDRSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "ServiceCIDRStatus", "ServiceCIDRStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *ServiceCIDRList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]ServiceCIDR{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "ServiceCIDR", "ServiceCIDR", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&ServiceCIDRList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *ServiceCIDRSpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ServiceCIDRSpec{`, + `CIDRs:` + fmt.Sprintf("%v", this.CIDRs) + `,`, + `}`, + }, "") + return s +} +func (this *ServiceCIDRStatus) String() string { + if this == nil { + return "nil" + } + repeatedStringForConditions := "[]Condition{" + for _, f := range this.Conditions { + repeatedStringForConditions += fmt.Sprintf("%v", f) + "," + } + repeatedStringForConditions += "}" + s := strings.Join([]string{`&ServiceCIDRStatus{`, + `Conditions:` + repeatedStringForConditions + `,`, + `}`, + }, "") + return s +} func valueToStringGenerated(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -3269,6 +4077,325 @@ func (m *HTTPIngressRuleValue) Unmarshal(dAtA []byte) error { } return nil } +func (m *IPAddress) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IPAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IPAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IPAddressList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IPAddressList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IPAddressList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, IPAddress{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IPAddressSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IPAddressSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IPAddressSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParentRef", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ParentRef == nil { + m.ParentRef = &ParentReference{} + } + if err := m.ParentRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *IPBlock) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6350,6 +7477,184 @@ func (m *NetworkPolicySpec) Unmarshal(dAtA []byte) error { } return nil } +func (m *ParentReference) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ParentReference: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ParentReference: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Group = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resource = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Namespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ServiceBackendPort) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6451,6 +7756,438 @@ func (m *ServiceBackendPort) Unmarshal(dAtA []byte) error { } return nil } +func (m *ServiceCIDR) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ServiceCIDR: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServiceCIDR: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ServiceCIDRList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ServiceCIDRList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServiceCIDRList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, ServiceCIDR{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ServiceCIDRSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ServiceCIDRSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServiceCIDRSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CIDRs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CIDRs = append(m.CIDRs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ServiceCIDRStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ServiceCIDRStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServiceCIDRStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Conditions = append(m.Conditions, v1.Condition{}) + if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipGenerated(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/e2e/vendor/k8s.io/api/networking/v1/generated.proto b/e2e/vendor/k8s.io/api/networking/v1/generated.proto index c72fdc8f3..e3e3e9215 100644 --- a/e2e/vendor/k8s.io/api/networking/v1/generated.proto +++ b/e2e/vendor/k8s.io/api/networking/v1/generated.proto @@ -72,6 +72,44 @@ message HTTPIngressRuleValue { repeated HTTPIngressPath paths = 1; } +// IPAddress represents a single IP of a single IP Family. The object is designed to be used by APIs +// that operate on IP addresses. The object is used by the Service core API for allocation of IP addresses. +// An IP address can be represented in different formats, to guarantee the uniqueness of the IP, +// the name of the object is the IP address in canonical format, four decimal digits separated +// by dots suppressing leading zeros for IPv4 and the representation defined by RFC 5952 for IPv6. +// Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 +// Invalid: 10.01.2.3 or 2001:db8:0:0:0::1 +message IPAddress { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // spec is the desired state of the IPAddress. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional + optional IPAddressSpec spec = 2; +} + +// IPAddressList contains a list of IPAddress. +message IPAddressList { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // items is the list of IPAddresses. + repeated IPAddress items = 2; +} + +// IPAddressSpec describe the attributes in an IP Address. +message IPAddressSpec { + // ParentRef references the resource that an IPAddress is attached to. + // An IPAddress must reference a parent object. + // +required + optional ParentReference parentRef = 1; +} + // IPBlock describes a particular CIDR (Ex. "192.168.1.0/24","2001:db8::/64") that is allowed // to the pods matched by a NetworkPolicySpec's podSelector. The except entry describes CIDRs // that should not be included within this rule. @@ -540,6 +578,25 @@ message NetworkPolicySpec { repeated string policyTypes = 4; } +// ParentReference describes a reference to a parent object. +message ParentReference { + // Group is the group of the object being referenced. + // +optional + optional string group = 1; + + // Resource is the resource of the object being referenced. + // +required + optional string resource = 2; + + // Namespace is the namespace of the object being referenced. + // +optional + optional string namespace = 3; + + // Name is the name of the object being referenced. + // +required + optional string name = 4; +} + // ServiceBackendPort is the service port being referenced. // +structType=atomic message ServiceBackendPort { @@ -554,3 +611,55 @@ message ServiceBackendPort { optional int32 number = 2; } +// ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). +// This range is used to allocate ClusterIPs to Service objects. +message ServiceCIDR { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // spec is the desired state of the ServiceCIDR. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional + optional ServiceCIDRSpec spec = 2; + + // status represents the current state of the ServiceCIDR. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional + optional ServiceCIDRStatus status = 3; +} + +// ServiceCIDRList contains a list of ServiceCIDR objects. +message ServiceCIDRList { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // items is the list of ServiceCIDRs. + repeated ServiceCIDR items = 2; +} + +// ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services. +message ServiceCIDRSpec { + // CIDRs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64") + // from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. + // This field is immutable. + // +optional + // +listType=atomic + repeated string cidrs = 1; +} + +// ServiceCIDRStatus describes the current state of the ServiceCIDR. +message ServiceCIDRStatus { + // conditions holds an array of metav1.Condition that describe the state of the ServiceCIDR. + // Current service state + // +optional + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1; +} + diff --git a/e2e/vendor/k8s.io/api/networking/v1/register.go b/e2e/vendor/k8s.io/api/networking/v1/register.go index a200d5437..b9bdcb78c 100644 --- a/e2e/vendor/k8s.io/api/networking/v1/register.go +++ b/e2e/vendor/k8s.io/api/networking/v1/register.go @@ -50,6 +50,10 @@ func addKnownTypes(scheme *runtime.Scheme) error { &IngressClassList{}, &NetworkPolicy{}, &NetworkPolicyList{}, + &IPAddress{}, + &IPAddressList{}, + &ServiceCIDR{}, + &ServiceCIDRList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) diff --git a/e2e/vendor/k8s.io/api/networking/v1/types.go b/e2e/vendor/k8s.io/api/networking/v1/types.go index d75e27558..216647cee 100644 --- a/e2e/vendor/k8s.io/api/networking/v1/types.go +++ b/e2e/vendor/k8s.io/api/networking/v1/types.go @@ -635,3 +635,133 @@ type IngressClassList struct { // items is the list of IngressClasses. Items []IngressClass `json:"items" protobuf:"bytes,2,rep,name=items"` } + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.33 + +// IPAddress represents a single IP of a single IP Family. The object is designed to be used by APIs +// that operate on IP addresses. The object is used by the Service core API for allocation of IP addresses. +// An IP address can be represented in different formats, to guarantee the uniqueness of the IP, +// the name of the object is the IP address in canonical format, four decimal digits separated +// by dots suppressing leading zeros for IPv4 and the representation defined by RFC 5952 for IPv6. +// Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 +// Invalid: 10.01.2.3 or 2001:db8:0:0:0::1 +type IPAddress struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // spec is the desired state of the IPAddress. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional + Spec IPAddressSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` +} + +// IPAddressSpec describe the attributes in an IP Address. +type IPAddressSpec struct { + // ParentRef references the resource that an IPAddress is attached to. + // An IPAddress must reference a parent object. + // +required + ParentRef *ParentReference `json:"parentRef,omitempty" protobuf:"bytes,1,opt,name=parentRef"` +} + +// ParentReference describes a reference to a parent object. +type ParentReference struct { + // Group is the group of the object being referenced. + // +optional + Group string `json:"group,omitempty" protobuf:"bytes,1,opt,name=group"` + // Resource is the resource of the object being referenced. + // +required + Resource string `json:"resource,omitempty" protobuf:"bytes,2,opt,name=resource"` + // Namespace is the namespace of the object being referenced. + // +optional + Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"` + // Name is the name of the object being referenced. + // +required + Name string `json:"name,omitempty" protobuf:"bytes,4,opt,name=name"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.33 + +// IPAddressList contains a list of IPAddress. +type IPAddressList struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // items is the list of IPAddresses. + Items []IPAddress `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.33 + +// ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). +// This range is used to allocate ClusterIPs to Service objects. +type ServiceCIDR struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // spec is the desired state of the ServiceCIDR. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional + Spec ServiceCIDRSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + // status represents the current state of the ServiceCIDR. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional + Status ServiceCIDRStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services. +type ServiceCIDRSpec struct { + // CIDRs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64") + // from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. + // This field is immutable. + // +optional + // +listType=atomic + CIDRs []string `json:"cidrs,omitempty" protobuf:"bytes,1,opt,name=cidrs"` +} + +const ( + // ServiceCIDRConditionReady represents status of a ServiceCIDR that is ready to be used by the + // apiserver to allocate ClusterIPs for Services. + ServiceCIDRConditionReady = "Ready" + // ServiceCIDRReasonTerminating represents a reason where a ServiceCIDR is not ready because it is + // being deleted. + ServiceCIDRReasonTerminating = "Terminating" +) + +// ServiceCIDRStatus describes the current state of the ServiceCIDR. +type ServiceCIDRStatus struct { + // conditions holds an array of metav1.Condition that describe the state of the ServiceCIDR. + // Current service state + // +optional + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.33 + +// ServiceCIDRList contains a list of ServiceCIDR objects. +type ServiceCIDRList struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // items is the list of ServiceCIDRs. + Items []ServiceCIDR `json:"items" protobuf:"bytes,2,rep,name=items"` +} diff --git a/e2e/vendor/k8s.io/api/networking/v1/types_swagger_doc_generated.go b/e2e/vendor/k8s.io/api/networking/v1/types_swagger_doc_generated.go index ff080540d..0e294848b 100644 --- a/e2e/vendor/k8s.io/api/networking/v1/types_swagger_doc_generated.go +++ b/e2e/vendor/k8s.io/api/networking/v1/types_swagger_doc_generated.go @@ -47,6 +47,35 @@ func (HTTPIngressRuleValue) SwaggerDoc() map[string]string { return map_HTTPIngressRuleValue } +var map_IPAddress = map[string]string{ + "": "IPAddress represents a single IP of a single IP Family. The object is designed to be used by APIs that operate on IP addresses. The object is used by the Service core API for allocation of IP addresses. An IP address can be represented in different formats, to guarantee the uniqueness of the IP, the name of the object is the IP address in canonical format, four decimal digits separated by dots suppressing leading zeros for IPv4 and the representation defined by RFC 5952 for IPv6. Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 Invalid: 10.01.2.3 or 2001:db8:0:0:0::1", + "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec is the desired state of the IPAddress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", +} + +func (IPAddress) SwaggerDoc() map[string]string { + return map_IPAddress +} + +var map_IPAddressList = map[string]string{ + "": "IPAddressList contains a list of IPAddress.", + "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "items": "items is the list of IPAddresses.", +} + +func (IPAddressList) SwaggerDoc() map[string]string { + return map_IPAddressList +} + +var map_IPAddressSpec = map[string]string{ + "": "IPAddressSpec describe the attributes in an IP Address.", + "parentRef": "ParentRef references the resource that an IPAddress is attached to. An IPAddress must reference a parent object.", +} + +func (IPAddressSpec) SwaggerDoc() map[string]string { + return map_IPAddressSpec +} + var map_IPBlock = map[string]string{ "": "IPBlock describes a particular CIDR (Ex. \"192.168.1.0/24\",\"2001:db8::/64\") that is allowed to the pods matched by a NetworkPolicySpec's podSelector. The except entry describes CIDRs that should not be included within this rule.", "cidr": "cidr is a string representing the IPBlock Valid examples are \"192.168.1.0/24\" or \"2001:db8::/64\"", @@ -294,6 +323,18 @@ func (NetworkPolicySpec) SwaggerDoc() map[string]string { return map_NetworkPolicySpec } +var map_ParentReference = map[string]string{ + "": "ParentReference describes a reference to a parent object.", + "group": "Group is the group of the object being referenced.", + "resource": "Resource is the resource of the object being referenced.", + "namespace": "Namespace is the namespace of the object being referenced.", + "name": "Name is the name of the object being referenced.", +} + +func (ParentReference) SwaggerDoc() map[string]string { + return map_ParentReference +} + var map_ServiceBackendPort = map[string]string{ "": "ServiceBackendPort is the service port being referenced.", "name": "name is the name of the port on the Service. This is a mutually exclusive setting with \"Number\".", @@ -304,4 +345,43 @@ func (ServiceBackendPort) SwaggerDoc() map[string]string { return map_ServiceBackendPort } +var map_ServiceCIDR = map[string]string{ + "": "ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). This range is used to allocate ClusterIPs to Service objects.", + "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec is the desired state of the ServiceCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", + "status": "status represents the current state of the ServiceCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", +} + +func (ServiceCIDR) SwaggerDoc() map[string]string { + return map_ServiceCIDR +} + +var map_ServiceCIDRList = map[string]string{ + "": "ServiceCIDRList contains a list of ServiceCIDR objects.", + "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "items": "items is the list of ServiceCIDRs.", +} + +func (ServiceCIDRList) SwaggerDoc() map[string]string { + return map_ServiceCIDRList +} + +var map_ServiceCIDRSpec = map[string]string{ + "": "ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services.", + "cidrs": "CIDRs defines the IP blocks in CIDR notation (e.g. \"192.168.0.0/24\" or \"2001:db8::/64\") from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. This field is immutable.", +} + +func (ServiceCIDRSpec) SwaggerDoc() map[string]string { + return map_ServiceCIDRSpec +} + +var map_ServiceCIDRStatus = map[string]string{ + "": "ServiceCIDRStatus describes the current state of the ServiceCIDR.", + "conditions": "conditions holds an array of metav1.Condition that describe the state of the ServiceCIDR. Current service state", +} + +func (ServiceCIDRStatus) SwaggerDoc() map[string]string { + return map_ServiceCIDRStatus +} + // AUTO-GENERATED FUNCTIONS END HERE diff --git a/e2e/vendor/k8s.io/api/networking/v1/well_known_labels.go b/e2e/vendor/k8s.io/api/networking/v1/well_known_labels.go new file mode 100644 index 000000000..28e2e8f3f --- /dev/null +++ b/e2e/vendor/k8s.io/api/networking/v1/well_known_labels.go @@ -0,0 +1,33 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +const ( + + // TODO: Use IPFamily as field with a field selector,And the value is set based on + // the name at create time and immutable. + // LabelIPAddressFamily is used to indicate the IP family of a Kubernetes IPAddress. + // This label simplify dual-stack client operations allowing to obtain the list of + // IP addresses filtered by family. + LabelIPAddressFamily = "ipaddress.kubernetes.io/ip-family" + // LabelManagedBy is used to indicate the controller or entity that manages + // an IPAddress. This label aims to enable different IPAddress + // objects to be managed by different controllers or entities within the + // same cluster. It is highly recommended to configure this label for all + // IPAddress objects. + LabelManagedBy = "ipaddress.kubernetes.io/managed-by" +) diff --git a/e2e/vendor/k8s.io/api/networking/v1/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/api/networking/v1/zz_generated.deepcopy.go index 540873833..9ce6435a4 100644 --- a/e2e/vendor/k8s.io/api/networking/v1/zz_generated.deepcopy.go +++ b/e2e/vendor/k8s.io/api/networking/v1/zz_generated.deepcopy.go @@ -73,6 +73,87 @@ func (in *HTTPIngressRuleValue) DeepCopy() *HTTPIngressRuleValue { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPAddress) DeepCopyInto(out *IPAddress) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddress. +func (in *IPAddress) DeepCopy() *IPAddress { + if in == nil { + return nil + } + out := new(IPAddress) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IPAddress) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPAddressList) DeepCopyInto(out *IPAddressList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]IPAddress, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressList. +func (in *IPAddressList) DeepCopy() *IPAddressList { + if in == nil { + return nil + } + out := new(IPAddressList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IPAddressList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPAddressSpec) DeepCopyInto(out *IPAddressSpec) { + *out = *in + if in.ParentRef != nil { + in, out := &in.ParentRef, &out.ParentRef + *out = new(ParentReference) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressSpec. +func (in *IPAddressSpec) DeepCopy() *IPAddressSpec { + if in == nil { + return nil + } + out := new(IPAddressSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IPBlock) DeepCopyInto(out *IPBlock) { *out = *in @@ -711,6 +792,22 @@ func (in *NetworkPolicySpec) DeepCopy() *NetworkPolicySpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ParentReference) DeepCopyInto(out *ParentReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ParentReference. +func (in *ParentReference) DeepCopy() *ParentReference { + if in == nil { + return nil + } + out := new(ParentReference) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ServiceBackendPort) DeepCopyInto(out *ServiceBackendPort) { *out = *in @@ -726,3 +823,108 @@ func (in *ServiceBackendPort) DeepCopy() *ServiceBackendPort { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceCIDR) DeepCopyInto(out *ServiceCIDR) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCIDR. +func (in *ServiceCIDR) DeepCopy() *ServiceCIDR { + if in == nil { + return nil + } + out := new(ServiceCIDR) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceCIDR) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceCIDRList) DeepCopyInto(out *ServiceCIDRList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceCIDR, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCIDRList. +func (in *ServiceCIDRList) DeepCopy() *ServiceCIDRList { + if in == nil { + return nil + } + out := new(ServiceCIDRList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceCIDRList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceCIDRSpec) DeepCopyInto(out *ServiceCIDRSpec) { + *out = *in + if in.CIDRs != nil { + in, out := &in.CIDRs, &out.CIDRs + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCIDRSpec. +func (in *ServiceCIDRSpec) DeepCopy() *ServiceCIDRSpec { + if in == nil { + return nil + } + out := new(ServiceCIDRSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceCIDRStatus) DeepCopyInto(out *ServiceCIDRStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCIDRStatus. +func (in *ServiceCIDRStatus) DeepCopy() *ServiceCIDRStatus { + if in == nil { + return nil + } + out := new(ServiceCIDRStatus) + in.DeepCopyInto(out) + return out +} diff --git a/e2e/vendor/k8s.io/api/networking/v1/zz_generated.prerelease-lifecycle.go b/e2e/vendor/k8s.io/api/networking/v1/zz_generated.prerelease-lifecycle.go index 21e8c671a..6894d8c53 100644 --- a/e2e/vendor/k8s.io/api/networking/v1/zz_generated.prerelease-lifecycle.go +++ b/e2e/vendor/k8s.io/api/networking/v1/zz_generated.prerelease-lifecycle.go @@ -21,6 +21,18 @@ limitations under the License. package v1 +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *IPAddress) APILifecycleIntroduced() (major, minor int) { + return 1, 33 +} + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *IPAddressList) APILifecycleIntroduced() (major, minor int) { + return 1, 33 +} + // APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. func (in *Ingress) APILifecycleIntroduced() (major, minor int) { @@ -56,3 +68,15 @@ func (in *NetworkPolicy) APILifecycleIntroduced() (major, minor int) { func (in *NetworkPolicyList) APILifecycleIntroduced() (major, minor int) { return 1, 19 } + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *ServiceCIDR) APILifecycleIntroduced() (major, minor int) { + return 1, 33 +} + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *ServiceCIDRList) APILifecycleIntroduced() (major, minor int) { + return 1, 33 +} diff --git a/e2e/vendor/k8s.io/api/networking/v1alpha1/doc.go b/e2e/vendor/k8s.io/api/networking/v1alpha1/doc.go index 3827b0418..55264ae70 100644 --- a/e2e/vendor/k8s.io/api/networking/v1alpha1/doc.go +++ b/e2e/vendor/k8s.io/api/networking/v1alpha1/doc.go @@ -20,4 +20,4 @@ limitations under the License. // +k8s:prerelease-lifecycle-gen=true // +groupName=networking.k8s.io -package v1alpha1 // import "k8s.io/api/networking/v1alpha1" +package v1alpha1 diff --git a/e2e/vendor/k8s.io/api/networking/v1beta1/doc.go b/e2e/vendor/k8s.io/api/networking/v1beta1/doc.go index fa6d01cea..c5a03e04e 100644 --- a/e2e/vendor/k8s.io/api/networking/v1beta1/doc.go +++ b/e2e/vendor/k8s.io/api/networking/v1beta1/doc.go @@ -20,4 +20,4 @@ limitations under the License. // +k8s:prerelease-lifecycle-gen=true // +groupName=networking.k8s.io -package v1beta1 // import "k8s.io/api/networking/v1beta1" +package v1beta1 diff --git a/e2e/vendor/k8s.io/api/node/v1/doc.go b/e2e/vendor/k8s.io/api/node/v1/doc.go index 57ca52445..3239af703 100644 --- a/e2e/vendor/k8s.io/api/node/v1/doc.go +++ b/e2e/vendor/k8s.io/api/node/v1/doc.go @@ -20,4 +20,4 @@ limitations under the License. // +k8s:prerelease-lifecycle-gen=true // +groupName=node.k8s.io -package v1 // import "k8s.io/api/node/v1" +package v1 diff --git a/e2e/vendor/k8s.io/api/node/v1alpha1/doc.go b/e2e/vendor/k8s.io/api/node/v1alpha1/doc.go index dfe99540b..2f3d46ac2 100644 --- a/e2e/vendor/k8s.io/api/node/v1alpha1/doc.go +++ b/e2e/vendor/k8s.io/api/node/v1alpha1/doc.go @@ -20,4 +20,4 @@ limitations under the License. // +groupName=node.k8s.io -package v1alpha1 // import "k8s.io/api/node/v1alpha1" +package v1alpha1 diff --git a/e2e/vendor/k8s.io/api/node/v1beta1/doc.go b/e2e/vendor/k8s.io/api/node/v1beta1/doc.go index c76ba89c4..7b47c8df6 100644 --- a/e2e/vendor/k8s.io/api/node/v1beta1/doc.go +++ b/e2e/vendor/k8s.io/api/node/v1beta1/doc.go @@ -21,4 +21,4 @@ limitations under the License. // +groupName=node.k8s.io -package v1beta1 // import "k8s.io/api/node/v1beta1" +package v1beta1 diff --git a/e2e/vendor/k8s.io/api/policy/v1/doc.go b/e2e/vendor/k8s.io/api/policy/v1/doc.go index c51e02685..ff47e7fd4 100644 --- a/e2e/vendor/k8s.io/api/policy/v1/doc.go +++ b/e2e/vendor/k8s.io/api/policy/v1/doc.go @@ -22,4 +22,4 @@ limitations under the License. // Package policy is for any kind of policy object. Suitable examples, even if // they aren't all here, are PodDisruptionBudget, // NetworkPolicy, etc. -package v1 // import "k8s.io/api/policy/v1" +package v1 diff --git a/e2e/vendor/k8s.io/api/policy/v1/generated.proto b/e2e/vendor/k8s.io/api/policy/v1/generated.proto index 57128e811..953489072 100644 --- a/e2e/vendor/k8s.io/api/policy/v1/generated.proto +++ b/e2e/vendor/k8s.io/api/policy/v1/generated.proto @@ -115,9 +115,6 @@ message PodDisruptionBudgetSpec { // Additional policies may be added in the future. // Clients making eviction decisions should disallow eviction of unhealthy pods // if they encounter an unrecognized policy in this field. - // - // This field is beta-level. The eviction API uses this field when - // the feature gate PDBUnhealthyPodEvictionPolicy is enabled (enabled by default). // +optional optional string unhealthyPodEvictionPolicy = 4; } diff --git a/e2e/vendor/k8s.io/api/policy/v1/types.go b/e2e/vendor/k8s.io/api/policy/v1/types.go index f05367ebe..4e7436789 100644 --- a/e2e/vendor/k8s.io/api/policy/v1/types.go +++ b/e2e/vendor/k8s.io/api/policy/v1/types.go @@ -70,9 +70,6 @@ type PodDisruptionBudgetSpec struct { // Additional policies may be added in the future. // Clients making eviction decisions should disallow eviction of unhealthy pods // if they encounter an unrecognized policy in this field. - // - // This field is beta-level. The eviction API uses this field when - // the feature gate PDBUnhealthyPodEvictionPolicy is enabled (enabled by default). // +optional UnhealthyPodEvictionPolicy *UnhealthyPodEvictionPolicyType `json:"unhealthyPodEvictionPolicy,omitempty" protobuf:"bytes,4,opt,name=unhealthyPodEvictionPolicy"` } diff --git a/e2e/vendor/k8s.io/api/policy/v1/types_swagger_doc_generated.go b/e2e/vendor/k8s.io/api/policy/v1/types_swagger_doc_generated.go index 799b0794a..9b2f5b945 100644 --- a/e2e/vendor/k8s.io/api/policy/v1/types_swagger_doc_generated.go +++ b/e2e/vendor/k8s.io/api/policy/v1/types_swagger_doc_generated.go @@ -63,7 +63,7 @@ var map_PodDisruptionBudgetSpec = map[string]string{ "minAvailable": "An eviction is allowed if at least \"minAvailable\" pods selected by \"selector\" will still be available after the eviction, i.e. even in the absence of the evicted pod. So for example you can prevent all voluntary evictions by specifying \"100%\".", "selector": "Label query over pods whose evictions are managed by the disruption budget. A null selector will match no pods, while an empty ({}) selector will select all pods within the namespace.", "maxUnavailable": "An eviction is allowed if at most \"maxUnavailable\" pods selected by \"selector\" are unavailable after the eviction, i.e. even in absence of the evicted pod. For example, one can prevent all voluntary evictions by specifying 0. This is a mutually exclusive setting with \"minAvailable\".", - "unhealthyPodEvictionPolicy": "UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods should be considered for eviction. Current implementation considers healthy pods, as pods that have status.conditions item with type=\"Ready\",status=\"True\".\n\nValid policies are IfHealthyBudget and AlwaysAllow. If no policy is specified, the default behavior will be used, which corresponds to the IfHealthyBudget policy.\n\nIfHealthyBudget policy means that running pods (status.phase=\"Running\"), but not yet healthy can be evicted only if the guarded application is not disrupted (status.currentHealthy is at least equal to status.desiredHealthy). Healthy pods will be subject to the PDB for eviction.\n\nAlwaysAllow policy means that all running pods (status.phase=\"Running\"), but not yet healthy are considered disrupted and can be evicted regardless of whether the criteria in a PDB is met. This means perspective running pods of a disrupted application might not get a chance to become healthy. Healthy pods will be subject to the PDB for eviction.\n\nAdditional policies may be added in the future. Clients making eviction decisions should disallow eviction of unhealthy pods if they encounter an unrecognized policy in this field.\n\nThis field is beta-level. The eviction API uses this field when the feature gate PDBUnhealthyPodEvictionPolicy is enabled (enabled by default).", + "unhealthyPodEvictionPolicy": "UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods should be considered for eviction. Current implementation considers healthy pods, as pods that have status.conditions item with type=\"Ready\",status=\"True\".\n\nValid policies are IfHealthyBudget and AlwaysAllow. If no policy is specified, the default behavior will be used, which corresponds to the IfHealthyBudget policy.\n\nIfHealthyBudget policy means that running pods (status.phase=\"Running\"), but not yet healthy can be evicted only if the guarded application is not disrupted (status.currentHealthy is at least equal to status.desiredHealthy). Healthy pods will be subject to the PDB for eviction.\n\nAlwaysAllow policy means that all running pods (status.phase=\"Running\"), but not yet healthy are considered disrupted and can be evicted regardless of whether the criteria in a PDB is met. This means perspective running pods of a disrupted application might not get a chance to become healthy. Healthy pods will be subject to the PDB for eviction.\n\nAdditional policies may be added in the future. Clients making eviction decisions should disallow eviction of unhealthy pods if they encounter an unrecognized policy in this field.", } func (PodDisruptionBudgetSpec) SwaggerDoc() map[string]string { diff --git a/e2e/vendor/k8s.io/api/policy/v1beta1/doc.go b/e2e/vendor/k8s.io/api/policy/v1beta1/doc.go index 76da54b4c..777106c60 100644 --- a/e2e/vendor/k8s.io/api/policy/v1beta1/doc.go +++ b/e2e/vendor/k8s.io/api/policy/v1beta1/doc.go @@ -22,4 +22,4 @@ limitations under the License. // Package policy is for any kind of policy object. Suitable examples, even if // they aren't all here, are PodDisruptionBudget, // NetworkPolicy, etc. -package v1beta1 // import "k8s.io/api/policy/v1beta1" +package v1beta1 diff --git a/e2e/vendor/k8s.io/api/policy/v1beta1/generated.proto b/e2e/vendor/k8s.io/api/policy/v1beta1/generated.proto index 91e33f233..e0cbe00f1 100644 --- a/e2e/vendor/k8s.io/api/policy/v1beta1/generated.proto +++ b/e2e/vendor/k8s.io/api/policy/v1beta1/generated.proto @@ -115,9 +115,6 @@ message PodDisruptionBudgetSpec { // Additional policies may be added in the future. // Clients making eviction decisions should disallow eviction of unhealthy pods // if they encounter an unrecognized policy in this field. - // - // This field is beta-level. The eviction API uses this field when - // the feature gate PDBUnhealthyPodEvictionPolicy is enabled (enabled by default). // +optional optional string unhealthyPodEvictionPolicy = 4; } diff --git a/e2e/vendor/k8s.io/api/policy/v1beta1/types.go b/e2e/vendor/k8s.io/api/policy/v1beta1/types.go index bc5f970d2..9bba454f9 100644 --- a/e2e/vendor/k8s.io/api/policy/v1beta1/types.go +++ b/e2e/vendor/k8s.io/api/policy/v1beta1/types.go @@ -67,9 +67,6 @@ type PodDisruptionBudgetSpec struct { // Additional policies may be added in the future. // Clients making eviction decisions should disallow eviction of unhealthy pods // if they encounter an unrecognized policy in this field. - // - // This field is beta-level. The eviction API uses this field when - // the feature gate PDBUnhealthyPodEvictionPolicy is enabled (enabled by default). // +optional UnhealthyPodEvictionPolicy *UnhealthyPodEvictionPolicyType `json:"unhealthyPodEvictionPolicy,omitempty" protobuf:"bytes,4,opt,name=unhealthyPodEvictionPolicy"` } diff --git a/e2e/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go b/e2e/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go index 4a79d7594..cffc9a548 100644 --- a/e2e/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go +++ b/e2e/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go @@ -63,7 +63,7 @@ var map_PodDisruptionBudgetSpec = map[string]string{ "minAvailable": "An eviction is allowed if at least \"minAvailable\" pods selected by \"selector\" will still be available after the eviction, i.e. even in the absence of the evicted pod. So for example you can prevent all voluntary evictions by specifying \"100%\".", "selector": "Label query over pods whose evictions are managed by the disruption budget. A null selector selects no pods. An empty selector ({}) also selects no pods, which differs from standard behavior of selecting all pods. In policy/v1, an empty selector will select all pods in the namespace.", "maxUnavailable": "An eviction is allowed if at most \"maxUnavailable\" pods selected by \"selector\" are unavailable after the eviction, i.e. even in absence of the evicted pod. For example, one can prevent all voluntary evictions by specifying 0. This is a mutually exclusive setting with \"minAvailable\".", - "unhealthyPodEvictionPolicy": "UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods should be considered for eviction. Current implementation considers healthy pods, as pods that have status.conditions item with type=\"Ready\",status=\"True\".\n\nValid policies are IfHealthyBudget and AlwaysAllow. If no policy is specified, the default behavior will be used, which corresponds to the IfHealthyBudget policy.\n\nIfHealthyBudget policy means that running pods (status.phase=\"Running\"), but not yet healthy can be evicted only if the guarded application is not disrupted (status.currentHealthy is at least equal to status.desiredHealthy). Healthy pods will be subject to the PDB for eviction.\n\nAlwaysAllow policy means that all running pods (status.phase=\"Running\"), but not yet healthy are considered disrupted and can be evicted regardless of whether the criteria in a PDB is met. This means perspective running pods of a disrupted application might not get a chance to become healthy. Healthy pods will be subject to the PDB for eviction.\n\nAdditional policies may be added in the future. Clients making eviction decisions should disallow eviction of unhealthy pods if they encounter an unrecognized policy in this field.\n\nThis field is beta-level. The eviction API uses this field when the feature gate PDBUnhealthyPodEvictionPolicy is enabled (enabled by default).", + "unhealthyPodEvictionPolicy": "UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods should be considered for eviction. Current implementation considers healthy pods, as pods that have status.conditions item with type=\"Ready\",status=\"True\".\n\nValid policies are IfHealthyBudget and AlwaysAllow. If no policy is specified, the default behavior will be used, which corresponds to the IfHealthyBudget policy.\n\nIfHealthyBudget policy means that running pods (status.phase=\"Running\"), but not yet healthy can be evicted only if the guarded application is not disrupted (status.currentHealthy is at least equal to status.desiredHealthy). Healthy pods will be subject to the PDB for eviction.\n\nAlwaysAllow policy means that all running pods (status.phase=\"Running\"), but not yet healthy are considered disrupted and can be evicted regardless of whether the criteria in a PDB is met. This means perspective running pods of a disrupted application might not get a chance to become healthy. Healthy pods will be subject to the PDB for eviction.\n\nAdditional policies may be added in the future. Clients making eviction decisions should disallow eviction of unhealthy pods if they encounter an unrecognized policy in this field.", } func (PodDisruptionBudgetSpec) SwaggerDoc() map[string]string { diff --git a/e2e/vendor/k8s.io/api/rbac/v1/doc.go b/e2e/vendor/k8s.io/api/rbac/v1/doc.go index b0e4e5b5b..408546274 100644 --- a/e2e/vendor/k8s.io/api/rbac/v1/doc.go +++ b/e2e/vendor/k8s.io/api/rbac/v1/doc.go @@ -20,4 +20,4 @@ limitations under the License. // +k8s:prerelease-lifecycle-gen=true // +groupName=rbac.authorization.k8s.io -package v1 // import "k8s.io/api/rbac/v1" +package v1 diff --git a/e2e/vendor/k8s.io/api/rbac/v1alpha1/doc.go b/e2e/vendor/k8s.io/api/rbac/v1alpha1/doc.go index 918b8a337..70d3c0e97 100644 --- a/e2e/vendor/k8s.io/api/rbac/v1alpha1/doc.go +++ b/e2e/vendor/k8s.io/api/rbac/v1alpha1/doc.go @@ -20,4 +20,4 @@ limitations under the License. // +groupName=rbac.authorization.k8s.io -package v1alpha1 // import "k8s.io/api/rbac/v1alpha1" +package v1alpha1 diff --git a/e2e/vendor/k8s.io/api/rbac/v1beta1/doc.go b/e2e/vendor/k8s.io/api/rbac/v1beta1/doc.go index 156f273e6..504a58d8b 100644 --- a/e2e/vendor/k8s.io/api/rbac/v1beta1/doc.go +++ b/e2e/vendor/k8s.io/api/rbac/v1beta1/doc.go @@ -21,4 +21,4 @@ limitations under the License. // +groupName=rbac.authorization.k8s.io -package v1beta1 // import "k8s.io/api/rbac/v1beta1" +package v1beta1 diff --git a/e2e/vendor/k8s.io/api/resource/v1alpha3/doc.go b/e2e/vendor/k8s.io/api/resource/v1alpha3/doc.go index ffc21307d..82e64f1d0 100644 --- a/e2e/vendor/k8s.io/api/resource/v1alpha3/doc.go +++ b/e2e/vendor/k8s.io/api/resource/v1alpha3/doc.go @@ -21,4 +21,4 @@ limitations under the License. // +groupName=resource.k8s.io // Package v1alpha3 is the v1alpha3 version of the resource API. -package v1alpha3 // import "k8s.io/api/resource/v1alpha3" +package v1alpha3 diff --git a/e2e/vendor/k8s.io/api/resource/v1alpha3/generated.pb.go b/e2e/vendor/k8s.io/api/resource/v1alpha3/generated.pb.go index 540f7b818..716492fea 100644 --- a/e2e/vendor/k8s.io/api/resource/v1alpha3/generated.pb.go +++ b/e2e/vendor/k8s.io/api/resource/v1alpha3/generated.pb.go @@ -29,6 +29,7 @@ import ( v11 "k8s.io/api/core/v1" resource "k8s.io/apimachinery/pkg/api/resource" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" math "math" math_bits "math/bits" @@ -161,10 +162,66 @@ func (m *CELDeviceSelector) XXX_DiscardUnknown() { var xxx_messageInfo_CELDeviceSelector proto.InternalMessageInfo +func (m *Counter) Reset() { *m = Counter{} } +func (*Counter) ProtoMessage() {} +func (*Counter) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{4} +} +func (m *Counter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Counter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Counter) XXX_Merge(src proto.Message) { + xxx_messageInfo_Counter.Merge(m, src) +} +func (m *Counter) XXX_Size() int { + return m.Size() +} +func (m *Counter) XXX_DiscardUnknown() { + xxx_messageInfo_Counter.DiscardUnknown(m) +} + +var xxx_messageInfo_Counter proto.InternalMessageInfo + +func (m *CounterSet) Reset() { *m = CounterSet{} } +func (*CounterSet) ProtoMessage() {} +func (*CounterSet) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{5} +} +func (m *CounterSet) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CounterSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *CounterSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_CounterSet.Merge(m, src) +} +func (m *CounterSet) XXX_Size() int { + return m.Size() +} +func (m *CounterSet) XXX_DiscardUnknown() { + xxx_messageInfo_CounterSet.DiscardUnknown(m) +} + +var xxx_messageInfo_CounterSet proto.InternalMessageInfo + func (m *Device) Reset() { *m = Device{} } func (*Device) ProtoMessage() {} func (*Device) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{4} + return fileDescriptor_66649ee9bbcd89d2, []int{6} } func (m *Device) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -192,7 +249,7 @@ var xxx_messageInfo_Device proto.InternalMessageInfo func (m *DeviceAllocationConfiguration) Reset() { *m = DeviceAllocationConfiguration{} } func (*DeviceAllocationConfiguration) ProtoMessage() {} func (*DeviceAllocationConfiguration) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{5} + return fileDescriptor_66649ee9bbcd89d2, []int{7} } func (m *DeviceAllocationConfiguration) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -220,7 +277,7 @@ var xxx_messageInfo_DeviceAllocationConfiguration proto.InternalMessageInfo func (m *DeviceAllocationResult) Reset() { *m = DeviceAllocationResult{} } func (*DeviceAllocationResult) ProtoMessage() {} func (*DeviceAllocationResult) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{6} + return fileDescriptor_66649ee9bbcd89d2, []int{8} } func (m *DeviceAllocationResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -248,7 +305,7 @@ var xxx_messageInfo_DeviceAllocationResult proto.InternalMessageInfo func (m *DeviceAttribute) Reset() { *m = DeviceAttribute{} } func (*DeviceAttribute) ProtoMessage() {} func (*DeviceAttribute) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{7} + return fileDescriptor_66649ee9bbcd89d2, []int{9} } func (m *DeviceAttribute) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -276,7 +333,7 @@ var xxx_messageInfo_DeviceAttribute proto.InternalMessageInfo func (m *DeviceClaim) Reset() { *m = DeviceClaim{} } func (*DeviceClaim) ProtoMessage() {} func (*DeviceClaim) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{8} + return fileDescriptor_66649ee9bbcd89d2, []int{10} } func (m *DeviceClaim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -304,7 +361,7 @@ var xxx_messageInfo_DeviceClaim proto.InternalMessageInfo func (m *DeviceClaimConfiguration) Reset() { *m = DeviceClaimConfiguration{} } func (*DeviceClaimConfiguration) ProtoMessage() {} func (*DeviceClaimConfiguration) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{9} + return fileDescriptor_66649ee9bbcd89d2, []int{11} } func (m *DeviceClaimConfiguration) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -332,7 +389,7 @@ var xxx_messageInfo_DeviceClaimConfiguration proto.InternalMessageInfo func (m *DeviceClass) Reset() { *m = DeviceClass{} } func (*DeviceClass) ProtoMessage() {} func (*DeviceClass) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{10} + return fileDescriptor_66649ee9bbcd89d2, []int{12} } func (m *DeviceClass) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -360,7 +417,7 @@ var xxx_messageInfo_DeviceClass proto.InternalMessageInfo func (m *DeviceClassConfiguration) Reset() { *m = DeviceClassConfiguration{} } func (*DeviceClassConfiguration) ProtoMessage() {} func (*DeviceClassConfiguration) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{11} + return fileDescriptor_66649ee9bbcd89d2, []int{13} } func (m *DeviceClassConfiguration) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -388,7 +445,7 @@ var xxx_messageInfo_DeviceClassConfiguration proto.InternalMessageInfo func (m *DeviceClassList) Reset() { *m = DeviceClassList{} } func (*DeviceClassList) ProtoMessage() {} func (*DeviceClassList) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{12} + return fileDescriptor_66649ee9bbcd89d2, []int{14} } func (m *DeviceClassList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -416,7 +473,7 @@ var xxx_messageInfo_DeviceClassList proto.InternalMessageInfo func (m *DeviceClassSpec) Reset() { *m = DeviceClassSpec{} } func (*DeviceClassSpec) ProtoMessage() {} func (*DeviceClassSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{13} + return fileDescriptor_66649ee9bbcd89d2, []int{15} } func (m *DeviceClassSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -444,7 +501,7 @@ var xxx_messageInfo_DeviceClassSpec proto.InternalMessageInfo func (m *DeviceConfiguration) Reset() { *m = DeviceConfiguration{} } func (*DeviceConfiguration) ProtoMessage() {} func (*DeviceConfiguration) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{14} + return fileDescriptor_66649ee9bbcd89d2, []int{16} } func (m *DeviceConfiguration) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -472,7 +529,7 @@ var xxx_messageInfo_DeviceConfiguration proto.InternalMessageInfo func (m *DeviceConstraint) Reset() { *m = DeviceConstraint{} } func (*DeviceConstraint) ProtoMessage() {} func (*DeviceConstraint) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{15} + return fileDescriptor_66649ee9bbcd89d2, []int{17} } func (m *DeviceConstraint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -497,10 +554,38 @@ func (m *DeviceConstraint) XXX_DiscardUnknown() { var xxx_messageInfo_DeviceConstraint proto.InternalMessageInfo +func (m *DeviceCounterConsumption) Reset() { *m = DeviceCounterConsumption{} } +func (*DeviceCounterConsumption) ProtoMessage() {} +func (*DeviceCounterConsumption) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{18} +} +func (m *DeviceCounterConsumption) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeviceCounterConsumption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *DeviceCounterConsumption) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceCounterConsumption.Merge(m, src) +} +func (m *DeviceCounterConsumption) XXX_Size() int { + return m.Size() +} +func (m *DeviceCounterConsumption) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceCounterConsumption.DiscardUnknown(m) +} + +var xxx_messageInfo_DeviceCounterConsumption proto.InternalMessageInfo + func (m *DeviceRequest) Reset() { *m = DeviceRequest{} } func (*DeviceRequest) ProtoMessage() {} func (*DeviceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{16} + return fileDescriptor_66649ee9bbcd89d2, []int{19} } func (m *DeviceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -528,7 +613,7 @@ var xxx_messageInfo_DeviceRequest proto.InternalMessageInfo func (m *DeviceRequestAllocationResult) Reset() { *m = DeviceRequestAllocationResult{} } func (*DeviceRequestAllocationResult) ProtoMessage() {} func (*DeviceRequestAllocationResult) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{17} + return fileDescriptor_66649ee9bbcd89d2, []int{20} } func (m *DeviceRequestAllocationResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -556,7 +641,7 @@ var xxx_messageInfo_DeviceRequestAllocationResult proto.InternalMessageInfo func (m *DeviceSelector) Reset() { *m = DeviceSelector{} } func (*DeviceSelector) ProtoMessage() {} func (*DeviceSelector) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{18} + return fileDescriptor_66649ee9bbcd89d2, []int{21} } func (m *DeviceSelector) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -581,10 +666,206 @@ func (m *DeviceSelector) XXX_DiscardUnknown() { var xxx_messageInfo_DeviceSelector proto.InternalMessageInfo +func (m *DeviceSubRequest) Reset() { *m = DeviceSubRequest{} } +func (*DeviceSubRequest) ProtoMessage() {} +func (*DeviceSubRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{22} +} +func (m *DeviceSubRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeviceSubRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *DeviceSubRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceSubRequest.Merge(m, src) +} +func (m *DeviceSubRequest) XXX_Size() int { + return m.Size() +} +func (m *DeviceSubRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceSubRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeviceSubRequest proto.InternalMessageInfo + +func (m *DeviceTaint) Reset() { *m = DeviceTaint{} } +func (*DeviceTaint) ProtoMessage() {} +func (*DeviceTaint) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{23} +} +func (m *DeviceTaint) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeviceTaint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *DeviceTaint) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceTaint.Merge(m, src) +} +func (m *DeviceTaint) XXX_Size() int { + return m.Size() +} +func (m *DeviceTaint) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceTaint.DiscardUnknown(m) +} + +var xxx_messageInfo_DeviceTaint proto.InternalMessageInfo + +func (m *DeviceTaintRule) Reset() { *m = DeviceTaintRule{} } +func (*DeviceTaintRule) ProtoMessage() {} +func (*DeviceTaintRule) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{24} +} +func (m *DeviceTaintRule) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeviceTaintRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *DeviceTaintRule) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceTaintRule.Merge(m, src) +} +func (m *DeviceTaintRule) XXX_Size() int { + return m.Size() +} +func (m *DeviceTaintRule) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceTaintRule.DiscardUnknown(m) +} + +var xxx_messageInfo_DeviceTaintRule proto.InternalMessageInfo + +func (m *DeviceTaintRuleList) Reset() { *m = DeviceTaintRuleList{} } +func (*DeviceTaintRuleList) ProtoMessage() {} +func (*DeviceTaintRuleList) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{25} +} +func (m *DeviceTaintRuleList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeviceTaintRuleList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *DeviceTaintRuleList) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceTaintRuleList.Merge(m, src) +} +func (m *DeviceTaintRuleList) XXX_Size() int { + return m.Size() +} +func (m *DeviceTaintRuleList) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceTaintRuleList.DiscardUnknown(m) +} + +var xxx_messageInfo_DeviceTaintRuleList proto.InternalMessageInfo + +func (m *DeviceTaintRuleSpec) Reset() { *m = DeviceTaintRuleSpec{} } +func (*DeviceTaintRuleSpec) ProtoMessage() {} +func (*DeviceTaintRuleSpec) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{26} +} +func (m *DeviceTaintRuleSpec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeviceTaintRuleSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *DeviceTaintRuleSpec) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceTaintRuleSpec.Merge(m, src) +} +func (m *DeviceTaintRuleSpec) XXX_Size() int { + return m.Size() +} +func (m *DeviceTaintRuleSpec) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceTaintRuleSpec.DiscardUnknown(m) +} + +var xxx_messageInfo_DeviceTaintRuleSpec proto.InternalMessageInfo + +func (m *DeviceTaintSelector) Reset() { *m = DeviceTaintSelector{} } +func (*DeviceTaintSelector) ProtoMessage() {} +func (*DeviceTaintSelector) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{27} +} +func (m *DeviceTaintSelector) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeviceTaintSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *DeviceTaintSelector) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceTaintSelector.Merge(m, src) +} +func (m *DeviceTaintSelector) XXX_Size() int { + return m.Size() +} +func (m *DeviceTaintSelector) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceTaintSelector.DiscardUnknown(m) +} + +var xxx_messageInfo_DeviceTaintSelector proto.InternalMessageInfo + +func (m *DeviceToleration) Reset() { *m = DeviceToleration{} } +func (*DeviceToleration) ProtoMessage() {} +func (*DeviceToleration) Descriptor() ([]byte, []int) { + return fileDescriptor_66649ee9bbcd89d2, []int{28} +} +func (m *DeviceToleration) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeviceToleration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *DeviceToleration) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeviceToleration.Merge(m, src) +} +func (m *DeviceToleration) XXX_Size() int { + return m.Size() +} +func (m *DeviceToleration) XXX_DiscardUnknown() { + xxx_messageInfo_DeviceToleration.DiscardUnknown(m) +} + +var xxx_messageInfo_DeviceToleration proto.InternalMessageInfo + func (m *NetworkDeviceData) Reset() { *m = NetworkDeviceData{} } func (*NetworkDeviceData) ProtoMessage() {} func (*NetworkDeviceData) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{19} + return fileDescriptor_66649ee9bbcd89d2, []int{29} } func (m *NetworkDeviceData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -612,7 +893,7 @@ var xxx_messageInfo_NetworkDeviceData proto.InternalMessageInfo func (m *OpaqueDeviceConfiguration) Reset() { *m = OpaqueDeviceConfiguration{} } func (*OpaqueDeviceConfiguration) ProtoMessage() {} func (*OpaqueDeviceConfiguration) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{20} + return fileDescriptor_66649ee9bbcd89d2, []int{30} } func (m *OpaqueDeviceConfiguration) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -640,7 +921,7 @@ var xxx_messageInfo_OpaqueDeviceConfiguration proto.InternalMessageInfo func (m *ResourceClaim) Reset() { *m = ResourceClaim{} } func (*ResourceClaim) ProtoMessage() {} func (*ResourceClaim) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{21} + return fileDescriptor_66649ee9bbcd89d2, []int{31} } func (m *ResourceClaim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -668,7 +949,7 @@ var xxx_messageInfo_ResourceClaim proto.InternalMessageInfo func (m *ResourceClaimConsumerReference) Reset() { *m = ResourceClaimConsumerReference{} } func (*ResourceClaimConsumerReference) ProtoMessage() {} func (*ResourceClaimConsumerReference) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{22} + return fileDescriptor_66649ee9bbcd89d2, []int{32} } func (m *ResourceClaimConsumerReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -696,7 +977,7 @@ var xxx_messageInfo_ResourceClaimConsumerReference proto.InternalMessageInfo func (m *ResourceClaimList) Reset() { *m = ResourceClaimList{} } func (*ResourceClaimList) ProtoMessage() {} func (*ResourceClaimList) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{23} + return fileDescriptor_66649ee9bbcd89d2, []int{33} } func (m *ResourceClaimList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -724,7 +1005,7 @@ var xxx_messageInfo_ResourceClaimList proto.InternalMessageInfo func (m *ResourceClaimSpec) Reset() { *m = ResourceClaimSpec{} } func (*ResourceClaimSpec) ProtoMessage() {} func (*ResourceClaimSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{24} + return fileDescriptor_66649ee9bbcd89d2, []int{34} } func (m *ResourceClaimSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -752,7 +1033,7 @@ var xxx_messageInfo_ResourceClaimSpec proto.InternalMessageInfo func (m *ResourceClaimStatus) Reset() { *m = ResourceClaimStatus{} } func (*ResourceClaimStatus) ProtoMessage() {} func (*ResourceClaimStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{25} + return fileDescriptor_66649ee9bbcd89d2, []int{35} } func (m *ResourceClaimStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -780,7 +1061,7 @@ var xxx_messageInfo_ResourceClaimStatus proto.InternalMessageInfo func (m *ResourceClaimTemplate) Reset() { *m = ResourceClaimTemplate{} } func (*ResourceClaimTemplate) ProtoMessage() {} func (*ResourceClaimTemplate) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{26} + return fileDescriptor_66649ee9bbcd89d2, []int{36} } func (m *ResourceClaimTemplate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -808,7 +1089,7 @@ var xxx_messageInfo_ResourceClaimTemplate proto.InternalMessageInfo func (m *ResourceClaimTemplateList) Reset() { *m = ResourceClaimTemplateList{} } func (*ResourceClaimTemplateList) ProtoMessage() {} func (*ResourceClaimTemplateList) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{27} + return fileDescriptor_66649ee9bbcd89d2, []int{37} } func (m *ResourceClaimTemplateList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -836,7 +1117,7 @@ var xxx_messageInfo_ResourceClaimTemplateList proto.InternalMessageInfo func (m *ResourceClaimTemplateSpec) Reset() { *m = ResourceClaimTemplateSpec{} } func (*ResourceClaimTemplateSpec) ProtoMessage() {} func (*ResourceClaimTemplateSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{28} + return fileDescriptor_66649ee9bbcd89d2, []int{38} } func (m *ResourceClaimTemplateSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -864,7 +1145,7 @@ var xxx_messageInfo_ResourceClaimTemplateSpec proto.InternalMessageInfo func (m *ResourcePool) Reset() { *m = ResourcePool{} } func (*ResourcePool) ProtoMessage() {} func (*ResourcePool) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{29} + return fileDescriptor_66649ee9bbcd89d2, []int{39} } func (m *ResourcePool) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -892,7 +1173,7 @@ var xxx_messageInfo_ResourcePool proto.InternalMessageInfo func (m *ResourceSlice) Reset() { *m = ResourceSlice{} } func (*ResourceSlice) ProtoMessage() {} func (*ResourceSlice) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{30} + return fileDescriptor_66649ee9bbcd89d2, []int{40} } func (m *ResourceSlice) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -920,7 +1201,7 @@ var xxx_messageInfo_ResourceSlice proto.InternalMessageInfo func (m *ResourceSliceList) Reset() { *m = ResourceSliceList{} } func (*ResourceSliceList) ProtoMessage() {} func (*ResourceSliceList) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{31} + return fileDescriptor_66649ee9bbcd89d2, []int{41} } func (m *ResourceSliceList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -948,7 +1229,7 @@ var xxx_messageInfo_ResourceSliceList proto.InternalMessageInfo func (m *ResourceSliceSpec) Reset() { *m = ResourceSliceSpec{} } func (*ResourceSliceSpec) ProtoMessage() {} func (*ResourceSliceSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_66649ee9bbcd89d2, []int{32} + return fileDescriptor_66649ee9bbcd89d2, []int{42} } func (m *ResourceSliceSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -980,6 +1261,9 @@ func init() { proto.RegisterMapType((map[QualifiedName]DeviceAttribute)(nil), "k8s.io.api.resource.v1alpha3.BasicDevice.AttributesEntry") proto.RegisterMapType((map[QualifiedName]resource.Quantity)(nil), "k8s.io.api.resource.v1alpha3.BasicDevice.CapacityEntry") proto.RegisterType((*CELDeviceSelector)(nil), "k8s.io.api.resource.v1alpha3.CELDeviceSelector") + proto.RegisterType((*Counter)(nil), "k8s.io.api.resource.v1alpha3.Counter") + proto.RegisterType((*CounterSet)(nil), "k8s.io.api.resource.v1alpha3.CounterSet") + proto.RegisterMapType((map[string]Counter)(nil), "k8s.io.api.resource.v1alpha3.CounterSet.CountersEntry") proto.RegisterType((*Device)(nil), "k8s.io.api.resource.v1alpha3.Device") proto.RegisterType((*DeviceAllocationConfiguration)(nil), "k8s.io.api.resource.v1alpha3.DeviceAllocationConfiguration") proto.RegisterType((*DeviceAllocationResult)(nil), "k8s.io.api.resource.v1alpha3.DeviceAllocationResult") @@ -992,9 +1276,18 @@ func init() { proto.RegisterType((*DeviceClassSpec)(nil), "k8s.io.api.resource.v1alpha3.DeviceClassSpec") proto.RegisterType((*DeviceConfiguration)(nil), "k8s.io.api.resource.v1alpha3.DeviceConfiguration") proto.RegisterType((*DeviceConstraint)(nil), "k8s.io.api.resource.v1alpha3.DeviceConstraint") + proto.RegisterType((*DeviceCounterConsumption)(nil), "k8s.io.api.resource.v1alpha3.DeviceCounterConsumption") + proto.RegisterMapType((map[string]Counter)(nil), "k8s.io.api.resource.v1alpha3.DeviceCounterConsumption.CountersEntry") proto.RegisterType((*DeviceRequest)(nil), "k8s.io.api.resource.v1alpha3.DeviceRequest") proto.RegisterType((*DeviceRequestAllocationResult)(nil), "k8s.io.api.resource.v1alpha3.DeviceRequestAllocationResult") proto.RegisterType((*DeviceSelector)(nil), "k8s.io.api.resource.v1alpha3.DeviceSelector") + proto.RegisterType((*DeviceSubRequest)(nil), "k8s.io.api.resource.v1alpha3.DeviceSubRequest") + proto.RegisterType((*DeviceTaint)(nil), "k8s.io.api.resource.v1alpha3.DeviceTaint") + proto.RegisterType((*DeviceTaintRule)(nil), "k8s.io.api.resource.v1alpha3.DeviceTaintRule") + proto.RegisterType((*DeviceTaintRuleList)(nil), "k8s.io.api.resource.v1alpha3.DeviceTaintRuleList") + proto.RegisterType((*DeviceTaintRuleSpec)(nil), "k8s.io.api.resource.v1alpha3.DeviceTaintRuleSpec") + proto.RegisterType((*DeviceTaintSelector)(nil), "k8s.io.api.resource.v1alpha3.DeviceTaintSelector") + proto.RegisterType((*DeviceToleration)(nil), "k8s.io.api.resource.v1alpha3.DeviceToleration") proto.RegisterType((*NetworkDeviceData)(nil), "k8s.io.api.resource.v1alpha3.NetworkDeviceData") proto.RegisterType((*OpaqueDeviceConfiguration)(nil), "k8s.io.api.resource.v1alpha3.OpaqueDeviceConfiguration") proto.RegisterType((*ResourceClaim)(nil), "k8s.io.api.resource.v1alpha3.ResourceClaim") @@ -1016,134 +1309,172 @@ func init() { } var fileDescriptor_66649ee9bbcd89d2 = []byte{ - // 2030 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x19, 0xcd, 0x6f, 0x1c, 0x57, - 0xdd, 0xb3, 0xe3, 0xcf, 0xdf, 0xfa, 0x2b, 0x2f, 0xa4, 0x38, 0xa6, 0xec, 0x3a, 0x53, 0x04, 0x4e, - 0x9b, 0xee, 0x36, 0x4e, 0xd5, 0x16, 0xc2, 0x01, 0x8f, 0xed, 0x06, 0x47, 0x89, 0xe3, 0x3c, 0xb7, - 0x11, 0x81, 0x12, 0x78, 0x9e, 0x7d, 0xb6, 0x07, 0xcf, 0xce, 0x4c, 0xe7, 0xbd, 0x71, 0xea, 0x0b, - 0xaa, 0xe0, 0x1e, 0xf1, 0x0f, 0x20, 0x0e, 0x48, 0x48, 0x5c, 0x80, 0xff, 0x00, 0x24, 0x90, 0x88, - 0xe0, 0x12, 0x09, 0x0e, 0x3d, 0x2d, 0xcd, 0x22, 0xce, 0xdc, 0x73, 0x42, 0xef, 0xcd, 0x9b, 0xcf, - 0xdd, 0x71, 0xc6, 0x55, 0xb1, 0xd2, 0xdb, 0xce, 0xef, 0xfb, 0xfd, 0xbe, 0xdf,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0x70, 0x9c, 0x50, - 0x0c, 0xfc, 0x91, 0x33, 0xfa, 0xf9, 0xfc, 0x91, 0x23, 0x37, 0x22, 0xc7, 0x11, 0x04, 0xf1, 0xf5, - 0x21, 0xdd, 0x88, 0x14, 0x1c, 0x27, 0x14, 0xe8, 0x4e, 0x3a, 0x5f, 0xc6, 0x65, 0x4c, 0xbe, 0x56, - 0x65, 0x44, 0x97, 0x0f, 0x14, 0xd3, 0x7c, 0xfc, 0xb4, 0x31, 0xf2, 0xe4, 0x69, 0x63, 0xe4, 0x93, - 0xa7, 0x8d, 0x91, 0x8f, 0xfb, 0x0d, 0xed, 0x71, 0xbf, 0xa1, 0x3d, 0xe9, 0x37, 0xb4, 0x4f, 0xfa, - 0x0d, 0xed, 0xd3, 0x7e, 0x43, 0xfb, 0xc5, 0xbf, 0x1b, 0x23, 0xdf, 0x7f, 0xf9, 0xa4, 0x7f, 0x95, - 0xff, 0x17, 0x00, 0x00, 0xff, 0xff, 0xbd, 0x60, 0x85, 0x64, 0x74, 0x1e, 0x00, 0x00, + // 2635 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x1a, 0x5b, 0x6f, 0x1c, 0x57, + 0x39, 0xb3, 0xbb, 0x5e, 0xaf, 0xbf, 0x8d, 0x1d, 0xfb, 0x84, 0x84, 0x8d, 0x49, 0x77, 0x93, 0x09, + 0x17, 0xa7, 0x75, 0xd6, 0x8d, 0x53, 0xb5, 0x85, 0x80, 0x84, 0xd7, 0x76, 0x52, 0xa7, 0x89, 0xe3, + 0x9c, 0x75, 0x03, 0x81, 0x12, 0x18, 0xcf, 0x1e, 0xdb, 0x83, 0x67, 0x67, 0xa6, 0x73, 0x66, 0x9d, + 0x5a, 0x42, 0xa8, 0xe2, 0x07, 0x54, 0xbc, 0xf2, 0x80, 0x2a, 0xf1, 0x50, 0x89, 0x17, 0xe0, 0x99, + 0x17, 0x90, 0x40, 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 0x60, 0x05, 0x47, 0xb0, 0xd4, 0xfb, 0x30, + 0x2a, 0xc3, 0x05, 0x35, 0x7d, 0xed, 0x94, 0xc3, 0x68, 0xd7, 0x18, 0x97, 0x92, 0x46, 0xee, 0x32, + 0x26, 0x52, 0x59, 0xf5, 0x3f, 0x0a, 0x80, 0x14, 0xd0, 0x24, 0x1e, 0xeb, 0x22, 0x16, 0x8b, 0x46, + 0x25, 0xde, 0x45, 0x78, 0x34, 0xf2, 0x15, 0xd4, 0x82, 0x92, 0xee, 0x67, 0x4a, 0x2e, 0x4b, 0xa6, + 0x84, 0xdc, 0xfd, 0x9f, 0xb2, 0x48, 0x4c, 0x06, 0x89, 0xea, 0x67, 0x48, 0xc0, 0x79, 0x7a, 0x03, + 0xc6, 0x63, 0xc8, 0x03, 0x9c, 0x75, 0x35, 0xee, 0xac, 0x2f, 0x64, 0xd2, 0x22, 0xea, 0xa3, 0x5d, + 0x90, 0x9d, 0x2f, 0xc3, 0xae, 0x6f, 0xc0, 0xc8, 0x06, 0xab, 0x38, 0x52, 0xd8, 0xc5, 0xcc, 0xc5, + 0xa9, 0x31, 0xc6, 0x4c, 0xce, 0x01, 0x58, 0xb0, 0x50, 0xdf, 0xcf, 0xc1, 0x0b, 0xc9, 0x46, 0xb0, + 0x68, 0x5b, 0x9b, 0xc6, 0x56, 0xc7, 0xe5, 0x7f, 0xd0, 0xd7, 0xa1, 0x28, 0x58, 0x4a, 0x8d, 0x66, + 0xfc, 0x04, 0x6a, 0x72, 0xe8, 0x7e, 0xb7, 0x76, 0x3a, 0x49, 0x2a, 0x56, 0xb0, 0xa4, 0x63, 0x79, + 0xed, 0x92, 0x77, 0x3a, 0x84, 0x7a, 0xc2, 0x4b, 0xb2, 0xb2, 0x60, 0x09, 0xc3, 0xc1, 0x2a, 0x7a, + 0x4f, 0x81, 0x93, 0x2d, 0x59, 0xcc, 0x22, 0x3a, 0xc8, 0x4e, 0x73, 0x39, 0x5b, 0x15, 0x8c, 0x10, + 0x36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, 0x0d, 0x8b, 0xc5, 0x1a, 0xba, 0x0c, 0x65, 0xad, 0xd5, 0x36, 0xac, 0x05, 0x5d, + 0x27, 0xd4, 0x3f, 0x90, 0xf2, 0x71, 0x66, 0x21, 0x04, 0xe3, 0x28, 0x0e, 0xb2, 0x60, 0x62, 0xd3, + 0x70, 0xa9, 0xb7, 0xb0, 0xab, 0x19, 0xa6, 0xb6, 0x61, 0x12, 0x79, 0x3c, 0xcd, 0x34, 0x3f, 0x34, + 0x3b, 0x1b, 0xfe, 0x80, 0x72, 0xda, 0xdf, 0xdf, 0xb5, 0x18, 0x37, 0x9c, 0xe0, 0xce, 0x86, 0x15, + 0xcf, 0x36, 0x89, 0xc8, 0x68, 0x5a, 0x29, 0x65, 0x17, 0xb6, 0x1e, 0x90, 0x85, 0xc3, 0x4a, 0x08, + 0xa3, 0x38, 0xca, 0x57, 0xfd, 0x4b, 0x70, 0x46, 0x48, 0x99, 0x65, 0xd1, 0x45, 0x36, 0x19, 0xf3, + 0x25, 0x19, 0x6f, 0x91, 0xe1, 0x96, 0x83, 0xb1, 0xbf, 0x1e, 0xb9, 0x42, 0xcc, 0x65, 0xba, 0x42, + 0xcc, 0x67, 0xb8, 0x42, 0x2c, 0x1c, 0x78, 0x85, 0x98, 0x70, 0xe4, 0x48, 0x06, 0x47, 0x26, 0x0c, + 0x5b, 0x7c, 0x46, 0x86, 0x7d, 0x1b, 0x26, 0x12, 0xa7, 0xf2, 0x1b, 0x90, 0xd7, 0x89, 0x29, 0x6b, + 0xfb, 0x13, 0x2e, 0x0d, 0xfb, 0xce, 0xf4, 0x8d, 0xd1, 0x5e, 0xb7, 0x96, 0x5f, 0x5c, 0xbe, 0x89, + 0x19, 0x13, 0xf5, 0xd7, 0x79, 0xbf, 0x9a, 0x87, 0xa1, 0xf5, 0x69, 0x59, 0xf8, 0x5f, 0xcb, 0x42, + 0x22, 0x34, 0x46, 0x9f, 0x51, 0x68, 0xfc, 0x3b, 0x18, 0x7b, 0xf9, 0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0x00, 0x00, } func (m *AllocatedDeviceStatus) Marshal() (dAtA []byte, err error) { @@ -1178,16 +1509,18 @@ func (m *AllocatedDeviceStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x32 } - { - size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.Data != nil { + { + size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a } - i-- - dAtA[i] = 0x2a if len(m.Conditions) > 0 { for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { { @@ -1285,6 +1618,63 @@ func (m *BasicDevice) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Taints) > 0 { + for iNdEx := len(m.Taints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Taints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if m.AllNodes != nil { + i-- + if *m.AllNodes { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.NodeSelector != nil { + { + size, err := m.NodeSelector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.NodeName != nil { + i -= len(*m.NodeName) + copy(dAtA[i:], *m.NodeName) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.NodeName))) + i-- + dAtA[i] = 0x22 + } + if len(m.ConsumesCounters) > 0 { + for iNdEx := len(m.ConsumesCounters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ConsumesCounters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } if len(m.Capacity) > 0 { keysForCapacity := make([]string, 0, len(m.Capacity)) for k := range m.Capacity { @@ -1374,6 +1764,96 @@ func (m *CELDeviceSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Counter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Counter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Counter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *CounterSet) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CounterSet) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CounterSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Counters) > 0 { + keysForCounters := make([]string, 0, len(m.Counters)) + for k := range m.Counters { + keysForCounters = append(keysForCounters, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForCounters) + for iNdEx := len(keysForCounters) - 1; iNdEx >= 0; iNdEx-- { + v := m.Counters[string(keysForCounters[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForCounters[iNdEx]) + copy(dAtA[i:], keysForCounters[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForCounters[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *Device) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1919,6 +2399,63 @@ func (m *DeviceConstraint) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *DeviceCounterConsumption) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeviceCounterConsumption) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeviceCounterConsumption) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Counters) > 0 { + keysForCounters := make([]string, 0, len(m.Counters)) + for k := range m.Counters { + keysForCounters = append(keysForCounters, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForCounters) + for iNdEx := len(keysForCounters) - 1; iNdEx >= 0; iNdEx-- { + v := m.Counters[string(keysForCounters[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForCounters[iNdEx]) + copy(dAtA[i:], keysForCounters[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForCounters[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.CounterSet) + copy(dAtA[i:], m.CounterSet) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.CounterSet))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *DeviceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1939,6 +2476,34 @@ func (m *DeviceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Tolerations) > 0 { + for iNdEx := len(m.Tolerations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tolerations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if len(m.FirstAvailable) > 0 { + for iNdEx := len(m.FirstAvailable) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FirstAvailable[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } if m.AdminAccess != nil { i-- if *m.AdminAccess { @@ -2004,6 +2569,20 @@ func (m *DeviceRequestAllocationResult) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l + if len(m.Tolerations) > 0 { + for iNdEx := len(m.Tolerations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tolerations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } if m.AdminAccess != nil { i-- if *m.AdminAccess { @@ -2072,6 +2651,373 @@ func (m *DeviceSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *DeviceSubRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeviceSubRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeviceSubRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Tolerations) > 0 { + for iNdEx := len(m.Tolerations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tolerations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + i = encodeVarintGenerated(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x28 + i -= len(m.AllocationMode) + copy(dAtA[i:], m.AllocationMode) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.AllocationMode))) + i-- + dAtA[i] = 0x22 + if len(m.Selectors) > 0 { + for iNdEx := len(m.Selectors) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Selectors[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + i -= len(m.DeviceClassName) + copy(dAtA[i:], m.DeviceClassName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeviceClassName))) + i-- + dAtA[i] = 0x12 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *DeviceTaint) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeviceTaint) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeviceTaint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TimeAdded != nil { + { + size, err := m.TimeAdded.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + i -= len(m.Effect) + copy(dAtA[i:], m.Effect) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Effect))) + i-- + dAtA[i] = 0x1a + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *DeviceTaintRule) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeviceTaintRule) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeviceTaintRule) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *DeviceTaintRuleList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeviceTaintRuleList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeviceTaintRuleList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *DeviceTaintRuleSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeviceTaintRuleSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeviceTaintRuleSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Taint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.DeviceSelector != nil { + { + size, err := m.DeviceSelector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DeviceTaintSelector) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeviceTaintSelector) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeviceTaintSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Selectors) > 0 { + for iNdEx := len(m.Selectors) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Selectors[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if m.Device != nil { + i -= len(*m.Device) + copy(dAtA[i:], *m.Device) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Device))) + i-- + dAtA[i] = 0x22 + } + if m.Pool != nil { + i -= len(*m.Pool) + copy(dAtA[i:], *m.Pool) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Pool))) + i-- + dAtA[i] = 0x1a + } + if m.Driver != nil { + i -= len(*m.Driver) + copy(dAtA[i:], *m.Driver) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Driver))) + i-- + dAtA[i] = 0x12 + } + if m.DeviceClassName != nil { + i -= len(*m.DeviceClassName) + copy(dAtA[i:], *m.DeviceClassName) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.DeviceClassName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DeviceToleration) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeviceToleration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeviceToleration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TolerationSeconds != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.TolerationSeconds)) + i-- + dAtA[i] = 0x28 + } + i -= len(m.Effect) + copy(dAtA[i:], m.Effect) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Effect))) + i-- + dAtA[i] = 0x22 + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x1a + i -= len(m.Operator) + copy(dAtA[i:], m.Operator) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Operator))) + i-- + dAtA[i] = 0x12 + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *NetworkDeviceData) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2668,6 +3614,30 @@ func (m *ResourceSliceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.SharedCounters) > 0 { + for iNdEx := len(m.SharedCounters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SharedCounters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if m.PerDeviceNodeSelection != nil { + i-- + if *m.PerDeviceNodeSelection { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } if len(m.Devices) > 0 { for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { { @@ -2754,8 +3724,10 @@ func (m *AllocatedDeviceStatus) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } - l = m.Data.Size() - n += 1 + l + sovGenerated(uint64(l)) + if m.Data != nil { + l = m.Data.Size() + n += 1 + l + sovGenerated(uint64(l)) + } if m.NetworkData != nil { l = m.NetworkData.Size() n += 1 + l + sovGenerated(uint64(l)) @@ -2802,6 +3774,29 @@ func (m *BasicDevice) Size() (n int) { n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) } } + if len(m.ConsumesCounters) > 0 { + for _, e := range m.ConsumesCounters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.NodeName != nil { + l = len(*m.NodeName) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.NodeSelector != nil { + l = m.NodeSelector.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.AllNodes != nil { + n += 2 + } + if len(m.Taints) > 0 { + for _, e := range m.Taints { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -2816,6 +3811,37 @@ func (m *CELDeviceSelector) Size() (n int) { return n } +func (m *Counter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Value.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *CounterSet) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Counters) > 0 { + for k, v := range m.Counters { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + func (m *Device) Size() (n int) { if m == nil { return 0 @@ -3032,6 +4058,26 @@ func (m *DeviceConstraint) Size() (n int) { return n } +func (m *DeviceCounterConsumption) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.CounterSet) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Counters) > 0 { + for k, v := range m.Counters { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + func (m *DeviceRequest) Size() (n int) { if m == nil { return 0 @@ -3054,6 +4100,18 @@ func (m *DeviceRequest) Size() (n int) { if m.AdminAccess != nil { n += 2 } + if len(m.FirstAvailable) > 0 { + for _, e := range m.FirstAvailable { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Tolerations) > 0 { + for _, e := range m.Tolerations { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -3074,6 +4132,12 @@ func (m *DeviceRequestAllocationResult) Size() (n int) { if m.AdminAccess != nil { n += 2 } + if len(m.Tolerations) > 0 { + for _, e := range m.Tolerations { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -3090,6 +4154,149 @@ func (m *DeviceSelector) Size() (n int) { return n } +func (m *DeviceSubRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.DeviceClassName) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Selectors) > 0 { + for _, e := range m.Selectors { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.AllocationMode) + n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.Count)) + if len(m.Tolerations) > 0 { + for _, e := range m.Tolerations { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *DeviceTaint) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Value) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Effect) + n += 1 + l + sovGenerated(uint64(l)) + if m.TimeAdded != nil { + l = m.TimeAdded.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *DeviceTaintRule) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *DeviceTaintRuleList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *DeviceTaintRuleSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DeviceSelector != nil { + l = m.DeviceSelector.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = m.Taint.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *DeviceTaintSelector) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DeviceClassName != nil { + l = len(*m.DeviceClassName) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Driver != nil { + l = len(*m.Driver) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Pool != nil { + l = len(*m.Pool) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Device != nil { + l = len(*m.Device) + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.Selectors) > 0 { + for _, e := range m.Selectors { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *DeviceToleration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Operator) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Value) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Effect) + n += 1 + l + sovGenerated(uint64(l)) + if m.TolerationSeconds != nil { + n += 1 + sovGenerated(uint64(*m.TolerationSeconds)) + } + return n +} + func (m *NetworkDeviceData) Size() (n int) { if m == nil { return 0 @@ -3316,6 +4523,15 @@ func (m *ResourceSliceSpec) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } + if m.PerDeviceNodeSelection != nil { + n += 2 + } + if len(m.SharedCounters) > 0 { + for _, e := range m.SharedCounters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -3339,7 +4555,7 @@ func (this *AllocatedDeviceStatus) String() string { `Pool:` + fmt.Sprintf("%v", this.Pool) + `,`, `Device:` + fmt.Sprintf("%v", this.Device) + `,`, `Conditions:` + repeatedStringForConditions + `,`, - `Data:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Data), "RawExtension", "runtime.RawExtension", 1), `&`, ``, 1) + `,`, + `Data:` + strings.Replace(fmt.Sprintf("%v", this.Data), "RawExtension", "runtime.RawExtension", 1) + `,`, `NetworkData:` + strings.Replace(this.NetworkData.String(), "NetworkDeviceData", "NetworkDeviceData", 1) + `,`, `}`, }, "") @@ -3360,6 +4576,16 @@ func (this *BasicDevice) String() string { if this == nil { return "nil" } + repeatedStringForConsumesCounters := "[]DeviceCounterConsumption{" + for _, f := range this.ConsumesCounters { + repeatedStringForConsumesCounters += strings.Replace(strings.Replace(f.String(), "DeviceCounterConsumption", "DeviceCounterConsumption", 1), `&`, ``, 1) + "," + } + repeatedStringForConsumesCounters += "}" + repeatedStringForTaints := "[]DeviceTaint{" + for _, f := range this.Taints { + repeatedStringForTaints += strings.Replace(strings.Replace(f.String(), "DeviceTaint", "DeviceTaint", 1), `&`, ``, 1) + "," + } + repeatedStringForTaints += "}" keysForAttributes := make([]string, 0, len(this.Attributes)) for k := range this.Attributes { keysForAttributes = append(keysForAttributes, string(k)) @@ -3383,6 +4609,11 @@ func (this *BasicDevice) String() string { s := strings.Join([]string{`&BasicDevice{`, `Attributes:` + mapStringForAttributes + `,`, `Capacity:` + mapStringForCapacity + `,`, + `ConsumesCounters:` + repeatedStringForConsumesCounters + `,`, + `NodeName:` + valueToStringGenerated(this.NodeName) + `,`, + `NodeSelector:` + strings.Replace(fmt.Sprintf("%v", this.NodeSelector), "NodeSelector", "v11.NodeSelector", 1) + `,`, + `AllNodes:` + valueToStringGenerated(this.AllNodes) + `,`, + `Taints:` + repeatedStringForTaints + `,`, `}`, }, "") return s @@ -3397,6 +4628,37 @@ func (this *CELDeviceSelector) String() string { }, "") return s } +func (this *Counter) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Counter{`, + `Value:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Value), "Quantity", "resource.Quantity", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *CounterSet) String() string { + if this == nil { + return "nil" + } + keysForCounters := make([]string, 0, len(this.Counters)) + for k := range this.Counters { + keysForCounters = append(keysForCounters, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForCounters) + mapStringForCounters := "map[string]Counter{" + for _, k := range keysForCounters { + mapStringForCounters += fmt.Sprintf("%v: %v,", k, this.Counters[k]) + } + mapStringForCounters += "}" + s := strings.Join([]string{`&CounterSet{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Counters:` + mapStringForCounters + `,`, + `}`, + }, "") + return s +} func (this *Device) String() string { if this == nil { return "nil" @@ -3571,6 +4833,27 @@ func (this *DeviceConstraint) String() string { }, "") return s } +func (this *DeviceCounterConsumption) String() string { + if this == nil { + return "nil" + } + keysForCounters := make([]string, 0, len(this.Counters)) + for k := range this.Counters { + keysForCounters = append(keysForCounters, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForCounters) + mapStringForCounters := "map[string]Counter{" + for _, k := range keysForCounters { + mapStringForCounters += fmt.Sprintf("%v: %v,", k, this.Counters[k]) + } + mapStringForCounters += "}" + s := strings.Join([]string{`&DeviceCounterConsumption{`, + `CounterSet:` + fmt.Sprintf("%v", this.CounterSet) + `,`, + `Counters:` + mapStringForCounters + `,`, + `}`, + }, "") + return s +} func (this *DeviceRequest) String() string { if this == nil { return "nil" @@ -3580,6 +4863,16 @@ func (this *DeviceRequest) String() string { repeatedStringForSelectors += strings.Replace(strings.Replace(f.String(), "DeviceSelector", "DeviceSelector", 1), `&`, ``, 1) + "," } repeatedStringForSelectors += "}" + repeatedStringForFirstAvailable := "[]DeviceSubRequest{" + for _, f := range this.FirstAvailable { + repeatedStringForFirstAvailable += strings.Replace(strings.Replace(f.String(), "DeviceSubRequest", "DeviceSubRequest", 1), `&`, ``, 1) + "," + } + repeatedStringForFirstAvailable += "}" + repeatedStringForTolerations := "[]DeviceToleration{" + for _, f := range this.Tolerations { + repeatedStringForTolerations += strings.Replace(strings.Replace(f.String(), "DeviceToleration", "DeviceToleration", 1), `&`, ``, 1) + "," + } + repeatedStringForTolerations += "}" s := strings.Join([]string{`&DeviceRequest{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `DeviceClassName:` + fmt.Sprintf("%v", this.DeviceClassName) + `,`, @@ -3587,6 +4880,8 @@ func (this *DeviceRequest) String() string { `AllocationMode:` + fmt.Sprintf("%v", this.AllocationMode) + `,`, `Count:` + fmt.Sprintf("%v", this.Count) + `,`, `AdminAccess:` + valueToStringGenerated(this.AdminAccess) + `,`, + `FirstAvailable:` + repeatedStringForFirstAvailable + `,`, + `Tolerations:` + repeatedStringForTolerations + `,`, `}`, }, "") return s @@ -3595,12 +4890,18 @@ func (this *DeviceRequestAllocationResult) String() string { if this == nil { return "nil" } + repeatedStringForTolerations := "[]DeviceToleration{" + for _, f := range this.Tolerations { + repeatedStringForTolerations += strings.Replace(strings.Replace(f.String(), "DeviceToleration", "DeviceToleration", 1), `&`, ``, 1) + "," + } + repeatedStringForTolerations += "}" s := strings.Join([]string{`&DeviceRequestAllocationResult{`, `Request:` + fmt.Sprintf("%v", this.Request) + `,`, `Driver:` + fmt.Sprintf("%v", this.Driver) + `,`, `Pool:` + fmt.Sprintf("%v", this.Pool) + `,`, `Device:` + fmt.Sprintf("%v", this.Device) + `,`, `AdminAccess:` + valueToStringGenerated(this.AdminAccess) + `,`, + `Tolerations:` + repeatedStringForTolerations + `,`, `}`, }, "") return s @@ -3615,6 +4916,115 @@ func (this *DeviceSelector) String() string { }, "") return s } +func (this *DeviceSubRequest) String() string { + if this == nil { + return "nil" + } + repeatedStringForSelectors := "[]DeviceSelector{" + for _, f := range this.Selectors { + repeatedStringForSelectors += strings.Replace(strings.Replace(f.String(), "DeviceSelector", "DeviceSelector", 1), `&`, ``, 1) + "," + } + repeatedStringForSelectors += "}" + repeatedStringForTolerations := "[]DeviceToleration{" + for _, f := range this.Tolerations { + repeatedStringForTolerations += strings.Replace(strings.Replace(f.String(), "DeviceToleration", "DeviceToleration", 1), `&`, ``, 1) + "," + } + repeatedStringForTolerations += "}" + s := strings.Join([]string{`&DeviceSubRequest{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `DeviceClassName:` + fmt.Sprintf("%v", this.DeviceClassName) + `,`, + `Selectors:` + repeatedStringForSelectors + `,`, + `AllocationMode:` + fmt.Sprintf("%v", this.AllocationMode) + `,`, + `Count:` + fmt.Sprintf("%v", this.Count) + `,`, + `Tolerations:` + repeatedStringForTolerations + `,`, + `}`, + }, "") + return s +} +func (this *DeviceTaint) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeviceTaint{`, + `Key:` + fmt.Sprintf("%v", this.Key) + `,`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + `Effect:` + fmt.Sprintf("%v", this.Effect) + `,`, + `TimeAdded:` + strings.Replace(fmt.Sprintf("%v", this.TimeAdded), "Time", "v1.Time", 1) + `,`, + `}`, + }, "") + return s +} +func (this *DeviceTaintRule) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeviceTaintRule{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "DeviceTaintRuleSpec", "DeviceTaintRuleSpec", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *DeviceTaintRuleList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]DeviceTaintRule{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "DeviceTaintRule", "DeviceTaintRule", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&DeviceTaintRuleList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *DeviceTaintRuleSpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeviceTaintRuleSpec{`, + `DeviceSelector:` + strings.Replace(this.DeviceSelector.String(), "DeviceTaintSelector", "DeviceTaintSelector", 1) + `,`, + `Taint:` + strings.Replace(strings.Replace(this.Taint.String(), "DeviceTaint", "DeviceTaint", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *DeviceTaintSelector) String() string { + if this == nil { + return "nil" + } + repeatedStringForSelectors := "[]DeviceSelector{" + for _, f := range this.Selectors { + repeatedStringForSelectors += strings.Replace(strings.Replace(f.String(), "DeviceSelector", "DeviceSelector", 1), `&`, ``, 1) + "," + } + repeatedStringForSelectors += "}" + s := strings.Join([]string{`&DeviceTaintSelector{`, + `DeviceClassName:` + valueToStringGenerated(this.DeviceClassName) + `,`, + `Driver:` + valueToStringGenerated(this.Driver) + `,`, + `Pool:` + valueToStringGenerated(this.Pool) + `,`, + `Device:` + valueToStringGenerated(this.Device) + `,`, + `Selectors:` + repeatedStringForSelectors + `,`, + `}`, + }, "") + return s +} +func (this *DeviceToleration) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeviceToleration{`, + `Key:` + fmt.Sprintf("%v", this.Key) + `,`, + `Operator:` + fmt.Sprintf("%v", this.Operator) + `,`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + `Effect:` + fmt.Sprintf("%v", this.Effect) + `,`, + `TolerationSeconds:` + valueToStringGenerated(this.TolerationSeconds) + `,`, + `}`, + }, "") + return s +} func (this *NetworkDeviceData) String() string { if this == nil { return "nil" @@ -3797,6 +5207,11 @@ func (this *ResourceSliceSpec) String() string { repeatedStringForDevices += strings.Replace(strings.Replace(f.String(), "Device", "Device", 1), `&`, ``, 1) + "," } repeatedStringForDevices += "}" + repeatedStringForSharedCounters := "[]CounterSet{" + for _, f := range this.SharedCounters { + repeatedStringForSharedCounters += strings.Replace(strings.Replace(f.String(), "CounterSet", "CounterSet", 1), `&`, ``, 1) + "," + } + repeatedStringForSharedCounters += "}" s := strings.Join([]string{`&ResourceSliceSpec{`, `Driver:` + fmt.Sprintf("%v", this.Driver) + `,`, `Pool:` + strings.Replace(strings.Replace(this.Pool.String(), "ResourcePool", "ResourcePool", 1), `&`, ``, 1) + `,`, @@ -3804,6 +5219,8 @@ func (this *ResourceSliceSpec) String() string { `NodeSelector:` + strings.Replace(fmt.Sprintf("%v", this.NodeSelector), "NodeSelector", "v11.NodeSelector", 1) + `,`, `AllNodes:` + fmt.Sprintf("%v", this.AllNodes) + `,`, `Devices:` + repeatedStringForDevices + `,`, + `PerDeviceNodeSelection:` + valueToStringGenerated(this.PerDeviceNodeSelection) + `,`, + `SharedCounters:` + repeatedStringForSharedCounters + `,`, `}`, }, "") return s @@ -4004,6 +5421,9 @@ func (m *AllocatedDeviceStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.Data == nil { + m.Data = &runtime.RawExtension{} + } if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4471,6 +5891,164 @@ func (m *BasicDevice) Unmarshal(dAtA []byte) error { } m.Capacity[QualifiedName(mapkey)] = *mapvalue iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumesCounters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumesCounters = append(m.ConsumesCounters, DeviceCounterConsumption{}) + if err := m.ConsumesCounters[len(m.ConsumesCounters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.NodeName = &s + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeSelector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NodeSelector == nil { + m.NodeSelector = &v11.NodeSelector{} + } + if err := m.NodeSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllNodes", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.AllNodes = &b + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Taints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Taints = append(m.Taints, DeviceTaint{}) + if err := m.Taints[len(m.Taints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -4574,6 +6152,300 @@ func (m *CELDeviceSelector) Unmarshal(dAtA []byte) error { } return nil } +func (m *Counter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Counter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Counter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CounterSet) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CounterSet: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CounterSet: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Counters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Counters == nil { + m.Counters = make(map[string]Counter) + } + var mapkey string + mapvalue := &Counter{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &Counter{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Counters[mapkey] = *mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Device) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6016,6 +7888,217 @@ func (m *DeviceConstraint) Unmarshal(dAtA []byte) error { } return nil } +func (m *DeviceCounterConsumption) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceCounterConsumption: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceCounterConsumption: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterSet", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterSet = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Counters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Counters == nil { + m.Counters = make(map[string]Counter) + } + var mapkey string + mapvalue := &Counter{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &Counter{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Counters[mapkey] = *mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *DeviceRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6215,6 +8298,74 @@ func (m *DeviceRequest) Unmarshal(dAtA []byte) error { } b := bool(v != 0) m.AdminAccess = &b + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FirstAvailable", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FirstAvailable = append(m.FirstAvailable, DeviceSubRequest{}) + if err := m.FirstAvailable[len(m.FirstAvailable)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tolerations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tolerations = append(m.Tolerations, DeviceToleration{}) + if err := m.Tolerations[len(m.Tolerations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -6414,6 +8565,40 @@ func (m *DeviceRequestAllocationResult) Unmarshal(dAtA []byte) error { } b := bool(v != 0) m.AdminAccess = &b + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tolerations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tolerations = append(m.Tolerations, DeviceToleration{}) + if err := m.Tolerations[len(m.Tolerations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -6521,6 +8706,1187 @@ func (m *DeviceSelector) Unmarshal(dAtA []byte) error { } return nil } +func (m *DeviceSubRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceSubRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceSubRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeviceClassName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeviceClassName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Selectors", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Selectors = append(m.Selectors, DeviceSelector{}) + if err := m.Selectors[len(m.Selectors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllocationMode", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllocationMode = DeviceAllocationMode(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + m.Count = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Count |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tolerations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tolerations = append(m.Tolerations, DeviceToleration{}) + if err := m.Tolerations[len(m.Tolerations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceTaint) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceTaint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceTaint: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Effect", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Effect = DeviceTaintEffect(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeAdded", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TimeAdded == nil { + m.TimeAdded = &v1.Time{} + } + if err := m.TimeAdded.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceTaintRule) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceTaintRule: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceTaintRule: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceTaintRuleList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceTaintRuleList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceTaintRuleList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, DeviceTaintRule{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceTaintRuleSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceTaintRuleSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceTaintRuleSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeviceSelector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DeviceSelector == nil { + m.DeviceSelector = &DeviceTaintSelector{} + } + if err := m.DeviceSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Taint", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Taint.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceTaintSelector) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceTaintSelector: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceTaintSelector: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeviceClassName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.DeviceClassName = &s + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Driver = &s + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pool", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Pool = &s + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Device", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Device = &s + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Selectors", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Selectors = append(m.Selectors, DeviceSelector{}) + if err := m.Selectors[len(m.Selectors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceToleration) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceToleration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceToleration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operator = DeviceTolerationOperator(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Effect", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Effect = DeviceTaintEffect(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TolerationSeconds", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TolerationSeconds = &v + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *NetworkDeviceData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -8381,6 +11747,61 @@ func (m *ResourceSliceSpec) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PerDeviceNodeSelection", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.PerDeviceNodeSelection = &b + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SharedCounters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SharedCounters = append(m.SharedCounters, CounterSet{}) + if err := m.SharedCounters[len(m.SharedCounters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/e2e/vendor/k8s.io/api/resource/v1alpha3/generated.proto b/e2e/vendor/k8s.io/api/resource/v1alpha3/generated.proto index e802a0143..103cafc6a 100644 --- a/e2e/vendor/k8s.io/api/resource/v1alpha3/generated.proto +++ b/e2e/vendor/k8s.io/api/resource/v1alpha3/generated.proto @@ -62,6 +62,8 @@ message AllocatedDeviceStatus { // If the device has been configured according to the class and claim // config references, the `Ready` condition should be True. // + // Must not contain more than 8 entries. + // // +optional // +listType=map // +listMapKey=type @@ -111,6 +113,64 @@ message BasicDevice { // // +optional map capacity = 2; + + // ConsumesCounters defines a list of references to sharedCounters + // and the set of counters that the device will + // consume from those counter sets. + // + // There can only be a single entry per counterSet. + // + // The total number of device counter consumption entries + // must be <= 32. In addition, the total number in the + // entire ResourceSlice must be <= 1024 (for example, + // 64 devices with 16 counters each). + // + // +optional + // +listType=atomic + // +featureGate=DRAPartitionableDevices + repeated DeviceCounterConsumption consumesCounters = 3; + + // NodeName identifies the node where the device is available. + // + // Must only be set if Spec.PerDeviceNodeSelection is set to true. + // At most one of NodeName, NodeSelector and AllNodes can be set. + // + // +optional + // +oneOf=DeviceNodeSelection + // +featureGate=DRAPartitionableDevices + optional string nodeName = 4; + + // NodeSelector defines the nodes where the device is available. + // + // Must only be set if Spec.PerDeviceNodeSelection is set to true. + // At most one of NodeName, NodeSelector and AllNodes can be set. + // + // +optional + // +oneOf=DeviceNodeSelection + // +featureGate=DRAPartitionableDevices + optional .k8s.io.api.core.v1.NodeSelector nodeSelector = 5; + + // AllNodes indicates that all nodes have access to the device. + // + // Must only be set if Spec.PerDeviceNodeSelection is set to true. + // At most one of NodeName, NodeSelector and AllNodes can be set. + // + // +optional + // +oneOf=DeviceNodeSelection + // +featureGate=DRAPartitionableDevices + optional bool allNodes = 6; + + // If specified, these are the driver-defined taints. + // + // The maximum number of taints is 4. + // + // This is an alpha field and requires enabling the DRADeviceTaints + // feature gate. + // + // +optional + // +listType=atomic + // +featureGate=DRADeviceTaints + repeated DeviceTaint taints = 7; } // CELDeviceSelector contains a CEL expression for selecting a device. @@ -170,6 +230,42 @@ message CELDeviceSelector { optional string expression = 1; } +// Counter describes a quantity associated with a device. +message Counter { + // Value defines how much of a certain device counter is available. + // + // +required + optional .k8s.io.apimachinery.pkg.api.resource.Quantity value = 1; +} + +// CounterSet defines a named set of counters +// that are available to be used by devices defined in the +// ResourceSlice. +// +// The counters are not allocatable by themselves, but +// can be referenced by devices. When a device is allocated, +// the portion of counters it uses will no longer be available for use +// by other devices. +message CounterSet { + // CounterSet is the name of the set from which the + // counters defined will be consumed. + // + // +required + optional string name = 1; + + // Counters defines the counters that will be consumed by the device. + // The name of each counter must be unique in that set and must be a DNS label. + // + // To ensure this uniqueness, capacities defined by the vendor + // must be listed without the driver name as domain prefix in + // their name. All others must be listed with their domain prefix. + // + // The maximum number of counters is 32. + // + // +required + map counters = 2; +} + // Device represents one individual hardware instance that can be selected based // on its attributes. Besides the name, exactly one field must be set. message Device { @@ -198,6 +294,10 @@ message DeviceAllocationConfiguration { // Requests lists the names of requests where the configuration applies. // If empty, its applies to all requests. // + // References to subrequests must include the name of the main request + // and may include the subrequest using the format
[/]. If just + // the main request is given, the configuration applies to all subrequests. + // // +optional // +listType=atomic repeated string requests = 2; @@ -284,6 +384,10 @@ message DeviceClaimConfiguration { // Requests lists the names of requests where the configuration applies. // If empty, it applies to all requests. // + // References to subrequests must include the name of the main request + // and may include the subrequest using the format
[/]. If just + // the main request is given, the configuration applies to all subrequests. + // // +optional // +listType=atomic repeated string requests = 1; @@ -368,6 +472,10 @@ message DeviceConstraint { // constraint. If this is not specified, this constraint applies to all // requests in this claim. // + // References to subrequests must include the name of the main request + // and may include the subrequest using the format
[/]. If just + // the main request is given, the constraint applies to all subrequests. + // // +optional // +listType=atomic repeated string requests = 1; @@ -390,14 +498,30 @@ message DeviceConstraint { optional string matchAttribute = 2; } +// DeviceCounterConsumption defines a set of counters that +// a device will consume from a CounterSet. +message DeviceCounterConsumption { + // CounterSet defines the set from which the + // counters defined will be consumed. + // + // +required + optional string counterSet = 1; + + // Counters defines the Counter that will be consumed by + // the device. + // + // The maximum number counters in a device is 32. + // In addition, the maximum number of all counters + // in all devices is 1024 (for example, 64 devices with + // 16 counters each). + // + // +required + map counters = 2; +} + // DeviceRequest is a request for devices required for a claim. // This is typically a request for a single resource like a device, but can // also ask for several identical devices. -// -// A DeviceClassName is currently required. Clients must check that it is -// indeed set. It's absence indicates that something changed in a way that -// is not supported by the client yet, in which case it must refuse to -// handle the request. message DeviceRequest { // Name can be used to reference this request in a pod.spec.containers[].resources.claims // entry and in a constraint of the claim. @@ -411,7 +535,10 @@ message DeviceRequest { // additional configuration and selectors to be inherited by this // request. // - // A class is required. Which classes are available depends on the cluster. + // A class is required if no subrequests are specified in the + // firstAvailable list and no class can be set if subrequests + // are specified in the firstAvailable list. + // Which classes are available depends on the cluster. // // Administrators may use this to restrict which devices may get // requested by only installing classes with selectors for permitted @@ -419,7 +546,8 @@ message DeviceRequest { // then administrators can create an empty DeviceClass for users // to reference. // - // +required + // +optional + // +oneOf=deviceRequestType optional string deviceClassName = 2; // Selectors define criteria which must be satisfied by a specific @@ -427,6 +555,9 @@ message DeviceRequest { // request. All selectors must be satisfied for a device to be // considered. // + // This field can only be set when deviceClassName is set and no subrequests + // are specified in the firstAvailable list. + // // +optional // +listType=atomic repeated DeviceSelector selectors = 3; @@ -439,13 +570,17 @@ message DeviceRequest { // count field. // // - All: This request is for all of the matching devices in a pool. + // At least one device must exist on the node for the allocation to succeed. // Allocation will fail if some devices are already allocated, // unless adminAccess is requested. // - // If AlloctionMode is not specified, the default mode is ExactCount. If + // If AllocationMode is not specified, the default mode is ExactCount. If // the mode is ExactCount and count is not specified, the default count is // one. Any other requests must specify this field. // + // This field can only be set when deviceClassName is set and no subrequests + // are specified in the firstAvailable list. + // // More modes may get added in the future. Clients must refuse to handle // requests with unknown modes. // @@ -455,6 +590,9 @@ message DeviceRequest { // Count is used only when the count mode is "ExactCount". Must be greater than zero. // If AllocationMode is ExactCount and this field is not specified, the default is one. // + // This field can only be set when deviceClassName is set and no subrequests + // are specified in the firstAvailable list. + // // +optional // +oneOf=AllocationMode optional int64 count = 5; @@ -465,6 +603,9 @@ message DeviceRequest { // all ordinary claims to the device with respect to access modes and // any resource allocations. // + // This field can only be set when deviceClassName is set and no subrequests + // are specified in the firstAvailable list. + // // This is an alpha field and requires enabling the DRAAdminAccess // feature gate. Admin access is disabled if this field is unset or // set to false, otherwise it is enabled. @@ -472,13 +613,65 @@ message DeviceRequest { // +optional // +featureGate=DRAAdminAccess optional bool adminAccess = 6; + + // FirstAvailable contains subrequests, of which exactly one will be + // satisfied by the scheduler to satisfy this request. It tries to + // satisfy them in the order in which they are listed here. So if + // there are two entries in the list, the scheduler will only check + // the second one if it determines that the first one cannot be used. + // + // This field may only be set in the entries of DeviceClaim.Requests. + // + // DRA does not yet implement scoring, so the scheduler will + // select the first set of devices that satisfies all the + // requests in the claim. And if the requirements can + // be satisfied on more than one node, other scheduling features + // will determine which node is chosen. This means that the set of + // devices allocated to a claim might not be the optimal set + // available to the cluster. Scoring will be implemented later. + // + // +optional + // +oneOf=deviceRequestType + // +listType=atomic + // +featureGate=DRAPrioritizedList + repeated DeviceSubRequest firstAvailable = 7; + + // If specified, the request's tolerations. + // + // Tolerations for NoSchedule are required to allocate a + // device which has a taint with that effect. The same applies + // to NoExecute. + // + // In addition, should any of the allocated devices get tainted + // with NoExecute after allocation and that effect is not tolerated, + // then all pods consuming the ResourceClaim get deleted to evict + // them. The scheduler will not let new pods reserve the claim while + // it has these tainted devices. Once all pods are evicted, the + // claim will get deallocated. + // + // The maximum number of tolerations is 16. + // + // This field can only be set when deviceClassName is set and no subrequests + // are specified in the firstAvailable list. + // + // This is an alpha field and requires enabling the DRADeviceTaints + // feature gate. + // + // +optional + // +listType=atomic + // +featureGate=DRADeviceTaints + repeated DeviceToleration tolerations = 8; } // DeviceRequestAllocationResult contains the allocation result for one request. message DeviceRequestAllocationResult { // Request is the name of the request in the claim which caused this - // device to be allocated. Multiple devices may have been allocated - // per request. + // device to be allocated. If it references a subrequest in the + // firstAvailable list on a DeviceRequest, this field must + // include both the name of the main request and the subrequest + // using the format
/. + // + // Multiple devices may have been allocated per request. // // +required optional string request = 1; @@ -519,6 +712,19 @@ message DeviceRequestAllocationResult { // +optional // +featureGate=DRAAdminAccess optional bool adminAccess = 5; + + // A copy of all tolerations specified in the request at the time + // when the device got allocated. + // + // The maximum number of tolerations is 16. + // + // This is an alpha field and requires enabling the DRADeviceTaints + // feature gate. + // + // +optional + // +listType=atomic + // +featureGate=DRADeviceTaints + repeated DeviceToleration tolerations = 6; } // DeviceSelector must have exactly one field set. @@ -530,6 +736,262 @@ message DeviceSelector { optional CELDeviceSelector cel = 1; } +// DeviceSubRequest describes a request for device provided in the +// claim.spec.devices.requests[].firstAvailable array. Each +// is typically a request for a single resource like a device, but can +// also ask for several identical devices. +// +// DeviceSubRequest is similar to Request, but doesn't expose the AdminAccess +// or FirstAvailable fields, as those can only be set on the top-level request. +// AdminAccess is not supported for requests with a prioritized list, and +// recursive FirstAvailable fields are not supported. +message DeviceSubRequest { + // Name can be used to reference this subrequest in the list of constraints + // or the list of configurations for the claim. References must use the + // format
/. + // + // Must be a DNS label. + // + // +required + optional string name = 1; + + // DeviceClassName references a specific DeviceClass, which can define + // additional configuration and selectors to be inherited by this + // subrequest. + // + // A class is required. Which classes are available depends on the cluster. + // + // Administrators may use this to restrict which devices may get + // requested by only installing classes with selectors for permitted + // devices. If users are free to request anything without restrictions, + // then administrators can create an empty DeviceClass for users + // to reference. + // + // +required + optional string deviceClassName = 2; + + // Selectors define criteria which must be satisfied by a specific + // device in order for that device to be considered for this + // request. All selectors must be satisfied for a device to be + // considered. + // + // +optional + // +listType=atomic + repeated DeviceSelector selectors = 3; + + // AllocationMode and its related fields define how devices are allocated + // to satisfy this request. Supported values are: + // + // - ExactCount: This request is for a specific number of devices. + // This is the default. The exact number is provided in the + // count field. + // + // - All: This request is for all of the matching devices in a pool. + // Allocation will fail if some devices are already allocated, + // unless adminAccess is requested. + // + // If AllocationMode is not specified, the default mode is ExactCount. If + // the mode is ExactCount and count is not specified, the default count is + // one. Any other requests must specify this field. + // + // More modes may get added in the future. Clients must refuse to handle + // requests with unknown modes. + // + // +optional + optional string allocationMode = 4; + + // Count is used only when the count mode is "ExactCount". Must be greater than zero. + // If AllocationMode is ExactCount and this field is not specified, the default is one. + // + // +optional + // +oneOf=AllocationMode + optional int64 count = 5; + + // If specified, the request's tolerations. + // + // Tolerations for NoSchedule are required to allocate a + // device which has a taint with that effect. The same applies + // to NoExecute. + // + // In addition, should any of the allocated devices get tainted + // with NoExecute after allocation and that effect is not tolerated, + // then all pods consuming the ResourceClaim get deleted to evict + // them. The scheduler will not let new pods reserve the claim while + // it has these tainted devices. Once all pods are evicted, the + // claim will get deallocated. + // + // The maximum number of tolerations is 16. + // + // This is an alpha field and requires enabling the DRADeviceTaints + // feature gate. + // + // +optional + // +listType=atomic + // +featureGate=DRADeviceTaints + repeated DeviceToleration tolerations = 7; +} + +// The device this taint is attached to has the "effect" on +// any claim which does not tolerate the taint and, through the claim, +// to pods using the claim. +message DeviceTaint { + // The taint key to be applied to a device. + // Must be a label name. + // + // +required + optional string key = 1; + + // The taint value corresponding to the taint key. + // Must be a label value. + // + // +optional + optional string value = 2; + + // The effect of the taint on claims that do not tolerate the taint + // and through such claims on the pods using them. + // Valid effects are NoSchedule and NoExecute. PreferNoSchedule as used for + // nodes is not valid here. + // + // +required + optional string effect = 3; + + // TimeAdded represents the time at which the taint was added. + // Added automatically during create or update if not set. + // + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time timeAdded = 4; +} + +// DeviceTaintRule adds one taint to all devices which match the selector. +// This has the same effect as if the taint was specified directly +// in the ResourceSlice by the DRA driver. +message DeviceTaintRule { + // Standard object metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // Spec specifies the selector and one taint. + // + // Changing the spec automatically increments the metadata.generation number. + optional DeviceTaintRuleSpec spec = 2; +} + +// DeviceTaintRuleList is a collection of DeviceTaintRules. +message DeviceTaintRuleList { + // Standard list metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // Items is the list of DeviceTaintRules. + repeated DeviceTaintRule items = 2; +} + +// DeviceTaintRuleSpec specifies the selector and one taint. +message DeviceTaintRuleSpec { + // DeviceSelector defines which device(s) the taint is applied to. + // All selector criteria must be satified for a device to + // match. The empty selector matches all devices. Without + // a selector, no devices are matches. + // + // +optional + optional DeviceTaintSelector deviceSelector = 1; + + // The taint that gets applied to matching devices. + // + // +required + optional DeviceTaint taint = 2; +} + +// DeviceTaintSelector defines which device(s) a DeviceTaintRule applies to. +// The empty selector matches all devices. Without a selector, no devices +// are matched. +message DeviceTaintSelector { + // If DeviceClassName is set, the selectors defined there must be + // satisfied by a device to be selected. This field corresponds + // to class.metadata.name. + // + // +optional + optional string deviceClassName = 1; + + // If driver is set, only devices from that driver are selected. + // This fields corresponds to slice.spec.driver. + // + // +optional + optional string driver = 2; + + // If pool is set, only devices in that pool are selected. + // + // Also setting the driver name may be useful to avoid + // ambiguity when different drivers use the same pool name, + // but this is not required because selecting pools from + // different drivers may also be useful, for example when + // drivers with node-local devices use the node name as + // their pool name. + // + // +optional + optional string pool = 3; + + // If device is set, only devices with that name are selected. + // This field corresponds to slice.spec.devices[].name. + // + // Setting also driver and pool may be required to avoid ambiguity, + // but is not required. + // + // +optional + optional string device = 4; + + // Selectors contains the same selection criteria as a ResourceClaim. + // Currently, CEL expressions are supported. All of these selectors + // must be satisfied. + // + // +optional + // +listType=atomic + repeated DeviceSelector selectors = 5; +} + +// The ResourceClaim this DeviceToleration is attached to tolerates any taint that matches +// the triple using the matching operator . +message DeviceToleration { + // Key is the taint key that the toleration applies to. Empty means match all taint keys. + // If the key is empty, operator must be Exists; this combination means to match all values and all keys. + // Must be a label name. + // + // +optional + optional string key = 1; + + // Operator represents a key's relationship to the value. + // Valid operators are Exists and Equal. Defaults to Equal. + // Exists is equivalent to wildcard for value, so that a ResourceClaim can + // tolerate all taints of a particular category. + // + // +optional + // +default="Equal" + optional string operator = 2; + + // Value is the taint value the toleration matches to. + // If the operator is Exists, the value must be empty, otherwise just a regular string. + // Must be a label value. + // + // +optional + optional string value = 3; + + // Effect indicates the taint effect to match. Empty means match all taint effects. + // When specified, allowed values are NoSchedule and NoExecute. + // + // +optional + optional string effect = 4; + + // TolerationSeconds represents the period of time the toleration (which must be + // of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, + // it is not set, which means tolerate the taint forever (do not evict). Zero and + // negative values will be treated as 0 (evict immediately) by the system. + // If larger than zero, the time when the pod needs to be evicted is calculated as
-{{range .}} -{{.Flag}}
-{{end}} -
-
-full flags configurable
- - -`)) - -type debugFlag struct { - Flag string -} - -func (f DebugFlags) addFlag(flag string) { - lock.Lock() - defer lock.Unlock() - registeredFlags[flag] = debugFlag{flag} -} - -// StringFlagSetterFunc is a func used for setting string type flag. -type StringFlagSetterFunc func(string) (string, error) - -// StringFlagPutHandler wraps an http Handler to set string type flag. -func StringFlagPutHandler(setter StringFlagSetterFunc) http.HandlerFunc { - return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - switch { - case req.Method == "PUT": - body, err := ioutil.ReadAll(req.Body) - if err != nil { - writePlainText(http.StatusBadRequest, "error reading request body: "+err.Error(), w) - return - } - defer req.Body.Close() - response, err := setter(string(body)) - if err != nil { - writePlainText(http.StatusBadRequest, err.Error(), w) - return - } - writePlainText(http.StatusOK, response, w) - return - default: - writePlainText(http.StatusNotAcceptable, "unsupported http method", w) - return - } - }) -} - -// writePlainText renders a simple string response. -func writePlainText(statusCode int, text string, w http.ResponseWriter) { - w.Header().Set("Content-Type", "text/plain") - w.Header().Set("X-Content-Type-Options", "nosniff") - w.WriteHeader(statusCode) - fmt.Fprintln(w, text) -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/server/routes/index.go b/e2e/vendor/k8s.io/apiserver/pkg/server/routes/index.go deleted file mode 100644 index 140757988..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/server/routes/index.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -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 routes - -import ( - "net/http" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apiserver/pkg/endpoints/handlers/responsewriters" - "k8s.io/apiserver/pkg/server/mux" -) - -// ListedPathProvider is an interface for providing paths that should be reported at /. -type ListedPathProvider interface { - // ListedPaths is an alphabetically sorted list of paths to be reported at /. - ListedPaths() []string -} - -// ListedPathProviders is a convenient way to combine multiple ListedPathProviders -type ListedPathProviders []ListedPathProvider - -// ListedPaths unions and sorts the included paths. -func (p ListedPathProviders) ListedPaths() []string { - ret := sets.String{} - for _, provider := range p { - for _, path := range provider.ListedPaths() { - ret.Insert(path) - } - } - - return ret.List() -} - -// Index provides a webservice for the http root / listing all known paths. -type Index struct{} - -// Install adds the Index webservice to the given mux. -func (i Index) Install(pathProvider ListedPathProvider, mux *mux.PathRecorderMux) { - handler := IndexLister{StatusCode: http.StatusOK, PathProvider: pathProvider} - - mux.UnlistedHandle("/", handler) - mux.UnlistedHandle("/index.html", handler) -} - -// IndexLister lists the available indexes with the status code provided -type IndexLister struct { - StatusCode int - PathProvider ListedPathProvider -} - -// ServeHTTP serves the available paths. -func (i IndexLister) ServeHTTP(w http.ResponseWriter, r *http.Request) { - responsewriters.WriteRawJSON(i.StatusCode, metav1.RootPaths{Paths: i.PathProvider.ListedPaths()}, w) -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/server/routes/metrics.go b/e2e/vendor/k8s.io/apiserver/pkg/server/routes/metrics.go deleted file mode 100644 index 8fd4d5599..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/server/routes/metrics.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -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 routes - -import ( - handlersmetrics "k8s.io/apiserver/pkg/endpoints/handlers/metrics" - apimetrics "k8s.io/apiserver/pkg/endpoints/metrics" - "k8s.io/apiserver/pkg/server/mux" - cachermetrics "k8s.io/apiserver/pkg/storage/cacher/metrics" - etcd3metrics "k8s.io/apiserver/pkg/storage/etcd3/metrics" - flowcontrolmetrics "k8s.io/apiserver/pkg/util/flowcontrol/metrics" - peerproxymetrics "k8s.io/apiserver/pkg/util/peerproxy/metrics" - "k8s.io/component-base/metrics/legacyregistry" -) - -// DefaultMetrics installs the default prometheus metrics handler -type DefaultMetrics struct{} - -// Install adds the DefaultMetrics handler -func (m DefaultMetrics) Install(c *mux.PathRecorderMux) { - register() - c.Handle("/metrics", legacyregistry.Handler()) -} - -// MetricsWithReset install the prometheus metrics handler extended with support for the DELETE method -// which resets the metrics. -type MetricsWithReset struct{} - -// Install adds the MetricsWithReset handler -func (m MetricsWithReset) Install(c *mux.PathRecorderMux) { - register() - c.Handle("/metrics", legacyregistry.HandlerWithReset()) -} - -// register apiserver and etcd metrics -func register() { - apimetrics.Register() - cachermetrics.Register() - etcd3metrics.Register() - flowcontrolmetrics.Register() - peerproxymetrics.Register() - handlersmetrics.Register() -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/server/routes/openapi.go b/e2e/vendor/k8s.io/apiserver/pkg/server/routes/openapi.go deleted file mode 100644 index 12c8b1ad9..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/server/routes/openapi.go +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package routes - -import ( - restful "github.com/emicklei/go-restful/v3" - "k8s.io/klog/v2" - - "k8s.io/apiserver/pkg/server/mux" - builder2 "k8s.io/kube-openapi/pkg/builder" - "k8s.io/kube-openapi/pkg/builder3" - "k8s.io/kube-openapi/pkg/common" - "k8s.io/kube-openapi/pkg/common/restfuladapter" - "k8s.io/kube-openapi/pkg/handler" - "k8s.io/kube-openapi/pkg/handler3" - "k8s.io/kube-openapi/pkg/validation/spec" -) - -// OpenAPI installs spec endpoints for each web service. -type OpenAPI struct { - Config *common.Config - V3Config *common.OpenAPIV3Config -} - -// Install adds the SwaggerUI webservice to the given mux. -func (oa OpenAPI) InstallV2(c *restful.Container, mux *mux.PathRecorderMux) (*handler.OpenAPIService, *spec.Swagger) { - spec, err := builder2.BuildOpenAPISpecFromRoutes(restfuladapter.AdaptWebServices(c.RegisteredWebServices()), oa.Config) - if err != nil { - klog.Fatalf("Failed to build open api spec for root: %v", err) - } - spec.Definitions = handler.PruneDefaults(spec.Definitions) - openAPIVersionedService := handler.NewOpenAPIService(spec) - openAPIVersionedService.RegisterOpenAPIVersionedService("/openapi/v2", mux) - - return openAPIVersionedService, spec -} - -// InstallV3 adds the static group/versions defined in the RegisteredWebServices to the OpenAPI v3 spec -func (oa OpenAPI) InstallV3(c *restful.Container, mux *mux.PathRecorderMux) *handler3.OpenAPIService { - openAPIVersionedService := handler3.NewOpenAPIService() - err := openAPIVersionedService.RegisterOpenAPIV3VersionedService("/openapi/v3", mux) - if err != nil { - klog.Fatalf("Failed to register versioned open api spec for root: %v", err) - } - - grouped := make(map[string][]*restful.WebService) - - for _, t := range c.RegisteredWebServices() { - // Strip the "/" prefix from the name - gvName := t.RootPath()[1:] - grouped[gvName] = []*restful.WebService{t} - } - - for gv, ws := range grouped { - spec, err := builder3.BuildOpenAPISpecFromRoutes(restfuladapter.AdaptWebServices(ws), oa.V3Config) - if err != nil { - klog.Errorf("Failed to build OpenAPI v3 for group %s, %q", gv, err) - - } - openAPIVersionedService.UpdateGroupVersion(gv, spec) - } - return openAPIVersionedService -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/server/routes/profiling.go b/e2e/vendor/k8s.io/apiserver/pkg/server/routes/profiling.go deleted file mode 100644 index b57d590f5..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/server/routes/profiling.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -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 routes - -import ( - "net/http" - "net/http/pprof" - - "k8s.io/apiserver/pkg/server/mux" -) - -// Profiling adds handlers for pprof under /debug/pprof. -type Profiling struct{} - -// Install adds the Profiling webservice to the given mux. -func (d Profiling) Install(c *mux.PathRecorderMux) { - c.UnlistedHandleFunc("/debug/pprof", redirectTo("/debug/pprof/")) - c.UnlistedHandlePrefix("/debug/pprof/", http.HandlerFunc(pprof.Index)) - c.UnlistedHandleFunc("/debug/pprof/profile", pprof.Profile) - c.UnlistedHandleFunc("/debug/pprof/symbol", pprof.Symbol) - c.UnlistedHandleFunc("/debug/pprof/trace", pprof.Trace) -} - -// redirectTo redirects request to a certain destination. -func redirectTo(to string) func(http.ResponseWriter, *http.Request) { - return func(rw http.ResponseWriter, req *http.Request) { - http.Redirect(rw, req, to, http.StatusFound) - } -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/server/routes/version.go b/e2e/vendor/k8s.io/apiserver/pkg/server/routes/version.go deleted file mode 100644 index 3e72f18ef..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/server/routes/version.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -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 routes - -import ( - "net/http" - - "github.com/emicklei/go-restful/v3" - - "k8s.io/apimachinery/pkg/version" - "k8s.io/apiserver/pkg/endpoints/handlers/responsewriters" -) - -// Version provides a webservice with version information. -type Version struct { - Version *version.Info -} - -// Install registers the APIServer's `/version` handler. -func (v Version) Install(c *restful.Container) { - if v.Version == nil { - return - } - - // Set up a service to return the git code version. - versionWS := new(restful.WebService) - versionWS.Path("/version") - versionWS.Doc("get the version information for this server.") - versionWS.Route( - versionWS.GET("/").To(v.handleVersion). - Doc("get the version information for this server"). - Operation("getCodeVersion"). - Produces(restful.MIME_JSON). - Consumes(restful.MIME_JSON). - Writes(version.Info{})) - - c.Add(versionWS) -} - -// handleVersion writes the server's version information. -func (v Version) handleVersion(req *restful.Request, resp *restful.Response) { - responsewriters.WriteRawJSON(http.StatusOK, *v.Version, resp.ResponseWriter) -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/server/secure_serving.go b/e2e/vendor/k8s.io/apiserver/pkg/server/secure_serving.go deleted file mode 100644 index 867c7efac..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/server/secure_serving.go +++ /dev/null @@ -1,307 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package server - -import ( - "context" - "crypto/tls" - "fmt" - "io" - "log" - "net" - "net/http" - "os" - "strings" - "time" - - "golang.org/x/net/http2" - "k8s.io/component-base/cli/flag" - "k8s.io/klog/v2" - - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apiserver/pkg/endpoints/metrics" - "k8s.io/apiserver/pkg/server/dynamiccertificates" -) - -const ( - defaultKeepAlivePeriod = 3 * time.Minute -) - -// tlsConfig produces the tls.Config to serve with. -func (s *SecureServingInfo) tlsConfig(stopCh <-chan struct{}) (*tls.Config, error) { - tlsConfig := &tls.Config{ - // Can't use SSLv3 because of POODLE and BEAST - // Can't use TLSv1.0 because of POODLE and BEAST using CBC cipher - // Can't use TLSv1.1 because of RC4 cipher usage - MinVersion: tls.VersionTLS12, - // enable HTTP2 for go's 1.7 HTTP Server - NextProtos: []string{"h2", "http/1.1"}, - } - - // these are static aspects of the tls.Config - if s.DisableHTTP2 { - klog.Info("Forcing use of http/1.1 only") - tlsConfig.NextProtos = []string{"http/1.1"} - } - if s.MinTLSVersion > 0 { - tlsConfig.MinVersion = s.MinTLSVersion - } - if len(s.CipherSuites) > 0 { - tlsConfig.CipherSuites = s.CipherSuites - insecureCiphers := flag.InsecureTLSCiphers() - for i := 0; i < len(s.CipherSuites); i++ { - for cipherName, cipherID := range insecureCiphers { - if s.CipherSuites[i] == cipherID { - klog.Warningf("Use of insecure cipher '%s' detected.", cipherName) - } - } - } - } - - if s.ClientCA != nil { - // Populate PeerCertificates in requests, but don't reject connections without certificates - // This allows certificates to be validated by authenticators, while still allowing other auth types - tlsConfig.ClientAuth = tls.RequestClientCert - } - - if s.ClientCA != nil || s.Cert != nil || len(s.SNICerts) > 0 { - dynamicCertificateController := dynamiccertificates.NewDynamicServingCertificateController( - tlsConfig, - s.ClientCA, - s.Cert, - s.SNICerts, - nil, // TODO see how to plumb an event recorder down in here. For now this results in simply klog messages. - ) - - if s.ClientCA != nil { - s.ClientCA.AddListener(dynamicCertificateController) - } - if s.Cert != nil { - s.Cert.AddListener(dynamicCertificateController) - } - // generate a context from stopCh. This is to avoid modifying files which are relying on apiserver - // TODO: See if we can pass ctx to the current method - ctx, cancel := context.WithCancel(context.Background()) - go func() { - select { - case <-stopCh: - cancel() // stopCh closed, so cancel our context - case <-ctx.Done(): - } - }() - // start controllers if possible - if controller, ok := s.ClientCA.(dynamiccertificates.ControllerRunner); ok { - // runonce to try to prime data. If this fails, it's ok because we fail closed. - // Files are required to be populated already, so this is for convenience. - if err := controller.RunOnce(ctx); err != nil { - klog.Warningf("Initial population of client CA failed: %v", err) - } - - go controller.Run(ctx, 1) - } - if controller, ok := s.Cert.(dynamiccertificates.ControllerRunner); ok { - // runonce to try to prime data. If this fails, it's ok because we fail closed. - // Files are required to be populated already, so this is for convenience. - if err := controller.RunOnce(ctx); err != nil { - klog.Warningf("Initial population of default serving certificate failed: %v", err) - } - - go controller.Run(ctx, 1) - } - for _, sniCert := range s.SNICerts { - sniCert.AddListener(dynamicCertificateController) - if controller, ok := sniCert.(dynamiccertificates.ControllerRunner); ok { - // runonce to try to prime data. If this fails, it's ok because we fail closed. - // Files are required to be populated already, so this is for convenience. - if err := controller.RunOnce(ctx); err != nil { - klog.Warningf("Initial population of SNI serving certificate failed: %v", err) - } - - go controller.Run(ctx, 1) - } - } - - // runonce to try to prime data. If this fails, it's ok because we fail closed. - // Files are required to be populated already, so this is for convenience. - if err := dynamicCertificateController.RunOnce(); err != nil { - klog.Warningf("Initial population of dynamic certificates failed: %v", err) - } - go dynamicCertificateController.Run(1, stopCh) - - tlsConfig.GetConfigForClient = dynamicCertificateController.GetConfigForClient - } - - return tlsConfig, nil -} - -// Serve runs the secure http server. It fails only if certificates cannot be loaded or the initial listen call fails. -// The actual server loop (stoppable by closing stopCh) runs in a go routine, i.e. Serve does not block. -// It returns a stoppedCh that is closed when all non-hijacked active requests have been processed. -// It returns a listenerStoppedCh that is closed when the underlying http Server has stopped listening. -func (s *SecureServingInfo) Serve(handler http.Handler, shutdownTimeout time.Duration, stopCh <-chan struct{}) (<-chan struct{}, <-chan struct{}, error) { - if s.Listener == nil { - return nil, nil, fmt.Errorf("listener must not be nil") - } - - tlsConfig, err := s.tlsConfig(stopCh) - if err != nil { - return nil, nil, err - } - - secureServer := &http.Server{ - Addr: s.Listener.Addr().String(), - Handler: handler, - MaxHeaderBytes: 1 << 20, - TLSConfig: tlsConfig, - - IdleTimeout: 90 * time.Second, // matches http.DefaultTransport keep-alive timeout - ReadHeaderTimeout: 32 * time.Second, // just shy of requestTimeoutUpperBound - } - - if !s.DisableHTTP2 { - // At least 99% of serialized resources in surveyed clusters were smaller than 256kb. - // This should be big enough to accommodate most API POST requests in a single frame, - // and small enough to allow a per connection buffer of this size multiplied by `MaxConcurrentStreams`. - const resourceBody99Percentile = 256 * 1024 - - http2Options := &http2.Server{ - IdleTimeout: 90 * time.Second, // matches http.DefaultTransport keep-alive timeout - // shrink the per-stream buffer and max framesize from the 1MB default while still accommodating most API POST requests in a single frame - MaxUploadBufferPerStream: resourceBody99Percentile, - MaxReadFrameSize: resourceBody99Percentile, - } - - // use the overridden concurrent streams setting or make the default of 250 explicit so we can size MaxUploadBufferPerConnection appropriately - if s.HTTP2MaxStreamsPerConnection > 0 { - http2Options.MaxConcurrentStreams = uint32(s.HTTP2MaxStreamsPerConnection) - } else { - // match http2.initialMaxConcurrentStreams used by clients - // this makes it so that a malicious client can only open 400 streams before we forcibly close the connection - // https://github.com/golang/net/commit/b225e7ca6dde1ef5a5ae5ce922861bda011cfabd - http2Options.MaxConcurrentStreams = 100 - } - - // increase the connection buffer size from the 1MB default to handle the specified number of concurrent streams - http2Options.MaxUploadBufferPerConnection = http2Options.MaxUploadBufferPerStream * int32(http2Options.MaxConcurrentStreams) - // apply settings to the server - if err := http2.ConfigureServer(secureServer, http2Options); err != nil { - return nil, nil, fmt.Errorf("error configuring http2: %v", err) - } - } - - // use tlsHandshakeErrorWriter to handle messages of tls handshake error - tlsErrorWriter := &tlsHandshakeErrorWriter{os.Stderr} - tlsErrorLogger := log.New(tlsErrorWriter, "", 0) - secureServer.ErrorLog = tlsErrorLogger - - klog.Infof("Serving securely on %s", secureServer.Addr) - return RunServer(secureServer, s.Listener, shutdownTimeout, stopCh) -} - -// RunServer spawns a go-routine continuously serving until the stopCh is -// closed. -// It returns a stoppedCh that is closed when all non-hijacked active requests -// have been processed. -// This function does not block -// TODO: make private when insecure serving is gone from the kube-apiserver -func RunServer( - server *http.Server, - ln net.Listener, - shutDownTimeout time.Duration, - stopCh <-chan struct{}, -) (<-chan struct{}, <-chan struct{}, error) { - if ln == nil { - return nil, nil, fmt.Errorf("listener must not be nil") - } - - // Shutdown server gracefully. - serverShutdownCh, listenerStoppedCh := make(chan struct{}), make(chan struct{}) - go func() { - defer close(serverShutdownCh) - <-stopCh - ctx, cancel := context.WithTimeout(context.Background(), shutDownTimeout) - defer cancel() - err := server.Shutdown(ctx) - if err != nil { - klog.Errorf("Failed to shutdown server: %v", err) - } - }() - - go func() { - defer utilruntime.HandleCrash() - defer close(listenerStoppedCh) - - var listener net.Listener - listener = tcpKeepAliveListener{ln} - if server.TLSConfig != nil { - listener = tls.NewListener(listener, server.TLSConfig) - } - - err := server.Serve(listener) - - msg := fmt.Sprintf("Stopped listening on %s", ln.Addr().String()) - select { - case <-stopCh: - klog.Info(msg) - default: - panic(fmt.Sprintf("%s due to error: %v", msg, err)) - } - }() - - return serverShutdownCh, listenerStoppedCh, nil -} - -// tcpKeepAliveListener sets TCP keep-alive timeouts on accepted -// connections. It's used by ListenAndServe and ListenAndServeTLS so -// dead TCP connections (e.g. closing laptop mid-download) eventually -// go away. -// -// Copied from Go 1.7.2 net/http/server.go -type tcpKeepAliveListener struct { - net.Listener -} - -func (ln tcpKeepAliveListener) Accept() (net.Conn, error) { - c, err := ln.Listener.Accept() - if err != nil { - return nil, err - } - if tc, ok := c.(*net.TCPConn); ok { - tc.SetKeepAlive(true) - tc.SetKeepAlivePeriod(defaultKeepAlivePeriod) - } - return c, nil -} - -// tlsHandshakeErrorWriter writes TLS handshake errors to klog with -// trace level - V(5), to avoid flooding of tls handshake errors. -type tlsHandshakeErrorWriter struct { - out io.Writer -} - -const tlsHandshakeErrorPrefix = "http: TLS handshake error" - -func (w *tlsHandshakeErrorWriter) Write(p []byte) (int, error) { - if strings.Contains(string(p), tlsHandshakeErrorPrefix) { - klog.V(5).Info(string(p)) - metrics.TLSHandshakeErrors.Inc() - return len(p), nil - } - - // for non tls handshake error, log it as usual - return w.out.Write(p) -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/server/signal.go b/e2e/vendor/k8s.io/apiserver/pkg/server/signal.go deleted file mode 100644 index e5334ae4c..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/server/signal.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package server - -import ( - "context" - "os" - "os/signal" -) - -var onlyOneSignalHandler = make(chan struct{}) -var shutdownHandler chan os.Signal - -// SetupSignalHandler registered for SIGTERM and SIGINT. A stop channel is returned -// which is closed on one of these signals. If a second signal is caught, the program -// is terminated with exit code 1. -// Only one of SetupSignalContext and SetupSignalHandler should be called, and only can -// be called once. -func SetupSignalHandler() <-chan struct{} { - return SetupSignalContext().Done() -} - -// SetupSignalContext is same as SetupSignalHandler, but a context.Context is returned. -// Only one of SetupSignalContext and SetupSignalHandler should be called, and only can -// be called once. -func SetupSignalContext() context.Context { - close(onlyOneSignalHandler) // panics when called twice - - shutdownHandler = make(chan os.Signal, 2) - - ctx, cancel := context.WithCancel(context.Background()) - signal.Notify(shutdownHandler, shutdownSignals...) - go func() { - <-shutdownHandler - cancel() - <-shutdownHandler - os.Exit(1) // second signal. Exit directly. - }() - - return ctx -} - -// RequestShutdown emulates a received event that is considered as shutdown signal (SIGTERM/SIGINT) -// This returns whether a handler was notified -func RequestShutdown() bool { - if shutdownHandler != nil { - select { - case shutdownHandler <- shutdownSignals[0]: - return true - default: - } - } - - return false -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/server/signal_windows.go b/e2e/vendor/k8s.io/apiserver/pkg/server/signal_windows.go deleted file mode 100644 index e7645a208..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/server/signal_windows.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package server - -import ( - "os" -) - -var shutdownSignals = []os.Signal{os.Interrupt} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/server/storage/doc.go b/e2e/vendor/k8s.io/apiserver/pkg/server/storage/doc.go deleted file mode 100644 index 71d4e2be7..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/server/storage/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package storage contains the plumbing to setup the etcd storage of the apiserver. -package storage diff --git a/e2e/vendor/k8s.io/apiserver/pkg/server/storage/resource_config.go b/e2e/vendor/k8s.io/apiserver/pkg/server/storage/resource_config.go deleted file mode 100644 index b6b3bbae4..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/server/storage/resource_config.go +++ /dev/null @@ -1,206 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package storage - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// APIResourceConfigSource is the interface to determine which groups and versions are enabled -type APIResourceConfigSource interface { - ResourceEnabled(resource schema.GroupVersionResource) bool - AnyResourceForGroupEnabled(group string) bool - ResourceExplicitlyEnabled(resource schema.GroupVersionResource) bool - VersionExplicitlyEnabled(version schema.GroupVersion) bool -} - -var _ APIResourceConfigSource = &ResourceConfig{} - -type ResourceConfig struct { - GroupVersionConfigs map[schema.GroupVersion]bool - ResourceConfigs map[schema.GroupVersionResource]bool - ExplicitGroupVersionConfigs map[schema.GroupVersion]bool - ExplicitResourceConfigs map[schema.GroupVersionResource]bool -} - -func NewResourceConfig() *ResourceConfig { - return &ResourceConfig{ - GroupVersionConfigs: map[schema.GroupVersion]bool{}, - ResourceConfigs: map[schema.GroupVersionResource]bool{}, - ExplicitGroupVersionConfigs: map[schema.GroupVersion]bool{}, - ExplicitResourceConfigs: map[schema.GroupVersionResource]bool{}, - } -} - -// DisableMatchingVersions disables all group/versions for which the matcher function returns true. -// This will remove any preferences previously set on individual resources. -func (o *ResourceConfig) DisableMatchingVersions(matcher func(gv schema.GroupVersion) bool) { - for version := range o.GroupVersionConfigs { - if matcher(version) { - o.GroupVersionConfigs[version] = false - o.removeMatchingResourcePreferences(resourceMatcherForVersion(version)) - } - } -} - -// EnableMatchingVersions enables all group/versions for which the matcher function returns true. -// This will remove any preferences previously set on individual resources. -func (o *ResourceConfig) EnableMatchingVersions(matcher func(gv schema.GroupVersion) bool) { - for version := range o.GroupVersionConfigs { - if matcher(version) { - o.GroupVersionConfigs[version] = true - o.removeMatchingResourcePreferences(resourceMatcherForVersion(version)) - } - } -} - -// resourceMatcherForVersion matches resources in the specified version -func resourceMatcherForVersion(gv schema.GroupVersion) func(gvr schema.GroupVersionResource) bool { - return func(gvr schema.GroupVersionResource) bool { - return gv == gvr.GroupVersion() - } -} - -// removeMatchingResourcePreferences removes individual resource preferences that match. This is useful when an override of a version or level enablement should -// override the previously individual preferences. -func (o *ResourceConfig) removeMatchingResourcePreferences(matcher func(gvr schema.GroupVersionResource) bool) { - keysToRemove := []schema.GroupVersionResource{} - for k := range o.ResourceConfigs { - if matcher(k) { - keysToRemove = append(keysToRemove, k) - } - } - for _, k := range keysToRemove { - delete(o.ResourceConfigs, k) - delete(o.ExplicitResourceConfigs, k) - } -} - -// DisableVersions disables the versions entirely. -// This will remove any preferences previously set on individual resources. -func (o *ResourceConfig) DisableVersions(versions ...schema.GroupVersion) { - for _, version := range versions { - o.GroupVersionConfigs[version] = false - - // a preference about a version takes priority over the previously set resources - o.removeMatchingResourcePreferences(resourceMatcherForVersion(version)) - } -} - -func (o *ResourceConfig) ExplicitlyDisableVersions(versions ...schema.GroupVersion) { - for _, version := range versions { - o.ExplicitGroupVersionConfigs[version] = false - } - o.DisableVersions(versions...) -} - -// EnableVersions enables all resources in a given groupVersion. -// This will remove any preferences previously set on individual resources. -func (o *ResourceConfig) EnableVersions(versions ...schema.GroupVersion) { - for _, version := range versions { - o.GroupVersionConfigs[version] = true - - // a preference about a version takes priority over the previously set resources - o.removeMatchingResourcePreferences(resourceMatcherForVersion(version)) - } - -} - -func (o *ResourceConfig) ExplicitlyEnableVersions(versions ...schema.GroupVersion) { - for _, version := range versions { - o.ExplicitGroupVersionConfigs[version] = true - } - o.EnableVersions(versions...) -} - -// TODO this must be removed and we enable/disable individual resources. -func (o *ResourceConfig) versionEnabled(version schema.GroupVersion) bool { - return o.GroupVersionConfigs[version] -} - -func (o *ResourceConfig) DisableResources(resources ...schema.GroupVersionResource) { - for _, resource := range resources { - o.ResourceConfigs[resource] = false - } -} - -func (o *ResourceConfig) ExplicitlyDisableResources(resources ...schema.GroupVersionResource) { - for _, resource := range resources { - o.ExplicitResourceConfigs[resource] = false - } - o.DisableResources(resources...) -} - -func (o *ResourceConfig) EnableResources(resources ...schema.GroupVersionResource) { - for _, resource := range resources { - o.ResourceConfigs[resource] = true - } -} - -func (o *ResourceConfig) ExplicitlyEnableResources(resources ...schema.GroupVersionResource) { - for _, resource := range resources { - o.ExplicitResourceConfigs[resource] = true - } - o.EnableResources(resources...) -} - -func (o *ResourceConfig) ResourceEnabled(resource schema.GroupVersionResource) bool { - // if a resource is explicitly set, that takes priority over the preference of the version. - resourceEnabled, explicitlySet := o.ResourceConfigs[resource] - if explicitlySet { - return resourceEnabled - } - - if !o.versionEnabled(resource.GroupVersion()) { - return false - } - // they are enabled by default. - return true -} - -func (o *ResourceConfig) AnyResourceForGroupEnabled(group string) bool { - for version := range o.GroupVersionConfigs { - if version.Group == group { - if o.versionEnabled(version) { - return true - } - } - } - for resource := range o.ResourceConfigs { - if resource.Group == group && o.ResourceEnabled(resource) { - return true - } - } - - return false -} - -func (o *ResourceConfig) ResourceExplicitlyEnabled(resource schema.GroupVersionResource) bool { - resourceEnabled, explicitlySet := o.ExplicitResourceConfigs[resource] - if explicitlySet { - return resourceEnabled - } - return false -} - -func (o *ResourceConfig) VersionExplicitlyEnabled(version schema.GroupVersion) bool { - versionEnabled, explicitlySet := o.ExplicitGroupVersionConfigs[version] - if explicitlySet { - return versionEnabled - } - return false -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/server/storage/resource_encoding_config.go b/e2e/vendor/k8s.io/apiserver/pkg/server/storage/resource_encoding_config.go deleted file mode 100644 index 612983cca..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/server/storage/resource_encoding_config.go +++ /dev/null @@ -1,217 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package storage - -import ( - "fmt" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - apimachineryversion "k8s.io/apimachinery/pkg/util/version" - "k8s.io/apiserver/pkg/util/compatibility" - basecompatibility "k8s.io/component-base/compatibility" -) - -type ResourceEncodingConfig interface { - // StorageEncoding returns the serialization format for the resource. - // TODO this should actually return a GroupVersionKind since you can logically have multiple "matching" Kinds - // For now, it returns just the GroupVersion for consistency with old behavior - StorageEncodingFor(schema.GroupResource) (schema.GroupVersion, error) - - // InMemoryEncodingFor returns the groupVersion for the in memory representation the storage should convert to. - InMemoryEncodingFor(schema.GroupResource) (schema.GroupVersion, error) -} - -type CompatibilityResourceEncodingConfig interface { - BackwardCompatibileStorageEncodingFor(schema.GroupResource, runtime.Object) (schema.GroupVersion, error) -} - -type DefaultResourceEncodingConfig struct { - // resources records the overriding encoding configs for individual resources. - resources map[schema.GroupResource]*OverridingResourceEncoding - scheme *runtime.Scheme - effectiveVersion basecompatibility.EffectiveVersion -} - -type OverridingResourceEncoding struct { - ExternalResourceEncoding schema.GroupVersion - InternalResourceEncoding schema.GroupVersion -} - -var _ ResourceEncodingConfig = &DefaultResourceEncodingConfig{} - -func NewDefaultResourceEncodingConfig(scheme *runtime.Scheme) *DefaultResourceEncodingConfig { - return NewDefaultResourceEncodingConfigForEffectiveVersion(scheme, compatibility.DefaultComponentGlobalsRegistry.EffectiveVersionFor(basecompatibility.DefaultKubeComponent)) -} - -func NewDefaultResourceEncodingConfigForEffectiveVersion(scheme *runtime.Scheme, effectiveVersion basecompatibility.EffectiveVersion) *DefaultResourceEncodingConfig { - return &DefaultResourceEncodingConfig{resources: map[schema.GroupResource]*OverridingResourceEncoding{}, scheme: scheme, effectiveVersion: effectiveVersion} -} - -func (o *DefaultResourceEncodingConfig) SetResourceEncoding(resourceBeingStored schema.GroupResource, externalEncodingVersion, internalVersion schema.GroupVersion) { - o.resources[resourceBeingStored] = &OverridingResourceEncoding{ - ExternalResourceEncoding: externalEncodingVersion, - InternalResourceEncoding: internalVersion, - } -} - -func (o *DefaultResourceEncodingConfig) SetEffectiveVersion(effectiveVersion basecompatibility.EffectiveVersion) { - o.effectiveVersion = effectiveVersion -} - -func (o *DefaultResourceEncodingConfig) StorageEncodingFor(resource schema.GroupResource) (schema.GroupVersion, error) { - if !o.scheme.IsGroupRegistered(resource.Group) { - return schema.GroupVersion{}, fmt.Errorf("group %q is not registered in scheme", resource.Group) - } - - resourceOverride, resourceExists := o.resources[resource] - if resourceExists { - return resourceOverride.ExternalResourceEncoding, nil - } - - // return the most preferred external version for the group - return o.scheme.PrioritizedVersionsForGroup(resource.Group)[0], nil -} - -func (o *DefaultResourceEncodingConfig) BackwardCompatibileStorageEncodingFor(resource schema.GroupResource, example runtime.Object) (schema.GroupVersion, error) { - if !o.scheme.IsGroupRegistered(resource.Group) { - return schema.GroupVersion{}, fmt.Errorf("group %q is not registered in scheme", resource.Group) - } - - // Always respect overrides - resourceOverride, resourceExists := o.resources[resource] - if resourceExists { - return resourceOverride.ExternalResourceEncoding, nil - } - - return emulatedStorageVersion( - o.scheme.PrioritizedVersionsForGroup(resource.Group)[0], - example, - o.effectiveVersion, - o.scheme) -} - -func (o *DefaultResourceEncodingConfig) InMemoryEncodingFor(resource schema.GroupResource) (schema.GroupVersion, error) { - if !o.scheme.IsGroupRegistered(resource.Group) { - return schema.GroupVersion{}, fmt.Errorf("group %q is not registered in scheme", resource.Group) - } - - resourceOverride, resourceExists := o.resources[resource] - if resourceExists { - return resourceOverride.InternalResourceEncoding, nil - } - return schema.GroupVersion{Group: resource.Group, Version: runtime.APIVersionInternal}, nil -} - -// Object interface generated from "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. -type introducedInterface interface { - APILifecycleIntroduced() (major, minor int) -} - -type replacementInterface interface { - APILifecycleReplacement() schema.GroupVersionKind -} - -func emulatedStorageVersion(binaryVersionOfResource schema.GroupVersion, example runtime.Object, effectiveVersion basecompatibility.EffectiveVersion, scheme *runtime.Scheme) (schema.GroupVersion, error) { - if example == nil || effectiveVersion == nil { - return binaryVersionOfResource, nil - } - - // Look up example in scheme to find all objects of the same Group-Kind - // Use the highest priority version for that group-kind whose lifecycle window - // includes the current emulation version. - // If no version is found, use the binary version - // (in this case the API should be disabled anyway) - gvks, _, err := scheme.ObjectKinds(example) - if err != nil { - return schema.GroupVersion{}, err - } - - var gvk schema.GroupVersionKind - for _, item := range gvks { - if item.Group != binaryVersionOfResource.Group { - continue - } - - gvk = item - break - } - - if len(gvk.Kind) == 0 { - return schema.GroupVersion{}, fmt.Errorf("object %T has no GVKs registered in scheme", example) - } - - // VersionsForGroupKind returns versions in priority order - versions := scheme.VersionsForGroupKind(schema.GroupKind{Group: gvk.Group, Kind: gvk.Kind}) - - compatibilityVersion := effectiveVersion.MinCompatibilityVersion() - - for _, gv := range versions { - if gv.Version == runtime.APIVersionInternal { - continue - } - - gvk := schema.GroupVersionKind{ - Group: gv.Group, - Version: gv.Version, - Kind: gvk.Kind, - } - - exampleOfGVK, err := scheme.New(gvk) - if err != nil { - return schema.GroupVersion{}, err - } - - // If it was introduced after current compatibility version, don't use it - // skip the introduced check for test when current compatibility version is 0.0 to test all apis - if introduced, hasIntroduced := exampleOfGVK.(introducedInterface); hasIntroduced && (compatibilityVersion.Major() > 0 || compatibilityVersion.Minor() > 0) { - - // Skip versions that have a replacement. - // This can be used to override this storage version selection by - // marking a storage version has having a replacement and preventing a - // that storage version from being selected. - if _, hasReplacement := exampleOfGVK.(replacementInterface); hasReplacement { - continue - } - // API resource lifecycles should be relative to k8s api version - majorIntroduced, minorIntroduced := introduced.APILifecycleIntroduced() - introducedVer := apimachineryversion.MajorMinor(uint(majorIntroduced), uint(minorIntroduced)) - if introducedVer.GreaterThan(compatibilityVersion) { - continue - } - } - - // versions is returned in priority order, so just use first result - return gvk.GroupVersion(), nil - } - - // Getting here means we're serving a version that is unknown to the - // min-compatibility-version server. - // - // This is only expected to happen when serving an alpha API type due - // to missing pre-release lifecycle information - // (which doesn't happen by default), or when emulation-version and - // min-compatibility-version are several versions apart so a beta or GA API - // was being served which didn't exist at all in min-compatibility-version. - // - // In the alpha case - we do not support compatibility versioning of - // alpha types and recommend users do not mix the two. - // In the skip-level case - The version of apiserver we are retaining - // compatibility with has no knowledge of the type, - // so storing it in another type is no issue. - return binaryVersionOfResource, nil -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/server/storage/storage_codec.go b/e2e/vendor/k8s.io/apiserver/pkg/server/storage/storage_codec.go deleted file mode 100644 index 4f5a398a0..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/server/storage/storage_codec.go +++ /dev/null @@ -1,103 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package storage - -import ( - "fmt" - "mime" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/runtime/serializer/recognizer" - "k8s.io/apiserver/pkg/storage/storagebackend" -) - -// StorageCodecConfig are the arguments passed to newStorageCodecFn -type StorageCodecConfig struct { - StorageMediaType string - StorageSerializer runtime.StorageSerializer - StorageVersion schema.GroupVersion - MemoryVersion schema.GroupVersion - Config storagebackend.Config - - EncoderDecoratorFn func(runtime.Encoder) runtime.Encoder - DecoderDecoratorFn func([]runtime.Decoder) []runtime.Decoder -} - -// NewStorageCodec assembles a storage codec for the provided storage media type, the provided serializer, and the requested -// storage and memory versions. -func NewStorageCodec(opts StorageCodecConfig) (runtime.Codec, runtime.GroupVersioner, error) { - mediaType, _, err := mime.ParseMediaType(opts.StorageMediaType) - if err != nil { - return nil, nil, fmt.Errorf("%q is not a valid mime-type", opts.StorageMediaType) - } - - supportedMediaTypes := opts.StorageSerializer.SupportedMediaTypes() - serializer, ok := runtime.SerializerInfoForMediaType(supportedMediaTypes, mediaType) - if !ok { - supportedMediaTypeList := make([]string, len(supportedMediaTypes)) - for i, mediaType := range supportedMediaTypes { - supportedMediaTypeList[i] = mediaType.MediaType - } - return nil, nil, fmt.Errorf("unable to find serializer for %q, supported media types: %v", mediaType, supportedMediaTypeList) - } - - s := serializer.Serializer - - // Give callers the opportunity to wrap encoders and decoders. For decoders, each returned decoder will - // be passed to the recognizer so that multiple decoders are available. - var encoder runtime.Encoder = s - if opts.EncoderDecoratorFn != nil { - encoder = opts.EncoderDecoratorFn(encoder) - } - decoders := []runtime.Decoder{ - // selected decoder as the primary - s, - // universal deserializer as a fallback - opts.StorageSerializer.UniversalDeserializer(), - // base64-wrapped universal deserializer as a last resort. - // this allows reading base64-encoded protobuf, which should only exist if etcd2+protobuf was used at some point. - // data written that way could exist in etcd2, or could have been migrated to etcd3. - // TODO: flag this type of data if we encounter it, require migration (read to decode, write to persist using a supported encoder), and remove in 1.8 - runtime.NewBase64Serializer(nil, opts.StorageSerializer.UniversalDeserializer()), - } - if opts.DecoderDecoratorFn != nil { - decoders = opts.DecoderDecoratorFn(decoders) - } - - encodeVersioner := runtime.NewMultiGroupVersioner( - opts.StorageVersion, - schema.GroupKind{Group: opts.StorageVersion.Group}, - schema.GroupKind{Group: opts.MemoryVersion.Group}, - ) - - // Ensure the storage receives the correct version. - encoder = opts.StorageSerializer.EncoderForVersion( - encoder, - encodeVersioner, - ) - decoder := opts.StorageSerializer.DecoderToVersion( - recognizer.NewDecoder(decoders...), - runtime.NewCoercingMultiGroupVersioner( - opts.MemoryVersion, - schema.GroupKind{Group: opts.MemoryVersion.Group}, - schema.GroupKind{Group: opts.StorageVersion.Group}, - ), - ) - - return runtime.NewCodec(encoder, decoder), encodeVersioner, nil -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/server/storage/storage_factory.go b/e2e/vendor/k8s.io/apiserver/pkg/server/storage/storage_factory.go deleted file mode 100644 index f4ccc62f6..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/server/storage/storage_factory.go +++ /dev/null @@ -1,372 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package storage - -import ( - "crypto/tls" - "crypto/x509" - "os" - "strings" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apiserver/pkg/storage/storagebackend" - "k8s.io/klog/v2" -) - -// Backend describes the storage servers, the information here should be enough -// for health validations. -type Backend struct { - // the url of storage backend like: https://etcd.domain:2379 - Server string - // the required tls config - TLSConfig *tls.Config -} - -// StorageFactory is the interface to locate the storage for a given GroupResource -type StorageFactory interface { - // New finds the storage destination for the given group and resource. It will - // return an error if the group has no storage destination configured. - NewConfig(groupResource schema.GroupResource, example runtime.Object) (*storagebackend.ConfigForResource, error) - - // ResourcePrefix returns the overridden resource prefix for the GroupResource - // This allows for cohabitation of resources with different native types and provides - // centralized control over the shape of etcd directories - ResourcePrefix(groupResource schema.GroupResource) string - - // Configs gets configurations for all of registered storage destinations. - Configs() []storagebackend.Config - - // Backends gets all backends for all registered storage destinations. - // Used for getting all instances for health validations. - // Deprecated: Use Configs instead - Backends() []Backend -} - -// DefaultStorageFactory takes a GroupResource and returns back its storage interface. This result includes: -// 1. Merged etcd config, including: auth, server locations, prefixes -// 2. Resource encodings for storage: group,version,kind to store as -// 3. Cohabitating default: some resources like hpa are exposed through multiple APIs. They must agree on 1 and 2 -type DefaultStorageFactory struct { - // StorageConfig describes how to create a storage backend in general. - // Its authentication information will be used for every storage.Interface returned. - StorageConfig storagebackend.Config - - Overrides map[schema.GroupResource]groupResourceOverrides - - DefaultResourcePrefixes map[schema.GroupResource]string - - // DefaultMediaType is the media type used to store resources. If it is not set, "application/json" is used. - DefaultMediaType string - - // DefaultSerializer is used to create encoders and decoders for the storage.Interface. - DefaultSerializer runtime.StorageSerializer - - // ResourceEncodingConfig describes how to encode a particular GroupVersionResource - ResourceEncodingConfig ResourceEncodingConfig - - // APIResourceConfigSource indicates whether the *storage* is enabled, NOT the API - // This is discrete from resource enablement because those are separate concerns. How this source is configured - // is left to the caller. - APIResourceConfigSource APIResourceConfigSource - - // newStorageCodecFn exists to be overwritten for unit testing. - newStorageCodecFn func(opts StorageCodecConfig) (codec runtime.Codec, encodeVersioner runtime.GroupVersioner, err error) -} - -type groupResourceOverrides struct { - // etcdLocation contains the list of "special" locations that are used for particular GroupResources - // These are merged on top of the StorageConfig when requesting the storage.Interface for a given GroupResource - etcdLocation []string - // etcdPrefix is the base location for a GroupResource. - etcdPrefix string - // etcdResourcePrefix is the location to use to store a particular type under the `etcdPrefix` location - // If empty, the default mapping is used. If the default mapping doesn't contain an entry, it will use - // the ToLowered name of the resource, not including the group. - etcdResourcePrefix string - // mediaType is the desired serializer to choose. If empty, the default is chosen. - mediaType string - // serializer contains the list of "special" serializers for a GroupResource. Resource=* means for the entire group - serializer runtime.StorageSerializer - // cohabitatingResources keeps track of which resources must be stored together. This happens when we have multiple ways - // of exposing one set of concepts. autoscaling.HPA and extensions.HPA as a for instance - // The order of the slice matters! It is the priority order of lookup for finding a storage location - cohabitatingResources []schema.GroupResource - // encoderDecoratorFn is optional and may wrap the provided encoder prior to being serialized. - encoderDecoratorFn func(runtime.Encoder) runtime.Encoder - // decoderDecoratorFn is optional and may wrap the provided decoders (can add new decoders). The order of - // returned decoders will be priority for attempt to decode. - decoderDecoratorFn func([]runtime.Decoder) []runtime.Decoder -} - -// Apply overrides the provided config and options if the override has a value in that position -func (o groupResourceOverrides) Apply(config *storagebackend.Config, options *StorageCodecConfig) { - if len(o.etcdLocation) > 0 { - config.Transport.ServerList = o.etcdLocation - } - if len(o.etcdPrefix) > 0 { - config.Prefix = o.etcdPrefix - } - - if len(o.mediaType) > 0 { - options.StorageMediaType = o.mediaType - } - if o.serializer != nil { - options.StorageSerializer = o.serializer - } - if o.encoderDecoratorFn != nil { - options.EncoderDecoratorFn = o.encoderDecoratorFn - } - if o.decoderDecoratorFn != nil { - options.DecoderDecoratorFn = o.decoderDecoratorFn - } -} - -var _ StorageFactory = &DefaultStorageFactory{} - -const AllResources = "*" - -func NewDefaultStorageFactory( - config storagebackend.Config, - defaultMediaType string, - defaultSerializer runtime.StorageSerializer, - resourceEncodingConfig ResourceEncodingConfig, - resourceConfig APIResourceConfigSource, - specialDefaultResourcePrefixes map[schema.GroupResource]string, -) *DefaultStorageFactory { - if len(defaultMediaType) == 0 { - defaultMediaType = runtime.ContentTypeJSON - } - return &DefaultStorageFactory{ - StorageConfig: config, - Overrides: map[schema.GroupResource]groupResourceOverrides{}, - DefaultMediaType: defaultMediaType, - DefaultSerializer: defaultSerializer, - ResourceEncodingConfig: resourceEncodingConfig, - APIResourceConfigSource: resourceConfig, - DefaultResourcePrefixes: specialDefaultResourcePrefixes, - - newStorageCodecFn: NewStorageCodec, - } -} - -func (s *DefaultStorageFactory) SetEtcdLocation(groupResource schema.GroupResource, location []string) { - overrides := s.Overrides[groupResource] - overrides.etcdLocation = location - s.Overrides[groupResource] = overrides -} - -func (s *DefaultStorageFactory) SetEtcdPrefix(groupResource schema.GroupResource, prefix string) { - overrides := s.Overrides[groupResource] - overrides.etcdPrefix = prefix - s.Overrides[groupResource] = overrides -} - -// SetResourceEtcdPrefix sets the prefix for a resource, but not the base-dir. You'll end up in `etcdPrefix/resourceEtcdPrefix`. -func (s *DefaultStorageFactory) SetResourceEtcdPrefix(groupResource schema.GroupResource, prefix string) { - overrides := s.Overrides[groupResource] - overrides.etcdResourcePrefix = prefix - s.Overrides[groupResource] = overrides -} - -func (s *DefaultStorageFactory) SetSerializer(groupResource schema.GroupResource, mediaType string, serializer runtime.StorageSerializer) { - overrides := s.Overrides[groupResource] - overrides.mediaType = mediaType - overrides.serializer = serializer - s.Overrides[groupResource] = overrides -} - -// AddCohabitatingResources links resources together the order of the slice matters! its the priority order of lookup for finding a storage location -func (s *DefaultStorageFactory) AddCohabitatingResources(groupResources ...schema.GroupResource) { - for _, groupResource := range groupResources { - overrides := s.Overrides[groupResource] - overrides.cohabitatingResources = groupResources - s.Overrides[groupResource] = overrides - } -} - -func (s *DefaultStorageFactory) AddSerializationChains(encoderDecoratorFn func(runtime.Encoder) runtime.Encoder, decoderDecoratorFn func([]runtime.Decoder) []runtime.Decoder, groupResources ...schema.GroupResource) { - for _, groupResource := range groupResources { - overrides := s.Overrides[groupResource] - overrides.encoderDecoratorFn = encoderDecoratorFn - overrides.decoderDecoratorFn = decoderDecoratorFn - s.Overrides[groupResource] = overrides - } -} - -func getAllResourcesAlias(resource schema.GroupResource) schema.GroupResource { - return schema.GroupResource{Group: resource.Group, Resource: AllResources} -} - -func (s *DefaultStorageFactory) getStorageGroupResource(groupResource schema.GroupResource) schema.GroupResource { - for _, potentialStorageResource := range s.Overrides[groupResource].cohabitatingResources { - // TODO deads2k or liggitt determine if have ever stored any of our cohabitating resources in a different location on new clusters - if s.APIResourceConfigSource.AnyResourceForGroupEnabled(potentialStorageResource.Group) { - return potentialStorageResource - } - } - - return groupResource -} - -// New finds the storage destination for the given group and resource. It will -// return an error if the group has no storage destination configured. -func (s *DefaultStorageFactory) NewConfig(groupResource schema.GroupResource, example runtime.Object) (*storagebackend.ConfigForResource, error) { - chosenStorageResource := s.getStorageGroupResource(groupResource) - - // operate on copy - storageConfig := s.StorageConfig - codecConfig := StorageCodecConfig{ - StorageMediaType: s.DefaultMediaType, - StorageSerializer: s.DefaultSerializer, - } - - if override, ok := s.Overrides[getAllResourcesAlias(chosenStorageResource)]; ok { - override.Apply(&storageConfig, &codecConfig) - } - if override, ok := s.Overrides[chosenStorageResource]; ok { - override.Apply(&storageConfig, &codecConfig) - } - - var err error - if backwardCompatibleInterface, ok := s.ResourceEncodingConfig.(CompatibilityResourceEncodingConfig); ok { - codecConfig.StorageVersion, err = backwardCompatibleInterface.BackwardCompatibileStorageEncodingFor(chosenStorageResource, example) - if err != nil { - return nil, err - } - } else { - codecConfig.StorageVersion, err = s.ResourceEncodingConfig.StorageEncodingFor(chosenStorageResource) - if err != nil { - return nil, err - } - } - - codecConfig.MemoryVersion, err = s.ResourceEncodingConfig.InMemoryEncodingFor(groupResource) - if err != nil { - return nil, err - } - - codecConfig.Config = storageConfig - - storageConfig.Codec, storageConfig.EncodeVersioner, err = s.newStorageCodecFn(codecConfig) - if err != nil { - return nil, err - } - klog.V(3).Infof("storing %v in %v, reading as %v from %#v", groupResource, codecConfig.StorageVersion, codecConfig.MemoryVersion, codecConfig.Config) - - return storageConfig.ForResource(groupResource), nil -} - -// Configs implements StorageFactory. -func (s *DefaultStorageFactory) Configs() []storagebackend.Config { - return configs(s.StorageConfig, s.Overrides) -} - -// Configs gets configurations for all of registered storage destinations. -func Configs(storageConfig storagebackend.Config) []storagebackend.Config { - return configs(storageConfig, nil) -} - -// Returns all storage configurations including those for group resource overrides -func configs(storageConfig storagebackend.Config, grOverrides map[schema.GroupResource]groupResourceOverrides) []storagebackend.Config { - configs := []storagebackend.Config{storageConfig} - - for _, override := range grOverrides { - if len(override.etcdLocation) == 0 { - continue - } - // copy - newConfig := storageConfig - override.Apply(&newConfig, &StorageCodecConfig{}) - newConfig.Transport.ServerList = override.etcdLocation - configs = append(configs, newConfig) - } - return configs -} - -// Backends implements StorageFactory. -func (s *DefaultStorageFactory) Backends() []Backend { - return backends(s.StorageConfig, s.Overrides) -} - -// Backends returns all backends for all registered storage destinations. -// Used for getting all instances for health validations. -// Deprecated: Validate health by passing storagebackend.Config directly to storagefactory.CreateProber. -func Backends(storageConfig storagebackend.Config) []Backend { - return backends(storageConfig, nil) -} - -func backends(storageConfig storagebackend.Config, grOverrides map[schema.GroupResource]groupResourceOverrides) []Backend { - servers := sets.NewString(storageConfig.Transport.ServerList...) - - for _, overrides := range grOverrides { - servers.Insert(overrides.etcdLocation...) - } - - tlsConfig := &tls.Config{ - InsecureSkipVerify: true, - } - if len(storageConfig.Transport.CertFile) > 0 && len(storageConfig.Transport.KeyFile) > 0 { - cert, err := tls.LoadX509KeyPair(storageConfig.Transport.CertFile, storageConfig.Transport.KeyFile) - if err != nil { - klog.Errorf("failed to load key pair while getting backends: %s", err) - } else { - tlsConfig.Certificates = []tls.Certificate{cert} - } - } - if len(storageConfig.Transport.TrustedCAFile) > 0 { - if caCert, err := os.ReadFile(storageConfig.Transport.TrustedCAFile); err != nil { - klog.Errorf("failed to read ca file while getting backends: %s", err) - } else { - caPool := x509.NewCertPool() - caPool.AppendCertsFromPEM(caCert) - tlsConfig.RootCAs = caPool - tlsConfig.InsecureSkipVerify = false - } - } - - backends := []Backend{} - for server := range servers { - backends = append(backends, Backend{ - Server: server, - // We can't share TLSConfig across different backends to avoid races. - // For more details see: https://pr.k8s.io/59338 - TLSConfig: tlsConfig.Clone(), - }) - } - return backends -} - -func (s *DefaultStorageFactory) ResourcePrefix(groupResource schema.GroupResource) string { - chosenStorageResource := s.getStorageGroupResource(groupResource) - groupOverride := s.Overrides[getAllResourcesAlias(chosenStorageResource)] - exactResourceOverride := s.Overrides[chosenStorageResource] - - etcdResourcePrefix := s.DefaultResourcePrefixes[chosenStorageResource] - if len(groupOverride.etcdResourcePrefix) > 0 { - etcdResourcePrefix = groupOverride.etcdResourcePrefix - } - if len(exactResourceOverride.etcdResourcePrefix) > 0 { - etcdResourcePrefix = exactResourceOverride.etcdResourcePrefix - } - if len(etcdResourcePrefix) == 0 { - etcdResourcePrefix = strings.ToLower(chosenStorageResource.Resource) - } - - return etcdResourcePrefix -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/server/storage_readiness_hook.go b/e2e/vendor/k8s.io/apiserver/pkg/server/storage_readiness_hook.go deleted file mode 100644 index 64fc241a6..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/server/storage_readiness_hook.go +++ /dev/null @@ -1,91 +0,0 @@ -/* -Copyright 2024 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package server - -import ( - "context" - "errors" - "sync" - "time" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apiserver/pkg/registry/rest" - "k8s.io/klog/v2" -) - -// StorageReadinessHook implements PostStartHook functionality for checking readiness -// of underlying storage for registered resources. -type StorageReadinessHook struct { - timeout time.Duration - - lock sync.Mutex - checks map[string]func() error -} - -// NewStorageReadinessHook created new StorageReadinessHook. -func NewStorageReadinessHook(timeout time.Duration) *StorageReadinessHook { - return &StorageReadinessHook{ - checks: make(map[string]func() error), - timeout: timeout, - } -} - -func (h *StorageReadinessHook) RegisterStorage(gvr metav1.GroupVersionResource, storage rest.StorageWithReadiness) { - h.lock.Lock() - defer h.lock.Unlock() - - if _, ok := h.checks[gvr.String()]; !ok { - h.checks[gvr.String()] = storage.ReadinessCheck - } else { - klog.Errorf("Registering storage readiness hook for %s again: ", gvr.String()) - } -} - -func (h *StorageReadinessHook) check() bool { - h.lock.Lock() - defer h.lock.Unlock() - - failedChecks := []string{} - for gvr, check := range h.checks { - if err := check(); err != nil { - failedChecks = append(failedChecks, gvr) - } - } - if len(failedChecks) == 0 { - klog.Infof("Storage is ready for all registered resources") - return true - } - klog.V(4).Infof("Storage is not ready for: %v", failedChecks) - return false -} - -func (h *StorageReadinessHook) Hook(ctx PostStartHookContext) error { - deadlineCtx, cancel := context.WithTimeout(ctx, h.timeout) - defer cancel() - err := wait.PollUntilContextCancel(deadlineCtx, 100*time.Millisecond, true, - func(_ context.Context) (bool, error) { - if ok := h.check(); ok { - return true, nil - } - return false, nil - }) - if errors.Is(err, context.DeadlineExceeded) { - klog.Warningf("Deadline exceeded while waiting for storage readiness... ignoring") - } - return nil -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/cache_watcher.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/cache_watcher.go deleted file mode 100644 index c06aefe3d..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/cache_watcher.go +++ /dev/null @@ -1,545 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cacher - -import ( - "context" - "fmt" - "sync" - "time" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/apiserver/pkg/storage" - "k8s.io/apiserver/pkg/storage/cacher/metrics" - utilflowcontrol "k8s.io/apiserver/pkg/util/flowcontrol" - - "k8s.io/klog/v2" -) - -// possible states of the cache watcher -const ( - // cacheWatcherWaitingForBookmark indicates the cacher - // is waiting for a bookmark event with a specific RV set - cacheWatcherWaitingForBookmark = iota - - // cacheWatcherBookmarkReceived indicates that the cacher - // has received a bookmark event with required RV - cacheWatcherBookmarkReceived - - // cacheWatcherBookmarkSent indicates that the cacher - // has already sent a bookmark event to a client - cacheWatcherBookmarkSent -) - -// cacheWatcher implements watch.Interface -// this is not thread-safe -type cacheWatcher struct { - input chan *watchCacheEvent - result chan watch.Event - done chan struct{} - filter filterWithAttrsFunc - stopped bool - forget func(bool) - versioner storage.Versioner - // The watcher will be closed by server after the deadline, - // save it here to send bookmark events before that. - deadline time.Time - allowWatchBookmarks bool - groupResource schema.GroupResource - - // human readable identifier that helps assigning cacheWatcher - // instance with request - identifier string - - // drainInputBuffer indicates whether we should delay closing this watcher - // and send all event in the input buffer. - drainInputBuffer bool - - // bookmarkAfterResourceVersion holds an RV that indicates - // when we should start delivering bookmark events. - // If this field holds the value of 0 that means - // we don't have any special preferences toward delivering bookmark events. - // Note that this field is used in conjunction with the state field. - // It should not be changed once the watcher has been started. - bookmarkAfterResourceVersion uint64 - - // stateMutex protects state - stateMutex sync.Mutex - - // state holds a numeric value indicating the current state of the watcher - state int -} - -func newCacheWatcher( - chanSize int, - filter filterWithAttrsFunc, - forget func(bool), - versioner storage.Versioner, - deadline time.Time, - allowWatchBookmarks bool, - groupResource schema.GroupResource, - identifier string, -) *cacheWatcher { - return &cacheWatcher{ - input: make(chan *watchCacheEvent, chanSize), - result: make(chan watch.Event, chanSize), - done: make(chan struct{}), - filter: filter, - stopped: false, - forget: forget, - versioner: versioner, - deadline: deadline, - allowWatchBookmarks: allowWatchBookmarks, - groupResource: groupResource, - identifier: identifier, - } -} - -// Implements watch.Interface. -func (c *cacheWatcher) ResultChan() <-chan watch.Event { - return c.result -} - -// Implements watch.Interface. -func (c *cacheWatcher) Stop() { - c.forget(false) -} - -// we rely on the fact that stopLocked is actually protected by Cacher.Lock() -func (c *cacheWatcher) stopLocked() { - if !c.stopped { - c.stopped = true - // stop without draining the input channel was requested. - if !c.drainInputBuffer { - close(c.done) - } - close(c.input) - } - - // Even if the watcher was already stopped, if it previously was - // using draining mode and it's not using it now we need to - // close the done channel now. Otherwise we could leak the - // processing goroutine if it will be trying to put more objects - // into result channel, the channel will be full and there will - // already be noone on the processing the events on the receiving end. - if !c.drainInputBuffer && !c.isDoneChannelClosedLocked() { - close(c.done) - } -} - -func (c *cacheWatcher) nonblockingAdd(event *watchCacheEvent) bool { - // if the bookmarkAfterResourceVersion hasn't been seen - // we will try to deliver a bookmark event every second. - // the following check will discard a bookmark event - // if it is < than the bookmarkAfterResourceVersion - // so that we don't pollute the input channel - if event.Type == watch.Bookmark && event.ResourceVersion < c.bookmarkAfterResourceVersion { - return false - } - select { - case c.input <- event: - c.markBookmarkAfterRvAsReceived(event) - return true - default: - return false - } -} - -// Nil timer means that add will not block (if it can't send event immediately, it will break the watcher) -// -// Note that bookmark events are never added via the add method only via the nonblockingAdd. -// Changing this behaviour will require moving the markBookmarkAfterRvAsReceived method -func (c *cacheWatcher) add(event *watchCacheEvent, timer *time.Timer) bool { - // Try to send the event immediately, without blocking. - if c.nonblockingAdd(event) { - return true - } - - closeFunc := func() { - // This means that we couldn't send event to that watcher. - // Since we don't want to block on it infinitely, - // we simply terminate it. - metrics.TerminatedWatchersCounter.WithLabelValues(c.groupResource.String()).Inc() - // This means that we couldn't send event to that watcher. - // Since we don't want to block on it infinitely, we simply terminate it. - - // we are graceful = false, when: - // - // (a) The bookmarkAfterResourceVersionReceived hasn't been received, - // we can safely terminate the watcher. Because the client is waiting - // for this specific bookmark, and we even haven't received one. - // (b) We have seen the bookmarkAfterResourceVersion, and it was sent already to the client. - // We can simply terminate the watcher. - - // we are graceful = true, when: - // - // (a) We have seen a bookmark, but it hasn't been sent to the client yet. - // That means we should drain the input buffer which contains - // the bookmarkAfterResourceVersion we want. We do that to make progress - // as clients can re-establish a new watch with the given RV and receive - // further notifications. - graceful := func() bool { - c.stateMutex.Lock() - defer c.stateMutex.Unlock() - return c.state == cacheWatcherBookmarkReceived - }() - klog.V(1).Infof("Forcing %v watcher close due to unresponsiveness: %v. len(c.input) = %v, len(c.result) = %v, graceful = %v", c.groupResource.String(), c.identifier, len(c.input), len(c.result), graceful) - c.forget(graceful) - } - - if timer == nil { - closeFunc() - return false - } - - // OK, block sending, but only until timer fires. - select { - case c.input <- event: - return true - case <-timer.C: - closeFunc() - return false - } -} - -func (c *cacheWatcher) nextBookmarkTime(now time.Time, bookmarkFrequency time.Duration) (time.Time, bool) { - // We try to send bookmarks: - // - // (a) right before the watcher timeout - for now we simply set it 2s before - // the deadline - // - // (b) roughly every minute - // - // (c) immediately when the bookmarkAfterResourceVersion wasn't confirmed - // in this scenario the client have already seen (or is in the process of sending) - // all initial data and is interested in seeing - // a specific RV value (aka. the bookmarkAfterResourceVersion) - // since we don't know when the cacher will see the RV we increase frequency - // - // (b) gives us periodicity if the watch breaks due to unexpected - // conditions, (a) ensures that on timeout the watcher is as close to - // now as possible - this covers 99% of cases. - - if !c.wasBookmarkAfterRvReceived() { - return time.Time{}, true // schedule immediately - } - - heartbeatTime := now.Add(bookmarkFrequency) - if c.deadline.IsZero() { - // Timeout is set by our client libraries (e.g. reflector) as well as defaulted by - // apiserver if properly configured. So this shoudln't happen in practice. - return heartbeatTime, true - } - if pretimeoutTime := c.deadline.Add(-2 * time.Second); pretimeoutTime.Before(heartbeatTime) { - heartbeatTime = pretimeoutTime - } - - if heartbeatTime.Before(now) { - return time.Time{}, false - } - return heartbeatTime, true -} - -// wasBookmarkAfterRvReceived same as wasBookmarkAfterRvReceivedLocked just acquires a lock -func (c *cacheWatcher) wasBookmarkAfterRvReceived() bool { - c.stateMutex.Lock() - defer c.stateMutex.Unlock() - return c.wasBookmarkAfterRvReceivedLocked() -} - -// wasBookmarkAfterRvReceivedLocked checks if the given cacheWatcher -// have seen a bookmark event >= bookmarkAfterResourceVersion -func (c *cacheWatcher) wasBookmarkAfterRvReceivedLocked() bool { - return c.state != cacheWatcherWaitingForBookmark -} - -// markBookmarkAfterRvAsReceived indicates that the given cacheWatcher -// have seen a bookmark event >= bookmarkAfterResourceVersion -func (c *cacheWatcher) markBookmarkAfterRvAsReceived(event *watchCacheEvent) { - if event.Type == watch.Bookmark { - c.stateMutex.Lock() - defer c.stateMutex.Unlock() - if c.wasBookmarkAfterRvReceivedLocked() { - return - } - // bookmark events are scheduled by startDispatchingBookmarkEvents method - // since we received a bookmark event that means we have - // converged towards the expected RV and it is okay to update the state so that - // this cacher can be scheduler for a regular bookmark events - c.state = cacheWatcherBookmarkReceived - } -} - -// wasBookmarkAfterRvSentLocked checks if a bookmark event -// with an RV >= the bookmarkAfterResourceVersion has been sent by this watcher -func (c *cacheWatcher) wasBookmarkAfterRvSentLocked() bool { - return c.state == cacheWatcherBookmarkSent -} - -// wasBookmarkAfterRvSent same as wasBookmarkAfterRvSentLocked just acquires a lock -func (c *cacheWatcher) wasBookmarkAfterRvSent() bool { - c.stateMutex.Lock() - defer c.stateMutex.Unlock() - return c.wasBookmarkAfterRvSentLocked() -} - -// markBookmarkAfterRvSent indicates that the given cacheWatcher -// have sent a bookmark event with an RV >= the bookmarkAfterResourceVersion -// -// this function relies on the fact that the nonblockingAdd method -// won't admit a bookmark event with an RV < the bookmarkAfterResourceVersion -// so the first received bookmark event is considered to match the bookmarkAfterResourceVersion -func (c *cacheWatcher) markBookmarkAfterRvSent(event *watchCacheEvent) { - // note that bookmark events are not so common so will acquire a lock every ~60 second or so - if event.Type == watch.Bookmark { - c.stateMutex.Lock() - defer c.stateMutex.Unlock() - if !c.wasBookmarkAfterRvSentLocked() { - c.state = cacheWatcherBookmarkSent - } - } -} - -// setBookmarkAfterResourceVersion sets the bookmarkAfterResourceVersion and the state associated with it -func (c *cacheWatcher) setBookmarkAfterResourceVersion(bookmarkAfterResourceVersion uint64) { - state := cacheWatcherWaitingForBookmark - if bookmarkAfterResourceVersion == 0 { - state = cacheWatcherBookmarkSent // if no specific RV was requested we assume no-op - } - c.state = state - c.bookmarkAfterResourceVersion = bookmarkAfterResourceVersion -} - -// setDrainInputBufferLocked if set to true indicates that we should delay closing this watcher -// until we send all events residing in the input buffer. -func (c *cacheWatcher) setDrainInputBufferLocked(drain bool) { - c.drainInputBuffer = drain -} - -// isDoneChannelClosed checks if c.done channel is closed -func (c *cacheWatcher) isDoneChannelClosedLocked() bool { - select { - case <-c.done: - return true - default: - } - return false -} - -func getMutableObject(object runtime.Object) runtime.Object { - if _, ok := object.(*cachingObject); ok { - // It is safe to return without deep-copy, because the underlying - // object will lazily perform deep-copy on the first try to change - // any of its fields. - return object - } - return object.DeepCopyObject() -} - -func updateResourceVersion(object runtime.Object, versioner storage.Versioner, resourceVersion uint64) { - if err := versioner.UpdateObject(object, resourceVersion); err != nil { - utilruntime.HandleError(fmt.Errorf("failure to version api object (%d) %#v: %v", resourceVersion, object, err)) - } -} - -func (c *cacheWatcher) convertToWatchEvent(event *watchCacheEvent) *watch.Event { - if event.Type == watch.Bookmark { - e := &watch.Event{Type: watch.Bookmark, Object: event.Object.DeepCopyObject()} - if !c.wasBookmarkAfterRvSent() { - if err := storage.AnnotateInitialEventsEndBookmark(e.Object); err != nil { - utilruntime.HandleError(fmt.Errorf("error while accessing object's metadata gr: %v, identifier: %v, obj: %#v, err: %v", c.groupResource, c.identifier, e.Object, err)) - return nil - } - } - return e - } - - curObjPasses := event.Type != watch.Deleted && c.filter(event.Key, event.ObjLabels, event.ObjFields) - oldObjPasses := false - if event.PrevObject != nil { - oldObjPasses = c.filter(event.Key, event.PrevObjLabels, event.PrevObjFields) - } - if !curObjPasses && !oldObjPasses { - // Watcher is not interested in that object. - return nil - } - - switch { - case curObjPasses && !oldObjPasses: - return &watch.Event{Type: watch.Added, Object: getMutableObject(event.Object)} - case curObjPasses && oldObjPasses: - return &watch.Event{Type: watch.Modified, Object: getMutableObject(event.Object)} - case !curObjPasses && oldObjPasses: - // return a delete event with the previous object content, but with the event's resource version - oldObj := getMutableObject(event.PrevObject) - // We know that if oldObj is cachingObject (which can only be set via - // setCachingObjects), its resourceVersion is already set correctly and - // we don't need to update it. However, since cachingObject efficiently - // handles noop updates, we avoid this microoptimization here. - updateResourceVersion(oldObj, c.versioner, event.ResourceVersion) - return &watch.Event{Type: watch.Deleted, Object: oldObj} - } - - return nil -} - -// NOTE: sendWatchCacheEvent is assumed to not modify !!! -func (c *cacheWatcher) sendWatchCacheEvent(event *watchCacheEvent) { - watchEvent := c.convertToWatchEvent(event) - if watchEvent == nil { - // Watcher is not interested in that object. - return - } - - // We need to ensure that if we put event X to the c.result, all - // previous events were already put into it before, no matter whether - // c.done is close or not. - // Thus we cannot simply select from c.done and c.result and this - // would give us non-determinism. - // At the same time, we don't want to block infinitely on putting - // to c.result, when c.done is already closed. - // - // This ensures that with c.done already close, we at most once go - // into the next select after this. With that, no matter which - // statement we choose there, we will deliver only consecutive - // events. - select { - case <-c.done: - return - default: - } - - select { - case c.result <- *watchEvent: - c.markBookmarkAfterRvSent(event) - case <-c.done: - } -} - -func (c *cacheWatcher) processInterval(ctx context.Context, cacheInterval *watchCacheInterval, resourceVersion uint64) { - defer utilruntime.HandleCrash() - defer close(c.result) - defer c.Stop() - - // Check how long we are processing initEvents. - // As long as these are not processed, we are not processing - // any incoming events, so if it takes long, we may actually - // block all watchers for some time. - // TODO: From the logs it seems that there happens processing - // times even up to 1s which is very long. However, this doesn't - // depend that much on the number of initEvents. E.g. from the - // 2000-node Kubemark run we have logs like this, e.g.: - // ... processing 13862 initEvents took 66.808689ms - // ... processing 14040 initEvents took 993.532539ms - // We should understand what is blocking us in those cases (e.g. - // is it lack of CPU, network, or sth else) and potentially - // consider increase size of result buffer in those cases. - const initProcessThreshold = 500 * time.Millisecond - startTime := time.Now() - - // cacheInterval may be created from a version being more fresh than requested - // (e.g. for NotOlderThan semantic). In such a case, we need to prevent watch event - // with lower resourceVersion from being delivered to ensure watch contract. - if cacheInterval.resourceVersion > resourceVersion { - resourceVersion = cacheInterval.resourceVersion - } - - initEventCount := 0 - for { - event, err := cacheInterval.Next() - if err != nil { - // An error indicates that the cache interval - // has been invalidated and can no longer serve - // events. - // - // Initially we considered sending an "out-of-history" - // Error event in this case, but because historically - // such events weren't sent out of the watchCache, we - // decided not to. This is still ok, because on watch - // closure, the watcher will try to re-instantiate the - // watch and then will get an explicit "out-of-history" - // window. There is potential for optimization, but for - // now, in order to be on the safe side and not break - // custom clients, the cost of it is something that we - // are fully accepting. - klog.Warningf("couldn't retrieve watch event to serve: %#v", err) - return - } - if event == nil { - break - } - c.sendWatchCacheEvent(event) - - // With some events already sent, update resourceVersion so that - // events that were buffered and not yet processed won't be delivered - // to this watcher second time causing going back in time. - // - // There is one case where events are not necessary ordered by - // resourceVersion, being a case of watching from resourceVersion=0, - // which at the beginning returns the state of each objects. - // For the purpose of it, we need to max it with the resource version - // that we have so far. - if event.ResourceVersion > resourceVersion { - resourceVersion = event.ResourceVersion - } - initEventCount++ - } - - if initEventCount > 0 { - metrics.InitCounter.WithLabelValues(c.groupResource.String()).Add(float64(initEventCount)) - } - processingTime := time.Since(startTime) - if processingTime > initProcessThreshold { - klog.V(2).Infof("processing %d initEvents of %s (%s) took %v", initEventCount, c.groupResource, c.identifier, processingTime) - } - - // send bookmark after sending all events in cacheInterval for watchlist request - if cacheInterval.initialEventsEndBookmark != nil { - c.sendWatchCacheEvent(cacheInterval.initialEventsEndBookmark) - } - c.process(ctx, resourceVersion) -} - -func (c *cacheWatcher) process(ctx context.Context, resourceVersion uint64) { - // At this point we already start processing incoming watch events. - // However, the init event can still be processed because their serialization - // and sending to the client happens asynchrnously. - // TODO: As describe in the KEP, we would like to estimate that by delaying - // the initialization signal proportionally to the number of events to - // process, but we're leaving this to the tuning phase. - utilflowcontrol.WatchInitialized(ctx) - - for { - select { - case event, ok := <-c.input: - if !ok { - return - } - // only send events newer than resourceVersion - // or a bookmark event with an RV equal to resourceVersion - // if we haven't sent one to the client - if event.ResourceVersion > resourceVersion || (event.Type == watch.Bookmark && event.ResourceVersion == resourceVersion && !c.wasBookmarkAfterRvSent()) { - c.sendWatchCacheEvent(event) - } - case <-ctx.Done(): - return - } - } -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/cacher.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/cacher.go deleted file mode 100644 index 5d18d8313..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/cacher.go +++ /dev/null @@ -1,1408 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cacher - -import ( - "context" - "fmt" - "net/http" - "reflect" - "strings" - "sync" - "time" - - "go.opentelemetry.io/otel/attribute" - "google.golang.org/grpc/metadata" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/conversion" - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/apiserver/pkg/audit" - "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/apiserver/pkg/features" - "k8s.io/apiserver/pkg/storage" - "k8s.io/apiserver/pkg/storage/cacher/delegator" - "k8s.io/apiserver/pkg/storage/cacher/metrics" - "k8s.io/apiserver/pkg/storage/cacher/progress" - etcdfeature "k8s.io/apiserver/pkg/storage/feature" - utilfeature "k8s.io/apiserver/pkg/util/feature" - "k8s.io/client-go/tools/cache" - "k8s.io/component-base/tracing" - "k8s.io/klog/v2" - "k8s.io/utils/clock" - "k8s.io/utils/ptr" -) - -var ( - emptyFunc = func(bool) {} - coreNamespaceResource = schema.GroupResource{Group: "", Resource: "namespaces"} -) - -const ( - // storageWatchListPageSize is the cacher's request chunk size of - // initial and resync watch lists to storage. - storageWatchListPageSize = int64(10000) - - // DefaultEventFreshDuration is the default time duration of events - // we want to keep. - // We set it to defaultBookmarkFrequency plus epsilon to maximize - // chances that last bookmark was sent within kept history, at the - // same time, minimizing the needed memory usage. - DefaultEventFreshDuration = defaultBookmarkFrequency + 15*time.Second - - // defaultBookmarkFrequency defines how frequently watch bookmarks should be send - // in addition to sending a bookmark right before watch deadline. - defaultBookmarkFrequency = time.Minute -) - -// Config contains the configuration for a given Cache. -type Config struct { - // An underlying storage.Interface. - Storage storage.Interface - - // An underlying storage.Versioner. - Versioner storage.Versioner - - // The GroupResource the cacher is caching. Used for disambiguating *unstructured.Unstructured (CRDs) in logging - // and metrics. - GroupResource schema.GroupResource - - // EventsHistoryWindow specifies minimum history duration that storage is keeping. - // If lower than DefaultEventFreshDuration, the cache creation will fail. - EventsHistoryWindow time.Duration - - // The Cache will be caching objects of a given Type and assumes that they - // are all stored under ResourcePrefix directory in the underlying database. - ResourcePrefix string - - // KeyFunc is used to get a key in the underlying storage for a given object. - KeyFunc func(runtime.Object) (string, error) - - // GetAttrsFunc is used to get object labels, fields - GetAttrsFunc func(runtime.Object) (label labels.Set, field fields.Set, err error) - - // IndexerFuncs is used for optimizing amount of watchers that - // needs to process an incoming event. - IndexerFuncs storage.IndexerFuncs - - // Indexers is used to accelerate the list operation, falls back to regular list - // operation if no indexer found. - Indexers *cache.Indexers - - // NewFunc is a function that creates new empty object storing a object of type Type. - NewFunc func() runtime.Object - - // NewList is a function that creates new empty object storing a list of - // objects of type Type. - NewListFunc func() runtime.Object - - Codec runtime.Codec - - Clock clock.WithTicker -} - -type watchersMap map[int]*cacheWatcher - -func (wm watchersMap) addWatcher(w *cacheWatcher, number int) { - wm[number] = w -} - -func (wm watchersMap) deleteWatcher(number int) { - delete(wm, number) -} - -func (wm watchersMap) terminateAll(done func(*cacheWatcher)) { - for key, watcher := range wm { - delete(wm, key) - done(watcher) - } -} - -type indexedWatchers struct { - allWatchers map[namespacedName]watchersMap - valueWatchers map[string]watchersMap -} - -func (i *indexedWatchers) addWatcher(w *cacheWatcher, number int, scope namespacedName, value string, supported bool) { - if supported { - if _, ok := i.valueWatchers[value]; !ok { - i.valueWatchers[value] = watchersMap{} - } - i.valueWatchers[value].addWatcher(w, number) - } else { - scopedWatchers, ok := i.allWatchers[scope] - if !ok { - scopedWatchers = watchersMap{} - i.allWatchers[scope] = scopedWatchers - } - scopedWatchers.addWatcher(w, number) - } -} - -func (i *indexedWatchers) deleteWatcher(number int, scope namespacedName, value string, supported bool) { - if supported { - i.valueWatchers[value].deleteWatcher(number) - if len(i.valueWatchers[value]) == 0 { - delete(i.valueWatchers, value) - } - } else { - i.allWatchers[scope].deleteWatcher(number) - if len(i.allWatchers[scope]) == 0 { - delete(i.allWatchers, scope) - } - } -} - -func (i *indexedWatchers) terminateAll(groupResource schema.GroupResource, done func(*cacheWatcher)) { - // note that we don't have to call setDrainInputBufferLocked method on the watchers - // because we take advantage of the default value - stop immediately - // also watchers that have had already its draining strategy set - // are no longer available (they were removed from the allWatchers and the valueWatchers maps) - if len(i.allWatchers) > 0 || len(i.valueWatchers) > 0 { - klog.Warningf("Terminating all watchers from cacher %v", groupResource) - } - for _, watchers := range i.allWatchers { - watchers.terminateAll(done) - } - for _, watchers := range i.valueWatchers { - watchers.terminateAll(done) - } - i.allWatchers = map[namespacedName]watchersMap{} - i.valueWatchers = map[string]watchersMap{} -} - -// As we don't need a high precision here, we keep all watchers timeout within a -// second in a bucket, and pop up them once at the timeout. To be more specific, -// if you set fire time at X, you can get the bookmark within (X-1,X+1) period. -type watcherBookmarkTimeBuckets struct { - // the key of watcherBuckets is the number of seconds since createTime - watchersBuckets map[int64][]*cacheWatcher - createTime time.Time - startBucketID int64 - clock clock.Clock - bookmarkFrequency time.Duration -} - -func newTimeBucketWatchers(clock clock.Clock, bookmarkFrequency time.Duration) *watcherBookmarkTimeBuckets { - return &watcherBookmarkTimeBuckets{ - watchersBuckets: make(map[int64][]*cacheWatcher), - createTime: clock.Now(), - startBucketID: 0, - clock: clock, - bookmarkFrequency: bookmarkFrequency, - } -} - -// adds a watcher to the bucket, if the deadline is before the start, it will be -// added to the first one. -func (t *watcherBookmarkTimeBuckets) addWatcherThreadUnsafe(w *cacheWatcher) bool { - // note that the returned time can be before t.createTime, - // especially in cases when the nextBookmarkTime method - // give us the zero value of type Time - // so buckedID can hold a negative value - nextTime, ok := w.nextBookmarkTime(t.clock.Now(), t.bookmarkFrequency) - if !ok { - return false - } - bucketID := int64(nextTime.Sub(t.createTime) / time.Second) - if bucketID < t.startBucketID { - bucketID = t.startBucketID - } - watchers := t.watchersBuckets[bucketID] - t.watchersBuckets[bucketID] = append(watchers, w) - return true -} - -func (t *watcherBookmarkTimeBuckets) popExpiredWatchersThreadUnsafe() [][]*cacheWatcher { - currentBucketID := int64(t.clock.Since(t.createTime) / time.Second) - // There should be one or two elements in almost all cases - expiredWatchers := make([][]*cacheWatcher, 0, 2) - for ; t.startBucketID <= currentBucketID; t.startBucketID++ { - if watchers, ok := t.watchersBuckets[t.startBucketID]; ok { - delete(t.watchersBuckets, t.startBucketID) - expiredWatchers = append(expiredWatchers, watchers) - } - } - return expiredWatchers -} - -type filterWithAttrsFunc func(key string, l labels.Set, f fields.Set) bool - -type indexedTriggerFunc struct { - indexName string - indexerFunc storage.IndexerFunc -} - -// Cacher is responsible for serving WATCH and LIST requests for a given -// resource from its internal cache and updating its cache in the background -// based on the underlying storage contents. -// Cacher implements storage.Interface (although most of the calls are just -// delegated to the underlying storage). -type Cacher struct { - // HighWaterMarks for performance debugging. - // Important: Since HighWaterMark is using sync/atomic, it has to be at the top of the struct due to a bug on 32-bit platforms - // See: https://golang.org/pkg/sync/atomic/ for more information - incomingHWM storage.HighWaterMark - // Incoming events that should be dispatched to watchers. - incoming chan watchCacheEvent - - resourcePrefix string - - sync.RWMutex - - // Before accessing the cacher's cache, wait for the ready to be ok. - // This is necessary to prevent users from accessing structures that are - // uninitialized or are being repopulated right now. - // ready needs to be set to false when the cacher is paused or stopped. - // ready needs to be set to true when the cacher is ready to use after - // initialization. - ready *ready - - // Underlying storage.Interface. - storage storage.Interface - - // Expected type of objects in the underlying cache. - objectType reflect.Type - // Used for logging, to disambiguate *unstructured.Unstructured (CRDs) - groupResource schema.GroupResource - - // "sliding window" of recent changes of objects and the current state. - watchCache *watchCache - reflector *cache.Reflector - - // Versioner is used to handle resource versions. - versioner storage.Versioner - - // newFunc is a function that creates new empty object storing a object of type Type. - newFunc func() runtime.Object - - // newListFunc is a function that creates new empty list for storing objects of type Type. - newListFunc func() runtime.Object - - // indexedTrigger is used for optimizing amount of watchers that needs to process - // an incoming event. - indexedTrigger *indexedTriggerFunc - // watchers is mapping from the value of trigger function that a - // watcher is interested into the watchers - watcherIdx int - watchers indexedWatchers - - // Defines a time budget that can be spend on waiting for not-ready watchers - // while dispatching event before shutting them down. - dispatchTimeoutBudget timeBudget - - // Handling graceful termination. - stopLock sync.RWMutex - stopped bool - stopCh chan struct{} - stopWg sync.WaitGroup - - clock clock.Clock - // timer is used to avoid unnecessary allocations in underlying watchers. - timer *time.Timer - - // dispatching determines whether there is currently dispatching of - // any event in flight. - dispatching bool - // watchersBuffer is a list of watchers potentially interested in currently - // dispatched event. - watchersBuffer []*cacheWatcher - // blockedWatchers is a list of watchers whose buffer is currently full. - blockedWatchers []*cacheWatcher - // watchersToStop is a list of watchers that were supposed to be stopped - // during current dispatching, but stopping was deferred to the end of - // dispatching that event to avoid race with closing channels in watchers. - watchersToStop []*cacheWatcher - // Maintain a timeout queue to send the bookmark event before the watcher times out. - // Note that this field when accessed MUST be protected by the Cacher.lock. - bookmarkWatchers *watcherBookmarkTimeBuckets - // expiredBookmarkWatchers is a list of watchers that were expired and need to be schedule for a next bookmark event - expiredBookmarkWatchers []*cacheWatcher -} - -// NewCacherFromConfig creates a new Cacher responsible for servicing WATCH and LIST requests from -// its internal cache and updating its cache in the background based on the -// given configuration. -func NewCacherFromConfig(config Config) (*Cacher, error) { - stopCh := make(chan struct{}) - obj := config.NewFunc() - // Give this error when it is constructed rather than when you get the - // first watch item, because it's much easier to track down that way. - if err := runtime.CheckCodec(config.Codec, obj); err != nil { - return nil, fmt.Errorf("storage codec doesn't seem to match given type: %v", err) - } - - var indexedTrigger *indexedTriggerFunc - if config.IndexerFuncs != nil { - // For now, we don't support multiple trigger functions defined - // for a given resource. - if len(config.IndexerFuncs) > 1 { - return nil, fmt.Errorf("cacher %s doesn't support more than one IndexerFunc: ", reflect.TypeOf(obj).String()) - } - for key, value := range config.IndexerFuncs { - if value != nil { - indexedTrigger = &indexedTriggerFunc{ - indexName: key, - indexerFunc: value, - } - } - } - } - - if config.Clock == nil { - config.Clock = clock.RealClock{} - } - objType := reflect.TypeOf(obj) - cacher := &Cacher{ - resourcePrefix: config.ResourcePrefix, - ready: newReady(config.Clock), - storage: config.Storage, - objectType: objType, - groupResource: config.GroupResource, - versioner: config.Versioner, - newFunc: config.NewFunc, - newListFunc: config.NewListFunc, - indexedTrigger: indexedTrigger, - watcherIdx: 0, - watchers: indexedWatchers{ - allWatchers: make(map[namespacedName]watchersMap), - valueWatchers: make(map[string]watchersMap), - }, - // TODO: Figure out the correct value for the buffer size. - incoming: make(chan watchCacheEvent, 100), - dispatchTimeoutBudget: newTimeBudget(), - // We need to (potentially) stop both: - // - wait.Until go-routine - // - reflector.ListAndWatch - // and there are no guarantees on the order that they will stop. - // So we will be simply closing the channel, and synchronizing on the WaitGroup. - stopCh: stopCh, - clock: config.Clock, - timer: time.NewTimer(time.Duration(0)), - bookmarkWatchers: newTimeBucketWatchers(config.Clock, defaultBookmarkFrequency), - } - - // Ensure that timer is stopped. - if !cacher.timer.Stop() { - // Consume triggered (but not yet received) timer event - // so that future reuse does not get a spurious timeout. - <-cacher.timer.C - } - var contextMetadata metadata.MD - if utilfeature.DefaultFeatureGate.Enabled(features.SeparateCacheWatchRPC) { - // Add grpc context metadata to watch and progress notify requests done by cacher to: - // * Prevent starvation of watch opened by cacher, by moving it to separate Watch RPC than watch request that bypass cacher. - // * Ensure that progress notification requests are executed on the same Watch RPC as their watch, which is required for it to work. - contextMetadata = metadata.New(map[string]string{"source": "cache"}) - } - - eventFreshDuration := config.EventsHistoryWindow - if eventFreshDuration < DefaultEventFreshDuration { - return nil, fmt.Errorf("config.EventsHistoryWindow (%v) must not be below %v", eventFreshDuration, DefaultEventFreshDuration) - } - - progressRequester := progress.NewConditionalProgressRequester(config.Storage.RequestWatchProgress, config.Clock, contextMetadata) - watchCache := newWatchCache( - config.KeyFunc, cacher.processEvent, config.GetAttrsFunc, config.Versioner, config.Indexers, - config.Clock, eventFreshDuration, config.GroupResource, progressRequester) - listerWatcher := NewListerWatcher(config.Storage, config.ResourcePrefix, config.NewListFunc, contextMetadata) - reflectorName := "storage/cacher.go:" + config.ResourcePrefix - - reflector := cache.NewNamedReflector(reflectorName, listerWatcher, obj, watchCache, 0) - // Configure reflector's pager to for an appropriate pagination chunk size for fetching data from - // storage. The pager falls back to full list if paginated list calls fail due to an "Expired" error. - reflector.WatchListPageSize = storageWatchListPageSize - // When etcd loses leader for 3 cycles, it returns error "no leader". - // We don't want to terminate all watchers as recreating all watchers puts high load on api-server. - // In most of the cases, leader is reelected within few cycles. - reflector.MaxInternalErrorRetryDuration = time.Second * 30 - // since the watch-list is provided by the watch cache instruct - // the reflector to issue a regular LIST against the store - reflector.UseWatchList = ptr.To(false) - - cacher.watchCache = watchCache - cacher.reflector = reflector - - go cacher.dispatchEvents() - go progressRequester.Run(stopCh) - - cacher.stopWg.Add(1) - go func() { - defer cacher.stopWg.Done() - defer cacher.terminateAllWatchers() - wait.Until( - func() { - if !cacher.isStopped() { - cacher.startCaching(stopCh) - } - }, time.Second, stopCh, - ) - }() - - return cacher, nil -} - -func (c *Cacher) startCaching(stopChannel <-chan struct{}) { - c.watchCache.SetOnReplace(func() { - c.ready.setReady() - klog.V(1).Infof("cacher (%v): initialized", c.groupResource.String()) - metrics.WatchCacheInitializations.WithLabelValues(c.groupResource.String()).Inc() - }) - var err error - defer func() { - c.ready.setError(err) - }() - - c.terminateAllWatchers() - err = c.reflector.ListAndWatch(stopChannel) - if err != nil { - klog.Errorf("cacher (%v): unexpected ListAndWatch error: %v; reinitializing...", c.groupResource.String(), err) - } -} - -type namespacedName struct { - namespace string - name string -} - -func (c *Cacher) Watch(ctx context.Context, key string, opts storage.ListOptions) (watch.Interface, error) { - pred := opts.Predicate - requestedWatchRV, err := c.versioner.ParseResourceVersion(opts.ResourceVersion) - if err != nil { - return nil, err - } - - var readyGeneration int - if utilfeature.DefaultFeatureGate.Enabled(features.ResilientWatchCacheInitialization) { - var err error - var downtime time.Duration - readyGeneration, downtime, err = c.ready.checkAndReadGeneration() - if err != nil { - return nil, errors.NewTooManyRequests(err.Error(), calculateRetryAfterForUnreadyCache(downtime)) - } - } else { - readyGeneration, err = c.ready.waitAndReadGeneration(ctx) - if err != nil { - return nil, errors.NewServiceUnavailable(err.Error()) - } - } - - // determine the namespace and name scope of the watch, first from the request, secondarily from the field selector - scope := namespacedName{} - if requestNamespace, ok := request.NamespaceFrom(ctx); ok && len(requestNamespace) > 0 { - scope.namespace = requestNamespace - } else if selectorNamespace, ok := pred.Field.RequiresExactMatch("metadata.namespace"); ok { - scope.namespace = selectorNamespace - } - if requestInfo, ok := request.RequestInfoFrom(ctx); ok && requestInfo != nil && len(requestInfo.Name) > 0 { - scope.name = requestInfo.Name - } else if selectorName, ok := pred.Field.RequiresExactMatch("metadata.name"); ok { - scope.name = selectorName - } - - // for request like '/api/v1/watch/namespaces/*', set scope.namespace to empty. - // namespaces don't populate metadata.namespace in ObjFields. - if c.groupResource == coreNamespaceResource && len(scope.namespace) > 0 && scope.namespace == scope.name { - scope.namespace = "" - } - - triggerValue, triggerSupported := "", false - if c.indexedTrigger != nil { - for _, field := range pred.IndexFields { - if field == c.indexedTrigger.indexName { - if value, ok := pred.Field.RequiresExactMatch(field); ok { - triggerValue, triggerSupported = value, true - break - } - } - } - } - - // It boils down to a tradeoff between: - // - having it as small as possible to reduce memory usage - // - having it large enough to ensure that watchers that need to process - // a bunch of changes have enough buffer to avoid from blocking other - // watchers on our watcher having a processing hiccup - chanSize := c.watchCache.suggestedWatchChannelSize(c.indexedTrigger != nil, triggerSupported) - - // client-go is going to fall back to a standard LIST on any error - // returned for watch-list requests - if isListWatchRequest(opts) && !etcdfeature.DefaultFeatureSupportChecker.Supports(storage.RequestWatchProgress) { - return newErrWatcher(fmt.Errorf("a watch stream was requested by the client but the required storage feature %s is disabled", storage.RequestWatchProgress)), nil - } - - // Determine the ResourceVersion to which the watch cache must be synchronized - requiredResourceVersion, err := c.getWatchCacheResourceVersion(ctx, requestedWatchRV, opts) - if err != nil { - return newErrWatcher(err), nil - } - - // Determine a function that computes the bookmarkAfterResourceVersion - bookmarkAfterResourceVersionFn, err := c.getBookmarkAfterResourceVersionLockedFunc(requestedWatchRV, requiredResourceVersion, opts) - if err != nil { - return newErrWatcher(err), nil - } - - // Determine watch timeout('0' means deadline is not set, ignore checking) - deadline, _ := ctx.Deadline() - - identifier := fmt.Sprintf("key: %q, labels: %q, fields: %q", key, pred.Label, pred.Field) - - // Create a watcher here to reduce memory allocations under lock, - // given that memory allocation may trigger GC and block the thread. - // Also note that emptyFunc is a placeholder, until we will be able - // to compute watcher.forget function (which has to happen under lock). - watcher := newCacheWatcher( - chanSize, - filterWithAttrsAndPrefixFunction(key, pred), - emptyFunc, - c.versioner, - deadline, - pred.AllowWatchBookmarks, - c.groupResource, - identifier, - ) - - // note that c.waitUntilWatchCacheFreshAndForceAllEvents must be called without - // the c.watchCache.RLock held otherwise we are at risk of a deadlock - // mainly because c.watchCache.processEvent method won't be able to make progress - // - // moreover even though the c.waitUntilWatchCacheFreshAndForceAllEvents acquires a lock - // it is safe to release the lock after the method finishes because we don't require - // any atomicity between the call to the method and further calls that actually get the events. - err = c.waitUntilWatchCacheFreshAndForceAllEvents(ctx, requiredResourceVersion, opts) - if err != nil { - return newErrWatcher(err), nil - } - - // We explicitly use thread unsafe version and do locking ourself to ensure that - // no new events will be processed in the meantime. The watchCache will be unlocked - // on return from this function. - // Note that we cannot do it under Cacher lock, to avoid a deadlock, since the - // underlying watchCache is calling processEvent under its lock. - c.watchCache.RLock() - defer c.watchCache.RUnlock() - - var cacheInterval *watchCacheInterval - cacheInterval, err = c.watchCache.getAllEventsSinceLocked(requiredResourceVersion, key, opts) - if err != nil { - // To match the uncached watch implementation, once we have passed authn/authz/admission, - // and successfully parsed a resource version, other errors must fail with a watch event of type ERROR, - // rather than a directly returned error. - return newErrWatcher(err), nil - } - - c.setInitialEventsEndBookmarkIfRequested(cacheInterval, opts, c.watchCache.resourceVersion) - - addedWatcher := false - func() { - c.Lock() - defer c.Unlock() - - if generation, _, err := c.ready.checkAndReadGeneration(); generation != readyGeneration || err != nil { - // We went unready or are already on a different generation. - // Avoid registering and starting the watch as it will have to be - // terminated immediately anyway. - return - } - - // Update watcher.forget function once we can compute it. - watcher.forget = forgetWatcher(c, watcher, c.watcherIdx, scope, triggerValue, triggerSupported) - // Update the bookMarkAfterResourceVersion - watcher.setBookmarkAfterResourceVersion(bookmarkAfterResourceVersionFn()) - c.watchers.addWatcher(watcher, c.watcherIdx, scope, triggerValue, triggerSupported) - addedWatcher = true - - // Add it to the queue only when the client support watch bookmarks. - if watcher.allowWatchBookmarks { - c.bookmarkWatchers.addWatcherThreadUnsafe(watcher) - } - c.watcherIdx++ - }() - - if !addedWatcher { - // Watcher isn't really started at this point, so it's safe to just drop it. - // - // We're simulating the immediate watch termination, which boils down to simply - // closing the watcher. - return newImmediateCloseWatcher(), nil - } - - go watcher.processInterval(ctx, cacheInterval, requiredResourceVersion) - return watcher, nil -} - -func (c *Cacher) Get(ctx context.Context, key string, opts storage.GetOptions, objPtr runtime.Object) error { - getRV, err := c.versioner.ParseResourceVersion(opts.ResourceVersion) - if err != nil { - return err - } - - objVal, err := conversion.EnforcePtr(objPtr) - if err != nil { - return err - } - - obj, exists, readResourceVersion, err := c.watchCache.WaitUntilFreshAndGet(ctx, getRV, key) - if err != nil { - return err - } - - if exists { - elem, ok := obj.(*storeElement) - if !ok { - return fmt.Errorf("non *storeElement returned from storage: %v", obj) - } - objVal.Set(reflect.ValueOf(elem.Object).Elem()) - } else { - objVal.Set(reflect.Zero(objVal.Type())) - if !opts.IgnoreNotFound { - return storage.NewKeyNotFoundError(key, int64(readResourceVersion)) - } - } - return nil -} - -// computeListLimit determines whether the cacher should -// apply a limit to an incoming LIST request and returns its value. -// -// note that this function doesn't check RVM nor the Continuation token. -// these parameters are validated by the shouldDelegateList function. -// -// as of today, the limit is ignored for requests that set RV == 0 -func computeListLimit(opts storage.ListOptions) int64 { - if opts.Predicate.Limit <= 0 || opts.ResourceVersion == "0" { - return 0 - } - return opts.Predicate.Limit -} - -func (c *Cacher) listItems(ctx context.Context, listRV uint64, key string, opts storage.ListOptions) (listResp, string, error) { - if !opts.Recursive { - obj, exists, readResourceVersion, err := c.watchCache.WaitUntilFreshAndGet(ctx, listRV, key) - if err != nil { - return listResp{}, "", err - } - if exists { - return listResp{Items: []interface{}{obj}, ResourceVersion: readResourceVersion}, "", nil - } - return listResp{ResourceVersion: readResourceVersion}, "", nil - } - return c.watchCache.WaitUntilFreshAndList(ctx, listRV, key, opts) -} - -type listResp struct { - Items []interface{} - ResourceVersion uint64 -} - -// GetList implements storage.Interface -func (c *Cacher) GetList(ctx context.Context, key string, opts storage.ListOptions, listObj runtime.Object) error { - // For recursive lists, we need to make sure the key ended with "/" so that we only - // get children "directories". e.g. if we have key "/a", "/a/b", "/ab", getting keys - // with prefix "/a" will return all three, while with prefix "/a/" will return only - // "/a/b" which is the correct answer. - preparedKey := key - if opts.Recursive && !strings.HasSuffix(key, "/") { - preparedKey += "/" - } - listRV, err := c.versioner.ParseResourceVersion(opts.ResourceVersion) - if err != nil { - return err - } - - ctx, span := tracing.Start(ctx, "cacher.GetList", - attribute.String("audit-id", audit.GetAuditIDTruncated(ctx)), - attribute.Stringer("type", c.groupResource)) - defer span.End(500 * time.Millisecond) - - if utilfeature.DefaultFeatureGate.Enabled(features.ResilientWatchCacheInitialization) { - if downtime, err := c.ready.check(); err != nil { - // If Cacher is not initialized, reject List requests - // as described in https://kep.k8s.io/4568 - return errors.NewTooManyRequests(err.Error(), calculateRetryAfterForUnreadyCache(downtime)) - } - } else { - if err := c.ready.wait(ctx); err != nil { - return errors.NewServiceUnavailable(err.Error()) - } - } - span.AddEvent("Ready") - - // List elements with at least 'listRV' from cache. - listPtr, err := meta.GetItemsPtr(listObj) - if err != nil { - return err - } - listVal, err := conversion.EnforcePtr(listPtr) - if err != nil { - return err - } - if listVal.Kind() != reflect.Slice { - return fmt.Errorf("need a pointer to slice, got %v", listVal.Kind()) - } - - resp, indexUsed, err := c.listItems(ctx, listRV, preparedKey, opts) - if err != nil { - return err - } - span.AddEvent("Listed items from cache", attribute.Int("count", len(resp.Items))) - // store pointer of eligible objects, - // Why not directly put object in the items of listObj? - // the elements in ListObject are Struct type, making slice will bring excessive memory consumption. - // so we try to delay this action as much as possible - var selectedObjects []runtime.Object - var lastSelectedObjectKey string - var hasMoreListItems bool - limit := computeListLimit(opts) - for i, obj := range resp.Items { - elem, ok := obj.(*storeElement) - if !ok { - return fmt.Errorf("non *storeElement returned from storage: %v", obj) - } - if opts.Predicate.MatchesObjectAttributes(elem.Labels, elem.Fields) { - selectedObjects = append(selectedObjects, elem.Object) - lastSelectedObjectKey = elem.Key - } - if limit > 0 && int64(len(selectedObjects)) >= limit { - hasMoreListItems = i < len(resp.Items)-1 - break - } - } - if len(selectedObjects) == 0 { - // Ensure that we never return a nil Items pointer in the result for consistency. - listVal.Set(reflect.MakeSlice(listVal.Type(), 0, 0)) - } else { - // Resize the slice appropriately, since we already know that size of result set - listVal.Set(reflect.MakeSlice(listVal.Type(), len(selectedObjects), len(selectedObjects))) - span.AddEvent("Resized result") - for i, o := range selectedObjects { - listVal.Index(i).Set(reflect.ValueOf(o).Elem()) - } - } - span.AddEvent("Filtered items", attribute.Int("count", listVal.Len())) - if c.versioner != nil { - continueValue, remainingItemCount, err := storage.PrepareContinueToken(lastSelectedObjectKey, key, int64(resp.ResourceVersion), int64(len(resp.Items)), hasMoreListItems, opts) - if err != nil { - return err - } - - if err = c.versioner.UpdateList(listObj, resp.ResourceVersion, continueValue, remainingItemCount); err != nil { - return err - } - } - metrics.RecordListCacheMetrics(c.resourcePrefix, indexUsed, len(resp.Items), listVal.Len()) - return nil -} - -// baseObjectThreadUnsafe omits locking for cachingObject. -func baseObjectThreadUnsafe(object runtime.Object) runtime.Object { - if co, ok := object.(*cachingObject); ok { - return co.object - } - return object -} - -func (c *Cacher) triggerValuesThreadUnsafe(event *watchCacheEvent) ([]string, bool) { - if c.indexedTrigger == nil { - return nil, false - } - - result := make([]string, 0, 2) - result = append(result, c.indexedTrigger.indexerFunc(baseObjectThreadUnsafe(event.Object))) - if event.PrevObject == nil { - return result, true - } - prevTriggerValue := c.indexedTrigger.indexerFunc(baseObjectThreadUnsafe(event.PrevObject)) - if result[0] != prevTriggerValue { - result = append(result, prevTriggerValue) - } - return result, true -} - -func (c *Cacher) processEvent(event *watchCacheEvent) { - if curLen := int64(len(c.incoming)); c.incomingHWM.Update(curLen) { - // Monitor if this gets backed up, and how much. - klog.V(1).Infof("cacher (%v): %v objects queued in incoming channel.", c.groupResource.String(), curLen) - } - c.incoming <- *event -} - -func (c *Cacher) dispatchEvents() { - // Jitter to help level out any aggregate load. - bookmarkTimer := c.clock.NewTimer(wait.Jitter(time.Second, 0.25)) - defer bookmarkTimer.Stop() - - // The internal informer populates the RV as soon as it conducts - // The first successful sync with the underlying store. - // The cache must wait until this first sync is completed to be deemed ready. - // Since we cannot send a bookmark when the lastProcessedResourceVersion is 0, - // we poll aggressively for the first list RV before entering the dispatch loop. - lastProcessedResourceVersion := uint64(0) - if err := wait.PollUntilContextCancel(wait.ContextForChannel(c.stopCh), 10*time.Millisecond, true, func(_ context.Context) (bool, error) { - if rv := c.watchCache.getListResourceVersion(); rv != 0 { - lastProcessedResourceVersion = rv - return true, nil - } - return false, nil - }); err != nil { - // given the function above never returns error, - // the non-empty error means that the stopCh was closed - return - } - for { - select { - case event, ok := <-c.incoming: - if !ok { - return - } - // Don't dispatch bookmarks coming from the storage layer. - // They can be very frequent (even to the level of subseconds) - // to allow efficient watch resumption on kube-apiserver restarts, - // and propagating them down may overload the whole system. - // - // TODO: If at some point we decide the performance and scalability - // footprint is acceptable, this is the place to hook them in. - // However, we then need to check if this was called as a result - // of a bookmark event or regular Add/Update/Delete operation by - // checking if resourceVersion here has changed. - if event.Type != watch.Bookmark { - c.dispatchEvent(&event) - } - lastProcessedResourceVersion = event.ResourceVersion - metrics.EventsCounter.WithLabelValues(c.groupResource.String()).Inc() - case <-bookmarkTimer.C(): - bookmarkTimer.Reset(wait.Jitter(time.Second, 0.25)) - bookmarkEvent := &watchCacheEvent{ - Type: watch.Bookmark, - Object: c.newFunc(), - ResourceVersion: lastProcessedResourceVersion, - } - if err := c.versioner.UpdateObject(bookmarkEvent.Object, bookmarkEvent.ResourceVersion); err != nil { - klog.Errorf("failure to set resourceVersion to %d on bookmark event %+v", bookmarkEvent.ResourceVersion, bookmarkEvent.Object) - continue - } - c.dispatchEvent(bookmarkEvent) - case <-c.stopCh: - return - } - } -} - -func setCachingObjects(event *watchCacheEvent, versioner storage.Versioner) { - switch event.Type { - case watch.Added, watch.Modified: - if object, err := newCachingObject(event.Object); err == nil { - event.Object = object - } else { - klog.Errorf("couldn't create cachingObject from: %#v", event.Object) - } - // Don't wrap PrevObject for update event (for create events it is nil). - // We only encode those to deliver DELETE watch events, so if - // event.Object is not nil it can be used only for watchers for which - // selector was satisfied for its previous version and is no longer - // satisfied for the current version. - // This is rare enough that it doesn't justify making deep-copy of the - // object (done by newCachingObject) every time. - case watch.Deleted: - // Don't wrap Object for delete events - these are not to deliver any - // events. Only wrap PrevObject. - if object, err := newCachingObject(event.PrevObject); err == nil { - // Update resource version of the object. - // event.PrevObject is used to deliver DELETE watch events and - // for them, we set resourceVersion to instead of - // the resourceVersion of the last modification of the object. - updateResourceVersion(object, versioner, event.ResourceVersion) - event.PrevObject = object - } else { - klog.Errorf("couldn't create cachingObject from: %#v", event.Object) - } - } -} - -func (c *Cacher) dispatchEvent(event *watchCacheEvent) { - c.startDispatching(event) - defer c.finishDispatching() - // Watchers stopped after startDispatching will be delayed to finishDispatching, - - // Since add() can block, we explicitly add when cacher is unlocked. - // Dispatching event in nonblocking way first, which make faster watchers - // not be blocked by slower ones. - // - // Note: if we ever decide to cache the serialization of bookmark events, - // we will also need to modify the watchEncoder encoder - if event.Type == watch.Bookmark { - for _, watcher := range c.watchersBuffer { - watcher.nonblockingAdd(event) - } - } else { - // Set up caching of object serializations only for dispatching this event. - // - // Storing serializations in memory would result in increased memory usage, - // but it would help for caching encodings for watches started from old - // versions. However, we still don't have a convincing data that the gain - // from it justifies increased memory usage, so for now we drop the cached - // serializations after dispatching this event. - // - // Given that CachingObject is just wrapping the object and not perfoming - // deep-copying (until some field is explicitly being modified), we create - // it unconditionally to ensure safety and reduce deep-copying. - // - // Make a shallow copy to allow overwriting Object and PrevObject. - wcEvent := *event - setCachingObjects(&wcEvent, c.versioner) - event = &wcEvent - - c.blockedWatchers = c.blockedWatchers[:0] - for _, watcher := range c.watchersBuffer { - if !watcher.nonblockingAdd(event) { - c.blockedWatchers = append(c.blockedWatchers, watcher) - } - } - - if len(c.blockedWatchers) > 0 { - // dispatchEvent is called very often, so arrange - // to reuse timers instead of constantly allocating. - startTime := time.Now() - timeout := c.dispatchTimeoutBudget.takeAvailable() - c.timer.Reset(timeout) - - // Send event to all blocked watchers. As long as timer is running, - // `add` will wait for the watcher to unblock. After timeout, - // `add` will not wait, but immediately close a still blocked watcher. - // Hence, every watcher gets the chance to unblock itself while timer - // is running, not only the first ones in the list. - timer := c.timer - for _, watcher := range c.blockedWatchers { - if !watcher.add(event, timer) { - // fired, clean the timer by set it to nil. - timer = nil - } - } - - // Stop the timer if it is not fired - if timer != nil && !timer.Stop() { - // Consume triggered (but not yet received) timer event - // so that future reuse does not get a spurious timeout. - <-timer.C - } - - c.dispatchTimeoutBudget.returnUnused(timeout - time.Since(startTime)) - } - } -} - -func (c *Cacher) startDispatchingBookmarkEventsLocked() { - // Pop already expired watchers. However, explicitly ignore stopped ones, - // as we don't delete watcher from bookmarkWatchers when it is stopped. - for _, watchers := range c.bookmarkWatchers.popExpiredWatchersThreadUnsafe() { - for _, watcher := range watchers { - // c.Lock() is held here. - // watcher.stopThreadUnsafe() is protected by c.Lock() - if watcher.stopped { - continue - } - c.watchersBuffer = append(c.watchersBuffer, watcher) - c.expiredBookmarkWatchers = append(c.expiredBookmarkWatchers, watcher) - } - } -} - -// startDispatching chooses watchers potentially interested in a given event -// a marks dispatching as true. -func (c *Cacher) startDispatching(event *watchCacheEvent) { - // It is safe to call triggerValuesThreadUnsafe here, because at this - // point only this thread can access this event (we create a separate - // watchCacheEvent for every dispatch). - triggerValues, supported := c.triggerValuesThreadUnsafe(event) - - c.Lock() - defer c.Unlock() - - c.dispatching = true - // We are reusing the slice to avoid memory reallocations in every - // dispatchEvent() call. That may prevent Go GC from freeing items - // from previous phases that are sitting behind the current length - // of the slice, but there is only a limited number of those and the - // gain from avoiding memory allocations is much bigger. - c.watchersBuffer = c.watchersBuffer[:0] - - if event.Type == watch.Bookmark { - c.startDispatchingBookmarkEventsLocked() - // return here to reduce following code indentation and diff - return - } - - // iterate over watchers for each applicable namespace/name tuple - namespace := event.ObjFields["metadata.namespace"] - name := event.ObjFields["metadata.name"] - if len(namespace) > 0 { - if len(name) > 0 { - // namespaced watchers scoped by name - for _, watcher := range c.watchers.allWatchers[namespacedName{namespace: namespace, name: name}] { - c.watchersBuffer = append(c.watchersBuffer, watcher) - } - } - // namespaced watchers not scoped by name - for _, watcher := range c.watchers.allWatchers[namespacedName{namespace: namespace}] { - c.watchersBuffer = append(c.watchersBuffer, watcher) - } - } - if len(name) > 0 { - // cluster-wide watchers scoped by name - for _, watcher := range c.watchers.allWatchers[namespacedName{name: name}] { - c.watchersBuffer = append(c.watchersBuffer, watcher) - } - } - // cluster-wide watchers unscoped by name - for _, watcher := range c.watchers.allWatchers[namespacedName{}] { - c.watchersBuffer = append(c.watchersBuffer, watcher) - } - - if supported { - // Iterate over watchers interested in the given values of the trigger. - for _, triggerValue := range triggerValues { - for _, watcher := range c.watchers.valueWatchers[triggerValue] { - c.watchersBuffer = append(c.watchersBuffer, watcher) - } - } - } else { - // supported equal to false generally means that trigger function - // is not defined (or not aware of any indexes). In this case, - // watchers filters should generally also don't generate any - // trigger values, but can cause problems in case of some - // misconfiguration. Thus we paranoidly leave this branch. - - // Iterate over watchers interested in exact values for all values. - for _, watchers := range c.watchers.valueWatchers { - for _, watcher := range watchers { - c.watchersBuffer = append(c.watchersBuffer, watcher) - } - } - } -} - -// finishDispatching stops all the watchers that were supposed to be -// stopped in the meantime, but it was deferred to avoid closing input -// channels of watchers, as add() may still have writing to it. -// It also marks dispatching as false. -func (c *Cacher) finishDispatching() { - c.Lock() - defer c.Unlock() - c.dispatching = false - for _, watcher := range c.watchersToStop { - watcher.stopLocked() - } - c.watchersToStop = c.watchersToStop[:0] - - for _, watcher := range c.expiredBookmarkWatchers { - if watcher.stopped { - continue - } - // requeue the watcher for the next bookmark if needed. - c.bookmarkWatchers.addWatcherThreadUnsafe(watcher) - } - c.expiredBookmarkWatchers = c.expiredBookmarkWatchers[:0] -} - -func (c *Cacher) terminateAllWatchers() { - c.Lock() - defer c.Unlock() - c.watchers.terminateAll(c.groupResource, c.stopWatcherLocked) -} - -func (c *Cacher) stopWatcherLocked(watcher *cacheWatcher) { - if c.dispatching { - c.watchersToStop = append(c.watchersToStop, watcher) - } else { - watcher.stopLocked() - } -} - -func (c *Cacher) isStopped() bool { - c.stopLock.RLock() - defer c.stopLock.RUnlock() - return c.stopped -} - -// Stop implements the graceful termination. -func (c *Cacher) Stop() { - c.stopLock.Lock() - if c.stopped { - // avoid stopping twice (note: cachers are shared with subresources) - c.stopLock.Unlock() - return - } - c.stopped = true - c.ready.stop() - c.stopLock.Unlock() - close(c.stopCh) - c.stopWg.Wait() -} - -func forgetWatcher(c *Cacher, w *cacheWatcher, index int, scope namespacedName, triggerValue string, triggerSupported bool) func(bool) { - return func(drainWatcher bool) { - c.Lock() - defer c.Unlock() - - w.setDrainInputBufferLocked(drainWatcher) - - // It's possible that the watcher is already not in the structure (e.g. in case of - // simultaneous Stop() and terminateAllWatchers(), but it is safe to call stopLocked() - // on a watcher multiple times. - c.watchers.deleteWatcher(index, scope, triggerValue, triggerSupported) - c.stopWatcherLocked(w) - } -} - -func filterWithAttrsAndPrefixFunction(key string, p storage.SelectionPredicate) filterWithAttrsFunc { - filterFunc := func(objKey string, label labels.Set, field fields.Set) bool { - if !hasPathPrefix(objKey, key) { - return false - } - return p.MatchesObjectAttributes(label, field) - } - return filterFunc -} - -// LastSyncResourceVersion returns resource version to which the underlying cache is synced. -func (c *Cacher) LastSyncResourceVersion() (uint64, error) { - if err := c.ready.wait(context.Background()); err != nil { - return 0, errors.NewServiceUnavailable(err.Error()) - } - - resourceVersion := c.reflector.LastSyncResourceVersion() - return c.versioner.ParseResourceVersion(resourceVersion) -} - -// getBookmarkAfterResourceVersionLockedFunc returns a function that -// spits a ResourceVersion after which the bookmark event will be delivered. -// -// The returned function must be called under the watchCache lock. -func (c *Cacher) getBookmarkAfterResourceVersionLockedFunc(parsedResourceVersion, requiredResourceVersion uint64, opts storage.ListOptions) (func() uint64, error) { - if !isListWatchRequest(opts) { - return func() uint64 { return 0 }, nil - } - - switch { - case len(opts.ResourceVersion) == 0: - return func() uint64 { return requiredResourceVersion }, nil - case parsedResourceVersion == 0: - // here we assume that watchCache locked is already held - return func() uint64 { return c.watchCache.resourceVersion }, nil - default: - return func() uint64 { return parsedResourceVersion }, nil - } -} - -func isListWatchRequest(opts storage.ListOptions) bool { - return opts.SendInitialEvents != nil && *opts.SendInitialEvents && opts.Predicate.AllowWatchBookmarks -} - -// getWatchCacheResourceVersion returns a ResourceVersion to which the watch cache must be synchronized to -// -// Depending on the input parameters, the semantics of the returned ResourceVersion are: -// - must be at Exact RV (when parsedWatchResourceVersion > 0) -// - can be at Any RV (when parsedWatchResourceVersion = 0) -// - must be at Most Recent RV (return an RV from etcd) -// -// note that the above semantic is enforced by the API validation (defined elsewhere): -// -// if SendInitiaEvents != nil => ResourceVersionMatch = NotOlderThan -// if ResourceVersionmatch != nil => ResourceVersionMatch = NotOlderThan & SendInitialEvents != nil -func (c *Cacher) getWatchCacheResourceVersion(ctx context.Context, parsedWatchResourceVersion uint64, opts storage.ListOptions) (uint64, error) { - if len(opts.ResourceVersion) != 0 { - return parsedWatchResourceVersion, nil - } - // legacy case - if !utilfeature.DefaultFeatureGate.Enabled(features.WatchFromStorageWithoutResourceVersion) && opts.SendInitialEvents == nil && opts.ResourceVersion == "" { - return 0, nil - } - rv, err := c.storage.GetCurrentResourceVersion(ctx) - return rv, err -} - -// waitUntilWatchCacheFreshAndForceAllEvents waits until cache is at least -// as fresh as given requestedWatchRV if sendInitialEvents was requested. -// otherwise, we allow for establishing the connection because the clients -// can wait for events without unnecessary blocking. -func (c *Cacher) waitUntilWatchCacheFreshAndForceAllEvents(ctx context.Context, requestedWatchRV uint64, opts storage.ListOptions) error { - if opts.SendInitialEvents != nil && *opts.SendInitialEvents { - // Here be dragons: - // Since the etcd feature checker needs to check all members - // to determine whether a given feature is supported, - // we may receive a positive response even if the feature is not supported. - // - // In this very rare scenario, the worst case will be that this - // request will wait for 3 seconds before it fails. - if etcdfeature.DefaultFeatureSupportChecker.Supports(storage.RequestWatchProgress) && c.watchCache.notFresh(requestedWatchRV) { - c.watchCache.waitingUntilFresh.Add() - defer c.watchCache.waitingUntilFresh.Remove() - } - err := c.watchCache.waitUntilFreshAndBlock(ctx, requestedWatchRV) - defer c.watchCache.RUnlock() - return err - } - return nil -} - -// Wait blocks until the cacher is Ready or Stopped, it returns an error if Stopped. -func (c *Cacher) Wait(ctx context.Context) error { - return c.ready.wait(ctx) -} - -// setInitialEventsEndBookmarkIfRequested sets initialEventsEndBookmark field in watchCacheInterval for watchlist request -func (c *Cacher) setInitialEventsEndBookmarkIfRequested(cacheInterval *watchCacheInterval, opts storage.ListOptions, currentResourceVersion uint64) { - if opts.SendInitialEvents != nil && *opts.SendInitialEvents && opts.Predicate.AllowWatchBookmarks { - // We don't need to set the InitialEventsAnnotation for this bookmark event, - // because this will be automatically set during event conversion in cacheWatcher.convertToWatchEvent method - initialEventsEndBookmark := &watchCacheEvent{ - Type: watch.Bookmark, - Object: c.newFunc(), - ResourceVersion: currentResourceVersion, - } - - if err := c.versioner.UpdateObject(initialEventsEndBookmark.Object, initialEventsEndBookmark.ResourceVersion); err != nil { - klog.Errorf("failure to set resourceVersion to %d on initialEventsEndBookmark event %+v for watchlist request and wait for bookmark trigger to send", initialEventsEndBookmark.ResourceVersion, initialEventsEndBookmark.Object) - initialEventsEndBookmark = nil - } - - cacheInterval.initialEventsEndBookmark = initialEventsEndBookmark - } -} - -func (c *Cacher) Ready() bool { - _, err := c.ready.check() - return err == nil -} - -// errWatcher implements watch.Interface to return a single error -type errWatcher struct { - result chan watch.Event -} - -func newErrWatcher(err error) *errWatcher { - // Create an error event - errEvent := watch.Event{Type: watch.Error} - switch err := err.(type) { - case runtime.Object: - errEvent.Object = err - case *errors.StatusError: - errEvent.Object = &err.ErrStatus - default: - errEvent.Object = &metav1.Status{ - Status: metav1.StatusFailure, - Message: err.Error(), - Reason: metav1.StatusReasonInternalError, - Code: http.StatusInternalServerError, - } - } - - // Create a watcher with room for a single event, populate it, and close the channel - watcher := &errWatcher{result: make(chan watch.Event, 1)} - watcher.result <- errEvent - close(watcher.result) - - return watcher -} - -func (c *Cacher) ShouldDelegateExactRV(resourceVersion string, recursive bool) (delegator.Result, error) { - // Not Recursive is not supported unitl exact RV is implemented for WaitUntilFreshAndGet. - if !recursive || c.watchCache.snapshots == nil { - return delegator.Result{ShouldDelegate: true}, nil - } - listRV, err := c.versioner.ParseResourceVersion(resourceVersion) - if err != nil { - return delegator.Result{}, err - } - return c.shouldDelegateExactRV(listRV) -} - -func (c *Cacher) ShouldDelegateContinue(continueToken string, recursive bool) (delegator.Result, error) { - // Not Recursive is not supported unitl exact RV is implemented for WaitUntilFreshAndGet. - if !recursive || c.watchCache.snapshots == nil { - return delegator.Result{ShouldDelegate: true}, nil - } - _, continueRV, err := storage.DecodeContinue(continueToken, c.resourcePrefix) - if err != nil { - return delegator.Result{}, err - } - if continueRV > 0 { - return c.shouldDelegateExactRV(uint64(continueRV)) - } else { - // Continue with negative RV is a consistent read. - return c.ShouldDelegateConsistentRead() - } -} - -func (c *Cacher) shouldDelegateExactRV(rv uint64) (delegator.Result, error) { - // Exact requests on future revision require support for consistent read, but are not a consistent read by themselves. - if c.watchCache.notFresh(rv) { - return delegator.Result{ - ShouldDelegate: !delegator.ConsistentReadSupported(), - }, nil - } - _, canServe := c.watchCache.snapshots.GetLessOrEqual(rv) - return delegator.Result{ - ShouldDelegate: !canServe, - }, nil -} - -func (c *Cacher) ShouldDelegateConsistentRead() (delegator.Result, error) { - return delegator.Result{ - ConsistentRead: true, - ShouldDelegate: !delegator.ConsistentReadSupported(), - }, nil -} - -// Implements watch.Interface. -func (c *errWatcher) ResultChan() <-chan watch.Event { - return c.result -} - -// Implements watch.Interface. -func (c *errWatcher) Stop() { - // no-op -} - -// immediateCloseWatcher implements watch.Interface that is immediately closed -type immediateCloseWatcher struct { - result chan watch.Event -} - -func newImmediateCloseWatcher() *immediateCloseWatcher { - watcher := &immediateCloseWatcher{result: make(chan watch.Event)} - close(watcher.result) - return watcher -} - -// Implements watch.Interface. -func (c *immediateCloseWatcher) ResultChan() <-chan watch.Event { - return c.result -} - -// Implements watch.Interface. -func (c *immediateCloseWatcher) Stop() { - // no-op -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/caching_object.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/caching_object.go deleted file mode 100644 index e2e2aa5e7..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/caching_object.go +++ /dev/null @@ -1,412 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cacher - -import ( - "bytes" - "fmt" - "io" - "reflect" - "runtime/debug" - "sync" - "sync/atomic" - "time" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/klog/v2" -) - -var _ runtime.CacheableObject = &cachingObject{} - -// metaRuntimeInterface implements runtime.Object and -// metav1.Object interfaces. -type metaRuntimeInterface interface { - runtime.Object - metav1.Object -} - -// serializationResult captures a result of serialization. -type serializationResult struct { - // once should be used to ensure serialization is computed once. - once sync.Once - - // raw is serialized object. - raw []byte - // err is error from serialization. - err error -} - -// serializationsCache is a type for caching serialization results. -type serializationsCache map[runtime.Identifier]*serializationResult - -// cachingObject is an object that is able to cache its serializations -// so that each of those is computed exactly once. -// -// cachingObject implements the metav1.Object interface (accessors for -// all metadata fields). -type cachingObject struct { - lock sync.RWMutex - - // deepCopied defines whether the object below has already been - // deep copied. The operation is performed lazily on the first - // setXxx operation. - // - // The lazy deep-copy make is useful, as effectively the only - // case when we are setting some fields are ResourceVersion for - // DELETE events, so in all other cases we can effectively avoid - // performing any deep copies. - deepCopied bool - - // Object for which serializations are cached. - object metaRuntimeInterface - - // serializations is a cache containing object`s serializations. - // The value stored in atomic.Value is of type serializationsCache. - // The atomic.Value type is used to allow fast-path. - serializations atomic.Value -} - -// newCachingObject performs a deep copy of the given object and wraps it -// into a cachingObject. -// An error is returned if it's not possible to cast the object to -// metav1.Object type. -func newCachingObject(object runtime.Object) (*cachingObject, error) { - if obj, ok := object.(metaRuntimeInterface); ok { - result := &cachingObject{ - object: obj, - deepCopied: false, - } - result.serializations.Store(make(serializationsCache)) - return result, nil - } - return nil, fmt.Errorf("can't cast object to metav1.Object: %#v", object) -} - -func (o *cachingObject) getSerializationResult(id runtime.Identifier) *serializationResult { - // Fast-path for getting from cache. - serializations := o.serializations.Load().(serializationsCache) - if result, exists := serializations[id]; exists { - return result - } - - // Slow-path (that may require insert). - o.lock.Lock() - defer o.lock.Unlock() - - serializations = o.serializations.Load().(serializationsCache) - // Check if in the meantime it wasn't inserted. - if result, exists := serializations[id]; exists { - return result - } - - // Insert an entry for . This requires copy of existing map. - newSerializations := make(serializationsCache) - for k, v := range serializations { - newSerializations[k] = v - } - result := &serializationResult{} - newSerializations[id] = result - o.serializations.Store(newSerializations) - return result -} - -// CacheEncode implements runtime.CacheableObject interface. -// It serializes the object and writes the result to given io.Writer trying -// to first use the already cached result and falls back to a given encode -// function in case of cache miss. -// It assumes that for a given identifier, the encode function always encodes -// each input object into the same output format. -func (o *cachingObject) CacheEncode(id runtime.Identifier, encode func(runtime.Object, io.Writer) error, w io.Writer) error { - result := o.getSerializationResult(id) - result.once.Do(func() { - buffer := bytes.NewBuffer(nil) - // TODO(wojtek-t): This is currently making a copy to avoid races - // in cases where encoding is making subtle object modifications, - // e.g. #82497 - // Figure out if we can somehow avoid this under some conditions. - result.err = encode(o.GetObject(), buffer) - result.raw = buffer.Bytes() - }) - // Once invoked, fields of serialization will not change. - if result.err != nil { - return result.err - } - if b, support := w.(runtime.Splice); support { - b.Splice(result.raw) - return nil - } - _, err := w.Write(result.raw) - return err -} - -// GetObject implements runtime.CacheableObject interface. -// It returns deep-copy of the wrapped object to return ownership of it -// to the called according to the contract of the interface. -func (o *cachingObject) GetObject() runtime.Object { - o.lock.RLock() - defer o.lock.RUnlock() - return o.object.DeepCopyObject().(metaRuntimeInterface) -} - -// GetObjectKind implements runtime.Object interface. -func (o *cachingObject) GetObjectKind() schema.ObjectKind { - o.lock.RLock() - defer o.lock.RUnlock() - return o.object.GetObjectKind() -} - -// DeepCopyObject implements runtime.Object interface. -func (o *cachingObject) DeepCopyObject() runtime.Object { - // DeepCopyObject on cachingObject is not expected to be called anywhere. - // However, to be on the safe-side, we implement it, though given the - // cache is only an optimization we ignore copying it. - result := &cachingObject{ - deepCopied: true, - } - result.serializations.Store(make(serializationsCache)) - - o.lock.RLock() - defer o.lock.RUnlock() - result.object = o.object.DeepCopyObject().(metaRuntimeInterface) - return result -} - -var ( - invalidationCacheTimestampLock sync.Mutex - invalidationCacheTimestamp time.Time -) - -// shouldLogCacheInvalidation allows for logging cache-invalidation -// at most once per second (to avoid spamming logs in case of issues). -func shouldLogCacheInvalidation(now time.Time) bool { - invalidationCacheTimestampLock.Lock() - defer invalidationCacheTimestampLock.Unlock() - if invalidationCacheTimestamp.Add(time.Second).Before(now) { - invalidationCacheTimestamp = now - return true - } - return false -} - -func (o *cachingObject) invalidateCacheLocked() { - if cache, ok := o.serializations.Load().(serializationsCache); ok && len(cache) == 0 { - return - } - // We don't expect cache invalidation to happen - so we want - // to log the stacktrace to allow debugging if that will happen. - // OTOH, we don't want to spam logs with it. - // So we try to log it at most once per second. - if shouldLogCacheInvalidation(time.Now()) { - klog.Warningf("Unexpected cache invalidation for %#v\n%s", o.object, string(debug.Stack())) - } - o.serializations.Store(make(serializationsCache)) -} - -// The following functions implement metav1.Object interface: -// - getters simply delegate for the underlying object -// - setters check if operations isn't noop and if so, -// invalidate the cache and delegate for the underlying object - -func (o *cachingObject) conditionalSet(isNoop func() bool, set func()) { - if fastPath := func() bool { - o.lock.RLock() - defer o.lock.RUnlock() - return isNoop() - }(); fastPath { - return - } - o.lock.Lock() - defer o.lock.Unlock() - if isNoop() { - return - } - if !o.deepCopied { - o.object = o.object.DeepCopyObject().(metaRuntimeInterface) - o.deepCopied = true - } - o.invalidateCacheLocked() - set() -} - -func (o *cachingObject) GetNamespace() string { - o.lock.RLock() - defer o.lock.RUnlock() - return o.object.GetNamespace() -} -func (o *cachingObject) SetNamespace(namespace string) { - o.conditionalSet( - func() bool { return o.object.GetNamespace() == namespace }, - func() { o.object.SetNamespace(namespace) }, - ) -} -func (o *cachingObject) GetName() string { - o.lock.RLock() - defer o.lock.RUnlock() - return o.object.GetName() -} -func (o *cachingObject) SetName(name string) { - o.conditionalSet( - func() bool { return o.object.GetName() == name }, - func() { o.object.SetName(name) }, - ) -} -func (o *cachingObject) GetGenerateName() string { - o.lock.RLock() - defer o.lock.RUnlock() - return o.object.GetGenerateName() -} -func (o *cachingObject) SetGenerateName(name string) { - o.conditionalSet( - func() bool { return o.object.GetGenerateName() == name }, - func() { o.object.SetGenerateName(name) }, - ) -} -func (o *cachingObject) GetUID() types.UID { - o.lock.RLock() - defer o.lock.RUnlock() - return o.object.GetUID() -} -func (o *cachingObject) SetUID(uid types.UID) { - o.conditionalSet( - func() bool { return o.object.GetUID() == uid }, - func() { o.object.SetUID(uid) }, - ) -} -func (o *cachingObject) GetResourceVersion() string { - o.lock.RLock() - defer o.lock.RUnlock() - return o.object.GetResourceVersion() -} -func (o *cachingObject) SetResourceVersion(version string) { - o.conditionalSet( - func() bool { return o.object.GetResourceVersion() == version }, - func() { o.object.SetResourceVersion(version) }, - ) -} -func (o *cachingObject) GetGeneration() int64 { - o.lock.RLock() - defer o.lock.RUnlock() - return o.object.GetGeneration() -} -func (o *cachingObject) SetGeneration(generation int64) { - o.conditionalSet( - func() bool { return o.object.GetGeneration() == generation }, - func() { o.object.SetGeneration(generation) }, - ) -} -func (o *cachingObject) GetSelfLink() string { - o.lock.RLock() - defer o.lock.RUnlock() - return o.object.GetSelfLink() -} -func (o *cachingObject) SetSelfLink(selfLink string) { - o.conditionalSet( - func() bool { return o.object.GetSelfLink() == selfLink }, - func() { o.object.SetSelfLink(selfLink) }, - ) -} -func (o *cachingObject) GetCreationTimestamp() metav1.Time { - o.lock.RLock() - defer o.lock.RUnlock() - return o.object.GetCreationTimestamp() -} -func (o *cachingObject) SetCreationTimestamp(timestamp metav1.Time) { - o.conditionalSet( - func() bool { return o.object.GetCreationTimestamp() == timestamp }, - func() { o.object.SetCreationTimestamp(timestamp) }, - ) -} -func (o *cachingObject) GetDeletionTimestamp() *metav1.Time { - o.lock.RLock() - defer o.lock.RUnlock() - return o.object.GetDeletionTimestamp() -} -func (o *cachingObject) SetDeletionTimestamp(timestamp *metav1.Time) { - o.conditionalSet( - func() bool { return o.object.GetDeletionTimestamp() == timestamp }, - func() { o.object.SetDeletionTimestamp(timestamp) }, - ) -} -func (o *cachingObject) GetDeletionGracePeriodSeconds() *int64 { - o.lock.RLock() - defer o.lock.RUnlock() - return o.object.GetDeletionGracePeriodSeconds() -} -func (o *cachingObject) SetDeletionGracePeriodSeconds(gracePeriodSeconds *int64) { - o.conditionalSet( - func() bool { return o.object.GetDeletionGracePeriodSeconds() == gracePeriodSeconds }, - func() { o.object.SetDeletionGracePeriodSeconds(gracePeriodSeconds) }, - ) -} -func (o *cachingObject) GetLabels() map[string]string { - o.lock.RLock() - defer o.lock.RUnlock() - return o.object.GetLabels() -} -func (o *cachingObject) SetLabels(labels map[string]string) { - o.conditionalSet( - func() bool { return reflect.DeepEqual(o.object.GetLabels(), labels) }, - func() { o.object.SetLabels(labels) }, - ) -} -func (o *cachingObject) GetAnnotations() map[string]string { - o.lock.RLock() - defer o.lock.RUnlock() - return o.object.GetAnnotations() -} -func (o *cachingObject) SetAnnotations(annotations map[string]string) { - o.conditionalSet( - func() bool { return reflect.DeepEqual(o.object.GetAnnotations(), annotations) }, - func() { o.object.SetAnnotations(annotations) }, - ) -} -func (o *cachingObject) GetFinalizers() []string { - o.lock.RLock() - defer o.lock.RUnlock() - return o.object.GetFinalizers() -} -func (o *cachingObject) SetFinalizers(finalizers []string) { - o.conditionalSet( - func() bool { return reflect.DeepEqual(o.object.GetFinalizers(), finalizers) }, - func() { o.object.SetFinalizers(finalizers) }, - ) -} -func (o *cachingObject) GetOwnerReferences() []metav1.OwnerReference { - o.lock.RLock() - defer o.lock.RUnlock() - return o.object.GetOwnerReferences() -} -func (o *cachingObject) SetOwnerReferences(references []metav1.OwnerReference) { - o.conditionalSet( - func() bool { return reflect.DeepEqual(o.object.GetOwnerReferences(), references) }, - func() { o.object.SetOwnerReferences(references) }, - ) -} -func (o *cachingObject) GetManagedFields() []metav1.ManagedFieldsEntry { - o.lock.RLock() - defer o.lock.RUnlock() - return o.object.GetManagedFields() -} -func (o *cachingObject) SetManagedFields(managedFields []metav1.ManagedFieldsEntry) { - o.conditionalSet( - func() bool { return reflect.DeepEqual(o.object.GetManagedFields(), managedFields) }, - func() { o.object.SetManagedFields(managedFields) }, - ) -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/delegator.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/delegator.go deleted file mode 100644 index ac17fb1c8..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/delegator.go +++ /dev/null @@ -1,437 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cacher - -import ( - "context" - "fmt" - "hash" - "hash/fnv" - "os" - "strconv" - "sync" - "time" - - "go.opentelemetry.io/otel/attribute" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/apiserver/pkg/audit" - "k8s.io/apiserver/pkg/features" - "k8s.io/apiserver/pkg/storage" - "k8s.io/apiserver/pkg/storage/cacher/delegator" - "k8s.io/apiserver/pkg/storage/cacher/metrics" - utilfeature "k8s.io/apiserver/pkg/util/feature" - "k8s.io/component-base/tracing" - "k8s.io/klog/v2" -) - -var ( - // ConsistencyCheckPeriod is the period of checking consistency between etcd and cache. - // 5 minutes were proposed to match the default compaction period. It's magnitute higher than - // List latency SLO (30 seconds) and timeout (1 minute). - ConsistencyCheckPeriod = 5 * time.Minute - // ConsistencyCheckerEnabled enables the consistency checking mechanism for cache. - // Based on KUBE_WATCHCACHE_CONSISTENCY_CHECKER environment variable. - ConsistencyCheckerEnabled = false -) - -func init() { - ConsistencyCheckerEnabled, _ = strconv.ParseBool(os.Getenv("KUBE_WATCHCACHE_CONSISTENCY_CHECKER")) -} - -func NewCacheDelegator(cacher *Cacher, storage storage.Interface) *CacheDelegator { - d := &CacheDelegator{ - cacher: cacher, - storage: storage, - stopCh: make(chan struct{}), - } - if ConsistencyCheckerEnabled { - d.checker = newConsistencyChecker(cacher.resourcePrefix, cacher.newListFunc, cacher, storage) - d.wg.Add(1) - go func() { - defer d.wg.Done() - d.checker.startChecking(d.stopCh) - }() - } - return d -} - -type CacheDelegator struct { - cacher *Cacher - storage storage.Interface - checker *consistencyChecker - - wg sync.WaitGroup - stopOnce sync.Once - stopCh chan struct{} -} - -var _ storage.Interface = (*CacheDelegator)(nil) - -func (c *CacheDelegator) Versioner() storage.Versioner { - return c.storage.Versioner() -} - -func (c *CacheDelegator) Create(ctx context.Context, key string, obj, out runtime.Object, ttl uint64) error { - return c.storage.Create(ctx, key, obj, out, ttl) -} - -func (c *CacheDelegator) GetCurrentResourceVersion(ctx context.Context) (uint64, error) { - return c.storage.GetCurrentResourceVersion(ctx) -} - -func (c *CacheDelegator) Delete(ctx context.Context, key string, out runtime.Object, preconditions *storage.Preconditions, validateDeletion storage.ValidateObjectFunc, cachedExistingObject runtime.Object, opts storage.DeleteOptions) error { - // Ignore the suggestion and try to pass down the current version of the object - // read from cache. - if elem, exists, err := c.cacher.watchCache.GetByKey(key); err != nil { - klog.Errorf("GetByKey returned error: %v", err) - } else if exists { - // DeepCopy the object since we modify resource version when serializing the - // current object. - currObj := elem.(*storeElement).Object.DeepCopyObject() - return c.storage.Delete(ctx, key, out, preconditions, validateDeletion, currObj, opts) - } - // If we couldn't get the object, fallback to no-suggestion. - return c.storage.Delete(ctx, key, out, preconditions, validateDeletion, nil, opts) -} - -func (c *CacheDelegator) Watch(ctx context.Context, key string, opts storage.ListOptions) (watch.Interface, error) { - // if the watch-list feature wasn't set and the resourceVersion is unset - // ensure that the rv from which the watch is being served, is the latest - // one. "latest" is ensured by serving the watch from - // the underlying storage. - // - // it should never happen due to our validation but let's just be super-safe here - // and disable sendingInitialEvents when the feature wasn't enabled - if !utilfeature.DefaultFeatureGate.Enabled(features.WatchList) && opts.SendInitialEvents != nil { - opts.SendInitialEvents = nil - } - // TODO: we should eventually get rid of this legacy case - if utilfeature.DefaultFeatureGate.Enabled(features.WatchFromStorageWithoutResourceVersion) && opts.SendInitialEvents == nil && opts.ResourceVersion == "" { - return c.storage.Watch(ctx, key, opts) - } - return c.cacher.Watch(ctx, key, opts) -} - -func (c *CacheDelegator) Get(ctx context.Context, key string, opts storage.GetOptions, objPtr runtime.Object) error { - ctx, span := tracing.Start(ctx, "cacher.Get", - attribute.String("audit-id", audit.GetAuditIDTruncated(ctx)), - attribute.String("key", key), - attribute.String("resource-version", opts.ResourceVersion)) - defer span.End(500 * time.Millisecond) - if opts.ResourceVersion == "" { - // If resourceVersion is not specified, serve it from underlying - // storage (for backward compatibility). - span.AddEvent("About to Get from underlying storage") - return c.storage.Get(ctx, key, opts, objPtr) - } - - if utilfeature.DefaultFeatureGate.Enabled(features.ResilientWatchCacheInitialization) { - if !c.cacher.Ready() { - // If Cache is not initialized, delegator Get requests to storage - // as described in https://kep.k8s.io/4568 - span.AddEvent("About to Get from underlying storage - cache not initialized") - return c.storage.Get(ctx, key, opts, objPtr) - } - } - // If resourceVersion is specified, serve it from cache. - // It's guaranteed that the returned value is at least that - // fresh as the given resourceVersion. - getRV, err := c.cacher.versioner.ParseResourceVersion(opts.ResourceVersion) - if err != nil { - return err - } - // Do not create a trace - it's not for free and there are tons - // of Get requests. We can add it if it will be really needed. - if !utilfeature.DefaultFeatureGate.Enabled(features.ResilientWatchCacheInitialization) { - if getRV == 0 && !c.cacher.Ready() { - // If Cacher is not yet initialized and we don't require any specific - // minimal resource version, simply forward the request to storage. - return c.storage.Get(ctx, key, opts, objPtr) - } - if err := c.cacher.ready.wait(ctx); err != nil { - return errors.NewServiceUnavailable(err.Error()) - } - } - span.AddEvent("About to fetch object from cache") - return c.cacher.Get(ctx, key, opts, objPtr) -} - -func (c *CacheDelegator) GetList(ctx context.Context, key string, opts storage.ListOptions, listObj runtime.Object) error { - _, _, err := storage.ValidateListOptions(c.cacher.resourcePrefix, c.cacher.versioner, opts) - if err != nil { - return err - } - result, err := delegator.ShouldDelegateList(opts, c.cacher) - if err != nil { - return err - } - if result.ShouldDelegate { - return c.storage.GetList(ctx, key, opts, listObj) - } - - listRV, err := c.cacher.versioner.ParseResourceVersion(opts.ResourceVersion) - if err != nil { - return err - } - - if utilfeature.DefaultFeatureGate.Enabled(features.ResilientWatchCacheInitialization) { - if !c.cacher.Ready() && shouldDelegateListOnNotReadyCache(opts) { - // If Cacher is not initialized, delegator List requests to storage - // as described in https://kep.k8s.io/4568 - return c.storage.GetList(ctx, key, opts, listObj) - } - } else { - if listRV == 0 && !c.cacher.Ready() { - // If Cacher is not yet initialized and we don't require any specific - // minimal resource version, simply forward the request to storage. - return c.storage.GetList(ctx, key, opts, listObj) - } - } - if result.ConsistentRead { - listRV, err = c.storage.GetCurrentResourceVersion(ctx) - if err != nil { - return err - } - // Setting resource version for consistent read in cache based on current ResourceVersion in etcd. - opts.ResourceVersion = strconv.FormatInt(int64(listRV), 10) - } - err = c.cacher.GetList(ctx, key, opts, listObj) - success := "true" - fallback := "false" - if err != nil { - if errors.IsResourceExpired(err) { - return c.storage.GetList(ctx, key, opts, listObj) - } - if result.ConsistentRead { - if storage.IsTooLargeResourceVersion(err) { - fallback = "true" - // Reset resourceVersion during fallback from consistent read. - opts.ResourceVersion = "" - err = c.storage.GetList(ctx, key, opts, listObj) - } - if err != nil { - success = "false" - } - metrics.ConsistentReadTotal.WithLabelValues(c.cacher.resourcePrefix, success, fallback).Add(1) - } - return err - } - if result.ConsistentRead { - metrics.ConsistentReadTotal.WithLabelValues(c.cacher.resourcePrefix, success, fallback).Add(1) - } - return nil -} - -func shouldDelegateListOnNotReadyCache(opts storage.ListOptions) bool { - pred := opts.Predicate - noLabelSelector := pred.Label == nil || pred.Label.Empty() - noFieldSelector := pred.Field == nil || pred.Field.Empty() - hasLimit := pred.Limit > 0 - return noLabelSelector && noFieldSelector && hasLimit -} - -func (c *CacheDelegator) GuaranteedUpdate(ctx context.Context, key string, destination runtime.Object, ignoreNotFound bool, preconditions *storage.Preconditions, tryUpdate storage.UpdateFunc, cachedExistingObject runtime.Object) error { - // Ignore the suggestion and try to pass down the current version of the object - // read from cache. - if elem, exists, err := c.cacher.watchCache.GetByKey(key); err != nil { - klog.Errorf("GetByKey returned error: %v", err) - } else if exists { - // DeepCopy the object since we modify resource version when serializing the - // current object. - currObj := elem.(*storeElement).Object.DeepCopyObject() - return c.storage.GuaranteedUpdate(ctx, key, destination, ignoreNotFound, preconditions, tryUpdate, currObj) - } - // If we couldn't get the object, fallback to no-suggestion. - return c.storage.GuaranteedUpdate(ctx, key, destination, ignoreNotFound, preconditions, tryUpdate, nil) -} - -func (c *CacheDelegator) Count(pathPrefix string) (int64, error) { - return c.storage.Count(pathPrefix) -} - -func (c *CacheDelegator) ReadinessCheck() error { - if !c.cacher.Ready() { - return storage.ErrStorageNotReady - } - return nil -} - -func (c *CacheDelegator) RequestWatchProgress(ctx context.Context) error { - return c.storage.RequestWatchProgress(ctx) -} - -func (c *CacheDelegator) Stop() { - c.stopOnce.Do(func() { - close(c.stopCh) - }) - c.wg.Wait() -} - -func newConsistencyChecker(resourcePrefix string, newListFunc func() runtime.Object, cacher getListerReady, etcd getLister) *consistencyChecker { - return &consistencyChecker{ - resourcePrefix: resourcePrefix, - newListFunc: newListFunc, - cacher: cacher, - etcd: etcd, - } -} - -type consistencyChecker struct { - resourcePrefix string - newListFunc func() runtime.Object - - cacher getListerReady - etcd getLister -} - -type getListerReady interface { - getLister - Ready() bool -} - -type getLister interface { - GetList(ctx context.Context, key string, opts storage.ListOptions, listObj runtime.Object) error -} - -func (c consistencyChecker) startChecking(stopCh <-chan struct{}) { - err := wait.PollUntilContextCancel(wait.ContextForChannel(stopCh), ConsistencyCheckPeriod, false, func(ctx context.Context) (done bool, err error) { - c.check(ctx) - return false, nil - }) - if err != nil { - klog.InfoS("Cache consistency check exiting", "resource", c.resourcePrefix, "err", err) - } -} - -func (c *consistencyChecker) check(ctx context.Context) { - digests, err := c.calculateDigests(ctx) - if err != nil { - klog.ErrorS(err, "Cache consistency check error", "resource", c.resourcePrefix) - metrics.StorageConsistencyCheckTotal.WithLabelValues(c.resourcePrefix, "error").Inc() - return - } - if digests.CacheDigest == digests.EtcdDigest { - klog.V(3).InfoS("Cache consistency check passed", "resource", c.resourcePrefix, "resourceVersion", digests.ResourceVersion, "digest", digests.CacheDigest) - metrics.StorageConsistencyCheckTotal.WithLabelValues(c.resourcePrefix, "success").Inc() - } else { - klog.ErrorS(nil, "Cache consistency check failed", "resource", c.resourcePrefix, "resourceVersion", digests.ResourceVersion, "etcdDigest", digests.EtcdDigest, "cacheDigest", digests.CacheDigest) - metrics.StorageConsistencyCheckTotal.WithLabelValues(c.resourcePrefix, "failure").Inc() - // Panic on internal consistency checking enabled only by environment variable. R - panic(fmt.Sprintf("Cache consistency check failed, resource: %q, resourceVersion: %q, etcdDigest: %q, cacheDigest: %q", c.resourcePrefix, digests.ResourceVersion, digests.EtcdDigest, digests.CacheDigest)) - } -} - -func (c *consistencyChecker) calculateDigests(ctx context.Context) (*storageDigest, error) { - if !c.cacher.Ready() { - return nil, fmt.Errorf("cache is not ready") - } - cacheDigest, resourceVersion, err := c.calculateStoreDigest(ctx, c.cacher, storage.ListOptions{ - Recursive: true, - ResourceVersion: "0", - Predicate: storage.Everything, - ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, - }) - if err != nil { - return nil, fmt.Errorf("failed calculating cache digest: %w", err) - } - etcdDigest, _, err := c.calculateStoreDigest(ctx, c.etcd, storage.ListOptions{ - Recursive: true, - ResourceVersion: resourceVersion, - Predicate: storage.Everything, - ResourceVersionMatch: metav1.ResourceVersionMatchExact, - }) - if err != nil { - return nil, fmt.Errorf("failed calculating etcd digest: %w", err) - } - return &storageDigest{ - ResourceVersion: resourceVersion, - CacheDigest: cacheDigest, - EtcdDigest: etcdDigest, - }, nil -} - -type storageDigest struct { - ResourceVersion string - CacheDigest string - EtcdDigest string -} - -func (c *consistencyChecker) calculateStoreDigest(ctx context.Context, store getLister, opts storage.ListOptions) (digest, rv string, err error) { - // TODO: Implement pagination - resp := c.newListFunc() - err = store.GetList(ctx, c.resourcePrefix, opts, resp) - if err != nil { - return "", "", err - } - digest, err = listDigest(resp) - if err != nil { - return "", "", err - } - list, err := meta.ListAccessor(resp) - if err != nil { - return "", "", err - } - return digest, list.GetResourceVersion(), nil -} - -func listDigest(list runtime.Object) (string, error) { - h := fnv.New64() - err := meta.EachListItem(list, func(obj runtime.Object) error { - objectMeta, err := meta.Accessor(obj) - if err != nil { - return err - } - err = addObjectToDigest(h, objectMeta) - if err != nil { - return err - } - return nil - }) - if err != nil { - return "", err - } - return fmt.Sprintf("%x", h.Sum64()), nil -} - -func addObjectToDigest(h hash.Hash64, objectMeta metav1.Object) error { - _, err := h.Write([]byte(objectMeta.GetNamespace())) - if err != nil { - return err - } - _, err = h.Write([]byte("/")) - if err != nil { - return err - } - _, err = h.Write([]byte(objectMeta.GetName())) - if err != nil { - return err - } - _, err = h.Write([]byte("/")) - if err != nil { - return err - } - _, err = h.Write([]byte(objectMeta.GetResourceVersion())) - if err != nil { - return err - } - return nil -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/delegator/interface.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/delegator/interface.go deleted file mode 100644 index 1cdf5145e..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/delegator/interface.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package delegator - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apiserver/pkg/features" - "k8s.io/apiserver/pkg/storage" - etcdfeature "k8s.io/apiserver/pkg/storage/feature" - utilfeature "k8s.io/apiserver/pkg/util/feature" -) - -func ShouldDelegateListMeta(opts *metav1.ListOptions, cache Helper) (Result, error) { - return ShouldDelegateList( - storage.ListOptions{ - ResourceVersionMatch: opts.ResourceVersionMatch, - ResourceVersion: opts.ResourceVersion, - Predicate: storage.SelectionPredicate{ - Continue: opts.Continue, - Limit: opts.Limit, - }, - Recursive: true, - }, cache) -} - -func ShouldDelegateList(opts storage.ListOptions, cache Helper) (Result, error) { - // see https://kubernetes.io/docs/reference/using-api/api-concepts/#semantics-for-get-and-list - switch opts.ResourceVersionMatch { - case metav1.ResourceVersionMatchExact: - return cache.ShouldDelegateExactRV(opts.ResourceVersion, opts.Recursive) - case metav1.ResourceVersionMatchNotOlderThan: - return Result{ShouldDelegate: false}, nil - case "": - // Continue - if len(opts.Predicate.Continue) > 0 { - return cache.ShouldDelegateContinue(opts.Predicate.Continue, opts.Recursive) - } - // Legacy exact match - if opts.Predicate.Limit > 0 && len(opts.ResourceVersion) > 0 && opts.ResourceVersion != "0" { - return cache.ShouldDelegateExactRV(opts.ResourceVersion, opts.Recursive) - } - // Consistent Read - if opts.ResourceVersion == "" { - return cache.ShouldDelegateConsistentRead() - } - return Result{ShouldDelegate: false}, nil - default: - return Result{ShouldDelegate: true}, nil - } -} - -type Helper interface { - ShouldDelegateExactRV(rv string, recursive bool) (Result, error) - ShouldDelegateContinue(continueToken string, recursive bool) (Result, error) - ShouldDelegateConsistentRead() (Result, error) -} - -// Result of delegator decision. -type Result struct { - // Whether a request cannot be served by cache and should be delegated to etcd. - ShouldDelegate bool - // Whether a request is a consistent read, used by delegator to decide if it should call GetCurrentResourceVersion to get RV. - // Included in interface as only cacher has keyPrefix needed to parse continue token. - ConsistentRead bool -} - -type CacheWithoutSnapshots struct{} - -var _ Helper = CacheWithoutSnapshots{} - -func (c CacheWithoutSnapshots) ShouldDelegateContinue(continueToken string, recursive bool) (Result, error) { - return Result{ - ShouldDelegate: true, - // Continue with negative RV is considered a consistent read, however token cannot be parsed without keyPrefix unavailable in staging/src/k8s.io/apiserver/pkg/util/flow_control/request/list_work_estimator.go. - ConsistentRead: false, - }, nil -} - -func (c CacheWithoutSnapshots) ShouldDelegateExactRV(rv string, recursive bool) (Result, error) { - return Result{ - ShouldDelegate: true, - ConsistentRead: false, - }, nil -} - -func (c CacheWithoutSnapshots) ShouldDelegateConsistentRead() (Result, error) { - return Result{ - ShouldDelegate: !ConsistentReadSupported(), - ConsistentRead: true, - }, nil -} - -// ConsistentReadSupported returns whether cache can be used to serve reads with RV not yet observed by cache, including both consistent reads. -// Function is located here to avoid import cycles between staging/src/k8s.io/apiserver/pkg/storage/cacher/delegator.go and staging/src/k8s.io/apiserver/pkg/util/flow_control/request/list_work_estimator.go. -func ConsistentReadSupported() bool { - consistentListFromCacheEnabled := utilfeature.DefaultFeatureGate.Enabled(features.ConsistentListFromCache) - requestWatchProgressSupported := etcdfeature.DefaultFeatureSupportChecker.Supports(storage.RequestWatchProgress) - return consistentListFromCacheEnabled && requestWatchProgressSupported -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/lister_watcher.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/lister_watcher.go deleted file mode 100644 index 2817a93dd..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/lister_watcher.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cacher - -import ( - "context" - - "google.golang.org/grpc/metadata" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/apiserver/pkg/storage" - "k8s.io/client-go/tools/cache" -) - -// listerWatcher opaques storage.Interface to expose cache.ListerWatcher. -type listerWatcher struct { - storage storage.Interface - resourcePrefix string - newListFunc func() runtime.Object - contextMetadata metadata.MD -} - -// NewListerWatcher returns a storage.Interface backed ListerWatcher. -func NewListerWatcher(storage storage.Interface, resourcePrefix string, newListFunc func() runtime.Object, contextMetadata metadata.MD) cache.ListerWatcher { - return &listerWatcher{ - storage: storage, - resourcePrefix: resourcePrefix, - newListFunc: newListFunc, - contextMetadata: contextMetadata, - } -} - -// Implements cache.ListerWatcher interface. -func (lw *listerWatcher) List(options metav1.ListOptions) (runtime.Object, error) { - list := lw.newListFunc() - pred := storage.SelectionPredicate{ - Label: labels.Everything(), - Field: fields.Everything(), - Limit: options.Limit, - Continue: options.Continue, - } - - storageOpts := storage.ListOptions{ - ResourceVersionMatch: options.ResourceVersionMatch, - Predicate: pred, - Recursive: true, - } - ctx := context.Background() - if lw.contextMetadata != nil { - ctx = metadata.NewOutgoingContext(ctx, lw.contextMetadata) - } - if err := lw.storage.GetList(ctx, lw.resourcePrefix, storageOpts, list); err != nil { - return nil, err - } - return list, nil -} - -// Implements cache.ListerWatcher interface. -func (lw *listerWatcher) Watch(options metav1.ListOptions) (watch.Interface, error) { - opts := storage.ListOptions{ - ResourceVersion: options.ResourceVersion, - Predicate: storage.Everything, - Recursive: true, - ProgressNotify: true, - } - ctx := context.Background() - if lw.contextMetadata != nil { - ctx = metadata.NewOutgoingContext(ctx, lw.contextMetadata) - } - return lw.storage.Watch(ctx, lw.resourcePrefix, opts) -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/metrics/OWNERS b/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/metrics/OWNERS deleted file mode 100644 index b26e7a4dc..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/metrics/OWNERS +++ /dev/null @@ -1,8 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - sig-instrumentation-approvers -reviewers: - - sig-instrumentation-reviewers -labels: - - sig/instrumentation diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/metrics/metrics.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/metrics/metrics.go deleted file mode 100644 index 0559708d2..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/metrics/metrics.go +++ /dev/null @@ -1,233 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package metrics - -import ( - "sync" - - compbasemetrics "k8s.io/component-base/metrics" - "k8s.io/component-base/metrics/legacyregistry" -) - -const ( - namespace = "apiserver" - subsystem = "watch_cache" -) - -/* - * By default, all the following metrics are defined as falling under - * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/kubernetes-control-plane-metrics-stability.md#stability-classes) - * - * Promoting the stability level of the metric is a responsibility of the component owner, since it - * involves explicitly acknowledging support for the metric across multiple releases, in accordance with - * the metric stability policy. - */ -var ( - listCacheCount = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Namespace: namespace, - Name: "cache_list_total", - Help: "Number of LIST requests served from watch cache", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"resource_prefix", "index"}, - ) - listCacheNumFetched = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Namespace: namespace, - Name: "cache_list_fetched_objects_total", - Help: "Number of objects read from watch cache in the course of serving a LIST request", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"resource_prefix", "index"}, - ) - listCacheNumReturned = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Namespace: namespace, - Name: "cache_list_returned_objects_total", - Help: "Number of objects returned for a LIST request from watch cache", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"resource_prefix"}, - ) - InitCounter = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Namespace: namespace, - Name: "init_events_total", - Help: "Counter of init events processed in watch cache broken by resource type.", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"resource"}, - ) - - EventsReceivedCounter = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "events_received_total", - Help: "Counter of events received in watch cache broken by resource type.", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"resource"}, - ) - - EventsCounter = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "events_dispatched_total", - Help: "Counter of events dispatched in watch cache broken by resource type.", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"resource"}, - ) - - TerminatedWatchersCounter = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Namespace: namespace, - Name: "terminated_watchers_total", - Help: "Counter of watchers closed due to unresponsiveness broken by resource type.", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"resource"}, - ) - - watchCacheResourceVersion = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "resource_version", - Help: "Current resource version of watch cache broken by resource type.", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"resource"}, - ) - - watchCacheCapacityIncreaseTotal = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Subsystem: subsystem, - Name: "capacity_increase_total", - Help: "Total number of watch cache capacity increase events broken by resource type.", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"resource"}, - ) - - watchCacheCapacityDecreaseTotal = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Subsystem: subsystem, - Name: "capacity_decrease_total", - Help: "Total number of watch cache capacity decrease events broken by resource type.", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"resource"}, - ) - - WatchCacheCapacity = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Subsystem: subsystem, - Name: "capacity", - Help: "Total capacity of watch cache broken by resource type.", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"resource"}, - ) - - WatchCacheInitializations = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "initializations_total", - Help: "Counter of watch cache initializations broken by resource type.", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"resource"}, - ) - - WatchCacheReadWait = compbasemetrics.NewHistogramVec( - &compbasemetrics.HistogramOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "read_wait_seconds", - Help: "Histogram of time spent waiting for a watch cache to become fresh.", - StabilityLevel: compbasemetrics.ALPHA, - Buckets: []float64{0.005, 0.025, 0.05, 0.1, 0.2, 0.4, 0.6, 0.8, 1.0, 1.25, 1.5, 2, 3}, - }, []string{"resource"}) - - ConsistentReadTotal = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "consistent_read_total", - Help: "Counter for consistent reads from cache.", - StabilityLevel: compbasemetrics.ALPHA, - }, []string{"resource", "success", "fallback"}) - - StorageConsistencyCheckTotal = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Namespace: namespace, - Name: "storage_consistency_checks_total", - Help: "Counter for status of consistency checks between etcd and watch cache", - StabilityLevel: compbasemetrics.INTERNAL, - }, []string{"resource", "status"}) -) - -var registerMetrics sync.Once - -// Register all metrics. -func Register() { - // Register the metrics. - registerMetrics.Do(func() { - legacyregistry.MustRegister(listCacheCount) - legacyregistry.MustRegister(listCacheNumFetched) - legacyregistry.MustRegister(listCacheNumReturned) - legacyregistry.MustRegister(InitCounter) - legacyregistry.MustRegister(EventsReceivedCounter) - legacyregistry.MustRegister(EventsCounter) - legacyregistry.MustRegister(TerminatedWatchersCounter) - legacyregistry.MustRegister(watchCacheResourceVersion) - legacyregistry.MustRegister(watchCacheCapacityIncreaseTotal) - legacyregistry.MustRegister(watchCacheCapacityDecreaseTotal) - legacyregistry.MustRegister(WatchCacheCapacity) - legacyregistry.MustRegister(WatchCacheInitializations) - legacyregistry.MustRegister(WatchCacheReadWait) - legacyregistry.MustRegister(ConsistentReadTotal) - legacyregistry.MustRegister(StorageConsistencyCheckTotal) - }) -} - -// RecordListCacheMetrics notes various metrics of the cost to serve a LIST request -func RecordListCacheMetrics(resourcePrefix, indexName string, numFetched, numReturned int) { - listCacheCount.WithLabelValues(resourcePrefix, indexName).Inc() - listCacheNumFetched.WithLabelValues(resourcePrefix, indexName).Add(float64(numFetched)) - listCacheNumReturned.WithLabelValues(resourcePrefix).Add(float64(numReturned)) -} - -// RecordResourceVersion sets the current resource version for a given resource type. -func RecordResourceVersion(resourcePrefix string, resourceVersion uint64) { - watchCacheResourceVersion.WithLabelValues(resourcePrefix).Set(float64(resourceVersion)) -} - -// RecordsWatchCacheCapacityChange record watchCache capacity resize(increase or decrease) operations. -func RecordsWatchCacheCapacityChange(objType string, old, new int) { - WatchCacheCapacity.WithLabelValues(objType).Set(float64(new)) - if old < new { - watchCacheCapacityIncreaseTotal.WithLabelValues(objType).Inc() - return - } - watchCacheCapacityDecreaseTotal.WithLabelValues(objType).Inc() -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/progress/watch_progress.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/progress/watch_progress.go deleted file mode 100644 index 76fe73f13..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/progress/watch_progress.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package progress - -import ( - "context" - "sync" - "time" - - "google.golang.org/grpc/metadata" - - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/wait" - - "k8s.io/klog/v2" - "k8s.io/utils/clock" -) - -const ( - // progressRequestPeriod determines period of requesting progress - // from etcd when there is a request waiting for watch cache to be fresh. - progressRequestPeriod = 100 * time.Millisecond -) - -func NewConditionalProgressRequester(requestWatchProgress WatchProgressRequester, clock TickerFactory, contextMetadata metadata.MD) *ConditionalProgressRequester { - pr := &ConditionalProgressRequester{ - clock: clock, - requestWatchProgress: requestWatchProgress, - contextMetadata: contextMetadata, - } - pr.cond = sync.NewCond(&pr.mux) - return pr -} - -type WatchProgressRequester func(ctx context.Context) error - -type TickerFactory interface { - NewTimer(time.Duration) clock.Timer -} - -// ConditionalProgressRequester will request progress notification if there -// is a request waiting for watch cache to be fresh. -type ConditionalProgressRequester struct { - clock TickerFactory - requestWatchProgress WatchProgressRequester - contextMetadata metadata.MD - - mux sync.Mutex - cond *sync.Cond - waiting int - stopped bool -} - -func (pr *ConditionalProgressRequester) Run(stopCh <-chan struct{}) { - ctx := wait.ContextForChannel(stopCh) - if pr.contextMetadata != nil { - ctx = metadata.NewOutgoingContext(ctx, pr.contextMetadata) - } - go func() { - defer utilruntime.HandleCrash() - <-stopCh - pr.mux.Lock() - defer pr.mux.Unlock() - pr.stopped = true - pr.cond.Signal() - }() - timer := pr.clock.NewTimer(progressRequestPeriod) - defer timer.Stop() - for { - stopped := func() bool { - pr.mux.Lock() - defer pr.mux.Unlock() - for pr.waiting == 0 && !pr.stopped { - pr.cond.Wait() - } - return pr.stopped - }() - if stopped { - return - } - - select { - case <-timer.C(): - shouldRequest := func() bool { - pr.mux.Lock() - defer pr.mux.Unlock() - return pr.waiting > 0 && !pr.stopped - }() - if !shouldRequest { - timer.Reset(0) - continue - } - timer.Reset(progressRequestPeriod) - err := pr.requestWatchProgress(ctx) - if err != nil { - klog.V(4).InfoS("Error requesting bookmark", "err", err) - } - case <-stopCh: - return - } - } -} - -func (pr *ConditionalProgressRequester) Add() { - pr.mux.Lock() - defer pr.mux.Unlock() - pr.waiting += 1 - pr.cond.Signal() -} - -func (pr *ConditionalProgressRequester) Remove() { - pr.mux.Lock() - defer pr.mux.Unlock() - pr.waiting -= 1 -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/ready.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/ready.go deleted file mode 100644 index 68ff509f0..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/ready.go +++ /dev/null @@ -1,195 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cacher - -import ( - "context" - "fmt" - "sync" - "time" - - "k8s.io/utils/clock" -) - -type status int - -const ( - Pending status = iota - Ready - Stopped -) - -// ready is a three state condition variable that blocks until is Ready if is not Stopped. -// Its initial state is Pending and its state machine diagram is as follow. -// -// Pending <------> Ready -----> Stopped -// -// | ^ -// └---------------------------┘ -type ready struct { - state status // represent the state of the variable - lastErr error - generation int // represent the number of times we have transtioned to ready - lock sync.RWMutex // protect the state and generation variables - restartLock sync.Mutex // protect the transition from ready to pending where the channel is recreated - waitCh chan struct{} // blocks until is ready or stopped - - clock clock.Clock - lastStateChangeTime time.Time -} - -func newReady(c clock.Clock) *ready { - r := &ready{ - waitCh: make(chan struct{}), - state: Pending, - clock: c, - } - r.updateLastStateChangeTimeLocked() - - return r -} - -// done close the channel once the state is Ready or Stopped -func (r *ready) done() chan struct{} { - r.restartLock.Lock() - defer r.restartLock.Unlock() - return r.waitCh -} - -// wait blocks until it is Ready or Stopped, it returns an error if is Stopped. -func (r *ready) wait(ctx context.Context) error { - _, err := r.waitAndReadGeneration(ctx) - return err -} - -// waitAndReadGenration blocks until it is Ready or Stopped and returns number -// of times we entered ready state if Ready and error otherwise. -func (r *ready) waitAndReadGeneration(ctx context.Context) (int, error) { - for { - // r.done() only blocks if state is Pending - select { - case <-ctx.Done(): - return 0, ctx.Err() - case <-r.done(): - } - - r.lock.RLock() - if r.state == Pending { - // since we allow to switch between the states Pending and Ready - // if there is a quick transition from Pending -> Ready -> Pending - // a process that was waiting can get unblocked and see a Pending - // state again. If the state is Pending we have to wait again to - // avoid an inconsistent state on the system, with some processes not - // waiting despite the state moved back to Pending. - r.lock.RUnlock() - continue - } - generation, err := r.readGenerationLocked() - r.lock.RUnlock() - return generation, err - } -} - -// check returns the time elapsed since the state was last changed and the current value. -func (r *ready) check() (time.Duration, error) { - _, elapsed, err := r.checkAndReadGeneration() - return elapsed, err -} - -// checkAndReadGeneration returns the current generation, the time elapsed since the state was last changed and the current value. -func (r *ready) checkAndReadGeneration() (int, time.Duration, error) { - r.lock.RLock() - defer r.lock.RUnlock() - generation, err := r.readGenerationLocked() - return generation, r.clock.Since(r.lastStateChangeTime), err -} - -func (r *ready) readGenerationLocked() (int, error) { - switch r.state { - case Pending: - if r.lastErr == nil { - return 0, fmt.Errorf("storage is (re)initializing") - } else { - return 0, fmt.Errorf("storage is (re)initializing: %w", r.lastErr) - } - case Ready: - return r.generation, nil - case Stopped: - return 0, fmt.Errorf("apiserver cacher is stopped") - default: - return 0, fmt.Errorf("unexpected apiserver cache state: %v", r.state) - } -} - -func (r *ready) setReady() { - r.set(true, nil) -} - -func (r *ready) setError(err error) { - r.set(false, err) -} - -// set the state to Pending (false) or Ready (true), it does not have effect if the state is Stopped. -func (r *ready) set(ok bool, err error) { - r.lock.Lock() - defer r.lock.Unlock() - if r.state == Stopped { - return - } - r.lastErr = err - if ok && r.state == Pending { - r.state = Ready - r.generation++ - r.updateLastStateChangeTimeLocked() - select { - case <-r.waitCh: - default: - close(r.waitCh) - } - } else if !ok && r.state == Ready { - // creating the waitCh can be racy if - // something enter the wait() method - select { - case <-r.waitCh: - r.restartLock.Lock() - r.waitCh = make(chan struct{}) - r.restartLock.Unlock() - default: - } - r.state = Pending - r.updateLastStateChangeTimeLocked() - } -} - -// stop the condition variable and set it as Stopped. This state is irreversible. -func (r *ready) stop() { - r.lock.Lock() - defer r.lock.Unlock() - if r.state != Stopped { - r.state = Stopped - r.updateLastStateChangeTimeLocked() - } - select { - case <-r.waitCh: - default: - close(r.waitCh) - } -} - -func (r *ready) updateLastStateChangeTimeLocked() { - r.lastStateChangeTime = r.clock.Now() -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/store.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/store.go deleted file mode 100644 index 9ec654e7d..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/store.go +++ /dev/null @@ -1,135 +0,0 @@ -/* -Copyright 2024 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cacher - -import ( - "fmt" - - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apiserver/pkg/features" - utilfeature "k8s.io/apiserver/pkg/util/feature" - "k8s.io/client-go/tools/cache" -) - -const ( - // btreeDegree defines the degree of btree storage. - // Decided based on the benchmark results (below). - // Selected the lowest degree from three options with best runtime (16,32,128). - // │ 2 │ 4 │ 8 │ 16 │ 32 │ 64 │ 128 │ - // │ sec/op │ sec/op vs base │ sec/op vs base │ sec/op vs base │ sec/op vs base │ sec/op vs base │ sec/op vs base │ - // StoreCreateList/RV=NotOlderThan-24 473.0µ ± 11% 430.1µ ± 9% -9.08% (p=0.005 n=10) 427.9µ ± 6% -9.54% (p=0.002 n=10) 403.9µ ± 8% -14.62% (p=0.000 n=10) 401.0µ ± 4% -15.22% (p=0.000 n=10) 408.0µ ± 4% -13.75% (p=0.000 n=10) 385.9µ ± 4% -18.42% (p=0.000 n=10) - // StoreCreateList/RV=ExactMatch-24 604.7µ ± 4% 596.7µ ± 8% ~ (p=0.529 n=10) 604.6µ ± 4% ~ (p=0.971 n=10) 601.1µ ± 4% ~ (p=0.853 n=10) 611.0µ ± 6% ~ (p=0.105 n=10) 598.2µ ± 5% ~ (p=0.579 n=10) 608.2µ ± 3% ~ (p=0.796 n=10) - // StoreList/List=All/Paginate=False/RV=Empty-24 729.1µ ± 5% 692.9µ ± 3% -4.96% (p=0.002 n=10) 693.7µ ± 3% -4.86% (p=0.000 n=10) 688.3µ ± 1% -5.59% (p=0.000 n=10) 690.4µ ± 5% -5.31% (p=0.002 n=10) 689.7µ ± 2% -5.40% (p=0.000 n=10) 687.8µ ± 3% -5.67% (p=0.000 n=10) - // StoreList/List=All/Paginate=True/RV=Empty-24 19.51m ± 2% 19.84m ± 2% ~ (p=0.105 n=10) 19.89m ± 3% ~ (p=0.190 n=10) 19.64m ± 4% ~ (p=0.853 n=10) 19.34m ± 4% ~ (p=0.481 n=10) 20.22m ± 4% +3.66% (p=0.007 n=10) 19.58m ± 4% ~ (p=0.912 n=10) - // StoreList/List=Namespace/Paginate=False/RV=Empty-24 1.672m ± 4% 1.635m ± 2% ~ (p=0.247 n=10) 1.673m ± 5% ~ (p=0.631 n=10) 1.657m ± 2% ~ (p=0.971 n=10) 1.656m ± 4% ~ (p=0.739 n=10) 1.678m ± 2% ~ (p=0.631 n=10) 1.718m ± 8% ~ (p=0.105 n=10) - // geomean 1.467m 1.420m -3.24% 1.430m -2.58% 1.403m -4.38% 1.402m -4.46% 1.417m -3.44% 1.403m -4.41% - // - // │ 2 │ 4 │ 8 │ 16 │ 32 │ 64 │ 128 │ - // │ B/op │ B/op vs base │ B/op vs base │ B/op vs base │ B/op vs base │ B/op vs base │ B/op vs base │ - // StoreCreateList/RV=NotOlderThan-24 98.58Ki ± 11% 101.33Ki ± 13% ~ (p=0.280 n=10) 99.80Ki ± 26% ~ (p=0.353 n=10) 109.63Ki ± 9% ~ (p=0.075 n=10) 112.56Ki ± 6% +14.18% (p=0.007 n=10) 114.41Ki ± 10% +16.05% (p=0.003 n=10) 115.06Ki ± 12% +16.72% (p=0.011 n=10) - // StoreCreateList/RV=ExactMatch-24 117.1Ki ± 0% 117.5Ki ± 0% ~ (p=0.218 n=10) 116.9Ki ± 0% ~ (p=0.052 n=10) 117.3Ki ± 0% ~ (p=0.353 n=10) 116.9Ki ± 0% ~ (p=0.075 n=10) 117.0Ki ± 0% ~ (p=0.436 n=10) 117.0Ki ± 0% ~ (p=0.280 n=10) - // StoreList/List=All/Paginate=False/RV=Empty-24 6.023Mi ± 0% 6.024Mi ± 0% +0.01% (p=0.037 n=10) 6.024Mi ± 0% ~ (p=0.493 n=10) 6.024Mi ± 0% +0.01% (p=0.035 n=10) 6.024Mi ± 0% ~ (p=0.247 n=10) 6.024Mi ± 0% ~ (p=0.247 n=10) 6.024Mi ± 0% ~ (p=0.315 n=10) - // StoreList/List=All/Paginate=True/RV=Empty-24 64.22Mi ± 0% 64.21Mi ± 0% ~ (p=0.075 n=10) 64.23Mi ± 0% ~ (p=0.280 n=10) 64.21Mi ± 0% -0.02% (p=0.002 n=10) 64.22Mi ± 0% ~ (p=0.579 n=10) 64.22Mi ± 0% ~ (p=0.971 n=10) 64.22Mi ± 0% ~ (p=1.000 n=10) - // StoreList/List=Namespace/Paginate=False/RV=Empty-24 8.177Mi ± 0% 8.178Mi ± 0% ~ (p=0.579 n=10) 8.177Mi ± 0% ~ (p=0.971 n=10) 8.179Mi ± 0% ~ (p=0.579 n=10) 8.178Mi ± 0% ~ (p=0.739 n=10) 8.179Mi ± 0% ~ (p=0.315 n=10) 8.176Mi ± 0% ~ (p=0.247 n=10) - // geomean 2.034Mi 2.047Mi +0.61% 2.039Mi +0.22% 2.079Mi +2.19% 2.088Mi +2.66% 2.095Mi +3.01% 2.098Mi +3.12% - // - // │ 2 │ 4 │ 8 │ 16 │ 32 │ 64 │ 128 │ - // │ allocs/op │ allocs/op vs base │ allocs/op vs base │ allocs/op vs base │ allocs/op vs base │ allocs/op vs base │ allocs/op vs base │ - // StoreCreateList/RV=NotOlderThan-24 560.0 ± 0% 558.0 ± 0% -0.36% (p=0.000 n=10) 557.0 ± 0% -0.54% (p=0.000 n=10) 558.0 ± 0% -0.36% (p=0.000 n=10) 557.0 ± 0% -0.54% (p=0.000 n=10) 557.0 ± 0% -0.54% (p=0.000 n=10) 557.0 ± 0% -0.54% (p=0.000 n=10) - // StoreCreateList/RV=ExactMatch-24 871.0 ± 0% 870.0 ± 0% -0.11% (p=0.038 n=10) 870.0 ± 0% -0.11% (p=0.004 n=10) 870.0 ± 0% -0.11% (p=0.005 n=10) 869.0 ± 0% -0.23% (p=0.000 n=10) 870.0 ± 0% -0.11% (p=0.001 n=10) 870.0 ± 0% -0.11% (p=0.000 n=10) - // StoreList/List=All/Paginate=False/RV=Empty-24 351.0 ± 3% 358.0 ± 1% +1.99% (p=0.034 n=10) 352.5 ± 3% ~ (p=0.589 n=10) 358.5 ± 1% +2.14% (p=0.022 n=10) 356.5 ± 3% ~ (p=0.208 n=10) 355.0 ± 3% ~ (p=0.224 n=10) 355.0 ± 3% ~ (p=0.183 n=10) - // StoreList/List=All/Paginate=True/RV=Empty-24 494.4k ± 0% 494.4k ± 0% ~ (p=0.424 n=10) 494.6k ± 0% +0.06% (p=0.000 n=10) 492.7k ± 0% -0.34% (p=0.000 n=10) 494.5k ± 0% +0.02% (p=0.009 n=10) 493.0k ± 0% -0.28% (p=0.000 n=10) 494.4k ± 0% ~ (p=0.424 n=10) - // StoreList/List=Namespace/Paginate=False/RV=Empty-24 32.43k ± 0% 32.44k ± 0% ~ (p=0.579 n=10) 32.43k ± 0% ~ (p=0.971 n=10) 32.45k ± 0% ~ (p=0.517 n=10) 32.44k ± 0% ~ (p=0.670 n=10) 32.46k ± 0% ~ (p=0.256 n=10) 32.41k ± 0% ~ (p=0.247 n=10) - // geomean 4.872k 4.887k +0.31% 4.870k -0.03% 4.885k +0.28% 4.880k +0.17% 4.875k +0.06% 4.876k +0.08% - btreeDegree = 16 -) - -type storeIndexer interface { - Add(obj interface{}) error - Update(obj interface{}) error - Delete(obj interface{}) error - List() []interface{} - ListKeys() []string - Get(obj interface{}) (item interface{}, exists bool, err error) - GetByKey(key string) (item interface{}, exists bool, err error) - Replace([]interface{}, string) error - ByIndex(indexName, indexedValue string) ([]interface{}, error) -} - -type orderedLister interface { - ListPrefix(prefix, continueKey string) []interface{} - Count(prefix, continueKey string) (count int) - Clone() orderedLister -} - -func newStoreIndexer(indexers *cache.Indexers) storeIndexer { - if utilfeature.DefaultFeatureGate.Enabled(features.BtreeWatchCache) { - return newThreadedBtreeStoreIndexer(storeElementIndexers(indexers), btreeDegree) - } - return cache.NewIndexer(storeElementKey, storeElementIndexers(indexers)) -} - -// Computing a key of an object is generally non-trivial (it performs -// e.g. validation underneath). Similarly computing object fields and -// labels. To avoid computing them multiple times (to serve the event -// in different List/Watch requests), in the underlying store we are -// keeping structs (key, object, labels, fields). -type storeElement struct { - Key string - Object runtime.Object - Labels labels.Set - Fields fields.Set -} - -func storeElementKey(obj interface{}) (string, error) { - elem, ok := obj.(*storeElement) - if !ok { - return "", fmt.Errorf("not a storeElement: %v", obj) - } - return elem.Key, nil -} - -func storeElementObject(obj interface{}) (runtime.Object, error) { - elem, ok := obj.(*storeElement) - if !ok { - return nil, fmt.Errorf("not a storeElement: %v", obj) - } - return elem.Object, nil -} - -func storeElementIndexFunc(objIndexFunc cache.IndexFunc) cache.IndexFunc { - return func(obj interface{}) (strings []string, e error) { - seo, err := storeElementObject(obj) - if err != nil { - return nil, err - } - return objIndexFunc(seo) - } -} - -func storeElementIndexers(indexers *cache.Indexers) cache.Indexers { - if indexers == nil { - return cache.Indexers{} - } - ret := cache.Indexers{} - for indexName, indexFunc := range *indexers { - ret[indexName] = storeElementIndexFunc(indexFunc) - } - return ret -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/store_btree.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/store_btree.go deleted file mode 100644 index 9908e2f64..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/store_btree.go +++ /dev/null @@ -1,505 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cacher - -import ( - "fmt" - "strings" - "sync" - - "github.com/google/btree" - "k8s.io/client-go/tools/cache" -) - -// newThreadedBtreeStoreIndexer returns a storage for cacher by adding locking over the two 2 data structures: -// * btree based storage for efficient LIST operation on prefix -// * map based indexer for retrieving values by index. -// This separation is used to allow independent snapshotting those two storages in the future. -// Intention is to utilize btree for its cheap snapshots that don't require locking if don't mutate data. -func newThreadedBtreeStoreIndexer(indexers cache.Indexers, degree int) *threadedStoreIndexer { - return &threadedStoreIndexer{ - store: newBtreeStore(degree), - indexer: newIndexer(indexers), - } -} - -type threadedStoreIndexer struct { - lock sync.RWMutex - store btreeStore - indexer indexer -} - -var _ orderedLister = (*threadedStoreIndexer)(nil) - -func (si *threadedStoreIndexer) Count(prefix, continueKey string) (count int) { - si.lock.RLock() - defer si.lock.RUnlock() - return si.store.Count(prefix, continueKey) -} - -func (si *threadedStoreIndexer) Clone() orderedLister { - si.lock.RLock() - defer si.lock.RUnlock() - return si.store.Clone() -} - -func (si *threadedStoreIndexer) Add(obj interface{}) error { - return si.addOrUpdate(obj) -} - -func (si *threadedStoreIndexer) Update(obj interface{}) error { - return si.addOrUpdate(obj) -} - -func (si *threadedStoreIndexer) addOrUpdate(obj interface{}) error { - if obj == nil { - return fmt.Errorf("obj cannot be nil") - } - newElem, ok := obj.(*storeElement) - if !ok { - return fmt.Errorf("obj not a storeElement: %#v", obj) - } - si.lock.Lock() - defer si.lock.Unlock() - oldElem := si.store.addOrUpdateElem(newElem) - return si.indexer.updateElem(newElem.Key, oldElem, newElem) -} - -func (si *threadedStoreIndexer) Delete(obj interface{}) error { - storeElem, ok := obj.(*storeElement) - if !ok { - return fmt.Errorf("obj not a storeElement: %#v", obj) - } - si.lock.Lock() - defer si.lock.Unlock() - oldObj, existed := si.store.deleteElem(storeElem) - if !existed { - return nil - } - return si.indexer.updateElem(storeElem.Key, oldObj, nil) -} - -func (si *threadedStoreIndexer) List() []interface{} { - si.lock.RLock() - defer si.lock.RUnlock() - return si.store.List() -} - -func (si *threadedStoreIndexer) ListPrefix(prefix, continueKey string) []interface{} { - si.lock.RLock() - defer si.lock.RUnlock() - return si.store.ListPrefix(prefix, continueKey) -} - -func (si *threadedStoreIndexer) ListKeys() []string { - si.lock.RLock() - defer si.lock.RUnlock() - return si.store.ListKeys() -} - -func (si *threadedStoreIndexer) Get(obj interface{}) (item interface{}, exists bool, err error) { - si.lock.RLock() - defer si.lock.RUnlock() - return si.store.Get(obj) -} - -func (si *threadedStoreIndexer) GetByKey(key string) (item interface{}, exists bool, err error) { - si.lock.RLock() - defer si.lock.RUnlock() - return si.store.GetByKey(key) -} - -func (si *threadedStoreIndexer) Replace(objs []interface{}, resourceVersion string) error { - si.lock.Lock() - defer si.lock.Unlock() - err := si.store.Replace(objs, resourceVersion) - if err != nil { - return err - } - return si.indexer.Replace(objs, resourceVersion) -} - -func (si *threadedStoreIndexer) ByIndex(indexName, indexValue string) ([]interface{}, error) { - si.lock.RLock() - defer si.lock.RUnlock() - return si.indexer.ByIndex(indexName, indexValue) -} - -func newBtreeStore(degree int) btreeStore { - return btreeStore{ - tree: btree.NewG(degree, func(a, b *storeElement) bool { - return a.Key < b.Key - }), - } -} - -type btreeStore struct { - tree *btree.BTreeG[*storeElement] -} - -func (s *btreeStore) Clone() orderedLister { - return &btreeStore{ - tree: s.tree.Clone(), - } -} - -func (s *btreeStore) Add(obj interface{}) error { - if obj == nil { - return fmt.Errorf("obj cannot be nil") - } - storeElem, ok := obj.(*storeElement) - if !ok { - return fmt.Errorf("obj not a storeElement: %#v", obj) - } - s.addOrUpdateElem(storeElem) - return nil -} - -func (s *btreeStore) Update(obj interface{}) error { - if obj == nil { - return fmt.Errorf("obj cannot be nil") - } - storeElem, ok := obj.(*storeElement) - if !ok { - return fmt.Errorf("obj not a storeElement: %#v", obj) - } - s.addOrUpdateElem(storeElem) - return nil -} - -func (s *btreeStore) Delete(obj interface{}) error { - if obj == nil { - return fmt.Errorf("obj cannot be nil") - } - storeElem, ok := obj.(*storeElement) - if !ok { - return fmt.Errorf("obj not a storeElement: %#v", obj) - } - s.deleteElem(storeElem) - return nil -} - -func (s *btreeStore) deleteElem(storeElem *storeElement) (*storeElement, bool) { - return s.tree.Delete(storeElem) -} - -func (s *btreeStore) List() []interface{} { - items := make([]interface{}, 0, s.tree.Len()) - s.tree.Ascend(func(item *storeElement) bool { - items = append(items, item) - return true - }) - return items -} - -func (s *btreeStore) ListKeys() []string { - items := make([]string, 0, s.tree.Len()) - s.tree.Ascend(func(item *storeElement) bool { - items = append(items, item.Key) - return true - }) - return items -} - -func (s *btreeStore) Get(obj interface{}) (item interface{}, exists bool, err error) { - storeElem, ok := obj.(*storeElement) - if !ok { - return nil, false, fmt.Errorf("obj is not a storeElement") - } - item, exists = s.tree.Get(storeElem) - return item, exists, nil -} - -func (s *btreeStore) GetByKey(key string) (item interface{}, exists bool, err error) { - return s.getByKey(key) -} - -func (s *btreeStore) Replace(objs []interface{}, _ string) error { - s.tree.Clear(false) - for _, obj := range objs { - storeElem, ok := obj.(*storeElement) - if !ok { - return fmt.Errorf("obj not a storeElement: %#v", obj) - } - s.addOrUpdateElem(storeElem) - } - return nil -} - -// addOrUpdateLocked assumes a lock is held and is used for Add -// and Update operations. -func (s *btreeStore) addOrUpdateElem(storeElem *storeElement) *storeElement { - oldObj, _ := s.tree.ReplaceOrInsert(storeElem) - return oldObj -} - -func (s *btreeStore) getByKey(key string) (item interface{}, exists bool, err error) { - keyElement := &storeElement{Key: key} - item, exists = s.tree.Get(keyElement) - return item, exists, nil -} - -func (s *btreeStore) ListPrefix(prefix, continueKey string) []interface{} { - if continueKey == "" { - continueKey = prefix - } - var result []interface{} - s.tree.AscendGreaterOrEqual(&storeElement{Key: continueKey}, func(item *storeElement) bool { - if !strings.HasPrefix(item.Key, prefix) { - return false - } - result = append(result, item) - return true - }) - return result -} - -func (s *btreeStore) Count(prefix, continueKey string) (count int) { - if continueKey == "" { - continueKey = prefix - } - s.tree.AscendGreaterOrEqual(&storeElement{Key: continueKey}, func(item *storeElement) bool { - if !strings.HasPrefix(item.Key, prefix) { - return false - } - count++ - return true - }) - return count -} - -// newIndexer returns a indexer similar to storeIndex from client-go/tools/cache. -// TODO: Unify the indexer code with client-go/cache package. -// Major differences is type of values stored and their mutability: -// * Indexer in client-go stores object keys, that are not mutable. -// * Indexer in cacher stores whole objects, which is mutable. -// Indexer in client-go uses keys as it is used in conjunction with map[key]value -// allowing for fast value retrieval, while btree used in cacher would provide additional overhead. -// Difference in mutability of stored values is used for optimizing some operations in client-go Indexer. -func newIndexer(indexers cache.Indexers) indexer { - return indexer{ - indices: map[string]map[string]map[string]*storeElement{}, - indexers: indexers, - } -} - -type indexer struct { - indices map[string]map[string]map[string]*storeElement - indexers cache.Indexers -} - -func (i *indexer) ByIndex(indexName, indexValue string) ([]interface{}, error) { - indexFunc := i.indexers[indexName] - if indexFunc == nil { - return nil, fmt.Errorf("index with name %s does not exist", indexName) - } - index := i.indices[indexName] - set := index[indexValue] - list := make([]interface{}, 0, len(set)) - for _, obj := range set { - list = append(list, obj) - } - return list, nil -} - -func (i *indexer) Replace(objs []interface{}, resourceVersion string) error { - i.indices = map[string]map[string]map[string]*storeElement{} - for _, obj := range objs { - storeElem, ok := obj.(*storeElement) - if !ok { - return fmt.Errorf("obj not a storeElement: %#v", obj) - } - err := i.updateElem(storeElem.Key, nil, storeElem) - if err != nil { - return err - } - } - return nil -} - -func (i *indexer) updateElem(key string, oldObj, newObj *storeElement) (err error) { - var oldIndexValues, indexValues []string - for name, indexFunc := range i.indexers { - if oldObj != nil { - oldIndexValues, err = indexFunc(oldObj) - } else { - oldIndexValues = oldIndexValues[:0] - } - if err != nil { - return fmt.Errorf("unable to calculate an index entry for key %q on index %q: %w", key, name, err) - } - if newObj != nil { - indexValues, err = indexFunc(newObj) - } else { - indexValues = indexValues[:0] - } - if err != nil { - return fmt.Errorf("unable to calculate an index entry for key %q on index %q: %w", key, name, err) - } - index := i.indices[name] - if index == nil { - index = map[string]map[string]*storeElement{} - i.indices[name] = index - } - if len(indexValues) == 1 && len(oldIndexValues) == 1 && indexValues[0] == oldIndexValues[0] { - // We optimize for the most common case where indexFunc returns a single value which has not been changed - i.add(key, indexValues[0], newObj, index) - continue - } - for _, value := range oldIndexValues { - i.delete(key, value, index) - } - for _, value := range indexValues { - i.add(key, value, newObj, index) - } - } - return nil -} - -func (i *indexer) add(key, value string, obj *storeElement, index map[string]map[string]*storeElement) { - set := index[value] - if set == nil { - set = map[string]*storeElement{} - index[value] = set - } - set[key] = obj -} - -func (i *indexer) delete(key, value string, index map[string]map[string]*storeElement) { - set := index[value] - if set == nil { - return - } - delete(set, key) - // If we don's delete the set when zero, indices with high cardinality - // short lived resources can cause memory to increase over time from - // unused empty sets. See `kubernetes/kubernetes/issues/84959`. - if len(set) == 0 { - delete(index, value) - } -} - -// newStoreSnapshotter returns a storeSnapshotter that stores snapshots for -// serving read requests with exact resource versions (RV) and pagination. -// -// Snapshots are created by calling Clone method on orderedLister, which is -// expected to be fast and efficient thanks to usage of B-trees. -// B-trees can create a lazy copy of the tree structure, minimizing overhead. -// -// Assuming the watch cache observes all events and snapshots cache after each of them, -// requests for a specific resource version can be served by retrieving -// the snapshot with the greatest RV less than or equal to the requested RV. -// To make snapshot retrivial efficient we need an ordered data structure, such as tree. -// -// The initial implementation uses a B-tree to achieve the following performance characteristics (n - number of snapshots stored): -// - `Add`: Adds a new snapshot. -// Complexity: O(log n). -// Executed for each watch event observed by the cache. -// - `GetLessOrEqual`: Retrieves the snapshot with the greatest RV less than or equal to the requested RV. -// Complexity: O(log n). -// Executed for each LIST request with match=Exact or continuation. -// - `RemoveLess`: Cleans up snapshots outside the watch history window. -// Complexity: O(k log n), k - number of snapshots to remove, usually only one if watch capacity was not reduced. -// Executed per watch event observed when the cache is full. -// - `Reset`: Cleans up all snapshots. -// Complexity: O(1). -// Executed when the watch cache is reinitialized. -// -// Further optimization is possible by leveraging the property that adds always -// increase the maximum RV and deletes only increase the minimum RV. -// For example, a binary search on a cyclic buffer of (RV, snapshot) -// should reduce number of allocations and improve removal complexity. -// However, this solution is more complex and is deferred for future implementation. -// -// TODO: Rewrite to use a cyclic buffer -func newStoreSnapshotter() *storeSnapshotter { - s := &storeSnapshotter{ - snapshots: btree.NewG[rvSnapshot](btreeDegree, func(a, b rvSnapshot) bool { - return a.resourceVersion < b.resourceVersion - }), - } - return s -} - -var _ Snapshotter = (*storeSnapshotter)(nil) - -type Snapshotter interface { - Reset() - GetLessOrEqual(rv uint64) (orderedLister, bool) - Add(rv uint64, indexer orderedLister) - RemoveLess(rv uint64) - Len() int -} - -type storeSnapshotter struct { - mux sync.RWMutex - snapshots *btree.BTreeG[rvSnapshot] -} - -type rvSnapshot struct { - resourceVersion uint64 - snapshot orderedLister -} - -func (s *storeSnapshotter) Reset() { - s.mux.Lock() - defer s.mux.Unlock() - s.snapshots.Clear(false) -} - -func (s *storeSnapshotter) GetLessOrEqual(rv uint64) (orderedLister, bool) { - s.mux.RLock() - defer s.mux.RUnlock() - - var result *rvSnapshot - s.snapshots.DescendLessOrEqual(rvSnapshot{resourceVersion: rv}, func(rvs rvSnapshot) bool { - result = &rvs - return false - }) - if result == nil { - return nil, false - } - return result.snapshot, true -} - -func (s *storeSnapshotter) Add(rv uint64, indexer orderedLister) { - s.mux.Lock() - defer s.mux.Unlock() - s.snapshots.ReplaceOrInsert(rvSnapshot{resourceVersion: rv, snapshot: indexer.Clone()}) -} - -func (s *storeSnapshotter) RemoveLess(rv uint64) { - s.mux.Lock() - defer s.mux.Unlock() - for s.snapshots.Len() > 0 { - oldest, ok := s.snapshots.Min() - if !ok { - break - } - if rv <= oldest.resourceVersion { - break - } - s.snapshots.DeleteMin() - } -} - -func (s *storeSnapshotter) Len() int { - s.mux.RLock() - defer s.mux.RUnlock() - - return s.snapshots.Len() -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/time_budget.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/time_budget.go deleted file mode 100644 index 636c6ef8d..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/time_budget.go +++ /dev/null @@ -1,102 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cacher - -import ( - "sync" - "time" - - "k8s.io/utils/clock" -) - -const ( - refreshPerSecond = 50 * time.Millisecond - maxBudget = 100 * time.Millisecond -) - -// timeBudget implements a budget of time that you can use and is -// periodically being refreshed. The pattern to use it is: -// -// budget := newTimeBudget(...) -// ... -// timeout := budget.takeAvailable() -// // Now you can spend at most timeout on doing stuff -// ... -// // If you didn't use all timeout, return what you didn't use -// budget.returnUnused() -// -// NOTE: It's not recommended to be used concurrently from multiple threads - -// if first user takes the whole timeout, the second one will get 0 timeout -// even though the first one may return something later. -type timeBudget interface { - takeAvailable() time.Duration - returnUnused(unused time.Duration) -} - -type timeBudgetImpl struct { - sync.Mutex - clock clock.Clock - budget time.Duration - maxBudget time.Duration - refresh time.Duration - // last store last access time - last time.Time -} - -func newTimeBudget() timeBudget { - result := &timeBudgetImpl{ - clock: clock.RealClock{}, - budget: time.Duration(0), - refresh: refreshPerSecond, - maxBudget: maxBudget, - } - result.last = result.clock.Now() - return result -} - -func (t *timeBudgetImpl) takeAvailable() time.Duration { - t.Lock() - defer t.Unlock() - // budget accumulated since last access - now := t.clock.Now() - acc := now.Sub(t.last).Seconds() * t.refresh.Seconds() - if acc < 0 { - acc = 0 - } - // update current budget and store the current time - if t.budget = t.budget + time.Duration(acc*1e9); t.budget > t.maxBudget { - t.budget = t.maxBudget - } - t.last = now - result := t.budget - t.budget = time.Duration(0) - return result -} - -func (t *timeBudgetImpl) returnUnused(unused time.Duration) { - t.Lock() - defer t.Unlock() - if unused < 0 { - // We used more than allowed. - return - } - // add the unused time directly to the budget - // takeAvailable() will take into account the elapsed time - if t.budget = t.budget + unused; t.budget > t.maxBudget { - t.budget = t.maxBudget - } -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/util.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/util.go deleted file mode 100644 index 341e256ad..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/util.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cacher - -import ( - "math" - "strings" - "time" -) - -// hasPathPrefix returns true if the string matches pathPrefix exactly, or if is prefixed with pathPrefix at a path segment boundary -func hasPathPrefix(s, pathPrefix string) bool { - // Short circuit if s doesn't contain the prefix at all - if !strings.HasPrefix(s, pathPrefix) { - return false - } - - pathPrefixLength := len(pathPrefix) - - if len(s) == pathPrefixLength { - // Exact match - return true - } - if strings.HasSuffix(pathPrefix, "/") { - // pathPrefix already ensured a path segment boundary - return true - } - if s[pathPrefixLength:pathPrefixLength+1] == "/" { - // The next character in s is a path segment boundary - // Check this instead of normalizing pathPrefix to avoid allocating on every call - return true - } - return false -} - -// calculateRetryAfterForUnreadyCache calculates the retry duration based on the cache downtime. -func calculateRetryAfterForUnreadyCache(downtime time.Duration) int { - factor := 0.06 - result := math.Exp(factor * downtime.Seconds()) - result = math.Min(30, math.Max(1, result)) - return int(result) -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_cache.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_cache.go deleted file mode 100644 index 967a60c9b..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_cache.go +++ /dev/null @@ -1,860 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cacher - -import ( - "context" - "fmt" - "math" - "sort" - "sync" - "time" - - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/apiserver/pkg/features" - "k8s.io/apiserver/pkg/storage" - "k8s.io/apiserver/pkg/storage/cacher/delegator" - "k8s.io/apiserver/pkg/storage/cacher/metrics" - "k8s.io/apiserver/pkg/storage/cacher/progress" - utilfeature "k8s.io/apiserver/pkg/util/feature" - "k8s.io/client-go/tools/cache" - "k8s.io/component-base/tracing" - "k8s.io/klog/v2" - "k8s.io/utils/clock" -) - -const ( - // blockTimeout determines how long we're willing to block the request - // to wait for a given resource version to be propagated to cache, - // before terminating request and returning Timeout error with retry - // after suggestion. - blockTimeout = 3 * time.Second - - // resourceVersionTooHighRetrySeconds is the seconds before a operation should be retried by the client - // after receiving a 'too high resource version' error. - resourceVersionTooHighRetrySeconds = 1 - - // defaultLowerBoundCapacity is a default value for event cache capacity's lower bound. - // TODO: Figure out, to what value we can decreased it. - defaultLowerBoundCapacity = 100 - - // defaultUpperBoundCapacity should be able to keep the required history. - defaultUpperBoundCapacity = 100 * 1024 -) - -// 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 -// upper layers. -type watchCacheEvent struct { - Type watch.EventType - Object runtime.Object - ObjLabels labels.Set - ObjFields fields.Set - PrevObject runtime.Object - PrevObjLabels labels.Set - PrevObjFields fields.Set - Key string - ResourceVersion uint64 - RecordTime time.Time -} - -// watchCache implements a Store interface. -// However, it depends on the elements implementing runtime.Object interface. -// -// watchCache is a "sliding window" (with a limited capacity) of objects -// observed from a watch. -type watchCache struct { - sync.RWMutex - - // Condition on which lists are waiting for the fresh enough - // resource version. - cond *sync.Cond - - // Maximum size of history window. - capacity int - - // upper bound of capacity since event cache has a dynamic size. - upperBoundCapacity int - - // lower bound of capacity since event cache has a dynamic size. - lowerBoundCapacity int - - // keyFunc is used to get a key in the underlying storage for a given object. - keyFunc func(runtime.Object) (string, error) - - // getAttrsFunc is used to get labels and fields of an object. - getAttrsFunc func(runtime.Object) (labels.Set, fields.Set, error) - - // cache is used a cyclic buffer - the "current" contents of it are - // stored in [start_index%capacity, end_index%capacity) - so the - // "current" contents have exactly end_index-start_index items. - cache []*watchCacheEvent - startIndex int - endIndex int - // removedEventSinceRelist holds the information whether any of the events - // were already removed from the `cache` cyclic buffer since the last relist - removedEventSinceRelist bool - - // store will effectively support LIST operation from the "end of cache - // history" i.e. from the moment just after the newest cached watched event. - // It is necessary to effectively allow clients to start watching at now. - // NOTE: We assume that is thread-safe. - store storeIndexer - - // ResourceVersion up to which the watchCache is propagated. - resourceVersion uint64 - - // ResourceVersion of the last list result (populated via Replace() method). - listResourceVersion uint64 - - // This handler is run at the end of every successful Replace() method. - onReplace func() - - // This handler is run at the end of every Add/Update/Delete method - // and additionally gets the previous value of the object. - eventHandler func(*watchCacheEvent) - - // for testing timeouts. - clock clock.Clock - - // eventFreshDuration defines the minimum watch history watchcache will store. - eventFreshDuration time.Duration - - // An underlying storage.Versioner. - versioner storage.Versioner - - // cacher's group resource - groupResource schema.GroupResource - - // For testing cache interval invalidation. - indexValidator indexValidator - - // Requests progress notification if there are requests waiting for watch - // to be fresh - waitingUntilFresh *progress.ConditionalProgressRequester - - // Stores previous snapshots of orderedLister to allow serving requests from previous revisions. - snapshots Snapshotter -} - -func newWatchCache( - keyFunc func(runtime.Object) (string, error), - eventHandler func(*watchCacheEvent), - getAttrsFunc func(runtime.Object) (labels.Set, fields.Set, error), - versioner storage.Versioner, - indexers *cache.Indexers, - clock clock.WithTicker, - eventFreshDuration time.Duration, - groupResource schema.GroupResource, - progressRequester *progress.ConditionalProgressRequester) *watchCache { - wc := &watchCache{ - capacity: defaultLowerBoundCapacity, - keyFunc: keyFunc, - getAttrsFunc: getAttrsFunc, - cache: make([]*watchCacheEvent, defaultLowerBoundCapacity), - lowerBoundCapacity: defaultLowerBoundCapacity, - upperBoundCapacity: capacityUpperBound(eventFreshDuration), - startIndex: 0, - endIndex: 0, - store: newStoreIndexer(indexers), - resourceVersion: 0, - listResourceVersion: 0, - eventHandler: eventHandler, - clock: clock, - eventFreshDuration: eventFreshDuration, - versioner: versioner, - groupResource: groupResource, - waitingUntilFresh: progressRequester, - } - if utilfeature.DefaultFeatureGate.Enabled(features.ListFromCacheSnapshot) { - wc.snapshots = newStoreSnapshotter() - } - metrics.WatchCacheCapacity.WithLabelValues(groupResource.String()).Set(float64(wc.capacity)) - wc.cond = sync.NewCond(wc.RLocker()) - wc.indexValidator = wc.isIndexValidLocked - - return wc -} - -// capacityUpperBound denotes the maximum possible capacity of the watch cache -// to which it can resize. -func capacityUpperBound(eventFreshDuration time.Duration) int { - if eventFreshDuration <= DefaultEventFreshDuration { - return defaultUpperBoundCapacity - } - // eventFreshDuration determines how long the watch events are supposed - // to be stored in the watch cache. - // In very high churn situations, there is a need to store more events - // in the watch cache, hence it would have to be upsized accordingly. - // Because of that, for larger values of eventFreshDuration, we set the - // upper bound of the watch cache's capacity proportionally to the ratio - // between eventFreshDuration and DefaultEventFreshDuration. - // Given that the watch cache size can only double, we round up that - // proportion to the next power of two. - exponent := int(math.Ceil((math.Log2(eventFreshDuration.Seconds() / DefaultEventFreshDuration.Seconds())))) - if maxExponent := int(math.Floor((math.Log2(math.MaxInt32 / defaultUpperBoundCapacity)))); exponent > maxExponent { - // Making sure that the capacity's upper bound fits in a 32-bit integer. - exponent = maxExponent - klog.Warningf("Capping watch cache capacity upper bound to %v", defaultUpperBoundCapacity< w.capacity { - w.doCacheResizeLocked(capacity) - } - return - } - if w.isCacheFullLocked() && eventTime.Sub(w.cache[(w.endIndex-w.capacity/4)%w.capacity].RecordTime) > w.eventFreshDuration { - capacity := max(w.capacity/2, w.lowerBoundCapacity) - if capacity < w.capacity { - w.doCacheResizeLocked(capacity) - } - return - } -} - -// isCacheFullLocked used to judge whether watchCacheEvent is full. -// Assumes that lock is already held for write. -func (w *watchCache) isCacheFullLocked() bool { - return w.endIndex == w.startIndex+w.capacity -} - -// doCacheResizeLocked resize watchCache's event array with different capacity. -// Assumes that lock is already held for write. -func (w *watchCache) doCacheResizeLocked(capacity int) { - newCache := make([]*watchCacheEvent, capacity) - if capacity < w.capacity { - // adjust startIndex if cache capacity shrink. - w.startIndex = w.endIndex - capacity - } - for i := w.startIndex; i < w.endIndex; i++ { - newCache[i%capacity] = w.cache[i%w.capacity] - } - w.cache = newCache - metrics.RecordsWatchCacheCapacityChange(w.groupResource.String(), w.capacity, capacity) - w.capacity = capacity -} - -func (w *watchCache) UpdateResourceVersion(resourceVersion string) { - rv, err := w.versioner.ParseResourceVersion(resourceVersion) - if err != nil { - klog.Errorf("Couldn't parse resourceVersion: %v", err) - return - } - - func() { - w.Lock() - defer w.Unlock() - w.resourceVersion = rv - w.cond.Broadcast() - }() - - // Avoid calling event handler under lock. - // This is safe as long as there is at most one call to Add/Update/Delete and - // UpdateResourceVersion in flight at any point in time, which is true now, - // because reflector calls them synchronously from its main thread. - if w.eventHandler != nil { - wcEvent := &watchCacheEvent{ - Type: watch.Bookmark, - ResourceVersion: rv, - } - w.eventHandler(wcEvent) - } - metrics.RecordResourceVersion(w.groupResource.String(), rv) -} - -// List returns list of pointers to objects. -func (w *watchCache) List() []interface{} { - return w.store.List() -} - -// waitUntilFreshAndBlock waits until cache is at least as fresh as given . -// NOTE: This function acquired lock and doesn't release it. -// You HAVE TO explicitly call w.RUnlock() after this function. -func (w *watchCache) waitUntilFreshAndBlock(ctx context.Context, resourceVersion uint64) error { - startTime := w.clock.Now() - defer func() { - if resourceVersion > 0 { - metrics.WatchCacheReadWait.WithContext(ctx).WithLabelValues(w.groupResource.String()).Observe(w.clock.Since(startTime).Seconds()) - } - }() - - // In case resourceVersion is 0, we accept arbitrarily stale result. - // As a result, the condition in the below for loop will never be - // satisfied (w.resourceVersion is never negative), this call will - // never hit the w.cond.Wait(). - // As a result - we can optimize the code by not firing the wakeup - // function (and avoid starting a gorotuine), especially given that - // resourceVersion=0 is the most common case. - if resourceVersion > 0 { - 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(blockTimeout) - w.cond.Broadcast() - }() - } - - w.RLock() - span := tracing.SpanFromContext(ctx) - span.AddEvent("watchCache locked acquired") - for w.resourceVersion < resourceVersion { - if w.clock.Since(startTime) >= blockTimeout { - // Request that the client retry after 'resourceVersionTooHighRetrySeconds' seconds. - return storage.NewTooLargeResourceVersionError(resourceVersion, w.resourceVersion, resourceVersionTooHighRetrySeconds) - } - w.cond.Wait() - } - span.AddEvent("watchCache fresh enough") - return nil -} - -type sortableStoreElements []interface{} - -func (s sortableStoreElements) Len() int { - return len(s) -} - -func (s sortableStoreElements) Less(i, j int) bool { - return s[i].(*storeElement).Key < s[j].(*storeElement).Key -} - -func (s sortableStoreElements) Swap(i, j int) { - s[i], s[j] = s[j], s[i] -} - -// WaitUntilFreshAndList returns list of pointers to `storeElement` objects along -// with their ResourceVersion and the name of the index, if any, that was used. -func (w *watchCache) WaitUntilFreshAndList(ctx context.Context, resourceVersion uint64, key string, opts storage.ListOptions) (resp listResp, index string, err error) { - if delegator.ConsistentReadSupported() && w.notFresh(resourceVersion) { - w.waitingUntilFresh.Add() - err = w.waitUntilFreshAndBlock(ctx, resourceVersion) - w.waitingUntilFresh.Remove() - } else { - err = w.waitUntilFreshAndBlock(ctx, resourceVersion) - } - - defer w.RUnlock() - if err != nil { - return listResp{}, "", err - } - return w.list(ctx, resourceVersion, key, opts) -} - -// NOTICE: Structure follows the shouldDelegateList function in -// staging/src/k8s.io/apiserver/pkg/storage/cacher/delegator.go -func (w *watchCache) list(ctx context.Context, resourceVersion uint64, key string, opts storage.ListOptions) (resp listResp, index string, err error) { - switch opts.ResourceVersionMatch { - case metav1.ResourceVersionMatchExact: - return w.listExactRV(key, "", resourceVersion) - case metav1.ResourceVersionMatchNotOlderThan: - case "": - // Continue - if len(opts.Predicate.Continue) > 0 { - continueKey, continueRV, err := storage.DecodeContinue(opts.Predicate.Continue, key) - if err != nil { - return listResp{}, "", errors.NewBadRequest(fmt.Sprintf("invalid continue token: %v", err)) - } - if continueRV > 0 { - return w.listExactRV(key, continueKey, uint64(continueRV)) - } else { - // Continue with negative RV is a consistent read - already handled via waitUntilFreshAndBlock. - // Don't pass matchValues as they don't support continueKey - return w.listLatestRV(key, continueKey, nil) - } - } - // Legacy exact match - if opts.Predicate.Limit > 0 && len(opts.ResourceVersion) > 0 && opts.ResourceVersion != "0" { - return w.listExactRV(key, "", resourceVersion) - } - // Consistent Read - already handled via waitUntilFreshAndBlock - } - return w.listLatestRV(key, "", opts.Predicate.MatcherIndex(ctx)) -} - -func (w *watchCache) listExactRV(key, continueKey string, resourceVersion uint64) (resp listResp, index string, err error) { - if w.snapshots == nil { - return listResp{}, "", errors.NewResourceExpired(fmt.Sprintf("too old resource version: %d", resourceVersion)) - } - store, ok := w.snapshots.GetLessOrEqual(resourceVersion) - if !ok { - return listResp{}, "", errors.NewResourceExpired(fmt.Sprintf("too old resource version: %d", resourceVersion)) - } - items := store.ListPrefix(key, continueKey) - return listResp{ - Items: items, - ResourceVersion: resourceVersion, - }, "", nil -} - -func (w *watchCache) listLatestRV(key, continueKey string, matchValues []storage.MatchValue) (resp listResp, index string, err error) { - // This isn't the place where we do "final filtering" - only some "prefiltering" is happening here. So the only - // requirement here is to NOT miss anything that should be returned. We can return as many non-matching items as we - // want - they will be filtered out later. The fact that we return less things is only further performance improvement. - // TODO: if multiple indexes match, return the one with the fewest items, so as to do as much filtering as possible. - for _, matchValue := range matchValues { - if result, err := w.store.ByIndex(matchValue.IndexName, matchValue.Value); err == nil { - result, err = filterPrefixAndOrder(key, result) - return listResp{ - Items: result, - ResourceVersion: w.resourceVersion, - }, matchValue.IndexName, err - } - } - if store, ok := w.store.(orderedLister); ok { - result := store.ListPrefix(key, continueKey) - return listResp{ - Items: result, - ResourceVersion: w.resourceVersion, - }, "", nil - } - result := w.store.List() - result, err = filterPrefixAndOrder(key, result) - return listResp{ - Items: result, - ResourceVersion: w.resourceVersion, - }, "", err -} - -func filterPrefixAndOrder(prefix string, items []interface{}) ([]interface{}, error) { - var result []interface{} - for _, item := range items { - elem, ok := item.(*storeElement) - if !ok { - return nil, fmt.Errorf("non *storeElement returned from storage: %v", item) - } - if !hasPathPrefix(elem.Key, prefix) { - continue - } - result = append(result, item) - } - sort.Sort(sortableStoreElements(result)) - return result, nil -} - -func (w *watchCache) notFresh(resourceVersion uint64) bool { - w.RLock() - defer w.RUnlock() - return resourceVersion > w.resourceVersion -} - -// WaitUntilFreshAndGet returns a pointers to object. -func (w *watchCache) WaitUntilFreshAndGet(ctx context.Context, resourceVersion uint64, key string) (interface{}, bool, uint64, error) { - var err error - if delegator.ConsistentReadSupported() && w.notFresh(resourceVersion) { - w.waitingUntilFresh.Add() - err = w.waitUntilFreshAndBlock(ctx, resourceVersion) - w.waitingUntilFresh.Remove() - } else { - err = w.waitUntilFreshAndBlock(ctx, resourceVersion) - } - defer w.RUnlock() - if err != nil { - return nil, false, 0, err - } - value, exists, err := w.store.GetByKey(key) - return value, exists, w.resourceVersion, err -} - -func (w *watchCache) ListKeys() []string { - return w.store.ListKeys() -} - -// Get takes runtime.Object as a parameter. However, it returns -// pointer to . -func (w *watchCache) Get(obj interface{}) (interface{}, bool, error) { - object, ok := obj.(runtime.Object) - if !ok { - return nil, false, fmt.Errorf("obj does not implement runtime.Object interface: %v", obj) - } - key, err := w.keyFunc(object) - if err != nil { - return nil, false, fmt.Errorf("couldn't compute key: %v", err) - } - - return w.store.Get(&storeElement{Key: key, Object: object}) -} - -// GetByKey returns pointer to . -func (w *watchCache) GetByKey(key string) (interface{}, bool, error) { - return w.store.GetByKey(key) -} - -// Replace takes slice of runtime.Object as a parameter. -func (w *watchCache) Replace(objs []interface{}, resourceVersion string) error { - version, err := w.versioner.ParseResourceVersion(resourceVersion) - if err != nil { - return err - } - - toReplace := make([]interface{}, 0, len(objs)) - for _, obj := range objs { - object, ok := obj.(runtime.Object) - if !ok { - return fmt.Errorf("didn't get runtime.Object for replace: %#v", obj) - } - key, err := w.keyFunc(object) - if err != nil { - return fmt.Errorf("couldn't compute key: %v", err) - } - objLabels, objFields, err := w.getAttrsFunc(object) - if err != nil { - return err - } - toReplace = append(toReplace, &storeElement{ - Key: key, - Object: object, - Labels: objLabels, - Fields: objFields, - }) - } - - w.Lock() - defer w.Unlock() - - // Ensure startIndex never decreases, so that existing watchCacheInterval - // instances get "invalid" errors if the try to download from the buffer - // using their own start/end indexes calculated from previous buffer - // content. - - // Empty the cyclic buffer, ensuring startIndex doesn't decrease. - w.startIndex = w.endIndex - w.removedEventSinceRelist = false - - if err := w.store.Replace(toReplace, resourceVersion); err != nil { - return err - } - if w.snapshots != nil { - w.snapshots.Reset() - if orderedLister, ordered := w.store.(orderedLister); ordered { - w.snapshots.Add(version, orderedLister) - } - } - w.listResourceVersion = version - w.resourceVersion = version - if w.onReplace != nil { - w.onReplace() - } - w.cond.Broadcast() - - metrics.RecordResourceVersion(w.groupResource.String(), version) - klog.V(3).Infof("Replaced watchCache (rev: %v) ", resourceVersion) - return nil -} - -func (w *watchCache) SetOnReplace(onReplace func()) { - w.Lock() - defer w.Unlock() - w.onReplace = onReplace -} - -func (w *watchCache) Resync() error { - // Nothing to do - return nil -} - -func (w *watchCache) getListResourceVersion() uint64 { - w.RLock() - defer w.RUnlock() - return w.listResourceVersion -} - -func (w *watchCache) currentCapacity() int { - w.RLock() - defer w.RUnlock() - return w.capacity -} - -const ( - // minWatchChanSize is the min size of channels used by the watch. - // We keep that set to 10 for "backward compatibility" until we - // convince ourselves based on some metrics that decreasing is safe. - minWatchChanSize = 10 - // maxWatchChanSizeWithIndexAndTriger is the max size of the channel - // used by the watch using the index and trigger selector. - maxWatchChanSizeWithIndexAndTrigger = 10 - // maxWatchChanSizeWithIndexWithoutTrigger is the max size of the channel - // used by the watch using the index but without triggering selector. - // We keep that set to 1000 for "backward compatibility", until we - // convinced ourselves based on some metrics that decreasing is safe. - maxWatchChanSizeWithIndexWithoutTrigger = 1000 - // maxWatchChanSizeWithoutIndex is the max size of the channel - // used by the watch not using the index. - // TODO(wojtek-t): Figure out if the value shouldn't be higher. - maxWatchChanSizeWithoutIndex = 100 -) - -func (w *watchCache) suggestedWatchChannelSize(indexExists, triggerUsed bool) int { - // To estimate the channel size we use a heuristic that a channel - // should roughly be able to keep one second of history. - // We don't have an exact data, but given we store updates from - // the last , we approach it by dividing the - // capacity by the length of the history window. - chanSize := int(math.Ceil(float64(w.currentCapacity()) / w.eventFreshDuration.Seconds())) - - // Finally we adjust the size to avoid ending with too low or - // to large values. - if chanSize < minWatchChanSize { - chanSize = minWatchChanSize - } - var maxChanSize int - switch { - case indexExists && triggerUsed: - maxChanSize = maxWatchChanSizeWithIndexAndTrigger - case indexExists && !triggerUsed: - maxChanSize = maxWatchChanSizeWithIndexWithoutTrigger - case !indexExists: - maxChanSize = maxWatchChanSizeWithoutIndex - } - if chanSize > maxChanSize { - chanSize = maxChanSize - } - return chanSize -} - -// isIndexValidLocked checks if a given index is still valid. -// This assumes that the lock is held. -func (w *watchCache) isIndexValidLocked(index int) bool { - return index >= w.startIndex -} - -// getAllEventsSinceLocked returns a watchCacheInterval that can be used to -// retrieve events since a certain resourceVersion. This function assumes to -// be called under the watchCache lock. -func (w *watchCache) getAllEventsSinceLocked(resourceVersion uint64, key string, opts storage.ListOptions) (*watchCacheInterval, error) { - _, matchesSingle := opts.Predicate.MatchesSingle() - matchesSingle = matchesSingle && !opts.Recursive - if opts.SendInitialEvents != nil && *opts.SendInitialEvents { - return w.getIntervalFromStoreLocked(key, matchesSingle) - } - - size := w.endIndex - w.startIndex - var oldest uint64 - switch { - case w.listResourceVersion > 0 && !w.removedEventSinceRelist: - // If no event was removed from the buffer since last relist, the oldest watch - // event we can deliver is one greater than the resource version of the list. - oldest = w.listResourceVersion + 1 - case size > 0: - // If the previous condition is not satisfied: either some event was already - // removed from the buffer or we've never completed a list (the latter can - // only happen in unit tests that populate the buffer without performing - // list/replace operations), the oldest watch event we can deliver is the first - // one in the buffer. - oldest = w.cache[w.startIndex%w.capacity].ResourceVersion - default: - return nil, fmt.Errorf("watch cache isn't correctly initialized") - } - - if resourceVersion == 0 { - if opts.SendInitialEvents == nil { - // resourceVersion = 0 means that we don't require any specific starting point - // and we would like to start watching from ~now. - // However, to keep backward compatibility, we additionally need to return the - // current state and only then start watching from that point. - // - // TODO: In v2 api, we should stop returning the current state - #13969. - return w.getIntervalFromStoreLocked(key, matchesSingle) - } - // SendInitialEvents = false and resourceVersion = 0 - // means that the request would like to start watching - // from Any resourceVersion - resourceVersion = w.resourceVersion - } - if resourceVersion < oldest-1 { - return nil, errors.NewResourceExpired(fmt.Sprintf("too old resource version: %d (%d)", resourceVersion, oldest-1)) - } - - // Binary search the smallest index at which resourceVersion is greater than the given one. - f := func(i int) bool { - return w.cache[(w.startIndex+i)%w.capacity].ResourceVersion > resourceVersion - } - first := sort.Search(size, f) - indexerFunc := func(i int) *watchCacheEvent { - return w.cache[i%w.capacity] - } - ci := newCacheInterval(w.startIndex+first, w.endIndex, indexerFunc, w.indexValidator, resourceVersion, w.RWMutex.RLocker()) - return ci, nil -} - -// getIntervalFromStoreLocked returns a watchCacheInterval -// that covers the entire storage state. -// This function assumes to be called under the watchCache lock. -func (w *watchCache) getIntervalFromStoreLocked(key string, matchesSingle bool) (*watchCacheInterval, error) { - ci, err := newCacheIntervalFromStore(w.resourceVersion, w.store, key, matchesSingle) - if err != nil { - return nil, err - } - return ci, nil -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_cache_interval.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_cache_interval.go deleted file mode 100644 index b74b3ca91..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_cache_interval.go +++ /dev/null @@ -1,255 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cacher - -import ( - "fmt" - "sort" - "sync" - - "k8s.io/apimachinery/pkg/watch" -) - -// watchCacheInterval serves as an abstraction over a source -// of watchCacheEvents. It maintains a window of events over -// an underlying source and these events can be served using -// the exposed Next() API. The main intent for doing things -// this way is to introduce an upper bound of memory usage -// for starting a watch and reduce the maximum possible time -// interval for which the lock would be held while events are -// copied over. -// -// The source of events for the interval is typically either -// the watchCache circular buffer, if events being retrieved -// need to be for resource versions > 0 or the underlying -// implementation of Store, if resource version = 0. -// -// Furthermore, an interval can be either valid or invalid at -// any given point of time. The notion of validity makes sense -// only in cases where the window of events in the underlying -// source can change over time - i.e. for watchCache circular -// buffer. When the circular buffer is full and an event needs -// to be popped off, watchCache::startIndex is incremented. In -// this case, an interval tracking that popped event is valid -// only if it has already been copied to its internal buffer. -// However, for efficiency we perform that lazily and we mark -// an interval as invalid iff we need to copy events from the -// watchCache and we end up needing events that have already -// been popped off. This translates to the following condition: -// -// watchCacheInterval::startIndex >= watchCache::startIndex. -// -// When this condition becomes false, the interval is no longer -// valid and should not be used to retrieve and serve elements -// from the underlying source. -type watchCacheInterval struct { - // startIndex denotes the starting point of the interval - // being considered. The value is the index in the actual - // source of watchCacheEvents. If the source of events is - // the watchCache, then this must be used modulo capacity. - startIndex int - - // endIndex denotes the ending point of the interval being - // considered. The value is the index in the actual source - // of events. If the source of the events is the watchCache, - // then this should be used modulo capacity. - endIndex int - - // indexer is meant to inject behaviour for how an event must - // be retrieved from the underlying source given an index. - indexer indexerFunc - - // indexValidator is used to check if a given index is still - // valid perspective. If it is deemed that the index is not - // valid, then this interval can no longer be used to serve - // events. Use of indexValidator is warranted only in cases - // where the window of events in the underlying source can - // change over time. Furthermore, an interval is invalid if - // its startIndex no longer coincides with the startIndex of - // underlying source. - indexValidator indexValidator - - // buffer holds watchCacheEvents that this interval returns on - // a call to Next(). This exists mainly to reduce acquiring the - // lock on each invocation of Next(). - buffer *watchCacheIntervalBuffer - - // resourceVersion is the resourceVersion from which - // the interval was constructed. - resourceVersion uint64 - - // lock effectively protects access to the underlying source - // of events through - indexer and indexValidator. - // - // Given that indexer and indexValidator only read state, if - // possible, Locker obtained through RLocker() is provided. - lock sync.Locker - - // initialEventsEndBookmark will be sent after sending all events in cacheInterval - initialEventsEndBookmark *watchCacheEvent -} - -type indexerFunc func(int) *watchCacheEvent -type indexValidator func(int) bool - -func newCacheInterval(startIndex, endIndex int, indexer indexerFunc, indexValidator indexValidator, resourceVersion uint64, locker sync.Locker) *watchCacheInterval { - return &watchCacheInterval{ - startIndex: startIndex, - endIndex: endIndex, - indexer: indexer, - indexValidator: indexValidator, - buffer: &watchCacheIntervalBuffer{buffer: make([]*watchCacheEvent, bufferSize)}, - resourceVersion: resourceVersion, - lock: locker, - } -} - -type sortableWatchCacheEvents []*watchCacheEvent - -func (s sortableWatchCacheEvents) Len() int { - return len(s) -} - -func (s sortableWatchCacheEvents) Less(i, j int) bool { - return s[i].Key < s[j].Key -} - -func (s sortableWatchCacheEvents) Swap(i, j int) { - s[i], s[j] = s[j], s[i] -} - -// newCacheIntervalFromStore is meant to handle the case of rv=0, such that the events -// returned by Next() need to be events from a List() done on the underlying store of -// the watch cache. -// The items returned in the interval will be sorted by Key. -func newCacheIntervalFromStore(resourceVersion uint64, store storeIndexer, key string, matchesSingle bool) (*watchCacheInterval, error) { - buffer := &watchCacheIntervalBuffer{} - var allItems []interface{} - if matchesSingle { - item, exists, err := store.GetByKey(key) - if err != nil { - return nil, err - } - - if exists { - allItems = append(allItems, item) - } - } else { - allItems = store.List() - } - buffer.buffer = make([]*watchCacheEvent, len(allItems)) - for i, item := range allItems { - elem, ok := item.(*storeElement) - if !ok { - return nil, fmt.Errorf("not a storeElement: %v", elem) - } - buffer.buffer[i] = &watchCacheEvent{ - Type: watch.Added, - Object: elem.Object, - ObjLabels: elem.Labels, - ObjFields: elem.Fields, - Key: elem.Key, - ResourceVersion: resourceVersion, - } - buffer.endIndex++ - } - sort.Sort(sortableWatchCacheEvents(buffer.buffer)) - ci := &watchCacheInterval{ - startIndex: 0, - // Simulate that we already have all the events we're looking for. - endIndex: 0, - buffer: buffer, - resourceVersion: resourceVersion, - } - - return ci, nil -} - -// Next returns the next item in the cache interval provided the cache -// interval is still valid. An error is returned if the interval is -// invalidated. -func (wci *watchCacheInterval) Next() (*watchCacheEvent, error) { - // if there are items in the buffer to return, return from - // the buffer. - if event, exists := wci.buffer.next(); exists { - return event, nil - } - // check if there are still other events in this interval - // that can be processed. - if wci.startIndex >= wci.endIndex { - return nil, nil - } - wci.lock.Lock() - defer wci.lock.Unlock() - - if valid := wci.indexValidator(wci.startIndex); !valid { - return nil, fmt.Errorf("cache interval invalidated, interval startIndex: %d", wci.startIndex) - } - - wci.fillBuffer() - if event, exists := wci.buffer.next(); exists { - return event, nil - } - return nil, nil -} - -func (wci *watchCacheInterval) fillBuffer() { - wci.buffer.startIndex = 0 - wci.buffer.endIndex = 0 - for wci.startIndex < wci.endIndex && !wci.buffer.isFull() { - event := wci.indexer(wci.startIndex) - if event == nil { - break - } - wci.buffer.buffer[wci.buffer.endIndex] = event - wci.buffer.endIndex++ - wci.startIndex++ - } -} - -const bufferSize = 100 - -// watchCacheIntervalBuffer is used to reduce acquiring -// the lock on each invocation of watchCacheInterval.Next(). -type watchCacheIntervalBuffer struct { - // buffer is used to hold watchCacheEvents that - // the interval returns on a call to Next(). - buffer []*watchCacheEvent - // The first element of buffer is defined by startIndex, - // its last element is defined by endIndex. - startIndex int - endIndex int -} - -// next returns the next event present in the interval buffer provided -// it is not empty. -func (wcib *watchCacheIntervalBuffer) next() (*watchCacheEvent, bool) { - if wcib.isEmpty() { - return nil, false - } - next := wcib.buffer[wcib.startIndex] - wcib.startIndex++ - return next, true -} - -func (wcib *watchCacheIntervalBuffer) isFull() bool { - return wcib.endIndex >= bufferSize -} - -func (wcib *watchCacheIntervalBuffer) isEmpty() bool { - return wcib.startIndex == wcib.endIndex -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/errors/doc.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/errors/doc.go deleted file mode 100644 index e6347ba86..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/errors/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -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 storage provides conversion of storage errors to API errors. -package errors diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/errors/storage.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/errors/storage.go deleted file mode 100644 index 758cfbec5..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/errors/storage.go +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -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 errors - -import ( - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apiserver/pkg/storage" -) - -// InterpretListError converts a generic error on a retrieval -// operation into the appropriate API error. -func InterpretListError(err error, qualifiedResource schema.GroupResource) error { - switch { - case storage.IsNotFound(err): - return errors.NewNotFound(qualifiedResource, "") - case storage.IsUnreachable(err), storage.IsRequestTimeout(err): - return errors.NewServerTimeout(qualifiedResource, "list", 2) // TODO: make configurable or handled at a higher level - case storage.IsInternalError(err): - return errors.NewInternalError(err) - case storage.IsCorruptObject(err): - return errors.NewInternalError(err) - default: - return err - } -} - -// InterpretGetError converts a generic error on a retrieval -// operation into the appropriate API error. -func InterpretGetError(err error, qualifiedResource schema.GroupResource, name string) error { - switch { - case storage.IsNotFound(err): - return errors.NewNotFound(qualifiedResource, name) - case storage.IsUnreachable(err): - return errors.NewServerTimeout(qualifiedResource, "get", 2) // TODO: make configurable or handled at a higher level - case storage.IsInternalError(err): - return errors.NewInternalError(err) - case storage.IsCorruptObject(err): - return errors.NewInternalError(err) - default: - return err - } -} - -// InterpretCreateError converts a generic error on a create -// operation into the appropriate API error. -func InterpretCreateError(err error, qualifiedResource schema.GroupResource, name string) error { - switch { - case storage.IsExist(err): - return errors.NewAlreadyExists(qualifiedResource, name) - case storage.IsUnreachable(err): - return errors.NewServerTimeout(qualifiedResource, "create", 2) // TODO: make configurable or handled at a higher level - case storage.IsInternalError(err): - return errors.NewInternalError(err) - case storage.IsCorruptObject(err): - return errors.NewInternalError(err) - default: - return err - } -} - -// InterpretUpdateError converts a generic error on an update -// operation into the appropriate API error. -func InterpretUpdateError(err error, qualifiedResource schema.GroupResource, name string) error { - switch { - case storage.IsConflict(err), storage.IsExist(err), storage.IsInvalidObj(err): - return errors.NewConflict(qualifiedResource, name, err) - case storage.IsUnreachable(err): - return errors.NewServerTimeout(qualifiedResource, "update", 2) // TODO: make configurable or handled at a higher level - case storage.IsNotFound(err): - return errors.NewNotFound(qualifiedResource, name) - case storage.IsInternalError(err): - return errors.NewInternalError(err) - case storage.IsCorruptObject(err): - return errors.NewInternalError(err) - default: - return err - } -} - -// InterpretDeleteError converts a generic error on a delete -// operation into the appropriate API error. -func InterpretDeleteError(err error, qualifiedResource schema.GroupResource, name string) error { - switch { - case storage.IsNotFound(err): - return errors.NewNotFound(qualifiedResource, name) - case storage.IsUnreachable(err): - return errors.NewServerTimeout(qualifiedResource, "delete", 2) // TODO: make configurable or handled at a higher level - case storage.IsConflict(err), storage.IsExist(err), storage.IsInvalidObj(err): - return errors.NewConflict(qualifiedResource, name, err) - case storage.IsInternalError(err): - return errors.NewInternalError(err) - case storage.IsCorruptObject(err): - return errors.NewInternalError(err) - default: - return err - } -} - -// InterpretWatchError converts a generic error on a watch -// operation into the appropriate API error. -func InterpretWatchError(err error, resource schema.GroupResource, name string) error { - switch { - case storage.IsInvalidError(err): - invalidError, _ := err.(storage.InvalidError) - return errors.NewInvalid(schema.GroupKind{Group: resource.Group, Kind: resource.Resource}, name, invalidError.Errs) - case storage.IsInternalError(err): - return errors.NewInternalError(err) - case storage.IsCorruptObject(err): - return errors.NewInternalError(err) - default: - return err - } -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/OWNERS b/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/OWNERS deleted file mode 100644 index 33809ed8c..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: - - wojtek-t - - serathius -labels: - - sig/etcd diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/compact.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/compact.go deleted file mode 100644 index f279c6cab..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/compact.go +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package etcd3 - -import ( - "context" - "strconv" - "sync" - "time" - - clientv3 "go.etcd.io/etcd/client/v3" - "k8s.io/klog/v2" -) - -const ( - compactRevKey = "compact_rev_key" -) - -var ( - endpointsMapMu sync.Mutex - endpointsMap map[string]struct{} -) - -func init() { - endpointsMap = make(map[string]struct{}) -} - -// StartCompactor starts a compactor in the background to compact old version of keys that's not needed. -// By default, we save the most recent 5 minutes data and compact versions > 5minutes ago. -// It should be enough for slow watchers and to tolerate burst. -// TODO: We might keep a longer history (12h) in the future once storage API can take advantage of past version of keys. -func StartCompactor(ctx context.Context, client *clientv3.Client, compactInterval time.Duration) { - endpointsMapMu.Lock() - defer endpointsMapMu.Unlock() - - // In one process, we can have only one compactor for one cluster. - // Currently we rely on endpoints to differentiate clusters. - for _, ep := range client.Endpoints() { - if _, ok := endpointsMap[ep]; ok { - klog.V(4).Infof("compactor already exists for endpoints %v", client.Endpoints()) - return - } - } - for _, ep := range client.Endpoints() { - endpointsMap[ep] = struct{}{} - } - - if compactInterval != 0 { - go compactor(ctx, client, compactInterval) - } -} - -// compactor periodically compacts historical versions of keys in etcd. -// It will compact keys with versions older than given interval. -// In other words, after compaction, it will only contain keys set during last interval. -// Any API call for the older versions of keys will return error. -// Interval is the time interval between each compaction. The first compaction happens after "interval". -func compactor(ctx context.Context, client *clientv3.Client, interval time.Duration) { - // Technical definitions: - // We have a special key in etcd defined as *compactRevKey*. - // compactRevKey's value will be set to the string of last compacted revision. - // compactRevKey's version will be used as logical time for comparison. THe version is referred as compact time. - // Initially, because the key doesn't exist, the compact time (version) is 0. - // - // Algorithm: - // - Compare to see if (local compact_time) = (remote compact_time). - // - If yes, increment both local and remote compact_time, and do a compaction. - // - If not, set local to remote compact_time. - // - // Technical details/insights: - // - // The protocol here is lease based. If one compactor CAS successfully, the others would know it when they fail in - // CAS later and would try again in 5 minutes. If an APIServer crashed, another one would "take over" the lease. - // - // For example, in the following diagram, we have a compactor C1 doing compaction in t1, t2. Another compactor C2 - // at t1' (t1 < t1' < t2) would CAS fail, set its known oldRev to rev at t1', and try again in t2' (t2' > t2). - // If C1 crashed and wouldn't compact at t2, C2 would CAS successfully at t2'. - // - // oldRev(t2) curRev(t2) - // + - // oldRev curRev | - // + + | - // | | | - // | | t1' | t2' - // +---v-------------v----^---------v------^----> - // t0 t1 t2 - // - // We have the guarantees: - // - in normal cases, the interval is 5 minutes. - // - in failover, the interval is >5m and <10m - // - // FAQ: - // - What if time is not accurate? We don't care as long as someone did the compaction. Atomicity is ensured using - // etcd API. - // - What happened under heavy load scenarios? Initially, each apiserver will do only one compaction - // every 5 minutes. This is very unlikely affecting or affected w.r.t. server load. - - var compactTime int64 - var rev int64 - var err error - for { - select { - case <-time.After(interval): - case <-ctx.Done(): - return - } - - compactTime, rev, err = compact(ctx, client, compactTime, rev) - if err != nil { - klog.Errorf("etcd: endpoint (%v) compact failed: %v", client.Endpoints(), err) - continue - } - } -} - -// compact compacts etcd store and returns current rev. -// It will return the current compact time and global revision if no error occurred. -// Note that CAS fail will not incur any error. -func compact(ctx context.Context, client *clientv3.Client, t, rev int64) (int64, int64, error) { - resp, err := client.KV.Txn(ctx).If( - clientv3.Compare(clientv3.Version(compactRevKey), "=", t), - ).Then( - clientv3.OpPut(compactRevKey, strconv.FormatInt(rev, 10)), // Expect side effect: increment Version - ).Else( - clientv3.OpGet(compactRevKey), - ).Commit() - if err != nil { - return t, rev, err - } - - curRev := resp.Header.Revision - - if !resp.Succeeded { - curTime := resp.Responses[0].GetResponseRange().Kvs[0].Version - return curTime, curRev, nil - } - curTime := t + 1 - - if rev == 0 { - // We don't compact on bootstrap. - return curTime, curRev, nil - } - if _, err = client.Compact(ctx, rev); err != nil { - return curTime, curRev, err - } - klog.V(4).Infof("etcd: compacted rev (%d), endpoints (%v)", rev, client.Endpoints()) - return curTime, curRev, nil -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/corrupt_obj_deleter.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/corrupt_obj_deleter.go deleted file mode 100644 index f94c56eaa..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/corrupt_obj_deleter.go +++ /dev/null @@ -1,270 +0,0 @@ -/* -Copyright 2024 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package etcd3 - -import ( - "context" - "errors" - "fmt" - "net/http" - "strings" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - utilerrors "k8s.io/apimachinery/pkg/util/errors" - "k8s.io/apiserver/pkg/storage" - "k8s.io/apiserver/pkg/storage/value" - "k8s.io/klog/v2" -) - -// NewStoreWithUnsafeCorruptObjectDeletion wraps the given store implementation -// and adds support for unsafe deletion of corrupt objects -func NewStoreWithUnsafeCorruptObjectDeletion(delegate storage.Interface, gr schema.GroupResource) storage.Interface { - return &corruptObjectDeleter{ - Interface: delegate, - groupResource: gr, - } -} - -// WithCorruptObjErrorHandlingDecoder decorates the given decoder, it determines -// if the error returned by the given decoder represents a corrupt object (the -// object is undecodable), and then it wraps the error appropriately so the -// unsafe deleter can determine if the object is a candidate for unsafe deletion -func WithCorruptObjErrorHandlingDecoder(decoder Decoder) Decoder { - return &corruptObjErrorInterpretingDecoder{Decoder: decoder} -} - -// WithCorruptObjErrorHandlingTransformer decorates the given decoder, it -// determines if the error returned by the given transformer represents a -// corrupt object (the data from the storage is untransformable), and then it -// wraps the error appropriately so the unsafe deleter can determine -// if the object is a candidate for unsafe deletion -func WithCorruptObjErrorHandlingTransformer(transformer value.Transformer) value.Transformer { - return &corruptObjErrorInterpretingTransformer{Transformer: transformer} -} - -// corruptObjErrAggregatorFactory returns an error aggregator that aggregates -// corrupt object error(s) that the list operation encounters while -// retrieving objects from the storage. -// maxCount: it is the maximum number of error that will be aggregated -func corruptObjErrAggregatorFactory(maxCount int) func() ListErrorAggregator { - if maxCount <= 0 { - return defaultListErrorAggregatorFactory - } - return func() ListErrorAggregator { - return &corruptObjErrAggregator{maxCount: maxCount} - } -} - -var errTooMany = errors.New("too many errors, the list is truncated") - -// aggregate corrupt object errors from the LIST operation -type corruptObjErrAggregator struct { - errs []error - abortErr error - maxCount int -} - -func (a *corruptObjErrAggregator) Aggregate(key string, err error) bool { - if len(a.errs) >= a.maxCount { - // add a sentinel error to indicate there are more - a.errs = append(a.errs, errTooMany) - return true - } - var corruptObjErr *corruptObjectError - if errors.As(err, &corruptObjErr) { - a.errs = append(a.errs, storage.NewCorruptObjError(key, corruptObjErr)) - return false - } - - // not a corrupt object error, the list operation should abort - a.abortErr = err - return true -} - -func (a *corruptObjErrAggregator) Err() error { - switch { - case len(a.errs) == 0 && a.abortErr != nil: - return a.abortErr - case len(a.errs) > 0: - err := utilerrors.NewAggregate(a.errs) - return &aggregatedStorageError{errs: err, resourcePrefix: "list"} - default: - return nil - } -} - -// corruptObjectDeleter facilitates unsafe deletion of corrupt objects for etcd -type corruptObjectDeleter struct { - storage.Interface - groupResource schema.GroupResource -} - -func (s *corruptObjectDeleter) Get(ctx context.Context, key string, opts storage.GetOptions, out runtime.Object) error { - if err := s.Interface.Get(ctx, key, opts, out); err != nil { - var corruptObjErr *corruptObjectError - if !errors.As(err, &corruptObjErr) { - // this error does not represent a corrupt object - return err - } - // the unsafe deleter at the registry layer will check whether - // the given err represents a corrupt object in order to - // initiate the unsafe deletion flow. - return storage.NewCorruptObjError(key, corruptObjErr) - } - return nil -} - -func (s *corruptObjectDeleter) GetList(ctx context.Context, key string, opts storage.ListOptions, listObj runtime.Object) error { - err := s.Interface.GetList(ctx, key, opts, listObj) - if err == nil { - return nil - } - - var aggregatedErr *aggregatedStorageError - if errors.As(err, &aggregatedErr) { - // we have aggregated a list of corrupt objects - klog.V(5).ErrorS(aggregatedErr, "corrupt objects") - return aggregatedErr.NewAPIStatusError(s.groupResource) - } - return err -} - -// corruptObjErrorInterpretingDecoder wraps the error returned by the decorated decoder -type corruptObjErrorInterpretingDecoder struct { - Decoder -} - -func (d *corruptObjErrorInterpretingDecoder) Decode(value []byte, objPtr runtime.Object, rev int64) error { - // TODO: right now any error is deemed as undecodable, in - // the future, we can apply some filter, if need be. - if err := d.Decoder.Decode(value, objPtr, rev); err != nil { - return &corruptObjectError{err: err, errType: undecodable, revision: rev} - } - return nil -} - -// decodeListItem decodes bytes value in array into object. -func (d *corruptObjErrorInterpretingDecoder) DecodeListItem(ctx context.Context, data []byte, rev uint64, newItemFunc func() runtime.Object) (runtime.Object, error) { - // TODO: right now any error is deemed as undecodable, in - // the future, we can apply some filter, if need be. - obj, err := d.Decoder.DecodeListItem(ctx, data, rev, newItemFunc) - if err != nil { - err = &corruptObjectError{err: err, errType: undecodable, revision: int64(rev)} - } - return obj, err -} - -// corruptObjErrorInterpretingTransformer wraps the error returned by the transformer -type corruptObjErrorInterpretingTransformer struct { - value.Transformer -} - -func (t *corruptObjErrorInterpretingTransformer) TransformFromStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, bool, error) { - // TODO: right now any error is deemed as undecodable, in the future, we - // can apply some filter, if need be. For example, any network error - out, stale, err := t.Transformer.TransformFromStorage(ctx, data, dataCtx) - if err != nil { - err = &corruptObjectError{err: err, errType: untransformable} - } - return out, stale, err -} - -// corruptObjectError is used internally, only by the corrupt object -// deleter, this error represents a corrup object: -// a) the data from the storage failed to transform, or -// b) the data failed to decode into an object -// NOTE: this error does not have any information to identify the object -// that is corrupt, for example the storage key associated with the object -type corruptObjectError struct { - err error - errType int - revision int64 -} - -const ( - untransformable int = iota + 1 - undecodable -) - -var typeToMessage = map[int]string{ - untransformable: "data from the storage is not transformable", - undecodable: "object not decodable", -} - -func (e *corruptObjectError) Unwrap() error { return e.err } -func (e *corruptObjectError) Error() string { - return fmt.Sprintf("%s revision=%d: %v", typeToMessage[e.errType], e.revision, e.err) -} - -// aggregatedStorageError holds an aggregated list of storage.StorageError -type aggregatedStorageError struct { - resourcePrefix string - errs utilerrors.Aggregate -} - -func (e *aggregatedStorageError) Error() string { - errs := e.errs.Errors() - var b strings.Builder - fmt.Fprintf(&b, "unable to transform or decode %d objects: {\n", len(errs)) - for _, err := range errs { - fmt.Fprintf(&b, "\t%s\n", err.Error()) - } - b.WriteString("}") - return b.String() -} - -// NewAPIStatusError creates a new APIStatus object from the -// aggregated list of StorageError -func (e *aggregatedStorageError) NewAPIStatusError(qualifiedResource schema.GroupResource) *apierrors.StatusError { - var causes []metav1.StatusCause - for _, err := range e.errs.Errors() { - var storageErr *storage.StorageError - if errors.As(err, &storageErr) { - causes = append(causes, metav1.StatusCause{ - Type: metav1.CauseTypeUnexpectedServerResponse, - Field: storageErr.Key, - // TODO: do we need to expose the internal error message here? - Message: err.Error(), - }) - continue - } - if errors.Is(err, errTooMany) { - causes = append(causes, metav1.StatusCause{ - Type: metav1.CauseTypeTooMany, - Message: errTooMany.Error(), - }) - } - } - - return &apierrors.StatusError{ - ErrStatus: metav1.Status{ - Status: metav1.StatusFailure, - Code: http.StatusInternalServerError, - Reason: metav1.StatusReasonStoreReadError, - Details: &metav1.StatusDetails{ - Group: qualifiedResource.Group, - Kind: qualifiedResource.Resource, - Name: e.resourcePrefix, - Causes: causes, - }, - Message: fmt.Sprintf("failed to read one or more %s from the storage", qualifiedResource.String()), - }, - } -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/decoder.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/decoder.go deleted file mode 100644 index f70101529..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/decoder.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -Copyright 2024 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package etcd3 - -import ( - "context" - "fmt" - "time" - - "k8s.io/apimachinery/pkg/conversion" - "k8s.io/apimachinery/pkg/runtime" - endpointsrequest "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/apiserver/pkg/storage" - - "k8s.io/klog/v2" -) - -// NewDefaultDecoder returns the default decoder for etcd3 store -func NewDefaultDecoder(codec runtime.Codec, versioner storage.Versioner) Decoder { - return &defaultDecoder{ - codec: codec, - versioner: versioner, - } -} - -// Decoder is used by the etcd storage implementation to decode -// transformed data from the storage into an object -type Decoder interface { - // Decode decodes value of bytes into object. It will also - // set the object resource version to rev. - // On success, objPtr would be set to the object. - Decode(value []byte, objPtr runtime.Object, rev int64) error - - // DecodeListItem decodes bytes value in array into object. - DecodeListItem(ctx context.Context, data []byte, rev uint64, newItemFunc func() runtime.Object) (runtime.Object, error) -} - -var _ Decoder = &defaultDecoder{} - -type defaultDecoder struct { - codec runtime.Codec - versioner storage.Versioner -} - -// decode decodes value of bytes into object. It will also set the object resource version to rev. -// On success, objPtr would be set to the object. -func (d *defaultDecoder) Decode(value []byte, objPtr runtime.Object, rev int64) error { - if _, err := conversion.EnforcePtr(objPtr); err != nil { - // nolint:errorlint // this code was moved from store.go as is - return fmt.Errorf("unable to convert output object to pointer: %v", err) - } - _, _, err := d.codec.Decode(value, nil, objPtr) - if err != nil { - return err - } - // being unable to set the version does not prevent the object from being extracted - if err := d.versioner.UpdateObject(objPtr, uint64(rev)); err != nil { - klog.Errorf("failed to update object version: %v", err) - } - return nil -} - -// decodeListItem decodes bytes value in array into object. -func (d *defaultDecoder) DecodeListItem(ctx context.Context, data []byte, rev uint64, newItemFunc func() runtime.Object) (runtime.Object, error) { - startedAt := time.Now() - defer func() { - endpointsrequest.TrackDecodeLatency(ctx, time.Since(startedAt)) - }() - - obj, _, err := d.codec.Decode(data, nil, newItemFunc()) - if err != nil { - return nil, err - } - - if err := d.versioner.UpdateObject(obj, rev); err != nil { - klog.Errorf("failed to update object version: %v", err) - } - - return obj, nil -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/errors.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/errors.go deleted file mode 100644 index 7dd91d949..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/errors.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package etcd3 - -import ( - goerrors "errors" - "net/http" - - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apiserver/pkg/storage" - - etcdrpc "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" -) - -func interpretWatchError(err error) error { - switch { - case err == etcdrpc.ErrCompacted: - return errors.NewResourceExpired("The resourceVersion for the provided watch is too old.") - } - - var corruptobjDeletedErr *corruptObjectDeletedError - if goerrors.As(err, &corruptobjDeletedErr) { - return &errors.StatusError{ - ErrStatus: metav1.Status{ - Status: metav1.StatusFailure, - Code: http.StatusInternalServerError, - Reason: metav1.StatusReasonStoreReadError, - Message: corruptobjDeletedErr.Error(), - }, - } - } - - return err -} - -const ( - expired string = "The resourceVersion for the provided list is too old." - continueExpired string = "The provided continue parameter is too old " + - "to display a consistent list result. You can start a new list without " + - "the continue parameter." - inconsistentContinue string = "The provided continue parameter is too old " + - "to display a consistent list result. You can start a new list without " + - "the continue parameter, or use the continue token in this response to " + - "retrieve the remainder of the results. Continuing with the provided " + - "token results in an inconsistent list - objects that were created, " + - "modified, or deleted between the time the first chunk was returned " + - "and now may show up in the list." -) - -func interpretListError(err error, paging bool, continueKey, keyPrefix string) error { - switch { - case err == etcdrpc.ErrCompacted: - if paging { - return handleCompactedErrorForPaging(continueKey, keyPrefix) - } - return errors.NewResourceExpired(expired) - } - return err -} - -func handleCompactedErrorForPaging(continueKey, keyPrefix string) error { - // continueToken.ResoureVersion=-1 means that the apiserver can - // continue the list at the latest resource version. We don't use rv=0 - // for this purpose to distinguish from a bad token that has empty rv. - newToken, err := storage.EncodeContinue(continueKey, keyPrefix, -1) - if err != nil { - utilruntime.HandleError(err) - return errors.NewResourceExpired(continueExpired) - } - statusError := errors.NewResourceExpired(inconsistentContinue) - statusError.ErrStatus.ListMeta.Continue = newToken - return statusError -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/event.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/event.go deleted file mode 100644 index e7644ddfa..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/event.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package etcd3 - -import ( - "fmt" - "go.etcd.io/etcd/api/v3/mvccpb" - clientv3 "go.etcd.io/etcd/client/v3" -) - -type event struct { - key string - value []byte - prevValue []byte - rev int64 - isDeleted bool - isCreated bool - isProgressNotify bool - // isInitialEventsEndBookmark helps us keep track - // of whether we have sent an annotated bookmark event. - // - // when this variable is set to true, - // a special annotation will be added - // to the bookmark event. - // - // note that we decided to extend the event - // struct field to eliminate contention - // between startWatching and processEvent - isInitialEventsEndBookmark bool -} - -// parseKV converts a KeyValue retrieved from an initial sync() listing to a synthetic isCreated event. -func parseKV(kv *mvccpb.KeyValue) *event { - return &event{ - key: string(kv.Key), - value: kv.Value, - prevValue: nil, - rev: kv.ModRevision, - isDeleted: false, - isCreated: true, - } -} - -func parseEvent(e *clientv3.Event) (*event, error) { - if !e.IsCreate() && e.PrevKv == nil { - // If the previous value is nil, error. One example of how this is possible is if the previous value has been compacted already. - return nil, fmt.Errorf("etcd event received with PrevKv=nil (key=%q, modRevision=%d, type=%s)", string(e.Kv.Key), e.Kv.ModRevision, e.Type.String()) - - } - ret := &event{ - key: string(e.Kv.Key), - value: e.Kv.Value, - rev: e.Kv.ModRevision, - isDeleted: e.Type == clientv3.EventTypeDelete, - isCreated: e.IsCreate(), - } - if e.PrevKv != nil { - ret.prevValue = e.PrevKv.Value - } - return ret, nil -} - -func progressNotifyEvent(rev int64) *event { - return &event{ - rev: rev, - isProgressNotify: true, - } -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/healthcheck.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/healthcheck.go deleted file mode 100644 index 3d4898103..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/healthcheck.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package etcd3 - -import ( - "encoding/json" - "fmt" -) - -// etcdHealth encodes data returned from etcd /healthz handler. -type etcdHealth struct { - // Note this has to be public so the json library can modify it. - Health string `json:"health"` -} - -// EtcdHealthCheck decodes data returned from etcd /healthz handler. -// Deprecated: Validate health by passing storagebackend.Config directly to storagefactory.CreateProber. -func EtcdHealthCheck(data []byte) error { - obj := etcdHealth{} - if err := json.Unmarshal(data, &obj); err != nil { - return err - } - if obj.Health != "true" { - return fmt.Errorf("Unhealthy status: %s", obj.Health) - } - return nil -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/latency_tracker.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/latency_tracker.go deleted file mode 100644 index f60210f96..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/latency_tracker.go +++ /dev/null @@ -1,107 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package etcd3 - -import ( - "context" - "time" - - clientv3 "go.etcd.io/etcd/client/v3" - endpointsrequest "k8s.io/apiserver/pkg/endpoints/request" -) - -// NewETCDLatencyTracker returns an implementation of -// clientv3.KV that times the calls from the specified -// 'delegate' KV instance in order to track latency incurred. -func NewETCDLatencyTracker(delegate clientv3.KV) clientv3.KV { - return &clientV3KVLatencyTracker{KV: delegate} -} - -// clientV3KVLatencyTracker decorates a clientv3.KV instance and times -// each call so we can track the latency an API request incurs in etcd -// round trips (the time it takes to send data to etcd and get the -// complete response back) -// -// If an API request involves N (N>=1) round trips to etcd, then we will sum -// up the latenciy incurred in each roundtrip. - -// It uses the context associated with the request in flight, so there -// are no states shared among the requests in flight, and so there is no -// concurrency overhead. -// If the goroutine executing the request handler makes concurrent calls -// to the underlying storage layer, that is protected since the latency -// tracking function TrackStorageLatency is thread safe. -// -// NOTE: Compact is an asynchronous process and is not associated with -// any request, so we will not be tracking its latency. -type clientV3KVLatencyTracker struct { - clientv3.KV -} - -func (c *clientV3KVLatencyTracker) Put(ctx context.Context, key, val string, opts ...clientv3.OpOption) (*clientv3.PutResponse, error) { - startedAt := time.Now() - defer func() { - endpointsrequest.TrackStorageLatency(ctx, time.Since(startedAt)) - }() - - return c.KV.Put(ctx, key, val, opts...) -} - -func (c *clientV3KVLatencyTracker) Get(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error) { - startedAt := time.Now() - defer func() { - endpointsrequest.TrackStorageLatency(ctx, time.Since(startedAt)) - }() - - return c.KV.Get(ctx, key, opts...) -} - -func (c *clientV3KVLatencyTracker) Delete(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.DeleteResponse, error) { - startedAt := time.Now() - defer func() { - endpointsrequest.TrackStorageLatency(ctx, time.Since(startedAt)) - }() - - return c.KV.Delete(ctx, key, opts...) -} - -func (c *clientV3KVLatencyTracker) Do(ctx context.Context, op clientv3.Op) (clientv3.OpResponse, error) { - startedAt := time.Now() - defer func() { - endpointsrequest.TrackStorageLatency(ctx, time.Since(startedAt)) - }() - - return c.KV.Do(ctx, op) -} - -func (c *clientV3KVLatencyTracker) Txn(ctx context.Context) clientv3.Txn { - return &clientV3TxnTracker{ctx: ctx, Txn: c.KV.Txn(ctx)} -} - -type clientV3TxnTracker struct { - ctx context.Context - clientv3.Txn -} - -func (t *clientV3TxnTracker) Commit() (*clientv3.TxnResponse, error) { - startedAt := time.Now() - defer func() { - endpointsrequest.TrackStorageLatency(t.ctx, time.Since(startedAt)) - }() - - return t.Txn.Commit() -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/lease_manager.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/lease_manager.go deleted file mode 100644 index 12c9d00c7..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/lease_manager.go +++ /dev/null @@ -1,131 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package etcd3 - -import ( - "context" - "sync" - "time" - - clientv3 "go.etcd.io/etcd/client/v3" - "k8s.io/apiserver/pkg/storage/etcd3/metrics" -) - -const ( - defaultLeaseReuseDurationSeconds = 60 - defaultLeaseMaxObjectCount = 1000 -) - -// LeaseManagerConfig is configuration for creating a lease manager. -type LeaseManagerConfig struct { - // ReuseDurationSeconds specifies time in seconds that each lease is reused - ReuseDurationSeconds int64 - // MaxObjectCount specifies how many objects that a lease can attach - MaxObjectCount int64 -} - -// NewDefaultLeaseManagerConfig creates a LeaseManagerConfig with default values -func NewDefaultLeaseManagerConfig() LeaseManagerConfig { - return LeaseManagerConfig{ - ReuseDurationSeconds: defaultLeaseReuseDurationSeconds, - MaxObjectCount: defaultLeaseMaxObjectCount, - } -} - -// leaseManager is used to manage leases requested from etcd. If a new write -// needs a lease that has similar expiration time to the previous one, the old -// lease will be reused to reduce the overhead of etcd, since lease operations -// are expensive. In the implementation, we only store one previous lease, -// since all the events have the same ttl. -type leaseManager struct { - client *clientv3.Client // etcd client used to grant leases - leaseMu sync.Mutex - prevLeaseID clientv3.LeaseID - prevLeaseExpirationTime time.Time - // The period of time in seconds and percent of TTL that each lease is - // reused. The minimum of them is used to avoid unreasonably large - // numbers. - leaseReuseDurationSeconds int64 - leaseReuseDurationPercent float64 - leaseMaxAttachedObjectCount int64 - leaseAttachedObjectCount int64 -} - -// newDefaultLeaseManager creates a new lease manager using default setting. -func newDefaultLeaseManager(client *clientv3.Client, config LeaseManagerConfig) *leaseManager { - if config.MaxObjectCount <= 0 { - config.MaxObjectCount = defaultLeaseMaxObjectCount - } - return newLeaseManager(client, config.ReuseDurationSeconds, 0.05, config.MaxObjectCount) -} - -// newLeaseManager creates a new lease manager with the number of buffered -// leases, lease reuse duration in seconds and percentage. The percentage -// value x means x*100%. -func newLeaseManager(client *clientv3.Client, leaseReuseDurationSeconds int64, leaseReuseDurationPercent float64, maxObjectCount int64) *leaseManager { - return &leaseManager{ - client: client, - leaseReuseDurationSeconds: leaseReuseDurationSeconds, - leaseReuseDurationPercent: leaseReuseDurationPercent, - leaseMaxAttachedObjectCount: maxObjectCount, - } -} - -// GetLease returns a lease based on requested ttl: if the cached previous -// lease can be reused, reuse it; otherwise request a new one from etcd. -func (l *leaseManager) GetLease(ctx context.Context, ttl int64) (clientv3.LeaseID, error) { - now := time.Now() - l.leaseMu.Lock() - defer l.leaseMu.Unlock() - // check if previous lease can be reused - reuseDurationSeconds := l.getReuseDurationSecondsLocked(ttl) - valid := now.Add(time.Duration(ttl) * time.Second).Before(l.prevLeaseExpirationTime) - sufficient := now.Add(time.Duration(ttl+reuseDurationSeconds) * time.Second).After(l.prevLeaseExpirationTime) - - // We count all operations that happened in the same lease, regardless of success or failure. - // Currently each GetLease call only attach 1 object - l.leaseAttachedObjectCount++ - - if valid && sufficient && l.leaseAttachedObjectCount <= l.leaseMaxAttachedObjectCount { - return l.prevLeaseID, nil - } - - // request a lease with a little extra ttl from etcd - ttl += reuseDurationSeconds - lcr, err := l.client.Lease.Grant(ctx, ttl) - if err != nil { - return clientv3.LeaseID(0), err - } - // cache the new lease id - l.prevLeaseID = lcr.ID - l.prevLeaseExpirationTime = now.Add(time.Duration(ttl) * time.Second) - // refresh count - metrics.UpdateLeaseObjectCount(l.leaseAttachedObjectCount) - l.leaseAttachedObjectCount = 1 - return lcr.ID, nil -} - -// getReuseDurationSecondsLocked returns the reusable duration in seconds -// based on the configuration. Lock has to be acquired before calling this -// function. -func (l *leaseManager) getReuseDurationSecondsLocked(ttl int64) int64 { - reuseDurationSeconds := int64(l.leaseReuseDurationPercent * float64(ttl)) - if reuseDurationSeconds > l.leaseReuseDurationSeconds { - reuseDurationSeconds = l.leaseReuseDurationSeconds - } - return reuseDurationSeconds -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/logger.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/logger.go deleted file mode 100644 index 773d12f6f..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/logger.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package etcd3 - -import ( - "fmt" - - "google.golang.org/grpc/grpclog" - "k8s.io/klog/v2" -) - -func init() { - grpclog.SetLoggerV2(klogWrapper{}) -} - -type klogWrapper struct{} - -const klogWrapperDepth = 4 - -func (klogWrapper) Info(args ...interface{}) { - if klogV := klog.V(5); klogV.Enabled() { - klogV.InfoSDepth(klogWrapperDepth, fmt.Sprint(args...)) - } -} - -func (klogWrapper) Infoln(args ...interface{}) { - if klogV := klog.V(5); klogV.Enabled() { - klogV.InfoSDepth(klogWrapperDepth, fmt.Sprintln(args...)) - } -} - -func (klogWrapper) Infof(format string, args ...interface{}) { - if klogV := klog.V(5); klogV.Enabled() { - klog.V(5).InfoSDepth(klogWrapperDepth, fmt.Sprintf(format, args...)) - } -} - -func (klogWrapper) Warning(args ...interface{}) { - klog.WarningDepth(klogWrapperDepth, args...) -} - -func (klogWrapper) Warningln(args ...interface{}) { - klog.WarningDepth(klogWrapperDepth, fmt.Sprintln(args...)) -} - -func (klogWrapper) Warningf(format string, args ...interface{}) { - klog.WarningDepth(klogWrapperDepth, fmt.Sprintf(format, args...)) -} - -func (klogWrapper) Error(args ...interface{}) { - klog.ErrorDepth(klogWrapperDepth, args...) -} - -func (klogWrapper) Errorln(args ...interface{}) { - klog.ErrorDepth(klogWrapperDepth, fmt.Sprintln(args...)) -} - -func (klogWrapper) Errorf(format string, args ...interface{}) { - klog.ErrorDepth(klogWrapperDepth, fmt.Sprintf(format, args...)) -} - -func (klogWrapper) Fatal(args ...interface{}) { - klog.FatalDepth(klogWrapperDepth, args...) -} - -func (klogWrapper) Fatalln(args ...interface{}) { - klog.FatalDepth(klogWrapperDepth, fmt.Sprintln(args...)) -} - -func (klogWrapper) Fatalf(format string, args ...interface{}) { - klog.FatalDepth(klogWrapperDepth, fmt.Sprintf(format, args...)) -} - -func (klogWrapper) V(l int) bool { - return bool(klog.V(klog.Level(l)).Enabled()) -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/metrics/OWNERS b/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/metrics/OWNERS deleted file mode 100644 index 433e84aa3..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/metrics/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - logicalhan diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go deleted file mode 100644 index 747e120dc..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go +++ /dev/null @@ -1,309 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package metrics - -import ( - "context" - "fmt" - "sync" - "time" - - compbasemetrics "k8s.io/component-base/metrics" - "k8s.io/component-base/metrics/legacyregistry" - "k8s.io/klog/v2" -) - -/* - * By default, all the following metrics are defined as falling under - * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/kubernetes-control-plane-metrics-stability.md#stability-classes) - * - * Promoting the stability level of the metric is a responsibility of the component owner, since it - * involves explicitly acknowledging support for the metric across multiple releases, in accordance with - * the metric stability policy. - */ -var ( - etcdRequestLatency = compbasemetrics.NewHistogramVec( - &compbasemetrics.HistogramOpts{ - Name: "etcd_request_duration_seconds", - Help: "Etcd request latency in seconds for each operation and object type.", - // Etcd request latency in seconds for each operation and object type. - // This metric is used for verifying etcd api call latencies SLO - // keep consistent with apiserver metric 'requestLatencies' in - // staging/src/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go - Buckets: []float64{0.005, 0.025, 0.05, 0.1, 0.2, 0.4, 0.6, 0.8, 1.0, 1.25, 1.5, 2, 3, - 4, 5, 6, 8, 10, 15, 20, 30, 45, 60}, - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"operation", "type"}, - ) - etcdRequestCounts = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Name: "etcd_requests_total", - Help: "Etcd request counts for each operation and object type.", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"operation", "type"}, - ) - etcdRequestErrorCounts = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Name: "etcd_request_errors_total", - Help: "Etcd failed request counts for each operation and object type.", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"operation", "type"}, - ) - objectCounts = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Name: "apiserver_storage_objects", - Help: "Number of stored objects at the time of last check split by kind. In case of a fetching error, the value will be -1.", - StabilityLevel: compbasemetrics.STABLE, - }, - []string{"resource"}, - ) - dbTotalSize = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Subsystem: "apiserver", - Name: "storage_db_total_size_in_bytes", - Help: "Total size of the storage database file physically allocated in bytes.", - StabilityLevel: compbasemetrics.ALPHA, - DeprecatedVersion: "1.28.0", - }, - []string{"endpoint"}, - ) - storageSizeDescription = compbasemetrics.NewDesc("apiserver_storage_size_bytes", "Size of the storage database file physically allocated in bytes.", []string{"storage_cluster_id"}, nil, compbasemetrics.STABLE, "") - storageMonitor = &monitorCollector{monitorGetter: func() ([]Monitor, error) { return nil, nil }} - etcdEventsReceivedCounts = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Subsystem: "apiserver", - Name: "storage_events_received_total", - Help: "Number of etcd events received split by kind.", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"resource"}, - ) - etcdBookmarkCounts = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Name: "etcd_bookmark_counts", - Help: "Number of etcd bookmarks (progress notify events) split by kind.", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"resource"}, - ) - etcdLeaseObjectCounts = compbasemetrics.NewHistogramVec( - &compbasemetrics.HistogramOpts{ - Name: "etcd_lease_object_counts", - Help: "Number of objects attached to a single etcd lease.", - Buckets: []float64{10, 50, 100, 500, 1000, 2500, 5000}, - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{}, - ) - listStorageCount = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Name: "apiserver_storage_list_total", - Help: "Number of LIST requests served from storage", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"resource"}, - ) - listStorageNumFetched = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Name: "apiserver_storage_list_fetched_objects_total", - Help: "Number of objects read from storage in the course of serving a LIST request", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"resource"}, - ) - listStorageNumSelectorEvals = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Name: "apiserver_storage_list_evaluated_objects_total", - Help: "Number of objects tested in the course of serving a LIST request from storage", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"resource"}, - ) - listStorageNumReturned = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Name: "apiserver_storage_list_returned_objects_total", - Help: "Number of objects returned for a LIST request from storage", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"resource"}, - ) - decodeErrorCounts = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Namespace: "apiserver", - Name: "storage_decode_errors_total", - Help: "Number of stored object decode errors split by object type", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"resource"}, - ) -) - -var registerMetrics sync.Once - -// Register all metrics. -func Register() { - // Register the metrics. - registerMetrics.Do(func() { - legacyregistry.MustRegister(etcdRequestLatency) - legacyregistry.MustRegister(etcdRequestCounts) - legacyregistry.MustRegister(etcdRequestErrorCounts) - legacyregistry.MustRegister(objectCounts) - legacyregistry.MustRegister(dbTotalSize) - legacyregistry.CustomMustRegister(storageMonitor) - legacyregistry.MustRegister(etcdEventsReceivedCounts) - legacyregistry.MustRegister(etcdBookmarkCounts) - legacyregistry.MustRegister(etcdLeaseObjectCounts) - legacyregistry.MustRegister(listStorageCount) - legacyregistry.MustRegister(listStorageNumFetched) - legacyregistry.MustRegister(listStorageNumSelectorEvals) - legacyregistry.MustRegister(listStorageNumReturned) - legacyregistry.MustRegister(decodeErrorCounts) - }) -} - -// UpdateObjectCount sets the apiserver_storage_object_counts metric. -func UpdateObjectCount(resourcePrefix string, count int64) { - objectCounts.WithLabelValues(resourcePrefix).Set(float64(count)) -} - -// RecordEtcdRequest updates and sets the etcd_request_duration_seconds, -// etcd_request_total, etcd_request_errors_total metrics. -func RecordEtcdRequest(verb, resource string, err error, startTime time.Time) { - v := []string{verb, resource} - etcdRequestLatency.WithLabelValues(v...).Observe(sinceInSeconds(startTime)) - etcdRequestCounts.WithLabelValues(v...).Inc() - if err != nil { - etcdRequestErrorCounts.WithLabelValues(v...).Inc() - } -} - -// RecordEtcdEvent updated the etcd_events_received_total metric. -func RecordEtcdEvent(resource string) { - etcdEventsReceivedCounts.WithLabelValues(resource).Inc() -} - -// RecordEtcdBookmark updates the etcd_bookmark_counts metric. -func RecordEtcdBookmark(resource string) { - etcdBookmarkCounts.WithLabelValues(resource).Inc() -} - -// RecordDecodeError sets the storage_decode_errors metrics. -func RecordDecodeError(resource string) { - decodeErrorCounts.WithLabelValues(resource).Inc() -} - -// Reset resets the etcd_request_duration_seconds metric. -func Reset() { - etcdRequestLatency.Reset() -} - -// sinceInSeconds gets the time since the specified start in seconds. -// -// This is a variable to facilitate testing. -var sinceInSeconds = func(start time.Time) float64 { - return time.Since(start).Seconds() -} - -// UpdateEtcdDbSize sets the etcd_db_total_size_in_bytes metric. -// Deprecated: Metric etcd_db_total_size_in_bytes will be replaced with apiserver_storage_size_bytes -func UpdateEtcdDbSize(ep string, size int64) { - dbTotalSize.WithLabelValues(ep).Set(float64(size)) -} - -// SetStorageMonitorGetter sets monitor getter to allow monitoring etcd stats. -func SetStorageMonitorGetter(getter func() ([]Monitor, error)) { - storageMonitor.setGetter(getter) -} - -// UpdateLeaseObjectCount sets the etcd_lease_object_counts metric. -func UpdateLeaseObjectCount(count int64) { - // Currently we only store one previous lease, since all the events have the same ttl. - // See pkg/storage/etcd3/lease_manager.go - etcdLeaseObjectCounts.WithLabelValues().Observe(float64(count)) -} - -// RecordListEtcd3Metrics notes various metrics of the cost to serve a LIST request -func RecordStorageListMetrics(resource string, numFetched, numEvald, numReturned int) { - listStorageCount.WithLabelValues(resource).Inc() - listStorageNumFetched.WithLabelValues(resource).Add(float64(numFetched)) - listStorageNumSelectorEvals.WithLabelValues(resource).Add(float64(numEvald)) - listStorageNumReturned.WithLabelValues(resource).Add(float64(numReturned)) -} - -type Monitor interface { - Monitor(ctx context.Context) (StorageMetrics, error) - Close() error -} - -type StorageMetrics struct { - Size int64 -} - -type monitorCollector struct { - compbasemetrics.BaseStableCollector - - mutex sync.Mutex - monitorGetter func() ([]Monitor, error) -} - -func (m *monitorCollector) setGetter(monitorGetter func() ([]Monitor, error)) { - m.mutex.Lock() - defer m.mutex.Unlock() - m.monitorGetter = monitorGetter -} - -func (m *monitorCollector) getGetter() func() ([]Monitor, error) { - m.mutex.Lock() - defer m.mutex.Unlock() - return m.monitorGetter -} - -// DescribeWithStability implements compbasemetrics.StableColletor -func (c *monitorCollector) DescribeWithStability(ch chan<- *compbasemetrics.Desc) { - ch <- storageSizeDescription -} - -// CollectWithStability implements compbasemetrics.StableColletor -func (c *monitorCollector) CollectWithStability(ch chan<- compbasemetrics.Metric) { - monitors, err := c.getGetter()() - if err != nil { - return - } - - for i, m := range monitors { - storageClusterID := fmt.Sprintf("etcd-%d", i) - - klog.V(4).InfoS("Start collecting storage metrics", "storage_cluster_id", storageClusterID) - ctx, cancel := context.WithTimeout(context.Background(), time.Second) - metrics, err := m.Monitor(ctx) - cancel() - m.Close() - if err != nil { - klog.InfoS("Failed to get storage metrics", "storage_cluster_id", storageClusterID, "err", err) - continue - } - - metric, err := compbasemetrics.NewConstMetric(storageSizeDescription, compbasemetrics.GaugeValue, float64(metrics.Size), storageClusterID) - if err != nil { - klog.ErrorS(err, "Failed to create metric", "storage_cluster_id", storageClusterID) - } - ch <- metric - } -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/store.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/store.go deleted file mode 100644 index ee5f3d676..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/store.go +++ /dev/null @@ -1,1084 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package etcd3 - -import ( - "bytes" - "context" - "fmt" - "path" - "reflect" - "strconv" - "strings" - "time" - - "go.etcd.io/etcd/api/v3/mvccpb" - clientv3 "go.etcd.io/etcd/client/v3" - "go.etcd.io/etcd/client/v3/kubernetes" - "go.opentelemetry.io/otel/attribute" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/meta" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/conversion" - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/apiserver/pkg/audit" - "k8s.io/apiserver/pkg/features" - "k8s.io/apiserver/pkg/storage" - "k8s.io/apiserver/pkg/storage/etcd3/metrics" - etcdfeature "k8s.io/apiserver/pkg/storage/feature" - "k8s.io/apiserver/pkg/storage/value" - utilfeature "k8s.io/apiserver/pkg/util/feature" - "k8s.io/component-base/tracing" - "k8s.io/klog/v2" -) - -const ( - // maxLimit is a maximum page limit increase used when fetching objects from etcd. - // This limit is used only for increasing page size by kube-apiserver. If request - // specifies larger limit initially, it won't be changed. - maxLimit = 10000 -) - -// authenticatedDataString satisfies the value.Context interface. It uses the key to -// authenticate the stored data. This does not defend against reuse of previously -// encrypted values under the same key, but will prevent an attacker from using an -// encrypted value from a different key. A stronger authenticated data segment would -// include the etcd3 Version field (which is incremented on each write to a key and -// reset when the key is deleted), but an attacker with write access to etcd can -// force deletion and recreation of keys to weaken that angle. -type authenticatedDataString string - -// AuthenticatedData implements the value.Context interface. -func (d authenticatedDataString) AuthenticatedData() []byte { - return []byte(string(d)) -} - -var _ value.Context = authenticatedDataString("") - -type store struct { - client *kubernetes.Client - codec runtime.Codec - versioner storage.Versioner - transformer value.Transformer - pathPrefix string - groupResource schema.GroupResource - groupResourceString string - watcher *watcher - leaseManager *leaseManager - decoder Decoder - listErrAggrFactory func() ListErrorAggregator - - resourcePrefix string - newListFunc func() runtime.Object -} - -func (s *store) RequestWatchProgress(ctx context.Context) error { - // Use watchContext to match ctx metadata provided when creating the watch. - // In best case scenario we would use the same context that watch was created, but there is no way access it from watchCache. - return s.client.RequestProgress(s.watchContext(ctx)) -} - -type objState struct { - obj runtime.Object - meta *storage.ResponseMeta - rev int64 - data []byte - stale bool -} - -// ListErrorAggregator aggregates the error(s) that the LIST operation -// encounters while retrieving object(s) from the storage -type ListErrorAggregator interface { - // Aggregate aggregates the given error from list operation - // key: it identifies the given object in the storage. - // err: it represents the error the list operation encountered while - // retrieving the given object from the storage. - // done: true if the aggregation is done and the list operation should - // abort, otherwise the list operation will continue - Aggregate(key string, err error) bool - - // Err returns the aggregated error - Err() error -} - -// defaultListErrorAggregatorFactory returns the default list error -// aggregator that maintains backward compatibility, which is abort -// the list operation as soon as it encounters the first error -func defaultListErrorAggregatorFactory() ListErrorAggregator { return &abortOnFirstError{} } - -// LIST aborts on the first error it encounters (backward compatible) -type abortOnFirstError struct { - err error -} - -func (a *abortOnFirstError) Aggregate(key string, err error) bool { - a.err = err - return true -} -func (a *abortOnFirstError) Err() error { return a.err } - -// New returns an etcd3 implementation of storage.Interface. -func New(c *kubernetes.Client, codec runtime.Codec, newFunc, newListFunc func() runtime.Object, prefix, resourcePrefix string, groupResource schema.GroupResource, transformer value.Transformer, leaseManagerConfig LeaseManagerConfig, decoder Decoder, versioner storage.Versioner) storage.Interface { - if utilfeature.DefaultFeatureGate.Enabled(features.AllowUnsafeMalformedObjectDeletion) { - transformer = WithCorruptObjErrorHandlingTransformer(transformer) - decoder = WithCorruptObjErrorHandlingDecoder(decoder) - } - var store storage.Interface - store = newStore(c, codec, newFunc, newListFunc, prefix, resourcePrefix, groupResource, transformer, leaseManagerConfig, decoder, versioner) - if utilfeature.DefaultFeatureGate.Enabled(features.AllowUnsafeMalformedObjectDeletion) { - store = NewStoreWithUnsafeCorruptObjectDeletion(store, groupResource) - } - return store -} - -func newStore(c *kubernetes.Client, codec runtime.Codec, newFunc, newListFunc func() runtime.Object, prefix, resourcePrefix string, groupResource schema.GroupResource, transformer value.Transformer, leaseManagerConfig LeaseManagerConfig, decoder Decoder, versioner storage.Versioner) *store { - // for compatibility with etcd2 impl. - // no-op for default prefix of '/registry'. - // keeps compatibility with etcd2 impl for custom prefixes that don't start with '/' - pathPrefix := path.Join("/", prefix) - if !strings.HasSuffix(pathPrefix, "/") { - // Ensure the pathPrefix ends in "/" here to simplify key concatenation later. - pathPrefix += "/" - } - - listErrAggrFactory := defaultListErrorAggregatorFactory - if utilfeature.DefaultFeatureGate.Enabled(features.AllowUnsafeMalformedObjectDeletion) { - listErrAggrFactory = corruptObjErrAggregatorFactory(100) - } - - w := &watcher{ - client: c.Client, - codec: codec, - newFunc: newFunc, - groupResource: groupResource, - versioner: versioner, - transformer: transformer, - } - if newFunc == nil { - w.objectType = "" - } else { - w.objectType = reflect.TypeOf(newFunc()).String() - } - s := &store{ - client: c, - codec: codec, - versioner: versioner, - transformer: transformer, - pathPrefix: pathPrefix, - groupResource: groupResource, - groupResourceString: groupResource.String(), - watcher: w, - leaseManager: newDefaultLeaseManager(c.Client, leaseManagerConfig), - decoder: decoder, - listErrAggrFactory: listErrAggrFactory, - - resourcePrefix: resourcePrefix, - newListFunc: newListFunc, - } - - w.getCurrentStorageRV = func(ctx context.Context) (uint64, error) { - return s.GetCurrentResourceVersion(ctx) - } - if utilfeature.DefaultFeatureGate.Enabled(features.ConsistentListFromCache) || utilfeature.DefaultFeatureGate.Enabled(features.WatchList) { - etcdfeature.DefaultFeatureSupportChecker.CheckClient(c.Ctx(), c, storage.RequestWatchProgress) - } - return s -} - -// Versioner implements storage.Interface.Versioner. -func (s *store) Versioner() storage.Versioner { - return s.versioner -} - -// Get implements storage.Interface.Get. -func (s *store) Get(ctx context.Context, key string, opts storage.GetOptions, out runtime.Object) error { - preparedKey, err := s.prepareKey(key) - if err != nil { - return err - } - startTime := time.Now() - getResp, err := s.client.Kubernetes.Get(ctx, preparedKey, kubernetes.GetOptions{}) - metrics.RecordEtcdRequest("get", s.groupResourceString, err, startTime) - if err != nil { - return err - } - if err = s.validateMinimumResourceVersion(opts.ResourceVersion, uint64(getResp.Revision)); err != nil { - return err - } - - if getResp.KV == nil { - if opts.IgnoreNotFound { - return runtime.SetZeroValue(out) - } - return storage.NewKeyNotFoundError(preparedKey, 0) - } - - data, _, err := s.transformer.TransformFromStorage(ctx, getResp.KV.Value, authenticatedDataString(preparedKey)) - if err != nil { - return storage.NewInternalError(err) - } - - err = s.decoder.Decode(data, out, getResp.KV.ModRevision) - if err != nil { - recordDecodeError(s.groupResourceString, preparedKey) - return err - } - return nil -} - -// Create implements storage.Interface.Create. -func (s *store) Create(ctx context.Context, key string, obj, out runtime.Object, ttl uint64) error { - preparedKey, err := s.prepareKey(key) - if err != nil { - return err - } - ctx, span := tracing.Start(ctx, "Create etcd3", - attribute.String("audit-id", audit.GetAuditIDTruncated(ctx)), - attribute.String("key", key), - attribute.String("type", getTypeName(obj)), - attribute.String("resource", s.groupResourceString), - ) - defer span.End(500 * time.Millisecond) - if version, err := s.versioner.ObjectResourceVersion(obj); err == nil && version != 0 { - return storage.ErrResourceVersionSetOnCreate - } - if err := s.versioner.PrepareObjectForStorage(obj); err != nil { - return fmt.Errorf("PrepareObjectForStorage failed: %v", err) - } - span.AddEvent("About to Encode") - data, err := runtime.Encode(s.codec, obj) - if err != nil { - span.AddEvent("Encode failed", attribute.Int("len", len(data)), attribute.String("err", err.Error())) - return err - } - span.AddEvent("Encode succeeded", attribute.Int("len", len(data))) - - var lease clientv3.LeaseID - if ttl != 0 { - lease, err = s.leaseManager.GetLease(ctx, int64(ttl)) - if err != nil { - return err - } - } - - newData, err := s.transformer.TransformToStorage(ctx, data, authenticatedDataString(preparedKey)) - if err != nil { - span.AddEvent("TransformToStorage failed", attribute.String("err", err.Error())) - return storage.NewInternalError(err) - } - span.AddEvent("TransformToStorage succeeded") - - startTime := time.Now() - txnResp, err := s.client.Kubernetes.OptimisticPut(ctx, preparedKey, newData, 0, kubernetes.PutOptions{LeaseID: lease}) - metrics.RecordEtcdRequest("create", s.groupResourceString, err, startTime) - if err != nil { - span.AddEvent("Txn call failed", attribute.String("err", err.Error())) - return err - } - span.AddEvent("Txn call succeeded") - - if !txnResp.Succeeded { - return storage.NewKeyExistsError(preparedKey, 0) - } - - if out != nil { - err = s.decoder.Decode(data, out, txnResp.Revision) - if err != nil { - span.AddEvent("decode failed", attribute.Int("len", len(data)), attribute.String("err", err.Error())) - recordDecodeError(s.groupResourceString, preparedKey) - return err - } - span.AddEvent("decode succeeded", attribute.Int("len", len(data))) - } - return nil -} - -// Delete implements storage.Interface.Delete. -func (s *store) Delete( - ctx context.Context, key string, out runtime.Object, preconditions *storage.Preconditions, - validateDeletion storage.ValidateObjectFunc, cachedExistingObject runtime.Object, opts storage.DeleteOptions) error { - preparedKey, err := s.prepareKey(key) - if err != nil { - return err - } - v, err := conversion.EnforcePtr(out) - if err != nil { - return fmt.Errorf("unable to convert output object to pointer: %v", err) - } - - skipTransformDecode := false - if utilfeature.DefaultFeatureGate.Enabled(features.AllowUnsafeMalformedObjectDeletion) { - skipTransformDecode = opts.IgnoreStoreReadError - } - return s.conditionalDelete(ctx, preparedKey, out, v, preconditions, validateDeletion, cachedExistingObject, skipTransformDecode) -} - -func (s *store) conditionalDelete( - ctx context.Context, key string, out runtime.Object, v reflect.Value, preconditions *storage.Preconditions, - validateDeletion storage.ValidateObjectFunc, cachedExistingObject runtime.Object, skipTransformDecode bool) error { - getCurrentState := s.getCurrentState(ctx, key, v, false, skipTransformDecode) - - var origState *objState - var err error - var origStateIsCurrent bool - if cachedExistingObject != nil { - origState, err = s.getStateFromObject(cachedExistingObject) - } else { - origState, err = getCurrentState() - origStateIsCurrent = true - } - if err != nil { - return err - } - - for { - if preconditions != nil { - if err := preconditions.Check(key, origState.obj); err != nil { - if origStateIsCurrent { - return err - } - - // It's possible we're working with stale data. - // Remember the revision of the potentially stale data and the resulting update error - cachedRev := origState.rev - cachedUpdateErr := err - - // Actually fetch - origState, err = getCurrentState() - if err != nil { - return err - } - origStateIsCurrent = true - - // it turns out our cached data was not stale, return the error - if cachedRev == origState.rev { - return cachedUpdateErr - } - - // Retry - continue - } - } - if err := validateDeletion(ctx, origState.obj); err != nil { - if origStateIsCurrent { - return err - } - - // It's possible we're working with stale data. - // Remember the revision of the potentially stale data and the resulting update error - cachedRev := origState.rev - cachedUpdateErr := err - - // Actually fetch - origState, err = getCurrentState() - if err != nil { - return err - } - origStateIsCurrent = true - - // it turns out our cached data was not stale, return the error - if cachedRev == origState.rev { - return cachedUpdateErr - } - - // Retry - continue - } - - startTime := time.Now() - txnResp, err := s.client.Kubernetes.OptimisticDelete(ctx, key, origState.rev, kubernetes.DeleteOptions{ - GetOnFailure: true, - }) - metrics.RecordEtcdRequest("delete", s.groupResourceString, err, startTime) - if err != nil { - return err - } - if !txnResp.Succeeded { - klog.V(4).Infof("deletion of %s failed because of a conflict, going to retry", key) - origState, err = s.getState(ctx, txnResp.KV, key, v, false, skipTransformDecode) - if err != nil { - return err - } - origStateIsCurrent = true - continue - } - - if !skipTransformDecode { - err = s.decoder.Decode(origState.data, out, txnResp.Revision) - if err != nil { - recordDecodeError(s.groupResourceString, key) - return err - } - } - return nil - } -} - -// GuaranteedUpdate implements storage.Interface.GuaranteedUpdate. -func (s *store) GuaranteedUpdate( - ctx context.Context, key string, destination runtime.Object, ignoreNotFound bool, - preconditions *storage.Preconditions, tryUpdate storage.UpdateFunc, cachedExistingObject runtime.Object) error { - preparedKey, err := s.prepareKey(key) - if err != nil { - return err - } - ctx, span := tracing.Start(ctx, "GuaranteedUpdate etcd3", - attribute.String("audit-id", audit.GetAuditIDTruncated(ctx)), - attribute.String("key", key), - attribute.String("type", getTypeName(destination)), - attribute.String("resource", s.groupResourceString)) - defer span.End(500 * time.Millisecond) - - v, err := conversion.EnforcePtr(destination) - if err != nil { - return fmt.Errorf("unable to convert output object to pointer: %v", err) - } - - skipTransformDecode := false - getCurrentState := s.getCurrentState(ctx, preparedKey, v, ignoreNotFound, skipTransformDecode) - - var origState *objState - var origStateIsCurrent bool - if cachedExistingObject != nil { - origState, err = s.getStateFromObject(cachedExistingObject) - } else { - origState, err = getCurrentState() - origStateIsCurrent = true - } - if err != nil { - return err - } - span.AddEvent("initial value restored") - - transformContext := authenticatedDataString(preparedKey) - for { - if err := preconditions.Check(preparedKey, origState.obj); err != nil { - // If our data is already up to date, return the error - if origStateIsCurrent { - return err - } - - // It's possible we were working with stale data - // Actually fetch - origState, err = getCurrentState() - if err != nil { - return err - } - origStateIsCurrent = true - // Retry - continue - } - - ret, ttl, err := s.updateState(origState, tryUpdate) - if err != nil { - // If our data is already up to date, return the error - if origStateIsCurrent { - return err - } - - // It's possible we were working with stale data - // Remember the revision of the potentially stale data and the resulting update error - cachedRev := origState.rev - cachedUpdateErr := err - - // Actually fetch - origState, err = getCurrentState() - if err != nil { - return err - } - origStateIsCurrent = true - - // it turns out our cached data was not stale, return the error - if cachedRev == origState.rev { - return cachedUpdateErr - } - - // Retry - continue - } - - span.AddEvent("About to Encode") - data, err := runtime.Encode(s.codec, ret) - if err != nil { - span.AddEvent("Encode failed", attribute.Int("len", len(data)), attribute.String("err", err.Error())) - return err - } - span.AddEvent("Encode succeeded", attribute.Int("len", len(data))) - if !origState.stale && bytes.Equal(data, origState.data) { - // if we skipped the original Get in this loop, we must refresh from - // etcd in order to be sure the data in the store is equivalent to - // our desired serialization - if !origStateIsCurrent { - origState, err = getCurrentState() - if err != nil { - return err - } - origStateIsCurrent = true - if !bytes.Equal(data, origState.data) { - // original data changed, restart loop - continue - } - } - // recheck that the data from etcd is not stale before short-circuiting a write - if !origState.stale { - err = s.decoder.Decode(origState.data, destination, origState.rev) - if err != nil { - recordDecodeError(s.groupResourceString, preparedKey) - return err - } - return nil - } - } - - newData, err := s.transformer.TransformToStorage(ctx, data, transformContext) - if err != nil { - span.AddEvent("TransformToStorage failed", attribute.String("err", err.Error())) - return storage.NewInternalError(err) - } - span.AddEvent("TransformToStorage succeeded") - - var lease clientv3.LeaseID - if ttl != 0 { - lease, err = s.leaseManager.GetLease(ctx, int64(ttl)) - if err != nil { - return err - } - } - span.AddEvent("Transaction prepared") - - startTime := time.Now() - - txnResp, err := s.client.Kubernetes.OptimisticPut(ctx, preparedKey, newData, origState.rev, kubernetes.PutOptions{ - GetOnFailure: true, - LeaseID: lease, - }) - metrics.RecordEtcdRequest("update", s.groupResourceString, err, startTime) - if err != nil { - span.AddEvent("Txn call failed", attribute.String("err", err.Error())) - return err - } - span.AddEvent("Txn call completed") - span.AddEvent("Transaction committed") - if !txnResp.Succeeded { - klog.V(4).Infof("GuaranteedUpdate of %s failed because of a conflict, going to retry", preparedKey) - origState, err = s.getState(ctx, txnResp.KV, preparedKey, v, ignoreNotFound, skipTransformDecode) - if err != nil { - return err - } - span.AddEvent("Retry value restored") - origStateIsCurrent = true - continue - } - - err = s.decoder.Decode(data, destination, txnResp.Revision) - if err != nil { - span.AddEvent("decode failed", attribute.Int("len", len(data)), attribute.String("err", err.Error())) - recordDecodeError(s.groupResourceString, preparedKey) - return err - } - span.AddEvent("decode succeeded", attribute.Int("len", len(data))) - return nil - } -} - -func getNewItemFunc(listObj runtime.Object, v reflect.Value) func() runtime.Object { - // For unstructured lists with a target group/version, preserve the group/version in the instantiated list items - if unstructuredList, isUnstructured := listObj.(*unstructured.UnstructuredList); isUnstructured { - if apiVersion := unstructuredList.GetAPIVersion(); len(apiVersion) > 0 { - return func() runtime.Object { - return &unstructured.Unstructured{Object: map[string]interface{}{"apiVersion": apiVersion}} - } - } - } - - // Otherwise just instantiate an empty item - elem := v.Type().Elem() - return func() runtime.Object { - return reflect.New(elem).Interface().(runtime.Object) - } -} - -func (s *store) Count(key string) (int64, error) { - preparedKey, err := s.prepareKey(key) - if err != nil { - return 0, err - } - - // We need to make sure the key ended with "/" so that we only get children "directories". - // e.g. if we have key "/a", "/a/b", "/ab", getting keys with prefix "/a" will return all three, - // while with prefix "/a/" will return only "/a/b" which is the correct answer. - if !strings.HasSuffix(preparedKey, "/") { - preparedKey += "/" - } - - startTime := time.Now() - count, err := s.client.Kubernetes.Count(context.Background(), preparedKey, kubernetes.CountOptions{}) - metrics.RecordEtcdRequest("listWithCount", preparedKey, err, startTime) - if err != nil { - return 0, err - } - return count, nil -} - -// ReadinessCheck implements storage.Interface. -func (s *store) ReadinessCheck() error { - return nil -} - -func (s *store) GetCurrentResourceVersion(ctx context.Context) (uint64, error) { - emptyList := s.newListFunc() - pred := storage.SelectionPredicate{ - Label: labels.Everything(), - Field: fields.Everything(), - Limit: 1, // just in case we actually hit something - } - - err := s.GetList(ctx, s.resourcePrefix, storage.ListOptions{Predicate: pred}, emptyList) - if err != nil { - return 0, err - } - emptyListAccessor, err := meta.ListAccessor(emptyList) - if err != nil { - return 0, err - } - if emptyListAccessor == nil { - return 0, fmt.Errorf("unable to extract a list accessor from %T", emptyList) - } - - currentResourceVersion, err := strconv.Atoi(emptyListAccessor.GetResourceVersion()) - if err != nil { - return 0, err - } - - if currentResourceVersion == 0 { - return 0, fmt.Errorf("the current resource version must be greater than 0") - } - return uint64(currentResourceVersion), nil -} - -// GetList implements storage.Interface. -func (s *store) GetList(ctx context.Context, key string, opts storage.ListOptions, listObj runtime.Object) error { - keyPrefix, err := s.prepareKey(key) - if err != nil { - return err - } - ctx, span := tracing.Start(ctx, fmt.Sprintf("List(recursive=%v) etcd3", opts.Recursive), - attribute.String("audit-id", audit.GetAuditIDTruncated(ctx)), - attribute.String("key", key), - attribute.String("resourceVersion", opts.ResourceVersion), - attribute.String("resourceVersionMatch", string(opts.ResourceVersionMatch)), - attribute.Int("limit", int(opts.Predicate.Limit)), - attribute.String("continue", opts.Predicate.Continue)) - defer span.End(500 * time.Millisecond) - listPtr, err := meta.GetItemsPtr(listObj) - if err != nil { - return err - } - v, err := conversion.EnforcePtr(listPtr) - if err != nil || v.Kind() != reflect.Slice { - return fmt.Errorf("need ptr to slice: %v", err) - } - - // For recursive lists, we need to make sure the key ended with "/" so that we only - // get children "directories". e.g. if we have key "/a", "/a/b", "/ab", getting keys - // with prefix "/a" will return all three, while with prefix "/a/" will return only - // "/a/b" which is the correct answer. - if opts.Recursive && !strings.HasSuffix(keyPrefix, "/") { - keyPrefix += "/" - } - - // set the appropriate clientv3 options to filter the returned data set - limit := opts.Predicate.Limit - paging := opts.Predicate.Limit > 0 - newItemFunc := getNewItemFunc(listObj, v) - - withRev, continueKey, err := storage.ValidateListOptions(keyPrefix, s.versioner, opts) - if err != nil { - return err - } - - // loop until we have filled the requested limit from etcd or there are no more results - var lastKey []byte - var hasMore bool - var getResp kubernetes.ListResponse - var numFetched int - var numEvald int - // Because these metrics are for understanding the costs of handling LIST requests, - // get them recorded even in error cases. - defer func() { - numReturn := v.Len() - metrics.RecordStorageListMetrics(s.groupResourceString, numFetched, numEvald, numReturn) - }() - - metricsOp := "get" - if opts.Recursive { - metricsOp = "list" - } - - aggregator := s.listErrAggrFactory() - for { - startTime := time.Now() - getResp, err = s.getList(ctx, keyPrefix, opts.Recursive, kubernetes.ListOptions{ - Revision: withRev, - Limit: limit, - Continue: continueKey, - }) - metrics.RecordEtcdRequest(metricsOp, s.groupResourceString, err, startTime) - if err != nil { - return interpretListError(err, len(opts.Predicate.Continue) > 0, continueKey, keyPrefix) - } - numFetched += len(getResp.Kvs) - if err = s.validateMinimumResourceVersion(opts.ResourceVersion, uint64(getResp.Revision)); err != nil { - return err - } - hasMore = int64(len(getResp.Kvs)) < getResp.Count - - if len(getResp.Kvs) == 0 && hasMore { - return fmt.Errorf("no results were found, but etcd indicated there were more values remaining") - } - // indicate to the client which resource version was returned, and use the same resource version for subsequent requests. - if withRev == 0 { - withRev = getResp.Revision - } - - // avoid small allocations for the result slice, since this can be called in many - // different contexts and we don't know how significantly the result will be filtered - if opts.Predicate.Empty() { - growSlice(v, len(getResp.Kvs)) - } else { - growSlice(v, 2048, len(getResp.Kvs)) - } - - // take items from the response until the bucket is full, filtering as we go - for i, kv := range getResp.Kvs { - if paging && int64(v.Len()) >= opts.Predicate.Limit { - hasMore = true - break - } - lastKey = kv.Key - - data, _, err := s.transformer.TransformFromStorage(ctx, kv.Value, authenticatedDataString(kv.Key)) - if err != nil { - if done := aggregator.Aggregate(string(kv.Key), storage.NewInternalError(fmt.Errorf("unable to transform key %q: %w", kv.Key, err))); done { - return aggregator.Err() - } - continue - } - - // Check if the request has already timed out before decode object - select { - case <-ctx.Done(): - // parent context is canceled or timed out, no point in continuing - return storage.NewTimeoutError(string(kv.Key), "request did not complete within requested timeout") - default: - } - - obj, err := s.decoder.DecodeListItem(ctx, data, uint64(kv.ModRevision), newItemFunc) - if err != nil { - recordDecodeError(s.groupResourceString, string(kv.Key)) - if done := aggregator.Aggregate(string(kv.Key), err); done { - return aggregator.Err() - } - continue - } - - // being unable to set the version does not prevent the object from being extracted - if matched, err := opts.Predicate.Matches(obj); err == nil && matched { - v.Set(reflect.Append(v, reflect.ValueOf(obj).Elem())) - } - - numEvald++ - - // free kv early. Long lists can take O(seconds) to decode. - getResp.Kvs[i] = nil - } - continueKey = string(lastKey) + "\x00" - - // no more results remain or we didn't request paging - if !hasMore || !paging { - break - } - // we're paging but we have filled our bucket - if int64(v.Len()) >= opts.Predicate.Limit { - break - } - - if limit < maxLimit { - // We got incomplete result due to field/label selector dropping the object. - // Double page size to reduce total number of calls to etcd. - limit *= 2 - if limit > maxLimit { - limit = maxLimit - } - } - } - - if err := aggregator.Err(); err != nil { - return err - } - - if v.IsNil() { - // Ensure that we never return a nil Items pointer in the result for consistency. - v.Set(reflect.MakeSlice(v.Type(), 0, 0)) - } - - continueValue, remainingItemCount, err := storage.PrepareContinueToken(string(lastKey), keyPrefix, withRev, getResp.Count, hasMore, opts) - if err != nil { - return err - } - return s.versioner.UpdateList(listObj, uint64(withRev), continueValue, remainingItemCount) -} - -func (s *store) getList(ctx context.Context, keyPrefix string, recursive bool, options kubernetes.ListOptions) (kubernetes.ListResponse, error) { - if recursive { - return s.client.Kubernetes.List(ctx, keyPrefix, options) - } - getResp, err := s.client.Kubernetes.Get(ctx, keyPrefix, kubernetes.GetOptions{ - Revision: options.Revision, - }) - var resp kubernetes.ListResponse - if getResp.KV != nil { - resp.Kvs = []*mvccpb.KeyValue{getResp.KV} - resp.Count = 1 - resp.Revision = getResp.Revision - } else { - resp.Kvs = []*mvccpb.KeyValue{} - resp.Count = 0 - resp.Revision = getResp.Revision - } - return resp, err -} - -// growSlice takes a slice value and grows its capacity up -// to the maximum of the passed sizes or maxCapacity, whichever -// is smaller. Above maxCapacity decisions about allocation are left -// to the Go runtime on append. This allows a caller to make an -// educated guess about the potential size of the total list while -// still avoiding overly aggressive initial allocation. If sizes -// is empty maxCapacity will be used as the size to grow. -func growSlice(v reflect.Value, maxCapacity int, sizes ...int) { - cap := v.Cap() - max := cap - for _, size := range sizes { - if size > max { - max = size - } - } - if len(sizes) == 0 || max > maxCapacity { - max = maxCapacity - } - if max <= cap { - return - } - if v.Len() > 0 { - extra := reflect.MakeSlice(v.Type(), v.Len(), max) - reflect.Copy(extra, v) - v.Set(extra) - } else { - extra := reflect.MakeSlice(v.Type(), 0, max) - v.Set(extra) - } -} - -// Watch implements storage.Interface.Watch. -func (s *store) Watch(ctx context.Context, key string, opts storage.ListOptions) (watch.Interface, error) { - preparedKey, err := s.prepareKey(key) - if err != nil { - return nil, err - } - rev, err := s.versioner.ParseResourceVersion(opts.ResourceVersion) - if err != nil { - return nil, err - } - return s.watcher.Watch(s.watchContext(ctx), preparedKey, int64(rev), opts) -} - -func (s *store) watchContext(ctx context.Context) context.Context { - // The etcd server waits until it cannot find a leader for 3 election - // timeouts to cancel existing streams. 3 is currently a hard coded - // constant. The election timeout defaults to 1000ms. If the cluster is - // healthy, when the leader is stopped, the leadership transfer should be - // smooth. (leader transfers its leadership before stopping). If leader is - // hard killed, other servers will take an election timeout to realize - // leader lost and start campaign. - return clientv3.WithRequireLeader(ctx) -} - -func (s *store) getCurrentState(ctx context.Context, key string, v reflect.Value, ignoreNotFound bool, skipTransformDecode bool) func() (*objState, error) { - return func() (*objState, error) { - startTime := time.Now() - getResp, err := s.client.Kubernetes.Get(ctx, key, kubernetes.GetOptions{}) - metrics.RecordEtcdRequest("get", s.groupResourceString, err, startTime) - if err != nil { - return nil, err - } - return s.getState(ctx, getResp.KV, key, v, ignoreNotFound, skipTransformDecode) - } -} - -// getState constructs a new objState from the given response from the storage. -// skipTransformDecode: if true, the function will neither transform the data -// from the storage nor decode it into an object; otherwise, data from the -// storage will be transformed and decoded. -// NOTE: when skipTransformDecode is true, the 'data', and the 'obj' fields -// of the objState will be nil, and 'stale' will be set to true. -func (s *store) getState(ctx context.Context, kv *mvccpb.KeyValue, key string, v reflect.Value, ignoreNotFound bool, skipTransformDecode bool) (*objState, error) { - state := &objState{ - meta: &storage.ResponseMeta{}, - } - - if u, ok := v.Addr().Interface().(runtime.Unstructured); ok { - state.obj = u.NewEmptyInstance() - } else { - state.obj = reflect.New(v.Type()).Interface().(runtime.Object) - } - - if kv == nil { - if !ignoreNotFound { - return nil, storage.NewKeyNotFoundError(key, 0) - } - if err := runtime.SetZeroValue(state.obj); err != nil { - return nil, err - } - } else { - state.rev = kv.ModRevision - state.meta.ResourceVersion = uint64(state.rev) - - if skipTransformDecode { - // be explicit that we don't have the object - state.obj = nil - state.stale = true // this seems a more sane value here - return state, nil - } - - data, stale, err := s.transformer.TransformFromStorage(ctx, kv.Value, authenticatedDataString(key)) - if err != nil { - return nil, storage.NewInternalError(err) - } - - state.data = data - state.stale = stale - - if err := s.decoder.Decode(state.data, state.obj, state.rev); err != nil { - recordDecodeError(s.groupResourceString, key) - return nil, err - } - } - return state, nil -} - -func (s *store) getStateFromObject(obj runtime.Object) (*objState, error) { - state := &objState{ - obj: obj, - meta: &storage.ResponseMeta{}, - } - - rv, err := s.versioner.ObjectResourceVersion(obj) - if err != nil { - return nil, fmt.Errorf("couldn't get resource version: %v", err) - } - state.rev = int64(rv) - state.meta.ResourceVersion = uint64(state.rev) - - // Compute the serialized form - for that we need to temporarily clean - // its resource version field (those are not stored in etcd). - if err := s.versioner.PrepareObjectForStorage(obj); err != nil { - return nil, fmt.Errorf("PrepareObjectForStorage failed: %v", err) - } - state.data, err = runtime.Encode(s.codec, obj) - if err != nil { - return nil, err - } - if err := s.versioner.UpdateObject(state.obj, uint64(rv)); err != nil { - klog.Errorf("failed to update object version: %v", err) - } - return state, nil -} - -func (s *store) updateState(st *objState, userUpdate storage.UpdateFunc) (runtime.Object, uint64, error) { - ret, ttlPtr, err := userUpdate(st.obj, *st.meta) - if err != nil { - return nil, 0, err - } - - if err := s.versioner.PrepareObjectForStorage(ret); err != nil { - return nil, 0, fmt.Errorf("PrepareObjectForStorage failed: %v", err) - } - var ttl uint64 - if ttlPtr != nil { - ttl = *ttlPtr - } - return ret, ttl, nil -} - -// validateMinimumResourceVersion returns a 'too large resource' version error when the provided minimumResourceVersion is -// greater than the most recent actualRevision available from storage. -func (s *store) validateMinimumResourceVersion(minimumResourceVersion string, actualRevision uint64) error { - if minimumResourceVersion == "" { - return nil - } - minimumRV, err := s.versioner.ParseResourceVersion(minimumResourceVersion) - if err != nil { - return apierrors.NewBadRequest(fmt.Sprintf("invalid resource version: %v", err)) - } - // Enforce the storage.Interface guarantee that the resource version of the returned data - // "will be at least 'resourceVersion'". - if minimumRV > actualRevision { - return storage.NewTooLargeResourceVersionError(minimumRV, actualRevision, 0) - } - return nil -} - -func (s *store) prepareKey(key string) (string, error) { - if key == ".." || - strings.HasPrefix(key, "../") || - strings.HasSuffix(key, "/..") || - strings.Contains(key, "/../") { - return "", fmt.Errorf("invalid key: %q", key) - } - if key == "." || - strings.HasPrefix(key, "./") || - strings.HasSuffix(key, "/.") || - strings.Contains(key, "/./") { - return "", fmt.Errorf("invalid key: %q", key) - } - if key == "" || key == "/" { - return "", fmt.Errorf("empty key: %q", key) - } - // We ensured that pathPrefix ends in '/' in construction, so skip any leading '/' in the key now. - startIndex := 0 - if key[0] == '/' { - startIndex = 1 - } - return s.pathPrefix + key[startIndex:], nil -} - -// recordDecodeError record decode error split by object type. -func recordDecodeError(resource string, key string) { - metrics.RecordDecodeError(resource) - klog.V(4).Infof("Decoding %s \"%s\" failed", resource, key) -} - -// getTypeName returns type name of an object for reporting purposes. -func getTypeName(obj interface{}) string { - return reflect.TypeOf(obj).String() -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go deleted file mode 100644 index e2141395b..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go +++ /dev/null @@ -1,748 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package etcd3 - -import ( - "context" - "errors" - "fmt" - "os" - "strconv" - "strings" - "sync" - "time" - - clientv3 "go.etcd.io/etcd/client/v3" - grpccodes "google.golang.org/grpc/codes" - grpcstatus "google.golang.org/grpc/status" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/apiserver/pkg/features" - "k8s.io/apiserver/pkg/storage" - "k8s.io/apiserver/pkg/storage/etcd3/metrics" - "k8s.io/apiserver/pkg/storage/value" - utilfeature "k8s.io/apiserver/pkg/util/feature" - utilflowcontrol "k8s.io/apiserver/pkg/util/flowcontrol" - "k8s.io/klog/v2" -) - -const ( - // We have set a buffer in order to reduce times of context switches. - incomingBufSize = 100 - outgoingBufSize = 100 - processEventConcurrency = 10 -) - -// defaultWatcherMaxLimit is used to facilitate construction tests -var defaultWatcherMaxLimit int64 = maxLimit - -// fatalOnDecodeError is used during testing to panic the server if watcher encounters a decoding error -var fatalOnDecodeError = false - -func init() { - // check to see if we are running in a test environment - TestOnlySetFatalOnDecodeError(true) - fatalOnDecodeError, _ = strconv.ParseBool(os.Getenv("KUBE_PANIC_WATCH_DECODE_ERROR")) -} - -// TestOnlySetFatalOnDecodeError should only be used for cases where decode errors are expected and need to be tested. e.g. conversion webhooks. -func TestOnlySetFatalOnDecodeError(b bool) { - fatalOnDecodeError = b -} - -type watcher struct { - client *clientv3.Client - codec runtime.Codec - newFunc func() runtime.Object - objectType string - groupResource schema.GroupResource - versioner storage.Versioner - transformer value.Transformer - getCurrentStorageRV func(context.Context) (uint64, error) -} - -// watchChan implements watch.Interface. -type watchChan struct { - watcher *watcher - key string - initialRev int64 - recursive bool - progressNotify bool - internalPred storage.SelectionPredicate - ctx context.Context - cancel context.CancelFunc - incomingEventChan chan *event - resultChan chan watch.Event - errChan chan error -} - -// Watch watches on a key and returns a watch.Interface that transfers relevant notifications. -// If rev is zero, it will return the existing object(s) and then start watching from -// the maximum revision+1 from returned objects. -// If rev is non-zero, it will watch events happened after given revision. -// If opts.Recursive is false, it watches on given key. -// If opts.Recursive is true, it watches any children and directories under the key, excluding the root key itself. -// pred must be non-nil. Only if opts.Predicate matches the change, it will be returned. -func (w *watcher) Watch(ctx context.Context, key string, rev int64, opts storage.ListOptions) (watch.Interface, error) { - if opts.Recursive && !strings.HasSuffix(key, "/") { - key += "/" - } - if opts.ProgressNotify && w.newFunc == nil { - return nil, apierrors.NewInternalError(errors.New("progressNotify for watch is unsupported by the etcd storage because no newFunc was provided")) - } - startWatchRV, err := w.getStartWatchResourceVersion(ctx, rev, opts) - if err != nil { - return nil, err - } - wc := w.createWatchChan(ctx, key, startWatchRV, opts.Recursive, opts.ProgressNotify, opts.Predicate) - go wc.run(isInitialEventsEndBookmarkRequired(opts), areInitialEventsRequired(rev, opts)) - - // For etcd watch we don't have an easy way to answer whether the watch - // has already caught up. So in the initial version (given that watchcache - // is by default enabled for all resources but Events), we just deliver - // the initialization signal immediately. Improving this will be explored - // in the future. - utilflowcontrol.WatchInitialized(ctx) - - return wc, nil -} - -func (w *watcher) createWatchChan(ctx context.Context, key string, rev int64, recursive, progressNotify bool, pred storage.SelectionPredicate) *watchChan { - wc := &watchChan{ - watcher: w, - key: key, - initialRev: rev, - recursive: recursive, - progressNotify: progressNotify, - internalPred: pred, - incomingEventChan: make(chan *event, incomingBufSize), - resultChan: make(chan watch.Event, outgoingBufSize), - errChan: make(chan error, 1), - } - if pred.Empty() { - // The filter doesn't filter out any object. - wc.internalPred = storage.Everything - } - wc.ctx, wc.cancel = context.WithCancel(ctx) - return wc -} - -// getStartWatchResourceVersion returns a ResourceVersion -// the watch will be started from. -// Depending on the input parameters the semantics of the returned ResourceVersion are: -// - start at Exact (return resourceVersion) -// - start at Most Recent (return an RV from etcd) -func (w *watcher) getStartWatchResourceVersion(ctx context.Context, resourceVersion int64, opts storage.ListOptions) (int64, error) { - if resourceVersion > 0 { - return resourceVersion, nil - } - if !utilfeature.DefaultFeatureGate.Enabled(features.WatchList) { - return 0, nil - } - if opts.SendInitialEvents == nil || *opts.SendInitialEvents { - // note that when opts.SendInitialEvents=true - // we will be issuing a consistent LIST request - // against etcd followed by the special bookmark event - return 0, nil - } - // at this point the clients is interested - // only in getting a stream of events - // starting at the MostRecent point in time (RV) - currentStorageRV, err := w.getCurrentStorageRV(ctx) - if err != nil { - return 0, err - } - // currentStorageRV is taken from resp.Header.Revision (int64) - // and cast to uint64, so it is safe to do reverse - // at some point we should unify the interface but that - // would require changing Versioner.UpdateList - return int64(currentStorageRV), nil -} - -// isInitialEventsEndBookmarkRequired since there is no way to directly set -// opts.ProgressNotify from the API and the etcd3 impl doesn't support -// notification for external clients we simply return initialEventsEndBookmarkRequired -// to only send the bookmark event after the initial list call. -// -// see: https://github.com/kubernetes/kubernetes/issues/120348 -func isInitialEventsEndBookmarkRequired(opts storage.ListOptions) bool { - if !utilfeature.DefaultFeatureGate.Enabled(features.WatchList) { - return false - } - return opts.SendInitialEvents != nil && *opts.SendInitialEvents && opts.Predicate.AllowWatchBookmarks -} - -// areInitialEventsRequired returns true if all events from the etcd should be returned. -func areInitialEventsRequired(resourceVersion int64, opts storage.ListOptions) bool { - if opts.SendInitialEvents == nil && resourceVersion == 0 { - return true // legacy case - } - if !utilfeature.DefaultFeatureGate.Enabled(features.WatchList) { - return false - } - return opts.SendInitialEvents != nil && *opts.SendInitialEvents -} - -type etcdError interface { - Code() grpccodes.Code - Error() string -} - -type grpcError interface { - GRPCStatus() *grpcstatus.Status -} - -func isCancelError(err error) bool { - if err == nil { - return false - } - if err == context.Canceled { - return true - } - if etcdErr, ok := err.(etcdError); ok && etcdErr.Code() == grpccodes.Canceled { - return true - } - if grpcErr, ok := err.(grpcError); ok && grpcErr.GRPCStatus().Code() == grpccodes.Canceled { - return true - } - return false -} - -func (wc *watchChan) run(initialEventsEndBookmarkRequired, forceInitialEvents bool) { - watchClosedCh := make(chan struct{}) - go wc.startWatching(watchClosedCh, initialEventsEndBookmarkRequired, forceInitialEvents) - - var resultChanWG sync.WaitGroup - wc.processEvents(&resultChanWG) - - select { - case err := <-wc.errChan: - if isCancelError(err) { - break - } - errResult := transformErrorToEvent(err) - if errResult != nil { - // error result is guaranteed to be received by user before closing ResultChan. - select { - case wc.resultChan <- *errResult: - case <-wc.ctx.Done(): // user has given up all results - } - } - case <-watchClosedCh: - case <-wc.ctx.Done(): // user cancel - } - - // We use wc.ctx to reap all goroutines. Under whatever condition, we should stop them all. - // It's fine to double cancel. - wc.cancel() - - // we need to wait until resultChan wouldn't be used anymore - resultChanWG.Wait() - close(wc.resultChan) -} - -func (wc *watchChan) Stop() { - wc.cancel() -} - -func (wc *watchChan) ResultChan() <-chan watch.Event { - return wc.resultChan -} - -func (wc *watchChan) RequestWatchProgress() error { - return wc.watcher.client.RequestProgress(wc.ctx) -} - -// sync tries to retrieve existing data and send them to process. -// The revision to watch will be set to the revision in response. -// All events sent will have isCreated=true -func (wc *watchChan) sync() error { - opts := []clientv3.OpOption{} - if wc.recursive { - opts = append(opts, clientv3.WithLimit(defaultWatcherMaxLimit)) - rangeEnd := clientv3.GetPrefixRangeEnd(wc.key) - opts = append(opts, clientv3.WithRange(rangeEnd)) - } - - var err error - var lastKey []byte - var withRev int64 - var getResp *clientv3.GetResponse - - metricsOp := "get" - if wc.recursive { - metricsOp = "list" - } - - preparedKey := wc.key - - for { - startTime := time.Now() - getResp, err = wc.watcher.client.KV.Get(wc.ctx, preparedKey, opts...) - metrics.RecordEtcdRequest(metricsOp, wc.watcher.groupResource.String(), err, startTime) - if err != nil { - return interpretListError(err, true, preparedKey, wc.key) - } - - if len(getResp.Kvs) == 0 && getResp.More { - return fmt.Errorf("no results were found, but etcd indicated there were more values remaining") - } - - // send items from the response until no more results - for i, kv := range getResp.Kvs { - lastKey = kv.Key - wc.sendEvent(parseKV(kv)) - // free kv early. Long lists can take O(seconds) to decode. - getResp.Kvs[i] = nil - } - - if withRev == 0 { - wc.initialRev = getResp.Header.Revision - } - - // no more results remain - if !getResp.More { - return nil - } - - preparedKey = string(lastKey) + "\x00" - if withRev == 0 { - withRev = getResp.Header.Revision - opts = append(opts, clientv3.WithRev(withRev)) - } - } -} - -func logWatchChannelErr(err error) { - switch { - case strings.Contains(err.Error(), "mvcc: required revision has been compacted"): - // mvcc revision compaction which is regarded as warning, not error - klog.Warningf("watch chan error: %v", err) - case isCancelError(err): - // expected when watches close, no need to log - default: - klog.Errorf("watch chan error: %v", err) - } -} - -// startWatching does: -// - get current objects if initialRev=0; set initialRev to current rev -// - watch on given key and send events to process. -// -// initialEventsEndBookmarkSent helps us keep track -// of whether we have sent an annotated bookmark event. -// -// it's important to note that we don't -// need to track the actual RV because -// we only send the bookmark event -// after the initial list call. -// -// when this variable is set to false, -// it means we don't have any specific -// preferences for delivering bookmark events. -func (wc *watchChan) startWatching(watchClosedCh chan struct{}, initialEventsEndBookmarkRequired, forceInitialEvents bool) { - if wc.initialRev > 0 && forceInitialEvents { - currentStorageRV, err := wc.watcher.getCurrentStorageRV(wc.ctx) - if err != nil { - wc.sendError(err) - return - } - if uint64(wc.initialRev) > currentStorageRV { - wc.sendError(storage.NewTooLargeResourceVersionError(uint64(wc.initialRev), currentStorageRV, int(wait.Jitter(1*time.Second, 3).Seconds()))) - return - } - } - if forceInitialEvents { - if err := wc.sync(); err != nil { - klog.Errorf("failed to sync with latest state: %v", err) - wc.sendError(err) - return - } - } - if initialEventsEndBookmarkRequired { - wc.sendEvent(func() *event { - e := progressNotifyEvent(wc.initialRev) - e.isInitialEventsEndBookmark = true - return e - }()) - } - opts := []clientv3.OpOption{clientv3.WithRev(wc.initialRev + 1), clientv3.WithPrevKV()} - if wc.recursive { - opts = append(opts, clientv3.WithPrefix()) - } - if wc.progressNotify { - opts = append(opts, clientv3.WithProgressNotify()) - } - wch := wc.watcher.client.Watch(wc.ctx, wc.key, opts...) - for wres := range wch { - if wres.Err() != nil { - err := wres.Err() - // If there is an error on server (e.g. compaction), the channel will return it before closed. - logWatchChannelErr(err) - wc.sendError(err) - return - } - if wres.IsProgressNotify() { - wc.sendEvent(progressNotifyEvent(wres.Header.GetRevision())) - metrics.RecordEtcdBookmark(wc.watcher.groupResource.String()) - continue - } - - for _, e := range wres.Events { - metrics.RecordEtcdEvent(wc.watcher.groupResource.String()) - parsedEvent, err := parseEvent(e) - if err != nil { - logWatchChannelErr(err) - wc.sendError(err) - return - } - wc.sendEvent(parsedEvent) - } - } - // When we come to this point, it's only possible that client side ends the watch. - // e.g. cancel the context, close the client. - // If this watch chan is broken and context isn't cancelled, other goroutines will still hang. - // We should notify the main thread that this goroutine has exited. - close(watchClosedCh) -} - -// processEvents processes events from etcd watcher and sends results to resultChan. -func (wc *watchChan) processEvents(wg *sync.WaitGroup) { - if utilfeature.DefaultFeatureGate.Enabled(features.ConcurrentWatchObjectDecode) { - wc.concurrentProcessEvents(wg) - } else { - wg.Add(1) - go wc.serialProcessEvents(wg) - } -} -func (wc *watchChan) serialProcessEvents(wg *sync.WaitGroup) { - defer wg.Done() - for { - select { - case e := <-wc.incomingEventChan: - res, err := wc.transform(e) - if err != nil { - wc.sendError(err) - return - } - - if res == nil { - continue - } - if len(wc.resultChan) == cap(wc.resultChan) { - klog.V(3).InfoS("Fast watcher, slow processing. Probably caused by slow dispatching events to watchers", "outgoingEvents", outgoingBufSize, "objectType", wc.watcher.objectType, "groupResource", wc.watcher.groupResource) - } - // If user couldn't receive results fast enough, we also block incoming events from watcher. - // Because storing events in local will cause more memory usage. - // The worst case would be closing the fast watcher. - select { - case wc.resultChan <- *res: - case <-wc.ctx.Done(): - return - } - case <-wc.ctx.Done(): - return - } - } -} - -func (wc *watchChan) concurrentProcessEvents(wg *sync.WaitGroup) { - p := concurrentOrderedEventProcessing{ - wc: wc, - processingQueue: make(chan chan *processingResult, processEventConcurrency-1), - - objectType: wc.watcher.objectType, - groupResource: wc.watcher.groupResource, - } - wg.Add(1) - go func() { - defer wg.Done() - p.scheduleEventProcessing(wc.ctx, wg) - }() - wg.Add(1) - go func() { - defer wg.Done() - p.collectEventProcessing(wc.ctx) - }() -} - -type processingResult struct { - event *watch.Event - err error -} - -type concurrentOrderedEventProcessing struct { - wc *watchChan - - processingQueue chan chan *processingResult - // Metadata for logging - objectType string - groupResource schema.GroupResource -} - -func (p *concurrentOrderedEventProcessing) scheduleEventProcessing(ctx context.Context, wg *sync.WaitGroup) { - var e *event - for { - select { - case <-ctx.Done(): - return - case e = <-p.wc.incomingEventChan: - } - processingResponse := make(chan *processingResult, 1) - select { - case <-ctx.Done(): - return - case p.processingQueue <- processingResponse: - } - wg.Add(1) - go func(e *event, response chan<- *processingResult) { - defer wg.Done() - responseEvent, err := p.wc.transform(e) - select { - case <-ctx.Done(): - case response <- &processingResult{event: responseEvent, err: err}: - } - }(e, processingResponse) - } -} - -func (p *concurrentOrderedEventProcessing) collectEventProcessing(ctx context.Context) { - var processingResponse chan *processingResult - var r *processingResult - for { - select { - case <-ctx.Done(): - return - case processingResponse = <-p.processingQueue: - } - select { - case <-ctx.Done(): - return - case r = <-processingResponse: - } - if r.err != nil { - p.wc.sendError(r.err) - return - } - if r.event == nil { - continue - } - if len(p.wc.resultChan) == cap(p.wc.resultChan) { - klog.V(3).InfoS("Fast watcher, slow processing. Probably caused by slow dispatching events to watchers", "outgoingEvents", outgoingBufSize, "objectType", p.wc.watcher.objectType, "groupResource", p.wc.watcher.groupResource) - } - // If user couldn't receive results fast enough, we also block incoming events from watcher. - // Because storing events in local will cause more memory usage. - // The worst case would be closing the fast watcher. - select { - case p.wc.resultChan <- *r.event: - case <-p.wc.ctx.Done(): - return - } - } -} - -func (wc *watchChan) filter(obj runtime.Object) bool { - if wc.internalPred.Empty() { - return true - } - matched, err := wc.internalPred.Matches(obj) - return err == nil && matched -} - -func (wc *watchChan) acceptAll() bool { - return wc.internalPred.Empty() -} - -// transform transforms an event into a result for user if not filtered. -func (wc *watchChan) transform(e *event) (res *watch.Event, err error) { - curObj, oldObj, err := wc.prepareObjs(e) - if err != nil { - klog.Errorf("failed to prepare current and previous objects: %v", err) - return nil, err - } - - switch { - case e.isProgressNotify: - object := wc.watcher.newFunc() - if err := wc.watcher.versioner.UpdateObject(object, uint64(e.rev)); err != nil { - klog.Errorf("failed to propagate object version: %v", err) - return nil, fmt.Errorf("failed to propagate object resource version: %w", err) - } - if e.isInitialEventsEndBookmark { - if err := storage.AnnotateInitialEventsEndBookmark(object); err != nil { - return nil, fmt.Errorf("error while accessing object's metadata gr: %v, type: %v, obj: %#v, err: %w", wc.watcher.groupResource, wc.watcher.objectType, object, err) - } - } - res = &watch.Event{ - Type: watch.Bookmark, - Object: object, - } - case e.isDeleted: - if !wc.filter(oldObj) { - return nil, nil - } - res = &watch.Event{ - Type: watch.Deleted, - Object: oldObj, - } - case e.isCreated: - if !wc.filter(curObj) { - return nil, nil - } - res = &watch.Event{ - Type: watch.Added, - Object: curObj, - } - default: - if wc.acceptAll() { - res = &watch.Event{ - Type: watch.Modified, - Object: curObj, - } - return res, nil - } - curObjPasses := wc.filter(curObj) - oldObjPasses := wc.filter(oldObj) - switch { - case curObjPasses && oldObjPasses: - res = &watch.Event{ - Type: watch.Modified, - Object: curObj, - } - case curObjPasses && !oldObjPasses: - res = &watch.Event{ - Type: watch.Added, - Object: curObj, - } - case !curObjPasses && oldObjPasses: - res = &watch.Event{ - Type: watch.Deleted, - Object: oldObj, - } - } - } - return res, nil -} - -func transformErrorToEvent(err error) *watch.Event { - err = interpretWatchError(err) - if _, ok := err.(apierrors.APIStatus); !ok { - err = apierrors.NewInternalError(err) - } - status := err.(apierrors.APIStatus).Status() - return &watch.Event{ - Type: watch.Error, - Object: &status, - } -} - -func (wc *watchChan) sendError(err error) { - select { - case wc.errChan <- err: - case <-wc.ctx.Done(): - } -} - -func (wc *watchChan) sendEvent(e *event) { - if len(wc.incomingEventChan) == incomingBufSize { - klog.V(3).InfoS("Fast watcher, slow processing. Probably caused by slow decoding, user not receiving fast, or other processing logic", "incomingEvents", incomingBufSize, "objectType", wc.watcher.objectType, "groupResource", wc.watcher.groupResource) - } - select { - case wc.incomingEventChan <- e: - case <-wc.ctx.Done(): - } -} - -func (wc *watchChan) prepareObjs(e *event) (curObj runtime.Object, oldObj runtime.Object, err error) { - if e.isProgressNotify { - // progressNotify events doesn't contain neither current nor previous object version, - return nil, nil, nil - } - - if !e.isDeleted { - data, _, err := wc.watcher.transformer.TransformFromStorage(wc.ctx, e.value, authenticatedDataString(e.key)) - if err != nil { - return nil, nil, err - } - curObj, err = decodeObj(wc.watcher.codec, wc.watcher.versioner, data, e.rev) - if err != nil { - return nil, nil, err - } - } - // We need to decode prevValue, only if this is deletion event or - // the underlying filter doesn't accept all objects (otherwise we - // know that the filter for previous object will return true and - // we need the object only to compute whether it was filtered out - // before). - if len(e.prevValue) > 0 && (e.isDeleted || !wc.acceptAll()) { - data, _, err := wc.watcher.transformer.TransformFromStorage(wc.ctx, e.prevValue, authenticatedDataString(e.key)) - if err != nil { - return nil, nil, wc.watcher.transformIfCorruptObjectError(e, err) - } - // Note that this sends the *old* object with the etcd revision for the time at - // which it gets deleted. - oldObj, err = decodeObj(wc.watcher.codec, wc.watcher.versioner, data, e.rev) - if err != nil { - return nil, nil, wc.watcher.transformIfCorruptObjectError(e, err) - } - } - return curObj, oldObj, nil -} - -type corruptObjectDeletedError struct { - err error -} - -func (e *corruptObjectDeletedError) Error() string { - return fmt.Sprintf("saw a DELETED event, but object data is corrupt - %v", e.err) -} -func (e *corruptObjectDeletedError) Unwrap() error { return e.err } - -func (w *watcher) transformIfCorruptObjectError(e *event, err error) error { - var corruptObjErr *corruptObjectError - if !e.isDeleted || !errors.As(err, &corruptObjErr) { - return err - } - - // if we are here it means we received a DELETED event but the object - // associated with it is corrupt because we failed to transform or - // decode the data associated with the object. - // wrap the original error so we can send a proper watch Error event. - return &corruptObjectDeletedError{err: corruptObjErr} -} - -func decodeObj(codec runtime.Codec, versioner storage.Versioner, data []byte, rev int64) (_ runtime.Object, err error) { - obj, err := runtime.Decode(codec, []byte(data)) - if err != nil { - if fatalOnDecodeError { - // we are running in a test environment and thus an - // error here is due to a coder mistake if the defer - // does not catch it - panic(err) - } - return nil, err - } - // ensure resource version is set on the object we load from etcd - if err := versioner.UpdateObject(obj, uint64(rev)); err != nil { - return nil, fmt.Errorf("failure to version api object (%d) %#v: %v", rev, obj, err) - } - return obj, nil -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/feature/feature_support_checker.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/feature/feature_support_checker.go deleted file mode 100644 index 77f5ab05c..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/feature/feature_support_checker.go +++ /dev/null @@ -1,172 +0,0 @@ -/* -Copyright 2024 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package feature - -import ( - "context" - "fmt" - "sync" - "time" - - clientv3 "go.etcd.io/etcd/client/v3" - "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/version" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apiserver/pkg/storage" - "k8s.io/klog/v2" - "k8s.io/utils/ptr" -) - -var ( - // Define these static versions to use for checking version of etcd, issue on kubernetes #123192 - v3_4_31 = version.MustParseSemantic("3.4.31") - v3_5_0 = version.MustParseSemantic("3.5.0") - v3_5_13 = version.MustParseSemantic("3.5.13") - - // DefaultFeatureSupportChecker is a shared global etcd FeatureSupportChecker. - DefaultFeatureSupportChecker FeatureSupportChecker = newDefaultFeatureSupportChecker() -) - -// FeatureSupportChecker to define Supports functions. -type FeatureSupportChecker interface { - // Supports check if the feature is supported or not by checking internal cache. - // By default all calls to this function before calling CheckClient returns false. - // Returns true if all endpoints in etcd clients are supporting the feature. - // If client A supports and client B doesn't support the feature, the `Supports` will - // first return true at client A initializtion and then return false on client B - // initialzation, it can flip the support at runtime. - Supports(feature storage.Feature) bool - // CheckClient works with etcd client to recalcualte feature support and cache it internally. - // All etcd clients should support feature to cause `Supports` return true. - // If client A supports and client B doesn't support the feature, the `Supports` will - // first return true at client A initializtion and then return false on client B - // initialzation, it can flip the support at runtime. - CheckClient(ctx context.Context, c client, feature storage.Feature) -} - -type defaultFeatureSupportChecker struct { - lock sync.Mutex - progressNotifySupported *bool - checkingEndpoint map[string]struct{} -} - -func newDefaultFeatureSupportChecker() *defaultFeatureSupportChecker { - return &defaultFeatureSupportChecker{ - checkingEndpoint: make(map[string]struct{}), - } -} - -// Supports can check the featue from anywhere without storage if it was cached before. -func (f *defaultFeatureSupportChecker) Supports(feature storage.Feature) bool { - switch feature { - case storage.RequestWatchProgress: - f.lock.Lock() - defer f.lock.Unlock() - - return ptr.Deref(f.progressNotifySupported, false) - default: - runtime.HandleError(fmt.Errorf("feature %q is not implemented in DefaultFeatureSupportChecker", feature)) - return false - } -} - -// CheckClient accepts client and calculate the support per endpoint and caches it. -func (f *defaultFeatureSupportChecker) CheckClient(ctx context.Context, c client, feature storage.Feature) { - switch feature { - case storage.RequestWatchProgress: - f.checkClient(ctx, c) - default: - runtime.HandleError(fmt.Errorf("feature %q is not implemented in DefaultFeatureSupportChecker", feature)) - } -} - -func (f *defaultFeatureSupportChecker) checkClient(ctx context.Context, c client) { - // start with 10 ms, multiply by 2 each step, until 15 s and stays on 15 seconds. - delayFunc := wait.Backoff{ - Duration: 10 * time.Millisecond, - Cap: 15 * time.Second, - Factor: 2.0, - Steps: 11}.DelayFunc() - f.lock.Lock() - defer f.lock.Unlock() - for _, ep := range c.Endpoints() { - if _, found := f.checkingEndpoint[ep]; found { - continue - } - f.checkingEndpoint[ep] = struct{}{} - go func(ep string) { - defer runtime.HandleCrash() - err := delayFunc.Until(ctx, true, true, func(ctx context.Context) (done bool, err error) { - internalErr := f.clientSupportsRequestWatchProgress(ctx, c, ep) - return internalErr == nil, nil - }) - if err != nil { - klog.ErrorS(err, "Failed to check if RequestWatchProgress is supported by etcd after retrying") - } - }(ep) - } -} - -func (f *defaultFeatureSupportChecker) clientSupportsRequestWatchProgress(ctx context.Context, c client, ep string) error { - supported, err := endpointSupportsRequestWatchProgress(ctx, c, ep) - if err != nil { - return err - } - f.lock.Lock() - defer f.lock.Unlock() - - if !supported { - klog.Infof("RequestWatchProgress feature is not supported by %q endpoint", ep) - f.progressNotifySupported = ptr.To(false) - return nil - } - if f.progressNotifySupported == nil { - f.progressNotifySupported = ptr.To(true) - } - return nil -} - -// Sub interface of etcd client. -type client interface { - // Endpoints returns list of endpoints in etcd client. - Endpoints() []string - // Status retrieves the status information from the etcd client connected to the specified endpoint. - // It takes a context.Context parameter for cancellation or timeout control. - // It returns a clientv3.StatusResponse containing the status information or an error if the operation fails. - Status(ctx context.Context, endpoint string) (*clientv3.StatusResponse, error) -} - -// endpointSupportsRequestWatchProgress evaluates whether RequestWatchProgress supported by current version of etcd endpoint. -// Based on this issues: -// - https://github.com/etcd-io/etcd/issues/15220 - Fixed in etcd v3.4.25+ and v3.5.8+ -// - https://github.com/etcd-io/etcd/issues/17507 - Fixed in etcd v3.4.31+ and v3.5.13+ -func endpointSupportsRequestWatchProgress(ctx context.Context, c client, endpoint string) (bool, error) { - resp, err := c.Status(ctx, endpoint) - if err != nil { - return false, fmt.Errorf("failed checking etcd version, endpoint: %q: %w", endpoint, err) - } - ver, err := version.ParseSemantic(resp.Version) - if err != nil { - // Assume feature is not supported if etcd version cannot be parsed. - klog.ErrorS(err, "Failed to parse etcd version", "version", resp.Version) - return false, nil - } - if ver.LessThan(v3_4_31) || ver.AtLeast(v3_5_0) && ver.LessThan(v3_5_13) { - return false, nil - } - return true, nil -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/storagebackend/OWNERS b/e2e/vendor/k8s.io/apiserver/pkg/storage/storagebackend/OWNERS deleted file mode 100644 index 7b8dfb623..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/storagebackend/OWNERS +++ /dev/null @@ -1,5 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: - - smarterclayton - - wojtek-t diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/storagebackend/config.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/storagebackend/config.go deleted file mode 100644 index c948d6411..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/storagebackend/config.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package storagebackend - -import ( - "time" - - oteltrace "go.opentelemetry.io/otel/trace" - noopoteltrace "go.opentelemetry.io/otel/trace/noop" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apiserver/pkg/server/egressselector" - "k8s.io/apiserver/pkg/storage/etcd3" - "k8s.io/apiserver/pkg/storage/value" - flowcontrolrequest "k8s.io/apiserver/pkg/util/flowcontrol/request" -) - -const ( - StorageTypeUnset = "" - StorageTypeETCD2 = "etcd2" - StorageTypeETCD3 = "etcd3" - - DefaultCompactInterval = 5 * time.Minute - DefaultDBMetricPollInterval = 30 * time.Second - DefaultEventsHistoryWindow = 75 * time.Second - DefaultHealthcheckTimeout = 2 * time.Second - DefaultReadinessTimeout = 2 * time.Second -) - -// TransportConfig holds all connection related info, i.e. equal TransportConfig means equal servers we talk to. -type TransportConfig struct { - // ServerList is the list of storage servers to connect with. - ServerList []string - // TLS credentials - KeyFile string - CertFile string - TrustedCAFile string - // function to determine the egress dialer. (i.e. konnectivity server dialer) - EgressLookup egressselector.Lookup - // The TracerProvider can add tracing the connection - TracerProvider oteltrace.TracerProvider -} - -// Config is configuration for creating a storage backend. -type Config struct { - // Type defines the type of storage backend. Default ("") is "etcd3". - Type string - // Prefix is the prefix to all keys passed to storage.Interface methods. - Prefix string - // Transport holds all connection related info, i.e. equal TransportConfig means equal servers we talk to. - Transport TransportConfig - - Codec runtime.Codec - // EncodeVersioner is the same groupVersioner used to build the - // storage encoder. Given a list of kinds the input object might belong - // to, the EncodeVersioner outputs the gvk the object will be - // converted to before persisted in etcd. - EncodeVersioner runtime.GroupVersioner - // Transformer allows the value to be transformed prior to persisting into etcd. - Transformer value.Transformer - - // CompactionInterval is an interval of requesting compaction from apiserver. - // If the value is 0, no compaction will be issued. - CompactionInterval time.Duration - // CountMetricPollPeriod specifies how often should count metric be updated - CountMetricPollPeriod time.Duration - // DBMetricPollInterval specifies how often should storage backend metric be updated. - DBMetricPollInterval time.Duration - // EventsHistoryWindow specifies minimum history duration that storage is keeping. - EventsHistoryWindow time.Duration - // HealthcheckTimeout specifies the timeout used when checking health - HealthcheckTimeout time.Duration - // ReadycheckTimeout specifies the timeout used when checking readiness - ReadycheckTimeout time.Duration - - LeaseManagerConfig etcd3.LeaseManagerConfig - - // StorageObjectCountTracker is used to keep track of the total - // number of objects in the storage per resource. - StorageObjectCountTracker flowcontrolrequest.StorageObjectCountTracker -} - -// ConfigForResource is a Config specialized to a particular `schema.GroupResource` -type ConfigForResource struct { - // Config is the resource-independent configuration - Config - - // GroupResource is the relevant one - GroupResource schema.GroupResource -} - -// ForResource specializes to the given resource -func (config *Config) ForResource(resource schema.GroupResource) *ConfigForResource { - return &ConfigForResource{ - Config: *config, - GroupResource: resource, - } -} - -func NewDefaultConfig(prefix string, codec runtime.Codec) *Config { - return &Config{ - Prefix: prefix, - Codec: codec, - CompactionInterval: DefaultCompactInterval, - DBMetricPollInterval: DefaultDBMetricPollInterval, - EventsHistoryWindow: DefaultEventsHistoryWindow, - HealthcheckTimeout: DefaultHealthcheckTimeout, - ReadycheckTimeout: DefaultReadinessTimeout, - LeaseManagerConfig: etcd3.NewDefaultLeaseManagerConfig(), - Transport: TransportConfig{TracerProvider: noopoteltrace.NewTracerProvider()}, - } -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go deleted file mode 100644 index 49aeaec2b..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go +++ /dev/null @@ -1,503 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package factory - -import ( - "context" - "fmt" - "log" - "math/rand" - "net" - "net/url" - "os" - "path" - "strings" - "sync" - "time" - - grpcprom "github.com/grpc-ecosystem/go-grpc-prometheus" - "go.etcd.io/etcd/client/pkg/v3/logutil" - "go.etcd.io/etcd/client/pkg/v3/transport" - clientv3 "go.etcd.io/etcd/client/v3" - "go.etcd.io/etcd/client/v3/kubernetes" - "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" - "go.uber.org/zap" - "go.uber.org/zap/zapcore" - "golang.org/x/time/rate" - "google.golang.org/grpc" - "k8s.io/klog/v2" - - "k8s.io/apimachinery/pkg/runtime" - utilnet "k8s.io/apimachinery/pkg/util/net" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/wait" - genericfeatures "k8s.io/apiserver/pkg/features" - "k8s.io/apiserver/pkg/server/egressselector" - "k8s.io/apiserver/pkg/storage" - "k8s.io/apiserver/pkg/storage/etcd3" - "k8s.io/apiserver/pkg/storage/etcd3/metrics" - "k8s.io/apiserver/pkg/storage/storagebackend" - "k8s.io/apiserver/pkg/storage/value/encrypt/identity" - utilfeature "k8s.io/apiserver/pkg/util/feature" - "k8s.io/component-base/metrics/legacyregistry" - tracing "k8s.io/component-base/tracing" -) - -const ( - // The short keepalive timeout and interval have been chosen to aggressively - // detect a failed etcd server without introducing much overhead. - keepaliveTime = 30 * time.Second - keepaliveTimeout = 10 * time.Second - - // dialTimeout is the timeout for failing to establish a connection. - // It is set to 20 seconds as times shorter than that will cause TLS connections to fail - // on heavily loaded arm64 CPUs (issue #64649) - dialTimeout = 20 * time.Second - - dbMetricsMonitorJitter = 0.5 -) - -// TODO(negz): Stop using a package scoped logger. At the time of writing we're -// creating an etcd client for each CRD. We need to pass each etcd client a -// logger or each client will create its own, which comes with a significant -// memory cost (around 20% of the API server's memory when hundreds of CRDs are -// present). The correct fix here is to not create a client per CRD. See -// https://github.com/kubernetes/kubernetes/issues/111476 for more. -var etcd3ClientLogger *zap.Logger - -func init() { - // grpcprom auto-registers (via an init function) their client metrics, since we are opting out of - // using the global prometheus registry and using our own wrapped global registry, - // we need to explicitly register these metrics to our global registry here. - // For reference: https://github.com/kubernetes/kubernetes/pull/81387 - legacyregistry.RawMustRegister(grpcprom.DefaultClientMetrics) - dbMetricsMonitors = make(map[string]struct{}) - - l, err := logutil.CreateDefaultZapLogger(etcdClientDebugLevel()) - if err != nil { - l = zap.NewNop() - } - etcd3ClientLogger = l.Named("etcd-client") -} - -// etcdClientDebugLevel translates ETCD_CLIENT_DEBUG into zap log level. -// NOTE(negz): This is a copy of a private etcd client function: -// https://github.com/etcd-io/etcd/blob/v3.5.4/client/v3/logger.go#L47 -func etcdClientDebugLevel() zapcore.Level { - envLevel := os.Getenv("ETCD_CLIENT_DEBUG") - if envLevel == "" || envLevel == "true" { - return zapcore.InfoLevel - } - var l zapcore.Level - if err := l.Set(envLevel); err == nil { - log.Printf("Deprecated env ETCD_CLIENT_DEBUG value. Using default level: 'info'") - return zapcore.InfoLevel - } - return l -} - -func newETCD3HealthCheck(c storagebackend.Config, stopCh <-chan struct{}) (func() error, error) { - timeout := storagebackend.DefaultHealthcheckTimeout - if c.HealthcheckTimeout != time.Duration(0) { - timeout = c.HealthcheckTimeout - } - return newETCD3Check(c, timeout, stopCh) -} - -func newETCD3ReadyCheck(c storagebackend.Config, stopCh <-chan struct{}) (func() error, error) { - timeout := storagebackend.DefaultReadinessTimeout - if c.ReadycheckTimeout != time.Duration(0) { - timeout = c.ReadycheckTimeout - } - return newETCD3Check(c, timeout, stopCh) -} - -// atomic error acts as a cache for atomically store an error -// the error is only updated if the timestamp is more recent than -// current stored error. -type atomicLastError struct { - mu sync.RWMutex - err error - timestamp time.Time -} - -func (a *atomicLastError) Store(err error, t time.Time) { - a.mu.Lock() - defer a.mu.Unlock() - if a.timestamp.IsZero() || a.timestamp.Before(t) { - a.err = err - a.timestamp = t - } -} - -func (a *atomicLastError) Load() error { - a.mu.RLock() - defer a.mu.RUnlock() - return a.err -} - -func newETCD3Check(c storagebackend.Config, timeout time.Duration, stopCh <-chan struct{}) (func() error, error) { - // constructing the etcd v3 client blocks and times out if etcd is not available. - // retry in a loop in the background until we successfully create the client, storing the client or error encountered - - lock := sync.RWMutex{} - var prober *etcd3ProberMonitor - clientErr := fmt.Errorf("etcd client connection not yet established") - - go wait.PollImmediateUntil(time.Second, func() (bool, error) { - lock.Lock() - defer lock.Unlock() - newProber, err := newETCD3ProberMonitor(c) - // Ensure that server is already not shutting down. - select { - case <-stopCh: - if err == nil { - newProber.Close() - } - return true, nil - default: - } - if err != nil { - clientErr = err - return false, nil - } - prober = newProber - clientErr = nil - return true, nil - }, stopCh) - - // Close the client on shutdown. - go func() { - defer utilruntime.HandleCrash() - <-stopCh - - lock.Lock() - defer lock.Unlock() - if prober != nil { - prober.Close() - clientErr = fmt.Errorf("server is shutting down") - } - }() - - // limit to a request every half of the configured timeout with a maximum burst of one - // rate limited requests will receive the last request sent error (note: not the last received response) - limiter := rate.NewLimiter(rate.Every(timeout/2), 1) - // initial state is the clientErr - lastError := &atomicLastError{err: fmt.Errorf("etcd client connection not yet established")} - - return func() error { - // Given that client is closed on shutdown we hold the lock for - // the entire period of healthcheck call to ensure that client will - // not be closed during healthcheck. - // Given that healthchecks has a 2s timeout, worst case of blocking - // shutdown for additional 2s seems acceptable. - lock.RLock() - defer lock.RUnlock() - - if clientErr != nil { - return clientErr - } - if limiter.Allow() == false { - return lastError.Load() - } - ctx, cancel := context.WithTimeout(context.Background(), timeout) - defer cancel() - now := time.Now() - err := prober.Probe(ctx) - lastError.Store(err, now) - return err - }, nil -} - -func newETCD3ProberMonitor(c storagebackend.Config) (*etcd3ProberMonitor, error) { - client, err := newETCD3Client(c.Transport) - if err != nil { - return nil, err - } - return &etcd3ProberMonitor{ - client: client.Client, - prefix: c.Prefix, - endpoints: c.Transport.ServerList, - }, nil -} - -type etcd3ProberMonitor struct { - prefix string - endpoints []string - - mux sync.RWMutex - client *clientv3.Client - closed bool -} - -func (t *etcd3ProberMonitor) Close() error { - t.mux.Lock() - defer t.mux.Unlock() - if !t.closed { - t.closed = true - return t.client.Close() - } - return fmt.Errorf("closed") -} - -func (t *etcd3ProberMonitor) Probe(ctx context.Context) error { - t.mux.RLock() - defer t.mux.RUnlock() - if t.closed { - return fmt.Errorf("closed") - } - // See https://github.com/etcd-io/etcd/blob/c57f8b3af865d1b531b979889c602ba14377420e/etcdctl/ctlv3/command/ep_command.go#L118 - _, err := t.client.Get(ctx, path.Join("/", t.prefix, "health")) - if err != nil { - return fmt.Errorf("error getting data from etcd: %w", err) - } - return nil -} - -func (t *etcd3ProberMonitor) Monitor(ctx context.Context) (metrics.StorageMetrics, error) { - t.mux.RLock() - defer t.mux.RUnlock() - if t.closed { - return metrics.StorageMetrics{}, fmt.Errorf("closed") - } - status, err := t.client.Status(ctx, t.endpoints[rand.Int()%len(t.endpoints)]) - if err != nil { - return metrics.StorageMetrics{}, err - } - return metrics.StorageMetrics{ - Size: status.DbSize, - }, nil -} - -var newETCD3Client = func(c storagebackend.TransportConfig) (*kubernetes.Client, error) { - tlsInfo := transport.TLSInfo{ - CertFile: c.CertFile, - KeyFile: c.KeyFile, - TrustedCAFile: c.TrustedCAFile, - } - tlsConfig, err := tlsInfo.ClientConfig() - if err != nil { - return nil, err - } - // NOTE: Client relies on nil tlsConfig - // for non-secure connections, update the implicit variable - if len(c.CertFile) == 0 && len(c.KeyFile) == 0 && len(c.TrustedCAFile) == 0 { - tlsConfig = nil - } - networkContext := egressselector.Etcd.AsNetworkContext() - var egressDialer utilnet.DialFunc - if c.EgressLookup != nil { - egressDialer, err = c.EgressLookup(networkContext) - if err != nil { - return nil, err - } - } - dialOptions := []grpc.DialOption{ - grpc.WithBlock(), // block until the underlying connection is up - // use chained interceptors so that the default (retry and backoff) interceptors are added. - // otherwise they will be overwritten by the metric interceptor. - // - // these optional interceptors will be placed after the default ones. - // which seems to be what we want as the metrics will be collected on each attempt (retry) - grpc.WithChainUnaryInterceptor(grpcprom.UnaryClientInterceptor), - grpc.WithChainStreamInterceptor(grpcprom.StreamClientInterceptor), - } - if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.APIServerTracing) { - tracingOpts := []otelgrpc.Option{ - otelgrpc.WithMessageEvents(otelgrpc.ReceivedEvents, otelgrpc.SentEvents), - otelgrpc.WithPropagators(tracing.Propagators()), - otelgrpc.WithTracerProvider(c.TracerProvider), - } - // Even with Noop TracerProvider, the otelgrpc still handles context propagation. - // See https://github.com/open-telemetry/opentelemetry-go/tree/main/example/passthrough - dialOptions = append(dialOptions, - grpc.WithUnaryInterceptor(otelgrpc.UnaryClientInterceptor(tracingOpts...)), - grpc.WithStreamInterceptor(otelgrpc.StreamClientInterceptor(tracingOpts...))) - } - if egressDialer != nil { - dialer := func(ctx context.Context, addr string) (net.Conn, error) { - if strings.Contains(addr, "//") { - // etcd client prior to 3.5 passed URLs to dialer, normalize to address - u, err := url.Parse(addr) - if err != nil { - return nil, err - } - addr = u.Host - } - return egressDialer(ctx, "tcp", addr) - } - dialOptions = append(dialOptions, grpc.WithContextDialer(dialer)) - } - - cfg := clientv3.Config{ - DialTimeout: dialTimeout, - DialKeepAliveTime: keepaliveTime, - DialKeepAliveTimeout: keepaliveTimeout, - DialOptions: dialOptions, - Endpoints: c.ServerList, - TLS: tlsConfig, - Logger: etcd3ClientLogger, - } - - return kubernetes.New(cfg) -} - -type runningCompactor struct { - interval time.Duration - cancel context.CancelFunc - client *clientv3.Client - refs int -} - -var ( - // compactorsMu guards access to compactors map - compactorsMu sync.Mutex - compactors = map[string]*runningCompactor{} - // dbMetricsMonitorsMu guards access to dbMetricsMonitors map - dbMetricsMonitorsMu sync.Mutex - dbMetricsMonitors map[string]struct{} -) - -// startCompactorOnce start one compactor per transport. If the interval get smaller on repeated calls, the -// compactor is replaced. A destroy func is returned. If all destroy funcs with the same transport are called, -// the compactor is stopped. -func startCompactorOnce(c storagebackend.TransportConfig, interval time.Duration) (func(), error) { - compactorsMu.Lock() - defer compactorsMu.Unlock() - - if interval == 0 { - // short circuit, if the compaction request from apiserver is disabled - return func() {}, nil - } - key := fmt.Sprintf("%v", c) // gives: {[server1 server2] keyFile certFile caFile} - if compactor, foundBefore := compactors[key]; !foundBefore || compactor.interval > interval { - client, err := newETCD3Client(c) - if err != nil { - return nil, err - } - compactorClient := client.Client - - if foundBefore { - // replace compactor - compactor.cancel() - compactor.client.Close() - } else { - // start new compactor - compactor = &runningCompactor{} - compactors[key] = compactor - } - - ctx, cancel := context.WithCancel(context.Background()) - - compactor.interval = interval - compactor.cancel = cancel - compactor.client = compactorClient - - etcd3.StartCompactor(ctx, compactorClient, interval) - } - - compactors[key].refs++ - - return func() { - compactorsMu.Lock() - defer compactorsMu.Unlock() - - compactor := compactors[key] - compactor.refs-- - if compactor.refs == 0 { - compactor.cancel() - compactor.client.Close() - delete(compactors, key) - } - }, nil -} - -func newETCD3Storage(c storagebackend.ConfigForResource, newFunc, newListFunc func() runtime.Object, resourcePrefix string) (storage.Interface, DestroyFunc, error) { - stopCompactor, err := startCompactorOnce(c.Transport, c.CompactionInterval) - if err != nil { - return nil, nil, err - } - - client, err := newETCD3Client(c.Transport) - if err != nil { - stopCompactor() - return nil, nil, err - } - - // decorate the KV instance so we can track etcd latency per request. - client.KV = etcd3.NewETCDLatencyTracker(client.KV) - - stopDBSizeMonitor, err := startDBSizeMonitorPerEndpoint(client.Client, c.DBMetricPollInterval) - if err != nil { - return nil, nil, err - } - - var once sync.Once - destroyFunc := func() { - // we know that storage destroy funcs are called multiple times (due to reuse in subresources). - // Hence, we only destroy once. - // TODO: fix duplicated storage destroy calls higher level - once.Do(func() { - stopCompactor() - stopDBSizeMonitor() - client.Close() - }) - } - transformer := c.Transformer - if transformer == nil { - transformer = identity.NewEncryptCheckTransformer() - } - - versioner := storage.APIObjectVersioner{} - decoder := etcd3.NewDefaultDecoder(c.Codec, versioner) - store := etcd3.New(client, c.Codec, newFunc, newListFunc, c.Prefix, resourcePrefix, c.GroupResource, transformer, c.LeaseManagerConfig, decoder, versioner) - return store, destroyFunc, nil -} - -// startDBSizeMonitorPerEndpoint starts a loop to monitor etcd database size and update the -// corresponding metric etcd_db_total_size_in_bytes for each etcd server endpoint. -// Deprecated: Will be replaced with newETCD3ProberMonitor -func startDBSizeMonitorPerEndpoint(client *clientv3.Client, interval time.Duration) (func(), error) { - if interval == 0 { - return func() {}, nil - } - dbMetricsMonitorsMu.Lock() - defer dbMetricsMonitorsMu.Unlock() - - ctx, cancel := context.WithCancel(context.Background()) - for _, ep := range client.Endpoints() { - if _, found := dbMetricsMonitors[ep]; found { - continue - } - dbMetricsMonitors[ep] = struct{}{} - endpoint := ep - klog.V(4).Infof("Start monitoring storage db size metric for endpoint %s with polling interval %v", endpoint, interval) - go wait.JitterUntilWithContext(ctx, func(context.Context) { - epStatus, err := client.Maintenance.Status(ctx, endpoint) - if err != nil { - klog.V(4).Infof("Failed to get storage db size for ep %s: %v", endpoint, err) - metrics.UpdateEtcdDbSize(endpoint, -1) - } else { - metrics.UpdateEtcdDbSize(endpoint, epStatus.DbSize) - } - }, interval, dbMetricsMonitorJitter, true) - } - - return func() { - cancel() - }, nil -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/factory.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/factory.go deleted file mode 100644 index 2bf3727e8..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/factory.go +++ /dev/null @@ -1,93 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package factory - -import ( - "context" - "fmt" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apiserver/pkg/storage" - "k8s.io/apiserver/pkg/storage/etcd3/metrics" - "k8s.io/apiserver/pkg/storage/storagebackend" -) - -// DestroyFunc is to destroy any resources used by the storage returned in Create() together. -type DestroyFunc func() - -// Create creates a storage backend based on given config. -func Create(c storagebackend.ConfigForResource, newFunc, newListFunc func() runtime.Object, resourcePrefix string) (storage.Interface, DestroyFunc, error) { - switch c.Type { - case storagebackend.StorageTypeETCD2: - return nil, nil, fmt.Errorf("%s is no longer a supported storage backend", c.Type) - case storagebackend.StorageTypeUnset, storagebackend.StorageTypeETCD3: - return newETCD3Storage(c, newFunc, newListFunc, resourcePrefix) - default: - return nil, nil, fmt.Errorf("unknown storage type: %s", c.Type) - } -} - -// CreateHealthCheck creates a healthcheck function based on given config. -func CreateHealthCheck(c storagebackend.Config, stopCh <-chan struct{}) (func() error, error) { - switch c.Type { - case storagebackend.StorageTypeETCD2: - return nil, fmt.Errorf("%s is no longer a supported storage backend", c.Type) - case storagebackend.StorageTypeUnset, storagebackend.StorageTypeETCD3: - return newETCD3HealthCheck(c, stopCh) - default: - return nil, fmt.Errorf("unknown storage type: %s", c.Type) - } -} - -func CreateReadyCheck(c storagebackend.Config, stopCh <-chan struct{}) (func() error, error) { - switch c.Type { - case storagebackend.StorageTypeETCD2: - return nil, fmt.Errorf("%s is no longer a supported storage backend", c.Type) - case storagebackend.StorageTypeUnset, storagebackend.StorageTypeETCD3: - return newETCD3ReadyCheck(c, stopCh) - default: - return nil, fmt.Errorf("unknown storage type: %s", c.Type) - } -} - -func CreateProber(c storagebackend.Config) (Prober, error) { - switch c.Type { - case storagebackend.StorageTypeETCD2: - return nil, fmt.Errorf("%s is no longer a supported storage backend", c.Type) - case storagebackend.StorageTypeUnset, storagebackend.StorageTypeETCD3: - return newETCD3ProberMonitor(c) - default: - return nil, fmt.Errorf("unknown storage type: %s", c.Type) - } -} - -func CreateMonitor(c storagebackend.Config) (metrics.Monitor, error) { - switch c.Type { - case storagebackend.StorageTypeETCD2: - return nil, fmt.Errorf("%s is no longer a supported storage backend", c.Type) - case storagebackend.StorageTypeUnset, storagebackend.StorageTypeETCD3: - return newETCD3ProberMonitor(c) - default: - return nil, fmt.Errorf("unknown storage type: %s", c.Type) - } -} - -// Prober is an interface that defines the Probe function for doing etcd readiness/liveness checks. -type Prober interface { - Probe(ctx context.Context) error - Close() error -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/OWNERS b/e2e/vendor/k8s.io/apiserver/pkg/storage/value/OWNERS deleted file mode 100644 index d2ea8ec60..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/OWNERS +++ /dev/null @@ -1,8 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - sig-auth-encryption-at-rest-approvers -reviewers: - - sig-auth-encryption-at-rest-reviewers -labels: - - sig/auth diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/aes.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/aes.go deleted file mode 100644 index 39469e9c6..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/aes.go +++ /dev/null @@ -1,273 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package aes transforms values for storage at rest using AES-GCM. -package aes - -import ( - "bytes" - "context" - "crypto/aes" - "crypto/cipher" - "crypto/rand" - "encoding/binary" - "errors" - "fmt" - "io" - "sync/atomic" - "time" - - "k8s.io/apiserver/pkg/storage/value" - "k8s.io/klog/v2" -) - -// commonSize is the length of various security sensitive byte slices such as encryption keys. -// Do not change this value. It would be a backward incompatible change. -const commonSize = 32 - -const keySizeCounterNonceGCM = commonSize - -// NewGCMTransformerWithUniqueKeyUnsafe is the same as NewGCMTransformer but is unsafe for general -// use because it makes assumptions about the key underlying the block cipher. Specifically, -// it uses a 96-bit nonce where the first 32 bits are random data and the remaining 64 bits are -// a monotonically incrementing atomic counter. This means that the key must be randomly generated -// on process startup and must never be used for encryption outside the lifetime of the process. -// Unlike NewGCMTransformer, this function is immune to the birthday attack and thus the key can -// be used for 2^64-1 writes without rotation. Furthermore, cryptographic wear out of AES-GCM with -// a sequential nonce occurs after 2^64 encryptions, which is not a concern for our use cases. -// Even if that occurs, the nonce counter would overflow and crash the process. We have no concerns -// around plaintext length because all stored items are small (less than 2 MB). To prevent the -// chance of the block cipher being accidentally re-used, it is not taken in as input. Instead, -// a new random key is generated and returned on every invocation of this function. This key is -// used as the input to the block cipher. If the key is stored and retrieved at a later point, -// it can be passed to NewGCMTransformer(aes.NewCipher(key)) to construct a transformer capable -// of decrypting values encrypted by this transformer (that transformer must not be used for encryption). -func NewGCMTransformerWithUniqueKeyUnsafe() (value.Transformer, []byte, error) { - key, err := GenerateKey(keySizeCounterNonceGCM) - if err != nil { - return nil, nil, err - } - block, err := aes.NewCipher(key) - if err != nil { - return nil, nil, err - } - - nonceGen := &nonceGenerator{ - // we start the nonce counter at one billion so that we are - // guaranteed to detect rollover across different go routines - zero: 1_000_000_000, - fatal: die, - } - nonceGen.nonce.Add(nonceGen.zero) - - transformer, err := newGCMTransformerWithUniqueKeyUnsafe(block, nonceGen) - if err != nil { - return nil, nil, err - } - return transformer, key, nil -} - -func newGCMTransformerWithUniqueKeyUnsafe(block cipher.Block, nonceGen *nonceGenerator) (value.Transformer, error) { - aead, err := newGCM(block) - if err != nil { - return nil, err - } - - nonceFunc := func(b []byte) error { - // we only need 8 bytes to store our 64 bit incrementing nonce - // instead of leaving the unused bytes as zeros, set those to random bits - // this mostly protects us from weird edge cases like a VM restore that rewinds our atomic counter - randNonceSize := len(b) - 8 - - if err := randomNonce(b[:randNonceSize]); err != nil { - return err - } - - nonceGen.next(b[randNonceSize:]) - - return nil - } - - return &gcm{aead: aead, nonceFunc: nonceFunc}, nil -} - -func randomNonce(b []byte) error { - _, err := rand.Read(b) - return err -} - -type nonceGenerator struct { - // even at one million encryptions per second, this counter is enough for half a million years - // using this struct avoids alignment bugs: https://pkg.go.dev/sync/atomic#pkg-note-BUG - nonce atomic.Uint64 - zero uint64 - fatal func(msg string) -} - -func (n *nonceGenerator) next(b []byte) { - incrementingNonce := n.nonce.Add(1) - if incrementingNonce <= n.zero { - // this should never happen, and is unrecoverable if it does - n.fatal("aes-gcm detected nonce overflow - cryptographic wear out has occurred") - } - binary.LittleEndian.PutUint64(b, incrementingNonce) -} - -func die(msg string) { - // nolint:logcheck // we want the stack traces, log flushing, and process exiting logic from FatalDepth - klog.FatalDepth(1, msg) -} - -// GenerateKey generates a random key using system randomness. -func GenerateKey(length int) (key []byte, err error) { - defer func(start time.Time) { - value.RecordDataKeyGeneration(start, err) - }(time.Now()) - key = make([]byte, length) - if _, err = rand.Read(key); err != nil { - return nil, err - } - - return key, nil -} - -// NewGCMTransformer takes the given block cipher and performs encryption and decryption on the given data. -// It implements AEAD encryption of the provided values given a cipher.Block algorithm. -// The authenticated data provided as part of the value.Context method must match when the same -// value is set to and loaded from storage. In order to ensure that values cannot be copied by -// an attacker from a location under their control, use characteristics of the storage location -// (such as the etcd key) as part of the authenticated data. -// -// Because this mode requires a generated IV and IV reuse is a known weakness of AES-GCM, keys -// must be rotated before a birthday attack becomes feasible. NIST SP 800-38D -// (http://csrc.nist.gov/publications/nistpubs/800-38D/SP-800-38D.pdf) recommends using the same -// key with random 96-bit nonces (the default nonce length) no more than 2^32 times, and -// therefore transformers using this implementation *must* ensure they allow for frequent key -// rotation. Future work should include investigation of AES-GCM-SIV as an alternative to -// random nonces. -func NewGCMTransformer(block cipher.Block) (value.Transformer, error) { - aead, err := newGCM(block) - if err != nil { - return nil, err - } - - return &gcm{aead: aead, nonceFunc: randomNonce}, nil -} - -func newGCM(block cipher.Block) (cipher.AEAD, error) { - aead, err := cipher.NewGCM(block) - if err != nil { - return nil, err - } - if nonceSize := aead.NonceSize(); nonceSize != 12 { // all data in etcd will be broken if this ever changes - return nil, fmt.Errorf("crypto/cipher.NewGCM returned unexpected nonce size: %d", nonceSize) - } - return aead, nil -} - -type gcm struct { - aead cipher.AEAD - nonceFunc func([]byte) error -} - -func (t *gcm) TransformFromStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, bool, error) { - nonceSize := t.aead.NonceSize() - if len(data) < nonceSize { - return nil, false, errors.New("the stored data was shorter than the required size") - } - result, err := t.aead.Open(nil, data[:nonceSize], data[nonceSize:], dataCtx.AuthenticatedData()) - return result, false, err -} - -func (t *gcm) TransformToStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, error) { - nonceSize := t.aead.NonceSize() - result := make([]byte, nonceSize+t.aead.Overhead()+len(data)) - - if err := t.nonceFunc(result[:nonceSize]); err != nil { - return nil, fmt.Errorf("failed to write nonce for AES-GCM: %w", err) - } - - cipherText := t.aead.Seal(result[nonceSize:nonceSize], result[:nonceSize], data, dataCtx.AuthenticatedData()) - return result[:nonceSize+len(cipherText)], nil -} - -// cbc implements encryption at rest of the provided values given a cipher.Block algorithm. -type cbc struct { - block cipher.Block -} - -// NewCBCTransformer takes the given block cipher and performs encryption and decryption on the given -// data. -func NewCBCTransformer(block cipher.Block) value.Transformer { - return &cbc{block: block} -} - -var ( - errInvalidBlockSize = errors.New("the stored data is not a multiple of the block size") - errInvalidPKCS7Data = errors.New("invalid PKCS7 data (empty or not padded)") - errInvalidPKCS7Padding = errors.New("invalid padding on input") -) - -func (t *cbc) TransformFromStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, bool, error) { - blockSize := aes.BlockSize - if len(data) < blockSize { - return nil, false, errors.New("the stored data was shorter than the required size") - } - iv := data[:blockSize] - data = data[blockSize:] - - if len(data)%blockSize != 0 { - return nil, false, errInvalidBlockSize - } - - result := make([]byte, len(data)) - copy(result, data) - mode := cipher.NewCBCDecrypter(t.block, iv) - mode.CryptBlocks(result, result) - - // remove and verify PKCS#7 padding for CBC - c := result[len(result)-1] - paddingSize := int(c) - size := len(result) - paddingSize - if paddingSize == 0 || paddingSize > len(result) { - return nil, false, errInvalidPKCS7Data - } - for i := 0; i < paddingSize; i++ { - if result[size+i] != c { - return nil, false, errInvalidPKCS7Padding - } - } - - return result[:size], false, nil -} - -func (t *cbc) TransformToStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, error) { - blockSize := aes.BlockSize - paddingSize := blockSize - (len(data) % blockSize) - result := make([]byte, blockSize+len(data)+paddingSize) - iv := result[:blockSize] - if _, err := io.ReadFull(rand.Reader, iv); err != nil { - return nil, errors.New("unable to read sufficient random bytes") - } - copy(result[blockSize:], data) - - // add PKCS#7 padding for CBC - copy(result[blockSize+len(data):], bytes.Repeat([]byte{byte(paddingSize)}, paddingSize)) - - mode := cipher.NewCBCEncrypter(t.block, iv) - mode.CryptBlocks(result[blockSize:], result[blockSize:]) - return result, nil -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/aes_extended_nonce.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/aes_extended_nonce.go deleted file mode 100644 index cf8f39305..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/aes_extended_nonce.go +++ /dev/null @@ -1,186 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package aes - -import ( - "bytes" - "context" - "crypto/aes" - "crypto/sha256" - "errors" - "fmt" - "io" - "time" - - "golang.org/x/crypto/hkdf" - - "k8s.io/apiserver/pkg/storage/value" - "k8s.io/utils/clock" -) - -const ( - // cacheTTL is the TTL of KDF cache entries. We assume that the value.Context.AuthenticatedData - // for every call is the etcd storage path of the associated resource, and use that as the primary - // cache key (with a secondary check that confirms that the info matches). Thus if a client - // is constantly creating resources with new names (and thus new paths), they will keep adding new - // entries to the cache for up to this TTL before the GC logic starts deleting old entries. Each - // entry is ~300 bytes in size, so even a malicious client will be bounded in the overall memory - // it can consume. - cacheTTL = 10 * time.Minute - - derivedKeySizeExtendedNonceGCM = commonSize - infoSizeExtendedNonceGCM - MinSeedSizeExtendedNonceGCM -) - -// NewHKDFExtendedNonceGCMTransformer is the same as NewGCMTransformer but trades storage, -// memory and CPU to work around the limitations of AES-GCM's 12 byte nonce size. The input seed -// is assumed to be a cryptographically strong slice of MinSeedSizeExtendedNonceGCM+ random bytes. -// Unlike NewGCMTransformer, this function is immune to the birthday attack because a new key is generated -// per encryption via a key derivation function: KDF(seed, random_bytes) -> key. The derived key is -// only used once as an AES-GCM key with a random 12 byte nonce. This avoids any concerns around -// cryptographic wear out (by either number of encryptions or the amount of data being encrypted). -// Speaking on the cryptographic safety, the limit on the number of operations that can be preformed -// with a single seed with derived keys and randomly generated nonces is not practically reachable. -// Thus, the scheme does not impose any specific requirements on the seed rotation schedule. -// Reusing the same seed is safe to do over time and across process restarts. Whenever a new -// seed is needed, the caller should generate it via GenerateKey(MinSeedSizeExtendedNonceGCM). -// In regard to KMSv2, organization standards or compliance policies around rotation may require -// that the seed be rotated at some interval. This can be implemented externally by rotating -// the key encryption key via a key ID change. -func NewHKDFExtendedNonceGCMTransformer(seed []byte) (value.Transformer, error) { - if seedLen := len(seed); seedLen < MinSeedSizeExtendedNonceGCM { - return nil, fmt.Errorf("invalid seed length %d used for key generation", seedLen) - } - return &extendedNonceGCM{ - seed: seed, - cache: newSimpleCache(clock.RealClock{}, cacheTTL), - }, nil -} - -type extendedNonceGCM struct { - seed []byte - cache *simpleCache -} - -func (e *extendedNonceGCM) TransformFromStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, bool, error) { - if len(data) < infoSizeExtendedNonceGCM { - return nil, false, errors.New("the stored data was shorter than the required size") - } - - info := data[:infoSizeExtendedNonceGCM] - - transformer, err := e.derivedKeyTransformer(info, dataCtx, false) - if err != nil { - return nil, false, fmt.Errorf("failed to derive read key from KDF: %w", err) - } - - return transformer.TransformFromStorage(ctx, data, dataCtx) -} - -func (e *extendedNonceGCM) TransformToStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, error) { - info := make([]byte, infoSizeExtendedNonceGCM) - if err := randomNonce(info); err != nil { - return nil, fmt.Errorf("failed to generate info for KDF: %w", err) - } - - transformer, err := e.derivedKeyTransformer(info, dataCtx, true) - if err != nil { - return nil, fmt.Errorf("failed to derive write key from KDF: %w", err) - } - - return transformer.TransformToStorage(ctx, data, dataCtx) -} - -func (e *extendedNonceGCM) derivedKeyTransformer(info []byte, dataCtx value.Context, write bool) (value.Transformer, error) { - if !write { // no need to check cache on write since we always generate a new transformer - if transformer := e.cache.get(info, dataCtx); transformer != nil { - return transformer, nil - } - - // on read, this is a subslice of a much larger slice and we do not want to hold onto that larger slice - info = bytes.Clone(info) - } - - key, err := e.sha256KDFExpandOnly(info) - if err != nil { - return nil, fmt.Errorf("failed to KDF expand seed with info: %w", err) - } - - transformer, err := newGCMTransformerWithInfo(key, info) - if err != nil { - return nil, fmt.Errorf("failed to build transformer with KDF derived key: %w", err) - } - - e.cache.set(dataCtx, transformer) - - return transformer, nil -} - -func (e *extendedNonceGCM) sha256KDFExpandOnly(info []byte) ([]byte, error) { - kdf := hkdf.Expand(sha256.New, e.seed, info) - - derivedKey := make([]byte, derivedKeySizeExtendedNonceGCM) - if _, err := io.ReadFull(kdf, derivedKey); err != nil { - return nil, fmt.Errorf("failed to read a derived key from KDF: %w", err) - } - - return derivedKey, nil -} - -func newGCMTransformerWithInfo(key, info []byte) (*transformerWithInfo, error) { - block, err := aes.NewCipher(key) - if err != nil { - return nil, err - } - - transformer, err := NewGCMTransformer(block) - if err != nil { - return nil, err - } - - return &transformerWithInfo{transformer: transformer, info: info}, nil -} - -type transformerWithInfo struct { - transformer value.Transformer - // info are extra opaque bytes prepended to the writes from transformer and stripped from reads. - // currently info is used to generate a key via KDF(seed, info) -> key - // and transformer is the output of NewGCMTransformer(aes.NewCipher(key)) - info []byte -} - -func (t *transformerWithInfo) TransformFromStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, bool, error) { - if !bytes.HasPrefix(data, t.info) { - return nil, false, errors.New("the stored data is missing the required info prefix") - } - - return t.transformer.TransformFromStorage(ctx, data[len(t.info):], dataCtx) -} - -func (t *transformerWithInfo) TransformToStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, error) { - out, err := t.transformer.TransformToStorage(ctx, data, dataCtx) - if err != nil { - return nil, err - } - - outWithInfo := make([]byte, 0, len(out)+len(t.info)) - outWithInfo = append(outWithInfo, t.info...) - outWithInfo = append(outWithInfo, out...) - - return outWithInfo, nil -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/cache.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/cache.go deleted file mode 100644 index c2551a2fb..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/cache.go +++ /dev/null @@ -1,91 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package aes - -import ( - "bytes" - "time" - "unsafe" - - utilcache "k8s.io/apimachinery/pkg/util/cache" - "k8s.io/apiserver/pkg/storage/value" - "k8s.io/utils/clock" -) - -type simpleCache struct { - cache *utilcache.Expiring - ttl time.Duration -} - -func newSimpleCache(clock clock.Clock, ttl time.Duration) *simpleCache { - cache := utilcache.NewExpiringWithClock(clock) - // "Stale" entries are always valid for us because the TTL is just used to prevent - // unbounded growth on the cache - for a given info the transformer is always the same. - // The key always corresponds to the exact same value, with the caveat that - // since we use the value.Context.AuthenticatedData to overwrite old keys, - // we always have to check that the info matches (to validate the transformer is correct). - cache.AllowExpiredGet = true - return &simpleCache{ - cache: cache, - ttl: ttl, - } -} - -// given a key, return the transformer, or nil if it does not exist in the cache -func (c *simpleCache) get(info []byte, dataCtx value.Context) *transformerWithInfo { - val, ok := c.cache.Get(keyFunc(dataCtx)) - if !ok { - return nil - } - - transformer := val.(*transformerWithInfo) - - if !bytes.Equal(transformer.info, info) { - return nil - } - - return transformer -} - -// set caches the record for the key -func (c *simpleCache) set(dataCtx value.Context, transformer *transformerWithInfo) { - if dataCtx == nil || len(dataCtx.AuthenticatedData()) == 0 { - panic("authenticated data must not be empty") - } - if transformer == nil { - panic("transformer must not be nil") - } - if len(transformer.info) == 0 { - panic("info must not be empty") - } - c.cache.Set(keyFunc(dataCtx), transformer, c.ttl) -} - -func keyFunc(dataCtx value.Context) string { - return toString(dataCtx.AuthenticatedData()) -} - -// toString performs unholy acts to avoid allocations -func toString(b []byte) string { - // unsafe.SliceData relies on cap whereas we want to rely on len - if len(b) == 0 { - return "" - } - // Copied from go 1.20.1 strings.Builder.String - // https://github.com/golang/go/blob/202a1a57064127c3f19d96df57b9f9586145e21c/src/strings/builder.go#L48 - return unsafe.String(unsafe.SliceData(b), len(b)) -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope.go deleted file mode 100644 index 4bb18ee8b..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/envelope.go +++ /dev/null @@ -1,202 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package envelope transforms values for storage at rest using a Envelope provider -package envelope - -import ( - "context" - "crypto/aes" - "crypto/cipher" - "crypto/rand" - "encoding/base64" - "fmt" - "time" - - "k8s.io/apiserver/pkg/storage/value" - "k8s.io/apiserver/pkg/storage/value/encrypt/envelope/metrics" - "k8s.io/utils/lru" - - "golang.org/x/crypto/cryptobyte" -) - -func init() { - value.RegisterMetrics() - metrics.RegisterMetrics() -} - -// Service allows encrypting and decrypting data using an external Key Management Service. -type Service interface { - // Decrypt a given bytearray to obtain the original data as bytes. - Decrypt(data []byte) ([]byte, error) - // Encrypt bytes to a ciphertext. - Encrypt(data []byte) ([]byte, error) -} - -type envelopeTransformer struct { - envelopeService Service - - // transformers is a thread-safe LRU cache which caches decrypted DEKs indexed by their encrypted form. - transformers *lru.Cache - - // baseTransformerFunc creates a new transformer for encrypting the data with the DEK. - baseTransformerFunc func(cipher.Block) (value.Transformer, error) - - cacheSize int - cacheEnabled bool -} - -// NewEnvelopeTransformer returns a transformer which implements a KEK-DEK based envelope encryption scheme. -// It uses envelopeService to encrypt and decrypt DEKs. Respective DEKs (in encrypted form) are prepended to -// the data items they encrypt. A cache (of size cacheSize) is maintained to store the most recently -// used decrypted DEKs in memory. -func NewEnvelopeTransformer(envelopeService Service, cacheSize int, baseTransformerFunc func(cipher.Block) (value.Transformer, error)) value.Transformer { - var ( - cache *lru.Cache - ) - - if cacheSize > 0 { - cache = lru.New(cacheSize) - } - return &envelopeTransformer{ - envelopeService: envelopeService, - transformers: cache, - baseTransformerFunc: baseTransformerFunc, - cacheEnabled: cacheSize > 0, - cacheSize: cacheSize, - } -} - -// TransformFromStorage decrypts data encrypted by this transformer using envelope encryption. -func (t *envelopeTransformer) TransformFromStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, bool, error) { - metrics.RecordArrival(metrics.FromStorageLabel, time.Now()) - - // Read the 16 bit length-of-DEK encoded at the start of the encrypted DEK. 16 bits can - // represent a maximum key length of 65536 bytes. We are using a 256 bit key, whose - // length cannot fit in 8 bits (1 byte). Thus, we use 16 bits (2 bytes) to store the length. - var encKey cryptobyte.String - s := cryptobyte.String(data) - if ok := s.ReadUint16LengthPrefixed(&encKey); !ok { - return nil, false, fmt.Errorf("invalid data encountered by envelope transformer: failed to read uint16 length prefixed data") - } - - encData := []byte(s) - - // Look up the decrypted DEK from cache or Envelope. - transformer := t.getTransformer(encKey) - if transformer == nil { - if t.cacheEnabled { - value.RecordCacheMiss() - } - key, err := t.envelopeService.Decrypt(encKey) - if err != nil { - // Do NOT wrap this err using fmt.Errorf() or similar functions - // because this gRPC status error has useful error code when - // record the metric. - return nil, false, err - } - - transformer, err = t.addTransformer(encKey, key) - if err != nil { - return nil, false, err - } - } - - return transformer.TransformFromStorage(ctx, encData, dataCtx) -} - -// TransformToStorage encrypts data to be written to disk using envelope encryption. -func (t *envelopeTransformer) TransformToStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, error) { - metrics.RecordArrival(metrics.ToStorageLabel, time.Now()) - newKey, err := generateKey(32) - if err != nil { - return nil, err - } - - encKey, err := t.envelopeService.Encrypt(newKey) - if err != nil { - // Do NOT wrap this err using fmt.Errorf() or similar functions - // because this gRPC status error has useful error code when - // record the metric. - return nil, err - } - - transformer, err := t.addTransformer(encKey, newKey) - if err != nil { - return nil, err - } - - result, err := transformer.TransformToStorage(ctx, data, dataCtx) - if err != nil { - return nil, err - } - // Append the length of the encrypted DEK as the first 2 bytes. - b := cryptobyte.NewBuilder(nil) - b.AddUint16LengthPrefixed(func(b *cryptobyte.Builder) { - b.AddBytes([]byte(encKey)) - }) - b.AddBytes(result) - - return b.Bytes() -} - -var _ value.Transformer = &envelopeTransformer{} - -// addTransformer inserts a new transformer to the Envelope cache of DEKs for future reads. -func (t *envelopeTransformer) addTransformer(encKey []byte, key []byte) (value.Transformer, error) { - block, err := aes.NewCipher(key) - if err != nil { - return nil, err - } - transformer, err := t.baseTransformerFunc(block) - if err != nil { - return nil, err - } - - // Use base64 of encKey as the key into the cache because hashicorp/golang-lru - // cannot hash []uint8. - if t.cacheEnabled { - t.transformers.Add(base64.StdEncoding.EncodeToString(encKey), transformer) - metrics.RecordDekCacheFillPercent(float64(t.transformers.Len()) / float64(t.cacheSize)) - } - return transformer, nil -} - -// getTransformer fetches the transformer corresponding to encKey from cache, if it exists. -func (t *envelopeTransformer) getTransformer(encKey []byte) value.Transformer { - if !t.cacheEnabled { - return nil - } - - _transformer, found := t.transformers.Get(base64.StdEncoding.EncodeToString(encKey)) - if found { - return _transformer.(value.Transformer) - } - return nil -} - -// generateKey generates a random key using system randomness. -func generateKey(length int) (key []byte, err error) { - defer func(start time.Time) { - value.RecordDataKeyGeneration(start, err) - }(time.Now()) - key = make([]byte, length) - if _, err = rand.Read(key); err != nil { - return nil, err - } - - return key, nil -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service.go deleted file mode 100644 index b2a5fd145..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/grpc_service.go +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package envelope transforms values for storage at rest using a Envelope provider -package envelope - -import ( - "context" - "fmt" - "net" - "sync" - "time" - - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" - - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/klog/v2" - kmsapi "k8s.io/kms/apis/v1beta1" - "k8s.io/kms/pkg/util" -) - -const ( - // unixProtocol is the only supported protocol for remote KMS provider. - unixProtocol = "unix" - // Current version for the protocol interface definition. - kmsapiVersion = "v1beta1" - - versionErrorf = "KMS provider api version %s is not supported, only %s is supported now" -) - -// The gRPC implementation for envelope.Service. -type gRPCService struct { - kmsClient kmsapi.KeyManagementServiceClient - connection *grpc.ClientConn - callTimeout time.Duration - mux sync.RWMutex - versionChecked bool -} - -// NewGRPCService returns an envelope.Service which use gRPC to communicate the remote KMS provider. -func NewGRPCService(ctx context.Context, endpoint string, callTimeout time.Duration) (Service, error) { - klog.V(4).InfoS("Configure KMS provider", "endpoint", endpoint) - - addr, err := util.ParseEndpoint(endpoint) - if err != nil { - return nil, err - } - - s := &gRPCService{callTimeout: callTimeout} - s.connection, err = grpc.Dial( - addr, - grpc.WithTransportCredentials(insecure.NewCredentials()), - grpc.WithUnaryInterceptor(s.interceptor), - grpc.WithDefaultCallOptions(grpc.WaitForReady(true)), - grpc.WithContextDialer( - func(context.Context, string) (net.Conn, error) { - // Ignoring addr and timeout arguments: - // addr - comes from the closure - c, err := net.DialUnix(unixProtocol, nil, &net.UnixAddr{Name: addr}) - if err != nil { - klog.ErrorS(err, "failed to create connection to unix socket", "addr", addr) - } else { - klog.V(4).InfoS("Successfully dialed Unix socket", "addr", addr) - } - return c, err - })) - - if err != nil { - return nil, fmt.Errorf("failed to create connection to %s, error: %v", endpoint, err) - } - - s.kmsClient = kmsapi.NewKeyManagementServiceClient(s.connection) - - go func() { - defer utilruntime.HandleCrash() - - <-ctx.Done() - _ = s.connection.Close() - }() - - return s, nil -} - -func (g *gRPCService) checkAPIVersion(ctx context.Context) error { - g.mux.Lock() - defer g.mux.Unlock() - - if g.versionChecked { - return nil - } - - request := &kmsapi.VersionRequest{Version: kmsapiVersion} - response, err := g.kmsClient.Version(ctx, request) - if err != nil { - return fmt.Errorf("failed get version from remote KMS provider: %v", err) - } - if response.Version != kmsapiVersion { - return fmt.Errorf(versionErrorf, response.Version, kmsapiVersion) - } - g.versionChecked = true - - klog.V(4).InfoS("KMS provider api version verified", "version", response.Version) - return nil -} - -// Decrypt a given data string to obtain the original byte data. -func (g *gRPCService) Decrypt(cipher []byte) ([]byte, error) { - ctx, cancel := context.WithTimeout(context.Background(), g.callTimeout) - defer cancel() - - request := &kmsapi.DecryptRequest{Cipher: cipher, Version: kmsapiVersion} - response, err := g.kmsClient.Decrypt(ctx, request) - if err != nil { - return nil, err - } - return response.Plain, nil -} - -// Encrypt bytes to a string ciphertext. -func (g *gRPCService) Encrypt(plain []byte) ([]byte, error) { - ctx, cancel := context.WithTimeout(context.Background(), g.callTimeout) - defer cancel() - - request := &kmsapi.EncryptRequest{Plain: plain, Version: kmsapiVersion} - response, err := g.kmsClient.Encrypt(ctx, request) - if err != nil { - return nil, err - } - return response.Cipher, nil -} - -func (g *gRPCService) interceptor( - ctx context.Context, - method string, - req interface{}, - reply interface{}, - cc *grpc.ClientConn, - invoker grpc.UnaryInvoker, - opts ...grpc.CallOption, -) error { - if !kmsapi.IsVersionCheckMethod(method) { - if err := g.checkAPIVersion(ctx); err != nil { - return err - } - } - - return invoker(ctx, method, req, reply, cc, opts...) -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/cache.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/cache.go deleted file mode 100644 index bc7f04b9c..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/cache.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package kmsv2 transforms values for storage at rest using a Envelope v2 provider -package kmsv2 - -import ( - "crypto/sha256" - "hash" - "sync" - "time" - "unsafe" - - utilcache "k8s.io/apimachinery/pkg/util/cache" - "k8s.io/apiserver/pkg/storage/value" - "k8s.io/apiserver/pkg/storage/value/encrypt/envelope/metrics" - "k8s.io/utils/clock" -) - -// simpleCache stores the decryption subset of value.Transformer (value.Read). -// this statically enforces that transformers placed in the cache are not used for encryption. -// this is relevant in the context of nonce collision since transformers that are created -// from encrypted DEKs retrieved from etcd cannot maintain their nonce counter state. -type simpleCache struct { - cache *utilcache.Expiring - ttl time.Duration - // hashPool is a per cache pool of hash.Hash (to avoid allocations from building the Hash) - // SHA-256 is used to prevent collisions - hashPool *sync.Pool - providerName string - mu sync.Mutex // guards call to set - recordCacheSize func(providerName string, size int) // for unit tests -} - -func newSimpleCache(clock clock.Clock, ttl time.Duration, providerName string) *simpleCache { - cache := utilcache.NewExpiringWithClock(clock) - cache.AllowExpiredGet = true // for a given key, the value (the decryptTransformer) is always the same - return &simpleCache{ - cache: cache, - ttl: ttl, - hashPool: &sync.Pool{ - New: func() interface{} { - return sha256.New() - }, - }, - providerName: providerName, - recordCacheSize: metrics.RecordDekSourceCacheSize, - } -} - -// given a key, return the transformer, or nil if it does not exist in the cache -func (c *simpleCache) get(key []byte) value.Read { - record, ok := c.cache.Get(c.keyFunc(key)) - if !ok { - return nil - } - return record.(value.Read) -} - -// set caches the record for the key -func (c *simpleCache) set(key []byte, transformer value.Read) { - c.mu.Lock() - defer c.mu.Unlock() - if len(key) == 0 { - panic("key must not be empty") - } - if transformer == nil { - panic("transformer must not be nil") - } - c.cache.Set(c.keyFunc(key), transformer, c.ttl) - // Add metrics for cache size - c.recordCacheSize(c.providerName, c.cache.Len()) -} - -// keyFunc generates a string key by hashing the inputs. -// This lowers the memory requirement of the cache. -func (c *simpleCache) keyFunc(s []byte) string { - h := c.hashPool.Get().(hash.Hash) - h.Reset() - - if _, err := h.Write(s); err != nil { - panic(err) // Write() on hash never fails - } - key := toString(h.Sum(nil)) // skip base64 encoding to save an allocation - c.hashPool.Put(h) - - return key -} - -// toString performs unholy acts to avoid allocations -func toString(b []byte) string { - // unsafe.SliceData relies on cap whereas we want to rely on len - if len(b) == 0 { - return "" - } - // Copied from go 1.20.1 strings.Builder.String - // https://github.com/golang/go/blob/202a1a57064127c3f19d96df57b9f9586145e21c/src/strings/builder.go#L48 - return unsafe.String(unsafe.SliceData(b), len(b)) -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/envelope.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/envelope.go deleted file mode 100644 index a20b10fc3..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/envelope.go +++ /dev/null @@ -1,528 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package kmsv2 transforms values for storage at rest using a Envelope v2 provider -package kmsv2 - -import ( - "context" - "crypto/aes" - "crypto/cipher" - "crypto/sha256" - "fmt" - "sort" - "time" - "unsafe" - - "github.com/gogo/protobuf/proto" - "go.opentelemetry.io/otel/attribute" - "golang.org/x/crypto/cryptobyte" - - utilerrors "k8s.io/apimachinery/pkg/util/errors" - "k8s.io/apimachinery/pkg/util/uuid" - "k8s.io/apimachinery/pkg/util/validation" - "k8s.io/apimachinery/pkg/util/validation/field" - genericapirequest "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/apiserver/pkg/storage/value" - aestransformer "k8s.io/apiserver/pkg/storage/value/encrypt/aes" - kmstypes "k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/v2" - "k8s.io/apiserver/pkg/storage/value/encrypt/envelope/metrics" - "k8s.io/component-base/tracing" - "k8s.io/klog/v2" - kmsservice "k8s.io/kms/pkg/service" - "k8s.io/utils/clock" -) - -func init() { - value.RegisterMetrics() - metrics.RegisterMetrics() -} - -const ( - // KMSAPIVersionv2 is a version of the KMS API. - KMSAPIVersionv2 = "v2" - // KMSAPIVersionv2beta1 is a version of the KMS API. - KMSAPIVersionv2beta1 = "v2beta1" - // annotationsMaxSize is the maximum size of the annotations. - annotationsMaxSize = 32 * 1024 // 32 kB - // KeyIDMaxSize is the maximum size of the keyID. - KeyIDMaxSize = 1 * 1024 // 1 kB - // encryptedDEKSourceMaxSize is the maximum size of the encrypted DEK source. - encryptedDEKSourceMaxSize = 1 * 1024 // 1 kB - // cacheTTL is the default time-to-live for the cache entry. - // this allows the cache to grow to an infinite size for up to a day. - // there is unlikely to be any meaningful memory impact on the server - // because the cache will likely never have more than a few thousand entries. - // each entry can be large due to an internal cache that maps the DEK seed to individual - // DEK entries, but that cache has an aggressive TTL to keep the size under control. - // with DEK/seed reuse and no storage migration, the number of entries in this cache - // would be approximated by unique key IDs used by the KMS plugin - // combined with the number of server restarts. If storage migration - // is performed after key ID changes, and the number of restarts - // is limited, this cache size may be as small as the number of API - // servers in use (once old entries expire out from the TTL). - cacheTTL = 24 * time.Hour - // key ID related error codes for metrics - errKeyIDOKCode ErrCodeKeyID = "ok" - errKeyIDEmptyCode ErrCodeKeyID = "empty" - errKeyIDTooLongCode ErrCodeKeyID = "too_long" -) - -// NowFunc is exported so tests can override it. -var NowFunc = time.Now - -type StateFunc func() (State, error) -type ErrCodeKeyID string - -type State struct { - Transformer value.Transformer - - EncryptedObject kmstypes.EncryptedObject - - UID string - - ExpirationTimestamp time.Time - - // CacheKey is the key used to cache the DEK/seed in envelopeTransformer.cache. - CacheKey []byte -} - -func (s *State) ValidateEncryptCapability() error { - if now := NowFunc(); now.After(s.ExpirationTimestamp) { - return fmt.Errorf("encryptedDEKSource with keyID hash %q expired at %s (current time is %s)", - GetHashIfNotEmpty(s.EncryptedObject.KeyID), s.ExpirationTimestamp.Format(time.RFC3339), now.Format(time.RFC3339)) - } - return nil -} - -type envelopeTransformer struct { - envelopeService kmsservice.Service - providerName string - stateFunc StateFunc - - // cache is a thread-safe expiring lru cache which caches decrypted DEKs indexed by their encrypted form. - cache *simpleCache - apiServerID string -} - -// NewEnvelopeTransformer returns a transformer which implements a KEK-DEK based envelope encryption scheme. -// It uses envelopeService to encrypt and decrypt DEKs. Respective DEKs (in encrypted form) are prepended to -// the data items they encrypt. -func NewEnvelopeTransformer(envelopeService kmsservice.Service, providerName string, stateFunc StateFunc, apiServerID string) value.Transformer { - return newEnvelopeTransformerWithClock(envelopeService, providerName, stateFunc, apiServerID, cacheTTL, clock.RealClock{}) -} - -func newEnvelopeTransformerWithClock(envelopeService kmsservice.Service, providerName string, stateFunc StateFunc, apiServerID string, cacheTTL time.Duration, clock clock.Clock) value.Transformer { - return &envelopeTransformer{ - envelopeService: envelopeService, - providerName: providerName, - stateFunc: stateFunc, - cache: newSimpleCache(clock, cacheTTL, providerName), - apiServerID: apiServerID, - } -} - -// TransformFromStorage decrypts data encrypted by this transformer using envelope encryption. -func (t *envelopeTransformer) TransformFromStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, bool, error) { - ctx, span := tracing.Start(ctx, "TransformFromStorage with envelopeTransformer", - attribute.String("transformer.provider.name", t.providerName), - // The service.instance_id of the apiserver is already available in the trace - /* - { - "key": "service.instance.id", - "type": "string", - "value": "apiserver-zsteyir5lyrtdcmqqmd5kzze6m" - } - */ - ) - defer span.End(500 * time.Millisecond) - - span.AddEvent("About to decode encrypted object") - // Deserialize the EncryptedObject from the data. - encryptedObject, err := t.doDecode(data) - if err != nil { - span.AddEvent("Decoding encrypted object failed") - span.RecordError(err) - return nil, false, err - } - span.AddEvent("Decoded encrypted object") - - useSeed := encryptedObject.EncryptedDEKSourceType == kmstypes.EncryptedDEKSourceType_HKDF_SHA256_XNONCE_AES_GCM_SEED - - // TODO: consider marking state.EncryptedDEK != encryptedObject.EncryptedDEK as a stale read to support DEK defragmentation - // at a minimum we should have a metric that helps the user understand if DEK fragmentation is high - state, err := t.stateFunc() // no need to call state.ValidateEncryptCapability on reads - if err != nil { - return nil, false, err - } - - encryptedObjectCacheKey, err := generateCacheKey(encryptedObject.EncryptedDEKSourceType, encryptedObject.EncryptedDEKSource, encryptedObject.KeyID, encryptedObject.Annotations) - if err != nil { - return nil, false, err - } - - // Look up the decrypted DEK from cache first - transformer := t.cache.get(encryptedObjectCacheKey) - - // fallback to the envelope service if we do not have the transformer locally - if transformer == nil { - span.AddEvent("About to decrypt DEK using remote service") - value.RecordCacheMiss() - - requestInfo := getRequestInfoFromContext(ctx) - uid := string(uuid.NewUUID()) - klog.V(6).InfoS("decrypting content using envelope service", "uid", uid, "key", string(dataCtx.AuthenticatedData()), - "group", requestInfo.APIGroup, "version", requestInfo.APIVersion, "resource", requestInfo.Resource, "subresource", requestInfo.Subresource, - "verb", requestInfo.Verb, "namespace", requestInfo.Namespace, "name", requestInfo.Name) - - key, err := t.envelopeService.Decrypt(ctx, uid, &kmsservice.DecryptRequest{ - Ciphertext: encryptedObject.EncryptedDEKSource, - KeyID: encryptedObject.KeyID, - Annotations: encryptedObject.Annotations, - }) - if err != nil { - span.AddEvent("DEK decryption failed") - span.RecordError(err) - return nil, false, fmt.Errorf("failed to decrypt DEK, error: %w", err) - } - span.AddEvent("DEK decryption succeeded") - - transformer, err = t.addTransformerForDecryption(encryptedObjectCacheKey, key, useSeed) - if err != nil { - return nil, false, err - } - } - metrics.RecordKeyID(metrics.FromStorageLabel, t.providerName, encryptedObject.KeyID, t.apiServerID) - - span.AddEvent("About to decrypt data using DEK") - out, stale, err := transformer.TransformFromStorage(ctx, encryptedObject.EncryptedData, dataCtx) - if err != nil { - span.AddEvent("Data decryption failed") - span.RecordError(err) - return nil, false, err - } - - span.AddEvent("Data decryption succeeded") - // data is considered stale if the key ID does not match our current write transformer - return out, - stale || - encryptedObject.KeyID != state.EncryptedObject.KeyID || - encryptedObject.EncryptedDEKSourceType != state.EncryptedObject.EncryptedDEKSourceType, - nil -} - -// TransformToStorage encrypts data to be written to disk using envelope encryption. -func (t *envelopeTransformer) TransformToStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, error) { - ctx, span := tracing.Start(ctx, "TransformToStorage with envelopeTransformer", - attribute.String("transformer.provider.name", t.providerName), - // The service.instance_id of the apiserver is already available in the trace - /* - { - "key": "service.instance.id", - "type": "string", - "value": "apiserver-zsteyir5lyrtdcmqqmd5kzze6m" - } - */ - ) - defer span.End(500 * time.Millisecond) - - state, err := t.stateFunc() - if err != nil { - return nil, err - } - if err := state.ValidateEncryptCapability(); err != nil { - return nil, err - } - - // this prevents a cache miss every time the DEK rotates - // this has the side benefit of causing the cache to perform a GC - // TODO see if we can do this inside the stateFunc control loop - t.cache.set(state.CacheKey, state.Transformer) - - requestInfo := getRequestInfoFromContext(ctx) - klog.V(6).InfoS("encrypting content using DEK", "uid", state.UID, "key", string(dataCtx.AuthenticatedData()), - "group", requestInfo.APIGroup, "version", requestInfo.APIVersion, "resource", requestInfo.Resource, "subresource", requestInfo.Subresource, - "verb", requestInfo.Verb, "namespace", requestInfo.Namespace, "name", requestInfo.Name) - - span.AddEvent("About to encrypt data using DEK") - result, err := state.Transformer.TransformToStorage(ctx, data, dataCtx) - if err != nil { - span.AddEvent("Data encryption failed") - span.RecordError(err) - return nil, err - } - span.AddEvent("Data encryption succeeded") - - metrics.RecordKeyID(metrics.ToStorageLabel, t.providerName, state.EncryptedObject.KeyID, t.apiServerID) - - encObjectCopy := state.EncryptedObject - encObjectCopy.EncryptedData = result - - span.AddEvent("About to encode encrypted object") - // Serialize the EncryptedObject to a byte array. - out, err := t.doEncode(&encObjectCopy) - if err != nil { - span.AddEvent("Encoding encrypted object failed") - span.RecordError(err) - return nil, err - } - span.AddEvent("Encoded encrypted object") - - return out, nil -} - -// addTransformerForDecryption inserts a new transformer to the Envelope cache of DEKs for future reads. -func (t *envelopeTransformer) addTransformerForDecryption(cacheKey []byte, key []byte, useSeed bool) (value.Read, error) { - var transformer value.Read - var err error - if useSeed { - // the input key is considered safe to use here because it is coming from the KMS plugin / etcd - transformer, err = aestransformer.NewHKDFExtendedNonceGCMTransformer(key) - } else { - var block cipher.Block - block, err = aes.NewCipher(key) - if err != nil { - return nil, err - } - // this is compatible with NewGCMTransformerWithUniqueKeyUnsafe for decryption - // it would use random nonces for encryption but we never do that - transformer, err = aestransformer.NewGCMTransformer(block) - } - if err != nil { - return nil, err - } - t.cache.set(cacheKey, transformer) - return transformer, nil -} - -// doEncode encodes the EncryptedObject to a byte array. -func (t *envelopeTransformer) doEncode(request *kmstypes.EncryptedObject) ([]byte, error) { - if err := ValidateEncryptedObject(request); err != nil { - return nil, err - } - return proto.Marshal(request) -} - -// doDecode decodes the byte array to an EncryptedObject. -func (t *envelopeTransformer) doDecode(originalData []byte) (*kmstypes.EncryptedObject, error) { - o := &kmstypes.EncryptedObject{} - if err := proto.Unmarshal(originalData, o); err != nil { - return nil, err - } - if err := ValidateEncryptedObject(o); err != nil { - return nil, err - } - - return o, nil -} - -// GenerateTransformer generates a new transformer and encrypts the DEK/seed using the envelope service. -// It returns the transformer, the encrypted DEK/seed, cache key and error. -func GenerateTransformer(ctx context.Context, uid string, envelopeService kmsservice.Service, useSeed bool) (value.Transformer, *kmstypes.EncryptedObject, []byte, error) { - newTransformerFunc := func() (value.Transformer, []byte, error) { - seed, err := aestransformer.GenerateKey(aestransformer.MinSeedSizeExtendedNonceGCM) - if err != nil { - return nil, nil, err - } - transformer, err := aestransformer.NewHKDFExtendedNonceGCMTransformer(seed) - if err != nil { - return nil, nil, err - } - return transformer, seed, nil - } - if !useSeed { - newTransformerFunc = aestransformer.NewGCMTransformerWithUniqueKeyUnsafe - } - transformer, newKey, err := newTransformerFunc() - if err != nil { - return nil, nil, nil, err - } - - klog.V(6).InfoS("encrypting content using envelope service", "uid", uid) - - resp, err := envelopeService.Encrypt(ctx, uid, newKey) - if err != nil { - return nil, nil, nil, fmt.Errorf("failed to encrypt DEK, error: %w", err) - } - - o := &kmstypes.EncryptedObject{ - KeyID: resp.KeyID, - EncryptedDEKSource: resp.Ciphertext, - EncryptedData: []byte{0}, // any non-empty value to pass validation - Annotations: resp.Annotations, - } - - if useSeed { - o.EncryptedDEKSourceType = kmstypes.EncryptedDEKSourceType_HKDF_SHA256_XNONCE_AES_GCM_SEED - } else { - o.EncryptedDEKSourceType = kmstypes.EncryptedDEKSourceType_AES_GCM_KEY - } - - if err := ValidateEncryptedObject(o); err != nil { - return nil, nil, nil, err - } - - cacheKey, err := generateCacheKey(o.EncryptedDEKSourceType, resp.Ciphertext, resp.KeyID, resp.Annotations) - if err != nil { - return nil, nil, nil, err - } - - o.EncryptedData = nil // make sure that later code that uses this encrypted object sets this field - - return transformer, o, cacheKey, nil -} - -func ValidateEncryptedObject(o *kmstypes.EncryptedObject) error { - if o == nil { - return fmt.Errorf("encrypted object is nil") - } - switch t := o.EncryptedDEKSourceType; t { - case kmstypes.EncryptedDEKSourceType_AES_GCM_KEY: - case kmstypes.EncryptedDEKSourceType_HKDF_SHA256_XNONCE_AES_GCM_SEED: - default: - return fmt.Errorf("unknown encryptedDEKSourceType: %d", t) - } - if len(o.EncryptedData) == 0 { - return fmt.Errorf("encrypted data is empty") - } - if err := validateEncryptedDEKSource(o.EncryptedDEKSource); err != nil { - return fmt.Errorf("failed to validate encrypted DEK source: %w", err) - } - if _, err := ValidateKeyID(o.KeyID); err != nil { - return fmt.Errorf("failed to validate key id: %w", err) - } - if err := validateAnnotations(o.Annotations); err != nil { - return fmt.Errorf("failed to validate annotations: %w", err) - } - return nil -} - -// validateEncryptedDEKSource tests the following: -// 1. The encrypted DEK source is not empty. -// 2. The size of encrypted DEK source is less than 1 kB. -func validateEncryptedDEKSource(encryptedDEKSource []byte) error { - if len(encryptedDEKSource) == 0 { - return fmt.Errorf("encrypted DEK source is empty") - } - if len(encryptedDEKSource) > encryptedDEKSourceMaxSize { - return fmt.Errorf("encrypted DEK source is %d bytes, which exceeds the max size of %d", len(encryptedDEKSource), encryptedDEKSourceMaxSize) - } - return nil -} - -// validateAnnotations tests the following: -// 1. checks if the annotation key is fully qualified -// 2. The size of annotations keys + values is less than 32 kB. -func validateAnnotations(annotations map[string][]byte) error { - var errs []error - var totalSize uint64 - for k, v := range annotations { - if fieldErr := validation.IsFullyQualifiedDomainName(field.NewPath("annotations"), k); fieldErr != nil { - errs = append(errs, fieldErr.ToAggregate()) - } - totalSize += uint64(len(k)) + uint64(len(v)) - } - if totalSize > annotationsMaxSize { - errs = append(errs, fmt.Errorf("total size of annotations is %d, which exceeds the max size of %d", totalSize, annotationsMaxSize)) - } - return utilerrors.NewAggregate(errs) -} - -// ValidateKeyID tests the following: -// 1. The keyID is not empty. -// 2. The size of keyID is less than 1 kB. -func ValidateKeyID(keyID string) (ErrCodeKeyID, error) { - if len(keyID) == 0 { - return errKeyIDEmptyCode, fmt.Errorf("keyID is empty") - } - if len(keyID) > KeyIDMaxSize { - return errKeyIDTooLongCode, fmt.Errorf("keyID is %d bytes, which exceeds the max size of %d", len(keyID), KeyIDMaxSize) - } - return errKeyIDOKCode, nil -} - -func getRequestInfoFromContext(ctx context.Context) *genericapirequest.RequestInfo { - if reqInfo, found := genericapirequest.RequestInfoFrom(ctx); found { - return reqInfo - } - return &genericapirequest.RequestInfo{} -} - -// generateCacheKey returns a key for the cache. -// The key is a concatenation of: -// 0. encryptedDEKSourceType -// 1. encryptedDEKSource -// 2. keyID -// 3. length of annotations -// 4. annotations (sorted by key) - each annotation is a concatenation of: -// a. annotation key -// b. annotation value -func generateCacheKey(encryptedDEKSourceType kmstypes.EncryptedDEKSourceType, encryptedDEKSource []byte, keyID string, annotations map[string][]byte) ([]byte, error) { - // TODO(aramase): use sync pool buffer to avoid allocations - b := cryptobyte.NewBuilder(nil) - b.AddUint32(uint32(encryptedDEKSourceType)) - b.AddUint16LengthPrefixed(func(b *cryptobyte.Builder) { - b.AddBytes(encryptedDEKSource) - }) - b.AddUint16LengthPrefixed(func(b *cryptobyte.Builder) { - b.AddBytes(toBytes(keyID)) - }) - if len(annotations) == 0 { - return b.Bytes() - } - - // add the length of annotations to the cache key - b.AddUint32(uint32(len(annotations))) - - // Sort the annotations by key. - keys := make([]string, 0, len(annotations)) - for k := range annotations { - k := k - keys = append(keys, k) - } - sort.Strings(keys) - for _, k := range keys { - // The maximum size of annotations is annotationsMaxSize (32 kB) so we can safely - // assume that the length of the key and value will fit in a uint16. - b.AddUint16LengthPrefixed(func(b *cryptobyte.Builder) { - b.AddBytes(toBytes(k)) - }) - b.AddUint16LengthPrefixed(func(b *cryptobyte.Builder) { - b.AddBytes(annotations[k]) - }) - } - - return b.Bytes() -} - -// toBytes performs unholy acts to avoid allocations -func toBytes(s string) []byte { - // unsafe.StringData is unspecified for the empty string, so we provide a strict interpretation - if len(s) == 0 { - return nil - } - // Copied from go 1.20.1 os.File.WriteString - // https://github.com/golang/go/blob/202a1a57064127c3f19d96df57b9f9586145e21c/src/os/file.go#L246 - return unsafe.Slice(unsafe.StringData(s), len(s)) -} - -// GetHashIfNotEmpty returns the sha256 hash of the data if it is not empty. -func GetHashIfNotEmpty(data string) string { - if len(data) > 0 { - return fmt.Sprintf("sha256:%x", sha256.Sum256([]byte(data))) - } - return "" -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/grpc_service.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/grpc_service.go deleted file mode 100644 index 09a2a76df..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/grpc_service.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package kmsv2 transforms values for storage at rest using a Envelope provider -package kmsv2 - -import ( - "context" - "fmt" - "net" - "time" - - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" - - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apiserver/pkg/storage/value/encrypt/envelope/metrics" - "k8s.io/klog/v2" - kmsapi "k8s.io/kms/apis/v2" - kmsservice "k8s.io/kms/pkg/service" - "k8s.io/kms/pkg/util" -) - -const ( - // unixProtocol is the only supported protocol for remote KMS provider. - unixProtocol = "unix" -) - -// The gRPC implementation for envelope.Service. -type gRPCService struct { - kmsClient kmsapi.KeyManagementServiceClient - connection *grpc.ClientConn - callTimeout time.Duration -} - -// NewGRPCService returns an envelope.Service which use gRPC to communicate the remote KMS provider. -func NewGRPCService(ctx context.Context, endpoint, providerName string, callTimeout time.Duration) (kmsservice.Service, error) { - klog.V(4).InfoS("Configure KMS provider", "endpoint", endpoint) - - addr, err := util.ParseEndpoint(endpoint) - if err != nil { - return nil, err - } - - s := &gRPCService{callTimeout: callTimeout} - s.connection, err = grpc.Dial( - addr, - grpc.WithAuthority("localhost"), - grpc.WithTransportCredentials(insecure.NewCredentials()), - grpc.WithDefaultCallOptions(grpc.WaitForReady(true)), - grpc.WithContextDialer( - func(context.Context, string) (net.Conn, error) { - // Ignoring addr and timeout arguments: - // addr - comes from the closure - c, err := net.DialUnix(unixProtocol, nil, &net.UnixAddr{Name: addr}) - if err != nil { - klog.ErrorS(err, "failed to create connection to unix socket", "addr", addr) - } else { - klog.V(4).InfoS("Successfully dialed Unix socket", "addr", addr) - } - return c, err - }), - grpc.WithChainUnaryInterceptor(recordMetricsInterceptor(providerName)), - ) - - if err != nil { - return nil, fmt.Errorf("failed to create connection to %s, error: %v", endpoint, err) - } - - s.kmsClient = kmsapi.NewKeyManagementServiceClient(s.connection) - - go func() { - defer utilruntime.HandleCrash() - - <-ctx.Done() - _ = s.connection.Close() - }() - - return s, nil -} - -// Decrypt a given data string to obtain the original byte data. -func (g *gRPCService) Decrypt(ctx context.Context, uid string, req *kmsservice.DecryptRequest) ([]byte, error) { - ctx, cancel := context.WithTimeout(ctx, g.callTimeout) - defer cancel() - - request := &kmsapi.DecryptRequest{ - Ciphertext: req.Ciphertext, - Uid: uid, - KeyId: req.KeyID, - Annotations: req.Annotations, - } - response, err := g.kmsClient.Decrypt(ctx, request) - if err != nil { - return nil, err - } - return response.Plaintext, nil -} - -// Encrypt bytes to a string ciphertext. -func (g *gRPCService) Encrypt(ctx context.Context, uid string, plaintext []byte) (*kmsservice.EncryptResponse, error) { - ctx, cancel := context.WithTimeout(ctx, g.callTimeout) - defer cancel() - - request := &kmsapi.EncryptRequest{ - Plaintext: plaintext, - Uid: uid, - } - response, err := g.kmsClient.Encrypt(ctx, request) - if err != nil { - return nil, err - } - return &kmsservice.EncryptResponse{ - Ciphertext: response.Ciphertext, - KeyID: response.KeyId, - Annotations: response.Annotations, - }, nil -} - -// Status returns the status of the KMSv2 provider. -func (g *gRPCService) Status(ctx context.Context) (*kmsservice.StatusResponse, error) { - ctx, cancel := context.WithTimeout(ctx, g.callTimeout) - defer cancel() - - request := &kmsapi.StatusRequest{} - response, err := g.kmsClient.Status(ctx, request) - if err != nil { - return nil, err - } - return &kmsservice.StatusResponse{Version: response.Version, Healthz: response.Healthz, KeyID: response.KeyId}, nil -} - -func recordMetricsInterceptor(providerName string) grpc.UnaryClientInterceptor { - return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { - start := NowFunc() - respErr := invoker(ctx, method, req, reply, cc, opts...) - elapsed := NowFunc().Sub(start) - metrics.RecordKMSOperationLatency(providerName, method, elapsed, respErr) - return respErr - } -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/v2/OWNERS b/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/v2/OWNERS deleted file mode 100644 index fa20d4cbe..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/v2/OWNERS +++ /dev/null @@ -1,9 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -# Disable inheritance as this is an api owners file -options: - no_parent_owners: true -approvers: - - api-approvers -reviewers: - - sig-auth-api-reviewers diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/v2/api.pb.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/v2/api.pb.go deleted file mode 100644 index 25150288f..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/v2/api.pb.go +++ /dev/null @@ -1,186 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: api.proto - -package v2 - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - 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. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type EncryptedDEKSourceType int32 - -const ( - // AES_GCM_KEY means that the plaintext of encryptedDEKSource is the DEK itself, with AES-GCM as the encryption algorithm. - EncryptedDEKSourceType_AES_GCM_KEY EncryptedDEKSourceType = 0 - // HKDF_SHA256_XNONCE_AES_GCM_SEED means that the plaintext of encryptedDEKSource is the pseudo random key - // (referred to as the seed throughout the code) that is fed into HKDF expand. SHA256 is the hash algorithm - // and first 32 bytes of encryptedData are the info param. The first 32 bytes from the HKDF stream are used - // as the DEK with AES-GCM as the encryption algorithm. - EncryptedDEKSourceType_HKDF_SHA256_XNONCE_AES_GCM_SEED EncryptedDEKSourceType = 1 -) - -var EncryptedDEKSourceType_name = map[int32]string{ - 0: "AES_GCM_KEY", - 1: "HKDF_SHA256_XNONCE_AES_GCM_SEED", -} - -var EncryptedDEKSourceType_value = map[string]int32{ - "AES_GCM_KEY": 0, - "HKDF_SHA256_XNONCE_AES_GCM_SEED": 1, -} - -func (x EncryptedDEKSourceType) String() string { - return proto.EnumName(EncryptedDEKSourceType_name, int32(x)) -} - -func (EncryptedDEKSourceType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{0} -} - -// EncryptedObject is the representation of data stored in etcd after envelope encryption. -type EncryptedObject struct { - // EncryptedData is the encrypted data. - EncryptedData []byte `protobuf:"bytes,1,opt,name=encryptedData,proto3" json:"encryptedData,omitempty"` - // KeyID is the KMS key ID used for encryption operations. - // keyID must satisfy the following constraints: - // 1. The keyID is not empty. - // 2. The size of keyID is less than 1 kB. - KeyID string `protobuf:"bytes,2,opt,name=keyID,proto3" json:"keyID,omitempty"` - // EncryptedDEKSource is the ciphertext of the source of the DEK used to encrypt the data stored in encryptedData. - // encryptedDEKSourceType defines the process of using the plaintext of this field to determine the aforementioned DEK. - // encryptedDEKSource must satisfy the following constraints: - // 1. The encrypted DEK source is not empty. - // 2. The size of encrypted DEK source is less than 1 kB. - EncryptedDEKSource []byte `protobuf:"bytes,3,opt,name=encryptedDEKSource,proto3" json:"encryptedDEKSource,omitempty"` - // Annotations is additional metadata that was provided by the KMS plugin. - // Annotations must satisfy the following constraints: - // 1. Annotation key must be a fully qualified domain name that conforms to the definition in DNS (RFC 1123). - // 2. The size of annotations keys + values is less than 32 kB. - Annotations map[string][]byte `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // encryptedDEKSourceType defines the process of using the plaintext of encryptedDEKSource to determine the DEK. - EncryptedDEKSourceType EncryptedDEKSourceType `protobuf:"varint,5,opt,name=encryptedDEKSourceType,proto3,enum=v2.EncryptedDEKSourceType" json:"encryptedDEKSourceType,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EncryptedObject) Reset() { *m = EncryptedObject{} } -func (m *EncryptedObject) String() string { return proto.CompactTextString(m) } -func (*EncryptedObject) ProtoMessage() {} -func (*EncryptedObject) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{0} -} -func (m *EncryptedObject) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EncryptedObject.Unmarshal(m, b) -} -func (m *EncryptedObject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EncryptedObject.Marshal(b, m, deterministic) -} -func (m *EncryptedObject) XXX_Merge(src proto.Message) { - xxx_messageInfo_EncryptedObject.Merge(m, src) -} -func (m *EncryptedObject) XXX_Size() int { - return xxx_messageInfo_EncryptedObject.Size(m) -} -func (m *EncryptedObject) XXX_DiscardUnknown() { - xxx_messageInfo_EncryptedObject.DiscardUnknown(m) -} - -var xxx_messageInfo_EncryptedObject proto.InternalMessageInfo - -func (m *EncryptedObject) GetEncryptedData() []byte { - if m != nil { - return m.EncryptedData - } - return nil -} - -func (m *EncryptedObject) GetKeyID() string { - if m != nil { - return m.KeyID - } - return "" -} - -func (m *EncryptedObject) GetEncryptedDEKSource() []byte { - if m != nil { - return m.EncryptedDEKSource - } - return nil -} - -func (m *EncryptedObject) GetAnnotations() map[string][]byte { - if m != nil { - return m.Annotations - } - return nil -} - -func (m *EncryptedObject) GetEncryptedDEKSourceType() EncryptedDEKSourceType { - if m != nil { - return m.EncryptedDEKSourceType - } - return EncryptedDEKSourceType_AES_GCM_KEY -} - -func init() { - proto.RegisterEnum("v2.EncryptedDEKSourceType", EncryptedDEKSourceType_name, EncryptedDEKSourceType_value) - proto.RegisterType((*EncryptedObject)(nil), "v2.EncryptedObject") - proto.RegisterMapType((map[string][]byte)(nil), "v2.EncryptedObject.AnnotationsEntry") -} - -func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } - -var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 329 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xe1, 0x4b, 0xc2, 0x40, - 0x18, 0xc6, 0xdb, 0xcc, 0xc0, 0xd3, 0x72, 0x1c, 0x21, 0xc3, 0x2f, 0x8d, 0xf2, 0xc3, 0xe8, 0xc3, - 0x0e, 0x16, 0x85, 0x44, 0x08, 0xe6, 0xce, 0x0c, 0x49, 0x61, 0xeb, 0x43, 0xf5, 0x65, 0x9c, 0xf6, - 0x22, 0x6b, 0xb6, 0x1b, 0xb7, 0xf3, 0x60, 0x7f, 0x6a, 0xff, 0x4d, 0x38, 0x13, 0xd3, 0xec, 0xdb, - 0xbd, 0xef, 0xfd, 0xde, 0xe7, 0xb9, 0x7b, 0x5e, 0x54, 0x61, 0x69, 0xe4, 0xa4, 0x82, 0x4b, 0x8e, - 0x75, 0xe5, 0x9e, 0x7f, 0xe9, 0xa8, 0x4e, 0x93, 0xa9, 0xc8, 0x53, 0x09, 0xef, 0xe3, 0xc9, 0x07, - 0x4c, 0x25, 0x6e, 0xa1, 0x63, 0x58, 0xb7, 0x3c, 0x26, 0x99, 0xa9, 0x59, 0x9a, 0x5d, 0xf3, 0xb7, - 0x9b, 0xf8, 0x14, 0x95, 0x63, 0xc8, 0x1f, 0x3d, 0x53, 0xb7, 0x34, 0xbb, 0xe2, 0xaf, 0x0a, 0xec, - 0x20, 0xbc, 0xc1, 0xe8, 0x30, 0xe0, 0x0b, 0x31, 0x05, 0xb3, 0x54, 0x08, 0xec, 0xb9, 0xc1, 0x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 0x00, 0x00, -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/v2/api.proto b/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/v2/api.proto deleted file mode 100644 index 674b3f4a9..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/v2/api.proto +++ /dev/null @@ -1,60 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// To regenerate api.pb.go run `hack/update-codegen.sh protobindings` -syntax = "proto3"; - -package v2; -option go_package = "k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/v2"; - -// EncryptedObject is the representation of data stored in etcd after envelope encryption. -message EncryptedObject { - // EncryptedData is the encrypted data. - bytes encryptedData = 1; - - // KeyID is the KMS key ID used for encryption operations. - // keyID must satisfy the following constraints: - // 1. The keyID is not empty. - // 2. The size of keyID is less than 1 kB. - string keyID = 2; - - // EncryptedDEKSource is the ciphertext of the source of the DEK used to encrypt the data stored in encryptedData. - // encryptedDEKSourceType defines the process of using the plaintext of this field to determine the aforementioned DEK. - // encryptedDEKSource must satisfy the following constraints: - // 1. The encrypted DEK source is not empty. - // 2. The size of encrypted DEK source is less than 1 kB. - bytes encryptedDEKSource = 3; - - // Annotations is additional metadata that was provided by the KMS plugin. - // Annotations must satisfy the following constraints: - // 1. Annotation key must be a fully qualified domain name that conforms to the definition in DNS (RFC 1123). - // 2. The size of annotations keys + values is less than 32 kB. - map annotations = 4; - - // encryptedDEKSourceType defines the process of using the plaintext of encryptedDEKSource to determine the DEK. - EncryptedDEKSourceType encryptedDEKSourceType = 5; -} - -enum EncryptedDEKSourceType { - // AES_GCM_KEY means that the plaintext of encryptedDEKSource is the DEK itself, with AES-GCM as the encryption algorithm. - AES_GCM_KEY = 0; - - // HKDF_SHA256_XNONCE_AES_GCM_SEED means that the plaintext of encryptedDEKSource is the pseudo random key - // (referred to as the seed throughout the code) that is fed into HKDF expand. SHA256 is the hash algorithm - // and first 32 bytes of encryptedData are the info param. The first 32 bytes from the HKDF stream are used - // as the DEK with AES-GCM as the encryption algorithm. - HKDF_SHA256_XNONCE_AES_GCM_SEED = 1; -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/v2/v2.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/v2/v2.go deleted file mode 100644 index 878b19f22..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/v2/v2.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v2 contains definition of kms-plugin's serialized types. -package v2 diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/metrics/metrics.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/metrics/metrics.go deleted file mode 100644 index 63723648c..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/metrics/metrics.go +++ /dev/null @@ -1,322 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package metrics - -import ( - "crypto/sha256" - "errors" - "fmt" - "hash" - "sync" - "time" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "k8s.io/component-base/metrics" - "k8s.io/component-base/metrics/legacyregistry" - "k8s.io/klog/v2" - "k8s.io/utils/lru" -) - -const ( - namespace = "apiserver" - subsystem = "envelope_encryption" - FromStorageLabel = "from_storage" - ToStorageLabel = "to_storage" -) - -type metricLabels struct { - transformationType string - providerName string - keyIDHash string - apiServerIDHash string -} - -/* - * By default, all the following metrics are defined as falling under - * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/kubernetes-control-plane-metrics-stability.md#stability-classes) - * - * Promoting the stability level of the metric is a responsibility of the component owner, since it - * involves explicitly acknowledging support for the metric across multiple releases, in accordance with - * the metric stability policy. - */ -var ( - lockLastFromStorage sync.Mutex - lockLastToStorage sync.Mutex - lockRecordKeyID sync.Mutex - lockRecordKeyIDStatus sync.Mutex - - lastFromStorage time.Time - lastToStorage time.Time - keyIDHashTotalMetricLabels *lru.Cache - keyIDHashStatusLastTimestampSecondsMetricLabels *lru.Cache - cacheSize = 100 - - // This metric is only used for KMS v1 API. - dekCacheFillPercent = metrics.NewGauge( - &metrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "dek_cache_fill_percent", - Help: "Percent of the cache slots currently occupied by cached DEKs.", - StabilityLevel: metrics.ALPHA, - }, - ) - - // This metric is only used for KMS v1 API. - dekCacheInterArrivals = metrics.NewHistogramVec( - &metrics.HistogramOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "dek_cache_inter_arrival_time_seconds", - Help: "Time (in seconds) of inter arrival of transformation requests.", - StabilityLevel: metrics.ALPHA, - Buckets: metrics.ExponentialBuckets(60, 2, 10), - }, - []string{"transformation_type"}, - ) - - // These metrics are made public to be used by unit tests. - KMSOperationsLatencyMetric = metrics.NewHistogramVec( - &metrics.HistogramOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "kms_operations_latency_seconds", - Help: "KMS operation duration with gRPC error code status total.", - StabilityLevel: metrics.ALPHA, - // Use custom buckets to avoid the default buckets which are too small for KMS operations. - // Start 0.1ms with the last bucket being [~52s, +Inf) - Buckets: metrics.ExponentialBuckets(0.0001, 2, 20), - }, - []string{"provider_name", "method_name", "grpc_status_code"}, - ) - - // keyIDHashTotal is the number of times a keyID is used - // e.g. apiserver_envelope_encryption_key_id_hash_total counter - // apiserver_envelope_encryption_key_id_hash_total{apiserver_id_hash="sha256",key_id_hash="sha256", - // provider_name="providerName",transformation_type="from_storage"} 1 - KeyIDHashTotal = metrics.NewCounterVec( - &metrics.CounterOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "key_id_hash_total", - Help: "Number of times a keyID is used split by transformation type, provider, and apiserver identity.", - StabilityLevel: metrics.ALPHA, - }, - []string{"transformation_type", "provider_name", "key_id_hash", "apiserver_id_hash"}, - ) - - // keyIDHashLastTimestampSeconds is the last time in seconds when a keyID was used - // e.g. apiserver_envelope_encryption_key_id_hash_last_timestamp_seconds{apiserver_id_hash="sha256",key_id_hash="sha256", provider_name="providerName",transformation_type="from_storage"} 1.674865558833728e+09 - KeyIDHashLastTimestampSeconds = metrics.NewGaugeVec( - &metrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "key_id_hash_last_timestamp_seconds", - Help: "The last time in seconds when a keyID was used.", - StabilityLevel: metrics.ALPHA, - }, - []string{"transformation_type", "provider_name", "key_id_hash", "apiserver_id_hash"}, - ) - - // keyIDHashStatusLastTimestampSeconds is the last time in seconds when a keyID was returned by the Status RPC call. - // e.g. apiserver_envelope_encryption_key_id_hash_status_last_timestamp_seconds{apiserver_id_hash="sha256",key_id_hash="sha256", provider_name="providerName"} 1.674865558833728e+09 - KeyIDHashStatusLastTimestampSeconds = metrics.NewGaugeVec( - &metrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "key_id_hash_status_last_timestamp_seconds", - Help: "The last time in seconds when a keyID was returned by the Status RPC call.", - StabilityLevel: metrics.ALPHA, - }, - []string{"provider_name", "key_id_hash", "apiserver_id_hash"}, - ) - - InvalidKeyIDFromStatusTotal = metrics.NewCounterVec( - &metrics.CounterOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "invalid_key_id_from_status_total", - Help: "Number of times an invalid keyID is returned by the Status RPC call split by error.", - StabilityLevel: metrics.ALPHA, - }, - []string{"provider_name", "error"}, - ) - - DekSourceCacheSize = metrics.NewGaugeVec( - &metrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "dek_source_cache_size", - Help: "Number of records in data encryption key (DEK) source cache. On a restart, this value is an approximation of the number of decrypt RPC calls the server will make to the KMS plugin.", - StabilityLevel: metrics.ALPHA, - }, - []string{"provider_name"}, - ) -) - -var registerMetricsFunc sync.Once -var hashPool *sync.Pool - -func registerLRUMetrics() { - if keyIDHashTotalMetricLabels != nil { - keyIDHashTotalMetricLabels.Clear() - } - if keyIDHashStatusLastTimestampSecondsMetricLabels != nil { - keyIDHashStatusLastTimestampSecondsMetricLabels.Clear() - } - - keyIDHashTotalMetricLabels = lru.NewWithEvictionFunc(cacheSize, func(key lru.Key, _ interface{}) { - item := key.(metricLabels) - if deleted := KeyIDHashTotal.DeleteLabelValues(item.transformationType, item.providerName, item.keyIDHash, item.apiServerIDHash); deleted { - klog.InfoS("Deleted keyIDHashTotalMetricLabels", "transformationType", item.transformationType, - "providerName", item.providerName, "keyIDHash", item.keyIDHash, "apiServerIDHash", item.apiServerIDHash) - } - if deleted := KeyIDHashLastTimestampSeconds.DeleteLabelValues(item.transformationType, item.providerName, item.keyIDHash, item.apiServerIDHash); deleted { - klog.InfoS("Deleted keyIDHashLastTimestampSecondsMetricLabels", "transformationType", item.transformationType, - "providerName", item.providerName, "keyIDHash", item.keyIDHash, "apiServerIDHash", item.apiServerIDHash) - } - }) - keyIDHashStatusLastTimestampSecondsMetricLabels = lru.NewWithEvictionFunc(cacheSize, func(key lru.Key, _ interface{}) { - item := key.(metricLabels) - if deleted := KeyIDHashStatusLastTimestampSeconds.DeleteLabelValues(item.providerName, item.keyIDHash, item.apiServerIDHash); deleted { - klog.InfoS("Deleted keyIDHashStatusLastTimestampSecondsMetricLabels", "providerName", item.providerName, "keyIDHash", item.keyIDHash, "apiServerIDHash", item.apiServerIDHash) - } - }) -} -func RegisterMetrics() { - registerMetricsFunc.Do(func() { - registerLRUMetrics() - hashPool = &sync.Pool{ - New: func() interface{} { - return sha256.New() - }, - } - legacyregistry.MustRegister(dekCacheFillPercent) - legacyregistry.MustRegister(dekCacheInterArrivals) - legacyregistry.MustRegister(DekSourceCacheSize) - legacyregistry.MustRegister(KeyIDHashTotal) - legacyregistry.MustRegister(KeyIDHashLastTimestampSeconds) - legacyregistry.MustRegister(KeyIDHashStatusLastTimestampSeconds) - legacyregistry.MustRegister(InvalidKeyIDFromStatusTotal) - legacyregistry.MustRegister(KMSOperationsLatencyMetric) - }) -} - -// RecordKeyID records total count and last time in seconds when a KeyID was used for TransformFromStorage and TransformToStorage operations -func RecordKeyID(transformationType, providerName, keyID, apiServerID string) { - lockRecordKeyID.Lock() - defer lockRecordKeyID.Unlock() - - keyIDHash, apiServerIDHash := addLabelToCache(keyIDHashTotalMetricLabels, transformationType, providerName, keyID, apiServerID) - KeyIDHashTotal.WithLabelValues(transformationType, providerName, keyIDHash, apiServerIDHash).Inc() - KeyIDHashLastTimestampSeconds.WithLabelValues(transformationType, providerName, keyIDHash, apiServerIDHash).SetToCurrentTime() -} - -// RecordKeyIDFromStatus records last time in seconds when a KeyID was returned by the Status RPC call. -func RecordKeyIDFromStatus(providerName, keyID, apiServerID string) { - lockRecordKeyIDStatus.Lock() - defer lockRecordKeyIDStatus.Unlock() - - keyIDHash, apiServerIDHash := addLabelToCache(keyIDHashStatusLastTimestampSecondsMetricLabels, "", providerName, keyID, apiServerID) - KeyIDHashStatusLastTimestampSeconds.WithLabelValues(providerName, keyIDHash, apiServerIDHash).SetToCurrentTime() -} - -func RecordInvalidKeyIDFromStatus(providerName, errCode string) { - InvalidKeyIDFromStatusTotal.WithLabelValues(providerName, errCode).Inc() -} - -func RecordArrival(transformationType string, start time.Time) { - switch transformationType { - case FromStorageLabel: - lockLastFromStorage.Lock() - defer lockLastFromStorage.Unlock() - - if lastFromStorage.IsZero() { - lastFromStorage = start - } - dekCacheInterArrivals.WithLabelValues(transformationType).Observe(start.Sub(lastFromStorage).Seconds()) - lastFromStorage = start - case ToStorageLabel: - lockLastToStorage.Lock() - defer lockLastToStorage.Unlock() - - if lastToStorage.IsZero() { - lastToStorage = start - } - dekCacheInterArrivals.WithLabelValues(transformationType).Observe(start.Sub(lastToStorage).Seconds()) - lastToStorage = start - } -} - -func RecordDekCacheFillPercent(percent float64) { - dekCacheFillPercent.Set(percent) -} - -func RecordDekSourceCacheSize(providerName string, size int) { - DekSourceCacheSize.WithLabelValues(providerName).Set(float64(size)) -} - -// RecordKMSOperationLatency records the latency of KMS operation. -func RecordKMSOperationLatency(providerName, methodName string, duration time.Duration, err error) { - KMSOperationsLatencyMetric.WithLabelValues(providerName, methodName, getErrorCode(err)).Observe(duration.Seconds()) -} - -type gRPCError interface { - GRPCStatus() *status.Status -} - -func getErrorCode(err error) string { - if err == nil { - return codes.OK.String() - } - - // handle errors wrapped with fmt.Errorf and similar - var s gRPCError - if errors.As(err, &s) { - return s.GRPCStatus().Code().String() - } - - // This is not gRPC error. The operation must have failed before gRPC - // method was called, otherwise we would get gRPC error. - return "unknown-non-grpc" -} - -func getHash(data string) string { - if len(data) == 0 { - return "" - } - h := hashPool.Get().(hash.Hash) - h.Reset() - h.Write([]byte(data)) - dataHash := fmt.Sprintf("sha256:%x", h.Sum(nil)) - hashPool.Put(h) - return dataHash -} - -func addLabelToCache(c *lru.Cache, transformationType, providerName, keyID, apiServerID string) (string, string) { - keyIDHash := getHash(keyID) - apiServerIDHash := getHash(apiServerID) - c.Add(metricLabels{ - transformationType: transformationType, - providerName: providerName, - keyIDHash: keyIDHash, - apiServerIDHash: apiServerIDHash, - }, nil) // value is irrelevant, this is a set and not a map - return keyIDHash, apiServerIDHash -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/identity/identity.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/identity/identity.go deleted file mode 100644 index 8d967d706..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/identity/identity.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package identity - -import ( - "bytes" - "context" - "fmt" - - "k8s.io/apiserver/pkg/storage/value" -) - -var ( - transformer = identityTransformer{} - encryptedPrefix = []byte("k8s:enc:") - errEncryptedData = fmt.Errorf("identity transformer tried to read encrypted data") -) - -// identityTransformer performs no transformation on provided data, but validates -// that the data is not encrypted data during TransformFromStorage -type identityTransformer struct{} - -// NewEncryptCheckTransformer returns an identityTransformer which returns an error -// on attempts to read encrypted data -func NewEncryptCheckTransformer() value.Transformer { - return transformer -} - -// TransformFromStorage returns the input bytes if the data is not encrypted -func (identityTransformer) TransformFromStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, bool, error) { - // identityTransformer has to return an error if the data is encoded using another transformer. - // JSON data starts with '{'. Protobuf data has a prefix 'k8s[\x00-\xFF]'. - // Prefix 'k8s:enc:' is reserved for encrypted data on disk. - if bytes.HasPrefix(data, encryptedPrefix) { - return nil, false, errEncryptedData - } - return data, false, nil -} - -// TransformToStorage implements the Transformer interface for identityTransformer -func (identityTransformer) TransformToStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, error) { - return data, nil -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/secretbox/secretbox.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/secretbox/secretbox.go deleted file mode 100644 index 9aec8acd3..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/secretbox/secretbox.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package secretbox transforms values for storage at rest using XSalsa20 and Poly1305. -package secretbox - -import ( - "context" - "crypto/rand" - "fmt" - - "golang.org/x/crypto/nacl/secretbox" - - "k8s.io/apiserver/pkg/storage/value" -) - -// secretbox implements at rest encryption of the provided values given a 32 byte secret key. -// Uses a standard 24 byte nonce (placed at the beginning of the cipher text) generated -// from crypto/rand. Does not perform authentication of the data at rest. -type secretboxTransformer struct { - key [32]byte -} - -const nonceSize = 24 - -// NewSecretboxTransformer takes the given key and performs encryption and decryption on the given -// data. -func NewSecretboxTransformer(key [32]byte) value.Transformer { - return &secretboxTransformer{key: key} -} - -func (t *secretboxTransformer) TransformFromStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, bool, error) { - if len(data) < (secretbox.Overhead + nonceSize) { - return nil, false, fmt.Errorf("the stored data was shorter than the required size") - } - var nonce [nonceSize]byte - copy(nonce[:], data[:nonceSize]) - data = data[nonceSize:] - out := make([]byte, 0, len(data)-secretbox.Overhead) - result, ok := secretbox.Open(out, data, &nonce, &t.key) - if !ok { - return nil, false, fmt.Errorf("output array was not large enough for encryption") - } - return result, false, nil -} - -func (t *secretboxTransformer) TransformToStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, error) { - var nonce [nonceSize]byte - n, err := rand.Read(nonce[:]) - if err != nil { - return nil, err - } - if n != nonceSize { - return nil, fmt.Errorf("unable to read sufficient random bytes") - } - return secretbox.Seal(nonce[:], data, &nonce, &t.key), nil -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/metrics.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/value/metrics.go deleted file mode 100644 index d2b59a29d..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/metrics.go +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package value - -import ( - "errors" - "sync" - "time" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "k8s.io/component-base/metrics" - "k8s.io/component-base/metrics/legacyregistry" -) - -const ( - namespace = "apiserver" - subsystem = "storage" -) - -/* - * By default, all the following metrics are defined as falling under - * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/1209-metrics-stability/kubernetes-control-plane-metrics-stability.md#stability-classes) - * - * Promoting the stability level of the metric is a responsibility of the component owner, since it - * involves explicitly acknowledging support for the metric across multiple releases, in accordance with - * the metric stability policy. - */ -var ( - transformerLatencies = metrics.NewHistogramVec( - &metrics.HistogramOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "transformation_duration_seconds", - Help: "Latencies in seconds of value transformation operations.", - // In-process transformations (ex. AES CBC) complete on the order of 20 microseconds. However, when - // external KMS is involved latencies may climb into hundreds of milliseconds. - Buckets: metrics.ExponentialBuckets(5e-6, 2, 25), - StabilityLevel: metrics.ALPHA, - }, - []string{"transformation_type", "transformer_prefix"}, - ) - - transformerOperationsTotal = metrics.NewCounterVec( - &metrics.CounterOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "transformation_operations_total", - Help: "Total number of transformations. Successful transformation will have a status 'OK' and a varied status string when the transformation fails. The status, resource, and transformation_type fields can be used for alerting purposes. For example, you can monitor for encryption/decryption failures using the transformation_type (e.g., from_storage for decryption and to_storage for encryption). Additionally, these fields can be used to ensure that the correct transformers are applied to each resource.", - StabilityLevel: metrics.ALPHA, - }, - []string{"resource", "transformation_type", "transformer_prefix", "status"}, - ) - - envelopeTransformationCacheMissTotal = metrics.NewCounter( - &metrics.CounterOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "envelope_transformation_cache_misses_total", - Help: "Total number of cache misses while accessing key decryption key(KEK).", - StabilityLevel: metrics.ALPHA, - }, - ) - - dataKeyGenerationLatencies = metrics.NewHistogram( - &metrics.HistogramOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "data_key_generation_duration_seconds", - Help: "Latencies in seconds of data encryption key(DEK) generation operations.", - Buckets: metrics.ExponentialBuckets(5e-6, 2, 14), - StabilityLevel: metrics.ALPHA, - }, - ) - - dataKeyGenerationFailuresTotal = metrics.NewCounter( - &metrics.CounterOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "data_key_generation_failures_total", - Help: "Total number of failed data encryption key(DEK) generation operations.", - StabilityLevel: metrics.ALPHA, - }, - ) -) - -var registerMetrics sync.Once - -func RegisterMetrics() { - registerMetrics.Do(func() { - legacyregistry.MustRegister(transformerLatencies) - legacyregistry.MustRegister(transformerOperationsTotal) - legacyregistry.MustRegister(envelopeTransformationCacheMissTotal) - legacyregistry.MustRegister(dataKeyGenerationLatencies) - legacyregistry.MustRegister(dataKeyGenerationFailuresTotal) - }) -} - -// RecordTransformation records latencies and count of TransformFromStorage and TransformToStorage operations. -// Note that transformation_failures_total metric is deprecated, use transformation_operations_total instead. -func RecordTransformation(resource, transformationType, transformerPrefix string, elapsed time.Duration, err error) { - transformerOperationsTotal.WithLabelValues(resource, transformationType, transformerPrefix, getErrorCode(err)).Inc() - - if err == nil { - transformerLatencies.WithLabelValues(transformationType, transformerPrefix).Observe(elapsed.Seconds()) - } -} - -// RecordCacheMiss records a miss on Key Encryption Key(KEK) - call to KMS was required to decrypt KEK. -func RecordCacheMiss() { - envelopeTransformationCacheMissTotal.Inc() -} - -// RecordDataKeyGeneration records latencies and count of Data Encryption Key generation operations. -func RecordDataKeyGeneration(start time.Time, err error) { - if err != nil { - dataKeyGenerationFailuresTotal.Inc() - return - } - - dataKeyGenerationLatencies.Observe(sinceInSeconds(start)) -} - -// sinceInSeconds gets the time since the specified start in seconds. -func sinceInSeconds(start time.Time) float64 { - return time.Since(start).Seconds() -} - -type gRPCError interface { - GRPCStatus() *status.Status -} - -func getErrorCode(err error) string { - if err == nil { - return codes.OK.String() - } - - // handle errors wrapped with fmt.Errorf and similar - var s gRPCError - if errors.As(err, &s) { - return s.GRPCStatus().Code().String() - } - - // This is not gRPC error. The operation must have failed before gRPC - // method was called, otherwise we would get gRPC error. - return "unknown-non-grpc" -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/transformer.go b/e2e/vendor/k8s.io/apiserver/pkg/storage/value/transformer.go deleted file mode 100644 index eab90b3fa..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storage/value/transformer.go +++ /dev/null @@ -1,221 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package value contains methods for assisting with transformation of values in storage. -package value - -import ( - "bytes" - "context" - "fmt" - "time" - - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/errors" - genericapirequest "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/klog/v2" -) - -func init() { - RegisterMetrics() -} - -// Context is additional information that a storage transformation may need to verify the data at rest. -type Context interface { - // AuthenticatedData should return an array of bytes that describes the current value. If the value changes, - // the transformer may report the value as unreadable or tampered. This may be nil if no such description exists - // or is needed. For additional verification, set this to data that strongly identifies the value, such as - // the key and creation version of the stored data. - AuthenticatedData() []byte -} - -type Read interface { - // TransformFromStorage may transform the provided data from its underlying storage representation or return an error. - // Stale is true if the object on disk is stale and a write to etcd should be issued, even if the contents of the object - // have not changed. - TransformFromStorage(ctx context.Context, data []byte, dataCtx Context) (out []byte, stale bool, err error) -} - -type Write interface { - // TransformToStorage may transform the provided data into the appropriate form in storage or return an error. - TransformToStorage(ctx context.Context, data []byte, dataCtx Context) (out []byte, err error) -} - -// Transformer allows a value to be transformed before being read from or written to the underlying store. The methods -// must be able to undo the transformation caused by the other. -type Transformer interface { - Read - Write -} - -// ResourceTransformers returns a transformer for the provided resource. -type ResourceTransformers interface { - TransformerForResource(resource schema.GroupResource) Transformer -} - -// DefaultContext is a simple implementation of Context for a slice of bytes. -type DefaultContext []byte - -// AuthenticatedData returns itself. -func (c DefaultContext) AuthenticatedData() []byte { return c } - -// PrefixTransformer holds a transformer interface and the prefix that the transformation is located under. -type PrefixTransformer struct { - Prefix []byte - Transformer Transformer -} - -type prefixTransformers struct { - transformers []PrefixTransformer - err error -} - -var _ Transformer = &prefixTransformers{} - -// NewPrefixTransformers supports the Transformer interface by checking the incoming data against the provided -// prefixes in order. The first matching prefix will be used to transform the value (the prefix is stripped -// before the Transformer interface is invoked). The first provided transformer will be used when writing to -// the store. -func NewPrefixTransformers(err error, transformers ...PrefixTransformer) Transformer { - if err == nil { - err = fmt.Errorf("the provided value does not match any of the supported transformers") - } - return &prefixTransformers{ - transformers: transformers, - err: err, - } -} - -// TransformFromStorage finds the first transformer with a prefix matching the provided data and returns -// the result of transforming the value. It will always mark any transformation as stale that is not using -// the first transformer. -func (t *prefixTransformers) TransformFromStorage(ctx context.Context, data []byte, dataCtx Context) ([]byte, bool, error) { - start := time.Now() - var errs []error - resource := getResourceFromContext(ctx) - for i, transformer := range t.transformers { - if bytes.HasPrefix(data, transformer.Prefix) { - result, stale, err := transformer.Transformer.TransformFromStorage(ctx, data[len(transformer.Prefix):], dataCtx) - // To migrate away from encryption, user can specify an identity transformer higher up - // (in the config file) than the encryption transformer. In that scenario, the identity transformer needs to - // identify (during reads from disk) whether the data being read is encrypted or not. If the data is encrypted, - // it shall throw an error, but that error should not prevent the next subsequent transformer from being tried. - if len(transformer.Prefix) == 0 && err != nil { - continue - } - if len(transformer.Prefix) == 0 { - RecordTransformation(resource, "from_storage", "identity", time.Since(start), err) - } else { - RecordTransformation(resource, "from_storage", string(transformer.Prefix), time.Since(start), err) - } - - // It is valid to have overlapping prefixes when the same encryption provider - // is specified multiple times but with different keys (the first provider is - // being rotated to and some later provider is being rotated away from). - // - // Example: - // - // { - // "aescbc": { - // "keys": [ - // { - // "name": "2", - // "secret": "some key 2" - // } - // ] - // } - // }, - // { - // "aescbc": { - // "keys": [ - // { - // "name": "1", - // "secret": "some key 1" - // } - // ] - // } - // }, - // - // The transformers for both aescbc configs share the prefix k8s:enc:aescbc:v1: - // but a failure in the first one should not prevent a later match from being attempted. - // Thus we never short-circuit on a prefix match that results in an error. - if err != nil { - errs = append(errs, err) - continue - } - - return result, stale || i != 0, err - } - } - if err := errors.Reduce(errors.NewAggregate(errs)); err != nil { - logTransformErr(ctx, err, "failed to decrypt data") - return nil, false, err - } - RecordTransformation(resource, "from_storage", "unknown", time.Since(start), t.err) - return nil, false, t.err -} - -// TransformToStorage uses the first transformer and adds its prefix to the data. -func (t *prefixTransformers) TransformToStorage(ctx context.Context, data []byte, dataCtx Context) ([]byte, error) { - start := time.Now() - transformer := t.transformers[0] - resource := getResourceFromContext(ctx) - result, err := transformer.Transformer.TransformToStorage(ctx, data, dataCtx) - RecordTransformation(resource, "to_storage", string(transformer.Prefix), time.Since(start), err) - if err != nil { - logTransformErr(ctx, err, "failed to encrypt data") - return nil, err - } - prefixedData := make([]byte, len(transformer.Prefix), len(result)+len(transformer.Prefix)) - copy(prefixedData, transformer.Prefix) - prefixedData = append(prefixedData, result...) - return prefixedData, nil -} - -func logTransformErr(ctx context.Context, err error, message string) { - requestInfo := getRequestInfoFromContext(ctx) - if klogLevel6 := klog.V(6); klogLevel6.Enabled() { - klogLevel6.InfoSDepth( - 1, - message, - "err", err, - "group", requestInfo.APIGroup, - "version", requestInfo.APIVersion, - "resource", requestInfo.Resource, - "subresource", requestInfo.Subresource, - "verb", requestInfo.Verb, - "namespace", requestInfo.Namespace, - "name", requestInfo.Name, - ) - - return - } - - klog.ErrorSDepth(1, err, message) -} - -func getRequestInfoFromContext(ctx context.Context) *genericapirequest.RequestInfo { - if reqInfo, found := genericapirequest.RequestInfoFrom(ctx); found { - return reqInfo - } - klog.V(4).InfoSDepth(1, "no request info on context") - return &genericapirequest.RequestInfo{} -} - -func getResourceFromContext(ctx context.Context) string { - reqInfo := getRequestInfoFromContext(ctx) - return schema.GroupResource{Group: reqInfo.APIGroup, Resource: reqInfo.Resource}.String() -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storageversion/OWNERS b/e2e/vendor/k8s.io/apiserver/pkg/storageversion/OWNERS deleted file mode 100644 index 869b3da0d..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storageversion/OWNERS +++ /dev/null @@ -1,5 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - caesarxuchao - - roycaihw diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storageversion/manager.go b/e2e/vendor/k8s.io/apiserver/pkg/storageversion/manager.go deleted file mode 100644 index d7d386311..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storageversion/manager.go +++ /dev/null @@ -1,301 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package storageversion - -import ( - "fmt" - "sort" - "sync" - "sync/atomic" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" - _ "k8s.io/component-base/metrics/prometheus/workqueue" // for workqueue metric registration - "k8s.io/klog/v2" -) - -// ResourceInfo contains the information to register the resource to the -// storage version API. -type ResourceInfo struct { - GroupResource schema.GroupResource - - EncodingVersion string - // Used to calculate decodable versions. Can only be used after all - // equivalent versions are registered by InstallREST. - EquivalentResourceMapper runtime.EquivalentResourceRegistry - - // DirectlyDecodableVersions is a list of versions that the converter for REST storage knows how to convert. This - // contains items like apiextensions.k8s.io/v1beta1 even if we don't serve that version. - DirectlyDecodableVersions []schema.GroupVersion - - // ServedVersions holds a list of all versions of GroupResource that are served. Note that a server may be able to - // decode a particular version, but still not serve it. - ServedVersions []string -} - -// Manager records the resources whose StorageVersions need updates, and provides a method to update those StorageVersions. -type Manager interface { - // AddResourceInfo records resources whose StorageVersions need updates - AddResourceInfo(resources ...*ResourceInfo) - // UpdateStorageVersions tries to update the StorageVersions of the recorded resources - UpdateStorageVersions(kubeAPIServerClientConfig *rest.Config, apiserverID string) - // PendingUpdate returns true if the StorageVersion of the given resource is still pending update. - PendingUpdate(gr schema.GroupResource) bool - // LastUpdateError returns the last error hit when updating the storage version of the given resource. - LastUpdateError(gr schema.GroupResource) error - // Completed returns true if updating StorageVersions of all recorded resources has completed. - Completed() bool -} - -var _ Manager = &defaultManager{} - -// defaultManager indicates if an apiserver has completed reporting its storage versions. -type defaultManager struct { - completed atomic.Bool - - mu sync.RWMutex - // managedResourceInfos records the ResourceInfos whose StorageVersions will get updated in the next - // UpdateStorageVersions call - managedResourceInfos map[*ResourceInfo]struct{} - // managedStatus records the update status of StorageVersion for each GroupResource. Since one - // ResourceInfo may expand into multiple GroupResource (e.g. ingresses.networking.k8s.io and ingresses.extensions), - // this map allows quick status lookup for a GroupResource, during API request handling. - managedStatus map[schema.GroupResource]*updateStatus -} - -type updateStatus struct { - done bool - lastErr error -} - -// NewDefaultManager creates a new defaultManager. -func NewDefaultManager() Manager { - s := &defaultManager{} - s.completed.Store(false) - s.managedResourceInfos = make(map[*ResourceInfo]struct{}) - s.managedStatus = make(map[schema.GroupResource]*updateStatus) - return s -} - -// AddResourceInfo adds ResourceInfo to the manager. -func (s *defaultManager) AddResourceInfo(resources ...*ResourceInfo) { - s.mu.Lock() - defer s.mu.Unlock() - for _, r := range resources { - s.managedResourceInfos[r] = struct{}{} - s.addPendingManagedStatusLocked(r) - } -} - -func (s *defaultManager) addPendingManagedStatusLocked(r *ResourceInfo) { - gvrs := r.EquivalentResourceMapper.EquivalentResourcesFor(r.GroupResource.WithVersion(""), "") - for _, gvr := range gvrs { - gr := gvr.GroupResource() - if _, ok := s.managedStatus[gr]; !ok { - s.managedStatus[gr] = &updateStatus{} - } - } -} - -// UpdateStorageVersions tries to update the StorageVersions of the recorded resources -func (s *defaultManager) UpdateStorageVersions(kubeAPIServerClientConfig *rest.Config, serverID string) { - clientset, err := kubernetes.NewForConfig(kubeAPIServerClientConfig) - if err != nil { - utilruntime.HandleError(fmt.Errorf("failed to get clientset: %v", err)) - return - } - sc := clientset.InternalV1alpha1().StorageVersions() - - s.mu.RLock() - resources := []ResourceInfo{} - for resource := range s.managedResourceInfos { - resources = append(resources, *resource) - } - s.mu.RUnlock() - hasFailure := false - // Sorting the list to make sure we have a consistent dedup result, and - // therefore avoid creating unnecessarily duplicated StorageVersion objects. - // For example, extensions.ingresses and networking.k8s.io.ingresses share - // the same underlying storage. Without sorting, in an HA cluster, one - // apiserver may dedup and update StorageVersion for extensions.ingresses, - // while another apiserver may dedup and update StorageVersion for - // networking.k8s.io.ingresses. The storage migrator (which migrates objects - // per GroupResource) will migrate these resources twice, since both - // StorageVersion objects have CommonEncodingVersion (each with one server registered). - sortResourceInfosByGroupResource(resources) - for _, r := range dedupResourceInfos(resources) { - decodableVersions := decodableVersions(r.DirectlyDecodableVersions, r.EquivalentResourceMapper, r.GroupResource) - gr := r.GroupResource - // Group must be a valid subdomain in DNS (RFC 1123) - if len(gr.Group) == 0 { - gr.Group = "core" - } - - servedVersions := r.ServedVersions - - if err := updateStorageVersionFor(sc, serverID, gr, r.EncodingVersion, decodableVersions, servedVersions); err != nil { - utilruntime.HandleError(fmt.Errorf("failed to update storage version for %v: %v", r.GroupResource, err)) - s.recordStatusFailure(&r, err) - hasFailure = true - continue - } - klog.V(2).Infof("successfully updated storage version for %v", r.GroupResource) - s.recordStatusSuccess(&r) - } - if hasFailure { - return - } - klog.V(2).Infof("storage version updates complete") - s.setComplete() -} - -// dedupResourceInfos dedups ResourceInfos with the same underlying storage. -// ResourceInfos from the same Group with different Versions share the same underlying storage. -// ResourceInfos from different Groups may share the same underlying storage, e.g. -// networking.k8s.io ingresses and extensions ingresses. The StorageVersion manager -// only needs to update one StorageVersion for the equivalent Groups. -func dedupResourceInfos(infos []ResourceInfo) []ResourceInfo { - var ret []ResourceInfo - seen := make(map[schema.GroupResource]struct{}) - for _, info := range infos { - gr := info.GroupResource - if _, ok := seen[gr]; ok { - continue - } - gvrs := info.EquivalentResourceMapper.EquivalentResourcesFor(gr.WithVersion(""), "") - for _, gvr := range gvrs { - seen[gvr.GroupResource()] = struct{}{} - } - ret = append(ret, info) - } - return ret -} - -func sortResourceInfosByGroupResource(infos []ResourceInfo) { - sort.Sort(byGroupResource(infos)) -} - -type byGroupResource []ResourceInfo - -func (s byGroupResource) Len() int { return len(s) } - -func (s byGroupResource) Less(i, j int) bool { - if s[i].GroupResource.Group == s[j].GroupResource.Group { - return s[i].GroupResource.Resource < s[j].GroupResource.Resource - } - return s[i].GroupResource.Group < s[j].GroupResource.Group -} - -func (s byGroupResource) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// recordStatusSuccess marks updated ResourceInfo as completed. -func (s *defaultManager) recordStatusSuccess(r *ResourceInfo) { - s.mu.Lock() - defer s.mu.Unlock() - s.recordStatusSuccessLocked(r) -} - -func (s *defaultManager) recordStatusSuccessLocked(r *ResourceInfo) { - gvrs := r.EquivalentResourceMapper.EquivalentResourcesFor(r.GroupResource.WithVersion(""), "") - for _, gvr := range gvrs { - s.recordSuccessGroupResourceLocked(gvr.GroupResource()) - } -} - -func (s *defaultManager) recordSuccessGroupResourceLocked(gr schema.GroupResource) { - if _, ok := s.managedStatus[gr]; !ok { - return - } - s.managedStatus[gr].done = true - s.managedStatus[gr].lastErr = nil -} - -// recordStatusFailure records latest error updating ResourceInfo. -func (s *defaultManager) recordStatusFailure(r *ResourceInfo, err error) { - s.mu.Lock() - defer s.mu.Unlock() - s.recordStatusFailureLocked(r, err) -} - -func (s *defaultManager) recordStatusFailureLocked(r *ResourceInfo, err error) { - gvrs := r.EquivalentResourceMapper.EquivalentResourcesFor(r.GroupResource.WithVersion(""), "") - for _, gvr := range gvrs { - s.recordErrorGroupResourceLocked(gvr.GroupResource(), err) - } -} - -func (s *defaultManager) recordErrorGroupResourceLocked(gr schema.GroupResource, err error) { - if _, ok := s.managedStatus[gr]; !ok { - return - } - s.managedStatus[gr].lastErr = err -} - -// PendingUpdate returns if the StorageVersion of a resource is still wait to be updated. -func (s *defaultManager) PendingUpdate(gr schema.GroupResource) bool { - s.mu.RLock() - defer s.mu.RUnlock() - if _, ok := s.managedStatus[gr]; !ok { - return false - } - return !s.managedStatus[gr].done -} - -// LastUpdateError returns the last error hit when updating the storage version of the given resource. -func (s *defaultManager) LastUpdateError(gr schema.GroupResource) error { - s.mu.RLock() - defer s.mu.RUnlock() - if _, ok := s.managedStatus[gr]; !ok { - return fmt.Errorf("couldn't find managed status for %v", gr) - } - return s.managedStatus[gr].lastErr -} - -// setComplete marks the completion of updating StorageVersions. No write requests need to be blocked anymore. -func (s *defaultManager) setComplete() { - s.completed.Store(true) -} - -// Completed returns if updating StorageVersions has completed. -func (s *defaultManager) Completed() bool { - return s.completed.Load() -} - -func decodableVersions(directlyDecodableVersions []schema.GroupVersion, e runtime.EquivalentResourceRegistry, gr schema.GroupResource) []string { - var versions []string - for _, decodableVersions := range directlyDecodableVersions { - versions = append(versions, decodableVersions.String()) - } - - decodingGVRs := e.EquivalentResourcesFor(gr.WithVersion(""), "") - for _, v := range decodingGVRs { - found := false - for _, existingVersion := range versions { - if existingVersion == v.GroupVersion().String() { - found = true - } - } - if found { - continue - } - versions = append(versions, v.GroupVersion().String()) - } - return versions -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/storageversion/updater.go b/e2e/vendor/k8s.io/apiserver/pkg/storageversion/updater.go deleted file mode 100644 index abf7218bc..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/storageversion/updater.go +++ /dev/null @@ -1,197 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package storageversion - -import ( - "context" - "fmt" - "time" - - "k8s.io/api/apiserverinternal/v1alpha1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/klog/v2" -) - -// Client has the methods required to update the storage version. -type Client interface { - Create(context.Context, *v1alpha1.StorageVersion, metav1.CreateOptions) (*v1alpha1.StorageVersion, error) - UpdateStatus(context.Context, *v1alpha1.StorageVersion, metav1.UpdateOptions) (*v1alpha1.StorageVersion, error) - Get(context.Context, string, metav1.GetOptions) (*v1alpha1.StorageVersion, error) -} - -// SetCommonEncodingVersion updates the CommonEncodingVersion and the AllEncodingVersionsEqual -// condition based on the StorageVersions. -func SetCommonEncodingVersion(sv *v1alpha1.StorageVersion) { - var oldCommonEncodingVersion *string - if sv.Status.CommonEncodingVersion != nil { - version := *sv.Status.CommonEncodingVersion - oldCommonEncodingVersion = &version - } - sv.Status.CommonEncodingVersion = nil - if len(sv.Status.StorageVersions) != 0 { - firstVersion := sv.Status.StorageVersions[0].EncodingVersion - agreed := true - for _, ssv := range sv.Status.StorageVersions { - if ssv.EncodingVersion != firstVersion { - agreed = false - break - } - } - if agreed { - sv.Status.CommonEncodingVersion = &firstVersion - } - } - - condition := v1alpha1.StorageVersionCondition{ - Type: v1alpha1.AllEncodingVersionsEqual, - Status: v1alpha1.ConditionFalse, - ObservedGeneration: sv.Generation, - LastTransitionTime: metav1.NewTime(time.Now()), - Reason: "CommonEncodingVersionUnset", - Message: "Common encoding version unset", - } - if sv.Status.CommonEncodingVersion != nil { - condition.Status = v1alpha1.ConditionTrue - condition.Reason = "CommonEncodingVersionSet" - condition.Message = "Common encoding version set" - } - forceTransition := false - if oldCommonEncodingVersion != nil && sv.Status.CommonEncodingVersion != nil && - *oldCommonEncodingVersion != *sv.Status.CommonEncodingVersion { - forceTransition = true - } - setStatusCondition(&sv.Status.Conditions, condition, forceTransition) -} - -func findStatusCondition(conditions []v1alpha1.StorageVersionCondition, - conditionType v1alpha1.StorageVersionConditionType) *v1alpha1.StorageVersionCondition { - for i := range conditions { - if conditions[i].Type == conditionType { - return &conditions[i] - } - } - return nil -} - -// setStatusCondition sets the corresponding condition in conditions to newCondition. -// conditions must be non-nil. -// 1. if the condition of the specified type already exists: all fields of the existing condition are updated to -// newCondition, LastTransitionTime is set to now if the new status differs from the old status -// 2. if a condition of the specified type does not exist: LastTransitionTime is set to now() if unset, -// and newCondition is appended -// -// NOTE: forceTransition allows overwriting LastTransitionTime even when the status doesn't change. -func setStatusCondition(conditions *[]v1alpha1.StorageVersionCondition, newCondition v1alpha1.StorageVersionCondition, - forceTransition bool) { - if conditions == nil { - return - } - - if newCondition.LastTransitionTime.IsZero() { - newCondition.LastTransitionTime = metav1.NewTime(time.Now()) - } - existingCondition := findStatusCondition(*conditions, newCondition.Type) - if existingCondition == nil { - *conditions = append(*conditions, newCondition) - return - } - - statusChanged := existingCondition.Status != newCondition.Status - if statusChanged || forceTransition { - existingCondition.LastTransitionTime = newCondition.LastTransitionTime - } - existingCondition.Status = newCondition.Status - existingCondition.Reason = newCondition.Reason - existingCondition.Message = newCondition.Message - existingCondition.ObservedGeneration = newCondition.ObservedGeneration -} - -// updateStorageVersionFor updates the storage version object for the resource. -func updateStorageVersionFor(c Client, apiserverID string, gr schema.GroupResource, encodingVersion string, decodableVersions []string, servedVersions []string) error { - retries := 3 - var retry int - var err error - for retry < retries { - err = singleUpdate(c, apiserverID, gr, encodingVersion, decodableVersions, servedVersions) - if err == nil { - return nil - } - if apierrors.IsAlreadyExists(err) || apierrors.IsConflict(err) { - time.Sleep(1 * time.Second) - continue - } - if err != nil { - klog.Errorf("retry %d, failed to update storage version for %v: %v", retry, gr, err) - retry++ - time.Sleep(1 * time.Second) - } - } - return err -} - -func singleUpdate(c Client, apiserverID string, gr schema.GroupResource, encodingVersion string, decodableVersions []string, servedVersions []string) error { - shouldCreate := false - name := fmt.Sprintf("%s.%s", gr.Group, gr.Resource) - sv, err := c.Get(context.TODO(), name, metav1.GetOptions{}) - if err != nil && !apierrors.IsNotFound(err) { - return err - } - if apierrors.IsNotFound(err) { - shouldCreate = true - sv = &v1alpha1.StorageVersion{} - sv.ObjectMeta.Name = name - } - updatedSV := localUpdateStorageVersion(sv, apiserverID, encodingVersion, decodableVersions, servedVersions) - if shouldCreate { - createdSV, err := c.Create(context.TODO(), updatedSV, metav1.CreateOptions{}) - if err != nil { - return err - } - // assign the calculated status to the object just created, then update status - createdSV.Status = updatedSV.Status - _, err = c.UpdateStatus(context.TODO(), createdSV, metav1.UpdateOptions{}) - return err - } - _, err = c.UpdateStatus(context.TODO(), updatedSV, metav1.UpdateOptions{}) - return err -} - -// localUpdateStorageVersion updates the input storageversion with given server storageversion info. -// The function updates the input storageversion in place. -func localUpdateStorageVersion(sv *v1alpha1.StorageVersion, apiserverID, encodingVersion string, decodableVersions []string, servedVersions []string) *v1alpha1.StorageVersion { - newSSV := v1alpha1.ServerStorageVersion{ - APIServerID: apiserverID, - EncodingVersion: encodingVersion, - DecodableVersions: decodableVersions, - ServedVersions: servedVersions, - } - foundSSV := false - for i, ssv := range sv.Status.StorageVersions { - if ssv.APIServerID == apiserverID { - sv.Status.StorageVersions[i] = newSSV - foundSSV = true - break - } - } - if !foundSSV { - sv.Status.StorageVersions = append(sv.Status.StorageVersions, newSSV) - } - SetCommonEncodingVersion(sv) - return sv -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/apihelpers/helpers.go b/e2e/vendor/k8s.io/apiserver/pkg/util/apihelpers/helpers.go deleted file mode 100644 index e5365fc22..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/apihelpers/helpers.go +++ /dev/null @@ -1,118 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package apihelpers - -import ( - "sort" - - flowcontrol "k8s.io/api/flowcontrol/v1" - metainternalversionscheme "k8s.io/apimachinery/pkg/apis/meta/internalversion/scheme" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/apimachinery/pkg/runtime/serializer/cbor" - "k8s.io/apiserver/pkg/features" - utilfeature "k8s.io/apiserver/pkg/util/feature" -) - -// SetFlowSchemaCondition sets conditions. -func SetFlowSchemaCondition(flowSchema *flowcontrol.FlowSchema, newCondition flowcontrol.FlowSchemaCondition) { - existingCondition := GetFlowSchemaConditionByType(flowSchema, newCondition.Type) - if existingCondition == nil { - flowSchema.Status.Conditions = append(flowSchema.Status.Conditions, newCondition) - return - } - - if existingCondition.Status != newCondition.Status { - existingCondition.Status = newCondition.Status - existingCondition.LastTransitionTime = newCondition.LastTransitionTime - } - - existingCondition.Reason = newCondition.Reason - existingCondition.Message = newCondition.Message -} - -// GetFlowSchemaConditionByType gets conditions. -func GetFlowSchemaConditionByType(flowSchema *flowcontrol.FlowSchema, conditionType flowcontrol.FlowSchemaConditionType) *flowcontrol.FlowSchemaCondition { - for i := range flowSchema.Status.Conditions { - if flowSchema.Status.Conditions[i].Type == conditionType { - return &flowSchema.Status.Conditions[i] - } - } - return nil -} - -// SetPriorityLevelConfigurationCondition sets conditions. -func SetPriorityLevelConfigurationCondition(priorityLevel *flowcontrol.PriorityLevelConfiguration, newCondition flowcontrol.PriorityLevelConfigurationCondition) { - existingCondition := GetPriorityLevelConfigurationConditionByType(priorityLevel, newCondition.Type) - if existingCondition == nil { - priorityLevel.Status.Conditions = append(priorityLevel.Status.Conditions, newCondition) - return - } - - if existingCondition.Status != newCondition.Status { - existingCondition.Status = newCondition.Status - existingCondition.LastTransitionTime = newCondition.LastTransitionTime - } - - existingCondition.Reason = newCondition.Reason - existingCondition.Message = newCondition.Message -} - -// GetPriorityLevelConfigurationConditionByType gets conditions. -func GetPriorityLevelConfigurationConditionByType(priorityLevel *flowcontrol.PriorityLevelConfiguration, conditionType flowcontrol.PriorityLevelConfigurationConditionType) *flowcontrol.PriorityLevelConfigurationCondition { - for i := range priorityLevel.Status.Conditions { - if priorityLevel.Status.Conditions[i].Type == conditionType { - return &priorityLevel.Status.Conditions[i] - } - } - return nil -} - -var _ sort.Interface = FlowSchemaSequence{} - -// FlowSchemaSequence holds sorted set of pointers to FlowSchema objects. -// FlowSchemaSequence implements `sort.Interface` -type FlowSchemaSequence []*flowcontrol.FlowSchema - -func (s FlowSchemaSequence) Len() int { - return len(s) -} - -func (s FlowSchemaSequence) Less(i, j int) bool { - // the flow-schema w/ lower matching-precedence is prior - if ip, jp := s[i].Spec.MatchingPrecedence, s[j].Spec.MatchingPrecedence; ip != jp { - return ip < jp - } - // sort alphabetically - return s[i].Name < s[j].Name -} - -func (s FlowSchemaSequence) Swap(i, j int) { - s[i], s[j] = s[j], s[i] -} - -var metaInternalVersionCodecsWithCBOR = serializer.NewCodecFactory(metainternalversionscheme.Scheme, serializer.WithSerializer(cbor.NewSerializerInfo)) - -// GetMetaInternalVersionCodecs returns a negotiated serializer that recognizes the types from -// k8s.io/apimachinery/pkg/apis/meta/internalversion/scheme.Scheme. It will or will include a CBOR -// serializer if CBOR is enabled. -func GetMetaInternalVersionCodecs() runtime.NegotiatedSerializer { - if utilfeature.DefaultFeatureGate.Enabled(features.CBORServingAndStorage) { - return metaInternalVersionCodecsWithCBOR - } - return metainternalversionscheme.Codecs -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/dryrun/dryrun.go b/e2e/vendor/k8s.io/apiserver/pkg/util/dryrun/dryrun.go deleted file mode 100644 index 3e28c2934..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/dryrun/dryrun.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package dryrun - -// IsDryRun returns true if the DryRun flag is an actual dry-run. -func IsDryRun(flag []string) bool { - return len(flag) > 0 -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/OWNERS b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/OWNERS deleted file mode 100644 index fd722b2ac..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/OWNERS +++ /dev/null @@ -1,15 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - deads2k - - yue9944882 - - MikeSpreitzer -reviewers: - - deads2k - - yue9944882 - - MikeSpreitzer -labels: - - sig/api-machinery - - area/apiserver -emeritus_approvers: - - lavalamp diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_context.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_context.go deleted file mode 100644 index 1cd59049d..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_context.go +++ /dev/null @@ -1,93 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flowcontrol - -import ( - "context" - "sync" -) - -type priorityAndFairnessKeyType int - -const ( - // priorityAndFairnessInitializationSignalKey is a key under which - // initialization signal function for watch requests is stored - // in the context. - priorityAndFairnessInitializationSignalKey priorityAndFairnessKeyType = iota -) - -// WithInitializationSignal creates a copy of parent context with -// priority and fairness initialization signal value. -func WithInitializationSignal(ctx context.Context, signal InitializationSignal) context.Context { - return context.WithValue(ctx, priorityAndFairnessInitializationSignalKey, signal) -} - -// initializationSignalFrom returns an initialization signal function -// which when called signals that watch initialization has already finished -// to priority and fairness dispatcher. -func initializationSignalFrom(ctx context.Context) (InitializationSignal, bool) { - signal, ok := ctx.Value(priorityAndFairnessInitializationSignalKey).(InitializationSignal) - return signal, ok && signal != nil -} - -// WatchInitialized sends a signal to priority and fairness dispatcher -// that a given watch request has already been initialized. -func WatchInitialized(ctx context.Context) { - if signal, ok := initializationSignalFrom(ctx); ok { - signal.Signal() - } -} - -// RequestDelegated informs the priority and fairness dispatcher that -// a given request has been delegated to an aggregated API -// server. No-op when priority and fairness is disabled. -func RequestDelegated(ctx context.Context) { - // The watch initialization signal doesn't traverse request - // boundaries, so we generously fire it as soon as we know - // that the request won't be serviced locally. Safe to call - // for non-watch requests. - WatchInitialized(ctx) -} - -// InitializationSignal is an interface that allows sending and handling -// initialization signals. -type InitializationSignal interface { - // Signal notifies the dispatcher about finished initialization. - Signal() - // Wait waits for the initialization signal. - Wait() -} - -type initializationSignal struct { - once sync.Once - done chan struct{} -} - -func NewInitializationSignal() InitializationSignal { - return &initializationSignal{ - once: sync.Once{}, - done: make(chan struct{}), - } -} - -func (i *initializationSignal) Signal() { - i.once.Do(func() { close(i.done) }) -} - -func (i *initializationSignal) Wait() { - <-i.done -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_controller.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_controller.go deleted file mode 100644 index 652ef57ab..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_controller.go +++ /dev/null @@ -1,1162 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flowcontrol - -import ( - "context" - "crypto/sha256" - "encoding/binary" - "errors" - "fmt" - "math" - "math/rand" - "sort" - "sync" - "time" - - "github.com/google/go-cmp/cmp" //nolint:depguard - apiequality "k8s.io/apimachinery/pkg/api/equality" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - utilerrors "k8s.io/apimachinery/pkg/util/errors" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apimachinery/pkg/util/wait" - fcboot "k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap" - "k8s.io/apiserver/pkg/authentication/user" - "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/apiserver/pkg/util/apihelpers" - fq "k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing" - fcfmt "k8s.io/apiserver/pkg/util/flowcontrol/format" - "k8s.io/apiserver/pkg/util/flowcontrol/metrics" - fcrequest "k8s.io/apiserver/pkg/util/flowcontrol/request" - "k8s.io/client-go/tools/cache" - "k8s.io/client-go/util/workqueue" - "k8s.io/klog/v2" - "k8s.io/utils/clock" - - flowcontrol "k8s.io/api/flowcontrol/v1" - flowcontrolapplyconfiguration "k8s.io/client-go/applyconfigurations/flowcontrol/v1" - flowcontrolclient "k8s.io/client-go/kubernetes/typed/flowcontrol/v1" - flowcontrollister "k8s.io/client-go/listers/flowcontrol/v1" -) - -const timeFmt = "2006-01-02T15:04:05.999" - -const ( - // priorityLevelMaxSeatsPercent is the percentage of the nominalCL used as max seats allocatable from work estimator - priorityLevelMaxSeatsPercent = float64(0.15) -) - -// This file contains a simple local (to the apiserver) controller -// that digests API Priority and Fairness config objects (FlowSchema -// and PriorityLevelConfiguration) into the data structure that the -// filter uses. At this first level of development this controller -// takes the simplest possible approach: whenever notified of any -// change to any config object, or when any priority level that is -// undesired becomes completely unused, all the config objects are -// read and processed as a whole. - -const ( - // Borrowing among priority levels will be accomplished by periodically - // adjusting the current concurrency limits (CurrentCLs); - // borrowingAdjustmentPeriod is that period. - borrowingAdjustmentPeriod = 10 * time.Second - - // The input to the seat borrowing is smoothed seat demand figures. - // This constant controls the decay rate of that smoothing, - // as described in the comment on the `seatDemandStats` field of `priorityLevelState`. - // The particular number appearing here has the property that half-life - // of that decay is 5 minutes. - // This is a very preliminary guess at a good value and is likely to be tweaked - // once we get some experience with borrowing. - seatDemandSmoothingCoefficient = 0.977 -) - -// The funcs in this package follow the naming convention that the suffix -// "Locked" means the relevant mutex must be locked at the start of each -// call and will be locked upon return. For a configController, the -// suffix "ReadLocked" stipulates a read lock while just "Locked" -// stipulates a full lock. Absence of either suffix means that either -// (a) the lock must NOT be held at call time and will not be held -// upon return or (b) locking is irrelevant. - -// StartFunction begins the process of handling a request. If the -// request gets queued then this function uses the given hashValue as -// the source of entropy as it shuffle-shards the request into a -// queue. The descr1 and descr2 values play no role in the logic but -// appear in log messages. This method does not return until the -// queuing, if any, for this request is done. If `execute` is false -// then `afterExecution` is irrelevant and the request should be -// rejected. Otherwise the request should be executed and -// `afterExecution` must be called exactly once. -type StartFunction func(ctx context.Context, hashValue uint64) (execute bool, afterExecution func()) - -// RequestDigest holds necessary info from request for flow-control -type RequestDigest struct { - RequestInfo *request.RequestInfo - User user.Info -} - -// `*configController` maintains eventual consistency with the API -// objects that configure API Priority and Fairness, and provides a -// procedural interface to the configured behavior. The methods of -// this type and cfgMeal follow the convention that the suffix -// "Locked" means that the caller must hold the configController lock. -type configController struct { - name string // varies in tests of fighting controllers - clock clock.PassiveClock - queueSetFactory fq.QueueSetFactory - reqsGaugeVec metrics.RatioedGaugeVec - execSeatsGaugeVec metrics.RatioedGaugeVec - - // How this controller appears in an ObjectMeta ManagedFieldsEntry.Manager - asFieldManager string - - // Given a boolean indicating whether a FlowSchema's referenced - // PriorityLevelConfig exists, return a boolean indicating whether - // the reference is dangling - foundToDangling func(bool) bool - - // configQueue holds `(interface{})(0)` when the configuration - // objects need to be reprocessed. - configQueue workqueue.TypedRateLimitingInterface[int] - - plLister flowcontrollister.PriorityLevelConfigurationLister - plInformerSynced cache.InformerSynced - - fsLister flowcontrollister.FlowSchemaLister - fsInformerSynced cache.InformerSynced - - flowcontrolClient flowcontrolclient.FlowcontrolV1Interface - - // serverConcurrencyLimit is the limit on the server's total - // number of non-exempt requests being served at once. This comes - // from server configuration. - serverConcurrencyLimit int - - // watchTracker implements the necessary WatchTracker interface. - WatchTracker - - // MaxSeatsTracker tracks the maximum seats that should be allocatable from the - // work estimator for a given priority level. This controller does not enforce - // any limits on max seats stored in this tracker, it is up to the work estimator - // to set lower/upper limits on max seats (currently min=1, max=10). - MaxSeatsTracker - - // the most recent update attempts, ordered by increasing age. - // Consumer trims to keep only the last minute's worth of entries. - // The controller uses this to limit itself to at most six updates - // to a given FlowSchema in any minute. - // This may only be accessed from the one and only worker goroutine. - mostRecentUpdates []updateAttempt - - // This must be locked while accessing the later fields. - // A lock for writing is needed - // for writing to any of the following: - // - the flowSchemas field - // - the slice held in the flowSchemas field - // - the priorityLevelStates field - // - the map held in the priorityLevelStates field - // - any field of a priorityLevelState held in that map - lock sync.RWMutex - - // flowSchemas holds the flow schema objects, sorted by increasing - // numerical (decreasing logical) matching precedence. Every - // FlowSchema in this slice is immutable. - flowSchemas apihelpers.FlowSchemaSequence - - // priorityLevelStates maps the PriorityLevelConfiguration object - // name to the state for that level. Every name referenced from a - // member of `flowSchemas` has an entry here. - priorityLevelStates map[string]*priorityLevelState - - // nominalCLSum is the sum of the nominalCL fields in the priorityLevelState records. - // This can exceed serverConcurrencyLimit because of the deliberate rounding up - // in the computation of the nominalCL values. - // This is tracked because it is an input to the allocation adjustment algorithm. - nominalCLSum int -} - -type updateAttempt struct { - timeUpdated time.Time - updatedItems sets.String // FlowSchema names -} - -// priorityLevelState holds the state specific to a priority level. -type priorityLevelState struct { - // the API object or prototype prescribing this level. Nothing - // reached through this pointer is mutable. - pl *flowcontrol.PriorityLevelConfiguration - - // qsCompleter holds the QueueSetCompleter derived from `pl` - // and `queues`. - qsCompleter fq.QueueSetCompleter - - // The QueueSet for this priority level. - // Never nil. - queues fq.QueueSet - - // quiescing==true indicates that this priority level should be - // removed when its queues have all drained. - quiescing bool - - // number of goroutines between Controller::Match and calling the - // returned StartFunction - numPending int - - // Observers tracking number of requests waiting, executing - reqsGaugePair metrics.RatioedGaugePair - - // Observer of number of seats occupied throughout execution - execSeatsObs metrics.RatioedGauge - - // Integrator of seat demand, reset every CurrentCL adjustment period - seatDemandIntegrator fq.Integrator - - // Gauge of seat demand / nominalCL - seatDemandRatioedGauge metrics.RatioedGauge - - // seatDemandStats is derived from periodically examining the seatDemandIntegrator. - // The average, standard deviation, and high watermark come directly from the integrator. - // envelope = avg + stdDev. - // Periodically smoothed gets replaced with `max(envelope, A*smoothed + (1-A)*envelope)`, - // where A is seatDemandSmoothingCoefficient. - seatDemandStats seatDemandStats - - // nominalCL is the nominal concurrency limit configured in the PriorityLevelConfiguration - nominalCL int - - // minCL is the nominal limit less the lendable amount - minCL int - - //maxCL is the nominal limit plus the amount that may be borrowed - maxCL int - - // currentCL is the dynamically derived concurrency limit to impose for now - currentCL int -} - -type seatDemandStats struct { - avg float64 - stdDev float64 - highWatermark int - smoothed float64 -} - -func (stats *seatDemandStats) update(obs fq.IntegratorResults) { - stats.highWatermark = int(math.Round(obs.Max)) - if obs.Duration <= 0 { - return - } - if math.IsNaN(obs.Deviation) { - obs.Deviation = 0 - } - stats.avg = obs.Average - stats.stdDev = obs.Deviation - envelope := obs.Average + obs.Deviation - stats.smoothed = math.Max(envelope, seatDemandSmoothingCoefficient*stats.smoothed+(1-seatDemandSmoothingCoefficient)*envelope) -} - -// NewTestableController is extra flexible to facilitate testing -func newTestableController(config TestableConfig) *configController { - cfgCtlr := &configController{ - name: config.Name, - clock: config.Clock, - queueSetFactory: config.QueueSetFactory, - reqsGaugeVec: config.ReqsGaugeVec, - execSeatsGaugeVec: config.ExecSeatsGaugeVec, - asFieldManager: config.AsFieldManager, - foundToDangling: config.FoundToDangling, - serverConcurrencyLimit: config.ServerConcurrencyLimit, - flowcontrolClient: config.FlowcontrolClient, - priorityLevelStates: make(map[string]*priorityLevelState), - WatchTracker: NewWatchTracker(), - MaxSeatsTracker: NewMaxSeatsTracker(), - } - klog.V(2).Infof("NewTestableController %q with serverConcurrencyLimit=%d, name=%s, asFieldManager=%q", cfgCtlr.name, cfgCtlr.serverConcurrencyLimit, cfgCtlr.name, cfgCtlr.asFieldManager) - // Start with longish delay because conflicts will be between - // different processes, so take some time to go away. - cfgCtlr.configQueue = workqueue.NewTypedRateLimitingQueueWithConfig( - workqueue.NewTypedItemExponentialFailureRateLimiter[int](200*time.Millisecond, 8*time.Hour), - workqueue.TypedRateLimitingQueueConfig[int]{Name: "priority_and_fairness_config_queue"}, - ) - // ensure the data structure reflects the mandatory config - cfgCtlr.lockAndDigestConfigObjects(nil, nil) - fci := config.InformerFactory.Flowcontrol().V1() - pli := fci.PriorityLevelConfigurations() - fsi := fci.FlowSchemas() - cfgCtlr.plLister = pli.Lister() - cfgCtlr.plInformerSynced = pli.Informer().HasSynced - cfgCtlr.fsLister = fsi.Lister() - cfgCtlr.fsInformerSynced = fsi.Informer().HasSynced - pli.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ - AddFunc: func(obj interface{}) { - pl := obj.(*flowcontrol.PriorityLevelConfiguration) - klog.V(7).Infof("Triggered API priority and fairness config reloading in %s due to creation of PLC %s", cfgCtlr.name, pl.Name) - cfgCtlr.configQueue.Add(0) - }, - UpdateFunc: func(oldObj, newObj interface{}) { - newPL := newObj.(*flowcontrol.PriorityLevelConfiguration) - oldPL := oldObj.(*flowcontrol.PriorityLevelConfiguration) - if !apiequality.Semantic.DeepEqual(oldPL.Spec, newPL.Spec) { - klog.V(7).Infof("Triggered API priority and fairness config reloading in %s due to spec update of PLC %s", cfgCtlr.name, newPL.Name) - cfgCtlr.configQueue.Add(0) - } else { - klog.V(7).Infof("No trigger API priority and fairness config reloading in %s due to spec non-change of PLC %s", cfgCtlr.name, newPL.Name) - } - }, - DeleteFunc: func(obj interface{}) { - name, _ := cache.DeletionHandlingMetaNamespaceKeyFunc(obj) - klog.V(7).Infof("Triggered API priority and fairness config reloading in %s due to deletion of PLC %s", cfgCtlr.name, name) - cfgCtlr.configQueue.Add(0) - - }}) - fsi.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ - AddFunc: func(obj interface{}) { - fs := obj.(*flowcontrol.FlowSchema) - klog.V(7).Infof("Triggered API priority and fairness config reloading in %s due to creation of FS %s", cfgCtlr.name, fs.Name) - cfgCtlr.configQueue.Add(0) - }, - UpdateFunc: func(oldObj, newObj interface{}) { - newFS := newObj.(*flowcontrol.FlowSchema) - oldFS := oldObj.(*flowcontrol.FlowSchema) - // Changes to either Spec or Status are relevant. The - // concern is that we might, in some future release, want - // different behavior than is implemented now. One of the - // hardest questions is how does an operator roll out the - // new release in a cluster with multiple kube-apiservers - // --- in a way that works no matter what servers crash - // and restart when. If this handler reacts only to - // changes in Spec then we have a scenario in which the - // rollout leaves the old Status in place. The scenario - // ends with this subsequence: deploy the last new server - // before deleting the last old server, and in between - // those two operations the last old server crashes and - // recovers. The chosen solution is making this controller - // insist on maintaining the particular state that it - // establishes. - if !(apiequality.Semantic.DeepEqual(oldFS.Spec, newFS.Spec) && - apiequality.Semantic.DeepEqual(oldFS.Status, newFS.Status)) { - klog.V(7).Infof("Triggered API priority and fairness config reloading in %s due to spec and/or status update of FS %s", cfgCtlr.name, newFS.Name) - cfgCtlr.configQueue.Add(0) - } else { - klog.V(7).Infof("No trigger of API priority and fairness config reloading in %s due to spec and status non-change of FS %s", cfgCtlr.name, newFS.Name) - } - }, - DeleteFunc: func(obj interface{}) { - name, _ := cache.DeletionHandlingMetaNamespaceKeyFunc(obj) - klog.V(7).Infof("Triggered API priority and fairness config reloading in %s due to deletion of FS %s", cfgCtlr.name, name) - cfgCtlr.configQueue.Add(0) - - }}) - return cfgCtlr -} - -func (cfgCtlr *configController) Run(stopCh <-chan struct{}) error { - defer utilruntime.HandleCrash() - - // Let the config worker stop when we are done - defer cfgCtlr.configQueue.ShutDown() - - klog.Info("Starting API Priority and Fairness config controller") - if ok := cache.WaitForCacheSync(stopCh, cfgCtlr.plInformerSynced, cfgCtlr.fsInformerSynced); !ok { - return fmt.Errorf("Never achieved initial sync") - } - - klog.Info("Running API Priority and Fairness config worker") - go wait.Until(cfgCtlr.runWorker, time.Second, stopCh) - - klog.Info("Running API Priority and Fairness periodic rebalancing process") - go wait.Until(cfgCtlr.updateBorrowing, borrowingAdjustmentPeriod, stopCh) - - <-stopCh - klog.Info("Shutting down API Priority and Fairness config worker") - return nil -} - -func (cfgCtlr *configController) updateBorrowing() { - cfgCtlr.lock.Lock() - defer cfgCtlr.lock.Unlock() - cfgCtlr.updateBorrowingLocked(true, cfgCtlr.priorityLevelStates) -} - -func (cfgCtlr *configController) updateBorrowingLocked(setCompleters bool, plStates map[string]*priorityLevelState) { - items := make([]allocProblemItem, 0, len(plStates)) - nonExemptPLNames := make([]string, 0, len(plStates)) - idxOfNonExempt := map[string]int{} // items index of non-exempt classes - cclOfExempt := map[string]int{} // minCurrentCL of exempt classes - var minCLSum, minCurrentCLSum int // sums over non-exempt classes - remainingServerCL := cfgCtlr.nominalCLSum - for plName, plState := range plStates { - obs := plState.seatDemandIntegrator.Reset() - plState.seatDemandStats.update(obs) - var minCurrentCL int - if plState.pl.Spec.Type == flowcontrol.PriorityLevelEnablementExempt { - minCurrentCL = max(plState.minCL, plState.seatDemandStats.highWatermark) - cclOfExempt[plName] = minCurrentCL - remainingServerCL -= minCurrentCL - } else { - // Lower bound on this priority level's adjusted concurreny limit is the lesser of: - // - its seat demamd high watermark over the last adjustment period, and - // - its configured concurrency limit. - // BUT: we do not want this to be lower than the lower bound from configuration. - // See KEP-1040 for a more detailed explanation. - minCurrentCL = max(plState.minCL, min(plState.nominalCL, plState.seatDemandStats.highWatermark)) - idxOfNonExempt[plName] = len(items) - nonExemptPLNames = append(nonExemptPLNames, plName) - items = append(items, allocProblemItem{ - lowerBound: float64(minCurrentCL), - upperBound: float64(plState.maxCL), - target: math.Max(float64(minCurrentCL), plState.seatDemandStats.smoothed), - }) - minCLSum += plState.minCL - minCurrentCLSum += minCurrentCL - } - } - if len(items) == 0 && cfgCtlr.nominalCLSum > 0 { - klog.ErrorS(nil, "Impossible: no priority levels", "plStates", cfgCtlr.priorityLevelStates) - return - } - var allocs []float64 - var shareFrac, fairFrac float64 - var err error - if remainingServerCL <= minCLSum { - metrics.SetFairFrac(0) - } else if remainingServerCL <= minCurrentCLSum { - shareFrac = float64(remainingServerCL-minCLSum) / float64(minCurrentCLSum-minCLSum) - metrics.SetFairFrac(0) - } else { - allocs, fairFrac, err = computeConcurrencyAllocation(cfgCtlr.nominalCLSum, items) - if err != nil { - klog.ErrorS(err, "Unable to derive new concurrency limits", "plNames", nonExemptPLNames, "items", items) - allocs = make([]float64, len(items)) - for idx, plName := range nonExemptPLNames { - plState := plStates[plName] - allocs[idx] = float64(plState.currentCL) - } - } - metrics.SetFairFrac(float64(fairFrac)) - } - for plName, plState := range plStates { - idx, isNonExempt := idxOfNonExempt[plName] - if setCompleters { - qsCompleter, err := queueSetCompleterForPL(cfgCtlr.queueSetFactory, plState.queues, - plState.pl, plState.reqsGaugePair, plState.execSeatsObs, - metrics.NewUnionGauge(plState.seatDemandIntegrator, plState.seatDemandRatioedGauge)) - if err != nil { - klog.ErrorS(err, "Inconceivable! Configuration error in existing priority level", "pl", plState.pl) - continue - } - plState.qsCompleter = qsCompleter - } - var currentCL int - if !isNonExempt { - currentCL = cclOfExempt[plName] - } else if remainingServerCL <= minCLSum { - currentCL = plState.minCL - } else if remainingServerCL <= minCurrentCLSum { - minCurrentCL := max(plState.minCL, min(plState.nominalCL, plState.seatDemandStats.highWatermark)) - currentCL = plState.minCL + int(math.Round(float64(minCurrentCL-plState.minCL)*shareFrac)) - } else { - currentCL = int(math.Round(float64(allocs[idx]))) - } - relChange := relDiff(float64(currentCL), float64(plState.currentCL)) - plState.currentCL = currentCL - metrics.NotePriorityLevelConcurrencyAdjustment(plState.pl.Name, float64(plState.seatDemandStats.highWatermark), plState.seatDemandStats.avg, plState.seatDemandStats.stdDev, plState.seatDemandStats.smoothed, float64(items[idx].target), currentCL) - logLevel := klog.Level(4) - if relChange >= 0.05 { - logLevel = 2 - } - var concurrencyDenominator int - if currentCL > 0 { - concurrencyDenominator = currentCL - } else { - concurrencyDenominator = int(math.Max(1, math.Round(float64(cfgCtlr.serverConcurrencyLimit)/10))) - } - plState.seatDemandRatioedGauge.SetDenominator(float64(concurrencyDenominator)) - klog.V(logLevel).InfoS("Update CurrentCL", "plName", plName, "seatDemandHighWatermark", plState.seatDemandStats.highWatermark, "seatDemandAvg", plState.seatDemandStats.avg, "seatDemandStdev", plState.seatDemandStats.stdDev, "seatDemandSmoothed", plState.seatDemandStats.smoothed, "fairFrac", fairFrac, "currentCL", currentCL, "concurrencyDenominator", concurrencyDenominator, "backstop", err != nil) - plState.queues = plState.qsCompleter.Complete(fq.DispatchingConfig{ConcurrencyLimit: currentCL, ConcurrencyDenominator: concurrencyDenominator}) - } -} - -// runWorker is the logic of the one and only worker goroutine. We -// limit the number to one in order to obviate explicit -// synchronization around access to `cfgCtlr.mostRecentUpdates`. -func (cfgCtlr *configController) runWorker() { - for cfgCtlr.processNextWorkItem() { - } -} - -// processNextWorkItem works on one entry from the work queue. -// Only invoke this in the one and only worker goroutine. -func (cfgCtlr *configController) processNextWorkItem() bool { - obj, shutdown := cfgCtlr.configQueue.Get() - if shutdown { - return false - } - - func(obj int) { - defer cfgCtlr.configQueue.Done(obj) - specificDelay, err := cfgCtlr.syncOne() - switch { - case err != nil: - klog.Error(err) - cfgCtlr.configQueue.AddRateLimited(obj) - case specificDelay > 0: - cfgCtlr.configQueue.AddAfter(obj, specificDelay) - default: - cfgCtlr.configQueue.Forget(obj) - } - }(obj) - - return true -} - -// syncOne does one full synchronization. It reads all the API -// objects that configure API Priority and Fairness and updates the -// local configController accordingly. -// Only invoke this in the one and only worker goroutine -func (cfgCtlr *configController) syncOne() (specificDelay time.Duration, err error) { - klog.V(5).Infof("%s syncOne at %s", cfgCtlr.name, cfgCtlr.clock.Now().Format(timeFmt)) - all := labels.Everything() - newPLs, err := cfgCtlr.plLister.List(all) - if err != nil { - return 0, fmt.Errorf("unable to list PriorityLevelConfiguration objects: %w", err) - } - newFSs, err := cfgCtlr.fsLister.List(all) - if err != nil { - return 0, fmt.Errorf("unable to list FlowSchema objects: %w", err) - } - return cfgCtlr.digestConfigObjects(newPLs, newFSs) -} - -// cfgMeal is the data involved in the process of digesting the API -// objects that configure API Priority and Fairness. All the config -// objects are digested together, because this is the simplest way to -// cope with the various dependencies between objects. The process of -// digestion is done in four passes over config objects --- three -// passes over PriorityLevelConfigurations and one pass over the -// FlowSchemas --- with the work dvided among the passes according to -// those dependencies. -type cfgMeal struct { - cfgCtlr *configController - - newPLStates map[string]*priorityLevelState - - // The sum of the concurrency shares of the priority levels in the - // new configuration - shareSum float64 - - // These keep track of which mandatory priority level config - // objects have been digested - haveExemptPL, haveCatchAllPL bool - - // Buffered FlowSchema status updates to do. Do them when the - // lock is not held, to avoid a deadlock due to such a request - // provoking a call into this controller while the lock held - // waiting on that request to complete. - fsStatusUpdates []fsStatusUpdate - - maxWaitingRequests, maxExecutingRequests int -} - -// A buffered set of status updates for FlowSchemas -type fsStatusUpdate struct { - flowSchema *flowcontrol.FlowSchema - condition flowcontrol.FlowSchemaCondition - oldValue flowcontrol.FlowSchemaCondition -} - -// digestConfigObjects is given all the API objects that configure -// cfgCtlr and writes its consequent new configState. -// Only invoke this in the one and only worker goroutine -func (cfgCtlr *configController) digestConfigObjects(newPLs []*flowcontrol.PriorityLevelConfiguration, newFSs []*flowcontrol.FlowSchema) (time.Duration, error) { - fsStatusUpdates := cfgCtlr.lockAndDigestConfigObjects(newPLs, newFSs) - var errs []error - currResult := updateAttempt{ - timeUpdated: cfgCtlr.clock.Now(), - updatedItems: sets.String{}, - } - var suggestedDelay time.Duration - for _, fsu := range fsStatusUpdates { - // if we should skip this name, indicate we will need a delay, but continue with other entries - if cfgCtlr.shouldDelayUpdate(fsu.flowSchema.Name) { - if suggestedDelay == 0 { - suggestedDelay = time.Duration(30+rand.Intn(45)) * time.Second - } - continue - } - - // if we are going to issue an update, be sure we track every name we update so we know if we update it too often. - currResult.updatedItems.Insert(fsu.flowSchema.Name) - if klogV := klog.V(4); klogV.Enabled() { - klogV.Infof("%s writing Condition %s to FlowSchema %s, which had ResourceVersion=%s, because its previous value was %s, diff: %s", - cfgCtlr.name, fsu.condition, fsu.flowSchema.Name, fsu.flowSchema.ResourceVersion, fcfmt.Fmt(fsu.oldValue), cmp.Diff(fsu.oldValue, fsu.condition)) - } - - if err := apply(cfgCtlr.flowcontrolClient.FlowSchemas(), fsu, cfgCtlr.asFieldManager); err != nil { - if apierrors.IsNotFound(err) { - // This object has been deleted. A notification is coming - // and nothing more needs to be done here. - klog.V(5).Infof("%s at %s: attempted update of concurrently deleted FlowSchema %s; nothing more needs to be done", cfgCtlr.name, cfgCtlr.clock.Now().Format(timeFmt), fsu.flowSchema.Name) - } else { - errs = append(errs, fmt.Errorf("failed to set a status.condition for FlowSchema %s: %w", fsu.flowSchema.Name, err)) - } - } - } - cfgCtlr.addUpdateResult(currResult) - - return suggestedDelay, utilerrors.NewAggregate(errs) -} - -func apply(client flowcontrolclient.FlowSchemaInterface, fsu fsStatusUpdate, asFieldManager string) error { - applyOptions := metav1.ApplyOptions{FieldManager: asFieldManager, Force: true} - - // the condition field in fsStatusUpdate holds the new condition we want to update. - // TODO: this will break when we have multiple conditions for a flowschema - _, err := client.ApplyStatus(context.TODO(), toFlowSchemaApplyConfiguration(fsu), applyOptions) - return err -} - -func toFlowSchemaApplyConfiguration(fsUpdate fsStatusUpdate) *flowcontrolapplyconfiguration.FlowSchemaApplyConfiguration { - condition := flowcontrolapplyconfiguration.FlowSchemaCondition(). - WithType(fsUpdate.condition.Type). - WithStatus(fsUpdate.condition.Status). - WithReason(fsUpdate.condition.Reason). - WithLastTransitionTime(fsUpdate.condition.LastTransitionTime). - WithMessage(fsUpdate.condition.Message) - - return flowcontrolapplyconfiguration.FlowSchema(fsUpdate.flowSchema.Name). - WithStatus(flowcontrolapplyconfiguration.FlowSchemaStatus(). - WithConditions(condition), - ) -} - -// shouldDelayUpdate checks to see if a flowschema has been updated too often and returns true if a delay is needed. -// Only invoke this in the one and only worker goroutine -func (cfgCtlr *configController) shouldDelayUpdate(flowSchemaName string) bool { - numUpdatesInPastMinute := 0 - oneMinuteAgo := cfgCtlr.clock.Now().Add(-1 * time.Minute) - for idx, update := range cfgCtlr.mostRecentUpdates { - if oneMinuteAgo.After(update.timeUpdated) { - // this and the remaining items are no longer relevant - cfgCtlr.mostRecentUpdates = cfgCtlr.mostRecentUpdates[:idx] - return false - } - if update.updatedItems.Has(flowSchemaName) { - numUpdatesInPastMinute++ - if numUpdatesInPastMinute > 5 { - return true - } - } - } - return false -} - -// addUpdateResult adds the result. It isn't a ring buffer because -// this is small and rate limited. -// Only invoke this in the one and only worker goroutine -func (cfgCtlr *configController) addUpdateResult(result updateAttempt) { - cfgCtlr.mostRecentUpdates = append([]updateAttempt{result}, cfgCtlr.mostRecentUpdates...) -} - -func (cfgCtlr *configController) lockAndDigestConfigObjects(newPLs []*flowcontrol.PriorityLevelConfiguration, newFSs []*flowcontrol.FlowSchema) []fsStatusUpdate { - cfgCtlr.lock.Lock() - defer cfgCtlr.lock.Unlock() - meal := cfgMeal{ - cfgCtlr: cfgCtlr, - newPLStates: make(map[string]*priorityLevelState), - } - - meal.digestNewPLsLocked(newPLs) - meal.digestFlowSchemasLocked(newFSs) - meal.processOldPLsLocked() - - // Supply missing mandatory PriorityLevelConfiguration objects - if !meal.haveExemptPL { - meal.imaginePL(fcboot.MandatoryPriorityLevelConfigurationExempt) - } - if !meal.haveCatchAllPL { - meal.imaginePL(fcboot.MandatoryPriorityLevelConfigurationCatchAll) - } - - meal.finishQueueSetReconfigsLocked() - - // The new config has been constructed - cfgCtlr.priorityLevelStates = meal.newPLStates - klog.V(5).InfoS("Switched to new API Priority and Fairness configuration", "maxWaitingRequests", meal.maxWaitingRequests, "maxExecutinRequests", meal.maxExecutingRequests) - - metrics.GetWaitingReadonlyConcurrency().SetDenominator(float64(meal.maxWaitingRequests)) - metrics.GetWaitingMutatingConcurrency().SetDenominator(float64(meal.maxWaitingRequests)) - metrics.GetExecutingReadonlyConcurrency().SetDenominator(float64(meal.maxExecutingRequests)) - metrics.GetExecutingMutatingConcurrency().SetDenominator(float64(meal.maxExecutingRequests)) - - return meal.fsStatusUpdates -} - -// Digest the new set of PriorityLevelConfiguration objects. -// Pretend broken ones do not exist. -func (meal *cfgMeal) digestNewPLsLocked(newPLs []*flowcontrol.PriorityLevelConfiguration) { - for _, pl := range newPLs { - state := meal.cfgCtlr.priorityLevelStates[pl.Name] - if state == nil { - labelValues := []string{pl.Name} - state = &priorityLevelState{ - reqsGaugePair: metrics.RatioedGaugeVecPhasedElementPair(meal.cfgCtlr.reqsGaugeVec, 1, 1, labelValues), - execSeatsObs: meal.cfgCtlr.execSeatsGaugeVec.NewForLabelValuesSafe(0, 1, labelValues), - seatDemandIntegrator: fq.NewNamedIntegrator(meal.cfgCtlr.clock, pl.Name), - seatDemandRatioedGauge: metrics.ApiserverSeatDemands.NewForLabelValuesSafe(0, 1, []string{pl.Name}), - } - } - qsCompleter, err := queueSetCompleterForPL(meal.cfgCtlr.queueSetFactory, state.queues, - pl, state.reqsGaugePair, state.execSeatsObs, - metrics.NewUnionGauge(state.seatDemandIntegrator, state.seatDemandRatioedGauge)) - if err != nil { - klog.Warningf("Ignoring PriorityLevelConfiguration object %s because its spec (%s) is broken: %s", pl.Name, fcfmt.Fmt(pl.Spec), err) - continue - } - meal.newPLStates[pl.Name] = state - state.pl = pl - state.qsCompleter = qsCompleter - if state.quiescing { // it was undesired, but no longer - klog.V(3).Infof("Priority level %q was undesired and has become desired again", pl.Name) - state.quiescing = false - } - nominalConcurrencyShares, _, _ := plSpecCommons(state.pl) - meal.shareSum += float64(*nominalConcurrencyShares) - meal.haveExemptPL = meal.haveExemptPL || pl.Name == flowcontrol.PriorityLevelConfigurationNameExempt - meal.haveCatchAllPL = meal.haveCatchAllPL || pl.Name == flowcontrol.PriorityLevelConfigurationNameCatchAll - } -} - -// Digest the given FlowSchema objects. Ones that reference a missing -// or broken priority level are not to be passed on to the filter for -// use. We do this before holding over old priority levels so that -// requests stop going to those levels and FlowSchemaStatus values -// reflect this. This function also adds any missing mandatory -// FlowSchema objects. The given objects must all have distinct -// names. -func (meal *cfgMeal) digestFlowSchemasLocked(newFSs []*flowcontrol.FlowSchema) { - fsSeq := make(apihelpers.FlowSchemaSequence, 0, len(newFSs)) - fsMap := make(map[string]*flowcontrol.FlowSchema, len(newFSs)) - var haveExemptFS, haveCatchAllFS bool - for i, fs := range newFSs { - otherFS := fsMap[fs.Name] - if otherFS != nil { - // This client is forbidden to do this. - panic(fmt.Sprintf("Given two FlowSchema objects with the same name: %s and %s", fcfmt.Fmt(otherFS), fcfmt.Fmt(fs))) - } - fsMap[fs.Name] = fs - _, goodPriorityRef := meal.newPLStates[fs.Spec.PriorityLevelConfiguration.Name] - - // Ensure the object's status reflects whether its priority - // level reference is broken. - // - // TODO: consider not even trying if server is not handling - // requests yet. - meal.presyncFlowSchemaStatus(fs, meal.cfgCtlr.foundToDangling(goodPriorityRef), fs.Spec.PriorityLevelConfiguration.Name) - - if !goodPriorityRef { - klog.V(6).Infof("Ignoring FlowSchema %s because of bad priority level reference %q", fs.Name, fs.Spec.PriorityLevelConfiguration.Name) - continue - } - fsSeq = append(fsSeq, newFSs[i]) - haveExemptFS = haveExemptFS || fs.Name == flowcontrol.FlowSchemaNameExempt - haveCatchAllFS = haveCatchAllFS || fs.Name == flowcontrol.FlowSchemaNameCatchAll - } - // sort into the order to be used for matching - sort.Sort(fsSeq) - - // Supply missing mandatory FlowSchemas, in correct position - if !haveExemptFS { - fsSeq = append(apihelpers.FlowSchemaSequence{fcboot.MandatoryFlowSchemaExempt}, fsSeq...) - } - if !haveCatchAllFS { - fsSeq = append(fsSeq, fcboot.MandatoryFlowSchemaCatchAll) - } - - meal.cfgCtlr.flowSchemas = fsSeq - klogV := klog.V(5) - if klogV.Enabled() { - for _, fs := range fsSeq { - klogV.Infof("Using FlowSchema %s", fcfmt.Fmt(fs)) - } - } -} - -// Consider all the priority levels in the previous configuration. -// Keep the ones that are in the new config, supply mandatory -// behavior, or are still busy; for the rest: drop it if it has no -// queues, otherwise start the quiescing process if that has not -// already been started. -func (meal *cfgMeal) processOldPLsLocked() { - for plName, plState := range meal.cfgCtlr.priorityLevelStates { - if meal.newPLStates[plName] != nil { - // Still desired and already updated - continue - } - if plName == flowcontrol.PriorityLevelConfigurationNameExempt && !meal.haveExemptPL || plName == flowcontrol.PriorityLevelConfigurationNameCatchAll && !meal.haveCatchAllPL { - // BTW, we know the Spec has not changed what is says about queuing because the - // mandatory objects have immutable Specs as far as queuing is concerned. - klog.V(3).Infof("Retaining mandatory priority level %q despite lack of API object", plName) - } else { - if plState.numPending == 0 && plState.queues.IsIdle() { - // The QueueSet is done - // draining and no use is coming from another - // goroutine - klog.V(3).Infof("Removing undesired priority level %q, Type=%v", plName, plState.pl.Spec.Type) - meal.cfgCtlr.MaxSeatsTracker.ForgetPriorityLevel(plName) - continue - } - if !plState.quiescing { - klog.V(3).Infof("Priority level %q became undesired", plName) - plState.quiescing = true - } - } - var err error - plState.qsCompleter, err = queueSetCompleterForPL(meal.cfgCtlr.queueSetFactory, plState.queues, - plState.pl, plState.reqsGaugePair, plState.execSeatsObs, - metrics.NewUnionGauge(plState.seatDemandIntegrator, plState.seatDemandRatioedGauge)) - if err != nil { - // This can not happen because queueSetCompleterForPL already approved this config - panic(fmt.Sprintf("%s from name=%q spec=%s", err, plName, fcfmt.Fmt(plState.pl.Spec))) - } - // We deliberately include the lingering priority levels - // here so that their queues get some concurrency and they - // continue to drain. During this interim a lingering - // priority level continues to get a concurrency - // allocation determined by all the share values in the - // regular way. - nominalConcurrencyShares, _, _ := plSpecCommons(plState.pl) - meal.shareSum += float64(*nominalConcurrencyShares) - meal.haveExemptPL = meal.haveExemptPL || plName == flowcontrol.PriorityLevelConfigurationNameExempt - meal.haveCatchAllPL = meal.haveCatchAllPL || plName == flowcontrol.PriorityLevelConfigurationNameCatchAll - meal.newPLStates[plName] = plState - } -} - -// For all the priority levels of the new config, divide up the -// server's total concurrency limit among them and create/update their -// QueueSets. -func (meal *cfgMeal) finishQueueSetReconfigsLocked() { - for plName, plState := range meal.newPLStates { - nominalConcurrencyShares, lendablePercent, borrowingLimitPercent := plSpecCommons(plState.pl) - // The use of math.Ceil here means that the results might sum - // to a little more than serverConcurrencyLimit but the - // difference will be negligible. - concurrencyLimit := int(math.Ceil(float64(meal.cfgCtlr.serverConcurrencyLimit) * float64(*nominalConcurrencyShares) / meal.shareSum)) - var lendableCL, borrowingCL int - if lendablePercent != nil { - lendableCL = int(math.Round(float64(concurrencyLimit) * float64(*lendablePercent) / 100)) - } - if borrowingLimitPercent != nil { - borrowingCL = int(math.Round(float64(concurrencyLimit) * float64(*borrowingLimitPercent) / 100)) - } else { - borrowingCL = meal.cfgCtlr.serverConcurrencyLimit - } - - metrics.SetPriorityLevelConfiguration(plName, concurrencyLimit, concurrencyLimit-lendableCL, concurrencyLimit+borrowingCL) - cfgChanged := plState.nominalCL != concurrencyLimit || plState.minCL != concurrencyLimit-lendableCL || plState.maxCL != concurrencyLimit+borrowingCL - plState.nominalCL = concurrencyLimit - plState.minCL = concurrencyLimit - lendableCL - plState.maxCL = concurrencyLimit + borrowingCL - meal.maxExecutingRequests += concurrencyLimit - if limited := plState.pl.Spec.Limited; limited != nil { - if qCfg := limited.LimitResponse.Queuing; qCfg != nil { - meal.maxWaitingRequests += int(qCfg.Queues * qCfg.QueueLengthLimit) - - // Max seats allocatable from work estimator is calculated as MAX(1, MIN(0.15 * nominalCL, nominalCL/handSize)). - // This is to keep max seats relative to total available concurrency with a minimum value of 1. - // 15% of nominal concurrency was chosen since it preserved the previous max seats of 10 for default priority levels - // when using apiserver's default total server concurrency of 600 (--max-requests-inflight=400, --max-mutating-requests-inflight=200). - // This ensures that clusters with relatively high inflight requests will continue to use a max seats of 10 - // while clusters with lower inflight requests will use max seats no greater than nominalCL/handSize. - // Calculated max seats can return arbitrarily high values but work estimator currently limits max seats at 10. - handSize := plState.pl.Spec.Limited.LimitResponse.Queuing.HandSize - maxSeats := uint64(math.Max(1, math.Min(math.Ceil(float64(concurrencyLimit)*priorityLevelMaxSeatsPercent), float64(int32(concurrencyLimit)/handSize)))) - meal.cfgCtlr.MaxSeatsTracker.SetMaxSeats(plName, maxSeats) - } - } - if plState.queues == nil { - initialCL := concurrencyLimit - lendableCL/2 - klog.V(2).Infof("Introducing queues for priority level %q: config=%s, nominalCL=%d, lendableCL=%d, borrowingCL=%d, currentCL=%d, quiescing=%v (shares=%v, shareSum=%v)", plName, fcfmt.Fmt(plState.pl.Spec), concurrencyLimit, lendableCL, borrowingCL, initialCL, plState.quiescing, nominalConcurrencyShares, meal.shareSum) - plState.seatDemandStats = seatDemandStats{} - plState.currentCL = initialCL - } else { - logLevel := klog.Level(5) - if cfgChanged { - logLevel = 2 - } - klog.V(logLevel).Infof("Retaining queues for priority level %q: config=%s, nominalCL=%d, lendableCL=%d, borrowingCL=%d, currentCL=%d, quiescing=%v, numPending=%d (shares=%v, shareSum=%v)", plName, fcfmt.Fmt(plState.pl.Spec), concurrencyLimit, lendableCL, borrowingCL, plState.currentCL, plState.quiescing, plState.numPending, nominalConcurrencyShares, meal.shareSum) - } - } - meal.cfgCtlr.nominalCLSum = meal.maxExecutingRequests - meal.cfgCtlr.updateBorrowingLocked(false, meal.newPLStates) -} - -// queueSetCompleterForPL returns an appropriate QueueSetCompleter for the -// given priority level configuration. Returns nil and an error if the given -// object is malformed in a way that is a problem for this package. -func queueSetCompleterForPL(qsf fq.QueueSetFactory, queues fq.QueueSet, pl *flowcontrol.PriorityLevelConfiguration, reqsIntPair metrics.RatioedGaugePair, execSeatsObs metrics.RatioedGauge, seatDemandGauge metrics.Gauge) (fq.QueueSetCompleter, error) { - if (pl.Spec.Type == flowcontrol.PriorityLevelEnablementLimited) != (pl.Spec.Limited != nil) { - return nil, errors.New("broken union structure at the top, for Limited") - } - if (pl.Spec.Type == flowcontrol.PriorityLevelEnablementExempt) != (pl.Spec.Exempt != nil) { - return nil, errors.New("broken union structure at the top, for Exempt") - } - if (pl.Spec.Type == flowcontrol.PriorityLevelEnablementExempt) != (pl.Name == flowcontrol.PriorityLevelConfigurationNameExempt) { - // This package does not attempt to cope with a priority level dynamically switching between exempt and not. - return nil, errors.New("non-alignment between name and type") - } - qcQS := fq.QueuingConfig{Name: pl.Name} - if pl.Spec.Limited != nil { - if (pl.Spec.Limited.LimitResponse.Type == flowcontrol.LimitResponseTypeReject) != (pl.Spec.Limited.LimitResponse.Queuing == nil) { - return nil, errors.New("broken union structure for limit response") - } - qcAPI := pl.Spec.Limited.LimitResponse.Queuing - if qcAPI != nil { - qcQS = fq.QueuingConfig{Name: pl.Name, - DesiredNumQueues: int(qcAPI.Queues), - QueueLengthLimit: int(qcAPI.QueueLengthLimit), - HandSize: int(qcAPI.HandSize), - } - } - } else { - qcQS = fq.QueuingConfig{Name: pl.Name, DesiredNumQueues: -1} - } - var qsc fq.QueueSetCompleter - var err error - if queues != nil { - qsc, err = queues.BeginConfigChange(qcQS) - } else { - qsc, err = qsf.BeginConstruction(qcQS, reqsIntPair, execSeatsObs, seatDemandGauge) - } - if err != nil { - err = fmt.Errorf("priority level %q has QueuingConfiguration %#+v, which is invalid: %w", pl.Name, qcQS, err) - } - return qsc, err -} - -func (meal *cfgMeal) presyncFlowSchemaStatus(fs *flowcontrol.FlowSchema, isDangling bool, plName string) { - danglingCondition := apihelpers.GetFlowSchemaConditionByType(fs, flowcontrol.FlowSchemaConditionDangling) - if danglingCondition == nil { - danglingCondition = &flowcontrol.FlowSchemaCondition{ - Type: flowcontrol.FlowSchemaConditionDangling, - } - } - desiredStatus := flowcontrol.ConditionFalse - var desiredReason, desiredMessage string - if isDangling { - desiredStatus = flowcontrol.ConditionTrue - desiredReason = "NotFound" - desiredMessage = fmt.Sprintf("This FlowSchema references the PriorityLevelConfiguration object named %q but there is no such object", plName) - } else { - desiredReason = "Found" - desiredMessage = fmt.Sprintf("This FlowSchema references the PriorityLevelConfiguration object named %q and it exists", plName) - } - if danglingCondition.Status == desiredStatus && danglingCondition.Reason == desiredReason && danglingCondition.Message == desiredMessage { - return - } - now := meal.cfgCtlr.clock.Now() - meal.fsStatusUpdates = append(meal.fsStatusUpdates, fsStatusUpdate{ - flowSchema: fs, - condition: flowcontrol.FlowSchemaCondition{ - Type: flowcontrol.FlowSchemaConditionDangling, - Status: desiredStatus, - LastTransitionTime: metav1.NewTime(now), - Reason: desiredReason, - Message: desiredMessage, - }, - oldValue: *danglingCondition}) -} - -// imaginePL adds a priority level based on one of the mandatory ones -// that does not actually exist (right now) as a real API object. -func (meal *cfgMeal) imaginePL(proto *flowcontrol.PriorityLevelConfiguration) { - klog.V(3).Infof("No %s PriorityLevelConfiguration found, imagining one", proto.Name) - labelValues := []string{proto.Name} - reqsGaugePair := metrics.RatioedGaugeVecPhasedElementPair(meal.cfgCtlr.reqsGaugeVec, 1, 1, labelValues) - execSeatsObs := meal.cfgCtlr.execSeatsGaugeVec.NewForLabelValuesSafe(0, 1, labelValues) - seatDemandIntegrator := fq.NewNamedIntegrator(meal.cfgCtlr.clock, proto.Name) - seatDemandRatioedGauge := metrics.ApiserverSeatDemands.NewForLabelValuesSafe(0, 1, []string{proto.Name}) - qsCompleter, err := queueSetCompleterForPL(meal.cfgCtlr.queueSetFactory, nil, proto, reqsGaugePair, - execSeatsObs, metrics.NewUnionGauge(seatDemandIntegrator, seatDemandRatioedGauge)) - if err != nil { - // This can not happen because proto is one of the mandatory - // objects and these are not erroneous - panic(err) - } - meal.newPLStates[proto.Name] = &priorityLevelState{ - pl: proto, - qsCompleter: qsCompleter, - reqsGaugePair: reqsGaugePair, - execSeatsObs: execSeatsObs, - seatDemandIntegrator: seatDemandIntegrator, - seatDemandRatioedGauge: seatDemandRatioedGauge, - } - nominalConcurrencyShares, _, _ := plSpecCommons(proto) - meal.shareSum += float64(*nominalConcurrencyShares) -} - -// startRequest classifies and, if appropriate, enqueues the request. -// Returns a nil Request if and only if the request is to be rejected. -// The returned bool indicates whether the request is exempt from -// limitation. The startWaitingTime is when the request started -// waiting in its queue, or `Time{}` if this did not happen. -func (cfgCtlr *configController) startRequest(ctx context.Context, rd RequestDigest, - noteFn func(fs *flowcontrol.FlowSchema, pl *flowcontrol.PriorityLevelConfiguration, flowDistinguisher string), - workEstimator func() fcrequest.WorkEstimate, - queueNoteFn fq.QueueNoteFn) (fs *flowcontrol.FlowSchema, pl *flowcontrol.PriorityLevelConfiguration, isExempt bool, req fq.Request, startWaitingTime time.Time) { - klog.V(7).Infof("startRequest(%#+v)", rd) - cfgCtlr.lock.RLock() - defer cfgCtlr.lock.RUnlock() - var selectedFlowSchema, catchAllFlowSchema *flowcontrol.FlowSchema - for _, fs := range cfgCtlr.flowSchemas { - if matchesFlowSchema(rd, fs) { - selectedFlowSchema = fs - break - } - if fs.Name == flowcontrol.FlowSchemaNameCatchAll { - catchAllFlowSchema = fs - } - } - if selectedFlowSchema == nil { - // This should never happen. If the requestDigest's User is a part of - // system:authenticated or system:unauthenticated, the catch-all flow - // schema should match it. However, if that invariant somehow fails, - // fallback to the catch-all flow schema anyway. - if catchAllFlowSchema == nil { - // This should absolutely never, ever happen! APF guarantees two - // undeletable flow schemas at all times: an exempt flow schema and a - // catch-all flow schema. - panic(fmt.Sprintf("no fallback catch-all flow schema found for request %#+v and user %#+v", rd.RequestInfo, rd.User)) - } - selectedFlowSchema = catchAllFlowSchema - klog.Warningf("no match found for request %#+v and user %#+v; selecting catchAll=%s as fallback flow schema", rd.RequestInfo, rd.User, fcfmt.Fmt(selectedFlowSchema)) - } - plName := selectedFlowSchema.Spec.PriorityLevelConfiguration.Name - plState := cfgCtlr.priorityLevelStates[plName] - var numQueues int32 - var hashValue uint64 - var flowDistinguisher string - if plState.pl.Spec.Type != flowcontrol.PriorityLevelEnablementExempt { - if plState.pl.Spec.Limited.LimitResponse.Type == flowcontrol.LimitResponseTypeQueue { - numQueues = plState.pl.Spec.Limited.LimitResponse.Queuing.Queues - } - if numQueues > 1 { - flowDistinguisher = computeFlowDistinguisher(rd, selectedFlowSchema.Spec.DistinguisherMethod) - hashValue = hashFlowID(selectedFlowSchema.Name, flowDistinguisher) - } - } - - noteFn(selectedFlowSchema, plState.pl, flowDistinguisher) - workEstimate := workEstimator() - - if plState.pl.Spec.Type != flowcontrol.PriorityLevelEnablementExempt { - startWaitingTime = cfgCtlr.clock.Now() - } - klog.V(7).Infof("startRequest(%#+v) => fsName=%q, distMethod=%#+v, plName=%q, numQueues=%d", rd, selectedFlowSchema.Name, selectedFlowSchema.Spec.DistinguisherMethod, plName, numQueues) - req, idle := plState.queues.StartRequest(ctx, &workEstimate, hashValue, flowDistinguisher, selectedFlowSchema.Name, rd.RequestInfo, rd.User, queueNoteFn) - if idle { - cfgCtlr.maybeReapReadLocked(plName, plState) - } - return selectedFlowSchema, plState.pl, plState.pl.Spec.Type == flowcontrol.PriorityLevelEnablementExempt, req, startWaitingTime -} - -// maybeReap will remove the last internal traces of the named -// priority level if it has no more use. Call this after getting a -// clue that the given priority level is undesired and idle. -func (cfgCtlr *configController) maybeReap(plName string) { - cfgCtlr.lock.RLock() - defer cfgCtlr.lock.RUnlock() - plState := cfgCtlr.priorityLevelStates[plName] - if plState == nil { - klog.V(7).Infof("plName=%s, plState==nil", plName) - return - } - useless := plState.quiescing && plState.numPending == 0 && plState.queues.IsIdle() - klog.V(7).Infof("plState.quiescing=%v, plState.numPending=%d, useless=%v", plState.quiescing, plState.numPending, useless) - if !useless { - return - } - klog.V(3).Infof("Triggered API priority and fairness config reloading because priority level %s is undesired and idle", plName) - cfgCtlr.configQueue.Add(0) -} - -// maybeReapLocked requires the cfgCtlr's lock to already be held and -// will remove the last internal traces of the named priority level if -// it has no more use. Call this if both (1) plState.queues is -// non-nil and reported being idle, and (2) cfgCtlr's lock has not -// been released since then. -func (cfgCtlr *configController) maybeReapReadLocked(plName string, plState *priorityLevelState) { - if !(plState.quiescing && plState.numPending == 0) { - return - } - klog.V(3).Infof("Triggered API priority and fairness config reloading because priority level %s is undesired and idle", plName) - cfgCtlr.configQueue.Add(0) -} - -// computeFlowDistinguisher extracts the flow distinguisher according to the given method -func computeFlowDistinguisher(rd RequestDigest, method *flowcontrol.FlowDistinguisherMethod) string { - if method == nil { - return "" - } - switch method.Type { - case flowcontrol.FlowDistinguisherMethodByUserType: - return rd.User.GetName() - case flowcontrol.FlowDistinguisherMethodByNamespaceType: - return rd.RequestInfo.Namespace - default: - // this line shall never reach - panic("invalid flow-distinguisher method") - } -} - -func hashFlowID(fsName, fDistinguisher string) uint64 { - hash := sha256.New() - var sep = [1]byte{0} - hash.Write([]byte(fsName)) - hash.Write(sep[:]) - hash.Write([]byte(fDistinguisher)) - var sum [32]byte - hash.Sum(sum[:0]) - return binary.LittleEndian.Uint64(sum[:8]) -} - -func relDiff(x, y float64) float64 { - diff := math.Abs(x - y) - den := math.Max(math.Abs(x), math.Abs(y)) - if den == 0 { - return 0 - } - return diff / den -} - -// plSpecCommons returns the (NominalConcurrencyShares, LendablePercent, BorrowingLimitPercent) of the given priority level config -func plSpecCommons(pl *flowcontrol.PriorityLevelConfiguration) (*int32, *int32, *int32) { - if limiter := pl.Spec.Limited; limiter != nil { - return limiter.NominalConcurrencyShares, limiter.LendablePercent, limiter.BorrowingLimitPercent - } - limiter := pl.Spec.Exempt - var nominalConcurrencyShares int32 - if limiter.NominalConcurrencyShares != nil { - nominalConcurrencyShares = *limiter.NominalConcurrencyShares - } - return &nominalConcurrencyShares, limiter.LendablePercent, nil -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_controller_debug.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_controller_debug.go deleted file mode 100644 index fde0c5151..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_controller_debug.go +++ /dev/null @@ -1,271 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flowcontrol - -import ( - "fmt" - "io" - "net/http" - "sort" - "strconv" - "strings" - "text/tabwriter" - "time" - - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apiserver/pkg/server/mux" - "k8s.io/apiserver/pkg/util/flowcontrol/debug" -) - -const ( - queryIncludeRequestDetails = "includeRequestDetails" -) - -func (cfgCtlr *configController) Install(c *mux.PathRecorderMux) { - // TODO(yue9944882): handle "Accept" header properly - // debugging dumps a CSV content for three levels of granularity - // 1. row per priority-level - c.UnlistedHandleFunc("/debug/api_priority_and_fairness/dump_priority_levels", cfgCtlr.dumpPriorityLevels) - // 2. row per queue - c.UnlistedHandleFunc("/debug/api_priority_and_fairness/dump_queues", cfgCtlr.dumpQueues) - // 3. row per request - c.UnlistedHandleFunc("/debug/api_priority_and_fairness/dump_requests", cfgCtlr.dumpRequests) -} - -func (cfgCtlr *configController) dumpPriorityLevels(w http.ResponseWriter, r *http.Request) { - cfgCtlr.lock.Lock() - defer cfgCtlr.lock.Unlock() - tabWriter := tabwriter.NewWriter(w, 8, 0, 1, ' ', 0) - columnHeaders := []string{ - "PriorityLevelName", // 1 - "ActiveQueues", // 2 - "IsIdle", // 3 - "IsQuiescing", // 4 - "WaitingRequests", // 5 - "ExecutingRequests", // 6 - "DispatchedRequests", // 7 - "RejectedRequests", // 8 - "TimedoutRequests", // 9 - "CancelledRequests", // 10 - } - tabPrint(tabWriter, rowForHeaders(columnHeaders)) - endLine(tabWriter) - plNames := make([]string, 0, len(cfgCtlr.priorityLevelStates)) - for plName := range cfgCtlr.priorityLevelStates { - plNames = append(plNames, plName) - } - sort.Strings(plNames) - for i := range plNames { - plState, ok := cfgCtlr.priorityLevelStates[plNames[i]] - if !ok { - continue - } - - queueSetDigest := plState.queues.Dump(false) - activeQueueNum := 0 - for _, q := range queueSetDigest.Queues { - if len(q.Requests) > 0 { - activeQueueNum++ - } - } - - tabPrint(tabWriter, rowForPriorityLevel( - plState.pl.Name, // 1 - activeQueueNum, // 2 - plState.queues.IsIdle(), // 3 - plState.quiescing, // 4 - queueSetDigest.Waiting, // 5 - queueSetDigest.Executing, // 6 - queueSetDigest.Dispatched, // 7 - queueSetDigest.Rejected, // 8 - queueSetDigest.Timedout, // 9 - queueSetDigest.Cancelled, // 10 - )) - endLine(tabWriter) - } - runtime.HandleError(tabWriter.Flush()) -} - -func (cfgCtlr *configController) dumpQueues(w http.ResponseWriter, r *http.Request) { - cfgCtlr.lock.Lock() - defer cfgCtlr.lock.Unlock() - tabWriter := tabwriter.NewWriter(w, 8, 0, 1, ' ', 0) - columnHeaders := []string{ - "PriorityLevelName", // 1 - "Index", // 2 - "PendingRequests", // 3 - "ExecutingRequests", // 4 - "SeatsInUse", // 5 - "NextDispatchR", // 6 - "InitialSeatsSum", // 7 - "MaxSeatsSum", // 8 - "TotalWorkSum", // 9 - } - tabPrint(tabWriter, rowForHeaders(columnHeaders)) - endLine(tabWriter) - for _, plState := range cfgCtlr.priorityLevelStates { - queueSetDigest := plState.queues.Dump(false) - for i, q := range queueSetDigest.Queues { - tabPrint(tabWriter, row( - plState.pl.Name, // 1 - "PriorityLevelName" - strconv.Itoa(i), // 2 - "Index" - strconv.Itoa(len(q.Requests)), // 3 - "PendingRequests" - strconv.Itoa(q.ExecutingRequests), // 4 - "ExecutingRequests" - strconv.Itoa(q.SeatsInUse), // 5 - "SeatsInUse" - q.NextDispatchR, // 6 - "NextDispatchR" - strconv.Itoa(q.QueueSum.InitialSeatsSum), // 7 - "InitialSeatsSum" - strconv.Itoa(q.QueueSum.MaxSeatsSum), // 8 - "MaxSeatsSum" - q.QueueSum.TotalWorkSum, // 9 - "TotalWorkSum" - )) - endLine(tabWriter) - } - } - runtime.HandleError(tabWriter.Flush()) -} - -func (cfgCtlr *configController) dumpRequests(w http.ResponseWriter, r *http.Request) { - cfgCtlr.lock.Lock() - defer cfgCtlr.lock.Unlock() - - includeRequestDetails := len(r.URL.Query().Get(queryIncludeRequestDetails)) > 0 - - tabWriter := tabwriter.NewWriter(w, 8, 0, 1, ' ', 0) - tabPrint(tabWriter, rowForHeaders([]string{ - "PriorityLevelName", // 1 - "FlowSchemaName", // 2 - "QueueIndex", // 3 - "RequestIndexInQueue", // 4 - "FlowDistingsher", // 5 - "ArriveTime", // 6 - "InitialSeats", // 7 - "FinalSeats", // 8 - "AdditionalLatency", // 9 - "StartTime", // 10 - })) - if includeRequestDetails { - continueLine(tabWriter) - tabPrint(tabWriter, rowForHeaders([]string{ - "UserName", // 11 - "Verb", // 12 - "APIPath", // 13 - "Namespace", // 14 - "Name", // 15 - "APIVersion", // 16 - "Resource", // 17 - "SubResource", // 18 - })) - } - endLine(tabWriter) - for _, plState := range cfgCtlr.priorityLevelStates { - queueSetDigest := plState.queues.Dump(includeRequestDetails) - dumpRequest := func(iq, ir int, r debug.RequestDump) { - tabPrint(tabWriter, row( - plState.pl.Name, // 1 - r.MatchedFlowSchema, // 2 - strconv.Itoa(iq), // 3 - strconv.Itoa(ir), // 4 - r.FlowDistinguisher, // 5 - r.ArriveTime.UTC().Format(time.RFC3339Nano), // 6 - strconv.Itoa(int(r.WorkEstimate.InitialSeats)), // 7 - strconv.Itoa(int(r.WorkEstimate.FinalSeats)), // 8 - r.WorkEstimate.AdditionalLatency.String(), // 9 - r.StartTime.UTC().Format(time.RFC3339Nano), // 10 - )) - if includeRequestDetails { - continueLine(tabWriter) - tabPrint(tabWriter, rowForRequestDetails( - r.UserName, // 11 - r.RequestInfo.Verb, // 12 - r.RequestInfo.Path, // 13 - r.RequestInfo.Namespace, // 14 - r.RequestInfo.Name, // 15 - schema.GroupVersion{ - Group: r.RequestInfo.APIGroup, - Version: r.RequestInfo.APIVersion, - }.String(), // 16 - r.RequestInfo.Resource, // 17 - r.RequestInfo.Subresource, // 18 - )) - } - endLine(tabWriter) - } - for iq, q := range queueSetDigest.Queues { - for ir, r := range q.Requests { - dumpRequest(iq, ir, r) - } - for _, r := range q.RequestsExecuting { - dumpRequest(iq, -1, r) - } - } - for _, r := range queueSetDigest.QueuelessExecutingRequests { - dumpRequest(-1, -1, r) - } - } - runtime.HandleError(tabWriter.Flush()) -} - -func tabPrint(w io.Writer, row string) { - _, err := fmt.Fprint(w, row) - runtime.HandleError(err) -} - -func continueLine(w io.Writer) { - _, err := fmt.Fprint(w, ",\t") - runtime.HandleError(err) -} -func endLine(w io.Writer) { - _, err := fmt.Fprint(w, "\n") - runtime.HandleError(err) -} - -func rowForHeaders(headers []string) string { - return row(headers...) -} - -func rowForPriorityLevel(plName string, activeQueues int, isIdle, isQuiescing bool, waitingRequests, executingRequests int, - dispatchedReqeusts, rejectedRequests, timedoutRequests, cancelledRequests int) string { - return row( - plName, - strconv.Itoa(activeQueues), - strconv.FormatBool(isIdle), - strconv.FormatBool(isQuiescing), - strconv.Itoa(waitingRequests), - strconv.Itoa(executingRequests), - strconv.Itoa(dispatchedReqeusts), - strconv.Itoa(rejectedRequests), - strconv.Itoa(timedoutRequests), - strconv.Itoa(cancelledRequests), - ) -} - -func rowForRequestDetails(username, verb, path, namespace, name, apiVersion, resource, subResource string) string { - return row( - username, - verb, - path, - namespace, - name, - apiVersion, - resource, - subResource, - ) -} - -func row(columns ...string) string { - return strings.Join(columns, ",\t") -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_filter.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_filter.go deleted file mode 100644 index 2a4bf10f7..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/apf_filter.go +++ /dev/null @@ -1,203 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flowcontrol - -import ( - "context" - "strconv" - "time" - - endpointsrequest "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/apiserver/pkg/server/httplog" - "k8s.io/apiserver/pkg/server/mux" - fq "k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing" - "k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/eventclock" - fqs "k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset" - "k8s.io/apiserver/pkg/util/flowcontrol/metrics" - fcrequest "k8s.io/apiserver/pkg/util/flowcontrol/request" - kubeinformers "k8s.io/client-go/informers" - "k8s.io/klog/v2" - "k8s.io/utils/clock" - - flowcontrol "k8s.io/api/flowcontrol/v1" - flowcontrolclient "k8s.io/client-go/kubernetes/typed/flowcontrol/v1" -) - -// ConfigConsumerAsFieldManager is how the config consuminng -// controller appears in an ObjectMeta ManagedFieldsEntry.Manager -const ConfigConsumerAsFieldManager = "api-priority-and-fairness-config-consumer-v1" - -// Interface defines how the API Priority and Fairness filter interacts with the underlying system. -type Interface interface { - // Handle takes care of queuing and dispatching a request - // characterized by the given digest. The given `noteFn` will be - // invoked with the results of request classification. - // The given `workEstimator` is called, if at all, after noteFn. - // `workEstimator` will be invoked only when the request - // is classified as non 'exempt'. - // 'workEstimator', when invoked, must return the - // work parameters for the request. - // If the request is queued then `queueNoteFn` will be called twice, - // first with `true` and then with `false`; otherwise - // `queueNoteFn` will not be called at all. If Handle decides - // that the request should be executed then `execute()` will be - // invoked once to execute the request; otherwise `execute()` will - // not be invoked. - // Handle() should never return while execute() is running, even if - // ctx is cancelled or times out. - Handle(ctx context.Context, - requestDigest RequestDigest, - noteFn func(fs *flowcontrol.FlowSchema, pl *flowcontrol.PriorityLevelConfiguration, flowDistinguisher string), - workEstimator func() fcrequest.WorkEstimate, - queueNoteFn fq.QueueNoteFn, - execFn func(), - ) - - // Run monitors config objects from the main apiservers and causes - // any needed changes to local behavior. This method ceases - // activity and returns after the given channel is closed. - Run(stopCh <-chan struct{}) error - - // Install installs debugging endpoints to the web-server. - Install(c *mux.PathRecorderMux) - - // WatchTracker provides the WatchTracker interface. - WatchTracker - - // MaxSeatsTracker is invoked from the work estimator to track max seats - // that can be occupied by a request for a priority level. - MaxSeatsTracker -} - -// This request filter implements https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/1040-priority-and-fairness/README.md - -// New creates a new instance to implement API priority and fairness -func New( - informerFactory kubeinformers.SharedInformerFactory, - flowcontrolClient flowcontrolclient.FlowcontrolV1Interface, - serverConcurrencyLimit int, -) Interface { - clk := eventclock.Real{} - return NewTestable(TestableConfig{ - Name: "Controller", - Clock: clk, - AsFieldManager: ConfigConsumerAsFieldManager, - FoundToDangling: func(found bool) bool { return !found }, - InformerFactory: informerFactory, - FlowcontrolClient: flowcontrolClient, - ServerConcurrencyLimit: serverConcurrencyLimit, - ReqsGaugeVec: metrics.PriorityLevelConcurrencyGaugeVec, - ExecSeatsGaugeVec: metrics.PriorityLevelExecutionSeatsGaugeVec, - QueueSetFactory: fqs.NewQueueSetFactory(clk), - }) -} - -// TestableConfig carries the parameters to an implementation that is testable -type TestableConfig struct { - // Name of the controller - Name string - - // Clock to use in timing deliberate delays - Clock clock.PassiveClock - - // AsFieldManager is the string to use in the metadata for - // server-side apply. Normally this is - // `ConfigConsumerAsFieldManager`. This is exposed as a parameter - // so that a test of competing controllers can supply different - // values. - AsFieldManager string - - // FoundToDangling maps the boolean indicating whether a - // FlowSchema's referenced PLC exists to the boolean indicating - // that FlowSchema's status should indicate a dangling reference. - // This is a parameter so that we can write tests of what happens - // when servers disagree on that bit of Status. - FoundToDangling func(bool) bool - - // InformerFactory to use in building the controller - InformerFactory kubeinformers.SharedInformerFactory - - // FlowcontrolClient to use for manipulating config objects - FlowcontrolClient flowcontrolclient.FlowcontrolV1Interface - - // ServerConcurrencyLimit for the controller to enforce - ServerConcurrencyLimit int - - // GaugeVec for metrics about requests, broken down by phase and priority_level - ReqsGaugeVec metrics.RatioedGaugeVec - - // RatioedGaugePairVec for metrics about seats occupied by all phases of execution - ExecSeatsGaugeVec metrics.RatioedGaugeVec - - // QueueSetFactory for the queuing implementation - QueueSetFactory fq.QueueSetFactory -} - -// NewTestable is extra flexible to facilitate testing -func NewTestable(config TestableConfig) Interface { - return newTestableController(config) -} - -func (cfgCtlr *configController) Handle(ctx context.Context, requestDigest RequestDigest, - noteFn func(fs *flowcontrol.FlowSchema, pl *flowcontrol.PriorityLevelConfiguration, flowDistinguisher string), - workEstimator func() fcrequest.WorkEstimate, - queueNoteFn fq.QueueNoteFn, - execFn func()) { - fs, pl, isExempt, req, startWaitingTime := cfgCtlr.startRequest(ctx, requestDigest, noteFn, workEstimator, queueNoteFn) - queued := startWaitingTime != time.Time{} - if req == nil { - if queued { - observeQueueWaitTime(ctx, pl.Name, fs.Name, strconv.FormatBool(req != nil), cfgCtlr.clock.Since(startWaitingTime)) - } - klog.V(7).Infof("Handle(%#+v) => fsName=%q, distMethod=%#+v, plName=%q, isExempt=%v, reject", requestDigest, fs.Name, fs.Spec.DistinguisherMethod, pl.Name, isExempt) - return - } - klog.V(7).Infof("Handle(%#+v) => fsName=%q, distMethod=%#+v, plName=%q, isExempt=%v, queued=%v", requestDigest, fs.Name, fs.Spec.DistinguisherMethod, pl.Name, isExempt, queued) - var executed bool - idle, panicking := true, true - defer func() { - klog.V(7).Infof("Handle(%#+v) => fsName=%q, distMethod=%#+v, plName=%q, isExempt=%v, queued=%v, Finish() => panicking=%v idle=%v", - requestDigest, fs.Name, fs.Spec.DistinguisherMethod, pl.Name, isExempt, queued, panicking, idle) - if idle { - cfgCtlr.maybeReap(pl.Name) - } - }() - idle = req.Finish(func() { - if queued { - observeQueueWaitTime(ctx, pl.Name, fs.Name, strconv.FormatBool(req != nil), cfgCtlr.clock.Since(startWaitingTime)) - } - metrics.AddDispatch(ctx, pl.Name, fs.Name) - fqs.OnRequestDispatched(req) - executed = true - startExecutionTime := cfgCtlr.clock.Now() - defer func() { - executionTime := cfgCtlr.clock.Since(startExecutionTime) - httplog.AddKeyValue(ctx, "apf_execution_time", executionTime) - metrics.ObserveExecutionDuration(ctx, pl.Name, fs.Name, executionTime) - }() - execFn() - }) - if queued && !executed { - observeQueueWaitTime(ctx, pl.Name, fs.Name, strconv.FormatBool(req != nil), cfgCtlr.clock.Since(startWaitingTime)) - } - panicking = false -} - -func observeQueueWaitTime(ctx context.Context, priorityLevelName, flowSchemaName, execute string, waitTime time.Duration) { - metrics.ObserveWaitingDuration(ctx, priorityLevelName, flowSchemaName, execute, waitTime) - endpointsrequest.TrackAPFQueueWaitLatency(ctx, waitTime) -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/conc_alloc.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/conc_alloc.go deleted file mode 100644 index 904f4fce2..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/conc_alloc.go +++ /dev/null @@ -1,257 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flowcontrol - -import ( - "errors" - "fmt" - "math" - "sort" -) - -// allocProblemItem is one of the classes to which computeConcurrencyAllocation should make an allocation -type allocProblemItem struct { - target float64 - lowerBound float64 - upperBound float64 -} - -// relativeAllocItem is like allocProblemItem but with target avoiding zero and the bounds divided by the target -type relativeAllocItem struct { - target float64 - relativeLowerBound float64 - relativeUpperBound float64 -} - -// relativeAllocProblem collects together all the classes and holds the result of sorting by increasing bounds. -// For J <= K, ascendingIndices[J] identifies a bound that is <= the one of ascendingIndices[K]. -// When ascendingIndices[J] = 2*N + 0, this identifies the lower bound of items[N]. -// When ascendingIndices[J] = 2*N + 1, this identifies the upper bound of items[N]. -type relativeAllocProblem struct { - items []relativeAllocItem - ascendingIndices []int -} - -// initIndices fills in ascendingIndices and sorts them -func (rap *relativeAllocProblem) initIndices() *relativeAllocProblem { - rap.ascendingIndices = make([]int, len(rap.items)*2) - for idx := 0; idx < len(rap.ascendingIndices); idx++ { - rap.ascendingIndices[idx] = idx - } - sort.Sort(rap) - return rap -} - -func (rap *relativeAllocProblem) getItemIndex(idx int) (int, bool) { - packedIndex := rap.ascendingIndices[idx] - itemIndex := packedIndex / 2 - return itemIndex, packedIndex == itemIndex*2 -} - -// decode(J) returns the bound associated with ascendingIndices[J], the associated items index, -// and a bool indicating whether the bound is the item's lower bound. -func (rap *relativeAllocProblem) decode(idx int) (float64, int, bool) { - itemIdx, lower := rap.getItemIndex(idx) - if lower { - return rap.items[itemIdx].relativeLowerBound, itemIdx, lower - } - return rap.items[itemIdx].relativeUpperBound, itemIdx, lower -} - -func (rap *relativeAllocProblem) getProportion(idx int) float64 { - prop, _, _ := rap.decode(idx) - return prop -} - -func (rap *relativeAllocProblem) Len() int { return len(rap.items) * 2 } - -func (rap *relativeAllocProblem) Less(i, j int) bool { - return rap.getProportion(i) < rap.getProportion(j) -} - -func (rap *relativeAllocProblem) Swap(i, j int) { - rap.ascendingIndices[i], rap.ascendingIndices[j] = rap.ascendingIndices[j], rap.ascendingIndices[i] -} - -// minMax records the minimum and maximum value seen while scanning a set of numbers -type minMax struct { - min float64 - max float64 -} - -// note scans one more number -func (mm *minMax) note(x float64) { - mm.min = math.Min(mm.min, x) - mm.max = math.Max(mm.max, x) -} - -const MinTarget = 0.001 -const epsilon = 0.0000001 - -// computeConcurrencyAllocation returns the unique `allocs []float64`, and -// an associated `fairProp float64`, that jointly have -// all of the following properties (to the degree that floating point calculations allow) -// if possible otherwise returns an error saying why it is impossible. -// `allocs` sums to `requiredSum`. -// For each J in [0, len(classes)): -// 1. `classes[J].lowerBound <= allocs[J] <= classes[J].upperBound` and -// 2. exactly one of the following is true: -// 2a. `allocs[J] == fairProp * classes[J].target`, -// 2b. `allocs[J] == classes[J].lowerBound && classes[J].lowerBound > fairProp * classes[J].target`, or -// 2c. `allocs[J] == classes[J].upperBound && classes[J].upperBound < fairProp * classes[J].target`. -// -// Each allocProblemItem is required to have `target >= lowerBound >= 0` and `upperBound >= lowerBound`. -// A target smaller than MinTarget is treated as if it were MinTarget. -func computeConcurrencyAllocation(requiredSum int, classes []allocProblemItem) ([]float64, float64, error) { - if requiredSum < 0 { - return nil, 0, errors.New("negative sums are not supported") - } - requiredSumF := float64(requiredSum) - var lowSum, highSum, targetSum float64 - ubRange := minMax{min: float64(math.MaxFloat32)} - lbRange := minMax{min: float64(math.MaxFloat32)} - relativeItems := make([]relativeAllocItem, len(classes)) - for idx, item := range classes { - target := item.target - if item.lowerBound < 0 { - return nil, 0, fmt.Errorf("lower bound %d is %v but negative lower bounds are not allowed", idx, item.lowerBound) - } - if target < item.lowerBound { - return nil, 0, fmt.Errorf("target %d is %v, which is below its lower bound of %v", idx, target, item.lowerBound) - } - if item.upperBound < item.lowerBound { - return nil, 0, fmt.Errorf("upper bound %d is %v but should not be less than the lower bound %v", idx, item.upperBound, item.lowerBound) - } - if target < MinTarget { - // tweak this to a non-zero value so avoid dividing by zero - target = MinTarget - } - lowSum += item.lowerBound - highSum += item.upperBound - targetSum += target - relativeItem := relativeAllocItem{ - target: target, - relativeLowerBound: item.lowerBound / target, - relativeUpperBound: item.upperBound / target, - } - ubRange.note(relativeItem.relativeUpperBound) - lbRange.note(relativeItem.relativeLowerBound) - relativeItems[idx] = relativeItem - } - if lbRange.max > 1 { - return nil, 0, fmt.Errorf("lbRange.max-1=%v, which is impossible because lbRange.max can not be greater than 1", lbRange.max-1) - } - if lowSum-requiredSumF > epsilon { - return nil, 0, fmt.Errorf("lower bounds sum to %v, which is higher than the required sum of %v", lowSum, requiredSum) - } - if requiredSumF-highSum > epsilon { - return nil, 0, fmt.Errorf("upper bounds sum to %v, which is lower than the required sum of %v", highSum, requiredSum) - } - ans := make([]float64, len(classes)) - if requiredSum == 0 { - return ans, 0, nil - } - if lowSum-requiredSumF > -epsilon { // no wiggle room, constrained from below - for idx, item := range classes { - ans[idx] = item.lowerBound - } - return ans, lbRange.min, nil - } - if requiredSumF-highSum > -epsilon { // no wiggle room, constrained from above - for idx, item := range classes { - ans[idx] = item.upperBound - } - return ans, ubRange.max, nil - } - // Now we know the solution is a unique fairProp in [lbRange.min, ubRange.max]. - // See if the solution does not run into any bounds. - fairProp := requiredSumF / targetSum - if lbRange.max <= fairProp && fairProp <= ubRange.min { // no bounds matter - for idx := range classes { - ans[idx] = relativeItems[idx].target * fairProp - } - return ans, fairProp, nil - } - // Sadly, some bounds matter. - // We find the solution by sorting the bounds and considering progressively - // higher values of fairProp, starting from lbRange.min. - rap := (&relativeAllocProblem{items: relativeItems}).initIndices() - sumSoFar := lowSum - fairProp = lbRange.min - var sensitiveTargetSum, deltaSensitiveTargetSum float64 - var numSensitiveClasses, deltaSensitiveClasses int - var nextIdx int - // `nextIdx` is the next `rap` index to consider. - // `sumSoFar` is what the allocs would sum to if the current - // value of `fairProp` solves the problem. - // If the current value of fairProp were the answer then - // `sumSoFar == requiredSum`. - // Otherwise the next increment in fairProp involves changing the allocations - // of `numSensitiveClasses` classes whose targets sum to `sensitiveTargetSum`; - // for the other classes, an upper or lower bound has applied and will continue to apply. - // The last increment of nextIdx calls for adding `deltaSensitiveClasses` - // to `numSensitiveClasses` and adding `deltaSensitiveTargetSum` to `sensitiveTargetSum`. - for sumSoFar < requiredSumF { - // There might be more than one bound that is equal to the current value - // of fairProp; find all of them because they will all be relevant to - // the next change in fairProp. - // Set nextBound to the next bound that is NOT equal to fairProp, - // and advance nextIdx to the index of that bound. - var nextBound float64 - for { - sensitiveTargetSum += deltaSensitiveTargetSum - numSensitiveClasses += deltaSensitiveClasses - if nextIdx >= rap.Len() { - return nil, 0, fmt.Errorf("impossible: ran out of bounds to consider in bound-constrained problem") - } - var itemIdx int - var lower bool - nextBound, itemIdx, lower = rap.decode(nextIdx) - if lower { - deltaSensitiveClasses = 1 - deltaSensitiveTargetSum = rap.items[itemIdx].target - } else { - deltaSensitiveClasses = -1 - deltaSensitiveTargetSum = -rap.items[itemIdx].target - } - nextIdx++ - if nextBound > fairProp { - break - } - } - // fairProp can increase to nextBound without passing any intermediate bounds. - if numSensitiveClasses == 0 { - // No classes are affected by the next range of fairProp; skip right past it - fairProp = nextBound - continue - } - // See whether fairProp can increase to the solution before passing the next bound. - deltaFairProp := (requiredSumF - sumSoFar) / sensitiveTargetSum - nextProp := fairProp + deltaFairProp - if nextProp <= nextBound { - fairProp = nextProp - break - } - // No, fairProp has to increase above nextBound - sumSoFar += (nextBound - fairProp) * sensitiveTargetSum - fairProp = nextBound - } - for idx, item := range classes { - ans[idx] = math.Max(item.lowerBound, math.Min(item.upperBound, fairProp*relativeItems[idx].target)) - } - return ans, fairProp, nil -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/debug/dump.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/debug/dump.go deleted file mode 100644 index 2b8538dcd..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/debug/dump.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package debug - -import ( - "time" - - "k8s.io/apiserver/pkg/endpoints/request" - flowcontrolrequest "k8s.io/apiserver/pkg/util/flowcontrol/request" -) - -// QueueSetDump is an instant dump of queue-set. -type QueueSetDump struct { - Queues []QueueDump - QueuelessExecutingRequests []RequestDump - Waiting int - Executing int - SeatsInUse int - SeatsWaiting int - Dispatched int - Rejected int - Timedout int - Cancelled int -} - -// QueueDump is an instant dump of one queue in a queue-set. -type QueueDump struct { - QueueSum QueueSum - Requests []RequestDump // just the waiting ones - RequestsExecuting []RequestDump - NextDispatchR string - ExecutingRequests int - SeatsInUse int -} - -type QueueSum struct { - InitialSeatsSum int - MaxSeatsSum int - TotalWorkSum string -} - -// RequestDump is an instant dump of one requests pending in the queue. -type RequestDump struct { - MatchedFlowSchema string - FlowDistinguisher string - ArriveTime time.Time - StartTime time.Time - WorkEstimate flowcontrolrequest.WorkEstimate - // request details - UserName string - RequestInfo request.RequestInfo -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/dropped_requests_tracker.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/dropped_requests_tracker.go deleted file mode 100644 index 74bf9eece..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/dropped_requests_tracker.go +++ /dev/null @@ -1,234 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flowcontrol - -import ( - "sync" - "sync/atomic" - "time" - - "k8s.io/utils/clock" -) - -const ( - // maxRetryAfter represents the maximum possible retryAfter. - maxRetryAfter = int64(32) -) - -// DroppedRequestsTracker is an interface that allows tracking -// a history od dropped requests in the system for the purpose -// of adjusting RetryAfter header to avoid system overload. -type DroppedRequestsTracker interface { - // RecordDroppedRequest records a request that was just - // dropped from processing. - RecordDroppedRequest(plName string) - - // GetRetryAfter returns the current suggested value of - // RetryAfter value. - GetRetryAfter(plName string) int64 -} - -// unixStat keeps a statistic how many requests were dropped within -// a single second. -type unixStat struct { - unixTime int64 - requests int64 -} - -type droppedRequestsStats struct { - lock sync.RWMutex - - // history stores the history of dropped requests. - history []unixStat - - // To reduce lock-contention, we store the information about - // the current second here, which we can then access under - // reader lock. - currentUnix int64 - currentCount atomic.Int64 - - retryAfter atomic.Int64 - retryAfterUpdateUnix int64 -} - -func newDroppedRequestsStats(nowUnix int64) *droppedRequestsStats { - result := &droppedRequestsStats{ - // We assume that we can bump at any time after first dropped request. - retryAfterUpdateUnix: 0, - } - result.retryAfter.Store(1) - return result -} - -func (s *droppedRequestsStats) recordDroppedRequest(unixTime int64) { - // Short path - if the current second matches passed time, - // just update the stats. - if done := func() bool { - s.lock.RLock() - defer s.lock.RUnlock() - if s.currentUnix == unixTime { - s.currentCount.Add(1) - return true - } - return false - }(); done { - return - } - - // We trigger the change of . - s.lock.Lock() - defer s.lock.Unlock() - if s.currentUnix == unixTime { - s.currentCount.Add(1) - return - } - - s.updateHistory(s.currentUnix, s.currentCount.Load()) - s.currentUnix = unixTime - s.currentCount.Store(1) - - // We only consider updating retryAfter when bumping the current second. - // However, given that we didn't report anything for the current second, - // we recompute it based on statistics from the previous one. - s.updateRetryAfterIfNeededLocked(unixTime) -} - -func (s *droppedRequestsStats) updateHistory(unixTime int64, count int64) { - s.history = append(s.history, unixStat{unixTime: unixTime, requests: count}) - - startIndex := 0 - // Entries that exceed 2*retryAfter or maxRetryAfter are never going to be needed. - maxHistory := 2 * s.retryAfter.Load() - if maxHistory > maxRetryAfter { - maxHistory = maxRetryAfter - } - for ; startIndex < len(s.history) && unixTime-s.history[startIndex].unixTime > maxHistory; startIndex++ { - } - if startIndex > 0 { - s.history = s.history[startIndex:] - } -} - -// updateRetryAfterIfNeededLocked updates the retryAfter based on the number of -// dropped requests in the last `retryAfter` seconds: -// - if there were less than `retryAfter` dropped requests, it decreases -// retryAfter -// - if there were at least 3*`retryAfter` dropped requests, it increases -// retryAfter -// -// The rationale behind these numbers being fairly low is that APF is queuing -// requests and rejecting (dropping) them is a last resort, which is not expected -// unless a given priority level is actually overloaded. -// -// Additionally, we rate-limit the increases of retryAfter to wait at least -// `retryAfter' seconds after the previous increase to avoid multiple bumps -// on a single spike. -// -// We're working with the interval [unixTime-retryAfter, unixTime). -func (s *droppedRequestsStats) updateRetryAfterIfNeededLocked(unixTime int64) { - retryAfter := s.retryAfter.Load() - - droppedRequests := int64(0) - for i := len(s.history) - 1; i >= 0; i-- { - if unixTime-s.history[i].unixTime > retryAfter { - break - } - if s.history[i].unixTime < unixTime { - droppedRequests += s.history[i].requests - } - } - - if unixTime-s.retryAfterUpdateUnix >= retryAfter && droppedRequests >= 3*retryAfter { - // We try to mimic the TCP algorithm and thus are doubling - // the retryAfter here. - retryAfter *= 2 - if retryAfter >= maxRetryAfter { - retryAfter = maxRetryAfter - } - s.retryAfter.Store(retryAfter) - s.retryAfterUpdateUnix = unixTime - return - } - - if droppedRequests < retryAfter && retryAfter > 1 { - // We try to mimc the TCP algorithm and thus are linearly - // scaling down the retryAfter here. - retryAfter-- - s.retryAfter.Store(retryAfter) - return - } -} - -// droppedRequestsTracker implement DroppedRequestsTracker interface -// for the purpose of adjusting RetryAfter header for newly dropped -// requests to avoid system overload. -type droppedRequestsTracker struct { - now func() time.Time - - lock sync.RWMutex - plStats map[string]*droppedRequestsStats -} - -// NewDroppedRequestsTracker is creating a new instance of -// DroppedRequestsTracker. -func NewDroppedRequestsTracker() DroppedRequestsTracker { - return newDroppedRequestsTracker(clock.RealClock{}.Now) -} - -func newDroppedRequestsTracker(now func() time.Time) *droppedRequestsTracker { - return &droppedRequestsTracker{ - now: now, - plStats: make(map[string]*droppedRequestsStats), - } -} - -func (t *droppedRequestsTracker) RecordDroppedRequest(plName string) { - unixTime := t.now().Unix() - - stats := func() *droppedRequestsStats { - // The list of priority levels should change very infrequently, - // so in almost all cases, the fast path should be enough. - t.lock.RLock() - if plStats, ok := t.plStats[plName]; ok { - t.lock.RUnlock() - return plStats - } - t.lock.RUnlock() - - // Slow path taking writer lock to update the map. - t.lock.Lock() - defer t.lock.Unlock() - if plStats, ok := t.plStats[plName]; ok { - return plStats - } - stats := newDroppedRequestsStats(unixTime) - t.plStats[plName] = stats - return stats - }() - - stats.recordDroppedRequest(unixTime) -} - -func (t *droppedRequestsTracker) GetRetryAfter(plName string) int64 { - t.lock.RLock() - defer t.lock.RUnlock() - - if plStats, ok := t.plStats[plName]; ok { - return plStats.retryAfter.Load() - } - return 1 -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/eventclock/interface.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/eventclock/interface.go deleted file mode 100644 index 58f88b992..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/eventclock/interface.go +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package eventclock - -import ( - "time" - - baseclock "k8s.io/utils/clock" -) - -// EventFunc does some work that needs to be done at or after the -// given time. -type EventFunc func(time.Time) - -// EventClock is an active clock abstraction for use in code that is -// testable with a fake clock that itself determines how time may be -// advanced. The timing paradigm is invoking EventFuncs rather than -// synchronizing through channels, so that the fake clock has a handle -// on when associated activity is done. -type Interface interface { - baseclock.PassiveClock - - // Sleep returns after the given duration (or more). - Sleep(d time.Duration) - - // EventAfterDuration invokes the given EventFunc after the given duration (or more), - // passing the time when the invocation was launched. - EventAfterDuration(f EventFunc, d time.Duration) - - // EventAfterTime invokes the given EventFunc at the given time or later, - // passing the time when the invocation was launched. - EventAfterTime(f EventFunc, t time.Time) -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/eventclock/real.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/eventclock/real.go deleted file mode 100644 index d567a0f45..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/eventclock/real.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package eventclock - -import ( - "time" - - "k8s.io/utils/clock" -) - -// RealEventClock fires event on real world time -type Real struct { - clock.RealClock -} - -var _ Interface = Real{} - -// EventAfterDuration schedules an EventFunc -func (Real) EventAfterDuration(f EventFunc, d time.Duration) { - ch := time.After(d) - go func() { - t := <-ch - f(t) - }() -} - -// EventAfterTime schedules an EventFunc -func (r Real) EventAfterTime(f EventFunc, t time.Time) { - r.EventAfterDuration(f, time.Until(t)) -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/integrator.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/integrator.go deleted file mode 100644 index f421a6425..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/integrator.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fairqueuing - -import ( - "math" - "sync" - "time" - - fcmetrics "k8s.io/apiserver/pkg/util/flowcontrol/metrics" - - "k8s.io/utils/clock" -) - -// Integrator computes the moments of some variable X over time as -// read from a particular clock. The integrals start when the -// Integrator is created, and ends at the latest operation on the -// Integrator. -type Integrator interface { - fcmetrics.Gauge - - GetResults() IntegratorResults - - // Return the results of integrating to now, and reset integration to start now - Reset() IntegratorResults -} - -// IntegratorResults holds statistical abstracts of the integration -type IntegratorResults struct { - Duration float64 //seconds - Average float64 //time-weighted - Deviation float64 //standard deviation: sqrt(avg((value-avg)^2)) - Min, Max float64 -} - -// Equal tests for semantic equality. -// This considers all NaN values to be equal to each other. -func (x *IntegratorResults) Equal(y *IntegratorResults) bool { - return x == y || x != nil && y != nil && x.Duration == y.Duration && x.Min == y.Min && x.Max == y.Max && (x.Average == y.Average || math.IsNaN(x.Average) && math.IsNaN(y.Average)) && (x.Deviation == y.Deviation || math.IsNaN(x.Deviation) && math.IsNaN(y.Deviation)) -} - -type integrator struct { - name string - clock clock.PassiveClock - sync.Mutex - lastTime time.Time - x float64 - moments Moments - min, max float64 -} - -// NewNamedIntegrator makes one that uses the given clock and name -func NewNamedIntegrator(clock clock.PassiveClock, name string) Integrator { - return &integrator{ - name: name, - clock: clock, - lastTime: clock.Now(), - } -} - -func (igr *integrator) Set(x float64) { - igr.Lock() - igr.setLocked(x) - igr.Unlock() -} - -func (igr *integrator) Add(deltaX float64) { - igr.Lock() - igr.setLocked(igr.x + deltaX) - igr.Unlock() -} - -func (igr *integrator) Inc() { - igr.Add(1) -} - -func (igr *integrator) Dec() { - igr.Add(-1) -} - -func (igr *integrator) SetToCurrentTime() { - igr.Set(float64(time.Now().UnixNano())) -} - -func (igr *integrator) setLocked(x float64) { - igr.updateLocked() - igr.x = x - if x < igr.min { - igr.min = x - } - if x > igr.max { - igr.max = x - } -} - -func (igr *integrator) updateLocked() { - now := igr.clock.Now() - dt := now.Sub(igr.lastTime).Seconds() - igr.lastTime = now - igr.moments = igr.moments.Add(ConstantMoments(dt, igr.x)) -} - -func (igr *integrator) GetResults() IntegratorResults { - igr.Lock() - defer igr.Unlock() - return igr.getResultsLocked() -} - -func (igr *integrator) Reset() IntegratorResults { - igr.Lock() - defer igr.Unlock() - results := igr.getResultsLocked() - igr.moments = Moments{} - igr.min = igr.x - igr.max = igr.x - return results -} - -func (igr *integrator) getResultsLocked() (results IntegratorResults) { - igr.updateLocked() - results.Min, results.Max = igr.min, igr.max - results.Duration = igr.moments.ElapsedSeconds - results.Average, results.Deviation = igr.moments.AvgAndStdDev() - return -} - -// Moments are the integrals of the 0, 1, and 2 powers of some -// variable X over some range of time. -type Moments struct { - ElapsedSeconds float64 // integral of dt - IntegralX float64 // integral of x dt - IntegralXX float64 // integral of x*x dt -} - -// ConstantMoments is for a constant X -func ConstantMoments(dt, x float64) Moments { - return Moments{ - ElapsedSeconds: dt, - IntegralX: x * dt, - IntegralXX: x * x * dt, - } -} - -// Add combines over two ranges of time -func (igr Moments) Add(ogr Moments) Moments { - return Moments{ - ElapsedSeconds: igr.ElapsedSeconds + ogr.ElapsedSeconds, - IntegralX: igr.IntegralX + ogr.IntegralX, - IntegralXX: igr.IntegralXX + ogr.IntegralXX, - } -} - -// Sub finds the difference between a range of time and a subrange -func (igr Moments) Sub(ogr Moments) Moments { - return Moments{ - ElapsedSeconds: igr.ElapsedSeconds - ogr.ElapsedSeconds, - IntegralX: igr.IntegralX - ogr.IntegralX, - IntegralXX: igr.IntegralXX - ogr.IntegralXX, - } -} - -// AvgAndStdDev returns the average and standard devation -func (igr Moments) AvgAndStdDev() (float64, float64) { - if igr.ElapsedSeconds <= 0 { - return math.NaN(), math.NaN() - } - avg := igr.IntegralX / igr.ElapsedSeconds - // standard deviation is sqrt( average( (x - xbar)^2 ) ) - // = sqrt( Integral( x^2 + xbar^2 -2*x*xbar dt ) / Duration ) - // = sqrt( ( Integral( x^2 dt ) + Duration * xbar^2 - 2*xbar*Integral(x dt) ) / Duration) - // = sqrt( Integral(x^2 dt)/Duration - xbar^2 ) - variance := igr.IntegralXX/igr.ElapsedSeconds - avg*avg - if variance >= 0 { - return avg, math.Sqrt(variance) - } - return avg, math.NaN() -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/interface.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/interface.go deleted file mode 100644 index 3b0ad1638..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/interface.go +++ /dev/null @@ -1,141 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fairqueuing - -import ( - "context" - - "k8s.io/apiserver/pkg/util/flowcontrol/debug" - "k8s.io/apiserver/pkg/util/flowcontrol/metrics" - "k8s.io/apiserver/pkg/util/flowcontrol/request" -) - -// QueueSetFactory is used to create QueueSet objects. Creation, like -// config update, is done in two phases: the first phase consumes the -// QueuingConfig and the second consumes the DispatchingConfig. They -// are separated so that errors from the first phase can be found -// before committing to a concurrency allotment for the second. -type QueueSetFactory interface { - // BeginConstruction does the first phase of creating a QueueSet. - // The RatioedGaugePair observes number of requests, - // execution covering just the regular phase. - // The denominator for the waiting phase is - // max(1, QueuingConfig.QueueLengthLimit) X max(1, QueuingConfig.DesiredNumQueues). - // The RatioedGauge observes number of seats occupied through all phases of execution. - // The denominator for all the ratioed concurrency gauges is supplied later in the DispatchingConfig. - // The Gauge observes the seat demand (executing + queued seats). - BeginConstruction(QueuingConfig, metrics.RatioedGaugePair, metrics.RatioedGauge, metrics.Gauge) (QueueSetCompleter, error) -} - -// QueueSetCompleter finishes the two-step process of creating or -// reconfiguring a QueueSet -type QueueSetCompleter interface { - // Complete returns a QueueSet configured by the given - // dispatching configuration. - Complete(DispatchingConfig) QueueSet -} - -// QueueSet is the abstraction for the queuing and dispatching -// functionality of one non-exempt priority level. It covers the -// functionality described in the "Assignment to a Queue", "Queuing", -// and "Dispatching" sections of -// https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/1040-priority-and-fairness/README.md -// . Some day we may have connections between priority levels, but -// today is not that day. -type QueueSet interface { - // BeginConfigChange starts the two-step process of updating the - // configuration. No change is made until Complete is called. If - // `C := X.BeginConstruction(q)` then `C.Complete(d)` returns the - // same value `X`. If the QueuingConfig's DesiredNumQueues field - // is zero then the other queuing-specific config parameters are - // not changed, so that the queues continue draining as before. - // In any case, reconfiguration does not discard any queue unless - // and until it is undesired and empty. - BeginConfigChange(QueuingConfig) (QueueSetCompleter, error) - - // IsIdle returns a bool indicating whether the QueueSet was idle - // at the moment of the return. Idle means the QueueSet has zero - // requests queued and zero executing. This bit can change only - // (1) during a call to StartRequest and (2) during a call to - // Request::Finish. In the latter case idleness can only change - // from false to true. - IsIdle() bool - - // StartRequest begins the process of handling a request. If the - // request gets queued and the number of queues is greater than 1 - // then StartRequest uses the given hashValue as the source of - // entropy as it shuffle-shards the request into a queue. The - // descr1 and descr2 values play no role in the logic but appear - // in log messages. This method always returns quickly (without - // waiting for the request to be dequeued). If this method - // returns a nil Request value then caller should reject the - // request and the returned bool indicates whether the QueueSet - // was idle at the moment of the return. Otherwise idle==false - // and the client must call the Finish method of the Request - // exactly once. - StartRequest(ctx context.Context, width *request.WorkEstimate, hashValue uint64, flowDistinguisher, fsName string, descr1, descr2 interface{}, queueNoteFn QueueNoteFn) (req Request, idle bool) - - // Dump saves and returns the instant internal state of the queue-set. - // Note that dumping process will stop the queue-set from proceeding - // any requests. - // For debugging only. - Dump(includeRequestDetails bool) debug.QueueSetDump -} - -// QueueNoteFn is called when a request enters and leaves a queue -type QueueNoteFn func(inQueue bool) - -// Request represents the remainder of the handling of one request -type Request interface { - // Finish determines whether to execute or reject the request and - // invokes `execute` if the decision is to execute the request. - // The returned `idle bool` value indicates whether the QueueSet - // was idle when the value was calculated, but might no longer be - // accurate by the time the client examines that value. - Finish(execute func()) (idle bool) -} - -// QueuingConfig defines the configuration of the queuing aspect of a QueueSet. -type QueuingConfig struct { - // Name is used to identify a queue set, allowing for descriptive information about its intended use - Name string - - // DesiredNumQueues is the number of queues that the API says - // should exist now. This may be non-positive, in which case - // QueueLengthLimit, and HandSize are ignored. - // A value of zero means to respect the ConcurrencyLimit of the DispatchingConfig. - // A negative value means to always dispatch immediately upon arrival - // (i.e., the requests are "exempt" from limitation). - DesiredNumQueues int - - // QueueLengthLimit is the maximum number of requests that may be waiting in a given queue at a time - QueueLengthLimit int - - // HandSize is a parameter of shuffle sharding. Upon arrival of a request, a queue is chosen by randomly - // dealing a "hand" of this many queues and then picking one of minimum length. - HandSize int -} - -// DispatchingConfig defines the configuration of the dispatching aspect of a QueueSet. -type DispatchingConfig struct { - // ConcurrencyLimit is the maximum number of requests of this QueueSet that may be executing at a time - ConcurrencyLimit int - - // ConcurrencyDenominator is used in relative metrics of concurrency. - // It equals ConcurrencyLimit except when that is zero. - ConcurrencyDenominator int -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/promise/interface.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/promise/interface.go deleted file mode 100644 index b2e3adbdc..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/promise/interface.go +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package promise - -// WriteOnce represents a variable that is initially not set and can -// be set once and is readable. This is the common meaning for -// "promise". -type WriteOnce interface { - // Get reads the current value of this variable. If this - // variable is not set yet then this call blocks until this - // variable gets a value. - Get() interface{} - - // Set normally writes a value into this variable, unblocks every - // goroutine waiting for this variable to have a value, and - // returns true. In the unhappy case that this variable is - // already set, this method returns false without modifying the - // variable's value. - Set(interface{}) bool -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/promise/promise.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/promise/promise.go deleted file mode 100644 index 79d19d136..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/promise/promise.go +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package promise - -import ( - "context" - "sync" -) - -// promise implements the WriteOnce interface. -type promise struct { - doneCtx context.Context - doneVal interface{} - setCh chan struct{} - onceler sync.Once - value interface{} -} - -var _ WriteOnce = &promise{} - -// NewWriteOnce makes a new thread-safe WriteOnce. -// -// If `initial` is non-nil then that value is Set at creation time. -// -// If a `Get` is waiting soon after the channel associated with the -// `doneCtx` becomes selectable (which never happens for the nil -// channel) then `Set(doneVal)` effectively happens at that time. -func NewWriteOnce(initial interface{}, doneCtx context.Context, doneVal interface{}) WriteOnce { - p := &promise{ - doneCtx: doneCtx, - doneVal: doneVal, - setCh: make(chan struct{}), - } - if initial != nil { - p.Set(initial) - } - return p -} - -func (p *promise) Get() interface{} { - select { - case <-p.setCh: - case <-p.doneCtx.Done(): - p.Set(p.doneVal) - } - return p.value -} - -func (p *promise) Set(value interface{}) bool { - var ans bool - p.onceler.Do(func() { - p.value = value - close(p.setCh) - ans = true - }) - return ans -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/doc.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/doc.go deleted file mode 100644 index fc30ebfd5..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/doc.go +++ /dev/null @@ -1,119 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package queueset implements a technique called "fair queuing for -// server requests". One QueueSet is a set of queues operating -// according to this technique. -// -// Fair queuing for server requests is inspired by the fair queuing -// technique from the world of networking. You can find a good paper -// on that at https://dl.acm.org/citation.cfm?doid=75247.75248 or -// http://people.csail.mit.edu/imcgraw/links/research/pubs/networks/WFQ.pdf -// and there is an implementation outline in the Wikipedia article at -// https://en.wikipedia.org/wiki/Fair_queuing . -// -// Fair queuing for server requests differs from traditional fair -// queuing in three ways: (1) we are dispatching application layer -// requests to a server rather than transmitting packets on a network -// link, (2) multiple requests can be executing at once, and (3) the -// service time (execution duration) is not known until the execution -// completes. -// -// The first two differences can easily be handled by straightforward -// adaptation of the concept called "R(t)" in the original paper and -// "virtual time" in the implementation outline. In that -// implementation outline, the notation now() is used to mean reading -// the virtual clock. In the original paper’s terms, "R(t)" is the -// number of "rounds" that have been completed at real time t --- -// where a round consists of virtually transmitting one bit from every -// non-empty queue in the router (regardless of which queue holds the -// packet that is really being transmitted at the moment); in this -// conception, a packet is considered to be "in" its queue until the -// packet’s transmission is finished. For our problem, we can define a -// round to be giving one nanosecond of CPU to every non-empty queue -// in the apiserver (where emptiness is judged based on both queued -// and executing requests from that queue), and define R(t) = (server -// start time) + (1 ns) * (number of rounds since server start). Let -// us write NEQ(t) for that number of non-empty queues in the -// apiserver at time t. Let us also write C for the concurrency -// limit. In the original paper, the partial derivative of R(t) with -// respect to t is -// -// 1 / NEQ(t) . -// -// To generalize from transmitting one packet at a time to executing C -// requests at a time, that derivative becomes -// -// C / NEQ(t) . -// -// However, sometimes there are fewer than C requests available to -// execute. For a given queue "q", let us also write "reqs(q, t)" for -// the number of requests of that queue that are executing at that -// time. The total number of requests executing is sum[over q] -// reqs(q, t) and if that is less than C then virtual time is not -// advancing as fast as it would if all C seats were occupied; in this -// case the numerator of the quotient in that derivative should be -// adjusted proportionally. Putting it all together for fair queing -// for server requests: at a particular time t, the partial derivative -// of R(t) with respect to t is -// -// min( C, sum[over q] reqs(q, t) ) / NEQ(t) . -// -// In terms of the implementation outline, this is the rate at which -// virtual time is advancing at time t (in virtual nanoseconds per -// real nanosecond). Where the networking implementation outline adds -// packet size to a virtual time, in our version this corresponds to -// adding a service time (i.e., duration) to virtual time. -// -// The third difference is handled by modifying the algorithm to -// dispatch based on an initial guess at the request’s service time -// (duration) and then make the corresponding adjustments once the -// request’s actual service time is known. This is similar, although -// not exactly isomorphic, to the original paper’s adjustment by -// `$\delta$` for the sake of promptness. -// -// For implementation simplicity (see below), let us use the same -// initial service time guess for every request; call that duration -// G. A good choice might be the service time limit (1 -// minute). Different guesses will give slightly different dynamics, -// but any positive number can be used for G without ruining the -// long-term behavior. -// -// As in ordinary fair queuing, there is a bound on divergence from -// the ideal. In plain fair queuing the bound is one packet; in our -// version it is C requests. -// -// To support efficiently making the necessary adjustments once a -// request’s actual service time is known, the virtual finish time of -// a request and the last virtual finish time of a queue are not -// represented directly but instead computed from queue length, -// request position in the queue, and an alternate state variable that -// holds the queue’s virtual start time. While the queue is empty and -// has no requests executing: the value of its virtual start time -// variable is ignored and its last virtual finish time is considered -// to be in the virtual past. When a request arrives to an empty queue -// with no requests executing, the queue’s virtual start time is set -// to the current virtual time. The virtual finish time of request -// number J in the queue (counting from J=1 for the head) is J * G + -// (queue's virtual start time). While the queue is non-empty: the -// last virtual finish time of the queue is the virtual finish time of -// the last request in the queue. While the queue is empty and has a -// request executing: the last virtual finish time is the queue’s -// virtual start time. When a request is dequeued for service the -// queue’s virtual start time is advanced by G. When a request -// finishes being served, and the actual service time was S, the -// queue’s virtual start time is decremented by G - S. -package queueset diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/fifo_list.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/fifo_list.go deleted file mode 100644 index eb56e1e94..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/fifo_list.go +++ /dev/null @@ -1,156 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package queueset - -import ( - "container/list" -) - -// removeFromFIFOFunc removes a designated element from the list -// if that element is in the list. -// The complexity of the runtime cost is O(1). -// The returned value is the element removed, if indeed one was removed, -// otherwise `nil`. -type removeFromFIFOFunc func() *request - -// walkFunc is called for each request in the list in the -// oldest -> newest order. -// ok: if walkFunc returns false then the iteration stops immediately. -// walkFunc may remove the given request from the fifo, -// but may not mutate the fifo in any othe way. -type walkFunc func(*request) (ok bool) - -// Internal interface to abstract out the implementation details -// of the underlying list used to maintain the requests. -// -// Note that a fifo, including the removeFromFIFOFuncs returned from Enqueue, -// is not safe for concurrent use by multiple goroutines. -type fifo interface { - // Enqueue enqueues the specified request into the list and - // returns a removeFromFIFOFunc function that can be used to remove the - // request from the list - Enqueue(*request) removeFromFIFOFunc - - // Dequeue pulls out the oldest request from the list. - Dequeue() (*request, bool) - - // Peek returns the oldest request without removing it. - Peek() (*request, bool) - - // Length returns the number of requests in the list. - Length() int - - // QueueSum returns the sum of initial seats, final seats, and - // additional latency aggregated from all requests in this queue. - QueueSum() queueSum - - // Walk iterates through the list in order of oldest -> newest - // and executes the specified walkFunc for each request in that order. - // - // if the specified walkFunc returns false the Walk function - // stops the walk an returns immediately. - Walk(walkFunc) -} - -// the FIFO list implementation is not safe for concurrent use by multiple -// goroutines. -type requestFIFO struct { - *list.List - - sum queueSum -} - -func newRequestFIFO() fifo { - return &requestFIFO{ - List: list.New(), - } -} - -func (l *requestFIFO) Length() int { - return l.Len() -} - -func (l *requestFIFO) QueueSum() queueSum { - return l.sum -} - -func (l *requestFIFO) Enqueue(req *request) removeFromFIFOFunc { - e := l.PushBack(req) - addToQueueSum(&l.sum, req) - - return func() *request { - if e.Value == nil { - return nil - } - l.Remove(e) - e.Value = nil - deductFromQueueSum(&l.sum, req) - return req - } -} - -func (l *requestFIFO) Dequeue() (*request, bool) { - return l.getFirst(true) -} - -func (l *requestFIFO) Peek() (*request, bool) { - return l.getFirst(false) -} - -func (l *requestFIFO) getFirst(remove bool) (*request, bool) { - e := l.Front() - if e == nil { - return nil, false - } - - if remove { - defer func() { - l.Remove(e) - e.Value = nil - }() - } - - request, ok := e.Value.(*request) - if remove && ok { - deductFromQueueSum(&l.sum, request) - } - return request, ok -} - -func (l *requestFIFO) Walk(f walkFunc) { - var next *list.Element - for current := l.Front(); current != nil; current = next { - next = current.Next() // f is allowed to remove current - if r, ok := current.Value.(*request); ok { - if !f(r) { - return - } - } - } -} - -func addToQueueSum(sum *queueSum, req *request) { - sum.InitialSeatsSum += req.InitialSeats() - sum.MaxSeatsSum += req.MaxSeats() - sum.TotalWorkSum += req.totalWork() -} - -func deductFromQueueSum(sum *queueSum, req *request) { - sum.InitialSeatsSum -= req.InitialSeats() - sum.MaxSeatsSum -= req.MaxSeats() - sum.TotalWorkSum -= req.totalWork() -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/queueset.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/queueset.go deleted file mode 100644 index 6d911ee2e..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/queueset.go +++ /dev/null @@ -1,1029 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package queueset - -import ( - "context" - "errors" - "fmt" - "math" - "sync" - "time" - - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apiserver/pkg/util/flowcontrol/debug" - fq "k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing" - "k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/eventclock" - "k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/promise" - "k8s.io/apiserver/pkg/util/flowcontrol/metrics" - fqrequest "k8s.io/apiserver/pkg/util/flowcontrol/request" - "k8s.io/apiserver/pkg/util/shufflesharding" - "k8s.io/klog/v2" -) - -const nsTimeFmt = "2006-01-02 15:04:05.000000000" - -// queueSetFactory implements the QueueSetFactory interface -// queueSetFactory makes QueueSet objects. -type queueSetFactory struct { - clock eventclock.Interface - promiseFactoryFactory promiseFactoryFactory -} - -// promiseFactory returns a WriteOnce -// - whose Set method is invoked with the queueSet locked, and -// - whose Get method is invoked with the queueSet not locked. -// The parameters are the same as for `promise.NewWriteOnce`. -type promiseFactory func(initial interface{}, doneCtx context.Context, doneVal interface{}) promise.WriteOnce - -// promiseFactoryFactory returns the promiseFactory to use for the given queueSet -type promiseFactoryFactory func(*queueSet) promiseFactory - -// `*queueSetCompleter` implements QueueSetCompleter. Exactly one of -// the fields `factory` and `theSet` is non-nil. -type queueSetCompleter struct { - factory *queueSetFactory - reqsGaugePair metrics.RatioedGaugePair - execSeatsGauge metrics.RatioedGauge - seatDemandIntegrator metrics.Gauge - theSet *queueSet - qCfg fq.QueuingConfig - dealer *shufflesharding.Dealer -} - -// queueSet implements the Fair Queuing for Server Requests technique -// described in this package's doc, and a pointer to one implements -// the QueueSet interface. The fields listed before the lock -// should not be changed; the fields listed after the -// lock must be accessed only while holding the lock. -// -// The methods of this type follow the naming convention that the -// suffix "Locked" means the caller must hold the lock; for a method -// whose name does not end in "Locked" either acquires the lock or -// does not care about locking. -// -// The methods of this type also follow the convention that the suffix -// "ToBoundLocked" means that the caller may have to follow up with a -// call to `boundNextDispatchLocked`. This is so for a method that -// changes what request is oldest in a queue, because that change means -// that the anti-windup hack in boundNextDispatchLocked needs to be -// applied wrt the revised oldest request in the queue. -type queueSet struct { - clock eventclock.Interface - estimatedServiceDuration time.Duration - - reqsGaugePair metrics.RatioedGaugePair // .RequestsExecuting covers regular phase only - - execSeatsGauge metrics.RatioedGauge // for all phases of execution - - seatDemandIntegrator metrics.Gauge - - promiseFactory promiseFactory - - lock sync.Mutex - - // qCfg holds the current queuing configuration. Its - // DesiredNumQueues may be less than the current number of queues. - // If its DesiredNumQueues is zero then its other queuing - // parameters retain the settings they had when DesiredNumQueues - // was last non-zero (if ever). - qCfg fq.QueuingConfig - - // the current dispatching configuration. - dCfg fq.DispatchingConfig - - // If `qCfg.DesiredNumQueues` is non-zero then dealer is not nil - // and is good for `qCfg`. - dealer *shufflesharding.Dealer - - // queues may be longer than the desired number, while the excess - // queues are still draining. - queues []*queue - - // currentR is the amount of seat-seconds allocated per queue since process startup. - // This is our generalization of the progress meter named R in the original fair queuing work. - currentR fqrequest.SeatSeconds - - // lastRealTime is what `clock.Now()` yielded when `virtualTime` was last updated - lastRealTime time.Time - - // robinIndex is the index of the last queue dispatched - robinIndex int - - // totRequestsWaiting is the sum, over all the queues, of the - // number of requests waiting in that queue - totRequestsWaiting int - - // totRequestsExecuting is the total number of requests of this - // queueSet that are currently executing. That is the same as the - // sum, over all the queues, of the number of requests executing - // from that queue. - totRequestsExecuting int - - // requestsExecutingSet is the set of requests executing in the real world IF - // there are no queues; otherwise the requests are tracked in the queues. - requestsExecutingSet sets.Set[*request] - - // totSeatsInUse is the number of total "seats" in use by all the - // request(s) that are currently executing in this queueset. - totSeatsInUse int - - // totSeatsWaiting is the sum, over all the waiting requests, of their - // max width. - totSeatsWaiting int - - // enqueues is the number of requests that have ever been enqueued - enqueues int - - // totRequestsDispatched is the total number of requests of this - // queueSet that have been processed. - totRequestsDispatched int - - // totRequestsRejected is the total number of requests of this - // queueSet that have been rejected. - totRequestsRejected int - - // totRequestsTimedout is the total number of requests of this - // queueSet that have been timeouted. - totRequestsTimedout int - - // totRequestsCancelled is the total number of requests of this - // queueSet that have been cancelled. - totRequestsCancelled int -} - -// NewQueueSetFactory creates a new QueueSetFactory object -func NewQueueSetFactory(c eventclock.Interface) fq.QueueSetFactory { - return newTestableQueueSetFactory(c, ordinaryPromiseFactoryFactory) -} - -// newTestableQueueSetFactory creates a new QueueSetFactory object with the given promiseFactoryFactory -func newTestableQueueSetFactory(c eventclock.Interface, promiseFactoryFactory promiseFactoryFactory) fq.QueueSetFactory { - return &queueSetFactory{ - clock: c, - promiseFactoryFactory: promiseFactoryFactory, - } -} - -func (qsf *queueSetFactory) BeginConstruction(qCfg fq.QueuingConfig, reqsGaugePair metrics.RatioedGaugePair, execSeatsGauge metrics.RatioedGauge, seatDemandIntegrator metrics.Gauge) (fq.QueueSetCompleter, error) { - dealer, err := checkConfig(qCfg) - if err != nil { - return nil, err - } - return &queueSetCompleter{ - factory: qsf, - reqsGaugePair: reqsGaugePair, - execSeatsGauge: execSeatsGauge, - seatDemandIntegrator: seatDemandIntegrator, - qCfg: qCfg, - dealer: dealer}, nil -} - -// checkConfig returns a non-nil Dealer if the config is valid and -// calls for one, and returns a non-nil error if the given config is -// invalid. -func checkConfig(qCfg fq.QueuingConfig) (*shufflesharding.Dealer, error) { - if qCfg.DesiredNumQueues <= 0 { - return nil, nil - } - dealer, err := shufflesharding.NewDealer(qCfg.DesiredNumQueues, qCfg.HandSize) - if err != nil { - err = fmt.Errorf("the QueueSetConfig implies an invalid shuffle sharding config (DesiredNumQueues is deckSize): %w", err) - } - return dealer, err -} - -func (qsc *queueSetCompleter) Complete(dCfg fq.DispatchingConfig) fq.QueueSet { - qs := qsc.theSet - if qs == nil { - qs = &queueSet{ - clock: qsc.factory.clock, - estimatedServiceDuration: 3 * time.Millisecond, - reqsGaugePair: qsc.reqsGaugePair, - execSeatsGauge: qsc.execSeatsGauge, - seatDemandIntegrator: qsc.seatDemandIntegrator, - qCfg: qsc.qCfg, - currentR: 0, - lastRealTime: qsc.factory.clock.Now(), - requestsExecutingSet: sets.New[*request](), - } - qs.promiseFactory = qsc.factory.promiseFactoryFactory(qs) - } - qs.setConfiguration(context.Background(), qsc.qCfg, qsc.dealer, dCfg) - return qs -} - -// createQueues is a helper method for initializing an array of n queues -func createQueues(n, baseIndex int) []*queue { - fqqueues := make([]*queue, n) - for i := 0; i < n; i++ { - fqqueues[i] = &queue{index: baseIndex + i, requestsWaiting: newRequestFIFO(), requestsExecuting: sets.New[*request]()} - } - return fqqueues -} - -func (qs *queueSet) BeginConfigChange(qCfg fq.QueuingConfig) (fq.QueueSetCompleter, error) { - dealer, err := checkConfig(qCfg) - if err != nil { - return nil, err - } - return &queueSetCompleter{ - theSet: qs, - qCfg: qCfg, - dealer: dealer}, nil -} - -// setConfiguration is used to set the configuration for a queueSet. -// Update handling for when fields are updated is handled here as well - -// eg: if DesiredNum is increased, setConfiguration reconciles by -// adding more queues. -func (qs *queueSet) setConfiguration(ctx context.Context, qCfg fq.QueuingConfig, dealer *shufflesharding.Dealer, dCfg fq.DispatchingConfig) { - qs.lockAndSyncTime(ctx) - defer qs.lock.Unlock() - - if qCfg.DesiredNumQueues > 0 { - // Adding queues is the only thing that requires immediate action - // Removing queues is handled by attrition, removing a queue when - // it goes empty and there are too many. - numQueues := len(qs.queues) - if qCfg.DesiredNumQueues > numQueues { - qs.queues = append(qs.queues, - createQueues(qCfg.DesiredNumQueues-numQueues, len(qs.queues))...) - } - } else { - qCfg.QueueLengthLimit = qs.qCfg.QueueLengthLimit - qCfg.HandSize = qs.qCfg.HandSize - } - - qs.qCfg = qCfg - qs.dCfg = dCfg - qs.dealer = dealer - qll := qCfg.QueueLengthLimit - if qll < 1 { - qll = 1 - } - if qCfg.DesiredNumQueues > 0 { - qll *= qCfg.DesiredNumQueues - } - qs.reqsGaugePair.RequestsWaiting.SetDenominator(float64(qll)) - qs.reqsGaugePair.RequestsExecuting.SetDenominator(float64(dCfg.ConcurrencyDenominator)) - qs.execSeatsGauge.SetDenominator(float64(dCfg.ConcurrencyDenominator)) - - qs.dispatchAsMuchAsPossibleLocked() -} - -// A decision about a request -type requestDecision int - -// Values passed through a request's decision -const ( - // Serve this one - decisionExecute requestDecision = iota - - // This one's context timed out / was canceled - decisionCancel -) - -// StartRequest begins the process of handling a request. We take the -// approach of updating the metrics about total requests queued and -// executing at each point where there is a change in that quantity, -// because the metrics --- and only the metrics --- track that -// quantity per FlowSchema. -// The queueSet's promiseFactory is invoked once if the returned Request is non-nil, -// not invoked if the Request is nil. -func (qs *queueSet) StartRequest(ctx context.Context, workEstimate *fqrequest.WorkEstimate, hashValue uint64, flowDistinguisher, fsName string, descr1, descr2 interface{}, queueNoteFn fq.QueueNoteFn) (fq.Request, bool) { - qs.lockAndSyncTime(ctx) - defer qs.lock.Unlock() - var req *request - - // ======================================================================== - // Step 0: - // Apply only concurrency limit, if zero queues desired - if qs.qCfg.DesiredNumQueues < 1 { - if !qs.canAccommodateSeatsLocked(workEstimate.MaxSeats()) { - klog.V(5).Infof("QS(%s): rejecting request %q %#+v %#+v because %d seats are asked for, %d seats are in use (%d are executing) and the limit is %d", - qs.qCfg.Name, fsName, descr1, descr2, workEstimate, qs.totSeatsInUse, qs.totRequestsExecuting, qs.dCfg.ConcurrencyLimit) - qs.totRequestsRejected++ - metrics.AddReject(ctx, qs.qCfg.Name, fsName, "concurrency-limit") - return nil, qs.isIdleLocked() - } - req = qs.dispatchSansQueueLocked(ctx, workEstimate, flowDistinguisher, fsName, descr1, descr2) - return req, false - } - - // ======================================================================== - // Step 1: - // 1) Start with shuffle sharding, to pick a queue. - // 2) Reject current request if there is not enough concurrency shares and - // we are at max queue length - // 3) If not rejected, create a request and enqueue - req = qs.shuffleShardAndRejectOrEnqueueLocked(ctx, workEstimate, hashValue, flowDistinguisher, fsName, descr1, descr2, queueNoteFn) - // req == nil means that the request was rejected - no remaining - // concurrency shares and at max queue length already - if req == nil { - klog.V(5).Infof("QS(%s): rejecting request %q %#+v %#+v due to queue full", qs.qCfg.Name, fsName, descr1, descr2) - qs.totRequestsRejected++ - metrics.AddReject(ctx, qs.qCfg.Name, fsName, "queue-full") - return nil, qs.isIdleLocked() - } - - // ======================================================================== - // Step 2: - // The next step is to invoke the method that dequeues as much - // as possible. - // This method runs a loop, as long as there are non-empty - // queues and the number currently executing is less than the - // assured concurrency value. The body of the loop uses the - // fair queuing technique to pick a queue and dispatch a - // request from that queue. - qs.dispatchAsMuchAsPossibleLocked() - - return req, false -} - -// ordinaryPromiseFactoryFactory is the promiseFactoryFactory that -// a queueSetFactory would ordinarily use. -// Test code might use something different. -func ordinaryPromiseFactoryFactory(qs *queueSet) promiseFactory { - return promise.NewWriteOnce -} - -// MaxSeats returns the maximum number of seats this request requires, it is -// the maxumum of the two - WorkEstimate.InitialSeats, WorkEstimate.FinalSeats. -func (req *request) MaxSeats() int { - return req.workEstimate.MaxSeats() -} - -func (req *request) InitialSeats() int { - return int(req.workEstimate.InitialSeats) -} - -func (req *request) NoteQueued(inQueue bool) { - if req.queueNoteFn != nil { - req.queueNoteFn(inQueue) - } -} - -func (req *request) Finish(execFn func()) bool { - exec, idle := req.wait() - if !exec { - return idle - } - func() { - defer func() { - idle = req.qs.finishRequestAndDispatchAsMuchAsPossible(req) - }() - - execFn() - }() - - return idle -} - -func (req *request) wait() (bool, bool) { - qs := req.qs - - // ======================================================================== - // Step 3: - // The final step is to wait on a decision from - // somewhere and then act on it. - decisionAny := req.decision.Get() - qs.lockAndSyncTime(req.ctx) - defer qs.lock.Unlock() - if req.waitStarted { - // This can not happen, because the client is forbidden to - // call Wait twice on the same request - klog.Errorf("Duplicate call to the Wait method! Immediately returning execute=false. QueueSet=%s, startTime=%s, descr1=%#+v, descr2=%#+v", req.qs.qCfg.Name, req.startTime, req.descr1, req.descr2) - return false, qs.isIdleLocked() - } - req.waitStarted = true - switch decisionAny { - case decisionCancel: // handle in code following this switch - case decisionExecute: - klog.V(5).Infof("QS(%s): Dispatching request %#+v %#+v from its queue", qs.qCfg.Name, req.descr1, req.descr2) - return true, false - default: - // This can not happen, all possible values are handled above - klog.Errorf("QS(%s): Impossible decision (type %T, value %#+v) for request %#+v %#+v! Treating as cancel", qs.qCfg.Name, decisionAny, decisionAny, req.descr1, req.descr2) - } - // TODO(aaron-prindle) add metrics for this case - klog.V(5).Infof("QS(%s): Ejecting request %#+v %#+v from its queue", qs.qCfg.Name, req.descr1, req.descr2) - // remove the request from the queue as its queue wait time has exceeded - queue := req.queue - if req.removeFromQueueLocked() != nil { - defer qs.boundNextDispatchLocked(queue) - qs.totRequestsWaiting-- - qs.totSeatsWaiting -= req.MaxSeats() - qs.totRequestsRejected++ - qs.totRequestsCancelled++ - metrics.AddReject(req.ctx, qs.qCfg.Name, req.fsName, "time-out") - metrics.AddRequestsInQueues(req.ctx, qs.qCfg.Name, req.fsName, -1) - metrics.AddSeatsInQueues(req.ctx, qs.qCfg.Name, req.fsName, -req.MaxSeats()) - req.NoteQueued(false) - qs.reqsGaugePair.RequestsWaiting.Add(-1) - qs.seatDemandIntegrator.Set(float64(qs.totSeatsInUse + qs.totSeatsWaiting)) - } - return false, qs.isIdleLocked() -} - -func (qs *queueSet) IsIdle() bool { - qs.lock.Lock() - defer qs.lock.Unlock() - return qs.isIdleLocked() -} - -func (qs *queueSet) isIdleLocked() bool { - return qs.totRequestsWaiting == 0 && qs.totRequestsExecuting == 0 -} - -// lockAndSyncTime acquires the lock and updates the virtual time. -// Doing them together avoids the mistake of modifying some queue state -// before calling syncTimeLocked. -func (qs *queueSet) lockAndSyncTime(ctx context.Context) { - qs.lock.Lock() - qs.syncTimeLocked(ctx) -} - -// syncTimeLocked updates the virtual time based on the assumption -// that the current state of the queues has been in effect since -// `qs.lastRealTime`. Thus, it should be invoked after acquiring the -// lock and before modifying the state of any queue. -func (qs *queueSet) syncTimeLocked(ctx context.Context) { - realNow := qs.clock.Now() - timeSinceLast := realNow.Sub(qs.lastRealTime) - qs.lastRealTime = realNow - prevR := qs.currentR - incrR := fqrequest.SeatsTimesDuration(qs.getVirtualTimeRatioLocked(), timeSinceLast) - qs.currentR = prevR + incrR - switch { - case prevR > qs.currentR: - klog.ErrorS(errors.New("queueset::currentR overflow"), "Overflow", "QS", qs.qCfg.Name, "when", realNow.Format(nsTimeFmt), "prevR", prevR, "incrR", incrR, "currentR", qs.currentR) - case qs.currentR >= highR: - qs.advanceEpoch(ctx, realNow, incrR) - } - metrics.SetCurrentR(qs.qCfg.Name, qs.currentR.ToFloat()) -} - -// rDecrement is the amount by which the progress meter R is wound backwards -// when needed to avoid overflow. -const rDecrement = fqrequest.MaxSeatSeconds / 2 - -// highR is the threshold that triggers advance of the epoch. -// That is, decrementing the global progress meter R by rDecrement. -const highR = rDecrement + rDecrement/2 - -// advanceEpoch subtracts rDecrement from the global progress meter R -// and all the readings that have been taked from that meter. -// The now and incrR parameters are only used to add info to the log messages. -func (qs *queueSet) advanceEpoch(ctx context.Context, now time.Time, incrR fqrequest.SeatSeconds) { - oldR := qs.currentR - qs.currentR -= rDecrement - klog.InfoS("Advancing epoch", "QS", qs.qCfg.Name, "when", now.Format(nsTimeFmt), "oldR", oldR, "newR", qs.currentR, "incrR", incrR) - success := true - for qIdx, queue := range qs.queues { - if queue.requestsWaiting.Length() == 0 && queue.requestsExecuting.Len() == 0 { - // Do not just decrement, the value could be quite outdated. - // It is safe to reset to zero in this case, because the next request - // will overwrite the zero with `qs.currentR`. - queue.nextDispatchR = 0 - continue - } - oldNextDispatchR := queue.nextDispatchR - queue.nextDispatchR -= rDecrement - if queue.nextDispatchR > oldNextDispatchR { - klog.ErrorS(errors.New("queue::nextDispatchR underflow"), "Underflow", "QS", qs.qCfg.Name, "queue", qIdx, "oldNextDispatchR", oldNextDispatchR, "newNextDispatchR", queue.nextDispatchR, "incrR", incrR) - success = false - } - queue.requestsWaiting.Walk(func(req *request) bool { - oldArrivalR := req.arrivalR - req.arrivalR -= rDecrement - if req.arrivalR > oldArrivalR { - klog.ErrorS(errors.New("request::arrivalR underflow"), "Underflow", "QS", qs.qCfg.Name, "queue", qIdx, "request", *req, "oldArrivalR", oldArrivalR, "incrR", incrR) - success = false - } - return true - }) - } - metrics.AddEpochAdvance(ctx, qs.qCfg.Name, success) -} - -// getVirtualTimeRatio calculates the rate at which virtual time has -// been advancing, according to the logic in `doc.go`. -func (qs *queueSet) getVirtualTimeRatioLocked() float64 { - activeQueues := 0 - seatsRequested := 0 - for _, queue := range qs.queues { - // here we want the sum of the maximum width of the requests in this queue since our - // goal is to find the maximum rate at which the queue could work. - seatsRequested += (queue.seatsInUse + queue.requestsWaiting.QueueSum().MaxSeatsSum) - if queue.requestsWaiting.Length() > 0 || queue.requestsExecuting.Len() > 0 { - activeQueues++ - } - } - if activeQueues == 0 { - return 0 - } - return math.Min(float64(seatsRequested), float64(qs.dCfg.ConcurrencyLimit)) / float64(activeQueues) -} - -// shuffleShardAndRejectOrEnqueueLocked encapsulates the logic required -// to validate and enqueue a request for the queueSet/QueueSet: -// 1) Start with shuffle sharding, to pick a queue. -// 2) Reject current request if there is not enough concurrency shares and -// we are at max queue length -// 3) If not rejected, create a request and enqueue -// returns the enqueud request on a successful enqueue -// returns nil in the case that there is no available concurrency or -// the queuelengthlimit has been reached -func (qs *queueSet) shuffleShardAndRejectOrEnqueueLocked(ctx context.Context, workEstimate *fqrequest.WorkEstimate, hashValue uint64, flowDistinguisher, fsName string, descr1, descr2 interface{}, queueNoteFn fq.QueueNoteFn) *request { - // Start with the shuffle sharding, to pick a queue. - queueIdx := qs.shuffleShardLocked(hashValue, descr1, descr2) - queue := qs.queues[queueIdx] - - defer qs.boundNextDispatchLocked(queue) - - // Create a request and enqueue - req := &request{ - qs: qs, - fsName: fsName, - flowDistinguisher: flowDistinguisher, - ctx: ctx, - decision: qs.promiseFactory(nil, ctx, decisionCancel), - arrivalTime: qs.clock.Now(), - arrivalR: qs.currentR, - queue: queue, - descr1: descr1, - descr2: descr2, - queueNoteFn: queueNoteFn, - workEstimate: qs.completeWorkEstimate(workEstimate), - } - if ok := qs.rejectOrEnqueueToBoundLocked(req); !ok { - return nil - } - metrics.ObserveQueueLength(ctx, qs.qCfg.Name, fsName, queue.requestsWaiting.Length()) - return req -} - -// shuffleShardLocked uses shuffle sharding to select a queue index -// using the given hashValue and the shuffle sharding parameters of the queueSet. -func (qs *queueSet) shuffleShardLocked(hashValue uint64, descr1, descr2 interface{}) int { - var backHand [8]int - // Deal into a data structure, so that the order of visit below is not necessarily the order of the deal. - // This removes bias in the case of flows with overlapping hands. - hand := qs.dealer.DealIntoHand(hashValue, backHand[:]) - handSize := len(hand) - offset := qs.enqueues % handSize - qs.enqueues++ - bestQueueIdx := -1 - minQueueSeatSeconds := fqrequest.MaxSeatSeconds - for i := 0; i < handSize; i++ { - queueIdx := hand[(offset+i)%handSize] - queue := qs.queues[queueIdx] - queueSum := queue.requestsWaiting.QueueSum() - - // this is the total amount of work in seat-seconds for requests - // waiting in this queue, we will select the queue with the minimum. - thisQueueSeatSeconds := queueSum.TotalWorkSum - klog.V(7).Infof("QS(%s): For request %#+v %#+v considering queue %d with sum: %#v and %d seats in use, nextDispatchR=%v", qs.qCfg.Name, descr1, descr2, queueIdx, queueSum, queue.seatsInUse, queue.nextDispatchR) - if thisQueueSeatSeconds < minQueueSeatSeconds { - minQueueSeatSeconds = thisQueueSeatSeconds - bestQueueIdx = queueIdx - } - } - if klogV := klog.V(6); klogV.Enabled() { - chosenQueue := qs.queues[bestQueueIdx] - klogV.Infof("QS(%s) at t=%s R=%v: For request %#+v %#+v chose queue %d, with sum: %#v & %d seats in use & nextDispatchR=%v", qs.qCfg.Name, qs.clock.Now().Format(nsTimeFmt), qs.currentR, descr1, descr2, bestQueueIdx, chosenQueue.requestsWaiting.QueueSum(), chosenQueue.seatsInUse, chosenQueue.nextDispatchR) - } - return bestQueueIdx -} - -// rejectOrEnqueueToBoundLocked rejects or enqueues the newly arrived -// request, which has been assigned to a queue. If up against the -// queue length limit and the concurrency limit then returns false. -// Otherwise enqueues and returns true. -func (qs *queueSet) rejectOrEnqueueToBoundLocked(request *request) bool { - queue := request.queue - curQueueLength := queue.requestsWaiting.Length() - // rejects the newly arrived request if resource criteria not met - if qs.totSeatsInUse >= qs.dCfg.ConcurrencyLimit && - curQueueLength >= qs.qCfg.QueueLengthLimit { - return false - } - - qs.enqueueToBoundLocked(request) - return true -} - -// enqueues a request into its queue. -func (qs *queueSet) enqueueToBoundLocked(request *request) { - queue := request.queue - now := qs.clock.Now() - if queue.requestsWaiting.Length() == 0 && queue.requestsExecuting.Len() == 0 { - // the queue’s start R is set to the virtual time. - queue.nextDispatchR = qs.currentR - klogV := klog.V(6) - if klogV.Enabled() { - klogV.Infof("QS(%s) at t=%s R=%v: initialized queue %d start R due to request %#+v %#+v", qs.qCfg.Name, now.Format(nsTimeFmt), queue.nextDispatchR, queue.index, request.descr1, request.descr2) - } - } - request.removeFromQueueLocked = queue.requestsWaiting.Enqueue(request) - qs.totRequestsWaiting++ - qs.totSeatsWaiting += request.MaxSeats() - metrics.AddRequestsInQueues(request.ctx, qs.qCfg.Name, request.fsName, 1) - metrics.AddSeatsInQueues(request.ctx, qs.qCfg.Name, request.fsName, request.MaxSeats()) - request.NoteQueued(true) - qs.reqsGaugePair.RequestsWaiting.Add(1) - qs.seatDemandIntegrator.Set(float64(qs.totSeatsInUse + qs.totSeatsWaiting)) -} - -// dispatchAsMuchAsPossibleLocked does as many dispatches as possible now. -func (qs *queueSet) dispatchAsMuchAsPossibleLocked() { - for qs.totRequestsWaiting != 0 && qs.totSeatsInUse < qs.dCfg.ConcurrencyLimit && qs.dispatchLocked() { - } -} - -func (qs *queueSet) dispatchSansQueueLocked(ctx context.Context, workEstimate *fqrequest.WorkEstimate, flowDistinguisher, fsName string, descr1, descr2 interface{}) *request { - // does not call metrics.SetDispatchMetrics because there is no queuing and thus no interesting virtual world - now := qs.clock.Now() - req := &request{ - qs: qs, - fsName: fsName, - flowDistinguisher: flowDistinguisher, - ctx: ctx, - startTime: now, - decision: qs.promiseFactory(decisionExecute, ctx, decisionCancel), - arrivalTime: now, - arrivalR: qs.currentR, - descr1: descr1, - descr2: descr2, - workEstimate: qs.completeWorkEstimate(workEstimate), - } - qs.totRequestsExecuting++ - qs.totSeatsInUse += req.MaxSeats() - qs.requestsExecutingSet = qs.requestsExecutingSet.Insert(req) - metrics.AddRequestsExecuting(ctx, qs.qCfg.Name, fsName, 1) - metrics.AddSeatConcurrencyInUse(qs.qCfg.Name, fsName, req.MaxSeats()) - qs.reqsGaugePair.RequestsExecuting.Add(1) - qs.execSeatsGauge.Add(float64(req.MaxSeats())) - qs.seatDemandIntegrator.Set(float64(qs.totSeatsInUse + qs.totSeatsWaiting)) - klogV := klog.V(5) - if klogV.Enabled() { - klogV.Infof("QS(%s) at t=%s R=%v: immediate dispatch of request %q %#+v %#+v, qs will have %d executing", qs.qCfg.Name, now.Format(nsTimeFmt), qs.currentR, fsName, descr1, descr2, qs.totRequestsExecuting) - } - return req -} - -// dispatchLocked uses the Fair Queuing for Server Requests method to -// select a queue and dispatch the oldest request in that queue. The -// return value indicates whether a request was dequeued; this will -// be false when either all queues are empty or the request at the head -// of the next queue cannot be dispatched. -func (qs *queueSet) dispatchLocked() bool { - queue, request := qs.findDispatchQueueToBoundLocked() - if queue == nil { - return false - } - if request == nil { // This should never happen. But if it does... - return false - } - qs.totRequestsWaiting-- - qs.totSeatsWaiting -= request.MaxSeats() - metrics.AddRequestsInQueues(request.ctx, qs.qCfg.Name, request.fsName, -1) - metrics.AddSeatsInQueues(request.ctx, qs.qCfg.Name, request.fsName, -request.MaxSeats()) - request.NoteQueued(false) - qs.reqsGaugePair.RequestsWaiting.Add(-1) - defer qs.boundNextDispatchLocked(queue) - if !request.decision.Set(decisionExecute) { - qs.seatDemandIntegrator.Set(float64(qs.totSeatsInUse + qs.totSeatsWaiting)) - return true - } - request.startTime = qs.clock.Now() - // At this moment the request leaves its queue and starts - // executing. We do not recognize any interim state between - // "queued" and "executing". While that means "executing" - // includes a little overhead from this package, this is not a - // problem because other overhead is also included. - qs.totRequestsExecuting++ - qs.totSeatsInUse += request.MaxSeats() - queue.requestsExecuting = queue.requestsExecuting.Insert(request) - queue.seatsInUse += request.MaxSeats() - metrics.AddRequestsExecuting(request.ctx, qs.qCfg.Name, request.fsName, 1) - metrics.AddSeatConcurrencyInUse(qs.qCfg.Name, request.fsName, request.MaxSeats()) - qs.reqsGaugePair.RequestsExecuting.Add(1) - qs.execSeatsGauge.Add(float64(request.MaxSeats())) - qs.seatDemandIntegrator.Set(float64(qs.totSeatsInUse + qs.totSeatsWaiting)) - klogV := klog.V(6) - if klogV.Enabled() { - klogV.Infof("QS(%s) at t=%s R=%v: dispatching request %#+v %#+v work %v from queue %d with start R %v, queue will have %d waiting & %d requests occupying %d seats, set will have %d seats occupied", - qs.qCfg.Name, request.startTime.Format(nsTimeFmt), qs.currentR, request.descr1, request.descr2, - request.workEstimate, queue.index, queue.nextDispatchR, queue.requestsWaiting.Length(), queue.requestsExecuting.Len(), queue.seatsInUse, qs.totSeatsInUse) - } - // When a request is dequeued for service -> qs.virtualStart += G * width - if request.totalWork() > rDecrement/100 { // A single increment should never be so big - klog.Errorf("QS(%s) at t=%s R=%v: dispatching request %#+v %#+v with implausibly high work %v from queue %d with start R %v", - qs.qCfg.Name, request.startTime.Format(nsTimeFmt), qs.currentR, request.descr1, request.descr2, - request.workEstimate, queue.index, queue.nextDispatchR) - } - queue.nextDispatchR += request.totalWork() - return true -} - -// canAccommodateSeatsLocked returns true if this queueSet has enough -// seats available to accommodate a request with the given number of seats, -// otherwise it returns false. -func (qs *queueSet) canAccommodateSeatsLocked(seats int) bool { - switch { - case qs.qCfg.DesiredNumQueues < 0: - // This is code for exemption from limitation - return true - case seats > qs.dCfg.ConcurrencyLimit: - // we have picked the queue with the minimum virtual finish time, but - // the number of seats this request asks for exceeds the concurrency limit. - // TODO: this is a quick fix for now, once we have borrowing in place we will not need it - if qs.totRequestsExecuting == 0 { - // TODO: apply additional lateny associated with this request, as described in the KEP - return true - } - // wait for all "currently" executing requests in this queueSet - // to finish before we can execute this request. - return false - case qs.totSeatsInUse+seats > qs.dCfg.ConcurrencyLimit: - return false - } - - return true -} - -// findDispatchQueueToBoundLocked examines the queues in round robin order and -// returns the first one of those for which the virtual finish time of -// the oldest waiting request is minimal, and also returns that request. -// Returns nils if the head of the selected queue can not be dispatched now, -// in which case the caller does not need to follow up with`qs.boundNextDispatchLocked`. -func (qs *queueSet) findDispatchQueueToBoundLocked() (*queue, *request) { - minVirtualFinish := fqrequest.MaxSeatSeconds - sMin := fqrequest.MaxSeatSeconds - dsMin := fqrequest.MaxSeatSeconds - sMax := fqrequest.MinSeatSeconds - dsMax := fqrequest.MinSeatSeconds - var minQueue *queue - var minIndex int - nq := len(qs.queues) - for range qs.queues { - qs.robinIndex = (qs.robinIndex + 1) % nq - queue := qs.queues[qs.robinIndex] - oldestWaiting, _ := queue.requestsWaiting.Peek() - if oldestWaiting != nil { - sMin = min(sMin, queue.nextDispatchR) - sMax = max(sMax, queue.nextDispatchR) - estimatedWorkInProgress := fqrequest.SeatsTimesDuration(float64(queue.seatsInUse), qs.estimatedServiceDuration) - dsMin = min(dsMin, queue.nextDispatchR-estimatedWorkInProgress) - dsMax = max(dsMax, queue.nextDispatchR-estimatedWorkInProgress) - currentVirtualFinish := queue.nextDispatchR + oldestWaiting.totalWork() - klog.V(11).InfoS("Considering queue to dispatch", "queueSet", qs.qCfg.Name, "queue", qs.robinIndex, "finishR", currentVirtualFinish) - if currentVirtualFinish < minVirtualFinish { - minVirtualFinish = currentVirtualFinish - minQueue = queue - minIndex = qs.robinIndex - } - } - } - - oldestReqFromMinQueue, _ := minQueue.requestsWaiting.Peek() - if oldestReqFromMinQueue == nil { - // This cannot happen - klog.ErrorS(errors.New("selected queue is empty"), "Impossible", "queueSet", qs.qCfg.Name) - return nil, nil - } - if !qs.canAccommodateSeatsLocked(oldestReqFromMinQueue.MaxSeats()) { - // since we have not picked the queue with the minimum virtual finish - // time, we are not going to advance the round robin index here. - klogV := klog.V(4) - if klogV.Enabled() { - klogV.Infof("QS(%s): request %v %v seats %d cannot be dispatched from queue %d, waiting for currently executing requests to complete, %d requests are occupying %d seats and the limit is %d", - qs.qCfg.Name, oldestReqFromMinQueue.descr1, oldestReqFromMinQueue.descr2, oldestReqFromMinQueue.MaxSeats(), minQueue.index, qs.totRequestsExecuting, qs.totSeatsInUse, qs.dCfg.ConcurrencyLimit) - } - metrics.AddDispatchWithNoAccommodation(qs.qCfg.Name, oldestReqFromMinQueue.fsName) - return nil, nil - } - oldestReqFromMinQueue.removeFromQueueLocked() - - // If the requested final seats exceed capacity of that queue, - // we reduce them to current capacity and adjust additional latency - // to preserve the total amount of work. - if oldestReqFromMinQueue.workEstimate.FinalSeats > uint64(qs.dCfg.ConcurrencyLimit) { - finalSeats := uint64(qs.dCfg.ConcurrencyLimit) - additionalLatency := oldestReqFromMinQueue.workEstimate.finalWork.DurationPerSeat(float64(finalSeats)) - oldestReqFromMinQueue.workEstimate.FinalSeats = finalSeats - oldestReqFromMinQueue.workEstimate.AdditionalLatency = additionalLatency - } - - // we set the round robin indexing to start at the chose queue - // for the next round. This way the non-selected queues - // win in the case that the virtual finish times are the same - qs.robinIndex = minIndex - - if minQueue.nextDispatchR < oldestReqFromMinQueue.arrivalR { - klog.ErrorS(errors.New("dispatch before arrival"), "Inconceivable!", "QS", qs.qCfg.Name, "queue", minQueue.index, "dispatchR", minQueue.nextDispatchR, "request", oldestReqFromMinQueue) - } - metrics.SetDispatchMetrics(qs.qCfg.Name, qs.currentR.ToFloat(), minQueue.nextDispatchR.ToFloat(), sMin.ToFloat(), sMax.ToFloat(), dsMin.ToFloat(), dsMax.ToFloat()) - return minQueue, oldestReqFromMinQueue -} - -// finishRequestAndDispatchAsMuchAsPossible is a convenience method -// which calls finishRequest for a given request and then dispatches -// as many requests as possible. This is all of what needs to be done -// once a request finishes execution or is canceled. This returns a bool -// indicating whether the QueueSet is now idle. -func (qs *queueSet) finishRequestAndDispatchAsMuchAsPossible(req *request) bool { - qs.lockAndSyncTime(req.ctx) - defer qs.lock.Unlock() - - qs.finishRequestLocked(req) - qs.dispatchAsMuchAsPossibleLocked() - return qs.isIdleLocked() -} - -// finishRequestLocked is a callback that should be used when a -// previously dispatched request has completed it's service. This -// callback updates important state in the queueSet -func (qs *queueSet) finishRequestLocked(r *request) { - now := qs.clock.Now() - qs.totRequestsExecuting-- - metrics.AddRequestsExecuting(r.ctx, qs.qCfg.Name, r.fsName, -1) - qs.reqsGaugePair.RequestsExecuting.Add(-1) - - actualServiceDuration := now.Sub(r.startTime) - - // TODO: for now we keep the logic localized so it is easier to see - // how the counters are tracked for queueset and queue, in future we - // can refactor to move this function. - releaseSeatsLocked := func() { - defer qs.removeQueueIfEmptyLocked(r) - - qs.totSeatsInUse -= r.MaxSeats() - metrics.AddSeatConcurrencyInUse(qs.qCfg.Name, r.fsName, -r.MaxSeats()) - qs.execSeatsGauge.Add(-float64(r.MaxSeats())) - qs.seatDemandIntegrator.Set(float64(qs.totSeatsInUse + qs.totSeatsWaiting)) - if r.queue != nil { - r.queue.seatsInUse -= r.MaxSeats() - } - } - - defer func() { - klogV := klog.V(6) - if r.workEstimate.AdditionalLatency <= 0 { - // release the seats allocated to this request immediately - releaseSeatsLocked() - if !klogV.Enabled() { - } else if r.queue != nil { - klogV.Infof("QS(%s) at t=%s R=%v: request %#+v %#+v finished all use of %d seats, adjusted queue %d start R to %v due to service time %.9fs, queue will have %d requests with %#v waiting & %d requests occupying %d seats", - qs.qCfg.Name, now.Format(nsTimeFmt), qs.currentR, r.descr1, r.descr2, r.workEstimate.MaxSeats(), r.queue.index, - r.queue.nextDispatchR, actualServiceDuration.Seconds(), r.queue.requestsWaiting.Length(), r.queue.requestsWaiting.QueueSum(), r.queue.requestsExecuting.Len(), r.queue.seatsInUse) - } else { - klogV.Infof("QS(%s) at t=%s R=%v: request %#+v %#+v finished all use of %d seats, qs will have %d requests occupying %d seats", qs.qCfg.Name, now.Format(nsTimeFmt), qs.currentR, r.descr1, r.descr2, r.workEstimate.InitialSeats, qs.totRequestsExecuting, qs.totSeatsInUse) - } - return - } - - additionalLatency := r.workEstimate.AdditionalLatency - if !klogV.Enabled() { - } else if r.queue != nil { - klogV.Infof("QS(%s) at t=%s R=%v: request %#+v %#+v finished main use of %d seats but lingering on %d seats for %v seconds, adjusted queue %d start R to %v due to service time %.9fs, queue will have %d requests with %#v waiting & %d requests occupying %d seats", - qs.qCfg.Name, now.Format(nsTimeFmt), qs.currentR, r.descr1, r.descr2, r.workEstimate.InitialSeats, r.workEstimate.FinalSeats, additionalLatency.Seconds(), r.queue.index, - r.queue.nextDispatchR, actualServiceDuration.Seconds(), r.queue.requestsWaiting.Length(), r.queue.requestsWaiting.QueueSum(), r.queue.requestsExecuting.Len(), r.queue.seatsInUse) - } else { - klogV.Infof("QS(%s) at t=%s R=%v: request %#+v %#+v finished main use of %d seats but lingering on %d seats for %v seconds, qs will have %d requests occupying %d seats", qs.qCfg.Name, now.Format(nsTimeFmt), qs.currentR, r.descr1, r.descr2, r.workEstimate.InitialSeats, r.workEstimate.FinalSeats, additionalLatency.Seconds(), qs.totRequestsExecuting, qs.totSeatsInUse) - } - // EventAfterDuration will execute the event func in a new goroutine, - // so the seats allocated to this request will be released after - // AdditionalLatency elapses, this ensures that the additional - // latency has no impact on the user experience. - qs.clock.EventAfterDuration(func(_ time.Time) { - qs.lockAndSyncTime(r.ctx) - defer qs.lock.Unlock() - now := qs.clock.Now() - releaseSeatsLocked() - if !klogV.Enabled() { - } else if r.queue != nil { - klogV.Infof("QS(%s) at t=%s R=%v: request %#+v %#+v finished lingering on %d seats, queue %d will have %d requests with %#v waiting & %d requests occupying %d seats", - qs.qCfg.Name, now.Format(nsTimeFmt), qs.currentR, r.descr1, r.descr2, r.workEstimate.FinalSeats, r.queue.index, - r.queue.requestsWaiting.Length(), r.queue.requestsWaiting.QueueSum(), r.queue.requestsExecuting.Len(), r.queue.seatsInUse) - } else { - klogV.Infof("QS(%s) at t=%s R=%v: request %#+v %#+v finished lingering on %d seats, qs will have %d requests occupying %d seats", qs.qCfg.Name, now.Format(nsTimeFmt), qs.currentR, r.descr1, r.descr2, r.workEstimate.FinalSeats, qs.totRequestsExecuting, qs.totSeatsInUse) - } - qs.dispatchAsMuchAsPossibleLocked() - }, additionalLatency) - }() - - if r.queue != nil { - // request has finished, remove from requests executing - r.queue.requestsExecuting = r.queue.requestsExecuting.Delete(r) - - // When a request finishes being served, and the actual service time was S, - // the queue’s start R is decremented by (G - S)*width. - r.queue.nextDispatchR -= fqrequest.SeatsTimesDuration(float64(r.InitialSeats()), qs.estimatedServiceDuration-actualServiceDuration) - qs.boundNextDispatchLocked(r.queue) - } else { - qs.requestsExecutingSet = qs.requestsExecutingSet.Delete(r) - } -} - -// boundNextDispatchLocked applies the anti-windup hack. -// We need a hack because all non-empty queues are allocated the same -// number of seats. A queue that can not use all those seats and does -// not go empty accumulates a progresively earlier `virtualStart` compared -// to queues that are using more than they are allocated. -// The following hack addresses the first side of that inequity, -// by insisting that dispatch in the virtual world not precede arrival. -func (qs *queueSet) boundNextDispatchLocked(queue *queue) { - oldestReqFromMinQueue, _ := queue.requestsWaiting.Peek() - if oldestReqFromMinQueue == nil { - return - } - var virtualStartBound = oldestReqFromMinQueue.arrivalR - if queue.nextDispatchR < virtualStartBound { - if klogV := klog.V(4); klogV.Enabled() { - klogV.InfoS("AntiWindup tweaked queue", "QS", qs.qCfg.Name, "queue", queue.index, "time", qs.clock.Now().Format(nsTimeFmt), "requestDescr1", oldestReqFromMinQueue.descr1, "requestDescr2", oldestReqFromMinQueue.descr2, "newVirtualStart", virtualStartBound, "deltaVirtualStart", (virtualStartBound - queue.nextDispatchR)) - } - queue.nextDispatchR = virtualStartBound - } -} - -func (qs *queueSet) removeQueueIfEmptyLocked(r *request) { - if r.queue == nil { - return - } - - // If there are more queues than desired and this one has no - // requests then remove it - if len(qs.queues) > qs.qCfg.DesiredNumQueues && - r.queue.requestsWaiting.Length() == 0 && - r.queue.requestsExecuting.Len() == 0 { - qs.queues = removeQueueAndUpdateIndexes(qs.queues, r.queue.index) - - // decrement here to maintain the invariant that (qs.robinIndex+1) % numQueues - // is the index of the next queue after the one last dispatched from - if qs.robinIndex >= r.queue.index { - qs.robinIndex-- - } - } -} - -// removeQueueAndUpdateIndexes uses reslicing to remove an index from a slice -// and then updates the 'index' field of the queues to be correct -func removeQueueAndUpdateIndexes(queues []*queue, index int) []*queue { - keptQueues := append(queues[:index], queues[index+1:]...) - for i := index; i < len(keptQueues); i++ { - keptQueues[i].index-- - } - return keptQueues -} - -func (qs *queueSet) Dump(includeRequestDetails bool) debug.QueueSetDump { - qs.lock.Lock() - defer qs.lock.Unlock() - d := debug.QueueSetDump{ - Queues: make([]debug.QueueDump, len(qs.queues)), - QueuelessExecutingRequests: SetMapReduce(dumpRequest(includeRequestDetails), append1[debug.RequestDump])(qs.requestsExecutingSet), - Waiting: qs.totRequestsWaiting, - Executing: qs.totRequestsExecuting, - SeatsInUse: qs.totSeatsInUse, - SeatsWaiting: qs.totSeatsWaiting, - Dispatched: qs.totRequestsDispatched, - Rejected: qs.totRequestsRejected, - Timedout: qs.totRequestsTimedout, - Cancelled: qs.totRequestsCancelled, - } - for i, q := range qs.queues { - d.Queues[i] = q.dumpLocked(includeRequestDetails) - } - return d -} - -func OnRequestDispatched(r fq.Request) { - req, ok := r.(*request) - if !ok { - return - } - - qs := req.qs - if qs != nil { - qs.lock.Lock() - defer qs.lock.Unlock() - qs.totRequestsDispatched++ - } -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/types.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/types.go deleted file mode 100644 index 8c36a58ff..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/types.go +++ /dev/null @@ -1,218 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package queueset - -import ( - "context" - "time" - - "k8s.io/apimachinery/pkg/util/sets" - genericrequest "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/apiserver/pkg/util/flowcontrol/debug" - fq "k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing" - "k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/promise" - fcrequest "k8s.io/apiserver/pkg/util/flowcontrol/request" -) - -// request is a temporary container for "requests" with additional -// tracking fields required for QueueSet functionality. -type request struct { - ctx context.Context - - qs *queueSet - - flowDistinguisher string - fsName string - - // The relevant queue. Is nil if this request did not go through - // a queue. - queue *queue - - // estimated amount of work of the request - workEstimate completedWorkEstimate - - // decision gets set to a `requestDecision` indicating what to do - // with this request. It gets set exactly once, when the request - // is removed from its queue. The value will be decisionReject, - // decisionCancel, or decisionExecute. - // - // decision.Set is called with the queueSet locked. - // decision.Get is called without the queueSet locked. - decision promise.WriteOnce - - // arrivalTime is the real time when the request entered this system - arrivalTime time.Time - - // descr1 and descr2 are not used in any logic but they appear in - // log messages - descr1, descr2 interface{} - - queueNoteFn fq.QueueNoteFn - - // The preceding fields are filled in at creation and not modified since; - // the following fields may be modified later and must only be accessed while - // holding the queueSet's lock. - - // Removes this request from its queue. If the request is not put into a - // a queue it will be nil. - removeFromQueueLocked removeFromFIFOFunc - - // arrivalR is R(arrivalTime). R is, confusingly, also called "virtual time". - // This field is meaningful only while the request is waiting in the virtual world. - arrivalR fcrequest.SeatSeconds - - // startTime is the real time when the request began executing - startTime time.Time - - // Indicates whether client has called Request::Wait() - waitStarted bool -} - -type completedWorkEstimate struct { - fcrequest.WorkEstimate - totalWork fcrequest.SeatSeconds // initial plus final work - finalWork fcrequest.SeatSeconds // only final work -} - -// queue is a sequence of requests that have arrived but not yet finished -// execution in both the real and virtual worlds. -type queue struct { - // The requestsWaiting not yet executing in the real world are stored in a FIFO list. - requestsWaiting fifo - - // nextDispatchR is the R progress meter reading at - // which the next request will be dispatched in the virtual world. - nextDispatchR fcrequest.SeatSeconds - - // requestsExecuting is the set of requests executing in the real world. - requestsExecuting sets.Set[*request] - - // index is the position of this queue among those in its queueSet. - index int - - // seatsInUse is the total number of "seats" currently occupied - // by all the requests that are currently executing in this queue. - seatsInUse int -} - -// queueSum tracks the sum of initial seats, max seats, and -// totalWork from all requests in a given queue -type queueSum struct { - // InitialSeatsSum is the sum of InitialSeats - // associated with all requests in a given queue. - InitialSeatsSum int - - // MaxSeatsSum is the sum of MaxSeats - // associated with all requests in a given queue. - MaxSeatsSum int - - // TotalWorkSum is the sum of totalWork of the waiting requests - TotalWorkSum fcrequest.SeatSeconds -} - -func (req *request) totalWork() fcrequest.SeatSeconds { - return req.workEstimate.totalWork -} - -func (qs *queueSet) completeWorkEstimate(we *fcrequest.WorkEstimate) completedWorkEstimate { - finalWork := qs.computeFinalWork(we) - return completedWorkEstimate{ - WorkEstimate: *we, - totalWork: qs.computeInitialWork(we) + finalWork, - finalWork: finalWork, - } -} - -func (qs *queueSet) computeInitialWork(we *fcrequest.WorkEstimate) fcrequest.SeatSeconds { - return fcrequest.SeatsTimesDuration(float64(we.InitialSeats), qs.estimatedServiceDuration) -} - -func (qs *queueSet) computeFinalWork(we *fcrequest.WorkEstimate) fcrequest.SeatSeconds { - return fcrequest.SeatsTimesDuration(float64(we.FinalSeats), we.AdditionalLatency) -} - -func (q *queue) dumpLocked(includeDetails bool) debug.QueueDump { - waitingDigest := make([]debug.RequestDump, 0, q.requestsWaiting.Length()) - q.requestsWaiting.Walk(func(r *request) bool { - waitingDigest = append(waitingDigest, dumpRequest(includeDetails)(r)) - return true - }) - executingDigest := SetMapReduce(dumpRequest(includeDetails), append1[debug.RequestDump])(q.requestsExecuting) - - sum := q.requestsWaiting.QueueSum() - queueSum := debug.QueueSum{ - InitialSeatsSum: sum.InitialSeatsSum, - MaxSeatsSum: sum.MaxSeatsSum, - TotalWorkSum: sum.TotalWorkSum.String(), - } - - return debug.QueueDump{ - NextDispatchR: q.nextDispatchR.String(), - Requests: waitingDigest, - RequestsExecuting: executingDigest, - ExecutingRequests: q.requestsExecuting.Len(), - SeatsInUse: q.seatsInUse, - QueueSum: queueSum, - } -} - -func dumpRequest(includeDetails bool) func(*request) debug.RequestDump { - return func(r *request) debug.RequestDump { - ans := debug.RequestDump{ - MatchedFlowSchema: r.fsName, - FlowDistinguisher: r.flowDistinguisher, - ArriveTime: r.arrivalTime, - StartTime: r.startTime, - WorkEstimate: r.workEstimate.WorkEstimate, - } - if includeDetails { - userInfo, _ := genericrequest.UserFrom(r.ctx) - ans.UserName = userInfo.GetName() - requestInfo, ok := genericrequest.RequestInfoFrom(r.ctx) - if ok { - ans.RequestInfo = *requestInfo - } - } - return ans - } -} - -// SetMapReduce is map-reduce starting from a set type in the sets package. -func SetMapReduce[Elt comparable, Result, Accumulator any](mapFn func(Elt) Result, reduceFn func(Accumulator, Result) Accumulator) func(map[Elt]sets.Empty) Accumulator { - return func(set map[Elt]sets.Empty) Accumulator { - var ans Accumulator - for elt := range set { - ans = reduceFn(ans, mapFn(elt)) - } - return ans - } -} - -// SliceMapReduce is map-reduce starting from a slice. -func SliceMapReduce[Elt, Result, Accumulator any](mapFn func(Elt) Result, reduceFn func(Accumulator, Result) Accumulator) func([]Elt) Accumulator { - return func(slice []Elt) Accumulator { - var ans Accumulator - for _, elt := range slice { - ans = reduceFn(ans, mapFn(elt)) - } - return ans - } -} - -func or(x, y bool) bool { return x || y } - -func append1[Elt any](slice []Elt, next Elt) []Elt { return append(slice, next) } diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/format/formatting.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/format/formatting.go deleted file mode 100644 index ced0eac31..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/format/formatting.go +++ /dev/null @@ -1,231 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package format - -import ( - "bytes" - "encoding/json" - "fmt" - - flowcontrol "k8s.io/api/flowcontrol/v1" - "k8s.io/apiserver/pkg/authentication/user" - "k8s.io/apiserver/pkg/endpoints/request" -) - -// This file provides an easy way to mark a value for formatting to -// `%s` in full detail IF it is printed but without costing a lot of -// CPU or memory if the value is NOT printed. The API Priority and -// Fairness API objects are formatted into JSON. The other types of -// objects here are formatted into golang source. - -// Stringer marks the given value for custom formatting by this package. -type Stringer struct{ val interface{} } - -// Fmt marks the given value for custom formatting by this package. -func Fmt(val interface{}) Stringer { - return Stringer{val} -} - -// String formats to a string in full detail -func (sr Stringer) String() string { - if sr.val == nil { - return "nil" - } - switch typed := sr.val.(type) { - case *flowcontrol.FlowSchema, - flowcontrol.FlowSchema, - flowcontrol.FlowSchemaSpec, - flowcontrol.FlowDistinguisherMethod, - *flowcontrol.FlowDistinguisherMethod, - *flowcontrol.PolicyRulesWithSubjects, - flowcontrol.PolicyRulesWithSubjects, - flowcontrol.Subject, - flowcontrol.ResourcePolicyRule, - flowcontrol.NonResourcePolicyRule, - flowcontrol.FlowSchemaCondition, - *flowcontrol.PriorityLevelConfiguration, - flowcontrol.PriorityLevelConfiguration, - flowcontrol.PriorityLevelConfigurationSpec, - *flowcontrol.LimitedPriorityLevelConfiguration, - flowcontrol.LimitedPriorityLevelConfiguration, - flowcontrol.LimitResponse, - *flowcontrol.QueuingConfiguration, - flowcontrol.QueuingConfiguration: - return ToJSON(sr.val) - case []user.Info: - return FmtUsers(typed) - case []*request.RequestInfo: - return FmtRequests(typed) - default: - return fmt.Sprintf("%#+v", sr.val) - } -} - -// ToJSON converts using encoding/json and handles errors by -// formatting them -func ToJSON(val interface{}) string { - bs, err := json.Marshal(val) - str := string(bs) - if err != nil { - str = str + "<" + err.Error() + ">" - } - return str -} - -// FmtPriorityLevelConfiguration returns a golang source expression -// equivalent to the given value -func FmtPriorityLevelConfiguration(pl *flowcontrol.PriorityLevelConfiguration) string { - if pl == nil { - return "nil" - } - var buf bytes.Buffer - buf.WriteString(fmt.Sprintf("&flowcontrolv1.PriorityLevelConfiguration{ObjectMeta: %#+v, Spec: ", - pl.ObjectMeta)) - BufferPriorityLevelConfigurationSpec(&buf, &pl.Spec) - buf.WriteString(fmt.Sprintf(", Status: %#+v}", pl.Status)) - return buf.String() -} - -// FmtPriorityLevelConfigurationSpec returns a golang source -// expression equivalent to the given value -func FmtPriorityLevelConfigurationSpec(plSpec *flowcontrol.PriorityLevelConfigurationSpec) string { - var buf bytes.Buffer - BufferPriorityLevelConfigurationSpec(&buf, plSpec) - return buf.String() -} - -// BufferPriorityLevelConfigurationSpec writes a golang source -// expression for the given value to the given buffer -func BufferPriorityLevelConfigurationSpec(buf *bytes.Buffer, plSpec *flowcontrol.PriorityLevelConfigurationSpec) { - buf.WriteString(fmt.Sprintf("flowcontrolv1.PriorityLevelConfigurationSpec{Type: %#v", plSpec.Type)) - if plSpec.Limited != nil { - buf.WriteString(fmt.Sprintf(", Limited: &flowcontrol.LimitedPriorityLevelConfiguration{NominalConcurrencyShares:%d, LimitResponse:flowcontrol.LimitResponse{Type:%#v", plSpec.Limited.NominalConcurrencyShares, plSpec.Limited.LimitResponse.Type)) - if plSpec.Limited.LimitResponse.Queuing != nil { - buf.WriteString(fmt.Sprintf(", Queuing:&%#+v", *plSpec.Limited.LimitResponse.Queuing)) - } - buf.WriteString(" } }") - } - buf.WriteString("}") -} - -// FmtFlowSchema produces a golang source expression of the value. -func FmtFlowSchema(fs *flowcontrol.FlowSchema) string { - if fs == nil { - return "nil" - } - var buf bytes.Buffer - buf.WriteString(fmt.Sprintf("&flowcontrolv1.FlowSchema{ObjectMeta: %#+v, Spec: ", - fs.ObjectMeta)) - BufferFlowSchemaSpec(&buf, &fs.Spec) - buf.WriteString(fmt.Sprintf(", Status: %#+v}", fs.Status)) - return buf.String() -} - -// FmtFlowSchemaSpec produces a golang source expression equivalent to -// the given spec -func FmtFlowSchemaSpec(fsSpec *flowcontrol.FlowSchemaSpec) string { - var buf bytes.Buffer - BufferFlowSchemaSpec(&buf, fsSpec) - return buf.String() -} - -// BufferFlowSchemaSpec writes a golang source expression for the -// given value to the given buffer -func BufferFlowSchemaSpec(buf *bytes.Buffer, fsSpec *flowcontrol.FlowSchemaSpec) { - buf.WriteString(fmt.Sprintf("flowcontrolv1.FlowSchemaSpec{PriorityLevelConfiguration: %#+v, MatchingPrecedence: %d, DistinguisherMethod: ", - fsSpec.PriorityLevelConfiguration, - fsSpec.MatchingPrecedence)) - if fsSpec.DistinguisherMethod == nil { - buf.WriteString("nil") - } else { - buf.WriteString(fmt.Sprintf("&%#+v", *fsSpec.DistinguisherMethod)) - } - buf.WriteString(", Rules: []flowcontrol.PolicyRulesWithSubjects{") - for idx, rule := range fsSpec.Rules { - if idx > 0 { - buf.WriteString(", ") - } - BufferFmtPolicyRulesWithSubjectsSlim(buf, rule) - } - buf.WriteString("}}") -} - -// FmtPolicyRulesWithSubjects produces a golang source expression of the value. -func FmtPolicyRulesWithSubjects(rule flowcontrol.PolicyRulesWithSubjects) string { - return "flowcontrolv1.PolicyRulesWithSubjects" + FmtPolicyRulesWithSubjectsSlim(rule) -} - -// FmtPolicyRulesWithSubjectsSlim produces a golang source expression -// of the value but without the leading type name. See above for an -// example context where this is useful. -func FmtPolicyRulesWithSubjectsSlim(rule flowcontrol.PolicyRulesWithSubjects) string { - var buf bytes.Buffer - BufferFmtPolicyRulesWithSubjectsSlim(&buf, rule) - return buf.String() -} - -// BufferFmtPolicyRulesWithSubjectsSlim writes a golang source -// expression for the given value to the given buffer but excludes the -// leading type name -func BufferFmtPolicyRulesWithSubjectsSlim(buf *bytes.Buffer, rule flowcontrol.PolicyRulesWithSubjects) { - buf.WriteString("{Subjects: []flowcontrolv1.Subject{") - for jdx, subj := range rule.Subjects { - if jdx > 0 { - buf.WriteString(", ") - } - buf.WriteString(fmt.Sprintf("{Kind: %q", subj.Kind)) - if subj.User != nil { - buf.WriteString(fmt.Sprintf(", User: &%#+v", *subj.User)) - } - if subj.Group != nil { - buf.WriteString(fmt.Sprintf(", Group: &%#+v", *subj.Group)) - } - if subj.ServiceAccount != nil { - buf.WriteString(fmt.Sprintf(", ServiceAccount: &%#+v", *subj.ServiceAccount)) - } - buf.WriteString("}") - } - buf.WriteString(fmt.Sprintf("}, ResourceRules: %#+v, NonResourceRules: %#+v}", rule.ResourceRules, rule.NonResourceRules)) -} - -// FmtUsers produces a golang source expression of the value. -func FmtUsers(list []user.Info) string { - var buf bytes.Buffer - buf.WriteString("[]user.Info{") - for idx, member := range list { - if idx > 0 { - buf.WriteString(", ") - } - buf.WriteString(fmt.Sprintf("%#+v", member)) - } - buf.WriteString("}") - return buf.String() -} - -// FmtRequests produces a golang source expression of the value. -func FmtRequests(list []*request.RequestInfo) string { - var buf bytes.Buffer - buf.WriteString("[]*request.RequestInfo{") - for idx, member := range list { - if idx > 0 { - buf.WriteString(", ") - } - buf.WriteString(fmt.Sprintf("%#+v", member)) - } - buf.WriteString("}") - return buf.String() -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/formatting.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/formatting.go deleted file mode 100644 index 5b5b367bd..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/formatting.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flowcontrol - -import ( - "fmt" - - fcfmt "k8s.io/apiserver/pkg/util/flowcontrol/format" -) - -var _ fmt.GoStringer = RequestDigest{} - -// GoString produces a golang source expression of the value. -func (rd RequestDigest) GoString() string { - return fmt.Sprintf("RequestDigest{RequestInfo: %#+v, User: %#+v}", rd.RequestInfo, rd.User) -} - -var _ fmt.GoStringer = (*priorityLevelState)(nil) - -// GoString produces a golang source expression of the value. -func (pls *priorityLevelState) GoString() string { - if pls == nil { - return "nil" - } - return fmt.Sprintf("&priorityLevelState{pl:%s, qsCompleter:%#+v, queues:%#+v, quiescing:%#v, numPending:%d}", fcfmt.Fmt(pls.pl), pls.qsCompleter, pls.queues, pls.quiescing, pls.numPending) -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/max_seats.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/max_seats.go deleted file mode 100644 index 18f88ab3b..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/max_seats.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flowcontrol - -import ( - "sync" -) - -// MaxSeatsTracker is used to track max seats allocatable per priority level from the work estimator -type MaxSeatsTracker interface { - // GetMaxSeats returns the maximum seats a request should occupy for a given priority level. - GetMaxSeats(priorityLevelName string) uint64 - - // SetMaxSeats configures max seats for a priority level. - SetMaxSeats(priorityLevelName string, maxSeats uint64) - - // ForgetPriorityLevel removes max seats tracking for a priority level. - ForgetPriorityLevel(priorityLevelName string) -} - -type maxSeatsTracker struct { - sync.RWMutex - - maxSeats map[string]uint64 -} - -func NewMaxSeatsTracker() MaxSeatsTracker { - return &maxSeatsTracker{ - maxSeats: make(map[string]uint64), - } -} - -func (m *maxSeatsTracker) GetMaxSeats(plName string) uint64 { - m.RLock() - defer m.RUnlock() - - return m.maxSeats[plName] -} - -func (m *maxSeatsTracker) SetMaxSeats(plName string, maxSeats uint64) { - m.Lock() - defer m.Unlock() - - m.maxSeats[plName] = maxSeats -} - -func (m *maxSeatsTracker) ForgetPriorityLevel(plName string) { - m.Lock() - defer m.Unlock() - - delete(m.maxSeats, plName) -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/interface.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/interface.go deleted file mode 100644 index 1f33f02b0..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/interface.go +++ /dev/null @@ -1,67 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package metrics - -// Gauge is the methods of a gauge that are used by instrumented code. -type Gauge interface { - Set(float64) - Inc() - Dec() - Add(float64) - SetToCurrentTime() -} - -// RatioedGauge tracks ratios. -// The numerator is set/changed through the Gauge methods, -// and the denominator can be updated through the SetDenominator method. -// A ratio is tracked whenever the numerator or denominator is set/changed. -type RatioedGauge interface { - Gauge - - // SetDenominator sets the denominator to use until it is changed again - SetDenominator(float64) -} - -// RatioedGaugeVec creates related observers that are -// differentiated by a series of label values -type RatioedGaugeVec interface { - // NewForLabelValuesSafe makes a new vector member for the given tuple of label values, - // initialized with the given numerator and denominator. - // Unlike the usual Vec WithLabelValues method, this is intended to be called only - // once per vector member (at the start of its lifecycle). - // The "Safe" part is saying that the returned object will function properly after metric registration - // even if this method is called before registration. - NewForLabelValuesSafe(initialNumerator, initialDenominator float64, labelValues []string) RatioedGauge -} - -//////////////////////////////// Pairs //////////////////////////////// -// -// API Priority and Fairness tends to use RatioedGaugeVec members in pairs, -// one for requests waiting in a queue and one for requests being executed. -// The following definitions are a convenience layer that adds support for that -// particular pattern of usage. - -// RatioedGaugePair is a corresponding pair of gauges, one for the -// number of requests waiting in queue(s) and one for the number of -// requests being executed. -type RatioedGaugePair struct { - // RequestsWaiting is given observations of the number of currently queued requests - RequestsWaiting RatioedGauge - - // RequestsExecuting is given observations of the number of requests currently executing - RequestsExecuting RatioedGauge -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/metrics.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/metrics.go deleted file mode 100644 index 9fe7b15a0..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/metrics.go +++ /dev/null @@ -1,632 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package metrics - -import ( - "context" - "strconv" - "strings" - "sync" - "time" - - epmetrics "k8s.io/apiserver/pkg/endpoints/metrics" - apirequest "k8s.io/apiserver/pkg/endpoints/request" - compbasemetrics "k8s.io/component-base/metrics" - "k8s.io/component-base/metrics/legacyregistry" - basemetricstestutil "k8s.io/component-base/metrics/testutil" -) - -const ( - namespace = "apiserver" - subsystem = "flowcontrol" -) - -const ( - requestKind = "request_kind" - priorityLevel = "priority_level" - flowSchema = "flow_schema" - phase = "phase" - LabelNamePhase = "phase" - LabelValueWaiting = "waiting" - LabelValueExecuting = "executing" -) - -var ( - queueLengthBuckets = []float64{0, 10, 25, 50, 100, 250, 500, 1000} - requestDurationSecondsBuckets = []float64{0, 0.005, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 15, 30} -) - -var registerMetrics sync.Once - -// Register all metrics. -func Register() { - registerMetrics.Do(func() { - for _, metric := range metrics { - legacyregistry.MustRegister(metric) - } - }) -} - -type resettable interface { - Reset() -} - -// Reset all resettable metrics to zero -func Reset() { - for _, metric := range metrics { - if rm, ok := metric.(resettable); ok { - rm.Reset() - } - } -} - -// GatherAndCompare the given metrics with the given Prometheus syntax expected value -func GatherAndCompare(expected string, metricNames ...string) error { - return basemetricstestutil.GatherAndCompare(legacyregistry.DefaultGatherer, strings.NewReader(expected), metricNames...) -} - -// Registerables is a slice of Registerable -type Registerables []compbasemetrics.Registerable - -// Append adds more -func (rs Registerables) Append(more ...compbasemetrics.Registerable) Registerables { - return append(rs, more...) -} - -var ( - apiserverRejectedRequestsTotal = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "rejected_requests_total", - Help: "Number of requests rejected by API Priority and Fairness subsystem", - StabilityLevel: compbasemetrics.BETA, - }, - []string{priorityLevel, flowSchema, "reason"}, - ) - apiserverDispatchedRequestsTotal = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "dispatched_requests_total", - Help: "Number of requests executed by API Priority and Fairness subsystem", - StabilityLevel: compbasemetrics.BETA, - }, - []string{priorityLevel, flowSchema}, - ) - // PriorityLevelExecutionSeatsGaugeVec creates observers of seats occupied throughout execution for priority levels - PriorityLevelExecutionSeatsGaugeVec = NewTimingRatioHistogramVec( - &compbasemetrics.TimingHistogramOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "priority_level_seat_utilization", - Help: "Observations, at the end of every nanosecond, of utilization of seats for any stage of execution (but only initial stage for WATCHes)", - // Buckets for both 0.99 and 1.0 mean PromQL's histogram_quantile will reveal saturation - Buckets: []float64{0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 0.99, 1}, - ConstLabels: map[string]string{phase: "executing"}, - StabilityLevel: compbasemetrics.ALPHA, - }, - priorityLevel, - ) - // PriorityLevelConcurrencyGaugeVec creates gauges of concurrency broken down by phase, priority level - PriorityLevelConcurrencyGaugeVec = NewTimingRatioHistogramVec( - &compbasemetrics.TimingHistogramOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "priority_level_request_utilization", - Help: "Observations, at the end of every nanosecond, of number of requests (as a fraction of the relevant limit) waiting or in any stage of execution (but only initial stage for WATCHes)", - // For executing: the denominator will be seats, so this metric will skew low. - // For waiting: total queue capacity is generally quite generous, so this metric will skew low. - Buckets: []float64{0, 0.001, 0.003, 0.01, 0.03, 0.1, 0.25, 0.5, 0.75, 1}, - StabilityLevel: compbasemetrics.ALPHA, - }, - LabelNamePhase, priorityLevel, - ) - // readWriteConcurrencyGaugeVec creates ratioed gauges of requests/limit broken down by phase and mutating vs readonly - readWriteConcurrencyGaugeVec = NewTimingRatioHistogramVec( - &compbasemetrics.TimingHistogramOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "read_vs_write_current_requests", - Help: "Observations, at the end of every nanosecond, of the number of requests (as a fraction of the relevant limit) waiting or in regular stage of execution", - // This metric will skew low for the same reason as the priority level metrics - // and also because APF has a combined limit for mutating and readonly. - Buckets: []float64{0, 0.001, 0.01, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 0.99, 1}, - StabilityLevel: compbasemetrics.ALPHA, - }, - LabelNamePhase, requestKind, - ) - apiserverCurrentR = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "current_r", - Help: "R(time of last change)", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel}, - ) - apiserverDispatchR = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "dispatch_r", - Help: "R(time of last dispatch)", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel}, - ) - apiserverLatestS = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "latest_s", - Help: "S(most recently dispatched request)", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel}, - ) - apiserverNextSBounds = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "next_s_bounds", - Help: "min and max, over queues, of S(oldest waiting request in queue)", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel, "bound"}, - ) - apiserverNextDiscountedSBounds = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "next_discounted_s_bounds", - Help: "min and max, over queues, of S(oldest waiting request in queue) - estimated work in progress", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel, "bound"}, - ) - apiserverCurrentInqueueRequests = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "current_inqueue_requests", - Help: "Number of requests currently pending in queues of the API Priority and Fairness subsystem", - StabilityLevel: compbasemetrics.BETA, - }, - []string{priorityLevel, flowSchema}, - ) - apiserverCurrentInqueueSeats = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "current_inqueue_seats", - Help: "Number of seats currently pending in queues of the API Priority and Fairness subsystem", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel, flowSchema}, - ) - apiserverRequestQueueLength = compbasemetrics.NewHistogramVec( - &compbasemetrics.HistogramOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "request_queue_length_after_enqueue", - Help: "Length of queue in the API Priority and Fairness subsystem, as seen by each request after it is enqueued", - Buckets: queueLengthBuckets, - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel, flowSchema}, - ) - apiserverRequestConcurrencyLimit = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "request_concurrency_limit", - Help: "Nominal number of execution seats configured for each priority level", - // Remove this metric once all suppported releases have the equal nominal_limit_seats metric - DeprecatedVersion: "1.30.0", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel}, - ) - apiserverCurrentExecutingRequests = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "current_executing_requests", - Help: "Number of requests in initial (for a WATCH) or any (for a non-WATCH) execution stage in the API Priority and Fairness subsystem", - StabilityLevel: compbasemetrics.BETA, - }, - []string{priorityLevel, flowSchema}, - ) - apiserverCurrentExecutingSeats = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "current_executing_seats", - Help: "Concurrency (number of seats) occupied by the currently executing (initial stage for a WATCH, any stage otherwise) requests in the API Priority and Fairness subsystem", - StabilityLevel: compbasemetrics.BETA, - }, - []string{priorityLevel, flowSchema}, - ) - apiserverRequestConcurrencyInUse = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "request_concurrency_in_use", - Help: "Concurrency (number of seats) occupied by the currently executing (initial stage for a WATCH, any stage otherwise) requests in the API Priority and Fairness subsystem", - // Remove this metric once all suppported releases have the equal current_executing_seats metric - DeprecatedVersion: "1.31.0", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel, flowSchema}, - ) - apiserverRequestWaitingSeconds = compbasemetrics.NewHistogramVec( - &compbasemetrics.HistogramOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "request_wait_duration_seconds", - Help: "Length of time a request spent waiting in its queue", - Buckets: requestDurationSecondsBuckets, - StabilityLevel: compbasemetrics.BETA, - }, - []string{priorityLevel, flowSchema, "execute"}, - ) - apiserverRequestExecutionSeconds = compbasemetrics.NewHistogramVec( - &compbasemetrics.HistogramOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "request_execution_seconds", - Help: "Duration of initial stage (for a WATCH) or any (for a non-WATCH) stage of request execution in the API Priority and Fairness subsystem", - Buckets: requestDurationSecondsBuckets, - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel, flowSchema, "type"}, - ) - watchCountSamples = compbasemetrics.NewHistogramVec( - &compbasemetrics.HistogramOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "watch_count_samples", - Help: "count of watchers for mutating requests in API Priority and Fairness", - Buckets: []float64{0, 1, 10, 100, 1000, 10000}, - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel, flowSchema}, - ) - apiserverEpochAdvances = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "epoch_advance_total", - Help: "Number of times the queueset's progress meter jumped backward", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel, "success"}, - ) - apiserverWorkEstimatedSeats = compbasemetrics.NewHistogramVec( - &compbasemetrics.HistogramOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "work_estimated_seats", - Help: "Number of estimated seats (maximum of initial and final seats) associated with requests in API Priority and Fairness", - // the upper bound comes from the maximum number of seats a request - // can occupy which is currently set at 10. - Buckets: []float64{1, 2, 4, 10}, - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel, flowSchema}, - ) - apiserverDispatchWithNoAccommodation = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "request_dispatch_no_accommodation_total", - Help: "Number of times a dispatch attempt resulted in a non accommodation due to lack of available seats", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel, flowSchema}, - ) - apiserverNominalConcurrencyLimits = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "nominal_limit_seats", - Help: "Nominal number of execution seats configured for each priority level", - StabilityLevel: compbasemetrics.BETA, - }, - []string{priorityLevel}, - ) - apiserverMinimumConcurrencyLimits = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "lower_limit_seats", - Help: "Configured lower bound on number of execution seats available to each priority level", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel}, - ) - apiserverMaximumConcurrencyLimits = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "upper_limit_seats", - Help: "Configured upper bound on number of execution seats available to each priority level", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel}, - ) - ApiserverSeatDemands = NewTimingRatioHistogramVec( - &compbasemetrics.TimingHistogramOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "demand_seats", - Help: "Observations, at the end of every nanosecond, of (the number of seats each priority level could use) / (nominal number of seats for that level)", - // Rationale for the bucket boundaries: - // For 0--1, evenly spaced and not too many; - // For 1--2, roughly powers of sqrt(sqrt(2)); - // For 2--6, roughly powers of sqrt(2); - // We need coverage over 1, but do not want too many buckets. - Buckets: []float64{0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.7, 2, 2.8, 4, 6}, - StabilityLevel: compbasemetrics.ALPHA, - }, - priorityLevel, - ) - apiserverSeatDemandHighWatermarks = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "demand_seats_high_watermark", - Help: "High watermark, over last adjustment period, of demand_seats", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel}, - ) - apiserverSeatDemandAverages = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "demand_seats_average", - Help: "Time-weighted average, over last adjustment period, of demand_seats", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel}, - ) - apiserverSeatDemandStandardDeviations = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "demand_seats_stdev", - Help: "Time-weighted standard deviation, over last adjustment period, of demand_seats", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel}, - ) - apiserverSeatDemandSmootheds = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "demand_seats_smoothed", - Help: "Smoothed seat demands", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel}, - ) - apiserverSeatDemandTargets = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "target_seats", - Help: "Seat allocation targets", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel}, - ) - apiserverFairFracs = compbasemetrics.NewGauge( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "seat_fair_frac", - Help: "Fair fraction of server's concurrency to allocate to each priority level that can use it", - StabilityLevel: compbasemetrics.ALPHA, - }) - apiserverCurrentConcurrencyLimits = compbasemetrics.NewGaugeVec( - &compbasemetrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "current_limit_seats", - Help: "current derived number of execution seats available to each priority level", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{priorityLevel}, - ) - - metrics = Registerables{ - apiserverRejectedRequestsTotal, - apiserverDispatchedRequestsTotal, - apiserverCurrentR, - apiserverDispatchR, - apiserverLatestS, - apiserverNextSBounds, - apiserverNextDiscountedSBounds, - apiserverCurrentInqueueRequests, - apiserverCurrentInqueueSeats, - apiserverRequestQueueLength, - apiserverRequestConcurrencyLimit, - apiserverRequestConcurrencyInUse, - apiserverCurrentExecutingSeats, - apiserverCurrentExecutingRequests, - apiserverRequestWaitingSeconds, - apiserverRequestExecutionSeconds, - watchCountSamples, - apiserverEpochAdvances, - apiserverWorkEstimatedSeats, - apiserverDispatchWithNoAccommodation, - apiserverNominalConcurrencyLimits, - apiserverMinimumConcurrencyLimits, - apiserverMaximumConcurrencyLimits, - apiserverSeatDemandHighWatermarks, - apiserverSeatDemandAverages, - apiserverSeatDemandStandardDeviations, - apiserverSeatDemandSmootheds, - apiserverSeatDemandTargets, - apiserverFairFracs, - apiserverCurrentConcurrencyLimits, - }. - Append(PriorityLevelExecutionSeatsGaugeVec.metrics()...). - Append(PriorityLevelConcurrencyGaugeVec.metrics()...). - Append(readWriteConcurrencyGaugeVec.metrics()...). - Append(ApiserverSeatDemands.metrics()...) -) - -type indexOnce struct { - labelValues []string - once sync.Once - gauge RatioedGauge -} - -func (io *indexOnce) getGauge() RatioedGauge { - io.once.Do(func() { - io.gauge = readWriteConcurrencyGaugeVec.NewForLabelValuesSafe(0, 1, io.labelValues) - }) - return io.gauge -} - -var waitingReadonly = indexOnce{labelValues: []string{LabelValueWaiting, epmetrics.ReadOnlyKind}} -var executingReadonly = indexOnce{labelValues: []string{LabelValueExecuting, epmetrics.ReadOnlyKind}} -var waitingMutating = indexOnce{labelValues: []string{LabelValueWaiting, epmetrics.MutatingKind}} -var executingMutating = indexOnce{labelValues: []string{LabelValueExecuting, epmetrics.MutatingKind}} - -// GetWaitingReadonlyConcurrency returns the gauge of number of readonly requests waiting / limit on those. -var GetWaitingReadonlyConcurrency = waitingReadonly.getGauge - -// GetExecutingReadonlyConcurrency returns the gauge of number of executing readonly requests / limit on those. -var GetExecutingReadonlyConcurrency = executingReadonly.getGauge - -// GetWaitingMutatingConcurrency returns the gauge of number of mutating requests waiting / limit on those. -var GetWaitingMutatingConcurrency = waitingMutating.getGauge - -// GetExecutingMutatingConcurrency returns the gauge of number of executing mutating requests / limit on those. -var GetExecutingMutatingConcurrency = executingMutating.getGauge - -// AddRequestsInQueues adds the given delta to the gauge of the # of requests in the queues of the specified flowSchema and priorityLevel -func AddRequestsInQueues(ctx context.Context, priorityLevel, flowSchema string, delta int) { - apiserverCurrentInqueueRequests.WithLabelValues(priorityLevel, flowSchema).Add(float64(delta)) -} - -// AddSeatsInQueues adds the given delta to the gauge of the # of seats in the queues of the specified flowSchema and priorityLevel -func AddSeatsInQueues(ctx context.Context, priorityLevel, flowSchema string, delta int) { - apiserverCurrentInqueueSeats.WithLabelValues(priorityLevel, flowSchema).Add(float64(delta)) -} - -// AddRequestsExecuting adds the given delta to the gauge of executing requests of the given flowSchema and priorityLevel -func AddRequestsExecuting(ctx context.Context, priorityLevel, flowSchema string, delta int) { - apiserverCurrentExecutingRequests.WithLabelValues(priorityLevel, flowSchema).Add(float64(delta)) -} - -// SetCurrentR sets the current-R (virtualTime) gauge for the given priority level -func SetCurrentR(priorityLevel string, r float64) { - apiserverCurrentR.WithLabelValues(priorityLevel).Set(r) -} - -// SetLatestS sets the latest-S (virtual time of dispatched request) gauge for the given priority level -func SetDispatchMetrics(priorityLevel string, r, s, sMin, sMax, discountedSMin, discountedSMax float64) { - apiserverDispatchR.WithLabelValues(priorityLevel).Set(r) - apiserverLatestS.WithLabelValues(priorityLevel).Set(s) - apiserverNextSBounds.WithLabelValues(priorityLevel, "min").Set(sMin) - apiserverNextSBounds.WithLabelValues(priorityLevel, "max").Set(sMax) - apiserverNextDiscountedSBounds.WithLabelValues(priorityLevel, "min").Set(discountedSMin) - apiserverNextDiscountedSBounds.WithLabelValues(priorityLevel, "max").Set(discountedSMax) -} - -// AddSeatConcurrencyInUse adds the given delta to the gauge of seats in use by -// the currently executing requests of the given flowSchema and priorityLevel -func AddSeatConcurrencyInUse(priorityLevel, flowSchema string, delta int) { - apiserverCurrentExecutingSeats.WithLabelValues(priorityLevel, flowSchema).Add(float64(delta)) - apiserverRequestConcurrencyInUse.WithLabelValues(priorityLevel, flowSchema).Add(float64(delta)) -} - -// AddReject increments the # of rejected requests for flow control -func AddReject(ctx context.Context, priorityLevel, flowSchema, reason string) { - apiserverRejectedRequestsTotal.WithContext(ctx).WithLabelValues(priorityLevel, flowSchema, reason).Add(1) -} - -// AddDispatch increments the # of dispatched requests for flow control -func AddDispatch(ctx context.Context, priorityLevel, flowSchema string) { - apiserverDispatchedRequestsTotal.WithContext(ctx).WithLabelValues(priorityLevel, flowSchema).Add(1) -} - -// ObserveQueueLength observes the queue length for flow control -func ObserveQueueLength(ctx context.Context, priorityLevel, flowSchema string, length int) { - apiserverRequestQueueLength.WithContext(ctx).WithLabelValues(priorityLevel, flowSchema).Observe(float64(length)) -} - -// ObserveWaitingDuration observes the queue length for flow control -func ObserveWaitingDuration(ctx context.Context, priorityLevel, flowSchema, execute string, waitTime time.Duration) { - apiserverRequestWaitingSeconds.WithContext(ctx).WithLabelValues(priorityLevel, flowSchema, execute).Observe(waitTime.Seconds()) -} - -// ObserveExecutionDuration observes the execution duration for flow control -func ObserveExecutionDuration(ctx context.Context, priorityLevel, flowSchema string, executionTime time.Duration) { - reqType := "regular" - if requestInfo, ok := apirequest.RequestInfoFrom(ctx); ok && requestInfo.Verb == "watch" { - reqType = requestInfo.Verb - } - apiserverRequestExecutionSeconds.WithContext(ctx).WithLabelValues(priorityLevel, flowSchema, reqType).Observe(executionTime.Seconds()) -} - -// ObserveWatchCount notes a sampling of a watch count -func ObserveWatchCount(ctx context.Context, priorityLevel, flowSchema string, count int) { - watchCountSamples.WithLabelValues(priorityLevel, flowSchema).Observe(float64(count)) -} - -// AddEpochAdvance notes an advance of the progress meter baseline for a given priority level -func AddEpochAdvance(ctx context.Context, priorityLevel string, success bool) { - apiserverEpochAdvances.WithContext(ctx).WithLabelValues(priorityLevel, strconv.FormatBool(success)).Inc() -} - -// ObserveWorkEstimatedSeats notes a sampling of estimated seats associated with a request -func ObserveWorkEstimatedSeats(priorityLevel, flowSchema string, seats int) { - apiserverWorkEstimatedSeats.WithLabelValues(priorityLevel, flowSchema).Observe(float64(seats)) -} - -// AddDispatchWithNoAccommodation keeps track of number of times dispatch attempt results -// in a non accommodation due to lack of available seats. -func AddDispatchWithNoAccommodation(priorityLevel, flowSchema string) { - apiserverDispatchWithNoAccommodation.WithLabelValues(priorityLevel, flowSchema).Inc() -} - -func SetPriorityLevelConfiguration(priorityLevel string, nominalCL, minCL, maxCL int) { - apiserverRequestConcurrencyLimit.WithLabelValues(priorityLevel).Set(float64(nominalCL)) - apiserverNominalConcurrencyLimits.WithLabelValues(priorityLevel).Set(float64(nominalCL)) - apiserverMinimumConcurrencyLimits.WithLabelValues(priorityLevel).Set(float64(minCL)) - apiserverMaximumConcurrencyLimits.WithLabelValues(priorityLevel).Set(float64(maxCL)) -} - -func NotePriorityLevelConcurrencyAdjustment(priorityLevel string, seatDemandHWM, seatDemandAvg, seatDemandStdev, seatDemandSmoothed, seatDemandTarget float64, currentCL int) { - apiserverSeatDemandHighWatermarks.WithLabelValues(priorityLevel).Set(seatDemandHWM) - apiserverSeatDemandAverages.WithLabelValues(priorityLevel).Set(seatDemandAvg) - apiserverSeatDemandStandardDeviations.WithLabelValues(priorityLevel).Set(seatDemandStdev) - apiserverSeatDemandSmootheds.WithLabelValues(priorityLevel).Set(seatDemandSmoothed) - apiserverSeatDemandTargets.WithLabelValues(priorityLevel).Set(seatDemandTarget) - apiserverCurrentConcurrencyLimits.WithLabelValues(priorityLevel).Set(float64(currentCL)) -} - -func SetFairFrac(fairFrac float64) { - apiserverFairFracs.Set(fairFrac) -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/timing_ratio_histogram.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/timing_ratio_histogram.go deleted file mode 100644 index 2275be6aa..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/timing_ratio_histogram.go +++ /dev/null @@ -1,226 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package metrics - -import ( - "context" - "sync" - "time" - - compbasemetrics "k8s.io/component-base/metrics" - "k8s.io/klog/v2" -) - -// TimingRatioHistogram is essentially a gauge for a ratio where the client -// independently controls the numerator and denominator. -// When scraped it produces a histogram of samples of the ratio -// taken at the end of every nanosecond. -// `*TimingRatioHistogram` implements both Registerable and RatioedGauge. -type TimingRatioHistogram struct { - // The implementation is layered on TimingHistogram, - // adding the division by an occasionally adjusted denominator. - - // Registerable is the registerable aspect. - // That is the registerable aspect of the underlying TimingHistogram. - compbasemetrics.Registerable - - // timingRatioHistogramInner implements the RatioedGauge aspect. - timingRatioHistogramInner -} - -// TimingRatioHistogramOpts is the constructor parameters of a TimingRatioHistogram. -// The `TimingHistogramOpts.InitialValue` is the initial numerator. -type TimingRatioHistogramOpts struct { - compbasemetrics.TimingHistogramOpts - InitialDenominator float64 -} - -// timingRatioHistogramInner implements the instrumentation aspect -type timingRatioHistogramInner struct { - nowFunc func() time.Time - getGaugeOfRatio func() Gauge - sync.Mutex - // access only with mutex locked - numerator, denominator float64 -} - -var _ RatioedGauge = &timingRatioHistogramInner{} -var _ RatioedGauge = &TimingRatioHistogram{} -var _ compbasemetrics.Registerable = &TimingRatioHistogram{} - -// NewTimingHistogram returns an object which is TimingHistogram-like. However, nothing -// will be measured until the histogram is registered in at least one registry. -func NewTimingRatioHistogram(opts *TimingRatioHistogramOpts) *TimingRatioHistogram { - return NewTestableTimingRatioHistogram(time.Now, opts) -} - -// NewTestableTimingHistogram adds injection of the clock -func NewTestableTimingRatioHistogram(nowFunc func() time.Time, opts *TimingRatioHistogramOpts) *TimingRatioHistogram { - //nolint:govet // copylocks: assignment copies lock value to ratioedOpts: k8s.io/component-base/metrics.TimingHistogramOpts contains sync.Once contains sync.Mutex - ratioedOpts := opts.TimingHistogramOpts - ratioedOpts.InitialValue /= opts.InitialDenominator - th := compbasemetrics.NewTestableTimingHistogram(nowFunc, &ratioedOpts) - return &TimingRatioHistogram{ - Registerable: th, - timingRatioHistogramInner: timingRatioHistogramInner{ - nowFunc: nowFunc, - getGaugeOfRatio: func() Gauge { return th }, - numerator: opts.InitialValue, - denominator: opts.InitialDenominator, - }} -} - -func (trh *timingRatioHistogramInner) Set(numerator float64) { - trh.Lock() - defer trh.Unlock() - trh.numerator = numerator - ratio := numerator / trh.denominator - trh.getGaugeOfRatio().Set(ratio) -} - -func (trh *timingRatioHistogramInner) Add(deltaNumerator float64) { - trh.Lock() - defer trh.Unlock() - numerator := trh.numerator + deltaNumerator - trh.numerator = numerator - ratio := numerator / trh.denominator - trh.getGaugeOfRatio().Set(ratio) -} - -func (trh *timingRatioHistogramInner) Sub(deltaNumerator float64) { - trh.Add(-deltaNumerator) -} - -func (trh *timingRatioHistogramInner) Inc() { - trh.Add(1) -} - -func (trh *timingRatioHistogramInner) Dec() { - trh.Add(-1) -} - -func (trh *timingRatioHistogramInner) SetToCurrentTime() { - trh.Set(float64(trh.nowFunc().Sub(time.Unix(0, 0)))) -} - -func (trh *timingRatioHistogramInner) SetDenominator(denominator float64) { - trh.Lock() - defer trh.Unlock() - trh.denominator = denominator - ratio := trh.numerator / denominator - trh.getGaugeOfRatio().Set(ratio) -} - -// WithContext allows the normal TimingHistogram metric to pass in context. -// The context is no-op at the current level of development. -func (trh *timingRatioHistogramInner) WithContext(ctx context.Context) RatioedGauge { - return trh -} - -// TimingRatioHistogramVec is a collection of TimingRatioHistograms that differ -// only in label values. -// `*TimingRatioHistogramVec` implements both Registerable and RatioedGaugeVec. -type TimingRatioHistogramVec struct { - // promote only the Registerable methods - compbasemetrics.Registerable - // delegate is TimingHistograms of the ratio - delegate compbasemetrics.GaugeVecMetric -} - -var _ RatioedGaugeVec = &TimingRatioHistogramVec{} -var _ compbasemetrics.Registerable = &TimingRatioHistogramVec{} - -// NewTimingHistogramVec constructs a new vector. -// `opts.InitialValue` is the initial ratio, but this applies -// only for the tiny period of time until NewForLabelValuesSafe sets -// the ratio based on the given initial numerator and denominator. -// Thus there is a tiny splinter of time during member construction when -// its underlying TimingHistogram is given the initial numerator rather than -// the initial ratio (which is obviously a non-issue when both are zero). -// Note the difficulties associated with extracting a member -// before registering the vector. -func NewTimingRatioHistogramVec(opts *compbasemetrics.TimingHistogramOpts, labelNames ...string) *TimingRatioHistogramVec { - return NewTestableTimingRatioHistogramVec(time.Now, opts, labelNames...) -} - -// NewTestableTimingHistogramVec adds injection of the clock. -func NewTestableTimingRatioHistogramVec(nowFunc func() time.Time, opts *compbasemetrics.TimingHistogramOpts, labelNames ...string) *TimingRatioHistogramVec { - delegate := compbasemetrics.NewTestableTimingHistogramVec(nowFunc, opts, labelNames) - return &TimingRatioHistogramVec{ - Registerable: delegate, - delegate: delegate, - } -} - -func (v *TimingRatioHistogramVec) metrics() Registerables { - return Registerables{v} -} - -// NewForLabelValuesChecked will return an error if this vec is not hidden and not yet registered -// or there is a syntactic problem with the labelValues. -func (v *TimingRatioHistogramVec) NewForLabelValuesChecked(initialNumerator, initialDenominator float64, labelValues []string) (RatioedGauge, error) { - underMember, err := v.delegate.WithLabelValuesChecked(labelValues...) - if err != nil { - return noopRatioed{}, err - } - underMember.Set(initialNumerator / initialDenominator) - return &timingRatioHistogramInner{ - getGaugeOfRatio: func() Gauge { return underMember }, - numerator: initialNumerator, - denominator: initialDenominator, - }, nil -} - -// NewForLabelValuesSafe is the same as NewForLabelValuesChecked in cases where that does not -// return an error. When the unsafe version returns an error due to the vector not being -// registered yet, the safe version returns an object that implements its methods -// by looking up the relevant vector member in each call (thus getting a non-noop after registration). -// In the other error cases the object returned here is a noop. -func (v *TimingRatioHistogramVec) NewForLabelValuesSafe(initialNumerator, initialDenominator float64, labelValues []string) RatioedGauge { - tro, err := v.NewForLabelValuesChecked(initialNumerator, initialDenominator, labelValues) - if err == nil { - klog.V(3).InfoS("TimingRatioHistogramVec.NewForLabelValuesSafe hit the efficient case", "fqName", v.FQName(), "labelValues", labelValues) - return tro - } - if !compbasemetrics.ErrIsNotRegistered(err) { - klog.ErrorS(err, "Failed to extract TimingRatioHistogramVec member, using noop instead", "vectorname", v.FQName(), "labelValues", labelValues) - return tro - } - klog.V(3).InfoS("TimingRatioHistogramVec.NewForLabelValuesSafe hit the inefficient case", "fqName", v.FQName(), "labelValues", labelValues) - // At this point we know v.NewForLabelValuesChecked(..) returns a permanent noop, - // which we precisely want to avoid using. Instead, make our own gauge that - // fetches the element on every Set. - return &timingRatioHistogramInner{ - getGaugeOfRatio: func() Gauge { return v.delegate.WithLabelValues(labelValues...) }, - numerator: initialNumerator, - denominator: initialDenominator, - } -} - -type noopRatioed struct{} - -func (noopRatioed) Set(float64) {} -func (noopRatioed) Add(float64) {} -func (noopRatioed) Sub(float64) {} -func (noopRatioed) Inc() {} -func (noopRatioed) Dec() {} -func (noopRatioed) SetToCurrentTime() {} -func (noopRatioed) SetDenominator(float64) {} - -func (v *TimingRatioHistogramVec) Reset() { - v.delegate.Reset() -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/union_gauge.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/union_gauge.go deleted file mode 100644 index b01daaaaa..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/union_gauge.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package metrics - -type unionGauge []Gauge - -var _ Gauge = unionGauge(nil) - -// NewUnionGauge constructs a Gauge that delegates to all of the given Gauges -func NewUnionGauge(elts ...Gauge) Gauge { - return unionGauge(elts) -} - -func (ug unionGauge) Set(x float64) { - for _, gauge := range ug { - gauge.Set(x) - } -} - -func (ug unionGauge) Add(x float64) { - for _, gauge := range ug { - gauge.Add(x) - } -} - -func (ug unionGauge) Inc() { - for _, gauge := range ug { - gauge.Inc() - } -} - -func (ug unionGauge) Dec() { - for _, gauge := range ug { - gauge.Dec() - } -} - -func (ug unionGauge) SetToCurrentTime() { - for _, gauge := range ug { - gauge.SetToCurrentTime() - } -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/vec_element_pair.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/vec_element_pair.go deleted file mode 100644 index 6dcef12c2..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/vec_element_pair.go +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package metrics - -// RatioedGaugeVecPhasedElementPair extracts a pair of elements that differ in handling phase -func RatioedGaugeVecPhasedElementPair(vec RatioedGaugeVec, initialWaitingDenominator, initialExecutingDenominator float64, labelValues []string) RatioedGaugePair { - return RatioedGaugePair{ - RequestsWaiting: vec.NewForLabelValuesSafe(0, initialWaitingDenominator, append([]string{LabelValueWaiting}, labelValues...)), - RequestsExecuting: vec.NewForLabelValuesSafe(0, initialExecutingDenominator, append([]string{LabelValueExecuting}, labelValues...)), - } -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/config.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/config.go deleted file mode 100644 index c51435b15..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/config.go +++ /dev/null @@ -1,93 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package request - -import ( - "time" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - minimumSeats = 1 - maximumSeatsLimit = 10 - objectsPerSeat = 100.0 - watchesPerSeat = 10.0 - enableMutatingWorkEstimator = true -) - -var eventAdditionalDuration = 5 * time.Millisecond - -// WorkEstimatorConfig holds work estimator parameters. -type WorkEstimatorConfig struct { - *ListWorkEstimatorConfig `json:"listWorkEstimatorConfig,omitempty"` - *MutatingWorkEstimatorConfig `json:"mutatingWorkEstimatorConfig,omitempty"` - - // MinimumSeats is the minimum number of seats a request must occupy. - MinimumSeats uint64 `json:"minimumSeats,omitempty"` - - // MaximumSeatsLimit is an upper limit on the max seats a request can occupy. - // - // NOTE: work_estimate_seats_samples metric uses the value of maximumSeats - // as the upper bound, so when we change maximumSeats we should also - // update the buckets of the metric. - MaximumSeatsLimit uint64 `json:"maximumSeatsLimit,omitempty"` -} - -// ListWorkEstimatorConfig holds work estimator parameters related to list requests. -type ListWorkEstimatorConfig struct { - ObjectsPerSeat float64 `json:"objectsPerSeat,omitempty"` -} - -// MutatingWorkEstimatorConfig holds work estimator -// parameters related to watches of mutating objects. -type MutatingWorkEstimatorConfig struct { - // TODO(wojtekt): Remove it once we tune the algorithm to not fail - // scalability tests. - Enabled bool `json:"enable,omitempty"` - EventAdditionalDuration metav1.Duration `json:"eventAdditionalDurationMs,omitempty"` - WatchesPerSeat float64 `json:"watchesPerSeat,omitempty"` -} - -// DefaultWorkEstimatorConfig creates a new WorkEstimatorConfig with default values. -func DefaultWorkEstimatorConfig() *WorkEstimatorConfig { - return &WorkEstimatorConfig{ - MinimumSeats: minimumSeats, - MaximumSeatsLimit: maximumSeatsLimit, - ListWorkEstimatorConfig: defaultListWorkEstimatorConfig(), - MutatingWorkEstimatorConfig: defaultMutatingWorkEstimatorConfig(), - } -} - -// defaultListWorkEstimatorConfig creates a new ListWorkEstimatorConfig with default values. -func defaultListWorkEstimatorConfig() *ListWorkEstimatorConfig { - return &ListWorkEstimatorConfig{ObjectsPerSeat: objectsPerSeat} -} - -// defaultMutatingWorkEstimatorConfig creates a new MutatingWorkEstimatorConfig with default values. -func defaultMutatingWorkEstimatorConfig() *MutatingWorkEstimatorConfig { - return &MutatingWorkEstimatorConfig{ - Enabled: enableMutatingWorkEstimator, - EventAdditionalDuration: metav1.Duration{Duration: eventAdditionalDuration}, - WatchesPerSeat: watchesPerSeat, - } -} - -// eventAdditionalDuration converts eventAdditionalDurationMs to a time.Duration type. -func (c *MutatingWorkEstimatorConfig) eventAdditionalDuration() time.Duration { - return c.EventAdditionalDuration.Duration -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/list_work_estimator.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/list_work_estimator.go deleted file mode 100644 index 6e46e2d59..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/list_work_estimator.go +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package request - -import ( - "math" - "net/http" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - apirequest "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/apiserver/pkg/storage/cacher/delegator" - "k8s.io/klog/v2" -) - -func newListWorkEstimator(countFn objectCountGetterFunc, config *WorkEstimatorConfig, maxSeatsFn maxSeatsFunc) WorkEstimatorFunc { - estimator := &listWorkEstimator{ - config: config, - countGetterFn: countFn, - maxSeatsFn: maxSeatsFn, - } - return estimator.estimate -} - -type listWorkEstimator struct { - config *WorkEstimatorConfig - countGetterFn objectCountGetterFunc - maxSeatsFn maxSeatsFunc -} - -func (e *listWorkEstimator) estimate(r *http.Request, flowSchemaName, priorityLevelName string) WorkEstimate { - minSeats := e.config.MinimumSeats - maxSeats := e.maxSeatsFn(priorityLevelName) - if maxSeats == 0 || maxSeats > e.config.MaximumSeatsLimit { - maxSeats = e.config.MaximumSeatsLimit - } - - requestInfo, ok := apirequest.RequestInfoFrom(r.Context()) - if !ok { - // no RequestInfo should never happen, but to be on the safe side - // let's return maximumSeats - return WorkEstimate{InitialSeats: maxSeats} - } - - if requestInfo.Name != "" { - // Requests with metadata.name specified are usually executed as get - // requests in storage layer so their width should be 1. - // Example of such list requests: - // /apis/certificates.k8s.io/v1/certificatesigningrequests?fieldSelector=metadata.name%3Dcsr-xxs4m - // /api/v1/namespaces/test/configmaps?fieldSelector=metadata.name%3Dbig-deployment-1&limit=500&resourceVersion=0 - return WorkEstimate{InitialSeats: minSeats} - } - - query := r.URL.Query() - listOptions := metav1.ListOptions{} - if err := metav1.Convert_url_Values_To_v1_ListOptions(&query, &listOptions, nil); err != nil { - klog.ErrorS(err, "Failed to convert options while estimating work for the list request") - - // This request is destined to fail in the validation layer, - // return maximumSeats for this request to be consistent. - return WorkEstimate{InitialSeats: maxSeats} - } - - // For watch requests, we want to adjust the cost only if they explicitly request - // sending initial events. - if requestInfo.Verb == "watch" { - if listOptions.SendInitialEvents == nil || !*listOptions.SendInitialEvents { - return WorkEstimate{InitialSeats: e.config.MinimumSeats} - } - } - // TODO: Check whether watchcache is enabled. - result, err := delegator.ShouldDelegateListMeta(&listOptions, delegator.CacheWithoutSnapshots{}) - if err != nil { - return WorkEstimate{InitialSeats: maxSeats} - } - listFromStorage := result.ShouldDelegate - isListFromCache := requestInfo.Verb == "watch" || !listFromStorage - - numStored, err := e.countGetterFn(key(requestInfo)) - switch { - case err == ObjectCountStaleErr: - // object count going stale is indicative of degradation, so we should - // be conservative here and allocate maximum seats to this list request. - // NOTE: if a CRD is removed, its count will go stale first and then the - // pruner will eventually remove the CRD from the cache. - return WorkEstimate{InitialSeats: maxSeats} - case err == ObjectCountNotFoundErr: - // there are multiple scenarios in which we can see this error: - // a. the type is truly unknown, a typo on the caller's part. - // b. the count has gone stale for too long and the pruner - // has removed the type from the cache. - // c. the type is an aggregated resource that is served by a - // different apiserver (thus its object count is not updated) - // we don't have a way to distinguish between those situations. - // However, in case c, the request is delegated to a different apiserver, - // and thus its cost for our server is minimal. To avoid the situation - // when aggregated API calls are overestimated, we allocate the minimum - // possible seats (see #109106 as an example when being more conservative - // led to problems). - return WorkEstimate{InitialSeats: minSeats} - case err != nil: - // we should never be here since Get returns either ObjectCountStaleErr or - // ObjectCountNotFoundErr, return maximumSeats to be on the safe side. - klog.ErrorS(err, "Unexpected error from object count tracker") - return WorkEstimate{InitialSeats: maxSeats} - } - - limit := numStored - if listOptions.Limit > 0 && listOptions.Limit < numStored { - limit = listOptions.Limit - } - - var estimatedObjectsToBeProcessed int64 - - switch { - case isListFromCache: - // TODO: For resources that implement indexes at the watchcache level, - // we need to adjust the cost accordingly - estimatedObjectsToBeProcessed = numStored - case listOptions.FieldSelector != "" || listOptions.LabelSelector != "": - estimatedObjectsToBeProcessed = numStored + limit - default: - estimatedObjectsToBeProcessed = 2 * limit - } - - // for now, our rough estimate is to allocate one seat to each 100 obejcts that - // will be processed by the list request. - // we will come up with a different formula for the transformation function and/or - // fine tune this number in future iteratons. - seats := uint64(math.Ceil(float64(estimatedObjectsToBeProcessed) / e.config.ObjectsPerSeat)) - - // make sure we never return a seat of zero - if seats < minSeats { - seats = minSeats - } - if seats > maxSeats { - seats = maxSeats - } - return WorkEstimate{InitialSeats: seats} -} - -func key(requestInfo *apirequest.RequestInfo) string { - groupResource := &schema.GroupResource{ - Group: requestInfo.APIGroup, - Resource: requestInfo.Resource, - } - return groupResource.String() -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/mutating_work_estimator.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/mutating_work_estimator.go deleted file mode 100644 index 9b983f003..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/mutating_work_estimator.go +++ /dev/null @@ -1,157 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package request - -import ( - "math" - "net/http" - "time" - - apirequest "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/apiserver/pkg/util/flowcontrol/metrics" -) - -func newMutatingWorkEstimator(countFn watchCountGetterFunc, config *WorkEstimatorConfig, maxSeatsFn maxSeatsFunc) WorkEstimatorFunc { - estimator := &mutatingWorkEstimator{ - config: config, - countFn: countFn, - maxSeatsFn: maxSeatsFn, - } - return estimator.estimate -} - -type mutatingWorkEstimator struct { - config *WorkEstimatorConfig - countFn watchCountGetterFunc - maxSeatsFn maxSeatsFunc -} - -func (e *mutatingWorkEstimator) estimate(r *http.Request, flowSchemaName, priorityLevelName string) WorkEstimate { - minSeats := e.config.MinimumSeats - maxSeats := e.maxSeatsFn(priorityLevelName) - if maxSeats == 0 || maxSeats > e.config.MaximumSeatsLimit { - maxSeats = e.config.MaximumSeatsLimit - } - - // TODO(wojtekt): Remove once we tune the algorithm to not fail - // scalability tests. - if !e.config.Enabled { - return WorkEstimate{ - InitialSeats: minSeats, - } - } - - requestInfo, ok := apirequest.RequestInfoFrom(r.Context()) - if !ok { - // no RequestInfo should never happen, but to be on the safe side - // let's return a large value. - return WorkEstimate{ - InitialSeats: minSeats, - FinalSeats: maxSeats, - AdditionalLatency: e.config.eventAdditionalDuration(), - } - } - - if isRequestExemptFromWatchEvents(requestInfo) { - return WorkEstimate{ - InitialSeats: minSeats, - FinalSeats: 0, - AdditionalLatency: time.Duration(0), - } - } - - watchCount := e.countFn(requestInfo) - metrics.ObserveWatchCount(r.Context(), priorityLevelName, flowSchemaName, watchCount) - - // The cost of the request associated with the watchers of that event - // consists of three parts: - // - cost of going through the event change logic - // - cost of serialization of the event - // - cost of processing an event object for each watcher (e.g. filtering, - // sending data over network) - // We're starting simple to get some operational experience with it and - // we will work on tuning the algorithm later. Given that the actual work - // associated with processing watch events is happening in multiple - // goroutines (proportional to the number of watchers) that are all - // resumed at once, as a starting point we assume that each such goroutine - // is taking 1/Nth of a seat for M milliseconds. - // We allow the accounting of that work in P&F to be reshaped into another - // rectangle of equal area for practical reasons. - var finalSeats uint64 - var additionalLatency time.Duration - - // TODO: Make this unconditional after we tune the algorithm better. - // Technically, there is an overhead connected to processing an event after - // the request finishes even if there is a small number of watches. - // However, until we tune the estimation we want to stay on the safe side - // an avoid introducing additional latency for almost every single request. - if watchCount >= int(e.config.WatchesPerSeat) { - // TODO: As described in the KEP, we should take into account that not all - // events are equal and try to estimate the cost of a single event based on - // some historical data about size of events. - finalSeats = uint64(math.Ceil(float64(watchCount) / e.config.WatchesPerSeat)) - finalWork := SeatsTimesDuration(float64(finalSeats), e.config.eventAdditionalDuration()) - - // While processing individual events is highly parallel, - // the design/implementation of P&F has a couple limitations that - // make using this assumption in the P&F implementation very - // inefficient because: - // - we reserve max(initialSeats, finalSeats) for time of executing - // both phases of the request - // - even more importantly, when a given `wide` request is the one to - // be dispatched, we are not dispatching any other request until - // we accumulate enough seats to dispatch the nominated one, even - // if currently unoccupied seats would allow for dispatching some - // other requests in the meantime - // As a consequence of these, the wider the request, the more capacity - // will effectively be blocked and unused during dispatching and - // executing this request. - // - // To mitigate the impact of it, we're capping the maximum number of - // seats that can be assigned to a given request. Thanks to it: - // 1) we reduce the amount of seat-seconds that are "wasted" during - // dispatching and executing initial phase of the request - // 2) we are not changing the finalWork estimate - just potentially - // reshaping it to be narrower and longer. As long as the maximum - // seats setting will prevent dispatching too many requests at once - // to prevent overloading kube-apiserver (and/or etcd or the VM or - // a physical machine it is running on), we believe the relaxed - // version should be good enough to achieve the P&F goals. - // - // TODO: Confirm that the current cap of maximumSeats allow us to - // achieve the above. - if finalSeats > maxSeats { - finalSeats = maxSeats - } - additionalLatency = finalWork.DurationPerSeat(float64(finalSeats)) - } - - return WorkEstimate{ - InitialSeats: 1, - FinalSeats: finalSeats, - AdditionalLatency: additionalLatency, - } -} - -func isRequestExemptFromWatchEvents(requestInfo *apirequest.RequestInfo) bool { - // Creating token for service account does not produce any event, - // but still serviceaccounts can have multiple watchers. - if requestInfo.Resource == "serviceaccounts" && requestInfo.Subresource == "token" { - return true - } - return false -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/object_count_tracker.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/object_count_tracker.go deleted file mode 100644 index 62a5e4f2d..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/object_count_tracker.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package request - -import ( - "errors" - "sync" - "time" - - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/klog/v2" - "k8s.io/utils/clock" -) - -const ( - // type deletion (it applies mostly to CRD) is not a very frequent - // operation so we can afford to prune the cache at a large interval. - // at the same time, we also want to make sure that the scalability - // tests hit this code path. - pruneInterval = 1 * time.Hour - - // the storage layer polls for object count at every 1m interval, we will allow - // up to 2-3 transient failures to get the latest count for a given resource. - staleTolerationThreshold = 3 * time.Minute -) - -var ( - // ObjectCountNotFoundErr is returned when the object count for - // a given resource is not being tracked. - ObjectCountNotFoundErr = errors.New("object count not found for the given resource") - - // ObjectCountStaleErr is returned when the object count for a - // given resource has gone stale due to transient failures. - ObjectCountStaleErr = errors.New("object count has gone stale for the given resource") -) - -// StorageObjectCountTracker is an interface that is used to keep track of -// of the total number of objects for each resource. -// {group}.{resource} is used as the key name to update and retrieve -// the total number of objects for a given resource. -type StorageObjectCountTracker interface { - // Set is invoked to update the current number of total - // objects for the given resource - Set(string, int64) - - // Get returns the total number of objects for the given resource. - // The following errors are returned: - // - if the count has gone stale for a given resource due to transient - // failures ObjectCountStaleErr is returned. - // - if the given resource is not being tracked then - // ObjectCountNotFoundErr is returned. - Get(string) (int64, error) - - // RunUntil starts all the necessary maintenance. - RunUntil(stopCh <-chan struct{}) -} - -// NewStorageObjectCountTracker returns an instance of -// StorageObjectCountTracker interface that can be used to -// keep track of the total number of objects for each resource. -func NewStorageObjectCountTracker() StorageObjectCountTracker { - return &objectCountTracker{ - clock: &clock.RealClock{}, - counts: map[string]*timestampedCount{}, - } -} - -// timestampedCount stores the count of a given resource with a last updated -// timestamp so we can prune it after it goes stale for certain threshold. -type timestampedCount struct { - count int64 - lastUpdatedAt time.Time -} - -// objectCountTracker implements StorageObjectCountTracker with -// reader/writer mutual exclusion lock. -type objectCountTracker struct { - clock clock.PassiveClock - - lock sync.RWMutex - counts map[string]*timestampedCount -} - -func (t *objectCountTracker) Set(groupResource string, count int64) { - if count <= -1 { - // a value of -1 indicates that the 'Count' call failed to contact - // the storage layer, in most cases this error can be transient. - // we will continue to work with the count that is in the cache - // up to a certain threshold defined by staleTolerationThreshold. - // in case this becomes a non transient error then the count for - // the given resource will will eventually be removed from - // the cache by the pruner. - return - } - - now := t.clock.Now() - - // lock for writing - t.lock.Lock() - defer t.lock.Unlock() - - if item, ok := t.counts[groupResource]; ok { - item.count = count - item.lastUpdatedAt = now - return - } - - t.counts[groupResource] = ×tampedCount{ - count: count, - lastUpdatedAt: now, - } -} - -func (t *objectCountTracker) Get(groupResource string) (int64, error) { - staleThreshold := t.clock.Now().Add(-staleTolerationThreshold) - - t.lock.RLock() - defer t.lock.RUnlock() - - if item, ok := t.counts[groupResource]; ok { - if item.lastUpdatedAt.Before(staleThreshold) { - return item.count, ObjectCountStaleErr - } - return item.count, nil - } - return 0, ObjectCountNotFoundErr -} - -// RunUntil runs all the necessary maintenance. -func (t *objectCountTracker) RunUntil(stopCh <-chan struct{}) { - wait.PollUntil( - pruneInterval, - func() (bool, error) { - // always prune at every pruneInterval - return false, t.prune(pruneInterval) - }, stopCh) - klog.InfoS("StorageObjectCountTracker pruner is exiting") -} - -func (t *objectCountTracker) prune(threshold time.Duration) error { - oldestLastUpdatedAtAllowed := t.clock.Now().Add(-threshold) - - // lock for writing - t.lock.Lock() - defer t.lock.Unlock() - - for groupResource, count := range t.counts { - if count.lastUpdatedAt.After(oldestLastUpdatedAtAllowed) { - continue - } - delete(t.counts, groupResource) - } - - return nil -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/seat_seconds.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/seat_seconds.go deleted file mode 100644 index 05dab65bd..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/seat_seconds.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package request - -import ( - "fmt" - "math" - "time" -) - -// SeatSeconds is a measure of work, in units of seat-seconds, using a fixed-point representation. -// `SeatSeconds(n)` represents `n/ssScale` seat-seconds. -// The `ssScale` constant is private to the implementation here, -// no other code should use it. -type SeatSeconds uint64 - -// MaxSeatsSeconds is the maximum representable value of SeatSeconds -const MaxSeatSeconds = SeatSeconds(math.MaxUint64) - -// MinSeatSeconds is the lowest representable value of SeatSeconds -const MinSeatSeconds = SeatSeconds(0) - -// SeatsTimeDuration produces the SeatSeconds value for the given factors. -// This is intended only to produce small values, increments in work -// rather than amount of work done since process start. -func SeatsTimesDuration(seats float64, duration time.Duration) SeatSeconds { - return SeatSeconds(int64(math.Round(seats * float64(duration/time.Nanosecond) / (1e9 / ssScale)))) -} - -// ToFloat converts to a floating-point representation. -// This conversion may lose precision. -func (ss SeatSeconds) ToFloat() float64 { - return float64(ss) / ssScale -} - -// DurationPerSeat returns duration per seat. -// This division may lose precision. -func (ss SeatSeconds) DurationPerSeat(seats float64) time.Duration { - return time.Duration(float64(ss) / seats * (float64(time.Second) / ssScale)) -} - -// String converts to a string. -// This is suitable for large as well as small values. -func (ss SeatSeconds) String() string { - const div = SeatSeconds(ssScale) - quo := ss / div - rem := ss - quo*div - return fmt.Sprintf("%d.%08dss", quo, rem) -} - -const ssScale = 1e8 diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/width.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/width.go deleted file mode 100644 index 43bc29ab8..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/request/width.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package request - -import ( - "fmt" - "net/http" - "time" - - apirequest "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/apiserver/pkg/features" - utilfeature "k8s.io/apiserver/pkg/util/feature" - - "k8s.io/klog/v2" -) - -// WorkEstimate carries three of the four parameters that determine the work in a request. -// The fourth parameter is the duration of the initial phase of execution. -type WorkEstimate struct { - // InitialSeats is the number of seats occupied while the server is - // executing this request. - InitialSeats uint64 - - // FinalSeats is the number of seats occupied at the end, - // during the AdditionalLatency. - FinalSeats uint64 - - // AdditionalLatency specifies the additional duration the seats allocated - // to this request must be reserved after the given request had finished. - // AdditionalLatency should not have any impact on the user experience, the - // caller must not experience this additional latency. - AdditionalLatency time.Duration -} - -// MaxSeats returns the maximum number of seats the request occupies over the -// phases of being served. -func (we *WorkEstimate) MaxSeats() int { - if we.InitialSeats >= we.FinalSeats { - return int(we.InitialSeats) - } - - return int(we.FinalSeats) -} - -// objectCountGetterFunc represents a function that gets the total -// number of objects for a given resource. -type objectCountGetterFunc func(string) (int64, error) - -// watchCountGetterFunc represents a function that gets the total -// number of watchers potentially interested in a given request. -type watchCountGetterFunc func(*apirequest.RequestInfo) int - -// MaxSeatsFunc represents a function that returns the maximum seats -// allowed for the work estimator for a given priority level. -type maxSeatsFunc func(priorityLevelName string) uint64 - -// NewWorkEstimator estimates the work that will be done by a given request, -// if no WorkEstimatorFunc matches the given request then the default -// work estimate of 1 seat is allocated to the request. -func NewWorkEstimator(objectCountFn objectCountGetterFunc, watchCountFn watchCountGetterFunc, config *WorkEstimatorConfig, maxSeatsFn maxSeatsFunc) WorkEstimatorFunc { - estimator := &workEstimator{ - minimumSeats: config.MinimumSeats, - maximumSeatsLimit: config.MaximumSeatsLimit, - listWorkEstimator: newListWorkEstimator(objectCountFn, config, maxSeatsFn), - mutatingWorkEstimator: newMutatingWorkEstimator(watchCountFn, config, maxSeatsFn), - } - return estimator.estimate -} - -// WorkEstimatorFunc returns the estimated work of a given request. -// This function will be used by the Priority & Fairness filter to -// estimate the work of incoming requests. -type WorkEstimatorFunc func(request *http.Request, flowSchemaName, priorityLevelName string) WorkEstimate - -func (e WorkEstimatorFunc) EstimateWork(r *http.Request, flowSchemaName, priorityLevelName string) WorkEstimate { - return e(r, flowSchemaName, priorityLevelName) -} - -type workEstimator struct { - // the minimum number of seats a request must occupy - minimumSeats uint64 - // the default maximum number of seats a request can occupy - maximumSeatsLimit uint64 - // listWorkEstimator estimates work for list request(s) - listWorkEstimator WorkEstimatorFunc - // mutatingWorkEstimator calculates the width of mutating request(s) - mutatingWorkEstimator WorkEstimatorFunc -} - -func (e *workEstimator) estimate(r *http.Request, flowSchemaName, priorityLevelName string) WorkEstimate { - requestInfo, ok := apirequest.RequestInfoFrom(r.Context()) - if !ok { - klog.ErrorS(fmt.Errorf("no RequestInfo found in context"), "Failed to estimate work for the request", "URI", r.RequestURI) - // no RequestInfo should never happen, but to be on the safe side let's return maximumSeats - return WorkEstimate{InitialSeats: e.maximumSeatsLimit} - } - - switch requestInfo.Verb { - case "list": - return e.listWorkEstimator.EstimateWork(r, flowSchemaName, priorityLevelName) - case "watch": - // WATCH supports `SendInitialEvents` option, which effectively means - // that is starts with sending of the contents of a corresponding LIST call. - // From that perspective, given that the watch only consumes APF seats - // during its initialization (sending init events), its cost should then - // be computed the same way as for a regular list. - if utilfeature.DefaultFeatureGate.Enabled(features.WatchList) { - return e.listWorkEstimator.EstimateWork(r, flowSchemaName, priorityLevelName) - } - case "create", "update", "patch", "delete": - return e.mutatingWorkEstimator.EstimateWork(r, flowSchemaName, priorityLevelName) - } - - return WorkEstimate{InitialSeats: e.minimumSeats} -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/rule.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/rule.go deleted file mode 100644 index 03c18b8e1..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/rule.go +++ /dev/null @@ -1,203 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flowcontrol - -import ( - "strings" - - flowcontrol "k8s.io/api/flowcontrol/v1" - "k8s.io/apiserver/pkg/authentication/serviceaccount" - "k8s.io/apiserver/pkg/authentication/user" - "k8s.io/apiserver/pkg/endpoints/request" -) - -// Tests whether a given request and FlowSchema match. Nobody mutates -// either input. -func matchesFlowSchema(digest RequestDigest, flowSchema *flowcontrol.FlowSchema) bool { - for _, policyRule := range flowSchema.Spec.Rules { - if matchesPolicyRule(digest, &policyRule) { - return true - } - } - return false -} - -func matchesPolicyRule(digest RequestDigest, policyRule *flowcontrol.PolicyRulesWithSubjects) bool { - if !matchesASubject(digest.User, policyRule.Subjects) { - return false - } - if digest.RequestInfo.IsResourceRequest { - return matchesAResourceRule(digest.RequestInfo, policyRule.ResourceRules) - } - return matchesANonResourceRule(digest.RequestInfo, policyRule.NonResourceRules) -} - -func matchesASubject(user user.Info, subjects []flowcontrol.Subject) bool { - for _, subject := range subjects { - if matchesSubject(user, subject) { - return true - } - } - return false -} - -func matchesSubject(user user.Info, subject flowcontrol.Subject) bool { - switch subject.Kind { - case flowcontrol.SubjectKindUser: - return subject.User != nil && (subject.User.Name == flowcontrol.NameAll || subject.User.Name == user.GetName()) - case flowcontrol.SubjectKindGroup: - if subject.Group == nil { - return false - } - seek := subject.Group.Name - if seek == "*" { - return true - } - for _, userGroup := range user.GetGroups() { - if userGroup == seek { - return true - } - } - return false - case flowcontrol.SubjectKindServiceAccount: - if subject.ServiceAccount == nil { - return false - } - if subject.ServiceAccount.Name == flowcontrol.NameAll { - return serviceAccountMatchesNamespace(subject.ServiceAccount.Namespace, user.GetName()) - } - return serviceaccount.MatchesUsername(subject.ServiceAccount.Namespace, subject.ServiceAccount.Name, user.GetName()) - default: - return false - } -} - -// serviceAccountMatchesNamespace checks whether the provided service account username matches the namespace, without -// allocating. Use this when checking a service account namespace against a known string. -// This is copied from `k8s.io/apiserver/pkg/authentication/serviceaccount::MatchesUsername` and simplified to not check the name part. -func serviceAccountMatchesNamespace(namespace string, username string) bool { - const ( - ServiceAccountUsernamePrefix = "system:serviceaccount:" - ServiceAccountUsernameSeparator = ":" - ) - if !strings.HasPrefix(username, ServiceAccountUsernamePrefix) { - return false - } - username = username[len(ServiceAccountUsernamePrefix):] - - if !strings.HasPrefix(username, namespace) { - return false - } - username = username[len(namespace):] - - return strings.HasPrefix(username, ServiceAccountUsernameSeparator) -} - -func matchesAResourceRule(ri *request.RequestInfo, rules []flowcontrol.ResourcePolicyRule) bool { - for _, rr := range rules { - if matchesResourcePolicyRule(ri, rr) { - return true - } - } - return false -} - -func matchesResourcePolicyRule(ri *request.RequestInfo, policyRule flowcontrol.ResourcePolicyRule) bool { - if !matchPolicyRuleVerb(policyRule.Verbs, ri.Verb) { - return false - } - if !matchPolicyRuleResource(policyRule.Resources, ri.Resource, ri.Subresource) { - return false - } - if !matchPolicyRuleAPIGroup(policyRule.APIGroups, ri.APIGroup) { - return false - } - if len(ri.Namespace) == 0 { - return policyRule.ClusterScope - } - return containsString(ri.Namespace, policyRule.Namespaces, flowcontrol.NamespaceEvery) -} - -func matchesANonResourceRule(ri *request.RequestInfo, rules []flowcontrol.NonResourcePolicyRule) bool { - for _, rr := range rules { - if matchesNonResourcePolicyRule(ri, rr) { - return true - } - } - return false -} - -func matchesNonResourcePolicyRule(ri *request.RequestInfo, policyRule flowcontrol.NonResourcePolicyRule) bool { - if !matchPolicyRuleVerb(policyRule.Verbs, ri.Verb) { - return false - } - return matchPolicyRuleNonResourceURL(policyRule.NonResourceURLs, ri.Path) -} - -func matchPolicyRuleVerb(policyRuleVerbs []string, requestVerb string) bool { - return containsString(requestVerb, policyRuleVerbs, flowcontrol.VerbAll) -} - -func matchPolicyRuleNonResourceURL(policyRuleRequestURLs []string, requestPath string) bool { - for _, rulePath := range policyRuleRequestURLs { - if rulePath == flowcontrol.NonResourceAll || rulePath == requestPath { - return true - } - rulePrefix := strings.TrimSuffix(rulePath, "*") - if !strings.HasSuffix(rulePrefix, "/") { - rulePrefix = rulePrefix + "/" - } - if strings.HasPrefix(requestPath, rulePrefix) { - return true - } - } - return false -} - -func matchPolicyRuleAPIGroup(policyRuleAPIGroups []string, requestAPIGroup string) bool { - return containsString(requestAPIGroup, policyRuleAPIGroups, flowcontrol.APIGroupAll) -} - -func rsJoin(requestResource, requestSubresource string) string { - seekString := requestResource - if requestSubresource != "" { - seekString = requestResource + "/" + requestSubresource - } - return seekString -} - -func matchPolicyRuleResource(policyRuleRequestResources []string, requestResource, requestSubresource string) bool { - return containsString(rsJoin(requestResource, requestSubresource), policyRuleRequestResources, flowcontrol.ResourceAll) -} - -// containsString returns true if either `x` or `wildcard` is in -// `list`. The wildcard is not a pattern to match against `x`; rather -// the presence of the wildcard in the list is the caller's way of -// saying that all values of `x` should match the list. This function -// assumes that if `wildcard` is in `list` then it is the only member -// of the list, which is enforced by validation. -func containsString(x string, list []string, wildcard string) bool { - if len(list) == 1 && list[0] == wildcard { - return true - } - for _, y := range list { - if x == y { - return true - } - } - return false -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/watch_tracker.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/watch_tracker.go deleted file mode 100644 index b7b9c886b..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flowcontrol/watch_tracker.go +++ /dev/null @@ -1,233 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flowcontrol - -import ( - "net/http" - "sync" - - metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion" - "k8s.io/apimachinery/pkg/apis/meta/internalversion/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apiserver/pkg/endpoints/request" - - "k8s.io/klog/v2" -) - -// readOnlyVerbs contains verbs for read-only requests. -var readOnlyVerbs = sets.NewString("get", "list", "watch", "proxy") - -// watchIdentifier identifies group of watches that are similar. -// As described in the "Priority and Fairness" KEP, we consider -// watches similar if they have the same resourceType, namespace -// and name. We ignore selectors as they have to be evaluated -// when processing an even anyway. -// -// TODO: For now we only track the number of watches registered -// in our kube-apiserver. Eventually we should consider sharing -// this information with other kube-apiserver as described in the -// KEP, but this isn't part of the first version. -type watchIdentifier struct { - apiGroup string - resource string - namespace string - name string -} - -// ForgetWatchFunc is a function that should be called to forget -// the previously registered watch from the watch tracker. -type ForgetWatchFunc func() - -// WatchTracker is an interface that allows tracking the number -// of watches in the system for the purpose of estimating the -// cost of incoming mutating requests. -type WatchTracker interface { - // RegisterWatch reqisters a watch based on the provided http.Request - // in the tracker. It returns the function that should be called - // to forget the watcher once it is finished. - RegisterWatch(r *http.Request) ForgetWatchFunc - - // GetInterestedWatchCount returns the number of watches that are - // potentially interested in a request with a given RequestInfo - // for the purpose of estimating cost of that request. - GetInterestedWatchCount(requestInfo *request.RequestInfo) int -} - -// builtinIndexes represents of set of indexes registered in -// watchcache that are indexing watches and increase speed of -// their processing. -// We define the indexes as a map from a resource to the path -// to the field in the object on which the index is built. -type builtinIndexes map[string]string - -func getBuiltinIndexes() builtinIndexes { - // The only existing indexes as of now are: - // - spec.nodeName for pods - // - metadata.Name for nodes, secrets and configmaps - // However, we can ignore the latter, because the requestInfo.Name - // is set for them (i.e. we already catch them correctly). - return map[string]string{ - "pods": "spec.nodeName", - } -} - -// watchTracker tracks the number of watches in the system for -// the purpose of estimating the cost of incoming mutating requests. -type watchTracker struct { - // indexes represents a set of registered indexes. - // It can't change after creation. - indexes builtinIndexes - - lock sync.Mutex - watchCount map[watchIdentifier]int -} - -func NewWatchTracker() WatchTracker { - return &watchTracker{ - indexes: getBuiltinIndexes(), - watchCount: make(map[watchIdentifier]int), - } -} - -const ( - unsetValue = "" -) - -func getIndexValue(r *http.Request, field string) string { - opts := metainternalversion.ListOptions{} - if err := scheme.ParameterCodec.DecodeParameters(r.URL.Query(), metav1.SchemeGroupVersion, &opts); err != nil { - klog.Warningf("Couldn't parse list options for %v: %v", r.URL.Query(), err) - return unsetValue - } - if opts.FieldSelector == nil { - return unsetValue - } - if value, ok := opts.FieldSelector.RequiresExactMatch(field); ok { - return value - } - return unsetValue -} - -type indexValue struct { - resource string - value string -} - -// RegisterWatch implements WatchTracker interface. -func (w *watchTracker) RegisterWatch(r *http.Request) ForgetWatchFunc { - requestInfo, ok := request.RequestInfoFrom(r.Context()) - if !ok || requestInfo == nil || requestInfo.Verb != "watch" { - return nil - } - - var index *indexValue - if indexField, ok := w.indexes[requestInfo.Resource]; ok { - index = &indexValue{ - resource: requestInfo.Resource, - value: getIndexValue(r, indexField), - } - } - - identifier := &watchIdentifier{ - apiGroup: requestInfo.APIGroup, - resource: requestInfo.Resource, - namespace: requestInfo.Namespace, - name: requestInfo.Name, - } - - w.lock.Lock() - defer w.lock.Unlock() - w.updateIndexLocked(identifier, index, 1) - return w.forgetWatch(identifier, index) -} - -func (w *watchTracker) updateIndexLocked(identifier *watchIdentifier, index *indexValue, incr int) { - if index == nil { - w.watchCount[*identifier] += incr - } else { - // For resources with defined index, for a given watch event we are - // only processing the watchers that: - // (a) do not specify field selector for an index field - // (b) do specify field selector with the value equal to the value - // coming from the processed object - // - // TODO(wojtek-t): For the sake of making progress and initially - // simplifying the implementation, we approximate (b) for all values - // as the value for an empty string. The assumption we're making here - // is that the difference between the actual number of watchers that - // will be processed, i.e. (a)+(b) above and the one from our - // approximation i.e. (a)+[(b) for field value of ""] will be small. - // This seem to be true in almost all production clusters, which makes - // it a reasonable first step simplification to unblock progres on it. - if index.value == unsetValue || index.value == "" { - w.watchCount[*identifier] += incr - } - } -} - -func (w *watchTracker) forgetWatch(identifier *watchIdentifier, index *indexValue) ForgetWatchFunc { - return func() { - w.lock.Lock() - defer w.lock.Unlock() - - w.updateIndexLocked(identifier, index, -1) - if w.watchCount[*identifier] == 0 { - delete(w.watchCount, *identifier) - } - } -} - -// GetInterestedWatchCount implements WatchTracker interface. -// -// TODO(wojtek-t): As of now, requestInfo for object creation (POST) doesn't -// contain the Name field set. Figure out if we can somehow get it for the -// more accurate cost estimation. -// -// TODO(wojtek-t): Figure out how to approach DELETECOLLECTION calls. -func (w *watchTracker) GetInterestedWatchCount(requestInfo *request.RequestInfo) int { - if requestInfo == nil || readOnlyVerbs.Has(requestInfo.Verb) { - return 0 - } - - result := 0 - // The watches that we're interested in include: - // - watches for all objects of a resource type (no namespace and name specified) - // - watches for all objects of a resource type in the same namespace (no name specified) - // - watched interested in this particular object - identifier := &watchIdentifier{ - apiGroup: requestInfo.APIGroup, - resource: requestInfo.Resource, - } - - w.lock.Lock() - defer w.lock.Unlock() - - result += w.watchCount[*identifier] - - if requestInfo.Namespace != "" { - identifier.namespace = requestInfo.Namespace - result += w.watchCount[*identifier] - } - - if requestInfo.Name != "" { - identifier.name = requestInfo.Name - result += w.watchCount[*identifier] - } - - return result -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flushwriter/doc.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flushwriter/doc.go deleted file mode 100644 index 1e7e324a1..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flushwriter/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -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 flushwriter implements a wrapper for a writer that flushes on every -// write if that writer implements the io.Flusher interface -package flushwriter diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/flushwriter/writer.go b/e2e/vendor/k8s.io/apiserver/pkg/util/flushwriter/writer.go deleted file mode 100644 index 748bd0108..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/flushwriter/writer.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -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 flushwriter - -import ( - "io" - "net/http" -) - -// Wrap wraps an io.Writer into a writer that flushes after every write if -// the writer implements the Flusher interface. -func Wrap(w io.Writer) io.Writer { - fw := &flushWriter{ - writer: w, - } - if flusher, ok := w.(http.Flusher); ok { - fw.flusher = flusher - } - return fw -} - -// flushWriter provides wrapper for responseWriter with HTTP streaming capabilities -type flushWriter struct { - flusher http.Flusher - writer io.Writer -} - -// Write is a FlushWriter implementation of the io.Writer that sends any buffered -// data to the client. -func (fw *flushWriter) Write(p []byte) (n int, err error) { - n, err = fw.writer.Write(p) - if err != nil { - return - } - if fw.flusher != nil { - fw.flusher.Flush() - } - return -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/peerproxy/metrics/metrics.go b/e2e/vendor/k8s.io/apiserver/pkg/util/peerproxy/metrics/metrics.go deleted file mode 100644 index 9b7aee4ea..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/peerproxy/metrics/metrics.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package metrics - -import ( - "context" - "sync" - - "k8s.io/component-base/metrics" - "k8s.io/component-base/metrics/legacyregistry" -) - -const ( - subsystem = "apiserver" - statuscode = "code" -) - -var registerMetricsOnce sync.Once - -var ( - // peerProxiedRequestsTotal counts the number of requests that were proxied to a peer kube-apiserver. - peerProxiedRequestsTotal = metrics.NewCounterVec( - &metrics.CounterOpts{ - Subsystem: subsystem, - Name: "rerouted_request_total", - Help: "Total number of requests that were proxied to a peer kube apiserver because the local apiserver was not capable of serving it", - StabilityLevel: metrics.ALPHA, - }, - []string{statuscode}, - ) -) - -func Register() { - registerMetricsOnce.Do(func() { - legacyregistry.MustRegister(peerProxiedRequestsTotal) - }) -} - -// Only used for tests. -func Reset() { - legacyregistry.Reset() -} - -// IncPeerProxiedRequest increments the # of proxied requests to peer kube-apiserver -func IncPeerProxiedRequest(ctx context.Context, status string) { - peerProxiedRequestsTotal.WithContext(ctx).WithLabelValues(status).Add(1) -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/util/shufflesharding/shufflesharding.go b/e2e/vendor/k8s.io/apiserver/pkg/util/shufflesharding/shufflesharding.go deleted file mode 100644 index 6ef4ed890..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/util/shufflesharding/shufflesharding.go +++ /dev/null @@ -1,107 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package shufflesharding - -import ( - "fmt" - "math" -) - -// MaxHashBits is the max bit length which can be used from hash value. -// If we use all bits of hash value, the critical(last) card shuffled by -// Dealer will be uneven to 2:3 (first half:second half) at most, -// in order to reduce this unevenness to 32:33, we set MaxHashBits to 60 here. -const MaxHashBits = 60 - -// RequiredEntropyBits makes a quick and slightly conservative estimate of the number -// of bits of hash value that are consumed in shuffle sharding a deck of the given size -// to a hand of the given size. The result is meaningful only if -// 1 <= handSize <= deckSize <= 1<<26. -func RequiredEntropyBits(deckSize, handSize int) int { - return int(math.Ceil(math.Log2(float64(deckSize)) * float64(handSize))) -} - -// Dealer contains some necessary parameters and provides some methods for shuffle sharding. -// Dealer is thread-safe. -type Dealer struct { - deckSize int - handSize int -} - -// NewDealer will create a Dealer with the given deckSize and handSize, will return error when -// deckSize or handSize is invalid as below. -// 1. deckSize or handSize is not positive -// 2. handSize is greater than deckSize -// 3. deckSize is impractically large (greater than 1<<26) -// 4. required entropy bits of deckSize and handSize is greater than MaxHashBits -func NewDealer(deckSize, handSize int) (*Dealer, error) { - if deckSize <= 0 || handSize <= 0 { - return nil, fmt.Errorf("deckSize %d or handSize %d is not positive", deckSize, handSize) - } - if handSize > deckSize { - return nil, fmt.Errorf("handSize %d is greater than deckSize %d", handSize, deckSize) - } - if deckSize > 1<<26 { - return nil, fmt.Errorf("deckSize %d is impractically large", deckSize) - } - if RequiredEntropyBits(deckSize, handSize) > MaxHashBits { - return nil, fmt.Errorf("required entropy bits of deckSize %d and handSize %d is greater than %d", deckSize, handSize, MaxHashBits) - } - - return &Dealer{ - deckSize: deckSize, - handSize: handSize, - }, nil -} - -// Deal shuffles a card deck and deals a hand of cards, using the given hashValue as the source of entropy. -// The deck size and hand size are properties of the Dealer. -// This function synchronously makes sequential calls to pick, one for each dealt card. -// Each card is identified by an integer in the range [0, deckSize). -// For example, for deckSize=128 and handSize=4 this function might call pick(14); pick(73); pick(119); pick(26). -func (d *Dealer) Deal(hashValue uint64, pick func(int)) { - // 15 is the largest possible value of handSize - var remainders [15]int - - for i := 0; i < d.handSize; i++ { - hashValueNext := hashValue / uint64(d.deckSize-i) - remainders[i] = int(hashValue - uint64(d.deckSize-i)*hashValueNext) - hashValue = hashValueNext - } - - for i := 0; i < d.handSize; i++ { - card := remainders[i] - for j := i; j > 0; j-- { - if card >= remainders[j-1] { - card++ - } - } - pick(card) - } -} - -// DealIntoHand shuffles and deals according to the Dealer's parameters, -// using the given hashValue as the source of entropy and then -// returns the dealt cards as a slice of `int`. -// If `hand` has the correct length as Dealer's handSize, it will be used as-is and no allocations will be made. -// If `hand` is nil or too small, it will be extended (performing an allocation). -// If `hand` is too large, a sub-slice will be returned. -func (d *Dealer) DealIntoHand(hashValue uint64, hand []int) []int { - h := hand[:0] - d.Deal(hashValue, func(card int) { h = append(h, card) }) - return h -} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/validation/metrics.go b/e2e/vendor/k8s.io/apiserver/pkg/validation/metrics.go deleted file mode 100644 index 256c23c4b..000000000 --- a/e2e/vendor/k8s.io/apiserver/pkg/validation/metrics.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package validation - -import ( - "k8s.io/component-base/metrics" - "k8s.io/component-base/metrics/legacyregistry" -) - -const ( - namespace = "apiserver" // Keep it consistent; apiserver is handling it - subsystem = "validation" -) - -// ValidationMetrics is the interface for validation metrics. -type ValidationMetrics interface { - IncDeclarativeValidationMismatchMetric() - IncDeclarativeValidationPanicMetric() - Reset() -} - -var validationMetricsInstance = &validationMetrics{ - DeclarativeValidationMismatchCounter: metrics.NewCounter( - &metrics.CounterOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "declarative_validation_mismatch_total", - Help: "Number of times declarative validation results differed from handwritten validation results for core types.", - StabilityLevel: metrics.BETA, - }, - ), - DeclarativeValidationPanicCounter: metrics.NewCounter( - &metrics.CounterOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "declarative_validation_panic_total", - Help: "Number of times declarative validation has panicked during validation.", - StabilityLevel: metrics.BETA, - }, - ), -} - -// Metrics provides access to validation metrics. -var Metrics ValidationMetrics = validationMetricsInstance - -func init() { - legacyregistry.MustRegister(validationMetricsInstance.DeclarativeValidationMismatchCounter) - legacyregistry.MustRegister(validationMetricsInstance.DeclarativeValidationPanicCounter) -} - -type validationMetrics struct { - DeclarativeValidationMismatchCounter *metrics.Counter - DeclarativeValidationPanicCounter *metrics.Counter -} - -// Reset resets the validation metrics. -func (m *validationMetrics) Reset() { - m.DeclarativeValidationMismatchCounter.Reset() - m.DeclarativeValidationPanicCounter.Reset() -} - -// IncDeclarativeValidationMismatchMetric increments the counter for the declarative_validation_mismatch_total metric. -func (m *validationMetrics) IncDeclarativeValidationMismatchMetric() { - m.DeclarativeValidationMismatchCounter.Inc() -} - -// IncDeclarativeValidationPanicMetric increments the counter for the declarative_validation_panic_total metric. -func (m *validationMetrics) IncDeclarativeValidationPanicMetric() { - m.DeclarativeValidationPanicCounter.Inc() -} - -func ResetValidationMetricsInstance() { - validationMetricsInstance.Reset() -} diff --git a/e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/buffered.go b/e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/buffered.go deleted file mode 100644 index 07f263b2e..000000000 --- a/e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/buffered.go +++ /dev/null @@ -1,290 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package buffered - -import ( - "fmt" - "sync" - "time" - - "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/wait" - auditinternal "k8s.io/apiserver/pkg/apis/audit" - "k8s.io/apiserver/pkg/audit" - "k8s.io/client-go/util/flowcontrol" -) - -// PluginName is the name reported in error metrics. -const PluginName = "buffered" - -// BatchConfig represents batching delegate audit backend configuration. -type BatchConfig struct { - // BufferSize defines a size of the buffering queue. - BufferSize int - // MaxBatchSize defines maximum size of a batch. - MaxBatchSize int - // MaxBatchWait indicates the maximum interval between two batches. - MaxBatchWait time.Duration - - // ThrottleEnable defines whether throttling will be applied to the batching process. - ThrottleEnable bool - // ThrottleQPS defines the allowed rate of batches per second sent to the delegate backend. - ThrottleQPS float32 - // ThrottleBurst defines the maximum number of requests sent to the delegate backend at the same moment in case - // the capacity defined by ThrottleQPS was not utilized. - ThrottleBurst int - - // Whether the delegate backend should be called asynchronously. - AsyncDelegate bool -} - -type bufferedBackend struct { - // The delegate backend that actually exports events. - delegateBackend audit.Backend - - // Channel to buffer events before sending to the delegate backend. - buffer chan *auditinternal.Event - // Maximum number of events in a batch sent to the delegate backend. - maxBatchSize int - // Amount of time to wait after sending a batch to the delegate backend before sending another one. - // - // Receiving maxBatchSize events will always trigger sending a batch, regardless of the amount of time passed. - maxBatchWait time.Duration - - // Whether the delegate backend should be called asynchronously. - asyncDelegate bool - - // Channel to signal that the batching routine has processed all remaining events and exited. - // Once `shutdownCh` is closed no new events will be sent to the delegate backend. - shutdownCh chan struct{} - - // WaitGroup to control the concurrency of sending batches to the delegate backend. - // Worker routine calls Add before sending a batch and - // then spawns a routine that calls Done after batch was processed by the delegate backend. - // This WaitGroup is used to wait for all sending routines to finish before shutting down audit backend. - wg sync.WaitGroup - - // Limits the number of batches sent to the delegate backend per second. - throttle flowcontrol.RateLimiter -} - -var _ audit.Backend = &bufferedBackend{} - -// NewBackend returns a buffered audit backend that wraps delegate backend. -// Buffered backend automatically runs and shuts down the delegate backend. -func NewBackend(delegate audit.Backend, config BatchConfig) audit.Backend { - var throttle flowcontrol.RateLimiter - if config.ThrottleEnable { - throttle = flowcontrol.NewTokenBucketRateLimiter(config.ThrottleQPS, config.ThrottleBurst) - } - return &bufferedBackend{ - delegateBackend: delegate, - buffer: make(chan *auditinternal.Event, config.BufferSize), - maxBatchSize: config.MaxBatchSize, - maxBatchWait: config.MaxBatchWait, - asyncDelegate: config.AsyncDelegate, - shutdownCh: make(chan struct{}), - wg: sync.WaitGroup{}, - throttle: throttle, - } -} - -func (b *bufferedBackend) Run(stopCh <-chan struct{}) error { - go func() { - // Signal that the working routine has exited. - defer close(b.shutdownCh) - - b.processIncomingEvents(stopCh) - - // Handle the events that were received after the last buffer - // scraping and before this line. Since the buffer is closed, no new - // events will come through. - allEventsProcessed := false - timer := make(chan time.Time) - for !allEventsProcessed { - allEventsProcessed = func() bool { - // Recover from any panic in order to try to process all remaining events. - // Note, that in case of a panic, the return value will be false and - // the loop execution will continue. - defer runtime.HandleCrash() - - events := b.collectEvents(timer, wait.NeverStop) - b.processEvents(events) - return len(events) == 0 - }() - } - }() - return b.delegateBackend.Run(stopCh) -} - -// Shutdown blocks until stopCh passed to the Run method is closed and all -// events added prior to that moment are batched and sent to the delegate backend. -func (b *bufferedBackend) Shutdown() { - // Wait until the routine spawned in Run method exits. - <-b.shutdownCh - - // Wait until all sending routines exit. - // - // - When b.shutdownCh is closed, we know that the goroutine in Run has terminated. - // - This means that processIncomingEvents has terminated. - // - Which means that b.buffer is closed and cannot accept any new events anymore. - // - Because processEvents is called synchronously from the Run goroutine, the waitgroup has its final value. - // Hence wg.Wait will not miss any more outgoing batches. - b.wg.Wait() - - b.delegateBackend.Shutdown() -} - -// processIncomingEvents runs a loop that collects events from the buffer. When -// b.stopCh is closed, processIncomingEvents stops and closes the buffer. -func (b *bufferedBackend) processIncomingEvents(stopCh <-chan struct{}) { - defer close(b.buffer) - - var ( - maxWaitChan <-chan time.Time - maxWaitTimer *time.Timer - ) - // Only use max wait batching if batching is enabled. - if b.maxBatchSize > 1 { - maxWaitTimer = time.NewTimer(b.maxBatchWait) - maxWaitChan = maxWaitTimer.C - defer maxWaitTimer.Stop() - } - - for { - func() { - // Recover from any panics caused by this function so a panic in the - // goroutine can't bring down the main routine. - defer runtime.HandleCrash() - - if b.maxBatchSize > 1 { - maxWaitTimer.Reset(b.maxBatchWait) - } - b.processEvents(b.collectEvents(maxWaitChan, stopCh)) - }() - - select { - case <-stopCh: - return - default: - } - } -} - -// collectEvents attempts to collect some number of events in a batch. -// -// The following things can cause collectEvents to stop and return the list -// of events: -// -// - Maximum number of events for a batch. -// - Timer has passed. -// - Buffer channel is closed and empty. -// - stopCh is closed. -func (b *bufferedBackend) collectEvents(timer <-chan time.Time, stopCh <-chan struct{}) []*auditinternal.Event { - var events []*auditinternal.Event - -L: - for i := 0; i < b.maxBatchSize; i++ { - select { - case ev, ok := <-b.buffer: - // Buffer channel was closed and no new events will follow. - if !ok { - break L - } - events = append(events, ev) - case <-timer: - // Timer has expired. Send currently accumulated batch. - break L - case <-stopCh: - // Backend has been stopped. Send currently accumulated batch. - break L - } - } - - return events -} - -// processEvents process the batch events in a goroutine using delegateBackend's ProcessEvents. -func (b *bufferedBackend) processEvents(events []*auditinternal.Event) { - if len(events) == 0 { - return - } - - // TODO(audit): Should control the number of active goroutines - // if one goroutine takes 5 seconds to finish, the number of goroutines can be 5 * defaultBatchThrottleQPS - if b.throttle != nil { - b.throttle.Accept() - } - - if b.asyncDelegate { - b.wg.Add(1) - go func() { - defer b.wg.Done() - defer runtime.HandleCrash() - - // Execute the real processing in a goroutine to keep it from blocking. - // This lets the batching routine continue draining the queue immediately. - b.delegateBackend.ProcessEvents(events...) - }() - } else { - func() { - defer runtime.HandleCrash() - - // Execute the real processing in a goroutine to keep it from blocking. - // This lets the batching routine continue draining the queue immediately. - b.delegateBackend.ProcessEvents(events...) - }() - } -} - -func (b *bufferedBackend) ProcessEvents(ev ...*auditinternal.Event) bool { - // The following mechanism is in place to support the situation when audit - // events are still coming after the backend was stopped. - var sendErr error - var evIndex int - - // If the delegateBackend was shutdown and the buffer channel was closed, an - // attempt to add an event to it will result in panic that we should - // recover from. - defer func() { - if err := recover(); err != nil { - sendErr = fmt.Errorf("audit backend shut down") - } - if sendErr != nil { - audit.HandlePluginError(PluginName, sendErr, ev[evIndex:]...) - } - }() - - for i, e := range ev { - evIndex = i - // Per the audit.Backend interface these events are reused after being - // sent to the Sink. Deep copy and send the copy to the queue. - event := e.DeepCopy() - - select { - case b.buffer <- event: - default: - sendErr = fmt.Errorf("audit buffer queue blocked") - return true - } - } - return true -} - -func (b *bufferedBackend) String() string { - return fmt.Sprintf("%s<%s>", PluginName, b.delegateBackend) -} diff --git a/e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/doc.go b/e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/doc.go deleted file mode 100644 index 933eacc8d..000000000 --- a/e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/buffered/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package buffered provides an implementation for the audit.Backend interface -// that batches incoming audit events and sends batches to the delegate audit.Backend. -package buffered diff --git a/e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/log/backend.go b/e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/log/backend.go deleted file mode 100644 index 2ef2cc6ec..000000000 --- a/e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/log/backend.go +++ /dev/null @@ -1,104 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package log - -import ( - "fmt" - "io" - "strings" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - auditinternal "k8s.io/apiserver/pkg/apis/audit" - "k8s.io/apiserver/pkg/audit" -) - -const ( - // FormatLegacy saves event in 1-line text format. - FormatLegacy = "legacy" - // FormatJson saves event in structured json format. - FormatJson = "json" - - // PluginName is the name of this plugin, to be used in help and logs. - PluginName = "log" -) - -// AllowedFormats are the formats known by log backend. -var AllowedFormats = []string{ - FormatLegacy, - FormatJson, -} - -type backend struct { - out io.Writer - format string - encoder runtime.Encoder -} - -var _ audit.Backend = &backend{} - -func NewBackend(out io.Writer, format string, groupVersion schema.GroupVersion) audit.Backend { - return &backend{ - out: out, - format: format, - encoder: audit.Codecs.LegacyCodec(groupVersion), - } -} - -func (b *backend) ProcessEvents(events ...*auditinternal.Event) bool { - success := true - for _, ev := range events { - success = b.logEvent(ev) && success - } - return success -} - -func (b *backend) logEvent(ev *auditinternal.Event) bool { - line := "" - switch b.format { - case FormatLegacy: - line = audit.EventString(ev) + "\n" - case FormatJson: - bs, err := runtime.Encode(b.encoder, ev) - if err != nil { - audit.HandlePluginError(PluginName, err, ev) - return false - } - line = string(bs[:]) - default: - audit.HandlePluginError(PluginName, fmt.Errorf("log format %q is not in list of known formats (%s)", - b.format, strings.Join(AllowedFormats, ",")), ev) - return false - } - if _, err := fmt.Fprint(b.out, line); err != nil { - audit.HandlePluginError(PluginName, err, ev) - return false - } - return true -} - -func (b *backend) Run(stopCh <-chan struct{}) error { - return nil -} - -func (b *backend) Shutdown() { - // Nothing to do here. -} - -func (b *backend) String() string { - return PluginName -} diff --git a/e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/truncate/doc.go b/e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/truncate/doc.go deleted file mode 100644 index 3157218eb..000000000 --- a/e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/truncate/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package truncate provides an implementation for the audit.Backend interface -// that truncates audit events and sends them to the delegate audit.Backend. -package truncate diff --git a/e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/truncate/truncate.go b/e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/truncate/truncate.go deleted file mode 100644 index 42a40e3eb..000000000 --- a/e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/truncate/truncate.go +++ /dev/null @@ -1,165 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package truncate - -import ( - "fmt" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - utilerrors "k8s.io/apimachinery/pkg/util/errors" - auditinternal "k8s.io/apiserver/pkg/apis/audit" - "k8s.io/apiserver/pkg/audit" -) - -const ( - // PluginName is the name reported in error metrics. - PluginName = "truncate" - - // annotationKey defines the name of the annotation used to indicate truncation. - annotationKey = "audit.k8s.io/truncated" - // annotationValue defines the value of the annotation used to indicate truncation. - annotationValue = "true" -) - -// Config represents truncating backend configuration. -type Config struct { - // MaxEventSize defines max allowed size of the event. If the event is larger, - // truncating will be performed. - MaxEventSize int64 - - // MaxBatchSize defined max allowed size of the batch of events, passed to the backend. - // If the total size of the batch is larger than this number, batch will be split. Actual - // size of the serialized request might be slightly higher, on the order of hundreds of bytes. - MaxBatchSize int64 -} - -type backend struct { - // The delegate backend that actually exports events. - delegateBackend audit.Backend - - // Configuration used for truncation. - c Config - - // Encoder used to calculate audit event sizes. - e runtime.Encoder -} - -var _ audit.Backend = &backend{} - -// NewBackend returns a new truncating backend, using configuration passed in the parameters. -// Truncate backend automatically runs and shut downs the delegate backend. -func NewBackend(delegateBackend audit.Backend, config Config, groupVersion schema.GroupVersion) audit.Backend { - return &backend{ - delegateBackend: delegateBackend, - c: config, - e: audit.Codecs.LegacyCodec(groupVersion), - } -} - -func (b *backend) ProcessEvents(events ...*auditinternal.Event) bool { - var errors []error - var impacted []*auditinternal.Event - var batch []*auditinternal.Event - var batchSize int64 - success := true - for _, event := range events { - size, err := b.calcSize(event) - // If event was correctly serialized, but the size is more than allowed - // and it makes sense to do trimming, i.e. there's a request and/or - // response present, try to strip away request and response. - if err == nil && size > b.c.MaxEventSize && event.Level.GreaterOrEqual(auditinternal.LevelRequest) { - event = truncate(event) - size, err = b.calcSize(event) - } - if err != nil { - errors = append(errors, err) - impacted = append(impacted, event) - continue - } - if size > b.c.MaxEventSize { - errors = append(errors, fmt.Errorf("event is too large even after truncating")) - impacted = append(impacted, event) - continue - } - - if len(batch) > 0 && batchSize+size > b.c.MaxBatchSize { - success = b.delegateBackend.ProcessEvents(batch...) && success - batch = []*auditinternal.Event{} - batchSize = 0 - } - - batchSize += size - batch = append(batch, event) - } - - if len(batch) > 0 { - success = b.delegateBackend.ProcessEvents(batch...) && success - } - - if len(impacted) > 0 { - audit.HandlePluginError(PluginName, utilerrors.NewAggregate(errors), impacted...) - } - return success -} - -// truncate removed request and response objects from the audit events, -// to try and keep at least metadata. -func truncate(e *auditinternal.Event) *auditinternal.Event { - // Make a shallow copy to avoid copying response/request objects. - newEvent := &auditinternal.Event{} - *newEvent = *e - - newEvent.RequestObject = nil - newEvent.ResponseObject = nil - - if newEvent.Annotations == nil { - newEvent.Annotations = make(map[string]string) - } - newEvent.Annotations[annotationKey] = annotationValue - - return newEvent -} - -func (b *backend) Run(stopCh <-chan struct{}) error { - return b.delegateBackend.Run(stopCh) -} - -func (b *backend) Shutdown() { - b.delegateBackend.Shutdown() -} - -func (b *backend) calcSize(e *auditinternal.Event) (int64, error) { - s := &sizer{} - if err := b.e.Encode(e, s); err != nil { - return 0, err - } - return s.Size, nil -} - -func (b *backend) String() string { - return fmt.Sprintf("%s<%s>", PluginName, b.delegateBackend) -} - -type sizer struct { - Size int64 -} - -func (s *sizer) Write(p []byte) (n int, err error) { - s.Size += int64(len(p)) - return len(p), nil -} diff --git a/e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook.go b/e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook.go deleted file mode 100644 index 6355df403..000000000 --- a/e2e/vendor/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook.go +++ /dev/null @@ -1,146 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package webhook implements the audit.Backend interface using HTTP webhooks. -package webhook - -import ( - "context" - "fmt" - "time" - - "go.opentelemetry.io/otel/attribute" - - "k8s.io/apimachinery/pkg/runtime/schema" - utilnet "k8s.io/apimachinery/pkg/util/net" - "k8s.io/apimachinery/pkg/util/wait" - auditinternal "k8s.io/apiserver/pkg/apis/audit" - "k8s.io/apiserver/pkg/apis/audit/install" - "k8s.io/apiserver/pkg/audit" - "k8s.io/apiserver/pkg/util/webhook" - "k8s.io/client-go/rest" - "k8s.io/component-base/tracing" -) - -const ( - // PluginName is the name of this plugin, to be used in help and logs. - PluginName = "webhook" - - // DefaultInitialBackoffDelay is the default amount of time to wait before - // retrying sending audit events through a webhook. - DefaultInitialBackoffDelay = 10 * time.Second -) - -func init() { - install.Install(audit.Scheme) -} - -// retryOnError enforces the webhook client to retry requests -// on error regardless of its nature. -// The default implementation considers a very limited set of -// 'retriable' errors, assuming correct use of HTTP codes by -// external webhooks. -// That may easily lead to dropped audit events. In fact, there is -// hardly any error that could be a justified reason NOT to retry -// sending audit events if there is even a slight chance that the -// receiving service gets back to normal at some point. -func retryOnError(err error) bool { - if err != nil { - return true - } - return false -} - -func loadWebhook(configFile string, groupVersion schema.GroupVersion, retryBackoff wait.Backoff, customDial utilnet.DialFunc) (*webhook.GenericWebhook, error) { - clientConfig, err := webhook.LoadKubeconfig(configFile, customDial) - if err != nil { - return nil, err - } - w, err := webhook.NewGenericWebhook(audit.Scheme, audit.Codecs, clientConfig, - []schema.GroupVersion{groupVersion}, retryBackoff) - if err != nil { - return nil, err - } - - w.ShouldRetry = retryOnError - return w, nil -} - -type backend struct { - w *webhook.GenericWebhook - name string -} - -// NewDynamicBackend returns an audit backend configured from a REST client that -// sends events over HTTP to an external service. -func NewDynamicBackend(rc *rest.RESTClient, retryBackoff wait.Backoff) audit.Backend { - return &backend{ - w: &webhook.GenericWebhook{ - RestClient: rc, - RetryBackoff: retryBackoff, - ShouldRetry: retryOnError, - }, - name: fmt.Sprintf("dynamic_%s", PluginName), - } -} - -// NewBackend returns an audit backend that sends events over HTTP to an external service. -func NewBackend(kubeConfigFile string, groupVersion schema.GroupVersion, retryBackoff wait.Backoff, customDial utilnet.DialFunc) (audit.Backend, error) { - w, err := loadWebhook(kubeConfigFile, groupVersion, retryBackoff, customDial) - if err != nil { - return nil, err - } - return &backend{w: w, name: PluginName}, nil -} - -func (b *backend) Run(stopCh <-chan struct{}) error { - return nil -} - -func (b *backend) Shutdown() { - // nothing to do here -} - -func (b *backend) ProcessEvents(ev ...*auditinternal.Event) bool { - if err := b.processEvents(ev...); err != nil { - audit.HandlePluginError(b.String(), err, ev...) - return false - } - return true -} - -func (b *backend) processEvents(ev ...*auditinternal.Event) error { - var list auditinternal.EventList - for _, e := range ev { - list.Items = append(list.Items, *e) - } - return b.w.WithExponentialBackoff(context.Background(), func() rest.Result { - ctx, span := tracing.Start(context.Background(), "Call Audit Events webhook", - attribute.String("name", b.name), - attribute.Int("event-count", len(list.Items)), - ) - // Only log audit webhook traces that exceed a 25ms per object limit plus a 50ms - // request overhead allowance. The high per object limit used here is primarily to - // allow enough time for the serialization/deserialization of audit events, which - // contain nested request and response objects plus additional event fields. - defer span.End(time.Duration(50+25*len(list.Items)) * time.Millisecond) - return b.w.RestClient.Post().Body(&list).Do(ctx) - }).Error() -} - -func (b *backend) String() string { - return b.name -} diff --git a/e2e/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/metrics.go b/e2e/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/metrics.go deleted file mode 100644 index 32e469e80..000000000 --- a/e2e/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/metrics.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package webhook - -import ( - "context" -) - -// AuthenticatorMetrics specifies a set of methods that are used to register various metrics -type AuthenticatorMetrics struct { - // RecordRequestTotal increments the total number of requests for webhooks - RecordRequestTotal func(ctx context.Context, code string) - - // RecordRequestLatency measures request latency in seconds for webhooks. Broken down by status code. - RecordRequestLatency func(ctx context.Context, code string, latency float64) -} - -type noopMetrics struct{} - -func (noopMetrics) RequestTotal(context.Context, string) {} -func (noopMetrics) RequestLatency(context.Context, string, float64) {} diff --git a/e2e/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/webhook.go b/e2e/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/webhook.go deleted file mode 100644 index 7d19b4b7a..000000000 --- a/e2e/vendor/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/webhook.go +++ /dev/null @@ -1,327 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package webhook implements the authenticator.Token interface using HTTP webhooks. -package webhook - -import ( - "context" - "errors" - "fmt" - "strconv" - "time" - - authenticationv1 "k8s.io/api/authentication/v1" - authenticationv1beta1 "k8s.io/api/authentication/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apiserver/pkg/authentication/authenticator" - "k8s.io/apiserver/pkg/authentication/user" - "k8s.io/apiserver/pkg/util/webhook" - "k8s.io/client-go/kubernetes/scheme" - authenticationv1client "k8s.io/client-go/kubernetes/typed/authentication/v1" - "k8s.io/client-go/rest" - "k8s.io/klog/v2" -) - -// DefaultRetryBackoff returns the default backoff parameters for webhook retry. -func DefaultRetryBackoff() *wait.Backoff { - backoff := webhook.DefaultRetryBackoffWithInitialDelay(500 * time.Millisecond) - return &backoff -} - -// Ensure WebhookTokenAuthenticator implements the authenticator.Token interface. -var _ authenticator.Token = (*WebhookTokenAuthenticator)(nil) - -type tokenReviewer interface { - Create(ctx context.Context, review *authenticationv1.TokenReview, _ metav1.CreateOptions) (*authenticationv1.TokenReview, int, error) -} - -type WebhookTokenAuthenticator struct { - tokenReview tokenReviewer - retryBackoff wait.Backoff - implicitAuds authenticator.Audiences - requestTimeout time.Duration - metrics AuthenticatorMetrics -} - -// NewFromInterface creates a webhook authenticator using the given tokenReview -// client. It is recommend to wrap this authenticator with the token cache -// authenticator implemented in -// k8s.io/apiserver/pkg/authentication/token/cache. -func NewFromInterface(tokenReview authenticationv1client.AuthenticationV1Interface, implicitAuds authenticator.Audiences, retryBackoff wait.Backoff, requestTimeout time.Duration, metrics AuthenticatorMetrics) (*WebhookTokenAuthenticator, error) { - tokenReviewClient := &tokenReviewV1Client{tokenReview.RESTClient()} - return newWithBackoff(tokenReviewClient, retryBackoff, implicitAuds, requestTimeout, metrics) -} - -// New creates a new WebhookTokenAuthenticator from the provided rest -// config. It is recommend to wrap this authenticator with the token cache -// authenticator implemented in -// k8s.io/apiserver/pkg/authentication/token/cache. -func New(config *rest.Config, version string, implicitAuds authenticator.Audiences, retryBackoff wait.Backoff) (*WebhookTokenAuthenticator, error) { - tokenReview, err := tokenReviewInterfaceFromConfig(config, version, retryBackoff) - if err != nil { - return nil, err - } - return newWithBackoff(tokenReview, retryBackoff, implicitAuds, time.Duration(0), AuthenticatorMetrics{ - RecordRequestTotal: noopMetrics{}.RequestTotal, - RecordRequestLatency: noopMetrics{}.RequestLatency, - }) -} - -// newWithBackoff allows tests to skip the sleep. -func newWithBackoff(tokenReview tokenReviewer, retryBackoff wait.Backoff, implicitAuds authenticator.Audiences, requestTimeout time.Duration, metrics AuthenticatorMetrics) (*WebhookTokenAuthenticator, error) { - return &WebhookTokenAuthenticator{ - tokenReview, - retryBackoff, - implicitAuds, - requestTimeout, - metrics, - }, nil -} - -// AuthenticateToken implements the authenticator.Token interface. -func (w *WebhookTokenAuthenticator) AuthenticateToken(ctx context.Context, token string) (*authenticator.Response, bool, error) { - // We take implicit audiences of the API server at WebhookTokenAuthenticator - // construction time. The outline of how we validate audience here is: - // - // * if the ctx is not audience limited, don't do any audience validation. - // * if ctx is audience-limited, add the audiences to the tokenreview spec - // * if the tokenreview returns with audiences in the status that intersect - // with the audiences in the ctx, copy into the response and return success - // * if the tokenreview returns without an audience in the status, ensure - // the ctx audiences intersect with the implicit audiences, and set the - // intersection in the response. - // * otherwise return unauthenticated. - wantAuds, checkAuds := authenticator.AudiencesFrom(ctx) - r := &authenticationv1.TokenReview{ - Spec: authenticationv1.TokenReviewSpec{ - Token: token, - Audiences: wantAuds, - }, - } - var ( - result *authenticationv1.TokenReview - auds authenticator.Audiences - cancel context.CancelFunc - ) - - // set a hard timeout if it was defined - // if the child has a shorter deadline then it will expire first, - // otherwise if the parent has a shorter deadline then the parent will expire and it will be propagate to the child - if w.requestTimeout > 0 { - ctx, cancel = context.WithTimeout(ctx, w.requestTimeout) - defer cancel() - } - - // WithExponentialBackoff will return tokenreview create error (tokenReviewErr) if any. - if err := webhook.WithExponentialBackoff(ctx, w.retryBackoff, func() error { - var tokenReviewErr error - var statusCode int - - start := time.Now() - result, statusCode, tokenReviewErr = w.tokenReview.Create(ctx, r, metav1.CreateOptions{}) - latency := time.Since(start) - - if statusCode != 0 { - w.metrics.RecordRequestTotal(ctx, strconv.Itoa(statusCode)) - w.metrics.RecordRequestLatency(ctx, strconv.Itoa(statusCode), latency.Seconds()) - return tokenReviewErr - } - - if tokenReviewErr != nil { - w.metrics.RecordRequestTotal(ctx, "") - w.metrics.RecordRequestLatency(ctx, "", latency.Seconds()) - } - return tokenReviewErr - }, webhook.DefaultShouldRetry); err != nil { - // An error here indicates bad configuration or an outage. Log for debugging. - klog.Errorf("Failed to make webhook authenticator request: %v", err) - return nil, false, err - } - - if checkAuds { - gotAuds := w.implicitAuds - if len(result.Status.Audiences) > 0 { - gotAuds = result.Status.Audiences - } - auds = wantAuds.Intersect(gotAuds) - if len(auds) == 0 { - return nil, false, nil - } - } - - r.Status = result.Status - if !r.Status.Authenticated { - var err error - if len(r.Status.Error) != 0 { - err = errors.New(r.Status.Error) - } - return nil, false, err - } - - var extra map[string][]string - if r.Status.User.Extra != nil { - extra = map[string][]string{} - for k, v := range r.Status.User.Extra { - extra[k] = v - } - } - - return &authenticator.Response{ - User: &user.DefaultInfo{ - Name: r.Status.User.Username, - UID: r.Status.User.UID, - Groups: r.Status.User.Groups, - Extra: extra, - }, - Audiences: auds, - }, true, nil -} - -// tokenReviewInterfaceFromConfig builds a client from the specified kubeconfig file, -// and returns a TokenReviewInterface that uses that client. Note that the client submits TokenReview -// requests to the exact path specified in the kubeconfig file, so arbitrary non-API servers can be targeted. -func tokenReviewInterfaceFromConfig(config *rest.Config, version string, retryBackoff wait.Backoff) (tokenReviewer, error) { - localScheme := runtime.NewScheme() - if err := scheme.AddToScheme(localScheme); err != nil { - return nil, err - } - - switch version { - case authenticationv1.SchemeGroupVersion.Version: - groupVersions := []schema.GroupVersion{authenticationv1.SchemeGroupVersion} - if err := localScheme.SetVersionPriority(groupVersions...); err != nil { - return nil, err - } - gw, err := webhook.NewGenericWebhook(localScheme, scheme.Codecs, config, groupVersions, retryBackoff) - if err != nil { - return nil, err - } - return &tokenReviewV1ClientGW{gw.RestClient}, nil - - case authenticationv1beta1.SchemeGroupVersion.Version: - groupVersions := []schema.GroupVersion{authenticationv1beta1.SchemeGroupVersion} - if err := localScheme.SetVersionPriority(groupVersions...); err != nil { - return nil, err - } - gw, err := webhook.NewGenericWebhook(localScheme, scheme.Codecs, config, groupVersions, retryBackoff) - if err != nil { - return nil, err - } - return &tokenReviewV1beta1ClientGW{gw.RestClient}, nil - - default: - return nil, fmt.Errorf( - "unsupported authentication webhook version %q, supported versions are %q, %q", - version, - authenticationv1.SchemeGroupVersion.Version, - authenticationv1beta1.SchemeGroupVersion.Version, - ) - } - -} - -type tokenReviewV1Client struct { - client rest.Interface -} - -// Create takes the representation of a tokenReview and creates it. Returns the server's representation of the tokenReview, HTTP status code and an error, if there is any. -func (c *tokenReviewV1Client) Create(ctx context.Context, tokenReview *authenticationv1.TokenReview, opts metav1.CreateOptions) (result *authenticationv1.TokenReview, statusCode int, err error) { - result = &authenticationv1.TokenReview{} - - restResult := c.client.Post(). - Resource("tokenreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(tokenReview). - Do(ctx) - - restResult.StatusCode(&statusCode) - err = restResult.Into(result) - return -} - -// tokenReviewV1ClientGW used by the generic webhook, doesn't specify GVR. -type tokenReviewV1ClientGW struct { - client rest.Interface -} - -// Create takes the representation of a tokenReview and creates it. Returns the server's representation of the tokenReview, HTTP status code and an error, if there is any. -func (c *tokenReviewV1ClientGW) Create(ctx context.Context, tokenReview *authenticationv1.TokenReview, opts metav1.CreateOptions) (result *authenticationv1.TokenReview, statusCode int, err error) { - result = &authenticationv1.TokenReview{} - - restResult := c.client.Post(). - Body(tokenReview). - Do(ctx) - - restResult.StatusCode(&statusCode) - err = restResult.Into(result) - return -} - -// tokenReviewV1beta1ClientGW used by the generic webhook, doesn't specify GVR. -type tokenReviewV1beta1ClientGW struct { - client rest.Interface -} - -func (t *tokenReviewV1beta1ClientGW) Create(ctx context.Context, review *authenticationv1.TokenReview, _ metav1.CreateOptions) (*authenticationv1.TokenReview, int, error) { - var statusCode int - v1beta1Review := &authenticationv1beta1.TokenReview{Spec: v1SpecToV1beta1Spec(&review.Spec)} - v1beta1Result := &authenticationv1beta1.TokenReview{} - - restResult := t.client.Post().Body(v1beta1Review).Do(ctx) - restResult.StatusCode(&statusCode) - err := restResult.Into(v1beta1Result) - if err != nil { - return nil, statusCode, err - } - review.Status = v1beta1StatusToV1Status(&v1beta1Result.Status) - return review, statusCode, nil -} - -func v1SpecToV1beta1Spec(in *authenticationv1.TokenReviewSpec) authenticationv1beta1.TokenReviewSpec { - return authenticationv1beta1.TokenReviewSpec{ - Token: in.Token, - Audiences: in.Audiences, - } -} - -func v1beta1StatusToV1Status(in *authenticationv1beta1.TokenReviewStatus) authenticationv1.TokenReviewStatus { - return authenticationv1.TokenReviewStatus{ - Authenticated: in.Authenticated, - User: v1beta1UserToV1User(in.User), - Audiences: in.Audiences, - Error: in.Error, - } -} - -func v1beta1UserToV1User(u authenticationv1beta1.UserInfo) authenticationv1.UserInfo { - var extra map[string]authenticationv1.ExtraValue - if u.Extra != nil { - extra = make(map[string]authenticationv1.ExtraValue, len(u.Extra)) - for k, v := range u.Extra { - extra[k] = authenticationv1.ExtraValue(v) - } - } - return authenticationv1.UserInfo{ - Username: u.Username, - UID: u.UID, - Groups: u.Groups, - Extra: extra, - } -} diff --git a/e2e/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/gencerts.sh b/e2e/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/gencerts.sh deleted file mode 100644 index a66f8f381..000000000 --- a/e2e/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/gencerts.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2016 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e - -# gencerts.sh generates the certificates for the webhook authz plugin tests. -# -# It is not expected to be run often (there is no go generate rule), and mainly -# exists for documentation purposes. - -cat > server.conf << EOF -[req] -req_extensions = v3_req -distinguished_name = req_distinguished_name -[req_distinguished_name] -[ v3_req ] -basicConstraints = CA:FALSE -keyUsage = nonRepudiation, digitalSignature, keyEncipherment -extendedKeyUsage = serverAuth -subjectAltName = @alt_names -[alt_names] -IP.1 = 127.0.0.1 -EOF - -cat > client.conf << EOF -[req] -req_extensions = v3_req -distinguished_name = req_distinguished_name -[req_distinguished_name] -[ v3_req ] -basicConstraints = CA:FALSE -keyUsage = nonRepudiation, digitalSignature, keyEncipherment -extendedKeyUsage = clientAuth -EOF - -# Create a certificate authority -openssl genrsa -out caKey.pem 2048 -openssl req -x509 -new -nodes -key caKey.pem -days 100000 -out caCert.pem -subj "/CN=webhook_authz_ca" - -# Create a second certificate authority -openssl genrsa -out badCAKey.pem 2048 -openssl req -x509 -new -nodes -key badCAKey.pem -days 100000 -out badCACert.pem -subj "/CN=webhook_authz_ca" - -# Create a server certiticate -openssl genrsa -out serverKey.pem 2048 -openssl req -new -key serverKey.pem -out server.csr -subj "/CN=webhook_authz_server" -config server.conf -openssl x509 -req -in server.csr -CA caCert.pem -CAkey caKey.pem -CAcreateserial -out serverCert.pem -days 100000 -extensions v3_req -extfile server.conf - -# Create a client certiticate -openssl genrsa -out clientKey.pem 2048 -openssl req -new -key clientKey.pem -out client.csr -subj "/CN=webhook_authz_client" -config client.conf -openssl x509 -req -in client.csr -CA caCert.pem -CAkey caKey.pem -CAcreateserial -out clientCert.pem -days 100000 -extensions v3_req -extfile client.conf - -outfile=certs_test.go - -cat > $outfile << EOF -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was generated using openssl by the gencerts.sh script -// and holds raw certificates for the webhook tests. - -package webhook -EOF - -for file in caKey caCert badCAKey badCACert serverKey serverCert clientKey clientCert; do - data=$(cat ${file}.pem) - echo "" >> $outfile - echo "var $file = []byte(\`$data\`)" >> $outfile -done - -# Clean up after we're done. -rm ./*.pem -rm ./*.csr -rm ./*.srl -rm ./*.conf diff --git a/e2e/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/metrics/metrics.go b/e2e/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/metrics/metrics.go deleted file mode 100644 index 23f82cc65..000000000 --- a/e2e/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/metrics/metrics.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package metrics - -import ( - "context" - "sync" - - "k8s.io/apiserver/pkg/authorization/cel" - compbasemetrics "k8s.io/component-base/metrics" - "k8s.io/component-base/metrics/legacyregistry" -) - -// AuthorizerMetrics specifies a set of methods that are used to register various metrics for the webhook authorizer -type AuthorizerMetrics interface { - // Request total and latency metrics - RequestMetrics - // Webhook count, latency, and fail open metrics - WebhookMetrics - // match condition metrics - cel.MatcherMetrics -} - -type NoopAuthorizerMetrics struct { - NoopRequestMetrics - NoopWebhookMetrics - cel.NoopMatcherMetrics -} - -type RequestMetrics interface { - // RecordRequestTotal increments the total number of requests for the webhook authorizer - RecordRequestTotal(ctx context.Context, code string) - - // RecordRequestLatency measures request latency in seconds for webhooks. Broken down by status code. - RecordRequestLatency(ctx context.Context, code string, latency float64) -} - -type NoopRequestMetrics struct{} - -func (NoopRequestMetrics) RecordRequestTotal(context.Context, string) {} -func (NoopRequestMetrics) RecordRequestLatency(context.Context, string, float64) {} - -type WebhookMetrics interface { - // RecordWebhookEvaluation increments with each round-trip of a webhook authorizer. - // result is one of: - // - canceled: the call invoking the webhook request was canceled - // - timeout: the webhook request timed out - // - error: the webhook response completed and was invalid - // - success: the webhook response completed and was well-formed - RecordWebhookEvaluation(ctx context.Context, name, result string) - // RecordWebhookDuration records latency for each round-trip of a webhook authorizer. - // result is one of: - // - canceled: the call invoking the webhook request was canceled - // - timeout: the webhook request timed out - // - error: the webhook response completed and was invalid - // - success: the webhook response completed and was well-formed - RecordWebhookDuration(ctx context.Context, name, result string, duration float64) - // RecordWebhookFailOpen increments when a webhook timeout or error results in a fail open - // of a request which has not been canceled. - // result is one of: - // - timeout: the webhook request timed out - // - error: the webhook response completed and was invalid - RecordWebhookFailOpen(ctx context.Context, name, result string) -} - -type NoopWebhookMetrics struct{} - -func (NoopWebhookMetrics) RecordWebhookEvaluation(ctx context.Context, name, result string) {} -func (NoopWebhookMetrics) RecordWebhookDuration(ctx context.Context, name, result string, duration float64) { -} -func (NoopWebhookMetrics) RecordWebhookFailOpen(ctx context.Context, name, result string) {} - -var registerWebhookMetrics sync.Once - -// RegisterMetrics registers authorizer metrics. -func RegisterWebhookMetrics() { - registerWebhookMetrics.Do(func() { - legacyregistry.MustRegister(webhookEvaluations) - legacyregistry.MustRegister(webhookDuration) - legacyregistry.MustRegister(webhookFailOpen) - }) -} - -func ResetMetricsForTest() { - webhookEvaluations.Reset() - webhookDuration.Reset() - webhookFailOpen.Reset() -} - -const ( - namespace = "apiserver" - subsystem = "authorization" -) - -var ( - webhookEvaluations = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "webhook_evaluations_total", - Help: "Round-trips to authorization webhooks.", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"name", "result"}, - ) - - webhookDuration = compbasemetrics.NewHistogramVec( - &compbasemetrics.HistogramOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "webhook_duration_seconds", - Help: "Request latency in seconds.", - Buckets: compbasemetrics.DefBuckets, - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"name", "result"}, - ) - - webhookFailOpen = compbasemetrics.NewCounterVec( - &compbasemetrics.CounterOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "webhook_evaluations_fail_open_total", - Help: "NoOpinion results due to webhook timeout or error.", - StabilityLevel: compbasemetrics.ALPHA, - }, - []string{"name", "result"}, - ) -) - -type webhookMetrics struct{} - -func NewWebhookMetrics() WebhookMetrics { - RegisterWebhookMetrics() - return webhookMetrics{} -} - -func ResetWebhookMetricsForTest() { - webhookEvaluations.Reset() - webhookDuration.Reset() - webhookFailOpen.Reset() -} - -func (webhookMetrics) RecordWebhookEvaluation(ctx context.Context, name, result string) { - webhookEvaluations.WithContext(ctx).WithLabelValues(name, result).Inc() -} -func (webhookMetrics) RecordWebhookDuration(ctx context.Context, name, result string, duration float64) { - webhookDuration.WithContext(ctx).WithLabelValues(name, result).Observe(duration) -} -func (webhookMetrics) RecordWebhookFailOpen(ctx context.Context, name, result string) { - webhookFailOpen.WithContext(ctx).WithLabelValues(name, result).Inc() -} diff --git a/e2e/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook.go b/e2e/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook.go deleted file mode 100644 index 3df8e580e..000000000 --- a/e2e/vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook.go +++ /dev/null @@ -1,605 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package webhook implements the authorizer.Authorizer interface using HTTP webhooks. -package webhook - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/http" - "strconv" - "time" - - authorizationv1 "k8s.io/api/authorization/v1" - authorizationv1beta1 "k8s.io/api/authorization/v1beta1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/selection" - "k8s.io/apimachinery/pkg/util/cache" - utilnet "k8s.io/apimachinery/pkg/util/net" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apiserver/pkg/apis/apiserver" - apiservervalidation "k8s.io/apiserver/pkg/apis/apiserver/validation" - "k8s.io/apiserver/pkg/authentication/user" - "k8s.io/apiserver/pkg/authorization/authorizer" - authorizationcel "k8s.io/apiserver/pkg/authorization/cel" - genericfeatures "k8s.io/apiserver/pkg/features" - utilfeature "k8s.io/apiserver/pkg/util/feature" - "k8s.io/apiserver/pkg/util/webhook" - "k8s.io/apiserver/plugin/pkg/authorizer/webhook/metrics" - "k8s.io/client-go/kubernetes/scheme" - authorizationv1client "k8s.io/client-go/kubernetes/typed/authorization/v1" - "k8s.io/client-go/rest" - "k8s.io/klog/v2" -) - -const ( - // The maximum length of requester-controlled attributes to allow caching. - maxControlledAttrCacheSize = 10000 -) - -// DefaultRetryBackoff returns the default backoff parameters for webhook retry. -func DefaultRetryBackoff() *wait.Backoff { - backoff := webhook.DefaultRetryBackoffWithInitialDelay(500 * time.Millisecond) - return &backoff -} - -// Ensure Webhook implements the authorizer.Authorizer interface. -var _ authorizer.Authorizer = (*WebhookAuthorizer)(nil) - -type subjectAccessReviewer interface { - Create(context.Context, *authorizationv1.SubjectAccessReview, metav1.CreateOptions) (*authorizationv1.SubjectAccessReview, int, error) -} - -type WebhookAuthorizer struct { - subjectAccessReview subjectAccessReviewer - responseCache *cache.LRUExpireCache - authorizedTTL time.Duration - unauthorizedTTL time.Duration - retryBackoff wait.Backoff - decisionOnError authorizer.Decision - metrics metrics.AuthorizerMetrics - celMatcher *authorizationcel.CELMatcher - name string -} - -// NewFromInterface creates a WebhookAuthorizer using the given subjectAccessReview client -func NewFromInterface(subjectAccessReview authorizationv1client.AuthorizationV1Interface, authorizedTTL, unauthorizedTTL time.Duration, retryBackoff wait.Backoff, decisionOnError authorizer.Decision, metrics metrics.AuthorizerMetrics, compiler authorizationcel.Compiler) (*WebhookAuthorizer, error) { - return newWithBackoff(&subjectAccessReviewV1Client{subjectAccessReview.RESTClient()}, authorizedTTL, unauthorizedTTL, retryBackoff, decisionOnError, nil, metrics, compiler, "") -} - -// New creates a new WebhookAuthorizer from the provided kubeconfig file. -// The config's cluster field is used to refer to the remote service, user refers to the returned authorizer. -// -// # clusters refers to the remote service. -// clusters: -// - name: name-of-remote-authz-service -// cluster: -// certificate-authority: /path/to/ca.pem # CA for verifying the remote service. -// server: https://authz.example.com/authorize # URL of remote service to query. Must use 'https'. -// -// # users refers to the API server's webhook configuration. -// users: -// - name: name-of-api-server -// user: -// client-certificate: /path/to/cert.pem # cert for the webhook plugin to use -// client-key: /path/to/key.pem # key matching the cert -// -// For additional HTTP configuration, refer to the kubeconfig documentation -// https://kubernetes.io/docs/user-guide/kubeconfig-file/. -func New(config *rest.Config, version string, authorizedTTL, unauthorizedTTL time.Duration, retryBackoff wait.Backoff, decisionOnError authorizer.Decision, matchConditions []apiserver.WebhookMatchCondition, name string, metrics metrics.AuthorizerMetrics, compiler authorizationcel.Compiler) (*WebhookAuthorizer, error) { - subjectAccessReview, err := subjectAccessReviewInterfaceFromConfig(config, version, retryBackoff) - if err != nil { - return nil, err - } - return newWithBackoff(subjectAccessReview, authorizedTTL, unauthorizedTTL, retryBackoff, decisionOnError, matchConditions, metrics, compiler, name) -} - -// newWithBackoff allows tests to skip the sleep. -func newWithBackoff(subjectAccessReview subjectAccessReviewer, authorizedTTL, unauthorizedTTL time.Duration, retryBackoff wait.Backoff, decisionOnError authorizer.Decision, matchConditions []apiserver.WebhookMatchCondition, am metrics.AuthorizerMetrics, compiler authorizationcel.Compiler, name string) (*WebhookAuthorizer, error) { - // compile all expressions once in validation and save the results to be used for eval later - cm, fieldErr := apiservervalidation.ValidateAndCompileMatchConditions(compiler, matchConditions) - if err := fieldErr.ToAggregate(); err != nil { - return nil, err - } - if cm != nil { - cm.AuthorizerType = "Webhook" - cm.AuthorizerName = name - cm.Metrics = am - } - return &WebhookAuthorizer{ - subjectAccessReview: subjectAccessReview, - responseCache: cache.NewLRUExpireCache(8192), - authorizedTTL: authorizedTTL, - unauthorizedTTL: unauthorizedTTL, - retryBackoff: retryBackoff, - decisionOnError: decisionOnError, - metrics: am, - celMatcher: cm, - name: name, - }, nil -} - -// Authorize makes a REST request to the remote service describing the attempted action as a JSON -// serialized api.authorization.v1beta1.SubjectAccessReview object. An example request body is -// provided below. -// -// { -// "apiVersion": "authorization.k8s.io/v1beta1", -// "kind": "SubjectAccessReview", -// "spec": { -// "resourceAttributes": { -// "namespace": "kittensandponies", -// "verb": "GET", -// "group": "group3", -// "resource": "pods" -// }, -// "user": "jane", -// "group": [ -// "group1", -// "group2" -// ] -// } -// } -// -// The remote service is expected to fill the SubjectAccessReviewStatus field to either allow or -// disallow access. A permissive response would return: -// -// { -// "apiVersion": "authorization.k8s.io/v1beta1", -// "kind": "SubjectAccessReview", -// "status": { -// "allowed": true -// } -// } -// -// To disallow access, the remote service would return: -// -// { -// "apiVersion": "authorization.k8s.io/v1beta1", -// "kind": "SubjectAccessReview", -// "status": { -// "allowed": false, -// "reason": "user does not have read access to the namespace" -// } -// } -// -// TODO(mikedanese): We should eventually support failing closed when we -// encounter an error. We are failing open now to preserve backwards compatible -// behavior. -func (w *WebhookAuthorizer) Authorize(ctx context.Context, attr authorizer.Attributes) (decision authorizer.Decision, reason string, err error) { - r := &authorizationv1.SubjectAccessReview{} - if user := attr.GetUser(); user != nil { - r.Spec = authorizationv1.SubjectAccessReviewSpec{ - User: user.GetName(), - UID: user.GetUID(), - Groups: user.GetGroups(), - Extra: convertToSARExtra(user.GetExtra()), - } - } - - if attr.IsResourceRequest() { - r.Spec.ResourceAttributes = resourceAttributesFrom(attr) - } else { - r.Spec.NonResourceAttributes = &authorizationv1.NonResourceAttributes{ - Path: attr.GetPath(), - Verb: attr.GetVerb(), - } - } - // skipping match when feature is not enabled - if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.StructuredAuthorizationConfiguration) { - // Process Match Conditions before calling the webhook - matches, err := w.match(ctx, r) - // If at least one matchCondition evaluates to an error (but none are FALSE): - // If failurePolicy=Deny, then the webhook rejects the request - // If failurePolicy=NoOpinion, then the error is ignored and the webhook is skipped - if err != nil { - return w.decisionOnError, "", err - } - // If at least one matchCondition successfully evaluates to FALSE, - // then the webhook is skipped. - if !matches { - return authorizer.DecisionNoOpinion, "", nil - } - } - // If all evaluated successfully and ALL matchConditions evaluate to TRUE, - // then the webhook is called. - key, err := json.Marshal(r.Spec) - if err != nil { - return w.decisionOnError, "", err - } - if entry, ok := w.responseCache.Get(string(key)); ok { - r.Status = entry.(authorizationv1.SubjectAccessReviewStatus) - } else { - var result *authorizationv1.SubjectAccessReview - var metricsResult string - // WithExponentialBackoff will return SAR create error (sarErr) if any. - if err := webhook.WithExponentialBackoff(ctx, w.retryBackoff, func() error { - var sarErr error - var statusCode int - - start := time.Now() - result, statusCode, sarErr = w.subjectAccessReview.Create(ctx, r, metav1.CreateOptions{}) - latency := time.Since(start) - - switch { - case sarErr == nil: - metricsResult = "success" - case ctx.Err() != nil: - metricsResult = "canceled" - case utilnet.IsTimeout(sarErr) || errors.Is(sarErr, context.DeadlineExceeded) || apierrors.IsTimeout(sarErr) || statusCode == http.StatusGatewayTimeout: - metricsResult = "timeout" - default: - metricsResult = "error" - } - w.metrics.RecordWebhookEvaluation(ctx, w.name, metricsResult) - w.metrics.RecordWebhookDuration(ctx, w.name, metricsResult, latency.Seconds()) - - if statusCode != 0 { - w.metrics.RecordRequestTotal(ctx, strconv.Itoa(statusCode)) - w.metrics.RecordRequestLatency(ctx, strconv.Itoa(statusCode), latency.Seconds()) - return sarErr - } - - if sarErr != nil { - w.metrics.RecordRequestTotal(ctx, "") - w.metrics.RecordRequestLatency(ctx, "", latency.Seconds()) - } - - return sarErr - }, webhook.DefaultShouldRetry); err != nil { - klog.Errorf("Failed to make webhook authorizer request: %v", err) - - // we're returning NoOpinion, and the parent context has not timed out or been canceled - if w.decisionOnError == authorizer.DecisionNoOpinion && ctx.Err() == nil { - w.metrics.RecordWebhookFailOpen(ctx, w.name, metricsResult) - } - - return w.decisionOnError, "", err - } - - r.Status = result.Status - if shouldCache(attr) { - if r.Status.Allowed { - w.responseCache.Add(string(key), r.Status, w.authorizedTTL) - } else { - w.responseCache.Add(string(key), r.Status, w.unauthorizedTTL) - } - } - } - switch { - case r.Status.Denied && r.Status.Allowed: - return authorizer.DecisionDeny, r.Status.Reason, fmt.Errorf("webhook subject access review returned both allow and deny response") - case r.Status.Denied: - return authorizer.DecisionDeny, r.Status.Reason, nil - case r.Status.Allowed: - return authorizer.DecisionAllow, r.Status.Reason, nil - default: - return authorizer.DecisionNoOpinion, r.Status.Reason, nil - } - -} - -func resourceAttributesFrom(attr authorizer.Attributes) *authorizationv1.ResourceAttributes { - ret := &authorizationv1.ResourceAttributes{ - Namespace: attr.GetNamespace(), - Verb: attr.GetVerb(), - Group: attr.GetAPIGroup(), - Version: attr.GetAPIVersion(), - Resource: attr.GetResource(), - Subresource: attr.GetSubresource(), - Name: attr.GetName(), - } - - if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.AuthorizeWithSelectors) { - // If we are able to get any requirements while parsing selectors, use them, even if there's an error. - // This is because selectors only narrow, so if a subset of selector requirements are available, the request can be allowed. - if selectorRequirements, _ := fieldSelectorToAuthorizationAPI(attr); len(selectorRequirements) > 0 { - ret.FieldSelector = &authorizationv1.FieldSelectorAttributes{ - Requirements: selectorRequirements, - } - } - - if selectorRequirements, _ := labelSelectorToAuthorizationAPI(attr); len(selectorRequirements) > 0 { - ret.LabelSelector = &authorizationv1.LabelSelectorAttributes{ - Requirements: selectorRequirements, - } - } - } - - return ret -} - -func fieldSelectorToAuthorizationAPI(attr authorizer.Attributes) ([]metav1.FieldSelectorRequirement, error) { - requirements, getFieldSelectorErr := attr.GetFieldSelector() - if len(requirements) == 0 { - return nil, getFieldSelectorErr - } - - retRequirements := []metav1.FieldSelectorRequirement{} - for _, requirement := range requirements { - retRequirement := metav1.FieldSelectorRequirement{} - switch { - case requirement.Operator == selection.Equals || requirement.Operator == selection.DoubleEquals || requirement.Operator == selection.In: - retRequirement.Operator = metav1.FieldSelectorOpIn - retRequirement.Key = requirement.Field - retRequirement.Values = []string{requirement.Value} - case requirement.Operator == selection.NotEquals || requirement.Operator == selection.NotIn: - retRequirement.Operator = metav1.FieldSelectorOpNotIn - retRequirement.Key = requirement.Field - retRequirement.Values = []string{requirement.Value} - default: - // ignore this particular requirement. since requirements are AND'd, it is safe to ignore unknown requirements - // for authorization since the resulting check will only be as broad or broader than the intended. - continue - } - retRequirements = append(retRequirements, retRequirement) - } - - if len(retRequirements) == 0 { - // this means that all requirements were dropped (likely due to unknown operators), so we are checking the broader - // unrestricted action. - return nil, getFieldSelectorErr - } - return retRequirements, getFieldSelectorErr -} - -func labelSelectorToAuthorizationAPI(attr authorizer.Attributes) ([]metav1.LabelSelectorRequirement, error) { - requirements, getLabelSelectorErr := attr.GetLabelSelector() - if len(requirements) == 0 { - return nil, getLabelSelectorErr - } - - retRequirements := []metav1.LabelSelectorRequirement{} - for _, requirement := range requirements { - retRequirement := metav1.LabelSelectorRequirement{ - Key: requirement.Key(), - } - if values := requirement.ValuesUnsorted(); len(values) > 0 { - retRequirement.Values = values - } - switch requirement.Operator() { - case selection.Equals, selection.DoubleEquals, selection.In: - retRequirement.Operator = metav1.LabelSelectorOpIn - case selection.NotEquals, selection.NotIn: - retRequirement.Operator = metav1.LabelSelectorOpNotIn - case selection.Exists: - retRequirement.Operator = metav1.LabelSelectorOpExists - case selection.DoesNotExist: - retRequirement.Operator = metav1.LabelSelectorOpDoesNotExist - default: - // ignore this particular requirement. since requirements are AND'd, it is safe to ignore unknown requirements - // for authorization since the resulting check will only be as broad or broader than the intended. - continue - } - retRequirements = append(retRequirements, retRequirement) - } - - if len(retRequirements) == 0 { - // this means that all requirements were dropped (likely due to unknown operators), so we are checking the broader - // unrestricted action. - return nil, getLabelSelectorErr - } - return retRequirements, getLabelSelectorErr -} - -// TODO: need to finish the method to get the rules when using webhook mode -func (w *WebhookAuthorizer) RulesFor(ctx context.Context, user user.Info, namespace string) ([]authorizer.ResourceRuleInfo, []authorizer.NonResourceRuleInfo, bool, error) { - var ( - resourceRules []authorizer.ResourceRuleInfo - nonResourceRules []authorizer.NonResourceRuleInfo - ) - incomplete := true - return resourceRules, nonResourceRules, incomplete, fmt.Errorf("webhook authorizer does not support user rule resolution") -} - -// Match is used to evaluate the SubjectAccessReviewSpec against -// the authorizer's matchConditions in the form of cel expressions -// to return match or no match found, which then is used to -// determine if the webhook should be skipped. -func (w *WebhookAuthorizer) match(ctx context.Context, r *authorizationv1.SubjectAccessReview) (bool, error) { - // A nil celMatcher or zero saved CompilationResults matches all requests. - if w.celMatcher == nil || w.celMatcher.CompilationResults == nil { - return true, nil - } - return w.celMatcher.Eval(ctx, r) -} - -func convertToSARExtra(extra map[string][]string) map[string]authorizationv1.ExtraValue { - if extra == nil { - return nil - } - ret := map[string]authorizationv1.ExtraValue{} - for k, v := range extra { - ret[k] = authorizationv1.ExtraValue(v) - } - - return ret -} - -// subjectAccessReviewInterfaceFromConfig builds a client from the specified kubeconfig file, -// and returns a SubjectAccessReviewInterface that uses that client. Note that the client submits SubjectAccessReview -// requests to the exact path specified in the kubeconfig file, so arbitrary non-API servers can be targeted. -func subjectAccessReviewInterfaceFromConfig(config *rest.Config, version string, retryBackoff wait.Backoff) (subjectAccessReviewer, error) { - localScheme := runtime.NewScheme() - if err := scheme.AddToScheme(localScheme); err != nil { - return nil, err - } - - switch version { - case authorizationv1.SchemeGroupVersion.Version: - groupVersions := []schema.GroupVersion{authorizationv1.SchemeGroupVersion} - if err := localScheme.SetVersionPriority(groupVersions...); err != nil { - return nil, err - } - gw, err := webhook.NewGenericWebhook(localScheme, scheme.Codecs, config, groupVersions, retryBackoff) - if err != nil { - return nil, err - } - return &subjectAccessReviewV1ClientGW{gw.RestClient}, nil - - case authorizationv1beta1.SchemeGroupVersion.Version: - groupVersions := []schema.GroupVersion{authorizationv1beta1.SchemeGroupVersion} - if err := localScheme.SetVersionPriority(groupVersions...); err != nil { - return nil, err - } - gw, err := webhook.NewGenericWebhook(localScheme, scheme.Codecs, config, groupVersions, retryBackoff) - if err != nil { - return nil, err - } - return &subjectAccessReviewV1beta1ClientGW{gw.RestClient}, nil - - default: - return nil, fmt.Errorf( - "unsupported webhook authorizer version %q, supported versions are %q, %q", - version, - authorizationv1.SchemeGroupVersion.Version, - authorizationv1beta1.SchemeGroupVersion.Version, - ) - } -} - -type subjectAccessReviewV1Client struct { - client rest.Interface -} - -func (t *subjectAccessReviewV1Client) Create(ctx context.Context, subjectAccessReview *authorizationv1.SubjectAccessReview, opts metav1.CreateOptions) (result *authorizationv1.SubjectAccessReview, statusCode int, err error) { - result = &authorizationv1.SubjectAccessReview{} - - restResult := t.client.Post(). - Resource("subjectaccessreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(subjectAccessReview). - Do(ctx) - - restResult.StatusCode(&statusCode) - err = restResult.Into(result) - return -} - -// subjectAccessReviewV1ClientGW used by the generic webhook, doesn't specify GVR. -type subjectAccessReviewV1ClientGW struct { - client rest.Interface -} - -func (t *subjectAccessReviewV1ClientGW) Create(ctx context.Context, subjectAccessReview *authorizationv1.SubjectAccessReview, _ metav1.CreateOptions) (*authorizationv1.SubjectAccessReview, int, error) { - var statusCode int - result := &authorizationv1.SubjectAccessReview{} - - restResult := t.client.Post().Body(subjectAccessReview).Do(ctx) - - restResult.StatusCode(&statusCode) - err := restResult.Into(result) - - return result, statusCode, err -} - -// subjectAccessReviewV1beta1ClientGW used by the generic webhook, doesn't specify GVR. -type subjectAccessReviewV1beta1ClientGW struct { - client rest.Interface -} - -func (t *subjectAccessReviewV1beta1ClientGW) Create(ctx context.Context, subjectAccessReview *authorizationv1.SubjectAccessReview, _ metav1.CreateOptions) (*authorizationv1.SubjectAccessReview, int, error) { - var statusCode int - v1beta1Review := &authorizationv1beta1.SubjectAccessReview{Spec: v1SpecToV1beta1Spec(&subjectAccessReview.Spec)} - v1beta1Result := &authorizationv1beta1.SubjectAccessReview{} - - restResult := t.client.Post().Body(v1beta1Review).Do(ctx) - - restResult.StatusCode(&statusCode) - err := restResult.Into(v1beta1Result) - if err == nil { - subjectAccessReview.Status = v1beta1StatusToV1Status(&v1beta1Result.Status) - } - return subjectAccessReview, statusCode, err -} - -// shouldCache determines whether it is safe to cache the given request attributes. If the -// requester-controlled attributes are too large, this may be a DoS attempt, so we skip the cache. -func shouldCache(attr authorizer.Attributes) bool { - controlledAttrSize := int64(len(attr.GetNamespace())) + - int64(len(attr.GetVerb())) + - int64(len(attr.GetAPIGroup())) + - int64(len(attr.GetAPIVersion())) + - int64(len(attr.GetResource())) + - int64(len(attr.GetSubresource())) + - int64(len(attr.GetName())) + - int64(len(attr.GetPath())) - return controlledAttrSize < maxControlledAttrCacheSize -} - -func v1beta1StatusToV1Status(in *authorizationv1beta1.SubjectAccessReviewStatus) authorizationv1.SubjectAccessReviewStatus { - return authorizationv1.SubjectAccessReviewStatus{ - Allowed: in.Allowed, - Denied: in.Denied, - Reason: in.Reason, - EvaluationError: in.EvaluationError, - } -} - -func v1SpecToV1beta1Spec(in *authorizationv1.SubjectAccessReviewSpec) authorizationv1beta1.SubjectAccessReviewSpec { - return authorizationv1beta1.SubjectAccessReviewSpec{ - ResourceAttributes: v1ResourceAttributesToV1beta1ResourceAttributes(in.ResourceAttributes), - NonResourceAttributes: v1NonResourceAttributesToV1beta1NonResourceAttributes(in.NonResourceAttributes), - User: in.User, - Groups: in.Groups, - Extra: v1ExtraToV1beta1Extra(in.Extra), - UID: in.UID, - } -} - -func v1ResourceAttributesToV1beta1ResourceAttributes(in *authorizationv1.ResourceAttributes) *authorizationv1beta1.ResourceAttributes { - if in == nil { - return nil - } - return &authorizationv1beta1.ResourceAttributes{ - Namespace: in.Namespace, - Verb: in.Verb, - Group: in.Group, - Version: in.Version, - Resource: in.Resource, - Subresource: in.Subresource, - Name: in.Name, - FieldSelector: in.FieldSelector, - LabelSelector: in.LabelSelector, - } -} - -func v1NonResourceAttributesToV1beta1NonResourceAttributes(in *authorizationv1.NonResourceAttributes) *authorizationv1beta1.NonResourceAttributes { - if in == nil { - return nil - } - return &authorizationv1beta1.NonResourceAttributes{ - Path: in.Path, - Verb: in.Verb, - } -} - -func v1ExtraToV1beta1Extra(in map[string]authorizationv1.ExtraValue) map[string]authorizationv1beta1.ExtraValue { - if in == nil { - return nil - } - ret := make(map[string]authorizationv1beta1.ExtraValue, len(in)) - for k, v := range in { - ret[k] = authorizationv1beta1.ExtraValue(v) - } - return ret -} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/OWNERS b/e2e/vendor/k8s.io/client-go/applyconfigurations/OWNERS index ea0928429..de4067fd3 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/OWNERS +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/OWNERS @@ -3,3 +3,4 @@ approvers: - apelisse - jpbetz + - api-approvers diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/apps/v1/deploymentstatus.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/apps/v1/deploymentstatus.go index 747813ade..8d9e6cca2 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/apps/v1/deploymentstatus.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/apps/v1/deploymentstatus.go @@ -27,6 +27,7 @@ type DeploymentStatusApplyConfiguration struct { ReadyReplicas *int32 `json:"readyReplicas,omitempty"` AvailableReplicas *int32 `json:"availableReplicas,omitempty"` UnavailableReplicas *int32 `json:"unavailableReplicas,omitempty"` + TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty"` Conditions []DeploymentConditionApplyConfiguration `json:"conditions,omitempty"` CollisionCount *int32 `json:"collisionCount,omitempty"` } @@ -85,6 +86,14 @@ func (b *DeploymentStatusApplyConfiguration) WithUnavailableReplicas(value int32 return b } +// WithTerminatingReplicas sets the TerminatingReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TerminatingReplicas field is set to the value of the last call. +func (b *DeploymentStatusApplyConfiguration) WithTerminatingReplicas(value int32) *DeploymentStatusApplyConfiguration { + b.TerminatingReplicas = &value + return b +} + // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/apps/v1/replicasetstatus.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/apps/v1/replicasetstatus.go index a1408ae25..d11526d60 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/apps/v1/replicasetstatus.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/apps/v1/replicasetstatus.go @@ -25,6 +25,7 @@ type ReplicaSetStatusApplyConfiguration struct { FullyLabeledReplicas *int32 `json:"fullyLabeledReplicas,omitempty"` ReadyReplicas *int32 `json:"readyReplicas,omitempty"` AvailableReplicas *int32 `json:"availableReplicas,omitempty"` + TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty"` ObservedGeneration *int64 `json:"observedGeneration,omitempty"` Conditions []ReplicaSetConditionApplyConfiguration `json:"conditions,omitempty"` } @@ -67,6 +68,14 @@ func (b *ReplicaSetStatusApplyConfiguration) WithAvailableReplicas(value int32) return b } +// WithTerminatingReplicas sets the TerminatingReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TerminatingReplicas field is set to the value of the last call. +func (b *ReplicaSetStatusApplyConfiguration) WithTerminatingReplicas(value int32) *ReplicaSetStatusApplyConfiguration { + b.TerminatingReplicas = &value + return b +} + // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/deploymentstatus.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/deploymentstatus.go index adc023a34..36b4fd42b 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/deploymentstatus.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/deploymentstatus.go @@ -27,6 +27,7 @@ type DeploymentStatusApplyConfiguration struct { ReadyReplicas *int32 `json:"readyReplicas,omitempty"` AvailableReplicas *int32 `json:"availableReplicas,omitempty"` UnavailableReplicas *int32 `json:"unavailableReplicas,omitempty"` + TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty"` Conditions []DeploymentConditionApplyConfiguration `json:"conditions,omitempty"` CollisionCount *int32 `json:"collisionCount,omitempty"` } @@ -85,6 +86,14 @@ func (b *DeploymentStatusApplyConfiguration) WithUnavailableReplicas(value int32 return b } +// WithTerminatingReplicas sets the TerminatingReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TerminatingReplicas field is set to the value of the last call. +func (b *DeploymentStatusApplyConfiguration) WithTerminatingReplicas(value int32) *DeploymentStatusApplyConfiguration { + b.TerminatingReplicas = &value + return b +} + // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/deploymentstatus.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/deploymentstatus.go index 5fa912233..554be024d 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/deploymentstatus.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/deploymentstatus.go @@ -27,6 +27,7 @@ type DeploymentStatusApplyConfiguration struct { ReadyReplicas *int32 `json:"readyReplicas,omitempty"` AvailableReplicas *int32 `json:"availableReplicas,omitempty"` UnavailableReplicas *int32 `json:"unavailableReplicas,omitempty"` + TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty"` Conditions []DeploymentConditionApplyConfiguration `json:"conditions,omitempty"` CollisionCount *int32 `json:"collisionCount,omitempty"` } @@ -85,6 +86,14 @@ func (b *DeploymentStatusApplyConfiguration) WithUnavailableReplicas(value int32 return b } +// WithTerminatingReplicas sets the TerminatingReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TerminatingReplicas field is set to the value of the last call. +func (b *DeploymentStatusApplyConfiguration) WithTerminatingReplicas(value int32) *DeploymentStatusApplyConfiguration { + b.TerminatingReplicas = &value + return b +} + // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/replicasetstatus.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/replicasetstatus.go index d3c92e274..13004fde3 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/replicasetstatus.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/replicasetstatus.go @@ -25,6 +25,7 @@ type ReplicaSetStatusApplyConfiguration struct { FullyLabeledReplicas *int32 `json:"fullyLabeledReplicas,omitempty"` ReadyReplicas *int32 `json:"readyReplicas,omitempty"` AvailableReplicas *int32 `json:"availableReplicas,omitempty"` + TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty"` ObservedGeneration *int64 `json:"observedGeneration,omitempty"` Conditions []ReplicaSetConditionApplyConfiguration `json:"conditions,omitempty"` } @@ -67,6 +68,14 @@ func (b *ReplicaSetStatusApplyConfiguration) WithAvailableReplicas(value int32) return b } +// WithTerminatingReplicas sets the TerminatingReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TerminatingReplicas field is set to the value of the last call. +func (b *ReplicaSetStatusApplyConfiguration) WithTerminatingReplicas(value int32) *ReplicaSetStatusApplyConfiguration { + b.TerminatingReplicas = &value + return b +} + // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/hpascalingrules.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/hpascalingrules.go index 6a6a2655f..6fd0f25cc 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/hpascalingrules.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/hpascalingrules.go @@ -20,6 +20,7 @@ package v2 import ( autoscalingv2 "k8s.io/api/autoscaling/v2" + resource "k8s.io/apimachinery/pkg/api/resource" ) // HPAScalingRulesApplyConfiguration represents a declarative configuration of the HPAScalingRules type for use @@ -28,6 +29,7 @@ type HPAScalingRulesApplyConfiguration struct { StabilizationWindowSeconds *int32 `json:"stabilizationWindowSeconds,omitempty"` SelectPolicy *autoscalingv2.ScalingPolicySelect `json:"selectPolicy,omitempty"` Policies []HPAScalingPolicyApplyConfiguration `json:"policies,omitempty"` + Tolerance *resource.Quantity `json:"tolerance,omitempty"` } // HPAScalingRulesApplyConfiguration constructs a declarative configuration of the HPAScalingRules type for use with @@ -64,3 +66,11 @@ func (b *HPAScalingRulesApplyConfiguration) WithPolicies(values ...*HPAScalingPo } return b } + +// WithTolerance sets the Tolerance field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Tolerance field is set to the value of the last call. +func (b *HPAScalingRulesApplyConfiguration) WithTolerance(value resource.Quantity) *HPAScalingRulesApplyConfiguration { + b.Tolerance = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/clustertrustbundle.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/clustertrustbundle.go new file mode 100644 index 000000000..365fb9b0e --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/clustertrustbundle.go @@ -0,0 +1,253 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + certificatesv1beta1 "k8s.io/api/certificates/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ClusterTrustBundleApplyConfiguration represents a declarative configuration of the ClusterTrustBundle type for use +// with apply. +type ClusterTrustBundleApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ClusterTrustBundleSpecApplyConfiguration `json:"spec,omitempty"` +} + +// ClusterTrustBundle constructs a declarative configuration of the ClusterTrustBundle type for use with +// apply. +func ClusterTrustBundle(name string) *ClusterTrustBundleApplyConfiguration { + b := &ClusterTrustBundleApplyConfiguration{} + b.WithName(name) + b.WithKind("ClusterTrustBundle") + b.WithAPIVersion("certificates.k8s.io/v1beta1") + return b +} + +// ExtractClusterTrustBundle extracts the applied configuration owned by fieldManager from +// clusterTrustBundle. If no managedFields are found in clusterTrustBundle for fieldManager, a +// ClusterTrustBundleApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// clusterTrustBundle must be a unmodified ClusterTrustBundle API object that was retrieved from the Kubernetes API. +// ExtractClusterTrustBundle provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractClusterTrustBundle(clusterTrustBundle *certificatesv1beta1.ClusterTrustBundle, fieldManager string) (*ClusterTrustBundleApplyConfiguration, error) { + return extractClusterTrustBundle(clusterTrustBundle, fieldManager, "") +} + +// ExtractClusterTrustBundleStatus is the same as ExtractClusterTrustBundle except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractClusterTrustBundleStatus(clusterTrustBundle *certificatesv1beta1.ClusterTrustBundle, fieldManager string) (*ClusterTrustBundleApplyConfiguration, error) { + return extractClusterTrustBundle(clusterTrustBundle, fieldManager, "status") +} + +func extractClusterTrustBundle(clusterTrustBundle *certificatesv1beta1.ClusterTrustBundle, fieldManager string, subresource string) (*ClusterTrustBundleApplyConfiguration, error) { + b := &ClusterTrustBundleApplyConfiguration{} + err := managedfields.ExtractInto(clusterTrustBundle, internal.Parser().Type("io.k8s.api.certificates.v1beta1.ClusterTrustBundle"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(clusterTrustBundle.Name) + + b.WithKind("ClusterTrustBundle") + b.WithAPIVersion("certificates.k8s.io/v1beta1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithKind(value string) *ClusterTrustBundleApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithAPIVersion(value string) *ClusterTrustBundleApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithName(value string) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithGenerateName(value string) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithNamespace(value string) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithUID(value types.UID) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithResourceVersion(value string) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithGeneration(value int64) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ClusterTrustBundleApplyConfiguration) WithLabels(entries map[string]string) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ClusterTrustBundleApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ClusterTrustBundleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ClusterTrustBundleApplyConfiguration) WithFinalizers(values ...string) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ClusterTrustBundleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithSpec(value *ClusterTrustBundleSpecApplyConfiguration) *ClusterTrustBundleApplyConfiguration { + b.Spec = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ClusterTrustBundleApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/clustertrustbundlespec.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/clustertrustbundlespec.go new file mode 100644 index 000000000..157a9efa8 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/clustertrustbundlespec.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// ClusterTrustBundleSpecApplyConfiguration represents a declarative configuration of the ClusterTrustBundleSpec type for use +// with apply. +type ClusterTrustBundleSpecApplyConfiguration struct { + SignerName *string `json:"signerName,omitempty"` + TrustBundle *string `json:"trustBundle,omitempty"` +} + +// ClusterTrustBundleSpecApplyConfiguration constructs a declarative configuration of the ClusterTrustBundleSpec type for use with +// apply. +func ClusterTrustBundleSpec() *ClusterTrustBundleSpecApplyConfiguration { + return &ClusterTrustBundleSpecApplyConfiguration{} +} + +// WithSignerName sets the SignerName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SignerName field is set to the value of the last call. +func (b *ClusterTrustBundleSpecApplyConfiguration) WithSignerName(value string) *ClusterTrustBundleSpecApplyConfiguration { + b.SignerName = &value + return b +} + +// WithTrustBundle sets the TrustBundle field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TrustBundle field is set to the value of the last call. +func (b *ClusterTrustBundleSpecApplyConfiguration) WithTrustBundle(value string) *ClusterTrustBundleSpecApplyConfiguration { + b.TrustBundle = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasecandidate.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasecandidate.go new file mode 100644 index 000000000..2e1c81219 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasecandidate.go @@ -0,0 +1,255 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + coordinationv1beta1 "k8s.io/api/coordination/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// LeaseCandidateApplyConfiguration represents a declarative configuration of the LeaseCandidate type for use +// with apply. +type LeaseCandidateApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *LeaseCandidateSpecApplyConfiguration `json:"spec,omitempty"` +} + +// LeaseCandidate constructs a declarative configuration of the LeaseCandidate type for use with +// apply. +func LeaseCandidate(name, namespace string) *LeaseCandidateApplyConfiguration { + b := &LeaseCandidateApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("LeaseCandidate") + b.WithAPIVersion("coordination.k8s.io/v1beta1") + return b +} + +// ExtractLeaseCandidate extracts the applied configuration owned by fieldManager from +// leaseCandidate. If no managedFields are found in leaseCandidate for fieldManager, a +// LeaseCandidateApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// leaseCandidate must be a unmodified LeaseCandidate API object that was retrieved from the Kubernetes API. +// ExtractLeaseCandidate provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractLeaseCandidate(leaseCandidate *coordinationv1beta1.LeaseCandidate, fieldManager string) (*LeaseCandidateApplyConfiguration, error) { + return extractLeaseCandidate(leaseCandidate, fieldManager, "") +} + +// ExtractLeaseCandidateStatus is the same as ExtractLeaseCandidate except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractLeaseCandidateStatus(leaseCandidate *coordinationv1beta1.LeaseCandidate, fieldManager string) (*LeaseCandidateApplyConfiguration, error) { + return extractLeaseCandidate(leaseCandidate, fieldManager, "status") +} + +func extractLeaseCandidate(leaseCandidate *coordinationv1beta1.LeaseCandidate, fieldManager string, subresource string) (*LeaseCandidateApplyConfiguration, error) { + b := &LeaseCandidateApplyConfiguration{} + err := managedfields.ExtractInto(leaseCandidate, internal.Parser().Type("io.k8s.api.coordination.v1beta1.LeaseCandidate"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(leaseCandidate.Name) + b.WithNamespace(leaseCandidate.Namespace) + + b.WithKind("LeaseCandidate") + b.WithAPIVersion("coordination.k8s.io/v1beta1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithKind(value string) *LeaseCandidateApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithAPIVersion(value string) *LeaseCandidateApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithName(value string) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithGenerateName(value string) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithNamespace(value string) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithUID(value types.UID) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithResourceVersion(value string) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithGeneration(value int64) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithCreationTimestamp(value metav1.Time) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *LeaseCandidateApplyConfiguration) WithLabels(entries map[string]string) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *LeaseCandidateApplyConfiguration) WithAnnotations(entries map[string]string) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *LeaseCandidateApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *LeaseCandidateApplyConfiguration) WithFinalizers(values ...string) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *LeaseCandidateApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithSpec(value *LeaseCandidateSpecApplyConfiguration) *LeaseCandidateApplyConfiguration { + b.Spec = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *LeaseCandidateApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasecandidatespec.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasecandidatespec.go new file mode 100644 index 000000000..c3ea12c81 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasecandidatespec.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + coordinationv1 "k8s.io/api/coordination/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// LeaseCandidateSpecApplyConfiguration represents a declarative configuration of the LeaseCandidateSpec type for use +// with apply. +type LeaseCandidateSpecApplyConfiguration struct { + LeaseName *string `json:"leaseName,omitempty"` + PingTime *v1.MicroTime `json:"pingTime,omitempty"` + RenewTime *v1.MicroTime `json:"renewTime,omitempty"` + BinaryVersion *string `json:"binaryVersion,omitempty"` + EmulationVersion *string `json:"emulationVersion,omitempty"` + Strategy *coordinationv1.CoordinatedLeaseStrategy `json:"strategy,omitempty"` +} + +// LeaseCandidateSpecApplyConfiguration constructs a declarative configuration of the LeaseCandidateSpec type for use with +// apply. +func LeaseCandidateSpec() *LeaseCandidateSpecApplyConfiguration { + return &LeaseCandidateSpecApplyConfiguration{} +} + +// WithLeaseName sets the LeaseName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LeaseName field is set to the value of the last call. +func (b *LeaseCandidateSpecApplyConfiguration) WithLeaseName(value string) *LeaseCandidateSpecApplyConfiguration { + b.LeaseName = &value + return b +} + +// WithPingTime sets the PingTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PingTime field is set to the value of the last call. +func (b *LeaseCandidateSpecApplyConfiguration) WithPingTime(value v1.MicroTime) *LeaseCandidateSpecApplyConfiguration { + b.PingTime = &value + return b +} + +// WithRenewTime sets the RenewTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RenewTime field is set to the value of the last call. +func (b *LeaseCandidateSpecApplyConfiguration) WithRenewTime(value v1.MicroTime) *LeaseCandidateSpecApplyConfiguration { + b.RenewTime = &value + return b +} + +// WithBinaryVersion sets the BinaryVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BinaryVersion field is set to the value of the last call. +func (b *LeaseCandidateSpecApplyConfiguration) WithBinaryVersion(value string) *LeaseCandidateSpecApplyConfiguration { + b.BinaryVersion = &value + return b +} + +// WithEmulationVersion sets the EmulationVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EmulationVersion field is set to the value of the last call. +func (b *LeaseCandidateSpecApplyConfiguration) WithEmulationVersion(value string) *LeaseCandidateSpecApplyConfiguration { + b.EmulationVersion = &value + return b +} + +// WithStrategy sets the Strategy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Strategy field is set to the value of the last call. +func (b *LeaseCandidateSpecApplyConfiguration) WithStrategy(value coordinationv1.CoordinatedLeaseStrategy) *LeaseCandidateSpecApplyConfiguration { + b.Strategy = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/containerstatus.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/containerstatus.go index 6a28939c2..8f64501bb 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/containerstatus.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/containerstatus.go @@ -39,6 +39,7 @@ type ContainerStatusApplyConfiguration struct { VolumeMounts []VolumeMountStatusApplyConfiguration `json:"volumeMounts,omitempty"` User *ContainerUserApplyConfiguration `json:"user,omitempty"` AllocatedResourcesStatus []ResourceStatusApplyConfiguration `json:"allocatedResourcesStatus,omitempty"` + StopSignal *corev1.Signal `json:"stopSignal,omitempty"` } // ContainerStatusApplyConfiguration constructs a declarative configuration of the ContainerStatus type for use with @@ -168,3 +169,11 @@ func (b *ContainerStatusApplyConfiguration) WithAllocatedResourcesStatus(values } return b } + +// WithStopSignal sets the StopSignal field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StopSignal field is set to the value of the last call. +func (b *ContainerStatusApplyConfiguration) WithStopSignal(value corev1.Signal) *ContainerStatusApplyConfiguration { + b.StopSignal = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/lifecycle.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/lifecycle.go index e37a30f59..f8c18a750 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/lifecycle.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/lifecycle.go @@ -18,11 +18,16 @@ limitations under the License. package v1 +import ( + corev1 "k8s.io/api/core/v1" +) + // LifecycleApplyConfiguration represents a declarative configuration of the Lifecycle type for use // with apply. type LifecycleApplyConfiguration struct { - PostStart *LifecycleHandlerApplyConfiguration `json:"postStart,omitempty"` - PreStop *LifecycleHandlerApplyConfiguration `json:"preStop,omitempty"` + PostStart *LifecycleHandlerApplyConfiguration `json:"postStart,omitempty"` + PreStop *LifecycleHandlerApplyConfiguration `json:"preStop,omitempty"` + StopSignal *corev1.Signal `json:"stopSignal,omitempty"` } // LifecycleApplyConfiguration constructs a declarative configuration of the Lifecycle type for use with @@ -46,3 +51,11 @@ func (b *LifecycleApplyConfiguration) WithPreStop(value *LifecycleHandlerApplyCo b.PreStop = value return b } + +// WithStopSignal sets the StopSignal field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StopSignal field is set to the value of the last call. +func (b *LifecycleApplyConfiguration) WithStopSignal(value corev1.Signal) *LifecycleApplyConfiguration { + b.StopSignal = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodeswapstatus.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodeswapstatus.go new file mode 100644 index 000000000..2a7a2e685 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodeswapstatus.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// NodeSwapStatusApplyConfiguration represents a declarative configuration of the NodeSwapStatus type for use +// with apply. +type NodeSwapStatusApplyConfiguration struct { + Capacity *int64 `json:"capacity,omitempty"` +} + +// NodeSwapStatusApplyConfiguration constructs a declarative configuration of the NodeSwapStatus type for use with +// apply. +func NodeSwapStatus() *NodeSwapStatusApplyConfiguration { + return &NodeSwapStatusApplyConfiguration{} +} + +// WithCapacity sets the Capacity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Capacity field is set to the value of the last call. +func (b *NodeSwapStatusApplyConfiguration) WithCapacity(value int64) *NodeSwapStatusApplyConfiguration { + b.Capacity = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodesysteminfo.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodesysteminfo.go index 11ac50713..55effd717 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodesysteminfo.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodesysteminfo.go @@ -21,16 +21,17 @@ package v1 // NodeSystemInfoApplyConfiguration represents a declarative configuration of the NodeSystemInfo type for use // with apply. type NodeSystemInfoApplyConfiguration struct { - MachineID *string `json:"machineID,omitempty"` - SystemUUID *string `json:"systemUUID,omitempty"` - BootID *string `json:"bootID,omitempty"` - KernelVersion *string `json:"kernelVersion,omitempty"` - OSImage *string `json:"osImage,omitempty"` - ContainerRuntimeVersion *string `json:"containerRuntimeVersion,omitempty"` - KubeletVersion *string `json:"kubeletVersion,omitempty"` - KubeProxyVersion *string `json:"kubeProxyVersion,omitempty"` - OperatingSystem *string `json:"operatingSystem,omitempty"` - Architecture *string `json:"architecture,omitempty"` + MachineID *string `json:"machineID,omitempty"` + SystemUUID *string `json:"systemUUID,omitempty"` + BootID *string `json:"bootID,omitempty"` + KernelVersion *string `json:"kernelVersion,omitempty"` + OSImage *string `json:"osImage,omitempty"` + ContainerRuntimeVersion *string `json:"containerRuntimeVersion,omitempty"` + KubeletVersion *string `json:"kubeletVersion,omitempty"` + KubeProxyVersion *string `json:"kubeProxyVersion,omitempty"` + OperatingSystem *string `json:"operatingSystem,omitempty"` + Architecture *string `json:"architecture,omitempty"` + Swap *NodeSwapStatusApplyConfiguration `json:"swap,omitempty"` } // NodeSystemInfoApplyConfiguration constructs a declarative configuration of the NodeSystemInfo type for use with @@ -118,3 +119,11 @@ func (b *NodeSystemInfoApplyConfiguration) WithArchitecture(value string) *NodeS b.Architecture = &value return b } + +// WithSwap sets the Swap field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Swap field is set to the value of the last call. +func (b *NodeSystemInfoApplyConfiguration) WithSwap(value *NodeSwapStatusApplyConfiguration) *NodeSystemInfoApplyConfiguration { + b.Swap = value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/podcondition.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/podcondition.go index 67cd1bd09..90bb8711b 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/podcondition.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/podcondition.go @@ -27,6 +27,7 @@ import ( // with apply. type PodConditionApplyConfiguration struct { Type *corev1.PodConditionType `json:"type,omitempty"` + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` Status *corev1.ConditionStatus `json:"status,omitempty"` LastProbeTime *metav1.Time `json:"lastProbeTime,omitempty"` LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` @@ -48,6 +49,14 @@ func (b *PodConditionApplyConfiguration) WithType(value corev1.PodConditionType) return b } +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *PodConditionApplyConfiguration) WithObservedGeneration(value int64) *PodConditionApplyConfiguration { + b.ObservedGeneration = &value + return b +} + // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/podstatus.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/podstatus.go index b79e1210a..28ad57bac 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/podstatus.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/core/v1/podstatus.go @@ -26,6 +26,7 @@ import ( // PodStatusApplyConfiguration represents a declarative configuration of the PodStatus type for use // with apply. type PodStatusApplyConfiguration struct { + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` Phase *corev1.PodPhase `json:"phase,omitempty"` Conditions []PodConditionApplyConfiguration `json:"conditions,omitempty"` Message *string `json:"message,omitempty"` @@ -50,6 +51,14 @@ func PodStatus() *PodStatusApplyConfiguration { return &PodStatusApplyConfiguration{} } +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *PodStatusApplyConfiguration) WithObservedGeneration(value int64) *PodStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + // WithPhase sets the Phase field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Phase field is set to the value of the last call. diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/endpointhints.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/endpointhints.go index d2d0f6776..7afda39b6 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/endpointhints.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/endpointhints.go @@ -22,6 +22,7 @@ package v1 // with apply. type EndpointHintsApplyConfiguration struct { ForZones []ForZoneApplyConfiguration `json:"forZones,omitempty"` + ForNodes []ForNodeApplyConfiguration `json:"forNodes,omitempty"` } // EndpointHintsApplyConfiguration constructs a declarative configuration of the EndpointHints type for use with @@ -42,3 +43,16 @@ func (b *EndpointHintsApplyConfiguration) WithForZones(values ...*ForZoneApplyCo } return b } + +// WithForNodes adds the given value to the ForNodes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ForNodes field. +func (b *EndpointHintsApplyConfiguration) WithForNodes(values ...*ForNodeApplyConfiguration) *EndpointHintsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithForNodes") + } + b.ForNodes = append(b.ForNodes, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/fornode.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/fornode.go new file mode 100644 index 000000000..3b2304d30 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/fornode.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ForNodeApplyConfiguration represents a declarative configuration of the ForNode type for use +// with apply. +type ForNodeApplyConfiguration struct { + Name *string `json:"name,omitempty"` +} + +// ForNodeApplyConfiguration constructs a declarative configuration of the ForNode type for use with +// apply. +func ForNode() *ForNodeApplyConfiguration { + return &ForNodeApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ForNodeApplyConfiguration) WithName(value string) *ForNodeApplyConfiguration { + b.Name = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/endpointhints.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/endpointhints.go index 99f69027a..9637f9940 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/endpointhints.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/endpointhints.go @@ -22,6 +22,7 @@ package v1beta1 // with apply. type EndpointHintsApplyConfiguration struct { ForZones []ForZoneApplyConfiguration `json:"forZones,omitempty"` + ForNodes []ForNodeApplyConfiguration `json:"forNodes,omitempty"` } // EndpointHintsApplyConfiguration constructs a declarative configuration of the EndpointHints type for use with @@ -42,3 +43,16 @@ func (b *EndpointHintsApplyConfiguration) WithForZones(values ...*ForZoneApplyCo } return b } + +// WithForNodes adds the given value to the ForNodes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ForNodes field. +func (b *EndpointHintsApplyConfiguration) WithForNodes(values ...*ForNodeApplyConfiguration) *EndpointHintsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithForNodes") + } + b.ForNodes = append(b.ForNodes, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/fornode.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/fornode.go new file mode 100644 index 000000000..79aff881d --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/fornode.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// ForNodeApplyConfiguration represents a declarative configuration of the ForNode type for use +// with apply. +type ForNodeApplyConfiguration struct { + Name *string `json:"name,omitempty"` +} + +// ForNodeApplyConfiguration constructs a declarative configuration of the ForNode type for use with +// apply. +func ForNode() *ForNodeApplyConfiguration { + return &ForNodeApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ForNodeApplyConfiguration) WithName(value string) *ForNodeApplyConfiguration { + b.Name = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/doc.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/doc.go index ac426c607..8efc9523e 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/doc.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/doc.go @@ -148,4 +148,4 @@ reconciliation code that performs a "read/modify-in-place/update" (or patch) wor // apply applied, err := deploymentClient.Apply(ctx, extractedDeployment, metav1.ApplyOptions{FieldManager: fieldMgr}) */ -package applyconfigurations // import "k8s.io/client-go/applyconfigurations" +package applyconfigurations diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/deploymentstatus.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/deploymentstatus.go index adc023a34..36b4fd42b 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/deploymentstatus.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/deploymentstatus.go @@ -27,6 +27,7 @@ type DeploymentStatusApplyConfiguration struct { ReadyReplicas *int32 `json:"readyReplicas,omitempty"` AvailableReplicas *int32 `json:"availableReplicas,omitempty"` UnavailableReplicas *int32 `json:"unavailableReplicas,omitempty"` + TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty"` Conditions []DeploymentConditionApplyConfiguration `json:"conditions,omitempty"` CollisionCount *int32 `json:"collisionCount,omitempty"` } @@ -85,6 +86,14 @@ func (b *DeploymentStatusApplyConfiguration) WithUnavailableReplicas(value int32 return b } +// WithTerminatingReplicas sets the TerminatingReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TerminatingReplicas field is set to the value of the last call. +func (b *DeploymentStatusApplyConfiguration) WithTerminatingReplicas(value int32) *DeploymentStatusApplyConfiguration { + b.TerminatingReplicas = &value + return b +} + // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/replicasetstatus.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/replicasetstatus.go index 9a5b468a3..46abc9432 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/replicasetstatus.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/replicasetstatus.go @@ -25,6 +25,7 @@ type ReplicaSetStatusApplyConfiguration struct { FullyLabeledReplicas *int32 `json:"fullyLabeledReplicas,omitempty"` ReadyReplicas *int32 `json:"readyReplicas,omitempty"` AvailableReplicas *int32 `json:"availableReplicas,omitempty"` + TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty"` ObservedGeneration *int64 `json:"observedGeneration,omitempty"` Conditions []ReplicaSetConditionApplyConfiguration `json:"conditions,omitempty"` } @@ -67,6 +68,14 @@ func (b *ReplicaSetStatusApplyConfiguration) WithAvailableReplicas(value int32) return b } +// WithTerminatingReplicas sets the TerminatingReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TerminatingReplicas field is set to the value of the last call. +func (b *ReplicaSetStatusApplyConfiguration) WithTerminatingReplicas(value int32) *ReplicaSetStatusApplyConfiguration { + b.TerminatingReplicas = &value + return b +} + // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ObservedGeneration field is set to the value of the last call. diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/internal/internal.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/internal/internal.go index cd9fcd98b..41332b742 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/internal/internal.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/internal/internal.go @@ -1662,6 +1662,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: replicas type: scalar: numeric + - name: terminatingReplicas + type: + scalar: numeric - name: unavailableReplicas type: scalar: numeric @@ -1761,6 +1764,9 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: numeric default: 0 + - name: terminatingReplicas + type: + scalar: numeric - name: io.k8s.api.apps.v1.RollingUpdateDaemonSet map: fields: @@ -2058,6 +2064,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: replicas type: scalar: numeric + - name: terminatingReplicas + type: + scalar: numeric - name: unavailableReplicas type: scalar: numeric @@ -2476,6 +2485,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: replicas type: scalar: numeric + - name: terminatingReplicas + type: + scalar: numeric - name: unavailableReplicas type: scalar: numeric @@ -2575,6 +2587,9 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: numeric default: 0 + - name: terminatingReplicas + type: + scalar: numeric - name: io.k8s.api.apps.v1beta2.RollingUpdateDaemonSet map: fields: @@ -2919,6 +2934,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: stabilizationWindowSeconds type: scalar: numeric + - name: tolerance + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.autoscaling.v2.HorizontalPodAutoscaler map: fields: @@ -4430,6 +4448,33 @@ var schemaYAML = typed.YAMLObject(`types: elementRelationship: associative keys: - type +- name: io.k8s.api.certificates.v1beta1.ClusterTrustBundle + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.certificates.v1beta1.ClusterTrustBundleSpec + default: {} +- name: io.k8s.api.certificates.v1beta1.ClusterTrustBundleSpec + map: + fields: + - name: signerName + type: + scalar: string + - name: trustBundle + type: + scalar: string + default: "" - name: io.k8s.api.coordination.v1.Lease map: fields: @@ -4528,6 +4573,46 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.api.coordination.v1beta1.LeaseSpec default: {} +- name: io.k8s.api.coordination.v1beta1.LeaseCandidate + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.coordination.v1beta1.LeaseCandidateSpec + default: {} +- name: io.k8s.api.coordination.v1beta1.LeaseCandidateSpec + map: + fields: + - name: binaryVersion + type: + scalar: string + default: "" + - name: emulationVersion + type: + scalar: string + - name: leaseName + type: + scalar: string + default: "" + - name: pingTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + - name: renewTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + - name: strategy + type: + scalar: string - name: io.k8s.api.coordination.v1beta1.LeaseSpec map: fields: @@ -5245,6 +5330,9 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.api.core.v1.ContainerState default: {} + - name: stopSignal + type: + scalar: string - name: user type: namedType: io.k8s.api.core.v1.ContainerUser @@ -5960,6 +6048,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: preStop type: namedType: io.k8s.api.core.v1.LifecycleHandler + - name: stopSignal + type: + scalar: string - name: io.k8s.api.core.v1.LifecycleHandler map: fields: @@ -6446,6 +6537,12 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: atomic +- name: io.k8s.api.core.v1.NodeSwapStatus + map: + fields: + - name: capacity + type: + scalar: numeric - name: io.k8s.api.core.v1.NodeSystemInfo map: fields: @@ -6485,6 +6582,9 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" + - name: swap + type: + namedType: io.k8s.api.core.v1.NodeSwapStatus - name: systemUUID type: scalar: string @@ -6911,6 +7011,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: message type: scalar: string + - name: observedGeneration + type: + scalar: numeric - name: reason type: scalar: string @@ -7275,6 +7378,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: nominatedNodeName type: scalar: string + - name: observedGeneration + type: + scalar: numeric - name: phase type: scalar: string @@ -7558,9 +7664,11 @@ var schemaYAML = typed.YAMLObject(`types: - name: minReadySeconds type: scalar: numeric + default: 0 - name: replicas type: scalar: numeric + default: 1 - name: selector type: map: @@ -8642,6 +8750,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.discovery.v1.EndpointHints map: fields: + - name: forNodes + type: + list: + elementType: + namedType: io.k8s.api.discovery.v1.ForNode + elementRelationship: atomic - name: forZones type: list: @@ -8693,6 +8807,13 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.discovery.v1.EndpointPort elementRelationship: atomic +- name: io.k8s.api.discovery.v1.ForNode + map: + fields: + - name: name + type: + scalar: string + default: "" - name: io.k8s.api.discovery.v1.ForZone map: fields: @@ -8745,6 +8866,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.discovery.v1beta1.EndpointHints map: fields: + - name: forNodes + type: + list: + elementType: + namedType: io.k8s.api.discovery.v1beta1.ForNode + elementRelationship: atomic - name: forZones type: list: @@ -8795,6 +8922,13 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.discovery.v1beta1.EndpointPort elementRelationship: atomic +- name: io.k8s.api.discovery.v1beta1.ForNode + map: + fields: + - name: name + type: + scalar: string + default: "" - name: io.k8s.api.discovery.v1beta1.ForZone map: fields: @@ -9153,6 +9287,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: replicas type: scalar: numeric + - name: terminatingReplicas + type: + scalar: numeric - name: unavailableReplicas type: scalar: numeric @@ -9503,6 +9640,9 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: numeric default: 0 + - name: terminatingReplicas + type: + scalar: numeric - name: io.k8s.api.extensions.v1beta1.RollbackConfig map: fields: @@ -10911,6 +11051,29 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.networking.v1.HTTPIngressPath elementRelationship: atomic +- name: io.k8s.api.networking.v1.IPAddress + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.networking.v1.IPAddressSpec + default: {} +- name: io.k8s.api.networking.v1.IPAddressSpec + map: + fields: + - name: parentRef + type: + namedType: io.k8s.api.networking.v1.ParentReference - name: io.k8s.api.networking.v1.IPBlock map: fields: @@ -11194,6 +11357,21 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: atomic +- name: io.k8s.api.networking.v1.ParentReference + map: + fields: + - name: group + type: + scalar: string + - name: name + type: + scalar: string + - name: namespace + type: + scalar: string + - name: resource + type: + scalar: string - name: io.k8s.api.networking.v1.ServiceBackendPort map: fields: @@ -11204,6 +11382,47 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: numeric elementRelationship: atomic +- name: io.k8s.api.networking.v1.ServiceCIDR + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.networking.v1.ServiceCIDRSpec + default: {} + - name: status + type: + namedType: io.k8s.api.networking.v1.ServiceCIDRStatus + default: {} +- name: io.k8s.api.networking.v1.ServiceCIDRSpec + map: + fields: + - name: cidrs + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.networking.v1.ServiceCIDRStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type - name: io.k8s.api.networking.v1alpha1.IPAddress map: fields: @@ -12396,6 +12615,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.resource.v1alpha3.BasicDevice map: fields: + - name: allNodes + type: + scalar: boolean - name: attributes type: map: @@ -12406,6 +12628,24 @@ var schemaYAML = typed.YAMLObject(`types: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: consumesCounters + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.DeviceCounterConsumption + elementRelationship: atomic + - name: nodeName + type: + scalar: string + - name: nodeSelector + type: + namedType: io.k8s.api.core.v1.NodeSelector + - name: taints + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.DeviceTaint + elementRelationship: atomic - name: io.k8s.api.resource.v1alpha3.CELDeviceSelector map: fields: @@ -12413,6 +12653,24 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" +- name: io.k8s.api.resource.v1alpha3.Counter + map: + fields: + - name: value + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.resource.v1alpha3.CounterSet + map: + fields: + - name: counters + type: + map: + elementType: + namedType: io.k8s.api.resource.v1alpha3.Counter + - name: name + type: + scalar: string + default: "" - name: io.k8s.api.resource.v1alpha3.Device map: fields: @@ -12552,6 +12810,18 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: atomic +- name: io.k8s.api.resource.v1alpha3.DeviceCounterConsumption + map: + fields: + - name: counterSet + type: + scalar: string + default: "" + - name: counters + type: + map: + elementType: + namedType: io.k8s.api.resource.v1alpha3.Counter - name: io.k8s.api.resource.v1alpha3.DeviceRequest map: fields: @@ -12568,6 +12838,12 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" + - name: firstAvailable + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.DeviceSubRequest + elementRelationship: atomic - name: name type: scalar: string @@ -12578,6 +12854,12 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.resource.v1alpha3.DeviceSelector elementRelationship: atomic + - name: tolerations + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.DeviceToleration + elementRelationship: atomic - name: io.k8s.api.resource.v1alpha3.DeviceRequestAllocationResult map: fields: @@ -12600,12 +12882,131 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" + - name: tolerations + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.DeviceToleration + elementRelationship: atomic - name: io.k8s.api.resource.v1alpha3.DeviceSelector map: fields: - name: cel type: namedType: io.k8s.api.resource.v1alpha3.CELDeviceSelector +- name: io.k8s.api.resource.v1alpha3.DeviceSubRequest + map: + fields: + - name: allocationMode + type: + scalar: string + - name: count + type: + scalar: numeric + - name: deviceClassName + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: selectors + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.DeviceSelector + elementRelationship: atomic + - name: tolerations + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.DeviceToleration + elementRelationship: atomic +- name: io.k8s.api.resource.v1alpha3.DeviceTaint + map: + fields: + - name: effect + type: + scalar: string + default: "" + - name: key + type: + scalar: string + default: "" + - name: timeAdded + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: value + type: + scalar: string +- name: io.k8s.api.resource.v1alpha3.DeviceTaintRule + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.resource.v1alpha3.DeviceTaintRuleSpec + default: {} +- name: io.k8s.api.resource.v1alpha3.DeviceTaintRuleSpec + map: + fields: + - name: deviceSelector + type: + namedType: io.k8s.api.resource.v1alpha3.DeviceTaintSelector + - name: taint + type: + namedType: io.k8s.api.resource.v1alpha3.DeviceTaint + default: {} +- name: io.k8s.api.resource.v1alpha3.DeviceTaintSelector + map: + fields: + - name: device + type: + scalar: string + - name: deviceClassName + type: + scalar: string + - name: driver + type: + scalar: string + - name: pool + type: + scalar: string + - name: selectors + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.DeviceSelector + elementRelationship: atomic +- name: io.k8s.api.resource.v1alpha3.DeviceToleration + map: + fields: + - name: effect + type: + scalar: string + - name: key + type: + scalar: string + - name: operator + type: + scalar: string + default: Equal + - name: tolerationSeconds + type: + scalar: numeric + - name: value + type: + scalar: string - name: io.k8s.api.resource.v1alpha3.NetworkDeviceData map: fields: @@ -12783,10 +13184,19 @@ var schemaYAML = typed.YAMLObject(`types: - name: nodeSelector type: namedType: io.k8s.api.core.v1.NodeSelector + - name: perDeviceNodeSelection + type: + scalar: boolean - name: pool type: namedType: io.k8s.api.resource.v1alpha3.ResourcePool default: {} + - name: sharedCounters + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.CounterSet + elementRelationship: atomic - name: io.k8s.api.resource.v1beta1.AllocatedDeviceStatus map: fields: @@ -12829,6 +13239,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.resource.v1beta1.BasicDevice map: fields: + - name: allNodes + type: + scalar: boolean - name: attributes type: map: @@ -12839,6 +13252,24 @@ var schemaYAML = typed.YAMLObject(`types: map: elementType: namedType: io.k8s.api.resource.v1beta1.DeviceCapacity + - name: consumesCounters + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta1.DeviceCounterConsumption + elementRelationship: atomic + - name: nodeName + type: + scalar: string + - name: nodeSelector + type: + namedType: io.k8s.api.core.v1.NodeSelector + - name: taints + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta1.DeviceTaint + elementRelationship: atomic - name: io.k8s.api.resource.v1beta1.CELDeviceSelector map: fields: @@ -12846,6 +13277,24 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" +- name: io.k8s.api.resource.v1beta1.Counter + map: + fields: + - name: value + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.resource.v1beta1.CounterSet + map: + fields: + - name: counters + type: + map: + elementType: + namedType: io.k8s.api.resource.v1beta1.Counter + - name: name + type: + scalar: string + default: "" - name: io.k8s.api.resource.v1beta1.Device map: fields: @@ -12991,6 +13440,18 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: atomic +- name: io.k8s.api.resource.v1beta1.DeviceCounterConsumption + map: + fields: + - name: counterSet + type: + scalar: string + default: "" + - name: counters + type: + map: + elementType: + namedType: io.k8s.api.resource.v1beta1.Counter - name: io.k8s.api.resource.v1beta1.DeviceRequest map: fields: @@ -13007,6 +13468,12 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" + - name: firstAvailable + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta1.DeviceSubRequest + elementRelationship: atomic - name: name type: scalar: string @@ -13017,6 +13484,12 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.resource.v1beta1.DeviceSelector elementRelationship: atomic + - name: tolerations + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta1.DeviceToleration + elementRelationship: atomic - name: io.k8s.api.resource.v1beta1.DeviceRequestAllocationResult map: fields: @@ -13039,12 +13512,83 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" + - name: tolerations + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta1.DeviceToleration + elementRelationship: atomic - name: io.k8s.api.resource.v1beta1.DeviceSelector map: fields: - name: cel type: namedType: io.k8s.api.resource.v1beta1.CELDeviceSelector +- name: io.k8s.api.resource.v1beta1.DeviceSubRequest + map: + fields: + - name: allocationMode + type: + scalar: string + - name: count + type: + scalar: numeric + - name: deviceClassName + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: selectors + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta1.DeviceSelector + elementRelationship: atomic + - name: tolerations + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta1.DeviceToleration + elementRelationship: atomic +- name: io.k8s.api.resource.v1beta1.DeviceTaint + map: + fields: + - name: effect + type: + scalar: string + default: "" + - name: key + type: + scalar: string + default: "" + - name: timeAdded + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: value + type: + scalar: string +- name: io.k8s.api.resource.v1beta1.DeviceToleration + map: + fields: + - name: effect + type: + scalar: string + - name: key + type: + scalar: string + - name: operator + type: + scalar: string + default: Equal + - name: tolerationSeconds + type: + scalar: numeric + - name: value + type: + scalar: string - name: io.k8s.api.resource.v1beta1.NetworkDeviceData map: fields: @@ -13222,10 +13766,601 @@ var schemaYAML = typed.YAMLObject(`types: - name: nodeSelector type: namedType: io.k8s.api.core.v1.NodeSelector + - name: perDeviceNodeSelection + type: + scalar: boolean - name: pool type: namedType: io.k8s.api.resource.v1beta1.ResourcePool default: {} + - name: sharedCounters + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta1.CounterSet + elementRelationship: atomic +- name: io.k8s.api.resource.v1beta2.AllocatedDeviceStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: data + type: + namedType: __untyped_atomic_ + - name: device + type: + scalar: string + default: "" + - name: driver + type: + scalar: string + default: "" + - name: networkData + type: + namedType: io.k8s.api.resource.v1beta2.NetworkDeviceData + - name: pool + type: + scalar: string + default: "" +- name: io.k8s.api.resource.v1beta2.AllocationResult + map: + fields: + - name: devices + type: + namedType: io.k8s.api.resource.v1beta2.DeviceAllocationResult + default: {} + - name: nodeSelector + type: + namedType: io.k8s.api.core.v1.NodeSelector +- name: io.k8s.api.resource.v1beta2.CELDeviceSelector + map: + fields: + - name: expression + type: + scalar: string + default: "" +- name: io.k8s.api.resource.v1beta2.Counter + map: + fields: + - name: value + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.resource.v1beta2.CounterSet + map: + fields: + - name: counters + type: + map: + elementType: + namedType: io.k8s.api.resource.v1beta2.Counter + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.resource.v1beta2.Device + map: + fields: + - name: allNodes + type: + scalar: boolean + - name: attributes + type: + map: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceAttribute + - name: capacity + type: + map: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceCapacity + - name: consumesCounters + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceCounterConsumption + elementRelationship: atomic + - name: name + type: + scalar: string + default: "" + - name: nodeName + type: + scalar: string + - name: nodeSelector + type: + namedType: io.k8s.api.core.v1.NodeSelector + - name: taints + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceTaint + elementRelationship: atomic +- name: io.k8s.api.resource.v1beta2.DeviceAllocationConfiguration + map: + fields: + - name: opaque + type: + namedType: io.k8s.api.resource.v1beta2.OpaqueDeviceConfiguration + - name: requests + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: source + type: + scalar: string + default: "" +- name: io.k8s.api.resource.v1beta2.DeviceAllocationResult + map: + fields: + - name: config + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceAllocationConfiguration + elementRelationship: atomic + - name: results + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceRequestAllocationResult + elementRelationship: atomic +- name: io.k8s.api.resource.v1beta2.DeviceAttribute + map: + fields: + - name: bool + type: + scalar: boolean + - name: int + type: + scalar: numeric + - name: string + type: + scalar: string + - name: version + type: + scalar: string +- name: io.k8s.api.resource.v1beta2.DeviceCapacity + map: + fields: + - name: value + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.resource.v1beta2.DeviceClaim + map: + fields: + - name: config + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceClaimConfiguration + elementRelationship: atomic + - name: constraints + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceConstraint + elementRelationship: atomic + - name: requests + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceRequest + elementRelationship: atomic +- name: io.k8s.api.resource.v1beta2.DeviceClaimConfiguration + map: + fields: + - name: opaque + type: + namedType: io.k8s.api.resource.v1beta2.OpaqueDeviceConfiguration + - name: requests + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.resource.v1beta2.DeviceClass + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.resource.v1beta2.DeviceClassSpec + default: {} +- name: io.k8s.api.resource.v1beta2.DeviceClassConfiguration + map: + fields: + - name: opaque + type: + namedType: io.k8s.api.resource.v1beta2.OpaqueDeviceConfiguration +- name: io.k8s.api.resource.v1beta2.DeviceClassSpec + map: + fields: + - name: config + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceClassConfiguration + elementRelationship: atomic + - name: selectors + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceSelector + elementRelationship: atomic +- name: io.k8s.api.resource.v1beta2.DeviceConstraint + map: + fields: + - name: matchAttribute + type: + scalar: string + - name: requests + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.resource.v1beta2.DeviceCounterConsumption + map: + fields: + - name: counterSet + type: + scalar: string + default: "" + - name: counters + type: + map: + elementType: + namedType: io.k8s.api.resource.v1beta2.Counter +- name: io.k8s.api.resource.v1beta2.DeviceRequest + map: + fields: + - name: exactly + type: + namedType: io.k8s.api.resource.v1beta2.ExactDeviceRequest + - name: firstAvailable + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceSubRequest + elementRelationship: atomic + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.resource.v1beta2.DeviceRequestAllocationResult + map: + fields: + - name: adminAccess + type: + scalar: boolean + - name: device + type: + scalar: string + default: "" + - name: driver + type: + scalar: string + default: "" + - name: pool + type: + scalar: string + default: "" + - name: request + type: + scalar: string + default: "" + - name: tolerations + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceToleration + elementRelationship: atomic +- name: io.k8s.api.resource.v1beta2.DeviceSelector + map: + fields: + - name: cel + type: + namedType: io.k8s.api.resource.v1beta2.CELDeviceSelector +- name: io.k8s.api.resource.v1beta2.DeviceSubRequest + map: + fields: + - name: allocationMode + type: + scalar: string + - name: count + type: + scalar: numeric + - name: deviceClassName + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: selectors + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceSelector + elementRelationship: atomic + - name: tolerations + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceToleration + elementRelationship: atomic +- name: io.k8s.api.resource.v1beta2.DeviceTaint + map: + fields: + - name: effect + type: + scalar: string + default: "" + - name: key + type: + scalar: string + default: "" + - name: timeAdded + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: value + type: + scalar: string +- name: io.k8s.api.resource.v1beta2.DeviceToleration + map: + fields: + - name: effect + type: + scalar: string + - name: key + type: + scalar: string + - name: operator + type: + scalar: string + default: Equal + - name: tolerationSeconds + type: + scalar: numeric + - name: value + type: + scalar: string +- name: io.k8s.api.resource.v1beta2.ExactDeviceRequest + map: + fields: + - name: adminAccess + type: + scalar: boolean + - name: allocationMode + type: + scalar: string + - name: count + type: + scalar: numeric + - name: deviceClassName + type: + scalar: string + default: "" + - name: selectors + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceSelector + elementRelationship: atomic + - name: tolerations + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceToleration + elementRelationship: atomic +- name: io.k8s.api.resource.v1beta2.NetworkDeviceData + map: + fields: + - name: hardwareAddress + type: + scalar: string + - name: interfaceName + type: + scalar: string + - name: ips + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.resource.v1beta2.OpaqueDeviceConfiguration + map: + fields: + - name: driver + type: + scalar: string + default: "" + - name: parameters + type: + namedType: __untyped_atomic_ +- name: io.k8s.api.resource.v1beta2.ResourceClaim + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.resource.v1beta2.ResourceClaimSpec + default: {} + - name: status + type: + namedType: io.k8s.api.resource.v1beta2.ResourceClaimStatus + default: {} +- name: io.k8s.api.resource.v1beta2.ResourceClaimConsumerReference + map: + fields: + - name: apiGroup + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: resource + type: + scalar: string + default: "" + - name: uid + type: + scalar: string + default: "" +- name: io.k8s.api.resource.v1beta2.ResourceClaimSpec + map: + fields: + - name: devices + type: + namedType: io.k8s.api.resource.v1beta2.DeviceClaim + default: {} +- name: io.k8s.api.resource.v1beta2.ResourceClaimStatus + map: + fields: + - name: allocation + type: + namedType: io.k8s.api.resource.v1beta2.AllocationResult + - name: devices + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.AllocatedDeviceStatus + elementRelationship: associative + keys: + - driver + - device + - pool + - name: reservedFor + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.ResourceClaimConsumerReference + elementRelationship: associative + keys: + - uid +- name: io.k8s.api.resource.v1beta2.ResourceClaimTemplate + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.resource.v1beta2.ResourceClaimTemplateSpec + default: {} +- name: io.k8s.api.resource.v1beta2.ResourceClaimTemplateSpec + map: + fields: + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.resource.v1beta2.ResourceClaimSpec + default: {} +- name: io.k8s.api.resource.v1beta2.ResourcePool + map: + fields: + - name: generation + type: + scalar: numeric + default: 0 + - name: name + type: + scalar: string + default: "" + - name: resourceSliceCount + type: + scalar: numeric + default: 0 +- name: io.k8s.api.resource.v1beta2.ResourceSlice + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.resource.v1beta2.ResourceSliceSpec + default: {} +- name: io.k8s.api.resource.v1beta2.ResourceSliceSpec + map: + fields: + - name: allNodes + type: + scalar: boolean + - name: devices + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.Device + elementRelationship: atomic + - name: driver + type: + scalar: string + default: "" + - name: nodeName + type: + scalar: string + - name: nodeSelector + type: + namedType: io.k8s.api.core.v1.NodeSelector + - name: perDeviceNodeSelection + type: + scalar: boolean + - name: pool + type: + namedType: io.k8s.api.resource.v1beta2.ResourcePool + default: {} + - name: sharedCounters + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.CounterSet + elementRelationship: atomic - name: io.k8s.api.scheduling.v1.PriorityClass map: fields: @@ -13330,6 +14465,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: fsGroupPolicy type: scalar: string + - name: nodeAllocatableUpdatePeriodSeconds + type: + scalar: numeric - name: podInfoOnMount type: scalar: boolean @@ -13547,6 +14685,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.storage.v1.VolumeError map: fields: + - name: errorCode + type: + scalar: numeric - name: message type: scalar: string @@ -13673,6 +14814,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.storage.v1alpha1.VolumeError map: fields: + - name: errorCode + type: + scalar: numeric - name: message type: scalar: string @@ -13705,6 +14849,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: fsGroupPolicy type: scalar: string + - name: nodeAllocatableUpdatePeriodSeconds + type: + scalar: numeric - name: podInfoOnMount type: scalar: boolean @@ -13944,6 +15091,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.storage.v1beta1.VolumeError map: fields: + - name: errorCode + type: + scalar: numeric - name: message type: scalar: string diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ipaddress.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ipaddress.go new file mode 100644 index 000000000..f3098b96b --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ipaddress.go @@ -0,0 +1,253 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + networkingv1 "k8s.io/api/networking/v1" + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// IPAddressApplyConfiguration represents a declarative configuration of the IPAddress type for use +// with apply. +type IPAddressApplyConfiguration struct { + metav1.TypeMetaApplyConfiguration `json:",inline"` + *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *IPAddressSpecApplyConfiguration `json:"spec,omitempty"` +} + +// IPAddress constructs a declarative configuration of the IPAddress type for use with +// apply. +func IPAddress(name string) *IPAddressApplyConfiguration { + b := &IPAddressApplyConfiguration{} + b.WithName(name) + b.WithKind("IPAddress") + b.WithAPIVersion("networking.k8s.io/v1") + return b +} + +// ExtractIPAddress extracts the applied configuration owned by fieldManager from +// iPAddress. If no managedFields are found in iPAddress for fieldManager, a +// IPAddressApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// iPAddress must be a unmodified IPAddress API object that was retrieved from the Kubernetes API. +// ExtractIPAddress provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractIPAddress(iPAddress *networkingv1.IPAddress, fieldManager string) (*IPAddressApplyConfiguration, error) { + return extractIPAddress(iPAddress, fieldManager, "") +} + +// ExtractIPAddressStatus is the same as ExtractIPAddress except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractIPAddressStatus(iPAddress *networkingv1.IPAddress, fieldManager string) (*IPAddressApplyConfiguration, error) { + return extractIPAddress(iPAddress, fieldManager, "status") +} + +func extractIPAddress(iPAddress *networkingv1.IPAddress, fieldManager string, subresource string) (*IPAddressApplyConfiguration, error) { + b := &IPAddressApplyConfiguration{} + err := managedfields.ExtractInto(iPAddress, internal.Parser().Type("io.k8s.api.networking.v1.IPAddress"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(iPAddress.Name) + + b.WithKind("IPAddress") + b.WithAPIVersion("networking.k8s.io/v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithKind(value string) *IPAddressApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithAPIVersion(value string) *IPAddressApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithName(value string) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithGenerateName(value string) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithNamespace(value string) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithUID(value types.UID) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithResourceVersion(value string) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithGeneration(value int64) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *IPAddressApplyConfiguration) WithLabels(entries map[string]string) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *IPAddressApplyConfiguration) WithAnnotations(entries map[string]string) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *IPAddressApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *IPAddressApplyConfiguration) WithFinalizers(values ...string) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *IPAddressApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithSpec(value *IPAddressSpecApplyConfiguration) *IPAddressApplyConfiguration { + b.Spec = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *IPAddressApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ipaddressspec.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ipaddressspec.go new file mode 100644 index 000000000..bac6e7912 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ipaddressspec.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// IPAddressSpecApplyConfiguration represents a declarative configuration of the IPAddressSpec type for use +// with apply. +type IPAddressSpecApplyConfiguration struct { + ParentRef *ParentReferenceApplyConfiguration `json:"parentRef,omitempty"` +} + +// IPAddressSpecApplyConfiguration constructs a declarative configuration of the IPAddressSpec type for use with +// apply. +func IPAddressSpec() *IPAddressSpecApplyConfiguration { + return &IPAddressSpecApplyConfiguration{} +} + +// WithParentRef sets the ParentRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ParentRef field is set to the value of the last call. +func (b *IPAddressSpecApplyConfiguration) WithParentRef(value *ParentReferenceApplyConfiguration) *IPAddressSpecApplyConfiguration { + b.ParentRef = value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/parentreference.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/parentreference.go new file mode 100644 index 000000000..896c0f8a6 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/parentreference.go @@ -0,0 +1,66 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ParentReferenceApplyConfiguration represents a declarative configuration of the ParentReference type for use +// with apply. +type ParentReferenceApplyConfiguration struct { + Group *string `json:"group,omitempty"` + Resource *string `json:"resource,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Name *string `json:"name,omitempty"` +} + +// ParentReferenceApplyConfiguration constructs a declarative configuration of the ParentReference type for use with +// apply. +func ParentReference() *ParentReferenceApplyConfiguration { + return &ParentReferenceApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *ParentReferenceApplyConfiguration) WithGroup(value string) *ParentReferenceApplyConfiguration { + b.Group = &value + return b +} + +// WithResource sets the Resource field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Resource field is set to the value of the last call. +func (b *ParentReferenceApplyConfiguration) WithResource(value string) *ParentReferenceApplyConfiguration { + b.Resource = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ParentReferenceApplyConfiguration) WithNamespace(value string) *ParentReferenceApplyConfiguration { + b.Namespace = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ParentReferenceApplyConfiguration) WithName(value string) *ParentReferenceApplyConfiguration { + b.Name = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidr.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidr.go new file mode 100644 index 000000000..1590c1579 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidr.go @@ -0,0 +1,262 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + networkingv1 "k8s.io/api/networking/v1" + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ServiceCIDRApplyConfiguration represents a declarative configuration of the ServiceCIDR type for use +// with apply. +type ServiceCIDRApplyConfiguration struct { + metav1.TypeMetaApplyConfiguration `json:",inline"` + *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ServiceCIDRSpecApplyConfiguration `json:"spec,omitempty"` + Status *ServiceCIDRStatusApplyConfiguration `json:"status,omitempty"` +} + +// ServiceCIDR constructs a declarative configuration of the ServiceCIDR type for use with +// apply. +func ServiceCIDR(name string) *ServiceCIDRApplyConfiguration { + b := &ServiceCIDRApplyConfiguration{} + b.WithName(name) + b.WithKind("ServiceCIDR") + b.WithAPIVersion("networking.k8s.io/v1") + return b +} + +// ExtractServiceCIDR extracts the applied configuration owned by fieldManager from +// serviceCIDR. If no managedFields are found in serviceCIDR for fieldManager, a +// ServiceCIDRApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// serviceCIDR must be a unmodified ServiceCIDR API object that was retrieved from the Kubernetes API. +// ExtractServiceCIDR provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractServiceCIDR(serviceCIDR *networkingv1.ServiceCIDR, fieldManager string) (*ServiceCIDRApplyConfiguration, error) { + return extractServiceCIDR(serviceCIDR, fieldManager, "") +} + +// ExtractServiceCIDRStatus is the same as ExtractServiceCIDR except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractServiceCIDRStatus(serviceCIDR *networkingv1.ServiceCIDR, fieldManager string) (*ServiceCIDRApplyConfiguration, error) { + return extractServiceCIDR(serviceCIDR, fieldManager, "status") +} + +func extractServiceCIDR(serviceCIDR *networkingv1.ServiceCIDR, fieldManager string, subresource string) (*ServiceCIDRApplyConfiguration, error) { + b := &ServiceCIDRApplyConfiguration{} + err := managedfields.ExtractInto(serviceCIDR, internal.Parser().Type("io.k8s.api.networking.v1.ServiceCIDR"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(serviceCIDR.Name) + + b.WithKind("ServiceCIDR") + b.WithAPIVersion("networking.k8s.io/v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithKind(value string) *ServiceCIDRApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithAPIVersion(value string) *ServiceCIDRApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithName(value string) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithGenerateName(value string) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithNamespace(value string) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithUID(value types.UID) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithResourceVersion(value string) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithGeneration(value int64) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ServiceCIDRApplyConfiguration) WithLabels(entries map[string]string) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ServiceCIDRApplyConfiguration) WithAnnotations(entries map[string]string) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ServiceCIDRApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ServiceCIDRApplyConfiguration) WithFinalizers(values ...string) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ServiceCIDRApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithSpec(value *ServiceCIDRSpecApplyConfiguration) *ServiceCIDRApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithStatus(value *ServiceCIDRStatusApplyConfiguration) *ServiceCIDRApplyConfiguration { + b.Status = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ServiceCIDRApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidrspec.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidrspec.go new file mode 100644 index 000000000..f84b7ba1e --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidrspec.go @@ -0,0 +1,41 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ServiceCIDRSpecApplyConfiguration represents a declarative configuration of the ServiceCIDRSpec type for use +// with apply. +type ServiceCIDRSpecApplyConfiguration struct { + CIDRs []string `json:"cidrs,omitempty"` +} + +// ServiceCIDRSpecApplyConfiguration constructs a declarative configuration of the ServiceCIDRSpec type for use with +// apply. +func ServiceCIDRSpec() *ServiceCIDRSpecApplyConfiguration { + return &ServiceCIDRSpecApplyConfiguration{} +} + +// WithCIDRs adds the given value to the CIDRs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CIDRs field. +func (b *ServiceCIDRSpecApplyConfiguration) WithCIDRs(values ...string) *ServiceCIDRSpecApplyConfiguration { + for i := range values { + b.CIDRs = append(b.CIDRs, values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidrstatus.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidrstatus.go new file mode 100644 index 000000000..9e3d52ae8 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidrstatus.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ServiceCIDRStatusApplyConfiguration represents a declarative configuration of the ServiceCIDRStatus type for use +// with apply. +type ServiceCIDRStatusApplyConfiguration struct { + Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` +} + +// ServiceCIDRStatusApplyConfiguration constructs a declarative configuration of the ServiceCIDRStatus type for use with +// apply. +func ServiceCIDRStatus() *ServiceCIDRStatusApplyConfiguration { + return &ServiceCIDRStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *ServiceCIDRStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *ServiceCIDRStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/basicdevice.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/basicdevice.go index b58e43294..382ed2a22 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/basicdevice.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/basicdevice.go @@ -21,13 +21,19 @@ package v1alpha3 import ( resourcev1alpha3 "k8s.io/api/resource/v1alpha3" resource "k8s.io/apimachinery/pkg/api/resource" + v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // BasicDeviceApplyConfiguration represents a declarative configuration of the BasicDevice type for use // with apply. type BasicDeviceApplyConfiguration struct { - Attributes map[resourcev1alpha3.QualifiedName]DeviceAttributeApplyConfiguration `json:"attributes,omitempty"` - Capacity map[resourcev1alpha3.QualifiedName]resource.Quantity `json:"capacity,omitempty"` + Attributes map[resourcev1alpha3.QualifiedName]DeviceAttributeApplyConfiguration `json:"attributes,omitempty"` + Capacity map[resourcev1alpha3.QualifiedName]resource.Quantity `json:"capacity,omitempty"` + ConsumesCounters []DeviceCounterConsumptionApplyConfiguration `json:"consumesCounters,omitempty"` + NodeName *string `json:"nodeName,omitempty"` + NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"` + AllNodes *bool `json:"allNodes,omitempty"` + Taints []DeviceTaintApplyConfiguration `json:"taints,omitempty"` } // BasicDeviceApplyConfiguration constructs a declarative configuration of the BasicDevice type for use with @@ -63,3 +69,53 @@ func (b *BasicDeviceApplyConfiguration) WithCapacity(entries map[resourcev1alpha } return b } + +// WithConsumesCounters adds the given value to the ConsumesCounters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ConsumesCounters field. +func (b *BasicDeviceApplyConfiguration) WithConsumesCounters(values ...*DeviceCounterConsumptionApplyConfiguration) *BasicDeviceApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConsumesCounters") + } + b.ConsumesCounters = append(b.ConsumesCounters, *values[i]) + } + return b +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *BasicDeviceApplyConfiguration) WithNodeName(value string) *BasicDeviceApplyConfiguration { + b.NodeName = &value + return b +} + +// WithNodeSelector sets the NodeSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeSelector field is set to the value of the last call. +func (b *BasicDeviceApplyConfiguration) WithNodeSelector(value *v1.NodeSelectorApplyConfiguration) *BasicDeviceApplyConfiguration { + b.NodeSelector = value + return b +} + +// WithAllNodes sets the AllNodes field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllNodes field is set to the value of the last call. +func (b *BasicDeviceApplyConfiguration) WithAllNodes(value bool) *BasicDeviceApplyConfiguration { + b.AllNodes = &value + return b +} + +// WithTaints adds the given value to the Taints field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Taints field. +func (b *BasicDeviceApplyConfiguration) WithTaints(values ...*DeviceTaintApplyConfiguration) *BasicDeviceApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTaints") + } + b.Taints = append(b.Taints, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/counter.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/counter.go new file mode 100644 index 000000000..10a752ee0 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/counter.go @@ -0,0 +1,43 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// CounterApplyConfiguration represents a declarative configuration of the Counter type for use +// with apply. +type CounterApplyConfiguration struct { + Value *resource.Quantity `json:"value,omitempty"` +} + +// CounterApplyConfiguration constructs a declarative configuration of the Counter type for use with +// apply. +func Counter() *CounterApplyConfiguration { + return &CounterApplyConfiguration{} +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *CounterApplyConfiguration) WithValue(value resource.Quantity) *CounterApplyConfiguration { + b.Value = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/counterset.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/counterset.go new file mode 100644 index 000000000..aa917c6ff --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/counterset.go @@ -0,0 +1,54 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// CounterSetApplyConfiguration represents a declarative configuration of the CounterSet type for use +// with apply. +type CounterSetApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Counters map[string]CounterApplyConfiguration `json:"counters,omitempty"` +} + +// CounterSetApplyConfiguration constructs a declarative configuration of the CounterSet type for use with +// apply. +func CounterSet() *CounterSetApplyConfiguration { + return &CounterSetApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *CounterSetApplyConfiguration) WithName(value string) *CounterSetApplyConfiguration { + b.Name = &value + return b +} + +// WithCounters puts the entries into the Counters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Counters field, +// overwriting an existing map entries in Counters field with the same key. +func (b *CounterSetApplyConfiguration) WithCounters(entries map[string]CounterApplyConfiguration) *CounterSetApplyConfiguration { + if b.Counters == nil && len(entries) > 0 { + b.Counters = make(map[string]CounterApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Counters[k] = v + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicecounterconsumption.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicecounterconsumption.go new file mode 100644 index 000000000..53deb747e --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicecounterconsumption.go @@ -0,0 +1,54 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// DeviceCounterConsumptionApplyConfiguration represents a declarative configuration of the DeviceCounterConsumption type for use +// with apply. +type DeviceCounterConsumptionApplyConfiguration struct { + CounterSet *string `json:"counterSet,omitempty"` + Counters map[string]CounterApplyConfiguration `json:"counters,omitempty"` +} + +// DeviceCounterConsumptionApplyConfiguration constructs a declarative configuration of the DeviceCounterConsumption type for use with +// apply. +func DeviceCounterConsumption() *DeviceCounterConsumptionApplyConfiguration { + return &DeviceCounterConsumptionApplyConfiguration{} +} + +// WithCounterSet sets the CounterSet field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CounterSet field is set to the value of the last call. +func (b *DeviceCounterConsumptionApplyConfiguration) WithCounterSet(value string) *DeviceCounterConsumptionApplyConfiguration { + b.CounterSet = &value + return b +} + +// WithCounters puts the entries into the Counters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Counters field, +// overwriting an existing map entries in Counters field with the same key. +func (b *DeviceCounterConsumptionApplyConfiguration) WithCounters(entries map[string]CounterApplyConfiguration) *DeviceCounterConsumptionApplyConfiguration { + if b.Counters == nil && len(entries) > 0 { + b.Counters = make(map[string]CounterApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Counters[k] = v + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicerequest.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicerequest.go index e5c87efe4..bff72a3f5 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicerequest.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicerequest.go @@ -31,6 +31,8 @@ type DeviceRequestApplyConfiguration struct { AllocationMode *resourcev1alpha3.DeviceAllocationMode `json:"allocationMode,omitempty"` Count *int64 `json:"count,omitempty"` AdminAccess *bool `json:"adminAccess,omitempty"` + FirstAvailable []DeviceSubRequestApplyConfiguration `json:"firstAvailable,omitempty"` + Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"` } // DeviceRequestApplyConfiguration constructs a declarative configuration of the DeviceRequest type for use with @@ -91,3 +93,29 @@ func (b *DeviceRequestApplyConfiguration) WithAdminAccess(value bool) *DeviceReq b.AdminAccess = &value return b } + +// WithFirstAvailable adds the given value to the FirstAvailable field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the FirstAvailable field. +func (b *DeviceRequestApplyConfiguration) WithFirstAvailable(values ...*DeviceSubRequestApplyConfiguration) *DeviceRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithFirstAvailable") + } + b.FirstAvailable = append(b.FirstAvailable, *values[i]) + } + return b +} + +// WithTolerations adds the given value to the Tolerations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Tolerations field. +func (b *DeviceRequestApplyConfiguration) WithTolerations(values ...*DeviceTolerationApplyConfiguration) *DeviceRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTolerations") + } + b.Tolerations = append(b.Tolerations, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicerequestallocationresult.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicerequestallocationresult.go index 4c3cffcf4..ec8c78e2e 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicerequestallocationresult.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicerequestallocationresult.go @@ -21,11 +21,12 @@ package v1alpha3 // DeviceRequestAllocationResultApplyConfiguration represents a declarative configuration of the DeviceRequestAllocationResult type for use // with apply. type DeviceRequestAllocationResultApplyConfiguration struct { - Request *string `json:"request,omitempty"` - Driver *string `json:"driver,omitempty"` - Pool *string `json:"pool,omitempty"` - Device *string `json:"device,omitempty"` - AdminAccess *bool `json:"adminAccess,omitempty"` + Request *string `json:"request,omitempty"` + Driver *string `json:"driver,omitempty"` + Pool *string `json:"pool,omitempty"` + Device *string `json:"device,omitempty"` + AdminAccess *bool `json:"adminAccess,omitempty"` + Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"` } // DeviceRequestAllocationResultApplyConfiguration constructs a declarative configuration of the DeviceRequestAllocationResult type for use with @@ -73,3 +74,16 @@ func (b *DeviceRequestAllocationResultApplyConfiguration) WithAdminAccess(value b.AdminAccess = &value return b } + +// WithTolerations adds the given value to the Tolerations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Tolerations field. +func (b *DeviceRequestAllocationResultApplyConfiguration) WithTolerations(values ...*DeviceTolerationApplyConfiguration) *DeviceRequestAllocationResultApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTolerations") + } + b.Tolerations = append(b.Tolerations, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicesubrequest.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicesubrequest.go new file mode 100644 index 000000000..249dcd1f2 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicesubrequest.go @@ -0,0 +1,98 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" +) + +// DeviceSubRequestApplyConfiguration represents a declarative configuration of the DeviceSubRequest type for use +// with apply. +type DeviceSubRequestApplyConfiguration struct { + Name *string `json:"name,omitempty"` + DeviceClassName *string `json:"deviceClassName,omitempty"` + Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` + AllocationMode *resourcev1alpha3.DeviceAllocationMode `json:"allocationMode,omitempty"` + Count *int64 `json:"count,omitempty"` + Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"` +} + +// DeviceSubRequestApplyConfiguration constructs a declarative configuration of the DeviceSubRequest type for use with +// apply. +func DeviceSubRequest() *DeviceSubRequestApplyConfiguration { + return &DeviceSubRequestApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *DeviceSubRequestApplyConfiguration) WithName(value string) *DeviceSubRequestApplyConfiguration { + b.Name = &value + return b +} + +// WithDeviceClassName sets the DeviceClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeviceClassName field is set to the value of the last call. +func (b *DeviceSubRequestApplyConfiguration) WithDeviceClassName(value string) *DeviceSubRequestApplyConfiguration { + b.DeviceClassName = &value + return b +} + +// WithSelectors adds the given value to the Selectors field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Selectors field. +func (b *DeviceSubRequestApplyConfiguration) WithSelectors(values ...*DeviceSelectorApplyConfiguration) *DeviceSubRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSelectors") + } + b.Selectors = append(b.Selectors, *values[i]) + } + return b +} + +// WithAllocationMode sets the AllocationMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllocationMode field is set to the value of the last call. +func (b *DeviceSubRequestApplyConfiguration) WithAllocationMode(value resourcev1alpha3.DeviceAllocationMode) *DeviceSubRequestApplyConfiguration { + b.AllocationMode = &value + return b +} + +// WithCount sets the Count field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Count field is set to the value of the last call. +func (b *DeviceSubRequestApplyConfiguration) WithCount(value int64) *DeviceSubRequestApplyConfiguration { + b.Count = &value + return b +} + +// WithTolerations adds the given value to the Tolerations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Tolerations field. +func (b *DeviceSubRequestApplyConfiguration) WithTolerations(values ...*DeviceTolerationApplyConfiguration) *DeviceSubRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTolerations") + } + b.Tolerations = append(b.Tolerations, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaint.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaint.go new file mode 100644 index 000000000..0dcd9a58c --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaint.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// DeviceTaintApplyConfiguration represents a declarative configuration of the DeviceTaint type for use +// with apply. +type DeviceTaintApplyConfiguration struct { + Key *string `json:"key,omitempty"` + Value *string `json:"value,omitempty"` + Effect *resourcev1alpha3.DeviceTaintEffect `json:"effect,omitempty"` + TimeAdded *v1.Time `json:"timeAdded,omitempty"` +} + +// DeviceTaintApplyConfiguration constructs a declarative configuration of the DeviceTaint type for use with +// apply. +func DeviceTaint() *DeviceTaintApplyConfiguration { + return &DeviceTaintApplyConfiguration{} +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *DeviceTaintApplyConfiguration) WithKey(value string) *DeviceTaintApplyConfiguration { + b.Key = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *DeviceTaintApplyConfiguration) WithValue(value string) *DeviceTaintApplyConfiguration { + b.Value = &value + return b +} + +// WithEffect sets the Effect field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Effect field is set to the value of the last call. +func (b *DeviceTaintApplyConfiguration) WithEffect(value resourcev1alpha3.DeviceTaintEffect) *DeviceTaintApplyConfiguration { + b.Effect = &value + return b +} + +// WithTimeAdded sets the TimeAdded field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TimeAdded field is set to the value of the last call. +func (b *DeviceTaintApplyConfiguration) WithTimeAdded(value v1.Time) *DeviceTaintApplyConfiguration { + b.TimeAdded = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaintrule.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaintrule.go new file mode 100644 index 000000000..d4f84399a --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaintrule.go @@ -0,0 +1,253 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// DeviceTaintRuleApplyConfiguration represents a declarative configuration of the DeviceTaintRule type for use +// with apply. +type DeviceTaintRuleApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *DeviceTaintRuleSpecApplyConfiguration `json:"spec,omitempty"` +} + +// DeviceTaintRule constructs a declarative configuration of the DeviceTaintRule type for use with +// apply. +func DeviceTaintRule(name string) *DeviceTaintRuleApplyConfiguration { + b := &DeviceTaintRuleApplyConfiguration{} + b.WithName(name) + b.WithKind("DeviceTaintRule") + b.WithAPIVersion("resource.k8s.io/v1alpha3") + return b +} + +// ExtractDeviceTaintRule extracts the applied configuration owned by fieldManager from +// deviceTaintRule. If no managedFields are found in deviceTaintRule for fieldManager, a +// DeviceTaintRuleApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// deviceTaintRule must be a unmodified DeviceTaintRule API object that was retrieved from the Kubernetes API. +// ExtractDeviceTaintRule provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractDeviceTaintRule(deviceTaintRule *resourcev1alpha3.DeviceTaintRule, fieldManager string) (*DeviceTaintRuleApplyConfiguration, error) { + return extractDeviceTaintRule(deviceTaintRule, fieldManager, "") +} + +// ExtractDeviceTaintRuleStatus is the same as ExtractDeviceTaintRule except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractDeviceTaintRuleStatus(deviceTaintRule *resourcev1alpha3.DeviceTaintRule, fieldManager string) (*DeviceTaintRuleApplyConfiguration, error) { + return extractDeviceTaintRule(deviceTaintRule, fieldManager, "status") +} + +func extractDeviceTaintRule(deviceTaintRule *resourcev1alpha3.DeviceTaintRule, fieldManager string, subresource string) (*DeviceTaintRuleApplyConfiguration, error) { + b := &DeviceTaintRuleApplyConfiguration{} + err := managedfields.ExtractInto(deviceTaintRule, internal.Parser().Type("io.k8s.api.resource.v1alpha3.DeviceTaintRule"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(deviceTaintRule.Name) + + b.WithKind("DeviceTaintRule") + b.WithAPIVersion("resource.k8s.io/v1alpha3") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithKind(value string) *DeviceTaintRuleApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithAPIVersion(value string) *DeviceTaintRuleApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithName(value string) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithGenerateName(value string) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithNamespace(value string) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithUID(value types.UID) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithResourceVersion(value string) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithGeneration(value int64) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *DeviceTaintRuleApplyConfiguration) WithLabels(entries map[string]string) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *DeviceTaintRuleApplyConfiguration) WithAnnotations(entries map[string]string) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *DeviceTaintRuleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *DeviceTaintRuleApplyConfiguration) WithFinalizers(values ...string) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *DeviceTaintRuleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithSpec(value *DeviceTaintRuleSpecApplyConfiguration) *DeviceTaintRuleApplyConfiguration { + b.Spec = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *DeviceTaintRuleApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaintrulespec.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaintrulespec.go new file mode 100644 index 000000000..a14ada3d4 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaintrulespec.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// DeviceTaintRuleSpecApplyConfiguration represents a declarative configuration of the DeviceTaintRuleSpec type for use +// with apply. +type DeviceTaintRuleSpecApplyConfiguration struct { + DeviceSelector *DeviceTaintSelectorApplyConfiguration `json:"deviceSelector,omitempty"` + Taint *DeviceTaintApplyConfiguration `json:"taint,omitempty"` +} + +// DeviceTaintRuleSpecApplyConfiguration constructs a declarative configuration of the DeviceTaintRuleSpec type for use with +// apply. +func DeviceTaintRuleSpec() *DeviceTaintRuleSpecApplyConfiguration { + return &DeviceTaintRuleSpecApplyConfiguration{} +} + +// WithDeviceSelector sets the DeviceSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeviceSelector field is set to the value of the last call. +func (b *DeviceTaintRuleSpecApplyConfiguration) WithDeviceSelector(value *DeviceTaintSelectorApplyConfiguration) *DeviceTaintRuleSpecApplyConfiguration { + b.DeviceSelector = value + return b +} + +// WithTaint sets the Taint field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Taint field is set to the value of the last call. +func (b *DeviceTaintRuleSpecApplyConfiguration) WithTaint(value *DeviceTaintApplyConfiguration) *DeviceTaintRuleSpecApplyConfiguration { + b.Taint = value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaintselector.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaintselector.go new file mode 100644 index 000000000..aecb2aa24 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaintselector.go @@ -0,0 +1,80 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// DeviceTaintSelectorApplyConfiguration represents a declarative configuration of the DeviceTaintSelector type for use +// with apply. +type DeviceTaintSelectorApplyConfiguration struct { + DeviceClassName *string `json:"deviceClassName,omitempty"` + Driver *string `json:"driver,omitempty"` + Pool *string `json:"pool,omitempty"` + Device *string `json:"device,omitempty"` + Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` +} + +// DeviceTaintSelectorApplyConfiguration constructs a declarative configuration of the DeviceTaintSelector type for use with +// apply. +func DeviceTaintSelector() *DeviceTaintSelectorApplyConfiguration { + return &DeviceTaintSelectorApplyConfiguration{} +} + +// WithDeviceClassName sets the DeviceClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeviceClassName field is set to the value of the last call. +func (b *DeviceTaintSelectorApplyConfiguration) WithDeviceClassName(value string) *DeviceTaintSelectorApplyConfiguration { + b.DeviceClassName = &value + return b +} + +// WithDriver sets the Driver field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Driver field is set to the value of the last call. +func (b *DeviceTaintSelectorApplyConfiguration) WithDriver(value string) *DeviceTaintSelectorApplyConfiguration { + b.Driver = &value + return b +} + +// WithPool sets the Pool field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Pool field is set to the value of the last call. +func (b *DeviceTaintSelectorApplyConfiguration) WithPool(value string) *DeviceTaintSelectorApplyConfiguration { + b.Pool = &value + return b +} + +// WithDevice sets the Device field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Device field is set to the value of the last call. +func (b *DeviceTaintSelectorApplyConfiguration) WithDevice(value string) *DeviceTaintSelectorApplyConfiguration { + b.Device = &value + return b +} + +// WithSelectors adds the given value to the Selectors field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Selectors field. +func (b *DeviceTaintSelectorApplyConfiguration) WithSelectors(values ...*DeviceSelectorApplyConfiguration) *DeviceTaintSelectorApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSelectors") + } + b.Selectors = append(b.Selectors, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetoleration.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetoleration.go new file mode 100644 index 000000000..fe4a67419 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetoleration.go @@ -0,0 +1,79 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" +) + +// DeviceTolerationApplyConfiguration represents a declarative configuration of the DeviceToleration type for use +// with apply. +type DeviceTolerationApplyConfiguration struct { + Key *string `json:"key,omitempty"` + Operator *resourcev1alpha3.DeviceTolerationOperator `json:"operator,omitempty"` + Value *string `json:"value,omitempty"` + Effect *resourcev1alpha3.DeviceTaintEffect `json:"effect,omitempty"` + TolerationSeconds *int64 `json:"tolerationSeconds,omitempty"` +} + +// DeviceTolerationApplyConfiguration constructs a declarative configuration of the DeviceToleration type for use with +// apply. +func DeviceToleration() *DeviceTolerationApplyConfiguration { + return &DeviceTolerationApplyConfiguration{} +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *DeviceTolerationApplyConfiguration) WithKey(value string) *DeviceTolerationApplyConfiguration { + b.Key = &value + return b +} + +// WithOperator sets the Operator field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Operator field is set to the value of the last call. +func (b *DeviceTolerationApplyConfiguration) WithOperator(value resourcev1alpha3.DeviceTolerationOperator) *DeviceTolerationApplyConfiguration { + b.Operator = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *DeviceTolerationApplyConfiguration) WithValue(value string) *DeviceTolerationApplyConfiguration { + b.Value = &value + return b +} + +// WithEffect sets the Effect field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Effect field is set to the value of the last call. +func (b *DeviceTolerationApplyConfiguration) WithEffect(value resourcev1alpha3.DeviceTaintEffect) *DeviceTolerationApplyConfiguration { + b.Effect = &value + return b +} + +// WithTolerationSeconds sets the TolerationSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TolerationSeconds field is set to the value of the last call. +func (b *DeviceTolerationApplyConfiguration) WithTolerationSeconds(value int64) *DeviceTolerationApplyConfiguration { + b.TolerationSeconds = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceslicespec.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceslicespec.go index 2ded75907..ec490760f 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceslicespec.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceslicespec.go @@ -25,12 +25,14 @@ import ( // ResourceSliceSpecApplyConfiguration represents a declarative configuration of the ResourceSliceSpec type for use // with apply. type ResourceSliceSpecApplyConfiguration struct { - Driver *string `json:"driver,omitempty"` - Pool *ResourcePoolApplyConfiguration `json:"pool,omitempty"` - NodeName *string `json:"nodeName,omitempty"` - NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"` - AllNodes *bool `json:"allNodes,omitempty"` - Devices []DeviceApplyConfiguration `json:"devices,omitempty"` + Driver *string `json:"driver,omitempty"` + Pool *ResourcePoolApplyConfiguration `json:"pool,omitempty"` + NodeName *string `json:"nodeName,omitempty"` + NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"` + AllNodes *bool `json:"allNodes,omitempty"` + Devices []DeviceApplyConfiguration `json:"devices,omitempty"` + PerDeviceNodeSelection *bool `json:"perDeviceNodeSelection,omitempty"` + SharedCounters []CounterSetApplyConfiguration `json:"sharedCounters,omitempty"` } // ResourceSliceSpecApplyConfiguration constructs a declarative configuration of the ResourceSliceSpec type for use with @@ -91,3 +93,24 @@ func (b *ResourceSliceSpecApplyConfiguration) WithDevices(values ...*DeviceApply } return b } + +// WithPerDeviceNodeSelection sets the PerDeviceNodeSelection field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PerDeviceNodeSelection field is set to the value of the last call. +func (b *ResourceSliceSpecApplyConfiguration) WithPerDeviceNodeSelection(value bool) *ResourceSliceSpecApplyConfiguration { + b.PerDeviceNodeSelection = &value + return b +} + +// WithSharedCounters adds the given value to the SharedCounters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SharedCounters field. +func (b *ResourceSliceSpecApplyConfiguration) WithSharedCounters(values ...*CounterSetApplyConfiguration) *ResourceSliceSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSharedCounters") + } + b.SharedCounters = append(b.SharedCounters, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/basicdevice.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/basicdevice.go index 691a8f15a..065d0bf4f 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/basicdevice.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/basicdevice.go @@ -20,13 +20,19 @@ package v1beta1 import ( resourcev1beta1 "k8s.io/api/resource/v1beta1" + v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // BasicDeviceApplyConfiguration represents a declarative configuration of the BasicDevice type for use // with apply. type BasicDeviceApplyConfiguration struct { - Attributes map[resourcev1beta1.QualifiedName]DeviceAttributeApplyConfiguration `json:"attributes,omitempty"` - Capacity map[resourcev1beta1.QualifiedName]DeviceCapacityApplyConfiguration `json:"capacity,omitempty"` + Attributes map[resourcev1beta1.QualifiedName]DeviceAttributeApplyConfiguration `json:"attributes,omitempty"` + Capacity map[resourcev1beta1.QualifiedName]DeviceCapacityApplyConfiguration `json:"capacity,omitempty"` + ConsumesCounters []DeviceCounterConsumptionApplyConfiguration `json:"consumesCounters,omitempty"` + NodeName *string `json:"nodeName,omitempty"` + NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"` + AllNodes *bool `json:"allNodes,omitempty"` + Taints []DeviceTaintApplyConfiguration `json:"taints,omitempty"` } // BasicDeviceApplyConfiguration constructs a declarative configuration of the BasicDevice type for use with @@ -62,3 +68,53 @@ func (b *BasicDeviceApplyConfiguration) WithCapacity(entries map[resourcev1beta1 } return b } + +// WithConsumesCounters adds the given value to the ConsumesCounters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ConsumesCounters field. +func (b *BasicDeviceApplyConfiguration) WithConsumesCounters(values ...*DeviceCounterConsumptionApplyConfiguration) *BasicDeviceApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConsumesCounters") + } + b.ConsumesCounters = append(b.ConsumesCounters, *values[i]) + } + return b +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *BasicDeviceApplyConfiguration) WithNodeName(value string) *BasicDeviceApplyConfiguration { + b.NodeName = &value + return b +} + +// WithNodeSelector sets the NodeSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeSelector field is set to the value of the last call. +func (b *BasicDeviceApplyConfiguration) WithNodeSelector(value *v1.NodeSelectorApplyConfiguration) *BasicDeviceApplyConfiguration { + b.NodeSelector = value + return b +} + +// WithAllNodes sets the AllNodes field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllNodes field is set to the value of the last call. +func (b *BasicDeviceApplyConfiguration) WithAllNodes(value bool) *BasicDeviceApplyConfiguration { + b.AllNodes = &value + return b +} + +// WithTaints adds the given value to the Taints field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Taints field. +func (b *BasicDeviceApplyConfiguration) WithTaints(values ...*DeviceTaintApplyConfiguration) *BasicDeviceApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTaints") + } + b.Taints = append(b.Taints, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/counter.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/counter.go new file mode 100644 index 000000000..b33ed99a5 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/counter.go @@ -0,0 +1,43 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// CounterApplyConfiguration represents a declarative configuration of the Counter type for use +// with apply. +type CounterApplyConfiguration struct { + Value *resource.Quantity `json:"value,omitempty"` +} + +// CounterApplyConfiguration constructs a declarative configuration of the Counter type for use with +// apply. +func Counter() *CounterApplyConfiguration { + return &CounterApplyConfiguration{} +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *CounterApplyConfiguration) WithValue(value resource.Quantity) *CounterApplyConfiguration { + b.Value = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/counterset.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/counterset.go new file mode 100644 index 000000000..7592fa4d5 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/counterset.go @@ -0,0 +1,54 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// CounterSetApplyConfiguration represents a declarative configuration of the CounterSet type for use +// with apply. +type CounterSetApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Counters map[string]CounterApplyConfiguration `json:"counters,omitempty"` +} + +// CounterSetApplyConfiguration constructs a declarative configuration of the CounterSet type for use with +// apply. +func CounterSet() *CounterSetApplyConfiguration { + return &CounterSetApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *CounterSetApplyConfiguration) WithName(value string) *CounterSetApplyConfiguration { + b.Name = &value + return b +} + +// WithCounters puts the entries into the Counters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Counters field, +// overwriting an existing map entries in Counters field with the same key. +func (b *CounterSetApplyConfiguration) WithCounters(entries map[string]CounterApplyConfiguration) *CounterSetApplyConfiguration { + if b.Counters == nil && len(entries) > 0 { + b.Counters = make(map[string]CounterApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Counters[k] = v + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicecounterconsumption.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicecounterconsumption.go new file mode 100644 index 000000000..a8a8a5f58 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicecounterconsumption.go @@ -0,0 +1,54 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// DeviceCounterConsumptionApplyConfiguration represents a declarative configuration of the DeviceCounterConsumption type for use +// with apply. +type DeviceCounterConsumptionApplyConfiguration struct { + CounterSet *string `json:"counterSet,omitempty"` + Counters map[string]CounterApplyConfiguration `json:"counters,omitempty"` +} + +// DeviceCounterConsumptionApplyConfiguration constructs a declarative configuration of the DeviceCounterConsumption type for use with +// apply. +func DeviceCounterConsumption() *DeviceCounterConsumptionApplyConfiguration { + return &DeviceCounterConsumptionApplyConfiguration{} +} + +// WithCounterSet sets the CounterSet field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CounterSet field is set to the value of the last call. +func (b *DeviceCounterConsumptionApplyConfiguration) WithCounterSet(value string) *DeviceCounterConsumptionApplyConfiguration { + b.CounterSet = &value + return b +} + +// WithCounters puts the entries into the Counters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Counters field, +// overwriting an existing map entries in Counters field with the same key. +func (b *DeviceCounterConsumptionApplyConfiguration) WithCounters(entries map[string]CounterApplyConfiguration) *DeviceCounterConsumptionApplyConfiguration { + if b.Counters == nil && len(entries) > 0 { + b.Counters = make(map[string]CounterApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Counters[k] = v + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicerequest.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicerequest.go index ea454a275..1be114f02 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicerequest.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicerequest.go @@ -31,6 +31,8 @@ type DeviceRequestApplyConfiguration struct { AllocationMode *resourcev1beta1.DeviceAllocationMode `json:"allocationMode,omitempty"` Count *int64 `json:"count,omitempty"` AdminAccess *bool `json:"adminAccess,omitempty"` + FirstAvailable []DeviceSubRequestApplyConfiguration `json:"firstAvailable,omitempty"` + Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"` } // DeviceRequestApplyConfiguration constructs a declarative configuration of the DeviceRequest type for use with @@ -91,3 +93,29 @@ func (b *DeviceRequestApplyConfiguration) WithAdminAccess(value bool) *DeviceReq b.AdminAccess = &value return b } + +// WithFirstAvailable adds the given value to the FirstAvailable field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the FirstAvailable field. +func (b *DeviceRequestApplyConfiguration) WithFirstAvailable(values ...*DeviceSubRequestApplyConfiguration) *DeviceRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithFirstAvailable") + } + b.FirstAvailable = append(b.FirstAvailable, *values[i]) + } + return b +} + +// WithTolerations adds the given value to the Tolerations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Tolerations field. +func (b *DeviceRequestApplyConfiguration) WithTolerations(values ...*DeviceTolerationApplyConfiguration) *DeviceRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTolerations") + } + b.Tolerations = append(b.Tolerations, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicerequestallocationresult.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicerequestallocationresult.go index c28eb26ab..aa207351d 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicerequestallocationresult.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicerequestallocationresult.go @@ -21,11 +21,12 @@ package v1beta1 // DeviceRequestAllocationResultApplyConfiguration represents a declarative configuration of the DeviceRequestAllocationResult type for use // with apply. type DeviceRequestAllocationResultApplyConfiguration struct { - Request *string `json:"request,omitempty"` - Driver *string `json:"driver,omitempty"` - Pool *string `json:"pool,omitempty"` - Device *string `json:"device,omitempty"` - AdminAccess *bool `json:"adminAccess,omitempty"` + Request *string `json:"request,omitempty"` + Driver *string `json:"driver,omitempty"` + Pool *string `json:"pool,omitempty"` + Device *string `json:"device,omitempty"` + AdminAccess *bool `json:"adminAccess,omitempty"` + Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"` } // DeviceRequestAllocationResultApplyConfiguration constructs a declarative configuration of the DeviceRequestAllocationResult type for use with @@ -73,3 +74,16 @@ func (b *DeviceRequestAllocationResultApplyConfiguration) WithAdminAccess(value b.AdminAccess = &value return b } + +// WithTolerations adds the given value to the Tolerations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Tolerations field. +func (b *DeviceRequestAllocationResultApplyConfiguration) WithTolerations(values ...*DeviceTolerationApplyConfiguration) *DeviceRequestAllocationResultApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTolerations") + } + b.Tolerations = append(b.Tolerations, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicesubrequest.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicesubrequest.go new file mode 100644 index 000000000..f2ea82001 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicesubrequest.go @@ -0,0 +1,98 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + resourcev1beta1 "k8s.io/api/resource/v1beta1" +) + +// DeviceSubRequestApplyConfiguration represents a declarative configuration of the DeviceSubRequest type for use +// with apply. +type DeviceSubRequestApplyConfiguration struct { + Name *string `json:"name,omitempty"` + DeviceClassName *string `json:"deviceClassName,omitempty"` + Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` + AllocationMode *resourcev1beta1.DeviceAllocationMode `json:"allocationMode,omitempty"` + Count *int64 `json:"count,omitempty"` + Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"` +} + +// DeviceSubRequestApplyConfiguration constructs a declarative configuration of the DeviceSubRequest type for use with +// apply. +func DeviceSubRequest() *DeviceSubRequestApplyConfiguration { + return &DeviceSubRequestApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *DeviceSubRequestApplyConfiguration) WithName(value string) *DeviceSubRequestApplyConfiguration { + b.Name = &value + return b +} + +// WithDeviceClassName sets the DeviceClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeviceClassName field is set to the value of the last call. +func (b *DeviceSubRequestApplyConfiguration) WithDeviceClassName(value string) *DeviceSubRequestApplyConfiguration { + b.DeviceClassName = &value + return b +} + +// WithSelectors adds the given value to the Selectors field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Selectors field. +func (b *DeviceSubRequestApplyConfiguration) WithSelectors(values ...*DeviceSelectorApplyConfiguration) *DeviceSubRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSelectors") + } + b.Selectors = append(b.Selectors, *values[i]) + } + return b +} + +// WithAllocationMode sets the AllocationMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllocationMode field is set to the value of the last call. +func (b *DeviceSubRequestApplyConfiguration) WithAllocationMode(value resourcev1beta1.DeviceAllocationMode) *DeviceSubRequestApplyConfiguration { + b.AllocationMode = &value + return b +} + +// WithCount sets the Count field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Count field is set to the value of the last call. +func (b *DeviceSubRequestApplyConfiguration) WithCount(value int64) *DeviceSubRequestApplyConfiguration { + b.Count = &value + return b +} + +// WithTolerations adds the given value to the Tolerations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Tolerations field. +func (b *DeviceSubRequestApplyConfiguration) WithTolerations(values ...*DeviceTolerationApplyConfiguration) *DeviceSubRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTolerations") + } + b.Tolerations = append(b.Tolerations, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicetaint.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicetaint.go new file mode 100644 index 000000000..bfa826f06 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicetaint.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + resourcev1beta1 "k8s.io/api/resource/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// DeviceTaintApplyConfiguration represents a declarative configuration of the DeviceTaint type for use +// with apply. +type DeviceTaintApplyConfiguration struct { + Key *string `json:"key,omitempty"` + Value *string `json:"value,omitempty"` + Effect *resourcev1beta1.DeviceTaintEffect `json:"effect,omitempty"` + TimeAdded *v1.Time `json:"timeAdded,omitempty"` +} + +// DeviceTaintApplyConfiguration constructs a declarative configuration of the DeviceTaint type for use with +// apply. +func DeviceTaint() *DeviceTaintApplyConfiguration { + return &DeviceTaintApplyConfiguration{} +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *DeviceTaintApplyConfiguration) WithKey(value string) *DeviceTaintApplyConfiguration { + b.Key = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *DeviceTaintApplyConfiguration) WithValue(value string) *DeviceTaintApplyConfiguration { + b.Value = &value + return b +} + +// WithEffect sets the Effect field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Effect field is set to the value of the last call. +func (b *DeviceTaintApplyConfiguration) WithEffect(value resourcev1beta1.DeviceTaintEffect) *DeviceTaintApplyConfiguration { + b.Effect = &value + return b +} + +// WithTimeAdded sets the TimeAdded field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TimeAdded field is set to the value of the last call. +func (b *DeviceTaintApplyConfiguration) WithTimeAdded(value v1.Time) *DeviceTaintApplyConfiguration { + b.TimeAdded = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicetoleration.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicetoleration.go new file mode 100644 index 000000000..977af6704 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicetoleration.go @@ -0,0 +1,79 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + resourcev1beta1 "k8s.io/api/resource/v1beta1" +) + +// DeviceTolerationApplyConfiguration represents a declarative configuration of the DeviceToleration type for use +// with apply. +type DeviceTolerationApplyConfiguration struct { + Key *string `json:"key,omitempty"` + Operator *resourcev1beta1.DeviceTolerationOperator `json:"operator,omitempty"` + Value *string `json:"value,omitempty"` + Effect *resourcev1beta1.DeviceTaintEffect `json:"effect,omitempty"` + TolerationSeconds *int64 `json:"tolerationSeconds,omitempty"` +} + +// DeviceTolerationApplyConfiguration constructs a declarative configuration of the DeviceToleration type for use with +// apply. +func DeviceToleration() *DeviceTolerationApplyConfiguration { + return &DeviceTolerationApplyConfiguration{} +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *DeviceTolerationApplyConfiguration) WithKey(value string) *DeviceTolerationApplyConfiguration { + b.Key = &value + return b +} + +// WithOperator sets the Operator field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Operator field is set to the value of the last call. +func (b *DeviceTolerationApplyConfiguration) WithOperator(value resourcev1beta1.DeviceTolerationOperator) *DeviceTolerationApplyConfiguration { + b.Operator = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *DeviceTolerationApplyConfiguration) WithValue(value string) *DeviceTolerationApplyConfiguration { + b.Value = &value + return b +} + +// WithEffect sets the Effect field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Effect field is set to the value of the last call. +func (b *DeviceTolerationApplyConfiguration) WithEffect(value resourcev1beta1.DeviceTaintEffect) *DeviceTolerationApplyConfiguration { + b.Effect = &value + return b +} + +// WithTolerationSeconds sets the TolerationSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TolerationSeconds field is set to the value of the last call. +func (b *DeviceTolerationApplyConfiguration) WithTolerationSeconds(value int64) *DeviceTolerationApplyConfiguration { + b.TolerationSeconds = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceslicespec.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceslicespec.go index 75bbb53c8..6eaae7da8 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceslicespec.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceslicespec.go @@ -25,12 +25,14 @@ import ( // ResourceSliceSpecApplyConfiguration represents a declarative configuration of the ResourceSliceSpec type for use // with apply. type ResourceSliceSpecApplyConfiguration struct { - Driver *string `json:"driver,omitempty"` - Pool *ResourcePoolApplyConfiguration `json:"pool,omitempty"` - NodeName *string `json:"nodeName,omitempty"` - NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"` - AllNodes *bool `json:"allNodes,omitempty"` - Devices []DeviceApplyConfiguration `json:"devices,omitempty"` + Driver *string `json:"driver,omitempty"` + Pool *ResourcePoolApplyConfiguration `json:"pool,omitempty"` + NodeName *string `json:"nodeName,omitempty"` + NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"` + AllNodes *bool `json:"allNodes,omitempty"` + Devices []DeviceApplyConfiguration `json:"devices,omitempty"` + PerDeviceNodeSelection *bool `json:"perDeviceNodeSelection,omitempty"` + SharedCounters []CounterSetApplyConfiguration `json:"sharedCounters,omitempty"` } // ResourceSliceSpecApplyConfiguration constructs a declarative configuration of the ResourceSliceSpec type for use with @@ -91,3 +93,24 @@ func (b *ResourceSliceSpecApplyConfiguration) WithDevices(values ...*DeviceApply } return b } + +// WithPerDeviceNodeSelection sets the PerDeviceNodeSelection field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PerDeviceNodeSelection field is set to the value of the last call. +func (b *ResourceSliceSpecApplyConfiguration) WithPerDeviceNodeSelection(value bool) *ResourceSliceSpecApplyConfiguration { + b.PerDeviceNodeSelection = &value + return b +} + +// WithSharedCounters adds the given value to the SharedCounters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SharedCounters field. +func (b *ResourceSliceSpecApplyConfiguration) WithSharedCounters(values ...*CounterSetApplyConfiguration) *ResourceSliceSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSharedCounters") + } + b.SharedCounters = append(b.SharedCounters, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/allocateddevicestatus.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/allocateddevicestatus.go new file mode 100644 index 000000000..a69cf26eb --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/allocateddevicestatus.go @@ -0,0 +1,94 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// AllocatedDeviceStatusApplyConfiguration represents a declarative configuration of the AllocatedDeviceStatus type for use +// with apply. +type AllocatedDeviceStatusApplyConfiguration struct { + Driver *string `json:"driver,omitempty"` + Pool *string `json:"pool,omitempty"` + Device *string `json:"device,omitempty"` + Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` + Data *runtime.RawExtension `json:"data,omitempty"` + NetworkData *NetworkDeviceDataApplyConfiguration `json:"networkData,omitempty"` +} + +// AllocatedDeviceStatusApplyConfiguration constructs a declarative configuration of the AllocatedDeviceStatus type for use with +// apply. +func AllocatedDeviceStatus() *AllocatedDeviceStatusApplyConfiguration { + return &AllocatedDeviceStatusApplyConfiguration{} +} + +// WithDriver sets the Driver field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Driver field is set to the value of the last call. +func (b *AllocatedDeviceStatusApplyConfiguration) WithDriver(value string) *AllocatedDeviceStatusApplyConfiguration { + b.Driver = &value + return b +} + +// WithPool sets the Pool field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Pool field is set to the value of the last call. +func (b *AllocatedDeviceStatusApplyConfiguration) WithPool(value string) *AllocatedDeviceStatusApplyConfiguration { + b.Pool = &value + return b +} + +// WithDevice sets the Device field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Device field is set to the value of the last call. +func (b *AllocatedDeviceStatusApplyConfiguration) WithDevice(value string) *AllocatedDeviceStatusApplyConfiguration { + b.Device = &value + return b +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *AllocatedDeviceStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *AllocatedDeviceStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithData sets the Data field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Data field is set to the value of the last call. +func (b *AllocatedDeviceStatusApplyConfiguration) WithData(value runtime.RawExtension) *AllocatedDeviceStatusApplyConfiguration { + b.Data = &value + return b +} + +// WithNetworkData sets the NetworkData field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NetworkData field is set to the value of the last call. +func (b *AllocatedDeviceStatusApplyConfiguration) WithNetworkData(value *NetworkDeviceDataApplyConfiguration) *AllocatedDeviceStatusApplyConfiguration { + b.NetworkData = value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/allocationresult.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/allocationresult.go new file mode 100644 index 000000000..a82b01c96 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/allocationresult.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/client-go/applyconfigurations/core/v1" +) + +// AllocationResultApplyConfiguration represents a declarative configuration of the AllocationResult type for use +// with apply. +type AllocationResultApplyConfiguration struct { + Devices *DeviceAllocationResultApplyConfiguration `json:"devices,omitempty"` + NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"` +} + +// AllocationResultApplyConfiguration constructs a declarative configuration of the AllocationResult type for use with +// apply. +func AllocationResult() *AllocationResultApplyConfiguration { + return &AllocationResultApplyConfiguration{} +} + +// WithDevices sets the Devices field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Devices field is set to the value of the last call. +func (b *AllocationResultApplyConfiguration) WithDevices(value *DeviceAllocationResultApplyConfiguration) *AllocationResultApplyConfiguration { + b.Devices = value + return b +} + +// WithNodeSelector sets the NodeSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeSelector field is set to the value of the last call. +func (b *AllocationResultApplyConfiguration) WithNodeSelector(value *v1.NodeSelectorApplyConfiguration) *AllocationResultApplyConfiguration { + b.NodeSelector = value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/celdeviceselector.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/celdeviceselector.go new file mode 100644 index 000000000..c2c3e52f0 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/celdeviceselector.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// CELDeviceSelectorApplyConfiguration represents a declarative configuration of the CELDeviceSelector type for use +// with apply. +type CELDeviceSelectorApplyConfiguration struct { + Expression *string `json:"expression,omitempty"` +} + +// CELDeviceSelectorApplyConfiguration constructs a declarative configuration of the CELDeviceSelector type for use with +// apply. +func CELDeviceSelector() *CELDeviceSelectorApplyConfiguration { + return &CELDeviceSelectorApplyConfiguration{} +} + +// WithExpression sets the Expression field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Expression field is set to the value of the last call. +func (b *CELDeviceSelectorApplyConfiguration) WithExpression(value string) *CELDeviceSelectorApplyConfiguration { + b.Expression = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/counter.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/counter.go new file mode 100644 index 000000000..4afdb9a3a --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/counter.go @@ -0,0 +1,43 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// CounterApplyConfiguration represents a declarative configuration of the Counter type for use +// with apply. +type CounterApplyConfiguration struct { + Value *resource.Quantity `json:"value,omitempty"` +} + +// CounterApplyConfiguration constructs a declarative configuration of the Counter type for use with +// apply. +func Counter() *CounterApplyConfiguration { + return &CounterApplyConfiguration{} +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *CounterApplyConfiguration) WithValue(value resource.Quantity) *CounterApplyConfiguration { + b.Value = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/counterset.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/counterset.go new file mode 100644 index 000000000..2882b4ef2 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/counterset.go @@ -0,0 +1,54 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// CounterSetApplyConfiguration represents a declarative configuration of the CounterSet type for use +// with apply. +type CounterSetApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Counters map[string]CounterApplyConfiguration `json:"counters,omitempty"` +} + +// CounterSetApplyConfiguration constructs a declarative configuration of the CounterSet type for use with +// apply. +func CounterSet() *CounterSetApplyConfiguration { + return &CounterSetApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *CounterSetApplyConfiguration) WithName(value string) *CounterSetApplyConfiguration { + b.Name = &value + return b +} + +// WithCounters puts the entries into the Counters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Counters field, +// overwriting an existing map entries in Counters field with the same key. +func (b *CounterSetApplyConfiguration) WithCounters(entries map[string]CounterApplyConfiguration) *CounterSetApplyConfiguration { + if b.Counters == nil && len(entries) > 0 { + b.Counters = make(map[string]CounterApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Counters[k] = v + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/device.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/device.go new file mode 100644 index 000000000..a05eb513f --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/device.go @@ -0,0 +1,129 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + resourcev1beta2 "k8s.io/api/resource/v1beta2" + v1 "k8s.io/client-go/applyconfigurations/core/v1" +) + +// DeviceApplyConfiguration represents a declarative configuration of the Device type for use +// with apply. +type DeviceApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Attributes map[resourcev1beta2.QualifiedName]DeviceAttributeApplyConfiguration `json:"attributes,omitempty"` + Capacity map[resourcev1beta2.QualifiedName]DeviceCapacityApplyConfiguration `json:"capacity,omitempty"` + ConsumesCounters []DeviceCounterConsumptionApplyConfiguration `json:"consumesCounters,omitempty"` + NodeName *string `json:"nodeName,omitempty"` + NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"` + AllNodes *bool `json:"allNodes,omitempty"` + Taints []DeviceTaintApplyConfiguration `json:"taints,omitempty"` +} + +// DeviceApplyConfiguration constructs a declarative configuration of the Device type for use with +// apply. +func Device() *DeviceApplyConfiguration { + return &DeviceApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *DeviceApplyConfiguration) WithName(value string) *DeviceApplyConfiguration { + b.Name = &value + return b +} + +// WithAttributes puts the entries into the Attributes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Attributes field, +// overwriting an existing map entries in Attributes field with the same key. +func (b *DeviceApplyConfiguration) WithAttributes(entries map[resourcev1beta2.QualifiedName]DeviceAttributeApplyConfiguration) *DeviceApplyConfiguration { + if b.Attributes == nil && len(entries) > 0 { + b.Attributes = make(map[resourcev1beta2.QualifiedName]DeviceAttributeApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Attributes[k] = v + } + return b +} + +// WithCapacity puts the entries into the Capacity field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Capacity field, +// overwriting an existing map entries in Capacity field with the same key. +func (b *DeviceApplyConfiguration) WithCapacity(entries map[resourcev1beta2.QualifiedName]DeviceCapacityApplyConfiguration) *DeviceApplyConfiguration { + if b.Capacity == nil && len(entries) > 0 { + b.Capacity = make(map[resourcev1beta2.QualifiedName]DeviceCapacityApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Capacity[k] = v + } + return b +} + +// WithConsumesCounters adds the given value to the ConsumesCounters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ConsumesCounters field. +func (b *DeviceApplyConfiguration) WithConsumesCounters(values ...*DeviceCounterConsumptionApplyConfiguration) *DeviceApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConsumesCounters") + } + b.ConsumesCounters = append(b.ConsumesCounters, *values[i]) + } + return b +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *DeviceApplyConfiguration) WithNodeName(value string) *DeviceApplyConfiguration { + b.NodeName = &value + return b +} + +// WithNodeSelector sets the NodeSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeSelector field is set to the value of the last call. +func (b *DeviceApplyConfiguration) WithNodeSelector(value *v1.NodeSelectorApplyConfiguration) *DeviceApplyConfiguration { + b.NodeSelector = value + return b +} + +// WithAllNodes sets the AllNodes field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllNodes field is set to the value of the last call. +func (b *DeviceApplyConfiguration) WithAllNodes(value bool) *DeviceApplyConfiguration { + b.AllNodes = &value + return b +} + +// WithTaints adds the given value to the Taints field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Taints field. +func (b *DeviceApplyConfiguration) WithTaints(values ...*DeviceTaintApplyConfiguration) *DeviceApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTaints") + } + b.Taints = append(b.Taints, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceallocationconfiguration.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceallocationconfiguration.go new file mode 100644 index 000000000..971fe807c --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceallocationconfiguration.go @@ -0,0 +1,63 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + resourcev1beta2 "k8s.io/api/resource/v1beta2" +) + +// DeviceAllocationConfigurationApplyConfiguration represents a declarative configuration of the DeviceAllocationConfiguration type for use +// with apply. +type DeviceAllocationConfigurationApplyConfiguration struct { + Source *resourcev1beta2.AllocationConfigSource `json:"source,omitempty"` + Requests []string `json:"requests,omitempty"` + DeviceConfigurationApplyConfiguration `json:",inline"` +} + +// DeviceAllocationConfigurationApplyConfiguration constructs a declarative configuration of the DeviceAllocationConfiguration type for use with +// apply. +func DeviceAllocationConfiguration() *DeviceAllocationConfigurationApplyConfiguration { + return &DeviceAllocationConfigurationApplyConfiguration{} +} + +// WithSource sets the Source field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Source field is set to the value of the last call. +func (b *DeviceAllocationConfigurationApplyConfiguration) WithSource(value resourcev1beta2.AllocationConfigSource) *DeviceAllocationConfigurationApplyConfiguration { + b.Source = &value + return b +} + +// WithRequests adds the given value to the Requests field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Requests field. +func (b *DeviceAllocationConfigurationApplyConfiguration) WithRequests(values ...string) *DeviceAllocationConfigurationApplyConfiguration { + for i := range values { + b.Requests = append(b.Requests, values[i]) + } + return b +} + +// WithOpaque sets the Opaque field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Opaque field is set to the value of the last call. +func (b *DeviceAllocationConfigurationApplyConfiguration) WithOpaque(value *OpaqueDeviceConfigurationApplyConfiguration) *DeviceAllocationConfigurationApplyConfiguration { + b.DeviceConfigurationApplyConfiguration.Opaque = value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceallocationresult.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceallocationresult.go new file mode 100644 index 000000000..5d9f01307 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceallocationresult.go @@ -0,0 +1,58 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// DeviceAllocationResultApplyConfiguration represents a declarative configuration of the DeviceAllocationResult type for use +// with apply. +type DeviceAllocationResultApplyConfiguration struct { + Results []DeviceRequestAllocationResultApplyConfiguration `json:"results,omitempty"` + Config []DeviceAllocationConfigurationApplyConfiguration `json:"config,omitempty"` +} + +// DeviceAllocationResultApplyConfiguration constructs a declarative configuration of the DeviceAllocationResult type for use with +// apply. +func DeviceAllocationResult() *DeviceAllocationResultApplyConfiguration { + return &DeviceAllocationResultApplyConfiguration{} +} + +// WithResults adds the given value to the Results field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Results field. +func (b *DeviceAllocationResultApplyConfiguration) WithResults(values ...*DeviceRequestAllocationResultApplyConfiguration) *DeviceAllocationResultApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResults") + } + b.Results = append(b.Results, *values[i]) + } + return b +} + +// WithConfig adds the given value to the Config field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Config field. +func (b *DeviceAllocationResultApplyConfiguration) WithConfig(values ...*DeviceAllocationConfigurationApplyConfiguration) *DeviceAllocationResultApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConfig") + } + b.Config = append(b.Config, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceattribute.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceattribute.go new file mode 100644 index 000000000..c5f88c3f7 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceattribute.go @@ -0,0 +1,66 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// DeviceAttributeApplyConfiguration represents a declarative configuration of the DeviceAttribute type for use +// with apply. +type DeviceAttributeApplyConfiguration struct { + IntValue *int64 `json:"int,omitempty"` + BoolValue *bool `json:"bool,omitempty"` + StringValue *string `json:"string,omitempty"` + VersionValue *string `json:"version,omitempty"` +} + +// DeviceAttributeApplyConfiguration constructs a declarative configuration of the DeviceAttribute type for use with +// apply. +func DeviceAttribute() *DeviceAttributeApplyConfiguration { + return &DeviceAttributeApplyConfiguration{} +} + +// WithIntValue sets the IntValue field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IntValue field is set to the value of the last call. +func (b *DeviceAttributeApplyConfiguration) WithIntValue(value int64) *DeviceAttributeApplyConfiguration { + b.IntValue = &value + return b +} + +// WithBoolValue sets the BoolValue field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BoolValue field is set to the value of the last call. +func (b *DeviceAttributeApplyConfiguration) WithBoolValue(value bool) *DeviceAttributeApplyConfiguration { + b.BoolValue = &value + return b +} + +// WithStringValue sets the StringValue field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StringValue field is set to the value of the last call. +func (b *DeviceAttributeApplyConfiguration) WithStringValue(value string) *DeviceAttributeApplyConfiguration { + b.StringValue = &value + return b +} + +// WithVersionValue sets the VersionValue field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VersionValue field is set to the value of the last call. +func (b *DeviceAttributeApplyConfiguration) WithVersionValue(value string) *DeviceAttributeApplyConfiguration { + b.VersionValue = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicecapacity.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicecapacity.go new file mode 100644 index 000000000..f62168cde --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicecapacity.go @@ -0,0 +1,43 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// DeviceCapacityApplyConfiguration represents a declarative configuration of the DeviceCapacity type for use +// with apply. +type DeviceCapacityApplyConfiguration struct { + Value *resource.Quantity `json:"value,omitempty"` +} + +// DeviceCapacityApplyConfiguration constructs a declarative configuration of the DeviceCapacity type for use with +// apply. +func DeviceCapacity() *DeviceCapacityApplyConfiguration { + return &DeviceCapacityApplyConfiguration{} +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *DeviceCapacityApplyConfiguration) WithValue(value resource.Quantity) *DeviceCapacityApplyConfiguration { + b.Value = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclaim.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclaim.go new file mode 100644 index 000000000..33af599ac --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclaim.go @@ -0,0 +1,72 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// DeviceClaimApplyConfiguration represents a declarative configuration of the DeviceClaim type for use +// with apply. +type DeviceClaimApplyConfiguration struct { + Requests []DeviceRequestApplyConfiguration `json:"requests,omitempty"` + Constraints []DeviceConstraintApplyConfiguration `json:"constraints,omitempty"` + Config []DeviceClaimConfigurationApplyConfiguration `json:"config,omitempty"` +} + +// DeviceClaimApplyConfiguration constructs a declarative configuration of the DeviceClaim type for use with +// apply. +func DeviceClaim() *DeviceClaimApplyConfiguration { + return &DeviceClaimApplyConfiguration{} +} + +// WithRequests adds the given value to the Requests field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Requests field. +func (b *DeviceClaimApplyConfiguration) WithRequests(values ...*DeviceRequestApplyConfiguration) *DeviceClaimApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRequests") + } + b.Requests = append(b.Requests, *values[i]) + } + return b +} + +// WithConstraints adds the given value to the Constraints field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Constraints field. +func (b *DeviceClaimApplyConfiguration) WithConstraints(values ...*DeviceConstraintApplyConfiguration) *DeviceClaimApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConstraints") + } + b.Constraints = append(b.Constraints, *values[i]) + } + return b +} + +// WithConfig adds the given value to the Config field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Config field. +func (b *DeviceClaimApplyConfiguration) WithConfig(values ...*DeviceClaimConfigurationApplyConfiguration) *DeviceClaimApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConfig") + } + b.Config = append(b.Config, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclaimconfiguration.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclaimconfiguration.go new file mode 100644 index 000000000..08464b399 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclaimconfiguration.go @@ -0,0 +1,50 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// DeviceClaimConfigurationApplyConfiguration represents a declarative configuration of the DeviceClaimConfiguration type for use +// with apply. +type DeviceClaimConfigurationApplyConfiguration struct { + Requests []string `json:"requests,omitempty"` + DeviceConfigurationApplyConfiguration `json:",inline"` +} + +// DeviceClaimConfigurationApplyConfiguration constructs a declarative configuration of the DeviceClaimConfiguration type for use with +// apply. +func DeviceClaimConfiguration() *DeviceClaimConfigurationApplyConfiguration { + return &DeviceClaimConfigurationApplyConfiguration{} +} + +// WithRequests adds the given value to the Requests field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Requests field. +func (b *DeviceClaimConfigurationApplyConfiguration) WithRequests(values ...string) *DeviceClaimConfigurationApplyConfiguration { + for i := range values { + b.Requests = append(b.Requests, values[i]) + } + return b +} + +// WithOpaque sets the Opaque field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Opaque field is set to the value of the last call. +func (b *DeviceClaimConfigurationApplyConfiguration) WithOpaque(value *OpaqueDeviceConfigurationApplyConfiguration) *DeviceClaimConfigurationApplyConfiguration { + b.DeviceConfigurationApplyConfiguration.Opaque = value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclass.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclass.go new file mode 100644 index 000000000..a361f331e --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclass.go @@ -0,0 +1,253 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + resourcev1beta2 "k8s.io/api/resource/v1beta2" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// DeviceClassApplyConfiguration represents a declarative configuration of the DeviceClass type for use +// with apply. +type DeviceClassApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *DeviceClassSpecApplyConfiguration `json:"spec,omitempty"` +} + +// DeviceClass constructs a declarative configuration of the DeviceClass type for use with +// apply. +func DeviceClass(name string) *DeviceClassApplyConfiguration { + b := &DeviceClassApplyConfiguration{} + b.WithName(name) + b.WithKind("DeviceClass") + b.WithAPIVersion("resource.k8s.io/v1beta2") + return b +} + +// ExtractDeviceClass extracts the applied configuration owned by fieldManager from +// deviceClass. If no managedFields are found in deviceClass for fieldManager, a +// DeviceClassApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// deviceClass must be a unmodified DeviceClass API object that was retrieved from the Kubernetes API. +// ExtractDeviceClass provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractDeviceClass(deviceClass *resourcev1beta2.DeviceClass, fieldManager string) (*DeviceClassApplyConfiguration, error) { + return extractDeviceClass(deviceClass, fieldManager, "") +} + +// ExtractDeviceClassStatus is the same as ExtractDeviceClass except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractDeviceClassStatus(deviceClass *resourcev1beta2.DeviceClass, fieldManager string) (*DeviceClassApplyConfiguration, error) { + return extractDeviceClass(deviceClass, fieldManager, "status") +} + +func extractDeviceClass(deviceClass *resourcev1beta2.DeviceClass, fieldManager string, subresource string) (*DeviceClassApplyConfiguration, error) { + b := &DeviceClassApplyConfiguration{} + err := managedfields.ExtractInto(deviceClass, internal.Parser().Type("io.k8s.api.resource.v1beta2.DeviceClass"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(deviceClass.Name) + + b.WithKind("DeviceClass") + b.WithAPIVersion("resource.k8s.io/v1beta2") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithKind(value string) *DeviceClassApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithAPIVersion(value string) *DeviceClassApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithName(value string) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithGenerateName(value string) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithNamespace(value string) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithUID(value types.UID) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithResourceVersion(value string) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithGeneration(value int64) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *DeviceClassApplyConfiguration) WithLabels(entries map[string]string) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *DeviceClassApplyConfiguration) WithAnnotations(entries map[string]string) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *DeviceClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *DeviceClassApplyConfiguration) WithFinalizers(values ...string) *DeviceClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *DeviceClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithSpec(value *DeviceClassSpecApplyConfiguration) *DeviceClassApplyConfiguration { + b.Spec = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *DeviceClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclassconfiguration.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclassconfiguration.go new file mode 100644 index 000000000..904410280 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclassconfiguration.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// DeviceClassConfigurationApplyConfiguration represents a declarative configuration of the DeviceClassConfiguration type for use +// with apply. +type DeviceClassConfigurationApplyConfiguration struct { + DeviceConfigurationApplyConfiguration `json:",inline"` +} + +// DeviceClassConfigurationApplyConfiguration constructs a declarative configuration of the DeviceClassConfiguration type for use with +// apply. +func DeviceClassConfiguration() *DeviceClassConfigurationApplyConfiguration { + return &DeviceClassConfigurationApplyConfiguration{} +} + +// WithOpaque sets the Opaque field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Opaque field is set to the value of the last call. +func (b *DeviceClassConfigurationApplyConfiguration) WithOpaque(value *OpaqueDeviceConfigurationApplyConfiguration) *DeviceClassConfigurationApplyConfiguration { + b.DeviceConfigurationApplyConfiguration.Opaque = value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclassspec.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclassspec.go new file mode 100644 index 000000000..c92a83e6b --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclassspec.go @@ -0,0 +1,58 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// DeviceClassSpecApplyConfiguration represents a declarative configuration of the DeviceClassSpec type for use +// with apply. +type DeviceClassSpecApplyConfiguration struct { + Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` + Config []DeviceClassConfigurationApplyConfiguration `json:"config,omitempty"` +} + +// DeviceClassSpecApplyConfiguration constructs a declarative configuration of the DeviceClassSpec type for use with +// apply. +func DeviceClassSpec() *DeviceClassSpecApplyConfiguration { + return &DeviceClassSpecApplyConfiguration{} +} + +// WithSelectors adds the given value to the Selectors field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Selectors field. +func (b *DeviceClassSpecApplyConfiguration) WithSelectors(values ...*DeviceSelectorApplyConfiguration) *DeviceClassSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSelectors") + } + b.Selectors = append(b.Selectors, *values[i]) + } + return b +} + +// WithConfig adds the given value to the Config field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Config field. +func (b *DeviceClassSpecApplyConfiguration) WithConfig(values ...*DeviceClassConfigurationApplyConfiguration) *DeviceClassSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConfig") + } + b.Config = append(b.Config, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceconfiguration.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceconfiguration.go new file mode 100644 index 000000000..2032433f3 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceconfiguration.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// DeviceConfigurationApplyConfiguration represents a declarative configuration of the DeviceConfiguration type for use +// with apply. +type DeviceConfigurationApplyConfiguration struct { + Opaque *OpaqueDeviceConfigurationApplyConfiguration `json:"opaque,omitempty"` +} + +// DeviceConfigurationApplyConfiguration constructs a declarative configuration of the DeviceConfiguration type for use with +// apply. +func DeviceConfiguration() *DeviceConfigurationApplyConfiguration { + return &DeviceConfigurationApplyConfiguration{} +} + +// WithOpaque sets the Opaque field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Opaque field is set to the value of the last call. +func (b *DeviceConfigurationApplyConfiguration) WithOpaque(value *OpaqueDeviceConfigurationApplyConfiguration) *DeviceConfigurationApplyConfiguration { + b.Opaque = value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceconstraint.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceconstraint.go new file mode 100644 index 000000000..460ffdd08 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceconstraint.go @@ -0,0 +1,54 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + resourcev1beta2 "k8s.io/api/resource/v1beta2" +) + +// DeviceConstraintApplyConfiguration represents a declarative configuration of the DeviceConstraint type for use +// with apply. +type DeviceConstraintApplyConfiguration struct { + Requests []string `json:"requests,omitempty"` + MatchAttribute *resourcev1beta2.FullyQualifiedName `json:"matchAttribute,omitempty"` +} + +// DeviceConstraintApplyConfiguration constructs a declarative configuration of the DeviceConstraint type for use with +// apply. +func DeviceConstraint() *DeviceConstraintApplyConfiguration { + return &DeviceConstraintApplyConfiguration{} +} + +// WithRequests adds the given value to the Requests field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Requests field. +func (b *DeviceConstraintApplyConfiguration) WithRequests(values ...string) *DeviceConstraintApplyConfiguration { + for i := range values { + b.Requests = append(b.Requests, values[i]) + } + return b +} + +// WithMatchAttribute sets the MatchAttribute field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MatchAttribute field is set to the value of the last call. +func (b *DeviceConstraintApplyConfiguration) WithMatchAttribute(value resourcev1beta2.FullyQualifiedName) *DeviceConstraintApplyConfiguration { + b.MatchAttribute = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicecounterconsumption.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicecounterconsumption.go new file mode 100644 index 000000000..9d6d0a873 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicecounterconsumption.go @@ -0,0 +1,54 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// DeviceCounterConsumptionApplyConfiguration represents a declarative configuration of the DeviceCounterConsumption type for use +// with apply. +type DeviceCounterConsumptionApplyConfiguration struct { + CounterSet *string `json:"counterSet,omitempty"` + Counters map[string]CounterApplyConfiguration `json:"counters,omitempty"` +} + +// DeviceCounterConsumptionApplyConfiguration constructs a declarative configuration of the DeviceCounterConsumption type for use with +// apply. +func DeviceCounterConsumption() *DeviceCounterConsumptionApplyConfiguration { + return &DeviceCounterConsumptionApplyConfiguration{} +} + +// WithCounterSet sets the CounterSet field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CounterSet field is set to the value of the last call. +func (b *DeviceCounterConsumptionApplyConfiguration) WithCounterSet(value string) *DeviceCounterConsumptionApplyConfiguration { + b.CounterSet = &value + return b +} + +// WithCounters puts the entries into the Counters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Counters field, +// overwriting an existing map entries in Counters field with the same key. +func (b *DeviceCounterConsumptionApplyConfiguration) WithCounters(entries map[string]CounterApplyConfiguration) *DeviceCounterConsumptionApplyConfiguration { + if b.Counters == nil && len(entries) > 0 { + b.Counters = make(map[string]CounterApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Counters[k] = v + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicerequest.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicerequest.go new file mode 100644 index 000000000..426c97487 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicerequest.go @@ -0,0 +1,62 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// DeviceRequestApplyConfiguration represents a declarative configuration of the DeviceRequest type for use +// with apply. +type DeviceRequestApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Exactly *ExactDeviceRequestApplyConfiguration `json:"exactly,omitempty"` + FirstAvailable []DeviceSubRequestApplyConfiguration `json:"firstAvailable,omitempty"` +} + +// DeviceRequestApplyConfiguration constructs a declarative configuration of the DeviceRequest type for use with +// apply. +func DeviceRequest() *DeviceRequestApplyConfiguration { + return &DeviceRequestApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *DeviceRequestApplyConfiguration) WithName(value string) *DeviceRequestApplyConfiguration { + b.Name = &value + return b +} + +// WithExactly sets the Exactly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Exactly field is set to the value of the last call. +func (b *DeviceRequestApplyConfiguration) WithExactly(value *ExactDeviceRequestApplyConfiguration) *DeviceRequestApplyConfiguration { + b.Exactly = value + return b +} + +// WithFirstAvailable adds the given value to the FirstAvailable field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the FirstAvailable field. +func (b *DeviceRequestApplyConfiguration) WithFirstAvailable(values ...*DeviceSubRequestApplyConfiguration) *DeviceRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithFirstAvailable") + } + b.FirstAvailable = append(b.FirstAvailable, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicerequestallocationresult.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicerequestallocationresult.go new file mode 100644 index 000000000..ab826812e --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicerequestallocationresult.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// DeviceRequestAllocationResultApplyConfiguration represents a declarative configuration of the DeviceRequestAllocationResult type for use +// with apply. +type DeviceRequestAllocationResultApplyConfiguration struct { + Request *string `json:"request,omitempty"` + Driver *string `json:"driver,omitempty"` + Pool *string `json:"pool,omitempty"` + Device *string `json:"device,omitempty"` + AdminAccess *bool `json:"adminAccess,omitempty"` + Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"` +} + +// DeviceRequestAllocationResultApplyConfiguration constructs a declarative configuration of the DeviceRequestAllocationResult type for use with +// apply. +func DeviceRequestAllocationResult() *DeviceRequestAllocationResultApplyConfiguration { + return &DeviceRequestAllocationResultApplyConfiguration{} +} + +// WithRequest sets the Request field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Request field is set to the value of the last call. +func (b *DeviceRequestAllocationResultApplyConfiguration) WithRequest(value string) *DeviceRequestAllocationResultApplyConfiguration { + b.Request = &value + return b +} + +// WithDriver sets the Driver field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Driver field is set to the value of the last call. +func (b *DeviceRequestAllocationResultApplyConfiguration) WithDriver(value string) *DeviceRequestAllocationResultApplyConfiguration { + b.Driver = &value + return b +} + +// WithPool sets the Pool field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Pool field is set to the value of the last call. +func (b *DeviceRequestAllocationResultApplyConfiguration) WithPool(value string) *DeviceRequestAllocationResultApplyConfiguration { + b.Pool = &value + return b +} + +// WithDevice sets the Device field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Device field is set to the value of the last call. +func (b *DeviceRequestAllocationResultApplyConfiguration) WithDevice(value string) *DeviceRequestAllocationResultApplyConfiguration { + b.Device = &value + return b +} + +// WithAdminAccess sets the AdminAccess field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AdminAccess field is set to the value of the last call. +func (b *DeviceRequestAllocationResultApplyConfiguration) WithAdminAccess(value bool) *DeviceRequestAllocationResultApplyConfiguration { + b.AdminAccess = &value + return b +} + +// WithTolerations adds the given value to the Tolerations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Tolerations field. +func (b *DeviceRequestAllocationResultApplyConfiguration) WithTolerations(values ...*DeviceTolerationApplyConfiguration) *DeviceRequestAllocationResultApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTolerations") + } + b.Tolerations = append(b.Tolerations, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceselector.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceselector.go new file mode 100644 index 000000000..fd064e5f6 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceselector.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// DeviceSelectorApplyConfiguration represents a declarative configuration of the DeviceSelector type for use +// with apply. +type DeviceSelectorApplyConfiguration struct { + CEL *CELDeviceSelectorApplyConfiguration `json:"cel,omitempty"` +} + +// DeviceSelectorApplyConfiguration constructs a declarative configuration of the DeviceSelector type for use with +// apply. +func DeviceSelector() *DeviceSelectorApplyConfiguration { + return &DeviceSelectorApplyConfiguration{} +} + +// WithCEL sets the CEL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CEL field is set to the value of the last call. +func (b *DeviceSelectorApplyConfiguration) WithCEL(value *CELDeviceSelectorApplyConfiguration) *DeviceSelectorApplyConfiguration { + b.CEL = value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicesubrequest.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicesubrequest.go new file mode 100644 index 000000000..aaf8600ad --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicesubrequest.go @@ -0,0 +1,98 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + resourcev1beta2 "k8s.io/api/resource/v1beta2" +) + +// DeviceSubRequestApplyConfiguration represents a declarative configuration of the DeviceSubRequest type for use +// with apply. +type DeviceSubRequestApplyConfiguration struct { + Name *string `json:"name,omitempty"` + DeviceClassName *string `json:"deviceClassName,omitempty"` + Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` + AllocationMode *resourcev1beta2.DeviceAllocationMode `json:"allocationMode,omitempty"` + Count *int64 `json:"count,omitempty"` + Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"` +} + +// DeviceSubRequestApplyConfiguration constructs a declarative configuration of the DeviceSubRequest type for use with +// apply. +func DeviceSubRequest() *DeviceSubRequestApplyConfiguration { + return &DeviceSubRequestApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *DeviceSubRequestApplyConfiguration) WithName(value string) *DeviceSubRequestApplyConfiguration { + b.Name = &value + return b +} + +// WithDeviceClassName sets the DeviceClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeviceClassName field is set to the value of the last call. +func (b *DeviceSubRequestApplyConfiguration) WithDeviceClassName(value string) *DeviceSubRequestApplyConfiguration { + b.DeviceClassName = &value + return b +} + +// WithSelectors adds the given value to the Selectors field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Selectors field. +func (b *DeviceSubRequestApplyConfiguration) WithSelectors(values ...*DeviceSelectorApplyConfiguration) *DeviceSubRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSelectors") + } + b.Selectors = append(b.Selectors, *values[i]) + } + return b +} + +// WithAllocationMode sets the AllocationMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllocationMode field is set to the value of the last call. +func (b *DeviceSubRequestApplyConfiguration) WithAllocationMode(value resourcev1beta2.DeviceAllocationMode) *DeviceSubRequestApplyConfiguration { + b.AllocationMode = &value + return b +} + +// WithCount sets the Count field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Count field is set to the value of the last call. +func (b *DeviceSubRequestApplyConfiguration) WithCount(value int64) *DeviceSubRequestApplyConfiguration { + b.Count = &value + return b +} + +// WithTolerations adds the given value to the Tolerations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Tolerations field. +func (b *DeviceSubRequestApplyConfiguration) WithTolerations(values ...*DeviceTolerationApplyConfiguration) *DeviceSubRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTolerations") + } + b.Tolerations = append(b.Tolerations, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicetaint.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicetaint.go new file mode 100644 index 000000000..b21f98a15 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicetaint.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + resourcev1beta2 "k8s.io/api/resource/v1beta2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// DeviceTaintApplyConfiguration represents a declarative configuration of the DeviceTaint type for use +// with apply. +type DeviceTaintApplyConfiguration struct { + Key *string `json:"key,omitempty"` + Value *string `json:"value,omitempty"` + Effect *resourcev1beta2.DeviceTaintEffect `json:"effect,omitempty"` + TimeAdded *v1.Time `json:"timeAdded,omitempty"` +} + +// DeviceTaintApplyConfiguration constructs a declarative configuration of the DeviceTaint type for use with +// apply. +func DeviceTaint() *DeviceTaintApplyConfiguration { + return &DeviceTaintApplyConfiguration{} +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *DeviceTaintApplyConfiguration) WithKey(value string) *DeviceTaintApplyConfiguration { + b.Key = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *DeviceTaintApplyConfiguration) WithValue(value string) *DeviceTaintApplyConfiguration { + b.Value = &value + return b +} + +// WithEffect sets the Effect field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Effect field is set to the value of the last call. +func (b *DeviceTaintApplyConfiguration) WithEffect(value resourcev1beta2.DeviceTaintEffect) *DeviceTaintApplyConfiguration { + b.Effect = &value + return b +} + +// WithTimeAdded sets the TimeAdded field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TimeAdded field is set to the value of the last call. +func (b *DeviceTaintApplyConfiguration) WithTimeAdded(value v1.Time) *DeviceTaintApplyConfiguration { + b.TimeAdded = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicetoleration.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicetoleration.go new file mode 100644 index 000000000..ae471233f --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicetoleration.go @@ -0,0 +1,79 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + resourcev1beta2 "k8s.io/api/resource/v1beta2" +) + +// DeviceTolerationApplyConfiguration represents a declarative configuration of the DeviceToleration type for use +// with apply. +type DeviceTolerationApplyConfiguration struct { + Key *string `json:"key,omitempty"` + Operator *resourcev1beta2.DeviceTolerationOperator `json:"operator,omitempty"` + Value *string `json:"value,omitempty"` + Effect *resourcev1beta2.DeviceTaintEffect `json:"effect,omitempty"` + TolerationSeconds *int64 `json:"tolerationSeconds,omitempty"` +} + +// DeviceTolerationApplyConfiguration constructs a declarative configuration of the DeviceToleration type for use with +// apply. +func DeviceToleration() *DeviceTolerationApplyConfiguration { + return &DeviceTolerationApplyConfiguration{} +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *DeviceTolerationApplyConfiguration) WithKey(value string) *DeviceTolerationApplyConfiguration { + b.Key = &value + return b +} + +// WithOperator sets the Operator field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Operator field is set to the value of the last call. +func (b *DeviceTolerationApplyConfiguration) WithOperator(value resourcev1beta2.DeviceTolerationOperator) *DeviceTolerationApplyConfiguration { + b.Operator = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *DeviceTolerationApplyConfiguration) WithValue(value string) *DeviceTolerationApplyConfiguration { + b.Value = &value + return b +} + +// WithEffect sets the Effect field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Effect field is set to the value of the last call. +func (b *DeviceTolerationApplyConfiguration) WithEffect(value resourcev1beta2.DeviceTaintEffect) *DeviceTolerationApplyConfiguration { + b.Effect = &value + return b +} + +// WithTolerationSeconds sets the TolerationSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TolerationSeconds field is set to the value of the last call. +func (b *DeviceTolerationApplyConfiguration) WithTolerationSeconds(value int64) *DeviceTolerationApplyConfiguration { + b.TolerationSeconds = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/exactdevicerequest.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/exactdevicerequest.go new file mode 100644 index 000000000..2d7d7155e --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/exactdevicerequest.go @@ -0,0 +1,98 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + resourcev1beta2 "k8s.io/api/resource/v1beta2" +) + +// ExactDeviceRequestApplyConfiguration represents a declarative configuration of the ExactDeviceRequest type for use +// with apply. +type ExactDeviceRequestApplyConfiguration struct { + DeviceClassName *string `json:"deviceClassName,omitempty"` + Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` + AllocationMode *resourcev1beta2.DeviceAllocationMode `json:"allocationMode,omitempty"` + Count *int64 `json:"count,omitempty"` + AdminAccess *bool `json:"adminAccess,omitempty"` + Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"` +} + +// ExactDeviceRequestApplyConfiguration constructs a declarative configuration of the ExactDeviceRequest type for use with +// apply. +func ExactDeviceRequest() *ExactDeviceRequestApplyConfiguration { + return &ExactDeviceRequestApplyConfiguration{} +} + +// WithDeviceClassName sets the DeviceClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeviceClassName field is set to the value of the last call. +func (b *ExactDeviceRequestApplyConfiguration) WithDeviceClassName(value string) *ExactDeviceRequestApplyConfiguration { + b.DeviceClassName = &value + return b +} + +// WithSelectors adds the given value to the Selectors field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Selectors field. +func (b *ExactDeviceRequestApplyConfiguration) WithSelectors(values ...*DeviceSelectorApplyConfiguration) *ExactDeviceRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSelectors") + } + b.Selectors = append(b.Selectors, *values[i]) + } + return b +} + +// WithAllocationMode sets the AllocationMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllocationMode field is set to the value of the last call. +func (b *ExactDeviceRequestApplyConfiguration) WithAllocationMode(value resourcev1beta2.DeviceAllocationMode) *ExactDeviceRequestApplyConfiguration { + b.AllocationMode = &value + return b +} + +// WithCount sets the Count field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Count field is set to the value of the last call. +func (b *ExactDeviceRequestApplyConfiguration) WithCount(value int64) *ExactDeviceRequestApplyConfiguration { + b.Count = &value + return b +} + +// WithAdminAccess sets the AdminAccess field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AdminAccess field is set to the value of the last call. +func (b *ExactDeviceRequestApplyConfiguration) WithAdminAccess(value bool) *ExactDeviceRequestApplyConfiguration { + b.AdminAccess = &value + return b +} + +// WithTolerations adds the given value to the Tolerations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Tolerations field. +func (b *ExactDeviceRequestApplyConfiguration) WithTolerations(values ...*DeviceTolerationApplyConfiguration) *ExactDeviceRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTolerations") + } + b.Tolerations = append(b.Tolerations, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/networkdevicedata.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/networkdevicedata.go new file mode 100644 index 000000000..9b0944f8f --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/networkdevicedata.go @@ -0,0 +1,59 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// NetworkDeviceDataApplyConfiguration represents a declarative configuration of the NetworkDeviceData type for use +// with apply. +type NetworkDeviceDataApplyConfiguration struct { + InterfaceName *string `json:"interfaceName,omitempty"` + IPs []string `json:"ips,omitempty"` + HardwareAddress *string `json:"hardwareAddress,omitempty"` +} + +// NetworkDeviceDataApplyConfiguration constructs a declarative configuration of the NetworkDeviceData type for use with +// apply. +func NetworkDeviceData() *NetworkDeviceDataApplyConfiguration { + return &NetworkDeviceDataApplyConfiguration{} +} + +// WithInterfaceName sets the InterfaceName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InterfaceName field is set to the value of the last call. +func (b *NetworkDeviceDataApplyConfiguration) WithInterfaceName(value string) *NetworkDeviceDataApplyConfiguration { + b.InterfaceName = &value + return b +} + +// WithIPs adds the given value to the IPs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the IPs field. +func (b *NetworkDeviceDataApplyConfiguration) WithIPs(values ...string) *NetworkDeviceDataApplyConfiguration { + for i := range values { + b.IPs = append(b.IPs, values[i]) + } + return b +} + +// WithHardwareAddress sets the HardwareAddress field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HardwareAddress field is set to the value of the last call. +func (b *NetworkDeviceDataApplyConfiguration) WithHardwareAddress(value string) *NetworkDeviceDataApplyConfiguration { + b.HardwareAddress = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/opaquedeviceconfiguration.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/opaquedeviceconfiguration.go new file mode 100644 index 000000000..aa8fe43f3 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/opaquedeviceconfiguration.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// OpaqueDeviceConfigurationApplyConfiguration represents a declarative configuration of the OpaqueDeviceConfiguration type for use +// with apply. +type OpaqueDeviceConfigurationApplyConfiguration struct { + Driver *string `json:"driver,omitempty"` + Parameters *runtime.RawExtension `json:"parameters,omitempty"` +} + +// OpaqueDeviceConfigurationApplyConfiguration constructs a declarative configuration of the OpaqueDeviceConfiguration type for use with +// apply. +func OpaqueDeviceConfiguration() *OpaqueDeviceConfigurationApplyConfiguration { + return &OpaqueDeviceConfigurationApplyConfiguration{} +} + +// WithDriver sets the Driver field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Driver field is set to the value of the last call. +func (b *OpaqueDeviceConfigurationApplyConfiguration) WithDriver(value string) *OpaqueDeviceConfigurationApplyConfiguration { + b.Driver = &value + return b +} + +// WithParameters sets the Parameters field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Parameters field is set to the value of the last call. +func (b *OpaqueDeviceConfigurationApplyConfiguration) WithParameters(value runtime.RawExtension) *OpaqueDeviceConfigurationApplyConfiguration { + b.Parameters = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaim.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaim.go new file mode 100644 index 000000000..65b3a6e0b --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaim.go @@ -0,0 +1,264 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + resourcev1beta2 "k8s.io/api/resource/v1beta2" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ResourceClaimApplyConfiguration represents a declarative configuration of the ResourceClaim type for use +// with apply. +type ResourceClaimApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ResourceClaimSpecApplyConfiguration `json:"spec,omitempty"` + Status *ResourceClaimStatusApplyConfiguration `json:"status,omitempty"` +} + +// ResourceClaim constructs a declarative configuration of the ResourceClaim type for use with +// apply. +func ResourceClaim(name, namespace string) *ResourceClaimApplyConfiguration { + b := &ResourceClaimApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("ResourceClaim") + b.WithAPIVersion("resource.k8s.io/v1beta2") + return b +} + +// ExtractResourceClaim extracts the applied configuration owned by fieldManager from +// resourceClaim. If no managedFields are found in resourceClaim for fieldManager, a +// ResourceClaimApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// resourceClaim must be a unmodified ResourceClaim API object that was retrieved from the Kubernetes API. +// ExtractResourceClaim provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractResourceClaim(resourceClaim *resourcev1beta2.ResourceClaim, fieldManager string) (*ResourceClaimApplyConfiguration, error) { + return extractResourceClaim(resourceClaim, fieldManager, "") +} + +// ExtractResourceClaimStatus is the same as ExtractResourceClaim except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractResourceClaimStatus(resourceClaim *resourcev1beta2.ResourceClaim, fieldManager string) (*ResourceClaimApplyConfiguration, error) { + return extractResourceClaim(resourceClaim, fieldManager, "status") +} + +func extractResourceClaim(resourceClaim *resourcev1beta2.ResourceClaim, fieldManager string, subresource string) (*ResourceClaimApplyConfiguration, error) { + b := &ResourceClaimApplyConfiguration{} + err := managedfields.ExtractInto(resourceClaim, internal.Parser().Type("io.k8s.api.resource.v1beta2.ResourceClaim"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(resourceClaim.Name) + b.WithNamespace(resourceClaim.Namespace) + + b.WithKind("ResourceClaim") + b.WithAPIVersion("resource.k8s.io/v1beta2") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ResourceClaimApplyConfiguration) WithKind(value string) *ResourceClaimApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ResourceClaimApplyConfiguration) WithAPIVersion(value string) *ResourceClaimApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ResourceClaimApplyConfiguration) WithName(value string) *ResourceClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ResourceClaimApplyConfiguration) WithGenerateName(value string) *ResourceClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ResourceClaimApplyConfiguration) WithNamespace(value string) *ResourceClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ResourceClaimApplyConfiguration) WithUID(value types.UID) *ResourceClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ResourceClaimApplyConfiguration) WithResourceVersion(value string) *ResourceClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ResourceClaimApplyConfiguration) WithGeneration(value int64) *ResourceClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ResourceClaimApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ResourceClaimApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ResourceClaimApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ResourceClaimApplyConfiguration) WithLabels(entries map[string]string) *ResourceClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ResourceClaimApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ResourceClaimApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ResourceClaimApplyConfiguration) WithFinalizers(values ...string) *ResourceClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ResourceClaimApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ResourceClaimApplyConfiguration) WithSpec(value *ResourceClaimSpecApplyConfiguration) *ResourceClaimApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ResourceClaimApplyConfiguration) WithStatus(value *ResourceClaimStatusApplyConfiguration) *ResourceClaimApplyConfiguration { + b.Status = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ResourceClaimApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimconsumerreference.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimconsumerreference.go new file mode 100644 index 000000000..b7824e859 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimconsumerreference.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + types "k8s.io/apimachinery/pkg/types" +) + +// ResourceClaimConsumerReferenceApplyConfiguration represents a declarative configuration of the ResourceClaimConsumerReference type for use +// with apply. +type ResourceClaimConsumerReferenceApplyConfiguration struct { + APIGroup *string `json:"apiGroup,omitempty"` + Resource *string `json:"resource,omitempty"` + Name *string `json:"name,omitempty"` + UID *types.UID `json:"uid,omitempty"` +} + +// ResourceClaimConsumerReferenceApplyConfiguration constructs a declarative configuration of the ResourceClaimConsumerReference type for use with +// apply. +func ResourceClaimConsumerReference() *ResourceClaimConsumerReferenceApplyConfiguration { + return &ResourceClaimConsumerReferenceApplyConfiguration{} +} + +// WithAPIGroup sets the APIGroup field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIGroup field is set to the value of the last call. +func (b *ResourceClaimConsumerReferenceApplyConfiguration) WithAPIGroup(value string) *ResourceClaimConsumerReferenceApplyConfiguration { + b.APIGroup = &value + return b +} + +// WithResource sets the Resource field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Resource field is set to the value of the last call. +func (b *ResourceClaimConsumerReferenceApplyConfiguration) WithResource(value string) *ResourceClaimConsumerReferenceApplyConfiguration { + b.Resource = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ResourceClaimConsumerReferenceApplyConfiguration) WithName(value string) *ResourceClaimConsumerReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ResourceClaimConsumerReferenceApplyConfiguration) WithUID(value types.UID) *ResourceClaimConsumerReferenceApplyConfiguration { + b.UID = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimspec.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimspec.go new file mode 100644 index 000000000..e1fce1715 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimspec.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ResourceClaimSpecApplyConfiguration represents a declarative configuration of the ResourceClaimSpec type for use +// with apply. +type ResourceClaimSpecApplyConfiguration struct { + Devices *DeviceClaimApplyConfiguration `json:"devices,omitempty"` +} + +// ResourceClaimSpecApplyConfiguration constructs a declarative configuration of the ResourceClaimSpec type for use with +// apply. +func ResourceClaimSpec() *ResourceClaimSpecApplyConfiguration { + return &ResourceClaimSpecApplyConfiguration{} +} + +// WithDevices sets the Devices field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Devices field is set to the value of the last call. +func (b *ResourceClaimSpecApplyConfiguration) WithDevices(value *DeviceClaimApplyConfiguration) *ResourceClaimSpecApplyConfiguration { + b.Devices = value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimstatus.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimstatus.go new file mode 100644 index 000000000..a3e7ae258 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimstatus.go @@ -0,0 +1,67 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ResourceClaimStatusApplyConfiguration represents a declarative configuration of the ResourceClaimStatus type for use +// with apply. +type ResourceClaimStatusApplyConfiguration struct { + Allocation *AllocationResultApplyConfiguration `json:"allocation,omitempty"` + ReservedFor []ResourceClaimConsumerReferenceApplyConfiguration `json:"reservedFor,omitempty"` + Devices []AllocatedDeviceStatusApplyConfiguration `json:"devices,omitempty"` +} + +// ResourceClaimStatusApplyConfiguration constructs a declarative configuration of the ResourceClaimStatus type for use with +// apply. +func ResourceClaimStatus() *ResourceClaimStatusApplyConfiguration { + return &ResourceClaimStatusApplyConfiguration{} +} + +// WithAllocation sets the Allocation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Allocation field is set to the value of the last call. +func (b *ResourceClaimStatusApplyConfiguration) WithAllocation(value *AllocationResultApplyConfiguration) *ResourceClaimStatusApplyConfiguration { + b.Allocation = value + return b +} + +// WithReservedFor adds the given value to the ReservedFor field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ReservedFor field. +func (b *ResourceClaimStatusApplyConfiguration) WithReservedFor(values ...*ResourceClaimConsumerReferenceApplyConfiguration) *ResourceClaimStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithReservedFor") + } + b.ReservedFor = append(b.ReservedFor, *values[i]) + } + return b +} + +// WithDevices adds the given value to the Devices field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Devices field. +func (b *ResourceClaimStatusApplyConfiguration) WithDevices(values ...*AllocatedDeviceStatusApplyConfiguration) *ResourceClaimStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithDevices") + } + b.Devices = append(b.Devices, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimtemplate.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimtemplate.go new file mode 100644 index 000000000..eb1f3ca06 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimtemplate.go @@ -0,0 +1,255 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + resourcev1beta2 "k8s.io/api/resource/v1beta2" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ResourceClaimTemplateApplyConfiguration represents a declarative configuration of the ResourceClaimTemplate type for use +// with apply. +type ResourceClaimTemplateApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ResourceClaimTemplateSpecApplyConfiguration `json:"spec,omitempty"` +} + +// ResourceClaimTemplate constructs a declarative configuration of the ResourceClaimTemplate type for use with +// apply. +func ResourceClaimTemplate(name, namespace string) *ResourceClaimTemplateApplyConfiguration { + b := &ResourceClaimTemplateApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("ResourceClaimTemplate") + b.WithAPIVersion("resource.k8s.io/v1beta2") + return b +} + +// ExtractResourceClaimTemplate extracts the applied configuration owned by fieldManager from +// resourceClaimTemplate. If no managedFields are found in resourceClaimTemplate for fieldManager, a +// ResourceClaimTemplateApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// resourceClaimTemplate must be a unmodified ResourceClaimTemplate API object that was retrieved from the Kubernetes API. +// ExtractResourceClaimTemplate provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractResourceClaimTemplate(resourceClaimTemplate *resourcev1beta2.ResourceClaimTemplate, fieldManager string) (*ResourceClaimTemplateApplyConfiguration, error) { + return extractResourceClaimTemplate(resourceClaimTemplate, fieldManager, "") +} + +// ExtractResourceClaimTemplateStatus is the same as ExtractResourceClaimTemplate except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractResourceClaimTemplateStatus(resourceClaimTemplate *resourcev1beta2.ResourceClaimTemplate, fieldManager string) (*ResourceClaimTemplateApplyConfiguration, error) { + return extractResourceClaimTemplate(resourceClaimTemplate, fieldManager, "status") +} + +func extractResourceClaimTemplate(resourceClaimTemplate *resourcev1beta2.ResourceClaimTemplate, fieldManager string, subresource string) (*ResourceClaimTemplateApplyConfiguration, error) { + b := &ResourceClaimTemplateApplyConfiguration{} + err := managedfields.ExtractInto(resourceClaimTemplate, internal.Parser().Type("io.k8s.api.resource.v1beta2.ResourceClaimTemplate"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(resourceClaimTemplate.Name) + b.WithNamespace(resourceClaimTemplate.Namespace) + + b.WithKind("ResourceClaimTemplate") + b.WithAPIVersion("resource.k8s.io/v1beta2") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ResourceClaimTemplateApplyConfiguration) WithKind(value string) *ResourceClaimTemplateApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ResourceClaimTemplateApplyConfiguration) WithAPIVersion(value string) *ResourceClaimTemplateApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ResourceClaimTemplateApplyConfiguration) WithName(value string) *ResourceClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ResourceClaimTemplateApplyConfiguration) WithGenerateName(value string) *ResourceClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ResourceClaimTemplateApplyConfiguration) WithNamespace(value string) *ResourceClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ResourceClaimTemplateApplyConfiguration) WithUID(value types.UID) *ResourceClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ResourceClaimTemplateApplyConfiguration) WithResourceVersion(value string) *ResourceClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ResourceClaimTemplateApplyConfiguration) WithGeneration(value int64) *ResourceClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ResourceClaimTemplateApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ResourceClaimTemplateApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ResourceClaimTemplateApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ResourceClaimTemplateApplyConfiguration) WithLabels(entries map[string]string) *ResourceClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ResourceClaimTemplateApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ResourceClaimTemplateApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ResourceClaimTemplateApplyConfiguration) WithFinalizers(values ...string) *ResourceClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ResourceClaimTemplateApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ResourceClaimTemplateApplyConfiguration) WithSpec(value *ResourceClaimTemplateSpecApplyConfiguration) *ResourceClaimTemplateApplyConfiguration { + b.Spec = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ResourceClaimTemplateApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimtemplatespec.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimtemplatespec.go new file mode 100644 index 000000000..c2aef66c7 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimtemplatespec.go @@ -0,0 +1,194 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ResourceClaimTemplateSpecApplyConfiguration represents a declarative configuration of the ResourceClaimTemplateSpec type for use +// with apply. +type ResourceClaimTemplateSpecApplyConfiguration struct { + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ResourceClaimSpecApplyConfiguration `json:"spec,omitempty"` +} + +// ResourceClaimTemplateSpecApplyConfiguration constructs a declarative configuration of the ResourceClaimTemplateSpec type for use with +// apply. +func ResourceClaimTemplateSpec() *ResourceClaimTemplateSpecApplyConfiguration { + return &ResourceClaimTemplateSpecApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ResourceClaimTemplateSpecApplyConfiguration) WithName(value string) *ResourceClaimTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ResourceClaimTemplateSpecApplyConfiguration) WithGenerateName(value string) *ResourceClaimTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ResourceClaimTemplateSpecApplyConfiguration) WithNamespace(value string) *ResourceClaimTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ResourceClaimTemplateSpecApplyConfiguration) WithUID(value types.UID) *ResourceClaimTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ResourceClaimTemplateSpecApplyConfiguration) WithResourceVersion(value string) *ResourceClaimTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ResourceClaimTemplateSpecApplyConfiguration) WithGeneration(value int64) *ResourceClaimTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ResourceClaimTemplateSpecApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceClaimTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ResourceClaimTemplateSpecApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceClaimTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ResourceClaimTemplateSpecApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceClaimTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ResourceClaimTemplateSpecApplyConfiguration) WithLabels(entries map[string]string) *ResourceClaimTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ResourceClaimTemplateSpecApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceClaimTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ResourceClaimTemplateSpecApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceClaimTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ResourceClaimTemplateSpecApplyConfiguration) WithFinalizers(values ...string) *ResourceClaimTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ResourceClaimTemplateSpecApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ResourceClaimTemplateSpecApplyConfiguration) WithSpec(value *ResourceClaimSpecApplyConfiguration) *ResourceClaimTemplateSpecApplyConfiguration { + b.Spec = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ResourceClaimTemplateSpecApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourcepool.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourcepool.go new file mode 100644 index 000000000..6923085d6 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourcepool.go @@ -0,0 +1,57 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ResourcePoolApplyConfiguration represents a declarative configuration of the ResourcePool type for use +// with apply. +type ResourcePoolApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Generation *int64 `json:"generation,omitempty"` + ResourceSliceCount *int64 `json:"resourceSliceCount,omitempty"` +} + +// ResourcePoolApplyConfiguration constructs a declarative configuration of the ResourcePool type for use with +// apply. +func ResourcePool() *ResourcePoolApplyConfiguration { + return &ResourcePoolApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ResourcePoolApplyConfiguration) WithName(value string) *ResourcePoolApplyConfiguration { + b.Name = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ResourcePoolApplyConfiguration) WithGeneration(value int64) *ResourcePoolApplyConfiguration { + b.Generation = &value + return b +} + +// WithResourceSliceCount sets the ResourceSliceCount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceSliceCount field is set to the value of the last call. +func (b *ResourcePoolApplyConfiguration) WithResourceSliceCount(value int64) *ResourcePoolApplyConfiguration { + b.ResourceSliceCount = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceslice.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceslice.go new file mode 100644 index 000000000..7333d709d --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceslice.go @@ -0,0 +1,253 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + resourcev1beta2 "k8s.io/api/resource/v1beta2" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ResourceSliceApplyConfiguration represents a declarative configuration of the ResourceSlice type for use +// with apply. +type ResourceSliceApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ResourceSliceSpecApplyConfiguration `json:"spec,omitempty"` +} + +// ResourceSlice constructs a declarative configuration of the ResourceSlice type for use with +// apply. +func ResourceSlice(name string) *ResourceSliceApplyConfiguration { + b := &ResourceSliceApplyConfiguration{} + b.WithName(name) + b.WithKind("ResourceSlice") + b.WithAPIVersion("resource.k8s.io/v1beta2") + return b +} + +// ExtractResourceSlice extracts the applied configuration owned by fieldManager from +// resourceSlice. If no managedFields are found in resourceSlice for fieldManager, a +// ResourceSliceApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// resourceSlice must be a unmodified ResourceSlice API object that was retrieved from the Kubernetes API. +// ExtractResourceSlice provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractResourceSlice(resourceSlice *resourcev1beta2.ResourceSlice, fieldManager string) (*ResourceSliceApplyConfiguration, error) { + return extractResourceSlice(resourceSlice, fieldManager, "") +} + +// ExtractResourceSliceStatus is the same as ExtractResourceSlice except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractResourceSliceStatus(resourceSlice *resourcev1beta2.ResourceSlice, fieldManager string) (*ResourceSliceApplyConfiguration, error) { + return extractResourceSlice(resourceSlice, fieldManager, "status") +} + +func extractResourceSlice(resourceSlice *resourcev1beta2.ResourceSlice, fieldManager string, subresource string) (*ResourceSliceApplyConfiguration, error) { + b := &ResourceSliceApplyConfiguration{} + err := managedfields.ExtractInto(resourceSlice, internal.Parser().Type("io.k8s.api.resource.v1beta2.ResourceSlice"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(resourceSlice.Name) + + b.WithKind("ResourceSlice") + b.WithAPIVersion("resource.k8s.io/v1beta2") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ResourceSliceApplyConfiguration) WithKind(value string) *ResourceSliceApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ResourceSliceApplyConfiguration) WithAPIVersion(value string) *ResourceSliceApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ResourceSliceApplyConfiguration) WithName(value string) *ResourceSliceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ResourceSliceApplyConfiguration) WithGenerateName(value string) *ResourceSliceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ResourceSliceApplyConfiguration) WithNamespace(value string) *ResourceSliceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ResourceSliceApplyConfiguration) WithUID(value types.UID) *ResourceSliceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ResourceSliceApplyConfiguration) WithResourceVersion(value string) *ResourceSliceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ResourceSliceApplyConfiguration) WithGeneration(value int64) *ResourceSliceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ResourceSliceApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceSliceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ResourceSliceApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceSliceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ResourceSliceApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceSliceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ResourceSliceApplyConfiguration) WithLabels(entries map[string]string) *ResourceSliceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ResourceSliceApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceSliceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ResourceSliceApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceSliceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ResourceSliceApplyConfiguration) WithFinalizers(values ...string) *ResourceSliceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ResourceSliceApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ResourceSliceApplyConfiguration) WithSpec(value *ResourceSliceSpecApplyConfiguration) *ResourceSliceApplyConfiguration { + b.Spec = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ResourceSliceApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceslicespec.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceslicespec.go new file mode 100644 index 000000000..5a000829f --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceslicespec.go @@ -0,0 +1,116 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/client-go/applyconfigurations/core/v1" +) + +// ResourceSliceSpecApplyConfiguration represents a declarative configuration of the ResourceSliceSpec type for use +// with apply. +type ResourceSliceSpecApplyConfiguration struct { + Driver *string `json:"driver,omitempty"` + Pool *ResourcePoolApplyConfiguration `json:"pool,omitempty"` + NodeName *string `json:"nodeName,omitempty"` + NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"` + AllNodes *bool `json:"allNodes,omitempty"` + Devices []DeviceApplyConfiguration `json:"devices,omitempty"` + PerDeviceNodeSelection *bool `json:"perDeviceNodeSelection,omitempty"` + SharedCounters []CounterSetApplyConfiguration `json:"sharedCounters,omitempty"` +} + +// ResourceSliceSpecApplyConfiguration constructs a declarative configuration of the ResourceSliceSpec type for use with +// apply. +func ResourceSliceSpec() *ResourceSliceSpecApplyConfiguration { + return &ResourceSliceSpecApplyConfiguration{} +} + +// WithDriver sets the Driver field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Driver field is set to the value of the last call. +func (b *ResourceSliceSpecApplyConfiguration) WithDriver(value string) *ResourceSliceSpecApplyConfiguration { + b.Driver = &value + return b +} + +// WithPool sets the Pool field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Pool field is set to the value of the last call. +func (b *ResourceSliceSpecApplyConfiguration) WithPool(value *ResourcePoolApplyConfiguration) *ResourceSliceSpecApplyConfiguration { + b.Pool = value + return b +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *ResourceSliceSpecApplyConfiguration) WithNodeName(value string) *ResourceSliceSpecApplyConfiguration { + b.NodeName = &value + return b +} + +// WithNodeSelector sets the NodeSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeSelector field is set to the value of the last call. +func (b *ResourceSliceSpecApplyConfiguration) WithNodeSelector(value *v1.NodeSelectorApplyConfiguration) *ResourceSliceSpecApplyConfiguration { + b.NodeSelector = value + return b +} + +// WithAllNodes sets the AllNodes field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllNodes field is set to the value of the last call. +func (b *ResourceSliceSpecApplyConfiguration) WithAllNodes(value bool) *ResourceSliceSpecApplyConfiguration { + b.AllNodes = &value + return b +} + +// WithDevices adds the given value to the Devices field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Devices field. +func (b *ResourceSliceSpecApplyConfiguration) WithDevices(values ...*DeviceApplyConfiguration) *ResourceSliceSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithDevices") + } + b.Devices = append(b.Devices, *values[i]) + } + return b +} + +// WithPerDeviceNodeSelection sets the PerDeviceNodeSelection field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PerDeviceNodeSelection field is set to the value of the last call. +func (b *ResourceSliceSpecApplyConfiguration) WithPerDeviceNodeSelection(value bool) *ResourceSliceSpecApplyConfiguration { + b.PerDeviceNodeSelection = &value + return b +} + +// WithSharedCounters adds the given value to the SharedCounters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SharedCounters field. +func (b *ResourceSliceSpecApplyConfiguration) WithSharedCounters(values ...*CounterSetApplyConfiguration) *ResourceSliceSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSharedCounters") + } + b.SharedCounters = append(b.SharedCounters, *values[i]) + } + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csidriverspec.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csidriverspec.go index 1b58c6db8..fc6f2fbf9 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csidriverspec.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csidriverspec.go @@ -25,14 +25,15 @@ import ( // CSIDriverSpecApplyConfiguration represents a declarative configuration of the CSIDriverSpec type for use // with apply. type CSIDriverSpecApplyConfiguration struct { - AttachRequired *bool `json:"attachRequired,omitempty"` - PodInfoOnMount *bool `json:"podInfoOnMount,omitempty"` - VolumeLifecycleModes []storagev1.VolumeLifecycleMode `json:"volumeLifecycleModes,omitempty"` - StorageCapacity *bool `json:"storageCapacity,omitempty"` - FSGroupPolicy *storagev1.FSGroupPolicy `json:"fsGroupPolicy,omitempty"` - TokenRequests []TokenRequestApplyConfiguration `json:"tokenRequests,omitempty"` - RequiresRepublish *bool `json:"requiresRepublish,omitempty"` - SELinuxMount *bool `json:"seLinuxMount,omitempty"` + AttachRequired *bool `json:"attachRequired,omitempty"` + PodInfoOnMount *bool `json:"podInfoOnMount,omitempty"` + VolumeLifecycleModes []storagev1.VolumeLifecycleMode `json:"volumeLifecycleModes,omitempty"` + StorageCapacity *bool `json:"storageCapacity,omitempty"` + FSGroupPolicy *storagev1.FSGroupPolicy `json:"fsGroupPolicy,omitempty"` + TokenRequests []TokenRequestApplyConfiguration `json:"tokenRequests,omitempty"` + RequiresRepublish *bool `json:"requiresRepublish,omitempty"` + SELinuxMount *bool `json:"seLinuxMount,omitempty"` + NodeAllocatableUpdatePeriodSeconds *int64 `json:"nodeAllocatableUpdatePeriodSeconds,omitempty"` } // CSIDriverSpecApplyConfiguration constructs a declarative configuration of the CSIDriverSpec type for use with @@ -111,3 +112,11 @@ func (b *CSIDriverSpecApplyConfiguration) WithSELinuxMount(value bool) *CSIDrive b.SELinuxMount = &value return b } + +// WithNodeAllocatableUpdatePeriodSeconds sets the NodeAllocatableUpdatePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeAllocatableUpdatePeriodSeconds field is set to the value of the last call. +func (b *CSIDriverSpecApplyConfiguration) WithNodeAllocatableUpdatePeriodSeconds(value int64) *CSIDriverSpecApplyConfiguration { + b.NodeAllocatableUpdatePeriodSeconds = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/storage/v1/volumeerror.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/storage/v1/volumeerror.go index c16c5c3af..9becf7726 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/storage/v1/volumeerror.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/storage/v1/volumeerror.go @@ -25,8 +25,9 @@ import ( // VolumeErrorApplyConfiguration represents a declarative configuration of the VolumeError type for use // with apply. type VolumeErrorApplyConfiguration struct { - Time *metav1.Time `json:"time,omitempty"` - Message *string `json:"message,omitempty"` + Time *metav1.Time `json:"time,omitempty"` + Message *string `json:"message,omitempty"` + ErrorCode *int32 `json:"errorCode,omitempty"` } // VolumeErrorApplyConfiguration constructs a declarative configuration of the VolumeError type for use with @@ -50,3 +51,11 @@ func (b *VolumeErrorApplyConfiguration) WithMessage(value string) *VolumeErrorAp b.Message = &value return b } + +// WithErrorCode sets the ErrorCode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ErrorCode field is set to the value of the last call. +func (b *VolumeErrorApplyConfiguration) WithErrorCode(value int32) *VolumeErrorApplyConfiguration { + b.ErrorCode = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeerror.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeerror.go index ef8f6bbe6..19e527510 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeerror.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeerror.go @@ -25,8 +25,9 @@ import ( // VolumeErrorApplyConfiguration represents a declarative configuration of the VolumeError type for use // with apply. type VolumeErrorApplyConfiguration struct { - Time *v1.Time `json:"time,omitempty"` - Message *string `json:"message,omitempty"` + Time *v1.Time `json:"time,omitempty"` + Message *string `json:"message,omitempty"` + ErrorCode *int32 `json:"errorCode,omitempty"` } // VolumeErrorApplyConfiguration constructs a declarative configuration of the VolumeError type for use with @@ -50,3 +51,11 @@ func (b *VolumeErrorApplyConfiguration) WithMessage(value string) *VolumeErrorAp b.Message = &value return b } + +// WithErrorCode sets the ErrorCode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ErrorCode field is set to the value of the last call. +func (b *VolumeErrorApplyConfiguration) WithErrorCode(value int32) *VolumeErrorApplyConfiguration { + b.ErrorCode = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csidriverspec.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csidriverspec.go index e62fe5888..b1c9ec6d1 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csidriverspec.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csidriverspec.go @@ -25,14 +25,15 @@ import ( // CSIDriverSpecApplyConfiguration represents a declarative configuration of the CSIDriverSpec type for use // with apply. type CSIDriverSpecApplyConfiguration struct { - AttachRequired *bool `json:"attachRequired,omitempty"` - PodInfoOnMount *bool `json:"podInfoOnMount,omitempty"` - VolumeLifecycleModes []storagev1beta1.VolumeLifecycleMode `json:"volumeLifecycleModes,omitempty"` - StorageCapacity *bool `json:"storageCapacity,omitempty"` - FSGroupPolicy *storagev1beta1.FSGroupPolicy `json:"fsGroupPolicy,omitempty"` - TokenRequests []TokenRequestApplyConfiguration `json:"tokenRequests,omitempty"` - RequiresRepublish *bool `json:"requiresRepublish,omitempty"` - SELinuxMount *bool `json:"seLinuxMount,omitempty"` + AttachRequired *bool `json:"attachRequired,omitempty"` + PodInfoOnMount *bool `json:"podInfoOnMount,omitempty"` + VolumeLifecycleModes []storagev1beta1.VolumeLifecycleMode `json:"volumeLifecycleModes,omitempty"` + StorageCapacity *bool `json:"storageCapacity,omitempty"` + FSGroupPolicy *storagev1beta1.FSGroupPolicy `json:"fsGroupPolicy,omitempty"` + TokenRequests []TokenRequestApplyConfiguration `json:"tokenRequests,omitempty"` + RequiresRepublish *bool `json:"requiresRepublish,omitempty"` + SELinuxMount *bool `json:"seLinuxMount,omitempty"` + NodeAllocatableUpdatePeriodSeconds *int64 `json:"nodeAllocatableUpdatePeriodSeconds,omitempty"` } // CSIDriverSpecApplyConfiguration constructs a declarative configuration of the CSIDriverSpec type for use with @@ -111,3 +112,11 @@ func (b *CSIDriverSpecApplyConfiguration) WithSELinuxMount(value bool) *CSIDrive b.SELinuxMount = &value return b } + +// WithNodeAllocatableUpdatePeriodSeconds sets the NodeAllocatableUpdatePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeAllocatableUpdatePeriodSeconds field is set to the value of the last call. +func (b *CSIDriverSpecApplyConfiguration) WithNodeAllocatableUpdatePeriodSeconds(value int64) *CSIDriverSpecApplyConfiguration { + b.NodeAllocatableUpdatePeriodSeconds = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/volumeerror.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/volumeerror.go index fec1c9ade..015bcd86d 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/volumeerror.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/volumeerror.go @@ -25,8 +25,9 @@ import ( // VolumeErrorApplyConfiguration represents a declarative configuration of the VolumeError type for use // with apply. type VolumeErrorApplyConfiguration struct { - Time *v1.Time `json:"time,omitempty"` - Message *string `json:"message,omitempty"` + Time *v1.Time `json:"time,omitempty"` + Message *string `json:"message,omitempty"` + ErrorCode *int32 `json:"errorCode,omitempty"` } // VolumeErrorApplyConfiguration constructs a declarative configuration of the VolumeError type for use with @@ -50,3 +51,11 @@ func (b *VolumeErrorApplyConfiguration) WithMessage(value string) *VolumeErrorAp b.Message = &value return b } + +// WithErrorCode sets the ErrorCode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ErrorCode field is set to the value of the last call. +func (b *VolumeErrorApplyConfiguration) WithErrorCode(value int32) *VolumeErrorApplyConfiguration { + b.ErrorCode = &value + return b +} diff --git a/e2e/vendor/k8s.io/client-go/applyconfigurations/utils.go b/e2e/vendor/k8s.io/client-go/applyconfigurations/utils.go index afbabac94..eec40ba9f 100644 --- a/e2e/vendor/k8s.io/client-go/applyconfigurations/utils.go +++ b/e2e/vendor/k8s.io/client-go/applyconfigurations/utils.go @@ -62,6 +62,7 @@ import ( rbacv1beta1 "k8s.io/api/rbac/v1beta1" v1alpha3 "k8s.io/api/resource/v1alpha3" resourcev1beta1 "k8s.io/api/resource/v1beta1" + resourcev1beta2 "k8s.io/api/resource/v1beta2" schedulingv1 "k8s.io/api/scheduling/v1" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" @@ -117,6 +118,7 @@ import ( applyconfigurationsrbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" applyconfigurationsresourcev1beta1 "k8s.io/client-go/applyconfigurations/resource/v1beta1" + applyconfigurationsresourcev1beta2 "k8s.io/client-go/applyconfigurations/resource/v1beta2" applyconfigurationsschedulingv1 "k8s.io/client-go/applyconfigurations/scheduling/v1" applyconfigurationsschedulingv1alpha1 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha1" applyconfigurationsschedulingv1beta1 "k8s.io/client-go/applyconfigurations/scheduling/v1beta1" @@ -624,6 +626,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscertificatesv1beta1.CertificateSigningRequestSpecApplyConfiguration{} case certificatesv1beta1.SchemeGroupVersion.WithKind("CertificateSigningRequestStatus"): return &applyconfigurationscertificatesv1beta1.CertificateSigningRequestStatusApplyConfiguration{} + case certificatesv1beta1.SchemeGroupVersion.WithKind("ClusterTrustBundle"): + return &applyconfigurationscertificatesv1beta1.ClusterTrustBundleApplyConfiguration{} + case certificatesv1beta1.SchemeGroupVersion.WithKind("ClusterTrustBundleSpec"): + return &applyconfigurationscertificatesv1beta1.ClusterTrustBundleSpecApplyConfiguration{} // Group=coordination.k8s.io, Version=v1 case coordinationv1.SchemeGroupVersion.WithKind("Lease"): @@ -640,6 +646,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { // Group=coordination.k8s.io, Version=v1beta1 case coordinationv1beta1.SchemeGroupVersion.WithKind("Lease"): return &applyconfigurationscoordinationv1beta1.LeaseApplyConfiguration{} + case coordinationv1beta1.SchemeGroupVersion.WithKind("LeaseCandidate"): + return &applyconfigurationscoordinationv1beta1.LeaseCandidateApplyConfiguration{} + case coordinationv1beta1.SchemeGroupVersion.WithKind("LeaseCandidateSpec"): + return &applyconfigurationscoordinationv1beta1.LeaseCandidateSpecApplyConfiguration{} case coordinationv1beta1.SchemeGroupVersion.WithKind("LeaseSpec"): return &applyconfigurationscoordinationv1beta1.LeaseSpecApplyConfiguration{} @@ -848,6 +858,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscorev1.NodeSpecApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeStatus"): return &applyconfigurationscorev1.NodeStatusApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeSwapStatus"): + return &applyconfigurationscorev1.NodeSwapStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeSystemInfo"): return &applyconfigurationscorev1.NodeSystemInfoApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ObjectFieldSelector"): @@ -1052,6 +1064,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsdiscoveryv1.EndpointPortApplyConfiguration{} case discoveryv1.SchemeGroupVersion.WithKind("EndpointSlice"): return &applyconfigurationsdiscoveryv1.EndpointSliceApplyConfiguration{} + case discoveryv1.SchemeGroupVersion.WithKind("ForNode"): + return &applyconfigurationsdiscoveryv1.ForNodeApplyConfiguration{} case discoveryv1.SchemeGroupVersion.WithKind("ForZone"): return &applyconfigurationsdiscoveryv1.ForZoneApplyConfiguration{} @@ -1066,6 +1080,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsdiscoveryv1beta1.EndpointPortApplyConfiguration{} case discoveryv1beta1.SchemeGroupVersion.WithKind("EndpointSlice"): return &applyconfigurationsdiscoveryv1beta1.EndpointSliceApplyConfiguration{} + case discoveryv1beta1.SchemeGroupVersion.WithKind("ForNode"): + return &applyconfigurationsdiscoveryv1beta1.ForNodeApplyConfiguration{} case discoveryv1beta1.SchemeGroupVersion.WithKind("ForZone"): return &applyconfigurationsdiscoveryv1beta1.ForZoneApplyConfiguration{} @@ -1406,6 +1422,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsnetworkingv1.IngressStatusApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("IngressTLS"): return &applyconfigurationsnetworkingv1.IngressTLSApplyConfiguration{} + case networkingv1.SchemeGroupVersion.WithKind("IPAddress"): + return &applyconfigurationsnetworkingv1.IPAddressApplyConfiguration{} + case networkingv1.SchemeGroupVersion.WithKind("IPAddressSpec"): + return &applyconfigurationsnetworkingv1.IPAddressSpecApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("IPBlock"): return &applyconfigurationsnetworkingv1.IPBlockApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("NetworkPolicy"): @@ -1420,8 +1440,16 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsnetworkingv1.NetworkPolicyPortApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("NetworkPolicySpec"): return &applyconfigurationsnetworkingv1.NetworkPolicySpecApplyConfiguration{} + case networkingv1.SchemeGroupVersion.WithKind("ParentReference"): + return &applyconfigurationsnetworkingv1.ParentReferenceApplyConfiguration{} case networkingv1.SchemeGroupVersion.WithKind("ServiceBackendPort"): return &applyconfigurationsnetworkingv1.ServiceBackendPortApplyConfiguration{} + case networkingv1.SchemeGroupVersion.WithKind("ServiceCIDR"): + return &applyconfigurationsnetworkingv1.ServiceCIDRApplyConfiguration{} + case networkingv1.SchemeGroupVersion.WithKind("ServiceCIDRSpec"): + return &applyconfigurationsnetworkingv1.ServiceCIDRSpecApplyConfiguration{} + case networkingv1.SchemeGroupVersion.WithKind("ServiceCIDRStatus"): + return &applyconfigurationsnetworkingv1.ServiceCIDRStatusApplyConfiguration{} // Group=networking.k8s.io, Version=v1alpha1 case networkingv1alpha1.SchemeGroupVersion.WithKind("IPAddress"): @@ -1590,6 +1618,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &resourcev1alpha3.BasicDeviceApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("CELDeviceSelector"): return &resourcev1alpha3.CELDeviceSelectorApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("Counter"): + return &resourcev1alpha3.CounterApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("CounterSet"): + return &resourcev1alpha3.CounterSetApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("Device"): return &resourcev1alpha3.DeviceApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("DeviceAllocationConfiguration"): @@ -1612,12 +1644,26 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &resourcev1alpha3.DeviceConfigurationApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("DeviceConstraint"): return &resourcev1alpha3.DeviceConstraintApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceCounterConsumption"): + return &resourcev1alpha3.DeviceCounterConsumptionApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("DeviceRequest"): return &resourcev1alpha3.DeviceRequestApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("DeviceRequestAllocationResult"): return &resourcev1alpha3.DeviceRequestAllocationResultApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("DeviceSelector"): return &resourcev1alpha3.DeviceSelectorApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceSubRequest"): + return &resourcev1alpha3.DeviceSubRequestApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceTaint"): + return &resourcev1alpha3.DeviceTaintApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceTaintRule"): + return &resourcev1alpha3.DeviceTaintRuleApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceTaintRuleSpec"): + return &resourcev1alpha3.DeviceTaintRuleSpecApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceTaintSelector"): + return &resourcev1alpha3.DeviceTaintSelectorApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceToleration"): + return &resourcev1alpha3.DeviceTolerationApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("NetworkDeviceData"): return &resourcev1alpha3.NetworkDeviceDataApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("OpaqueDeviceConfiguration"): @@ -1650,6 +1696,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsresourcev1beta1.BasicDeviceApplyConfiguration{} case resourcev1beta1.SchemeGroupVersion.WithKind("CELDeviceSelector"): return &applyconfigurationsresourcev1beta1.CELDeviceSelectorApplyConfiguration{} + case resourcev1beta1.SchemeGroupVersion.WithKind("Counter"): + return &applyconfigurationsresourcev1beta1.CounterApplyConfiguration{} + case resourcev1beta1.SchemeGroupVersion.WithKind("CounterSet"): + return &applyconfigurationsresourcev1beta1.CounterSetApplyConfiguration{} case resourcev1beta1.SchemeGroupVersion.WithKind("Device"): return &applyconfigurationsresourcev1beta1.DeviceApplyConfiguration{} case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceAllocationConfiguration"): @@ -1674,12 +1724,20 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsresourcev1beta1.DeviceConfigurationApplyConfiguration{} case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceConstraint"): return &applyconfigurationsresourcev1beta1.DeviceConstraintApplyConfiguration{} + case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceCounterConsumption"): + return &applyconfigurationsresourcev1beta1.DeviceCounterConsumptionApplyConfiguration{} case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceRequest"): return &applyconfigurationsresourcev1beta1.DeviceRequestApplyConfiguration{} case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceRequestAllocationResult"): return &applyconfigurationsresourcev1beta1.DeviceRequestAllocationResultApplyConfiguration{} case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceSelector"): return &applyconfigurationsresourcev1beta1.DeviceSelectorApplyConfiguration{} + case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceSubRequest"): + return &applyconfigurationsresourcev1beta1.DeviceSubRequestApplyConfiguration{} + case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceTaint"): + return &applyconfigurationsresourcev1beta1.DeviceTaintApplyConfiguration{} + case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceToleration"): + return &applyconfigurationsresourcev1beta1.DeviceTolerationApplyConfiguration{} case resourcev1beta1.SchemeGroupVersion.WithKind("NetworkDeviceData"): return &applyconfigurationsresourcev1beta1.NetworkDeviceDataApplyConfiguration{} case resourcev1beta1.SchemeGroupVersion.WithKind("OpaqueDeviceConfiguration"): @@ -1703,6 +1761,80 @@ func ForKind(kind schema.GroupVersionKind) interface{} { case resourcev1beta1.SchemeGroupVersion.WithKind("ResourceSliceSpec"): return &applyconfigurationsresourcev1beta1.ResourceSliceSpecApplyConfiguration{} + // Group=resource.k8s.io, Version=v1beta2 + case resourcev1beta2.SchemeGroupVersion.WithKind("AllocatedDeviceStatus"): + return &applyconfigurationsresourcev1beta2.AllocatedDeviceStatusApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("AllocationResult"): + return &applyconfigurationsresourcev1beta2.AllocationResultApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("CELDeviceSelector"): + return &applyconfigurationsresourcev1beta2.CELDeviceSelectorApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("Counter"): + return &applyconfigurationsresourcev1beta2.CounterApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("CounterSet"): + return &applyconfigurationsresourcev1beta2.CounterSetApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("Device"): + return &applyconfigurationsresourcev1beta2.DeviceApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceAllocationConfiguration"): + return &applyconfigurationsresourcev1beta2.DeviceAllocationConfigurationApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceAllocationResult"): + return &applyconfigurationsresourcev1beta2.DeviceAllocationResultApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceAttribute"): + return &applyconfigurationsresourcev1beta2.DeviceAttributeApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceCapacity"): + return &applyconfigurationsresourcev1beta2.DeviceCapacityApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceClaim"): + return &applyconfigurationsresourcev1beta2.DeviceClaimApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceClaimConfiguration"): + return &applyconfigurationsresourcev1beta2.DeviceClaimConfigurationApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceClass"): + return &applyconfigurationsresourcev1beta2.DeviceClassApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceClassConfiguration"): + return &applyconfigurationsresourcev1beta2.DeviceClassConfigurationApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceClassSpec"): + return &applyconfigurationsresourcev1beta2.DeviceClassSpecApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceConfiguration"): + return &applyconfigurationsresourcev1beta2.DeviceConfigurationApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceConstraint"): + return &applyconfigurationsresourcev1beta2.DeviceConstraintApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceCounterConsumption"): + return &applyconfigurationsresourcev1beta2.DeviceCounterConsumptionApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceRequest"): + return &applyconfigurationsresourcev1beta2.DeviceRequestApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceRequestAllocationResult"): + return &applyconfigurationsresourcev1beta2.DeviceRequestAllocationResultApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceSelector"): + return &applyconfigurationsresourcev1beta2.DeviceSelectorApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceSubRequest"): + return &applyconfigurationsresourcev1beta2.DeviceSubRequestApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceTaint"): + return &applyconfigurationsresourcev1beta2.DeviceTaintApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceToleration"): + return &applyconfigurationsresourcev1beta2.DeviceTolerationApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("ExactDeviceRequest"): + return &applyconfigurationsresourcev1beta2.ExactDeviceRequestApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("NetworkDeviceData"): + return &applyconfigurationsresourcev1beta2.NetworkDeviceDataApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("OpaqueDeviceConfiguration"): + return &applyconfigurationsresourcev1beta2.OpaqueDeviceConfigurationApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("ResourceClaim"): + return &applyconfigurationsresourcev1beta2.ResourceClaimApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("ResourceClaimConsumerReference"): + return &applyconfigurationsresourcev1beta2.ResourceClaimConsumerReferenceApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("ResourceClaimSpec"): + return &applyconfigurationsresourcev1beta2.ResourceClaimSpecApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("ResourceClaimStatus"): + return &applyconfigurationsresourcev1beta2.ResourceClaimStatusApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("ResourceClaimTemplate"): + return &applyconfigurationsresourcev1beta2.ResourceClaimTemplateApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("ResourceClaimTemplateSpec"): + return &applyconfigurationsresourcev1beta2.ResourceClaimTemplateSpecApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("ResourcePool"): + return &applyconfigurationsresourcev1beta2.ResourcePoolApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("ResourceSlice"): + return &applyconfigurationsresourcev1beta2.ResourceSliceApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("ResourceSliceSpec"): + return &applyconfigurationsresourcev1beta2.ResourceSliceSpecApplyConfiguration{} + // Group=scheduling.k8s.io, Version=v1 case schedulingv1.SchemeGroupVersion.WithKind("PriorityClass"): return &applyconfigurationsschedulingv1.PriorityClassApplyConfiguration{} diff --git a/e2e/vendor/k8s.io/client-go/discovery/aggregated_discovery.go b/e2e/vendor/k8s.io/client-go/discovery/aggregated_discovery.go index f5eaaedab..82d46b489 100644 --- a/e2e/vendor/k8s.io/client-go/discovery/aggregated_discovery.go +++ b/e2e/vendor/k8s.io/client-go/discovery/aggregated_discovery.go @@ -156,7 +156,7 @@ func convertAPISubresource(parent metav1.APIResource, in apidiscovery.APISubreso return result, nil } -// Please note the functions below will be removed in v1.33. They facilitate conversion +// Please note the functions below will be removed in v1.35. They facilitate conversion // between the deprecated type apidiscoveryv2beta1.APIGroupDiscoveryList. // SplitGroupsAndResourcesV2Beta1 transforms "aggregated" discovery top-level structure into diff --git a/e2e/vendor/k8s.io/client-go/discovery/discovery_client.go b/e2e/vendor/k8s.io/client-go/discovery/discovery_client.go index ef14fee5f..646820cbc 100644 --- a/e2e/vendor/k8s.io/client-go/discovery/discovery_client.go +++ b/e2e/vendor/k8s.io/client-go/discovery/discovery_client.go @@ -29,9 +29,8 @@ import ( "sync" "time" - //nolint:staticcheck // SA1019 Keep using module since it's still being maintained and the api of google.golang.org/protobuf/proto differs - "github.com/golang/protobuf/proto" openapi_v2 "github.com/google/gnostic-models/openapiv2" + "google.golang.org/protobuf/proto" apidiscoveryv2 "k8s.io/api/apidiscovery/v2" apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1" diff --git a/e2e/vendor/k8s.io/client-go/discovery/doc.go b/e2e/vendor/k8s.io/client-go/discovery/doc.go index 6baa1ef2a..76495588e 100644 --- a/e2e/vendor/k8s.io/client-go/discovery/doc.go +++ b/e2e/vendor/k8s.io/client-go/discovery/doc.go @@ -16,4 +16,4 @@ limitations under the License. // Package discovery provides ways to discover server-supported // API groups, versions and resources. -package discovery // import "k8s.io/client-go/discovery" +package discovery diff --git a/e2e/vendor/k8s.io/client-go/dynamic/dynamicinformer/informer.go b/e2e/vendor/k8s.io/client-go/dynamic/dynamicinformer/informer.go index 62d01339d..d1381823d 100644 --- a/e2e/vendor/k8s.io/client-go/dynamic/dynamicinformer/informer.go +++ b/e2e/vendor/k8s.io/client-go/dynamic/dynamicinformer/informer.go @@ -153,13 +153,25 @@ func NewFilteredDynamicInformer(client dynamic.Interface, gvr schema.GroupVersio if tweakListOptions != nil { tweakListOptions(&options) } - return client.Resource(gvr).Namespace(namespace).List(context.TODO(), options) + return client.Resource(gvr).Namespace(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.Resource(gvr).Namespace(namespace).Watch(context.TODO(), options) + return client.Resource(gvr).Namespace(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.Resource(gvr).Namespace(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.Resource(gvr).Namespace(namespace).Watch(ctx, options) }, }, &unstructured.Unstructured{}, diff --git a/e2e/vendor/k8s.io/client-go/dynamic/fake/simple.go b/e2e/vendor/k8s.io/client-go/dynamic/fake/simple.go deleted file mode 100644 index 5d0a6f69f..000000000 --- a/e2e/vendor/k8s.io/client-go/dynamic/fake/simple.go +++ /dev/null @@ -1,539 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - "context" - "fmt" - "strings" - - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/dynamic" - "k8s.io/client-go/testing" -) - -func NewSimpleDynamicClient(scheme *runtime.Scheme, objects ...runtime.Object) *FakeDynamicClient { - unstructuredScheme := runtime.NewScheme() - for gvk := range scheme.AllKnownTypes() { - if unstructuredScheme.Recognizes(gvk) { - continue - } - if strings.HasSuffix(gvk.Kind, "List") { - unstructuredScheme.AddKnownTypeWithName(gvk, &unstructured.UnstructuredList{}) - continue - } - unstructuredScheme.AddKnownTypeWithName(gvk, &unstructured.Unstructured{}) - } - - objects, err := convertObjectsToUnstructured(scheme, objects) - if err != nil { - panic(err) - } - - for _, obj := range objects { - gvk := obj.GetObjectKind().GroupVersionKind() - if !unstructuredScheme.Recognizes(gvk) { - unstructuredScheme.AddKnownTypeWithName(gvk, &unstructured.Unstructured{}) - } - gvk.Kind += "List" - if !unstructuredScheme.Recognizes(gvk) { - unstructuredScheme.AddKnownTypeWithName(gvk, &unstructured.UnstructuredList{}) - } - } - - return NewSimpleDynamicClientWithCustomListKinds(unstructuredScheme, nil, objects...) -} - -// NewSimpleDynamicClientWithCustomListKinds try not to use this. In general you want to have the scheme have the List types registered -// and allow the default guessing for resources match. Sometimes that doesn't work, so you can specify a custom mapping here. -func NewSimpleDynamicClientWithCustomListKinds(scheme *runtime.Scheme, gvrToListKind map[schema.GroupVersionResource]string, objects ...runtime.Object) *FakeDynamicClient { - // In order to use List with this client, you have to have your lists registered so that the object tracker will find them - // in the scheme to support the t.scheme.New(listGVK) call when it's building the return value. - // Since the base fake client needs the listGVK passed through the action (in cases where there are no instances, it - // cannot look up the actual hits), we need to know a mapping of GVR to listGVK here. For GETs and other types of calls, - // there is no return value that contains a GVK, so it doesn't have to know the mapping in advance. - - // first we attempt to invert known List types from the scheme to auto guess the resource with unsafe guesses - // this covers common usage of registering types in scheme and passing them - completeGVRToListKind := map[schema.GroupVersionResource]string{} - for listGVK := range scheme.AllKnownTypes() { - if !strings.HasSuffix(listGVK.Kind, "List") { - continue - } - nonListGVK := listGVK.GroupVersion().WithKind(listGVK.Kind[:len(listGVK.Kind)-4]) - plural, _ := meta.UnsafeGuessKindToResource(nonListGVK) - completeGVRToListKind[plural] = listGVK.Kind - } - - for gvr, listKind := range gvrToListKind { - if !strings.HasSuffix(listKind, "List") { - panic("coding error, listGVK must end in List or this fake client doesn't work right") - } - listGVK := gvr.GroupVersion().WithKind(listKind) - - // if we already have this type registered, just skip it - if _, err := scheme.New(listGVK); err == nil { - completeGVRToListKind[gvr] = listKind - continue - } - - scheme.AddKnownTypeWithName(listGVK, &unstructured.UnstructuredList{}) - completeGVRToListKind[gvr] = listKind - } - - codecs := serializer.NewCodecFactory(scheme) - o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - cs := &FakeDynamicClient{scheme: scheme, gvrToListKind: completeGVRToListKind, tracker: o} - cs.AddReactor("*", "*", testing.ObjectReaction(o)) - cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { - gvr := action.GetResource() - ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) - if err != nil { - return false, nil, err - } - return true, watch, nil - }) - - return cs -} - -// Clientset implements clientset.Interface. 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 FakeDynamicClient struct { - testing.Fake - scheme *runtime.Scheme - gvrToListKind map[schema.GroupVersionResource]string - tracker testing.ObjectTracker -} - -type dynamicResourceClient struct { - client *FakeDynamicClient - namespace string - resource schema.GroupVersionResource - listKind string -} - -var ( - _ dynamic.Interface = &FakeDynamicClient{} - _ testing.FakeClient = &FakeDynamicClient{} -) - -func (c *FakeDynamicClient) Tracker() testing.ObjectTracker { - return c.tracker -} - -func (c *FakeDynamicClient) Resource(resource schema.GroupVersionResource) dynamic.NamespaceableResourceInterface { - return &dynamicResourceClient{client: c, resource: resource, listKind: c.gvrToListKind[resource]} -} - -func (c *dynamicResourceClient) Namespace(ns string) dynamic.ResourceInterface { - ret := *c - ret.namespace = ns - return &ret -} - -func (c *dynamicResourceClient) Create(ctx context.Context, obj *unstructured.Unstructured, opts metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error) { - var uncastRet runtime.Object - var err error - switch { - case len(c.namespace) == 0 && len(subresources) == 0: - uncastRet, err = c.client.Fake. - Invokes(testing.NewRootCreateAction(c.resource, obj), obj) - - case len(c.namespace) == 0 && len(subresources) > 0: - var accessor metav1.Object // avoid shadowing err - accessor, err = meta.Accessor(obj) - if err != nil { - return nil, err - } - name := accessor.GetName() - uncastRet, err = c.client.Fake. - Invokes(testing.NewRootCreateSubresourceAction(c.resource, name, strings.Join(subresources, "/"), obj), obj) - - case len(c.namespace) > 0 && len(subresources) == 0: - uncastRet, err = c.client.Fake. - Invokes(testing.NewCreateAction(c.resource, c.namespace, obj), obj) - - case len(c.namespace) > 0 && len(subresources) > 0: - var accessor metav1.Object // avoid shadowing err - accessor, err = meta.Accessor(obj) - if err != nil { - return nil, err - } - name := accessor.GetName() - uncastRet, err = c.client.Fake. - Invokes(testing.NewCreateSubresourceAction(c.resource, name, strings.Join(subresources, "/"), c.namespace, obj), obj) - - } - - if err != nil { - return nil, err - } - if uncastRet == nil { - return nil, err - } - - ret := &unstructured.Unstructured{} - if err := c.client.scheme.Convert(uncastRet, ret, nil); err != nil { - return nil, err - } - return ret, err -} - -func (c *dynamicResourceClient) Update(ctx context.Context, obj *unstructured.Unstructured, opts metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error) { - var uncastRet runtime.Object - var err error - switch { - case len(c.namespace) == 0 && len(subresources) == 0: - uncastRet, err = c.client.Fake. - Invokes(testing.NewRootUpdateAction(c.resource, obj), obj) - - case len(c.namespace) == 0 && len(subresources) > 0: - uncastRet, err = c.client.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(c.resource, strings.Join(subresources, "/"), obj), obj) - - case len(c.namespace) > 0 && len(subresources) == 0: - uncastRet, err = c.client.Fake. - Invokes(testing.NewUpdateAction(c.resource, c.namespace, obj), obj) - - case len(c.namespace) > 0 && len(subresources) > 0: - uncastRet, err = c.client.Fake. - Invokes(testing.NewUpdateSubresourceAction(c.resource, strings.Join(subresources, "/"), c.namespace, obj), obj) - - } - - if err != nil { - return nil, err - } - if uncastRet == nil { - return nil, err - } - - ret := &unstructured.Unstructured{} - if err := c.client.scheme.Convert(uncastRet, ret, nil); err != nil { - return nil, err - } - return ret, err -} - -func (c *dynamicResourceClient) UpdateStatus(ctx context.Context, obj *unstructured.Unstructured, opts metav1.UpdateOptions) (*unstructured.Unstructured, error) { - var uncastRet runtime.Object - var err error - switch { - case len(c.namespace) == 0: - uncastRet, err = c.client.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(c.resource, "status", obj), obj) - - case len(c.namespace) > 0: - uncastRet, err = c.client.Fake. - Invokes(testing.NewUpdateSubresourceAction(c.resource, "status", c.namespace, obj), obj) - - } - - if err != nil { - return nil, err - } - if uncastRet == nil { - return nil, err - } - - ret := &unstructured.Unstructured{} - if err := c.client.scheme.Convert(uncastRet, ret, nil); err != nil { - return nil, err - } - return ret, err -} - -func (c *dynamicResourceClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions, subresources ...string) error { - var err error - switch { - case len(c.namespace) == 0 && len(subresources) == 0: - _, err = c.client.Fake. - Invokes(testing.NewRootDeleteAction(c.resource, name), &metav1.Status{Status: "dynamic delete fail"}) - - case len(c.namespace) == 0 && len(subresources) > 0: - _, err = c.client.Fake. - Invokes(testing.NewRootDeleteSubresourceAction(c.resource, strings.Join(subresources, "/"), name), &metav1.Status{Status: "dynamic delete fail"}) - - case len(c.namespace) > 0 && len(subresources) == 0: - _, err = c.client.Fake. - Invokes(testing.NewDeleteAction(c.resource, c.namespace, name), &metav1.Status{Status: "dynamic delete fail"}) - - case len(c.namespace) > 0 && len(subresources) > 0: - _, err = c.client.Fake. - Invokes(testing.NewDeleteSubresourceAction(c.resource, strings.Join(subresources, "/"), c.namespace, name), &metav1.Status{Status: "dynamic delete fail"}) - } - - return err -} - -func (c *dynamicResourceClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOptions metav1.ListOptions) error { - var err error - switch { - case len(c.namespace) == 0: - action := testing.NewRootDeleteCollectionAction(c.resource, listOptions) - _, err = c.client.Fake.Invokes(action, &metav1.Status{Status: "dynamic deletecollection fail"}) - - case len(c.namespace) > 0: - action := testing.NewDeleteCollectionAction(c.resource, c.namespace, listOptions) - _, err = c.client.Fake.Invokes(action, &metav1.Status{Status: "dynamic deletecollection fail"}) - - } - - return err -} - -func (c *dynamicResourceClient) Get(ctx context.Context, name string, opts metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error) { - var uncastRet runtime.Object - var err error - switch { - case len(c.namespace) == 0 && len(subresources) == 0: - uncastRet, err = c.client.Fake. - Invokes(testing.NewRootGetAction(c.resource, name), &metav1.Status{Status: "dynamic get fail"}) - - case len(c.namespace) == 0 && len(subresources) > 0: - uncastRet, err = c.client.Fake. - Invokes(testing.NewRootGetSubresourceAction(c.resource, strings.Join(subresources, "/"), name), &metav1.Status{Status: "dynamic get fail"}) - - case len(c.namespace) > 0 && len(subresources) == 0: - uncastRet, err = c.client.Fake. - Invokes(testing.NewGetAction(c.resource, c.namespace, name), &metav1.Status{Status: "dynamic get fail"}) - - case len(c.namespace) > 0 && len(subresources) > 0: - uncastRet, err = c.client.Fake. - Invokes(testing.NewGetSubresourceAction(c.resource, c.namespace, strings.Join(subresources, "/"), name), &metav1.Status{Status: "dynamic get fail"}) - } - - if err != nil { - return nil, err - } - if uncastRet == nil { - return nil, err - } - - ret := &unstructured.Unstructured{} - if err := c.client.scheme.Convert(uncastRet, ret, nil); err != nil { - return nil, err - } - return ret, err -} - -func (c *dynamicResourceClient) List(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) { - if len(c.listKind) == 0 { - panic(fmt.Sprintf("coding error: you must register resource to list kind for every resource you're going to LIST when creating the client. See NewSimpleDynamicClientWithCustomListKinds or register the list into the scheme: %v out of %v", c.resource, c.client.gvrToListKind)) - } - listGVK := c.resource.GroupVersion().WithKind(c.listKind) - listForFakeClientGVK := c.resource.GroupVersion().WithKind(c.listKind[:len(c.listKind)-4]) /*base library appends List*/ - - var obj runtime.Object - var err error - switch { - case len(c.namespace) == 0: - obj, err = c.client.Fake. - Invokes(testing.NewRootListAction(c.resource, listForFakeClientGVK, opts), &metav1.Status{Status: "dynamic list fail"}) - - case len(c.namespace) > 0: - obj, err = c.client.Fake. - Invokes(testing.NewListAction(c.resource, listForFakeClientGVK, c.namespace, opts), &metav1.Status{Status: "dynamic list fail"}) - - } - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - - retUnstructured := &unstructured.Unstructured{} - if err := c.client.scheme.Convert(obj, retUnstructured, nil); err != nil { - return nil, err - } - entireList, err := retUnstructured.ToList() - if err != nil { - return nil, err - } - - list := &unstructured.UnstructuredList{} - list.SetRemainingItemCount(entireList.GetRemainingItemCount()) - list.SetResourceVersion(entireList.GetResourceVersion()) - list.SetContinue(entireList.GetContinue()) - list.GetObjectKind().SetGroupVersionKind(listGVK) - for i := range entireList.Items { - item := &entireList.Items[i] - metadata, err := meta.Accessor(item) - if err != nil { - return nil, err - } - if label.Matches(labels.Set(metadata.GetLabels())) { - list.Items = append(list.Items, *item) - } - } - return list, nil -} - -func (c *dynamicResourceClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - switch { - case len(c.namespace) == 0: - return c.client.Fake. - InvokesWatch(testing.NewRootWatchAction(c.resource, opts)) - - case len(c.namespace) > 0: - return c.client.Fake. - InvokesWatch(testing.NewWatchAction(c.resource, c.namespace, opts)) - - } - - panic("math broke") -} - -// TODO: opts are currently ignored. -func (c *dynamicResourceClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*unstructured.Unstructured, error) { - var uncastRet runtime.Object - var err error - switch { - case len(c.namespace) == 0 && len(subresources) == 0: - uncastRet, err = c.client.Fake. - Invokes(testing.NewRootPatchAction(c.resource, name, pt, data), &metav1.Status{Status: "dynamic patch fail"}) - - case len(c.namespace) == 0 && len(subresources) > 0: - uncastRet, err = c.client.Fake. - Invokes(testing.NewRootPatchSubresourceAction(c.resource, name, pt, data, subresources...), &metav1.Status{Status: "dynamic patch fail"}) - - case len(c.namespace) > 0 && len(subresources) == 0: - uncastRet, err = c.client.Fake. - Invokes(testing.NewPatchAction(c.resource, c.namespace, name, pt, data), &metav1.Status{Status: "dynamic patch fail"}) - - case len(c.namespace) > 0 && len(subresources) > 0: - uncastRet, err = c.client.Fake. - Invokes(testing.NewPatchSubresourceAction(c.resource, c.namespace, name, pt, data, subresources...), &metav1.Status{Status: "dynamic patch fail"}) - - } - - if err != nil { - return nil, err - } - if uncastRet == nil { - return nil, err - } - - ret := &unstructured.Unstructured{} - if err := c.client.scheme.Convert(uncastRet, ret, nil); err != nil { - return nil, err - } - return ret, err -} - -// TODO: opts are currently ignored. -func (c *dynamicResourceClient) Apply(ctx context.Context, name string, obj *unstructured.Unstructured, options metav1.ApplyOptions, subresources ...string) (*unstructured.Unstructured, error) { - outBytes, err := runtime.Encode(unstructured.UnstructuredJSONScheme, obj) - if err != nil { - return nil, err - } - var uncastRet runtime.Object - switch { - case len(c.namespace) == 0 && len(subresources) == 0: - uncastRet, err = c.client.Fake. - Invokes(testing.NewRootPatchAction(c.resource, name, types.ApplyPatchType, outBytes), &metav1.Status{Status: "dynamic patch fail"}) - - case len(c.namespace) == 0 && len(subresources) > 0: - uncastRet, err = c.client.Fake. - Invokes(testing.NewRootPatchSubresourceAction(c.resource, name, types.ApplyPatchType, outBytes, subresources...), &metav1.Status{Status: "dynamic patch fail"}) - - case len(c.namespace) > 0 && len(subresources) == 0: - uncastRet, err = c.client.Fake. - Invokes(testing.NewPatchAction(c.resource, c.namespace, name, types.ApplyPatchType, outBytes), &metav1.Status{Status: "dynamic patch fail"}) - - case len(c.namespace) > 0 && len(subresources) > 0: - uncastRet, err = c.client.Fake. - Invokes(testing.NewPatchSubresourceAction(c.resource, c.namespace, name, types.ApplyPatchType, outBytes, subresources...), &metav1.Status{Status: "dynamic patch fail"}) - - } - - if err != nil { - return nil, err - } - if uncastRet == nil { - return nil, err - } - - ret := &unstructured.Unstructured{} - if err := c.client.scheme.Convert(uncastRet, ret, nil); err != nil { - return nil, err - } - return ret, nil -} - -func (c *dynamicResourceClient) ApplyStatus(ctx context.Context, name string, obj *unstructured.Unstructured, options metav1.ApplyOptions) (*unstructured.Unstructured, error) { - return c.Apply(ctx, name, obj, options, "status") -} - -func convertObjectsToUnstructured(s *runtime.Scheme, objs []runtime.Object) ([]runtime.Object, error) { - ul := make([]runtime.Object, 0, len(objs)) - - for _, obj := range objs { - u, err := convertToUnstructured(s, obj) - if err != nil { - return nil, err - } - - ul = append(ul, u) - } - return ul, nil -} - -func convertToUnstructured(s *runtime.Scheme, obj runtime.Object) (runtime.Object, error) { - var ( - err error - u unstructured.Unstructured - ) - - u.Object, err = runtime.DefaultUnstructuredConverter.ToUnstructured(obj) - if err != nil { - return nil, fmt.Errorf("failed to convert to unstructured: %w", err) - } - - gvk := u.GroupVersionKind() - if gvk.Group == "" || gvk.Kind == "" { - gvks, _, err := s.ObjectKinds(obj) - if err != nil { - return nil, fmt.Errorf("failed to convert to unstructured - unable to get GVK %w", err) - } - apiv, k := gvks[0].ToAPIVersionAndKind() - u.SetAPIVersion(apiv) - u.SetKind(k) - } - return &u, nil -} diff --git a/e2e/vendor/k8s.io/client-go/features/known_features.go b/e2e/vendor/k8s.io/client-go/features/known_features.go index a74f6a833..344d2ebb7 100644 --- a/e2e/vendor/k8s.io/client-go/features/known_features.go +++ b/e2e/vendor/k8s.io/client-go/features/known_features.go @@ -53,6 +53,12 @@ const ( // alpha: v1.30 InformerResourceVersion Feature = "InformerResourceVersion" + // owner: @deads2k + // beta: v1.33 + // + // Refactor informers to deliver watch stream events in order instead of out of order. + InOrderInformers Feature = "InOrderInformers" + // owner: @p0lyn0mial // beta: v1.30 // @@ -73,5 +79,6 @@ var defaultKubernetesFeatureGates = map[Feature]FeatureSpec{ ClientsAllowCBOR: {Default: false, PreRelease: Alpha}, ClientsPreferCBOR: {Default: false, PreRelease: Alpha}, InformerResourceVersion: {Default: false, PreRelease: Alpha}, + InOrderInformers: {Default: true, PreRelease: Beta}, WatchListClient: {Default: false, PreRelease: Beta}, } diff --git a/e2e/vendor/k8s.io/client-go/gentype/fake.go b/e2e/vendor/k8s.io/client-go/gentype/fake.go index bcb9ca27f..6ea3cbe0c 100644 --- a/e2e/vendor/k8s.io/client-go/gentype/fake.go +++ b/e2e/vendor/k8s.io/client-go/gentype/fake.go @@ -183,6 +183,7 @@ func (l *alsoFakeLister[T, L]) List(ctx context.Context, opts metav1.ListOptions // Watch returns a watch.Interface that watches the requested resources. func (c *FakeClient[T]) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + opts.Watch = true return c.Fake. InvokesWatch(testing.NewWatchActionWithOptions(c.resource, c.ns, opts)) } diff --git a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1/mutatingwebhookconfiguration.go b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1/mutatingwebhookconfiguration.go index 11c67480f..7adafde23 100644 --- a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1/mutatingwebhookconfiguration.go +++ b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1/mutatingwebhookconfiguration.go @@ -61,13 +61,25 @@ func NewFilteredMutatingWebhookConfigurationInformer(client kubernetes.Interface if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1().MutatingWebhookConfigurations().List(context.TODO(), options) + return client.AdmissionregistrationV1().MutatingWebhookConfigurations().List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1().MutatingWebhookConfigurations().Watch(context.TODO(), options) + return client.AdmissionregistrationV1().MutatingWebhookConfigurations().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1().MutatingWebhookConfigurations().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1().MutatingWebhookConfigurations().Watch(ctx, options) }, }, &apiadmissionregistrationv1.MutatingWebhookConfiguration{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicy.go b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicy.go index e6974238c..92cfa1fa4 100644 --- a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicy.go +++ b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicy.go @@ -61,13 +61,25 @@ func NewFilteredValidatingAdmissionPolicyInformer(client kubernetes.Interface, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1().ValidatingAdmissionPolicies().List(context.TODO(), options) + return client.AdmissionregistrationV1().ValidatingAdmissionPolicies().List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1().ValidatingAdmissionPolicies().Watch(context.TODO(), options) + return client.AdmissionregistrationV1().ValidatingAdmissionPolicies().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1().ValidatingAdmissionPolicies().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1().ValidatingAdmissionPolicies().Watch(ctx, options) }, }, &apiadmissionregistrationv1.ValidatingAdmissionPolicy{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicybinding.go b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicybinding.go index 34067ca38..e0c35ec5e 100644 --- a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicybinding.go +++ b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicybinding.go @@ -61,13 +61,25 @@ func NewFilteredValidatingAdmissionPolicyBindingInformer(client kubernetes.Inter if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1().ValidatingAdmissionPolicyBindings().List(context.TODO(), options) + return client.AdmissionregistrationV1().ValidatingAdmissionPolicyBindings().List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1().ValidatingAdmissionPolicyBindings().Watch(context.TODO(), options) + return client.AdmissionregistrationV1().ValidatingAdmissionPolicyBindings().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1().ValidatingAdmissionPolicyBindings().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1().ValidatingAdmissionPolicyBindings().Watch(ctx, options) }, }, &apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingwebhookconfiguration.go b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingwebhookconfiguration.go index 42ca69c22..8ddeb0492 100644 --- a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingwebhookconfiguration.go +++ b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingwebhookconfiguration.go @@ -61,13 +61,25 @@ func NewFilteredValidatingWebhookConfigurationInformer(client kubernetes.Interfa if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1().ValidatingWebhookConfigurations().List(context.TODO(), options) + return client.AdmissionregistrationV1().ValidatingWebhookConfigurations().List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Watch(context.TODO(), options) + return client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1().ValidatingWebhookConfigurations().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Watch(ctx, options) }, }, &apiadmissionregistrationv1.ValidatingWebhookConfiguration{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/mutatingadmissionpolicy.go b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/mutatingadmissionpolicy.go index 5a23158bf..939eff983 100644 --- a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/mutatingadmissionpolicy.go +++ b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/mutatingadmissionpolicy.go @@ -61,13 +61,25 @@ func NewFilteredMutatingAdmissionPolicyInformer(client kubernetes.Interface, res if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1alpha1().MutatingAdmissionPolicies().List(context.TODO(), options) + return client.AdmissionregistrationV1alpha1().MutatingAdmissionPolicies().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1alpha1().MutatingAdmissionPolicies().Watch(context.TODO(), options) + return client.AdmissionregistrationV1alpha1().MutatingAdmissionPolicies().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1alpha1().MutatingAdmissionPolicies().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1alpha1().MutatingAdmissionPolicies().Watch(ctx, options) }, }, &apiadmissionregistrationv1alpha1.MutatingAdmissionPolicy{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/mutatingadmissionpolicybinding.go b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/mutatingadmissionpolicybinding.go index efa143fe5..a94f6d27b 100644 --- a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/mutatingadmissionpolicybinding.go +++ b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/mutatingadmissionpolicybinding.go @@ -61,13 +61,25 @@ func NewFilteredMutatingAdmissionPolicyBindingInformer(client kubernetes.Interfa if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1alpha1().MutatingAdmissionPolicyBindings().List(context.TODO(), options) + return client.AdmissionregistrationV1alpha1().MutatingAdmissionPolicyBindings().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1alpha1().MutatingAdmissionPolicyBindings().Watch(context.TODO(), options) + return client.AdmissionregistrationV1alpha1().MutatingAdmissionPolicyBindings().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1alpha1().MutatingAdmissionPolicyBindings().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1alpha1().MutatingAdmissionPolicyBindings().Watch(ctx, options) }, }, &apiadmissionregistrationv1alpha1.MutatingAdmissionPolicyBinding{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/validatingadmissionpolicy.go b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/validatingadmissionpolicy.go index aaae7b297..1a6f7d56d 100644 --- a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/validatingadmissionpolicy.go +++ b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/validatingadmissionpolicy.go @@ -61,13 +61,25 @@ func NewFilteredValidatingAdmissionPolicyInformer(client kubernetes.Interface, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1alpha1().ValidatingAdmissionPolicies().List(context.TODO(), options) + return client.AdmissionregistrationV1alpha1().ValidatingAdmissionPolicies().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1alpha1().ValidatingAdmissionPolicies().Watch(context.TODO(), options) + return client.AdmissionregistrationV1alpha1().ValidatingAdmissionPolicies().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1alpha1().ValidatingAdmissionPolicies().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1alpha1().ValidatingAdmissionPolicies().Watch(ctx, options) }, }, &apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicy{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go index d62c59061..3afaa3bec 100644 --- a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go +++ b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go @@ -61,13 +61,25 @@ func NewFilteredValidatingAdmissionPolicyBindingInformer(client kubernetes.Inter if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1alpha1().ValidatingAdmissionPolicyBindings().List(context.TODO(), options) + return client.AdmissionregistrationV1alpha1().ValidatingAdmissionPolicyBindings().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1alpha1().ValidatingAdmissionPolicyBindings().Watch(context.TODO(), options) + return client.AdmissionregistrationV1alpha1().ValidatingAdmissionPolicyBindings().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1alpha1().ValidatingAdmissionPolicyBindings().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1alpha1().ValidatingAdmissionPolicyBindings().Watch(ctx, options) }, }, &apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index c6ca36ea2..697dae852 100644 --- a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -61,13 +61,25 @@ func NewFilteredMutatingWebhookConfigurationInformer(client kubernetes.Interface if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().List(context.TODO(), options) + return client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Watch(context.TODO(), options) + return client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Watch(ctx, options) }, }, &apiadmissionregistrationv1beta1.MutatingWebhookConfiguration{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicy.go b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicy.go index d5b4204f1..31c3569d9 100644 --- a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicy.go +++ b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicy.go @@ -61,13 +61,25 @@ func NewFilteredValidatingAdmissionPolicyInformer(client kubernetes.Interface, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1beta1().ValidatingAdmissionPolicies().List(context.TODO(), options) + return client.AdmissionregistrationV1beta1().ValidatingAdmissionPolicies().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1beta1().ValidatingAdmissionPolicies().Watch(context.TODO(), options) + return client.AdmissionregistrationV1beta1().ValidatingAdmissionPolicies().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1beta1().ValidatingAdmissionPolicies().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1beta1().ValidatingAdmissionPolicies().Watch(ctx, options) }, }, &apiadmissionregistrationv1beta1.ValidatingAdmissionPolicy{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicybinding.go b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicybinding.go index dbb5153ef..fb2c10e3e 100644 --- a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicybinding.go +++ b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicybinding.go @@ -61,13 +61,25 @@ func NewFilteredValidatingAdmissionPolicyBindingInformer(client kubernetes.Inter if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1beta1().ValidatingAdmissionPolicyBindings().List(context.TODO(), options) + return client.AdmissionregistrationV1beta1().ValidatingAdmissionPolicyBindings().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1beta1().ValidatingAdmissionPolicyBindings().Watch(context.TODO(), options) + return client.AdmissionregistrationV1beta1().ValidatingAdmissionPolicyBindings().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1beta1().ValidatingAdmissionPolicyBindings().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1beta1().ValidatingAdmissionPolicyBindings().Watch(ctx, options) }, }, &apiadmissionregistrationv1beta1.ValidatingAdmissionPolicyBinding{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go index 602b361af..2eb6991cb 100644 --- a/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/e2e/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -61,13 +61,25 @@ func NewFilteredValidatingWebhookConfigurationInformer(client kubernetes.Interfa if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().List(context.TODO(), options) + return client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().Watch(context.TODO(), options) + return client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().Watch(ctx, options) }, }, &apiadmissionregistrationv1beta1.ValidatingWebhookConfiguration{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/apiserverinternal/v1alpha1/storageversion.go b/e2e/vendor/k8s.io/client-go/informers/apiserverinternal/v1alpha1/storageversion.go index a99dbd17d..e8e1669d1 100644 --- a/e2e/vendor/k8s.io/client-go/informers/apiserverinternal/v1alpha1/storageversion.go +++ b/e2e/vendor/k8s.io/client-go/informers/apiserverinternal/v1alpha1/storageversion.go @@ -61,13 +61,25 @@ func NewFilteredStorageVersionInformer(client kubernetes.Interface, resyncPeriod if tweakListOptions != nil { tweakListOptions(&options) } - return client.InternalV1alpha1().StorageVersions().List(context.TODO(), options) + return client.InternalV1alpha1().StorageVersions().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.InternalV1alpha1().StorageVersions().Watch(context.TODO(), options) + return client.InternalV1alpha1().StorageVersions().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.InternalV1alpha1().StorageVersions().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.InternalV1alpha1().StorageVersions().Watch(ctx, options) }, }, &apiapiserverinternalv1alpha1.StorageVersion{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/apps/v1/controllerrevision.go b/e2e/vendor/k8s.io/client-go/informers/apps/v1/controllerrevision.go index 334a1b8f8..64eeddec0 100644 --- a/e2e/vendor/k8s.io/client-go/informers/apps/v1/controllerrevision.go +++ b/e2e/vendor/k8s.io/client-go/informers/apps/v1/controllerrevision.go @@ -62,13 +62,25 @@ func NewFilteredControllerRevisionInformer(client kubernetes.Interface, namespac if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1().ControllerRevisions(namespace).List(context.TODO(), options) + return client.AppsV1().ControllerRevisions(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1().ControllerRevisions(namespace).Watch(context.TODO(), options) + return client.AppsV1().ControllerRevisions(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1().ControllerRevisions(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1().ControllerRevisions(namespace).Watch(ctx, options) }, }, &apiappsv1.ControllerRevision{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/apps/v1/daemonset.go b/e2e/vendor/k8s.io/client-go/informers/apps/v1/daemonset.go index 73adf8cbf..4a3e95e1f 100644 --- a/e2e/vendor/k8s.io/client-go/informers/apps/v1/daemonset.go +++ b/e2e/vendor/k8s.io/client-go/informers/apps/v1/daemonset.go @@ -62,13 +62,25 @@ func NewFilteredDaemonSetInformer(client kubernetes.Interface, namespace string, if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1().DaemonSets(namespace).List(context.TODO(), options) + return client.AppsV1().DaemonSets(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1().DaemonSets(namespace).Watch(context.TODO(), options) + return client.AppsV1().DaemonSets(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1().DaemonSets(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1().DaemonSets(namespace).Watch(ctx, options) }, }, &apiappsv1.DaemonSet{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/apps/v1/deployment.go b/e2e/vendor/k8s.io/client-go/informers/apps/v1/deployment.go index f9314844c..9c0c20c53 100644 --- a/e2e/vendor/k8s.io/client-go/informers/apps/v1/deployment.go +++ b/e2e/vendor/k8s.io/client-go/informers/apps/v1/deployment.go @@ -62,13 +62,25 @@ func NewFilteredDeploymentInformer(client kubernetes.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1().Deployments(namespace).List(context.TODO(), options) + return client.AppsV1().Deployments(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1().Deployments(namespace).Watch(context.TODO(), options) + return client.AppsV1().Deployments(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1().Deployments(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1().Deployments(namespace).Watch(ctx, options) }, }, &apiappsv1.Deployment{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/apps/v1/replicaset.go b/e2e/vendor/k8s.io/client-go/informers/apps/v1/replicaset.go index dfa8ae87a..75c7a79e8 100644 --- a/e2e/vendor/k8s.io/client-go/informers/apps/v1/replicaset.go +++ b/e2e/vendor/k8s.io/client-go/informers/apps/v1/replicaset.go @@ -62,13 +62,25 @@ func NewFilteredReplicaSetInformer(client kubernetes.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1().ReplicaSets(namespace).List(context.TODO(), options) + return client.AppsV1().ReplicaSets(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1().ReplicaSets(namespace).Watch(context.TODO(), options) + return client.AppsV1().ReplicaSets(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1().ReplicaSets(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1().ReplicaSets(namespace).Watch(ctx, options) }, }, &apiappsv1.ReplicaSet{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/apps/v1/statefulset.go b/e2e/vendor/k8s.io/client-go/informers/apps/v1/statefulset.go index 84ca50123..f759e0464 100644 --- a/e2e/vendor/k8s.io/client-go/informers/apps/v1/statefulset.go +++ b/e2e/vendor/k8s.io/client-go/informers/apps/v1/statefulset.go @@ -62,13 +62,25 @@ func NewFilteredStatefulSetInformer(client kubernetes.Interface, namespace strin if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1().StatefulSets(namespace).List(context.TODO(), options) + return client.AppsV1().StatefulSets(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1().StatefulSets(namespace).Watch(context.TODO(), options) + return client.AppsV1().StatefulSets(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1().StatefulSets(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1().StatefulSets(namespace).Watch(ctx, options) }, }, &apiappsv1.StatefulSet{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/apps/v1beta1/controllerrevision.go b/e2e/vendor/k8s.io/client-go/informers/apps/v1beta1/controllerrevision.go index c0a51dbe3..79b2fb907 100644 --- a/e2e/vendor/k8s.io/client-go/informers/apps/v1beta1/controllerrevision.go +++ b/e2e/vendor/k8s.io/client-go/informers/apps/v1beta1/controllerrevision.go @@ -62,13 +62,25 @@ func NewFilteredControllerRevisionInformer(client kubernetes.Interface, namespac if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta1().ControllerRevisions(namespace).List(context.TODO(), options) + return client.AppsV1beta1().ControllerRevisions(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta1().ControllerRevisions(namespace).Watch(context.TODO(), options) + return client.AppsV1beta1().ControllerRevisions(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1beta1().ControllerRevisions(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1beta1().ControllerRevisions(namespace).Watch(ctx, options) }, }, &apiappsv1beta1.ControllerRevision{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/apps/v1beta1/deployment.go b/e2e/vendor/k8s.io/client-go/informers/apps/v1beta1/deployment.go index 027ae402d..1334c03a9 100644 --- a/e2e/vendor/k8s.io/client-go/informers/apps/v1beta1/deployment.go +++ b/e2e/vendor/k8s.io/client-go/informers/apps/v1beta1/deployment.go @@ -62,13 +62,25 @@ func NewFilteredDeploymentInformer(client kubernetes.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta1().Deployments(namespace).List(context.TODO(), options) + return client.AppsV1beta1().Deployments(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta1().Deployments(namespace).Watch(context.TODO(), options) + return client.AppsV1beta1().Deployments(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1beta1().Deployments(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1beta1().Deployments(namespace).Watch(ctx, options) }, }, &apiappsv1beta1.Deployment{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/apps/v1beta1/statefulset.go b/e2e/vendor/k8s.io/client-go/informers/apps/v1beta1/statefulset.go index bc357d7e7..2d52ae02d 100644 --- a/e2e/vendor/k8s.io/client-go/informers/apps/v1beta1/statefulset.go +++ b/e2e/vendor/k8s.io/client-go/informers/apps/v1beta1/statefulset.go @@ -62,13 +62,25 @@ func NewFilteredStatefulSetInformer(client kubernetes.Interface, namespace strin if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta1().StatefulSets(namespace).List(context.TODO(), options) + return client.AppsV1beta1().StatefulSets(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta1().StatefulSets(namespace).Watch(context.TODO(), options) + return client.AppsV1beta1().StatefulSets(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1beta1().StatefulSets(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1beta1().StatefulSets(namespace).Watch(ctx, options) }, }, &apiappsv1beta1.StatefulSet{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/apps/v1beta2/controllerrevision.go b/e2e/vendor/k8s.io/client-go/informers/apps/v1beta2/controllerrevision.go index 62a560fda..0936ef7b9 100644 --- a/e2e/vendor/k8s.io/client-go/informers/apps/v1beta2/controllerrevision.go +++ b/e2e/vendor/k8s.io/client-go/informers/apps/v1beta2/controllerrevision.go @@ -62,13 +62,25 @@ func NewFilteredControllerRevisionInformer(client kubernetes.Interface, namespac if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta2().ControllerRevisions(namespace).List(context.TODO(), options) + return client.AppsV1beta2().ControllerRevisions(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta2().ControllerRevisions(namespace).Watch(context.TODO(), options) + return client.AppsV1beta2().ControllerRevisions(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1beta2().ControllerRevisions(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1beta2().ControllerRevisions(namespace).Watch(ctx, options) }, }, &apiappsv1beta2.ControllerRevision{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/apps/v1beta2/daemonset.go b/e2e/vendor/k8s.io/client-go/informers/apps/v1beta2/daemonset.go index 9d4c8ede9..d5c49d77f 100644 --- a/e2e/vendor/k8s.io/client-go/informers/apps/v1beta2/daemonset.go +++ b/e2e/vendor/k8s.io/client-go/informers/apps/v1beta2/daemonset.go @@ -62,13 +62,25 @@ func NewFilteredDaemonSetInformer(client kubernetes.Interface, namespace string, if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta2().DaemonSets(namespace).List(context.TODO(), options) + return client.AppsV1beta2().DaemonSets(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta2().DaemonSets(namespace).Watch(context.TODO(), options) + return client.AppsV1beta2().DaemonSets(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1beta2().DaemonSets(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1beta2().DaemonSets(namespace).Watch(ctx, options) }, }, &apiappsv1beta2.DaemonSet{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/apps/v1beta2/deployment.go b/e2e/vendor/k8s.io/client-go/informers/apps/v1beta2/deployment.go index be85192cf..575ddbfca 100644 --- a/e2e/vendor/k8s.io/client-go/informers/apps/v1beta2/deployment.go +++ b/e2e/vendor/k8s.io/client-go/informers/apps/v1beta2/deployment.go @@ -62,13 +62,25 @@ func NewFilteredDeploymentInformer(client kubernetes.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta2().Deployments(namespace).List(context.TODO(), options) + return client.AppsV1beta2().Deployments(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta2().Deployments(namespace).Watch(context.TODO(), options) + return client.AppsV1beta2().Deployments(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1beta2().Deployments(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1beta2().Deployments(namespace).Watch(ctx, options) }, }, &apiappsv1beta2.Deployment{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/apps/v1beta2/replicaset.go b/e2e/vendor/k8s.io/client-go/informers/apps/v1beta2/replicaset.go index e5d279708..cfc4b3289 100644 --- a/e2e/vendor/k8s.io/client-go/informers/apps/v1beta2/replicaset.go +++ b/e2e/vendor/k8s.io/client-go/informers/apps/v1beta2/replicaset.go @@ -62,13 +62,25 @@ func NewFilteredReplicaSetInformer(client kubernetes.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta2().ReplicaSets(namespace).List(context.TODO(), options) + return client.AppsV1beta2().ReplicaSets(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta2().ReplicaSets(namespace).Watch(context.TODO(), options) + return client.AppsV1beta2().ReplicaSets(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1beta2().ReplicaSets(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1beta2().ReplicaSets(namespace).Watch(ctx, options) }, }, &apiappsv1beta2.ReplicaSet{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/apps/v1beta2/statefulset.go b/e2e/vendor/k8s.io/client-go/informers/apps/v1beta2/statefulset.go index d147fc885..a514c5bbb 100644 --- a/e2e/vendor/k8s.io/client-go/informers/apps/v1beta2/statefulset.go +++ b/e2e/vendor/k8s.io/client-go/informers/apps/v1beta2/statefulset.go @@ -62,13 +62,25 @@ func NewFilteredStatefulSetInformer(client kubernetes.Interface, namespace strin if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta2().StatefulSets(namespace).List(context.TODO(), options) + return client.AppsV1beta2().StatefulSets(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta2().StatefulSets(namespace).Watch(context.TODO(), options) + return client.AppsV1beta2().StatefulSets(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1beta2().StatefulSets(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppsV1beta2().StatefulSets(namespace).Watch(ctx, options) }, }, &apiappsv1beta2.StatefulSet{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/autoscaling/v1/horizontalpodautoscaler.go b/e2e/vendor/k8s.io/client-go/informers/autoscaling/v1/horizontalpodautoscaler.go index fce275934..e92f75639 100644 --- a/e2e/vendor/k8s.io/client-go/informers/autoscaling/v1/horizontalpodautoscaler.go +++ b/e2e/vendor/k8s.io/client-go/informers/autoscaling/v1/horizontalpodautoscaler.go @@ -62,13 +62,25 @@ func NewFilteredHorizontalPodAutoscalerInformer(client kubernetes.Interface, nam if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV1().HorizontalPodAutoscalers(namespace).List(context.TODO(), options) + return client.AutoscalingV1().HorizontalPodAutoscalers(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV1().HorizontalPodAutoscalers(namespace).Watch(context.TODO(), options) + return client.AutoscalingV1().HorizontalPodAutoscalers(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutoscalingV1().HorizontalPodAutoscalers(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutoscalingV1().HorizontalPodAutoscalers(namespace).Watch(ctx, options) }, }, &apiautoscalingv1.HorizontalPodAutoscaler{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/autoscaling/v2/horizontalpodautoscaler.go b/e2e/vendor/k8s.io/client-go/informers/autoscaling/v2/horizontalpodautoscaler.go index 92104f822..b5d4123e5 100644 --- a/e2e/vendor/k8s.io/client-go/informers/autoscaling/v2/horizontalpodautoscaler.go +++ b/e2e/vendor/k8s.io/client-go/informers/autoscaling/v2/horizontalpodautoscaler.go @@ -62,13 +62,25 @@ func NewFilteredHorizontalPodAutoscalerInformer(client kubernetes.Interface, nam if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV2().HorizontalPodAutoscalers(namespace).List(context.TODO(), options) + return client.AutoscalingV2().HorizontalPodAutoscalers(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV2().HorizontalPodAutoscalers(namespace).Watch(context.TODO(), options) + return client.AutoscalingV2().HorizontalPodAutoscalers(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutoscalingV2().HorizontalPodAutoscalers(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutoscalingV2().HorizontalPodAutoscalers(namespace).Watch(ctx, options) }, }, &apiautoscalingv2.HorizontalPodAutoscaler{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/horizontalpodautoscaler.go b/e2e/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/horizontalpodautoscaler.go index b77602718..5a64e7ef9 100644 --- a/e2e/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/e2e/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -62,13 +62,25 @@ func NewFilteredHorizontalPodAutoscalerInformer(client kubernetes.Interface, nam if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV2beta1().HorizontalPodAutoscalers(namespace).List(context.TODO(), options) + return client.AutoscalingV2beta1().HorizontalPodAutoscalers(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV2beta1().HorizontalPodAutoscalers(namespace).Watch(context.TODO(), options) + return client.AutoscalingV2beta1().HorizontalPodAutoscalers(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutoscalingV2beta1().HorizontalPodAutoscalers(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutoscalingV2beta1().HorizontalPodAutoscalers(namespace).Watch(ctx, options) }, }, &apiautoscalingv2beta1.HorizontalPodAutoscaler{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/autoscaling/v2beta2/horizontalpodautoscaler.go b/e2e/vendor/k8s.io/client-go/informers/autoscaling/v2beta2/horizontalpodautoscaler.go index 1848429b1..2d4c3f1de 100644 --- a/e2e/vendor/k8s.io/client-go/informers/autoscaling/v2beta2/horizontalpodautoscaler.go +++ b/e2e/vendor/k8s.io/client-go/informers/autoscaling/v2beta2/horizontalpodautoscaler.go @@ -62,13 +62,25 @@ func NewFilteredHorizontalPodAutoscalerInformer(client kubernetes.Interface, nam if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV2beta2().HorizontalPodAutoscalers(namespace).List(context.TODO(), options) + return client.AutoscalingV2beta2().HorizontalPodAutoscalers(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV2beta2().HorizontalPodAutoscalers(namespace).Watch(context.TODO(), options) + return client.AutoscalingV2beta2().HorizontalPodAutoscalers(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutoscalingV2beta2().HorizontalPodAutoscalers(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutoscalingV2beta2().HorizontalPodAutoscalers(namespace).Watch(ctx, options) }, }, &apiautoscalingv2beta2.HorizontalPodAutoscaler{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/batch/v1/cronjob.go b/e2e/vendor/k8s.io/client-go/informers/batch/v1/cronjob.go index 2a188acdd..ee4f8808a 100644 --- a/e2e/vendor/k8s.io/client-go/informers/batch/v1/cronjob.go +++ b/e2e/vendor/k8s.io/client-go/informers/batch/v1/cronjob.go @@ -62,13 +62,25 @@ func NewFilteredCronJobInformer(client kubernetes.Interface, namespace string, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.BatchV1().CronJobs(namespace).List(context.TODO(), options) + return client.BatchV1().CronJobs(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.BatchV1().CronJobs(namespace).Watch(context.TODO(), options) + return client.BatchV1().CronJobs(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.BatchV1().CronJobs(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.BatchV1().CronJobs(namespace).Watch(ctx, options) }, }, &apibatchv1.CronJob{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/batch/v1/job.go b/e2e/vendor/k8s.io/client-go/informers/batch/v1/job.go index 439ec7a6a..d3965f53e 100644 --- a/e2e/vendor/k8s.io/client-go/informers/batch/v1/job.go +++ b/e2e/vendor/k8s.io/client-go/informers/batch/v1/job.go @@ -62,13 +62,25 @@ func NewFilteredJobInformer(client kubernetes.Interface, namespace string, resyn if tweakListOptions != nil { tweakListOptions(&options) } - return client.BatchV1().Jobs(namespace).List(context.TODO(), options) + return client.BatchV1().Jobs(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.BatchV1().Jobs(namespace).Watch(context.TODO(), options) + return client.BatchV1().Jobs(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.BatchV1().Jobs(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.BatchV1().Jobs(namespace).Watch(ctx, options) }, }, &apibatchv1.Job{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/batch/v1beta1/cronjob.go b/e2e/vendor/k8s.io/client-go/informers/batch/v1beta1/cronjob.go index 1f061e16c..1cf169d92 100644 --- a/e2e/vendor/k8s.io/client-go/informers/batch/v1beta1/cronjob.go +++ b/e2e/vendor/k8s.io/client-go/informers/batch/v1beta1/cronjob.go @@ -62,13 +62,25 @@ func NewFilteredCronJobInformer(client kubernetes.Interface, namespace string, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.BatchV1beta1().CronJobs(namespace).List(context.TODO(), options) + return client.BatchV1beta1().CronJobs(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.BatchV1beta1().CronJobs(namespace).Watch(context.TODO(), options) + return client.BatchV1beta1().CronJobs(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.BatchV1beta1().CronJobs(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.BatchV1beta1().CronJobs(namespace).Watch(ctx, options) }, }, &apibatchv1beta1.CronJob{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/certificates/v1/certificatesigningrequest.go b/e2e/vendor/k8s.io/client-go/informers/certificates/v1/certificatesigningrequest.go index 0bd32ab95..076da1362 100644 --- a/e2e/vendor/k8s.io/client-go/informers/certificates/v1/certificatesigningrequest.go +++ b/e2e/vendor/k8s.io/client-go/informers/certificates/v1/certificatesigningrequest.go @@ -61,13 +61,25 @@ func NewFilteredCertificateSigningRequestInformer(client kubernetes.Interface, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.CertificatesV1().CertificateSigningRequests().List(context.TODO(), options) + return client.CertificatesV1().CertificateSigningRequests().List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CertificatesV1().CertificateSigningRequests().Watch(context.TODO(), options) + return client.CertificatesV1().CertificateSigningRequests().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CertificatesV1().CertificateSigningRequests().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CertificatesV1().CertificateSigningRequests().Watch(ctx, options) }, }, &apicertificatesv1.CertificateSigningRequest{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/certificates/v1alpha1/clustertrustbundle.go b/e2e/vendor/k8s.io/client-go/informers/certificates/v1alpha1/clustertrustbundle.go index 046688961..ca5ee2c97 100644 --- a/e2e/vendor/k8s.io/client-go/informers/certificates/v1alpha1/clustertrustbundle.go +++ b/e2e/vendor/k8s.io/client-go/informers/certificates/v1alpha1/clustertrustbundle.go @@ -61,13 +61,25 @@ func NewFilteredClusterTrustBundleInformer(client kubernetes.Interface, resyncPe if tweakListOptions != nil { tweakListOptions(&options) } - return client.CertificatesV1alpha1().ClusterTrustBundles().List(context.TODO(), options) + return client.CertificatesV1alpha1().ClusterTrustBundles().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CertificatesV1alpha1().ClusterTrustBundles().Watch(context.TODO(), options) + return client.CertificatesV1alpha1().ClusterTrustBundles().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CertificatesV1alpha1().ClusterTrustBundles().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CertificatesV1alpha1().ClusterTrustBundles().Watch(ctx, options) }, }, &apicertificatesv1alpha1.ClusterTrustBundle{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/certificates/v1beta1/certificatesigningrequest.go b/e2e/vendor/k8s.io/client-go/informers/certificates/v1beta1/certificatesigningrequest.go index b3aff1cc8..f93d435a0 100644 --- a/e2e/vendor/k8s.io/client-go/informers/certificates/v1beta1/certificatesigningrequest.go +++ b/e2e/vendor/k8s.io/client-go/informers/certificates/v1beta1/certificatesigningrequest.go @@ -61,13 +61,25 @@ func NewFilteredCertificateSigningRequestInformer(client kubernetes.Interface, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.CertificatesV1beta1().CertificateSigningRequests().List(context.TODO(), options) + return client.CertificatesV1beta1().CertificateSigningRequests().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CertificatesV1beta1().CertificateSigningRequests().Watch(context.TODO(), options) + return client.CertificatesV1beta1().CertificateSigningRequests().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CertificatesV1beta1().CertificateSigningRequests().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CertificatesV1beta1().CertificateSigningRequests().Watch(ctx, options) }, }, &apicertificatesv1beta1.CertificateSigningRequest{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/certificates/v1beta1/clustertrustbundle.go b/e2e/vendor/k8s.io/client-go/informers/certificates/v1beta1/clustertrustbundle.go new file mode 100644 index 000000000..c4a69b22e --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/informers/certificates/v1beta1/clustertrustbundle.go @@ -0,0 +1,101 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + context "context" + time "time" + + apicertificatesv1beta1 "k8s.io/api/certificates/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + certificatesv1beta1 "k8s.io/client-go/listers/certificates/v1beta1" + cache "k8s.io/client-go/tools/cache" +) + +// ClusterTrustBundleInformer provides access to a shared informer and lister for +// ClusterTrustBundles. +type ClusterTrustBundleInformer interface { + Informer() cache.SharedIndexInformer + Lister() certificatesv1beta1.ClusterTrustBundleLister +} + +type clusterTrustBundleInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewClusterTrustBundleInformer constructs a new informer for ClusterTrustBundle type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewClusterTrustBundleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredClusterTrustBundleInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredClusterTrustBundleInformer constructs a new informer for ClusterTrustBundle type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredClusterTrustBundleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CertificatesV1beta1().ClusterTrustBundles().List(context.Background(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CertificatesV1beta1().ClusterTrustBundles().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CertificatesV1beta1().ClusterTrustBundles().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CertificatesV1beta1().ClusterTrustBundles().Watch(ctx, options) + }, + }, + &apicertificatesv1beta1.ClusterTrustBundle{}, + resyncPeriod, + indexers, + ) +} + +func (f *clusterTrustBundleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredClusterTrustBundleInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *clusterTrustBundleInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apicertificatesv1beta1.ClusterTrustBundle{}, f.defaultInformer) +} + +func (f *clusterTrustBundleInformer) Lister() certificatesv1beta1.ClusterTrustBundleLister { + return certificatesv1beta1.NewClusterTrustBundleLister(f.Informer().GetIndexer()) +} diff --git a/e2e/vendor/k8s.io/client-go/informers/certificates/v1beta1/interface.go b/e2e/vendor/k8s.io/client-go/informers/certificates/v1beta1/interface.go index 258dd1d0e..f13d5e663 100644 --- a/e2e/vendor/k8s.io/client-go/informers/certificates/v1beta1/interface.go +++ b/e2e/vendor/k8s.io/client-go/informers/certificates/v1beta1/interface.go @@ -26,6 +26,8 @@ import ( type Interface interface { // CertificateSigningRequests returns a CertificateSigningRequestInformer. CertificateSigningRequests() CertificateSigningRequestInformer + // ClusterTrustBundles returns a ClusterTrustBundleInformer. + ClusterTrustBundles() ClusterTrustBundleInformer } type version struct { @@ -43,3 +45,8 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList func (v *version) CertificateSigningRequests() CertificateSigningRequestInformer { return &certificateSigningRequestInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } + +// ClusterTrustBundles returns a ClusterTrustBundleInformer. +func (v *version) ClusterTrustBundles() ClusterTrustBundleInformer { + return &clusterTrustBundleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/e2e/vendor/k8s.io/client-go/informers/coordination/v1/lease.go b/e2e/vendor/k8s.io/client-go/informers/coordination/v1/lease.go index 0627d7309..2d0c812d6 100644 --- a/e2e/vendor/k8s.io/client-go/informers/coordination/v1/lease.go +++ b/e2e/vendor/k8s.io/client-go/informers/coordination/v1/lease.go @@ -62,13 +62,25 @@ func NewFilteredLeaseInformer(client kubernetes.Interface, namespace string, res if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoordinationV1().Leases(namespace).List(context.TODO(), options) + return client.CoordinationV1().Leases(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoordinationV1().Leases(namespace).Watch(context.TODO(), options) + return client.CoordinationV1().Leases(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoordinationV1().Leases(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoordinationV1().Leases(namespace).Watch(ctx, options) }, }, &apicoordinationv1.Lease{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/coordination/v1alpha2/leasecandidate.go b/e2e/vendor/k8s.io/client-go/informers/coordination/v1alpha2/leasecandidate.go index f38adf652..c220a9b20 100644 --- a/e2e/vendor/k8s.io/client-go/informers/coordination/v1alpha2/leasecandidate.go +++ b/e2e/vendor/k8s.io/client-go/informers/coordination/v1alpha2/leasecandidate.go @@ -62,13 +62,25 @@ func NewFilteredLeaseCandidateInformer(client kubernetes.Interface, namespace st if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoordinationV1alpha2().LeaseCandidates(namespace).List(context.TODO(), options) + return client.CoordinationV1alpha2().LeaseCandidates(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoordinationV1alpha2().LeaseCandidates(namespace).Watch(context.TODO(), options) + return client.CoordinationV1alpha2().LeaseCandidates(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoordinationV1alpha2().LeaseCandidates(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoordinationV1alpha2().LeaseCandidates(namespace).Watch(ctx, options) }, }, &apicoordinationv1alpha2.LeaseCandidate{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/coordination/v1beta1/interface.go b/e2e/vendor/k8s.io/client-go/informers/coordination/v1beta1/interface.go index 360266206..707e51086 100644 --- a/e2e/vendor/k8s.io/client-go/informers/coordination/v1beta1/interface.go +++ b/e2e/vendor/k8s.io/client-go/informers/coordination/v1beta1/interface.go @@ -26,6 +26,8 @@ import ( type Interface interface { // Leases returns a LeaseInformer. Leases() LeaseInformer + // LeaseCandidates returns a LeaseCandidateInformer. + LeaseCandidates() LeaseCandidateInformer } type version struct { @@ -43,3 +45,8 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList func (v *version) Leases() LeaseInformer { return &leaseInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } + +// LeaseCandidates returns a LeaseCandidateInformer. +func (v *version) LeaseCandidates() LeaseCandidateInformer { + return &leaseCandidateInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/e2e/vendor/k8s.io/client-go/informers/coordination/v1beta1/lease.go b/e2e/vendor/k8s.io/client-go/informers/coordination/v1beta1/lease.go index 563a25c30..ef91381c1 100644 --- a/e2e/vendor/k8s.io/client-go/informers/coordination/v1beta1/lease.go +++ b/e2e/vendor/k8s.io/client-go/informers/coordination/v1beta1/lease.go @@ -62,13 +62,25 @@ func NewFilteredLeaseInformer(client kubernetes.Interface, namespace string, res if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoordinationV1beta1().Leases(namespace).List(context.TODO(), options) + return client.CoordinationV1beta1().Leases(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoordinationV1beta1().Leases(namespace).Watch(context.TODO(), options) + return client.CoordinationV1beta1().Leases(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoordinationV1beta1().Leases(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoordinationV1beta1().Leases(namespace).Watch(ctx, options) }, }, &apicoordinationv1beta1.Lease{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/coordination/v1beta1/leasecandidate.go b/e2e/vendor/k8s.io/client-go/informers/coordination/v1beta1/leasecandidate.go new file mode 100644 index 000000000..4315e50c3 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/informers/coordination/v1beta1/leasecandidate.go @@ -0,0 +1,102 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + context "context" + time "time" + + apicoordinationv1beta1 "k8s.io/api/coordination/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + coordinationv1beta1 "k8s.io/client-go/listers/coordination/v1beta1" + cache "k8s.io/client-go/tools/cache" +) + +// LeaseCandidateInformer provides access to a shared informer and lister for +// LeaseCandidates. +type LeaseCandidateInformer interface { + Informer() cache.SharedIndexInformer + Lister() coordinationv1beta1.LeaseCandidateLister +} + +type leaseCandidateInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewLeaseCandidateInformer constructs a new informer for LeaseCandidate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewLeaseCandidateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredLeaseCandidateInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredLeaseCandidateInformer constructs a new informer for LeaseCandidate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredLeaseCandidateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoordinationV1beta1().LeaseCandidates(namespace).List(context.Background(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoordinationV1beta1().LeaseCandidates(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoordinationV1beta1().LeaseCandidates(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoordinationV1beta1().LeaseCandidates(namespace).Watch(ctx, options) + }, + }, + &apicoordinationv1beta1.LeaseCandidate{}, + resyncPeriod, + indexers, + ) +} + +func (f *leaseCandidateInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredLeaseCandidateInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *leaseCandidateInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apicoordinationv1beta1.LeaseCandidate{}, f.defaultInformer) +} + +func (f *leaseCandidateInformer) Lister() coordinationv1beta1.LeaseCandidateLister { + return coordinationv1beta1.NewLeaseCandidateLister(f.Informer().GetIndexer()) +} diff --git a/e2e/vendor/k8s.io/client-go/informers/core/v1/componentstatus.go b/e2e/vendor/k8s.io/client-go/informers/core/v1/componentstatus.go index 2a97c638f..a7992bfdf 100644 --- a/e2e/vendor/k8s.io/client-go/informers/core/v1/componentstatus.go +++ b/e2e/vendor/k8s.io/client-go/informers/core/v1/componentstatus.go @@ -61,13 +61,25 @@ func NewFilteredComponentStatusInformer(client kubernetes.Interface, resyncPerio if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ComponentStatuses().List(context.TODO(), options) + return client.CoreV1().ComponentStatuses().List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ComponentStatuses().Watch(context.TODO(), options) + return client.CoreV1().ComponentStatuses().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().ComponentStatuses().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().ComponentStatuses().Watch(ctx, options) }, }, &apicorev1.ComponentStatus{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/core/v1/configmap.go b/e2e/vendor/k8s.io/client-go/informers/core/v1/configmap.go index 07f5fb1f7..014e55afe 100644 --- a/e2e/vendor/k8s.io/client-go/informers/core/v1/configmap.go +++ b/e2e/vendor/k8s.io/client-go/informers/core/v1/configmap.go @@ -62,13 +62,25 @@ func NewFilteredConfigMapInformer(client kubernetes.Interface, namespace string, if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ConfigMaps(namespace).List(context.TODO(), options) + return client.CoreV1().ConfigMaps(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ConfigMaps(namespace).Watch(context.TODO(), options) + return client.CoreV1().ConfigMaps(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().ConfigMaps(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().ConfigMaps(namespace).Watch(ctx, options) }, }, &apicorev1.ConfigMap{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/core/v1/endpoints.go b/e2e/vendor/k8s.io/client-go/informers/core/v1/endpoints.go index 6171d5df6..2d4412ad0 100644 --- a/e2e/vendor/k8s.io/client-go/informers/core/v1/endpoints.go +++ b/e2e/vendor/k8s.io/client-go/informers/core/v1/endpoints.go @@ -62,13 +62,25 @@ func NewFilteredEndpointsInformer(client kubernetes.Interface, namespace string, if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Endpoints(namespace).List(context.TODO(), options) + return client.CoreV1().Endpoints(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Endpoints(namespace).Watch(context.TODO(), options) + return client.CoreV1().Endpoints(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().Endpoints(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().Endpoints(namespace).Watch(ctx, options) }, }, &apicorev1.Endpoints{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/core/v1/event.go b/e2e/vendor/k8s.io/client-go/informers/core/v1/event.go index 55500679d..80a5cad84 100644 --- a/e2e/vendor/k8s.io/client-go/informers/core/v1/event.go +++ b/e2e/vendor/k8s.io/client-go/informers/core/v1/event.go @@ -62,13 +62,25 @@ func NewFilteredEventInformer(client kubernetes.Interface, namespace string, res if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Events(namespace).List(context.TODO(), options) + return client.CoreV1().Events(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Events(namespace).Watch(context.TODO(), options) + return client.CoreV1().Events(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().Events(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().Events(namespace).Watch(ctx, options) }, }, &apicorev1.Event{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/core/v1/limitrange.go b/e2e/vendor/k8s.io/client-go/informers/core/v1/limitrange.go index 2c2dec79f..cf8e1eb42 100644 --- a/e2e/vendor/k8s.io/client-go/informers/core/v1/limitrange.go +++ b/e2e/vendor/k8s.io/client-go/informers/core/v1/limitrange.go @@ -62,13 +62,25 @@ func NewFilteredLimitRangeInformer(client kubernetes.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().LimitRanges(namespace).List(context.TODO(), options) + return client.CoreV1().LimitRanges(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().LimitRanges(namespace).Watch(context.TODO(), options) + return client.CoreV1().LimitRanges(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().LimitRanges(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().LimitRanges(namespace).Watch(ctx, options) }, }, &apicorev1.LimitRange{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/core/v1/namespace.go b/e2e/vendor/k8s.io/client-go/informers/core/v1/namespace.go index 09e0740ba..ae09888b9 100644 --- a/e2e/vendor/k8s.io/client-go/informers/core/v1/namespace.go +++ b/e2e/vendor/k8s.io/client-go/informers/core/v1/namespace.go @@ -61,13 +61,25 @@ func NewFilteredNamespaceInformer(client kubernetes.Interface, resyncPeriod time if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Namespaces().List(context.TODO(), options) + return client.CoreV1().Namespaces().List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Namespaces().Watch(context.TODO(), options) + return client.CoreV1().Namespaces().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().Namespaces().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().Namespaces().Watch(ctx, options) }, }, &apicorev1.Namespace{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/core/v1/node.go b/e2e/vendor/k8s.io/client-go/informers/core/v1/node.go index 608aa9fb7..a036db034 100644 --- a/e2e/vendor/k8s.io/client-go/informers/core/v1/node.go +++ b/e2e/vendor/k8s.io/client-go/informers/core/v1/node.go @@ -61,13 +61,25 @@ func NewFilteredNodeInformer(client kubernetes.Interface, resyncPeriod time.Dura if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Nodes().List(context.TODO(), options) + return client.CoreV1().Nodes().List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Nodes().Watch(context.TODO(), options) + return client.CoreV1().Nodes().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().Nodes().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().Nodes().Watch(ctx, options) }, }, &apicorev1.Node{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/core/v1/persistentvolume.go b/e2e/vendor/k8s.io/client-go/informers/core/v1/persistentvolume.go index 19c0929e5..4d1d63ead 100644 --- a/e2e/vendor/k8s.io/client-go/informers/core/v1/persistentvolume.go +++ b/e2e/vendor/k8s.io/client-go/informers/core/v1/persistentvolume.go @@ -61,13 +61,25 @@ func NewFilteredPersistentVolumeInformer(client kubernetes.Interface, resyncPeri if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().PersistentVolumes().List(context.TODO(), options) + return client.CoreV1().PersistentVolumes().List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().PersistentVolumes().Watch(context.TODO(), options) + return client.CoreV1().PersistentVolumes().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().PersistentVolumes().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().PersistentVolumes().Watch(ctx, options) }, }, &apicorev1.PersistentVolume{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/core/v1/persistentvolumeclaim.go b/e2e/vendor/k8s.io/client-go/informers/core/v1/persistentvolumeclaim.go index 27c35fec1..87a4cc037 100644 --- a/e2e/vendor/k8s.io/client-go/informers/core/v1/persistentvolumeclaim.go +++ b/e2e/vendor/k8s.io/client-go/informers/core/v1/persistentvolumeclaim.go @@ -62,13 +62,25 @@ func NewFilteredPersistentVolumeClaimInformer(client kubernetes.Interface, names if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().PersistentVolumeClaims(namespace).List(context.TODO(), options) + return client.CoreV1().PersistentVolumeClaims(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().PersistentVolumeClaims(namespace).Watch(context.TODO(), options) + return client.CoreV1().PersistentVolumeClaims(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().PersistentVolumeClaims(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().PersistentVolumeClaims(namespace).Watch(ctx, options) }, }, &apicorev1.PersistentVolumeClaim{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/core/v1/pod.go b/e2e/vendor/k8s.io/client-go/informers/core/v1/pod.go index c661704bd..e3a40729f 100644 --- a/e2e/vendor/k8s.io/client-go/informers/core/v1/pod.go +++ b/e2e/vendor/k8s.io/client-go/informers/core/v1/pod.go @@ -62,13 +62,25 @@ func NewFilteredPodInformer(client kubernetes.Interface, namespace string, resyn if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Pods(namespace).List(context.TODO(), options) + return client.CoreV1().Pods(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Pods(namespace).Watch(context.TODO(), options) + return client.CoreV1().Pods(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().Pods(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().Pods(namespace).Watch(ctx, options) }, }, &apicorev1.Pod{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/core/v1/podtemplate.go b/e2e/vendor/k8s.io/client-go/informers/core/v1/podtemplate.go index 0d16c5b4e..9d6e7048e 100644 --- a/e2e/vendor/k8s.io/client-go/informers/core/v1/podtemplate.go +++ b/e2e/vendor/k8s.io/client-go/informers/core/v1/podtemplate.go @@ -62,13 +62,25 @@ func NewFilteredPodTemplateInformer(client kubernetes.Interface, namespace strin if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().PodTemplates(namespace).List(context.TODO(), options) + return client.CoreV1().PodTemplates(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().PodTemplates(namespace).Watch(context.TODO(), options) + return client.CoreV1().PodTemplates(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().PodTemplates(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().PodTemplates(namespace).Watch(ctx, options) }, }, &apicorev1.PodTemplate{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/core/v1/replicationcontroller.go b/e2e/vendor/k8s.io/client-go/informers/core/v1/replicationcontroller.go index 5866ec151..89c216e82 100644 --- a/e2e/vendor/k8s.io/client-go/informers/core/v1/replicationcontroller.go +++ b/e2e/vendor/k8s.io/client-go/informers/core/v1/replicationcontroller.go @@ -62,13 +62,25 @@ func NewFilteredReplicationControllerInformer(client kubernetes.Interface, names if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ReplicationControllers(namespace).List(context.TODO(), options) + return client.CoreV1().ReplicationControllers(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ReplicationControllers(namespace).Watch(context.TODO(), options) + return client.CoreV1().ReplicationControllers(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().ReplicationControllers(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().ReplicationControllers(namespace).Watch(ctx, options) }, }, &apicorev1.ReplicationController{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/core/v1/resourcequota.go b/e2e/vendor/k8s.io/client-go/informers/core/v1/resourcequota.go index 999b49546..aa77e0570 100644 --- a/e2e/vendor/k8s.io/client-go/informers/core/v1/resourcequota.go +++ b/e2e/vendor/k8s.io/client-go/informers/core/v1/resourcequota.go @@ -62,13 +62,25 @@ func NewFilteredResourceQuotaInformer(client kubernetes.Interface, namespace str if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ResourceQuotas(namespace).List(context.TODO(), options) + return client.CoreV1().ResourceQuotas(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ResourceQuotas(namespace).Watch(context.TODO(), options) + return client.CoreV1().ResourceQuotas(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().ResourceQuotas(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().ResourceQuotas(namespace).Watch(ctx, options) }, }, &apicorev1.ResourceQuota{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/core/v1/secret.go b/e2e/vendor/k8s.io/client-go/informers/core/v1/secret.go index f3d371501..be5a80a96 100644 --- a/e2e/vendor/k8s.io/client-go/informers/core/v1/secret.go +++ b/e2e/vendor/k8s.io/client-go/informers/core/v1/secret.go @@ -62,13 +62,25 @@ func NewFilteredSecretInformer(client kubernetes.Interface, namespace string, re if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Secrets(namespace).List(context.TODO(), options) + return client.CoreV1().Secrets(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Secrets(namespace).Watch(context.TODO(), options) + return client.CoreV1().Secrets(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().Secrets(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().Secrets(namespace).Watch(ctx, options) }, }, &apicorev1.Secret{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/core/v1/service.go b/e2e/vendor/k8s.io/client-go/informers/core/v1/service.go index c4bc294a3..10b058757 100644 --- a/e2e/vendor/k8s.io/client-go/informers/core/v1/service.go +++ b/e2e/vendor/k8s.io/client-go/informers/core/v1/service.go @@ -62,13 +62,25 @@ func NewFilteredServiceInformer(client kubernetes.Interface, namespace string, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Services(namespace).List(context.TODO(), options) + return client.CoreV1().Services(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Services(namespace).Watch(context.TODO(), options) + return client.CoreV1().Services(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().Services(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().Services(namespace).Watch(ctx, options) }, }, &apicorev1.Service{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/core/v1/serviceaccount.go b/e2e/vendor/k8s.io/client-go/informers/core/v1/serviceaccount.go index b04b44cb4..594439618 100644 --- a/e2e/vendor/k8s.io/client-go/informers/core/v1/serviceaccount.go +++ b/e2e/vendor/k8s.io/client-go/informers/core/v1/serviceaccount.go @@ -62,13 +62,25 @@ func NewFilteredServiceAccountInformer(client kubernetes.Interface, namespace st if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ServiceAccounts(namespace).List(context.TODO(), options) + return client.CoreV1().ServiceAccounts(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ServiceAccounts(namespace).Watch(context.TODO(), options) + return client.CoreV1().ServiceAccounts(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().ServiceAccounts(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoreV1().ServiceAccounts(namespace).Watch(ctx, options) }, }, &apicorev1.ServiceAccount{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/discovery/v1/endpointslice.go b/e2e/vendor/k8s.io/client-go/informers/discovery/v1/endpointslice.go index ec09b2d26..38f09183c 100644 --- a/e2e/vendor/k8s.io/client-go/informers/discovery/v1/endpointslice.go +++ b/e2e/vendor/k8s.io/client-go/informers/discovery/v1/endpointslice.go @@ -62,13 +62,25 @@ func NewFilteredEndpointSliceInformer(client kubernetes.Interface, namespace str if tweakListOptions != nil { tweakListOptions(&options) } - return client.DiscoveryV1().EndpointSlices(namespace).List(context.TODO(), options) + return client.DiscoveryV1().EndpointSlices(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.DiscoveryV1().EndpointSlices(namespace).Watch(context.TODO(), options) + return client.DiscoveryV1().EndpointSlices(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.DiscoveryV1().EndpointSlices(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.DiscoveryV1().EndpointSlices(namespace).Watch(ctx, options) }, }, &apidiscoveryv1.EndpointSlice{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/discovery/v1beta1/endpointslice.go b/e2e/vendor/k8s.io/client-go/informers/discovery/v1beta1/endpointslice.go index 3af1a3be9..23c51eb7b 100644 --- a/e2e/vendor/k8s.io/client-go/informers/discovery/v1beta1/endpointslice.go +++ b/e2e/vendor/k8s.io/client-go/informers/discovery/v1beta1/endpointslice.go @@ -62,13 +62,25 @@ func NewFilteredEndpointSliceInformer(client kubernetes.Interface, namespace str if tweakListOptions != nil { tweakListOptions(&options) } - return client.DiscoveryV1beta1().EndpointSlices(namespace).List(context.TODO(), options) + return client.DiscoveryV1beta1().EndpointSlices(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.DiscoveryV1beta1().EndpointSlices(namespace).Watch(context.TODO(), options) + return client.DiscoveryV1beta1().EndpointSlices(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.DiscoveryV1beta1().EndpointSlices(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.DiscoveryV1beta1().EndpointSlices(namespace).Watch(ctx, options) }, }, &apidiscoveryv1beta1.EndpointSlice{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/doc.go b/e2e/vendor/k8s.io/client-go/informers/doc.go index f37c3e4d0..231bffb69 100644 --- a/e2e/vendor/k8s.io/client-go/informers/doc.go +++ b/e2e/vendor/k8s.io/client-go/informers/doc.go @@ -15,4 +15,4 @@ limitations under the License. */ // Package informers provides generated informers for Kubernetes APIs. -package informers // import "k8s.io/client-go/informers" +package informers diff --git a/e2e/vendor/k8s.io/client-go/informers/events/v1/event.go b/e2e/vendor/k8s.io/client-go/informers/events/v1/event.go index 518d79841..139cc155a 100644 --- a/e2e/vendor/k8s.io/client-go/informers/events/v1/event.go +++ b/e2e/vendor/k8s.io/client-go/informers/events/v1/event.go @@ -62,13 +62,25 @@ func NewFilteredEventInformer(client kubernetes.Interface, namespace string, res if tweakListOptions != nil { tweakListOptions(&options) } - return client.EventsV1().Events(namespace).List(context.TODO(), options) + return client.EventsV1().Events(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.EventsV1().Events(namespace).Watch(context.TODO(), options) + return client.EventsV1().Events(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EventsV1().Events(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EventsV1().Events(namespace).Watch(ctx, options) }, }, &apieventsv1.Event{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/events/v1beta1/event.go b/e2e/vendor/k8s.io/client-go/informers/events/v1beta1/event.go index 5324599bb..75818c0ef 100644 --- a/e2e/vendor/k8s.io/client-go/informers/events/v1beta1/event.go +++ b/e2e/vendor/k8s.io/client-go/informers/events/v1beta1/event.go @@ -62,13 +62,25 @@ func NewFilteredEventInformer(client kubernetes.Interface, namespace string, res if tweakListOptions != nil { tweakListOptions(&options) } - return client.EventsV1beta1().Events(namespace).List(context.TODO(), options) + return client.EventsV1beta1().Events(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.EventsV1beta1().Events(namespace).Watch(context.TODO(), options) + return client.EventsV1beta1().Events(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EventsV1beta1().Events(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EventsV1beta1().Events(namespace).Watch(ctx, options) }, }, &apieventsv1beta1.Event{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/extensions/v1beta1/daemonset.go b/e2e/vendor/k8s.io/client-go/informers/extensions/v1beta1/daemonset.go index ea77575c9..ce8612c1c 100644 --- a/e2e/vendor/k8s.io/client-go/informers/extensions/v1beta1/daemonset.go +++ b/e2e/vendor/k8s.io/client-go/informers/extensions/v1beta1/daemonset.go @@ -62,13 +62,25 @@ func NewFilteredDaemonSetInformer(client kubernetes.Interface, namespace string, if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().DaemonSets(namespace).List(context.TODO(), options) + return client.ExtensionsV1beta1().DaemonSets(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().DaemonSets(namespace).Watch(context.TODO(), options) + return client.ExtensionsV1beta1().DaemonSets(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExtensionsV1beta1().DaemonSets(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExtensionsV1beta1().DaemonSets(namespace).Watch(ctx, options) }, }, &apiextensionsv1beta1.DaemonSet{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/extensions/v1beta1/deployment.go b/e2e/vendor/k8s.io/client-go/informers/extensions/v1beta1/deployment.go index 1b2770ce0..5dd957baa 100644 --- a/e2e/vendor/k8s.io/client-go/informers/extensions/v1beta1/deployment.go +++ b/e2e/vendor/k8s.io/client-go/informers/extensions/v1beta1/deployment.go @@ -62,13 +62,25 @@ func NewFilteredDeploymentInformer(client kubernetes.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().Deployments(namespace).List(context.TODO(), options) + return client.ExtensionsV1beta1().Deployments(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().Deployments(namespace).Watch(context.TODO(), options) + return client.ExtensionsV1beta1().Deployments(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExtensionsV1beta1().Deployments(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExtensionsV1beta1().Deployments(namespace).Watch(ctx, options) }, }, &apiextensionsv1beta1.Deployment{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/extensions/v1beta1/ingress.go b/e2e/vendor/k8s.io/client-go/informers/extensions/v1beta1/ingress.go index 63e734060..935f6868c 100644 --- a/e2e/vendor/k8s.io/client-go/informers/extensions/v1beta1/ingress.go +++ b/e2e/vendor/k8s.io/client-go/informers/extensions/v1beta1/ingress.go @@ -62,13 +62,25 @@ func NewFilteredIngressInformer(client kubernetes.Interface, namespace string, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().Ingresses(namespace).List(context.TODO(), options) + return client.ExtensionsV1beta1().Ingresses(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().Ingresses(namespace).Watch(context.TODO(), options) + return client.ExtensionsV1beta1().Ingresses(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExtensionsV1beta1().Ingresses(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExtensionsV1beta1().Ingresses(namespace).Watch(ctx, options) }, }, &apiextensionsv1beta1.Ingress{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/extensions/v1beta1/networkpolicy.go b/e2e/vendor/k8s.io/client-go/informers/extensions/v1beta1/networkpolicy.go index 024653af2..f485f3149 100644 --- a/e2e/vendor/k8s.io/client-go/informers/extensions/v1beta1/networkpolicy.go +++ b/e2e/vendor/k8s.io/client-go/informers/extensions/v1beta1/networkpolicy.go @@ -62,13 +62,25 @@ func NewFilteredNetworkPolicyInformer(client kubernetes.Interface, namespace str if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().NetworkPolicies(namespace).List(context.TODO(), options) + return client.ExtensionsV1beta1().NetworkPolicies(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().NetworkPolicies(namespace).Watch(context.TODO(), options) + return client.ExtensionsV1beta1().NetworkPolicies(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExtensionsV1beta1().NetworkPolicies(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExtensionsV1beta1().NetworkPolicies(namespace).Watch(ctx, options) }, }, &apiextensionsv1beta1.NetworkPolicy{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/extensions/v1beta1/replicaset.go b/e2e/vendor/k8s.io/client-go/informers/extensions/v1beta1/replicaset.go index 392ccef86..4b1be5421 100644 --- a/e2e/vendor/k8s.io/client-go/informers/extensions/v1beta1/replicaset.go +++ b/e2e/vendor/k8s.io/client-go/informers/extensions/v1beta1/replicaset.go @@ -62,13 +62,25 @@ func NewFilteredReplicaSetInformer(client kubernetes.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().ReplicaSets(namespace).List(context.TODO(), options) + return client.ExtensionsV1beta1().ReplicaSets(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().ReplicaSets(namespace).Watch(context.TODO(), options) + return client.ExtensionsV1beta1().ReplicaSets(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExtensionsV1beta1().ReplicaSets(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExtensionsV1beta1().ReplicaSets(namespace).Watch(ctx, options) }, }, &apiextensionsv1beta1.ReplicaSet{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1/flowschema.go b/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1/flowschema.go index 945bc351e..f8918dcf7 100644 --- a/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1/flowschema.go +++ b/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1/flowschema.go @@ -61,13 +61,25 @@ func NewFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod tim if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1().FlowSchemas().List(context.TODO(), options) + return client.FlowcontrolV1().FlowSchemas().List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1().FlowSchemas().Watch(context.TODO(), options) + return client.FlowcontrolV1().FlowSchemas().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowcontrolV1().FlowSchemas().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowcontrolV1().FlowSchemas().Watch(ctx, options) }, }, &apiflowcontrolv1.FlowSchema{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1/prioritylevelconfiguration.go b/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1/prioritylevelconfiguration.go index eec6388b2..2ec4f3988 100644 --- a/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1/prioritylevelconfiguration.go +++ b/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1/prioritylevelconfiguration.go @@ -61,13 +61,25 @@ func NewFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1().PriorityLevelConfigurations().List(context.TODO(), options) + return client.FlowcontrolV1().PriorityLevelConfigurations().List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1().PriorityLevelConfigurations().Watch(context.TODO(), options) + return client.FlowcontrolV1().PriorityLevelConfigurations().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowcontrolV1().PriorityLevelConfigurations().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowcontrolV1().PriorityLevelConfigurations().Watch(ctx, options) }, }, &apiflowcontrolv1.PriorityLevelConfiguration{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta1/flowschema.go b/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta1/flowschema.go index 30d099773..322fa3181 100644 --- a/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta1/flowschema.go +++ b/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta1/flowschema.go @@ -61,13 +61,25 @@ func NewFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod tim if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1beta1().FlowSchemas().List(context.TODO(), options) + return client.FlowcontrolV1beta1().FlowSchemas().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1beta1().FlowSchemas().Watch(context.TODO(), options) + return client.FlowcontrolV1beta1().FlowSchemas().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowcontrolV1beta1().FlowSchemas().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowcontrolV1beta1().FlowSchemas().Watch(ctx, options) }, }, &apiflowcontrolv1beta1.FlowSchema{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta1/prioritylevelconfiguration.go b/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta1/prioritylevelconfiguration.go index 2a8a867c4..aebc788f7 100644 --- a/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta1/prioritylevelconfiguration.go +++ b/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta1/prioritylevelconfiguration.go @@ -61,13 +61,25 @@ func NewFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1beta1().PriorityLevelConfigurations().List(context.TODO(), options) + return client.FlowcontrolV1beta1().PriorityLevelConfigurations().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1beta1().PriorityLevelConfigurations().Watch(context.TODO(), options) + return client.FlowcontrolV1beta1().PriorityLevelConfigurations().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowcontrolV1beta1().PriorityLevelConfigurations().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowcontrolV1beta1().PriorityLevelConfigurations().Watch(ctx, options) }, }, &apiflowcontrolv1beta1.PriorityLevelConfiguration{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta2/flowschema.go b/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta2/flowschema.go index edfed12c5..522e24b7b 100644 --- a/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta2/flowschema.go +++ b/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta2/flowschema.go @@ -61,13 +61,25 @@ func NewFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod tim if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1beta2().FlowSchemas().List(context.TODO(), options) + return client.FlowcontrolV1beta2().FlowSchemas().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1beta2().FlowSchemas().Watch(context.TODO(), options) + return client.FlowcontrolV1beta2().FlowSchemas().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowcontrolV1beta2().FlowSchemas().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowcontrolV1beta2().FlowSchemas().Watch(ctx, options) }, }, &apiflowcontrolv1beta2.FlowSchema{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta2/prioritylevelconfiguration.go b/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta2/prioritylevelconfiguration.go index 624e0373e..0ee0506e2 100644 --- a/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta2/prioritylevelconfiguration.go +++ b/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta2/prioritylevelconfiguration.go @@ -61,13 +61,25 @@ func NewFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1beta2().PriorityLevelConfigurations().List(context.TODO(), options) + return client.FlowcontrolV1beta2().PriorityLevelConfigurations().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1beta2().PriorityLevelConfigurations().Watch(context.TODO(), options) + return client.FlowcontrolV1beta2().PriorityLevelConfigurations().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowcontrolV1beta2().PriorityLevelConfigurations().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowcontrolV1beta2().PriorityLevelConfigurations().Watch(ctx, options) }, }, &apiflowcontrolv1beta2.PriorityLevelConfiguration{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/flowschema.go b/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/flowschema.go index bd3f5e6ed..3b0dca3cc 100644 --- a/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/flowschema.go +++ b/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/flowschema.go @@ -61,13 +61,25 @@ func NewFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod tim if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1beta3().FlowSchemas().List(context.TODO(), options) + return client.FlowcontrolV1beta3().FlowSchemas().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1beta3().FlowSchemas().Watch(context.TODO(), options) + return client.FlowcontrolV1beta3().FlowSchemas().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowcontrolV1beta3().FlowSchemas().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowcontrolV1beta3().FlowSchemas().Watch(ctx, options) }, }, &apiflowcontrolv1beta3.FlowSchema{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/prioritylevelconfiguration.go b/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/prioritylevelconfiguration.go index 5695d5d4d..77ff4e4e7 100644 --- a/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/prioritylevelconfiguration.go +++ b/e2e/vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/prioritylevelconfiguration.go @@ -61,13 +61,25 @@ func NewFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1beta3().PriorityLevelConfigurations().List(context.TODO(), options) + return client.FlowcontrolV1beta3().PriorityLevelConfigurations().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1beta3().PriorityLevelConfigurations().Watch(context.TODO(), options) + return client.FlowcontrolV1beta3().PriorityLevelConfigurations().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowcontrolV1beta3().PriorityLevelConfigurations().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowcontrolV1beta3().PriorityLevelConfigurations().Watch(ctx, options) }, }, &apiflowcontrolv1beta3.PriorityLevelConfiguration{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/generic.go b/e2e/vendor/k8s.io/client-go/informers/generic.go index fd331686d..965955354 100644 --- a/e2e/vendor/k8s.io/client-go/informers/generic.go +++ b/e2e/vendor/k8s.io/client-go/informers/generic.go @@ -63,6 +63,7 @@ import ( rbacv1beta1 "k8s.io/api/rbac/v1beta1" v1alpha3 "k8s.io/api/resource/v1alpha3" resourcev1beta1 "k8s.io/api/resource/v1beta1" + resourcev1beta2 "k8s.io/api/resource/v1beta2" schedulingv1 "k8s.io/api/scheduling/v1" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" @@ -199,6 +200,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=certificates.k8s.io, Version=v1beta1 case certificatesv1beta1.SchemeGroupVersion.WithResource("certificatesigningrequests"): return &genericInformer{resource: resource.GroupResource(), informer: f.Certificates().V1beta1().CertificateSigningRequests().Informer()}, nil + case certificatesv1beta1.SchemeGroupVersion.WithResource("clustertrustbundles"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Certificates().V1beta1().ClusterTrustBundles().Informer()}, nil // Group=coordination.k8s.io, Version=v1 case coordinationv1.SchemeGroupVersion.WithResource("leases"): @@ -211,6 +214,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=coordination.k8s.io, Version=v1beta1 case coordinationv1beta1.SchemeGroupVersion.WithResource("leases"): return &genericInformer{resource: resource.GroupResource(), informer: f.Coordination().V1beta1().Leases().Informer()}, nil + case coordinationv1beta1.SchemeGroupVersion.WithResource("leasecandidates"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Coordination().V1beta1().LeaseCandidates().Informer()}, nil // Group=core, Version=v1 case corev1.SchemeGroupVersion.WithResource("componentstatuses"): @@ -303,12 +308,16 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Internal().V1alpha1().StorageVersions().Informer()}, nil // Group=networking.k8s.io, Version=v1 + case networkingv1.SchemeGroupVersion.WithResource("ipaddresses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().IPAddresses().Informer()}, nil case networkingv1.SchemeGroupVersion.WithResource("ingresses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().Ingresses().Informer()}, nil case networkingv1.SchemeGroupVersion.WithResource("ingressclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().IngressClasses().Informer()}, nil case networkingv1.SchemeGroupVersion.WithResource("networkpolicies"): return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().NetworkPolicies().Informer()}, nil + case networkingv1.SchemeGroupVersion.WithResource("servicecidrs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().ServiceCIDRs().Informer()}, nil // Group=networking.k8s.io, Version=v1alpha1 case networkingv1alpha1.SchemeGroupVersion.WithResource("ipaddresses"): @@ -379,6 +388,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=resource.k8s.io, Version=v1alpha3 case v1alpha3.SchemeGroupVersion.WithResource("deviceclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().DeviceClasses().Informer()}, nil + case v1alpha3.SchemeGroupVersion.WithResource("devicetaintrules"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().DeviceTaintRules().Informer()}, nil case v1alpha3.SchemeGroupVersion.WithResource("resourceclaims"): return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceClaims().Informer()}, nil case v1alpha3.SchemeGroupVersion.WithResource("resourceclaimtemplates"): @@ -396,6 +407,16 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case resourcev1beta1.SchemeGroupVersion.WithResource("resourceslices"): return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1beta1().ResourceSlices().Informer()}, nil + // Group=resource.k8s.io, Version=v1beta2 + case resourcev1beta2.SchemeGroupVersion.WithResource("deviceclasses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1beta2().DeviceClasses().Informer()}, nil + case resourcev1beta2.SchemeGroupVersion.WithResource("resourceclaims"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1beta2().ResourceClaims().Informer()}, nil + case resourcev1beta2.SchemeGroupVersion.WithResource("resourceclaimtemplates"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1beta2().ResourceClaimTemplates().Informer()}, nil + case resourcev1beta2.SchemeGroupVersion.WithResource("resourceslices"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1beta2().ResourceSlices().Informer()}, nil + // Group=scheduling.k8s.io, Version=v1 case schedulingv1.SchemeGroupVersion.WithResource("priorityclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1().PriorityClasses().Informer()}, nil diff --git a/e2e/vendor/k8s.io/client-go/informers/networking/v1/ingress.go b/e2e/vendor/k8s.io/client-go/informers/networking/v1/ingress.go index a0deccf16..6f1b0b781 100644 --- a/e2e/vendor/k8s.io/client-go/informers/networking/v1/ingress.go +++ b/e2e/vendor/k8s.io/client-go/informers/networking/v1/ingress.go @@ -62,13 +62,25 @@ func NewFilteredIngressInformer(client kubernetes.Interface, namespace string, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1().Ingresses(namespace).List(context.TODO(), options) + return client.NetworkingV1().Ingresses(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1().Ingresses(namespace).Watch(context.TODO(), options) + return client.NetworkingV1().Ingresses(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().Ingresses(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().Ingresses(namespace).Watch(ctx, options) }, }, &apinetworkingv1.Ingress{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/networking/v1/ingressclass.go b/e2e/vendor/k8s.io/client-go/informers/networking/v1/ingressclass.go index 7eb174516..b0d4803d8 100644 --- a/e2e/vendor/k8s.io/client-go/informers/networking/v1/ingressclass.go +++ b/e2e/vendor/k8s.io/client-go/informers/networking/v1/ingressclass.go @@ -61,13 +61,25 @@ func NewFilteredIngressClassInformer(client kubernetes.Interface, resyncPeriod t if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1().IngressClasses().List(context.TODO(), options) + return client.NetworkingV1().IngressClasses().List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1().IngressClasses().Watch(context.TODO(), options) + return client.NetworkingV1().IngressClasses().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().IngressClasses().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().IngressClasses().Watch(ctx, options) }, }, &apinetworkingv1.IngressClass{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/networking/v1/interface.go b/e2e/vendor/k8s.io/client-go/informers/networking/v1/interface.go index a48d92c4e..09634929b 100644 --- a/e2e/vendor/k8s.io/client-go/informers/networking/v1/interface.go +++ b/e2e/vendor/k8s.io/client-go/informers/networking/v1/interface.go @@ -24,12 +24,16 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { + // IPAddresses returns a IPAddressInformer. + IPAddresses() IPAddressInformer // Ingresses returns a IngressInformer. Ingresses() IngressInformer // IngressClasses returns a IngressClassInformer. IngressClasses() IngressClassInformer // NetworkPolicies returns a NetworkPolicyInformer. NetworkPolicies() NetworkPolicyInformer + // ServiceCIDRs returns a ServiceCIDRInformer. + ServiceCIDRs() ServiceCIDRInformer } type version struct { @@ -43,6 +47,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } +// IPAddresses returns a IPAddressInformer. +func (v *version) IPAddresses() IPAddressInformer { + return &iPAddressInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + // Ingresses returns a IngressInformer. func (v *version) Ingresses() IngressInformer { return &ingressInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} @@ -57,3 +66,8 @@ func (v *version) IngressClasses() IngressClassInformer { func (v *version) NetworkPolicies() NetworkPolicyInformer { return &networkPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } + +// ServiceCIDRs returns a ServiceCIDRInformer. +func (v *version) ServiceCIDRs() ServiceCIDRInformer { + return &serviceCIDRInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/e2e/vendor/k8s.io/client-go/informers/networking/v1/ipaddress.go b/e2e/vendor/k8s.io/client-go/informers/networking/v1/ipaddress.go new file mode 100644 index 000000000..e3459e72b --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/informers/networking/v1/ipaddress.go @@ -0,0 +1,101 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + time "time" + + apinetworkingv1 "k8s.io/api/networking/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + networkingv1 "k8s.io/client-go/listers/networking/v1" + cache "k8s.io/client-go/tools/cache" +) + +// IPAddressInformer provides access to a shared informer and lister for +// IPAddresses. +type IPAddressInformer interface { + Informer() cache.SharedIndexInformer + Lister() networkingv1.IPAddressLister +} + +type iPAddressInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewIPAddressInformer constructs a new informer for IPAddress type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewIPAddressInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredIPAddressInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredIPAddressInformer constructs a new informer for IPAddress type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredIPAddressInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().IPAddresses().List(context.Background(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().IPAddresses().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().IPAddresses().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().IPAddresses().Watch(ctx, options) + }, + }, + &apinetworkingv1.IPAddress{}, + resyncPeriod, + indexers, + ) +} + +func (f *iPAddressInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredIPAddressInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *iPAddressInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apinetworkingv1.IPAddress{}, f.defaultInformer) +} + +func (f *iPAddressInformer) Lister() networkingv1.IPAddressLister { + return networkingv1.NewIPAddressLister(f.Informer().GetIndexer()) +} diff --git a/e2e/vendor/k8s.io/client-go/informers/networking/v1/networkpolicy.go b/e2e/vendor/k8s.io/client-go/informers/networking/v1/networkpolicy.go index d4bac2911..0dba59c5e 100644 --- a/e2e/vendor/k8s.io/client-go/informers/networking/v1/networkpolicy.go +++ b/e2e/vendor/k8s.io/client-go/informers/networking/v1/networkpolicy.go @@ -62,13 +62,25 @@ func NewFilteredNetworkPolicyInformer(client kubernetes.Interface, namespace str if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1().NetworkPolicies(namespace).List(context.TODO(), options) + return client.NetworkingV1().NetworkPolicies(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1().NetworkPolicies(namespace).Watch(context.TODO(), options) + return client.NetworkingV1().NetworkPolicies(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().NetworkPolicies(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().NetworkPolicies(namespace).Watch(ctx, options) }, }, &apinetworkingv1.NetworkPolicy{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/networking/v1/servicecidr.go b/e2e/vendor/k8s.io/client-go/informers/networking/v1/servicecidr.go new file mode 100644 index 000000000..039cdc753 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/informers/networking/v1/servicecidr.go @@ -0,0 +1,101 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + time "time" + + apinetworkingv1 "k8s.io/api/networking/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + networkingv1 "k8s.io/client-go/listers/networking/v1" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceCIDRInformer provides access to a shared informer and lister for +// ServiceCIDRs. +type ServiceCIDRInformer interface { + Informer() cache.SharedIndexInformer + Lister() networkingv1.ServiceCIDRLister +} + +type serviceCIDRInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceCIDRInformer constructs a new informer for ServiceCIDR type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceCIDRInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceCIDRInformer constructs a new informer for ServiceCIDR type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().ServiceCIDRs().List(context.Background(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().ServiceCIDRs().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().ServiceCIDRs().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().ServiceCIDRs().Watch(ctx, options) + }, + }, + &apinetworkingv1.ServiceCIDR{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceCIDRInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceCIDRInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceCIDRInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apinetworkingv1.ServiceCIDR{}, f.defaultInformer) +} + +func (f *serviceCIDRInformer) Lister() networkingv1.ServiceCIDRLister { + return networkingv1.NewServiceCIDRLister(f.Informer().GetIndexer()) +} diff --git a/e2e/vendor/k8s.io/client-go/informers/networking/v1alpha1/ipaddress.go b/e2e/vendor/k8s.io/client-go/informers/networking/v1alpha1/ipaddress.go index f04c14535..f357be93b 100644 --- a/e2e/vendor/k8s.io/client-go/informers/networking/v1alpha1/ipaddress.go +++ b/e2e/vendor/k8s.io/client-go/informers/networking/v1alpha1/ipaddress.go @@ -61,13 +61,25 @@ func NewFilteredIPAddressInformer(client kubernetes.Interface, resyncPeriod time if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1alpha1().IPAddresses().List(context.TODO(), options) + return client.NetworkingV1alpha1().IPAddresses().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1alpha1().IPAddresses().Watch(context.TODO(), options) + return client.NetworkingV1alpha1().IPAddresses().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1alpha1().IPAddresses().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1alpha1().IPAddresses().Watch(ctx, options) }, }, &apinetworkingv1alpha1.IPAddress{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/networking/v1alpha1/servicecidr.go b/e2e/vendor/k8s.io/client-go/informers/networking/v1alpha1/servicecidr.go index 86af6d226..30cb61a65 100644 --- a/e2e/vendor/k8s.io/client-go/informers/networking/v1alpha1/servicecidr.go +++ b/e2e/vendor/k8s.io/client-go/informers/networking/v1alpha1/servicecidr.go @@ -61,13 +61,25 @@ func NewFilteredServiceCIDRInformer(client kubernetes.Interface, resyncPeriod ti if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1alpha1().ServiceCIDRs().List(context.TODO(), options) + return client.NetworkingV1alpha1().ServiceCIDRs().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1alpha1().ServiceCIDRs().Watch(context.TODO(), options) + return client.NetworkingV1alpha1().ServiceCIDRs().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1alpha1().ServiceCIDRs().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1alpha1().ServiceCIDRs().Watch(ctx, options) }, }, &apinetworkingv1alpha1.ServiceCIDR{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/networking/v1beta1/ingress.go b/e2e/vendor/k8s.io/client-go/informers/networking/v1beta1/ingress.go index aa337d8e7..6c616b902 100644 --- a/e2e/vendor/k8s.io/client-go/informers/networking/v1beta1/ingress.go +++ b/e2e/vendor/k8s.io/client-go/informers/networking/v1beta1/ingress.go @@ -62,13 +62,25 @@ func NewFilteredIngressInformer(client kubernetes.Interface, namespace string, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().Ingresses(namespace).List(context.TODO(), options) + return client.NetworkingV1beta1().Ingresses(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().Ingresses(namespace).Watch(context.TODO(), options) + return client.NetworkingV1beta1().Ingresses(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1beta1().Ingresses(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1beta1().Ingresses(namespace).Watch(ctx, options) }, }, &apinetworkingv1beta1.Ingress{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/networking/v1beta1/ingressclass.go b/e2e/vendor/k8s.io/client-go/informers/networking/v1beta1/ingressclass.go index 6ff9d5169..dd3a9aa7c 100644 --- a/e2e/vendor/k8s.io/client-go/informers/networking/v1beta1/ingressclass.go +++ b/e2e/vendor/k8s.io/client-go/informers/networking/v1beta1/ingressclass.go @@ -61,13 +61,25 @@ func NewFilteredIngressClassInformer(client kubernetes.Interface, resyncPeriod t if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().IngressClasses().List(context.TODO(), options) + return client.NetworkingV1beta1().IngressClasses().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().IngressClasses().Watch(context.TODO(), options) + return client.NetworkingV1beta1().IngressClasses().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1beta1().IngressClasses().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1beta1().IngressClasses().Watch(ctx, options) }, }, &apinetworkingv1beta1.IngressClass{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/networking/v1beta1/ipaddress.go b/e2e/vendor/k8s.io/client-go/informers/networking/v1beta1/ipaddress.go index 401ecd7cb..32ce3c4a8 100644 --- a/e2e/vendor/k8s.io/client-go/informers/networking/v1beta1/ipaddress.go +++ b/e2e/vendor/k8s.io/client-go/informers/networking/v1beta1/ipaddress.go @@ -61,13 +61,25 @@ func NewFilteredIPAddressInformer(client kubernetes.Interface, resyncPeriod time if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().IPAddresses().List(context.TODO(), options) + return client.NetworkingV1beta1().IPAddresses().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().IPAddresses().Watch(context.TODO(), options) + return client.NetworkingV1beta1().IPAddresses().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1beta1().IPAddresses().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1beta1().IPAddresses().Watch(ctx, options) }, }, &apinetworkingv1beta1.IPAddress{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/networking/v1beta1/servicecidr.go b/e2e/vendor/k8s.io/client-go/informers/networking/v1beta1/servicecidr.go index ff40692f2..25843d2fe 100644 --- a/e2e/vendor/k8s.io/client-go/informers/networking/v1beta1/servicecidr.go +++ b/e2e/vendor/k8s.io/client-go/informers/networking/v1beta1/servicecidr.go @@ -61,13 +61,25 @@ func NewFilteredServiceCIDRInformer(client kubernetes.Interface, resyncPeriod ti if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().ServiceCIDRs().List(context.TODO(), options) + return client.NetworkingV1beta1().ServiceCIDRs().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().ServiceCIDRs().Watch(context.TODO(), options) + return client.NetworkingV1beta1().ServiceCIDRs().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1beta1().ServiceCIDRs().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1beta1().ServiceCIDRs().Watch(ctx, options) }, }, &apinetworkingv1beta1.ServiceCIDR{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/node/v1/runtimeclass.go b/e2e/vendor/k8s.io/client-go/informers/node/v1/runtimeclass.go index 7fef7e332..85625e3e0 100644 --- a/e2e/vendor/k8s.io/client-go/informers/node/v1/runtimeclass.go +++ b/e2e/vendor/k8s.io/client-go/informers/node/v1/runtimeclass.go @@ -61,13 +61,25 @@ func NewFilteredRuntimeClassInformer(client kubernetes.Interface, resyncPeriod t if tweakListOptions != nil { tweakListOptions(&options) } - return client.NodeV1().RuntimeClasses().List(context.TODO(), options) + return client.NodeV1().RuntimeClasses().List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NodeV1().RuntimeClasses().Watch(context.TODO(), options) + return client.NodeV1().RuntimeClasses().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NodeV1().RuntimeClasses().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NodeV1().RuntimeClasses().Watch(ctx, options) }, }, &apinodev1.RuntimeClass{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/node/v1alpha1/runtimeclass.go b/e2e/vendor/k8s.io/client-go/informers/node/v1alpha1/runtimeclass.go index aee61406f..b3ac2e2a2 100644 --- a/e2e/vendor/k8s.io/client-go/informers/node/v1alpha1/runtimeclass.go +++ b/e2e/vendor/k8s.io/client-go/informers/node/v1alpha1/runtimeclass.go @@ -61,13 +61,25 @@ func NewFilteredRuntimeClassInformer(client kubernetes.Interface, resyncPeriod t if tweakListOptions != nil { tweakListOptions(&options) } - return client.NodeV1alpha1().RuntimeClasses().List(context.TODO(), options) + return client.NodeV1alpha1().RuntimeClasses().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NodeV1alpha1().RuntimeClasses().Watch(context.TODO(), options) + return client.NodeV1alpha1().RuntimeClasses().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NodeV1alpha1().RuntimeClasses().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NodeV1alpha1().RuntimeClasses().Watch(ctx, options) }, }, &apinodev1alpha1.RuntimeClass{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/node/v1beta1/runtimeclass.go b/e2e/vendor/k8s.io/client-go/informers/node/v1beta1/runtimeclass.go index ab9b8e0ee..b562476d4 100644 --- a/e2e/vendor/k8s.io/client-go/informers/node/v1beta1/runtimeclass.go +++ b/e2e/vendor/k8s.io/client-go/informers/node/v1beta1/runtimeclass.go @@ -61,13 +61,25 @@ func NewFilteredRuntimeClassInformer(client kubernetes.Interface, resyncPeriod t if tweakListOptions != nil { tweakListOptions(&options) } - return client.NodeV1beta1().RuntimeClasses().List(context.TODO(), options) + return client.NodeV1beta1().RuntimeClasses().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NodeV1beta1().RuntimeClasses().Watch(context.TODO(), options) + return client.NodeV1beta1().RuntimeClasses().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NodeV1beta1().RuntimeClasses().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NodeV1beta1().RuntimeClasses().Watch(ctx, options) }, }, &apinodev1beta1.RuntimeClass{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/policy/v1/poddisruptionbudget.go b/e2e/vendor/k8s.io/client-go/informers/policy/v1/poddisruptionbudget.go index baacb59da..f80d7dd91 100644 --- a/e2e/vendor/k8s.io/client-go/informers/policy/v1/poddisruptionbudget.go +++ b/e2e/vendor/k8s.io/client-go/informers/policy/v1/poddisruptionbudget.go @@ -62,13 +62,25 @@ func NewFilteredPodDisruptionBudgetInformer(client kubernetes.Interface, namespa if tweakListOptions != nil { tweakListOptions(&options) } - return client.PolicyV1().PodDisruptionBudgets(namespace).List(context.TODO(), options) + return client.PolicyV1().PodDisruptionBudgets(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.PolicyV1().PodDisruptionBudgets(namespace).Watch(context.TODO(), options) + return client.PolicyV1().PodDisruptionBudgets(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.PolicyV1().PodDisruptionBudgets(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.PolicyV1().PodDisruptionBudgets(namespace).Watch(ctx, options) }, }, &apipolicyv1.PodDisruptionBudget{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/policy/v1beta1/poddisruptionbudget.go b/e2e/vendor/k8s.io/client-go/informers/policy/v1beta1/poddisruptionbudget.go index 081b2e08e..92e37d0eb 100644 --- a/e2e/vendor/k8s.io/client-go/informers/policy/v1beta1/poddisruptionbudget.go +++ b/e2e/vendor/k8s.io/client-go/informers/policy/v1beta1/poddisruptionbudget.go @@ -62,13 +62,25 @@ func NewFilteredPodDisruptionBudgetInformer(client kubernetes.Interface, namespa if tweakListOptions != nil { tweakListOptions(&options) } - return client.PolicyV1beta1().PodDisruptionBudgets(namespace).List(context.TODO(), options) + return client.PolicyV1beta1().PodDisruptionBudgets(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.PolicyV1beta1().PodDisruptionBudgets(namespace).Watch(context.TODO(), options) + return client.PolicyV1beta1().PodDisruptionBudgets(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.PolicyV1beta1().PodDisruptionBudgets(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.PolicyV1beta1().PodDisruptionBudgets(namespace).Watch(ctx, options) }, }, &apipolicyv1beta1.PodDisruptionBudget{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go b/e2e/vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go index 0606fb464..4118bffff 100644 --- a/e2e/vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go +++ b/e2e/vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go @@ -61,13 +61,25 @@ func NewFilteredClusterRoleInformer(client kubernetes.Interface, resyncPeriod ti if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1().ClusterRoles().List(context.TODO(), options) + return client.RbacV1().ClusterRoles().List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1().ClusterRoles().Watch(context.TODO(), options) + return client.RbacV1().ClusterRoles().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1().ClusterRoles().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1().ClusterRoles().Watch(ctx, options) }, }, &apirbacv1.ClusterRole{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/rbac/v1/clusterrolebinding.go b/e2e/vendor/k8s.io/client-go/informers/rbac/v1/clusterrolebinding.go index dca087c9d..67c06d601 100644 --- a/e2e/vendor/k8s.io/client-go/informers/rbac/v1/clusterrolebinding.go +++ b/e2e/vendor/k8s.io/client-go/informers/rbac/v1/clusterrolebinding.go @@ -61,13 +61,25 @@ func NewFilteredClusterRoleBindingInformer(client kubernetes.Interface, resyncPe if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1().ClusterRoleBindings().List(context.TODO(), options) + return client.RbacV1().ClusterRoleBindings().List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1().ClusterRoleBindings().Watch(context.TODO(), options) + return client.RbacV1().ClusterRoleBindings().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1().ClusterRoleBindings().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1().ClusterRoleBindings().Watch(ctx, options) }, }, &apirbacv1.ClusterRoleBinding{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/rbac/v1/role.go b/e2e/vendor/k8s.io/client-go/informers/rbac/v1/role.go index 66f9c3f23..e931d2396 100644 --- a/e2e/vendor/k8s.io/client-go/informers/rbac/v1/role.go +++ b/e2e/vendor/k8s.io/client-go/informers/rbac/v1/role.go @@ -62,13 +62,25 @@ func NewFilteredRoleInformer(client kubernetes.Interface, namespace string, resy if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1().Roles(namespace).List(context.TODO(), options) + return client.RbacV1().Roles(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1().Roles(namespace).Watch(context.TODO(), options) + return client.RbacV1().Roles(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1().Roles(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1().Roles(namespace).Watch(ctx, options) }, }, &apirbacv1.Role{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/rbac/v1/rolebinding.go b/e2e/vendor/k8s.io/client-go/informers/rbac/v1/rolebinding.go index 6d72601a4..89b11efff 100644 --- a/e2e/vendor/k8s.io/client-go/informers/rbac/v1/rolebinding.go +++ b/e2e/vendor/k8s.io/client-go/informers/rbac/v1/rolebinding.go @@ -62,13 +62,25 @@ func NewFilteredRoleBindingInformer(client kubernetes.Interface, namespace strin if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1().RoleBindings(namespace).List(context.TODO(), options) + return client.RbacV1().RoleBindings(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1().RoleBindings(namespace).Watch(context.TODO(), options) + return client.RbacV1().RoleBindings(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1().RoleBindings(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1().RoleBindings(namespace).Watch(ctx, options) }, }, &apirbacv1.RoleBinding{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrole.go b/e2e/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrole.go index 52249f6b4..ff95f62ff 100644 --- a/e2e/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrole.go +++ b/e2e/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrole.go @@ -61,13 +61,25 @@ func NewFilteredClusterRoleInformer(client kubernetes.Interface, resyncPeriod ti if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1alpha1().ClusterRoles().List(context.TODO(), options) + return client.RbacV1alpha1().ClusterRoles().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1alpha1().ClusterRoles().Watch(context.TODO(), options) + return client.RbacV1alpha1().ClusterRoles().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1alpha1().ClusterRoles().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1alpha1().ClusterRoles().Watch(ctx, options) }, }, &apirbacv1alpha1.ClusterRole{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrolebinding.go b/e2e/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrolebinding.go index c8f7c4c10..1002f1630 100644 --- a/e2e/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrolebinding.go +++ b/e2e/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrolebinding.go @@ -61,13 +61,25 @@ func NewFilteredClusterRoleBindingInformer(client kubernetes.Interface, resyncPe if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1alpha1().ClusterRoleBindings().List(context.TODO(), options) + return client.RbacV1alpha1().ClusterRoleBindings().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1alpha1().ClusterRoleBindings().Watch(context.TODO(), options) + return client.RbacV1alpha1().ClusterRoleBindings().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1alpha1().ClusterRoleBindings().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1alpha1().ClusterRoleBindings().Watch(ctx, options) }, }, &apirbacv1alpha1.ClusterRoleBinding{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/rbac/v1alpha1/role.go b/e2e/vendor/k8s.io/client-go/informers/rbac/v1alpha1/role.go index dcdddc057..ad7b1c0b8 100644 --- a/e2e/vendor/k8s.io/client-go/informers/rbac/v1alpha1/role.go +++ b/e2e/vendor/k8s.io/client-go/informers/rbac/v1alpha1/role.go @@ -62,13 +62,25 @@ func NewFilteredRoleInformer(client kubernetes.Interface, namespace string, resy if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1alpha1().Roles(namespace).List(context.TODO(), options) + return client.RbacV1alpha1().Roles(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1alpha1().Roles(namespace).Watch(context.TODO(), options) + return client.RbacV1alpha1().Roles(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1alpha1().Roles(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1alpha1().Roles(namespace).Watch(ctx, options) }, }, &apirbacv1alpha1.Role{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/rbac/v1alpha1/rolebinding.go b/e2e/vendor/k8s.io/client-go/informers/rbac/v1alpha1/rolebinding.go index 9184a5baf..c5d915d23 100644 --- a/e2e/vendor/k8s.io/client-go/informers/rbac/v1alpha1/rolebinding.go +++ b/e2e/vendor/k8s.io/client-go/informers/rbac/v1alpha1/rolebinding.go @@ -62,13 +62,25 @@ func NewFilteredRoleBindingInformer(client kubernetes.Interface, namespace strin if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1alpha1().RoleBindings(namespace).List(context.TODO(), options) + return client.RbacV1alpha1().RoleBindings(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1alpha1().RoleBindings(namespace).Watch(context.TODO(), options) + return client.RbacV1alpha1().RoleBindings(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1alpha1().RoleBindings(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1alpha1().RoleBindings(namespace).Watch(ctx, options) }, }, &apirbacv1alpha1.RoleBinding{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrole.go b/e2e/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrole.go index d86dd771a..24aad0b82 100644 --- a/e2e/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrole.go +++ b/e2e/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrole.go @@ -61,13 +61,25 @@ func NewFilteredClusterRoleInformer(client kubernetes.Interface, resyncPeriod ti if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1beta1().ClusterRoles().List(context.TODO(), options) + return client.RbacV1beta1().ClusterRoles().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1beta1().ClusterRoles().Watch(context.TODO(), options) + return client.RbacV1beta1().ClusterRoles().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1beta1().ClusterRoles().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1beta1().ClusterRoles().Watch(ctx, options) }, }, &apirbacv1beta1.ClusterRole{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrolebinding.go b/e2e/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrolebinding.go index 70c1cd984..3506b7972 100644 --- a/e2e/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrolebinding.go +++ b/e2e/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrolebinding.go @@ -61,13 +61,25 @@ func NewFilteredClusterRoleBindingInformer(client kubernetes.Interface, resyncPe if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1beta1().ClusterRoleBindings().List(context.TODO(), options) + return client.RbacV1beta1().ClusterRoleBindings().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1beta1().ClusterRoleBindings().Watch(context.TODO(), options) + return client.RbacV1beta1().ClusterRoleBindings().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1beta1().ClusterRoleBindings().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1beta1().ClusterRoleBindings().Watch(ctx, options) }, }, &apirbacv1beta1.ClusterRoleBinding{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/rbac/v1beta1/role.go b/e2e/vendor/k8s.io/client-go/informers/rbac/v1beta1/role.go index 2995e1e63..119a601f0 100644 --- a/e2e/vendor/k8s.io/client-go/informers/rbac/v1beta1/role.go +++ b/e2e/vendor/k8s.io/client-go/informers/rbac/v1beta1/role.go @@ -62,13 +62,25 @@ func NewFilteredRoleInformer(client kubernetes.Interface, namespace string, resy if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1beta1().Roles(namespace).List(context.TODO(), options) + return client.RbacV1beta1().Roles(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1beta1().Roles(namespace).Watch(context.TODO(), options) + return client.RbacV1beta1().Roles(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1beta1().Roles(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1beta1().Roles(namespace).Watch(ctx, options) }, }, &apirbacv1beta1.Role{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/rbac/v1beta1/rolebinding.go b/e2e/vendor/k8s.io/client-go/informers/rbac/v1beta1/rolebinding.go index 11854f38d..c36c295c0 100644 --- a/e2e/vendor/k8s.io/client-go/informers/rbac/v1beta1/rolebinding.go +++ b/e2e/vendor/k8s.io/client-go/informers/rbac/v1beta1/rolebinding.go @@ -62,13 +62,25 @@ func NewFilteredRoleBindingInformer(client kubernetes.Interface, namespace strin if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1beta1().RoleBindings(namespace).List(context.TODO(), options) + return client.RbacV1beta1().RoleBindings(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1beta1().RoleBindings(namespace).Watch(context.TODO(), options) + return client.RbacV1beta1().RoleBindings(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1beta1().RoleBindings(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.RbacV1beta1().RoleBindings(namespace).Watch(ctx, options) }, }, &apirbacv1beta1.RoleBinding{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/resource/interface.go b/e2e/vendor/k8s.io/client-go/informers/resource/interface.go index 0d75732af..f4bcd9270 100644 --- a/e2e/vendor/k8s.io/client-go/informers/resource/interface.go +++ b/e2e/vendor/k8s.io/client-go/informers/resource/interface.go @@ -22,6 +22,7 @@ import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" v1alpha3 "k8s.io/client-go/informers/resource/v1alpha3" v1beta1 "k8s.io/client-go/informers/resource/v1beta1" + v1beta2 "k8s.io/client-go/informers/resource/v1beta2" ) // Interface provides access to each of this group's versions. @@ -30,6 +31,8 @@ type Interface interface { V1alpha3() v1alpha3.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface + // V1beta2 provides access to shared informers for resources in V1beta2. + V1beta2() v1beta2.Interface } type group struct { @@ -52,3 +55,8 @@ func (g *group) V1alpha3() v1alpha3.Interface { func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } + +// V1beta2 returns a new v1beta2.Interface. +func (g *group) V1beta2() v1beta2.Interface { + return v1beta2.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/deviceclass.go b/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/deviceclass.go index da322c8d0..cff627919 100644 --- a/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/deviceclass.go +++ b/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/deviceclass.go @@ -61,13 +61,25 @@ func NewFilteredDeviceClassInformer(client kubernetes.Interface, resyncPeriod ti if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha3().DeviceClasses().List(context.TODO(), options) + return client.ResourceV1alpha3().DeviceClasses().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha3().DeviceClasses().Watch(context.TODO(), options) + return client.ResourceV1alpha3().DeviceClasses().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1alpha3().DeviceClasses().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1alpha3().DeviceClasses().Watch(ctx, options) }, }, &apiresourcev1alpha3.DeviceClass{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/devicetaintrule.go b/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/devicetaintrule.go new file mode 100644 index 000000000..9a07c8f4e --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/devicetaintrule.go @@ -0,0 +1,101 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + context "context" + time "time" + + apiresourcev1alpha3 "k8s.io/api/resource/v1alpha3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + resourcev1alpha3 "k8s.io/client-go/listers/resource/v1alpha3" + cache "k8s.io/client-go/tools/cache" +) + +// DeviceTaintRuleInformer provides access to a shared informer and lister for +// DeviceTaintRules. +type DeviceTaintRuleInformer interface { + Informer() cache.SharedIndexInformer + Lister() resourcev1alpha3.DeviceTaintRuleLister +} + +type deviceTaintRuleInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDeviceTaintRuleInformer constructs a new informer for DeviceTaintRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDeviceTaintRuleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDeviceTaintRuleInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDeviceTaintRuleInformer constructs a new informer for DeviceTaintRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDeviceTaintRuleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1alpha3().DeviceTaintRules().List(context.Background(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1alpha3().DeviceTaintRules().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1alpha3().DeviceTaintRules().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1alpha3().DeviceTaintRules().Watch(ctx, options) + }, + }, + &apiresourcev1alpha3.DeviceTaintRule{}, + resyncPeriod, + indexers, + ) +} + +func (f *deviceTaintRuleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDeviceTaintRuleInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *deviceTaintRuleInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apiresourcev1alpha3.DeviceTaintRule{}, f.defaultInformer) +} + +func (f *deviceTaintRuleInformer) Lister() resourcev1alpha3.DeviceTaintRuleLister { + return resourcev1alpha3.NewDeviceTaintRuleLister(f.Informer().GetIndexer()) +} diff --git a/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/interface.go b/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/interface.go index 356c46179..11c7f849a 100644 --- a/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/interface.go +++ b/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/interface.go @@ -26,6 +26,8 @@ import ( type Interface interface { // DeviceClasses returns a DeviceClassInformer. DeviceClasses() DeviceClassInformer + // DeviceTaintRules returns a DeviceTaintRuleInformer. + DeviceTaintRules() DeviceTaintRuleInformer // ResourceClaims returns a ResourceClaimInformer. ResourceClaims() ResourceClaimInformer // ResourceClaimTemplates returns a ResourceClaimTemplateInformer. @@ -50,6 +52,11 @@ func (v *version) DeviceClasses() DeviceClassInformer { return &deviceClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } +// DeviceTaintRules returns a DeviceTaintRuleInformer. +func (v *version) DeviceTaintRules() DeviceTaintRuleInformer { + return &deviceTaintRuleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + // ResourceClaims returns a ResourceClaimInformer. func (v *version) ResourceClaims() ResourceClaimInformer { return &resourceClaimInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/resourceclaim.go b/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/resourceclaim.go index 822d145bc..2ee78d35d 100644 --- a/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/resourceclaim.go +++ b/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/resourceclaim.go @@ -62,13 +62,25 @@ func NewFilteredResourceClaimInformer(client kubernetes.Interface, namespace str if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha3().ResourceClaims(namespace).List(context.TODO(), options) + return client.ResourceV1alpha3().ResourceClaims(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha3().ResourceClaims(namespace).Watch(context.TODO(), options) + return client.ResourceV1alpha3().ResourceClaims(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1alpha3().ResourceClaims(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1alpha3().ResourceClaims(namespace).Watch(ctx, options) }, }, &apiresourcev1alpha3.ResourceClaim{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/resourceclaimtemplate.go b/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/resourceclaimtemplate.go index 94680730a..bd1e7abef 100644 --- a/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/resourceclaimtemplate.go +++ b/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/resourceclaimtemplate.go @@ -62,13 +62,25 @@ func NewFilteredResourceClaimTemplateInformer(client kubernetes.Interface, names if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha3().ResourceClaimTemplates(namespace).List(context.TODO(), options) + return client.ResourceV1alpha3().ResourceClaimTemplates(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha3().ResourceClaimTemplates(namespace).Watch(context.TODO(), options) + return client.ResourceV1alpha3().ResourceClaimTemplates(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1alpha3().ResourceClaimTemplates(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1alpha3().ResourceClaimTemplates(namespace).Watch(ctx, options) }, }, &apiresourcev1alpha3.ResourceClaimTemplate{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/resourceslice.go b/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/resourceslice.go index 15394575f..9b6422e96 100644 --- a/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/resourceslice.go +++ b/e2e/vendor/k8s.io/client-go/informers/resource/v1alpha3/resourceslice.go @@ -61,13 +61,25 @@ func NewFilteredResourceSliceInformer(client kubernetes.Interface, resyncPeriod if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha3().ResourceSlices().List(context.TODO(), options) + return client.ResourceV1alpha3().ResourceSlices().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha3().ResourceSlices().Watch(context.TODO(), options) + return client.ResourceV1alpha3().ResourceSlices().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1alpha3().ResourceSlices().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1alpha3().ResourceSlices().Watch(ctx, options) }, }, &apiresourcev1alpha3.ResourceSlice{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/resource/v1beta1/deviceclass.go b/e2e/vendor/k8s.io/client-go/informers/resource/v1beta1/deviceclass.go index 9623788c4..bb0b28245 100644 --- a/e2e/vendor/k8s.io/client-go/informers/resource/v1beta1/deviceclass.go +++ b/e2e/vendor/k8s.io/client-go/informers/resource/v1beta1/deviceclass.go @@ -61,13 +61,25 @@ func NewFilteredDeviceClassInformer(client kubernetes.Interface, resyncPeriod ti if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1beta1().DeviceClasses().List(context.TODO(), options) + return client.ResourceV1beta1().DeviceClasses().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1beta1().DeviceClasses().Watch(context.TODO(), options) + return client.ResourceV1beta1().DeviceClasses().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta1().DeviceClasses().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta1().DeviceClasses().Watch(ctx, options) }, }, &apiresourcev1beta1.DeviceClass{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceclaim.go b/e2e/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceclaim.go index 107b7fda7..5e13b7973 100644 --- a/e2e/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceclaim.go +++ b/e2e/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceclaim.go @@ -62,13 +62,25 @@ func NewFilteredResourceClaimInformer(client kubernetes.Interface, namespace str if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1beta1().ResourceClaims(namespace).List(context.TODO(), options) + return client.ResourceV1beta1().ResourceClaims(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1beta1().ResourceClaims(namespace).Watch(context.TODO(), options) + return client.ResourceV1beta1().ResourceClaims(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta1().ResourceClaims(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta1().ResourceClaims(namespace).Watch(ctx, options) }, }, &apiresourcev1beta1.ResourceClaim{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceclaimtemplate.go b/e2e/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceclaimtemplate.go index 9ae634ad0..86c13a8f2 100644 --- a/e2e/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceclaimtemplate.go +++ b/e2e/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceclaimtemplate.go @@ -62,13 +62,25 @@ func NewFilteredResourceClaimTemplateInformer(client kubernetes.Interface, names if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1beta1().ResourceClaimTemplates(namespace).List(context.TODO(), options) + return client.ResourceV1beta1().ResourceClaimTemplates(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1beta1().ResourceClaimTemplates(namespace).Watch(context.TODO(), options) + return client.ResourceV1beta1().ResourceClaimTemplates(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta1().ResourceClaimTemplates(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta1().ResourceClaimTemplates(namespace).Watch(ctx, options) }, }, &apiresourcev1beta1.ResourceClaimTemplate{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceslice.go b/e2e/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceslice.go index 8ab6cb4fc..6cc3c65fd 100644 --- a/e2e/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceslice.go +++ b/e2e/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceslice.go @@ -61,13 +61,25 @@ func NewFilteredResourceSliceInformer(client kubernetes.Interface, resyncPeriod if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1beta1().ResourceSlices().List(context.TODO(), options) + return client.ResourceV1beta1().ResourceSlices().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1beta1().ResourceSlices().Watch(context.TODO(), options) + return client.ResourceV1beta1().ResourceSlices().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta1().ResourceSlices().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta1().ResourceSlices().Watch(ctx, options) }, }, &apiresourcev1beta1.ResourceSlice{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/resource/v1beta2/deviceclass.go b/e2e/vendor/k8s.io/client-go/informers/resource/v1beta2/deviceclass.go new file mode 100644 index 000000000..372d35d8a --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/informers/resource/v1beta2/deviceclass.go @@ -0,0 +1,101 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta2 + +import ( + context "context" + time "time" + + apiresourcev1beta2 "k8s.io/api/resource/v1beta2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + resourcev1beta2 "k8s.io/client-go/listers/resource/v1beta2" + cache "k8s.io/client-go/tools/cache" +) + +// DeviceClassInformer provides access to a shared informer and lister for +// DeviceClasses. +type DeviceClassInformer interface { + Informer() cache.SharedIndexInformer + Lister() resourcev1beta2.DeviceClassLister +} + +type deviceClassInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDeviceClassInformer constructs a new informer for DeviceClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDeviceClassInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDeviceClassInformer constructs a new informer for DeviceClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta2().DeviceClasses().List(context.Background(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta2().DeviceClasses().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta2().DeviceClasses().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta2().DeviceClasses().Watch(ctx, options) + }, + }, + &apiresourcev1beta2.DeviceClass{}, + resyncPeriod, + indexers, + ) +} + +func (f *deviceClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDeviceClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *deviceClassInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apiresourcev1beta2.DeviceClass{}, f.defaultInformer) +} + +func (f *deviceClassInformer) Lister() resourcev1beta2.DeviceClassLister { + return resourcev1beta2.NewDeviceClassLister(f.Informer().GetIndexer()) +} diff --git a/e2e/vendor/k8s.io/client-go/informers/resource/v1beta2/interface.go b/e2e/vendor/k8s.io/client-go/informers/resource/v1beta2/interface.go new file mode 100644 index 000000000..4627d6f3e --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/informers/resource/v1beta2/interface.go @@ -0,0 +1,66 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta2 + +import ( + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // DeviceClasses returns a DeviceClassInformer. + DeviceClasses() DeviceClassInformer + // ResourceClaims returns a ResourceClaimInformer. + ResourceClaims() ResourceClaimInformer + // ResourceClaimTemplates returns a ResourceClaimTemplateInformer. + ResourceClaimTemplates() ResourceClaimTemplateInformer + // ResourceSlices returns a ResourceSliceInformer. + ResourceSlices() ResourceSliceInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// DeviceClasses returns a DeviceClassInformer. +func (v *version) DeviceClasses() DeviceClassInformer { + return &deviceClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ResourceClaims returns a ResourceClaimInformer. +func (v *version) ResourceClaims() ResourceClaimInformer { + return &resourceClaimInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// ResourceClaimTemplates returns a ResourceClaimTemplateInformer. +func (v *version) ResourceClaimTemplates() ResourceClaimTemplateInformer { + return &resourceClaimTemplateInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// ResourceSlices returns a ResourceSliceInformer. +func (v *version) ResourceSlices() ResourceSliceInformer { + return &resourceSliceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/e2e/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceclaim.go b/e2e/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceclaim.go new file mode 100644 index 000000000..e245d998c --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceclaim.go @@ -0,0 +1,102 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta2 + +import ( + context "context" + time "time" + + apiresourcev1beta2 "k8s.io/api/resource/v1beta2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + resourcev1beta2 "k8s.io/client-go/listers/resource/v1beta2" + cache "k8s.io/client-go/tools/cache" +) + +// ResourceClaimInformer provides access to a shared informer and lister for +// ResourceClaims. +type ResourceClaimInformer interface { + Informer() cache.SharedIndexInformer + Lister() resourcev1beta2.ResourceClaimLister +} + +type resourceClaimInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewResourceClaimInformer constructs a new informer for ResourceClaim type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewResourceClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredResourceClaimInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredResourceClaimInformer constructs a new informer for ResourceClaim type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredResourceClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta2().ResourceClaims(namespace).List(context.Background(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta2().ResourceClaims(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta2().ResourceClaims(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta2().ResourceClaims(namespace).Watch(ctx, options) + }, + }, + &apiresourcev1beta2.ResourceClaim{}, + resyncPeriod, + indexers, + ) +} + +func (f *resourceClaimInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredResourceClaimInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *resourceClaimInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apiresourcev1beta2.ResourceClaim{}, f.defaultInformer) +} + +func (f *resourceClaimInformer) Lister() resourcev1beta2.ResourceClaimLister { + return resourcev1beta2.NewResourceClaimLister(f.Informer().GetIndexer()) +} diff --git a/e2e/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceclaimtemplate.go b/e2e/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceclaimtemplate.go new file mode 100644 index 000000000..4b973bd96 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceclaimtemplate.go @@ -0,0 +1,102 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta2 + +import ( + context "context" + time "time" + + apiresourcev1beta2 "k8s.io/api/resource/v1beta2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + resourcev1beta2 "k8s.io/client-go/listers/resource/v1beta2" + cache "k8s.io/client-go/tools/cache" +) + +// ResourceClaimTemplateInformer provides access to a shared informer and lister for +// ResourceClaimTemplates. +type ResourceClaimTemplateInformer interface { + Informer() cache.SharedIndexInformer + Lister() resourcev1beta2.ResourceClaimTemplateLister +} + +type resourceClaimTemplateInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewResourceClaimTemplateInformer constructs a new informer for ResourceClaimTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewResourceClaimTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredResourceClaimTemplateInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredResourceClaimTemplateInformer constructs a new informer for ResourceClaimTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredResourceClaimTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta2().ResourceClaimTemplates(namespace).List(context.Background(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta2().ResourceClaimTemplates(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta2().ResourceClaimTemplates(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta2().ResourceClaimTemplates(namespace).Watch(ctx, options) + }, + }, + &apiresourcev1beta2.ResourceClaimTemplate{}, + resyncPeriod, + indexers, + ) +} + +func (f *resourceClaimTemplateInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredResourceClaimTemplateInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *resourceClaimTemplateInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apiresourcev1beta2.ResourceClaimTemplate{}, f.defaultInformer) +} + +func (f *resourceClaimTemplateInformer) Lister() resourcev1beta2.ResourceClaimTemplateLister { + return resourcev1beta2.NewResourceClaimTemplateLister(f.Informer().GetIndexer()) +} diff --git a/e2e/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceslice.go b/e2e/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceslice.go new file mode 100644 index 000000000..c0cdc67a8 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceslice.go @@ -0,0 +1,101 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta2 + +import ( + context "context" + time "time" + + apiresourcev1beta2 "k8s.io/api/resource/v1beta2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + resourcev1beta2 "k8s.io/client-go/listers/resource/v1beta2" + cache "k8s.io/client-go/tools/cache" +) + +// ResourceSliceInformer provides access to a shared informer and lister for +// ResourceSlices. +type ResourceSliceInformer interface { + Informer() cache.SharedIndexInformer + Lister() resourcev1beta2.ResourceSliceLister +} + +type resourceSliceInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewResourceSliceInformer constructs a new informer for ResourceSlice type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredResourceSliceInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredResourceSliceInformer constructs a new informer for ResourceSlice type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta2().ResourceSlices().List(context.Background(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta2().ResourceSlices().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta2().ResourceSlices().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ResourceV1beta2().ResourceSlices().Watch(ctx, options) + }, + }, + &apiresourcev1beta2.ResourceSlice{}, + resyncPeriod, + indexers, + ) +} + +func (f *resourceSliceInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredResourceSliceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *resourceSliceInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apiresourcev1beta2.ResourceSlice{}, f.defaultInformer) +} + +func (f *resourceSliceInformer) Lister() resourcev1beta2.ResourceSliceLister { + return resourcev1beta2.NewResourceSliceLister(f.Informer().GetIndexer()) +} diff --git a/e2e/vendor/k8s.io/client-go/informers/scheduling/v1/priorityclass.go b/e2e/vendor/k8s.io/client-go/informers/scheduling/v1/priorityclass.go index 20b9fc0dc..df4263663 100644 --- a/e2e/vendor/k8s.io/client-go/informers/scheduling/v1/priorityclass.go +++ b/e2e/vendor/k8s.io/client-go/informers/scheduling/v1/priorityclass.go @@ -61,13 +61,25 @@ func NewFilteredPriorityClassInformer(client kubernetes.Interface, resyncPeriod if tweakListOptions != nil { tweakListOptions(&options) } - return client.SchedulingV1().PriorityClasses().List(context.TODO(), options) + return client.SchedulingV1().PriorityClasses().List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.SchedulingV1().PriorityClasses().Watch(context.TODO(), options) + return client.SchedulingV1().PriorityClasses().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SchedulingV1().PriorityClasses().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SchedulingV1().PriorityClasses().Watch(ctx, options) }, }, &apischedulingv1.PriorityClass{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/priorityclass.go b/e2e/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/priorityclass.go index 904bc6c4e..228240af1 100644 --- a/e2e/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/priorityclass.go +++ b/e2e/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/priorityclass.go @@ -61,13 +61,25 @@ func NewFilteredPriorityClassInformer(client kubernetes.Interface, resyncPeriod if tweakListOptions != nil { tweakListOptions(&options) } - return client.SchedulingV1alpha1().PriorityClasses().List(context.TODO(), options) + return client.SchedulingV1alpha1().PriorityClasses().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.SchedulingV1alpha1().PriorityClasses().Watch(context.TODO(), options) + return client.SchedulingV1alpha1().PriorityClasses().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SchedulingV1alpha1().PriorityClasses().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SchedulingV1alpha1().PriorityClasses().Watch(ctx, options) }, }, &apischedulingv1alpha1.PriorityClass{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/scheduling/v1beta1/priorityclass.go b/e2e/vendor/k8s.io/client-go/informers/scheduling/v1beta1/priorityclass.go index 299d37673..fd40bd086 100644 --- a/e2e/vendor/k8s.io/client-go/informers/scheduling/v1beta1/priorityclass.go +++ b/e2e/vendor/k8s.io/client-go/informers/scheduling/v1beta1/priorityclass.go @@ -61,13 +61,25 @@ func NewFilteredPriorityClassInformer(client kubernetes.Interface, resyncPeriod if tweakListOptions != nil { tweakListOptions(&options) } - return client.SchedulingV1beta1().PriorityClasses().List(context.TODO(), options) + return client.SchedulingV1beta1().PriorityClasses().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.SchedulingV1beta1().PriorityClasses().Watch(context.TODO(), options) + return client.SchedulingV1beta1().PriorityClasses().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SchedulingV1beta1().PriorityClasses().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SchedulingV1beta1().PriorityClasses().Watch(ctx, options) }, }, &apischedulingv1beta1.PriorityClass{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/storage/v1/csidriver.go b/e2e/vendor/k8s.io/client-go/informers/storage/v1/csidriver.go index 79282873b..b79a51ca0 100644 --- a/e2e/vendor/k8s.io/client-go/informers/storage/v1/csidriver.go +++ b/e2e/vendor/k8s.io/client-go/informers/storage/v1/csidriver.go @@ -61,13 +61,25 @@ func NewFilteredCSIDriverInformer(client kubernetes.Interface, resyncPeriod time if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1().CSIDrivers().List(context.TODO(), options) + return client.StorageV1().CSIDrivers().List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1().CSIDrivers().Watch(context.TODO(), options) + return client.StorageV1().CSIDrivers().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1().CSIDrivers().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1().CSIDrivers().Watch(ctx, options) }, }, &apistoragev1.CSIDriver{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/storage/v1/csinode.go b/e2e/vendor/k8s.io/client-go/informers/storage/v1/csinode.go index 00345f897..7a6040795 100644 --- a/e2e/vendor/k8s.io/client-go/informers/storage/v1/csinode.go +++ b/e2e/vendor/k8s.io/client-go/informers/storage/v1/csinode.go @@ -61,13 +61,25 @@ func NewFilteredCSINodeInformer(client kubernetes.Interface, resyncPeriod time.D if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1().CSINodes().List(context.TODO(), options) + return client.StorageV1().CSINodes().List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1().CSINodes().Watch(context.TODO(), options) + return client.StorageV1().CSINodes().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1().CSINodes().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1().CSINodes().Watch(ctx, options) }, }, &apistoragev1.CSINode{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/storage/v1/csistoragecapacity.go b/e2e/vendor/k8s.io/client-go/informers/storage/v1/csistoragecapacity.go index 5a72272fc..84ef70f2e 100644 --- a/e2e/vendor/k8s.io/client-go/informers/storage/v1/csistoragecapacity.go +++ b/e2e/vendor/k8s.io/client-go/informers/storage/v1/csistoragecapacity.go @@ -62,13 +62,25 @@ func NewFilteredCSIStorageCapacityInformer(client kubernetes.Interface, namespac if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1().CSIStorageCapacities(namespace).List(context.TODO(), options) + return client.StorageV1().CSIStorageCapacities(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1().CSIStorageCapacities(namespace).Watch(context.TODO(), options) + return client.StorageV1().CSIStorageCapacities(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1().CSIStorageCapacities(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1().CSIStorageCapacities(namespace).Watch(ctx, options) }, }, &apistoragev1.CSIStorageCapacity{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/storage/v1/storageclass.go b/e2e/vendor/k8s.io/client-go/informers/storage/v1/storageclass.go index 6eecc50f7..7f17ecf8c 100644 --- a/e2e/vendor/k8s.io/client-go/informers/storage/v1/storageclass.go +++ b/e2e/vendor/k8s.io/client-go/informers/storage/v1/storageclass.go @@ -61,13 +61,25 @@ func NewFilteredStorageClassInformer(client kubernetes.Interface, resyncPeriod t if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1().StorageClasses().List(context.TODO(), options) + return client.StorageV1().StorageClasses().List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1().StorageClasses().Watch(context.TODO(), options) + return client.StorageV1().StorageClasses().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1().StorageClasses().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1().StorageClasses().Watch(ctx, options) }, }, &apistoragev1.StorageClass{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/storage/v1/volumeattachment.go b/e2e/vendor/k8s.io/client-go/informers/storage/v1/volumeattachment.go index deca09cda..3dee340d5 100644 --- a/e2e/vendor/k8s.io/client-go/informers/storage/v1/volumeattachment.go +++ b/e2e/vendor/k8s.io/client-go/informers/storage/v1/volumeattachment.go @@ -61,13 +61,25 @@ func NewFilteredVolumeAttachmentInformer(client kubernetes.Interface, resyncPeri if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1().VolumeAttachments().List(context.TODO(), options) + return client.StorageV1().VolumeAttachments().List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1().VolumeAttachments().Watch(context.TODO(), options) + return client.StorageV1().VolumeAttachments().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1().VolumeAttachments().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1().VolumeAttachments().Watch(ctx, options) }, }, &apistoragev1.VolumeAttachment{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/storage/v1alpha1/csistoragecapacity.go b/e2e/vendor/k8s.io/client-go/informers/storage/v1alpha1/csistoragecapacity.go index 2253f700e..794de10db 100644 --- a/e2e/vendor/k8s.io/client-go/informers/storage/v1alpha1/csistoragecapacity.go +++ b/e2e/vendor/k8s.io/client-go/informers/storage/v1alpha1/csistoragecapacity.go @@ -62,13 +62,25 @@ func NewFilteredCSIStorageCapacityInformer(client kubernetes.Interface, namespac if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1alpha1().CSIStorageCapacities(namespace).List(context.TODO(), options) + return client.StorageV1alpha1().CSIStorageCapacities(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1alpha1().CSIStorageCapacities(namespace).Watch(context.TODO(), options) + return client.StorageV1alpha1().CSIStorageCapacities(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1alpha1().CSIStorageCapacities(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1alpha1().CSIStorageCapacities(namespace).Watch(ctx, options) }, }, &apistoragev1alpha1.CSIStorageCapacity{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattachment.go b/e2e/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattachment.go index f31989953..dc68be234 100644 --- a/e2e/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattachment.go +++ b/e2e/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattachment.go @@ -61,13 +61,25 @@ func NewFilteredVolumeAttachmentInformer(client kubernetes.Interface, resyncPeri if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1alpha1().VolumeAttachments().List(context.TODO(), options) + return client.StorageV1alpha1().VolumeAttachments().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1alpha1().VolumeAttachments().Watch(context.TODO(), options) + return client.StorageV1alpha1().VolumeAttachments().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1alpha1().VolumeAttachments().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1alpha1().VolumeAttachments().Watch(ctx, options) }, }, &apistoragev1alpha1.VolumeAttachment{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattributesclass.go b/e2e/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattributesclass.go index 8a688312a..5210ea79a 100644 --- a/e2e/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattributesclass.go +++ b/e2e/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattributesclass.go @@ -61,13 +61,25 @@ func NewFilteredVolumeAttributesClassInformer(client kubernetes.Interface, resyn if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1alpha1().VolumeAttributesClasses().List(context.TODO(), options) + return client.StorageV1alpha1().VolumeAttributesClasses().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1alpha1().VolumeAttributesClasses().Watch(context.TODO(), options) + return client.StorageV1alpha1().VolumeAttributesClasses().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1alpha1().VolumeAttributesClasses().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1alpha1().VolumeAttributesClasses().Watch(ctx, options) }, }, &apistoragev1alpha1.VolumeAttributesClass{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/csidriver.go b/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/csidriver.go index f538deed5..a21dc94ff 100644 --- a/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/csidriver.go +++ b/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/csidriver.go @@ -61,13 +61,25 @@ func NewFilteredCSIDriverInformer(client kubernetes.Interface, resyncPeriod time if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1beta1().CSIDrivers().List(context.TODO(), options) + return client.StorageV1beta1().CSIDrivers().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1beta1().CSIDrivers().Watch(context.TODO(), options) + return client.StorageV1beta1().CSIDrivers().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1beta1().CSIDrivers().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1beta1().CSIDrivers().Watch(ctx, options) }, }, &apistoragev1beta1.CSIDriver{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/csinode.go b/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/csinode.go index 5d26cffdc..e789fe309 100644 --- a/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/csinode.go +++ b/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/csinode.go @@ -61,13 +61,25 @@ func NewFilteredCSINodeInformer(client kubernetes.Interface, resyncPeriod time.D if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1beta1().CSINodes().List(context.TODO(), options) + return client.StorageV1beta1().CSINodes().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1beta1().CSINodes().Watch(context.TODO(), options) + return client.StorageV1beta1().CSINodes().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1beta1().CSINodes().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1beta1().CSINodes().Watch(ctx, options) }, }, &apistoragev1beta1.CSINode{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/csistoragecapacity.go b/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/csistoragecapacity.go index 9ad42e9f8..fa75b0b4f 100644 --- a/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/csistoragecapacity.go +++ b/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/csistoragecapacity.go @@ -62,13 +62,25 @@ func NewFilteredCSIStorageCapacityInformer(client kubernetes.Interface, namespac if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1beta1().CSIStorageCapacities(namespace).List(context.TODO(), options) + return client.StorageV1beta1().CSIStorageCapacities(namespace).List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1beta1().CSIStorageCapacities(namespace).Watch(context.TODO(), options) + return client.StorageV1beta1().CSIStorageCapacities(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1beta1().CSIStorageCapacities(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1beta1().CSIStorageCapacities(namespace).Watch(ctx, options) }, }, &apistoragev1beta1.CSIStorageCapacity{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/storageclass.go b/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/storageclass.go index 2d8649e9b..23d7ca4fc 100644 --- a/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/storageclass.go +++ b/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/storageclass.go @@ -61,13 +61,25 @@ func NewFilteredStorageClassInformer(client kubernetes.Interface, resyncPeriod t if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1beta1().StorageClasses().List(context.TODO(), options) + return client.StorageV1beta1().StorageClasses().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1beta1().StorageClasses().Watch(context.TODO(), options) + return client.StorageV1beta1().StorageClasses().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1beta1().StorageClasses().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1beta1().StorageClasses().Watch(ctx, options) }, }, &apistoragev1beta1.StorageClass{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattachment.go b/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattachment.go index 93d382693..691b2c6d1 100644 --- a/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattachment.go +++ b/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattachment.go @@ -61,13 +61,25 @@ func NewFilteredVolumeAttachmentInformer(client kubernetes.Interface, resyncPeri if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1beta1().VolumeAttachments().List(context.TODO(), options) + return client.StorageV1beta1().VolumeAttachments().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1beta1().VolumeAttachments().Watch(context.TODO(), options) + return client.StorageV1beta1().VolumeAttachments().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1beta1().VolumeAttachments().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1beta1().VolumeAttachments().Watch(ctx, options) }, }, &apistoragev1beta1.VolumeAttachment{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattributesclass.go b/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattributesclass.go index dd9734bdc..7d66c5815 100644 --- a/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattributesclass.go +++ b/e2e/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattributesclass.go @@ -61,13 +61,25 @@ func NewFilteredVolumeAttributesClassInformer(client kubernetes.Interface, resyn if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1beta1().VolumeAttributesClasses().List(context.TODO(), options) + return client.StorageV1beta1().VolumeAttributesClasses().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1beta1().VolumeAttributesClasses().Watch(context.TODO(), options) + return client.StorageV1beta1().VolumeAttributesClasses().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1beta1().VolumeAttributesClasses().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1beta1().VolumeAttributesClasses().Watch(ctx, options) }, }, &apistoragev1beta1.VolumeAttributesClass{}, diff --git a/e2e/vendor/k8s.io/client-go/informers/storagemigration/v1alpha1/storageversionmigration.go b/e2e/vendor/k8s.io/client-go/informers/storagemigration/v1alpha1/storageversionmigration.go index 49d6dd2e5..4debb5eef 100644 --- a/e2e/vendor/k8s.io/client-go/informers/storagemigration/v1alpha1/storageversionmigration.go +++ b/e2e/vendor/k8s.io/client-go/informers/storagemigration/v1alpha1/storageversionmigration.go @@ -61,13 +61,25 @@ func NewFilteredStorageVersionMigrationInformer(client kubernetes.Interface, res if tweakListOptions != nil { tweakListOptions(&options) } - return client.StoragemigrationV1alpha1().StorageVersionMigrations().List(context.TODO(), options) + return client.StoragemigrationV1alpha1().StorageVersionMigrations().List(context.Background(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StoragemigrationV1alpha1().StorageVersionMigrations().Watch(context.TODO(), options) + return client.StoragemigrationV1alpha1().StorageVersionMigrations().Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StoragemigrationV1alpha1().StorageVersionMigrations().List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StoragemigrationV1alpha1().StorageVersionMigrations().Watch(ctx, options) }, }, &apistoragemigrationv1alpha1.StorageVersionMigration{}, diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/clientset.go b/e2e/vendor/k8s.io/client-go/kubernetes/clientset.go index a6dbc23a9..b333d6b8a 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/clientset.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/clientset.go @@ -70,6 +70,7 @@ import ( rbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1" resourcev1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3" resourcev1beta1 "k8s.io/client-go/kubernetes/typed/resource/v1beta1" + resourcev1beta2 "k8s.io/client-go/kubernetes/typed/resource/v1beta2" schedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1" schedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1" @@ -128,6 +129,7 @@ type Interface interface { RbacV1() rbacv1.RbacV1Interface RbacV1beta1() rbacv1beta1.RbacV1beta1Interface RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface + ResourceV1beta2() resourcev1beta2.ResourceV1beta2Interface ResourceV1beta1() resourcev1beta1.ResourceV1beta1Interface ResourceV1alpha3() resourcev1alpha3.ResourceV1alpha3Interface SchedulingV1alpha1() schedulingv1alpha1.SchedulingV1alpha1Interface @@ -187,6 +189,7 @@ type Clientset struct { rbacV1 *rbacv1.RbacV1Client rbacV1beta1 *rbacv1beta1.RbacV1beta1Client rbacV1alpha1 *rbacv1alpha1.RbacV1alpha1Client + resourceV1beta2 *resourcev1beta2.ResourceV1beta2Client resourceV1beta1 *resourcev1beta1.ResourceV1beta1Client resourceV1alpha3 *resourcev1alpha3.ResourceV1alpha3Client schedulingV1alpha1 *schedulingv1alpha1.SchedulingV1alpha1Client @@ -423,6 +426,11 @@ func (c *Clientset) RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface { return c.rbacV1alpha1 } +// ResourceV1beta2 retrieves the ResourceV1beta2Client +func (c *Clientset) ResourceV1beta2() resourcev1beta2.ResourceV1beta2Interface { + return c.resourceV1beta2 +} + // ResourceV1beta1 retrieves the ResourceV1beta1Client func (c *Clientset) ResourceV1beta1() resourcev1beta1.ResourceV1beta1Interface { return c.resourceV1beta1 @@ -692,6 +700,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } + cs.resourceV1beta2, err = resourcev1beta2.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.resourceV1beta1, err = resourcev1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err @@ -794,6 +806,7 @@ func New(c rest.Interface) *Clientset { cs.rbacV1 = rbacv1.New(c) cs.rbacV1beta1 = rbacv1beta1.New(c) cs.rbacV1alpha1 = rbacv1alpha1.New(c) + cs.resourceV1beta2 = resourcev1beta2.New(c) cs.resourceV1beta1 = resourcev1beta1.New(c) cs.resourceV1alpha3 = resourcev1alpha3.New(c) cs.schedulingV1alpha1 = schedulingv1alpha1.New(c) diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/doc.go b/e2e/vendor/k8s.io/client-go/kubernetes/doc.go index e052f81b8..9cef4242f 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/doc.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/doc.go @@ -16,4 +16,4 @@ limitations under the License. // Package kubernetes holds packages which implement a clientset for Kubernetes // APIs. -package kubernetes // import "k8s.io/client-go/kubernetes" +package kubernetes diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go b/e2e/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go index 6b583818b..a454c6f19 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go @@ -19,6 +19,7 @@ limitations under the License. package fake import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" applyconfigurations "k8s.io/client-go/applyconfigurations" @@ -119,6 +120,8 @@ import ( fakeresourcev1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake" resourcev1beta1 "k8s.io/client-go/kubernetes/typed/resource/v1beta1" fakeresourcev1beta1 "k8s.io/client-go/kubernetes/typed/resource/v1beta1/fake" + resourcev1beta2 "k8s.io/client-go/kubernetes/typed/resource/v1beta2" + fakeresourcev1beta2 "k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake" schedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1" fakeschedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1/fake" schedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1" @@ -156,9 +159,13 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset { cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} cs.AddReactor("*", "*", testing.ObjectReaction(o)) cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + var opts metav1.ListOptions + if watchActcion, ok := action.(testing.WatchActionImpl); ok { + opts = watchActcion.ListOptions + } gvr := action.GetResource() ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) + watch, err := o.Watch(gvr, ns, opts) if err != nil { return false, nil, err } @@ -205,9 +212,13 @@ func NewClientset(objects ...runtime.Object) *Clientset { cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} cs.AddReactor("*", "*", testing.ObjectReaction(o)) cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + var opts metav1.ListOptions + if watchActcion, ok := action.(testing.WatchActionImpl); ok { + opts = watchActcion.ListOptions + } gvr := action.GetResource() ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) + watch, err := o.Watch(gvr, ns, opts) if err != nil { return false, nil, err } @@ -447,6 +458,11 @@ func (c *Clientset) RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface { return &fakerbacv1alpha1.FakeRbacV1alpha1{Fake: &c.Fake} } +// ResourceV1beta2 retrieves the ResourceV1beta2Client +func (c *Clientset) ResourceV1beta2() resourcev1beta2.ResourceV1beta2Interface { + return &fakeresourcev1beta2.FakeResourceV1beta2{Fake: &c.Fake} +} + // ResourceV1beta1 retrieves the ResourceV1beta1Client func (c *Clientset) ResourceV1beta1() resourcev1beta1.ResourceV1beta1Interface { return &fakeresourcev1beta1.FakeResourceV1beta1{Fake: &c.Fake} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/fake/register.go b/e2e/vendor/k8s.io/client-go/kubernetes/fake/register.go index 849b1ac90..1332509c1 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/fake/register.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/fake/register.go @@ -66,6 +66,7 @@ import ( rbacv1beta1 "k8s.io/api/rbac/v1beta1" resourcev1alpha3 "k8s.io/api/resource/v1alpha3" resourcev1beta1 "k8s.io/api/resource/v1beta1" + resourcev1beta2 "k8s.io/api/resource/v1beta2" schedulingv1 "k8s.io/api/scheduling/v1" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" @@ -129,6 +130,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ rbacv1.AddToScheme, rbacv1beta1.AddToScheme, rbacv1alpha1.AddToScheme, + resourcev1beta2.AddToScheme, resourcev1beta1.AddToScheme, resourcev1alpha3.AddToScheme, schedulingv1alpha1.AddToScheme, diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/import.go b/e2e/vendor/k8s.io/client-go/kubernetes/import.go index c4f9a91bc..93f3e4c6e 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/import.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/import.go @@ -16,4 +16,4 @@ limitations under the License. // This file exists to enforce this clientset's vanity import path. -package kubernetes // import "k8s.io/client-go/kubernetes" +package kubernetes diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/scheme/register.go b/e2e/vendor/k8s.io/client-go/kubernetes/scheme/register.go index a9a5d8eb7..e0dfc986f 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/scheme/register.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/scheme/register.go @@ -66,6 +66,7 @@ import ( rbacv1beta1 "k8s.io/api/rbac/v1beta1" resourcev1alpha3 "k8s.io/api/resource/v1alpha3" resourcev1beta1 "k8s.io/api/resource/v1beta1" + resourcev1beta2 "k8s.io/api/resource/v1beta2" schedulingv1 "k8s.io/api/scheduling/v1" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" @@ -129,6 +130,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ rbacv1.AddToScheme, rbacv1beta1.AddToScheme, rbacv1alpha1.AddToScheme, + resourcev1beta2.AddToScheme, resourcev1beta1.AddToScheme, resourcev1alpha3.AddToScheme, schedulingv1alpha1.AddToScheme, diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/admissionregistration_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/admissionregistration_client.go index 74d2967f6..859ad913b 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/admissionregistration_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/admissionregistration_client.go @@ -60,9 +60,7 @@ func (c *AdmissionregistrationV1Client) ValidatingWebhookConfigurations() Valida // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AdmissionregistrationV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -74,9 +72,7 @@ func NewForConfig(c *rest.Config) (*AdmissionregistrationV1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AdmissionregistrationV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -99,7 +95,7 @@ func New(c rest.Interface) *AdmissionregistrationV1Client { return &AdmissionregistrationV1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := admissionregistrationv1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -108,8 +104,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go index f8a67c6d8..8ffb7da7f 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go @@ -60,9 +60,7 @@ func (c *AdmissionregistrationV1alpha1Client) ValidatingAdmissionPolicyBindings( // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AdmissionregistrationV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -74,9 +72,7 @@ func NewForConfig(c *rest.Config) (*AdmissionregistrationV1alpha1Client, error) // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AdmissionregistrationV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -99,7 +95,7 @@ func New(c rest.Interface) *AdmissionregistrationV1alpha1Client { return &AdmissionregistrationV1alpha1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := admissionregistrationv1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -108,8 +104,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/admissionregistration_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/admissionregistration_client.go index 16c42b0ec..cfb825359 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/admissionregistration_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/admissionregistration_client.go @@ -60,9 +60,7 @@ func (c *AdmissionregistrationV1beta1Client) ValidatingWebhookConfigurations() V // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AdmissionregistrationV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -74,9 +72,7 @@ func NewForConfig(c *rest.Config) (*AdmissionregistrationV1beta1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AdmissionregistrationV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -99,7 +95,7 @@ func New(c rest.Interface) *AdmissionregistrationV1beta1Client { return &AdmissionregistrationV1beta1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := admissionregistrationv1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -108,8 +104,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/apiserverinternal_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/apiserverinternal_client.go index b76fadf91..2ea2568bf 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/apiserverinternal_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/apiserverinternal_client.go @@ -45,9 +45,7 @@ func (c *InternalV1alpha1Client) StorageVersions() StorageVersionInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*InternalV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*InternalV1alpha1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*InternalV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *InternalV1alpha1Client { return &InternalV1alpha1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := apiserverinternalv1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/apps_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/apps_client.go index cb0bf87ba..7371f6265 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/apps_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/apps_client.go @@ -65,9 +65,7 @@ func (c *AppsV1Client) StatefulSets(namespace string) StatefulSetInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AppsV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -79,9 +77,7 @@ func NewForConfig(c *rest.Config) (*AppsV1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AppsV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -104,7 +100,7 @@ func New(c rest.Interface) *AppsV1Client { return &AppsV1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := appsv1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -113,8 +109,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/apps_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/apps_client.go index 72bde633b..02e09bdda 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/apps_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/apps_client.go @@ -55,9 +55,7 @@ func (c *AppsV1beta1Client) StatefulSets(namespace string) StatefulSetInterface // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AppsV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -69,9 +67,7 @@ func NewForConfig(c *rest.Config) (*AppsV1beta1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AppsV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -94,7 +90,7 @@ func New(c rest.Interface) *AppsV1beta1Client { return &AppsV1beta1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := appsv1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -103,8 +99,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/apps_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/apps_client.go index e13d12a76..28309fa6a 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/apps_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/apps_client.go @@ -65,9 +65,7 @@ func (c *AppsV1beta2Client) StatefulSets(namespace string) StatefulSetInterface // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AppsV1beta2Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -79,9 +77,7 @@ func NewForConfig(c *rest.Config) (*AppsV1beta2Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AppsV1beta2Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -104,7 +100,7 @@ func New(c rest.Interface) *AppsV1beta2Client { return &AppsV1beta2Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := appsv1beta2.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -113,8 +109,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/authentication_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/authentication_client.go index bd5df7798..d030dae32 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/authentication_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/authentication_client.go @@ -50,9 +50,7 @@ func (c *AuthenticationV1Client) TokenReviews() TokenReviewInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AuthenticationV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -64,9 +62,7 @@ func NewForConfig(c *rest.Config) (*AuthenticationV1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AuthenticationV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -89,7 +85,7 @@ func New(c rest.Interface) *AuthenticationV1Client { return &AuthenticationV1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := authenticationv1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -98,8 +94,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/authentication_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/authentication_client.go index 821265859..d317d7f9b 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/authentication_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/authentication_client.go @@ -45,9 +45,7 @@ func (c *AuthenticationV1alpha1Client) SelfSubjectReviews() SelfSubjectReviewInt // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AuthenticationV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*AuthenticationV1alpha1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AuthenticationV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *AuthenticationV1alpha1Client { return &AuthenticationV1alpha1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := authenticationv1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/authentication_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/authentication_client.go index 7b22e46e3..b8c8eab7f 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/authentication_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/authentication_client.go @@ -50,9 +50,7 @@ func (c *AuthenticationV1beta1Client) TokenReviews() TokenReviewInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AuthenticationV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -64,9 +62,7 @@ func NewForConfig(c *rest.Config) (*AuthenticationV1beta1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AuthenticationV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -89,7 +85,7 @@ func New(c rest.Interface) *AuthenticationV1beta1Client { return &AuthenticationV1beta1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := authenticationv1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -98,8 +94,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/authorization_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/authorization_client.go index 71fb89b38..5c290f9f3 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/authorization_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/authorization_client.go @@ -60,9 +60,7 @@ func (c *AuthorizationV1Client) SubjectAccessReviews() SubjectAccessReviewInterf // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AuthorizationV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -74,9 +72,7 @@ func NewForConfig(c *rest.Config) (*AuthorizationV1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AuthorizationV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -99,7 +95,7 @@ func New(c rest.Interface) *AuthorizationV1Client { return &AuthorizationV1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := authorizationv1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -108,8 +104,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/authorization_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/authorization_client.go index f33619eb3..648e69225 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/authorization_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/authorization_client.go @@ -60,9 +60,7 @@ func (c *AuthorizationV1beta1Client) SubjectAccessReviews() SubjectAccessReviewI // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AuthorizationV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -74,9 +72,7 @@ func NewForConfig(c *rest.Config) (*AuthorizationV1beta1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AuthorizationV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -99,7 +95,7 @@ func New(c rest.Interface) *AuthorizationV1beta1Client { return &AuthorizationV1beta1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := authorizationv1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -108,8 +104,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/autoscaling_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/autoscaling_client.go index 6ceaaf82a..4f7de82a0 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/autoscaling_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/autoscaling_client.go @@ -45,9 +45,7 @@ func (c *AutoscalingV1Client) HorizontalPodAutoscalers(namespace string) Horizon // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AutoscalingV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*AutoscalingV1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AutoscalingV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *AutoscalingV1Client { return &AutoscalingV1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := autoscalingv1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2/autoscaling_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2/autoscaling_client.go index 78a2609bf..bedc3d8a1 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2/autoscaling_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2/autoscaling_client.go @@ -45,9 +45,7 @@ func (c *AutoscalingV2Client) HorizontalPodAutoscalers(namespace string) Horizon // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AutoscalingV2Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*AutoscalingV2Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AutoscalingV2Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *AutoscalingV2Client { return &AutoscalingV2Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := autoscalingv2.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/autoscaling_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/autoscaling_client.go index 1fcda17c8..25e38f371 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/autoscaling_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/autoscaling_client.go @@ -45,9 +45,7 @@ func (c *AutoscalingV2beta1Client) HorizontalPodAutoscalers(namespace string) Ho // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AutoscalingV2beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*AutoscalingV2beta1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AutoscalingV2beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *AutoscalingV2beta1Client { return &AutoscalingV2beta1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := autoscalingv2beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/autoscaling_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/autoscaling_client.go index 62f5b743c..21626e5ce 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/autoscaling_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/autoscaling_client.go @@ -45,9 +45,7 @@ func (c *AutoscalingV2beta2Client) HorizontalPodAutoscalers(namespace string) Ho // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*AutoscalingV2beta2Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*AutoscalingV2beta2Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AutoscalingV2beta2Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *AutoscalingV2beta2Client { return &AutoscalingV2beta2Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := autoscalingv2beta2.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/batch_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/batch_client.go index 614d049f3..56deda20c 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/batch_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/batch_client.go @@ -50,9 +50,7 @@ func (c *BatchV1Client) Jobs(namespace string) JobInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*BatchV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -64,9 +62,7 @@ func NewForConfig(c *rest.Config) (*BatchV1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*BatchV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -89,7 +85,7 @@ func New(c rest.Interface) *BatchV1Client { return &BatchV1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := batchv1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -98,8 +94,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/batch_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/batch_client.go index 2da9e4135..9de08074f 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/batch_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/batch_client.go @@ -45,9 +45,7 @@ func (c *BatchV1beta1Client) CronJobs(namespace string) CronJobInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*BatchV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*BatchV1beta1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*BatchV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *BatchV1beta1Client { return &BatchV1beta1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := batchv1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/certificates_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/certificates_client.go index 60337cd23..a13c3559d 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/certificates_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/certificates_client.go @@ -45,9 +45,7 @@ func (c *CertificatesV1Client) CertificateSigningRequests() CertificateSigningRe // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*CertificatesV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*CertificatesV1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CertificatesV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *CertificatesV1Client { return &CertificatesV1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := certificatesv1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificates_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificates_client.go index 36e08253a..163ddad01 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificates_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificates_client.go @@ -45,9 +45,7 @@ func (c *CertificatesV1alpha1Client) ClusterTrustBundles() ClusterTrustBundleInt // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*CertificatesV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*CertificatesV1alpha1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CertificatesV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *CertificatesV1alpha1Client { return &CertificatesV1alpha1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := certificatesv1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificates_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificates_client.go index f040e7664..8de95609f 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificates_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificates_client.go @@ -29,6 +29,7 @@ import ( type CertificatesV1beta1Interface interface { RESTClient() rest.Interface CertificateSigningRequestsGetter + ClusterTrustBundlesGetter } // CertificatesV1beta1Client is used to interact with features provided by the certificates.k8s.io group. @@ -40,14 +41,16 @@ func (c *CertificatesV1beta1Client) CertificateSigningRequests() CertificateSign return newCertificateSigningRequests(c) } +func (c *CertificatesV1beta1Client) ClusterTrustBundles() ClusterTrustBundleInterface { + return newClusterTrustBundles(c) +} + // NewForConfig creates a new CertificatesV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*CertificatesV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +62,7 @@ func NewForConfig(c *rest.Config) (*CertificatesV1beta1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CertificatesV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +85,7 @@ func New(c rest.Interface) *CertificatesV1beta1Client { return &CertificatesV1beta1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := certificatesv1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +94,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/clustertrustbundle.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/clustertrustbundle.go new file mode 100644 index 000000000..c4d93d7b2 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/clustertrustbundle.go @@ -0,0 +1,73 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + context "context" + + certificatesv1beta1 "k8s.io/api/certificates/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationscertificatesv1beta1 "k8s.io/client-go/applyconfigurations/certificates/v1beta1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// ClusterTrustBundlesGetter has a method to return a ClusterTrustBundleInterface. +// A group's client should implement this interface. +type ClusterTrustBundlesGetter interface { + ClusterTrustBundles() ClusterTrustBundleInterface +} + +// ClusterTrustBundleInterface has methods to work with ClusterTrustBundle resources. +type ClusterTrustBundleInterface interface { + Create(ctx context.Context, clusterTrustBundle *certificatesv1beta1.ClusterTrustBundle, opts v1.CreateOptions) (*certificatesv1beta1.ClusterTrustBundle, error) + Update(ctx context.Context, clusterTrustBundle *certificatesv1beta1.ClusterTrustBundle, opts v1.UpdateOptions) (*certificatesv1beta1.ClusterTrustBundle, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*certificatesv1beta1.ClusterTrustBundle, error) + List(ctx context.Context, opts v1.ListOptions) (*certificatesv1beta1.ClusterTrustBundleList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *certificatesv1beta1.ClusterTrustBundle, err error) + Apply(ctx context.Context, clusterTrustBundle *applyconfigurationscertificatesv1beta1.ClusterTrustBundleApplyConfiguration, opts v1.ApplyOptions) (result *certificatesv1beta1.ClusterTrustBundle, err error) + ClusterTrustBundleExpansion +} + +// clusterTrustBundles implements ClusterTrustBundleInterface +type clusterTrustBundles struct { + *gentype.ClientWithListAndApply[*certificatesv1beta1.ClusterTrustBundle, *certificatesv1beta1.ClusterTrustBundleList, *applyconfigurationscertificatesv1beta1.ClusterTrustBundleApplyConfiguration] +} + +// newClusterTrustBundles returns a ClusterTrustBundles +func newClusterTrustBundles(c *CertificatesV1beta1Client) *clusterTrustBundles { + return &clusterTrustBundles{ + gentype.NewClientWithListAndApply[*certificatesv1beta1.ClusterTrustBundle, *certificatesv1beta1.ClusterTrustBundleList, *applyconfigurationscertificatesv1beta1.ClusterTrustBundleApplyConfiguration]( + "clustertrustbundles", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *certificatesv1beta1.ClusterTrustBundle { return &certificatesv1beta1.ClusterTrustBundle{} }, + func() *certificatesv1beta1.ClusterTrustBundleList { + return &certificatesv1beta1.ClusterTrustBundleList{} + }, + gentype.PrefersProtobuf[*certificatesv1beta1.ClusterTrustBundle](), + ), + } +} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificates_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificates_client.go index 313df7abd..fba168ea1 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificates_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificates_client.go @@ -32,6 +32,10 @@ func (c *FakeCertificatesV1beta1) CertificateSigningRequests() v1beta1.Certifica return newFakeCertificateSigningRequests(c) } +func (c *FakeCertificatesV1beta1) ClusterTrustBundles() v1beta1.ClusterTrustBundleInterface { + return newFakeClusterTrustBundles(c) +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeCertificatesV1beta1) RESTClient() rest.Interface { diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_clustertrustbundle.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_clustertrustbundle.go new file mode 100644 index 000000000..ff88f7353 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_clustertrustbundle.go @@ -0,0 +1,53 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1beta1 "k8s.io/api/certificates/v1beta1" + certificatesv1beta1 "k8s.io/client-go/applyconfigurations/certificates/v1beta1" + gentype "k8s.io/client-go/gentype" + typedcertificatesv1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1" +) + +// fakeClusterTrustBundles implements ClusterTrustBundleInterface +type fakeClusterTrustBundles struct { + *gentype.FakeClientWithListAndApply[*v1beta1.ClusterTrustBundle, *v1beta1.ClusterTrustBundleList, *certificatesv1beta1.ClusterTrustBundleApplyConfiguration] + Fake *FakeCertificatesV1beta1 +} + +func newFakeClusterTrustBundles(fake *FakeCertificatesV1beta1) typedcertificatesv1beta1.ClusterTrustBundleInterface { + return &fakeClusterTrustBundles{ + gentype.NewFakeClientWithListAndApply[*v1beta1.ClusterTrustBundle, *v1beta1.ClusterTrustBundleList, *certificatesv1beta1.ClusterTrustBundleApplyConfiguration]( + fake.Fake, + "", + v1beta1.SchemeGroupVersion.WithResource("clustertrustbundles"), + v1beta1.SchemeGroupVersion.WithKind("ClusterTrustBundle"), + func() *v1beta1.ClusterTrustBundle { return &v1beta1.ClusterTrustBundle{} }, + func() *v1beta1.ClusterTrustBundleList { return &v1beta1.ClusterTrustBundleList{} }, + func(dst, src *v1beta1.ClusterTrustBundleList) { dst.ListMeta = src.ListMeta }, + func(list *v1beta1.ClusterTrustBundleList) []*v1beta1.ClusterTrustBundle { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1beta1.ClusterTrustBundleList, items []*v1beta1.ClusterTrustBundle) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/generated_expansion.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/generated_expansion.go index f6df76963..408936e06 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/generated_expansion.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/generated_expansion.go @@ -17,3 +17,5 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. package v1beta1 + +type ClusterTrustBundleExpansion interface{} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/coordination_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/coordination_client.go index 427cb7e93..52cfcca05 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/coordination_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/coordination_client.go @@ -45,9 +45,7 @@ func (c *CoordinationV1Client) Leases(namespace string) LeaseInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*CoordinationV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*CoordinationV1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CoordinationV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *CoordinationV1Client { return &CoordinationV1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := coordinationv1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha2/coordination_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha2/coordination_client.go index 4c286d463..2fd87f68e 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha2/coordination_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha2/coordination_client.go @@ -45,9 +45,7 @@ func (c *CoordinationV1alpha2Client) LeaseCandidates(namespace string) LeaseCand // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*CoordinationV1alpha2Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*CoordinationV1alpha2Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CoordinationV1alpha2Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *CoordinationV1alpha2Client { return &CoordinationV1alpha2Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := coordinationv1alpha2.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/coordination_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/coordination_client.go index 1f1afba24..fa0af1c0a 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/coordination_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/coordination_client.go @@ -29,6 +29,7 @@ import ( type CoordinationV1beta1Interface interface { RESTClient() rest.Interface LeasesGetter + LeaseCandidatesGetter } // CoordinationV1beta1Client is used to interact with features provided by the coordination.k8s.io group. @@ -40,14 +41,16 @@ func (c *CoordinationV1beta1Client) Leases(namespace string) LeaseInterface { return newLeases(c, namespace) } +func (c *CoordinationV1beta1Client) LeaseCandidates(namespace string) LeaseCandidateInterface { + return newLeaseCandidates(c, namespace) +} + // NewForConfig creates a new CoordinationV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*CoordinationV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +62,7 @@ func NewForConfig(c *rest.Config) (*CoordinationV1beta1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CoordinationV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +85,7 @@ func New(c rest.Interface) *CoordinationV1beta1Client { return &CoordinationV1beta1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := coordinationv1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +94,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_coordination_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_coordination_client.go index 41b3ce06b..c4eca7ecd 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_coordination_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_coordination_client.go @@ -32,6 +32,10 @@ func (c *FakeCoordinationV1beta1) Leases(namespace string) v1beta1.LeaseInterfac return newFakeLeases(c, namespace) } +func (c *FakeCoordinationV1beta1) LeaseCandidates(namespace string) v1beta1.LeaseCandidateInterface { + return newFakeLeaseCandidates(c, namespace) +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeCoordinationV1beta1) RESTClient() rest.Interface { diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_leasecandidate.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_leasecandidate.go new file mode 100644 index 000000000..bd5587b92 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_leasecandidate.go @@ -0,0 +1,53 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1beta1 "k8s.io/api/coordination/v1beta1" + coordinationv1beta1 "k8s.io/client-go/applyconfigurations/coordination/v1beta1" + gentype "k8s.io/client-go/gentype" + typedcoordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1" +) + +// fakeLeaseCandidates implements LeaseCandidateInterface +type fakeLeaseCandidates struct { + *gentype.FakeClientWithListAndApply[*v1beta1.LeaseCandidate, *v1beta1.LeaseCandidateList, *coordinationv1beta1.LeaseCandidateApplyConfiguration] + Fake *FakeCoordinationV1beta1 +} + +func newFakeLeaseCandidates(fake *FakeCoordinationV1beta1, namespace string) typedcoordinationv1beta1.LeaseCandidateInterface { + return &fakeLeaseCandidates{ + gentype.NewFakeClientWithListAndApply[*v1beta1.LeaseCandidate, *v1beta1.LeaseCandidateList, *coordinationv1beta1.LeaseCandidateApplyConfiguration]( + fake.Fake, + namespace, + v1beta1.SchemeGroupVersion.WithResource("leasecandidates"), + v1beta1.SchemeGroupVersion.WithKind("LeaseCandidate"), + func() *v1beta1.LeaseCandidate { return &v1beta1.LeaseCandidate{} }, + func() *v1beta1.LeaseCandidateList { return &v1beta1.LeaseCandidateList{} }, + func(dst, src *v1beta1.LeaseCandidateList) { dst.ListMeta = src.ListMeta }, + func(list *v1beta1.LeaseCandidateList) []*v1beta1.LeaseCandidate { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1beta1.LeaseCandidateList, items []*v1beta1.LeaseCandidate) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/generated_expansion.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/generated_expansion.go index dfd180daf..a341e2aff 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/generated_expansion.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/generated_expansion.go @@ -19,3 +19,5 @@ limitations under the License. package v1beta1 type LeaseExpansion interface{} + +type LeaseCandidateExpansion interface{} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/leasecandidate.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/leasecandidate.go new file mode 100644 index 000000000..505be1be0 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/leasecandidate.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + context "context" + + coordinationv1beta1 "k8s.io/api/coordination/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationscoordinationv1beta1 "k8s.io/client-go/applyconfigurations/coordination/v1beta1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// LeaseCandidatesGetter has a method to return a LeaseCandidateInterface. +// A group's client should implement this interface. +type LeaseCandidatesGetter interface { + LeaseCandidates(namespace string) LeaseCandidateInterface +} + +// LeaseCandidateInterface has methods to work with LeaseCandidate resources. +type LeaseCandidateInterface interface { + Create(ctx context.Context, leaseCandidate *coordinationv1beta1.LeaseCandidate, opts v1.CreateOptions) (*coordinationv1beta1.LeaseCandidate, error) + Update(ctx context.Context, leaseCandidate *coordinationv1beta1.LeaseCandidate, opts v1.UpdateOptions) (*coordinationv1beta1.LeaseCandidate, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*coordinationv1beta1.LeaseCandidate, error) + List(ctx context.Context, opts v1.ListOptions) (*coordinationv1beta1.LeaseCandidateList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *coordinationv1beta1.LeaseCandidate, err error) + Apply(ctx context.Context, leaseCandidate *applyconfigurationscoordinationv1beta1.LeaseCandidateApplyConfiguration, opts v1.ApplyOptions) (result *coordinationv1beta1.LeaseCandidate, err error) + LeaseCandidateExpansion +} + +// leaseCandidates implements LeaseCandidateInterface +type leaseCandidates struct { + *gentype.ClientWithListAndApply[*coordinationv1beta1.LeaseCandidate, *coordinationv1beta1.LeaseCandidateList, *applyconfigurationscoordinationv1beta1.LeaseCandidateApplyConfiguration] +} + +// newLeaseCandidates returns a LeaseCandidates +func newLeaseCandidates(c *CoordinationV1beta1Client, namespace string) *leaseCandidates { + return &leaseCandidates{ + gentype.NewClientWithListAndApply[*coordinationv1beta1.LeaseCandidate, *coordinationv1beta1.LeaseCandidateList, *applyconfigurationscoordinationv1beta1.LeaseCandidateApplyConfiguration]( + "leasecandidates", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *coordinationv1beta1.LeaseCandidate { return &coordinationv1beta1.LeaseCandidate{} }, + func() *coordinationv1beta1.LeaseCandidateList { return &coordinationv1beta1.LeaseCandidateList{} }, + gentype.PrefersProtobuf[*coordinationv1beta1.LeaseCandidate](), + ), + } +} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/core/v1/core_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/core/v1/core_client.go index abf85cba6..0a9380cf8 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/core/v1/core_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/core/v1/core_client.go @@ -120,9 +120,7 @@ func (c *CoreV1Client) ServiceAccounts(namespace string) ServiceAccountInterface // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*CoreV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -134,9 +132,7 @@ func NewForConfig(c *rest.Config) (*CoreV1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CoreV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -159,7 +155,7 @@ func New(c rest.Interface) *CoreV1Client { return &CoreV1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := corev1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/api" @@ -168,8 +164,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event_expansion.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event_expansion.go index 424357232..ddecf93b1 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event_expansion.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event_expansion.go @@ -31,13 +31,29 @@ import ( // 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. + // + // Deprecated: use CreateWithEventNamespaceWithContext instead. CreateWithEventNamespace(event *v1.Event) (*v1.Event, error) // UpdateWithEventNamespace is the same as a Update, except that it sends the request to the event.Namespace. + // + // Deprecated: use UpdateWithEventNamespaceWithContext instead. UpdateWithEventNamespace(event *v1.Event) (*v1.Event, error) // PatchWithEventNamespace is the same as a Patch, except that it sends the request to the event.Namespace. + // + // Deprecated: use PatchWithEventNamespaceWithContext instead. PatchWithEventNamespace(event *v1.Event, data []byte) (*v1.Event, error) // Search finds events about the specified object + // + // Deprecated: use SearchWithContext instead. Search(scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.EventList, error) + // CreateWithEventNamespaceWithContext is the same as a Create, except that it sends the request to the event.Namespace. + CreateWithEventNamespaceWithContext(ctx context.Context, event *v1.Event) (*v1.Event, error) + // UpdateWithEventNamespaceWithContext is the same as a Update, except that it sends the request to the event.Namespace. + UpdateWithEventNamespaceWithContext(ctx context.Context, event *v1.Event) (*v1.Event, error) + // PatchWithEventNamespaceWithContext is the same as a Patch, except that it sends the request to the event.Namespace. + PatchWithEventNamespaceWithContext(ctx context.Context, event *v1.Event, data []byte) (*v1.Event, error) + // SearchWithContext finds events about the specified object + SearchWithContext(ctx context.Context, scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.EventList, error) // Returns the appropriate field selector based on the API version being used to communicate with the server. // The returned field selector can be used with List and Watch to filter desired events. GetFieldSelector(involvedObjectName, involvedObjectNamespace, involvedObjectKind, involvedObjectUID *string) fields.Selector @@ -47,7 +63,17 @@ type EventExpansion interface { // or an error. The namespace to create the event within is deduced from the // event; it must either match this event client's namespace, or this event // client must have been created with the "" namespace. +// +// Deprecated: use CreateWithEventNamespaceWithContext instead. func (e *events) CreateWithEventNamespace(event *v1.Event) (*v1.Event, error) { + return e.CreateWithEventNamespaceWithContext(context.Background(), event) +} + +// CreateWithEventNamespaceWithContext makes a new event. Returns the copy of the event the server returns, +// or an error. The namespace to create the event within is deduced from the +// event; it must either match this event client's namespace, or this event +// client must have been created with the "" namespace. +func (e *events) CreateWithEventNamespaceWithContext(ctx context.Context, event *v1.Event) (*v1.Event, error) { if e.GetNamespace() != "" && event.Namespace != e.GetNamespace() { return nil, fmt.Errorf("can't create an event with namespace '%v' in namespace '%v'", event.Namespace, e.GetNamespace()) } @@ -56,7 +82,7 @@ func (e *events) CreateWithEventNamespace(event *v1.Event) (*v1.Event, error) { NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0). Resource("events"). Body(event). - Do(context.TODO()). + Do(ctx). Into(result) return result, err } @@ -66,7 +92,18 @@ func (e *events) CreateWithEventNamespace(event *v1.Event) (*v1.Event, error) { // namespace must either match this event client's namespace, or this event client must have been // created with the "" namespace. Update also requires the ResourceVersion to be set in the event // object. +// +// Deprecated: use UpdateWithEventNamespaceWithContext instead. func (e *events) UpdateWithEventNamespace(event *v1.Event) (*v1.Event, error) { + return e.UpdateWithEventNamespaceWithContext(context.Background(), event) +} + +// UpdateWithEventNamespaceWithContext modifies an existing event. It returns the copy of the event that the server returns, +// or an error. The namespace and key to update the event within is deduced from the event. The +// namespace must either match this event client's namespace, or this event client must have been +// created with the "" namespace. Update also requires the ResourceVersion to be set in the event +// object. +func (e *events) UpdateWithEventNamespaceWithContext(ctx context.Context, event *v1.Event) (*v1.Event, error) { if e.GetNamespace() != "" && event.Namespace != e.GetNamespace() { return nil, fmt.Errorf("can't update an event with namespace '%v' in namespace '%v'", event.Namespace, e.GetNamespace()) } @@ -76,7 +113,7 @@ func (e *events) UpdateWithEventNamespace(event *v1.Event) (*v1.Event, error) { Resource("events"). Name(event.Name). Body(event). - Do(context.TODO()). + Do(ctx). Into(result) return result, err } @@ -86,7 +123,18 @@ func (e *events) UpdateWithEventNamespace(event *v1.Event) (*v1.Event, error) { // target event is deduced from the incompleteEvent. The namespace must either // match this event client's namespace, or this event client must have been // created with the "" namespace. +// +// Deprecated: use PatchWithEventNamespaceWithContext instead. func (e *events) PatchWithEventNamespace(incompleteEvent *v1.Event, data []byte) (*v1.Event, error) { + return e.PatchWithEventNamespaceWithContext(context.Background(), incompleteEvent, data) +} + +// PatchWithEventNamespaceWithContext modifies an existing event. It returns the copy of +// the event that the server returns, or an error. The namespace and name of the +// target event is deduced from the incompleteEvent. The namespace must either +// match this event client's namespace, or this event client must have been +// created with the "" namespace. +func (e *events) PatchWithEventNamespaceWithContext(ctx context.Context, incompleteEvent *v1.Event, data []byte) (*v1.Event, error) { if e.GetNamespace() != "" && incompleteEvent.Namespace != e.GetNamespace() { return nil, fmt.Errorf("can't patch an event with namespace '%v' in namespace '%v'", incompleteEvent.Namespace, e.GetNamespace()) } @@ -96,7 +144,7 @@ func (e *events) PatchWithEventNamespace(incompleteEvent *v1.Event, data []byte) Resource("events"). Name(incompleteEvent.Name). Body(data). - Do(context.TODO()). + Do(ctx). Into(result) return result, err } @@ -104,7 +152,16 @@ func (e *events) PatchWithEventNamespace(incompleteEvent *v1.Event, data []byte) // Search finds events about the specified object. The namespace of the // object must match this event's client namespace unless the event client // was made with the "" namespace. +// +// Deprecated: use SearchWithContext instead. func (e *events) Search(scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.EventList, error) { + return e.SearchWithContext(context.Background(), scheme, objOrRef) +} + +// SearchWithContext finds events about the specified object. The namespace of the +// object must match this event's client namespace unless the event client +// was made with the "" namespace. +func (e *events) SearchWithContext(ctx context.Context, scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.EventList, error) { ref, err := ref.GetReference(scheme, objOrRef) if err != nil { return nil, err @@ -123,7 +180,7 @@ func (e *events) Search(scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.Ev refUID = &stringRefUID } fieldSelector := e.GetFieldSelector(&ref.Name, &ref.Namespace, refKind, refUID) - return e.List(context.TODO(), metav1.ListOptions{FieldSelector: fieldSelector.String()}) + return e.List(ctx, metav1.ListOptions{FieldSelector: fieldSelector.String()}) } // Returns the appropriate field selector based on the API version being used to communicate with the server. diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event_expansion.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event_expansion.go index 3840f6323..944d6808d 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event_expansion.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event_expansion.go @@ -17,6 +17,8 @@ limitations under the License. package fake import ( + "context" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" @@ -25,7 +27,12 @@ import ( core "k8s.io/client-go/testing" ) +// Deprecated: use CreateWithEventNamespaceWithContext instead. func (c *fakeEvents) CreateWithEventNamespace(event *v1.Event) (*v1.Event, error) { + return c.CreateWithEventNamespaceWithContext(context.Background(), event) +} + +func (c *fakeEvents) CreateWithEventNamespaceWithContext(_ context.Context, event *v1.Event) (*v1.Event, error) { var action core.CreateActionImpl if c.Namespace() != "" { action = core.NewCreateAction(c.Resource(), c.Namespace(), event) @@ -41,7 +48,14 @@ func (c *fakeEvents) CreateWithEventNamespace(event *v1.Event) (*v1.Event, error } // Update replaces an existing event. Returns the copy of the event the server returns, or an error. +// +// Deprecated: use UpdateWithEventNamespaceWithContext instead. func (c *fakeEvents) UpdateWithEventNamespace(event *v1.Event) (*v1.Event, error) { + return c.UpdateWithEventNamespaceWithContext(context.Background(), event) +} + +// Update replaces an existing event. Returns the copy of the event the server returns, or an error. +func (c *fakeEvents) UpdateWithEventNamespaceWithContext(_ context.Context, event *v1.Event) (*v1.Event, error) { var action core.UpdateActionImpl if c.Namespace() != "" { action = core.NewUpdateAction(c.Resource(), c.Namespace(), event) @@ -58,7 +72,15 @@ func (c *fakeEvents) UpdateWithEventNamespace(event *v1.Event) (*v1.Event, error // PatchWithEventNamespace patches an existing event. Returns the copy of the event the server returns, or an error. // TODO: Should take a PatchType as an argument probably. +// +// Deprecated: use PatchWithEventNamespaceWithContext instead. func (c *fakeEvents) PatchWithEventNamespace(event *v1.Event, data []byte) (*v1.Event, error) { + return c.PatchWithEventNamespaceWithContext(context.Background(), event, data) +} + +// PatchWithEventNamespaceWithContext patches an existing event. Returns the copy of the event the server returns, or an error. +// TODO: Should take a PatchType as an argument probably. +func (c *fakeEvents) PatchWithEventNamespaceWithContext(_ context.Context, event *v1.Event, data []byte) (*v1.Event, error) { // TODO: Should be configurable to support additional patch strategies. pt := types.StrategicMergePatchType var action core.PatchActionImpl @@ -76,7 +98,14 @@ func (c *fakeEvents) PatchWithEventNamespace(event *v1.Event, data []byte) (*v1. } // Search returns a list of events matching the specified object. +// +// Deprecated: use SearchWithContext instead. func (c *fakeEvents) Search(scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.EventList, error) { + return c.SearchWithContext(context.Background(), scheme, objOrRef) +} + +// SearchWithContext returns a list of events matching the specified object. +func (c *fakeEvents) SearchWithContext(_ context.Context, scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.EventList, error) { var action core.ListActionImpl if c.Namespace() != "" { action = core.NewListAction(c.Resource(), c.Kind(), c.Namespace(), metav1.ListOptions{}) diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1/discovery_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1/discovery_client.go index fbc685df8..876058d7a 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1/discovery_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1/discovery_client.go @@ -45,9 +45,7 @@ func (c *DiscoveryV1Client) EndpointSlices(namespace string) EndpointSliceInterf // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*DiscoveryV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*DiscoveryV1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*DiscoveryV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *DiscoveryV1Client { return &DiscoveryV1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := discoveryv1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/discovery_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/discovery_client.go index 908446c6d..d37de4050 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/discovery_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/discovery_client.go @@ -45,9 +45,7 @@ func (c *DiscoveryV1beta1Client) EndpointSlices(namespace string) EndpointSliceI // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*DiscoveryV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*DiscoveryV1beta1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*DiscoveryV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *DiscoveryV1beta1Client { return &DiscoveryV1beta1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := discoveryv1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/events/v1/events_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/events/v1/events_client.go index 959ff5f81..6d7f7553b 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/events/v1/events_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/events/v1/events_client.go @@ -45,9 +45,7 @@ func (c *EventsV1Client) Events(namespace string) EventInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*EventsV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*EventsV1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*EventsV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *EventsV1Client { return &EventsV1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := eventsv1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event_expansion.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event_expansion.go index 4ddbaa31a..bdade2c7f 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event_expansion.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event_expansion.go @@ -52,7 +52,7 @@ func (e *events) CreateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event, NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0). Resource("events"). Body(event). - Do(context.TODO()). + Do(context.Background() /* Nothing to do here, v1beta1 will be removed eventually. */). Into(result) return result, err } @@ -73,7 +73,7 @@ func (e *events) UpdateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event, Resource("events"). Name(event.Name). Body(event). - Do(context.TODO()). + Do(context.Background() /* Nothing to do here, v1beta1 will be removed eventually. */). Into(result) return result, err } @@ -93,7 +93,7 @@ func (e *events) PatchWithEventNamespace(event *v1beta1.Event, data []byte) (*v1 Resource("events"). Name(event.Name). Body(data). - Do(context.TODO()). + Do(context.Background() /* Nothing to do here, v1beta1 will be removed eventually. */). Into(result) return result, err } diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/events_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/events_client.go index 0bfc3cb60..6670d57cd 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/events_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/events_client.go @@ -45,9 +45,7 @@ func (c *EventsV1beta1Client) Events(namespace string) EventInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*EventsV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*EventsV1beta1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*EventsV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *EventsV1beta1Client { return &EventsV1beta1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := eventsv1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/extensions_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/extensions_client.go index 88f2279bb..ccbd29637 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/extensions_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/extensions_client.go @@ -65,9 +65,7 @@ func (c *ExtensionsV1beta1Client) ReplicaSets(namespace string) ReplicaSetInterf // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*ExtensionsV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -79,9 +77,7 @@ func NewForConfig(c *rest.Config) (*ExtensionsV1beta1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ExtensionsV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -104,7 +100,7 @@ func New(c rest.Interface) *ExtensionsV1beta1Client { return &ExtensionsV1beta1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := extensionsv1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -113,8 +109,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/flowcontrol_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/flowcontrol_client.go index 3b19586e9..a8af7106a 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/flowcontrol_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/flowcontrol_client.go @@ -50,9 +50,7 @@ func (c *FlowcontrolV1Client) PriorityLevelConfigurations() PriorityLevelConfigu // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*FlowcontrolV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -64,9 +62,7 @@ func NewForConfig(c *rest.Config) (*FlowcontrolV1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FlowcontrolV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -89,7 +85,7 @@ func New(c rest.Interface) *FlowcontrolV1Client { return &FlowcontrolV1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := flowcontrolv1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -98,8 +94,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/flowcontrol_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/flowcontrol_client.go index ac3f5ffe8..d7517f986 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/flowcontrol_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/flowcontrol_client.go @@ -50,9 +50,7 @@ func (c *FlowcontrolV1beta1Client) PriorityLevelConfigurations() PriorityLevelCo // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*FlowcontrolV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -64,9 +62,7 @@ func NewForConfig(c *rest.Config) (*FlowcontrolV1beta1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FlowcontrolV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -89,7 +85,7 @@ func New(c rest.Interface) *FlowcontrolV1beta1Client { return &FlowcontrolV1beta1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := flowcontrolv1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -98,8 +94,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/flowcontrol_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/flowcontrol_client.go index 7652d4f39..6cac8b89a 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/flowcontrol_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/flowcontrol_client.go @@ -50,9 +50,7 @@ func (c *FlowcontrolV1beta2Client) PriorityLevelConfigurations() PriorityLevelCo // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*FlowcontrolV1beta2Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -64,9 +62,7 @@ func NewForConfig(c *rest.Config) (*FlowcontrolV1beta2Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FlowcontrolV1beta2Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -89,7 +85,7 @@ func New(c rest.Interface) *FlowcontrolV1beta2Client { return &FlowcontrolV1beta2Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := flowcontrolv1beta2.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -98,8 +94,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/flowcontrol_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/flowcontrol_client.go index b32dc911c..340cedd67 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/flowcontrol_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/flowcontrol_client.go @@ -50,9 +50,7 @@ func (c *FlowcontrolV1beta3Client) PriorityLevelConfigurations() PriorityLevelCo // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*FlowcontrolV1beta3Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -64,9 +62,7 @@ func NewForConfig(c *rest.Config) (*FlowcontrolV1beta3Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FlowcontrolV1beta3Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -89,7 +85,7 @@ func New(c rest.Interface) *FlowcontrolV1beta3Client { return &FlowcontrolV1beta3Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := flowcontrolv1beta3.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -98,8 +94,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_ipaddress.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_ipaddress.go new file mode 100644 index 000000000..15f4e3c1c --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_ipaddress.go @@ -0,0 +1,49 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "k8s.io/api/networking/v1" + networkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" + gentype "k8s.io/client-go/gentype" + typednetworkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1" +) + +// fakeIPAddresses implements IPAddressInterface +type fakeIPAddresses struct { + *gentype.FakeClientWithListAndApply[*v1.IPAddress, *v1.IPAddressList, *networkingv1.IPAddressApplyConfiguration] + Fake *FakeNetworkingV1 +} + +func newFakeIPAddresses(fake *FakeNetworkingV1) typednetworkingv1.IPAddressInterface { + return &fakeIPAddresses{ + gentype.NewFakeClientWithListAndApply[*v1.IPAddress, *v1.IPAddressList, *networkingv1.IPAddressApplyConfiguration]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("ipaddresses"), + v1.SchemeGroupVersion.WithKind("IPAddress"), + func() *v1.IPAddress { return &v1.IPAddress{} }, + func() *v1.IPAddressList { return &v1.IPAddressList{} }, + func(dst, src *v1.IPAddressList) { dst.ListMeta = src.ListMeta }, + func(list *v1.IPAddressList) []*v1.IPAddress { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.IPAddressList, items []*v1.IPAddress) { list.Items = gentype.FromPointerSlice(items) }, + ), + fake, + } +} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networking_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networking_client.go index 3b6a36ffe..ba61689e6 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networking_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networking_client.go @@ -28,6 +28,10 @@ type FakeNetworkingV1 struct { *testing.Fake } +func (c *FakeNetworkingV1) IPAddresses() v1.IPAddressInterface { + return newFakeIPAddresses(c) +} + func (c *FakeNetworkingV1) Ingresses(namespace string) v1.IngressInterface { return newFakeIngresses(c, namespace) } @@ -40,6 +44,10 @@ func (c *FakeNetworkingV1) NetworkPolicies(namespace string) v1.NetworkPolicyInt return newFakeNetworkPolicies(c, namespace) } +func (c *FakeNetworkingV1) ServiceCIDRs() v1.ServiceCIDRInterface { + return newFakeServiceCIDRs(c) +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeNetworkingV1) RESTClient() rest.Interface { diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_servicecidr.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_servicecidr.go new file mode 100644 index 000000000..c82391fb4 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_servicecidr.go @@ -0,0 +1,49 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "k8s.io/api/networking/v1" + networkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" + gentype "k8s.io/client-go/gentype" + typednetworkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1" +) + +// fakeServiceCIDRs implements ServiceCIDRInterface +type fakeServiceCIDRs struct { + *gentype.FakeClientWithListAndApply[*v1.ServiceCIDR, *v1.ServiceCIDRList, *networkingv1.ServiceCIDRApplyConfiguration] + Fake *FakeNetworkingV1 +} + +func newFakeServiceCIDRs(fake *FakeNetworkingV1) typednetworkingv1.ServiceCIDRInterface { + return &fakeServiceCIDRs{ + gentype.NewFakeClientWithListAndApply[*v1.ServiceCIDR, *v1.ServiceCIDRList, *networkingv1.ServiceCIDRApplyConfiguration]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("servicecidrs"), + v1.SchemeGroupVersion.WithKind("ServiceCIDR"), + func() *v1.ServiceCIDR { return &v1.ServiceCIDR{} }, + func() *v1.ServiceCIDRList { return &v1.ServiceCIDRList{} }, + func(dst, src *v1.ServiceCIDRList) { dst.ListMeta = src.ListMeta }, + func(list *v1.ServiceCIDRList) []*v1.ServiceCIDR { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.ServiceCIDRList, items []*v1.ServiceCIDR) { list.Items = gentype.FromPointerSlice(items) }, + ), + fake, + } +} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/generated_expansion.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/generated_expansion.go index 52b70c514..88f0f9f67 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/generated_expansion.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/generated_expansion.go @@ -18,8 +18,12 @@ limitations under the License. package v1 +type IPAddressExpansion interface{} + type IngressExpansion interface{} type IngressClassExpansion interface{} type NetworkPolicyExpansion interface{} + +type ServiceCIDRExpansion interface{} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/ipaddress.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/ipaddress.go new file mode 100644 index 000000000..c3328cc3d --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/ipaddress.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + networkingv1 "k8s.io/api/networking/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationsnetworkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// IPAddressesGetter has a method to return a IPAddressInterface. +// A group's client should implement this interface. +type IPAddressesGetter interface { + IPAddresses() IPAddressInterface +} + +// IPAddressInterface has methods to work with IPAddress resources. +type IPAddressInterface interface { + Create(ctx context.Context, iPAddress *networkingv1.IPAddress, opts metav1.CreateOptions) (*networkingv1.IPAddress, error) + Update(ctx context.Context, iPAddress *networkingv1.IPAddress, opts metav1.UpdateOptions) (*networkingv1.IPAddress, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*networkingv1.IPAddress, error) + List(ctx context.Context, opts metav1.ListOptions) (*networkingv1.IPAddressList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *networkingv1.IPAddress, err error) + Apply(ctx context.Context, iPAddress *applyconfigurationsnetworkingv1.IPAddressApplyConfiguration, opts metav1.ApplyOptions) (result *networkingv1.IPAddress, err error) + IPAddressExpansion +} + +// iPAddresses implements IPAddressInterface +type iPAddresses struct { + *gentype.ClientWithListAndApply[*networkingv1.IPAddress, *networkingv1.IPAddressList, *applyconfigurationsnetworkingv1.IPAddressApplyConfiguration] +} + +// newIPAddresses returns a IPAddresses +func newIPAddresses(c *NetworkingV1Client) *iPAddresses { + return &iPAddresses{ + gentype.NewClientWithListAndApply[*networkingv1.IPAddress, *networkingv1.IPAddressList, *applyconfigurationsnetworkingv1.IPAddressApplyConfiguration]( + "ipaddresses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *networkingv1.IPAddress { return &networkingv1.IPAddress{} }, + func() *networkingv1.IPAddressList { return &networkingv1.IPAddressList{} }, + gentype.PrefersProtobuf[*networkingv1.IPAddress](), + ), + } +} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networking_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networking_client.go index 692b52f02..3411c053b 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networking_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networking_client.go @@ -28,9 +28,11 @@ import ( type NetworkingV1Interface interface { RESTClient() rest.Interface + IPAddressesGetter IngressesGetter IngressClassesGetter NetworkPoliciesGetter + ServiceCIDRsGetter } // NetworkingV1Client is used to interact with features provided by the networking.k8s.io group. @@ -38,6 +40,10 @@ type NetworkingV1Client struct { restClient rest.Interface } +func (c *NetworkingV1Client) IPAddresses() IPAddressInterface { + return newIPAddresses(c) +} + func (c *NetworkingV1Client) Ingresses(namespace string) IngressInterface { return newIngresses(c, namespace) } @@ -50,14 +56,16 @@ func (c *NetworkingV1Client) NetworkPolicies(namespace string) NetworkPolicyInte return newNetworkPolicies(c, namespace) } +func (c *NetworkingV1Client) ServiceCIDRs() ServiceCIDRInterface { + return newServiceCIDRs(c) +} + // NewForConfig creates a new NetworkingV1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*NetworkingV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -69,9 +77,7 @@ func NewForConfig(c *rest.Config) (*NetworkingV1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NetworkingV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -94,7 +100,7 @@ func New(c rest.Interface) *NetworkingV1Client { return &NetworkingV1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := networkingv1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -103,8 +109,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/servicecidr.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/servicecidr.go new file mode 100644 index 000000000..b22f30c2c --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/servicecidr.go @@ -0,0 +1,75 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + networkingv1 "k8s.io/api/networking/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationsnetworkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// ServiceCIDRsGetter has a method to return a ServiceCIDRInterface. +// A group's client should implement this interface. +type ServiceCIDRsGetter interface { + ServiceCIDRs() ServiceCIDRInterface +} + +// ServiceCIDRInterface has methods to work with ServiceCIDR resources. +type ServiceCIDRInterface interface { + Create(ctx context.Context, serviceCIDR *networkingv1.ServiceCIDR, opts metav1.CreateOptions) (*networkingv1.ServiceCIDR, error) + Update(ctx context.Context, serviceCIDR *networkingv1.ServiceCIDR, opts metav1.UpdateOptions) (*networkingv1.ServiceCIDR, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, serviceCIDR *networkingv1.ServiceCIDR, opts metav1.UpdateOptions) (*networkingv1.ServiceCIDR, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*networkingv1.ServiceCIDR, error) + List(ctx context.Context, opts metav1.ListOptions) (*networkingv1.ServiceCIDRList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *networkingv1.ServiceCIDR, err error) + Apply(ctx context.Context, serviceCIDR *applyconfigurationsnetworkingv1.ServiceCIDRApplyConfiguration, opts metav1.ApplyOptions) (result *networkingv1.ServiceCIDR, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, serviceCIDR *applyconfigurationsnetworkingv1.ServiceCIDRApplyConfiguration, opts metav1.ApplyOptions) (result *networkingv1.ServiceCIDR, err error) + ServiceCIDRExpansion +} + +// serviceCIDRs implements ServiceCIDRInterface +type serviceCIDRs struct { + *gentype.ClientWithListAndApply[*networkingv1.ServiceCIDR, *networkingv1.ServiceCIDRList, *applyconfigurationsnetworkingv1.ServiceCIDRApplyConfiguration] +} + +// newServiceCIDRs returns a ServiceCIDRs +func newServiceCIDRs(c *NetworkingV1Client) *serviceCIDRs { + return &serviceCIDRs{ + gentype.NewClientWithListAndApply[*networkingv1.ServiceCIDR, *networkingv1.ServiceCIDRList, *applyconfigurationsnetworkingv1.ServiceCIDRApplyConfiguration]( + "servicecidrs", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *networkingv1.ServiceCIDR { return &networkingv1.ServiceCIDR{} }, + func() *networkingv1.ServiceCIDRList { return &networkingv1.ServiceCIDRList{} }, + gentype.PrefersProtobuf[*networkingv1.ServiceCIDR](), + ), + } +} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/networking_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/networking_client.go index 9e1b3064d..c9d1dfd29 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/networking_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/networking_client.go @@ -50,9 +50,7 @@ func (c *NetworkingV1alpha1Client) ServiceCIDRs() ServiceCIDRInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*NetworkingV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -64,9 +62,7 @@ func NewForConfig(c *rest.Config) (*NetworkingV1alpha1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NetworkingV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -89,7 +85,7 @@ func New(c rest.Interface) *NetworkingV1alpha1Client { return &NetworkingV1alpha1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := networkingv1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -98,8 +94,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/networking_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/networking_client.go index cb4b0c601..c30acf0a2 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/networking_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/networking_client.go @@ -60,9 +60,7 @@ func (c *NetworkingV1beta1Client) ServiceCIDRs() ServiceCIDRInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*NetworkingV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -74,9 +72,7 @@ func NewForConfig(c *rest.Config) (*NetworkingV1beta1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NetworkingV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -99,7 +95,7 @@ func New(c rest.Interface) *NetworkingV1beta1Client { return &NetworkingV1beta1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := networkingv1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -108,8 +104,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/node/v1/node_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/node/v1/node_client.go index 3bde21171..b1b2f7c07 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/node/v1/node_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/node/v1/node_client.go @@ -45,9 +45,7 @@ func (c *NodeV1Client) RuntimeClasses() RuntimeClassInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*NodeV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*NodeV1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NodeV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *NodeV1Client { return &NodeV1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := nodev1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/node_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/node_client.go index e47ef3548..e11398de4 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/node_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/node_client.go @@ -45,9 +45,7 @@ func (c *NodeV1alpha1Client) RuntimeClasses() RuntimeClassInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*NodeV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*NodeV1alpha1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NodeV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *NodeV1alpha1Client { return &NodeV1alpha1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := nodev1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/node_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/node_client.go index c7864a479..bc9b1f6a2 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/node_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/node_client.go @@ -45,9 +45,7 @@ func (c *NodeV1beta1Client) RuntimeClasses() RuntimeClassInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*NodeV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*NodeV1beta1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NodeV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *NodeV1beta1Client { return &NodeV1beta1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := nodev1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/policy_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/policy_client.go index 8d84f460b..fdbbc922b 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/policy_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/policy_client.go @@ -50,9 +50,7 @@ func (c *PolicyV1Client) PodDisruptionBudgets(namespace string) PodDisruptionBud // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*PolicyV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -64,9 +62,7 @@ func NewForConfig(c *rest.Config) (*PolicyV1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*PolicyV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -89,7 +85,7 @@ func New(c rest.Interface) *PolicyV1Client { return &PolicyV1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := policyv1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -98,8 +94,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go index d8e78627e..666e1b7f8 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/policy_client.go @@ -50,9 +50,7 @@ func (c *PolicyV1beta1Client) PodDisruptionBudgets(namespace string) PodDisrupti // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*PolicyV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -64,9 +62,7 @@ func NewForConfig(c *rest.Config) (*PolicyV1beta1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*PolicyV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -89,7 +85,7 @@ func New(c rest.Interface) *PolicyV1beta1Client { return &PolicyV1beta1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := policyv1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -98,8 +94,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rbac_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rbac_client.go index c586ee638..8eee912fc 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rbac_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rbac_client.go @@ -60,9 +60,7 @@ func (c *RbacV1Client) RoleBindings(namespace string) RoleBindingInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*RbacV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -74,9 +72,7 @@ func NewForConfig(c *rest.Config) (*RbacV1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*RbacV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -99,7 +95,7 @@ func New(c rest.Interface) *RbacV1Client { return &RbacV1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := rbacv1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -108,8 +104,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rbac_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rbac_client.go index df46fc3aa..2e7dc9842 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rbac_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rbac_client.go @@ -60,9 +60,7 @@ func (c *RbacV1alpha1Client) RoleBindings(namespace string) RoleBindingInterface // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*RbacV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -74,9 +72,7 @@ func NewForConfig(c *rest.Config) (*RbacV1alpha1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*RbacV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -99,7 +95,7 @@ func New(c rest.Interface) *RbacV1alpha1Client { return &RbacV1alpha1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := rbacv1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -108,8 +104,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rbac_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rbac_client.go index 5739bb289..69f464147 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rbac_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rbac_client.go @@ -60,9 +60,7 @@ func (c *RbacV1beta1Client) RoleBindings(namespace string) RoleBindingInterface // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*RbacV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -74,9 +72,7 @@ func NewForConfig(c *rest.Config) (*RbacV1beta1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*RbacV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -99,7 +95,7 @@ func New(c rest.Interface) *RbacV1beta1Client { return &RbacV1beta1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := rbacv1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -108,8 +104,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/devicetaintrule.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/devicetaintrule.go new file mode 100644 index 000000000..77e26b6e3 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/devicetaintrule.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + context "context" + + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationsresourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// DeviceTaintRulesGetter has a method to return a DeviceTaintRuleInterface. +// A group's client should implement this interface. +type DeviceTaintRulesGetter interface { + DeviceTaintRules() DeviceTaintRuleInterface +} + +// DeviceTaintRuleInterface has methods to work with DeviceTaintRule resources. +type DeviceTaintRuleInterface interface { + Create(ctx context.Context, deviceTaintRule *resourcev1alpha3.DeviceTaintRule, opts v1.CreateOptions) (*resourcev1alpha3.DeviceTaintRule, error) + Update(ctx context.Context, deviceTaintRule *resourcev1alpha3.DeviceTaintRule, opts v1.UpdateOptions) (*resourcev1alpha3.DeviceTaintRule, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*resourcev1alpha3.DeviceTaintRule, error) + List(ctx context.Context, opts v1.ListOptions) (*resourcev1alpha3.DeviceTaintRuleList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *resourcev1alpha3.DeviceTaintRule, err error) + Apply(ctx context.Context, deviceTaintRule *applyconfigurationsresourcev1alpha3.DeviceTaintRuleApplyConfiguration, opts v1.ApplyOptions) (result *resourcev1alpha3.DeviceTaintRule, err error) + DeviceTaintRuleExpansion +} + +// deviceTaintRules implements DeviceTaintRuleInterface +type deviceTaintRules struct { + *gentype.ClientWithListAndApply[*resourcev1alpha3.DeviceTaintRule, *resourcev1alpha3.DeviceTaintRuleList, *applyconfigurationsresourcev1alpha3.DeviceTaintRuleApplyConfiguration] +} + +// newDeviceTaintRules returns a DeviceTaintRules +func newDeviceTaintRules(c *ResourceV1alpha3Client) *deviceTaintRules { + return &deviceTaintRules{ + gentype.NewClientWithListAndApply[*resourcev1alpha3.DeviceTaintRule, *resourcev1alpha3.DeviceTaintRuleList, *applyconfigurationsresourcev1alpha3.DeviceTaintRuleApplyConfiguration]( + "devicetaintrules", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *resourcev1alpha3.DeviceTaintRule { return &resourcev1alpha3.DeviceTaintRule{} }, + func() *resourcev1alpha3.DeviceTaintRuleList { return &resourcev1alpha3.DeviceTaintRuleList{} }, + gentype.PrefersProtobuf[*resourcev1alpha3.DeviceTaintRule](), + ), + } +} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_devicetaintrule.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_devicetaintrule.go new file mode 100644 index 000000000..62a55561f --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_devicetaintrule.go @@ -0,0 +1,53 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha3 "k8s.io/api/resource/v1alpha3" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" + gentype "k8s.io/client-go/gentype" + typedresourcev1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3" +) + +// fakeDeviceTaintRules implements DeviceTaintRuleInterface +type fakeDeviceTaintRules struct { + *gentype.FakeClientWithListAndApply[*v1alpha3.DeviceTaintRule, *v1alpha3.DeviceTaintRuleList, *resourcev1alpha3.DeviceTaintRuleApplyConfiguration] + Fake *FakeResourceV1alpha3 +} + +func newFakeDeviceTaintRules(fake *FakeResourceV1alpha3) typedresourcev1alpha3.DeviceTaintRuleInterface { + return &fakeDeviceTaintRules{ + gentype.NewFakeClientWithListAndApply[*v1alpha3.DeviceTaintRule, *v1alpha3.DeviceTaintRuleList, *resourcev1alpha3.DeviceTaintRuleApplyConfiguration]( + fake.Fake, + "", + v1alpha3.SchemeGroupVersion.WithResource("devicetaintrules"), + v1alpha3.SchemeGroupVersion.WithKind("DeviceTaintRule"), + func() *v1alpha3.DeviceTaintRule { return &v1alpha3.DeviceTaintRule{} }, + func() *v1alpha3.DeviceTaintRuleList { return &v1alpha3.DeviceTaintRuleList{} }, + func(dst, src *v1alpha3.DeviceTaintRuleList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha3.DeviceTaintRuleList) []*v1alpha3.DeviceTaintRule { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha3.DeviceTaintRuleList, items []*v1alpha3.DeviceTaintRule) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resource_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resource_client.go index 83dfdb2b9..d6d872d85 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resource_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resource_client.go @@ -32,6 +32,10 @@ func (c *FakeResourceV1alpha3) DeviceClasses() v1alpha3.DeviceClassInterface { return newFakeDeviceClasses(c) } +func (c *FakeResourceV1alpha3) DeviceTaintRules() v1alpha3.DeviceTaintRuleInterface { + return newFakeDeviceTaintRules(c) +} + func (c *FakeResourceV1alpha3) ResourceClaims(namespace string) v1alpha3.ResourceClaimInterface { return newFakeResourceClaims(c, namespace) } diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/generated_expansion.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/generated_expansion.go index cd8862ea8..6a7ffeda8 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/generated_expansion.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/generated_expansion.go @@ -20,6 +20,8 @@ package v1alpha3 type DeviceClassExpansion interface{} +type DeviceTaintRuleExpansion interface{} + type ResourceClaimExpansion interface{} type ResourceClaimTemplateExpansion interface{} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/resource_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/resource_client.go index acc9b97c2..7e16ac154 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/resource_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/resource_client.go @@ -29,6 +29,7 @@ import ( type ResourceV1alpha3Interface interface { RESTClient() rest.Interface DeviceClassesGetter + DeviceTaintRulesGetter ResourceClaimsGetter ResourceClaimTemplatesGetter ResourceSlicesGetter @@ -43,6 +44,10 @@ func (c *ResourceV1alpha3Client) DeviceClasses() DeviceClassInterface { return newDeviceClasses(c) } +func (c *ResourceV1alpha3Client) DeviceTaintRules() DeviceTaintRuleInterface { + return newDeviceTaintRules(c) +} + func (c *ResourceV1alpha3Client) ResourceClaims(namespace string) ResourceClaimInterface { return newResourceClaims(c, namespace) } @@ -60,9 +65,7 @@ func (c *ResourceV1alpha3Client) ResourceSlices() ResourceSliceInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*ResourceV1alpha3Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -74,9 +77,7 @@ func NewForConfig(c *rest.Config) (*ResourceV1alpha3Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ResourceV1alpha3Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -99,7 +100,7 @@ func New(c rest.Interface) *ResourceV1alpha3Client { return &ResourceV1alpha3Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := resourcev1alpha3.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -108,8 +109,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta1/resource_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta1/resource_client.go index c6a3b2836..789d34a91 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta1/resource_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta1/resource_client.go @@ -60,9 +60,7 @@ func (c *ResourceV1beta1Client) ResourceSlices() ResourceSliceInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*ResourceV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -74,9 +72,7 @@ func NewForConfig(c *rest.Config) (*ResourceV1beta1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ResourceV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -99,7 +95,7 @@ func New(c rest.Interface) *ResourceV1beta1Client { return &ResourceV1beta1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := resourcev1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -108,8 +104,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/deviceclass.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/deviceclass.go new file mode 100644 index 000000000..0943193f6 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/deviceclass.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +import ( + context "context" + + resourcev1beta2 "k8s.io/api/resource/v1beta2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationsresourcev1beta2 "k8s.io/client-go/applyconfigurations/resource/v1beta2" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// DeviceClassesGetter has a method to return a DeviceClassInterface. +// A group's client should implement this interface. +type DeviceClassesGetter interface { + DeviceClasses() DeviceClassInterface +} + +// DeviceClassInterface has methods to work with DeviceClass resources. +type DeviceClassInterface interface { + Create(ctx context.Context, deviceClass *resourcev1beta2.DeviceClass, opts v1.CreateOptions) (*resourcev1beta2.DeviceClass, error) + Update(ctx context.Context, deviceClass *resourcev1beta2.DeviceClass, opts v1.UpdateOptions) (*resourcev1beta2.DeviceClass, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*resourcev1beta2.DeviceClass, error) + List(ctx context.Context, opts v1.ListOptions) (*resourcev1beta2.DeviceClassList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *resourcev1beta2.DeviceClass, err error) + Apply(ctx context.Context, deviceClass *applyconfigurationsresourcev1beta2.DeviceClassApplyConfiguration, opts v1.ApplyOptions) (result *resourcev1beta2.DeviceClass, err error) + DeviceClassExpansion +} + +// deviceClasses implements DeviceClassInterface +type deviceClasses struct { + *gentype.ClientWithListAndApply[*resourcev1beta2.DeviceClass, *resourcev1beta2.DeviceClassList, *applyconfigurationsresourcev1beta2.DeviceClassApplyConfiguration] +} + +// newDeviceClasses returns a DeviceClasses +func newDeviceClasses(c *ResourceV1beta2Client) *deviceClasses { + return &deviceClasses{ + gentype.NewClientWithListAndApply[*resourcev1beta2.DeviceClass, *resourcev1beta2.DeviceClassList, *applyconfigurationsresourcev1beta2.DeviceClassApplyConfiguration]( + "deviceclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *resourcev1beta2.DeviceClass { return &resourcev1beta2.DeviceClass{} }, + func() *resourcev1beta2.DeviceClassList { return &resourcev1beta2.DeviceClassList{} }, + gentype.PrefersProtobuf[*resourcev1beta2.DeviceClass](), + ), + } +} diff --git a/e2e/vendor/k8s.io/cloud-provider/config/doc.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/doc.go similarity index 77% rename from e2e/vendor/k8s.io/cloud-provider/config/doc.go rename to e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/doc.go index 25132693d..56518ef7f 100644 --- a/e2e/vendor/k8s.io/cloud-provider/config/doc.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +k8s:deepcopy-gen=package -// +groupName=cloudcontrollermanager.config.k8s.io +// Code generated by client-gen. DO NOT EDIT. -package config +// This package has the automatically generated typed clients. +package v1beta2 diff --git a/e2e/vendor/k8s.io/controller-manager/config/doc.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/doc.go similarity index 78% rename from e2e/vendor/k8s.io/controller-manager/config/doc.go rename to e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/doc.go index 164ec715b..16f443990 100644 --- a/e2e/vendor/k8s.io/controller-manager/config/doc.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +k8s:deepcopy-gen=package +// Code generated by client-gen. DO NOT EDIT. -package config +// Package fake has the automatically generated clients. +package fake diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_deviceclass.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_deviceclass.go new file mode 100644 index 000000000..540f278ca --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_deviceclass.go @@ -0,0 +1,51 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1beta2 "k8s.io/api/resource/v1beta2" + resourcev1beta2 "k8s.io/client-go/applyconfigurations/resource/v1beta2" + gentype "k8s.io/client-go/gentype" + typedresourcev1beta2 "k8s.io/client-go/kubernetes/typed/resource/v1beta2" +) + +// fakeDeviceClasses implements DeviceClassInterface +type fakeDeviceClasses struct { + *gentype.FakeClientWithListAndApply[*v1beta2.DeviceClass, *v1beta2.DeviceClassList, *resourcev1beta2.DeviceClassApplyConfiguration] + Fake *FakeResourceV1beta2 +} + +func newFakeDeviceClasses(fake *FakeResourceV1beta2) typedresourcev1beta2.DeviceClassInterface { + return &fakeDeviceClasses{ + gentype.NewFakeClientWithListAndApply[*v1beta2.DeviceClass, *v1beta2.DeviceClassList, *resourcev1beta2.DeviceClassApplyConfiguration]( + fake.Fake, + "", + v1beta2.SchemeGroupVersion.WithResource("deviceclasses"), + v1beta2.SchemeGroupVersion.WithKind("DeviceClass"), + func() *v1beta2.DeviceClass { return &v1beta2.DeviceClass{} }, + func() *v1beta2.DeviceClassList { return &v1beta2.DeviceClassList{} }, + func(dst, src *v1beta2.DeviceClassList) { dst.ListMeta = src.ListMeta }, + func(list *v1beta2.DeviceClassList) []*v1beta2.DeviceClass { return gentype.ToPointerSlice(list.Items) }, + func(list *v1beta2.DeviceClassList, items []*v1beta2.DeviceClass) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_resource_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_resource_client.go new file mode 100644 index 000000000..10c5c0e33 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_resource_client.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1beta2 "k8s.io/client-go/kubernetes/typed/resource/v1beta2" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeResourceV1beta2 struct { + *testing.Fake +} + +func (c *FakeResourceV1beta2) DeviceClasses() v1beta2.DeviceClassInterface { + return newFakeDeviceClasses(c) +} + +func (c *FakeResourceV1beta2) ResourceClaims(namespace string) v1beta2.ResourceClaimInterface { + return newFakeResourceClaims(c, namespace) +} + +func (c *FakeResourceV1beta2) ResourceClaimTemplates(namespace string) v1beta2.ResourceClaimTemplateInterface { + return newFakeResourceClaimTemplates(c, namespace) +} + +func (c *FakeResourceV1beta2) ResourceSlices() v1beta2.ResourceSliceInterface { + return newFakeResourceSlices(c) +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeResourceV1beta2) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_resourceclaim.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_resourceclaim.go new file mode 100644 index 000000000..f09391762 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_resourceclaim.go @@ -0,0 +1,53 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1beta2 "k8s.io/api/resource/v1beta2" + resourcev1beta2 "k8s.io/client-go/applyconfigurations/resource/v1beta2" + gentype "k8s.io/client-go/gentype" + typedresourcev1beta2 "k8s.io/client-go/kubernetes/typed/resource/v1beta2" +) + +// fakeResourceClaims implements ResourceClaimInterface +type fakeResourceClaims struct { + *gentype.FakeClientWithListAndApply[*v1beta2.ResourceClaim, *v1beta2.ResourceClaimList, *resourcev1beta2.ResourceClaimApplyConfiguration] + Fake *FakeResourceV1beta2 +} + +func newFakeResourceClaims(fake *FakeResourceV1beta2, namespace string) typedresourcev1beta2.ResourceClaimInterface { + return &fakeResourceClaims{ + gentype.NewFakeClientWithListAndApply[*v1beta2.ResourceClaim, *v1beta2.ResourceClaimList, *resourcev1beta2.ResourceClaimApplyConfiguration]( + fake.Fake, + namespace, + v1beta2.SchemeGroupVersion.WithResource("resourceclaims"), + v1beta2.SchemeGroupVersion.WithKind("ResourceClaim"), + func() *v1beta2.ResourceClaim { return &v1beta2.ResourceClaim{} }, + func() *v1beta2.ResourceClaimList { return &v1beta2.ResourceClaimList{} }, + func(dst, src *v1beta2.ResourceClaimList) { dst.ListMeta = src.ListMeta }, + func(list *v1beta2.ResourceClaimList) []*v1beta2.ResourceClaim { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1beta2.ResourceClaimList, items []*v1beta2.ResourceClaim) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_resourceclaimtemplate.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_resourceclaimtemplate.go new file mode 100644 index 000000000..5c4bb111d --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_resourceclaimtemplate.go @@ -0,0 +1,53 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1beta2 "k8s.io/api/resource/v1beta2" + resourcev1beta2 "k8s.io/client-go/applyconfigurations/resource/v1beta2" + gentype "k8s.io/client-go/gentype" + typedresourcev1beta2 "k8s.io/client-go/kubernetes/typed/resource/v1beta2" +) + +// fakeResourceClaimTemplates implements ResourceClaimTemplateInterface +type fakeResourceClaimTemplates struct { + *gentype.FakeClientWithListAndApply[*v1beta2.ResourceClaimTemplate, *v1beta2.ResourceClaimTemplateList, *resourcev1beta2.ResourceClaimTemplateApplyConfiguration] + Fake *FakeResourceV1beta2 +} + +func newFakeResourceClaimTemplates(fake *FakeResourceV1beta2, namespace string) typedresourcev1beta2.ResourceClaimTemplateInterface { + return &fakeResourceClaimTemplates{ + gentype.NewFakeClientWithListAndApply[*v1beta2.ResourceClaimTemplate, *v1beta2.ResourceClaimTemplateList, *resourcev1beta2.ResourceClaimTemplateApplyConfiguration]( + fake.Fake, + namespace, + v1beta2.SchemeGroupVersion.WithResource("resourceclaimtemplates"), + v1beta2.SchemeGroupVersion.WithKind("ResourceClaimTemplate"), + func() *v1beta2.ResourceClaimTemplate { return &v1beta2.ResourceClaimTemplate{} }, + func() *v1beta2.ResourceClaimTemplateList { return &v1beta2.ResourceClaimTemplateList{} }, + func(dst, src *v1beta2.ResourceClaimTemplateList) { dst.ListMeta = src.ListMeta }, + func(list *v1beta2.ResourceClaimTemplateList) []*v1beta2.ResourceClaimTemplate { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1beta2.ResourceClaimTemplateList, items []*v1beta2.ResourceClaimTemplate) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_resourceslice.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_resourceslice.go new file mode 100644 index 000000000..a53b6f81d --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_resourceslice.go @@ -0,0 +1,53 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1beta2 "k8s.io/api/resource/v1beta2" + resourcev1beta2 "k8s.io/client-go/applyconfigurations/resource/v1beta2" + gentype "k8s.io/client-go/gentype" + typedresourcev1beta2 "k8s.io/client-go/kubernetes/typed/resource/v1beta2" +) + +// fakeResourceSlices implements ResourceSliceInterface +type fakeResourceSlices struct { + *gentype.FakeClientWithListAndApply[*v1beta2.ResourceSlice, *v1beta2.ResourceSliceList, *resourcev1beta2.ResourceSliceApplyConfiguration] + Fake *FakeResourceV1beta2 +} + +func newFakeResourceSlices(fake *FakeResourceV1beta2) typedresourcev1beta2.ResourceSliceInterface { + return &fakeResourceSlices{ + gentype.NewFakeClientWithListAndApply[*v1beta2.ResourceSlice, *v1beta2.ResourceSliceList, *resourcev1beta2.ResourceSliceApplyConfiguration]( + fake.Fake, + "", + v1beta2.SchemeGroupVersion.WithResource("resourceslices"), + v1beta2.SchemeGroupVersion.WithKind("ResourceSlice"), + func() *v1beta2.ResourceSlice { return &v1beta2.ResourceSlice{} }, + func() *v1beta2.ResourceSliceList { return &v1beta2.ResourceSliceList{} }, + func(dst, src *v1beta2.ResourceSliceList) { dst.ListMeta = src.ListMeta }, + func(list *v1beta2.ResourceSliceList) []*v1beta2.ResourceSlice { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1beta2.ResourceSliceList, items []*v1beta2.ResourceSlice) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/server/signal_posix.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/generated_expansion.go similarity index 67% rename from e2e/vendor/k8s.io/apiserver/pkg/server/signal_posix.go rename to e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/generated_expansion.go index 7acb2038a..230ab8ccd 100644 --- a/e2e/vendor/k8s.io/apiserver/pkg/server/signal_posix.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/generated_expansion.go @@ -1,8 +1,5 @@ -//go:build !windows -// +build !windows - /* -Copyright 2017 The Kubernetes Authors. +Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,11 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -package server +// Code generated by client-gen. DO NOT EDIT. -import ( - "os" - "syscall" -) +package v1beta2 -var shutdownSignals = []os.Signal{os.Interrupt, syscall.SIGTERM} +type DeviceClassExpansion interface{} + +type ResourceClaimExpansion interface{} + +type ResourceClaimTemplateExpansion interface{} + +type ResourceSliceExpansion interface{} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/resource_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/resource_client.go new file mode 100644 index 000000000..aadde5be9 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/resource_client.go @@ -0,0 +1,116 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +import ( + http "net/http" + + resourcev1beta2 "k8s.io/api/resource/v1beta2" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +type ResourceV1beta2Interface interface { + RESTClient() rest.Interface + DeviceClassesGetter + ResourceClaimsGetter + ResourceClaimTemplatesGetter + ResourceSlicesGetter +} + +// ResourceV1beta2Client is used to interact with features provided by the resource.k8s.io group. +type ResourceV1beta2Client struct { + restClient rest.Interface +} + +func (c *ResourceV1beta2Client) DeviceClasses() DeviceClassInterface { + return newDeviceClasses(c) +} + +func (c *ResourceV1beta2Client) ResourceClaims(namespace string) ResourceClaimInterface { + return newResourceClaims(c, namespace) +} + +func (c *ResourceV1beta2Client) ResourceClaimTemplates(namespace string) ResourceClaimTemplateInterface { + return newResourceClaimTemplates(c, namespace) +} + +func (c *ResourceV1beta2Client) ResourceSlices() ResourceSliceInterface { + return newResourceSlices(c) +} + +// NewForConfig creates a new ResourceV1beta2Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*ResourceV1beta2Client, error) { + config := *c + setConfigDefaults(&config) + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new ResourceV1beta2Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ResourceV1beta2Client, error) { + config := *c + setConfigDefaults(&config) + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &ResourceV1beta2Client{client}, nil +} + +// NewForConfigOrDie creates a new ResourceV1beta2Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ResourceV1beta2Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ResourceV1beta2Client for the given RESTClient. +func New(c rest.Interface) *ResourceV1beta2Client { + return &ResourceV1beta2Client{c} +} + +func setConfigDefaults(config *rest.Config) { + gv := resourcev1beta2.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *ResourceV1beta2Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/resourceclaim.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/resourceclaim.go new file mode 100644 index 000000000..47efefa9c --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/resourceclaim.go @@ -0,0 +1,75 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +import ( + context "context" + + resourcev1beta2 "k8s.io/api/resource/v1beta2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationsresourcev1beta2 "k8s.io/client-go/applyconfigurations/resource/v1beta2" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// ResourceClaimsGetter has a method to return a ResourceClaimInterface. +// A group's client should implement this interface. +type ResourceClaimsGetter interface { + ResourceClaims(namespace string) ResourceClaimInterface +} + +// ResourceClaimInterface has methods to work with ResourceClaim resources. +type ResourceClaimInterface interface { + Create(ctx context.Context, resourceClaim *resourcev1beta2.ResourceClaim, opts v1.CreateOptions) (*resourcev1beta2.ResourceClaim, error) + Update(ctx context.Context, resourceClaim *resourcev1beta2.ResourceClaim, opts v1.UpdateOptions) (*resourcev1beta2.ResourceClaim, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, resourceClaim *resourcev1beta2.ResourceClaim, opts v1.UpdateOptions) (*resourcev1beta2.ResourceClaim, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*resourcev1beta2.ResourceClaim, error) + List(ctx context.Context, opts v1.ListOptions) (*resourcev1beta2.ResourceClaimList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *resourcev1beta2.ResourceClaim, err error) + Apply(ctx context.Context, resourceClaim *applyconfigurationsresourcev1beta2.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *resourcev1beta2.ResourceClaim, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, resourceClaim *applyconfigurationsresourcev1beta2.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *resourcev1beta2.ResourceClaim, err error) + ResourceClaimExpansion +} + +// resourceClaims implements ResourceClaimInterface +type resourceClaims struct { + *gentype.ClientWithListAndApply[*resourcev1beta2.ResourceClaim, *resourcev1beta2.ResourceClaimList, *applyconfigurationsresourcev1beta2.ResourceClaimApplyConfiguration] +} + +// newResourceClaims returns a ResourceClaims +func newResourceClaims(c *ResourceV1beta2Client, namespace string) *resourceClaims { + return &resourceClaims{ + gentype.NewClientWithListAndApply[*resourcev1beta2.ResourceClaim, *resourcev1beta2.ResourceClaimList, *applyconfigurationsresourcev1beta2.ResourceClaimApplyConfiguration]( + "resourceclaims", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *resourcev1beta2.ResourceClaim { return &resourcev1beta2.ResourceClaim{} }, + func() *resourcev1beta2.ResourceClaimList { return &resourcev1beta2.ResourceClaimList{} }, + gentype.PrefersProtobuf[*resourcev1beta2.ResourceClaim](), + ), + } +} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/resourceclaimtemplate.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/resourceclaimtemplate.go new file mode 100644 index 000000000..2140a4537 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/resourceclaimtemplate.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +import ( + context "context" + + resourcev1beta2 "k8s.io/api/resource/v1beta2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationsresourcev1beta2 "k8s.io/client-go/applyconfigurations/resource/v1beta2" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// ResourceClaimTemplatesGetter has a method to return a ResourceClaimTemplateInterface. +// A group's client should implement this interface. +type ResourceClaimTemplatesGetter interface { + ResourceClaimTemplates(namespace string) ResourceClaimTemplateInterface +} + +// ResourceClaimTemplateInterface has methods to work with ResourceClaimTemplate resources. +type ResourceClaimTemplateInterface interface { + Create(ctx context.Context, resourceClaimTemplate *resourcev1beta2.ResourceClaimTemplate, opts v1.CreateOptions) (*resourcev1beta2.ResourceClaimTemplate, error) + Update(ctx context.Context, resourceClaimTemplate *resourcev1beta2.ResourceClaimTemplate, opts v1.UpdateOptions) (*resourcev1beta2.ResourceClaimTemplate, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*resourcev1beta2.ResourceClaimTemplate, error) + List(ctx context.Context, opts v1.ListOptions) (*resourcev1beta2.ResourceClaimTemplateList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *resourcev1beta2.ResourceClaimTemplate, err error) + Apply(ctx context.Context, resourceClaimTemplate *applyconfigurationsresourcev1beta2.ResourceClaimTemplateApplyConfiguration, opts v1.ApplyOptions) (result *resourcev1beta2.ResourceClaimTemplate, err error) + ResourceClaimTemplateExpansion +} + +// resourceClaimTemplates implements ResourceClaimTemplateInterface +type resourceClaimTemplates struct { + *gentype.ClientWithListAndApply[*resourcev1beta2.ResourceClaimTemplate, *resourcev1beta2.ResourceClaimTemplateList, *applyconfigurationsresourcev1beta2.ResourceClaimTemplateApplyConfiguration] +} + +// newResourceClaimTemplates returns a ResourceClaimTemplates +func newResourceClaimTemplates(c *ResourceV1beta2Client, namespace string) *resourceClaimTemplates { + return &resourceClaimTemplates{ + gentype.NewClientWithListAndApply[*resourcev1beta2.ResourceClaimTemplate, *resourcev1beta2.ResourceClaimTemplateList, *applyconfigurationsresourcev1beta2.ResourceClaimTemplateApplyConfiguration]( + "resourceclaimtemplates", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *resourcev1beta2.ResourceClaimTemplate { return &resourcev1beta2.ResourceClaimTemplate{} }, + func() *resourcev1beta2.ResourceClaimTemplateList { return &resourcev1beta2.ResourceClaimTemplateList{} }, + gentype.PrefersProtobuf[*resourcev1beta2.ResourceClaimTemplate](), + ), + } +} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/resourceslice.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/resourceslice.go new file mode 100644 index 000000000..c4507803f --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/resourceslice.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +import ( + context "context" + + resourcev1beta2 "k8s.io/api/resource/v1beta2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationsresourcev1beta2 "k8s.io/client-go/applyconfigurations/resource/v1beta2" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// ResourceSlicesGetter has a method to return a ResourceSliceInterface. +// A group's client should implement this interface. +type ResourceSlicesGetter interface { + ResourceSlices() ResourceSliceInterface +} + +// ResourceSliceInterface has methods to work with ResourceSlice resources. +type ResourceSliceInterface interface { + Create(ctx context.Context, resourceSlice *resourcev1beta2.ResourceSlice, opts v1.CreateOptions) (*resourcev1beta2.ResourceSlice, error) + Update(ctx context.Context, resourceSlice *resourcev1beta2.ResourceSlice, opts v1.UpdateOptions) (*resourcev1beta2.ResourceSlice, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*resourcev1beta2.ResourceSlice, error) + List(ctx context.Context, opts v1.ListOptions) (*resourcev1beta2.ResourceSliceList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *resourcev1beta2.ResourceSlice, err error) + Apply(ctx context.Context, resourceSlice *applyconfigurationsresourcev1beta2.ResourceSliceApplyConfiguration, opts v1.ApplyOptions) (result *resourcev1beta2.ResourceSlice, err error) + ResourceSliceExpansion +} + +// resourceSlices implements ResourceSliceInterface +type resourceSlices struct { + *gentype.ClientWithListAndApply[*resourcev1beta2.ResourceSlice, *resourcev1beta2.ResourceSliceList, *applyconfigurationsresourcev1beta2.ResourceSliceApplyConfiguration] +} + +// newResourceSlices returns a ResourceSlices +func newResourceSlices(c *ResourceV1beta2Client) *resourceSlices { + return &resourceSlices{ + gentype.NewClientWithListAndApply[*resourcev1beta2.ResourceSlice, *resourcev1beta2.ResourceSliceList, *applyconfigurationsresourcev1beta2.ResourceSliceApplyConfiguration]( + "resourceslices", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *resourcev1beta2.ResourceSlice { return &resourcev1beta2.ResourceSlice{} }, + func() *resourcev1beta2.ResourceSliceList { return &resourcev1beta2.ResourceSliceList{} }, + gentype.PrefersProtobuf[*resourcev1beta2.ResourceSlice](), + ), + } +} diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/scheduling_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/scheduling_client.go index bbb46a9de..85ea7722e 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/scheduling_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/scheduling_client.go @@ -45,9 +45,7 @@ func (c *SchedulingV1Client) PriorityClasses() PriorityClassInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*SchedulingV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*SchedulingV1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SchedulingV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *SchedulingV1Client { return &SchedulingV1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := schedulingv1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/scheduling_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/scheduling_client.go index 056ab855e..b17b182f1 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/scheduling_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/scheduling_client.go @@ -45,9 +45,7 @@ func (c *SchedulingV1alpha1Client) PriorityClasses() PriorityClassInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*SchedulingV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*SchedulingV1alpha1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SchedulingV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *SchedulingV1alpha1Client { return &SchedulingV1alpha1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := schedulingv1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/scheduling_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/scheduling_client.go index 9e383398e..0b2aa0e1a 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/scheduling_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/scheduling_client.go @@ -45,9 +45,7 @@ func (c *SchedulingV1beta1Client) PriorityClasses() PriorityClassInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*SchedulingV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*SchedulingV1beta1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SchedulingV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *SchedulingV1beta1Client { return &SchedulingV1beta1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := schedulingv1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go index 70aaff169..6ed552120 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go @@ -65,9 +65,7 @@ func (c *StorageV1Client) VolumeAttachments() VolumeAttachmentInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*StorageV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -79,9 +77,7 @@ func NewForConfig(c *rest.Config) (*StorageV1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*StorageV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -104,7 +100,7 @@ func New(c rest.Interface) *StorageV1Client { return &StorageV1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := storagev1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -113,8 +109,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/storage_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/storage_client.go index 17b680d19..44e1e1a23 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/storage_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/storage_client.go @@ -55,9 +55,7 @@ func (c *StorageV1alpha1Client) VolumeAttributesClasses() VolumeAttributesClassI // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*StorageV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -69,9 +67,7 @@ func NewForConfig(c *rest.Config) (*StorageV1alpha1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*StorageV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -94,7 +90,7 @@ func New(c rest.Interface) *StorageV1alpha1Client { return &StorageV1alpha1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := storagev1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -103,8 +99,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storage_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storage_client.go index 63b1d42a3..02805e1b9 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storage_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storage_client.go @@ -70,9 +70,7 @@ func (c *StorageV1beta1Client) VolumeAttributesClasses() VolumeAttributesClassIn // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*StorageV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -84,9 +82,7 @@ func NewForConfig(c *rest.Config) (*StorageV1beta1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*StorageV1beta1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -109,7 +105,7 @@ func New(c rest.Interface) *StorageV1beta1Client { return &StorageV1beta1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := storagev1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -118,8 +114,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/storagemigration_client.go b/e2e/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/storagemigration_client.go index dcd5a4bf8..f7b5f5a1e 100644 --- a/e2e/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/storagemigration_client.go +++ b/e2e/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/storagemigration_client.go @@ -45,9 +45,7 @@ func (c *StoragemigrationV1alpha1Client) StorageVersionMigrations() StorageVersi // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*StoragemigrationV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +57,7 @@ func NewForConfig(c *rest.Config) (*StoragemigrationV1alpha1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*StoragemigrationV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,7 +80,7 @@ func New(c rest.Interface) *StoragemigrationV1alpha1Client { return &StoragemigrationV1alpha1Client{c} } -func setConfigDefaults(config *rest.Config) error { +func setConfigDefaults(config *rest.Config) { gv := storagemigrationv1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" @@ -93,8 +89,6 @@ func setConfigDefaults(config *rest.Config) error { if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/e2e/vendor/k8s.io/client-go/listers/certificates/v1beta1/clustertrustbundle.go b/e2e/vendor/k8s.io/client-go/listers/certificates/v1beta1/clustertrustbundle.go new file mode 100644 index 000000000..dfda2498b --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/listers/certificates/v1beta1/clustertrustbundle.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + certificatesv1beta1 "k8s.io/api/certificates/v1beta1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// ClusterTrustBundleLister helps list ClusterTrustBundles. +// All objects returned here must be treated as read-only. +type ClusterTrustBundleLister interface { + // List lists all ClusterTrustBundles in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*certificatesv1beta1.ClusterTrustBundle, err error) + // Get retrieves the ClusterTrustBundle from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*certificatesv1beta1.ClusterTrustBundle, error) + ClusterTrustBundleListerExpansion +} + +// clusterTrustBundleLister implements the ClusterTrustBundleLister interface. +type clusterTrustBundleLister struct { + listers.ResourceIndexer[*certificatesv1beta1.ClusterTrustBundle] +} + +// NewClusterTrustBundleLister returns a new ClusterTrustBundleLister. +func NewClusterTrustBundleLister(indexer cache.Indexer) ClusterTrustBundleLister { + return &clusterTrustBundleLister{listers.New[*certificatesv1beta1.ClusterTrustBundle](indexer, certificatesv1beta1.Resource("clustertrustbundle"))} +} diff --git a/e2e/vendor/k8s.io/client-go/listers/certificates/v1beta1/expansion_generated.go b/e2e/vendor/k8s.io/client-go/listers/certificates/v1beta1/expansion_generated.go index 68f993cd6..12a2554df 100644 --- a/e2e/vendor/k8s.io/client-go/listers/certificates/v1beta1/expansion_generated.go +++ b/e2e/vendor/k8s.io/client-go/listers/certificates/v1beta1/expansion_generated.go @@ -21,3 +21,7 @@ package v1beta1 // CertificateSigningRequestListerExpansion allows custom methods to be added to // CertificateSigningRequestLister. type CertificateSigningRequestListerExpansion interface{} + +// ClusterTrustBundleListerExpansion allows custom methods to be added to +// ClusterTrustBundleLister. +type ClusterTrustBundleListerExpansion interface{} diff --git a/e2e/vendor/k8s.io/client-go/listers/coordination/v1beta1/expansion_generated.go b/e2e/vendor/k8s.io/client-go/listers/coordination/v1beta1/expansion_generated.go index dddc53107..d61788a32 100644 --- a/e2e/vendor/k8s.io/client-go/listers/coordination/v1beta1/expansion_generated.go +++ b/e2e/vendor/k8s.io/client-go/listers/coordination/v1beta1/expansion_generated.go @@ -25,3 +25,11 @@ type LeaseListerExpansion interface{} // LeaseNamespaceListerExpansion allows custom methods to be added to // LeaseNamespaceLister. type LeaseNamespaceListerExpansion interface{} + +// LeaseCandidateListerExpansion allows custom methods to be added to +// LeaseCandidateLister. +type LeaseCandidateListerExpansion interface{} + +// LeaseCandidateNamespaceListerExpansion allows custom methods to be added to +// LeaseCandidateNamespaceLister. +type LeaseCandidateNamespaceListerExpansion interface{} diff --git a/e2e/vendor/k8s.io/client-go/listers/coordination/v1beta1/leasecandidate.go b/e2e/vendor/k8s.io/client-go/listers/coordination/v1beta1/leasecandidate.go new file mode 100644 index 000000000..9c176a3ec --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/listers/coordination/v1beta1/leasecandidate.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + coordinationv1beta1 "k8s.io/api/coordination/v1beta1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// LeaseCandidateLister helps list LeaseCandidates. +// All objects returned here must be treated as read-only. +type LeaseCandidateLister interface { + // List lists all LeaseCandidates in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*coordinationv1beta1.LeaseCandidate, err error) + // LeaseCandidates returns an object that can list and get LeaseCandidates. + LeaseCandidates(namespace string) LeaseCandidateNamespaceLister + LeaseCandidateListerExpansion +} + +// leaseCandidateLister implements the LeaseCandidateLister interface. +type leaseCandidateLister struct { + listers.ResourceIndexer[*coordinationv1beta1.LeaseCandidate] +} + +// NewLeaseCandidateLister returns a new LeaseCandidateLister. +func NewLeaseCandidateLister(indexer cache.Indexer) LeaseCandidateLister { + return &leaseCandidateLister{listers.New[*coordinationv1beta1.LeaseCandidate](indexer, coordinationv1beta1.Resource("leasecandidate"))} +} + +// LeaseCandidates returns an object that can list and get LeaseCandidates. +func (s *leaseCandidateLister) LeaseCandidates(namespace string) LeaseCandidateNamespaceLister { + return leaseCandidateNamespaceLister{listers.NewNamespaced[*coordinationv1beta1.LeaseCandidate](s.ResourceIndexer, namespace)} +} + +// LeaseCandidateNamespaceLister helps list and get LeaseCandidates. +// All objects returned here must be treated as read-only. +type LeaseCandidateNamespaceLister interface { + // List lists all LeaseCandidates in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*coordinationv1beta1.LeaseCandidate, err error) + // Get retrieves the LeaseCandidate from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*coordinationv1beta1.LeaseCandidate, error) + LeaseCandidateNamespaceListerExpansion +} + +// leaseCandidateNamespaceLister implements the LeaseCandidateNamespaceLister +// interface. +type leaseCandidateNamespaceLister struct { + listers.ResourceIndexer[*coordinationv1beta1.LeaseCandidate] +} diff --git a/e2e/vendor/k8s.io/client-go/listers/doc.go b/e2e/vendor/k8s.io/client-go/listers/doc.go index 96c330c93..da6a80408 100644 --- a/e2e/vendor/k8s.io/client-go/listers/doc.go +++ b/e2e/vendor/k8s.io/client-go/listers/doc.go @@ -15,4 +15,4 @@ limitations under the License. */ // Package listers provides generated listers for Kubernetes APIs. -package listers // import "k8s.io/client-go/listers" +package listers diff --git a/e2e/vendor/k8s.io/client-go/listers/networking/v1/expansion_generated.go b/e2e/vendor/k8s.io/client-go/listers/networking/v1/expansion_generated.go index a380c2418..a2d335e6b 100644 --- a/e2e/vendor/k8s.io/client-go/listers/networking/v1/expansion_generated.go +++ b/e2e/vendor/k8s.io/client-go/listers/networking/v1/expansion_generated.go @@ -18,6 +18,10 @@ limitations under the License. package v1 +// IPAddressListerExpansion allows custom methods to be added to +// IPAddressLister. +type IPAddressListerExpansion interface{} + // IngressListerExpansion allows custom methods to be added to // IngressLister. type IngressListerExpansion interface{} @@ -37,3 +41,7 @@ type NetworkPolicyListerExpansion interface{} // NetworkPolicyNamespaceListerExpansion allows custom methods to be added to // NetworkPolicyNamespaceLister. type NetworkPolicyNamespaceListerExpansion interface{} + +// ServiceCIDRListerExpansion allows custom methods to be added to +// ServiceCIDRLister. +type ServiceCIDRListerExpansion interface{} diff --git a/e2e/vendor/k8s.io/client-go/listers/networking/v1/ipaddress.go b/e2e/vendor/k8s.io/client-go/listers/networking/v1/ipaddress.go new file mode 100644 index 000000000..e554bd38b --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/listers/networking/v1/ipaddress.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + networkingv1 "k8s.io/api/networking/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// IPAddressLister helps list IPAddresses. +// All objects returned here must be treated as read-only. +type IPAddressLister interface { + // List lists all IPAddresses in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*networkingv1.IPAddress, err error) + // Get retrieves the IPAddress from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*networkingv1.IPAddress, error) + IPAddressListerExpansion +} + +// iPAddressLister implements the IPAddressLister interface. +type iPAddressLister struct { + listers.ResourceIndexer[*networkingv1.IPAddress] +} + +// NewIPAddressLister returns a new IPAddressLister. +func NewIPAddressLister(indexer cache.Indexer) IPAddressLister { + return &iPAddressLister{listers.New[*networkingv1.IPAddress](indexer, networkingv1.Resource("ipaddress"))} +} diff --git a/e2e/vendor/k8s.io/client-go/listers/networking/v1/servicecidr.go b/e2e/vendor/k8s.io/client-go/listers/networking/v1/servicecidr.go new file mode 100644 index 000000000..6e326da16 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/listers/networking/v1/servicecidr.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + networkingv1 "k8s.io/api/networking/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceCIDRLister helps list ServiceCIDRs. +// All objects returned here must be treated as read-only. +type ServiceCIDRLister interface { + // List lists all ServiceCIDRs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*networkingv1.ServiceCIDR, err error) + // Get retrieves the ServiceCIDR from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*networkingv1.ServiceCIDR, error) + ServiceCIDRListerExpansion +} + +// serviceCIDRLister implements the ServiceCIDRLister interface. +type serviceCIDRLister struct { + listers.ResourceIndexer[*networkingv1.ServiceCIDR] +} + +// NewServiceCIDRLister returns a new ServiceCIDRLister. +func NewServiceCIDRLister(indexer cache.Indexer) ServiceCIDRLister { + return &serviceCIDRLister{listers.New[*networkingv1.ServiceCIDR](indexer, networkingv1.Resource("servicecidr"))} +} diff --git a/e2e/vendor/k8s.io/client-go/listers/resource/v1alpha3/devicetaintrule.go b/e2e/vendor/k8s.io/client-go/listers/resource/v1alpha3/devicetaintrule.go new file mode 100644 index 000000000..28d94ff2e --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/listers/resource/v1alpha3/devicetaintrule.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// DeviceTaintRuleLister helps list DeviceTaintRules. +// All objects returned here must be treated as read-only. +type DeviceTaintRuleLister interface { + // List lists all DeviceTaintRules in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*resourcev1alpha3.DeviceTaintRule, err error) + // Get retrieves the DeviceTaintRule from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*resourcev1alpha3.DeviceTaintRule, error) + DeviceTaintRuleListerExpansion +} + +// deviceTaintRuleLister implements the DeviceTaintRuleLister interface. +type deviceTaintRuleLister struct { + listers.ResourceIndexer[*resourcev1alpha3.DeviceTaintRule] +} + +// NewDeviceTaintRuleLister returns a new DeviceTaintRuleLister. +func NewDeviceTaintRuleLister(indexer cache.Indexer) DeviceTaintRuleLister { + return &deviceTaintRuleLister{listers.New[*resourcev1alpha3.DeviceTaintRule](indexer, resourcev1alpha3.Resource("devicetaintrule"))} +} diff --git a/e2e/vendor/k8s.io/client-go/listers/resource/v1alpha3/expansion_generated.go b/e2e/vendor/k8s.io/client-go/listers/resource/v1alpha3/expansion_generated.go index f626c9283..ff94d2869 100644 --- a/e2e/vendor/k8s.io/client-go/listers/resource/v1alpha3/expansion_generated.go +++ b/e2e/vendor/k8s.io/client-go/listers/resource/v1alpha3/expansion_generated.go @@ -22,6 +22,10 @@ package v1alpha3 // DeviceClassLister. type DeviceClassListerExpansion interface{} +// DeviceTaintRuleListerExpansion allows custom methods to be added to +// DeviceTaintRuleLister. +type DeviceTaintRuleListerExpansion interface{} + // ResourceClaimListerExpansion allows custom methods to be added to // ResourceClaimLister. type ResourceClaimListerExpansion interface{} diff --git a/e2e/vendor/k8s.io/client-go/listers/resource/v1beta2/deviceclass.go b/e2e/vendor/k8s.io/client-go/listers/resource/v1beta2/deviceclass.go new file mode 100644 index 000000000..a89e57202 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/listers/resource/v1beta2/deviceclass.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta2 + +import ( + resourcev1beta2 "k8s.io/api/resource/v1beta2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// DeviceClassLister helps list DeviceClasses. +// All objects returned here must be treated as read-only. +type DeviceClassLister interface { + // List lists all DeviceClasses in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*resourcev1beta2.DeviceClass, err error) + // Get retrieves the DeviceClass from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*resourcev1beta2.DeviceClass, error) + DeviceClassListerExpansion +} + +// deviceClassLister implements the DeviceClassLister interface. +type deviceClassLister struct { + listers.ResourceIndexer[*resourcev1beta2.DeviceClass] +} + +// NewDeviceClassLister returns a new DeviceClassLister. +func NewDeviceClassLister(indexer cache.Indexer) DeviceClassLister { + return &deviceClassLister{listers.New[*resourcev1beta2.DeviceClass](indexer, resourcev1beta2.Resource("deviceclass"))} +} diff --git a/e2e/vendor/k8s.io/client-go/listers/resource/v1beta2/expansion_generated.go b/e2e/vendor/k8s.io/client-go/listers/resource/v1beta2/expansion_generated.go new file mode 100644 index 000000000..590f26bd7 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/listers/resource/v1beta2/expansion_generated.go @@ -0,0 +1,43 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta2 + +// DeviceClassListerExpansion allows custom methods to be added to +// DeviceClassLister. +type DeviceClassListerExpansion interface{} + +// ResourceClaimListerExpansion allows custom methods to be added to +// ResourceClaimLister. +type ResourceClaimListerExpansion interface{} + +// ResourceClaimNamespaceListerExpansion allows custom methods to be added to +// ResourceClaimNamespaceLister. +type ResourceClaimNamespaceListerExpansion interface{} + +// ResourceClaimTemplateListerExpansion allows custom methods to be added to +// ResourceClaimTemplateLister. +type ResourceClaimTemplateListerExpansion interface{} + +// ResourceClaimTemplateNamespaceListerExpansion allows custom methods to be added to +// ResourceClaimTemplateNamespaceLister. +type ResourceClaimTemplateNamespaceListerExpansion interface{} + +// ResourceSliceListerExpansion allows custom methods to be added to +// ResourceSliceLister. +type ResourceSliceListerExpansion interface{} diff --git a/e2e/vendor/k8s.io/client-go/listers/resource/v1beta2/resourceclaim.go b/e2e/vendor/k8s.io/client-go/listers/resource/v1beta2/resourceclaim.go new file mode 100644 index 000000000..ec6d40663 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/listers/resource/v1beta2/resourceclaim.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta2 + +import ( + resourcev1beta2 "k8s.io/api/resource/v1beta2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// ResourceClaimLister helps list ResourceClaims. +// All objects returned here must be treated as read-only. +type ResourceClaimLister interface { + // List lists all ResourceClaims in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*resourcev1beta2.ResourceClaim, err error) + // ResourceClaims returns an object that can list and get ResourceClaims. + ResourceClaims(namespace string) ResourceClaimNamespaceLister + ResourceClaimListerExpansion +} + +// resourceClaimLister implements the ResourceClaimLister interface. +type resourceClaimLister struct { + listers.ResourceIndexer[*resourcev1beta2.ResourceClaim] +} + +// NewResourceClaimLister returns a new ResourceClaimLister. +func NewResourceClaimLister(indexer cache.Indexer) ResourceClaimLister { + return &resourceClaimLister{listers.New[*resourcev1beta2.ResourceClaim](indexer, resourcev1beta2.Resource("resourceclaim"))} +} + +// ResourceClaims returns an object that can list and get ResourceClaims. +func (s *resourceClaimLister) ResourceClaims(namespace string) ResourceClaimNamespaceLister { + return resourceClaimNamespaceLister{listers.NewNamespaced[*resourcev1beta2.ResourceClaim](s.ResourceIndexer, namespace)} +} + +// ResourceClaimNamespaceLister helps list and get ResourceClaims. +// All objects returned here must be treated as read-only. +type ResourceClaimNamespaceLister interface { + // List lists all ResourceClaims in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*resourcev1beta2.ResourceClaim, err error) + // Get retrieves the ResourceClaim from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*resourcev1beta2.ResourceClaim, error) + ResourceClaimNamespaceListerExpansion +} + +// resourceClaimNamespaceLister implements the ResourceClaimNamespaceLister +// interface. +type resourceClaimNamespaceLister struct { + listers.ResourceIndexer[*resourcev1beta2.ResourceClaim] +} diff --git a/e2e/vendor/k8s.io/client-go/listers/resource/v1beta2/resourceclaimtemplate.go b/e2e/vendor/k8s.io/client-go/listers/resource/v1beta2/resourceclaimtemplate.go new file mode 100644 index 000000000..8ff19b88e --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/listers/resource/v1beta2/resourceclaimtemplate.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta2 + +import ( + resourcev1beta2 "k8s.io/api/resource/v1beta2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// ResourceClaimTemplateLister helps list ResourceClaimTemplates. +// All objects returned here must be treated as read-only. +type ResourceClaimTemplateLister interface { + // List lists all ResourceClaimTemplates in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*resourcev1beta2.ResourceClaimTemplate, err error) + // ResourceClaimTemplates returns an object that can list and get ResourceClaimTemplates. + ResourceClaimTemplates(namespace string) ResourceClaimTemplateNamespaceLister + ResourceClaimTemplateListerExpansion +} + +// resourceClaimTemplateLister implements the ResourceClaimTemplateLister interface. +type resourceClaimTemplateLister struct { + listers.ResourceIndexer[*resourcev1beta2.ResourceClaimTemplate] +} + +// NewResourceClaimTemplateLister returns a new ResourceClaimTemplateLister. +func NewResourceClaimTemplateLister(indexer cache.Indexer) ResourceClaimTemplateLister { + return &resourceClaimTemplateLister{listers.New[*resourcev1beta2.ResourceClaimTemplate](indexer, resourcev1beta2.Resource("resourceclaimtemplate"))} +} + +// ResourceClaimTemplates returns an object that can list and get ResourceClaimTemplates. +func (s *resourceClaimTemplateLister) ResourceClaimTemplates(namespace string) ResourceClaimTemplateNamespaceLister { + return resourceClaimTemplateNamespaceLister{listers.NewNamespaced[*resourcev1beta2.ResourceClaimTemplate](s.ResourceIndexer, namespace)} +} + +// ResourceClaimTemplateNamespaceLister helps list and get ResourceClaimTemplates. +// All objects returned here must be treated as read-only. +type ResourceClaimTemplateNamespaceLister interface { + // List lists all ResourceClaimTemplates in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*resourcev1beta2.ResourceClaimTemplate, err error) + // Get retrieves the ResourceClaimTemplate from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*resourcev1beta2.ResourceClaimTemplate, error) + ResourceClaimTemplateNamespaceListerExpansion +} + +// resourceClaimTemplateNamespaceLister implements the ResourceClaimTemplateNamespaceLister +// interface. +type resourceClaimTemplateNamespaceLister struct { + listers.ResourceIndexer[*resourcev1beta2.ResourceClaimTemplate] +} diff --git a/e2e/vendor/k8s.io/client-go/listers/resource/v1beta2/resourceslice.go b/e2e/vendor/k8s.io/client-go/listers/resource/v1beta2/resourceslice.go new file mode 100644 index 000000000..f1a817407 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/listers/resource/v1beta2/resourceslice.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta2 + +import ( + resourcev1beta2 "k8s.io/api/resource/v1beta2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// ResourceSliceLister helps list ResourceSlices. +// All objects returned here must be treated as read-only. +type ResourceSliceLister interface { + // List lists all ResourceSlices in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*resourcev1beta2.ResourceSlice, err error) + // Get retrieves the ResourceSlice from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*resourcev1beta2.ResourceSlice, error) + ResourceSliceListerExpansion +} + +// resourceSliceLister implements the ResourceSliceLister interface. +type resourceSliceLister struct { + listers.ResourceIndexer[*resourcev1beta2.ResourceSlice] +} + +// NewResourceSliceLister returns a new ResourceSliceLister. +func NewResourceSliceLister(indexer cache.Indexer) ResourceSliceLister { + return &resourceSliceLister{listers.New[*resourcev1beta2.ResourceSlice](indexer, resourcev1beta2.Resource("resourceslice"))} +} diff --git a/e2e/vendor/k8s.io/client-go/pkg/apis/clientauthentication/doc.go b/e2e/vendor/k8s.io/client-go/pkg/apis/clientauthentication/doc.go index b99459757..486790fa6 100644 --- a/e2e/vendor/k8s.io/client-go/pkg/apis/clientauthentication/doc.go +++ b/e2e/vendor/k8s.io/client-go/pkg/apis/clientauthentication/doc.go @@ -17,4 +17,4 @@ limitations under the License. // +k8s:deepcopy-gen=package // +groupName=client.authentication.k8s.io -package clientauthentication // import "k8s.io/client-go/pkg/apis/clientauthentication" +package clientauthentication diff --git a/e2e/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1/doc.go b/e2e/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1/doc.go index 94ca35c2c..e378b75cf 100644 --- a/e2e/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1/doc.go +++ b/e2e/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1/doc.go @@ -21,4 +21,4 @@ limitations under the License. // +groupName=client.authentication.k8s.io -package v1 // import "k8s.io/client-go/pkg/apis/clientauthentication/v1" +package v1 diff --git a/e2e/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1beta1/doc.go b/e2e/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1beta1/doc.go index 22d1c588b..6eb6a9815 100644 --- a/e2e/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1beta1/doc.go +++ b/e2e/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1beta1/doc.go @@ -21,4 +21,4 @@ limitations under the License. // +groupName=client.authentication.k8s.io -package v1beta1 // import "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1" +package v1beta1 diff --git a/e2e/vendor/k8s.io/client-go/pkg/version/doc.go b/e2e/vendor/k8s.io/client-go/pkg/version/doc.go index 05e997e13..c3ace7451 100644 --- a/e2e/vendor/k8s.io/client-go/pkg/version/doc.go +++ b/e2e/vendor/k8s.io/client-go/pkg/version/doc.go @@ -18,4 +18,4 @@ limitations under the License. // Package version supplies version information collected at build time to // kubernetes components. -package version // import "k8s.io/client-go/pkg/version" +package version diff --git a/e2e/vendor/k8s.io/client-go/rest/.mockery.yaml b/e2e/vendor/k8s.io/client-go/rest/.mockery.yaml new file mode 100644 index 000000000..e21d7b5be --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/rest/.mockery.yaml @@ -0,0 +1,10 @@ +--- +dir: . +filename: "mock_{{.InterfaceName | snakecase}}_test.go" +boilerplate-file: ../../../../../hack/boilerplate/boilerplate.generatego.txt +outpkg: rest +with-expecter: true +packages: + k8s.io/client-go/rest: + interfaces: + BackoffManager: diff --git a/e2e/vendor/k8s.io/client-go/rest/client.go b/e2e/vendor/k8s.io/client-go/rest/client.go index 159caa13f..a085c334f 100644 --- a/e2e/vendor/k8s.io/client-go/rest/client.go +++ b/e2e/vendor/k8s.io/client-go/rest/client.go @@ -93,7 +93,7 @@ type RESTClient struct { content requestClientContentConfigProvider // creates BackoffManager that is passed to requests. - createBackoffMgr func() BackoffManager + createBackoffMgr func() BackoffManagerWithContext // rateLimiter is shared among all requests created by this client unless specifically // overridden. @@ -101,7 +101,7 @@ type RESTClient struct { // warningHandler is shared among all requests created by this client. // If not set, defaultWarningHandler is used. - warningHandler WarningHandler + warningHandler WarningHandlerWithContext // Set specific behavior of the client. If not set http.DefaultClient will be used. Client *http.Client @@ -178,7 +178,7 @@ func (c *RESTClient) GetRateLimiter() flowcontrol.RateLimiter { // readExpBackoffConfig handles the internal logic of determining what the // backoff policy is. By default if no information is available, NoBackoff. // TODO Generalize this see #17727 . -func readExpBackoffConfig() BackoffManager { +func readExpBackoffConfig() BackoffManagerWithContext { backoffBase := os.Getenv(envBackoffBase) backoffDuration := os.Getenv(envBackoffDuration) diff --git a/e2e/vendor/k8s.io/client-go/rest/config.go b/e2e/vendor/k8s.io/client-go/rest/config.go index f2e813d07..82d4f7136 100644 --- a/e2e/vendor/k8s.io/client-go/rest/config.go +++ b/e2e/vendor/k8s.io/client-go/rest/config.go @@ -129,10 +129,23 @@ type Config struct { RateLimiter flowcontrol.RateLimiter // WarningHandler handles warnings in server responses. - // If not set, the default warning handler is used. - // See documentation for SetDefaultWarningHandler() for details. + // If this and WarningHandlerWithContext are not set, the + // default warning handler is used. If both are set, + // WarningHandlerWithContext is used. + // + // See documentation for [SetDefaultWarningHandler] for details. + // + //logcheck:context // WarningHandlerWithContext should be used instead of WarningHandler in code which supports contextual logging. WarningHandler WarningHandler + // WarningHandlerWithContext handles warnings in server responses. + // If this and WarningHandler are not set, the + // default warning handler is used. If both are set, + // WarningHandlerWithContext is used. + // + // See documentation for [SetDefaultWarningHandler] for details. + WarningHandlerWithContext WarningHandlerWithContext + // The maximum length of time to wait before giving up on a server request. A value of zero means no timeout. Timeout time.Duration @@ -381,12 +394,27 @@ func RESTClientForConfigAndClient(config *Config, httpClient *http.Client) (*RES } restClient, err := NewRESTClient(baseURL, versionedAPIPath, clientContent, rateLimiter, httpClient) - if err == nil && config.WarningHandler != nil { - restClient.warningHandler = config.WarningHandler - } + maybeSetWarningHandler(restClient, config.WarningHandler, config.WarningHandlerWithContext) return restClient, err } +// maybeSetWarningHandler sets the handlerWithContext if non-nil, +// otherwise the handler with a wrapper if non-nil, +// and does nothing if both are nil. +// +// May be called for a nil client. +func maybeSetWarningHandler(c *RESTClient, handler WarningHandler, handlerWithContext WarningHandlerWithContext) { + if c == nil { + return + } + switch { + case handlerWithContext != nil: + c.warningHandler = handlerWithContext + case handler != nil: + c.warningHandler = warningLoggerNopContext{l: handler} + } +} + // UnversionedRESTClientFor is the same as RESTClientFor, except that it allows // the config.Version to be empty. func UnversionedRESTClientFor(config *Config) (*RESTClient, error) { @@ -448,9 +476,7 @@ func UnversionedRESTClientForConfigAndClient(config *Config, httpClient *http.Cl } restClient, err := NewRESTClient(baseURL, versionedAPIPath, clientContent, rateLimiter, httpClient) - if err == nil && config.WarningHandler != nil { - restClient.warningHandler = config.WarningHandler - } + maybeSetWarningHandler(restClient, config.WarningHandler, config.WarningHandlerWithContext) return restClient, err } @@ -532,6 +558,7 @@ func InClusterConfig() (*Config, error) { tlsClientConfig := TLSClientConfig{} if _, err := certutil.NewPool(rootCAFile); err != nil { + //nolint:logcheck // The decision to log this instead of returning an error goes back to ~2016. It's part of the client-go API now, so not changing it just to support contextual logging. klog.Errorf("Expected to load root CA config from %s, but got err: %v", rootCAFile, err) } else { tlsClientConfig.CAFile = rootCAFile @@ -616,15 +643,16 @@ func AnonymousClientConfig(config *Config) *Config { CAData: config.TLSClientConfig.CAData, NextProtos: config.TLSClientConfig.NextProtos, }, - RateLimiter: config.RateLimiter, - WarningHandler: config.WarningHandler, - UserAgent: config.UserAgent, - DisableCompression: config.DisableCompression, - QPS: config.QPS, - Burst: config.Burst, - Timeout: config.Timeout, - Dial: config.Dial, - Proxy: config.Proxy, + RateLimiter: config.RateLimiter, + WarningHandler: config.WarningHandler, + WarningHandlerWithContext: config.WarningHandlerWithContext, + UserAgent: config.UserAgent, + DisableCompression: config.DisableCompression, + QPS: config.QPS, + Burst: config.Burst, + Timeout: config.Timeout, + Dial: config.Dial, + Proxy: config.Proxy, } } @@ -658,17 +686,18 @@ func CopyConfig(config *Config) *Config { CAData: config.TLSClientConfig.CAData, NextProtos: config.TLSClientConfig.NextProtos, }, - UserAgent: config.UserAgent, - DisableCompression: config.DisableCompression, - Transport: config.Transport, - WrapTransport: config.WrapTransport, - QPS: config.QPS, - Burst: config.Burst, - RateLimiter: config.RateLimiter, - WarningHandler: config.WarningHandler, - Timeout: config.Timeout, - Dial: config.Dial, - Proxy: config.Proxy, + UserAgent: config.UserAgent, + DisableCompression: config.DisableCompression, + Transport: config.Transport, + WrapTransport: config.WrapTransport, + QPS: config.QPS, + Burst: config.Burst, + RateLimiter: config.RateLimiter, + WarningHandler: config.WarningHandler, + WarningHandlerWithContext: config.WarningHandlerWithContext, + Timeout: config.Timeout, + Dial: config.Dial, + Proxy: config.Proxy, } if config.ExecProvider != nil && config.ExecProvider.Config != nil { c.ExecProvider.Config = config.ExecProvider.Config.DeepCopyObject() diff --git a/e2e/vendor/k8s.io/client-go/rest/plugin.go b/e2e/vendor/k8s.io/client-go/rest/plugin.go index ae5cbdc2c..f7a4e4f34 100644 --- a/e2e/vendor/k8s.io/client-go/rest/plugin.go +++ b/e2e/vendor/k8s.io/client-go/rest/plugin.go @@ -21,8 +21,6 @@ import ( "net/http" "sync" - "k8s.io/klog/v2" - clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) @@ -65,7 +63,10 @@ func RegisterAuthProviderPlugin(name string, plugin Factory) error { if _, found := plugins[name]; found { return fmt.Errorf("auth Provider Plugin %q was registered twice", name) } - klog.V(4).Infof("Registered Auth Provider Plugin %q", name) + // RegisterAuthProviderPlugin gets called during the init phase before + // logging is initialized and therefore should not emit logs. If you + // need this message for debugging something, then uncomment it. + // klog.V(4).Infof("Registered Auth Provider Plugin %q", name) plugins[name] = plugin return nil } diff --git a/e2e/vendor/k8s.io/client-go/rest/request.go b/e2e/vendor/k8s.io/client-go/rest/request.go index 0ec90ad18..1eb2f9b42 100644 --- a/e2e/vendor/k8s.io/client-go/rest/request.go +++ b/e2e/vendor/k8s.io/client-go/rest/request.go @@ -54,7 +54,7 @@ import ( "k8s.io/utils/clock" ) -var ( +const ( // longThrottleLatency defines threshold for logging requests. All requests being // throttled (via the provided rateLimiter) for more than longThrottleLatency will // be logged. @@ -103,10 +103,10 @@ type Request struct { contentConfig ClientContentConfig contentTypeNotSet bool - warningHandler WarningHandler + warningHandler WarningHandlerWithContext rateLimiter flowcontrol.RateLimiter - backoff BackoffManager + backoff BackoffManagerWithContext timeout time.Duration maxRetries int @@ -136,7 +136,7 @@ type Request struct { // NewRequest creates a new request helper object for accessing runtime.Objects on a server. func NewRequest(c *RESTClient) *Request { - var backoff BackoffManager + var backoff BackoffManagerWithContext if c.createBackoffMgr != nil { backoff = c.createBackoffMgr() } @@ -259,20 +259,47 @@ func (r *Request) Resource(resource string) *Request { } // BackOff sets the request's backoff manager to the one specified, -// or defaults to the stub implementation if nil is provided +// or defaults to the stub implementation if nil is provided. +// +// Deprecated: BackoffManager.Sleep ignores the caller's context. Use BackOffWithContext and BackoffManagerWithContext instead. func (r *Request) BackOff(manager BackoffManager) *Request { if manager == nil { r.backoff = &NoBackoff{} return r } + r.backoff = &backoffManagerNopContext{BackoffManager: manager} + return r +} + +// BackOffWithContext sets the request's backoff manager to the one specified, +// or defaults to the stub implementation if nil is provided. +func (r *Request) BackOffWithContext(manager BackoffManagerWithContext) *Request { + if manager == nil { + r.backoff = &NoBackoff{} + return r + } + r.backoff = manager return r } // WarningHandler sets the handler this client uses when warning headers are encountered. -// If set to nil, this client will use the default warning handler (see SetDefaultWarningHandler). +// If set to nil, this client will use the default warning handler (see [SetDefaultWarningHandler]). +// +//logcheck:context // WarningHandlerWithContext should be used instead of WarningHandler in code which supports contextual logging. func (r *Request) WarningHandler(handler WarningHandler) *Request { + if handler == nil { + r.warningHandler = nil + return r + } + r.warningHandler = warningLoggerNopContext{l: handler} + return r +} + +// WarningHandlerWithContext sets the handler this client uses when warning headers are encountered. +// If set to nil, this client will use the default warning handler (see [SetDefaultWarningHandlerWithContext]). +func (r *Request) WarningHandlerWithContext(handler WarningHandlerWithContext) *Request { r.warningHandler = handler return r } @@ -649,21 +676,17 @@ func (r *Request) tryThrottleWithInfo(ctx context.Context, retryInfo string) err } latency := time.Since(now) - var message string - switch { - case len(retryInfo) > 0: - message = fmt.Sprintf("Waited for %v, %s - request: %s:%s", latency, retryInfo, r.verb, r.URL().String()) - default: - message = fmt.Sprintf("Waited for %v due to client-side throttling, not priority and fairness, request: %s:%s", latency, r.verb, r.URL().String()) - } - if latency > longThrottleLatency { - klog.V(3).Info(message) - } - if latency > extraLongThrottleLatency { - // If the rate limiter latency is very high, the log message should be printed at a higher log level, - // but we use a throttled logger to prevent spamming. - globalThrottledLogger.Infof("%s", message) + if retryInfo == "" { + retryInfo = "client-side throttling, not priority and fairness" + } + klog.FromContext(ctx).V(3).Info("Waited before sending request", "delay", latency, "reason", retryInfo, "verb", r.verb, "URL", r.URL()) + + if latency > extraLongThrottleLatency { + // If the rate limiter latency is very high, the log message should be printed at a higher log level, + // but we use a throttled logger to prevent spamming. + globalThrottledLogger.info(klog.FromContext(ctx), "Waited before sending request", "delay", latency, "reason", retryInfo, "verb", r.verb, "URL", r.URL()) + } } metrics.RateLimiterLatency.Observe(ctx, r.verb, r.finalURLTemplate(), latency) @@ -675,7 +698,7 @@ func (r *Request) tryThrottle(ctx context.Context) error { } type throttleSettings struct { - logLevel klog.Level + logLevel int minLogInterval time.Duration lastLogTime time.Time @@ -700,9 +723,9 @@ var globalThrottledLogger = &throttledLogger{ }, } -func (b *throttledLogger) attemptToLog() (klog.Level, bool) { +func (b *throttledLogger) attemptToLog(logger klog.Logger) (int, bool) { for _, setting := range b.settings { - if bool(klog.V(setting.logLevel).Enabled()) { + if bool(logger.V(setting.logLevel).Enabled()) { // Return early without write locking if possible. if func() bool { setting.lock.RLock() @@ -724,9 +747,9 @@ func (b *throttledLogger) attemptToLog() (klog.Level, bool) { // Infof will write a log message at each logLevel specified by the receiver's throttleSettings // as long as it hasn't written a log message more recently than minLogInterval. -func (b *throttledLogger) Infof(message string, args ...interface{}) { - if logLevel, ok := b.attemptToLog(); ok { - klog.V(logLevel).Infof(message, args...) +func (b *throttledLogger) info(logger klog.Logger, message string, kv ...any) { + if logLevel, ok := b.attemptToLog(logger); ok { + logger.V(logLevel).Info(message, kv...) } } @@ -739,7 +762,7 @@ func (r *Request) Watch(ctx context.Context) (watch.Interface, error) { func (r *Request) watchInternal(ctx context.Context) (watch.Interface, runtime.Decoder, error) { if r.body == nil { - logBody(ctx, 2, "Request Body", r.bodyBytes) + logBody(klog.FromContext(ctx), 2, "Request Body", r.bodyBytes) } // We specifically don't want to rate limit watches, so we @@ -776,7 +799,7 @@ func (r *Request) watchInternal(ctx context.Context) (watch.Interface, runtime.D resp, err := client.Do(req) retry.After(ctx, r, resp, err) if err == nil && resp.StatusCode == http.StatusOK { - return r.newStreamWatcher(resp) + return r.newStreamWatcher(ctx, resp) } done, transformErr := func() (bool, error) { @@ -898,7 +921,7 @@ func (r WatchListResult) Into(obj runtime.Object) error { // to see what parameters are currently required. func (r *Request) WatchList(ctx context.Context) WatchListResult { if r.body == nil { - logBody(ctx, 2, "Request Body", r.bodyBytes) + logBody(klog.FromContext(ctx), 2, "Request Body", r.bodyBytes) } if !clientfeatures.FeatureGates().Enabled(clientfeatures.WatchListClient) { @@ -969,23 +992,24 @@ func (r *Request) handleWatchList(ctx context.Context, w watch.Interface, negoti } } -func (r *Request) newStreamWatcher(resp *http.Response) (watch.Interface, runtime.Decoder, error) { +func (r *Request) newStreamWatcher(ctx context.Context, resp *http.Response) (watch.Interface, runtime.Decoder, error) { contentType := resp.Header.Get("Content-Type") mediaType, params, err := mime.ParseMediaType(contentType) if err != nil { - klog.V(4).Infof("Unexpected content type from the server: %q: %v", contentType, err) + klog.FromContext(ctx).V(4).Info("Unexpected content type from the server", "contentType", contentType, "err", err) } objectDecoder, streamingSerializer, framer, err := r.contentConfig.Negotiator.StreamDecoder(mediaType, params) if err != nil { return nil, nil, err } - handleWarnings(resp.Header, r.warningHandler) + handleWarnings(ctx, resp.Header, r.warningHandler) frameReader := framer.NewFrameReader(resp.Body) watchEventDecoder := streaming.NewDecoder(frameReader, streamingSerializer) - return watch.NewStreamWatcher( + return watch.NewStreamWatcherWithLogger( + klog.FromContext(ctx), restclientwatch.NewDecoder(watchEventDecoder, objectDecoder), // use 500 to indicate that the cause of the error is unknown - other error codes // are more specific to HTTP interactions, and set a reason @@ -1031,7 +1055,7 @@ func sanitize(req *Request, resp *http.Response, err error) (string, string) { // If we can, we return that as an error. Otherwise, we create an error that lists the http status and the content of the response. func (r *Request) Stream(ctx context.Context) (io.ReadCloser, error) { if r.body == nil { - logBody(ctx, 2, "Request Body", r.bodyBytes) + logBody(klog.FromContext(ctx), 2, "Request Body", r.bodyBytes) } if r.err != nil { @@ -1067,7 +1091,7 @@ func (r *Request) Stream(ctx context.Context) (io.ReadCloser, error) { switch { case (resp.StatusCode >= 200) && (resp.StatusCode < 300): - handleWarnings(resp.Header, r.warningHandler) + handleWarnings(ctx, resp.Header, r.warningHandler) return resp.Body, nil default: @@ -1175,7 +1199,7 @@ func (r *Request) request(ctx context.Context, fn func(*http.Request, *http.Resp }() if r.err != nil { - klog.V(4).Infof("Error in request: %v", r.err) + klog.FromContext(ctx).V(4).Info("Error in request", "err", r.err) return r.err } @@ -1267,8 +1291,9 @@ func (r *Request) request(ctx context.Context, fn func(*http.Request, *http.Resp // - If the server responds with a status: *errors.StatusError or *errors.UnexpectedObjectError // - http.Client.Do errors are returned directly. func (r *Request) Do(ctx context.Context) Result { + logger := klog.FromContext(ctx) if r.body == nil { - logBody(ctx, 2, "Request Body", r.bodyBytes) + logBody(logger, 2, "Request Body", r.bodyBytes) } var result Result @@ -1276,7 +1301,7 @@ func (r *Request) Do(ctx context.Context) Result { result = r.transformResponse(ctx, resp, req) }) if err != nil { - return Result{err: err} + return Result{err: err, logger: logger} } if result.err == nil || len(result.body) > 0 { metrics.ResponseSize.Observe(ctx, r.verb, r.URL().Host, float64(len(result.body))) @@ -1286,14 +1311,15 @@ func (r *Request) Do(ctx context.Context) Result { // DoRaw executes the request but does not process the response body. func (r *Request) DoRaw(ctx context.Context) ([]byte, error) { + logger := klog.FromContext(ctx) if r.body == nil { - logBody(ctx, 2, "Request Body", r.bodyBytes) + logBody(logger, 2, "Request Body", r.bodyBytes) } var result Result err := r.request(ctx, func(req *http.Request, resp *http.Response) { result.body, result.err = io.ReadAll(resp.Body) - logBody(ctx, 2, "Response Body", result.body) + logBody(logger, 2, "Response Body", result.body) if resp.StatusCode < http.StatusOK || resp.StatusCode > http.StatusPartialContent { result.err = r.transformUnstructuredResponseError(resp, req, result.body) } @@ -1309,6 +1335,7 @@ func (r *Request) DoRaw(ctx context.Context) ([]byte, error) { // transformResponse converts an API response into a structured API object func (r *Request) transformResponse(ctx context.Context, resp *http.Response, req *http.Request) Result { + logger := klog.FromContext(ctx) var body []byte if resp.Body != nil { data, err := io.ReadAll(resp.Body) @@ -1323,22 +1350,24 @@ func (r *Request) transformResponse(ctx context.Context, resp *http.Response, re // 2. Apiserver sends back the headers and then part of the body // 3. Apiserver closes connection. // 4. client-go should catch this and return an error. - klog.V(2).Infof("Stream error %#v when reading response body, may be caused by closed connection.", err) + logger.V(2).Info("Stream error when reading response body, may be caused by closed connection", "err", err) streamErr := fmt.Errorf("stream error when reading response body, may be caused by closed connection. Please retry. Original error: %w", err) return Result{ - err: streamErr, + err: streamErr, + logger: logger, } default: - klog.Errorf("Unexpected error when reading response body: %v", err) + logger.Error(err, "Unexpected error when reading response body") unexpectedErr := fmt.Errorf("unexpected error when reading response body. Please retry. Original error: %w", err) return Result{ - err: unexpectedErr, + err: unexpectedErr, + logger: logger, } } } // Call depth is tricky. This one is okay for Do and DoRaw. - logBody(ctx, 7, "Response Body", body) + logBody(logger, 7, "Response Body", body) // verify the content type is accurate var decoder runtime.Decoder @@ -1350,7 +1379,7 @@ func (r *Request) transformResponse(ctx context.Context, resp *http.Response, re var err error mediaType, params, err := mime.ParseMediaType(contentType) if err != nil { - return Result{err: errors.NewInternalError(err)} + return Result{err: errors.NewInternalError(err), logger: logger} } decoder, err = r.contentConfig.Negotiator.Decoder(mediaType, params) if err != nil { @@ -1359,13 +1388,14 @@ func (r *Request) transformResponse(ctx context.Context, resp *http.Response, re case resp.StatusCode == http.StatusSwitchingProtocols: // no-op, we've been upgraded case resp.StatusCode < http.StatusOK || resp.StatusCode > http.StatusPartialContent: - return Result{err: r.transformUnstructuredResponseError(resp, req, body)} + return Result{err: r.transformUnstructuredResponseError(resp, req, body), logger: logger} } return Result{ body: body, contentType: contentType, statusCode: resp.StatusCode, - warnings: handleWarnings(resp.Header, r.warningHandler), + warnings: handleWarnings(ctx, resp.Header, r.warningHandler), + logger: logger, } } } @@ -1384,7 +1414,8 @@ func (r *Request) transformResponse(ctx context.Context, resp *http.Response, re statusCode: resp.StatusCode, decoder: decoder, err: err, - warnings: handleWarnings(resp.Header, r.warningHandler), + warnings: handleWarnings(ctx, resp.Header, r.warningHandler), + logger: logger, } } @@ -1393,7 +1424,8 @@ func (r *Request) transformResponse(ctx context.Context, resp *http.Response, re contentType: contentType, statusCode: resp.StatusCode, decoder: decoder, - warnings: handleWarnings(resp.Header, r.warningHandler), + warnings: handleWarnings(ctx, resp.Header, r.warningHandler), + logger: logger, } } @@ -1421,8 +1453,7 @@ func truncateBody(logger klog.Logger, body string) string { // whether the body is printable. // // It needs to be called by all functions which send or receive the data. -func logBody(ctx context.Context, callDepth int, prefix string, body []byte) { - logger := klog.FromContext(ctx) +func logBody(logger klog.Logger, callDepth int, prefix string, body []byte) { if loggerV := logger.V(8); loggerV.Enabled() { loggerV := loggerV.WithCallDepth(callDepth) if bytes.IndexFunc(body, func(r rune) bool { @@ -1524,6 +1555,7 @@ type Result struct { contentType string err error statusCode int + logger klog.Logger decoder runtime.Decoder } @@ -1629,7 +1661,7 @@ func (r Result) Error() error { // to be backwards compatible with old servers that do not return a version, default to "v1" out, _, err := r.decoder.Decode(r.body, &schema.GroupVersionKind{Version: "v1"}, nil) if err != nil { - klog.V(5).Infof("body was not decodable (unable to check for Status): %v", err) + r.logger.V(5).Info("Body was not decodable (unable to check for Status)", "err", err) return r.err } switch t := out.(type) { diff --git a/e2e/vendor/k8s.io/client-go/rest/urlbackoff.go b/e2e/vendor/k8s.io/client-go/rest/urlbackoff.go index 2f9962d7e..5b7b4e216 100644 --- a/e2e/vendor/k8s.io/client-go/rest/urlbackoff.go +++ b/e2e/vendor/k8s.io/client-go/rest/urlbackoff.go @@ -17,6 +17,8 @@ limitations under the License. package rest import ( + "context" + "fmt" "net/url" "time" @@ -32,12 +34,24 @@ import ( var serverIsOverloadedSet = sets.NewInt(429) var maxResponseCode = 499 +//go:generate mockery + +// Deprecated: BackoffManager.Sleep ignores the caller's context. Use BackoffManagerWithContext instead. type BackoffManager interface { - UpdateBackoff(actualUrl *url.URL, err error, responseCode int) - CalculateBackoff(actualUrl *url.URL) time.Duration + UpdateBackoff(actualURL *url.URL, err error, responseCode int) + CalculateBackoff(actualURL *url.URL) time.Duration Sleep(d time.Duration) } +type BackoffManagerWithContext interface { + UpdateBackoffWithContext(ctx context.Context, actualURL *url.URL, err error, responseCode int) + CalculateBackoffWithContext(ctx context.Context, actualURL *url.URL) time.Duration + SleepWithContext(ctx context.Context, d time.Duration) +} + +var _ BackoffManager = &URLBackoff{} +var _ BackoffManagerWithContext = &URLBackoff{} + // URLBackoff struct implements the semantics on top of Backoff which // we need for URL specific exponential backoff. type URLBackoff struct { @@ -49,11 +63,19 @@ type URLBackoff struct { type NoBackoff struct { } -func (n *NoBackoff) UpdateBackoff(actualUrl *url.URL, err error, responseCode int) { +func (n *NoBackoff) UpdateBackoff(actualURL *url.URL, err error, responseCode int) { // do nothing. } -func (n *NoBackoff) CalculateBackoff(actualUrl *url.URL) time.Duration { +func (n *NoBackoff) UpdateBackoffWithContext(ctx context.Context, actualURL *url.URL, err error, responseCode int) { + // do nothing. +} + +func (n *NoBackoff) CalculateBackoff(actualURL *url.URL) time.Duration { + return 0 * time.Second +} + +func (n *NoBackoff) CalculateBackoffWithContext(ctx context.Context, actualURL *url.URL) time.Duration { return 0 * time.Second } @@ -61,10 +83,21 @@ func (n *NoBackoff) Sleep(d time.Duration) { time.Sleep(d) } +func (n *NoBackoff) SleepWithContext(ctx context.Context, d time.Duration) { + if d == 0 { + return + } + t := time.NewTimer(d) + defer t.Stop() + select { + case <-ctx.Done(): + case <-t.C: + } +} + // Disable makes the backoff trivial, i.e., sets it to zero. This might be used // by tests which want to run 1000s of mock requests without slowing down. func (b *URLBackoff) Disable() { - klog.V(4).Infof("Disabling backoff strategy") b.Backoff = flowcontrol.NewBackOff(0*time.Second, 0*time.Second) } @@ -76,32 +109,74 @@ func (b *URLBackoff) baseUrlKey(rawurl *url.URL) string { // in the future. host, err := url.Parse(rawurl.String()) if err != nil { - klog.V(4).Infof("Error extracting url: %v", rawurl) - panic("bad url!") + panic(fmt.Sprintf("Error parsing bad URL %q: %v", rawurl, err)) } return host.Host } // UpdateBackoff updates backoff metadata -func (b *URLBackoff) UpdateBackoff(actualUrl *url.URL, err error, responseCode int) { +func (b *URLBackoff) UpdateBackoff(actualURL *url.URL, err error, responseCode int) { + b.UpdateBackoffWithContext(context.Background(), actualURL, err, responseCode) +} + +// UpdateBackoffWithContext updates backoff metadata +func (b *URLBackoff) UpdateBackoffWithContext(ctx context.Context, actualURL *url.URL, err error, responseCode int) { // range for retry counts that we store is [0,13] if responseCode > maxResponseCode || serverIsOverloadedSet.Has(responseCode) { - b.Backoff.Next(b.baseUrlKey(actualUrl), b.Backoff.Clock.Now()) + b.Backoff.Next(b.baseUrlKey(actualURL), b.Backoff.Clock.Now()) return } else if responseCode >= 300 || err != nil { - klog.V(4).Infof("Client is returning errors: code %v, error %v", responseCode, err) + klog.FromContext(ctx).V(4).Info("Client is returning errors", "code", responseCode, "err", err) } //If we got this far, there is no backoff required for this URL anymore. - b.Backoff.Reset(b.baseUrlKey(actualUrl)) + b.Backoff.Reset(b.baseUrlKey(actualURL)) } // CalculateBackoff takes a url and back's off exponentially, // based on its knowledge of existing failures. -func (b *URLBackoff) CalculateBackoff(actualUrl *url.URL) time.Duration { - return b.Backoff.Get(b.baseUrlKey(actualUrl)) +func (b *URLBackoff) CalculateBackoff(actualURL *url.URL) time.Duration { + return b.Backoff.Get(b.baseUrlKey(actualURL)) +} + +// CalculateBackoffWithContext takes a url and back's off exponentially, +// based on its knowledge of existing failures. +func (b *URLBackoff) CalculateBackoffWithContext(ctx context.Context, actualURL *url.URL) time.Duration { + return b.Backoff.Get(b.baseUrlKey(actualURL)) } func (b *URLBackoff) Sleep(d time.Duration) { b.Backoff.Clock.Sleep(d) } + +func (b *URLBackoff) SleepWithContext(ctx context.Context, d time.Duration) { + if d == 0 { + return + } + t := b.Backoff.Clock.NewTimer(d) + defer t.Stop() + select { + case <-ctx.Done(): + case <-t.C(): + } +} + +// backoffManagerNopContext wraps a BackoffManager and adds the *WithContext methods. +type backoffManagerNopContext struct { + BackoffManager +} + +var _ BackoffManager = &backoffManagerNopContext{} +var _ BackoffManagerWithContext = &backoffManagerNopContext{} + +func (b *backoffManagerNopContext) UpdateBackoffWithContext(ctx context.Context, actualURL *url.URL, err error, responseCode int) { + b.UpdateBackoff(actualURL, err, responseCode) +} + +func (b *backoffManagerNopContext) CalculateBackoffWithContext(ctx context.Context, actualURL *url.URL) time.Duration { + return b.CalculateBackoff(actualURL) +} + +func (b *backoffManagerNopContext) SleepWithContext(ctx context.Context, d time.Duration) { + b.Sleep(d) +} diff --git a/e2e/vendor/k8s.io/client-go/rest/warnings.go b/e2e/vendor/k8s.io/client-go/rest/warnings.go index ad493659f..713b2d64d 100644 --- a/e2e/vendor/k8s.io/client-go/rest/warnings.go +++ b/e2e/vendor/k8s.io/client-go/rest/warnings.go @@ -17,6 +17,7 @@ limitations under the License. package rest import ( + "context" "fmt" "io" "net/http" @@ -33,8 +34,15 @@ type WarningHandler interface { HandleWarningHeader(code int, agent string, text string) } +// WarningHandlerWithContext is an interface for handling warning headers with +// support for contextual logging. +type WarningHandlerWithContext interface { + // HandleWarningHeaderWithContext is called with the warn code, agent, and text when a warning header is countered. + HandleWarningHeaderWithContext(ctx context.Context, code int, agent string, text string) +} + var ( - defaultWarningHandler WarningHandler = WarningLogger{} + defaultWarningHandler WarningHandlerWithContext = WarningLogger{} defaultWarningHandlerLock sync.RWMutex ) @@ -43,33 +51,68 @@ var ( // - NoWarnings suppresses warnings. // - WarningLogger logs warnings. // - NewWarningWriter() outputs warnings to the provided writer. +// +// logcheck:context // SetDefaultWarningHandlerWithContext should be used instead of SetDefaultWarningHandler in code which supports contextual logging. func SetDefaultWarningHandler(l WarningHandler) { + if l == nil { + SetDefaultWarningHandlerWithContext(nil) + return + } + SetDefaultWarningHandlerWithContext(warningLoggerNopContext{l: l}) +} + +// SetDefaultWarningHandlerWithContext is a variant of [SetDefaultWarningHandler] which supports contextual logging. +func SetDefaultWarningHandlerWithContext(l WarningHandlerWithContext) { defaultWarningHandlerLock.Lock() defer defaultWarningHandlerLock.Unlock() defaultWarningHandler = l } -func getDefaultWarningHandler() WarningHandler { + +func getDefaultWarningHandler() WarningHandlerWithContext { defaultWarningHandlerLock.RLock() defer defaultWarningHandlerLock.RUnlock() l := defaultWarningHandler return l } -// NoWarnings is an implementation of WarningHandler that suppresses warnings. +type warningLoggerNopContext struct { + l WarningHandler +} + +func (w warningLoggerNopContext) HandleWarningHeaderWithContext(_ context.Context, code int, agent string, message string) { + w.l.HandleWarningHeader(code, agent, message) +} + +// NoWarnings is an implementation of [WarningHandler] and [WarningHandlerWithContext] that suppresses warnings. type NoWarnings struct{} func (NoWarnings) HandleWarningHeader(code int, agent string, message string) {} +func (NoWarnings) HandleWarningHeaderWithContext(ctx context.Context, code int, agent string, message string) { +} -// WarningLogger is an implementation of WarningHandler that logs code 299 warnings +var _ WarningHandler = NoWarnings{} +var _ WarningHandlerWithContext = NoWarnings{} + +// WarningLogger is an implementation of [WarningHandler] and [WarningHandlerWithContext] that logs code 299 warnings type WarningLogger struct{} func (WarningLogger) HandleWarningHeader(code int, agent string, message string) { if code != 299 || len(message) == 0 { return } - klog.Warning(message) + klog.Background().Info("Warning: " + message) } +func (WarningLogger) HandleWarningHeaderWithContext(ctx context.Context, code int, agent string, message string) { + if code != 299 || len(message) == 0 { + return + } + klog.FromContext(ctx).Info("Warning: " + message) +} + +var _ WarningHandler = WarningLogger{} +var _ WarningHandlerWithContext = WarningLogger{} + type warningWriter struct { // out is the writer to output warnings to out io.Writer @@ -134,14 +177,14 @@ func (w *warningWriter) WarningCount() int { return w.writtenCount } -func handleWarnings(headers http.Header, handler WarningHandler) []net.WarningHeader { +func handleWarnings(ctx context.Context, headers http.Header, handler WarningHandlerWithContext) []net.WarningHeader { if handler == nil { handler = getDefaultWarningHandler() } warnings, _ := net.ParseWarningHeaders(headers["Warning"]) for _, warning := range warnings { - handler.HandleWarningHeader(warning.Code, warning.Agent, warning.Text) + handler.HandleWarningHeaderWithContext(ctx, warning.Code, warning.Agent, warning.Text) } return warnings } diff --git a/e2e/vendor/k8s.io/client-go/rest/with_retry.go b/e2e/vendor/k8s.io/client-go/rest/with_retry.go index eaaadc6a4..e211c39d4 100644 --- a/e2e/vendor/k8s.io/client-go/rest/with_retry.go +++ b/e2e/vendor/k8s.io/client-go/rest/with_retry.go @@ -209,18 +209,18 @@ func (r *withRetry) Before(ctx context.Context, request *Request) error { // we do a backoff sleep before the first attempt is made, // (preserving current behavior). if request.backoff != nil { - request.backoff.Sleep(request.backoff.CalculateBackoff(url)) + request.backoff.SleepWithContext(ctx, request.backoff.CalculateBackoffWithContext(ctx, url)) } return nil } // if we are here, we have made attempt(s) at least once before. if request.backoff != nil { - delay := request.backoff.CalculateBackoff(url) + delay := request.backoff.CalculateBackoffWithContext(ctx, url) if r.retryAfter.Wait > delay { delay = r.retryAfter.Wait } - request.backoff.Sleep(delay) + request.backoff.SleepWithContext(ctx, delay) } // We are retrying the request that we already send to @@ -231,7 +231,7 @@ func (r *withRetry) Before(ctx context.Context, request *Request) error { return err } - klog.V(4).Infof("Got a Retry-After %s response for attempt %d to %v", r.retryAfter.Wait, r.retryAfter.Attempt, request.URL().String()) + klog.FromContext(ctx).V(4).Info("Got a Retry-After response", "delay", r.retryAfter.Wait, "attempt", r.retryAfter.Attempt, "url", request.URL()) return nil } @@ -258,9 +258,9 @@ func (r *withRetry) After(ctx context.Context, request *Request, resp *http.Resp if request.c.base != nil { if err != nil { - request.backoff.UpdateBackoff(request.URL(), err, 0) + request.backoff.UpdateBackoffWithContext(ctx, request.URL(), err, 0) } else { - request.backoff.UpdateBackoff(request.URL(), err, resp.StatusCode) + request.backoff.UpdateBackoffWithContext(ctx, request.URL(), err, resp.StatusCode) } } } diff --git a/e2e/vendor/k8s.io/client-go/scale/doc.go b/e2e/vendor/k8s.io/client-go/scale/doc.go index b6fa3f5f2..59fd39146 100644 --- a/e2e/vendor/k8s.io/client-go/scale/doc.go +++ b/e2e/vendor/k8s.io/client-go/scale/doc.go @@ -18,4 +18,4 @@ limitations under the License. // and updating Scale for any resource which implements the `scale` subresource, // as long as that subresource operates on a version of scale convertable to // autoscaling.Scale. -package scale // import "k8s.io/client-go/scale" +package scale diff --git a/e2e/vendor/k8s.io/client-go/scale/scheme/appsint/doc.go b/e2e/vendor/k8s.io/client-go/scale/scheme/appsint/doc.go index 735efb953..16f29e2af 100644 --- a/e2e/vendor/k8s.io/client-go/scale/scheme/appsint/doc.go +++ b/e2e/vendor/k8s.io/client-go/scale/scheme/appsint/doc.go @@ -19,4 +19,4 @@ limitations under the License. // It doesn't have any of its own types -- it's just necessary to // get the expected behavior out of runtime.Scheme.ConvertToVersion // and associated methods. -package appsint // import "k8s.io/client-go/scale/scheme/appsint" +package appsint diff --git a/e2e/vendor/k8s.io/client-go/scale/scheme/appsv1beta1/doc.go b/e2e/vendor/k8s.io/client-go/scale/scheme/appsv1beta1/doc.go index aea95e2e4..b9e8cf63d 100644 --- a/e2e/vendor/k8s.io/client-go/scale/scheme/appsv1beta1/doc.go +++ b/e2e/vendor/k8s.io/client-go/scale/scheme/appsv1beta1/doc.go @@ -17,4 +17,4 @@ limitations under the License. // +k8s:conversion-gen=k8s.io/client-go/scale/scheme // +k8s:conversion-gen-external-types=k8s.io/api/apps/v1beta1 -package appsv1beta1 // import "k8s.io/client-go/scale/scheme/appsv1beta1" +package appsv1beta1 diff --git a/e2e/vendor/k8s.io/client-go/scale/scheme/appsv1beta2/doc.go b/e2e/vendor/k8s.io/client-go/scale/scheme/appsv1beta2/doc.go index d1ae2118e..b224c4da6 100644 --- a/e2e/vendor/k8s.io/client-go/scale/scheme/appsv1beta2/doc.go +++ b/e2e/vendor/k8s.io/client-go/scale/scheme/appsv1beta2/doc.go @@ -17,4 +17,4 @@ limitations under the License. // +k8s:conversion-gen=k8s.io/client-go/scale/scheme // +k8s:conversion-gen-external-types=k8s.io/api/apps/v1beta2 -package appsv1beta2 // import "k8s.io/client-go/scale/scheme/appsv1beta2" +package appsv1beta2 diff --git a/e2e/vendor/k8s.io/client-go/scale/scheme/autoscalingv1/doc.go b/e2e/vendor/k8s.io/client-go/scale/scheme/autoscalingv1/doc.go index 25f23d2d8..2741a8a45 100644 --- a/e2e/vendor/k8s.io/client-go/scale/scheme/autoscalingv1/doc.go +++ b/e2e/vendor/k8s.io/client-go/scale/scheme/autoscalingv1/doc.go @@ -17,4 +17,4 @@ limitations under the License. // +k8s:conversion-gen=k8s.io/client-go/scale/scheme // +k8s:conversion-gen-external-types=k8s.io/api/autoscaling/v1 -package autoscalingv1 // import "k8s.io/client-go/scale/scheme/autoscalingv1" +package autoscalingv1 diff --git a/e2e/vendor/k8s.io/client-go/scale/scheme/doc.go b/e2e/vendor/k8s.io/client-go/scale/scheme/doc.go index 248b448a5..0203d6d5a 100644 --- a/e2e/vendor/k8s.io/client-go/scale/scheme/doc.go +++ b/e2e/vendor/k8s.io/client-go/scale/scheme/doc.go @@ -19,4 +19,4 @@ limitations under the License. // Package scheme contains a runtime.Scheme to be used for serializing // and deserializing different versions of Scale, and for converting // in between them. -package scheme // import "k8s.io/client-go/scale/scheme" +package scheme diff --git a/e2e/vendor/k8s.io/client-go/scale/scheme/extensionsint/doc.go b/e2e/vendor/k8s.io/client-go/scale/scheme/extensionsint/doc.go index dedff2d70..9aaac6086 100644 --- a/e2e/vendor/k8s.io/client-go/scale/scheme/extensionsint/doc.go +++ b/e2e/vendor/k8s.io/client-go/scale/scheme/extensionsint/doc.go @@ -19,4 +19,4 @@ limitations under the License. // It doesn't have any of its own types -- it's just necessary to // get the expected behavior out of runtime.Scheme.ConvertToVersion // and associated methods. -package extensionsint // import "k8s.io/client-go/scale/scheme/extensionsint" +package extensionsint diff --git a/e2e/vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/doc.go b/e2e/vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/doc.go index de633889a..b5d24f50b 100644 --- a/e2e/vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/doc.go +++ b/e2e/vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/doc.go @@ -17,4 +17,4 @@ limitations under the License. // +k8s:conversion-gen=k8s.io/client-go/scale/scheme // +k8s:conversion-gen-external-types=k8s.io/api/extensions/v1beta1 -package extensionsv1beta1 // import "k8s.io/client-go/scale/scheme/extensionsv1beta1" +package extensionsv1beta1 diff --git a/e2e/vendor/k8s.io/client-go/tools/cache/controller.go b/e2e/vendor/k8s.io/client-go/tools/cache/controller.go index e523a6652..1497700d8 100644 --- a/e2e/vendor/k8s.io/client-go/tools/cache/controller.go +++ b/e2e/vendor/k8s.io/client-go/tools/cache/controller.go @@ -17,7 +17,9 @@ limitations under the License. package cache import ( + "context" "errors" + clientgofeaturegate "k8s.io/client-go/features" "sync" "time" @@ -71,16 +73,15 @@ type Config struct { // resync. ShouldResync ShouldResyncFunc - // If true, when Process() returns an error, re-enqueue the object. - // TODO: add interface to let you inject a delay/backoff or drop - // the object completely if desired. Pass the object in - // question to this interface as a parameter. This is probably moot - // now that this functionality appears at a higher level. - RetryOnError bool - // Called whenever the ListAndWatch drops the connection with an error. + // + // Contextual logging: WatchErrorHandlerWithContext should be used instead of WatchErrorHandler in code which supports contextual logging. WatchErrorHandler WatchErrorHandler + // Called whenever the ListAndWatch drops the connection with an error + // and WatchErrorHandler is not set. + WatchErrorHandlerWithContext WatchErrorHandlerWithContext + // WatchListPageSize is the requested chunk size of initial and relist watch lists. WatchListPageSize int64 } @@ -104,12 +105,21 @@ type controller struct { // Controller is a low-level controller that is parameterized by a // Config and used in sharedIndexInformer. type Controller interface { - // Run does two things. One is to construct and run a Reflector + // RunWithContext does two things. One is to construct and run a Reflector // to pump objects/notifications from the Config's ListerWatcher // to the Config's Queue and possibly invoke the occasional Resync // on that Queue. The other is to repeatedly Pop from the Queue // and process with the Config's ProcessFunc. Both of these - // continue until `stopCh` is closed. + // continue until the context is canceled. + // + // It's an error to call RunWithContext more than once. + // RunWithContext blocks; call via go. + RunWithContext(ctx context.Context) + + // Run does the same as RunWithContext with a stop channel instead of + // a context. + // + // Contextual logging: RunWithcontext should be used instead of Run in code which supports contextual logging. Run(stopCh <-chan struct{}) // HasSynced delegates to the Config's Queue @@ -129,13 +139,16 @@ func New(c *Config) Controller { return ctlr } -// Run begins processing items, and will continue until a value is sent down stopCh or it is closed. -// It's an error to call Run more than once. -// Run blocks; call via go. +// Run implements [Controller.Run]. func (c *controller) Run(stopCh <-chan struct{}) { - defer utilruntime.HandleCrash() + c.RunWithContext(wait.ContextForChannel(stopCh)) +} + +// RunWithContext implements [Controller.RunWithContext]. +func (c *controller) RunWithContext(ctx context.Context) { + defer utilruntime.HandleCrashWithContext(ctx) go func() { - <-stopCh + <-ctx.Done() c.config.Queue.Close() }() r := NewReflectorWithOptions( @@ -152,7 +165,11 @@ func (c *controller) Run(stopCh <-chan struct{}) { r.ShouldResync = c.config.ShouldResync r.WatchListPageSize = c.config.WatchListPageSize if c.config.WatchErrorHandler != nil { - r.watchErrorHandler = c.config.WatchErrorHandler + r.watchErrorHandler = func(_ context.Context, r *Reflector, err error) { + c.config.WatchErrorHandler(r, err) + } + } else if c.config.WatchErrorHandlerWithContext != nil { + r.watchErrorHandler = c.config.WatchErrorHandlerWithContext } c.reflectorMutex.Lock() @@ -161,9 +178,9 @@ func (c *controller) Run(stopCh <-chan struct{}) { var wg wait.Group - wg.StartWithChannel(stopCh, r.Run) + wg.StartWithContext(ctx, r.RunWithContext) - wait.Until(c.processLoop, time.Second, stopCh) + wait.UntilWithContext(ctx, c.processLoop, time.Second) wg.Wait() } @@ -185,22 +202,16 @@ func (c *controller) LastSyncResourceVersion() string { // TODO: Consider doing the processing in parallel. This will require a little thought // to make sure that we don't end up processing the same object multiple times // concurrently. -// -// TODO: Plumb through the stopCh here (and down to the queue) so that this can -// actually exit when the controller is stopped. Or just give up on this stuff -// ever being stoppable. Converting this whole package to use Context would -// also be helpful. -func (c *controller) processLoop() { +func (c *controller) processLoop(ctx context.Context) { for { - obj, err := c.config.Queue.Pop(PopProcessFunc(c.config.Process)) + // TODO: Plumb through the ctx so that this can + // actually exit when the controller is stopped. Or just give up on this stuff + // ever being stoppable. + _, err := c.config.Queue.Pop(PopProcessFunc(c.config.Process)) if err != nil { if err == ErrFIFOClosed { return } - if c.config.RetryOnError { - // This is the safe way to re-enqueue. - c.config.Queue.AddIfNotPresent(obj) - } } } } @@ -582,11 +593,17 @@ func newInformer(clientState Store, options InformerOptions) Controller { // This will hold incoming changes. Note how we pass clientState in as a // KeyLister, that way resync operations will result in the correct set // of update/delete deltas. - fifo := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ - KnownObjects: clientState, - EmitDeltaTypeReplaced: true, - Transformer: options.Transform, - }) + + var fifo Queue + if clientgofeaturegate.FeatureGates().Enabled(clientgofeaturegate.InOrderInformers) { + fifo = NewRealFIFO(MetaNamespaceKeyFunc, clientState, options.Transform) + } else { + fifo = NewDeltaFIFOWithOptions(DeltaFIFOOptions{ + KnownObjects: clientState, + EmitDeltaTypeReplaced: true, + Transformer: options.Transform, + }) + } cfg := &Config{ Queue: fifo, @@ -594,7 +611,6 @@ func newInformer(clientState Store, options InformerOptions) Controller { ObjectType: options.ObjectType, FullResyncPeriod: options.ResyncPeriod, MinWatchTimeout: options.MinWatchTimeout, - RetryOnError: false, Process: func(obj interface{}, isInInitialList bool) error { if deltas, ok := obj.(Deltas); ok { diff --git a/e2e/vendor/k8s.io/client-go/tools/cache/delta_fifo.go b/e2e/vendor/k8s.io/client-go/tools/cache/delta_fifo.go index ce74dfb6f..264d7559a 100644 --- a/e2e/vendor/k8s.io/client-go/tools/cache/delta_fifo.go +++ b/e2e/vendor/k8s.io/client-go/tools/cache/delta_fifo.go @@ -55,6 +55,9 @@ type DeltaFIFOOptions struct { // If set, will be called for objects before enqueueing them. Please // see the comment on TransformFunc for details. Transformer TransformFunc + + // If set, log output will go to this logger instead of klog.Background(). + Logger *klog.Logger } // DeltaFIFO is like FIFO, but differs in two ways. One is that the @@ -136,6 +139,10 @@ type DeltaFIFO struct { // Called with every object if non-nil. transformer TransformFunc + + // logger is a per-instance logger. This gets chosen when constructing + // the instance, with klog.Background() as default. + logger klog.Logger } // TransformFunc allows for transforming an object before it will be processed. @@ -253,6 +260,10 @@ func NewDeltaFIFOWithOptions(opts DeltaFIFOOptions) *DeltaFIFO { emitDeltaTypeReplaced: opts.EmitDeltaTypeReplaced, transformer: opts.Transformer, + logger: klog.Background(), + } + if opts.Logger != nil { + f.logger = *opts.Logger } f.cond.L = &f.lock return f @@ -358,43 +369,6 @@ func (f *DeltaFIFO) Delete(obj interface{}) error { return f.queueActionLocked(Deleted, obj) } -// AddIfNotPresent inserts an item, and puts it in the queue. If the item is already -// present in the set, it is neither enqueued nor added to the set. -// -// This is useful in a single producer/consumer scenario so that the consumer can -// safely retry items without contending with the producer and potentially enqueueing -// stale items. -// -// Important: obj must be a Deltas (the output of the Pop() function). Yes, this is -// different from the Add/Update/Delete functions. -func (f *DeltaFIFO) AddIfNotPresent(obj interface{}) error { - deltas, ok := obj.(Deltas) - if !ok { - return fmt.Errorf("object must be of type deltas, but got: %#v", obj) - } - id, err := f.KeyOf(deltas) - if err != nil { - return KeyError{obj, err} - } - f.lock.Lock() - defer f.lock.Unlock() - f.addIfNotPresent(id, deltas) - return nil -} - -// addIfNotPresent inserts deltas under id if it does not exist, and assumes the caller -// already holds the fifo lock. -func (f *DeltaFIFO) addIfNotPresent(id string, deltas Deltas) { - f.populated = true - if _, exists := f.items[id]; exists { - return - } - - f.queue = append(f.queue, id) - f.items[id] = deltas - f.cond.Broadcast() -} - // re-listing and watching can deliver the same update multiple times in any // order. This will combine the most recent two deltas if they are the same. func dedupDeltas(deltas Deltas) Deltas { @@ -487,71 +461,16 @@ func (f *DeltaFIFO) queueActionInternalLocked(actionType, internalActionType Del // when given a non-empty list (as it is here). // If somehow it happens anyway, deal with it but complain. if oldDeltas == nil { - klog.Errorf("Impossible dedupDeltas for id=%q: oldDeltas=%#+v, obj=%#+v; ignoring", id, oldDeltas, obj) + f.logger.Error(nil, "Impossible dedupDeltas, ignoring", "id", id, "oldDeltas", oldDeltas, "obj", obj) return nil } - klog.Errorf("Impossible dedupDeltas for id=%q: oldDeltas=%#+v, obj=%#+v; breaking invariant by storing empty Deltas", id, oldDeltas, obj) + f.logger.Error(nil, "Impossible dedupDeltas, breaking invariant by storing empty Deltas", "id", id, "oldDeltas", oldDeltas, "obj", obj) f.items[id] = newDeltas return fmt.Errorf("Impossible dedupDeltas for id=%q: oldDeltas=%#+v, obj=%#+v; broke DeltaFIFO invariant by storing empty Deltas", id, oldDeltas, obj) } return nil } -// List returns a list of all the items; it returns the object -// from the most recent Delta. -// You should treat the items returned inside the deltas as immutable. -func (f *DeltaFIFO) List() []interface{} { - f.lock.RLock() - defer f.lock.RUnlock() - return f.listLocked() -} - -func (f *DeltaFIFO) listLocked() []interface{} { - list := make([]interface{}, 0, len(f.items)) - for _, item := range f.items { - list = append(list, item.Newest().Object) - } - return list -} - -// ListKeys returns a list of all the keys of the objects currently -// in the FIFO. -func (f *DeltaFIFO) ListKeys() []string { - f.lock.RLock() - defer f.lock.RUnlock() - list := make([]string, 0, len(f.queue)) - for _, key := range f.queue { - list = append(list, key) - } - return list -} - -// Get returns the complete list of deltas for the requested item, -// or sets exists=false. -// You should treat the items returned inside the deltas as immutable. -func (f *DeltaFIFO) Get(obj interface{}) (item interface{}, exists bool, err error) { - key, err := f.KeyOf(obj) - if err != nil { - return nil, false, KeyError{obj, err} - } - return f.GetByKey(key) -} - -// GetByKey returns the complete list of deltas for the requested item, -// setting exists=false if that list is empty. -// You should treat the items returned inside the deltas as immutable. -func (f *DeltaFIFO) GetByKey(key string) (item interface{}, exists bool, err error) { - f.lock.RLock() - defer f.lock.RUnlock() - d, exists := f.items[key] - if exists { - // Copy item's slice so operations on this slice - // won't interfere with the object we return. - d = copyDeltas(d) - } - return d, exists, nil -} - // IsClosed checks if the queue is closed func (f *DeltaFIFO) IsClosed() bool { f.lock.Lock() @@ -565,9 +484,7 @@ func (f *DeltaFIFO) IsClosed() bool { // is returned, so if you don't successfully process it, you need to add it back // with AddIfNotPresent(). // process function is called under lock, so it is safe to update data structures -// in it that need to be in sync with the queue (e.g. knownKeys). The PopProcessFunc -// may return an instance of ErrRequeue with a nested error to indicate the current -// item should be requeued (equivalent to calling AddIfNotPresent under the lock). +// in it that need to be in sync with the queue (e.g. knownKeys). // process should avoid expensive I/O operation so that other queue operations, i.e. // Add() and Get(), won't be blocked for too long. // @@ -597,7 +514,7 @@ func (f *DeltaFIFO) Pop(process PopProcessFunc) (interface{}, error) { item, ok := f.items[id] if !ok { // This should never happen - klog.Errorf("Inconceivable! %q was in f.queue but not f.items; ignoring.", id) + f.logger.Error(nil, "Inconceivable! Item was in f.queue but not f.items; ignoring", "id", id) continue } delete(f.items, id) @@ -614,10 +531,6 @@ func (f *DeltaFIFO) Pop(process PopProcessFunc) (interface{}, error) { defer trace.LogIfLong(100 * time.Millisecond) } err := process(item, isInInitialList) - if e, ok := err.(ErrRequeue); ok { - f.addIfNotPresent(id, item) - err = e.Err - } // Don't need to copyDeltas here, because we're transferring // ownership to the caller. return item, err @@ -694,10 +607,10 @@ func (f *DeltaFIFO) Replace(list []interface{}, _ string) error { deletedObj, exists, err := f.knownObjects.GetByKey(k) if err != nil { deletedObj = nil - klog.Errorf("Unexpected error %v during lookup of key %v, placing DeleteFinalStateUnknown marker without object", err, k) + f.logger.Error(err, "Unexpected error during lookup, placing DeleteFinalStateUnknown marker without object", "key", k) } else if !exists { deletedObj = nil - klog.Infof("Key %v does not exist in known objects store, placing DeleteFinalStateUnknown marker without object", k) + f.logger.Info("Key does not exist in known objects store, placing DeleteFinalStateUnknown marker without object", "key", k) } queuedDeletions++ if err := f.queueActionLocked(Deleted, DeletedFinalStateUnknown{k, deletedObj}); err != nil { @@ -737,10 +650,10 @@ func (f *DeltaFIFO) Resync() error { func (f *DeltaFIFO) syncKeyLocked(key string) error { obj, exists, err := f.knownObjects.GetByKey(key) if err != nil { - klog.Errorf("Unexpected error %v during lookup of key %v, unable to queue object for sync", err, key) + f.logger.Error(err, "Unexpected error during lookup, unable to queue object for sync", "key", key) return nil } else if !exists { - klog.Infof("Key %v does not exist in known objects store, unable to queue object for sync", key) + f.logger.Info("Key does not exist in known objects store, unable to queue object for sync", "key", key) return nil } diff --git a/e2e/vendor/k8s.io/client-go/tools/cache/doc.go b/e2e/vendor/k8s.io/client-go/tools/cache/doc.go index 56b61d300..4f593f0d3 100644 --- a/e2e/vendor/k8s.io/client-go/tools/cache/doc.go +++ b/e2e/vendor/k8s.io/client-go/tools/cache/doc.go @@ -21,4 +21,4 @@ limitations under the License. // list currently available nodes), and one that additionally acts as // a FIFO queue (for example, to allow a scheduler to process incoming // pods). -package cache // import "k8s.io/client-go/tools/cache" +package cache diff --git a/e2e/vendor/k8s.io/client-go/tools/cache/fifo.go b/e2e/vendor/k8s.io/client-go/tools/cache/fifo.go index dd13c4ea7..5c2ca9008 100644 --- a/e2e/vendor/k8s.io/client-go/tools/cache/fifo.go +++ b/e2e/vendor/k8s.io/client-go/tools/cache/fifo.go @@ -27,30 +27,16 @@ import ( // It is supposed to process the accumulator popped from the queue. type PopProcessFunc func(obj interface{}, isInInitialList bool) error -// ErrRequeue may be returned by a PopProcessFunc to safely requeue -// the current item. The value of Err will be returned from Pop. -type ErrRequeue struct { - // Err is returned by the Pop function - Err error -} - // ErrFIFOClosed used when FIFO is closed var ErrFIFOClosed = errors.New("DeltaFIFO: manipulating with closed queue") -func (e ErrRequeue) Error() string { - if e.Err == nil { - return "the popped item should be requeued without returning an error" - } - return e.Err.Error() -} - -// Queue extends Store with a collection of Store keys to "process". +// Queue extends ReflectorStore with a collection of Store keys to "process". // Every Add, Update, or Delete may put the object's key in that collection. // A Queue has a way to derive the corresponding key given an accumulator. // A Queue can be accessed concurrently from multiple goroutines. // A Queue can be "closed", after which Pop operations return an error. type Queue interface { - Store + ReflectorStore // Pop blocks until there is at least one key to process or the // Queue is closed. In the latter case Pop returns with an error. @@ -64,11 +50,6 @@ type Queue interface { // Pop. Pop(PopProcessFunc) (interface{}, error) - // AddIfNotPresent puts the given accumulator into the Queue (in - // association with the accumulator's key) if and only if that key - // is not already associated with a non-empty accumulator. - AddIfNotPresent(interface{}) error - // HasSynced returns true if the first batch of keys have all been // popped. The first batch of keys are those of the first Replace // operation if that happened before any Add, AddIfNotPresent, @@ -177,36 +158,6 @@ func (f *FIFO) Add(obj interface{}) error { return nil } -// AddIfNotPresent inserts an item, and puts it in the queue. If the item is already -// present in the set, it is neither enqueued nor added to the set. -// -// This is useful in a single producer/consumer scenario so that the consumer can -// safely retry items without contending with the producer and potentially enqueueing -// stale items. -func (f *FIFO) AddIfNotPresent(obj interface{}) error { - id, err := f.keyFunc(obj) - if err != nil { - return KeyError{obj, err} - } - f.lock.Lock() - defer f.lock.Unlock() - f.addIfNotPresent(id, obj) - return nil -} - -// addIfNotPresent assumes the fifo lock is already held and adds the provided -// item to the queue under id if it does not already exist. -func (f *FIFO) addIfNotPresent(id string, obj interface{}) { - f.populated = true - if _, exists := f.items[id]; exists { - return - } - - f.queue = append(f.queue, id) - f.items[id] = obj - f.cond.Broadcast() -} - // Update is the same as Add in this implementation. func (f *FIFO) Update(obj interface{}) error { return f.Add(obj) @@ -227,46 +178,6 @@ func (f *FIFO) Delete(obj interface{}) error { return err } -// List returns a list of all the items. -func (f *FIFO) List() []interface{} { - f.lock.RLock() - defer f.lock.RUnlock() - list := make([]interface{}, 0, len(f.items)) - for _, item := range f.items { - list = append(list, item) - } - return list -} - -// ListKeys returns a list of all the keys of the objects currently -// in the FIFO. -func (f *FIFO) ListKeys() []string { - f.lock.RLock() - defer f.lock.RUnlock() - list := make([]string, 0, len(f.items)) - for key := range f.items { - list = append(list, key) - } - return list -} - -// Get returns the requested item, or sets exists=false. -func (f *FIFO) Get(obj interface{}) (item interface{}, exists bool, err error) { - key, err := f.keyFunc(obj) - if err != nil { - return nil, false, KeyError{obj, err} - } - return f.GetByKey(key) -} - -// GetByKey returns the requested item, or sets exists=false. -func (f *FIFO) GetByKey(key string) (item interface{}, exists bool, err error) { - f.lock.RLock() - defer f.lock.RUnlock() - item, exists = f.items[key] - return item, exists, nil -} - // IsClosed checks if the queue is closed func (f *FIFO) IsClosed() bool { f.lock.Lock() @@ -307,10 +218,6 @@ func (f *FIFO) Pop(process PopProcessFunc) (interface{}, error) { } delete(f.items, id) err := process(item, isInInitialList) - if e, ok := err.(ErrRequeue); ok { - f.addIfNotPresent(id, item) - err = e.Err - } return item, err } } diff --git a/e2e/vendor/k8s.io/client-go/tools/cache/listers.go b/e2e/vendor/k8s.io/client-go/tools/cache/listers.go index a60f44943..9e050ff45 100644 --- a/e2e/vendor/k8s.io/client-go/tools/cache/listers.go +++ b/e2e/vendor/k8s.io/client-go/tools/cache/listers.go @@ -62,7 +62,12 @@ func ListAllByNamespace(indexer Indexer, namespace string, selector labels.Selec items, err := indexer.Index(NamespaceIndex, &metav1.ObjectMeta{Namespace: namespace}) if err != nil { // Ignore error; do slow search without index. - klog.Warningf("can not retrieve list of objects using index : %v", err) + // + // ListAllByNamespace is called by generated code + // (k8s.io/client-go/listers) and probably not worth converting + // to contextual logging, which would require changing all of + // those APIs. + klog.TODO().Info("Warning: can not retrieve list of objects using index", "err", err) for _, m := range indexer.List() { metadata, err := meta.Accessor(m) if err != nil { diff --git a/e2e/vendor/k8s.io/client-go/tools/cache/listwatch.go b/e2e/vendor/k8s.io/client-go/tools/cache/listwatch.go index f5708ffeb..30d30e885 100644 --- a/e2e/vendor/k8s.io/client-go/tools/cache/listwatch.go +++ b/e2e/vendor/k8s.io/client-go/tools/cache/listwatch.go @@ -27,50 +27,160 @@ import ( ) // Lister is any object that knows how to perform an initial list. +// +// Ideally, all implementations of Lister should also implement ListerWithContext. type Lister interface { // List should return a list type object; the Items field will be extracted, and the // ResourceVersion field will be used to start the watch in the right place. + // + // Deprecated: use ListerWithContext.ListWithContext instead. List(options metav1.ListOptions) (runtime.Object, error) } +// ListerWithContext is any object that knows how to perform an initial list. +type ListerWithContext interface { + // ListWithContext should return a list type object; the Items field will be extracted, and the + // ResourceVersion field will be used to start the watch in the right place. + ListWithContext(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) +} + +func ToListerWithContext(l Lister) ListerWithContext { + if l, ok := l.(ListerWithContext); ok { + return l + } + return listerWrapper{ + parent: l, + } +} + +type listerWrapper struct { + parent Lister +} + +func (l listerWrapper) ListWithContext(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + return l.parent.List(options) +} + // Watcher is any object that knows how to start a watch on a resource. +// +// Ideally, all implementations of Watcher should also implement WatcherWithContext. type Watcher interface { // Watch should begin a watch at the specified version. // // If Watch returns an error, it should handle its own cleanup, including // but not limited to calling Stop() on the watch, if one was constructed. // This allows the caller to ignore the watch, if the error is non-nil. + // + // Deprecated: use WatcherWithContext.WatchWithContext instead. Watch(options metav1.ListOptions) (watch.Interface, error) } +// WatcherWithContext is any object that knows how to start a watch on a resource. +type WatcherWithContext interface { + // WatchWithContext should begin a watch at the specified version. + // + // If Watch returns an error, it should handle its own cleanup, including + // but not limited to calling Stop() on the watch, if one was constructed. + // This allows the caller to ignore the watch, if the error is non-nil. + WatchWithContext(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) +} + +func ToWatcherWithContext(w Watcher) WatcherWithContext { + if w, ok := w.(WatcherWithContext); ok { + return w + } + return watcherWrapper{ + parent: w, + } +} + +type watcherWrapper struct { + parent Watcher +} + +func (l watcherWrapper) WatchWithContext(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + return l.parent.Watch(options) +} + // ListerWatcher is any object that knows how to perform an initial list and start a watch on a resource. +// +// Ideally, all implementations of ListerWatcher should also implement ListerWatcherWithContext. type ListerWatcher interface { Lister Watcher } +// ListerWatcherWithContext is any object that knows how to perform an initial list and start a watch on a resource. +type ListerWatcherWithContext interface { + ListerWithContext + WatcherWithContext +} + +func ToListerWatcherWithContext(lw ListerWatcher) ListerWatcherWithContext { + if lw, ok := lw.(ListerWatcherWithContext); ok { + return lw + } + return listerWatcherWrapper{ + ListerWithContext: ToListerWithContext(lw), + WatcherWithContext: ToWatcherWithContext(lw), + } +} + +type listerWatcherWrapper struct { + ListerWithContext + WatcherWithContext +} + // ListFunc knows how to list resources +// +// Deprecated: use ListWithContextFunc instead. type ListFunc func(options metav1.ListOptions) (runtime.Object, error) +// ListWithContextFunc knows how to list resources +type ListWithContextFunc func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) + // WatchFunc knows how to watch resources +// +// Deprecated: use WatchFuncWithContext instead. type WatchFunc func(options metav1.ListOptions) (watch.Interface, error) -// ListWatch knows how to list and watch a set of apiserver resources. It satisfies the ListerWatcher interface. +// WatchFuncWithContext knows how to watch resources +type WatchFuncWithContext func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) + +// ListWatch knows how to list and watch a set of apiserver resources. +// It satisfies the ListerWatcher and ListerWatcherWithContext interfaces. // It is a convenience function for users of NewReflector, etc. -// ListFunc and WatchFunc must not be nil +// ListFunc or ListWithContextFunc must be set. Same for WatchFunc and WatchFuncWithContext. +// ListWithContextFunc and WatchFuncWithContext are preferred if +// a context is available, otherwise ListFunc and WatchFunc. +// +// NewFilteredListWatchFromClient sets all of the functions to ensure that callers +// which only know about ListFunc and WatchFunc continue to work. type ListWatch struct { - ListFunc ListFunc + // Deprecated: use ListWithContext instead. + ListFunc ListFunc + // Deprecated: use WatchWithContext instead. WatchFunc WatchFunc + + ListWithContextFunc ListWithContextFunc + WatchFuncWithContext WatchFuncWithContext + // DisableChunking requests no chunking for this list watcher. DisableChunking bool } +var ( + _ ListerWatcher = &ListWatch{} + _ ListerWatcherWithContext = &ListWatch{} +) + // Getter interface knows how to access Get method from RESTClient. type Getter interface { Get() *restclient.Request } // NewListWatchFromClient creates a new ListWatch from the specified client, resource, namespace and field selector. +// For backward compatibility, all function fields are populated. func NewListWatchFromClient(c Getter, resource string, namespace string, fieldSelector fields.Selector) *ListWatch { optionsModifier := func(options *metav1.ListOptions) { options.FieldSelector = fieldSelector.String() @@ -81,6 +191,7 @@ func NewListWatchFromClient(c Getter, resource string, namespace string, fieldSe // NewFilteredListWatchFromClient creates a new ListWatch from the specified client, resource, namespace, and option modifier. // Option modifier is a function takes a ListOptions and modifies the consumed ListOptions. Provide customized modifier function // to apply modification to ListOptions with a field selector, a label selector, or any other desired options. +// For backward compatibility, all function fields are populated. func NewFilteredListWatchFromClient(c Getter, resource string, namespace string, optionsModifier func(options *metav1.ListOptions)) *ListWatch { listFunc := func(options metav1.ListOptions) (runtime.Object, error) { optionsModifier(&options) @@ -88,7 +199,7 @@ func NewFilteredListWatchFromClient(c Getter, resource string, namespace string, Namespace(namespace). Resource(resource). VersionedParams(&options, metav1.ParameterCodec). - Do(context.TODO()). + Do(context.Background()). Get() } watchFunc := func(options metav1.ListOptions) (watch.Interface, error) { @@ -98,19 +209,70 @@ func NewFilteredListWatchFromClient(c Getter, resource string, namespace string, Namespace(namespace). Resource(resource). VersionedParams(&options, metav1.ParameterCodec). - Watch(context.TODO()) + Watch(context.Background()) + } + listFuncWithContext := func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + optionsModifier(&options) + return c.Get(). + Namespace(namespace). + Resource(resource). + VersionedParams(&options, metav1.ParameterCodec). + Do(ctx). + Get() + } + watchFuncWithContext := func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + options.Watch = true + optionsModifier(&options) + return c.Get(). + Namespace(namespace). + Resource(resource). + VersionedParams(&options, metav1.ParameterCodec). + Watch(ctx) + } + return &ListWatch{ + ListFunc: listFunc, + WatchFunc: watchFunc, + ListWithContextFunc: listFuncWithContext, + WatchFuncWithContext: watchFuncWithContext, } - return &ListWatch{ListFunc: listFunc, WatchFunc: watchFunc} } // List a set of apiserver resources +// +// Deprecated: use ListWatchWithContext.ListWithContext instead. func (lw *ListWatch) List(options metav1.ListOptions) (runtime.Object, error) { // ListWatch is used in Reflector, which already supports pagination. // Don't paginate here to avoid duplication. + if lw.ListFunc != nil { + return lw.ListFunc(options) + } + return lw.ListWithContextFunc(context.Background(), options) +} + +// List a set of apiserver resources +func (lw *ListWatch) ListWithContext(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + // ListWatch is used in Reflector, which already supports pagination. + // Don't paginate here to avoid duplication. + if lw.ListWithContextFunc != nil { + return lw.ListWithContextFunc(ctx, options) + } return lw.ListFunc(options) } // Watch a set of apiserver resources +// +// Deprecated: use ListWatchWithContext.WatchWithContext instead. func (lw *ListWatch) Watch(options metav1.ListOptions) (watch.Interface, error) { + if lw.WatchFunc != nil { + return lw.WatchFunc(options) + } + return lw.WatchFuncWithContext(context.Background(), options) +} + +// Watch a set of apiserver resources +func (lw *ListWatch) WatchWithContext(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if lw.WatchFuncWithContext != nil { + return lw.WatchFuncWithContext(ctx, options) + } return lw.WatchFunc(options) } diff --git a/e2e/vendor/k8s.io/client-go/tools/cache/mutation_cache.go b/e2e/vendor/k8s.io/client-go/tools/cache/mutation_cache.go index c6f953d8e..6800a6250 100644 --- a/e2e/vendor/k8s.io/client-go/tools/cache/mutation_cache.go +++ b/e2e/vendor/k8s.io/client-go/tools/cache/mutation_cache.go @@ -60,7 +60,7 @@ type ResourceVersionComparator interface { // If includeAdds is true, objects in the mutation cache will be returned even if they don't exist // in the underlying store. This is only safe if your use of the cache can handle mutation entries // remaining in the cache for up to ttl when mutations and deletes occur very closely in time. -func NewIntegerResourceVersionMutationCache(backingCache Store, indexer Indexer, ttl time.Duration, includeAdds bool) MutationCache { +func NewIntegerResourceVersionMutationCache(logger klog.Logger, backingCache Store, indexer Indexer, ttl time.Duration, includeAdds bool) MutationCache { return &mutationCache{ backingCache: backingCache, indexer: indexer, @@ -68,6 +68,7 @@ func NewIntegerResourceVersionMutationCache(backingCache Store, indexer Indexer, comparator: etcdObjectVersioner{}, ttl: ttl, includeAdds: includeAdds, + logger: logger, } } @@ -75,6 +76,7 @@ func NewIntegerResourceVersionMutationCache(backingCache Store, indexer Indexer, // since you can't distinguish between, "didn't observe create" and "was deleted after create", // if the key is missing from the backing cache, we always return it as missing type mutationCache struct { + logger klog.Logger lock sync.Mutex backingCache Store indexer Indexer @@ -157,7 +159,7 @@ func (c *mutationCache) ByIndex(name string, indexKey string) ([]interface{}, er } elements, err := fn(updated) if err != nil { - klog.V(4).Infof("Unable to calculate an index entry for mutation cache entry %s: %v", key, err) + c.logger.V(4).Info("Unable to calculate an index entry for mutation cache entry", "key", key, "err", err) continue } for _, inIndex := range elements { @@ -204,7 +206,7 @@ func (c *mutationCache) Mutation(obj interface{}) { key, err := DeletionHandlingMetaNamespaceKeyFunc(obj) if err != nil { // this is a "nice to have", so failures shouldn't do anything weird - utilruntime.HandleError(err) + utilruntime.HandleErrorWithLogger(c.logger, err, "DeletionHandlingMetaNamespaceKeyFunc") return } diff --git a/e2e/vendor/k8s.io/client-go/tools/cache/mutation_detector.go b/e2e/vendor/k8s.io/client-go/tools/cache/mutation_detector.go index b37537cbd..27ea62bfb 100644 --- a/e2e/vendor/k8s.io/client-go/tools/cache/mutation_detector.go +++ b/e2e/vendor/k8s.io/client-go/tools/cache/mutation_detector.go @@ -50,6 +50,7 @@ func NewCacheMutationDetector(name string) MutationDetector { if !mutationDetectionEnabled { return dummyMutationDetector{} } + //nolint:logcheck // This code shouldn't be used in production. klog.Warningln("Mutation detector is enabled, this will result in memory leakage.") return &defaultCacheMutationDetector{name: name, period: 1 * time.Second, retainDuration: 2 * time.Minute} } diff --git a/e2e/vendor/k8s.io/client-go/tools/cache/reflector.go b/e2e/vendor/k8s.io/client-go/tools/cache/reflector.go index 030b45297..8e2a82700 100644 --- a/e2e/vendor/k8s.io/client-go/tools/cache/reflector.go +++ b/e2e/vendor/k8s.io/client-go/tools/cache/reflector.go @@ -55,6 +55,28 @@ var ( defaultMinWatchTimeout = 5 * time.Minute ) +// ReflectorStore is the subset of cache.Store that the reflector uses +type ReflectorStore interface { + // Add adds the given object to the accumulator associated with the given object's key + Add(obj interface{}) error + + // Update updates the given object in the accumulator associated with the given object's key + Update(obj interface{}) error + + // Delete deletes the given object from the accumulator associated with the given object's key + Delete(obj interface{}) error + + // Replace will delete the contents of the store, using instead the + // given list. Store takes ownership of the list, you should not reference + // it after calling this function. + Replace([]interface{}, string) error + + // Resync is meaningless in the terms appearing here but has + // meaning in some implementations that have non-trivial + // additional behavior (e.g., DeltaFIFO). + Resync() error +} + // Reflector watches a specified resource and causes all changes to be reflected in the given store. type Reflector struct { // name identifies this reflector. By default, it will be a file:line if possible. @@ -72,9 +94,9 @@ type Reflector struct { // The GVK of the object we expect to place in the store if unstructured. expectedGVK *schema.GroupVersionKind // The destination to sync up with the watch source - store Store + store ReflectorStore // listerWatcher is used to perform lists and watches. - listerWatcher ListerWatcher + listerWatcher ListerWatcherWithContext // backoff manages backoff of ListWatch backoffManager wait.BackoffManager resyncPeriod time.Duration @@ -95,7 +117,7 @@ type Reflector struct { // lastSyncResourceVersionMutex guards read/write access to lastSyncResourceVersion lastSyncResourceVersionMutex sync.RWMutex // Called whenever the ListAndWatch drops the connection with an error. - watchErrorHandler WatchErrorHandler + watchErrorHandler WatchErrorHandlerWithContext // WatchListPageSize is the requested chunk size of initial and resync watch lists. // If unset, for consistent reads (RV="") or reads that opt-into arbitrarily old data // (RV="0") it will default to pager.PageSize, for the rest (RV != "" && RV != "0") @@ -150,20 +172,32 @@ type ResourceVersionUpdater interface { // should be offloaded. type WatchErrorHandler func(r *Reflector, err error) -// DefaultWatchErrorHandler is the default implementation of WatchErrorHandler -func DefaultWatchErrorHandler(r *Reflector, err error) { +// The WatchErrorHandler is called whenever ListAndWatch drops the +// connection with an error. After calling this handler, the informer +// will backoff and retry. +// +// The default implementation looks at the error type and tries to log +// the error message at an appropriate level. +// +// Implementations of this handler may display the error message in other +// ways. Implementations should return quickly - any expensive processing +// should be offloaded. +type WatchErrorHandlerWithContext func(ctx context.Context, r *Reflector, err error) + +// DefaultWatchErrorHandler is the default implementation of WatchErrorHandlerWithContext. +func DefaultWatchErrorHandler(ctx context.Context, r *Reflector, err error) { switch { case isExpiredError(err): // Don't set LastSyncResourceVersionUnavailable - LIST call with ResourceVersion=RV already // has a semantic that it returns data at least as fresh as provided RV. // So first try to LIST with setting RV to resource version of last observed object. - klog.V(4).Infof("%s: watch of %v closed with: %v", r.name, r.typeDescription, err) + klog.FromContext(ctx).V(4).Info("Watch closed", "reflector", r.name, "type", r.typeDescription, "err", err) case err == io.EOF: // watch closed normally case err == io.ErrUnexpectedEOF: - klog.V(1).Infof("%s: Watch for %v closed with unexpected EOF: %v", r.name, r.typeDescription, err) + klog.FromContext(ctx).V(1).Info("Watch closed with unexpected EOF", "reflector", r.name, "type", r.typeDescription, "err", err) default: - utilruntime.HandleError(fmt.Errorf("%s: Failed to watch %v: %v", r.name, r.typeDescription, err)) + utilruntime.HandleErrorWithContext(ctx, err, "Failed to watch", "reflector", r.name, "type", r.typeDescription) } } @@ -177,13 +211,13 @@ func NewNamespaceKeyedIndexerAndReflector(lw ListerWatcher, expectedType interfa // NewReflector creates a new Reflector with its name defaulted to the closest source_file.go:line in the call stack // that is outside this package. See NewReflectorWithOptions for further information. -func NewReflector(lw ListerWatcher, expectedType interface{}, store Store, resyncPeriod time.Duration) *Reflector { +func NewReflector(lw ListerWatcher, expectedType interface{}, store ReflectorStore, resyncPeriod time.Duration) *Reflector { return NewReflectorWithOptions(lw, expectedType, store, ReflectorOptions{ResyncPeriod: resyncPeriod}) } // NewNamedReflector creates a new Reflector with the specified name. See NewReflectorWithOptions for further // information. -func NewNamedReflector(name string, lw ListerWatcher, expectedType interface{}, store Store, resyncPeriod time.Duration) *Reflector { +func NewNamedReflector(name string, lw ListerWatcher, expectedType interface{}, store ReflectorStore, resyncPeriod time.Duration) *Reflector { return NewReflectorWithOptions(lw, expectedType, store, ReflectorOptions{Name: name, ResyncPeriod: resyncPeriod}) } @@ -222,7 +256,7 @@ type ReflectorOptions struct { // "yes". This enables you to use reflectors to periodically process // everything as well as incrementally processing the things that // change. -func NewReflectorWithOptions(lw ListerWatcher, expectedType interface{}, store Store, options ReflectorOptions) *Reflector { +func NewReflectorWithOptions(lw ListerWatcher, expectedType interface{}, store ReflectorStore, options ReflectorOptions) *Reflector { reflectorClock := options.Clock if reflectorClock == nil { reflectorClock = clock.RealClock{} @@ -236,14 +270,14 @@ func NewReflectorWithOptions(lw ListerWatcher, expectedType interface{}, store S resyncPeriod: options.ResyncPeriod, minWatchTimeout: minWatchTimeout, typeDescription: options.TypeDescription, - listerWatcher: lw, + listerWatcher: ToListerWatcherWithContext(lw), store: store, // We used to make the call every 1sec (1 QPS), the goal here is to achieve ~98% traffic reduction when // API server is not healthy. With these parameters, backoff will stop at [30,60) sec interval which is // 0.22 QPS. If we don't backoff for 2min, assume API server is healthy and we reset the backoff. backoffManager: wait.NewExponentialBackoffManager(800*time.Millisecond, 30*time.Second, 2*time.Minute, 2.0, 1.0, reflectorClock), clock: reflectorClock, - watchErrorHandler: WatchErrorHandler(DefaultWatchErrorHandler), + watchErrorHandler: WatchErrorHandlerWithContext(DefaultWatchErrorHandler), expectedType: reflect.TypeOf(expectedType), } @@ -309,14 +343,24 @@ var internalPackages = []string{"client-go/tools/cache/"} // Run repeatedly uses the reflector's ListAndWatch to fetch all the // objects and subsequent deltas. // Run will exit when stopCh is closed. +// +// Contextual logging: RunWithContext should be used instead of Run in code which supports contextual logging. func (r *Reflector) Run(stopCh <-chan struct{}) { - klog.V(3).Infof("Starting reflector %s (%s) from %s", r.typeDescription, r.resyncPeriod, r.name) + r.RunWithContext(wait.ContextForChannel(stopCh)) +} + +// RunWithContext repeatedly uses the reflector's ListAndWatch to fetch all the +// objects and subsequent deltas. +// Run will exit when the context is canceled. +func (r *Reflector) RunWithContext(ctx context.Context) { + logger := klog.FromContext(ctx) + logger.V(3).Info("Starting reflector", "type", r.typeDescription, "resyncPeriod", r.resyncPeriod, "reflector", r.name) wait.BackoffUntil(func() { - if err := r.ListAndWatch(stopCh); err != nil { - r.watchErrorHandler(r, err) + if err := r.ListAndWatchWithContext(ctx); err != nil { + r.watchErrorHandler(ctx, r, err) } - }, r.backoffManager, true, stopCh) - klog.V(3).Infof("Stopping reflector %s (%s) from %s", r.typeDescription, r.resyncPeriod, r.name) + }, r.backoffManager, true, ctx.Done()) + logger.V(3).Info("Stopping reflector", "type", r.typeDescription, "resyncPeriod", r.resyncPeriod, "reflector", r.name) } var ( @@ -345,21 +389,31 @@ func (r *Reflector) resyncChan() (<-chan time.Time, func() bool) { // ListAndWatch first lists all items and get the resource version at the moment of call, // and then use the resource version to watch. // It returns error if ListAndWatch didn't even try to initialize watch. +// +// Contextual logging: ListAndWatchWithContext should be used instead of ListAndWatch in code which supports contextual logging. func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { - klog.V(3).Infof("Listing and watching %v from %s", r.typeDescription, r.name) + return r.ListAndWatchWithContext(wait.ContextForChannel(stopCh)) +} + +// ListAndWatchWithContext first lists all items and get the resource version at the moment of call, +// and then use the resource version to watch. +// It returns error if ListAndWatchWithContext didn't even try to initialize watch. +func (r *Reflector) ListAndWatchWithContext(ctx context.Context) error { + logger := klog.FromContext(ctx) + logger.V(3).Info("Listing and watching", "type", r.typeDescription, "reflector", r.name) var err error var w watch.Interface useWatchList := ptr.Deref(r.UseWatchList, false) fallbackToList := !useWatchList if useWatchList { - w, err = r.watchList(stopCh) + w, err = r.watchList(ctx) if w == nil && err == nil { // stopCh was closed return nil } if err != nil { - klog.Warningf("The watchlist request ended with an error, falling back to the standard LIST/WATCH semantics because making progress is better than deadlocking, err = %v", err) + logger.Error(err, "The watchlist request ended with an error, falling back to the standard LIST/WATCH semantics because making progress is better than deadlocking") fallbackToList = true // ensure that we won't accidentally pass some garbage down the watch. w = nil @@ -367,20 +421,21 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { } if fallbackToList { - err = r.list(stopCh) + err = r.list(ctx) if err != nil { return err } } - klog.V(2).Infof("Caches populated for %v from %s", r.typeDescription, r.name) - return r.watchWithResync(w, stopCh) + logger.V(2).Info("Caches populated", "type", r.typeDescription, "reflector", r.name) + return r.watchWithResync(ctx, w) } // startResync periodically calls r.store.Resync() method. // Note that this method is blocking and should be // called in a separate goroutine. -func (r *Reflector) startResync(stopCh <-chan struct{}, cancelCh <-chan struct{}, resyncerrc chan error) { +func (r *Reflector) startResync(ctx context.Context, resyncerrc chan error) { + logger := klog.FromContext(ctx) resyncCh, cleanup := r.resyncChan() defer func() { cleanup() // Call the last one written into cleanup @@ -388,13 +443,11 @@ func (r *Reflector) startResync(stopCh <-chan struct{}, cancelCh <-chan struct{} for { select { case <-resyncCh: - case <-stopCh: - return - case <-cancelCh: + case <-ctx.Done(): return } if r.ShouldResync == nil || r.ShouldResync() { - klog.V(4).Infof("%s: forcing resync", r.name) + logger.V(4).Info("Forcing resync", "reflector", r.name) if err := r.store.Resync(); err != nil { resyncerrc <- err return @@ -406,16 +459,27 @@ func (r *Reflector) startResync(stopCh <-chan struct{}, cancelCh <-chan struct{} } // watchWithResync runs watch with startResync in the background. -func (r *Reflector) watchWithResync(w watch.Interface, stopCh <-chan struct{}) error { +func (r *Reflector) watchWithResync(ctx context.Context, w watch.Interface) error { resyncerrc := make(chan error, 1) - cancelCh := make(chan struct{}) - defer close(cancelCh) - go r.startResync(stopCh, cancelCh, resyncerrc) - return r.watch(w, stopCh, resyncerrc) + cancelCtx, cancel := context.WithCancel(ctx) + // Waiting for completion of the goroutine is relevant for race detector. + // Without this, there is a race between "this function returns + code + // waiting for it" and "goroutine does something". + var wg wait.Group + defer func() { + cancel() + wg.Wait() + }() + wg.Start(func() { + r.startResync(cancelCtx, resyncerrc) + }) + return r.watch(ctx, w, resyncerrc) } // watch simply starts a watch request with the server. -func (r *Reflector) watch(w watch.Interface, stopCh <-chan struct{}, resyncerrc chan error) error { +func (r *Reflector) watch(ctx context.Context, w watch.Interface, resyncerrc chan error) error { + stopCh := ctx.Done() + logger := klog.FromContext(ctx) var err error retry := NewRetryWithDeadline(r.MaxInternalErrorRetryDuration, time.Minute, apierrors.IsInternalError, r.clock) @@ -448,10 +512,10 @@ func (r *Reflector) watch(w watch.Interface, stopCh <-chan struct{}, resyncerrc AllowWatchBookmarks: true, } - w, err = r.listerWatcher.Watch(options) + w, err = r.listerWatcher.WatchWithContext(ctx, options) if err != nil { if canRetry := isWatchErrorRetriable(err); canRetry { - klog.V(4).Infof("%s: watch of %v returned %v - backing off", r.name, r.typeDescription, err) + logger.V(4).Info("Watch failed - backing off", "reflector", r.name, "type", r.typeDescription, "err", err) select { case <-stopCh: return nil @@ -463,8 +527,8 @@ func (r *Reflector) watch(w watch.Interface, stopCh <-chan struct{}, resyncerrc } } - err = handleWatch(start, w, r.store, r.expectedType, r.expectedGVK, r.name, r.typeDescription, r.setLastSyncResourceVersion, - r.clock, resyncerrc, stopCh) + err = handleWatch(ctx, start, w, r.store, r.expectedType, r.expectedGVK, r.name, r.typeDescription, r.setLastSyncResourceVersion, + r.clock, resyncerrc) // Ensure that watch will not be reused across iterations. w.Stop() w = nil @@ -476,9 +540,9 @@ func (r *Reflector) watch(w watch.Interface, stopCh <-chan struct{}, resyncerrc // Don't set LastSyncResourceVersionUnavailable - LIST call with ResourceVersion=RV already // has a semantic that it returns data at least as fresh as provided RV. // So first try to LIST with setting RV to resource version of last observed object. - klog.V(4).Infof("%s: watch of %v closed with: %v", r.name, r.typeDescription, err) + logger.V(4).Info("Watch closed", "reflector", r.name, "type", r.typeDescription, "err", err) case apierrors.IsTooManyRequests(err): - klog.V(2).Infof("%s: watch of %v returned 429 - backing off", r.name, r.typeDescription) + logger.V(2).Info("Watch returned 429 - backing off", "reflector", r.name, "type", r.typeDescription) select { case <-stopCh: return nil @@ -486,10 +550,10 @@ func (r *Reflector) watch(w watch.Interface, stopCh <-chan struct{}, resyncerrc continue } case apierrors.IsInternalError(err) && retry.ShouldRetry(): - klog.V(2).Infof("%s: retrying watch of %v internal error: %v", r.name, r.typeDescription, err) + logger.V(2).Info("Retrying watch after internal error", "reflector", r.name, "type", r.typeDescription, "err", err) continue default: - klog.Warningf("%s: watch of %v ended with: %v", r.name, r.typeDescription, err) + logger.Info("Warning: watch ended with error", "reflector", r.name, "type", r.typeDescription, "err", err) } } return nil @@ -499,7 +563,7 @@ func (r *Reflector) watch(w watch.Interface, stopCh <-chan struct{}, resyncerrc // list simply lists all items and records a resource version obtained from the server at the moment of the call. // the resource version can be used for further progress notification (aka. watch). -func (r *Reflector) list(stopCh <-chan struct{}) error { +func (r *Reflector) list(ctx context.Context) error { var resourceVersion string options := metav1.ListOptions{ResourceVersion: r.relistResourceVersion()} @@ -519,7 +583,7 @@ func (r *Reflector) list(stopCh <-chan struct{}) error { // Attempt to gather list in chunks, if supported by listerWatcher, if not, the first // list request will return the full response. pager := pager.New(pager.SimplePageFunc(func(opts metav1.ListOptions) (runtime.Object, error) { - return r.listerWatcher.List(opts) + return r.listerWatcher.ListWithContext(ctx, opts) })) switch { case r.WatchListPageSize != 0: @@ -558,7 +622,7 @@ func (r *Reflector) list(stopCh <-chan struct{}) error { close(listCh) }() select { - case <-stopCh: + case <-ctx.Done(): return nil case r := <-panicCh: panic(r) @@ -566,7 +630,6 @@ func (r *Reflector) list(stopCh <-chan struct{}) error { } initTrace.Step("Objects listed", trace.Field{Key: "error", Value: err}) if err != nil { - klog.Warningf("%s: failed to list %v: %v", r.name, r.typeDescription, err) return fmt.Errorf("failed to list %v: %w", r.typeDescription, err) } @@ -624,7 +687,9 @@ func (r *Reflector) list(stopCh <-chan struct{}) error { // After receiving a "Bookmark" event the reflector is considered to be synchronized. // It replaces its internal store with the collected items and // reuses the current watch requests for getting further events. -func (r *Reflector) watchList(stopCh <-chan struct{}) (watch.Interface, error) { +func (r *Reflector) watchList(ctx context.Context) (watch.Interface, error) { + stopCh := ctx.Done() + logger := klog.FromContext(ctx) var w watch.Interface var err error var temporaryStore Store @@ -634,7 +699,7 @@ func (r *Reflector) watchList(stopCh <-chan struct{}) (watch.Interface, error) { // could be unified with the r.watch method isErrorRetriableWithSideEffectsFn := func(err error) bool { if canRetry := isWatchErrorRetriable(err); canRetry { - klog.V(2).Infof("%s: watch-list of %v returned %v - backing off", r.name, r.typeDescription, err) + logger.V(2).Info("watch-list failed - backing off", "reflector", r.name, "type", r.typeDescription, "err", err) <-r.backoffManager.Backoff().C() return true } @@ -674,16 +739,16 @@ func (r *Reflector) watchList(stopCh <-chan struct{}) (watch.Interface, error) { } start := r.clock.Now() - w, err = r.listerWatcher.Watch(options) + w, err = r.listerWatcher.WatchWithContext(ctx, options) if err != nil { if isErrorRetriableWithSideEffectsFn(err) { continue } return nil, err } - watchListBookmarkReceived, err := handleListWatch(start, w, temporaryStore, r.expectedType, r.expectedGVK, r.name, r.typeDescription, + watchListBookmarkReceived, err := handleListWatch(ctx, start, w, temporaryStore, r.expectedType, r.expectedGVK, r.name, r.typeDescription, func(rv string) { resourceVersion = rv }, - r.clock, make(chan error), stopCh) + r.clock, make(chan error)) if err != nil { w.Stop() // stop and retry with clean state if errors.Is(err, errorStopRequested) { @@ -706,7 +771,7 @@ func (r *Reflector) watchList(stopCh <-chan struct{}) (watch.Interface, error) { // we utilize the temporaryStore to ensure independence from the current store implementation. // as of today, the store is implemented as a queue and will be drained by the higher-level // component as soon as it finishes replacing the content. - checkWatchListDataConsistencyIfRequested(wait.ContextForChannel(stopCh), r.name, resourceVersion, wrapListFuncWithContext(r.listerWatcher.List), temporaryStore.List) + checkWatchListDataConsistencyIfRequested(ctx, r.name, resourceVersion, r.listerWatcher.ListWithContext, temporaryStore.List) if err := r.store.Replace(temporaryStore.List(), resourceVersion); err != nil { return nil, fmt.Errorf("unable to sync watch-list result: %w", err) @@ -731,6 +796,7 @@ func (r *Reflector) syncWith(items []runtime.Object, resourceVersion string) err // retry. If successful, the watcher will be left open after receiving the // initial set of objects, to allow watching for future events. func handleListWatch( + ctx context.Context, start time.Time, w watch.Interface, store Store, @@ -741,20 +807,20 @@ func handleListWatch( setLastSyncResourceVersion func(string), clock clock.Clock, errCh chan error, - stopCh <-chan struct{}, ) (bool, error) { exitOnWatchListBookmarkReceived := true - return handleAnyWatch(start, w, store, expectedType, expectedGVK, name, expectedTypeName, - setLastSyncResourceVersion, exitOnWatchListBookmarkReceived, clock, errCh, stopCh) + return handleAnyWatch(ctx, start, w, store, expectedType, expectedGVK, name, expectedTypeName, + setLastSyncResourceVersion, exitOnWatchListBookmarkReceived, clock, errCh) } // handleListWatch consumes events from w, updates the Store, and records the // last seen ResourceVersion, to allow continuing from that ResourceVersion on // retry. The watcher will always be stopped on exit. func handleWatch( + ctx context.Context, start time.Time, w watch.Interface, - store Store, + store ReflectorStore, expectedType reflect.Type, expectedGVK *schema.GroupVersionKind, name string, @@ -762,11 +828,10 @@ func handleWatch( setLastSyncResourceVersion func(string), clock clock.Clock, errCh chan error, - stopCh <-chan struct{}, ) error { exitOnWatchListBookmarkReceived := false - _, err := handleAnyWatch(start, w, store, expectedType, expectedGVK, name, expectedTypeName, - setLastSyncResourceVersion, exitOnWatchListBookmarkReceived, clock, errCh, stopCh) + _, err := handleAnyWatch(ctx, start, w, store, expectedType, expectedGVK, name, expectedTypeName, + setLastSyncResourceVersion, exitOnWatchListBookmarkReceived, clock, errCh) return err } @@ -779,9 +844,11 @@ func handleWatch( // The watcher will always be stopped, unless exitOnWatchListBookmarkReceived is // true and watchListBookmarkReceived is true. This allows the same watch stream // to be re-used by the caller to continue watching for new events. -func handleAnyWatch(start time.Time, +func handleAnyWatch( + ctx context.Context, + start time.Time, w watch.Interface, - store Store, + store ReflectorStore, expectedType reflect.Type, expectedGVK *schema.GroupVersionKind, name string, @@ -790,17 +857,17 @@ func handleAnyWatch(start time.Time, exitOnWatchListBookmarkReceived bool, clock clock.Clock, errCh chan error, - stopCh <-chan struct{}, ) (bool, error) { watchListBookmarkReceived := false eventCount := 0 - initialEventsEndBookmarkWarningTicker := newInitialEventsEndBookmarkTicker(name, clock, start, exitOnWatchListBookmarkReceived) + logger := klog.FromContext(ctx) + initialEventsEndBookmarkWarningTicker := newInitialEventsEndBookmarkTicker(logger, name, clock, start, exitOnWatchListBookmarkReceived) defer initialEventsEndBookmarkWarningTicker.Stop() loop: for { select { - case <-stopCh: + case <-ctx.Done(): return watchListBookmarkReceived, errorStopRequested case err := <-errCh: return watchListBookmarkReceived, err @@ -813,19 +880,19 @@ loop: } if expectedType != nil { if e, a := expectedType, reflect.TypeOf(event.Object); e != a { - utilruntime.HandleError(fmt.Errorf("%s: expected type %v, but watch event object had type %v", name, e, a)) + utilruntime.HandleErrorWithContext(ctx, nil, "Unexpected watch event object type", "reflector", name, "expectedType", e, "actualType", a) continue } } if expectedGVK != nil { if e, a := *expectedGVK, event.Object.GetObjectKind().GroupVersionKind(); e != a { - utilruntime.HandleError(fmt.Errorf("%s: expected gvk %v, but watch event object had gvk %v", name, e, a)) + utilruntime.HandleErrorWithContext(ctx, nil, "Unexpected watch event object gvk", "reflector", name, "expectedGVK", e, "actualGVK", a) continue } } meta, err := meta.Accessor(event.Object) if err != nil { - utilruntime.HandleError(fmt.Errorf("%s: unable to understand watch event %#v", name, event)) + utilruntime.HandleErrorWithContext(ctx, err, "Unable to understand watch event", "reflector", name, "event", event) continue } resourceVersion := meta.GetResourceVersion() @@ -833,12 +900,12 @@ loop: case watch.Added: err := store.Add(event.Object) if err != nil { - utilruntime.HandleError(fmt.Errorf("%s: unable to add watch event object (%#v) to store: %v", name, event.Object, err)) + utilruntime.HandleErrorWithContext(ctx, err, "Unable to add watch event object to store", "reflector", name, "object", event.Object) } case watch.Modified: err := store.Update(event.Object) if err != nil { - utilruntime.HandleError(fmt.Errorf("%s: unable to update watch event object (%#v) to store: %v", name, event.Object, err)) + utilruntime.HandleErrorWithContext(ctx, err, "Unable to update watch event object to store", "reflector", name, "object", event.Object) } case watch.Deleted: // TODO: Will any consumers need access to the "last known @@ -846,7 +913,7 @@ loop: // to change this. err := store.Delete(event.Object) if err != nil { - utilruntime.HandleError(fmt.Errorf("%s: unable to delete watch event object (%#v) from store: %v", name, event.Object, err)) + utilruntime.HandleErrorWithContext(ctx, err, "Unable to delete watch event object from store", "reflector", name, "object", event.Object) } case watch.Bookmark: // A `Bookmark` means watch has synced here, just update the resourceVersion @@ -854,7 +921,7 @@ loop: watchListBookmarkReceived = true } default: - utilruntime.HandleError(fmt.Errorf("%s: unable to understand watch event %#v", name, event)) + utilruntime.HandleErrorWithContext(ctx, err, "Unknown watch event", "reflector", name, "event", event) } setLastSyncResourceVersion(resourceVersion) if rvu, ok := store.(ResourceVersionUpdater); ok { @@ -863,7 +930,7 @@ loop: eventCount++ if exitOnWatchListBookmarkReceived && watchListBookmarkReceived { watchDuration := clock.Since(start) - klog.V(4).Infof("exiting %v Watch because received the bookmark that marks the end of initial events stream, total %v items received in %v", name, eventCount, watchDuration) + klog.FromContext(ctx).V(4).Info("Exiting watch because received the bookmark that marks the end of initial events stream", "reflector", name, "totalItems", eventCount, "duration", watchDuration) return watchListBookmarkReceived, nil } initialEventsEndBookmarkWarningTicker.observeLastEventTimeStamp(clock.Now()) @@ -876,7 +943,7 @@ loop: if watchDuration < 1*time.Second && eventCount == 0 { return watchListBookmarkReceived, fmt.Errorf("very short watch: %s: Unexpected watch close - watch lasted less than a second and no items received", name) } - klog.V(4).Infof("%s: Watch close - %v total %v items received", name, expectedTypeName, eventCount) + klog.FromContext(ctx).V(4).Info("Watch close", "reflector", name, "type", expectedTypeName, "totalItems", eventCount) return watchListBookmarkReceived, nil } @@ -990,13 +1057,6 @@ func isWatchErrorRetriable(err error) bool { return false } -// wrapListFuncWithContext simply wraps ListFunction into another function that accepts a context and ignores it. -func wrapListFuncWithContext(listFn ListFunc) func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { - return func(_ context.Context, options metav1.ListOptions) (runtime.Object, error) { - return listFn(options) - } -} - // initialEventsEndBookmarkTicker a ticker that produces a warning if the bookmark event // which marks the end of the watch stream, has not been received within the defined tick interval. // @@ -1004,8 +1064,9 @@ func wrapListFuncWithContext(listFn ListFunc) func(ctx context.Context, options // The methods exposed by this type are not thread-safe. type initialEventsEndBookmarkTicker struct { clock.Ticker - clock clock.Clock - name string + clock clock.Clock + name string + logger klog.Logger watchStart time.Time tickInterval time.Duration @@ -1019,15 +1080,15 @@ type initialEventsEndBookmarkTicker struct { // Note that the caller controls whether to call t.C() and t.Stop(). // // In practice, the reflector exits the watchHandler as soon as the bookmark event is received and calls the t.C() method. -func newInitialEventsEndBookmarkTicker(name string, c clock.Clock, watchStart time.Time, exitOnWatchListBookmarkReceived bool) *initialEventsEndBookmarkTicker { - return newInitialEventsEndBookmarkTickerInternal(name, c, watchStart, 10*time.Second, exitOnWatchListBookmarkReceived) +func newInitialEventsEndBookmarkTicker(logger klog.Logger, name string, c clock.Clock, watchStart time.Time, exitOnWatchListBookmarkReceived bool) *initialEventsEndBookmarkTicker { + return newInitialEventsEndBookmarkTickerInternal(logger, name, c, watchStart, 10*time.Second, exitOnWatchListBookmarkReceived) } -func newInitialEventsEndBookmarkTickerInternal(name string, c clock.Clock, watchStart time.Time, tickInterval time.Duration, exitOnWatchListBookmarkReceived bool) *initialEventsEndBookmarkTicker { +func newInitialEventsEndBookmarkTickerInternal(logger klog.Logger, name string, c clock.Clock, watchStart time.Time, tickInterval time.Duration, exitOnWatchListBookmarkReceived bool) *initialEventsEndBookmarkTicker { clockWithTicker, ok := c.(clock.WithTicker) if !ok || !exitOnWatchListBookmarkReceived { if exitOnWatchListBookmarkReceived { - klog.Warningf("clock does not support WithTicker interface but exitOnInitialEventsEndBookmark was requested") + logger.Info("Warning: clock does not support WithTicker interface but exitOnInitialEventsEndBookmark was requested") } return &initialEventsEndBookmarkTicker{ Ticker: &noopTicker{}, @@ -1038,6 +1099,7 @@ func newInitialEventsEndBookmarkTickerInternal(name string, c clock.Clock, watch Ticker: clockWithTicker.NewTicker(tickInterval), clock: c, name: name, + logger: logger, watchStart: watchStart, tickInterval: tickInterval, } @@ -1049,7 +1111,7 @@ func (t *initialEventsEndBookmarkTicker) observeLastEventTimeStamp(lastEventObse func (t *initialEventsEndBookmarkTicker) warnIfExpired() { if err := t.produceWarningIfExpired(); err != nil { - klog.Warning(err) + t.logger.Info("Warning: event bookmark expired", "err", err) } } diff --git a/e2e/vendor/k8s.io/client-go/tools/cache/shared_informer.go b/e2e/vendor/k8s.io/client-go/tools/cache/shared_informer.go index c805030bd..9f194ff64 100644 --- a/e2e/vendor/k8s.io/client-go/tools/cache/shared_informer.go +++ b/e2e/vendor/k8s.io/client-go/tools/cache/shared_informer.go @@ -17,6 +17,7 @@ limitations under the License. package cache import ( + "context" "errors" "fmt" "sync" @@ -29,6 +30,7 @@ import ( "k8s.io/client-go/tools/cache/synctrack" "k8s.io/utils/buffer" "k8s.io/utils/clock" + "k8s.io/utils/ptr" "k8s.io/klog/v2" @@ -142,6 +144,8 @@ type SharedInformer interface { // It returns a registration handle for the handler that can be used to // remove the handler again, or to tell if the handler is synced (has // seen every item in the initial list). + // + // Contextual logging: AddEventHandlerWithOptions together with a logger in the options should be used instead of AddEventHandler in code which supports contextual logging. AddEventHandler(handler ResourceEventHandler) (ResourceEventHandlerRegistration, error) // AddEventHandlerWithResyncPeriod adds an event handler to the // shared informer with the requested resync period; zero means @@ -159,7 +163,12 @@ type SharedInformer interface { // be competing load and scheduling noise. // It returns a registration handle for the handler that can be used to remove // the handler again and an error if the handler cannot be added. + // + // Contextual logging: AddEventHandlerWithOptions together with a logger in the options should be used instead of AddEventHandlerWithResyncPeriod in code which supports contextual logging. AddEventHandlerWithResyncPeriod(handler ResourceEventHandler, resyncPeriod time.Duration) (ResourceEventHandlerRegistration, error) + // AddEventHandlerWithOptions is a variant of AddEventHandlerWithResyncPeriod where + // all optional parameters are passed in a struct. + AddEventHandlerWithOptions(handler ResourceEventHandler, options HandlerOptions) (ResourceEventHandlerRegistration, error) // RemoveEventHandler removes a formerly added event handler given by // its registration handle. // This function is guaranteed to be idempotent, and thread-safe. @@ -170,7 +179,12 @@ type SharedInformer interface { GetController() Controller // Run starts and runs the shared informer, returning after it stops. // The informer will be stopped when stopCh is closed. + // + // Contextual logging: RunWithContext should be used instead of Run in code which uses contextual logging. Run(stopCh <-chan struct{}) + // RunWithContext starts and runs the shared informer, returning after it stops. + // The informer will be stopped when the context is canceled. + RunWithContext(ctx context.Context) // HasSynced returns true if the shared informer's store has been // informed by at least one full LIST of the authoritative state // of the informer's object collection. This is unrelated to "resync". @@ -197,8 +211,14 @@ type SharedInformer interface { // The handler is intended for visibility, not to e.g. pause the consumers. // The handler should return quickly - any expensive processing should be // offloaded. + // + // Contextual logging: SetWatchErrorHandlerWithContext should be used instead of SetWatchErrorHandler in code which supports contextual logging. SetWatchErrorHandler(handler WatchErrorHandler) error + // SetWatchErrorHandlerWithContext is a variant of SetWatchErrorHandler where + // the handler is passed an additional context parameter. + SetWatchErrorHandlerWithContext(handler WatchErrorHandlerWithContext) error + // The TransformFunc is called for each object which is about to be stored. // // This function is intended for you to take the opportunity to @@ -228,6 +248,21 @@ type ResourceEventHandlerRegistration interface { HasSynced() bool } +// Optional configuration options for [SharedInformer.AddEventHandlerWithOptions]. +// May be left empty. +type HandlerOptions struct { + // Logger overrides the default klog.Background() logger. + Logger *klog.Logger + + // ResyncPeriod requests a certain resync period from an informer. Zero + // means the handler does not care about resyncs. Not all informers do + // resyncs, even if requested. See + // [SharedInformer.AddEventHandlerWithResyncPeriod] for details. + // + // If nil, the default resync period of the shared informer is used. + ResyncPeriod *time.Duration +} + // SharedIndexInformer provides add and get Indexers ability based on SharedInformer. type SharedIndexInformer interface { SharedInformer @@ -309,15 +344,38 @@ const ( // WaitForNamedCacheSync is a wrapper around WaitForCacheSync that generates log messages // indicating that the caller identified by name is waiting for syncs, followed by // either a successful or failed sync. +// +// Contextual logging: WaitForNamedCacheSyncWithContext should be used instead of WaitForNamedCacheSync in code which supports contextual logging. func WaitForNamedCacheSync(controllerName string, stopCh <-chan struct{}, cacheSyncs ...InformerSynced) bool { - klog.Infof("Waiting for caches to sync for %s", controllerName) + klog.Background().Info("Waiting for caches to sync", "controller", controllerName) if !WaitForCacheSync(stopCh, cacheSyncs...) { - utilruntime.HandleError(fmt.Errorf("unable to sync caches for %s", controllerName)) + utilruntime.HandleErrorWithContext(context.Background(), nil, "Unable to sync caches", "controller", controllerName) return false } - klog.Infof("Caches are synced for %s", controllerName) + klog.Background().Info("Caches are synced", "controller", controllerName) + return true +} + +// WaitForNamedCacheSyncWithContext is a wrapper around WaitForCacheSyncWithContext that generates log messages +// indicating that the caller is waiting for syncs, followed by either a successful or failed sync. +// +// Contextual logging can be used to identify the caller in those log messages. The log level is zero, +// the same as in [WaitForNamedCacheSync]. If this is too verbose, then store a logger with an increased +// threshold in the context: +// +// WaitForNamedCacheSyncWithContext(klog.NewContext(ctx, logger.V(5)), ...) +func WaitForNamedCacheSyncWithContext(ctx context.Context, cacheSyncs ...InformerSynced) bool { + logger := klog.FromContext(ctx) + logger.Info("Waiting for caches to sync") + + if !WaitForCacheSync(ctx.Done(), cacheSyncs...) { + utilruntime.HandleErrorWithContext(ctx, nil, "Unable to sync caches") + return false + } + + logger.Info("Caches are synced") return true } @@ -389,7 +447,7 @@ type sharedIndexInformer struct { blockDeltas sync.Mutex // Called whenever the ListAndWatch drops the connection with an error. - watchErrorHandler WatchErrorHandler + watchErrorHandler WatchErrorHandlerWithContext transform TransformFunc } @@ -403,6 +461,9 @@ type dummyController struct { informer *sharedIndexInformer } +func (v *dummyController) RunWithContext(context.Context) { +} + func (v *dummyController) Run(stopCh <-chan struct{}) { } @@ -433,6 +494,12 @@ type deleteNotification struct { } func (s *sharedIndexInformer) SetWatchErrorHandler(handler WatchErrorHandler) error { + return s.SetWatchErrorHandlerWithContext(func(_ context.Context, r *Reflector, err error) { + handler(r, err) + }) +} + +func (s *sharedIndexInformer) SetWatchErrorHandlerWithContext(handler WatchErrorHandlerWithContext) error { s.startedLock.Lock() defer s.startedLock.Unlock() @@ -457,10 +524,15 @@ func (s *sharedIndexInformer) SetTransform(handler TransformFunc) error { } func (s *sharedIndexInformer) Run(stopCh <-chan struct{}) { - defer utilruntime.HandleCrash() + s.RunWithContext(wait.ContextForChannel(stopCh)) +} + +func (s *sharedIndexInformer) RunWithContext(ctx context.Context) { + defer utilruntime.HandleCrashWithContext(ctx) + logger := klog.FromContext(ctx) if s.HasStarted() { - klog.Warningf("The sharedIndexInformer has started, run more than once is not allowed") + logger.Info("Warning: the sharedIndexInformer has started, run more than once is not allowed") return } @@ -468,11 +540,16 @@ func (s *sharedIndexInformer) Run(stopCh <-chan struct{}) { s.startedLock.Lock() defer s.startedLock.Unlock() - fifo := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ - KnownObjects: s.indexer, - EmitDeltaTypeReplaced: true, - Transformer: s.transform, - }) + var fifo Queue + if clientgofeaturegate.FeatureGates().Enabled(clientgofeaturegate.InOrderInformers) { + fifo = NewRealFIFO(MetaNamespaceKeyFunc, s.indexer, s.transform) + } else { + fifo = NewDeltaFIFOWithOptions(DeltaFIFOOptions{ + KnownObjects: s.indexer, + EmitDeltaTypeReplaced: true, + Transformer: s.transform, + }) + } cfg := &Config{ Queue: fifo, @@ -480,11 +557,10 @@ func (s *sharedIndexInformer) Run(stopCh <-chan struct{}) { ObjectType: s.objectType, ObjectDescription: s.objectDescription, FullResyncPeriod: s.resyncCheckPeriod, - RetryOnError: false, ShouldResync: s.processor.shouldResync, - Process: s.HandleDeltas, - WatchErrorHandler: s.watchErrorHandler, + Process: s.HandleDeltas, + WatchErrorHandlerWithContext: s.watchErrorHandler, } s.controller = New(cfg) @@ -492,20 +568,24 @@ func (s *sharedIndexInformer) Run(stopCh <-chan struct{}) { s.started = true }() - // Separate stop channel because Processor should be stopped strictly after controller - processorStopCh := make(chan struct{}) + // Separate stop context because Processor should be stopped strictly after controller. + // Cancelation in the parent context is ignored and all values are passed on, + // including - but not limited to - a logger. + processorStopCtx, stopProcessor := context.WithCancelCause(context.WithoutCancel(ctx)) var wg wait.Group - defer wg.Wait() // Wait for Processor to stop - defer close(processorStopCh) // Tell Processor to stop - wg.StartWithChannel(processorStopCh, s.cacheMutationDetector.Run) - wg.StartWithChannel(processorStopCh, s.processor.run) + defer wg.Wait() // Wait for Processor to stop + defer stopProcessor(errors.New("informer is stopping")) // Tell Processor to stop + // TODO: extend the MutationDetector interface so that it optionally + // has a RunWithContext method that we can use here. + wg.StartWithChannel(processorStopCtx.Done(), s.cacheMutationDetector.Run) + wg.StartWithContext(processorStopCtx, s.processor.run) defer func() { s.startedLock.Lock() defer s.startedLock.Unlock() s.stopped = true // Don't want any new listeners }() - s.controller.Run(stopCh) + s.controller.RunWithContext(ctx) } func (s *sharedIndexInformer) HasStarted() bool { @@ -558,19 +638,19 @@ func (s *sharedIndexInformer) GetController() Controller { } func (s *sharedIndexInformer) AddEventHandler(handler ResourceEventHandler) (ResourceEventHandlerRegistration, error) { - return s.AddEventHandlerWithResyncPeriod(handler, s.defaultEventHandlerResyncPeriod) + return s.AddEventHandlerWithOptions(handler, HandlerOptions{}) } -func determineResyncPeriod(desired, check time.Duration) time.Duration { +func determineResyncPeriod(logger klog.Logger, desired, check time.Duration) time.Duration { if desired == 0 { return desired } if check == 0 { - klog.Warningf("The specified resyncPeriod %v is invalid because this shared informer doesn't support resyncing", desired) + logger.Info("Warning: the specified resyncPeriod is invalid because this shared informer doesn't support resyncing", "desired", desired) return 0 } if desired < check { - klog.Warningf("The specified resyncPeriod %v is being increased to the minimum resyncCheckPeriod %v", desired, check) + logger.Info("Warning: the specified resyncPeriod is being increased to the minimum resyncCheckPeriod", "desired", desired, "resyncCheckPeriod", check) return check } return desired @@ -579,6 +659,10 @@ func determineResyncPeriod(desired, check time.Duration) time.Duration { const minimumResyncPeriod = 1 * time.Second func (s *sharedIndexInformer) AddEventHandlerWithResyncPeriod(handler ResourceEventHandler, resyncPeriod time.Duration) (ResourceEventHandlerRegistration, error) { + return s.AddEventHandlerWithOptions(handler, HandlerOptions{ResyncPeriod: &resyncPeriod}) +} + +func (s *sharedIndexInformer) AddEventHandlerWithOptions(handler ResourceEventHandler, options HandlerOptions) (ResourceEventHandlerRegistration, error) { s.startedLock.Lock() defer s.startedLock.Unlock() @@ -586,27 +670,30 @@ func (s *sharedIndexInformer) AddEventHandlerWithResyncPeriod(handler ResourceEv return nil, fmt.Errorf("handler %v was not added to shared informer because it has stopped already", handler) } + logger := ptr.Deref(options.Logger, klog.Background()) + resyncPeriod := ptr.Deref(options.ResyncPeriod, s.defaultEventHandlerResyncPeriod) if resyncPeriod > 0 { if resyncPeriod < minimumResyncPeriod { - klog.Warningf("resyncPeriod %v is too small. Changing it to the minimum allowed value of %v", resyncPeriod, minimumResyncPeriod) + logger.Info("Warning: resync period is too small. Changing it to the minimum allowed value", "resyncPeriod", resyncPeriod, "minimumResyncPeriod", minimumResyncPeriod) resyncPeriod = minimumResyncPeriod } if resyncPeriod < s.resyncCheckPeriod { if s.started { - klog.Warningf("resyncPeriod %v is smaller than resyncCheckPeriod %v and the informer has already started. Changing it to %v", resyncPeriod, s.resyncCheckPeriod, s.resyncCheckPeriod) + logger.Info("Warning: resync period is smaller than resync check period and the informer has already started. Changing it to the resync check period", "resyncPeriod", resyncPeriod, "resyncCheckPeriod", s.resyncCheckPeriod) + resyncPeriod = s.resyncCheckPeriod } else { // if the event handler's resyncPeriod is smaller than the current resyncCheckPeriod, update // resyncCheckPeriod to match resyncPeriod and adjust the resync periods of all the listeners // accordingly s.resyncCheckPeriod = resyncPeriod - s.processor.resyncCheckPeriodChanged(resyncPeriod) + s.processor.resyncCheckPeriodChanged(logger, resyncPeriod) } } } - listener := newProcessListener(handler, resyncPeriod, determineResyncPeriod(resyncPeriod, s.resyncCheckPeriod), s.clock.Now(), initialBufferSize, s.HasSynced) + listener := newProcessListener(logger, handler, resyncPeriod, determineResyncPeriod(logger, resyncPeriod, s.resyncCheckPeriod), s.clock.Now(), initialBufferSize, s.HasSynced) if !s.started { return s.processor.addListener(listener), nil @@ -648,7 +735,7 @@ func (s *sharedIndexInformer) HandleDeltas(obj interface{}, isInInitialList bool // Conforms to ResourceEventHandler func (s *sharedIndexInformer) OnAdd(obj interface{}, isInInitialList bool) { // Invocation of this function is locked under s.blockDeltas, so it is - // save to distribute the notification + // safe to distribute the notification s.cacheMutationDetector.AddObject(obj) s.processor.distribute(addNotification{newObj: obj, isInInitialList: isInInitialList}, false) } @@ -670,7 +757,7 @@ func (s *sharedIndexInformer) OnUpdate(old, new interface{}) { } // Invocation of this function is locked under s.blockDeltas, so it is - // save to distribute the notification + // safe to distribute the notification s.cacheMutationDetector.AddObject(new) s.processor.distribute(updateNotification{oldObj: old, newObj: new}, isSync) } @@ -678,7 +765,7 @@ func (s *sharedIndexInformer) OnUpdate(old, new interface{}) { // Conforms to ResourceEventHandler func (s *sharedIndexInformer) OnDelete(old interface{}) { // Invocation of this function is locked under s.blockDeltas, so it is - // save to distribute the notification + // safe to distribute the notification s.processor.distribute(deleteNotification{oldObj: old}, false) } @@ -794,7 +881,7 @@ func (p *sharedProcessor) distribute(obj interface{}, sync bool) { } } -func (p *sharedProcessor) run(stopCh <-chan struct{}) { +func (p *sharedProcessor) run(ctx context.Context) { func() { p.listenersLock.RLock() defer p.listenersLock.RUnlock() @@ -804,7 +891,7 @@ func (p *sharedProcessor) run(stopCh <-chan struct{}) { } p.listenersStarted = true }() - <-stopCh + <-ctx.Done() p.listenersLock.Lock() defer p.listenersLock.Unlock() @@ -844,13 +931,13 @@ func (p *sharedProcessor) shouldResync() bool { return resyncNeeded } -func (p *sharedProcessor) resyncCheckPeriodChanged(resyncCheckPeriod time.Duration) { +func (p *sharedProcessor) resyncCheckPeriodChanged(logger klog.Logger, resyncCheckPeriod time.Duration) { p.listenersLock.RLock() defer p.listenersLock.RUnlock() for listener := range p.listeners { resyncPeriod := determineResyncPeriod( - listener.requestedResyncPeriod, resyncCheckPeriod) + logger, listener.requestedResyncPeriod, resyncCheckPeriod) listener.setResyncPeriod(resyncPeriod) } } @@ -867,6 +954,7 @@ func (p *sharedProcessor) resyncCheckPeriodChanged(resyncCheckPeriod time.Durati // processorListener also keeps track of the adjusted requested resync // period of the listener. type processorListener struct { + logger klog.Logger nextCh chan interface{} addCh chan interface{} @@ -910,8 +998,9 @@ func (p *processorListener) HasSynced() bool { return p.syncTracker.HasSynced() } -func newProcessListener(handler ResourceEventHandler, requestedResyncPeriod, resyncPeriod time.Duration, now time.Time, bufferSize int, hasSynced func() bool) *processorListener { +func newProcessListener(logger klog.Logger, handler ResourceEventHandler, requestedResyncPeriod, resyncPeriod time.Duration, now time.Time, bufferSize int, hasSynced func() bool) *processorListener { ret := &processorListener{ + logger: logger, nextCh: make(chan interface{}), addCh: make(chan interface{}), handler: handler, @@ -934,7 +1023,7 @@ func (p *processorListener) add(notification interface{}) { } func (p *processorListener) pop() { - defer utilruntime.HandleCrash() + defer utilruntime.HandleCrashWithLogger(p.logger) defer close(p.nextCh) // Tell .run() to stop var nextCh chan<- interface{} @@ -966,11 +1055,21 @@ func (p *processorListener) pop() { func (p *processorListener) run() { // this call blocks until the channel is closed. When a panic happens during the notification // we will catch it, **the offending item will be skipped!**, and after a short delay (one second) - // the next notification will be attempted. This is usually better than the alternative of never + // the next notification will be attempted. This is usually better than the alternative of never // delivering again. - stopCh := make(chan struct{}) - wait.Until(func() { - for next := range p.nextCh { + // + // This only applies if utilruntime is configured to not panic, which is not the default. + sleepAfterCrash := false + for next := range p.nextCh { + if sleepAfterCrash { + // Sleep before processing the next item. + time.Sleep(time.Second) + } + func() { + // Gets reset below, but only if we get that far. + sleepAfterCrash = true + defer utilruntime.HandleCrashWithLogger(p.logger) + switch notification := next.(type) { case updateNotification: p.handler.OnUpdate(notification.oldObj, notification.newObj) @@ -982,15 +1081,14 @@ func (p *processorListener) run() { case deleteNotification: p.handler.OnDelete(notification.oldObj) default: - utilruntime.HandleError(fmt.Errorf("unrecognized notification: %T", next)) + utilruntime.HandleErrorWithLogger(p.logger, nil, "unrecognized notification", "notificationType", fmt.Sprintf("%T", next)) } - } - // the only way to get here is if the p.nextCh is empty and closed - close(stopCh) - }, 1*time.Second, stopCh) + sleepAfterCrash = false + }() + } } -// shouldResync deterimines if the listener needs a resync. If the listener's resyncPeriod is 0, +// shouldResync determines if the listener needs a resync. If the listener's resyncPeriod is 0, // this always returns false. func (p *processorListener) shouldResync(now time.Time) bool { p.resyncLock.Lock() diff --git a/e2e/vendor/k8s.io/client-go/tools/cache/the_real_fifo.go b/e2e/vendor/k8s.io/client-go/tools/cache/the_real_fifo.go new file mode 100644 index 000000000..9be14ff38 --- /dev/null +++ b/e2e/vendor/k8s.io/client-go/tools/cache/the_real_fifo.go @@ -0,0 +1,407 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cache + +import ( + "fmt" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/apimachinery/pkg/util/sets" + utiltrace "k8s.io/utils/trace" + "sync" + "time" +) + +// RealFIFO is a Queue in which every notification from the Reflector is passed +// in order to the Queue via Pop. +// This means that it +// 1. delivers notifications for items that have been deleted +// 2. delivers multiple notifications per item instead of simply the most recent value +type RealFIFO struct { + lock sync.RWMutex + cond sync.Cond + + items []Delta + + // 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 + + // knownObjects list keys that are "known" --- affecting Delete(), + // Replace(), and Resync() + knownObjects KeyListerGetter + + // Indication the queue is closed. + // Used to indicate a queue is closed so a control loop can exit when a queue is empty. + // Currently, not used to gate any of CRUD operations. + closed bool + + // Called with every object if non-nil. + transformer TransformFunc +} + +var ( + _ = Queue(&RealFIFO{}) // RealFIFO is a Queue +) + +// Close the queue. +func (f *RealFIFO) Close() { + f.lock.Lock() + defer f.lock.Unlock() + f.closed = true + f.cond.Broadcast() +} + +// KeyOf exposes f's keyFunc, but also detects the key of a Deltas object or +// DeletedFinalStateUnknown objects. +func (f *RealFIFO) keyOf(obj interface{}) (string, error) { + if d, ok := obj.(Deltas); ok { + if len(d) == 0 { + return "", KeyError{obj, ErrZeroLengthDeltasObject} + } + obj = d.Newest().Object + } + if d, ok := obj.(Delta); ok { + obj = d.Object + } + if d, ok := obj.(DeletedFinalStateUnknown); ok { + return d.Key, nil + } + return f.keyFunc(obj) +} + +// HasSynced returns true if an Add/Update/Delete are called first, +// or the first batch of items inserted by Replace() has been popped. +func (f *RealFIFO) HasSynced() bool { + f.lock.Lock() + defer f.lock.Unlock() + return f.hasSynced_locked() +} + +// ignoring lint to reduce delta to the original for review. It's ok adjust later. +// +//lint:file-ignore ST1003: should not use underscores in Go names +func (f *RealFIFO) hasSynced_locked() bool { + return f.populated && f.initialPopulationCount == 0 +} + +// addToItems_locked appends to the delta list. +func (f *RealFIFO) addToItems_locked(deltaActionType DeltaType, skipTransform bool, obj interface{}) error { + // we must be able to read the keys in order to determine whether the knownObjcts and the items + // in this FIFO overlap + _, err := f.keyOf(obj) + if err != nil { + return KeyError{obj, err} + } + + // Every object comes through this code path once, so this is a good + // place to call the transform func. + // + // If obj is a DeletedFinalStateUnknown tombstone or the action is a Sync, + // then the object have already gone through the transformer. + // + // If the objects already present in the cache are passed to Replace(), + // the transformer must be idempotent to avoid re-mutating them, + // or coordinate with all readers from the cache to avoid data races. + // Default informers do not pass existing objects to Replace. + if f.transformer != nil { + _, isTombstone := obj.(DeletedFinalStateUnknown) + if !isTombstone && !skipTransform { + var err error + obj, err = f.transformer(obj) + if err != nil { + return err + } + } + } + + f.items = append(f.items, Delta{ + Type: deltaActionType, + Object: obj, + }) + f.cond.Broadcast() + + return nil +} + +// 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 *RealFIFO) Add(obj interface{}) error { + f.lock.Lock() + defer f.lock.Unlock() + + f.populated = true + retErr := f.addToItems_locked(Added, false, obj) + + return retErr +} + +// Update is the same as Add in this implementation. +func (f *RealFIFO) Update(obj interface{}) error { + f.lock.Lock() + defer f.lock.Unlock() + + f.populated = true + retErr := f.addToItems_locked(Updated, false, obj) + + return retErr +} + +// Delete removes an item. It doesn't add it to the queue, because +// this implementation assumes the consumer only cares about the objects, +// not the order in which they were created/added. +func (f *RealFIFO) Delete(obj interface{}) error { + f.lock.Lock() + defer f.lock.Unlock() + + f.populated = true + retErr := f.addToItems_locked(Deleted, false, obj) + + return retErr +} + +// IsClosed checks if the queue is closed +func (f *RealFIFO) IsClosed() bool { + f.lock.Lock() + defer f.lock.Unlock() + return f.closed +} + +// Pop waits until an item is ready and processes it. If multiple items are +// ready, they are returned in the order in which they were added/updated. +// The item is removed from the queue (and the store) before it is processed. +// process function is called under lock, so it is safe +// update data structures in it that need to be in sync with the queue. +func (f *RealFIFO) Pop(process PopProcessFunc) (interface{}, error) { + f.lock.Lock() + defer f.lock.Unlock() + + for len(f.items) == 0 { + // When the queue is empty, invocation of Pop() is blocked until new item is enqueued. + // When Close() is called, the f.closed is set and the condition is broadcasted. + // Which causes this loop to continue and return from the Pop(). + if f.closed { + return nil, ErrFIFOClosed + } + + f.cond.Wait() + } + + isInInitialList := !f.hasSynced_locked() + item := f.items[0] + // The underlying array still exists and references this object, so the object will not be garbage collected unless we zero the reference. + f.items[0] = Delta{} + f.items = f.items[1:] + if f.initialPopulationCount > 0 { + f.initialPopulationCount-- + } + + // Only log traces if the queue depth is greater than 10 and it takes more than + // 100 milliseconds to process one item from the queue. + // Queue depth never goes high because processing an item is locking the queue, + // and new items can't be added until processing finish. + // https://github.com/kubernetes/kubernetes/issues/103789 + if len(f.items) > 10 { + id, _ := f.keyOf(item) + trace := utiltrace.New("RealFIFO Pop Process", + utiltrace.Field{Key: "ID", Value: id}, + utiltrace.Field{Key: "Depth", Value: len(f.items)}, + utiltrace.Field{Key: "Reason", Value: "slow event handlers blocking the queue"}) + defer trace.LogIfLong(100 * time.Millisecond) + } + + // we wrap in Deltas here to be compatible with preview Pop functions and those interpreting the return value. + err := process(Deltas{item}, isInInitialList) + return Deltas{item}, err +} + +// Replace +// 1. finds those items in f.items that are not in newItems and creates synthetic deletes for them +// 2. finds items in knownObjects that are not in newItems and creates synthetic deletes for them +// 3. adds the newItems to the queue +func (f *RealFIFO) Replace(newItems []interface{}, resourceVersion string) error { + f.lock.Lock() + defer f.lock.Unlock() + + // determine the keys of everything we're adding. We cannot add the items until after the synthetic deletes have been + // created for items that don't existing in newItems + newKeys := sets.Set[string]{} + for _, obj := range newItems { + key, err := f.keyOf(obj) + if err != nil { + return KeyError{obj, err} + } + newKeys.Insert(key) + } + + queuedItems := f.items + queuedKeys := []string{} + lastQueuedItemForKey := map[string]Delta{} + for _, queuedItem := range queuedItems { + queuedKey, err := f.keyOf(queuedItem.Object) + if err != nil { + return KeyError{queuedItem.Object, err} + } + + if _, seen := lastQueuedItemForKey[queuedKey]; !seen { + queuedKeys = append(queuedKeys, queuedKey) + } + lastQueuedItemForKey[queuedKey] = queuedItem + } + + // all the deletes already in the queue are important. There are two cases + // 1. queuedItems has delete for key/X and newItems has replace for key/X. This means the queued UID was deleted and a new one was created. + // 2. queuedItems has a delete for key/X and newItems does NOT have key/X. This means the queued item was deleted. + // Do deletion detection against objects in the queue. + for _, queuedKey := range queuedKeys { + if newKeys.Has(queuedKey) { + continue + } + + // Delete pre-existing items not in the new list. + // This could happen if watch deletion event was missed while + // disconnected from apiserver. + lastQueuedItem := lastQueuedItemForKey[queuedKey] + // if we've already got the item marked as deleted, no need to add another delete + if lastQueuedItem.Type == Deleted { + continue + } + + // if we got here, then the last entry we have for the queued item is *not* a deletion and we need to add a delete + deletedObj := lastQueuedItem.Object + + retErr := f.addToItems_locked(Deleted, true, DeletedFinalStateUnknown{ + Key: queuedKey, + Obj: deletedObj, + }) + if retErr != nil { + return fmt.Errorf("couldn't enqueue object: %w", retErr) + } + } + + // Detect deletions for objects not present in the queue, but present in KnownObjects + knownKeys := f.knownObjects.ListKeys() + for _, knownKey := range knownKeys { + if newKeys.Has(knownKey) { // still present + continue + } + if _, inQueuedItems := lastQueuedItemForKey[knownKey]; inQueuedItems { // already added delete for these + continue + } + + deletedObj, exists, err := f.knownObjects.GetByKey(knownKey) + if err != nil { + deletedObj = nil + utilruntime.HandleError(fmt.Errorf("error during lookup, placing DeleteFinalStateUnknown marker without object: key=%q, err=%w", knownKey, err)) + } else if !exists { + deletedObj = nil + utilruntime.HandleError(fmt.Errorf("key does not exist in known objects store, placing DeleteFinalStateUnknown marker without object: key=%q", knownKey)) + } + retErr := f.addToItems_locked(Deleted, false, DeletedFinalStateUnknown{ + Key: knownKey, + Obj: deletedObj, + }) + if retErr != nil { + return fmt.Errorf("couldn't enqueue object: %w", retErr) + } + } + + // now that we have the deletes we need for items, we can add the newItems to the items queue + for _, obj := range newItems { + retErr := f.addToItems_locked(Replaced, false, obj) + if retErr != nil { + return fmt.Errorf("couldn't enqueue object: %w", retErr) + } + } + + if !f.populated { + f.populated = true + f.initialPopulationCount = len(f.items) + } + + return nil +} + +// Resync will ensure that every object in the Store has its key in the queue. +// This should be a no-op, because that property is maintained by all operations. +func (f *RealFIFO) Resync() error { + // TODO this cannot logically be done by the FIFO, it can only be done by the indexer + f.lock.Lock() + defer f.lock.Unlock() + + if f.knownObjects == nil { + return nil + } + + keysInQueue := sets.Set[string]{} + for _, item := range f.items { + key, err := f.keyOf(item.Object) + if err != nil { + return KeyError{item, err} + } + keysInQueue.Insert(key) + } + + knownKeys := f.knownObjects.ListKeys() + for _, knownKey := range knownKeys { + // If we are doing Resync() and there is already an event queued for that object, + // we ignore the Resync for it. This is to avoid the race, in which the resync + // comes with the previous value of object (since queueing an event for the object + // doesn't trigger changing the underlying store . + if keysInQueue.Has(knownKey) { + continue + } + + knownObj, exists, err := f.knownObjects.GetByKey(knownKey) + if err != nil { + utilruntime.HandleError(fmt.Errorf("unable to queue object for sync: key=%q, err=%w", knownKey, err)) + continue + } else if !exists { + utilruntime.HandleError(fmt.Errorf("key does not exist in known objects store, unable to queue object for sync: key=%q", knownKey)) + continue + } + + retErr := f.addToItems_locked(Sync, true, knownObj) + if retErr != nil { + return fmt.Errorf("couldn't queue object: %w", err) + } + } + + return nil +} + +// NewRealFIFO returns a Store which can be used to queue up items to +// process. +func NewRealFIFO(keyFunc KeyFunc, knownObjects KeyListerGetter, transformer TransformFunc) *RealFIFO { + if knownObjects == nil { + panic("coding error: knownObjects must be provided") + } + + f := &RealFIFO{ + items: make([]Delta, 0, 10), + keyFunc: keyFunc, + knownObjects: knownObjects, + transformer: transformer, + } + f.cond.L = &f.lock + return f +} diff --git a/e2e/vendor/k8s.io/client-go/tools/clientcmd/api/doc.go b/e2e/vendor/k8s.io/client-go/tools/clientcmd/api/doc.go index fd913a308..5871575a6 100644 --- a/e2e/vendor/k8s.io/client-go/tools/clientcmd/api/doc.go +++ b/e2e/vendor/k8s.io/client-go/tools/clientcmd/api/doc.go @@ -16,4 +16,4 @@ limitations under the License. // +k8s:deepcopy-gen=package -package api // import "k8s.io/client-go/tools/clientcmd/api" +package api diff --git a/e2e/vendor/k8s.io/client-go/tools/clientcmd/api/v1/doc.go b/e2e/vendor/k8s.io/client-go/tools/clientcmd/api/v1/doc.go index 9e483e9d7..3ccdebc1c 100644 --- a/e2e/vendor/k8s.io/client-go/tools/clientcmd/api/v1/doc.go +++ b/e2e/vendor/k8s.io/client-go/tools/clientcmd/api/v1/doc.go @@ -18,4 +18,4 @@ limitations under the License. // +k8s:deepcopy-gen=package // +k8s:defaulter-gen=Kind -package v1 // import "k8s.io/client-go/tools/clientcmd/api/v1" +package v1 diff --git a/e2e/vendor/k8s.io/client-go/tools/clientcmd/doc.go b/e2e/vendor/k8s.io/client-go/tools/clientcmd/doc.go index 424311ee1..c07ace6a5 100644 --- a/e2e/vendor/k8s.io/client-go/tools/clientcmd/doc.go +++ b/e2e/vendor/k8s.io/client-go/tools/clientcmd/doc.go @@ -34,4 +34,4 @@ Sample usage from merged .kubeconfig files (local directory, home directory) client, err := metav1.New(config) // ... */ -package clientcmd // import "k8s.io/client-go/tools/clientcmd" +package clientcmd diff --git a/e2e/vendor/k8s.io/client-go/tools/events/doc.go b/e2e/vendor/k8s.io/client-go/tools/events/doc.go index 8c48f607e..08c0ba70b 100644 --- a/e2e/vendor/k8s.io/client-go/tools/events/doc.go +++ b/e2e/vendor/k8s.io/client-go/tools/events/doc.go @@ -16,4 +16,4 @@ limitations under the License. // Package events has all client logic for recording and reporting // "k8s.io/api/events/v1".Event events. -package events // import "k8s.io/client-go/tools/events" +package events diff --git a/e2e/vendor/k8s.io/client-go/tools/events/event_recorder.go b/e2e/vendor/k8s.io/client-go/tools/events/event_recorder.go index 654317884..ba2ec7be4 100644 --- a/e2e/vendor/k8s.io/client-go/tools/events/event_recorder.go +++ b/e2e/vendor/k8s.io/client-go/tools/events/event_recorder.go @@ -96,7 +96,7 @@ func (recorder *recorderImpl) makeEvent(refRegarding *v1.ObjectReference, refRel } return &eventsv1.Event{ ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("%v.%x", refRegarding.Name, t.UnixNano()), + Name: util.GenerateEventName(refRegarding.Name, t.UnixNano()), Namespace: namespace, }, EventTime: timestamp, diff --git a/e2e/vendor/k8s.io/client-go/tools/portforward/doc.go b/e2e/vendor/k8s.io/client-go/tools/portforward/doc.go index 2f5340634..e0f6cfbf2 100644 --- a/e2e/vendor/k8s.io/client-go/tools/portforward/doc.go +++ b/e2e/vendor/k8s.io/client-go/tools/portforward/doc.go @@ -16,4 +16,4 @@ limitations under the License. // Package portforward adds support for SSH-like port forwarding from the client's // local host to remote containers. -package portforward // import "k8s.io/client-go/tools/portforward" +package portforward diff --git a/e2e/vendor/k8s.io/client-go/tools/record/doc.go b/e2e/vendor/k8s.io/client-go/tools/record/doc.go index 33d5fe78e..23a35758c 100644 --- a/e2e/vendor/k8s.io/client-go/tools/record/doc.go +++ b/e2e/vendor/k8s.io/client-go/tools/record/doc.go @@ -16,4 +16,4 @@ limitations under the License. // Package record has all client logic for recording and reporting // "k8s.io/api/core/v1".Event events. -package record // import "k8s.io/client-go/tools/record" +package record diff --git a/e2e/vendor/k8s.io/client-go/tools/record/event.go b/e2e/vendor/k8s.io/client-go/tools/record/event.go index 55947d209..f97c5d612 100644 --- a/e2e/vendor/k8s.io/client-go/tools/record/event.go +++ b/e2e/vendor/k8s.io/client-go/tools/record/event.go @@ -489,7 +489,7 @@ func (recorder *recorderImpl) makeEvent(ref *v1.ObjectReference, annotations map } return &v1.Event{ ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("%v.%x", ref.Name, t.UnixNano()), + Name: util.GenerateEventName(ref.Name, t.UnixNano()), Namespace: namespace, Annotations: annotations, }, diff --git a/e2e/vendor/k8s.io/client-go/tools/record/util/util.go b/e2e/vendor/k8s.io/client-go/tools/record/util/util.go index afcc6a6a0..7a82db0cd 100644 --- a/e2e/vendor/k8s.io/client-go/tools/record/util/util.go +++ b/e2e/vendor/k8s.io/client-go/tools/record/util/util.go @@ -17,10 +17,14 @@ limitations under the License. package util import ( + "fmt" "net/http" + "github.com/google/uuid" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" + apimachineryvalidation "k8s.io/apimachinery/pkg/api/validation" ) // ValidateEventType checks that eventtype is an expected type of event @@ -38,3 +42,16 @@ func IsKeyNotFoundError(err error) bool { return statusErr != nil && statusErr.Status().Code == http.StatusNotFound } + +// GenerateEventName generates a valid Event name from the referenced name and the passed UNIX timestamp. +// The referenced Object name may not be a valid name for Events and cause the Event to fail +// to be created, so we need to generate a new one in that case. +// Ref: https://issues.k8s.io/127594 +func GenerateEventName(refName string, unixNano int64) string { + name := fmt.Sprintf("%s.%x", refName, unixNano) + if errs := apimachineryvalidation.NameIsDNSSubdomain(name, false); len(errs) > 0 { + // Using an uuid guarantees uniqueness and correctness + name = uuid.New().String() + } + return name +} diff --git a/e2e/vendor/k8s.io/client-go/tools/remotecommand/doc.go b/e2e/vendor/k8s.io/client-go/tools/remotecommand/doc.go index ac06a9cd3..b9f0db2d9 100644 --- a/e2e/vendor/k8s.io/client-go/tools/remotecommand/doc.go +++ b/e2e/vendor/k8s.io/client-go/tools/remotecommand/doc.go @@ -17,4 +17,4 @@ limitations under the License. // Package remotecommand adds support for executing commands in containers, // with support for separate stdin, stdout, and stderr streams, as well as // TTY. -package remotecommand // import "k8s.io/client-go/tools/remotecommand" +package remotecommand diff --git a/e2e/vendor/k8s.io/client-go/tools/remotecommand/errorstream.go b/e2e/vendor/k8s.io/client-go/tools/remotecommand/errorstream.go index e60dd7cdc..90bb39b4a 100644 --- a/e2e/vendor/k8s.io/client-go/tools/remotecommand/errorstream.go +++ b/e2e/vendor/k8s.io/client-go/tools/remotecommand/errorstream.go @@ -41,7 +41,7 @@ func watchErrorStream(errorStream io.Reader, d errorStreamDecoder) chan error { message, err := io.ReadAll(errorStream) switch { case err != nil && err != io.EOF: - errorChan <- fmt.Errorf("error reading from error stream: %s", err) + errorChan <- fmt.Errorf("error reading from error stream: %w", err) case len(message) > 0: errorChan <- d.decode(message) default: diff --git a/e2e/vendor/k8s.io/client-go/tools/remotecommand/websocket.go b/e2e/vendor/k8s.io/client-go/tools/remotecommand/websocket.go index 1dc679cb1..cea26a0b5 100644 --- a/e2e/vendor/k8s.io/client-go/tools/remotecommand/websocket.go +++ b/e2e/vendor/k8s.io/client-go/tools/remotecommand/websocket.go @@ -248,6 +248,7 @@ func (c *wsStreamCreator) readDemuxLoop(bufferSize int, period time.Duration, de // Initialize and start the ping/pong heartbeat. h := newHeartbeat(c.conn, period, deadline) // Set initial timeout for websocket connection reading. + klog.V(5).Infof("Websocket initial read deadline: %s", deadline) if err := c.conn.SetReadDeadline(time.Now().Add(deadline)); err != nil { klog.Errorf("Websocket initial setting read deadline failed %v", err) return @@ -311,7 +312,7 @@ func (c *wsStreamCreator) readDemuxLoop(bufferSize int, period time.Duration, de if errRead == io.EOF { break } - c.closeAllStreamReaders(fmt.Errorf("read message: %w", err)) + c.closeAllStreamReaders(fmt.Errorf("read message: %w", errRead)) return } } @@ -354,8 +355,8 @@ func (s *stream) Read(p []byte) (n int, err error) { // Write writes directly to the underlying WebSocket connection. func (s *stream) Write(p []byte) (n int, err error) { - klog.V(4).Infof("Write() on stream %d", s.id) - defer klog.V(4).Infof("Write() done on stream %d", s.id) + klog.V(8).Infof("Write() on stream %d", s.id) + defer klog.V(8).Infof("Write() done on stream %d", s.id) s.connWriteLock.Lock() defer s.connWriteLock.Unlock() if s.conn == nil { @@ -363,7 +364,7 @@ func (s *stream) Write(p []byte) (n int, err error) { } err = s.conn.SetWriteDeadline(time.Now().Add(writeDeadline)) if err != nil { - klog.V(7).Infof("Websocket setting write deadline failed %v", err) + klog.V(4).Infof("Websocket setting write deadline failed %v", err) return 0, err } // Message writer buffers the message data, so we don't need to do that ourselves. @@ -392,8 +393,8 @@ func (s *stream) Write(p []byte) (n int, err error) { // Close half-closes the stream, indicating this side is finished with the stream. func (s *stream) Close() error { - klog.V(4).Infof("Close() on stream %d", s.id) - defer klog.V(4).Infof("Close() done on stream %d", s.id) + klog.V(6).Infof("Close() on stream %d", s.id) + defer klog.V(6).Infof("Close() done on stream %d", s.id) s.connWriteLock.Lock() defer s.connWriteLock.Unlock() if s.conn == nil { @@ -452,7 +453,7 @@ func newHeartbeat(conn *gwebsocket.Conn, period time.Duration, deadline time.Dur // be empty. h.conn.SetPongHandler(func(msg string) error { // Push the read deadline into the future. - klog.V(8).Infof("Pong message received (%s)--resetting read deadline", msg) + klog.V(6).Infof("Pong message received (%s)--resetting read deadline", msg) err := h.conn.SetReadDeadline(time.Now().Add(deadline)) if err != nil { klog.Errorf("Websocket setting read deadline failed %v", err) @@ -487,14 +488,14 @@ func (h *heartbeat) start() { for { select { case <-h.closer: - klog.V(8).Infof("closed channel--returning") + klog.V(5).Infof("closed channel--returning") return case <-t.C: // "WriteControl" does not need to be protected by a mutex. According to // gorilla/websockets library docs: "The Close and WriteControl methods can // be called concurrently with all other methods." if err := h.conn.WriteControl(gwebsocket.PingMessage, h.message, time.Now().Add(pingReadDeadline)); err == nil { - klog.V(8).Infof("Websocket Ping succeeeded") + klog.V(6).Infof("Websocket Ping succeeeded") } else { klog.Errorf("Websocket Ping failed: %v", err) if errors.Is(err, gwebsocket.ErrCloseSent) { diff --git a/e2e/vendor/k8s.io/client-go/tools/watch/informerwatcher.go b/e2e/vendor/k8s.io/client-go/tools/watch/informerwatcher.go index 5e6aad5cf..114abfcc9 100644 --- a/e2e/vendor/k8s.io/client-go/tools/watch/informerwatcher.go +++ b/e2e/vendor/k8s.io/client-go/tools/watch/informerwatcher.go @@ -20,8 +20,10 @@ import ( "sync" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/tools/cache" + "k8s.io/klog/v2" ) func newEventProcessor(out chan<- watch.Event) *eventProcessor { @@ -103,7 +105,16 @@ func (e *eventProcessor) stop() { // NewIndexerInformerWatcher will create an IndexerInformer and wrap it into watch.Interface // so you can use it anywhere where you'd have used a regular Watcher returned from Watch method. // it also returns a channel you can use to wait for the informers to fully shutdown. +// +// Contextual logging: NewIndexerInformerWatcherWithLogger should be used instead of NewIndexerInformerWatcher in code which supports contextual logging. func NewIndexerInformerWatcher(lw cache.ListerWatcher, objType runtime.Object) (cache.Indexer, cache.Controller, watch.Interface, <-chan struct{}) { + return NewIndexerInformerWatcherWithLogger(klog.Background(), lw, objType) +} + +// NewIndexerInformerWatcherWithLogger will create an IndexerInformer and wrap it into watch.Interface +// so you can use it anywhere where you'd have used a regular Watcher returned from Watch method. +// it also returns a channel you can use to wait for the informers to fully shutdown. +func NewIndexerInformerWatcherWithLogger(logger klog.Logger, lw cache.ListerWatcher, objType runtime.Object) (cache.Indexer, cache.Controller, watch.Interface, <-chan struct{}) { ch := make(chan watch.Event) w := watch.NewProxyWatcher(ch) e := newEventProcessor(ch) @@ -137,13 +148,18 @@ func NewIndexerInformerWatcher(lw cache.ListerWatcher, objType runtime.Object) ( }, }, cache.Indexers{}) + // This will get stopped, but without waiting for it. go e.run() doneCh := make(chan struct{}) go func() { defer close(doneCh) defer e.stop() - informer.Run(w.StopChan()) + // Waiting for w.StopChan() is the traditional behavior which gets + // preserved here, with the logger added to support contextual logging. + ctx := wait.ContextForChannel(w.StopChan()) + ctx = klog.NewContext(ctx, logger) + informer.RunWithContext(ctx) }() return indexer, informer, w, doneCh diff --git a/e2e/vendor/k8s.io/client-go/tools/watch/retrywatcher.go b/e2e/vendor/k8s.io/client-go/tools/watch/retrywatcher.go index d36d7455d..45249d8e4 100644 --- a/e2e/vendor/k8s.io/client-go/tools/watch/retrywatcher.go +++ b/e2e/vendor/k8s.io/client-go/tools/watch/retrywatcher.go @@ -22,7 +22,6 @@ import ( "fmt" "io" "net/http" - "sync" "time" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -48,23 +47,31 @@ type resourceVersionGetter interface { // Please note that this is not resilient to etcd cache not having the resource version anymore - you would need to // use Informers for that. type RetryWatcher struct { + cancel func(error) lastResourceVersion string - watcherClient cache.Watcher + watcherClient cache.WatcherWithContext resultChan chan watch.Event - stopChan chan struct{} doneChan chan struct{} minRestartDelay time.Duration - stopChanLock sync.Mutex } // NewRetryWatcher creates a new RetryWatcher. // It will make sure that watches gets restarted in case of recoverable errors. // The initialResourceVersion will be given to watch method when first called. +// +// Deprecated: use NewRetryWatcherWithContext instead. func NewRetryWatcher(initialResourceVersion string, watcherClient cache.Watcher) (*RetryWatcher, error) { - return newRetryWatcher(initialResourceVersion, watcherClient, 1*time.Second) + return NewRetryWatcherWithContext(context.Background(), initialResourceVersion, cache.ToWatcherWithContext(watcherClient)) } -func newRetryWatcher(initialResourceVersion string, watcherClient cache.Watcher, minRestartDelay time.Duration) (*RetryWatcher, error) { +// NewRetryWatcherWithContext creates a new RetryWatcher. +// It will make sure that watches gets restarted in case of recoverable errors. +// The initialResourceVersion will be given to watch method when first called. +func NewRetryWatcherWithContext(ctx context.Context, initialResourceVersion string, watcherClient cache.WatcherWithContext) (*RetryWatcher, error) { + return newRetryWatcher(ctx, initialResourceVersion, watcherClient, 1*time.Second) +} + +func newRetryWatcher(ctx context.Context, initialResourceVersion string, watcherClient cache.WatcherWithContext, minRestartDelay time.Duration) (*RetryWatcher, error) { switch initialResourceVersion { case "", "0": // TODO: revisit this if we ever get WATCH v2 where it means start "now" @@ -74,34 +81,36 @@ func newRetryWatcher(initialResourceVersion string, watcherClient cache.Watcher, break } + ctx, cancel := context.WithCancelCause(ctx) + rw := &RetryWatcher{ + cancel: cancel, lastResourceVersion: initialResourceVersion, watcherClient: watcherClient, - stopChan: make(chan struct{}), doneChan: make(chan struct{}), resultChan: make(chan watch.Event, 0), minRestartDelay: minRestartDelay, } - go rw.receive() + go rw.receive(ctx) return rw, nil } -func (rw *RetryWatcher) send(event watch.Event) bool { +func (rw *RetryWatcher) send(ctx context.Context, event watch.Event) bool { // Writing to an unbuffered channel is blocking operation // and we need to check if stop wasn't requested while doing so. select { case rw.resultChan <- event: return true - case <-rw.stopChan: + case <-ctx.Done(): return false } } // doReceive returns true when it is done, false otherwise. // If it is not done the second return value holds the time to wait before calling it again. -func (rw *RetryWatcher) doReceive() (bool, time.Duration) { - watcher, err := rw.watcherClient.Watch(metav1.ListOptions{ +func (rw *RetryWatcher) doReceive(ctx context.Context) (bool, time.Duration) { + watcher, err := rw.watcherClient.WatchWithContext(ctx, metav1.ListOptions{ ResourceVersion: rw.lastResourceVersion, AllowWatchBookmarks: true, }) @@ -117,13 +126,13 @@ func (rw *RetryWatcher) doReceive() (bool, time.Duration) { return false, 0 case io.ErrUnexpectedEOF: - klog.V(1).InfoS("Watch closed with unexpected EOF", "err", err) + klog.FromContext(ctx).V(1).Info("Watch closed with unexpected EOF", "err", err) return false, 0 default: msg := "Watch failed" if net.IsProbableEOF(err) || net.IsTimeout(err) { - klog.V(5).InfoS(msg, "err", err) + klog.FromContext(ctx).V(5).Info(msg, "err", err) // Retry return false, 0 } @@ -132,38 +141,38 @@ func (rw *RetryWatcher) doReceive() (bool, time.Duration) { // being invalid (e.g. expired token). if apierrors.IsForbidden(err) || apierrors.IsUnauthorized(err) { // Add more detail since the forbidden message returned by the Kubernetes API is just "unknown". - klog.ErrorS(err, msg+": ensure the client has valid credentials and watch permissions on the resource") + klog.FromContext(ctx).Error(err, msg+": ensure the client has valid credentials and watch permissions on the resource") if apiStatus, ok := err.(apierrors.APIStatus); ok { statusErr := apiStatus.Status() - sent := rw.send(watch.Event{ + sent := rw.send(ctx, watch.Event{ Type: watch.Error, Object: &statusErr, }) if !sent { // This likely means the RetryWatcher is stopping but return false so the caller to doReceive can // verify this and potentially retry. - klog.Error("Failed to send the Unauthorized or Forbidden watch event") + klog.FromContext(ctx).Error(nil, "Failed to send the Unauthorized or Forbidden watch event") return false, 0 } } else { // This should never happen since apierrors only handles apierrors.APIStatus. Still, this is an // unrecoverable error, so still allow it to return true below. - klog.ErrorS(err, msg+": encountered an unexpected Unauthorized or Forbidden error type") + klog.FromContext(ctx).Error(err, msg+": encountered an unexpected Unauthorized or Forbidden error type") } return true, 0 } - klog.ErrorS(err, msg) + klog.FromContext(ctx).Error(err, msg) // Retry return false, 0 } if watcher == nil { - klog.ErrorS(nil, "Watch returned nil watcher") + klog.FromContext(ctx).Error(nil, "Watch returned nil watcher") // Retry return false, 0 } @@ -173,12 +182,12 @@ func (rw *RetryWatcher) doReceive() (bool, time.Duration) { for { select { - case <-rw.stopChan: - klog.V(4).InfoS("Stopping RetryWatcher.") + case <-ctx.Done(): + klog.FromContext(ctx).V(4).Info("Stopping RetryWatcher") return true, 0 case event, ok := <-ch: if !ok { - klog.V(4).InfoS("Failed to get event! Re-creating the watcher.", "resourceVersion", rw.lastResourceVersion) + klog.FromContext(ctx).V(4).Info("Failed to get event - re-creating the watcher", "resourceVersion", rw.lastResourceVersion) return false, 0 } @@ -187,7 +196,7 @@ func (rw *RetryWatcher) doReceive() (bool, time.Duration) { case watch.Added, watch.Modified, watch.Deleted, watch.Bookmark: metaObject, ok := event.Object.(resourceVersionGetter) if !ok { - _ = rw.send(watch.Event{ + _ = rw.send(ctx, watch.Event{ Type: watch.Error, Object: &apierrors.NewInternalError(errors.New("retryWatcher: doesn't support resourceVersion")).ErrStatus, }) @@ -197,7 +206,7 @@ func (rw *RetryWatcher) doReceive() (bool, time.Duration) { resourceVersion := metaObject.GetResourceVersion() if resourceVersion == "" { - _ = rw.send(watch.Event{ + _ = rw.send(ctx, watch.Event{ Type: watch.Error, Object: &apierrors.NewInternalError(fmt.Errorf("retryWatcher: object %#v doesn't support resourceVersion", event.Object)).ErrStatus, }) @@ -207,7 +216,7 @@ func (rw *RetryWatcher) doReceive() (bool, time.Duration) { // All is fine; send the non-bookmark events and update resource version. if event.Type != watch.Bookmark { - ok = rw.send(event) + ok = rw.send(ctx, event) if !ok { return true, 0 } @@ -221,7 +230,7 @@ func (rw *RetryWatcher) doReceive() (bool, time.Duration) { errObject := apierrors.FromObject(event.Object) statusErr, ok := errObject.(*apierrors.StatusError) if !ok { - klog.Error(fmt.Sprintf("Received an error which is not *metav1.Status but %s", dump.Pretty(event.Object))) + klog.FromContext(ctx).Error(nil, "Received an error which is not *metav1.Status", "errorObject", dump.Pretty(event.Object)) // Retry unknown errors return false, 0 } @@ -236,7 +245,7 @@ func (rw *RetryWatcher) doReceive() (bool, time.Duration) { switch status.Code { case http.StatusGone: // Never retry RV too old errors - _ = rw.send(event) + _ = rw.send(ctx, event) return true, 0 case http.StatusGatewayTimeout, http.StatusInternalServerError: @@ -250,15 +259,15 @@ func (rw *RetryWatcher) doReceive() (bool, time.Duration) { // Log here so we have a record of hitting the unexpected error // and we can whitelist some error codes if we missed any that are expected. - klog.V(5).Info(fmt.Sprintf("Retrying after unexpected error: %s", dump.Pretty(event.Object))) + klog.FromContext(ctx).V(5).Info("Retrying after unexpected error", "errorObject", dump.Pretty(event.Object)) // Retry return false, statusDelay } default: - klog.Errorf("Failed to recognize Event type %q", event.Type) - _ = rw.send(watch.Event{ + klog.FromContext(ctx).Error(nil, "Failed to recognize event", "type", event.Type) + _ = rw.send(ctx, watch.Event{ Type: watch.Error, Object: &apierrors.NewInternalError(fmt.Errorf("retryWatcher failed to recognize Event type %q", event.Type)).ErrStatus, }) @@ -270,29 +279,21 @@ func (rw *RetryWatcher) doReceive() (bool, time.Duration) { } // receive reads the result from a watcher, restarting it if necessary. -func (rw *RetryWatcher) receive() { +func (rw *RetryWatcher) receive(ctx context.Context) { defer close(rw.doneChan) defer close(rw.resultChan) - klog.V(4).Info("Starting RetryWatcher.") - defer klog.V(4).Info("Stopping RetryWatcher.") + logger := klog.FromContext(ctx) + logger.V(4).Info("Starting RetryWatcher") + defer logger.V(4).Info("Stopping RetryWatcher") - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(ctx) defer cancel() - go func() { - select { - case <-rw.stopChan: - cancel() - return - case <-ctx.Done(): - return - } - }() // We use non sliding until so we don't introduce delays on happy path when WATCH call // timeouts or gets closed and we need to reestablish it while also avoiding hot loops. wait.NonSlidingUntilWithContext(ctx, func(ctx context.Context) { - done, retryAfter := rw.doReceive() + done, retryAfter := rw.doReceive(ctx) if done { cancel() return @@ -306,7 +307,7 @@ func (rw *RetryWatcher) receive() { case <-timer.C: } - klog.V(4).Infof("Restarting RetryWatcher at RV=%q", rw.lastResourceVersion) + logger.V(4).Info("Restarting RetryWatcher", "resourceVersion", rw.lastResourceVersion) }, rw.minRestartDelay) } @@ -317,15 +318,7 @@ func (rw *RetryWatcher) ResultChan() <-chan watch.Event { // Stop implements Interface. func (rw *RetryWatcher) Stop() { - rw.stopChanLock.Lock() - defer rw.stopChanLock.Unlock() - - // Prevent closing an already closed channel to prevent a panic - select { - case <-rw.stopChan: - default: - close(rw.stopChan) - } + rw.cancel(errors.New("asked to stop")) } // Done allows the caller to be notified when Retry watcher stops. diff --git a/e2e/vendor/k8s.io/client-go/tools/watch/until.go b/e2e/vendor/k8s.io/client-go/tools/watch/until.go index a2474556b..03ceaf002 100644 --- a/e2e/vendor/k8s.io/client-go/tools/watch/until.go +++ b/e2e/vendor/k8s.io/client-go/tools/watch/until.go @@ -105,7 +105,7 @@ func UntilWithoutRetry(ctx context.Context, watcher watch.Interface, conditions // // The most frequent usage for Until would be a test where you want to verify exact order of events ("edges"). func Until(ctx context.Context, initialResourceVersion string, watcherClient cache.Watcher, conditions ...ConditionFunc) (*watch.Event, error) { - w, err := NewRetryWatcher(initialResourceVersion, watcherClient) + w, err := NewRetryWatcherWithContext(ctx, initialResourceVersion, cache.ToWatcherWithContext(watcherClient)) if err != nil { return nil, err } @@ -126,7 +126,7 @@ func Until(ctx context.Context, initialResourceVersion string, watcherClient cac // The most frequent usage would be a command that needs to watch the "state of the world" and should't fail, like: // waiting for object reaching a state, "small" controllers, ... func UntilWithSync(ctx context.Context, lw cache.ListerWatcher, objType runtime.Object, precondition PreconditionFunc, conditions ...ConditionFunc) (*watch.Event, error) { - indexer, informer, watcher, done := NewIndexerInformerWatcher(lw, objType) + indexer, informer, watcher, done := NewIndexerInformerWatcherWithLogger(klog.FromContext(ctx), lw, objType) // We need to wait for the internal informers to fully stop so it's easier to reason about // and it works with non-thread safe clients. defer func() { <-done }() @@ -156,7 +156,7 @@ func UntilWithSync(ctx context.Context, lw cache.ListerWatcher, objType runtime. func ContextWithOptionalTimeout(parent context.Context, timeout time.Duration) (context.Context, context.CancelFunc) { if timeout < 0 { // This should be handled in validation - klog.Errorf("Timeout for context shall not be negative!") + klog.FromContext(parent).Error(nil, "Timeout for context shall not be negative") timeout = 0 } diff --git a/e2e/vendor/k8s.io/client-go/transport/cache.go b/e2e/vendor/k8s.io/client-go/transport/cache.go index 7c7f1b330..b8dd86611 100644 --- a/e2e/vendor/k8s.io/client-go/transport/cache.go +++ b/e2e/vendor/k8s.io/client-go/transport/cache.go @@ -28,6 +28,7 @@ import ( utilnet "k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/tools/metrics" + "k8s.io/klog/v2" ) // TlsTransportCache caches TLS http.RoundTrippers different configurations. The @@ -116,10 +117,13 @@ func (c *tlsTransportCache) get(config *Config) (http.RoundTripper, error) { // If we use are reloading files, we need to handle certificate rotation properly // TODO(jackkleeman): We can also add rotation here when config.HasCertCallback() is true if config.TLS.ReloadTLSFiles && tlsConfig != nil && tlsConfig.GetClientCertificate != nil { - dynamicCertDialer := certRotatingDialer(tlsConfig.GetClientCertificate, dial) + // The TLS cache is a singleton, so sharing the same name for all of its + // background activity seems okay. + logger := klog.Background().WithName("tls-transport-cache") + dynamicCertDialer := certRotatingDialer(logger, tlsConfig.GetClientCertificate, dial) tlsConfig.GetClientCertificate = dynamicCertDialer.GetClientCertificate dial = dynamicCertDialer.connDialer.DialContext - go dynamicCertDialer.Run(DialerStopCh) + go dynamicCertDialer.run(DialerStopCh) } proxy := http.ProxyFromEnvironment diff --git a/e2e/vendor/k8s.io/client-go/transport/cert_rotation.go b/e2e/vendor/k8s.io/client-go/transport/cert_rotation.go index e76f65812..e343f42be 100644 --- a/e2e/vendor/k8s.io/client-go/transport/cert_rotation.go +++ b/e2e/vendor/k8s.io/client-go/transport/cert_rotation.go @@ -19,7 +19,6 @@ package transport import ( "bytes" "crypto/tls" - "fmt" "reflect" "sync" "time" @@ -40,6 +39,7 @@ var CertCallbackRefreshDuration = 5 * time.Minute type reloadFunc func(*tls.CertificateRequestInfo) (*tls.Certificate, error) type dynamicClientCert struct { + logger klog.Logger clientCert *tls.Certificate certMtx sync.RWMutex @@ -50,8 +50,9 @@ type dynamicClientCert struct { queue workqueue.TypedRateLimitingInterface[string] } -func certRotatingDialer(reload reloadFunc, dial utilnet.DialFunc) *dynamicClientCert { +func certRotatingDialer(logger klog.Logger, reload reloadFunc, dial utilnet.DialFunc) *dynamicClientCert { d := &dynamicClientCert{ + logger: logger, reload: reload, connDialer: connrotation.NewDialer(connrotation.DialFunc(dial)), queue: workqueue.NewTypedRateLimitingQueueWithConfig( @@ -88,7 +89,7 @@ func (c *dynamicClientCert) loadClientCert() (*tls.Certificate, error) { return cert, nil } - klog.V(1).Infof("certificate rotation detected, shutting down client connections to start using new credentials") + c.logger.V(1).Info("Certificate rotation detected, shutting down client connections to start using new credentials") c.connDialer.CloseAll() return cert, nil @@ -133,12 +134,12 @@ func byteMatrixEqual(left, right [][]byte) bool { } // run starts the controller and blocks until stopCh is closed. -func (c *dynamicClientCert) Run(stopCh <-chan struct{}) { - defer utilruntime.HandleCrash() +func (c *dynamicClientCert) run(stopCh <-chan struct{}) { + defer utilruntime.HandleCrashWithLogger(c.logger) defer c.queue.ShutDown() - klog.V(3).Infof("Starting client certificate rotation controller") - defer klog.V(3).Infof("Shutting down client certificate rotation controller") + c.logger.V(3).Info("Starting client certificate rotation controller") + defer c.logger.V(3).Info("Shutting down client certificate rotation controller") go wait.Until(c.runWorker, time.Second, stopCh) @@ -168,7 +169,7 @@ func (c *dynamicClientCert) processNextWorkItem() bool { return true } - utilruntime.HandleError(fmt.Errorf("%v failed with : %v", dsKey, err)) + utilruntime.HandleErrorWithLogger(c.logger, err, "Loading client cert failed", "key", dsKey) c.queue.AddRateLimited(dsKey) return true diff --git a/e2e/vendor/k8s.io/client-go/transport/round_trippers.go b/e2e/vendor/k8s.io/client-go/transport/round_trippers.go index 52fefb531..39fcebd94 100644 --- a/e2e/vendor/k8s.io/client-go/transport/round_trippers.go +++ b/e2e/vendor/k8s.io/client-go/transport/round_trippers.go @@ -21,10 +21,12 @@ import ( "fmt" "net/http" "net/http/httptrace" + "sort" "strings" "sync" "time" + "github.com/go-logr/logr" "golang.org/x/oauth2" utilnet "k8s.io/apimachinery/pkg/util/net" @@ -68,19 +70,16 @@ func HTTPWrappersForConfig(config *Config, rt http.RoundTripper) (http.RoundTrip return rt, nil } -// DebugWrappers wraps a round tripper and logs based on the current log level. +// DebugWrappers potentially wraps a round tripper with a wrapper that logs +// based on the log level in the context of each individual request. +// +// At the moment, wrapping depends on the global log verbosity and is done +// if that verbosity is >= 6. This may change in the future. func DebugWrappers(rt http.RoundTripper) http.RoundTripper { - switch { - case bool(klog.V(9).Enabled()): - rt = NewDebuggingRoundTripper(rt, DebugCurlCommand, DebugURLTiming, DebugDetailedTiming, DebugResponseHeaders) - case bool(klog.V(8).Enabled()): - rt = NewDebuggingRoundTripper(rt, DebugJustURL, DebugRequestHeaders, DebugResponseStatus, DebugResponseHeaders) - case bool(klog.V(7).Enabled()): - rt = NewDebuggingRoundTripper(rt, DebugJustURL, DebugRequestHeaders, DebugResponseStatus) - case bool(klog.V(6).Enabled()): - rt = NewDebuggingRoundTripper(rt, DebugURLTiming) + //nolint:logcheck // The actual logging is done with a different logger, so only checking here is okay. + if klog.V(6).Enabled() { + rt = NewDebuggingRoundTripper(rt, DebugByContext) } - return rt } @@ -380,14 +379,17 @@ func (r *requestInfo) toCurl() string { } } - return fmt.Sprintf("curl -v -X%s %s '%s'", r.RequestVerb, headers, r.RequestURL) + // Newline at the end makes this look better in the text log output (the + // only usage of this method) because it becomes a multi-line string with + // no quoting. + return fmt.Sprintf("curl -v -X%s %s '%s'\n", r.RequestVerb, headers, r.RequestURL) } // debuggingRoundTripper will display information about the requests passing // through it based on what is configured type debuggingRoundTripper struct { delegatedRoundTripper http.RoundTripper - levels map[DebugLevel]bool + levels int } var _ utilnet.RoundTripperWrapper = &debuggingRoundTripper{} @@ -412,6 +414,26 @@ const ( DebugResponseHeaders // DebugDetailedTiming will add to the debug output the duration of the HTTP requests events. DebugDetailedTiming + // DebugByContext will add any of the above depending on the verbosity of the per-request logger obtained from the requests context. + // + // Can be combined in NewDebuggingRoundTripper with some of the other options, in which case the + // debug roundtripper will always log what is requested there plus the information that gets + // enabled by the context's log verbosity. + DebugByContext +) + +// Different log levels include different sets of information. +// +// Not exported because the exact content of log messages is not part +// of of the package API. +const ( + levelsV6 = (1 << DebugURLTiming) + // Logging *less* information for the response at level 7 compared to 6 replicates prior behavior: + // https://github.com/kubernetes/kubernetes/blob/2b472fe4690c83a2b343995f88050b2a3e9ff0fa/staging/src/k8s.io/client-go/transport/round_trippers.go#L79 + // Presumably that was done because verb and URL are already in the request log entry. + levelsV7 = (1 << DebugJustURL) | (1 << DebugRequestHeaders) | (1 << DebugResponseStatus) + levelsV8 = (1 << DebugJustURL) | (1 << DebugRequestHeaders) | (1 << DebugResponseStatus) | (1 << DebugResponseHeaders) + levelsV9 = (1 << DebugCurlCommand) | (1 << DebugURLTiming) | (1 << DebugDetailedTiming) | (1 << DebugResponseHeaders) ) // NewDebuggingRoundTripper allows to display in the logs output debug information @@ -419,10 +441,9 @@ const ( func NewDebuggingRoundTripper(rt http.RoundTripper, levels ...DebugLevel) http.RoundTripper { drt := &debuggingRoundTripper{ delegatedRoundTripper: rt, - levels: make(map[DebugLevel]bool, len(levels)), } for _, v := range levels { - drt.levels[v] = true + drt.levels |= 1 << v } return drt } @@ -464,27 +485,51 @@ func maskValue(key string, value string) string { } func (rt *debuggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { + logger := klog.FromContext(req.Context()) + levels := rt.levels + + // When logging depends on the context, it uses the verbosity of the per-context logger + // and a hard-coded mapping of verbosity to debug details. Otherwise all messages + // are logged as V(0). + if levels&(1< 0 { + logger.Info("Request", kvs...) } startTime := time.Now() - if rt.levels[DebugDetailedTiming] { + if levels&(1< 0 { + logger.Info("Response", kvs...) } return response, err } +// headerMap formats headers sorted and across multiple lines with no quoting +// when using string output and as JSON when using zapr. +type headersMap http.Header + +// newHeadersMap masks all sensitive values. This has to be done before +// passing the map to a logger because while in practice all loggers +// either use String or MarshalLog, that is not guaranteed. +func newHeadersMap(header http.Header) headersMap { + h := make(headersMap, len(header)) + for key, values := range header { + maskedValues := make([]string, 0, len(values)) + for _, value := range values { + maskedValues = append(maskedValues, maskValue(key, value)) + } + h[key] = maskedValues + } + return h +} + +var _ fmt.Stringer = headersMap{} +var _ logr.Marshaler = headersMap{} + +func (h headersMap) String() string { + // The fixed size typically avoids memory allocations when it is large enough. + keys := make([]string, 0, 20) + for key := range h { + keys = append(keys, key) + } + sort.Strings(keys) + var buffer strings.Builder + for _, key := range keys { + for _, value := range h[key] { + _, _ = buffer.WriteString(key) + _, _ = buffer.WriteString(": ") + _, _ = buffer.WriteString(value) + _, _ = buffer.WriteString("\n") + } + } + return buffer.String() +} + +func (h headersMap) MarshalLog() any { + return map[string][]string(h) +} + func (rt *debuggingRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.delegatedRoundTripper } diff --git a/e2e/vendor/k8s.io/client-go/transport/token_source.go b/e2e/vendor/k8s.io/client-go/transport/token_source.go index 8e312800f..469dd8176 100644 --- a/e2e/vendor/k8s.io/client-go/transport/token_source.go +++ b/e2e/vendor/k8s.io/client-go/transport/token_source.go @@ -182,7 +182,10 @@ func (ts *cachingTokenSource) Token() (*oauth2.Token, error) { if ts.tok == nil { return nil, err } - klog.Errorf("Unable to rotate token: %v", err) + // Not using a caller-provided logger isn't ideal, but impossible to fix + // without new APIs that go up all the way to HTTPWrappersForConfig. + // This is currently deemed not worth changing (too much effort, not enough benefit). + klog.TODO().Error(err, "Unable to rotate token") return ts.tok, nil } diff --git a/e2e/vendor/k8s.io/client-go/transport/transport.go b/e2e/vendor/k8s.io/client-go/transport/transport.go index 4770331a0..8fdcc5700 100644 --- a/e2e/vendor/k8s.io/client-go/transport/transport.go +++ b/e2e/vendor/k8s.io/client-go/transport/transport.go @@ -353,7 +353,7 @@ func tryCancelRequest(rt http.RoundTripper, req *http.Request) { case utilnet.RoundTripperWrapper: tryCancelRequest(rt.WrappedRoundTripper(), req) default: - klog.Warningf("Unable to cancel request for %T", rt) + klog.FromContext(req.Context()).Info("Warning: unable to cancel request", "roundTripperType", fmt.Sprintf("%T", rt)) } } diff --git a/e2e/vendor/k8s.io/client-go/util/cert/cert.go b/e2e/vendor/k8s.io/client-go/util/cert/cert.go index 91e171271..122046126 100644 --- a/e2e/vendor/k8s.io/client-go/util/cert/cert.go +++ b/e2e/vendor/k8s.io/client-go/util/cert/cert.go @@ -90,11 +90,37 @@ func NewSelfSignedCACert(cfg Config, key crypto.Signer) (*x509.Certificate, erro return x509.ParseCertificate(certDERBytes) } +// SelfSignedCertKeyOptions contains configuration parameters for generating self-signed certificates. +type SelfSignedCertKeyOptions struct { + // Host is required, and identifies the host of the serving certificate. Can be a DNS name or IP address. + Host string + // AlternateIPs is optional, and identifies additional IPs the serving certificate should be valid for. + AlternateIPs []net.IP + // AlternateDNS is optional, and identifies additional DNS names the serving certificate should be valid for. + AlternateDNS []string + + // MaxAge controls the duration of the issued certificate. + // Defaults to 1 year if unset. + // Ignored if FixtureDirectory is set. + MaxAge time.Duration + + // FixtureDirectory is intended for use in tests. + // If non-empty, it is a directory path which can contain pre-generated certs. The format is: + // _-_-.crt + // _-_-.key + // Certs/keys not existing in that directory are created with a duration of 100 years. + FixtureDirectory string +} + // GenerateSelfSignedCertKey creates a self-signed certificate and key for the given host. // Host may be an IP or a DNS name // You may also specify additional subject alt names (either ip or dns names) for the certificate. func GenerateSelfSignedCertKey(host string, alternateIPs []net.IP, alternateDNS []string) ([]byte, []byte, error) { - return GenerateSelfSignedCertKeyWithFixtures(host, alternateIPs, alternateDNS, "") + return GenerateSelfSignedCertKeyWithOptions(SelfSignedCertKeyOptions{ + Host: host, + AlternateIPs: alternateIPs, + AlternateDNS: alternateDNS, + }) } // GenerateSelfSignedCertKeyWithFixtures creates a self-signed certificate and key for the given host. @@ -106,8 +132,26 @@ func GenerateSelfSignedCertKey(host string, alternateIPs []net.IP, alternateDNS // _-_-.key // Certs/keys not existing in that directory are created. func GenerateSelfSignedCertKeyWithFixtures(host string, alternateIPs []net.IP, alternateDNS []string, fixtureDirectory string) ([]byte, []byte, error) { + return GenerateSelfSignedCertKeyWithOptions(SelfSignedCertKeyOptions{ + Host: host, + AlternateIPs: alternateIPs, + AlternateDNS: alternateDNS, + FixtureDirectory: fixtureDirectory, + }) +} + +// GenerateSelfSignedCertKeyWithOptions generates a self-signed certificate and key based on the provided options. +func GenerateSelfSignedCertKeyWithOptions(opts SelfSignedCertKeyOptions) ([]byte, []byte, error) { + host := opts.Host + alternateIPs := opts.AlternateIPs + alternateDNS := opts.AlternateDNS + fixtureDirectory := opts.FixtureDirectory + maxAge := opts.MaxAge + if maxAge == 0 { + maxAge = 365 * 24 * time.Hour + } + validFrom := time.Now().Add(-time.Hour) // valid an hour earlier to avoid flakes due to clock skew - maxAge := time.Hour * 24 * 365 // one year self-signed certs baseName := fmt.Sprintf("%s_%s_%s", host, strings.Join(ipsToStrings(alternateIPs), "-"), strings.Join(alternateDNS, "-")) certFixturePath := filepath.Join(fixtureDirectory, baseName+".crt") diff --git a/e2e/vendor/k8s.io/client-go/util/consistencydetector/data_consistency_detector.go b/e2e/vendor/k8s.io/client-go/util/consistencydetector/data_consistency_detector.go index b33d08032..72a871d43 100644 --- a/e2e/vendor/k8s.io/client-go/util/consistencydetector/data_consistency_detector.go +++ b/e2e/vendor/k8s.io/client-go/util/consistencydetector/data_consistency_detector.go @@ -22,7 +22,7 @@ import ( "sort" "time" - "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp" //nolint:depguard "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/e2e/vendor/k8s.io/client-go/util/flowcontrol/backoff.go b/e2e/vendor/k8s.io/client-go/util/flowcontrol/backoff.go index 899b8e34e..7cb46717c 100644 --- a/e2e/vendor/k8s.io/client-go/util/flowcontrol/backoff.go +++ b/e2e/vendor/k8s.io/client-go/util/flowcontrol/backoff.go @@ -22,7 +22,6 @@ import ( "time" "k8s.io/utils/clock" - testingclock "k8s.io/utils/clock/testing" ) type backoffEntry struct { @@ -49,7 +48,7 @@ type Backoff struct { maxJitterFactor float64 } -func NewFakeBackOff(initial, max time.Duration, tc *testingclock.FakeClock) *Backoff { +func NewFakeBackOff(initial, max time.Duration, tc clock.Clock) *Backoff { return newBackoff(tc, initial, max, 0.0) } @@ -57,7 +56,7 @@ func NewBackOff(initial, max time.Duration) *Backoff { return NewBackOffWithJitter(initial, max, 0.0) } -func NewFakeBackOffWithJitter(initial, max time.Duration, tc *testingclock.FakeClock, maxJitterFactor float64) *Backoff { +func NewFakeBackOffWithJitter(initial, max time.Duration, tc clock.Clock, maxJitterFactor float64) *Backoff { return newBackoff(tc, initial, max, maxJitterFactor) } diff --git a/e2e/vendor/k8s.io/client-go/util/workqueue/delaying_queue.go b/e2e/vendor/k8s.io/client-go/util/workqueue/delaying_queue.go index e33a6c692..da444f4fb 100644 --- a/e2e/vendor/k8s.io/client-go/util/workqueue/delaying_queue.go +++ b/e2e/vendor/k8s.io/client-go/util/workqueue/delaying_queue.go @@ -22,6 +22,7 @@ import ( "time" utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/klog/v2" "k8s.io/utils/clock" ) @@ -46,6 +47,10 @@ type DelayingQueueConfig = TypedDelayingQueueConfig[any] // TypedDelayingQueueConfig specifies optional configurations to customize a DelayingInterface. type TypedDelayingQueueConfig[T comparable] struct { + // An optional logger. The name of the queue does *not* get added to it, this should + // be done by the caller if desired. + Logger *klog.Logger + // Name for the queue. If unnamed, the metrics will not be registered. Name string @@ -94,6 +99,10 @@ func TypedNewDelayingQueue[T comparable]() TypedDelayingInterface[T] { // NewTypedDelayingQueueWithConfig constructs a new workqueue with options to // customize different properties. func NewTypedDelayingQueueWithConfig[T comparable](config TypedDelayingQueueConfig[T]) TypedDelayingInterface[T] { + logger := klog.Background() + if config.Logger != nil { + logger = *config.Logger + } if config.Clock == nil { config.Clock = clock.RealClock{} } @@ -106,7 +115,7 @@ func NewTypedDelayingQueueWithConfig[T comparable](config TypedDelayingQueueConf }) } - return newDelayingQueue(config.Clock, config.Queue, config.Name, config.MetricsProvider) + return newDelayingQueue(logger, config.Clock, config.Queue, config.Name, config.MetricsProvider) } // NewDelayingQueueWithCustomQueue constructs a new workqueue with ability to @@ -135,7 +144,7 @@ func NewDelayingQueueWithCustomClock(clock clock.WithTicker, name string) Delayi }) } -func newDelayingQueue[T comparable](clock clock.WithTicker, q TypedInterface[T], name string, provider MetricsProvider) *delayingType[T] { +func newDelayingQueue[T comparable](logger klog.Logger, clock clock.WithTicker, q TypedInterface[T], name string, provider MetricsProvider) *delayingType[T] { ret := &delayingType[T]{ TypedInterface: q, clock: clock, @@ -145,7 +154,7 @@ func newDelayingQueue[T comparable](clock clock.WithTicker, q TypedInterface[T], metrics: newRetryMetrics(name, provider), } - go ret.waitingLoop() + go ret.waitingLoop(logger) return ret } @@ -264,8 +273,8 @@ func (q *delayingType[T]) AddAfter(item T, duration time.Duration) { const maxWait = 10 * time.Second // waitingLoop runs until the workqueue is shutdown and keeps a check on the list of items to be added. -func (q *delayingType[T]) waitingLoop() { - defer utilruntime.HandleCrash() +func (q *delayingType[T]) waitingLoop(logger klog.Logger) { + defer utilruntime.HandleCrashWithLogger(logger) // Make a placeholder channel to use when there are no items in our list never := make(<-chan time.Time) diff --git a/e2e/vendor/k8s.io/client-go/util/workqueue/doc.go b/e2e/vendor/k8s.io/client-go/util/workqueue/doc.go index 8555aa95f..a76d830ed 100644 --- a/e2e/vendor/k8s.io/client-go/util/workqueue/doc.go +++ b/e2e/vendor/k8s.io/client-go/util/workqueue/doc.go @@ -23,4 +23,4 @@ limitations under the License. // - Multiple consumers and producers. In particular, it is allowed for an // item to be reenqueued while it is being processed. // - Shutdown notifications. -package workqueue // import "k8s.io/client-go/util/workqueue" +package workqueue diff --git a/e2e/vendor/k8s.io/client-go/util/workqueue/parallelizer.go b/e2e/vendor/k8s.io/client-go/util/workqueue/parallelizer.go index 366bf20a3..9f986a25a 100644 --- a/e2e/vendor/k8s.io/client-go/util/workqueue/parallelizer.go +++ b/e2e/vendor/k8s.io/client-go/util/workqueue/parallelizer.go @@ -74,7 +74,7 @@ func ParallelizeUntil(ctx context.Context, workers, pieces int, doWorkPiece DoWo wg.Add(workers) for i := 0; i < workers; i++ { go func() { - defer utilruntime.HandleCrash() + defer utilruntime.HandleCrashWithContext(ctx) defer wg.Done() for chunk := range toProcess { start := chunk * chunkSize diff --git a/e2e/vendor/k8s.io/cloud-provider/CONTRIBUTING.md b/e2e/vendor/k8s.io/cloud-provider/CONTRIBUTING.md deleted file mode 100644 index fe4643fdb..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/CONTRIBUTING.md +++ /dev/null @@ -1,9 +0,0 @@ -# Contributing guidelines - -Welcome to Kubernetes. We are excited about the prospect of you joining our [community](https://github.com/kubernetes/community)! The Kubernetes community abides by the CNCF [code of conduct](code-of-conduct.md). - -Do not open pull requests directly against this repository, they will be ignored. Instead, please open pull requests against [kubernetes/kubernetes](https://git.k8s.io/kubernetes/). Please follow the same [contributing guide](https://git.k8s.io/kubernetes/CONTRIBUTING.md) you would follow for any other pull request made to kubernetes/kubernetes. Changes to this repo should be discussed with [sig cloud-provider](https://github.com/kubernetes/community/tree/master/sig-cloud-provider). - -This repository is published from [kubernetes/kubernetes/staging/src/k8s.io/cloud-provider](https://git.k8s.io/kubernetes/staging/src/k8s.io/cloud-provider) by the [kubernetes publishing-bot](https://git.k8s.io/publishing-bot). - -Please see [Staging Directory and Publishing](https://git.k8s.io/community/contributors/devel/sig-architecture/staging.md) for more information diff --git a/e2e/vendor/k8s.io/cloud-provider/OWNERS b/e2e/vendor/k8s.io/cloud-provider/OWNERS deleted file mode 100644 index 1ac1c0f0e..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/OWNERS +++ /dev/null @@ -1,30 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - mikedanese - - dims - - wlan0 - - andrewsykim - - cheftako -reviewers: - - aojea - - wojtek-t - - deads2k - - derekwaynecarr - - mikedanese - - liggitt - - sttts - - dchen1107 - - saad-ali - - luxas - - justinsb - - jsafrane - - dims - - freehan - - jingxu97 - - wlan0 - - cheftako - - andrewsykim -labels: - - sig/cloud-provider - - area/cloudprovider diff --git a/e2e/vendor/k8s.io/cloud-provider/README.md b/e2e/vendor/k8s.io/cloud-provider/README.md deleted file mode 100644 index 542a9a7a8..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# cloud-provider - -This repository defines the cloud-provider interface and mechanism to initialize -a cloud-provider implementation into Kubernetes. Currently multiple processes -use this code although the intent is that it will eventually only be cloud -controller manager. - -**Note:** go-get or vendor this package as `k8s.io/cloud-provider`. - -## Purpose - -This library is a shared dependency for processes which need to be able to -integrate with cloud-provider specific functionality. - -## Compatibility - -Cloud Providers are expected to keep the HEAD of their implementations in sync -with the HEAD of this repository. - -## Where does it come from? - -`cloud-provider` is synced from -https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/cloud-provider. -Code changes are made in that location, merged into k8s.io/kubernetes and -later synced here. - -## Things you should NOT do - - 1. Add an cloud provider specific code to this repo. - 2. Directly modify anything under vendor/k8s.io/cloud-provider in this repo. Those are driven from `k8s.io/kubernetes/staging/src/k8s.io/cloud-provider`. - 3. Make interface changes without first discussing them with - sig-cloudprovider. - diff --git a/e2e/vendor/k8s.io/cloud-provider/SECURITY_CONTACTS b/e2e/vendor/k8s.io/cloud-provider/SECURITY_CONTACTS deleted file mode 100644 index 68e73edaf..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/SECURITY_CONTACTS +++ /dev/null @@ -1,20 +0,0 @@ -# Defined below are the security contacts for this repo. -# -# They are the contact point for the Product Security Committee to reach out -# to for triaging and handling of incoming issues. -# -# The below names agree to abide by the -# [Embargo Policy](https://git.k8s.io/security/private-distributors-list.md#embargo-policy) -# and will be removed and replaced if they violate that agreement. -# -# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE -# INSTRUCTIONS AT https://kubernetes.io/security/ - -cheftako -andrewsykim -dims -cjcullen -joelsmith -liggitt -philips -tallclair diff --git a/e2e/vendor/k8s.io/cloud-provider/app/config/config.go b/e2e/vendor/k8s.io/cloud-provider/app/config/config.go deleted file mode 100644 index 20f1d0ef9..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/app/config/config.go +++ /dev/null @@ -1,83 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package config - -import ( - apiserver "k8s.io/apiserver/pkg/server" - "k8s.io/client-go/informers" - clientset "k8s.io/client-go/kubernetes" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/tools/record" - cloudprovider "k8s.io/cloud-provider" - "k8s.io/cloud-provider/config" -) - -// Config is the main context object for the cloud controller manager. -type Config struct { - ComponentConfig config.CloudControllerManagerConfiguration - - SecureServing *apiserver.SecureServingInfo - // LoopbackClientConfig is a config for a privileged loopback connection - LoopbackClientConfig *restclient.Config - - Authentication apiserver.AuthenticationInfo - Authorization apiserver.AuthorizationInfo - - // WebhookSecureServing is a separate SecureServing configuration from - // healthz, configz, and metrics. - WebhookSecureServing *apiserver.SecureServingInfo - - // the general kube client - Client *clientset.Clientset - - // the rest config for the master - Kubeconfig *restclient.Config - - // EventBroadcaster is broadcaster events to all sinks. - EventBroadcaster record.EventBroadcaster - - // EventRecord is a sink for events. - EventRecorder record.EventRecorder - - // ClientBuilder will provide a client for this controller to use - ClientBuilder cloudprovider.ControllerClientBuilder - - // VersionedClient will provide a client for informers - VersionedClient clientset.Interface - - // SharedInformers gives access to informers for the controller. - SharedInformers informers.SharedInformerFactory -} - -type completedConfig struct { - *Config -} - -// CompletedConfig same as Config, just to swap private object. -type CompletedConfig struct { - // Embed a private pointer that cannot be instantiated outside of this package. - *completedConfig -} - -// Complete fills in any fields not set that are required to have valid data. It's mutating the receiver. -func (c *Config) Complete() *CompletedConfig { - cc := completedConfig{c} - - apiserver.AuthorizeClientBearerToken(c.LoopbackClientConfig, &c.Authentication, &c.Authorization) - - return &CompletedConfig{&cc} -} diff --git a/e2e/vendor/k8s.io/cloud-provider/cloud.go b/e2e/vendor/k8s.io/cloud-provider/cloud.go deleted file mode 100644 index d250d5acc..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/cloud.go +++ /dev/null @@ -1,335 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -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 cloudprovider - -import ( - "context" - "errors" - "fmt" - "strings" - - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/informers" - clientset "k8s.io/client-go/kubernetes" - restclient "k8s.io/client-go/rest" -) - -// ControllerClientBuilder allows you to get clients and configs for controllers -// Please note a copy also exists in pkg/controller/client_builder.go -// TODO: Make this depend on the separate controller utilities repo (issues/68947) -type ControllerClientBuilder interface { - Config(name string) (*restclient.Config, error) - ConfigOrDie(name string) *restclient.Config - Client(name string) (clientset.Interface, error) - ClientOrDie(name string) clientset.Interface -} - -// Interface is an abstract, pluggable interface for cloud providers. -type Interface interface { - // Initialize provides the cloud with a kubernetes client builder and may spawn goroutines - // to perform housekeeping or run custom controllers specific to the cloud provider. - // Any tasks started here should be cleaned up when the stop channel closes. - Initialize(clientBuilder ControllerClientBuilder, stop <-chan struct{}) - // LoadBalancer returns a balancer interface. Also returns true if the interface is supported, false otherwise. - LoadBalancer() (LoadBalancer, bool) - // Instances returns an instances interface. Also returns true if the interface is supported, false otherwise. - Instances() (Instances, bool) - // InstancesV2 is an implementation for instances and should only be implemented by external cloud providers. - // Implementing InstancesV2 is behaviorally identical to Instances but is optimized to significantly reduce - // API calls to the cloud provider when registering and syncing nodes. Implementation of this interface will - // disable calls to the Zones interface. Also returns true if the interface is supported, false otherwise. - InstancesV2() (InstancesV2, bool) - // Zones returns a zones interface. Also returns true if the interface is supported, false otherwise. - // DEPRECATED: Zones is deprecated in favor of retrieving zone/region information from InstancesV2. - // This interface will not be called if InstancesV2 is enabled. - Zones() (Zones, bool) - // Clusters returns a clusters interface. Also returns true if the interface is supported, false otherwise. - Clusters() (Clusters, bool) - // Routes returns a routes interface along with whether the interface is supported. - Routes() (Routes, bool) - // ProviderName returns the cloud provider ID. - ProviderName() string - // HasClusterID returns true if a ClusterID is required and set - HasClusterID() bool -} - -type InformerUser interface { - // SetInformers sets the informer on the cloud object. - SetInformers(informerFactory informers.SharedInformerFactory) -} - -// Clusters is an abstract, pluggable interface for clusters of containers. -type Clusters interface { - // ListClusters lists the names of the available clusters. - ListClusters(ctx context.Context) ([]string, error) - // Master gets back the address (either DNS name or IP address) of the master node for the cluster. - Master(ctx context.Context, clusterName string) (string, error) -} - -// (DEPRECATED) DefaultLoadBalancerName is the default load balancer name that is called from -// LoadBalancer.GetLoadBalancerName. Use this method to maintain backward compatible names for -// LoadBalancers that were created prior to Kubernetes v1.12. In the future, each provider should -// replace this method call in GetLoadBalancerName with a provider-specific implementation that -// is less cryptic than the Service's UUID. -func DefaultLoadBalancerName(service *v1.Service) string { - //GCE requires that the name of a load balancer starts with a lower case letter. - ret := "a" + string(service.UID) - ret = strings.Replace(ret, "-", "", -1) - //AWS requires that the name of a load balancer is shorter than 32 bytes. - if len(ret) > 32 { - ret = ret[:32] - } - return ret -} - -// GetInstanceProviderID builds a ProviderID for a node in a cloud. -// Note that if the instance does not exist, we must return ("", cloudprovider.InstanceNotFound) -// cloudprovider.InstanceNotFound should NOT be returned for instances that exist but are stopped/sleeping -func GetInstanceProviderID(ctx context.Context, cloud Interface, nodeName types.NodeName) (string, error) { - instances, ok := cloud.Instances() - if !ok { - return "", fmt.Errorf("failed to get instances from cloud provider") - } - instanceID, err := instances.InstanceID(ctx, nodeName) - if err != nil { - if err == NotImplemented { - return "", err - } - if err == InstanceNotFound { - return "", err - } - - return "", fmt.Errorf("failed to get instance ID from cloud provider: %w", err) - } - return cloud.ProviderName() + "://" + instanceID, nil -} - -// LoadBalancer is an abstract, pluggable interface for load balancers. -// -// Cloud provider may chose to implement the logic for -// constructing/destroying specific kinds of load balancers in a -// controller separate from the ServiceController. If this is the case, -// then {Ensure,Update}LoadBalancer must return the ImplementedElsewhere error. -// For the given LB service, the GetLoadBalancer must return "exists=True" if -// there exists a LoadBalancer instance created by ServiceController. -// In all other cases, GetLoadBalancer must return a NotFound error. -// EnsureLoadBalancerDeleted must not return ImplementedElsewhere to ensure -// proper teardown of resources that were allocated by the ServiceController. -// This can happen if a user changes the type of LB via an update to the resource -// or when migrating from ServiceController to alternate implementation. -// The finalizer on the service will be added and removed by ServiceController -// irrespective of the ImplementedElsewhere error. Additional finalizers for -// LB services must be managed in the alternate implementation. -type LoadBalancer interface { - // GetLoadBalancer returns whether the specified load balancer exists, and - // if so, what its status is. - // Implementations must treat the *v1.Service parameter as read-only and not modify it. - // Parameter 'clusterName' is the name of the cluster as presented to kube-controller-manager. - // TODO: Break this up into different interfaces (LB, etc) when we have more than one type of service - GetLoadBalancer(ctx context.Context, clusterName string, service *v1.Service) (status *v1.LoadBalancerStatus, exists bool, err error) - // GetLoadBalancerName returns the name of the load balancer. Implementations must treat the - // *v1.Service parameter as read-only and not modify it. - GetLoadBalancerName(ctx context.Context, clusterName string, service *v1.Service) string - // EnsureLoadBalancer creates a new load balancer 'name', or updates the existing one. Returns the status of the balancer - // Implementations must treat the *v1.Service and *v1.Node - // parameters as read-only and not modify them. - // Parameter 'clusterName' is the name of the cluster as presented to kube-controller-manager. - // - // Implementations may return a (possibly wrapped) api.RetryError to enforce - // backing off at a fixed duration. This can be used for cases like when the - // load balancer is not ready yet (e.g., it is still being provisioned) and - // polling at a fixed rate is preferred over backing off exponentially in - // order to minimize latency. - EnsureLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error) - // UpdateLoadBalancer updates hosts under the specified load balancer. - // Implementations must treat the *v1.Service and *v1.Node - // parameters as read-only and not modify them. - // Parameter 'clusterName' is the name of the cluster as presented to kube-controller-manager - UpdateLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) error - // EnsureLoadBalancerDeleted deletes the specified load balancer if it - // exists, returning nil if the load balancer specified either didn't exist or - // was successfully deleted. - // This construction is useful because many cloud providers' load balancers - // have multiple underlying components, meaning a Get could say that the LB - // doesn't exist even if some part of it is still laying around. - // Implementations must treat the *v1.Service parameter as read-only and not modify it. - // Parameter 'clusterName' is the name of the cluster as presented to kube-controller-manager - EnsureLoadBalancerDeleted(ctx context.Context, clusterName string, service *v1.Service) error -} - -// Instances is an abstract, pluggable interface for sets of instances. -type Instances interface { - // NodeAddresses returns the addresses of the specified instance. - NodeAddresses(ctx context.Context, name types.NodeName) ([]v1.NodeAddress, error) - // NodeAddressesByProviderID returns the addresses of the specified instance. - // The instance is specified using the providerID of the node. The - // ProviderID is a unique identifier of the node. This will not be called - // from the node whose nodeaddresses are being queried. i.e. local metadata - // services cannot be used in this method to obtain nodeaddresses - NodeAddressesByProviderID(ctx context.Context, providerID string) ([]v1.NodeAddress, error) - // InstanceID returns the cloud provider ID of the node with the specified NodeName. - // Note that if the instance does not exist, we must return ("", cloudprovider.InstanceNotFound) - // cloudprovider.InstanceNotFound should NOT be returned for instances that exist but are stopped/sleeping - InstanceID(ctx context.Context, nodeName types.NodeName) (string, error) - // InstanceType returns the type of the specified instance. - InstanceType(ctx context.Context, name types.NodeName) (string, error) - // InstanceTypeByProviderID returns the type of the specified instance. - InstanceTypeByProviderID(ctx context.Context, providerID string) (string, error) - // AddSSHKeyToAllInstances adds an SSH public key as a legal identity for all instances - // expected format for the key is standard ssh-keygen format: - AddSSHKeyToAllInstances(ctx context.Context, user string, keyData []byte) error - // CurrentNodeName returns the name of the node we are currently running on - // On most clouds (e.g. GCE) this is the hostname, so we provide the hostname - CurrentNodeName(ctx context.Context, hostname string) (types.NodeName, error) - // InstanceExistsByProviderID returns true if the instance for the given provider exists. - // If false is returned with no error, the instance will be immediately deleted by the cloud controller manager. - // This method should still return true for instances that exist but are stopped/sleeping. - InstanceExistsByProviderID(ctx context.Context, providerID string) (bool, error) - // InstanceShutdownByProviderID returns true if the instance is shutdown in cloudprovider - InstanceShutdownByProviderID(ctx context.Context, providerID string) (bool, error) -} - -// InstancesV2 is an abstract, pluggable interface for cloud provider instances. -// Unlike the Instances interface, it is designed for external cloud providers and should only be used by them. -// Implementation of this interface will disable calls to the Zones interface. -type InstancesV2 interface { - // InstanceExists returns true if the instance for the given node exists according to the cloud provider. - // Use the node.name or node.spec.providerID field to find the node in the cloud provider. - InstanceExists(ctx context.Context, node *v1.Node) (bool, error) - // InstanceShutdown returns true if the instance is shutdown according to the cloud provider. - // Use the node.name or node.spec.providerID field to find the node in the cloud provider. - InstanceShutdown(ctx context.Context, node *v1.Node) (bool, error) - // InstanceMetadata returns the instance's metadata. The values returned in InstanceMetadata are - // translated into specific fields and labels in the Node object on registration. - // Implementations should always check node.spec.providerID first when trying to discover the instance - // for a given node. In cases where node.spec.providerID is empty, implementations can use other - // properties of the node like its name, labels and annotations. - InstanceMetadata(ctx context.Context, node *v1.Node) (*InstanceMetadata, error) -} - -// Route is a representation of an advanced routing rule. -type Route struct { - // Name is the name of the routing rule in the cloud-provider. - // It will be ignored in a Create (although nameHint may influence it) - Name string - // TargetNode is the NodeName of the target instance. - TargetNode types.NodeName - // EnableNodeAddresses is a feature gate for TargetNodeAddresses. If false, ignore TargetNodeAddresses. - // Without this, if users haven't updated their cloud-provider, reconcile() will delete and create same route every time. - EnableNodeAddresses bool - // TargetNodeAddresses are the Node IPs of the target Node. - TargetNodeAddresses []v1.NodeAddress - // DestinationCIDR is the CIDR format IP range that this routing rule - // applies to. - DestinationCIDR string - // Blackhole is set to true if this is a blackhole route - // The node controller will delete the route if it is in the managed range. - Blackhole bool -} - -// Routes is an abstract, pluggable interface for advanced routing rules. -type Routes interface { - // ListRoutes lists all managed routes that belong to the specified clusterName - ListRoutes(ctx context.Context, clusterName string) ([]*Route, error) - // CreateRoute creates the described managed route - // route.Name will be ignored, although the cloud-provider may use nameHint - // to create a more user-meaningful name. - CreateRoute(ctx context.Context, clusterName string, nameHint string, route *Route) error - // DeleteRoute deletes the specified managed route - // Route should be as returned by ListRoutes - DeleteRoute(ctx context.Context, clusterName string, route *Route) error -} - -var ( - DiskNotFound = errors.New("disk is not found") - ImplementedElsewhere = errors.New("implemented by alternate to cloud provider") - InstanceNotFound = errors.New("instance not found") - NotImplemented = errors.New("unimplemented") -) - -// Zone represents the location of a particular machine. -type Zone struct { - FailureDomain string - Region string -} - -// Zones is an abstract, pluggable interface for zone enumeration. -// DEPRECATED: Zones is deprecated in favor of retrieving zone/region information from InstancesV2. -// This interface will not be called if InstancesV2 is enabled. -type Zones interface { - // GetZone returns the Zone containing the current failure zone and locality region that the program is running in - // In most cases, this method is called from the kubelet querying a local metadata service to acquire its zone. - // For the case of external cloud providers, use GetZoneByProviderID or GetZoneByNodeName since GetZone - // can no longer be called from the kubelets. - GetZone(ctx context.Context) (Zone, error) - - // GetZoneByProviderID returns the Zone containing the current zone and locality region of the node specified by providerID - // This method is particularly used in the context of external cloud providers where node initialization must be done - // outside the kubelets. - GetZoneByProviderID(ctx context.Context, providerID string) (Zone, error) - - // GetZoneByNodeName returns the Zone containing the current zone and locality region of the node specified by node name - // This method is particularly used in the context of external cloud providers where node initialization must be done - // outside the kubelets. - GetZoneByNodeName(ctx context.Context, nodeName types.NodeName) (Zone, error) -} - -// PVLabeler is an abstract, pluggable interface for fetching labels for volumes -// DEPRECATED: PVLabeler is deprecated in favor of CSI topology feature. -type PVLabeler interface { - GetLabelsForVolume(ctx context.Context, pv *v1.PersistentVolume) (map[string]string, error) -} - -// InstanceMetadata contains metadata about a specific instance. -// Values returned in InstanceMetadata are translated into specific fields and labels for Node. -type InstanceMetadata struct { - // ProviderID is a unique ID used to identify an instance on the cloud provider. - // The ProviderID set here will be set on the node's spec.providerID field. - // The provider ID format can be set by the cloud provider but providers should - // ensure the format does not change in any incompatible way. - // - // The provider ID format used by existing cloud provider has been: - // :// - // Existing providers setting this field should preserve the existing format - // currently being set in node.spec.providerID. - ProviderID string - // InstanceType is the instance's type. - // The InstanceType set here will be set using the following labels on the node object: - // * node.kubernetes.io/instance-type= - // * beta.kubernetes.io/instance-type= (DEPRECATED) - InstanceType string - // NodeAddress contains information for the instance's address. - // The node addresses returned here will be set on the node's status.addresses field. - NodeAddresses []v1.NodeAddress - - // Zone is the zone that the instance is in. - // The value set here is applied as the following labels on the node: - // * topology.kubernetes.io/zone= - // * failure-domain.beta.kubernetes.io/zone= (DEPRECATED) - Zone string - // Region is the region that the instance is in. - // The value set here is applied as the following labels on the node: - // * topology.kubernetes.io/region= - // * failure-domain.beta.kubernetes.io/region= (DEPRECATED) - Region string - - // AdditionalLabels is a map of additional labels provided by the cloud provider. - // When provided, they will be applied to the node and enable cloud providers - // to labels nodes with information that may be valuable to that provider. - AdditionalLabels map[string]string -} diff --git a/e2e/vendor/k8s.io/cloud-provider/code-of-conduct.md b/e2e/vendor/k8s.io/cloud-provider/code-of-conduct.md deleted file mode 100644 index 0d15c00cf..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/code-of-conduct.md +++ /dev/null @@ -1,3 +0,0 @@ -# Kubernetes Community Code of Conduct - -Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) diff --git a/e2e/vendor/k8s.io/cloud-provider/config/install/install.go b/e2e/vendor/k8s.io/cloud-provider/config/install/install.go deleted file mode 100644 index b07a9f051..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/config/install/install.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package install - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/cloud-provider/config" - "k8s.io/cloud-provider/config/v1alpha1" -) - -var ( - // Scheme defines methods for serializing and deserializing API objects. - Scheme = runtime.NewScheme() - // Codecs provides methods for retrieving codecs and serializers for specific - // versions and content types. - Codecs = serializer.NewCodecFactory(Scheme) -) - -func init() { - Install(Scheme) -} - -// Install adds the types of this group into the given scheme. -func Install(scheme *runtime.Scheme) { - utilruntime.Must(config.AddToScheme(scheme)) - utilruntime.Must(v1alpha1.AddToScheme(scheme)) - utilruntime.Must(scheme.SetVersionPriority(v1alpha1.SchemeGroupVersion)) -} diff --git a/e2e/vendor/k8s.io/cloud-provider/config/register.go b/e2e/vendor/k8s.io/cloud-provider/config/register.go deleted file mode 100644 index 3f14ec59b..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/config/register.go +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package config - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// GroupName is the group name used in this package -const GroupName = "cloudcontrollermanager.config.k8s.io" - -var ( - // SchemeGroupVersion is group version used to register these objects - SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} - // SchemeBuilder is the scheme builder with scheme init functions to run for this API package - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - // AddToScheme is a global function that registers this API group & version to a scheme - AddToScheme = SchemeBuilder.AddToScheme -) - -// addKnownTypes registers known types to the given scheme -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &CloudControllerManagerConfiguration{}, - ) - return nil -} diff --git a/e2e/vendor/k8s.io/cloud-provider/config/types.go b/e2e/vendor/k8s.io/cloud-provider/config/types.go deleted file mode 100644 index f0e8c179f..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/config/types.go +++ /dev/null @@ -1,103 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package config - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - nodeconfig "k8s.io/cloud-provider/controllers/node/config" - serviceconfig "k8s.io/cloud-provider/controllers/service/config" - cmconfig "k8s.io/controller-manager/config" -) - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// CloudControllerManagerConfiguration contains elements describing cloud-controller manager. -type CloudControllerManagerConfiguration struct { - metav1.TypeMeta - - // Generic holds configuration for a generic controller-manager - Generic cmconfig.GenericControllerManagerConfiguration - // KubeCloudSharedConfiguration holds configuration for shared related features - // both in cloud controller manager and kube-controller manager. - KubeCloudShared KubeCloudSharedConfiguration - - // NodeController holds configuration for node controller - // related features. - NodeController nodeconfig.NodeControllerConfiguration - - // ServiceControllerConfiguration holds configuration for ServiceController - // related features. - ServiceController serviceconfig.ServiceControllerConfiguration - - // NodeStatusUpdateFrequency is the frequency at which the controller updates nodes' status - NodeStatusUpdateFrequency metav1.Duration - - // Webhook is the configuration for cloud-controller-manager hosted webhooks - Webhook WebhookConfiguration -} - -// KubeCloudSharedConfiguration contains elements shared by both kube-controller manager -// and cloud-controller manager, but not genericconfig. -type KubeCloudSharedConfiguration struct { - // CloudProviderConfiguration holds configuration for CloudProvider related features. - CloudProvider CloudProviderConfiguration - // externalCloudVolumePlugin specifies the plugin to use when cloudProvider is "external". - // It is currently used by the in repo cloud providers to handle node and volume control in the KCM. - ExternalCloudVolumePlugin string - // useServiceAccountCredentials indicates whether controllers should be run with - // individual service account credentials. - UseServiceAccountCredentials bool - // run with untagged cloud instances - AllowUntaggedCloud bool - // routeReconciliationPeriod is the period for reconciling routes created for Nodes by cloud provider.. - RouteReconciliationPeriod metav1.Duration - // nodeMonitorPeriod is the period for syncing NodeStatus in CloudNodeLifecycleController. - NodeMonitorPeriod metav1.Duration - // clusterName is the instance prefix for the cluster. - ClusterName string - // clusterCIDR is CIDR Range for Pods in cluster. - ClusterCIDR string - // AllocateNodeCIDRs enables CIDRs for Pods to be allocated and, if - // ConfigureCloudRoutes is true, to be set on the cloud provider. - AllocateNodeCIDRs bool - // CIDRAllocatorType determines what kind of pod CIDR allocator will be used. - CIDRAllocatorType string - // configureCloudRoutes enables CIDRs allocated with allocateNodeCIDRs - // to be configured on the cloud provider. - ConfigureCloudRoutes bool - // nodeSyncPeriod is the period for syncing nodes from cloudprovider. Longer - // periods will result in fewer calls to cloud provider, but may delay addition - // of new nodes to cluster. - NodeSyncPeriod metav1.Duration -} - -// CloudProviderConfiguration contains basically elements about cloud provider. -type CloudProviderConfiguration struct { - // Name is the provider for cloud services. - Name string - // cloudConfigFile is the path to the cloud provider configuration file. - CloudConfigFile string -} - -type WebhookConfiguration struct { - // Webhooks is the list of webhooks to enable or disable - // '*' means "all enabled by default webhooks" - // 'foo' means "enable 'foo'" - // '-foo' means "disable 'foo'" - // first item for a particular name wins - Webhooks []string -} diff --git a/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/conversion.go b/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/conversion.go deleted file mode 100644 index 41240f7af..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/conversion.go +++ /dev/null @@ -1,49 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/conversion" - cpconfig "k8s.io/cloud-provider/config" -) - -// Important! The public back-and-forth conversion functions for the types in this generic -// package with ComponentConfig types need to be manually exposed like this in order for -// other packages that reference this package to be able to call these conversion functions -// in an autogenerated manner. -// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions -// in autogenerated code as well. - -// Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration is an autogenerated conversion function. -func Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(in *KubeCloudSharedConfiguration, out *cpconfig.KubeCloudSharedConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(in, out, s) -} - -// Convert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration is an autogenerated conversion function. -func Convert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(in *cpconfig.KubeCloudSharedConfiguration, out *KubeCloudSharedConfiguration, s conversion.Scope) error { - return autoConvert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(in, out, s) -} - -// Convert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration is an autogenerated conversion function. -func Convert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(in *CloudProviderConfiguration, out *cpconfig.CloudProviderConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(in, out, s) -} - -// Convert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration is an autogenerated conversion function. -func Convert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(in *cpconfig.CloudProviderConfiguration, out *CloudProviderConfiguration, s conversion.Scope) error { - return autoConvert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(in, out, s) -} diff --git a/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/defaults.go b/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/defaults.go deleted file mode 100644 index c7f4760b4..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/defaults.go +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "time" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - nodeconfigv1alpha1 "k8s.io/cloud-provider/controllers/node/config/v1alpha1" - serviceconfigv1alpha1 "k8s.io/cloud-provider/controllers/service/config/v1alpha1" - cmconfigv1alpha1 "k8s.io/controller-manager/config/v1alpha1" - utilpointer "k8s.io/utils/pointer" -) - -func addDefaultingFuncs(scheme *runtime.Scheme) error { - return RegisterDefaults(scheme) -} - -func SetDefaults_CloudControllerManagerConfiguration(obj *CloudControllerManagerConfiguration) { - zero := metav1.Duration{} - if obj.NodeStatusUpdateFrequency == zero { - obj.NodeStatusUpdateFrequency = metav1.Duration{Duration: 5 * time.Minute} - } - - // These defaults override the recommended defaults from the apimachineryconfigv1alpha1 package that are applied automatically - // These client-connection defaults are specific to the cloud-controller-manager - if obj.Generic.ClientConnection.QPS == 0 { - obj.Generic.ClientConnection.QPS = 20 - } - if obj.Generic.ClientConnection.Burst == 0 { - obj.Generic.ClientConnection.Burst = 30 - } - - // Use the default RecommendedDefaultGenericControllerManagerConfiguration options - cmconfigv1alpha1.RecommendedDefaultGenericControllerManagerConfiguration(&obj.Generic) - // Use the default RecommendedDefaultServiceControllerConfiguration options - serviceconfigv1alpha1.RecommendedDefaultServiceControllerConfiguration(&obj.ServiceController) - // Use the default RecommendedDefaultNodeControllerConfiguration options - nodeconfigv1alpha1.RecommendedDefaultNodeControllerConfiguration(&obj.NodeController) -} - -func SetDefaults_KubeCloudSharedConfiguration(obj *KubeCloudSharedConfiguration) { - zero := metav1.Duration{} - if obj.NodeMonitorPeriod == zero { - obj.NodeMonitorPeriod = metav1.Duration{Duration: 5 * time.Second} - } - if obj.ClusterName == "" { - obj.ClusterName = "kubernetes" - } - if obj.ConfigureCloudRoutes == nil { - obj.ConfigureCloudRoutes = utilpointer.BoolPtr(true) - } - if obj.RouteReconciliationPeriod == zero { - obj.RouteReconciliationPeriod = metav1.Duration{Duration: 10 * time.Second} - } -} diff --git a/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/doc.go b/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/doc.go deleted file mode 100644 index 4bce737d5..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/doc.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Note: The referenced generic ComponentConfig packages with conversions -// between the types (e.g. the external package) needs to be given as an -// input to conversion-gen for it to find the native conversation funcs to -// call. - -// +k8s:deepcopy-gen=package -// +k8s:conversion-gen=k8s.io/component-base/config/v1alpha1 -// +k8s:conversion-gen=k8s.io/cloud-provider/config -// +k8s:conversion-gen=k8s.io/cloud-provider/config/v1alpha1 -// +k8s:conversion-gen=k8s.io/cloud-provider/controllers/service/config/v1alpha1 -// +k8s:conversion-gen=k8s.io/controller-manager/config/v1alpha1 -// +k8s:openapi-gen=true -// +k8s:defaulter-gen=TypeMeta -// +groupName=cloudcontrollermanager.config.k8s.io - -package v1alpha1 diff --git a/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/register.go b/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/register.go deleted file mode 100644 index 94320d37c..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/register.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// GroupName is the group name use in this package -const GroupName = "cloudcontrollermanager.config.k8s.io" - -var ( - // GroupName is the group name use in this package - SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} - // SchemeBuilder is the scheme builder with scheme init functions to run for this API package - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - // localSchemeBuilder ïs a pointer to SchemeBuilder instance. Using localSchemeBuilder - // defaulting and conversion init funcs are registered as well. - localSchemeBuilder = &SchemeBuilder - // AddToScheme is a global function that registers this API group & version to a scheme - AddToScheme = localSchemeBuilder.AddToScheme -) - -func init() { - // We only register manually written functions here. The registration of the - // generated functions takes place in the generated files. The separation - // makes the code compile even when the generated files are missing. - localSchemeBuilder.Register(addDefaultingFuncs) -} - -// addKnownTypes registers known types to the given scheme -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &CloudControllerManagerConfiguration{}, - ) - return nil -} diff --git a/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/types.go b/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/types.go deleted file mode 100644 index 53689cadc..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/types.go +++ /dev/null @@ -1,101 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - nodeconfigv1alpha1 "k8s.io/cloud-provider/controllers/node/config/v1alpha1" - serviceconfigv1alpha1 "k8s.io/cloud-provider/controllers/service/config/v1alpha1" - cmconfigv1alpha1 "k8s.io/controller-manager/config/v1alpha1" -) - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// CloudControllerManagerConfiguration contains elements describing cloud-controller manager. -type CloudControllerManagerConfiguration struct { - metav1.TypeMeta `json:",inline"` - - // Generic holds configuration for a generic controller-manager - Generic cmconfigv1alpha1.GenericControllerManagerConfiguration - // KubeCloudSharedConfiguration holds configuration for shared related features - // both in cloud controller manager and kube-controller manager. - KubeCloudShared KubeCloudSharedConfiguration - // NodeController holds configuration for node controller - // related features. - NodeController nodeconfigv1alpha1.NodeControllerConfiguration - // ServiceControllerConfiguration holds configuration for ServiceController - // related features. - ServiceController serviceconfigv1alpha1.ServiceControllerConfiguration - // NodeStatusUpdateFrequency is the frequency at which the controller updates nodes' status - NodeStatusUpdateFrequency metav1.Duration - // Webhook is the configuration for cloud-controller-manager hosted webhooks - Webhook WebhookConfiguration -} - -// KubeCloudSharedConfiguration contains elements shared by both kube-controller manager -// and cloud-controller manager, but not genericconfig. -type KubeCloudSharedConfiguration struct { - // CloudProviderConfiguration holds configuration for CloudProvider related features. - CloudProvider CloudProviderConfiguration - // externalCloudVolumePlugin specifies the plugin to use when cloudProvider is "external". - // It is currently used by the in repo cloud providers to handle node and volume control in the KCM. - ExternalCloudVolumePlugin string - // useServiceAccountCredentials indicates whether controllers should be run with - // individual service account credentials. - UseServiceAccountCredentials bool - // run with untagged cloud instances - AllowUntaggedCloud bool - // routeReconciliationPeriod is the period for reconciling routes created for Nodes by cloud provider.. - RouteReconciliationPeriod metav1.Duration - // nodeMonitorPeriod is the period for syncing NodeStatus in NodeController. - NodeMonitorPeriod metav1.Duration - // clusterName is the instance prefix for the cluster. - ClusterName string - // clusterCIDR is CIDR Range for Pods in cluster. - ClusterCIDR string - // AllocateNodeCIDRs enables CIDRs for Pods to be allocated and, if - // ConfigureCloudRoutes is true, to be set on the cloud provider. - AllocateNodeCIDRs bool - // CIDRAllocatorType determines what kind of pod CIDR allocator will be used. - CIDRAllocatorType string - // configureCloudRoutes enables CIDRs allocated with allocateNodeCIDRs - // to be configured on the cloud provider. - ConfigureCloudRoutes *bool - // nodeSyncPeriod is the period for syncing nodes from cloudprovider. Longer - // periods will result in fewer calls to cloud provider, but may delay addition - // of new nodes to cluster. - NodeSyncPeriod metav1.Duration -} - -// CloudProviderConfiguration contains basically elements about cloud provider. -type CloudProviderConfiguration struct { - // Name is the provider for cloud services. - Name string - // cloudConfigFile is the path to the cloud provider configuration file. - CloudConfigFile string -} - -// WebhookConfiguration contains configuration related to -// cloud-controller-manager hosted webhooks -type WebhookConfiguration struct { - // Webhooks is the list of webhooks to enable or disable - // '*' means "all enabled by default webhooks" - // 'foo' means "enable 'foo'" - // '-foo' means "disable 'foo'" - // first item for a particular name wins - Webhooks []string -} diff --git a/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/zz_generated.conversion.go b/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/zz_generated.conversion.go deleted file mode 100644 index cc8d09414..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/zz_generated.conversion.go +++ /dev/null @@ -1,206 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - unsafe "unsafe" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - config "k8s.io/cloud-provider/config" - nodeconfigv1alpha1 "k8s.io/cloud-provider/controllers/node/config/v1alpha1" - serviceconfigv1alpha1 "k8s.io/cloud-provider/controllers/service/config/v1alpha1" - configv1alpha1 "k8s.io/controller-manager/config/v1alpha1" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*CloudControllerManagerConfiguration)(nil), (*config.CloudControllerManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_CloudControllerManagerConfiguration_To_config_CloudControllerManagerConfiguration(a.(*CloudControllerManagerConfiguration), b.(*config.CloudControllerManagerConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*config.CloudControllerManagerConfiguration)(nil), (*CloudControllerManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_config_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration(a.(*config.CloudControllerManagerConfiguration), b.(*CloudControllerManagerConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*WebhookConfiguration)(nil), (*config.WebhookConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_WebhookConfiguration_To_config_WebhookConfiguration(a.(*WebhookConfiguration), b.(*config.WebhookConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*config.WebhookConfiguration)(nil), (*WebhookConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_config_WebhookConfiguration_To_v1alpha1_WebhookConfiguration(a.(*config.WebhookConfiguration), b.(*WebhookConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*config.CloudProviderConfiguration)(nil), (*CloudProviderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(a.(*config.CloudProviderConfiguration), b.(*CloudProviderConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*config.KubeCloudSharedConfiguration)(nil), (*KubeCloudSharedConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(a.(*config.KubeCloudSharedConfiguration), b.(*KubeCloudSharedConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*CloudProviderConfiguration)(nil), (*config.CloudProviderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(a.(*CloudProviderConfiguration), b.(*config.CloudProviderConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*KubeCloudSharedConfiguration)(nil), (*config.KubeCloudSharedConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(a.(*KubeCloudSharedConfiguration), b.(*config.KubeCloudSharedConfiguration), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha1_CloudControllerManagerConfiguration_To_config_CloudControllerManagerConfiguration(in *CloudControllerManagerConfiguration, out *config.CloudControllerManagerConfiguration, s conversion.Scope) error { - if err := configv1alpha1.Convert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(&in.Generic, &out.Generic, s); err != nil { - return err - } - if err := Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(&in.KubeCloudShared, &out.KubeCloudShared, s); err != nil { - return err - } - if err := nodeconfigv1alpha1.Convert_v1alpha1_NodeControllerConfiguration_To_config_NodeControllerConfiguration(&in.NodeController, &out.NodeController, s); err != nil { - return err - } - if err := serviceconfigv1alpha1.Convert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(&in.ServiceController, &out.ServiceController, s); err != nil { - return err - } - out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency - if err := Convert_v1alpha1_WebhookConfiguration_To_config_WebhookConfiguration(&in.Webhook, &out.Webhook, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_CloudControllerManagerConfiguration_To_config_CloudControllerManagerConfiguration is an autogenerated conversion function. -func Convert_v1alpha1_CloudControllerManagerConfiguration_To_config_CloudControllerManagerConfiguration(in *CloudControllerManagerConfiguration, out *config.CloudControllerManagerConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha1_CloudControllerManagerConfiguration_To_config_CloudControllerManagerConfiguration(in, out, s) -} - -func autoConvert_config_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration(in *config.CloudControllerManagerConfiguration, out *CloudControllerManagerConfiguration, s conversion.Scope) error { - if err := configv1alpha1.Convert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(&in.Generic, &out.Generic, s); err != nil { - return err - } - if err := Convert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(&in.KubeCloudShared, &out.KubeCloudShared, s); err != nil { - return err - } - if err := nodeconfigv1alpha1.Convert_config_NodeControllerConfiguration_To_v1alpha1_NodeControllerConfiguration(&in.NodeController, &out.NodeController, s); err != nil { - return err - } - if err := serviceconfigv1alpha1.Convert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(&in.ServiceController, &out.ServiceController, s); err != nil { - return err - } - out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency - if err := Convert_config_WebhookConfiguration_To_v1alpha1_WebhookConfiguration(&in.Webhook, &out.Webhook, s); err != nil { - return err - } - return nil -} - -// Convert_config_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration is an autogenerated conversion function. -func Convert_config_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration(in *config.CloudControllerManagerConfiguration, out *CloudControllerManagerConfiguration, s conversion.Scope) error { - return autoConvert_config_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration(in, out, s) -} - -func autoConvert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(in *CloudProviderConfiguration, out *config.CloudProviderConfiguration, s conversion.Scope) error { - out.Name = in.Name - out.CloudConfigFile = in.CloudConfigFile - return nil -} - -func autoConvert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(in *config.CloudProviderConfiguration, out *CloudProviderConfiguration, s conversion.Scope) error { - out.Name = in.Name - out.CloudConfigFile = in.CloudConfigFile - return nil -} - -func autoConvert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(in *KubeCloudSharedConfiguration, out *config.KubeCloudSharedConfiguration, s conversion.Scope) error { - if err := Convert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(&in.CloudProvider, &out.CloudProvider, s); err != nil { - return err - } - out.ExternalCloudVolumePlugin = in.ExternalCloudVolumePlugin - out.UseServiceAccountCredentials = in.UseServiceAccountCredentials - out.AllowUntaggedCloud = in.AllowUntaggedCloud - out.RouteReconciliationPeriod = in.RouteReconciliationPeriod - out.NodeMonitorPeriod = in.NodeMonitorPeriod - out.ClusterName = in.ClusterName - out.ClusterCIDR = in.ClusterCIDR - out.AllocateNodeCIDRs = in.AllocateNodeCIDRs - out.CIDRAllocatorType = in.CIDRAllocatorType - if err := v1.Convert_Pointer_bool_To_bool(&in.ConfigureCloudRoutes, &out.ConfigureCloudRoutes, s); err != nil { - return err - } - out.NodeSyncPeriod = in.NodeSyncPeriod - return nil -} - -func autoConvert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(in *config.KubeCloudSharedConfiguration, out *KubeCloudSharedConfiguration, s conversion.Scope) error { - if err := Convert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(&in.CloudProvider, &out.CloudProvider, s); err != nil { - return err - } - out.ExternalCloudVolumePlugin = in.ExternalCloudVolumePlugin - out.UseServiceAccountCredentials = in.UseServiceAccountCredentials - out.AllowUntaggedCloud = in.AllowUntaggedCloud - out.RouteReconciliationPeriod = in.RouteReconciliationPeriod - out.NodeMonitorPeriod = in.NodeMonitorPeriod - out.ClusterName = in.ClusterName - out.ClusterCIDR = in.ClusterCIDR - out.AllocateNodeCIDRs = in.AllocateNodeCIDRs - out.CIDRAllocatorType = in.CIDRAllocatorType - if err := v1.Convert_bool_To_Pointer_bool(&in.ConfigureCloudRoutes, &out.ConfigureCloudRoutes, s); err != nil { - return err - } - out.NodeSyncPeriod = in.NodeSyncPeriod - return nil -} - -func autoConvert_v1alpha1_WebhookConfiguration_To_config_WebhookConfiguration(in *WebhookConfiguration, out *config.WebhookConfiguration, s conversion.Scope) error { - out.Webhooks = *(*[]string)(unsafe.Pointer(&in.Webhooks)) - return nil -} - -// Convert_v1alpha1_WebhookConfiguration_To_config_WebhookConfiguration is an autogenerated conversion function. -func Convert_v1alpha1_WebhookConfiguration_To_config_WebhookConfiguration(in *WebhookConfiguration, out *config.WebhookConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha1_WebhookConfiguration_To_config_WebhookConfiguration(in, out, s) -} - -func autoConvert_config_WebhookConfiguration_To_v1alpha1_WebhookConfiguration(in *config.WebhookConfiguration, out *WebhookConfiguration, s conversion.Scope) error { - out.Webhooks = *(*[]string)(unsafe.Pointer(&in.Webhooks)) - return nil -} - -// Convert_config_WebhookConfiguration_To_v1alpha1_WebhookConfiguration is an autogenerated conversion function. -func Convert_config_WebhookConfiguration_To_v1alpha1_WebhookConfiguration(in *config.WebhookConfiguration, out *WebhookConfiguration, s conversion.Scope) error { - return autoConvert_config_WebhookConfiguration_To_v1alpha1_WebhookConfiguration(in, out, s) -} diff --git a/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index 40a61f147..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,119 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CloudControllerManagerConfiguration) DeepCopyInto(out *CloudControllerManagerConfiguration) { - *out = *in - out.TypeMeta = in.TypeMeta - in.Generic.DeepCopyInto(&out.Generic) - in.KubeCloudShared.DeepCopyInto(&out.KubeCloudShared) - out.NodeController = in.NodeController - out.ServiceController = in.ServiceController - out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency - in.Webhook.DeepCopyInto(&out.Webhook) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudControllerManagerConfiguration. -func (in *CloudControllerManagerConfiguration) DeepCopy() *CloudControllerManagerConfiguration { - if in == nil { - return nil - } - out := new(CloudControllerManagerConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CloudControllerManagerConfiguration) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CloudProviderConfiguration) DeepCopyInto(out *CloudProviderConfiguration) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudProviderConfiguration. -func (in *CloudProviderConfiguration) DeepCopy() *CloudProviderConfiguration { - if in == nil { - return nil - } - out := new(CloudProviderConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeCloudSharedConfiguration) DeepCopyInto(out *KubeCloudSharedConfiguration) { - *out = *in - out.CloudProvider = in.CloudProvider - out.RouteReconciliationPeriod = in.RouteReconciliationPeriod - out.NodeMonitorPeriod = in.NodeMonitorPeriod - if in.ConfigureCloudRoutes != nil { - in, out := &in.ConfigureCloudRoutes, &out.ConfigureCloudRoutes - *out = new(bool) - **out = **in - } - out.NodeSyncPeriod = in.NodeSyncPeriod - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeCloudSharedConfiguration. -func (in *KubeCloudSharedConfiguration) DeepCopy() *KubeCloudSharedConfiguration { - if in == nil { - return nil - } - out := new(KubeCloudSharedConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WebhookConfiguration) DeepCopyInto(out *WebhookConfiguration) { - *out = *in - if in.Webhooks != nil { - in, out := &in.Webhooks, &out.Webhooks - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookConfiguration. -func (in *WebhookConfiguration) DeepCopy() *WebhookConfiguration { - if in == nil { - return nil - } - out := new(WebhookConfiguration) - in.DeepCopyInto(out) - return out -} diff --git a/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/zz_generated.defaults.go b/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/zz_generated.defaults.go deleted file mode 100644 index 96b18ded9..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/config/v1alpha1/zz_generated.defaults.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by defaulter-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// RegisterDefaults adds defaulters functions to the given scheme. -// Public to allow building arbitrary schemes. -// All generated defaulters are covering - they call all nested defaulters. -func RegisterDefaults(scheme *runtime.Scheme) error { - scheme.AddTypeDefaultingFunc(&CloudControllerManagerConfiguration{}, func(obj interface{}) { - SetObjectDefaults_CloudControllerManagerConfiguration(obj.(*CloudControllerManagerConfiguration)) - }) - return nil -} - -func SetObjectDefaults_CloudControllerManagerConfiguration(in *CloudControllerManagerConfiguration) { - SetDefaults_CloudControllerManagerConfiguration(in) - SetDefaults_KubeCloudSharedConfiguration(&in.KubeCloudShared) -} diff --git a/e2e/vendor/k8s.io/cloud-provider/config/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/cloud-provider/config/zz_generated.deepcopy.go deleted file mode 100644 index 8225daba1..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/config/zz_generated.deepcopy.go +++ /dev/null @@ -1,114 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package config - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CloudControllerManagerConfiguration) DeepCopyInto(out *CloudControllerManagerConfiguration) { - *out = *in - out.TypeMeta = in.TypeMeta - in.Generic.DeepCopyInto(&out.Generic) - out.KubeCloudShared = in.KubeCloudShared - out.NodeController = in.NodeController - out.ServiceController = in.ServiceController - out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency - in.Webhook.DeepCopyInto(&out.Webhook) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudControllerManagerConfiguration. -func (in *CloudControllerManagerConfiguration) DeepCopy() *CloudControllerManagerConfiguration { - if in == nil { - return nil - } - out := new(CloudControllerManagerConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CloudControllerManagerConfiguration) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CloudProviderConfiguration) DeepCopyInto(out *CloudProviderConfiguration) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudProviderConfiguration. -func (in *CloudProviderConfiguration) DeepCopy() *CloudProviderConfiguration { - if in == nil { - return nil - } - out := new(CloudProviderConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeCloudSharedConfiguration) DeepCopyInto(out *KubeCloudSharedConfiguration) { - *out = *in - out.CloudProvider = in.CloudProvider - out.RouteReconciliationPeriod = in.RouteReconciliationPeriod - out.NodeMonitorPeriod = in.NodeMonitorPeriod - out.NodeSyncPeriod = in.NodeSyncPeriod - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeCloudSharedConfiguration. -func (in *KubeCloudSharedConfiguration) DeepCopy() *KubeCloudSharedConfiguration { - if in == nil { - return nil - } - out := new(KubeCloudSharedConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WebhookConfiguration) DeepCopyInto(out *WebhookConfiguration) { - *out = *in - if in.Webhooks != nil { - in, out := &in.Webhooks, &out.Webhooks - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookConfiguration. -func (in *WebhookConfiguration) DeepCopy() *WebhookConfiguration { - if in == nil { - return nil - } - out := new(WebhookConfiguration) - in.DeepCopyInto(out) - return out -} diff --git a/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/types.go b/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/types.go deleted file mode 100644 index af7c78803..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/types.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package config - -// NodeControllerConfiguration contains elements describing NodeController. -type NodeControllerConfiguration struct { - // ConcurrentNodeSyncs is the number of workers - // concurrently synchronizing nodes - ConcurrentNodeSyncs int32 -} diff --git a/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/conversion.go b/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/conversion.go deleted file mode 100644 index 07dc75d31..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/conversion.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/conversion" - "k8s.io/cloud-provider/controllers/node/config" -) - -// Important! The public back-and-forth conversion functions for the types in this generic -// package with ComponentConfig types need to be manually exposed like this in order for -// other packages that reference this package to be able to call these conversion functions -// in an autogenerated manner. -// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions -// in autogenerated code as well. - -// Convert_config_NodeControllerConfiguration_To_v1alpha1_NodeControllerConfiguration is an autogenerated conversion function. -func Convert_config_NodeControllerConfiguration_To_v1alpha1_NodeControllerConfiguration(in *config.NodeControllerConfiguration, out *NodeControllerConfiguration, s conversion.Scope) error { - return autoConvert_config_NodeControllerConfiguration_To_v1alpha1_NodeControllerConfiguration(in, out, s) -} - -// Convert_v1alpha1_NodeControllerConfiguration_To_config_NodeControllerConfiguration is an autogenerated conversion function. -func Convert_v1alpha1_NodeControllerConfiguration_To_config_NodeControllerConfiguration(in *NodeControllerConfiguration, out *config.NodeControllerConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha1_NodeControllerConfiguration_To_config_NodeControllerConfiguration(in, out, s) -} diff --git a/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/defaults.go b/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/defaults.go deleted file mode 100644 index 5f5ff95ff..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/defaults.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -func RecommendedDefaultNodeControllerConfiguration(obj *NodeControllerConfiguration) { - if obj.ConcurrentNodeSyncs == 0 { - obj.ConcurrentNodeSyncs = 1 - } -} diff --git a/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/doc.go b/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/doc.go deleted file mode 100644 index 05c1119a2..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// +k8s:deepcopy-gen=package -// +k8s:conversion-gen=k8s.io/cloud-provider/controllers/node/config -// +k8s:conversion-gen=k8s.io/cloud-provider/controllers/node/config/v1alpha1 - -package v1alpha1 diff --git a/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/register.go b/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/register.go deleted file mode 100644 index a25accd07..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/register.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime" -) - -var ( - // SchemeBuilder is the scheme builder with scheme init functions to run for this API package - SchemeBuilder runtime.SchemeBuilder - // localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package, - // defaulting and conversion init funcs are registered as well. - localSchemeBuilder = &SchemeBuilder - // AddToScheme is a global function that registers this API group & version to a scheme - AddToScheme = localSchemeBuilder.AddToScheme -) diff --git a/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/types.go b/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/types.go deleted file mode 100644 index ca85a557c..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/types.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -// NodeControllerConfiguration contains elements describing NodeController. -type NodeControllerConfiguration struct { - // ConcurrentNodeSyncs is the number of workers - // concurrently synchronizing nodes - ConcurrentNodeSyncs int32 -} diff --git a/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/zz_generated.conversion.go b/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/zz_generated.conversion.go deleted file mode 100644 index cf3852db2..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/zz_generated.conversion.go +++ /dev/null @@ -1,58 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - config "k8s.io/cloud-provider/controllers/node/config" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddConversionFunc((*config.NodeControllerConfiguration)(nil), (*NodeControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_config_NodeControllerConfiguration_To_v1alpha1_NodeControllerConfiguration(a.(*config.NodeControllerConfiguration), b.(*NodeControllerConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*NodeControllerConfiguration)(nil), (*config.NodeControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_NodeControllerConfiguration_To_config_NodeControllerConfiguration(a.(*NodeControllerConfiguration), b.(*config.NodeControllerConfiguration), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha1_NodeControllerConfiguration_To_config_NodeControllerConfiguration(in *NodeControllerConfiguration, out *config.NodeControllerConfiguration, s conversion.Scope) error { - out.ConcurrentNodeSyncs = in.ConcurrentNodeSyncs - return nil -} - -func autoConvert_config_NodeControllerConfiguration_To_v1alpha1_NodeControllerConfiguration(in *config.NodeControllerConfiguration, out *NodeControllerConfiguration, s conversion.Scope) error { - out.ConcurrentNodeSyncs = in.ConcurrentNodeSyncs - return nil -} diff --git a/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index 7e7c1b9fa..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/controllers/node/config/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1alpha1 - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeControllerConfiguration) DeepCopyInto(out *NodeControllerConfiguration) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeControllerConfiguration. -func (in *NodeControllerConfiguration) DeepCopy() *NodeControllerConfiguration { - if in == nil { - return nil - } - out := new(NodeControllerConfiguration) - in.DeepCopyInto(out) - return out -} diff --git a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/OWNERS b/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/OWNERS deleted file mode 100644 index 200d01f74..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/OWNERS +++ /dev/null @@ -1,14 +0,0 @@ -approvers: - - api-approvers - - deads2k - - luxas - - mtaufen - - sttts -reviewers: - - api-reviewers - - deads2k - - luxas - - mtaufen - - sttts -emeritus_approvers: - - stewart-yu diff --git a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/doc.go b/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/doc.go deleted file mode 100644 index 919c3093d..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// +k8s:deepcopy-gen=package - -package config diff --git a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/types.go b/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/types.go deleted file mode 100644 index 3afca1630..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/types.go +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package config - -// ServiceControllerConfiguration contains elements describing ServiceController. -type ServiceControllerConfiguration struct { - // concurrentServiceSyncs is the number of services that are - // allowed to sync concurrently. Larger number = more responsive service - // management, but more CPU (and network) load. - ConcurrentServiceSyncs int32 -} diff --git a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/conversion.go b/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/conversion.go deleted file mode 100644 index 1c9ccc641..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/conversion.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/conversion" - serviceconfig "k8s.io/cloud-provider/controllers/service/config" -) - -// Important! The public back-and-forth conversion functions for the types in this generic -// package with ComponentConfig types need to be manually exposed like this in order for -// other packages that reference this package to be able to call these conversion functions -// in an autogenerated manner. -// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions -// in autogenerated code as well. - -// Convert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration is an autogenerated conversion function. -func Convert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(in *ServiceControllerConfiguration, out *serviceconfig.ServiceControllerConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(in, out, s) -} - -// Convert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration is an autogenerated conversion function. -func Convert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(in *serviceconfig.ServiceControllerConfiguration, out *ServiceControllerConfiguration, s conversion.Scope) error { - return autoConvert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(in, out, s) -} diff --git a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/defaults.go b/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/defaults.go deleted file mode 100644 index e4a8edb9e..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/defaults.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -// RecommendedDefaultServiceControllerConfiguration defaults a pointer to a -// ServiceControllerConfiguration struct. This will set the recommended default -// values, but they may be subject to change between API versions. This function -// is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo` -// function to allow consumers of this type to set whatever defaults for their -// embedded configs. Forcing consumers to use these defaults would be problematic -// as defaulting in the scheme is done as part of the conversion, and there would -// be no easy way to opt-out. Instead, if you want to use this defaulting method -// run it in your wrapper struct of this type in its `SetDefaults_` method. -func RecommendedDefaultServiceControllerConfiguration(obj *ServiceControllerConfiguration) { - if obj.ConcurrentServiceSyncs == 0 { - obj.ConcurrentServiceSyncs = 1 - } -} diff --git a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/doc.go b/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/doc.go deleted file mode 100644 index 7b9a09351..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// +k8s:deepcopy-gen=package -// +k8s:conversion-gen=k8s.io/cloud-provider/controllers/service/config -// +k8s:conversion-gen=k8s.io/cloud-provider/controllers/service/config/v1alpha1 - -package v1alpha1 diff --git a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/register.go b/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/register.go deleted file mode 100644 index 47e070782..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/register.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime" -) - -var ( - // SchemeBuilder is the scheme builder with scheme init functions to run for this API package - SchemeBuilder runtime.SchemeBuilder - // localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package, - // defaulting and conversion init funcs are registered as well. - localSchemeBuilder = &SchemeBuilder - // AddToScheme is a global function that registers this API group & version to a scheme - AddToScheme = localSchemeBuilder.AddToScheme -) diff --git a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/types.go b/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/types.go deleted file mode 100644 index 10ab1d2d9..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/types.go +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -// ServiceControllerConfiguration contains elements describing ServiceController. -type ServiceControllerConfiguration struct { - // concurrentServiceSyncs is the number of services that are - // allowed to sync concurrently. Larger number = more responsive service - // management, but more CPU (and network) load. - ConcurrentServiceSyncs int32 -} diff --git a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/zz_generated.conversion.go b/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/zz_generated.conversion.go deleted file mode 100644 index 5c4e7db7a..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/zz_generated.conversion.go +++ /dev/null @@ -1,58 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - config "k8s.io/cloud-provider/controllers/service/config" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddConversionFunc((*config.ServiceControllerConfiguration)(nil), (*ServiceControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(a.(*config.ServiceControllerConfiguration), b.(*ServiceControllerConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*ServiceControllerConfiguration)(nil), (*config.ServiceControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(a.(*ServiceControllerConfiguration), b.(*config.ServiceControllerConfiguration), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(in *ServiceControllerConfiguration, out *config.ServiceControllerConfiguration, s conversion.Scope) error { - out.ConcurrentServiceSyncs = in.ConcurrentServiceSyncs - return nil -} - -func autoConvert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(in *config.ServiceControllerConfiguration, out *ServiceControllerConfiguration, s conversion.Scope) error { - out.ConcurrentServiceSyncs = in.ConcurrentServiceSyncs - return nil -} diff --git a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index 49a9f7d2a..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1alpha1 - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceControllerConfiguration) DeepCopyInto(out *ServiceControllerConfiguration) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceControllerConfiguration. -func (in *ServiceControllerConfiguration) DeepCopy() *ServiceControllerConfiguration { - if in == nil { - return nil - } - out := new(ServiceControllerConfiguration) - in.DeepCopyInto(out) - return out -} diff --git a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/zz_generated.deepcopy.go deleted file mode 100644 index 53eb24296..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/controllers/service/config/zz_generated.deepcopy.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package config - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceControllerConfiguration) DeepCopyInto(out *ServiceControllerConfiguration) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceControllerConfiguration. -func (in *ServiceControllerConfiguration) DeepCopy() *ServiceControllerConfiguration { - if in == nil { - return nil - } - out := new(ServiceControllerConfiguration) - in.DeepCopyInto(out) - return out -} diff --git a/e2e/vendor/k8s.io/cloud-provider/doc.go b/e2e/vendor/k8s.io/cloud-provider/doc.go deleted file mode 100644 index 7192394c3..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -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 cloudprovider supplies interfaces and implementations for cloud service providers. -package cloudprovider diff --git a/e2e/vendor/k8s.io/cloud-provider/names/controller_names.go b/e2e/vendor/k8s.io/cloud-provider/names/controller_names.go deleted file mode 100644 index 87e938d01..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/names/controller_names.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package names - -// Canonical controller names -// -// NAMING CONVENTIONS -// 1. naming should be consistent across the controllers -// 2. use of shortcuts should be avoided, unless they are well-known non-Kubernetes shortcuts -// 3. Kubernetes' resources should be written together without a hyphen ("-") -// -// CHANGE POLICY -// The controller names should be treated as IDs. -// They can only be changed if absolutely necessary. For example if an inappropriate name was chosen in the past, or if the scope of the controller changes. -// When a name is changed, the old name should be aliased in CCMControllerAliases, while preserving all old aliases. -// This is done to achieve backwards compatibility -// -// USE CASES -// The following places should use the controller name constants, when: -// 1. registering a controller in app.DefaultInitFuncConstructors or sample main.controllerInitializers: -// 1.1. disabling a controller by default in app.ControllersDisabledByDefault -// 1.2. checking if IsControllerEnabled -// 1.3. defining an alias in CCMControllerAliases (for backwards compatibility only) -// 2. used anywhere inside the controller itself: -// 2.1. [TODO] logger component should be configured with the controller name by calling LoggerWithName -// 2.2. [TODO] logging should use a canonical controller name when referencing a controller (Eg. Starting X, Shutting down X) -// 2.3. [TODO] emitted events should have an EventSource.Component set to the controller name (usually when initializing an EventRecorder) -// 2.4. [TODO] registering ControllerManagerMetrics with ControllerStarted and ControllerStopped -// 2.5. [TODO] calling WaitForNamedCacheSync -// 3. defining controller options for "--help" command or generated documentation -// 3.1. controller name should be used to create a pflag.FlagSet when registering controller options (the name is rendered in a controller flag group header) -// 3.2. when defined flag's help mentions a controller name -// 4. defining a new service account for a new controller (old controllers may have inconsistent service accounts to stay backwards compatible) -// 5. anywhere these controllers are used outside of this module (kube-controller-manager, cloud-provider sample) -const ( - CloudNodeController = "cloud-node-controller" - ServiceLBController = "service-lb-controller" - NodeRouteController = "node-route-controller" - CloudNodeLifecycleController = "cloud-node-lifecycle-controller" -) - -// CCMControllerAliases returns a mapping of aliases to canonical controller names -// -// These aliases ensure backwards compatibility and should never be removed! -// Only addition of new aliases is allowed, and only when a canonical name is changed (please see CHANGE POLICY of controller names) -func CCMControllerAliases() map[string]string { - // return a new reference to achieve immutability of the mapping - return map[string]string{ - "cloud-node": CloudNodeController, - "service": ServiceLBController, - "route": NodeRouteController, - "cloud-node-lifecycle": CloudNodeLifecycleController, - } - -} diff --git a/e2e/vendor/k8s.io/cloud-provider/options/cloudprovider.go b/e2e/vendor/k8s.io/cloud-provider/options/cloudprovider.go deleted file mode 100644 index 6b5034aba..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/options/cloudprovider.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package options - -import ( - "github.com/spf13/pflag" - cpconfig "k8s.io/cloud-provider/config" -) - -// CloudProviderOptions holds the cloudprovider options. -type CloudProviderOptions struct { - *cpconfig.CloudProviderConfiguration -} - -// Validate checks validation of cloudprovider options. -func (s *CloudProviderOptions) Validate() []error { - allErrors := []error{} - return allErrors -} - -// AddFlags adds flags related to cloudprovider for controller manager to the specified FlagSet. -func (s *CloudProviderOptions) AddFlags(fs *pflag.FlagSet) { - fs.StringVar(&s.Name, "cloud-provider", s.Name, - "The provider for cloud services. Empty string for no provider.") - - fs.StringVar(&s.CloudConfigFile, "cloud-config", s.CloudConfigFile, - "The path to the cloud provider configuration file. Empty string for no configuration file.") -} - -// ApplyTo fills up cloudprovider config with options. -func (s *CloudProviderOptions) ApplyTo(cfg *cpconfig.CloudProviderConfiguration) error { - if s == nil { - return nil - } - - cfg.Name = s.Name - cfg.CloudConfigFile = s.CloudConfigFile - - return nil -} diff --git a/e2e/vendor/k8s.io/cloud-provider/options/kubecloudshared.go b/e2e/vendor/k8s.io/cloud-provider/options/kubecloudshared.go deleted file mode 100644 index 08a2f01b8..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/options/kubecloudshared.go +++ /dev/null @@ -1,110 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package options - -import ( - "fmt" - - "github.com/spf13/pflag" - - cpconfig "k8s.io/cloud-provider/config" - "k8s.io/cloud-provider/names" -) - -// KubeCloudSharedOptions holds the options shared between kube-controller-manager -// and cloud-controller-manager. -type KubeCloudSharedOptions struct { - *cpconfig.KubeCloudSharedConfiguration - CloudProvider *CloudProviderOptions -} - -// NewKubeCloudSharedOptions returns common/default configuration values for both -// the kube-controller-manager and the cloud-contoller-manager. Any common changes should -// be made here. Any individual changes should be made in that controller. -func NewKubeCloudSharedOptions(cfg *cpconfig.KubeCloudSharedConfiguration) *KubeCloudSharedOptions { - o := &KubeCloudSharedOptions{ - KubeCloudSharedConfiguration: cfg, - CloudProvider: &CloudProviderOptions{ - CloudProviderConfiguration: &cpconfig.CloudProviderConfiguration{}, - }, - } - - return o -} - -// AddFlags adds flags related to shared variable for controller manager to the specified FlagSet. -func (o *KubeCloudSharedOptions) AddFlags(fs *pflag.FlagSet) { - if o == nil { - return - } - - o.CloudProvider.AddFlags(fs) - fs.StringVar(&o.ExternalCloudVolumePlugin, "external-cloud-volume-plugin", o.ExternalCloudVolumePlugin, "The plugin to use when cloud provider is set to external. Can be empty, should only be set when cloud-provider is external. Currently used to allow node-ipam-controller, persistentvolume-binder-controller, persistentvolume-expander-controller and attach-detach-controller to work for in tree cloud providers.") - fs.BoolVar(&o.UseServiceAccountCredentials, "use-service-account-credentials", o.UseServiceAccountCredentials, "If true, use individual service account credentials for each controller.") - fs.BoolVar(&o.AllowUntaggedCloud, "allow-untagged-cloud", false, "Allow the cluster to run without the cluster-id on cloud instances. This is a legacy mode of operation and a cluster-id will be required in the future.") - fs.MarkDeprecated("allow-untagged-cloud", "This flag is deprecated and will be removed in a future release. A cluster-id will be required on cloud instances.") - fs.DurationVar(&o.RouteReconciliationPeriod.Duration, "route-reconciliation-period", o.RouteReconciliationPeriod.Duration, "The period for reconciling routes created for Nodes by cloud provider.") - fs.DurationVar(&o.NodeMonitorPeriod.Duration, "node-monitor-period", o.NodeMonitorPeriod.Duration, - fmt.Sprintf("The period for syncing NodeStatus in %s.", names.CloudNodeLifecycleController)) - fs.StringVar(&o.ClusterName, "cluster-name", o.ClusterName, "The instance prefix for the cluster.") - fs.StringVar(&o.ClusterCIDR, "cluster-cidr", o.ClusterCIDR, "CIDR Range for Pods in cluster. Only used when --allocate-node-cidrs=true; if false, this option will be ignored.") - fs.BoolVar(&o.AllocateNodeCIDRs, "allocate-node-cidrs", false, "Should CIDRs for Pods be allocated and set on the cloud provider. Requires --cluster-cidr.") - fs.StringVar(&o.CIDRAllocatorType, "cidr-allocator-type", "RangeAllocator", "Type of CIDR allocator to use") - fs.BoolVar(&o.ConfigureCloudRoutes, "configure-cloud-routes", true, "Should CIDRs allocated by allocate-node-cidrs be configured on the cloud provider.") - - fs.DurationVar(&o.NodeSyncPeriod.Duration, "node-sync-period", 0, ""+ - "This flag is deprecated and will be removed in future releases. See node-monitor-period for Node health checking or "+ - "route-reconciliation-period for cloud provider's route configuration settings.") - fs.MarkDeprecated("node-sync-period", "This flag is currently no-op and will be deleted.") -} - -// ApplyTo fills up KubeCloudShared config with options. -func (o *KubeCloudSharedOptions) ApplyTo(cfg *cpconfig.KubeCloudSharedConfiguration) error { - if o == nil { - return nil - } - - if err := o.CloudProvider.ApplyTo(&cfg.CloudProvider); err != nil { - return err - } - - cfg.ExternalCloudVolumePlugin = o.ExternalCloudVolumePlugin - cfg.UseServiceAccountCredentials = o.UseServiceAccountCredentials - cfg.AllowUntaggedCloud = o.AllowUntaggedCloud - cfg.RouteReconciliationPeriod = o.RouteReconciliationPeriod - cfg.NodeMonitorPeriod = o.NodeMonitorPeriod - cfg.ClusterName = o.ClusterName - cfg.ClusterCIDR = o.ClusterCIDR - cfg.AllocateNodeCIDRs = o.AllocateNodeCIDRs - cfg.CIDRAllocatorType = o.CIDRAllocatorType - cfg.ConfigureCloudRoutes = o.ConfigureCloudRoutes - cfg.NodeSyncPeriod = o.NodeSyncPeriod - - return nil -} - -// Validate checks validation of KubeCloudSharedOptions. -func (o *KubeCloudSharedOptions) Validate() []error { - if o == nil { - return nil - } - - errs := []error{} - errs = append(errs, o.CloudProvider.Validate()...) - - return errs -} diff --git a/e2e/vendor/k8s.io/cloud-provider/options/nodecontroller.go b/e2e/vendor/k8s.io/cloud-provider/options/nodecontroller.go deleted file mode 100644 index 4823c437b..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/options/nodecontroller.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package options - -import ( - "fmt" - - "github.com/spf13/pflag" - - nodeconfig "k8s.io/cloud-provider/controllers/node/config" -) - -// NodeControllerOptions holds the ServiceController options. -type NodeControllerOptions struct { - *nodeconfig.NodeControllerConfiguration -} - -// AddFlags adds flags related to ServiceController for controller manager to the specified FlagSet. -func (o *NodeControllerOptions) AddFlags(fs *pflag.FlagSet) { - if o == nil { - return - } - - fs.Int32Var(&o.ConcurrentNodeSyncs, "concurrent-node-syncs", o.ConcurrentNodeSyncs, "Number of workers concurrently synchronizing nodes.") -} - -// ApplyTo fills up ServiceController config with options. -func (o *NodeControllerOptions) ApplyTo(cfg *nodeconfig.NodeControllerConfiguration) error { - if o == nil { - return nil - } - - cfg.ConcurrentNodeSyncs = o.ConcurrentNodeSyncs - - return nil -} - -// Validate checks validation of NodeControllerOptions. -func (o *NodeControllerOptions) Validate() []error { - if o == nil { - return nil - } - var errors []error - if o.ConcurrentNodeSyncs <= 0 { - errors = append(errors, fmt.Errorf("concurrent-node-syncs must be a positive number")) - } - return errors -} diff --git a/e2e/vendor/k8s.io/cloud-provider/options/options.go b/e2e/vendor/k8s.io/cloud-provider/options/options.go deleted file mode 100644 index 0534f9f61..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/options/options.go +++ /dev/null @@ -1,308 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package options - -import ( - "context" - "fmt" - "math/rand" - "net" - "time" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - utilerrors "k8s.io/apimachinery/pkg/util/errors" - apiserveroptions "k8s.io/apiserver/pkg/server/options" - utilfeature "k8s.io/apiserver/pkg/util/feature" - "k8s.io/client-go/informers" - clientset "k8s.io/client-go/kubernetes" - "k8s.io/client-go/kubernetes/scheme" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" - "k8s.io/client-go/tools/record" - cloudprovider "k8s.io/cloud-provider" - "k8s.io/cloud-provider/app/config" - ccmconfig "k8s.io/cloud-provider/config" - ccmconfigscheme "k8s.io/cloud-provider/config/install" - ccmconfigv1alpha1 "k8s.io/cloud-provider/config/v1alpha1" - "k8s.io/cloud-provider/names" - cliflag "k8s.io/component-base/cli/flag" - cmoptions "k8s.io/controller-manager/options" - "k8s.io/controller-manager/pkg/clientbuilder" - netutils "k8s.io/utils/net" - - // add the related feature gates - _ "k8s.io/controller-manager/pkg/features/register" -) - -const ( - // CloudControllerManagerUserAgent is the userAgent name when starting cloud-controller managers. - CloudControllerManagerUserAgent = "cloud-controller-manager" -) - -// CloudControllerManagerOptions is the main context object for the controller manager. -type CloudControllerManagerOptions struct { - Generic *cmoptions.GenericControllerManagerConfigurationOptions - KubeCloudShared *KubeCloudSharedOptions - ServiceController *ServiceControllerOptions - NodeController *NodeControllerOptions - - SecureServing *apiserveroptions.SecureServingOptionsWithLoopback - Authentication *apiserveroptions.DelegatingAuthenticationOptions - Authorization *apiserveroptions.DelegatingAuthorizationOptions - - Master string - - WebhookServing *WebhookServingOptions - Webhook *WebhookOptions - - // NodeStatusUpdateFrequency is the frequency at which the controller updates nodes' status - NodeStatusUpdateFrequency metav1.Duration -} - -// ProviderDefaults are provided by the consumer when calling -// NewCloudControllerManagerOptions(), so that they can customize certain flag -// default values. -type ProviderDefaults struct { - // WebhookBindAddress is the default address. It can be overridden by "--webhook-bind-address". - WebhookBindAddress *net.IP - // WebhookBindPort is the default port. It can be overridden by "--webhook-bind-port". - WebhookBindPort *int -} - -// NewCloudControllerManagerOptions creates a new ExternalCMServer with a default config. -func NewCloudControllerManagerOptions() (*CloudControllerManagerOptions, error) { - return NewCloudControllerManagerOptionsWithProviderDefaults(ProviderDefaults{}) -} - -// NewCloudControllerManagerOptionsWithProviderDefaults creates a new -// ExternalCMServer with a default config, but allows the cloud provider to -// override a select number of default option values. -func NewCloudControllerManagerOptionsWithProviderDefaults(defaults ProviderDefaults) (*CloudControllerManagerOptions, error) { - componentConfig, err := NewDefaultComponentConfig() - if err != nil { - return nil, err - } - - s := CloudControllerManagerOptions{ - Generic: cmoptions.NewGenericControllerManagerConfigurationOptions(&componentConfig.Generic), - KubeCloudShared: NewKubeCloudSharedOptions(&componentConfig.KubeCloudShared), - NodeController: &NodeControllerOptions{ - NodeControllerConfiguration: &componentConfig.NodeController, - }, - ServiceController: &ServiceControllerOptions{ - ServiceControllerConfiguration: &componentConfig.ServiceController, - }, - SecureServing: apiserveroptions.NewSecureServingOptions().WithLoopback(), - Webhook: NewWebhookOptions(), - WebhookServing: NewWebhookServingOptions(defaults), - Authentication: apiserveroptions.NewDelegatingAuthenticationOptions(), - Authorization: apiserveroptions.NewDelegatingAuthorizationOptions(), - NodeStatusUpdateFrequency: componentConfig.NodeStatusUpdateFrequency, - } - - s.Authentication.RemoteKubeConfigFileOptional = true - s.Authorization.RemoteKubeConfigFileOptional = true - - // Set the PairName but leave certificate directory blank to generate in-memory by default - s.SecureServing.ServerCert.CertDirectory = "" - s.SecureServing.ServerCert.PairName = "cloud-controller-manager" - s.SecureServing.BindPort = cloudprovider.CloudControllerManagerPort - - s.Generic.LeaderElection.ResourceName = "cloud-controller-manager" - s.Generic.LeaderElection.ResourceNamespace = "kube-system" - - return &s, nil -} - -// NewDefaultComponentConfig returns cloud-controller manager configuration object. -func NewDefaultComponentConfig() (*ccmconfig.CloudControllerManagerConfiguration, error) { - versioned := &ccmconfigv1alpha1.CloudControllerManagerConfiguration{} - ccmconfigscheme.Scheme.Default(versioned) - - internal := &ccmconfig.CloudControllerManagerConfiguration{} - if err := ccmconfigscheme.Scheme.Convert(versioned, internal, nil); err != nil { - return nil, err - } - - return internal, nil -} - -// Flags returns flags for a specific CloudController by section name -func (o *CloudControllerManagerOptions) Flags(allControllers []string, disabledByDefaultControllers []string, controllerAliases map[string]string, allWebhooks, disabledByDefaultWebhooks []string) cliflag.NamedFlagSets { - fss := cliflag.NamedFlagSets{} - o.Generic.AddFlags(&fss, allControllers, disabledByDefaultControllers, controllerAliases) - o.KubeCloudShared.AddFlags(fss.FlagSet("generic")) - o.NodeController.AddFlags(fss.FlagSet(names.CloudNodeController)) - o.ServiceController.AddFlags(fss.FlagSet(names.ServiceLBController)) - if o.Webhook != nil { - o.Webhook.AddFlags(fss.FlagSet("webhook"), allWebhooks, disabledByDefaultWebhooks) - } - if o.WebhookServing != nil { - o.WebhookServing.AddFlags(fss.FlagSet("webhook serving")) - } - - o.SecureServing.AddFlags(fss.FlagSet("secure serving")) - o.Authentication.AddFlags(fss.FlagSet("authentication")) - o.Authorization.AddFlags(fss.FlagSet("authorization")) - - fs := fss.FlagSet("misc") - fs.StringVar(&o.Master, "master", o.Master, "The address of the Kubernetes API server (overrides any value in kubeconfig).") - fs.StringVar(&o.Generic.ClientConnection.Kubeconfig, "kubeconfig", o.Generic.ClientConnection.Kubeconfig, "Path to kubeconfig file with authorization and master location information (the master location can be overridden by the master flag).") - fs.DurationVar(&o.NodeStatusUpdateFrequency.Duration, "node-status-update-frequency", o.NodeStatusUpdateFrequency.Duration, "Specifies how often the controller updates nodes' status.") - utilfeature.DefaultMutableFeatureGate.AddFlag(fss.FlagSet("generic")) - - return fss -} - -// ApplyTo fills up cloud controller manager config with options. -func (o *CloudControllerManagerOptions) ApplyTo(c *config.Config, allControllers []string, disabledByDefaultControllers []string, controllerAliases map[string]string, userAgent string) error { - var err error - - // Build kubeconfig first to so that if it fails, it doesn't cause leaking - // goroutines (started from initializing secure serving - which underneath - // creates a queue which in its constructor starts a goroutine). - c.Kubeconfig, err = clientcmd.BuildConfigFromFlags(o.Master, o.Generic.ClientConnection.Kubeconfig) - if err != nil { - return err - } - c.Kubeconfig.DisableCompression = true - c.Kubeconfig.ContentConfig.AcceptContentTypes = o.Generic.ClientConnection.AcceptContentTypes - c.Kubeconfig.ContentConfig.ContentType = o.Generic.ClientConnection.ContentType - c.Kubeconfig.QPS = o.Generic.ClientConnection.QPS - c.Kubeconfig.Burst = int(o.Generic.ClientConnection.Burst) - - if err = o.Generic.ApplyTo(&c.ComponentConfig.Generic, allControllers, disabledByDefaultControllers, controllerAliases); err != nil { - return err - } - if err = o.KubeCloudShared.ApplyTo(&c.ComponentConfig.KubeCloudShared); err != nil { - return err - } - if err = o.ServiceController.ApplyTo(&c.ComponentConfig.ServiceController); err != nil { - return err - } - if o.Webhook != nil { - if err = o.Webhook.ApplyTo(&c.ComponentConfig.Webhook); err != nil { - return err - } - } - if o.WebhookServing != nil { - if err = o.WebhookServing.ApplyTo(&c.WebhookSecureServing, c.ComponentConfig.Webhook); err != nil { - return err - } - } - if err = o.SecureServing.ApplyTo(&c.SecureServing, &c.LoopbackClientConfig); err != nil { - return err - } - if o.SecureServing.BindPort != 0 || o.SecureServing.Listener != nil { - if err = o.Authentication.ApplyTo(&c.Authentication, c.SecureServing, nil); err != nil { - return err - } - if err = o.Authorization.ApplyTo(&c.Authorization); err != nil { - return err - } - } - - c.Client, err = clientset.NewForConfig(restclient.AddUserAgent(c.Kubeconfig, userAgent)) - if err != nil { - return err - } - - c.EventBroadcaster = record.NewBroadcaster(record.WithContext(context.TODO())) // TODO: move broadcaster construction to a place where there is a proper context. - c.EventRecorder = c.EventBroadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: userAgent}) - - rootClientBuilder := clientbuilder.SimpleControllerClientBuilder{ - ClientConfig: c.Kubeconfig, - } - if c.ComponentConfig.KubeCloudShared.UseServiceAccountCredentials { - c.ClientBuilder = clientbuilder.NewDynamicClientBuilder( - restclient.AnonymousClientConfig(c.Kubeconfig), - c.Client.CoreV1(), - metav1.NamespaceSystem) - } else { - c.ClientBuilder = rootClientBuilder - } - c.VersionedClient = rootClientBuilder.ClientOrDie("shared-informers") - c.SharedInformers = informers.NewSharedInformerFactory(c.VersionedClient, resyncPeriod(c)()) - - // sync back to component config - // TODO: find more elegant way than syncing back the values. - c.ComponentConfig.NodeStatusUpdateFrequency = o.NodeStatusUpdateFrequency - c.ComponentConfig.NodeController.ConcurrentNodeSyncs = o.NodeController.ConcurrentNodeSyncs - - return nil -} - -// Validate is used to validate config before launching the cloud controller manager -func (o *CloudControllerManagerOptions) Validate(allControllers []string, disabledByDefaultControllers []string, controllerAliases map[string]string, allWebhooks, disabledByDefaultWebhooks []string) error { - errors := []error{} - - errors = append(errors, o.Generic.Validate(allControllers, disabledByDefaultControllers, controllerAliases)...) - errors = append(errors, o.KubeCloudShared.Validate()...) - errors = append(errors, o.ServiceController.Validate()...) - errors = append(errors, o.SecureServing.Validate()...) - errors = append(errors, o.Authentication.Validate()...) - errors = append(errors, o.Authorization.Validate()...) - - if o.Webhook != nil { - errors = append(errors, o.Webhook.Validate(allWebhooks, disabledByDefaultWebhooks)...) - } - if o.WebhookServing != nil { - errors = append(errors, o.WebhookServing.Validate()...) - - if o.WebhookServing.BindPort == o.SecureServing.BindPort && o.WebhookServing.BindPort != 0 { - errors = append(errors, fmt.Errorf("--webhook-secure-port cannot be the same value as --secure-port")) - } - } - if len(o.KubeCloudShared.CloudProvider.Name) == 0 { - errors = append(errors, fmt.Errorf("--cloud-provider cannot be empty")) - } - - return utilerrors.NewAggregate(errors) -} - -// resyncPeriod computes the time interval a shared informer waits before resyncing with the api server -func resyncPeriod(c *config.Config) func() time.Duration { - return func() time.Duration { - factor := rand.Float64() + 1 - return time.Duration(float64(c.ComponentConfig.Generic.MinResyncPeriod.Nanoseconds()) * factor) - } -} - -// Config return a cloud controller manager config objective -func (o *CloudControllerManagerOptions) Config(allControllers []string, disabledByDefaultControllers []string, controllerAliases map[string]string, allWebhooks, disabledByDefaultWebhooks []string) (*config.Config, error) { - if err := o.Validate(allControllers, disabledByDefaultControllers, controllerAliases, allWebhooks, disabledByDefaultWebhooks); err != nil { - return nil, err - } - - if err := o.SecureServing.MaybeDefaultWithSelfSignedCerts("localhost", nil, []net.IP{netutils.ParseIPSloppy("127.0.0.1")}); err != nil { - return nil, fmt.Errorf("error creating self-signed certificates: %v", err) - } - - if o.WebhookServing != nil { - if err := o.WebhookServing.MaybeDefaultWithSelfSignedCerts("localhost", nil, []net.IP{netutils.ParseIPSloppy("127.0.0.1")}); err != nil { - return nil, fmt.Errorf("error creating self-signed certificates for webhook: %v", err) - } - } - - c := &config.Config{} - if err := o.ApplyTo(c, allControllers, disabledByDefaultControllers, controllerAliases, CloudControllerManagerUserAgent); err != nil { - return nil, err - } - - return c, nil -} diff --git a/e2e/vendor/k8s.io/cloud-provider/options/servicecontroller.go b/e2e/vendor/k8s.io/cloud-provider/options/servicecontroller.go deleted file mode 100644 index c63e43a98..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/options/servicecontroller.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package options - -import ( - "github.com/spf13/pflag" - serviceconfig "k8s.io/cloud-provider/controllers/service/config" -) - -// ServiceControllerOptions holds the ServiceController options. -type ServiceControllerOptions struct { - *serviceconfig.ServiceControllerConfiguration -} - -// AddFlags adds flags related to ServiceController for controller manager to the specified FlagSet. -func (o *ServiceControllerOptions) AddFlags(fs *pflag.FlagSet) { - if o == nil { - return - } - - fs.Int32Var(&o.ConcurrentServiceSyncs, "concurrent-service-syncs", o.ConcurrentServiceSyncs, "The number of services that are allowed to sync concurrently. Larger number = more responsive service management, but more CPU (and network) load") -} - -// ApplyTo fills up ServiceController config with options. -func (o *ServiceControllerOptions) ApplyTo(cfg *serviceconfig.ServiceControllerConfiguration) error { - if o == nil { - return nil - } - - cfg.ConcurrentServiceSyncs = o.ConcurrentServiceSyncs - - return nil -} - -// Validate checks validation of ServiceControllerOptions. -func (o *ServiceControllerOptions) Validate() []error { - if o == nil { - return nil - } - - errs := []error{} - return errs -} diff --git a/e2e/vendor/k8s.io/cloud-provider/options/webhook.go b/e2e/vendor/k8s.io/cloud-provider/options/webhook.go deleted file mode 100644 index 5174ae80f..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/options/webhook.go +++ /dev/null @@ -1,210 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package options - -import ( - "context" - "fmt" - "net" - "strconv" - "strings" - - "github.com/spf13/pflag" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apiserver/pkg/server" - "k8s.io/apiserver/pkg/server/dynamiccertificates" - apiserveroptions "k8s.io/apiserver/pkg/server/options" - "k8s.io/cloud-provider/config" - netutils "k8s.io/utils/net" -) - -const ( - CloudControllerManagerWebhookPort = 10260 -) - -type WebhookOptions struct { - // Webhooks is the list of webhook names that should be enabled or disabled - Webhooks []string -} - -func NewWebhookOptions() *WebhookOptions { - o := &WebhookOptions{} - return o -} - -func (o *WebhookOptions) AddFlags(fs *pflag.FlagSet, allWebhooks, disabledByDefaultWebhooks []string) { - fs.StringSliceVar(&o.Webhooks, "webhooks", o.Webhooks, fmt.Sprintf(""+ - "A list of webhooks to enable. '*' enables all on-by-default webhooks, 'foo' enables the webhook "+ - "named 'foo', '-foo' disables the webhook named 'foo'.\nAll webhooks: %s\nDisabled-by-default webhooks: %s", - strings.Join(allWebhooks, ", "), strings.Join(disabledByDefaultWebhooks, ", "))) -} - -func (o *WebhookOptions) Validate(allWebhooks, disabledByDefaultWebhooks []string) []error { - allErrors := []error{} - - allWebhooksSet := sets.NewString(allWebhooks...) - toValidate := sets.NewString(o.Webhooks...) - toValidate.Insert(disabledByDefaultWebhooks...) - for _, webhook := range toValidate.List() { - if webhook == "*" { - continue - } - webhook = strings.TrimPrefix(webhook, "-") - if !allWebhooksSet.Has(webhook) { - allErrors = append(allErrors, fmt.Errorf("%q is not in the list of known webhooks", webhook)) - } - } - - return allErrors -} - -func (o *WebhookOptions) ApplyTo(cfg *config.WebhookConfiguration) error { - if o == nil { - return nil - } - - cfg.Webhooks = o.Webhooks - - return nil -} - -type WebhookServingOptions struct { - *apiserveroptions.SecureServingOptions -} - -func NewWebhookServingOptions(defaults ProviderDefaults) *WebhookServingOptions { - var ( - bindAddress net.IP - bindPort int - ) - - if defaults.WebhookBindAddress != nil { - bindAddress = *defaults.WebhookBindAddress - } else { - bindAddress = netutils.ParseIPSloppy("0.0.0.0") - } - - if defaults.WebhookBindPort != nil { - bindPort = *defaults.WebhookBindPort - } else { - bindPort = CloudControllerManagerWebhookPort - } - - return &WebhookServingOptions{ - SecureServingOptions: &apiserveroptions.SecureServingOptions{ - BindAddress: bindAddress, - BindPort: bindPort, - ServerCert: apiserveroptions.GeneratableKeyCert{ - CertDirectory: "", - PairName: "cloud-controller-manager-webhook", - }, - }, - } -} - -func (o *WebhookServingOptions) AddFlags(fs *pflag.FlagSet) { - fs.IPVar(&o.BindAddress, "webhook-bind-address", o.BindAddress, ""+ - "The IP address on which to listen for the --webhook-secure-port port. The "+ - "associated interface(s) must be reachable by the rest of the cluster, and by CLI/web "+ - fmt.Sprintf("clients. If set to an unspecified address (0.0.0.0 or ::), all interfaces will be used. If unset, defaults to %v.", o.BindAddress)) - - fs.IntVar(&o.BindPort, "webhook-secure-port", o.BindPort, "Secure port to serve cloud provider webhooks. If 0, don't serve webhooks at all.") - - fs.StringVar(&o.ServerCert.CertDirectory, "webhook-cert-dir", o.ServerCert.CertDirectory, ""+ - "The directory where the TLS certs are located. "+ - "If --tls-cert-file and --tls-private-key-file are provided, this flag will be ignored.") - - fs.StringVar(&o.ServerCert.CertKey.CertFile, "webhook-tls-cert-file", o.ServerCert.CertKey.CertFile, ""+ - "File containing the default x509 Certificate for HTTPS. (CA cert, if any, concatenated "+ - "after server cert). If HTTPS serving is enabled, and --tls-cert-file and "+ - "--tls-private-key-file are not provided, a self-signed certificate and key "+ - "are generated for the public address and saved to the directory specified by --cert-dir.") - - fs.StringVar(&o.ServerCert.CertKey.KeyFile, "webhook-tls-private-key-file", o.ServerCert.CertKey.KeyFile, - "File containing the default x509 private key matching --tls-cert-file.") -} - -func (o *WebhookServingOptions) Validate() []error { - allErrors := []error{} - if o.BindPort < 0 || o.BindPort > 65535 { - allErrors = append(allErrors, fmt.Errorf("--webhook-secure-port %v must be between 0 and 65535, inclusive. A value of 0 disables the webhook endpoint entirely.", o.BindPort)) - } - - if (len(o.ServerCert.CertKey.CertFile) != 0 || len(o.ServerCert.CertKey.KeyFile) != 0) && o.ServerCert.GeneratedCert != nil { - allErrors = append(allErrors, fmt.Errorf("cert/key file and in-memory certificate cannot both be set")) - } - - return allErrors -} - -func (o *WebhookServingOptions) ApplyTo(cfg **server.SecureServingInfo, webhookCfg config.WebhookConfiguration) error { - if o == nil { - return nil - } - - if o.BindPort <= 0 { - return nil - } - // no need to bind to the address if there are no webhook enabled. - if len(webhookCfg.Webhooks) == 0 { - return nil - } - - var err error - var listener net.Listener - addr := net.JoinHostPort(o.BindAddress.String(), strconv.Itoa(o.BindPort)) - - l := net.ListenConfig{} - - listener, o.BindPort, err = createListener(addr, l) - if err != nil { - return fmt.Errorf("failed to create listener: %v", err) - } - - *cfg = &server.SecureServingInfo{ - Listener: listener, - } - - serverCertFile, serverKeyFile := o.ServerCert.CertKey.CertFile, o.ServerCert.CertKey.KeyFile - if len(serverCertFile) != 0 || len(serverKeyFile) != 0 { - var err error - (*cfg).Cert, err = dynamiccertificates.NewDynamicServingContentFromFiles("serving-cert", serverCertFile, serverKeyFile) - if err != nil { - return err - } - } else if o.ServerCert.GeneratedCert != nil { - (*cfg).Cert = o.ServerCert.GeneratedCert - } - - return nil -} - -func createListener(addr string, config net.ListenConfig) (net.Listener, int, error) { - ln, err := config.Listen(context.TODO(), "tcp", addr) - if err != nil { - return nil, 0, fmt.Errorf("failed to listen on %v: %v", addr, err) - } - - // get port - tcpAddr, ok := ln.Addr().(*net.TCPAddr) - if !ok { - ln.Close() - return nil, 0, fmt.Errorf("invalid listen address: %q", ln.Addr().String()) - } - - return ln, tcpAddr.Port, nil -} diff --git a/e2e/vendor/k8s.io/cloud-provider/plugins.go b/e2e/vendor/k8s.io/cloud-provider/plugins.go deleted file mode 100644 index 8ef778b17..000000000 --- a/e2e/vendor/k8s.io/cloud-provider/plugins.go +++ /dev/null @@ -1,136 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -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 cloudprovider - -import ( - "fmt" - "io" - "os" - "sync" - - "k8s.io/klog/v2" -) - -// Factory is a function that returns a cloudprovider.Interface. -// 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(config io.Reader) (Interface, error) - -// All registered cloud providers. -var ( - providersMutex sync.Mutex - providers = make(map[string]Factory) -) - -const externalCloudProvider = "external" - -// RegisterCloudProvider registers a cloudprovider.Factory by name. This -// is expected to happen during app startup. -func RegisterCloudProvider(name string, cloud Factory) { - providersMutex.Lock() - defer providersMutex.Unlock() - if _, found := providers[name]; found { - klog.Fatalf("Cloud provider %q was registered twice", name) - } - klog.V(1).Infof("Registered cloud provider %q", name) - providers[name] = cloud -} - -// IsCloudProvider returns true if name corresponds to an already registered -// cloud provider. -func IsCloudProvider(name string) bool { - providersMutex.Lock() - defer providersMutex.Unlock() - _, found := providers[name] - return found -} - -// GetCloudProvider creates an instance of the named cloud provider, or nil if -// the name is unknown. The error return is only used if 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 GetCloudProvider(name string, config io.Reader) (Interface, error) { - providersMutex.Lock() - defer providersMutex.Unlock() - f, found := providers[name] - if !found { - return nil, nil - } - return f(config) -} - -// Detects if the string is an external cloud provider -func IsExternal(name string) bool { - return name == externalCloudProvider -} - -// DisableWarningForProvider logs information about disabled cloud provider state -func DisableWarningForProvider(providerName string) { - if !IsExternal(providerName) { - klog.Infof("INFO: Please make sure you are running an external cloud controller manager binary for provider %q."+ - "In-tree cloud providers are disabled. Refer to https://github.com/kubernetes/kubernetes/tree/master/staging/src/k8s.io/cloud-provider/sample "+ - "for an example implementation.", providerName) - klog.Warningf("WARNING: built-in cloud providers are disabled. Please set \"--cloud-provider=external\" and migrate to an external cloud controller manager for provider %q", providerName) - } -} - -// ErrorForDisabledProvider returns an error formatted with the supplied provider name -func ErrorForDisabledProvider(providerName string) error { - return fmt.Errorf("cloud provider %q was specified, but built-in cloud providers are disabled. Please set --cloud-provider=external and migrate to an external cloud provider", providerName) -} - -// InitCloudProvider creates an instance of the named cloud provider. -func InitCloudProvider(name string, configFilePath string) (Interface, error) { - var cloud Interface - var err error - - if name == "" { - return nil, nil - } - - if IsExternal(name) { - klog.Info("External cloud provider specified") - return nil, nil - } - - if configFilePath != "" { - var config *os.File - config, err = os.Open(configFilePath) - if err != nil { - klog.Fatalf("Couldn't open cloud provider configuration %s: %#v", - configFilePath, err) - } - - defer config.Close() - cloud, err = GetCloudProvider(name, config) - } else { - // Pass explicit nil so plugins can actually check for nil. See - // "Why is my nil error value not equal to nil?" in golang.org/doc/faq. - cloud, err = GetCloudProvider(name, nil) - } - - if err != nil { - return nil, fmt.Errorf("could not init cloud provider %q: %v", name, err) - } - if cloud == nil { - return nil, fmt.Errorf("unknown cloud provider %q", name) - } - - return cloud, nil -} diff --git a/e2e/vendor/k8s.io/component-base/config/options/leaderelectionconfig.go b/e2e/vendor/k8s.io/component-base/config/options/leaderelectionconfig.go deleted file mode 100644 index bd90b6481..000000000 --- a/e2e/vendor/k8s.io/component-base/config/options/leaderelectionconfig.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package options - -import ( - "github.com/spf13/pflag" - "k8s.io/component-base/config" -) - -// BindLeaderElectionFlags binds the LeaderElectionConfiguration struct fields to a flagset -func BindLeaderElectionFlags(l *config.LeaderElectionConfiguration, fs *pflag.FlagSet) { - fs.BoolVar(&l.LeaderElect, "leader-elect", l.LeaderElect, ""+ - "Start a leader election client and gain leadership before "+ - "executing the main loop. Enable this when running replicated "+ - "components for high availability.") - fs.DurationVar(&l.LeaseDuration.Duration, "leader-elect-lease-duration", l.LeaseDuration.Duration, ""+ - "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.") - fs.DurationVar(&l.RenewDeadline.Duration, "leader-elect-renew-deadline", l.RenewDeadline.Duration, ""+ - "The interval between attempts by the acting master to renew a leadership slot "+ - "before it stops leading. This must be less than the lease duration. "+ - "This is only applicable if leader election is enabled.") - fs.DurationVar(&l.RetryPeriod.Duration, "leader-elect-retry-period", l.RetryPeriod.Duration, ""+ - "The duration the clients should wait between attempting acquisition and renewal "+ - "of a leadership. This is only applicable if leader election is enabled.") - fs.StringVar(&l.ResourceLock, "leader-elect-resource-lock", l.ResourceLock, ""+ - "The type of resource object that is used for locking during "+ - "leader election. Supported options are 'leases'.") - fs.StringVar(&l.ResourceName, "leader-elect-resource-name", l.ResourceName, ""+ - "The name of resource object that is used for locking during "+ - "leader election.") - fs.StringVar(&l.ResourceNamespace, "leader-elect-resource-namespace", l.ResourceNamespace, ""+ - "The namespace of resource object that is used for locking during "+ - "leader election.") -} diff --git a/e2e/vendor/k8s.io/component-base/metrics/features/kube_features.go b/e2e/vendor/k8s.io/component-base/metrics/features/kube_features.go deleted file mode 100644 index 5f41802cb..000000000 --- a/e2e/vendor/k8s.io/component-base/metrics/features/kube_features.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package features - -import ( - "k8s.io/apimachinery/pkg/util/version" - "k8s.io/component-base/featuregate" -) - -const ( - // owner: @logicalhan - // kep: https://kep.k8s.io/3466 - ComponentSLIs featuregate.Feature = "ComponentSLIs" -) - -func featureGates() map[featuregate.Feature]featuregate.VersionedSpecs { - return map[featuregate.Feature]featuregate.VersionedSpecs{ - ComponentSLIs: { - {Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.27"), Default: true, PreRelease: featuregate.Beta}, - // ComponentSLIs officially graduated to GA in v1.29 but the gate was not updated until v1.32. - // To support emulated versions, keep the gate until v1.35. - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, - }, - } -} - -// AddFeatureGates adds all feature gates used by this package. -func AddFeatureGates(mutableFeatureGate featuregate.MutableVersionedFeatureGate) error { - return mutableFeatureGate.AddVersioned(featureGates()) -} diff --git a/e2e/vendor/k8s.io/component-base/metrics/prometheus/workqueue/metrics.go b/e2e/vendor/k8s.io/component-base/metrics/prometheus/workqueue/metrics.go deleted file mode 100644 index 59fd1cf6d..000000000 --- a/e2e/vendor/k8s.io/component-base/metrics/prometheus/workqueue/metrics.go +++ /dev/null @@ -1,137 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package workqueue - -import ( - "k8s.io/client-go/util/workqueue" - k8smetrics "k8s.io/component-base/metrics" - "k8s.io/component-base/metrics/legacyregistry" -) - -// Package prometheus sets the workqueue DefaultMetricsFactory to produce -// prometheus metrics. To use this package, you just have to import it. - -// Metrics subsystem and keys used by the workqueue. -const ( - WorkQueueSubsystem = "workqueue" - DepthKey = "depth" - AddsKey = "adds_total" - QueueLatencyKey = "queue_duration_seconds" - WorkDurationKey = "work_duration_seconds" - UnfinishedWorkKey = "unfinished_work_seconds" - LongestRunningProcessorKey = "longest_running_processor_seconds" - RetriesKey = "retries_total" -) - -var ( - depth = k8smetrics.NewGaugeVec(&k8smetrics.GaugeOpts{ - Subsystem: WorkQueueSubsystem, - Name: DepthKey, - StabilityLevel: k8smetrics.ALPHA, - Help: "Current depth of workqueue", - }, []string{"name"}) - - adds = k8smetrics.NewCounterVec(&k8smetrics.CounterOpts{ - Subsystem: WorkQueueSubsystem, - Name: AddsKey, - StabilityLevel: k8smetrics.ALPHA, - Help: "Total number of adds handled by workqueue", - }, []string{"name"}) - - latency = k8smetrics.NewHistogramVec(&k8smetrics.HistogramOpts{ - Subsystem: WorkQueueSubsystem, - Name: QueueLatencyKey, - StabilityLevel: k8smetrics.ALPHA, - Help: "How long in seconds an item stays in workqueue before being requested.", - Buckets: k8smetrics.ExponentialBuckets(10e-9, 10, 10), - }, []string{"name"}) - - workDuration = k8smetrics.NewHistogramVec(&k8smetrics.HistogramOpts{ - Subsystem: WorkQueueSubsystem, - Name: WorkDurationKey, - StabilityLevel: k8smetrics.ALPHA, - Help: "How long in seconds processing an item from workqueue takes.", - Buckets: k8smetrics.ExponentialBuckets(10e-9, 10, 10), - }, []string{"name"}) - - unfinished = k8smetrics.NewGaugeVec(&k8smetrics.GaugeOpts{ - Subsystem: WorkQueueSubsystem, - Name: UnfinishedWorkKey, - StabilityLevel: k8smetrics.ALPHA, - Help: "How many seconds of work has done that " + - "is in progress and hasn't been observed by work_duration. Large " + - "values indicate stuck threads. One can deduce the number of stuck " + - "threads by observing the rate at which this increases.", - }, []string{"name"}) - - longestRunningProcessor = k8smetrics.NewGaugeVec(&k8smetrics.GaugeOpts{ - Subsystem: WorkQueueSubsystem, - Name: LongestRunningProcessorKey, - StabilityLevel: k8smetrics.ALPHA, - Help: "How many seconds has the longest running " + - "processor for workqueue been running.", - }, []string{"name"}) - - retries = k8smetrics.NewCounterVec(&k8smetrics.CounterOpts{ - Subsystem: WorkQueueSubsystem, - Name: RetriesKey, - StabilityLevel: k8smetrics.ALPHA, - Help: "Total number of retries handled by workqueue", - }, []string{"name"}) - - metrics = []k8smetrics.Registerable{ - depth, adds, latency, workDuration, unfinished, longestRunningProcessor, retries, - } -) - -type prometheusMetricsProvider struct { -} - -func init() { - for _, m := range metrics { - legacyregistry.MustRegister(m) - } - workqueue.SetProvider(prometheusMetricsProvider{}) -} - -func (prometheusMetricsProvider) NewDepthMetric(name string) workqueue.GaugeMetric { - return depth.WithLabelValues(name) -} - -func (prometheusMetricsProvider) NewAddsMetric(name string) workqueue.CounterMetric { - return adds.WithLabelValues(name) -} - -func (prometheusMetricsProvider) NewLatencyMetric(name string) workqueue.HistogramMetric { - return latency.WithLabelValues(name) -} - -func (prometheusMetricsProvider) NewWorkDurationMetric(name string) workqueue.HistogramMetric { - return workDuration.WithLabelValues(name) -} - -func (prometheusMetricsProvider) NewUnfinishedWorkSecondsMetric(name string) workqueue.SettableGaugeMetric { - return unfinished.WithLabelValues(name) -} - -func (prometheusMetricsProvider) NewLongestRunningProcessorSecondsMetric(name string) workqueue.SettableGaugeMetric { - return longestRunningProcessor.WithLabelValues(name) -} - -func (prometheusMetricsProvider) NewRetriesMetric(name string) workqueue.CounterMetric { - return retries.WithLabelValues(name) -} diff --git a/e2e/vendor/k8s.io/component-base/zpages/flagz/flagreader.go b/e2e/vendor/k8s.io/component-base/zpages/flagz/flagreader.go deleted file mode 100644 index 40fe09b45..000000000 --- a/e2e/vendor/k8s.io/component-base/zpages/flagz/flagreader.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright 2024 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flagz - -import ( - "github.com/spf13/pflag" - cliflag "k8s.io/component-base/cli/flag" -) - -type Reader interface { - GetFlagz() map[string]string -} - -// NamedFlagSetsReader implements Reader for cliflag.NamedFlagSets -type NamedFlagSetsReader struct { - FlagSets cliflag.NamedFlagSets -} - -func (n NamedFlagSetsReader) GetFlagz() map[string]string { - return convertNamedFlagSetToFlags(&n.FlagSets) -} - -func convertNamedFlagSetToFlags(flagSets *cliflag.NamedFlagSets) map[string]string { - flags := make(map[string]string) - for _, fs := range flagSets.FlagSets { - fs.VisitAll(func(flag *pflag.Flag) { - if flag.Value != nil { - value := flag.Value.String() - if set, ok := flag.Annotations["classified"]; ok && len(set) > 0 { - value = "CLASSIFIED" - } - flags[flag.Name] = value - } - }) - } - - return flags -} diff --git a/e2e/vendor/k8s.io/component-base/zpages/flagz/flagz.go b/e2e/vendor/k8s.io/component-base/zpages/flagz/flagz.go deleted file mode 100644 index 99a2f4482..000000000 --- a/e2e/vendor/k8s.io/component-base/zpages/flagz/flagz.go +++ /dev/null @@ -1,102 +0,0 @@ -/* -Copyright 2024 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flagz - -import ( - "bytes" - "fmt" - "io" - "math/rand" - "net/http" - "sort" - "sync" - - "k8s.io/component-base/zpages/httputil" - "k8s.io/klog/v2" -) - -const ( - DefaultFlagzPath = "/flagz" - - flagzHeaderFmt = ` -%s flags -Warning: This endpoint is not meant to be machine parseable, has no formatting compatibility guarantees and is for debugging purposes only. - -` -) - -var ( - delimiters = []string{":", ": ", "=", " "} -) - -type registry struct { - response bytes.Buffer - once sync.Once -} - -type mux interface { - Handle(path string, handler http.Handler) -} - -func Install(m mux, componentName string, flagReader Reader) { - var reg registry - reg.installHandler(m, componentName, flagReader) -} - -func (reg *registry) installHandler(m mux, componentName string, flagReader Reader) { - m.Handle(DefaultFlagzPath, reg.handleFlags(componentName, flagReader)) -} - -func (reg *registry) handleFlags(componentName string, flagReader Reader) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - if !httputil.AcceptableMediaType(r) { - http.Error(w, httputil.ErrUnsupportedMediaType.Error(), http.StatusNotAcceptable) - return - } - - reg.once.Do(func() { - fmt.Fprintf(®.response, flagzHeaderFmt, componentName) - if flagReader == nil { - klog.Error("received nil flagReader") - return - } - - randomIndex := rand.Intn(len(delimiters)) - separator := delimiters[randomIndex] - // Randomize the delimiter for printing to prevent scraping of the response. - printSortedFlags(®.response, flagReader.GetFlagz(), separator) - }) - w.Header().Set("Content-Type", "text/plain; charset=utf-8") - _, err := w.Write(reg.response.Bytes()) - if err != nil { - klog.Errorf("error writing response: %v", err) - http.Error(w, "error writing response", http.StatusInternalServerError) - } - } -} - -func printSortedFlags(w io.Writer, flags map[string]string, separator string) { - var sortedKeys []string - for key := range flags { - sortedKeys = append(sortedKeys, key) - } - - sort.Strings(sortedKeys) - for _, key := range sortedKeys { - fmt.Fprintf(w, "%s%s%s\n", key, separator, flags[key]) - } -} diff --git a/e2e/vendor/k8s.io/component-base/zpages/httputil/httputil.go b/e2e/vendor/k8s.io/component-base/zpages/httputil/httputil.go deleted file mode 100644 index da49474ba..000000000 --- a/e2e/vendor/k8s.io/component-base/zpages/httputil/httputil.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2024 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package httputil - -import ( - "fmt" - "net/http" - "strings" - - "github.com/munnerz/goautoneg" -) - -// ErrUnsupportedMediaType is the error returned when the request's -// Accept header does not contain "text/plain". -var ErrUnsupportedMediaType = fmt.Errorf("media type not acceptable, must be: text/plain") - -// AcceptableMediaType checks if the request's Accept header contains -// a supported media type with optional "charset=utf-8" parameter. -func AcceptableMediaType(r *http.Request) bool { - accepts := goautoneg.ParseAccept(r.Header.Get("Accept")) - for _, accept := range accepts { - if !mediaTypeMatches(accept) { - continue - } - if len(accept.Params) == 0 { - return true - } - if len(accept.Params) == 1 { - if charset, ok := accept.Params["charset"]; ok && strings.EqualFold(charset, "utf-8") { - return true - } - } - } - return false -} - -func mediaTypeMatches(a goautoneg.Accept) bool { - return (a.Type == "text" || a.Type == "*") && - (a.SubType == "plain" || a.SubType == "*") -} diff --git a/e2e/vendor/k8s.io/controller-manager/config/OWNERS b/e2e/vendor/k8s.io/controller-manager/config/OWNERS deleted file mode 100644 index 200d01f74..000000000 --- a/e2e/vendor/k8s.io/controller-manager/config/OWNERS +++ /dev/null @@ -1,14 +0,0 @@ -approvers: - - api-approvers - - deads2k - - luxas - - mtaufen - - sttts -reviewers: - - api-reviewers - - deads2k - - luxas - - mtaufen - - sttts -emeritus_approvers: - - stewart-yu diff --git a/e2e/vendor/k8s.io/controller-manager/config/register.go b/e2e/vendor/k8s.io/controller-manager/config/register.go deleted file mode 100644 index 1f1a4a3c6..000000000 --- a/e2e/vendor/k8s.io/controller-manager/config/register.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package config - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// GroupName is the "group" that is needed to uniquely identify the API -const GroupName = "controllermanager.config.k8s.io" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} - -var ( - // SchemeBuilder is the scheme builder with scheme init functions to run for this API package - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - // localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package, - // defaulting and conversion init funcs are registered as well. - localSchemeBuilder = &SchemeBuilder - // AddToScheme is a global function that registers this API group & version to a scheme - AddToScheme = localSchemeBuilder.AddToScheme -) - -// Adds the list of known types to the given scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &LeaderMigrationConfiguration{}, - ) - return nil -} diff --git a/e2e/vendor/k8s.io/controller-manager/config/types.go b/e2e/vendor/k8s.io/controller-manager/config/types.go deleted file mode 100644 index e8d2470ee..000000000 --- a/e2e/vendor/k8s.io/controller-manager/config/types.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package config should only include generic configurations -package config - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - componentbaseconfig "k8s.io/component-base/config" -) - -// GenericControllerManagerConfiguration holds configuration for a generic controller-manager -type GenericControllerManagerConfiguration struct { - // port is the port that the controller-manager's http service runs on. - Port int32 - // address is the IP address to serve on (set to 0.0.0.0 for all interfaces). - Address string - // minResyncPeriod is the resync period in reflectors; will be random between - // minResyncPeriod and 2*minResyncPeriod. - MinResyncPeriod metav1.Duration - // ClientConnection specifies the kubeconfig file and client connection - // settings for the proxy server to use when communicating with the apiserver. - ClientConnection componentbaseconfig.ClientConnectionConfiguration - // How long to wait between starting controller managers - ControllerStartInterval metav1.Duration - // leaderElection defines the configuration of leader election client. - LeaderElection componentbaseconfig.LeaderElectionConfiguration - // Controllers is the list of controllers to enable or disable - // '*' means "all enabled by default controllers" - // 'foo' means "enable 'foo'" - // '-foo' means "disable 'foo'" - // first item for a particular name wins - Controllers []string - // DebuggingConfiguration holds configuration for Debugging related features. - Debugging componentbaseconfig.DebuggingConfiguration - // LeaderMigrationEnabled indicates whether Leader Migration should be enabled for the controller manager. - LeaderMigrationEnabled bool - // LeaderMigration holds the configuration for Leader Migration. - LeaderMigration LeaderMigrationConfiguration -} - -// LeaderMigrationConfiguration provides versioned configuration for all migrating leader locks. -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type LeaderMigrationConfiguration struct { - metav1.TypeMeta - - // LeaderName is the name of the leader election resource that protects the migration - // E.g. 1-20-KCM-to-1-21-CCM - LeaderName string - - // ResourceLock indicates the resource object type that will be used to lock - // Should be "leases" or "endpoints" - ResourceLock string - - // ControllerLeaders contains a list of migrating leader lock configurations - ControllerLeaders []ControllerLeaderConfiguration -} - -// ControllerLeaderConfiguration provides the configuration for a migrating leader lock. -type ControllerLeaderConfiguration struct { - // Name is the name of the controller being migrated - // E.g. service-controller, route-controller, cloud-node-controller, etc - Name string - - // Component is the name of the component in which the controller should be running. - // E.g. kube-controller-manager, cloud-controller-manager, etc - // Or '*' meaning the controller can be run under any component that participates in the migration - Component string -} diff --git a/e2e/vendor/k8s.io/controller-manager/config/v1/conversion.go b/e2e/vendor/k8s.io/controller-manager/config/v1/conversion.go deleted file mode 100644 index 4ba5bd8a8..000000000 --- a/e2e/vendor/k8s.io/controller-manager/config/v1/conversion.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - "unsafe" - - "k8s.io/apimachinery/pkg/conversion" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/controller-manager/config" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -const ResourceLockLeases = "leases" - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*ControllerLeaderConfiguration)(nil), (*config.ControllerLeaderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_ControllerLeaderConfiguration_To_config_ControllerLeaderConfiguration(a.(*ControllerLeaderConfiguration), b.(*config.ControllerLeaderConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*config.ControllerLeaderConfiguration)(nil), (*ControllerLeaderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_config_ControllerLeaderConfiguration_To_v1_ControllerLeaderConfiguration(a.(*config.ControllerLeaderConfiguration), b.(*ControllerLeaderConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*LeaderMigrationConfiguration)(nil), (*config.LeaderMigrationConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_LeaderMigrationConfiguration_To_config_LeaderMigrationConfiguration(a.(*LeaderMigrationConfiguration), b.(*config.LeaderMigrationConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*config.LeaderMigrationConfiguration)(nil), (*LeaderMigrationConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_config_LeaderMigrationConfiguration_To_v1_LeaderMigrationConfiguration(a.(*config.LeaderMigrationConfiguration), b.(*LeaderMigrationConfiguration), scope) - }); err != nil { - return err - } - return nil -} - -func Convert_config_LeaderMigrationConfiguration_To_v1_LeaderMigrationConfiguration(in *config.LeaderMigrationConfiguration, out *LeaderMigrationConfiguration, s conversion.Scope) error { - out.LeaderName = in.LeaderName - out.ControllerLeaders = *(*[]ControllerLeaderConfiguration)(unsafe.Pointer(&in.ControllerLeaders)) - return nil -} - -func Convert_v1_LeaderMigrationConfiguration_To_config_LeaderMigrationConfiguration(in *LeaderMigrationConfiguration, out *config.LeaderMigrationConfiguration, s conversion.Scope) error { - out.LeaderName = in.LeaderName - out.ControllerLeaders = *(*[]config.ControllerLeaderConfiguration)(unsafe.Pointer(&in.ControllerLeaders)) - out.ResourceLock = ResourceLockLeases - return nil -} - -func Convert_v1_ControllerLeaderConfiguration_To_config_ControllerLeaderConfiguration(in *ControllerLeaderConfiguration, out *config.ControllerLeaderConfiguration, s conversion.Scope) error { - out.Name = in.Name - out.Component = in.Component - return nil -} - -func Convert_config_ControllerLeaderConfiguration_To_v1_ControllerLeaderConfiguration(in *config.ControllerLeaderConfiguration, out *ControllerLeaderConfiguration, s conversion.Scope) error { - out.Name = in.Name - out.Component = in.Component - return nil -} diff --git a/e2e/vendor/k8s.io/controller-manager/config/v1/doc.go b/e2e/vendor/k8s.io/controller-manager/config/v1/doc.go deleted file mode 100644 index 2062f49b6..000000000 --- a/e2e/vendor/k8s.io/controller-manager/config/v1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// +k8s:deepcopy-gen=package -// +groupName=controllermanager.config.k8s.io - -package v1 diff --git a/e2e/vendor/k8s.io/controller-manager/config/v1/types.go b/e2e/vendor/k8s.io/controller-manager/config/v1/types.go deleted file mode 100644 index e20278686..000000000 --- a/e2e/vendor/k8s.io/controller-manager/config/v1/types.go +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// LeaderMigrationConfiguration provides versioned configuration for all migrating leader locks. -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type LeaderMigrationConfiguration struct { - metav1.TypeMeta `json:",inline"` - - // LeaderName is the name of the leader election resource that protects the migration - // E.g. 1-20-KCM-to-1-21-CCM - LeaderName string `json:"leaderName"` - - // ControllerLeaders contains a list of migrating leader lock configurations - // +listType=atomic - ControllerLeaders []ControllerLeaderConfiguration `json:"controllerLeaders"` -} - -// ControllerLeaderConfiguration provides the configuration for a migrating leader lock. -type ControllerLeaderConfiguration struct { - // Name is the name of the controller being migrated - // E.g. service-controller, route-controller, cloud-node-controller, etc - Name string `json:"name"` - - // Component is the name of the component in which the controller should be running. - // E.g. kube-controller-manager, cloud-controller-manager, etc - // Or '*' meaning the controller can be run under any component that participates in the migration - Component string `json:"component"` -} diff --git a/e2e/vendor/k8s.io/controller-manager/config/v1/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/controller-manager/config/v1/zz_generated.deepcopy.go deleted file mode 100644 index d5b54b0b2..000000000 --- a/e2e/vendor/k8s.io/controller-manager/config/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,72 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ControllerLeaderConfiguration) DeepCopyInto(out *ControllerLeaderConfiguration) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControllerLeaderConfiguration. -func (in *ControllerLeaderConfiguration) DeepCopy() *ControllerLeaderConfiguration { - if in == nil { - return nil - } - out := new(ControllerLeaderConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LeaderMigrationConfiguration) DeepCopyInto(out *LeaderMigrationConfiguration) { - *out = *in - out.TypeMeta = in.TypeMeta - if in.ControllerLeaders != nil { - in, out := &in.ControllerLeaders, &out.ControllerLeaders - *out = make([]ControllerLeaderConfiguration, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaderMigrationConfiguration. -func (in *LeaderMigrationConfiguration) DeepCopy() *LeaderMigrationConfiguration { - if in == nil { - return nil - } - out := new(LeaderMigrationConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *LeaderMigrationConfiguration) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} diff --git a/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/conversion.go b/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/conversion.go deleted file mode 100644 index d006429e7..000000000 --- a/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/conversion.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/conversion" - cmconfig "k8s.io/controller-manager/config" -) - -// Important! The public back-and-forth conversion functions for the types in this generic -// package with ComponentConfig types need to be manually exposed like this in order for -// other packages that reference this package to be able to call these conversion functions -// in an autogenerated manner. -// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions -// in autogenerated code as well. - -// Convert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration is an autogenerated conversion function. -func Convert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(in *GenericControllerManagerConfiguration, out *cmconfig.GenericControllerManagerConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(in, out, s) -} - -// Convert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration is an autogenerated conversion function. -func Convert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(in *cmconfig.GenericControllerManagerConfiguration, out *GenericControllerManagerConfiguration, s conversion.Scope) error { - return autoConvert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(in, out, s) -} diff --git a/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/defaults.go b/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/defaults.go deleted file mode 100644 index 82a920c70..000000000 --- a/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/defaults.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "time" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1" -) - -func RecommendedDefaultGenericControllerManagerConfiguration(obj *GenericControllerManagerConfiguration) { - zero := metav1.Duration{} - if obj.Address == "" { - obj.Address = "0.0.0.0" - } - if obj.MinResyncPeriod == zero { - obj.MinResyncPeriod = metav1.Duration{Duration: 12 * time.Hour} - } - if obj.ControllerStartInterval == zero { - obj.ControllerStartInterval = metav1.Duration{Duration: 0 * time.Second} - } - if len(obj.Controllers) == 0 { - obj.Controllers = []string{"*"} - } - - if len(obj.LeaderElection.ResourceLock) == 0 { - // Use lease-based leader election to reduce cost. - // We migrated for EndpointsLease lock in 1.17 and starting in 1.20 we - // migrated to Lease lock. - obj.LeaderElection.ResourceLock = "leases" - } - - // Use the default ClientConnectionConfiguration and LeaderElectionConfiguration options - componentbaseconfigv1alpha1.RecommendedDefaultClientConnectionConfiguration(&obj.ClientConnection) - componentbaseconfigv1alpha1.RecommendedDefaultLeaderElectionConfiguration(&obj.LeaderElection) -} diff --git a/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/doc.go b/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/doc.go deleted file mode 100644 index 72d1f3cf6..000000000 --- a/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/doc.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// +k8s:deepcopy-gen=package -// +k8s:conversion-gen=k8s.io/controller-manager/config -// +k8s:conversion-gen=k8s.io/controller-manager/config/v1alpha1 -// +k8s:openapi-gen=true -// +groupName=controllermanager.config.k8s.io - -package v1alpha1 diff --git a/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/register.go b/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/register.go deleted file mode 100644 index 59603396d..000000000 --- a/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/register.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// GroupName is the "group" that is needed to uniquely identify the API -const GroupName = "controllermanager.config.k8s.io" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} - -var ( - // SchemeBuilder is the scheme builder with scheme init functions to run for this API package - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - // localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package, - // defaulting and conversion init funcs are registered as well. - localSchemeBuilder = &SchemeBuilder - // AddToScheme is a global function that registers this API group & version to a scheme - AddToScheme = localSchemeBuilder.AddToScheme -) - -// Adds the list of known types to the given scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &LeaderMigrationConfiguration{}, - ) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/types.go b/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/types.go deleted file mode 100644 index 9cd9eee9c..000000000 --- a/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/types.go +++ /dev/null @@ -1,81 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1" -) - -// GenericControllerManagerConfiguration holds configuration for a generic controller-manager. -type GenericControllerManagerConfiguration struct { - // port is the port that the controller-manager's http service runs on. - Port int32 - // address is the IP address to serve on (set to 0.0.0.0 for all interfaces). - Address string - // minResyncPeriod is the resync period in reflectors; will be random between - // minResyncPeriod and 2*minResyncPeriod. - MinResyncPeriod metav1.Duration - // ClientConnection specifies the kubeconfig file and client connection - // settings for the proxy server to use when communicating with the apiserver. - ClientConnection componentbaseconfigv1alpha1.ClientConnectionConfiguration - // How long to wait between starting controller managers - ControllerStartInterval metav1.Duration - // leaderElection defines the configuration of leader election client. - LeaderElection componentbaseconfigv1alpha1.LeaderElectionConfiguration - // Controllers is the list of controllers to enable or disable - // '*' means "all enabled by default controllers" - // 'foo' means "enable 'foo'" - // '-foo' means "disable 'foo'" - // first item for a particular name wins - Controllers []string - // DebuggingConfiguration holds configuration for Debugging related features. - Debugging componentbaseconfigv1alpha1.DebuggingConfiguration - // LeaderMigrationEnabled indicates whether Leader Migration should be enabled for the controller manager. - LeaderMigrationEnabled bool - // LeaderMigration holds the configuration for Leader Migration. - LeaderMigration LeaderMigrationConfiguration -} - -// LeaderMigrationConfiguration provides versioned configuration for all migrating leader locks. -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type LeaderMigrationConfiguration struct { - metav1.TypeMeta `json:",inline"` - - // LeaderName is the name of the leader election resource that protects the migration - // E.g. 1-20-KCM-to-1-21-CCM - LeaderName string `json:"leaderName"` - - // ResourceLock indicates the resource object type that will be used to lock - // Should be "leases" or "endpoints" - ResourceLock string `json:"resourceLock"` - - // ControllerLeaders contains a list of migrating leader lock configurations - ControllerLeaders []ControllerLeaderConfiguration `json:"controllerLeaders"` -} - -// ControllerLeaderConfiguration provides the configuration for a migrating leader lock. -type ControllerLeaderConfiguration struct { - // Name is the name of the controller being migrated - // E.g. service-controller, route-controller, cloud-node-controller, etc - Name string `json:"name"` - - // Component is the name of the component in which the controller should be running. - // E.g. kube-controller-manager, cloud-controller-manager, etc - // Or '*' meaning the controller can be run under any component that participates in the migration - Component string `json:"component"` -} diff --git a/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/zz_generated.conversion.go b/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/zz_generated.conversion.go deleted file mode 100644 index 40da2f91d..000000000 --- a/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/zz_generated.conversion.go +++ /dev/null @@ -1,161 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - unsafe "unsafe" - - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - configv1alpha1 "k8s.io/component-base/config/v1alpha1" - config "k8s.io/controller-manager/config" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*ControllerLeaderConfiguration)(nil), (*config.ControllerLeaderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ControllerLeaderConfiguration_To_config_ControllerLeaderConfiguration(a.(*ControllerLeaderConfiguration), b.(*config.ControllerLeaderConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*config.ControllerLeaderConfiguration)(nil), (*ControllerLeaderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_config_ControllerLeaderConfiguration_To_v1alpha1_ControllerLeaderConfiguration(a.(*config.ControllerLeaderConfiguration), b.(*ControllerLeaderConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*LeaderMigrationConfiguration)(nil), (*config.LeaderMigrationConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_LeaderMigrationConfiguration_To_config_LeaderMigrationConfiguration(a.(*LeaderMigrationConfiguration), b.(*config.LeaderMigrationConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*config.LeaderMigrationConfiguration)(nil), (*LeaderMigrationConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_config_LeaderMigrationConfiguration_To_v1alpha1_LeaderMigrationConfiguration(a.(*config.LeaderMigrationConfiguration), b.(*LeaderMigrationConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*config.GenericControllerManagerConfiguration)(nil), (*GenericControllerManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(a.(*config.GenericControllerManagerConfiguration), b.(*GenericControllerManagerConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*GenericControllerManagerConfiguration)(nil), (*config.GenericControllerManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(a.(*GenericControllerManagerConfiguration), b.(*config.GenericControllerManagerConfiguration), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha1_ControllerLeaderConfiguration_To_config_ControllerLeaderConfiguration(in *ControllerLeaderConfiguration, out *config.ControllerLeaderConfiguration, s conversion.Scope) error { - out.Name = in.Name - out.Component = in.Component - return nil -} - -// Convert_v1alpha1_ControllerLeaderConfiguration_To_config_ControllerLeaderConfiguration is an autogenerated conversion function. -func Convert_v1alpha1_ControllerLeaderConfiguration_To_config_ControllerLeaderConfiguration(in *ControllerLeaderConfiguration, out *config.ControllerLeaderConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha1_ControllerLeaderConfiguration_To_config_ControllerLeaderConfiguration(in, out, s) -} - -func autoConvert_config_ControllerLeaderConfiguration_To_v1alpha1_ControllerLeaderConfiguration(in *config.ControllerLeaderConfiguration, out *ControllerLeaderConfiguration, s conversion.Scope) error { - out.Name = in.Name - out.Component = in.Component - return nil -} - -// Convert_config_ControllerLeaderConfiguration_To_v1alpha1_ControllerLeaderConfiguration is an autogenerated conversion function. -func Convert_config_ControllerLeaderConfiguration_To_v1alpha1_ControllerLeaderConfiguration(in *config.ControllerLeaderConfiguration, out *ControllerLeaderConfiguration, s conversion.Scope) error { - return autoConvert_config_ControllerLeaderConfiguration_To_v1alpha1_ControllerLeaderConfiguration(in, out, s) -} - -func autoConvert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(in *GenericControllerManagerConfiguration, out *config.GenericControllerManagerConfiguration, s conversion.Scope) error { - out.Port = in.Port - out.Address = in.Address - out.MinResyncPeriod = in.MinResyncPeriod - if err := configv1alpha1.Convert_v1alpha1_ClientConnectionConfiguration_To_config_ClientConnectionConfiguration(&in.ClientConnection, &out.ClientConnection, s); err != nil { - return err - } - out.ControllerStartInterval = in.ControllerStartInterval - if err := configv1alpha1.Convert_v1alpha1_LeaderElectionConfiguration_To_config_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil { - return err - } - out.Controllers = *(*[]string)(unsafe.Pointer(&in.Controllers)) - if err := configv1alpha1.Convert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil { - return err - } - out.LeaderMigrationEnabled = in.LeaderMigrationEnabled - if err := Convert_v1alpha1_LeaderMigrationConfiguration_To_config_LeaderMigrationConfiguration(&in.LeaderMigration, &out.LeaderMigration, s); err != nil { - return err - } - return nil -} - -func autoConvert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(in *config.GenericControllerManagerConfiguration, out *GenericControllerManagerConfiguration, s conversion.Scope) error { - out.Port = in.Port - out.Address = in.Address - out.MinResyncPeriod = in.MinResyncPeriod - if err := configv1alpha1.Convert_config_ClientConnectionConfiguration_To_v1alpha1_ClientConnectionConfiguration(&in.ClientConnection, &out.ClientConnection, s); err != nil { - return err - } - out.ControllerStartInterval = in.ControllerStartInterval - if err := configv1alpha1.Convert_config_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil { - return err - } - out.Controllers = *(*[]string)(unsafe.Pointer(&in.Controllers)) - if err := configv1alpha1.Convert_config_DebuggingConfiguration_To_v1alpha1_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil { - return err - } - out.LeaderMigrationEnabled = in.LeaderMigrationEnabled - if err := Convert_config_LeaderMigrationConfiguration_To_v1alpha1_LeaderMigrationConfiguration(&in.LeaderMigration, &out.LeaderMigration, s); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha1_LeaderMigrationConfiguration_To_config_LeaderMigrationConfiguration(in *LeaderMigrationConfiguration, out *config.LeaderMigrationConfiguration, s conversion.Scope) error { - out.LeaderName = in.LeaderName - out.ResourceLock = in.ResourceLock - out.ControllerLeaders = *(*[]config.ControllerLeaderConfiguration)(unsafe.Pointer(&in.ControllerLeaders)) - return nil -} - -// Convert_v1alpha1_LeaderMigrationConfiguration_To_config_LeaderMigrationConfiguration is an autogenerated conversion function. -func Convert_v1alpha1_LeaderMigrationConfiguration_To_config_LeaderMigrationConfiguration(in *LeaderMigrationConfiguration, out *config.LeaderMigrationConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha1_LeaderMigrationConfiguration_To_config_LeaderMigrationConfiguration(in, out, s) -} - -func autoConvert_config_LeaderMigrationConfiguration_To_v1alpha1_LeaderMigrationConfiguration(in *config.LeaderMigrationConfiguration, out *LeaderMigrationConfiguration, s conversion.Scope) error { - out.LeaderName = in.LeaderName - out.ResourceLock = in.ResourceLock - out.ControllerLeaders = *(*[]ControllerLeaderConfiguration)(unsafe.Pointer(&in.ControllerLeaders)) - return nil -} - -// Convert_config_LeaderMigrationConfiguration_To_v1alpha1_LeaderMigrationConfiguration is an autogenerated conversion function. -func Convert_config_LeaderMigrationConfiguration_To_v1alpha1_LeaderMigrationConfiguration(in *config.LeaderMigrationConfiguration, out *LeaderMigrationConfiguration, s conversion.Scope) error { - return autoConvert_config_LeaderMigrationConfiguration_To_v1alpha1_LeaderMigrationConfiguration(in, out, s) -} diff --git a/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index 5d0eea247..000000000 --- a/e2e/vendor/k8s.io/controller-manager/config/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,99 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ControllerLeaderConfiguration) DeepCopyInto(out *ControllerLeaderConfiguration) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControllerLeaderConfiguration. -func (in *ControllerLeaderConfiguration) DeepCopy() *ControllerLeaderConfiguration { - if in == nil { - return nil - } - out := new(ControllerLeaderConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GenericControllerManagerConfiguration) DeepCopyInto(out *GenericControllerManagerConfiguration) { - *out = *in - out.MinResyncPeriod = in.MinResyncPeriod - out.ClientConnection = in.ClientConnection - out.ControllerStartInterval = in.ControllerStartInterval - in.LeaderElection.DeepCopyInto(&out.LeaderElection) - if in.Controllers != nil { - in, out := &in.Controllers, &out.Controllers - *out = make([]string, len(*in)) - copy(*out, *in) - } - in.Debugging.DeepCopyInto(&out.Debugging) - in.LeaderMigration.DeepCopyInto(&out.LeaderMigration) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericControllerManagerConfiguration. -func (in *GenericControllerManagerConfiguration) DeepCopy() *GenericControllerManagerConfiguration { - if in == nil { - return nil - } - out := new(GenericControllerManagerConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LeaderMigrationConfiguration) DeepCopyInto(out *LeaderMigrationConfiguration) { - *out = *in - out.TypeMeta = in.TypeMeta - if in.ControllerLeaders != nil { - in, out := &in.ControllerLeaders, &out.ControllerLeaders - *out = make([]ControllerLeaderConfiguration, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaderMigrationConfiguration. -func (in *LeaderMigrationConfiguration) DeepCopy() *LeaderMigrationConfiguration { - if in == nil { - return nil - } - out := new(LeaderMigrationConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *LeaderMigrationConfiguration) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} diff --git a/e2e/vendor/k8s.io/controller-manager/config/v1beta1/register.go b/e2e/vendor/k8s.io/controller-manager/config/v1beta1/register.go deleted file mode 100644 index c812dcd3b..000000000 --- a/e2e/vendor/k8s.io/controller-manager/config/v1beta1/register.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// GroupName is the "group" that is needed to uniquely identify the API -const GroupName = "controllermanager.config.k8s.io" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} - -var ( - // SchemeBuilder is the scheme builder with scheme init functions to run for this API package - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - // localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package, - // defaulting and conversion init funcs are registered as well. - localSchemeBuilder = &SchemeBuilder - // AddToScheme is a global function that registers this API group & version to a scheme - AddToScheme = localSchemeBuilder.AddToScheme -) - -// Adds the list of known types to the given scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &LeaderMigrationConfiguration{}, - ) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/e2e/vendor/k8s.io/controller-manager/config/v1beta1/types.go b/e2e/vendor/k8s.io/controller-manager/config/v1beta1/types.go deleted file mode 100644 index 91467c006..000000000 --- a/e2e/vendor/k8s.io/controller-manager/config/v1beta1/types.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// LeaderMigrationConfiguration provides versioned configuration for all migrating leader locks. -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type LeaderMigrationConfiguration struct { - metav1.TypeMeta `json:",inline"` - - // LeaderName is the name of the leader election resource that protects the migration - // E.g. 1-20-KCM-to-1-21-CCM - LeaderName string `json:"leaderName"` - - // ResourceLock indicates the resource object type that will be used to lock - // Should be "leases" or "endpoints" - ResourceLock string `json:"resourceLock"` - - // ControllerLeaders contains a list of migrating leader lock configurations - // +listType=atomic - ControllerLeaders []ControllerLeaderConfiguration `json:"controllerLeaders"` -} - -// ControllerLeaderConfiguration provides the configuration for a migrating leader lock. -type ControllerLeaderConfiguration struct { - // Name is the name of the controller being migrated - // E.g. service-controller, route-controller, cloud-node-controller, etc - Name string `json:"name"` - - // Component is the name of the component in which the controller should be running. - // E.g. kube-controller-manager, cloud-controller-manager, etc - // Or '*' meaning the controller can be run under any component that participates in the migration - Component string `json:"component"` -} diff --git a/e2e/vendor/k8s.io/controller-manager/config/v1beta1/zz_generated.conversion.go b/e2e/vendor/k8s.io/controller-manager/config/v1beta1/zz_generated.conversion.go deleted file mode 100644 index 37a633085..000000000 --- a/e2e/vendor/k8s.io/controller-manager/config/v1beta1/zz_generated.conversion.go +++ /dev/null @@ -1,106 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1beta1 - -import ( - unsafe "unsafe" - - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - config "k8s.io/controller-manager/config" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*ControllerLeaderConfiguration)(nil), (*config.ControllerLeaderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ControllerLeaderConfiguration_To_config_ControllerLeaderConfiguration(a.(*ControllerLeaderConfiguration), b.(*config.ControllerLeaderConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*config.ControllerLeaderConfiguration)(nil), (*ControllerLeaderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_config_ControllerLeaderConfiguration_To_v1beta1_ControllerLeaderConfiguration(a.(*config.ControllerLeaderConfiguration), b.(*ControllerLeaderConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*LeaderMigrationConfiguration)(nil), (*config.LeaderMigrationConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_LeaderMigrationConfiguration_To_config_LeaderMigrationConfiguration(a.(*LeaderMigrationConfiguration), b.(*config.LeaderMigrationConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*config.LeaderMigrationConfiguration)(nil), (*LeaderMigrationConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_config_LeaderMigrationConfiguration_To_v1beta1_LeaderMigrationConfiguration(a.(*config.LeaderMigrationConfiguration), b.(*LeaderMigrationConfiguration), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1beta1_ControllerLeaderConfiguration_To_config_ControllerLeaderConfiguration(in *ControllerLeaderConfiguration, out *config.ControllerLeaderConfiguration, s conversion.Scope) error { - out.Name = in.Name - out.Component = in.Component - return nil -} - -// Convert_v1beta1_ControllerLeaderConfiguration_To_config_ControllerLeaderConfiguration is an autogenerated conversion function. -func Convert_v1beta1_ControllerLeaderConfiguration_To_config_ControllerLeaderConfiguration(in *ControllerLeaderConfiguration, out *config.ControllerLeaderConfiguration, s conversion.Scope) error { - return autoConvert_v1beta1_ControllerLeaderConfiguration_To_config_ControllerLeaderConfiguration(in, out, s) -} - -func autoConvert_config_ControllerLeaderConfiguration_To_v1beta1_ControllerLeaderConfiguration(in *config.ControllerLeaderConfiguration, out *ControllerLeaderConfiguration, s conversion.Scope) error { - out.Name = in.Name - out.Component = in.Component - return nil -} - -// Convert_config_ControllerLeaderConfiguration_To_v1beta1_ControllerLeaderConfiguration is an autogenerated conversion function. -func Convert_config_ControllerLeaderConfiguration_To_v1beta1_ControllerLeaderConfiguration(in *config.ControllerLeaderConfiguration, out *ControllerLeaderConfiguration, s conversion.Scope) error { - return autoConvert_config_ControllerLeaderConfiguration_To_v1beta1_ControllerLeaderConfiguration(in, out, s) -} - -func autoConvert_v1beta1_LeaderMigrationConfiguration_To_config_LeaderMigrationConfiguration(in *LeaderMigrationConfiguration, out *config.LeaderMigrationConfiguration, s conversion.Scope) error { - out.LeaderName = in.LeaderName - out.ResourceLock = in.ResourceLock - out.ControllerLeaders = *(*[]config.ControllerLeaderConfiguration)(unsafe.Pointer(&in.ControllerLeaders)) - return nil -} - -// Convert_v1beta1_LeaderMigrationConfiguration_To_config_LeaderMigrationConfiguration is an autogenerated conversion function. -func Convert_v1beta1_LeaderMigrationConfiguration_To_config_LeaderMigrationConfiguration(in *LeaderMigrationConfiguration, out *config.LeaderMigrationConfiguration, s conversion.Scope) error { - return autoConvert_v1beta1_LeaderMigrationConfiguration_To_config_LeaderMigrationConfiguration(in, out, s) -} - -func autoConvert_config_LeaderMigrationConfiguration_To_v1beta1_LeaderMigrationConfiguration(in *config.LeaderMigrationConfiguration, out *LeaderMigrationConfiguration, s conversion.Scope) error { - out.LeaderName = in.LeaderName - out.ResourceLock = in.ResourceLock - out.ControllerLeaders = *(*[]ControllerLeaderConfiguration)(unsafe.Pointer(&in.ControllerLeaders)) - return nil -} - -// Convert_config_LeaderMigrationConfiguration_To_v1beta1_LeaderMigrationConfiguration is an autogenerated conversion function. -func Convert_config_LeaderMigrationConfiguration_To_v1beta1_LeaderMigrationConfiguration(in *config.LeaderMigrationConfiguration, out *LeaderMigrationConfiguration, s conversion.Scope) error { - return autoConvert_config_LeaderMigrationConfiguration_To_v1beta1_LeaderMigrationConfiguration(in, out, s) -} diff --git a/e2e/vendor/k8s.io/controller-manager/config/v1beta1/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/controller-manager/config/v1beta1/zz_generated.deepcopy.go deleted file mode 100644 index 8285edb9f..000000000 --- a/e2e/vendor/k8s.io/controller-manager/config/v1beta1/zz_generated.deepcopy.go +++ /dev/null @@ -1,72 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1beta1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ControllerLeaderConfiguration) DeepCopyInto(out *ControllerLeaderConfiguration) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControllerLeaderConfiguration. -func (in *ControllerLeaderConfiguration) DeepCopy() *ControllerLeaderConfiguration { - if in == nil { - return nil - } - out := new(ControllerLeaderConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LeaderMigrationConfiguration) DeepCopyInto(out *LeaderMigrationConfiguration) { - *out = *in - out.TypeMeta = in.TypeMeta - if in.ControllerLeaders != nil { - in, out := &in.ControllerLeaders, &out.ControllerLeaders - *out = make([]ControllerLeaderConfiguration, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaderMigrationConfiguration. -func (in *LeaderMigrationConfiguration) DeepCopy() *LeaderMigrationConfiguration { - if in == nil { - return nil - } - out := new(LeaderMigrationConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *LeaderMigrationConfiguration) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} diff --git a/e2e/vendor/k8s.io/controller-manager/config/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/controller-manager/config/zz_generated.deepcopy.go deleted file mode 100644 index 00cd42088..000000000 --- a/e2e/vendor/k8s.io/controller-manager/config/zz_generated.deepcopy.go +++ /dev/null @@ -1,99 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package config - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ControllerLeaderConfiguration) DeepCopyInto(out *ControllerLeaderConfiguration) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControllerLeaderConfiguration. -func (in *ControllerLeaderConfiguration) DeepCopy() *ControllerLeaderConfiguration { - if in == nil { - return nil - } - out := new(ControllerLeaderConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GenericControllerManagerConfiguration) DeepCopyInto(out *GenericControllerManagerConfiguration) { - *out = *in - out.MinResyncPeriod = in.MinResyncPeriod - out.ClientConnection = in.ClientConnection - out.ControllerStartInterval = in.ControllerStartInterval - out.LeaderElection = in.LeaderElection - if in.Controllers != nil { - in, out := &in.Controllers, &out.Controllers - *out = make([]string, len(*in)) - copy(*out, *in) - } - out.Debugging = in.Debugging - in.LeaderMigration.DeepCopyInto(&out.LeaderMigration) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericControllerManagerConfiguration. -func (in *GenericControllerManagerConfiguration) DeepCopy() *GenericControllerManagerConfiguration { - if in == nil { - return nil - } - out := new(GenericControllerManagerConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LeaderMigrationConfiguration) DeepCopyInto(out *LeaderMigrationConfiguration) { - *out = *in - out.TypeMeta = in.TypeMeta - if in.ControllerLeaders != nil { - in, out := &in.ControllerLeaders, &out.ControllerLeaders - *out = make([]ControllerLeaderConfiguration, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaderMigrationConfiguration. -func (in *LeaderMigrationConfiguration) DeepCopy() *LeaderMigrationConfiguration { - if in == nil { - return nil - } - out := new(LeaderMigrationConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *LeaderMigrationConfiguration) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} diff --git a/e2e/vendor/k8s.io/controller-manager/options/debugging.go b/e2e/vendor/k8s.io/controller-manager/options/debugging.go deleted file mode 100644 index 063186a50..000000000 --- a/e2e/vendor/k8s.io/controller-manager/options/debugging.go +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package options - -import ( - "github.com/spf13/pflag" - - componentbaseconfig "k8s.io/component-base/config" -) - -// DebuggingOptions holds the Debugging options. -type DebuggingOptions struct { - *componentbaseconfig.DebuggingConfiguration -} - -// RecommendedDebuggingOptions returns the currently recommended debugging options. These are subject to change -// between releases as we add options and decide which features should be exposed or not by default. -func RecommendedDebuggingOptions() *DebuggingOptions { - return &DebuggingOptions{ - DebuggingConfiguration: &componentbaseconfig.DebuggingConfiguration{ - EnableProfiling: true, // profile debugging is cheap to have exposed and standard on kube binaries - }, - } -} - -// AddFlags adds flags related to debugging for controller manager to the specified FlagSet. -func (o *DebuggingOptions) AddFlags(fs *pflag.FlagSet) { - if o == nil { - return - } - - fs.BoolVar(&o.EnableProfiling, "profiling", o.EnableProfiling, - "Enable profiling via web interface host:port/debug/pprof/") - fs.BoolVar(&o.EnableContentionProfiling, "contention-profiling", o.EnableContentionProfiling, - "Enable block profiling, if profiling is enabled") -} - -// ApplyTo fills up Debugging config with options. -func (o *DebuggingOptions) ApplyTo(cfg *componentbaseconfig.DebuggingConfiguration) error { - if o == nil { - return nil - } - - cfg.EnableProfiling = o.EnableProfiling - cfg.EnableContentionProfiling = o.EnableContentionProfiling - - return nil -} - -// Validate checks validation of DebuggingOptions. -func (o *DebuggingOptions) Validate() []error { - if o == nil { - return nil - } - - errs := []error{} - return errs -} diff --git a/e2e/vendor/k8s.io/controller-manager/options/generic.go b/e2e/vendor/k8s.io/controller-manager/options/generic.go deleted file mode 100644 index 35b7cc232..000000000 --- a/e2e/vendor/k8s.io/controller-manager/options/generic.go +++ /dev/null @@ -1,140 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package options - -import ( - "fmt" - "strings" - - "k8s.io/apimachinery/pkg/util/sets" - cliflag "k8s.io/component-base/cli/flag" - "k8s.io/component-base/config/options" - cmconfig "k8s.io/controller-manager/config" - migration "k8s.io/controller-manager/pkg/leadermigration/options" -) - -// GenericControllerManagerConfigurationOptions holds the options which are generic. -type GenericControllerManagerConfigurationOptions struct { - *cmconfig.GenericControllerManagerConfiguration - Debugging *DebuggingOptions - // LeaderMigration is the options for leader migration, a nil indicates default options should be applied. - LeaderMigration *migration.LeaderMigrationOptions -} - -// NewGenericControllerManagerConfigurationOptions returns generic configuration default values for both -// the kube-controller-manager and the cloud-contoller-manager. Any common changes should -// be made here. Any individual changes should be made in that controller. -func NewGenericControllerManagerConfigurationOptions(cfg *cmconfig.GenericControllerManagerConfiguration) *GenericControllerManagerConfigurationOptions { - o := &GenericControllerManagerConfigurationOptions{ - GenericControllerManagerConfiguration: cfg, - Debugging: RecommendedDebuggingOptions(), - LeaderMigration: &migration.LeaderMigrationOptions{}, - } - - return o -} - -// AddFlags adds flags related to generic for controller manager to the specified FlagSet. -func (o *GenericControllerManagerConfigurationOptions) AddFlags(fss *cliflag.NamedFlagSets, allControllers, disabledByDefaultControllers []string, controllerAliases map[string]string) { - if o == nil { - return - } - - o.Debugging.AddFlags(fss.FlagSet("debugging")) - o.LeaderMigration.AddFlags(fss.FlagSet("leader-migration")) - genericfs := fss.FlagSet("generic") - genericfs.DurationVar(&o.MinResyncPeriod.Duration, "min-resync-period", o.MinResyncPeriod.Duration, "The resync period in reflectors will be random between MinResyncPeriod and 2*MinResyncPeriod.") - genericfs.StringVar(&o.ClientConnection.ContentType, "kube-api-content-type", o.ClientConnection.ContentType, "Content type of requests sent to apiserver.") - genericfs.Float32Var(&o.ClientConnection.QPS, "kube-api-qps", o.ClientConnection.QPS, "QPS to use while talking with kubernetes apiserver.") - genericfs.Int32Var(&o.ClientConnection.Burst, "kube-api-burst", o.ClientConnection.Burst, "Burst to use while talking with kubernetes apiserver.") - genericfs.DurationVar(&o.ControllerStartInterval.Duration, "controller-start-interval", o.ControllerStartInterval.Duration, "Interval between starting controller managers.") - genericfs.StringSliceVar(&o.Controllers, "controllers", o.Controllers, fmt.Sprintf(""+ - "A list of controllers to enable. '*' enables all on-by-default controllers, 'foo' enables the controller "+ - "named 'foo', '-foo' disables the controller named 'foo'.\nAll controllers: %s\nDisabled-by-default controllers: %s", - strings.Join(allControllers, ", "), strings.Join(disabledByDefaultControllers, ", "))) - - options.BindLeaderElectionFlags(&o.LeaderElection, genericfs) -} - -// ApplyTo fills up generic config with options. -func (o *GenericControllerManagerConfigurationOptions) ApplyTo(cfg *cmconfig.GenericControllerManagerConfiguration, allControllers []string, disabledByDefaultControllers []string, controllerAliases map[string]string) error { - if o == nil { - return nil - } - - if err := o.Debugging.ApplyTo(&cfg.Debugging); err != nil { - return err - } - if err := o.LeaderMigration.ApplyTo(cfg); err != nil { - return err - } - cfg.Port = o.Port - cfg.Address = o.Address - cfg.MinResyncPeriod = o.MinResyncPeriod - cfg.ClientConnection = o.ClientConnection - cfg.ControllerStartInterval = o.ControllerStartInterval - cfg.LeaderElection = o.LeaderElection - - // copy controller names and replace aliases with canonical names - cfg.Controllers = make([]string, len(o.Controllers)) - for i, initialName := range o.Controllers { - initialNameWithoutPrefix := strings.TrimPrefix(initialName, "-") - controllerName := initialNameWithoutPrefix - if canonicalName, ok := controllerAliases[controllerName]; ok { - controllerName = canonicalName - } - if strings.HasPrefix(initialName, "-") { - controllerName = fmt.Sprintf("-%s", controllerName) - } - cfg.Controllers[i] = controllerName - } - - return nil -} - -// Validate checks validation of GenericOptions. -func (o *GenericControllerManagerConfigurationOptions) Validate(allControllers []string, disabledByDefaultControllers []string, controllerAliases map[string]string) []error { - if o == nil { - return nil - } - - errs := []error{} - errs = append(errs, o.Debugging.Validate()...) - - // TODO: This can be removed when ResourceLock is not available - // Lock the ResourceLock using leases - if o.LeaderElection.LeaderElect && o.LeaderElection.ResourceLock != "leases" { - errs = append(errs, fmt.Errorf(`resourceLock value must be "leases"`)) - } - - allControllersSet := sets.NewString(allControllers...) - for _, initialName := range o.Controllers { - if initialName == "*" { - continue - } - initialNameWithoutPrefix := strings.TrimPrefix(initialName, "-") - controllerName := initialNameWithoutPrefix - if canonicalName, ok := controllerAliases[controllerName]; ok { - controllerName = canonicalName - } - if !allControllersSet.Has(controllerName) { - errs = append(errs, fmt.Errorf("%q is not in the list of known controllers", initialNameWithoutPrefix)) - } - } - - return errs -} diff --git a/e2e/vendor/k8s.io/controller-manager/pkg/clientbuilder/client_builder.go b/e2e/vendor/k8s.io/controller-manager/pkg/clientbuilder/client_builder.go deleted file mode 100644 index 290847483..000000000 --- a/e2e/vendor/k8s.io/controller-manager/pkg/clientbuilder/client_builder.go +++ /dev/null @@ -1,102 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package clientbuilder - -import ( - "k8s.io/client-go/discovery" - clientset "k8s.io/client-go/kubernetes" - restclient "k8s.io/client-go/rest" - "k8s.io/klog/v2" -) - -// ControllerClientBuilder allows you to get clients and configs for controllers -// Please note a copy also exists in staging/src/k8s.io/cloud-provider/cloud.go -// TODO: Extract this into a separate controller utilities repo (issues/68947) -type ControllerClientBuilder interface { - Config(name string) (*restclient.Config, error) - ConfigOrDie(name string) *restclient.Config - Client(name string) (clientset.Interface, error) - ClientOrDie(name string) clientset.Interface - DiscoveryClient(name string) (discovery.DiscoveryInterface, error) - DiscoveryClientOrDie(name string) discovery.DiscoveryInterface -} - -// SimpleControllerClientBuilder returns a fixed client with different user agents -type SimpleControllerClientBuilder struct { - // ClientConfig is a skeleton config to clone and use as the basis for each controller client - ClientConfig *restclient.Config -} - -// Config returns a client config for a fixed client -func (b SimpleControllerClientBuilder) Config(name string) (*restclient.Config, error) { - clientConfig := *b.ClientConfig - return restclient.AddUserAgent(&clientConfig, name), nil -} - -// ConfigOrDie returns a client config if no error from previous config func. -// If it gets an error getting the client, it will log the error and kill the process it's running in. -func (b SimpleControllerClientBuilder) ConfigOrDie(name string) *restclient.Config { - clientConfig, err := b.Config(name) - if err != nil { - klog.Fatal(err) - } - return clientConfig -} - -// Client returns a clientset.Interface built from the ClientBuilder -func (b SimpleControllerClientBuilder) Client(name string) (clientset.Interface, error) { - clientConfig, err := b.Config(name) - if err != nil { - return nil, err - } - return clientset.NewForConfig(clientConfig) -} - -// ClientOrDie returns a clientset.interface built from the ClientBuilder with no error. -// If it gets an error getting the client, it will log the error and kill the process it's running in. -func (b SimpleControllerClientBuilder) ClientOrDie(name string) clientset.Interface { - client, err := b.Client(name) - if err != nil { - klog.Fatal(err) - } - return client -} - -// DiscoveryClient returns a discovery.DiscoveryInterface built from the ClientBuilder -// Discovery is special because it will artificially pump the burst quite high to handle the many discovery requests. -func (b SimpleControllerClientBuilder) DiscoveryClient(name string) (discovery.DiscoveryInterface, error) { - clientConfig, err := b.Config(name) - if err != nil { - return nil, err - } - // Discovery makes a lot of requests infrequently. This allows the burst to succeed and refill to happen - // in just a few seconds. - clientConfig.Burst = 200 - clientConfig.QPS = 20 - return clientset.NewForConfig(clientConfig) -} - -// DiscoveryClientOrDie returns a discovery.DiscoveryInterface built from the ClientBuilder with no error. -// Discovery is special because it will artificially pump the burst quite high to handle the many discovery requests. -// If it gets an error getting the client, it will log the error and kill the process it's running in. -func (b SimpleControllerClientBuilder) DiscoveryClientOrDie(name string) discovery.DiscoveryInterface { - client, err := b.DiscoveryClient(name) - if err != nil { - klog.Fatal(err) - } - return client -} diff --git a/e2e/vendor/k8s.io/controller-manager/pkg/clientbuilder/client_builder_dynamic.go b/e2e/vendor/k8s.io/controller-manager/pkg/clientbuilder/client_builder_dynamic.go deleted file mode 100644 index 514bb1b83..000000000 --- a/e2e/vendor/k8s.io/controller-manager/pkg/clientbuilder/client_builder_dynamic.go +++ /dev/null @@ -1,271 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package clientbuilder - -import ( - "context" - "fmt" - "net/http" - "sync" - "time" - - "golang.org/x/oauth2" - v1authenticationapi "k8s.io/api/authentication/v1" - v1 "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/wait" - apiserverserviceaccount "k8s.io/apiserver/pkg/authentication/serviceaccount" - "k8s.io/client-go/discovery" - clientset "k8s.io/client-go/kubernetes" - v1core "k8s.io/client-go/kubernetes/typed/core/v1" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/transport" - "k8s.io/klog/v2" - "k8s.io/utils/clock" - utilpointer "k8s.io/utils/pointer" -) - -var ( - // defaultExpirationSeconds defines the duration of a TokenRequest in seconds. - defaultExpirationSeconds = int64(3600) - // defaultLeewayPercent defines the percentage of expiration left before the client trigger a token rotation. - // range[0, 100] - defaultLeewayPercent = 20 -) - -type DynamicControllerClientBuilder struct { - // ClientConfig is a skeleton config to clone and use as the basis for each controller client - ClientConfig *restclient.Config - - // CoreClient is used to provision service accounts if needed and watch for their associated tokens - // to construct a controller client - CoreClient v1core.CoreV1Interface - - // Namespace is the namespace used to host the service accounts that will back the - // controllers. It must be highly privileged namespace which normal users cannot inspect. - Namespace string - - // roundTripperFuncMap is a cache stores the corresponding roundtripper func for each - // service account - roundTripperFuncMap map[string]func(http.RoundTripper) http.RoundTripper - - // expirationSeconds defines the token expiration seconds - expirationSeconds int64 - - // leewayPercent defines the percentage of expiration left before the client trigger a token rotation. - leewayPercent int - - mutex sync.Mutex - - clock clock.Clock -} - -// NewDynamicClientBuilder returns client builder which uses TokenRequest feature and refresh service account token periodically -func NewDynamicClientBuilder(clientConfig *restclient.Config, coreClient v1core.CoreV1Interface, ns string) ControllerClientBuilder { - builder := &DynamicControllerClientBuilder{ - ClientConfig: clientConfig, - CoreClient: coreClient, - Namespace: ns, - roundTripperFuncMap: map[string]func(http.RoundTripper) http.RoundTripper{}, - expirationSeconds: defaultExpirationSeconds, - leewayPercent: defaultLeewayPercent, - clock: clock.RealClock{}, - } - return builder -} - -// this function only for test purpose, don't call it -func NewTestDynamicClientBuilder(clientConfig *restclient.Config, coreClient v1core.CoreV1Interface, ns string, expirationSeconds int64, leewayPercent int) ControllerClientBuilder { - builder := &DynamicControllerClientBuilder{ - ClientConfig: clientConfig, - CoreClient: coreClient, - Namespace: ns, - roundTripperFuncMap: map[string]func(http.RoundTripper) http.RoundTripper{}, - expirationSeconds: expirationSeconds, - leewayPercent: leewayPercent, - clock: clock.RealClock{}, - } - return builder -} - -func (t *DynamicControllerClientBuilder) Config(saName string) (*restclient.Config, error) { - _, err := getOrCreateServiceAccount(t.CoreClient, t.Namespace, saName) - if err != nil { - return nil, err - } - - configCopy := constructClient(t.Namespace, saName, t.ClientConfig) - - t.mutex.Lock() - defer t.mutex.Unlock() - - rt, ok := t.roundTripperFuncMap[saName] - if ok { - configCopy.Wrap(rt) - } else { - cachedTokenSource := transport.NewCachedTokenSource(&tokenSourceImpl{ - namespace: t.Namespace, - serviceAccountName: saName, - coreClient: t.CoreClient, - expirationSeconds: t.expirationSeconds, - leewayPercent: t.leewayPercent, - }) - configCopy.Wrap(transport.ResettableTokenSourceWrapTransport(cachedTokenSource)) - t.roundTripperFuncMap[saName] = configCopy.WrapTransport - } - - return &configCopy, nil -} - -func (t *DynamicControllerClientBuilder) ConfigOrDie(name string) *restclient.Config { - clientConfig, err := t.Config(name) - if err != nil { - klog.Fatal(err) - } - return clientConfig -} - -func (t *DynamicControllerClientBuilder) Client(name string) (clientset.Interface, error) { - clientConfig, err := t.Config(name) - if err != nil { - return nil, err - } - return clientset.NewForConfig(clientConfig) -} - -func (t *DynamicControllerClientBuilder) ClientOrDie(name string) clientset.Interface { - client, err := t.Client(name) - if err != nil { - klog.Fatal(err) - } - return client -} - -func (t *DynamicControllerClientBuilder) DiscoveryClient(name string) (discovery.DiscoveryInterface, error) { - clientConfig, err := t.Config(name) - if err != nil { - return nil, err - } - // Discovery makes a lot of requests infrequently. This allows the burst to succeed and refill to happen - // in just a few seconds. - clientConfig.Burst = 200 - clientConfig.QPS = 20 - return clientset.NewForConfig(clientConfig) -} - -func (t *DynamicControllerClientBuilder) DiscoveryClientOrDie(name string) discovery.DiscoveryInterface { - client, err := t.DiscoveryClient(name) - if err != nil { - klog.Fatal(err) - } - return client -} - -type tokenSourceImpl struct { - namespace string - serviceAccountName string - coreClient v1core.CoreV1Interface - expirationSeconds int64 - leewayPercent int -} - -func (ts *tokenSourceImpl) Token() (*oauth2.Token, error) { - var retTokenRequest *v1authenticationapi.TokenRequest - - backoff := wait.Backoff{ - Duration: 500 * time.Millisecond, - Factor: 2, // double the timeout for every failure - Steps: 4, - } - if err := wait.ExponentialBackoff(backoff, func() (bool, error) { - if _, inErr := getOrCreateServiceAccount(ts.coreClient, ts.namespace, ts.serviceAccountName); inErr != nil { - klog.Warningf("get or create service account failed: %v", inErr) - return false, nil - } - - tr, inErr := ts.coreClient.ServiceAccounts(ts.namespace).CreateToken(context.TODO(), ts.serviceAccountName, &v1authenticationapi.TokenRequest{ - Spec: v1authenticationapi.TokenRequestSpec{ - ExpirationSeconds: utilpointer.Int64Ptr(ts.expirationSeconds), - }, - }, metav1.CreateOptions{}) - if inErr != nil { - klog.Warningf("get token failed: %v", inErr) - return false, nil - } - retTokenRequest = tr - return true, nil - }); err != nil { - return nil, fmt.Errorf("failed to get token for %s/%s: %v", ts.namespace, ts.serviceAccountName, err) - } - - if retTokenRequest.Spec.ExpirationSeconds == nil { - return nil, fmt.Errorf("nil pointer of expiration in token request") - } - - lifetime := retTokenRequest.Status.ExpirationTimestamp.Time.Sub(time.Now()) - if lifetime < time.Minute*10 { - // possible clock skew issue, pin to minimum token lifetime - lifetime = time.Minute * 10 - } - - leeway := time.Duration(int64(lifetime) * int64(ts.leewayPercent) / 100) - expiry := time.Now().Add(lifetime).Add(-1 * leeway) - - return &oauth2.Token{ - AccessToken: retTokenRequest.Status.Token, - TokenType: "Bearer", - Expiry: expiry, - }, nil -} - -func constructClient(saNamespace, saName string, config *restclient.Config) restclient.Config { - username := apiserverserviceaccount.MakeUsername(saNamespace, saName) - // make a shallow copy - // the caller already castrated the config during creation - // this allows for potential extensions in the future - // for example it preserve HTTP wrappers for custom behavior per request - ret := *config - restclient.AddUserAgent(&ret, username) - return ret -} - -func getOrCreateServiceAccount(coreClient v1core.CoreV1Interface, namespace, name string) (*v1.ServiceAccount, error) { - sa, err := coreClient.ServiceAccounts(namespace).Get(context.TODO(), name, metav1.GetOptions{}) - if err == nil { - return sa, nil - } - if !apierrors.IsNotFound(err) { - return nil, err - } - - // Create the namespace if we can't verify it exists. - // Tolerate errors, since we don't know whether this component has namespace creation permissions. - if _, err := coreClient.Namespaces().Get(context.TODO(), namespace, metav1.GetOptions{}); apierrors.IsNotFound(err) { - if _, err = coreClient.Namespaces().Create(context.TODO(), &v1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: namespace}}, metav1.CreateOptions{}); err != nil && !apierrors.IsAlreadyExists(err) { - klog.Warningf("create non-exist namespace %s failed:%v", namespace, err) - } - } - - // Create the service account - sa, err = coreClient.ServiceAccounts(namespace).Create(context.TODO(), &v1.ServiceAccount{ObjectMeta: metav1.ObjectMeta{Namespace: namespace, Name: name}}, metav1.CreateOptions{}) - if apierrors.IsAlreadyExists(err) { - // If we're racing to init and someone else already created it, re-fetch - return coreClient.ServiceAccounts(namespace).Get(context.TODO(), name, metav1.GetOptions{}) - } - return sa, err -} diff --git a/e2e/vendor/k8s.io/controller-manager/pkg/features/register/register.go b/e2e/vendor/k8s.io/controller-manager/pkg/features/register/register.go deleted file mode 100644 index 5672dac00..000000000 --- a/e2e/vendor/k8s.io/controller-manager/pkg/features/register/register.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package register - -import ( - "k8s.io/apimachinery/pkg/util/runtime" - utilfeature "k8s.io/apiserver/pkg/util/feature" - "k8s.io/controller-manager/pkg/features" -) - -func init() { - runtime.Must(features.SetupCurrentKubernetesSpecificFeatureGates(utilfeature.DefaultMutableFeatureGate)) -} diff --git a/e2e/vendor/k8s.io/controller-manager/pkg/leadermigration/config/config.go b/e2e/vendor/k8s.io/controller-manager/pkg/leadermigration/config/config.go deleted file mode 100644 index 3a5d139ea..000000000 --- a/e2e/vendor/k8s.io/controller-manager/pkg/leadermigration/config/config.go +++ /dev/null @@ -1,109 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package config - -import ( - "fmt" - "os" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/serializer" - util "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - internal "k8s.io/controller-manager/config" - v1 "k8s.io/controller-manager/config/v1" - "k8s.io/controller-manager/config/v1alpha1" - "k8s.io/controller-manager/config/v1beta1" -) - -// ResourceLockLeases is the resourceLock value for 'leases' API -const ResourceLockLeases = "leases" - -// ResourceLockEndpoints is the resourceLock value for 'endpoints' API -const ResourceLockEndpoints = "endpoints" - -var cfgScheme = runtime.NewScheme() - -func init() { - // internal - util.Must(internal.AddToScheme(cfgScheme)) - - // v1alpha1 - util.Must(v1alpha1.AddToScheme(cfgScheme)) - util.Must(cfgScheme.SetVersionPriority(v1alpha1.SchemeGroupVersion)) - - // v1beta1 - util.Must(v1beta1.AddToScheme(cfgScheme)) - util.Must(cfgScheme.SetVersionPriority(v1beta1.SchemeGroupVersion)) - - // v1 - util.Must(v1.AddToScheme(cfgScheme)) - util.Must(cfgScheme.SetVersionPriority(v1.SchemeGroupVersion)) -} - -// ReadLeaderMigrationConfiguration reads LeaderMigrationConfiguration from a YAML file at the given path. -// The parsed LeaderMigrationConfiguration may be invalid. -// It returns an error if the file did not exist. -func ReadLeaderMigrationConfiguration(configFilePath string) (*internal.LeaderMigrationConfiguration, error) { - data, err := os.ReadFile(configFilePath) - if err != nil { - return nil, fmt.Errorf("unable to read leader migration configuration from %q: %w", configFilePath, err) - } - config, gvk, err := serializer.NewCodecFactory(cfgScheme, serializer.EnableStrict).UniversalDecoder().Decode(data, nil, nil) - if err != nil { - return nil, err - } - internalConfig, ok := config.(*internal.LeaderMigrationConfiguration) - if !ok { - return nil, fmt.Errorf("unexpected config type: %v", gvk) - } - return internalConfig, nil -} - -// ValidateLeaderMigrationConfiguration validates the LeaderMigrationConfiguration against common errors. -// It checks required names and whether resourceLock is either 'leases' or 'endpoints'. -// It will return nil if it does not find anything wrong. -func ValidateLeaderMigrationConfiguration(config *internal.LeaderMigrationConfiguration) (allErrs field.ErrorList) { - if config.LeaderName == "" { - allErrs = append(allErrs, field.Required(field.NewPath("leaderName"), - "leaderName must be set for LeaderMigrationConfiguration")) - } - if config.ResourceLock != ResourceLockLeases && config.ResourceLock != ResourceLockEndpoints { - allErrs = append(allErrs, field.Invalid(field.NewPath("resourceLock"), config.ResourceLock, - "resource Lock must be one of 'leases' or 'endpoints'")) - } - // validate controllerLeaders - fldPath := field.NewPath("controllerLeaders") - for i, controllerLeader := range config.ControllerLeaders { - path := fldPath.Index(i) - allErrs = append(allErrs, validateControllerLeaderConfiguration(path, &controllerLeader)...) - } - return -} - -func validateControllerLeaderConfiguration(path *field.Path, config *internal.ControllerLeaderConfiguration) (allErrs field.ErrorList) { - if config == nil { - return - } - if config.Component == "" { - allErrs = append(allErrs, field.Required(path.Child("component"), "component must be set")) - } - if config.Name == "" { - allErrs = append(allErrs, field.Required(path.Child("name"), "name must be set")) - } - return -} diff --git a/e2e/vendor/k8s.io/controller-manager/pkg/leadermigration/config/default.go b/e2e/vendor/k8s.io/controller-manager/pkg/leadermigration/config/default.go deleted file mode 100644 index 995f48ac4..000000000 --- a/e2e/vendor/k8s.io/controller-manager/pkg/leadermigration/config/default.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package config - -import internal "k8s.io/controller-manager/config" - -// DefaultLeaderMigrationConfiguration returns the default LeaderMigrationConfiguration -// that is valid for this release of Kubernetes. -func DefaultLeaderMigrationConfiguration() *internal.LeaderMigrationConfiguration { - return &internal.LeaderMigrationConfiguration{ - LeaderName: "cloud-provider-extraction-migration", - ResourceLock: ResourceLockLeases, - ControllerLeaders: []internal.ControllerLeaderConfiguration{ - { - Name: "route-controller", - Component: "*", - }, { - Name: "service-controller", - Component: "*", - }, { - Name: "cloud-node-lifecycle-controller", - Component: "*", - }, - }, - } -} diff --git a/e2e/vendor/k8s.io/controller-manager/pkg/leadermigration/options/options.go b/e2e/vendor/k8s.io/controller-manager/pkg/leadermigration/options/options.go deleted file mode 100644 index abbd75e6f..000000000 --- a/e2e/vendor/k8s.io/controller-manager/pkg/leadermigration/options/options.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package options - -import ( - "fmt" - - "github.com/spf13/pflag" - "k8s.io/controller-manager/config" - migrationconfig "k8s.io/controller-manager/pkg/leadermigration/config" -) - -// LeaderMigrationOptions is the set of options for Leader Migration, -// which is given to the controller manager through flags -type LeaderMigrationOptions struct { - // Enabled indicates whether leader migration is enabled through the --enabled-leader-migration flag. - Enabled bool - - // ControllerMigrationConfig is the path to the file of LeaderMigrationConfiguration type. - // It can be set with --leader-migration-config flag - // If the path is "" (default vaule), the default vaule will be used. - ControllerMigrationConfig string -} - -// DefaultLeaderMigrationOptions returns a LeaderMigrationOptions with default values. -func DefaultLeaderMigrationOptions() *LeaderMigrationOptions { - return &LeaderMigrationOptions{ - Enabled: false, - ControllerMigrationConfig: "", - } -} - -// AddFlags adds all flags related to leader migration to given flag set. -func (o *LeaderMigrationOptions) AddFlags(fs *pflag.FlagSet) { - if o == nil { - return - } - fs.BoolVar(&o.Enabled, "enable-leader-migration", false, "Whether to enable controller leader migration.") - fs.StringVar(&o.ControllerMigrationConfig, "leader-migration-config", "", - "Path to the config file for controller leader migration, "+ - "or empty to use the value that reflects default configuration of the controller manager. "+ - "The config file should be of type LeaderMigrationConfiguration, group controllermanager.config.k8s.io, version v1alpha1.") -} - -// ApplyTo applies the options of leader migration to generic configuration. -func (o *LeaderMigrationOptions) ApplyTo(cfg *config.GenericControllerManagerConfiguration) error { - if o == nil { - // an nil LeaderMigrationOptions indicates that default options should be used - // in which case leader migration will be disabled - cfg.LeaderMigrationEnabled = false - return nil - } - cfg.LeaderMigrationEnabled = o.Enabled - if !cfg.LeaderMigrationEnabled { - return nil - } - if o.ControllerMigrationConfig == "" { - cfg.LeaderMigration = *migrationconfig.DefaultLeaderMigrationConfiguration() - return nil - } - leaderMigrationConfig, err := migrationconfig.ReadLeaderMigrationConfiguration(o.ControllerMigrationConfig) - if err != nil { - return err - } - errs := migrationconfig.ValidateLeaderMigrationConfiguration(leaderMigrationConfig) - if len(errs) != 0 { - return fmt.Errorf("failed to parse leader migration configuration: %v", errs) - } - cfg.LeaderMigration = *leaderMigrationConfig - return nil -} diff --git a/e2e/vendor/k8s.io/cri-api/pkg/apis/runtime/v1/api.pb.go b/e2e/vendor/k8s.io/cri-api/pkg/apis/runtime/v1/api.pb.go index 22c9c011c..e4f7ea856 100644 --- a/e2e/vendor/k8s.io/cri-api/pkg/apis/runtime/v1/api.pb.go +++ b/e2e/vendor/k8s.io/cri-api/pkg/apis/runtime/v1/api.pb.go @@ -21,6 +21,7 @@ package v1 import ( context "context" + encoding_binary "encoding/binary" fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" @@ -214,6 +215,223 @@ func (PodSandboxState) EnumDescriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{4} } +type Signal int32 + +const ( + Signal_RUNTIME_DEFAULT Signal = 0 + Signal_SIGABRT Signal = 1 + Signal_SIGALRM Signal = 2 + Signal_SIGBUS Signal = 3 + Signal_SIGCHLD Signal = 4 + Signal_SIGCLD Signal = 5 + Signal_SIGCONT Signal = 6 + Signal_SIGFPE Signal = 7 + Signal_SIGHUP Signal = 8 + Signal_SIGILL Signal = 9 + Signal_SIGINT Signal = 10 + Signal_SIGIO Signal = 11 + Signal_SIGIOT Signal = 12 + Signal_SIGKILL Signal = 13 + Signal_SIGPIPE Signal = 14 + Signal_SIGPOLL Signal = 15 + Signal_SIGPROF Signal = 16 + Signal_SIGPWR Signal = 17 + Signal_SIGQUIT Signal = 18 + Signal_SIGSEGV Signal = 19 + Signal_SIGSTKFLT Signal = 20 + Signal_SIGSTOP Signal = 21 + Signal_SIGSYS Signal = 22 + Signal_SIGTERM Signal = 23 + Signal_SIGTRAP Signal = 24 + Signal_SIGTSTP Signal = 25 + Signal_SIGTTIN Signal = 26 + Signal_SIGTTOU Signal = 27 + Signal_SIGURG Signal = 28 + Signal_SIGUSR1 Signal = 29 + Signal_SIGUSR2 Signal = 30 + Signal_SIGVTALRM Signal = 31 + Signal_SIGWINCH Signal = 32 + Signal_SIGXCPU Signal = 33 + Signal_SIGXFSZ Signal = 34 + Signal_SIGRTMIN Signal = 35 + Signal_SIGRTMINPLUS1 Signal = 36 + Signal_SIGRTMINPLUS2 Signal = 37 + Signal_SIGRTMINPLUS3 Signal = 38 + Signal_SIGRTMINPLUS4 Signal = 39 + Signal_SIGRTMINPLUS5 Signal = 40 + Signal_SIGRTMINPLUS6 Signal = 41 + Signal_SIGRTMINPLUS7 Signal = 42 + Signal_SIGRTMINPLUS8 Signal = 43 + Signal_SIGRTMINPLUS9 Signal = 44 + Signal_SIGRTMINPLUS10 Signal = 45 + Signal_SIGRTMINPLUS11 Signal = 46 + Signal_SIGRTMINPLUS12 Signal = 47 + Signal_SIGRTMINPLUS13 Signal = 48 + Signal_SIGRTMINPLUS14 Signal = 49 + Signal_SIGRTMINPLUS15 Signal = 50 + Signal_SIGRTMAXMINUS14 Signal = 51 + Signal_SIGRTMAXMINUS13 Signal = 52 + Signal_SIGRTMAXMINUS12 Signal = 53 + Signal_SIGRTMAXMINUS11 Signal = 54 + Signal_SIGRTMAXMINUS10 Signal = 55 + Signal_SIGRTMAXMINUS9 Signal = 56 + Signal_SIGRTMAXMINUS8 Signal = 57 + Signal_SIGRTMAXMINUS7 Signal = 58 + Signal_SIGRTMAXMINUS6 Signal = 59 + Signal_SIGRTMAXMINUS5 Signal = 60 + Signal_SIGRTMAXMINUS4 Signal = 61 + Signal_SIGRTMAXMINUS3 Signal = 62 + Signal_SIGRTMAXMINUS2 Signal = 63 + Signal_SIGRTMAXMINUS1 Signal = 64 + Signal_SIGRTMAX Signal = 65 +) + +var Signal_name = map[int32]string{ + 0: "RUNTIME_DEFAULT", + 1: "SIGABRT", + 2: "SIGALRM", + 3: "SIGBUS", + 4: "SIGCHLD", + 5: "SIGCLD", + 6: "SIGCONT", + 7: "SIGFPE", + 8: "SIGHUP", + 9: "SIGILL", + 10: "SIGINT", + 11: "SIGIO", + 12: "SIGIOT", + 13: "SIGKILL", + 14: "SIGPIPE", + 15: "SIGPOLL", + 16: "SIGPROF", + 17: "SIGPWR", + 18: "SIGQUIT", + 19: "SIGSEGV", + 20: "SIGSTKFLT", + 21: "SIGSTOP", + 22: "SIGSYS", + 23: "SIGTERM", + 24: "SIGTRAP", + 25: "SIGTSTP", + 26: "SIGTTIN", + 27: "SIGTTOU", + 28: "SIGURG", + 29: "SIGUSR1", + 30: "SIGUSR2", + 31: "SIGVTALRM", + 32: "SIGWINCH", + 33: "SIGXCPU", + 34: "SIGXFSZ", + 35: "SIGRTMIN", + 36: "SIGRTMINPLUS1", + 37: "SIGRTMINPLUS2", + 38: "SIGRTMINPLUS3", + 39: "SIGRTMINPLUS4", + 40: "SIGRTMINPLUS5", + 41: "SIGRTMINPLUS6", + 42: "SIGRTMINPLUS7", + 43: "SIGRTMINPLUS8", + 44: "SIGRTMINPLUS9", + 45: "SIGRTMINPLUS10", + 46: "SIGRTMINPLUS11", + 47: "SIGRTMINPLUS12", + 48: "SIGRTMINPLUS13", + 49: "SIGRTMINPLUS14", + 50: "SIGRTMINPLUS15", + 51: "SIGRTMAXMINUS14", + 52: "SIGRTMAXMINUS13", + 53: "SIGRTMAXMINUS12", + 54: "SIGRTMAXMINUS11", + 55: "SIGRTMAXMINUS10", + 56: "SIGRTMAXMINUS9", + 57: "SIGRTMAXMINUS8", + 58: "SIGRTMAXMINUS7", + 59: "SIGRTMAXMINUS6", + 60: "SIGRTMAXMINUS5", + 61: "SIGRTMAXMINUS4", + 62: "SIGRTMAXMINUS3", + 63: "SIGRTMAXMINUS2", + 64: "SIGRTMAXMINUS1", + 65: "SIGRTMAX", +} + +var Signal_value = map[string]int32{ + "RUNTIME_DEFAULT": 0, + "SIGABRT": 1, + "SIGALRM": 2, + "SIGBUS": 3, + "SIGCHLD": 4, + "SIGCLD": 5, + "SIGCONT": 6, + "SIGFPE": 7, + "SIGHUP": 8, + "SIGILL": 9, + "SIGINT": 10, + "SIGIO": 11, + "SIGIOT": 12, + "SIGKILL": 13, + "SIGPIPE": 14, + "SIGPOLL": 15, + "SIGPROF": 16, + "SIGPWR": 17, + "SIGQUIT": 18, + "SIGSEGV": 19, + "SIGSTKFLT": 20, + "SIGSTOP": 21, + "SIGSYS": 22, + "SIGTERM": 23, + "SIGTRAP": 24, + "SIGTSTP": 25, + "SIGTTIN": 26, + "SIGTTOU": 27, + "SIGURG": 28, + "SIGUSR1": 29, + "SIGUSR2": 30, + "SIGVTALRM": 31, + "SIGWINCH": 32, + "SIGXCPU": 33, + "SIGXFSZ": 34, + "SIGRTMIN": 35, + "SIGRTMINPLUS1": 36, + "SIGRTMINPLUS2": 37, + "SIGRTMINPLUS3": 38, + "SIGRTMINPLUS4": 39, + "SIGRTMINPLUS5": 40, + "SIGRTMINPLUS6": 41, + "SIGRTMINPLUS7": 42, + "SIGRTMINPLUS8": 43, + "SIGRTMINPLUS9": 44, + "SIGRTMINPLUS10": 45, + "SIGRTMINPLUS11": 46, + "SIGRTMINPLUS12": 47, + "SIGRTMINPLUS13": 48, + "SIGRTMINPLUS14": 49, + "SIGRTMINPLUS15": 50, + "SIGRTMAXMINUS14": 51, + "SIGRTMAXMINUS13": 52, + "SIGRTMAXMINUS12": 53, + "SIGRTMAXMINUS11": 54, + "SIGRTMAXMINUS10": 55, + "SIGRTMAXMINUS9": 56, + "SIGRTMAXMINUS8": 57, + "SIGRTMAXMINUS7": 58, + "SIGRTMAXMINUS6": 59, + "SIGRTMAXMINUS5": 60, + "SIGRTMAXMINUS4": 61, + "SIGRTMAXMINUS3": 62, + "SIGRTMAXMINUS2": 63, + "SIGRTMAXMINUS1": 64, + "SIGRTMAX": 65, +} + +func (x Signal) String() string { + return proto.EnumName(Signal_name, int32(x)) +} + +func (Signal) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{5} +} + type ContainerState int32 const ( @@ -242,7 +460,7 @@ func (x ContainerState) String() string { } func (ContainerState) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{5} + return fileDescriptor_00212fb1f9d3bf1c, []int{6} } type ContainerEventType int32 @@ -277,7 +495,7 @@ func (x ContainerEventType) String() string { } func (ContainerEventType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{6} + return fileDescriptor_00212fb1f9d3bf1c, []int{7} } type MetricType int32 @@ -302,7 +520,7 @@ func (x MetricType) String() string { } func (MetricType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{7} + return fileDescriptor_00212fb1f9d3bf1c, []int{8} } type CgroupDriver int32 @@ -327,7 +545,7 @@ func (x CgroupDriver) String() string { } func (CgroupDriver) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{8} + return fileDescriptor_00212fb1f9d3bf1c, []int{9} } // Available profile types. @@ -555,7 +773,16 @@ type PortMapping struct { Protocol Protocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=runtime.v1.Protocol" json:"protocol,omitempty"` // Port number within the container. Default: 0 (not specified). ContainerPort int32 `protobuf:"varint,2,opt,name=container_port,json=containerPort,proto3" json:"container_port,omitempty"` - // Port number on the host. Default: 0 (not specified). + // Port number on the host to map the container port to. + // + // - Valid host port range is 1-65535. + // - The value 0 has explicit semantic meaning: it indicates NO host port should be allocated. + // - The value 0 does NOT indicate dynamic port allocation. Future implementations + // of dynamic allocation will use different values/semantics. + // - Implementations MUST handle the case where this field is explicitly set to 0, + // This field SHOULD be omitted when no port is required. + // + // Default: If omitted, container port will not be exposed on the host. HostPort int32 `protobuf:"varint,3,opt,name=host_port,json=hostPort,proto3" json:"host_port,omitempty"` // Host IP. HostIp string `protobuf:"bytes,4,opt,name=host_ip,json=hostIp,proto3" json:"host_ip,omitempty"` @@ -654,15 +881,21 @@ type Mount struct { RecursiveReadOnly bool `protobuf:"varint,8,opt,name=recursive_read_only,json=recursiveReadOnly,proto3" json:"recursive_read_only,omitempty"` // Mount an image reference (image ID, with or without digest), which is a // special use case for image volume mounts. If this field is set, then - // host_path should be unset. All OCI mounts are per feature definition - // readonly. The kubelet does an PullImage RPC and evaluates the returned + // host_path should be unset. All image mounts are per feature definition + // readonly (noexec). The kubelet does an PullImage RPC and evaluates the returned // PullImageResponse.image_ref value, which is then set to the // ImageSpec.image field. Runtimes are expected to mount the image as // required. - // Introduced in the OCI Volume Source KEP: https://kep.k8s.io/4639 - Image *ImageSpec `protobuf:"bytes,9,opt,name=image,proto3" json:"image,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` + // Introduced in the Image Volume Source KEP: https://kep.k8s.io/4639 + Image *ImageSpec `protobuf:"bytes,9,opt,name=image,proto3" json:"image,omitempty"` + // Specific image sub path to be used from inside the image instead of its + // root, only necessary if the above image field is set. If the sub path is + // not empty and does not exist in the image, then runtimes should fail and + // return an error. + // Introduced in the Image Volume Source KEP beta graduation: https://kep.k8s.io/4639 + ImageSubPath string `protobuf:"bytes,10,opt,name=image_sub_path,json=imageSubPath,proto3" json:"image_sub_path,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Mount) Reset() { *m = Mount{} } @@ -760,6 +993,13 @@ func (m *Mount) GetImage() *ImageSpec { return nil } +func (m *Mount) GetImageSubPath() string { + if m != nil { + return m.ImageSubPath + } + return "" +} + // IDMapping describes host to container ID mappings for a pod sandbox. type IDMapping struct { // HostId is the id on the host. @@ -2992,9 +3232,11 @@ type LinuxPodSandboxStats struct { // Stats pertaining to processes in the pod sandbox. Process *ProcessUsage `protobuf:"bytes,4,opt,name=process,proto3" json:"process,omitempty"` // Stats of containers in the measured pod sandbox. - Containers []*ContainerStats `protobuf:"bytes,5,rep,name=containers,proto3" json:"containers,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` + Containers []*ContainerStats `protobuf:"bytes,5,rep,name=containers,proto3" json:"containers,omitempty"` + // IO usage gathered for the pod sandbox. + Io *IoUsage `protobuf:"bytes,6,opt,name=io,proto3" json:"io,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *LinuxPodSandboxStats) Reset() { *m = LinuxPodSandboxStats{} } @@ -3064,6 +3306,13 @@ func (m *LinuxPodSandboxStats) GetContainers() []*ContainerStats { return nil } +func (m *LinuxPodSandboxStats) GetIo() *IoUsage { + if m != nil { + return m.Io + } + return nil +} + // WindowsPodSandboxStats provides the resource usage statistics for a pod sandbox on windows type WindowsPodSandboxStats struct { // CPU usage gathered for the pod sandbox. @@ -4376,7 +4625,7 @@ func (m *LinuxContainerUser) GetSupplementalGroups() []int64 { // WindowsNamespaceOption provides options for Windows namespaces. type WindowsNamespaceOption struct { // Network namespace for this container/sandbox. - // Namespaces currently set by the kubelet: POD, NODE + // This is currently never set by the kubelet Network NamespaceMode `protobuf:"varint,1,opt,name=network,proto3,enum=runtime.v1.NamespaceMode" json:"network,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` @@ -5059,9 +5308,11 @@ type ContainerConfig struct { // Configuration specific to Windows containers. Windows *WindowsContainerConfig `protobuf:"bytes,16,opt,name=windows,proto3" json:"windows,omitempty"` // CDI devices for the container. - CDIDevices []*CDIDevice `protobuf:"bytes,17,rep,name=CDI_devices,json=CDIDevices,proto3" json:"CDI_devices,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` + CDIDevices []*CDIDevice `protobuf:"bytes,17,rep,name=CDI_devices,json=CDIDevices,proto3" json:"CDI_devices,omitempty"` + // The custom stop signal for the container + StopSignal Signal `protobuf:"varint,18,opt,name=stop_signal,json=stopSignal,proto3,enum=runtime.v1.Signal" json:"stop_signal,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ContainerConfig) Reset() { *m = ContainerConfig{} } @@ -5215,6 +5466,13 @@ func (m *ContainerConfig) GetCDIDevices() []*CDIDevice { return nil } +func (m *ContainerConfig) GetStopSignal() Signal { + if m != nil { + return m.StopSignal + } + return Signal_RUNTIME_DEFAULT +} + type CreateContainerRequest struct { // ID of the PodSandbox in which the container should be created. PodSandboxId string `protobuf:"bytes,1,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` @@ -6046,9 +6304,11 @@ type ContainerStatus struct { // to a unique image identifier on the node. ImageId string `protobuf:"bytes,17,opt,name=image_id,json=imageId,proto3" json:"image_id,omitempty"` // User identities initially attached to the container - User *ContainerUser `protobuf:"bytes,18,opt,name=user,proto3" json:"user,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` + User *ContainerUser `protobuf:"bytes,18,opt,name=user,proto3" json:"user,omitempty"` + // Returns the stop signal used by the container runtime to terminate the container + StopSignal Signal `protobuf:"varint,19,opt,name=stop_signal,json=stopSignal,proto3,enum=runtime.v1.Signal" json:"stop_signal,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ContainerStatus) Reset() { *m = ContainerStatus{} } @@ -6209,6 +6469,13 @@ func (m *ContainerStatus) GetUser() *ContainerUser { return nil } +func (m *ContainerStatus) GetStopSignal() Signal { + if m != nil { + return m.StopSignal + } + return Signal_RUNTIME_DEFAULT +} + type ContainerStatusResponse struct { // Status of the container. Status *ContainerStatus `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` @@ -8916,9 +9183,11 @@ type ContainerStats struct { // Usage of the writable layer. WritableLayer *FilesystemUsage `protobuf:"bytes,4,opt,name=writable_layer,json=writableLayer,proto3" json:"writable_layer,omitempty"` // Swap usage gathered from the container. - Swap *SwapUsage `protobuf:"bytes,5,opt,name=swap,proto3" json:"swap,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` + Swap *SwapUsage `protobuf:"bytes,5,opt,name=swap,proto3" json:"swap,omitempty"` + // IO usage gathered from the container. + Io *IoUsage `protobuf:"bytes,6,opt,name=io,proto3" json:"io,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ContainerStats) Reset() { *m = ContainerStats{} } @@ -8988,6 +9257,13 @@ func (m *ContainerStats) GetSwap() *SwapUsage { return nil } +func (m *ContainerStats) GetIo() *IoUsage { + if m != nil { + return m.Io + } + return nil +} + // WindowsContainerStats provides the resource usage statistics for a container specific for Windows type WindowsContainerStats struct { // Information of the container. @@ -9062,6 +9338,137 @@ func (m *WindowsContainerStats) GetWritableLayer() *WindowsFilesystemUsage { return nil } +// PSI statistics for an individual resource. +type PsiStats struct { + // PSI data for all tasks in the cgroup. + Full *PsiData `protobuf:"bytes,1,opt,name=Full,proto3" json:"Full,omitempty"` + // PSI data for some tasks in the cgroup. + Some *PsiData `protobuf:"bytes,2,opt,name=Some,proto3" json:"Some,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PsiStats) Reset() { *m = PsiStats{} } +func (*PsiStats) ProtoMessage() {} +func (*PsiStats) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{131} +} +func (m *PsiStats) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PsiStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PsiStats.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PsiStats) XXX_Merge(src proto.Message) { + xxx_messageInfo_PsiStats.Merge(m, src) +} +func (m *PsiStats) XXX_Size() int { + return m.Size() +} +func (m *PsiStats) XXX_DiscardUnknown() { + xxx_messageInfo_PsiStats.DiscardUnknown(m) +} + +var xxx_messageInfo_PsiStats proto.InternalMessageInfo + +func (m *PsiStats) GetFull() *PsiData { + if m != nil { + return m.Full + } + return nil +} + +func (m *PsiStats) GetSome() *PsiData { + if m != nil { + return m.Some + } + return nil +} + +// PSI data for an individual resource. +type PsiData struct { + // Total time duration for tasks in the cgroup have waited due to congestion. + // Unit: nanoseconds. + Total uint64 `protobuf:"varint,1,opt,name=Total,proto3" json:"Total,omitempty"` + // The average (in %) tasks have waited due to congestion over a 10 second window. + Avg10 float64 `protobuf:"fixed64,2,opt,name=Avg10,proto3" json:"Avg10,omitempty"` + // The average (in %) tasks have waited due to congestion over a 60 second window. + Avg60 float64 `protobuf:"fixed64,3,opt,name=Avg60,proto3" json:"Avg60,omitempty"` + // The average (in %) tasks have waited due to congestion over a 300 second window. + Avg300 float64 `protobuf:"fixed64,4,opt,name=Avg300,proto3" json:"Avg300,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PsiData) Reset() { *m = PsiData{} } +func (*PsiData) ProtoMessage() {} +func (*PsiData) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{132} +} +func (m *PsiData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PsiData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PsiData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PsiData) XXX_Merge(src proto.Message) { + xxx_messageInfo_PsiData.Merge(m, src) +} +func (m *PsiData) XXX_Size() int { + return m.Size() +} +func (m *PsiData) XXX_DiscardUnknown() { + xxx_messageInfo_PsiData.DiscardUnknown(m) +} + +var xxx_messageInfo_PsiData proto.InternalMessageInfo + +func (m *PsiData) GetTotal() uint64 { + if m != nil { + return m.Total + } + return 0 +} + +func (m *PsiData) GetAvg10() float64 { + if m != nil { + return m.Avg10 + } + return 0 +} + +func (m *PsiData) GetAvg60() float64 { + if m != nil { + return m.Avg60 + } + return 0 +} + +func (m *PsiData) GetAvg300() float64 { + if m != nil { + return m.Avg300 + } + return 0 +} + // CpuUsage provides the CPU usage information. type CpuUsage struct { // Timestamp in nanoseconds at which the information were collected. Must be > 0. @@ -9070,15 +9477,17 @@ type CpuUsage struct { UsageCoreNanoSeconds *UInt64Value `protobuf:"bytes,2,opt,name=usage_core_nano_seconds,json=usageCoreNanoSeconds,proto3" json:"usage_core_nano_seconds,omitempty"` // Total CPU usage (sum of all cores) averaged over the sample window. // The "core" unit can be interpreted as CPU core-nanoseconds per second. - UsageNanoCores *UInt64Value `protobuf:"bytes,3,opt,name=usage_nano_cores,json=usageNanoCores,proto3" json:"usage_nano_cores,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` + UsageNanoCores *UInt64Value `protobuf:"bytes,3,opt,name=usage_nano_cores,json=usageNanoCores,proto3" json:"usage_nano_cores,omitempty"` + // CPU PSI statistics. + Psi *PsiStats `protobuf:"bytes,4,opt,name=psi,proto3" json:"psi,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *CpuUsage) Reset() { *m = CpuUsage{} } func (*CpuUsage) ProtoMessage() {} func (*CpuUsage) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{131} + return fileDescriptor_00212fb1f9d3bf1c, []int{133} } func (m *CpuUsage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -9128,6 +9537,13 @@ func (m *CpuUsage) GetUsageNanoCores() *UInt64Value { return nil } +func (m *CpuUsage) GetPsi() *PsiStats { + if m != nil { + return m.Psi + } + return nil +} + // WindowsCpuUsage provides the CPU usage information specific to Windows type WindowsCpuUsage struct { // Timestamp in nanoseconds at which the information were collected. Must be > 0. @@ -9144,7 +9560,7 @@ type WindowsCpuUsage struct { func (m *WindowsCpuUsage) Reset() { *m = WindowsCpuUsage{} } func (*WindowsCpuUsage) ProtoMessage() {} func (*WindowsCpuUsage) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{132} + return fileDescriptor_00212fb1f9d3bf1c, []int{134} } func (m *WindowsCpuUsage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -9209,15 +9625,17 @@ type MemoryUsage struct { // Cumulative number of minor page faults. PageFaults *UInt64Value `protobuf:"bytes,6,opt,name=page_faults,json=pageFaults,proto3" json:"page_faults,omitempty"` // Cumulative number of major page faults. - MajorPageFaults *UInt64Value `protobuf:"bytes,7,opt,name=major_page_faults,json=majorPageFaults,proto3" json:"major_page_faults,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` + MajorPageFaults *UInt64Value `protobuf:"bytes,7,opt,name=major_page_faults,json=majorPageFaults,proto3" json:"major_page_faults,omitempty"` + // Memory PSI statistics. + Psi *PsiStats `protobuf:"bytes,8,opt,name=psi,proto3" json:"psi,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *MemoryUsage) Reset() { *m = MemoryUsage{} } func (*MemoryUsage) ProtoMessage() {} func (*MemoryUsage) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{133} + return fileDescriptor_00212fb1f9d3bf1c, []int{135} } func (m *MemoryUsage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -9295,6 +9713,68 @@ func (m *MemoryUsage) GetMajorPageFaults() *UInt64Value { return nil } +func (m *MemoryUsage) GetPsi() *PsiStats { + if m != nil { + return m.Psi + } + return nil +} + +type IoUsage struct { + // Timestamp in nanoseconds at which the information were collected. Must be > 0. + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // IO PSI statistics. + Psi *PsiStats `protobuf:"bytes,2,opt,name=psi,proto3" json:"psi,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *IoUsage) Reset() { *m = IoUsage{} } +func (*IoUsage) ProtoMessage() {} +func (*IoUsage) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{136} +} +func (m *IoUsage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IoUsage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IoUsage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *IoUsage) XXX_Merge(src proto.Message) { + xxx_messageInfo_IoUsage.Merge(m, src) +} +func (m *IoUsage) XXX_Size() int { + return m.Size() +} +func (m *IoUsage) XXX_DiscardUnknown() { + xxx_messageInfo_IoUsage.DiscardUnknown(m) +} + +var xxx_messageInfo_IoUsage proto.InternalMessageInfo + +func (m *IoUsage) GetTimestamp() int64 { + if m != nil { + return m.Timestamp + } + return 0 +} + +func (m *IoUsage) GetPsi() *PsiStats { + if m != nil { + return m.Psi + } + return nil +} + type SwapUsage struct { // Timestamp in nanoseconds at which the information were collected. Must be > 0. Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` @@ -9309,7 +9789,7 @@ type SwapUsage struct { func (m *SwapUsage) Reset() { *m = SwapUsage{} } func (*SwapUsage) ProtoMessage() {} func (*SwapUsage) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{134} + return fileDescriptor_00212fb1f9d3bf1c, []int{137} } func (m *SwapUsage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -9378,7 +9858,7 @@ type WindowsMemoryUsage struct { func (m *WindowsMemoryUsage) Reset() { *m = WindowsMemoryUsage{} } func (*WindowsMemoryUsage) ProtoMessage() {} func (*WindowsMemoryUsage) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{135} + return fileDescriptor_00212fb1f9d3bf1c, []int{138} } func (m *WindowsMemoryUsage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -9452,7 +9932,7 @@ type ReopenContainerLogRequest struct { func (m *ReopenContainerLogRequest) Reset() { *m = ReopenContainerLogRequest{} } func (*ReopenContainerLogRequest) ProtoMessage() {} func (*ReopenContainerLogRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{136} + return fileDescriptor_00212fb1f9d3bf1c, []int{139} } func (m *ReopenContainerLogRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -9496,7 +9976,7 @@ type ReopenContainerLogResponse struct { func (m *ReopenContainerLogResponse) Reset() { *m = ReopenContainerLogResponse{} } func (*ReopenContainerLogResponse) ProtoMessage() {} func (*ReopenContainerLogResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{137} + return fileDescriptor_00212fb1f9d3bf1c, []int{140} } func (m *ReopenContainerLogResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -9541,7 +10021,7 @@ type CheckpointContainerRequest struct { func (m *CheckpointContainerRequest) Reset() { *m = CheckpointContainerRequest{} } func (*CheckpointContainerRequest) ProtoMessage() {} func (*CheckpointContainerRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{138} + return fileDescriptor_00212fb1f9d3bf1c, []int{141} } func (m *CheckpointContainerRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -9599,7 +10079,7 @@ type CheckpointContainerResponse struct { func (m *CheckpointContainerResponse) Reset() { *m = CheckpointContainerResponse{} } func (*CheckpointContainerResponse) ProtoMessage() {} func (*CheckpointContainerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{139} + return fileDescriptor_00212fb1f9d3bf1c, []int{142} } func (m *CheckpointContainerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -9636,7 +10116,7 @@ type GetEventsRequest struct { func (m *GetEventsRequest) Reset() { *m = GetEventsRequest{} } func (*GetEventsRequest) ProtoMessage() {} func (*GetEventsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{140} + return fileDescriptor_00212fb1f9d3bf1c, []int{143} } func (m *GetEventsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -9683,7 +10163,7 @@ type ContainerEventResponse struct { func (m *ContainerEventResponse) Reset() { *m = ContainerEventResponse{} } func (*ContainerEventResponse) ProtoMessage() {} func (*ContainerEventResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{141} + return fileDescriptor_00212fb1f9d3bf1c, []int{144} } func (m *ContainerEventResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -9755,7 +10235,7 @@ type ListMetricDescriptorsRequest struct { func (m *ListMetricDescriptorsRequest) Reset() { *m = ListMetricDescriptorsRequest{} } func (*ListMetricDescriptorsRequest) ProtoMessage() {} func (*ListMetricDescriptorsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{142} + return fileDescriptor_00212fb1f9d3bf1c, []int{145} } func (m *ListMetricDescriptorsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -9793,7 +10273,7 @@ type ListMetricDescriptorsResponse struct { func (m *ListMetricDescriptorsResponse) Reset() { *m = ListMetricDescriptorsResponse{} } func (*ListMetricDescriptorsResponse) ProtoMessage() {} func (*ListMetricDescriptorsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{143} + return fileDescriptor_00212fb1f9d3bf1c, []int{146} } func (m *ListMetricDescriptorsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -9846,7 +10326,7 @@ type MetricDescriptor struct { func (m *MetricDescriptor) Reset() { *m = MetricDescriptor{} } func (*MetricDescriptor) ProtoMessage() {} func (*MetricDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{144} + return fileDescriptor_00212fb1f9d3bf1c, []int{147} } func (m *MetricDescriptor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -9904,7 +10384,7 @@ type ListPodSandboxMetricsRequest struct { func (m *ListPodSandboxMetricsRequest) Reset() { *m = ListPodSandboxMetricsRequest{} } func (*ListPodSandboxMetricsRequest) ProtoMessage() {} func (*ListPodSandboxMetricsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{145} + return fileDescriptor_00212fb1f9d3bf1c, []int{148} } func (m *ListPodSandboxMetricsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -9942,7 +10422,7 @@ type ListPodSandboxMetricsResponse struct { func (m *ListPodSandboxMetricsResponse) Reset() { *m = ListPodSandboxMetricsResponse{} } func (*ListPodSandboxMetricsResponse) ProtoMessage() {} func (*ListPodSandboxMetricsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{146} + return fileDescriptor_00212fb1f9d3bf1c, []int{149} } func (m *ListPodSandboxMetricsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -9989,7 +10469,7 @@ type PodSandboxMetrics struct { func (m *PodSandboxMetrics) Reset() { *m = PodSandboxMetrics{} } func (*PodSandboxMetrics) ProtoMessage() {} func (*PodSandboxMetrics) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{147} + return fileDescriptor_00212fb1f9d3bf1c, []int{150} } func (m *PodSandboxMetrics) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -10049,7 +10529,7 @@ type ContainerMetrics struct { func (m *ContainerMetrics) Reset() { *m = ContainerMetrics{} } func (*ContainerMetrics) ProtoMessage() {} func (*ContainerMetrics) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{148} + return fileDescriptor_00212fb1f9d3bf1c, []int{151} } func (m *ContainerMetrics) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -10112,7 +10592,7 @@ type Metric struct { func (m *Metric) Reset() { *m = Metric{} } func (*Metric) ProtoMessage() {} func (*Metric) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{149} + return fileDescriptor_00212fb1f9d3bf1c, []int{152} } func (m *Metric) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -10184,7 +10664,7 @@ type RuntimeConfigRequest struct { func (m *RuntimeConfigRequest) Reset() { *m = RuntimeConfigRequest{} } func (*RuntimeConfigRequest) ProtoMessage() {} func (*RuntimeConfigRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{150} + return fileDescriptor_00212fb1f9d3bf1c, []int{153} } func (m *RuntimeConfigRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -10225,7 +10705,7 @@ type RuntimeConfigResponse struct { func (m *RuntimeConfigResponse) Reset() { *m = RuntimeConfigResponse{} } func (*RuntimeConfigResponse) ProtoMessage() {} func (*RuntimeConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{151} + return fileDescriptor_00212fb1f9d3bf1c, []int{154} } func (m *RuntimeConfigResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -10277,7 +10757,7 @@ type LinuxRuntimeConfiguration struct { func (m *LinuxRuntimeConfiguration) Reset() { *m = LinuxRuntimeConfiguration{} } func (*LinuxRuntimeConfiguration) ProtoMessage() {} func (*LinuxRuntimeConfiguration) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{152} + return fileDescriptor_00212fb1f9d3bf1c, []int{155} } func (m *LinuxRuntimeConfiguration) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -10313,12 +10793,114 @@ func (m *LinuxRuntimeConfiguration) GetCgroupDriver() CgroupDriver { return CgroupDriver_SYSTEMD } +type UpdatePodSandboxResourcesRequest struct { + // ID of the PodSandbox to update. + PodSandboxId string `protobuf:"bytes,1,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` + // Optional overhead represents the overheads associated with this sandbox + Overhead *LinuxContainerResources `protobuf:"bytes,2,opt,name=overhead,proto3" json:"overhead,omitempty"` + // Optional resources represents the sum of container resources for this sandbox + Resources *LinuxContainerResources `protobuf:"bytes,3,opt,name=resources,proto3" json:"resources,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdatePodSandboxResourcesRequest) Reset() { *m = UpdatePodSandboxResourcesRequest{} } +func (*UpdatePodSandboxResourcesRequest) ProtoMessage() {} +func (*UpdatePodSandboxResourcesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{156} +} +func (m *UpdatePodSandboxResourcesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UpdatePodSandboxResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UpdatePodSandboxResourcesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UpdatePodSandboxResourcesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdatePodSandboxResourcesRequest.Merge(m, src) +} +func (m *UpdatePodSandboxResourcesRequest) XXX_Size() int { + return m.Size() +} +func (m *UpdatePodSandboxResourcesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_UpdatePodSandboxResourcesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdatePodSandboxResourcesRequest proto.InternalMessageInfo + +func (m *UpdatePodSandboxResourcesRequest) GetPodSandboxId() string { + if m != nil { + return m.PodSandboxId + } + return "" +} + +func (m *UpdatePodSandboxResourcesRequest) GetOverhead() *LinuxContainerResources { + if m != nil { + return m.Overhead + } + return nil +} + +func (m *UpdatePodSandboxResourcesRequest) GetResources() *LinuxContainerResources { + if m != nil { + return m.Resources + } + return nil +} + +type UpdatePodSandboxResourcesResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdatePodSandboxResourcesResponse) Reset() { *m = UpdatePodSandboxResourcesResponse{} } +func (*UpdatePodSandboxResourcesResponse) ProtoMessage() {} +func (*UpdatePodSandboxResourcesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{157} +} +func (m *UpdatePodSandboxResourcesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UpdatePodSandboxResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UpdatePodSandboxResourcesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UpdatePodSandboxResourcesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdatePodSandboxResourcesResponse.Merge(m, src) +} +func (m *UpdatePodSandboxResourcesResponse) XXX_Size() int { + return m.Size() +} +func (m *UpdatePodSandboxResourcesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_UpdatePodSandboxResourcesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdatePodSandboxResourcesResponse proto.InternalMessageInfo + func init() { proto.RegisterEnum("runtime.v1.Protocol", Protocol_name, Protocol_value) proto.RegisterEnum("runtime.v1.MountPropagation", MountPropagation_name, MountPropagation_value) proto.RegisterEnum("runtime.v1.NamespaceMode", NamespaceMode_name, NamespaceMode_value) proto.RegisterEnum("runtime.v1.SupplementalGroupsPolicy", SupplementalGroupsPolicy_name, SupplementalGroupsPolicy_value) proto.RegisterEnum("runtime.v1.PodSandboxState", PodSandboxState_name, PodSandboxState_value) + proto.RegisterEnum("runtime.v1.Signal", Signal_name, Signal_value) proto.RegisterEnum("runtime.v1.ContainerState", ContainerState_name, ContainerState_value) proto.RegisterEnum("runtime.v1.ContainerEventType", ContainerEventType_name, ContainerEventType_value) proto.RegisterEnum("runtime.v1.MetricType", MetricType_name, MetricType_value) @@ -10483,9 +11065,12 @@ func init() { proto.RegisterMapType((map[string]string)(nil), "runtime.v1.ContainerAttributes.LabelsEntry") proto.RegisterType((*ContainerStats)(nil), "runtime.v1.ContainerStats") proto.RegisterType((*WindowsContainerStats)(nil), "runtime.v1.WindowsContainerStats") + proto.RegisterType((*PsiStats)(nil), "runtime.v1.PsiStats") + proto.RegisterType((*PsiData)(nil), "runtime.v1.PsiData") proto.RegisterType((*CpuUsage)(nil), "runtime.v1.CpuUsage") proto.RegisterType((*WindowsCpuUsage)(nil), "runtime.v1.WindowsCpuUsage") proto.RegisterType((*MemoryUsage)(nil), "runtime.v1.MemoryUsage") + proto.RegisterType((*IoUsage)(nil), "runtime.v1.IoUsage") proto.RegisterType((*SwapUsage)(nil), "runtime.v1.SwapUsage") proto.RegisterType((*WindowsMemoryUsage)(nil), "runtime.v1.WindowsMemoryUsage") proto.RegisterType((*ReopenContainerLogRequest)(nil), "runtime.v1.ReopenContainerLogRequest") @@ -10505,461 +11090,505 @@ func init() { proto.RegisterType((*RuntimeConfigRequest)(nil), "runtime.v1.RuntimeConfigRequest") proto.RegisterType((*RuntimeConfigResponse)(nil), "runtime.v1.RuntimeConfigResponse") proto.RegisterType((*LinuxRuntimeConfiguration)(nil), "runtime.v1.LinuxRuntimeConfiguration") + proto.RegisterType((*UpdatePodSandboxResourcesRequest)(nil), "runtime.v1.UpdatePodSandboxResourcesRequest") + proto.RegisterType((*UpdatePodSandboxResourcesResponse)(nil), "runtime.v1.UpdatePodSandboxResourcesResponse") } func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 7180 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x7d, 0x5d, 0x6c, 0x1c, 0xc9, - 0x75, 0x2e, 0x7b, 0x66, 0x48, 0xce, 0x1c, 0x72, 0xc8, 0x61, 0x89, 0x22, 0xa9, 0x91, 0x44, 0x49, - 0xbd, 0x7f, 0x92, 0x76, 0xf5, 0xb3, 0x5a, 0xed, 0xae, 0xa4, 0xd5, 0xee, 0x6a, 0x44, 0x52, 0xd2, - 0xac, 0x45, 0x72, 0xdc, 0x43, 0xae, 0xbd, 0xeb, 0x0b, 0xf7, 0x6d, 0x4d, 0x17, 0x87, 0xbd, 0x9a, - 0xe9, 0x6e, 0x77, 0xf7, 0x48, 0xa2, 0x1f, 0x2e, 0xee, 0xd3, 0xc5, 0x8d, 0x9f, 0x0c, 0x24, 0x46, - 0x10, 0x23, 0x88, 0xe1, 0x00, 0xf9, 0x79, 0x4b, 0x62, 0x20, 0x8e, 0x83, 0x04, 0x08, 0x10, 0x24, - 0x86, 0x13, 0x20, 0x40, 0x1e, 0x12, 0xc0, 0x6f, 0xb1, 0x37, 0x01, 0x02, 0xe4, 0xd9, 0x0f, 0x79, - 0x8a, 0x83, 0xfa, 0xeb, 0xee, 0xea, 0x9f, 0x99, 0x21, 0x77, 0xb3, 0xbb, 0x7e, 0xe2, 0x74, 0xd5, - 0x39, 0xa7, 0xaa, 0x4e, 0x9d, 0x3a, 0x75, 0xaa, 0xea, 0xab, 0x22, 0x54, 0x0c, 0xd7, 0xba, 0xec, - 0x7a, 0x4e, 0xe0, 0x20, 0xf0, 0x06, 0x76, 0x60, 0xf5, 0xf1, 0xe5, 0x27, 0xaf, 0xd6, 0x2f, 0x75, - 0xad, 0x60, 0x7f, 0xf0, 0xe8, 0x72, 0xc7, 0xe9, 0x5f, 0xe9, 0x3a, 0x5d, 0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09, 0x16, 0x0d, 0xbc, 0x03, 0x02, 0xb4, 0x36, 0x44, 0xbe, 0xcc, 0x59, 0xf5, 0xe2, 0x9f, - 0xea, 0x69, 0x38, 0x99, 0x29, 0x9f, 0xb7, 0xde, 0x85, 0x5a, 0x94, 0xc1, 0xee, 0xc1, 0x86, 0x70, - 0x20, 0x25, 0x06, 0x07, 0x5a, 0x0a, 0x43, 0xf8, 0x82, 0x98, 0xb9, 0x68, 0x94, 0x1e, 0x2d, 0x01, - 0x8b, 0x79, 0x4b, 0xc0, 0x92, 0xb4, 0x04, 0x54, 0x37, 0x43, 0x1d, 0xf2, 0x85, 0xf8, 0x6d, 0xba, - 0x55, 0xc0, 0xca, 0x16, 0x4e, 0xed, 0x54, 0x76, 0xfb, 0x18, 0x91, 0x16, 0xa3, 0x57, 0x2f, 0x40, - 0x55, 0x76, 0x6f, 0x31, 0x8f, 0xa5, 0xc8, 0x1e, 0xeb, 0xff, 0xc0, 0x92, 0x26, 0x21, 0x00, 0xef, - 0x61, 0x23, 0x18, 0x78, 0xd8, 0x47, 0x6f, 0x41, 0x3d, 0xe3, 0xf1, 0x22, 0x9d, 0xaf, 0x0c, 0x99, - 0x98, 0xe5, 0xd4, 0x1b, 0x46, 0x9b, 0x6c, 0x5d, 0xf8, 0x12, 0xcc, 0x53, 0x84, 0x62, 0xec, 0x66, - 0x2f, 0xd3, 0x11, 0x7d, 0xfb, 0x66, 0x2b, 0xba, 0xc6, 0x6b, 0x86, 0xef, 0x6d, 0xf0, 0xf2, 0x33, - 0xcf, 0xd8, 0xde, 0x81, 0xf2, 0x1e, 0xaf, 0x17, 0x1f, 0x90, 0x6a, 0x86, 0x32, 0x12, 0x2d, 0xd0, - 0x42, 0x1e, 0x75, 0x1b, 0xe6, 0x39, 0x4d, 0xd8, 0xbc, 0xdb, 0x43, 0x41, 0x31, 0xac, 0x79, 0xb9, - 0x70, 0x17, 0xf5, 0x87, 0x05, 0x98, 0x4b, 0xf8, 0xf8, 0x57, 0x13,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xdf, 0x3c, 0xf5, 0x6e, 0x5f, 0xfd, 0xdc, 0x10, 0x8a, 0x50, - 0xee, 0x07, 0x30, 0x27, 0xbf, 0x5c, 0x8b, 0xce, 0xc9, 0xa7, 0x02, 0x19, 0x8f, 0xe2, 0xd6, 0xd5, - 0x61, 0x24, 0xa1, 0x68, 0x1d, 0x6a, 0xc9, 0x97, 0x6b, 0x91, 0x84, 0x51, 0xca, 0x79, 0x18, 0xb7, - 0xfe, 0xfc, 0x70, 0xa2, 0x78, 0x01, 0xa9, 0x07, 0x59, 0x9f, 0x1b, 0xfe, 0xc4, 0x65, 0x46, 0x01, - 0x79, 0xef, 0x60, 0x32, 0xe5, 0xc8, 0x13, 0x2d, 0x4a, 0xbc, 0x81, 0x9a, 0xf1, 0x5c, 0xa2, 0xac, - 0x9c, 0xec, 0xa7, 0xf2, 0xd4, 0x09, 0xf4, 0xbf, 0x60, 0x3e, 0x71, 0xe9, 0x01, 0x49, 0x8c, 0xd9, - 0x77, 0x39, 0xea, 0xcf, 0x0d, 0xa5, 0x91, 0x7b, 0x35, 0x7e, 0xb1, 0x21, 0xd9, 0xab, 0x19, 0x17, - 0x26, 0x92, 0xbd, 0x9a, 0x79, 0x2f, 0x82, 0x1a, 0xa2, 0x74, 0x89, 0x41, 0x36, 0xc4, 0xac, 0x4b, - 0x13, 0xf5, 0x73, 0x43, 0x28, 0xe2, 0x0a, 0x49, 0x5c, 0x63, 0x90, 0x15, 0x92, 0x7d, 0x41, 0xa2, - 0xfe, 0xdc, 0x50, 0x9a, 0x64, 0x4f, 0x46, 0x18, 0xe9, 0x74, 0x4f, 0xa6, 0x20, 0xfc, 0xe9, 0x9e, - 0x4c, 0x43, 0xac, 0x79, 0x4f, 0x26, 0x50, 0xcd, 0xea, 0x50, 0x9c, 0x64, 0x56, 0x4f, 0x66, 0x63, - 0x29, 0xd5, 0x09, 0xf4, 0x14, 0x56, 0xf2, 0x70, 0x6c, 0xe8, 0xe5, 0x43, 0xc0, 0xed, 0x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0xf3, 0x93, 0x9f, 0xaf, 0x2a, 0x3f, - 0xfd, 0xf9, 0xea, 0xc4, 0xff, 0xfd, 0x78, 0x55, 0xf9, 0xc9, 0xc7, 0xab, 0xca, 0x3f, 0x7e, 0xbc, - 0xaa, 0xfc, 0xec, 0xe3, 0x55, 0xe5, 0xdb, 0xff, 0xba, 0x3a, 0xf1, 0xa1, 0xfa, 0xf8, 0x86, 0x7f, - 0xd9, 0x72, 0xae, 0x74, 0x3c, 0xeb, 0x92, 0xe1, 0x5a, 0x57, 0xdc, 0xc7, 0xdd, 0x2b, 0x86, 0x6b, - 0xf9, 0x57, 0xb8, 0xdc, 0x2b, 0x4f, 0x5e, 0x7d, 0x34, 0x45, 0xff, 0x23, 0xdf, 0x6b, 0xff, 0x1d, - 0x00, 0x00, 0xff, 0xff, 0xc7, 0xd9, 0x11, 0x7e, 0x4b, 0x71, 0x00, 0x00, + // 7855 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x7d, 0x5b, 0x6c, 0x1b, 0xc9, + 0x96, 0x98, 0x9a, 0xa4, 0x24, 0xf2, 0x48, 0x94, 0x5a, 0x65, 0xd9, 0x96, 0xe9, 0x77, 0x7b, 0x66, + 0xfc, 0x98, 0xb1, 0x2d, 0xbf, 0x1f, 0xe3, 0x99, 0x31, 0x2d, 0xc9, 0x32, 0x67, 0xf4, 0xe0, 0x6d, + 0x52, 0x9e, 0xc7, 0x5d, 0x2c, 0xd3, 0x66, 0x97, 0xa4, 0xbe, 0x26, 0xbb, 0xfb, 0x76, 0x37, 0x6d, + 0xeb, 0x7e, 0x04, 0xf9, 0x0a, 0x92, 0xfd, 0xda, 0x8f, 0x5c, 0x04, 0x58, 0x2c, 0x12, 0x24, 0x40, + 0x1e, 0x1f, 0x01, 0x92, 0x2c, 0x90, 0xcd, 0x06, 0x08, 0x12, 0x20, 0xc8, 0x2e, 0x76, 0x83, 0x04,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xc3, + 0x1e, 0x2f, 0x51, 0x2c, 0xc8, 0x5e, 0x30, 0xa8, 0xf6, 0x09, 0x1c, 0x4f, 0x14, 0xcb, 0xd7, 0x83, + 0xef, 0xc1, 0x9c, 0xeb, 0x98, 0x1d, 0x9f, 0x81, 0x85, 0xbf, 0x5a, 0x21, 0xba, 0x23, 0x70, 0x1b, + 0x26, 0x21, 0x6f, 0x05, 0x8e, 0x9b, 0xae, 0xf6, 0x78, 0xe4, 0x4b, 0x70, 0x22, 0x49, 0xce, 0x8a, + 0xd7, 0x3e, 0x83, 0x93, 0x3a, 0xee, 0x3b, 0x6f, 0xf0, 0x51, 0x59, 0xd7, 0x60, 0x29, 0xcd, 0x80, + 0x33, 0xff, 0x1a, 0x4e, 0x46, 0xd0, 0x56, 0x60, 0x04, 0x03, 0xff, 0x50, 0xcc, 0xf9, 0x62, 0xf9, + 0x95, 0xe3, 0xb3, 0x8e, 0x2c, 0xeb, 0x22, 0xa9, 0x9d, 0x84, 0xc9, 0xa6, 0x63, 0x36, 0x9a, 0x68, + 0x0e, 0x0a, 0x96, 0xcb, 0x89, 0x0b, 0x96, 0xab, 0x75, 0xe3, 0x65, 0x6e, 0x31, 0xcf, 0x96, 0x15, + 0x9d, 0x44, 0x45, 0x0f, 0x61, 0xce, 0x30, 0x4d, 0x8b, 0x28, 0x92, 0xd1, 0xeb, 0x58, 0xae, 0x70, + 0xcc, 0x17, 0x12, 0x5d, 0xdf, 0x68, 0xea, 0xd5, 0x08, 0xb1, 0xe1, 0xfa, 0xda, 0x33, 0xa8, 0x44, + 0x8b, 0x80, 0x7b, 0xd1, 0xc2, 0xb7, 0x30, 0xda, 0x5f, 0x0c, 0x57, 0xc5, 0x5b, 0xa9, 0x49, 0x92, + 0x57, 0xf3, 0x1e, 0x40, 0x68, 0x54, 0x85, 0x0b, 0x7a, 0x3c, 0x93, 0xa5, 0x1e, 0x43, 0xd4, 0xfe, + 0x57, 0x29, 0x6e, 0x64, 0x63, 0x4d, 0x36, 0xc3, 0x26, 0x9b, 0x92, 0xd1, 0x2d, 0x1c, 0xd2, 0xe8, + 0xde, 0x82, 0x49, 0x3f, 0x30, 0x02, 0xcc, 0x7d, 0xfe, 0xd3, 0xd9, 0x84, 0xa4, 0x60, 0xac, 0x33, + 0x4c, 0x74, 0x16, 0xa0, 0xeb, 0x61, 0x23, 0xc0, 0x66, 0xc7, 0x60, 0xb3, 0x42, 0x51, 0xaf, 0x70, + 0x48, 0x3d, 0x20, 0x56, 0x44, 0xac, 0x52, 0x32, 0x26, 0xc2, 0x9c, 0x6e, 0x8c, 0xd6, 0x2b, 0xa1, + 0xf5, 0x9a, 0x1a, 0x69, 0xbd, 0x38, 0x29, 0xb7, 0x5e, 0x91, 0x25, 0x9e, 0x1e, 0x66, 0x89, 0x19, + 0xd1, 0x38, 0x96, 0xb8, 0x3c, 0xcc, 0x12, 0x73, 0x36, 0xc3, 0x2d, 0x71, 0x86, 0x21, 0xa9, 0x64, + 0x19, 0x92, 0x1f, 0xd2, 0x74, 0xfe, 0xbb, 0x02, 0x2c, 0xa5, 0xc7, 0x33, 0xb7, 0x63, 0x77, 0x61, + 0xca, 0xa7, 0x90, 0xe1, 0xf6, 0x93, 0x53, 0x71, 0x5c, 0xf4, 0x0c, 0x4a, 0x96, 0xbd, 0xeb, 0xf0, + 0x81, 0x77, 0x63, 0x28, 0x0d, 0x2f, 0xe9, 0x46, 0xc3, 0xde, 0x75, 0x98, 0x04, 0x29, 0x2d, 0xda, + 0x80, 0x63, 0xe1, 0xea, 0xdd, 0xef, 0x30, 0xc6, 0x58, 0xf8, 0x79, 0x92, 0x96, 0x86, 0x5e, 0x15, + 0xe7, 0x88, 0x22, 0xba, 0x16, 0x27, 0x23, 0x3e, 0x0e, 0x41, 0xf7, 0x03, 0xa3, 0xef, 0x0a, 0x8d, + 0x0d, 0x01, 0xb5, 0x07, 0x50, 0x09, 0x8b, 0x3f, 0x94, 0xec, 0x1a, 0xb0, 0x98, 0x18, 0x23, 0x6c, + 0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 0x78, 0xb3, 0xfe, 0x52, 0x81, 0xe3, 0x99, 0x58, 0x99, 0x7b, 0xb0, 0xb7, 0xa1, + 0xec, 0xbd, 0xeb, 0xbc, 0x3a, 0x08, 0xb0, 0x9f, 0x35, 0xfa, 0x77, 0x62, 0x87, 0x39, 0xd3, 0xde, + 0xbb, 0x67, 0x04, 0x0f, 0xdd, 0x85, 0x8a, 0xf7, 0xae, 0x83, 0x3d, 0xcf, 0xf1, 0x84, 0xc1, 0xca, + 0x25, 0x2a, 0x7b, 0xef, 0xd6, 0x28, 0x22, 0x29, 0x29, 0x10, 0x25, 0x95, 0x46, 0x94, 0x14, 0x44, + 0x25, 0x05, 0x61, 0x49, 0x93, 0x23, 0x4a, 0x0a, 0x78, 0x49, 0xda, 0x3f, 0x2f, 0xc0, 0x99, 0x61, + 0xe2, 0xfa, 0xce, 0x04, 0xb1, 0x06, 0xc8, 0x7b, 0xd7, 0x71, 0x8d, 0xee, 0x6b, 0x1c, 0xf8, 0x1d, + 0xd3, 0x73, 0x5c, 0x17, 0x9b, 0xa3, 0x24, 0xa2, 0x7a, 0xef, 0x9a, 0x8c, 0x62, 0x95, 0x11, 0x1c, + 0x49, 0x32, 0x6b, 0x80, 0x82, 0x74, 0xd1, 0x23, 0x44, 0xa4, 0x06, 0x89, 0xa2, 0xb5, 0x9f, 0xc1, + 0x6c, 0xdc, 0x42, 0x8c, 0xd0, 0xfd, 0x27, 0x50, 0xe5, 0x16, 0xa4, 0xd3, 0x75, 0x06, 0x76, 0x30, + 0x4a, 0x50, 0xb3, 0x1c, 0x7b, 0x85, 0x20, 0x6b, 0x3f, 0x0f, 0x87, 0xdb, 0xf7, 0x56, 0xe4, 0xdf, + 0x2e, 0x40, 0x25, 0x3c, 0xec, 0x27, 0xee, 0x00, 0x0b, 0x09, 0x60, 0xfd, 0xce, 0xcf, 0xfe, 0x5f, + 0xc8, 0xae, 0x0d, 0x73, 0x66, 0x3f, 0xc8, 0x0c, 0x17, 0x18, 0xb1, 0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0x8b, 0xcc, 0xa8, + 0xaa, 0xf6, 0xbb, 0xd3, 0x30, 0x9f, 0x1c, 0x00, 0x8f, 0x52, 0xc1, 0x6b, 0x67, 0x33, 0x37, 0x3e, + 0x33, 0x76, 0xfc, 0xc3, 0xc8, 0xf7, 0xc2, 0x18, 0x91, 0xef, 0x4b, 0x30, 0xdd, 0x75, 0xfa, 0x7d, + 0xc3, 0x36, 0xc5, 0xa5, 0x0a, 0x9e, 0x24, 0x35, 0x35, 0xbc, 0x3d, 0xb6, 0xd7, 0x5f, 0xd1, 0xe9, + 0x37, 0xd1, 0x4f, 0x62, 0xa9, 0x2d, 0x9b, 0x86, 0xbf, 0x51, 0x15, 0xaa, 0xe8, 0xc0, 0x41, 0xab, + 0x96, 0x87, 0xae, 0x40, 0x09, 0xdb, 0x6f, 0x84, 0xca, 0x48, 0x7b, 0xce, 0x62, 0xfd, 0xa9, 0x53, + 0x0c, 0x74, 0x15, 0xa6, 0xfa, 0x44, 0xe7, 0x45, 0x88, 0xc4, 0x42, 0xea, 0xf2, 0x81, 0xce, 0x11, + 0xd0, 0x47, 0x30, 0x6d, 0x52, 0xe9, 0x89, 0x05, 0x17, 0x92, 0x02, 0xe9, 0x68, 0x96, 0x2e, 0x50, + 0xd0, 0x67, 0xe1, 0x81, 0x47, 0x25, 0x7d, 0x12, 0x99, 0x10, 0x73, 0xe6, 0x59, 0xc7, 0x96, 0xbc, + 0x21, 0x00, 0xe9, 0x63, 0x93, 0x24, 0x97, 0xe1, 0xdb, 0x02, 0xa7, 0xa0, 0xdc, 0x73, 0xf6, 0x98, + 0xf6, 0xcc, 0xb0, 0x1b, 0x39, 0x3d, 0x67, 0x8f, 0x2a, 0xcf, 0x22, 0x4c, 0xfa, 0x81, 0x69, 0xd9, + 0xd4, 0x6f, 0x2d, 0xeb, 0x2c, 0x41, 0x2c, 0x08, 0xfd, 0xe8, 0x38, 0x76, 0x17, 0x2f, 0x55, 0x69, + 0x56, 0x85, 0x42, 0xb6, 0xed,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0x31, 0xf7, 0x85, 0x26, 0x23, 0x7e, 0x6a, 0xba, 0x03, 0x27, 0x92, 0x31, 0x82, 0x87, 0x32, + 0x7f, 0x39, 0xc1, 0xca, 0xbf, 0x8c, 0x7b, 0x90, 0x39, 0x91, 0xb9, 0x8f, 0x52, 0x41, 0x24, 0x63, + 0x2b, 0xef, 0xb2, 0x1c, 0x6f, 0x76, 0x68, 0x95, 0x4b, 0x85, 0x9b, 0x51, 0x0f, 0xc7, 0xf0, 0x78, + 0x36, 0x5b, 0x89, 0x54, 0x38, 0xa4, 0x4e, 0x97, 0x41, 0x64, 0x99, 0xe0, 0xef, 0xb3, 0xfc, 0x29, + 0xb6, 0x0c, 0x12, 0xa0, 0x3a, 0xdd, 0x71, 0xc6, 0xef, 0xac, 0xa0, 0xd3, 0x75, 0x4c, 0x4c, 0x15, + 0x7a, 0x52, 0x2f, 0x13, 0xc0, 0x8a, 0x63, 0xe2, 0x68, 0xa8, 0x95, 0x0f, 0x3b, 0xd4, 0x2a, 0x89, + 0xa1, 0x76, 0x02, 0xa6, 0x3c, 0x6c, 0xf8, 0x8e, 0xcd, 0x55, 0x92, 0xa7, 0x48, 0x47, 0xf4, 0xb1, + 0xef, 0x93, 0x32, 0xb8, 0x43, 0xc7, 0x93, 0x31, 0xe7, 0x73, 0x76, 0x88, 0xf3, 0x39, 0x24, 0xee, + 0x37, 0xe1, 0x7c, 0x56, 0x87, 0x38, 0x9f, 0x63, 0x85, 0xfd, 0x46, 0x6e, 0xf6, 0xdc, 0x28, 0x37, + 0x3b, 0xee, 0xa7, 0xce, 0xcb, 0x7e, 0xea, 0x93, 0xf8, 0x72, 0x5c, 0x4d, 0x07, 0x38, 0x0c, 0x5f, + 0x87, 0xc7, 0xc7, 0xf6, 0x82, 0x34, 0xb6, 0xd1, 0x75, 0xbe, 0xed, 0x8f, 0xd2, 0x1b, 0xc6, 0xd2, + 0xfe, 0x15, 0x3f, 0x11, 0x48, 0xb8, 0x8e, 0xc7, 0x7e, 0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47, 0xcf, 0xfb, 0x68, 0xa6, 0x69, 0xed, 0x61, 0x3f, 0x10, 0x67, 0xd4, 0x33, + 0x04, 0xb6, 0xca, 0x40, 0x44, 0x30, 0xf4, 0x28, 0xbf, 0x44, 0xf7, 0x65, 0xe9, 0x37, 0xba, 0xc2, + 0xce, 0x8f, 0x86, 0x1f, 0xcc, 0xd2, 0x73, 0xa5, 0x1a, 0x94, 0x13, 0x27, 0xaa, 0x61, 0x1a, 0x5d, + 0x85, 0x12, 0x3d, 0x32, 0x98, 0x1e, 0x26, 0x25, 0x8a, 0x42, 0xb4, 0xc2, 0xb5, 0x6c, 0x1b, 0x9b, + 0xfc, 0x89, 0x0f, 0x9e, 0xd2, 0x3e, 0x03, 0x14, 0x17, 0x1e, 0xef, 0xa0, 0xab, 0x30, 0x45, 0x65, + 0x2b, 0x5c, 0xf1, 0x85, 0x14, 0x6b, 0x9d, 0x23, 0x68, 0x3f, 0x05, 0xc4, 0xca, 0x92, 0xdc, 0xef, + 0xc3, 0x74, 0xe0, 0x10, 0x47, 0xfc, 0xf7, 0x15, 0x38, 0x26, 0x71, 0xe7, 0xf5, 0xbb, 0x2c, 0xb3, + 0xcf, 0xa8, 0x1e, 0x67, 0xfd, 0x89, 0x34, 0xc1, 0x5f, 0x4d, 0x57, 0xe3, 0xaf, 0x68, 0x72, 0xff, + 0x6f, 0x0a, 0x40, 0x7d, 0x10, 0xec, 0xf3, 0xed, 0xe7, 0x78, 0x27, 0x2a, 0x89, 0x4e, 0xac, 0x41, + 0xd9, 0x35, 0x7c, 0xff, 0xad, 0xe3, 0x89, 0x55, 0x72, 0x98, 0xa6, 0x9b, 0xc6, 0x03, 0xfe, 0xae, + 0x49, 0x45, 0xa7, 0xdf, 0xe8, 0x7d, 0x98, 0x63, 0xcf, 0xfb, 0x74, 0x0c, 0xd3, 0xf4, 0x44, 0xb8, + 0x6a, 0x45, 0xaf, 0x32, 0x68, 0x9d, 0x01, 0x09, 0x9a, 0x45, 0x0f, 0x90,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 0xda, 0xcb, 0xe2, 0xed, 0x32, 0xda, 0x2b, + 0xc5, 0x5f, 0x66, 0xb4, 0x57, 0x0e, 0xd4, 0xd3, 0x26, 0x9e, 0x3d, 0xfd, 0xe3, 0x3f, 0x3f, 0xa7, + 0xfc, 0xe9, 0x9f, 0x9f, 0x9b, 0xf8, 0x5b, 0xbf, 0x3a, 0xa7, 0xfc, 0xf1, 0xaf, 0xce, 0x29, 0xff, + 0xfd, 0x57, 0xe7, 0x94, 0x3f, 0xfb, 0xd5, 0x39, 0xe5, 0xb7, 0xff, 0xe2, 0xdc, 0xc4, 0x37, 0xda, + 0xeb, 0x87, 0xfe, 0x0d, 0xcb, 0xb9, 0xd9, 0xf5, 0xac, 0xeb, 0x86, 0x6b, 0xdd, 0x74, 0x5f, 0xef, + 0xdd, 0x34, 0x5c, 0xcb, 0xbf, 0xc9, 0xf9, 0xde, 0x7c, 0x73, 0xeb, 0xd5, 0x14, 0xfd, 0xbb, 0xdd, + 0x3b, 0xff, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x6a, 0xf8, 0x7f, 0x28, 0x79, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -11070,6 +11699,12 @@ type RuntimeServiceClient interface { // The Kubelet will not re-request the RuntimeConfiguration after startup, and CRI implementations should // avoid updating them without a full node reboot. RuntimeConfig(ctx context.Context, in *RuntimeConfigRequest, opts ...grpc.CallOption) (*RuntimeConfigResponse, error) + // UpdatePodSandboxResources synchronously updates the PodSandboxConfig with + // the pod-level resource configuration. This method is called _after_ the + // Kubelet reconfigures the pod-level cgroups. + // This request is treated as best effort, and failure will not block the + // Kubelet with proceeding with a resize. + UpdatePodSandboxResources(ctx context.Context, in *UpdatePodSandboxResourcesRequest, opts ...grpc.CallOption) (*UpdatePodSandboxResourcesResponse, error) } type runtimeServiceClient struct { @@ -11364,6 +11999,15 @@ func (c *runtimeServiceClient) RuntimeConfig(ctx context.Context, in *RuntimeCon return out, nil } +func (c *runtimeServiceClient) UpdatePodSandboxResources(ctx context.Context, in *UpdatePodSandboxResourcesRequest, opts ...grpc.CallOption) (*UpdatePodSandboxResourcesResponse, error) { + out := new(UpdatePodSandboxResourcesResponse) + err := c.cc.Invoke(ctx, "/runtime.v1.RuntimeService/UpdatePodSandboxResources", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // RuntimeServiceServer is the server API for RuntimeService service. type RuntimeServiceServer interface { // Version returns the runtime name, runtime version, and runtime API version. @@ -11462,6 +12106,12 @@ type RuntimeServiceServer interface { // The Kubelet will not re-request the RuntimeConfiguration after startup, and CRI implementations should // avoid updating them without a full node reboot. RuntimeConfig(context.Context, *RuntimeConfigRequest) (*RuntimeConfigResponse, error) + // UpdatePodSandboxResources synchronously updates the PodSandboxConfig with + // the pod-level resource configuration. This method is called _after_ the + // Kubelet reconfigures the pod-level cgroups. + // This request is treated as best effort, and failure will not block the + // Kubelet with proceeding with a resize. + UpdatePodSandboxResources(context.Context, *UpdatePodSandboxResourcesRequest) (*UpdatePodSandboxResourcesResponse, error) } // UnimplementedRuntimeServiceServer can be embedded to have forward compatible implementations. @@ -11555,6 +12205,9 @@ func (*UnimplementedRuntimeServiceServer) ListPodSandboxMetrics(ctx context.Cont func (*UnimplementedRuntimeServiceServer) RuntimeConfig(ctx context.Context, req *RuntimeConfigRequest) (*RuntimeConfigResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RuntimeConfig not implemented") } +func (*UnimplementedRuntimeServiceServer) UpdatePodSandboxResources(ctx context.Context, req *UpdatePodSandboxResourcesRequest) (*UpdatePodSandboxResourcesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdatePodSandboxResources not implemented") +} func RegisterRuntimeServiceServer(s *grpc.Server, srv RuntimeServiceServer) { s.RegisterService(&_RuntimeService_serviceDesc, srv) @@ -12085,6 +12738,24 @@ func _RuntimeService_RuntimeConfig_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _RuntimeService_UpdatePodSandboxResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdatePodSandboxResourcesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServiceServer).UpdatePodSandboxResources(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/runtime.v1.RuntimeService/UpdatePodSandboxResources", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServiceServer).UpdatePodSandboxResources(ctx, req.(*UpdatePodSandboxResourcesRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _RuntimeService_serviceDesc = grpc.ServiceDesc{ ServiceName: "runtime.v1.RuntimeService", HandlerType: (*RuntimeServiceServer)(nil), @@ -12201,6 +12872,10 @@ var _RuntimeService_serviceDesc = grpc.ServiceDesc{ MethodName: "RuntimeConfig", Handler: _RuntimeService_RuntimeConfig_Handler, }, + { + MethodName: "UpdatePodSandboxResources", + Handler: _RuntimeService_UpdatePodSandboxResources_Handler, + }, }, Streams: []grpc.StreamDesc{ { @@ -12642,6 +13317,13 @@ func (m *Mount) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.ImageSubPath) > 0 { + i -= len(m.ImageSubPath) + copy(dAtA[i:], m.ImageSubPath) + i = encodeVarintApi(dAtA, i, uint64(len(m.ImageSubPath))) + i-- + dAtA[i] = 0x52 + } if m.Image != nil { { size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) @@ -14524,6 +15206,18 @@ func (m *LinuxPodSandboxStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Io != nil { + { + size, err := m.Io.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } if len(m.Containers) > 0 { for iNdEx := len(m.Containers) - 1; iNdEx >= 0; iNdEx-- { { @@ -15466,21 +16160,21 @@ func (m *LinuxContainerSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, dAtA[i] = 0x4a } if len(m.SupplementalGroups) > 0 { - dAtA58 := make([]byte, len(m.SupplementalGroups)*10) - var j57 int + dAtA59 := make([]byte, len(m.SupplementalGroups)*10) + var j58 int for _, num1 := range m.SupplementalGroups { num := uint64(num1) for num >= 1<<7 { - dAtA58[j57] = uint8(uint64(num)&0x7f | 0x80) + dAtA59[j58] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j57++ + j58++ } - dAtA58[j57] = uint8(num) - j57++ + dAtA59[j58] = uint8(num) + j58++ } - i -= j57 - copy(dAtA[i:], dAtA58[:j57]) - i = encodeVarintApi(dAtA, i, uint64(j57)) + i -= j58 + copy(dAtA[i:], dAtA59[:j58]) + i = encodeVarintApi(dAtA, i, uint64(j58)) i-- dAtA[i] = 0x42 } @@ -15630,21 +16324,21 @@ func (m *LinuxContainerUser) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.SupplementalGroups) > 0 { - dAtA66 := make([]byte, len(m.SupplementalGroups)*10) - var j65 int + dAtA67 := make([]byte, len(m.SupplementalGroups)*10) + var j66 int for _, num1 := range m.SupplementalGroups { num := uint64(num1) for num >= 1<<7 { - dAtA66[j65] = uint8(uint64(num)&0x7f | 0x80) + dAtA67[j66] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j65++ + j66++ } - dAtA66[j65] = uint8(num) - j65++ + dAtA67[j66] = uint8(num) + j66++ } - i -= j65 - copy(dAtA[i:], dAtA66[:j65]) - i = encodeVarintApi(dAtA, i, uint64(j65)) + i -= j66 + copy(dAtA[i:], dAtA67[:j66]) + i = encodeVarintApi(dAtA, i, uint64(j66)) i-- dAtA[i] = 0x1a } @@ -16101,6 +16795,13 @@ func (m *ContainerConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.StopSignal != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.StopSignal)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } if len(m.CDIDevices) > 0 { for iNdEx := len(m.CDIDevices) - 1; iNdEx >= 0; iNdEx-- { { @@ -16911,6 +17612,13 @@ func (m *ContainerStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.StopSignal != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.StopSignal)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x98 + } if m.User != nil { { size, err := m.User.MarshalToSizedBuffer(dAtA[:i]) @@ -17635,21 +18343,21 @@ func (m *PortForwardRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.Port) > 0 { - dAtA92 := make([]byte, len(m.Port)*10) - var j91 int + dAtA93 := make([]byte, len(m.Port)*10) + var j92 int for _, num1 := range m.Port { num := uint64(num1) for num >= 1<<7 { - dAtA92[j91] = uint8(uint64(num)&0x7f | 0x80) + dAtA93[j92] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j91++ + j92++ } - dAtA92[j91] = uint8(num) - j91++ + dAtA93[j92] = uint8(num) + j92++ } - i -= j91 - copy(dAtA[i:], dAtA92[:j91]) - i = encodeVarintApi(dAtA, i, uint64(j91)) + i -= j92 + copy(dAtA[i:], dAtA93[:j92]) + i = encodeVarintApi(dAtA, i, uint64(j92)) i-- dAtA[i] = 0x12 } @@ -19191,6 +19899,18 @@ func (m *ContainerStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Io != nil { + { + size, err := m.Io.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } if m.Swap != nil { { size, err := m.Swap.MarshalToSizedBuffer(dAtA[:i]) @@ -19325,6 +20045,99 @@ func (m *WindowsContainerStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *PsiStats) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PsiStats) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PsiStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Some != nil { + { + size, err := m.Some.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Full != nil { + { + size, err := m.Full.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PsiData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PsiData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PsiData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Avg300 != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Avg300)))) + i-- + dAtA[i] = 0x21 + } + if m.Avg60 != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Avg60)))) + i-- + dAtA[i] = 0x19 + } + if m.Avg10 != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Avg10)))) + i-- + dAtA[i] = 0x11 + } + if m.Total != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *CpuUsage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -19345,6 +20158,18 @@ func (m *CpuUsage) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Psi != nil { + { + size, err := m.Psi.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } if m.UsageNanoCores != nil { { size, err := m.UsageNanoCores.MarshalToSizedBuffer(dAtA[:i]) @@ -19449,6 +20274,18 @@ func (m *MemoryUsage) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Psi != nil { + { + size, err := m.Psi.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } if m.MajorPageFaults != nil { { size, err := m.MajorPageFaults.MarshalToSizedBuffer(dAtA[:i]) @@ -19529,6 +20366,46 @@ func (m *MemoryUsage) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *IoUsage) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IoUsage) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IoUsage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Psi != nil { + { + size, err := m.Psi.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Timestamp != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *SwapUsage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -20279,6 +21156,83 @@ func (m *LinuxRuntimeConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } +func (m *UpdatePodSandboxResourcesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdatePodSandboxResourcesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdatePodSandboxResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Resources != nil { + { + size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Overhead != nil { + { + size, err := m.Overhead.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.PodSandboxId) > 0 { + i -= len(m.PodSandboxId) + copy(dAtA[i:], m.PodSandboxId) + i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UpdatePodSandboxResourcesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdatePodSandboxResourcesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdatePodSandboxResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintApi(dAtA []byte, offset int, v uint64) int { offset -= sovApi(v) base := offset @@ -20419,6 +21373,10 @@ func (m *Mount) Size() (n int) { l = m.Image.Size() n += 1 + l + sovApi(uint64(l)) } + l = len(m.ImageSubPath) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } return n } @@ -21177,6 +22135,10 @@ func (m *LinuxPodSandboxStats) Size() (n int) { n += 1 + l + sovApi(uint64(l)) } } + if m.Io != nil { + l = m.Io.Size() + n += 1 + l + sovApi(uint64(l)) + } return n } @@ -21899,6 +22861,9 @@ func (m *ContainerConfig) Size() (n int) { n += 2 + l + sovApi(uint64(l)) } } + if m.StopSignal != 0 { + n += 2 + sovApi(uint64(m.StopSignal)) + } return n } @@ -22228,6 +23193,9 @@ func (m *ContainerStatus) Size() (n int) { l = m.User.Size() n += 2 + l + sovApi(uint64(l)) } + if m.StopSignal != 0 { + n += 2 + sovApi(uint64(m.StopSignal)) + } return n } @@ -23098,6 +24066,10 @@ func (m *ContainerStats) Size() (n int) { l = m.Swap.Size() n += 1 + l + sovApi(uint64(l)) } + if m.Io != nil { + l = m.Io.Size() + n += 1 + l + sovApi(uint64(l)) + } return n } @@ -23126,6 +24098,44 @@ func (m *WindowsContainerStats) Size() (n int) { return n } +func (m *PsiStats) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Full != nil { + l = m.Full.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.Some != nil { + l = m.Some.Size() + n += 1 + l + sovApi(uint64(l)) + } + return n +} + +func (m *PsiData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Total != 0 { + n += 1 + sovApi(uint64(m.Total)) + } + if m.Avg10 != 0 { + n += 9 + } + if m.Avg60 != 0 { + n += 9 + } + if m.Avg300 != 0 { + n += 9 + } + return n +} + func (m *CpuUsage) Size() (n int) { if m == nil { return 0 @@ -23143,6 +24153,10 @@ func (m *CpuUsage) Size() (n int) { l = m.UsageNanoCores.Size() n += 1 + l + sovApi(uint64(l)) } + if m.Psi != nil { + l = m.Psi.Size() + n += 1 + l + sovApi(uint64(l)) + } return n } @@ -23199,6 +24213,26 @@ func (m *MemoryUsage) Size() (n int) { l = m.MajorPageFaults.Size() n += 1 + l + sovApi(uint64(l)) } + if m.Psi != nil { + l = m.Psi.Size() + n += 1 + l + sovApi(uint64(l)) + } + return n +} + +func (m *IoUsage) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Timestamp != 0 { + n += 1 + sovApi(uint64(m.Timestamp)) + } + if m.Psi != nil { + l = m.Psi.Size() + n += 1 + l + sovApi(uint64(l)) + } return n } @@ -23517,6 +24551,36 @@ func (m *LinuxRuntimeConfiguration) Size() (n int) { return n } +func (m *UpdatePodSandboxResourcesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PodSandboxId) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + if m.Overhead != nil { + l = m.Overhead.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.Resources != nil { + l = m.Resources.Size() + n += 1 + l + sovApi(uint64(l)) + } + return n +} + +func (m *UpdatePodSandboxResourcesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovApi(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -23595,6 +24659,7 @@ func (this *Mount) String() string { `GidMappings:` + repeatedStringForGidMappings + `,`, `RecursiveReadOnly:` + fmt.Sprintf("%v", this.RecursiveReadOnly) + `,`, `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, + `ImageSubPath:` + fmt.Sprintf("%v", this.ImageSubPath) + `,`, `}`, }, "") return s @@ -24169,6 +25234,7 @@ func (this *LinuxPodSandboxStats) String() string { `Network:` + strings.Replace(this.Network.String(), "NetworkUsage", "NetworkUsage", 1) + `,`, `Process:` + strings.Replace(this.Process.String(), "ProcessUsage", "ProcessUsage", 1) + `,`, `Containers:` + repeatedStringForContainers + `,`, + `Io:` + strings.Replace(this.Io.String(), "IoUsage", "IoUsage", 1) + `,`, `}`, }, "") return s @@ -24611,6 +25677,7 @@ func (this *ContainerConfig) String() string { `Linux:` + strings.Replace(this.Linux.String(), "LinuxContainerConfig", "LinuxContainerConfig", 1) + `,`, `Windows:` + strings.Replace(this.Windows.String(), "WindowsContainerConfig", "WindowsContainerConfig", 1) + `,`, `CDIDevices:` + repeatedStringForCDIDevices + `,`, + `StopSignal:` + fmt.Sprintf("%v", this.StopSignal) + `,`, `}`, }, "") return s @@ -24851,6 +25918,7 @@ func (this *ContainerStatus) String() string { `Resources:` + strings.Replace(this.Resources.String(), "ContainerResources", "ContainerResources", 1) + `,`, `ImageId:` + fmt.Sprintf("%v", this.ImageId) + `,`, `User:` + strings.Replace(this.User.String(), "ContainerUser", "ContainerUser", 1) + `,`, + `StopSignal:` + fmt.Sprintf("%v", this.StopSignal) + `,`, `}`, }, "") return s @@ -25485,6 +26553,7 @@ func (this *ContainerStats) String() string { `Memory:` + strings.Replace(this.Memory.String(), "MemoryUsage", "MemoryUsage", 1) + `,`, `WritableLayer:` + strings.Replace(this.WritableLayer.String(), "FilesystemUsage", "FilesystemUsage", 1) + `,`, `Swap:` + strings.Replace(this.Swap.String(), "SwapUsage", "SwapUsage", 1) + `,`, + `Io:` + strings.Replace(this.Io.String(), "IoUsage", "IoUsage", 1) + `,`, `}`, }, "") return s @@ -25502,6 +26571,30 @@ func (this *WindowsContainerStats) String() string { }, "") return s } +func (this *PsiStats) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PsiStats{`, + `Full:` + strings.Replace(this.Full.String(), "PsiData", "PsiData", 1) + `,`, + `Some:` + strings.Replace(this.Some.String(), "PsiData", "PsiData", 1) + `,`, + `}`, + }, "") + return s +} +func (this *PsiData) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PsiData{`, + `Total:` + fmt.Sprintf("%v", this.Total) + `,`, + `Avg10:` + fmt.Sprintf("%v", this.Avg10) + `,`, + `Avg60:` + fmt.Sprintf("%v", this.Avg60) + `,`, + `Avg300:` + fmt.Sprintf("%v", this.Avg300) + `,`, + `}`, + }, "") + return s +} func (this *CpuUsage) String() string { if this == nil { return "nil" @@ -25510,6 +26603,7 @@ func (this *CpuUsage) String() string { `Timestamp:` + fmt.Sprintf("%v", this.Timestamp) + `,`, `UsageCoreNanoSeconds:` + strings.Replace(this.UsageCoreNanoSeconds.String(), "UInt64Value", "UInt64Value", 1) + `,`, `UsageNanoCores:` + strings.Replace(this.UsageNanoCores.String(), "UInt64Value", "UInt64Value", 1) + `,`, + `Psi:` + strings.Replace(this.Psi.String(), "PsiStats", "PsiStats", 1) + `,`, `}`, }, "") return s @@ -25538,6 +26632,18 @@ func (this *MemoryUsage) String() string { `RssBytes:` + strings.Replace(this.RssBytes.String(), "UInt64Value", "UInt64Value", 1) + `,`, `PageFaults:` + strings.Replace(this.PageFaults.String(), "UInt64Value", "UInt64Value", 1) + `,`, `MajorPageFaults:` + strings.Replace(this.MajorPageFaults.String(), "UInt64Value", "UInt64Value", 1) + `,`, + `Psi:` + strings.Replace(this.Psi.String(), "PsiStats", "PsiStats", 1) + `,`, + `}`, + }, "") + return s +} +func (this *IoUsage) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&IoUsage{`, + `Timestamp:` + fmt.Sprintf("%v", this.Timestamp) + `,`, + `Psi:` + strings.Replace(this.Psi.String(), "PsiStats", "PsiStats", 1) + `,`, `}`, }, "") return s @@ -25777,6 +26883,27 @@ func (this *LinuxRuntimeConfiguration) String() string { }, "") return s } +func (this *UpdatePodSandboxResourcesRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&UpdatePodSandboxResourcesRequest{`, + `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, + `Overhead:` + strings.Replace(this.Overhead.String(), "LinuxContainerResources", "LinuxContainerResources", 1) + `,`, + `Resources:` + strings.Replace(this.Resources.String(), "LinuxContainerResources", "LinuxContainerResources", 1) + `,`, + `}`, + }, "") + return s +} +func (this *UpdatePodSandboxResourcesResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&UpdatePodSandboxResourcesResponse{`, + `}`, + }, "") + return s +} func valueToStringApi(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -26606,6 +27733,38 @@ func (m *Mount) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ImageSubPath", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ImageSubPath = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) @@ -32603,6 +33762,42 @@ func (m *LinuxPodSandboxStats) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Io", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Io == nil { + m.Io = &IoUsage{} + } + if err := m.Io.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) @@ -37824,6 +39019,25 @@ func (m *ContainerConfig) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StopSignal", wireType) + } + m.StopSignal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StopSignal |= Signal(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) @@ -40404,6 +41618,25 @@ func (m *ContainerStatus) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 19: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StopSignal", wireType) + } + m.StopSignal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StopSignal |= Signal(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) @@ -46671,6 +47904,42 @@ func (m *ContainerStats) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Io", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Io == nil { + m.Io = &IoUsage{} + } + if err := m.Io.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) @@ -46886,6 +48155,230 @@ func (m *WindowsContainerStats) Unmarshal(dAtA []byte) error { } return nil } +func (m *PsiStats) 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 ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PsiStats: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PsiStats: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Full", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Full == nil { + m.Full = &PsiData{} + } + if err := m.Full.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Some", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Some == nil { + m.Some = &PsiData{} + } + if err := m.Some.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PsiData) 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 ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PsiData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PsiData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) + } + m.Total = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Total |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Avg10", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Avg10 = float64(math.Float64frombits(v)) + case 3: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Avg60", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Avg60 = float64(math.Float64frombits(v)) + case 4: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Avg300", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Avg300 = float64(math.Float64frombits(v)) + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *CpuUsage) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -47006,6 +48499,42 @@ func (m *CpuUsage) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Psi", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Psi == nil { + m.Psi = &PsiStats{} + } + if err := m.Psi.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) @@ -47432,6 +48961,147 @@ func (m *MemoryUsage) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Psi", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Psi == nil { + m.Psi = &PsiStats{} + } + if err := m.Psi.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IoUsage) 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 ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IoUsage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IoUsage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Psi", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Psi == nil { + m.Psi = &PsiStats{} + } + if err := m.Psi.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) @@ -49435,6 +51105,210 @@ func (m *LinuxRuntimeConfiguration) Unmarshal(dAtA []byte) error { } return nil } +func (m *UpdatePodSandboxResourcesRequest) 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 ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpdatePodSandboxResourcesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdatePodSandboxResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PodSandboxId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Overhead", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Overhead == nil { + m.Overhead = &LinuxContainerResources{} + } + if err := m.Overhead.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Resources == nil { + m.Resources = &LinuxContainerResources{} + } + if err := m.Resources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpdatePodSandboxResourcesResponse) 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 ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpdatePodSandboxResourcesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdatePodSandboxResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipApi(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/e2e/vendor/k8s.io/cri-api/pkg/apis/runtime/v1/api.proto b/e2e/vendor/k8s.io/cri-api/pkg/apis/runtime/v1/api.proto index a19133001..a14c325fe 100644 --- a/e2e/vendor/k8s.io/cri-api/pkg/apis/runtime/v1/api.proto +++ b/e2e/vendor/k8s.io/cri-api/pkg/apis/runtime/v1/api.proto @@ -140,6 +140,13 @@ service RuntimeService { // The Kubelet will not re-request the RuntimeConfiguration after startup, and CRI implementations should // avoid updating them without a full node reboot. rpc RuntimeConfig(RuntimeConfigRequest) returns (RuntimeConfigResponse) {} + + // UpdatePodSandboxResources synchronously updates the PodSandboxConfig with + // the pod-level resource configuration. This method is called _after_ the + // Kubelet reconfigures the pod-level cgroups. + // This request is treated as best effort, and failure will not block the + // Kubelet with proceeding with a resize. + rpc UpdatePodSandboxResources(UpdatePodSandboxResourcesRequest) returns (UpdatePodSandboxResourcesResponse) {} } // ImageService defines the public APIs for managing images. @@ -201,7 +208,16 @@ message PortMapping { Protocol protocol = 1; // Port number within the container. Default: 0 (not specified). int32 container_port = 2; - // Port number on the host. Default: 0 (not specified). + // Port number on the host to map the container port to. + // + // * Valid host port range is 1-65535. + // * The value 0 has explicit semantic meaning: it indicates NO host port should be allocated. + // * The value 0 does NOT indicate dynamic port allocation. Future implementations + // of dynamic allocation will use different values/semantics. + // * Implementations MUST handle the case where this field is explicitly set to 0, + // This field SHOULD be omitted when no port is required. + // + // Default: If omitted, container port will not be exposed on the host. int32 host_port = 3; // Host IP. string host_ip = 4; @@ -248,13 +264,19 @@ message Mount { bool recursive_read_only = 8; // Mount an image reference (image ID, with or without digest), which is a // special use case for image volume mounts. If this field is set, then - // host_path should be unset. All OCI mounts are per feature definition - // readonly. The kubelet does an PullImage RPC and evaluates the returned + // host_path should be unset. All image mounts are per feature definition + // readonly (noexec). The kubelet does an PullImage RPC and evaluates the returned // PullImageResponse.image_ref value, which is then set to the // ImageSpec.image field. Runtimes are expected to mount the image as // required. - // Introduced in the OCI Volume Source KEP: https://kep.k8s.io/4639 + // Introduced in the Image Volume Source KEP: https://kep.k8s.io/4639 ImageSpec image = 9; + // Specific image sub path to be used from inside the image instead of its + // root, only necessary if the above image field is set. If the sub path is + // not empty and does not exist in the image, then runtimes should fail and + // return an error. + // Introduced in the Image Volume Source KEP beta graduation: https://kep.k8s.io/4639 + string image_sub_path = 10; } // IDMapping describes host to container ID mappings for a pod sandbox. @@ -726,6 +748,8 @@ message LinuxPodSandboxStats { ProcessUsage process = 4; // Stats of containers in the measured pod sandbox. repeated ContainerStats containers = 5; + // IO usage gathered for the pod sandbox. + IoUsage io = 6; } // WindowsPodSandboxStats provides the resource usage statistics for a pod sandbox on windows @@ -989,7 +1013,7 @@ message LinuxContainerUser { // WindowsNamespaceOption provides options for Windows namespaces. message WindowsNamespaceOption { // Network namespace for this container/sandbox. - // Namespaces currently set by the kubelet: POD, NODE + // This is currently never set by the kubelet NamespaceMode network = 1; } @@ -1164,6 +1188,78 @@ message ContainerConfig { // CDI devices for the container. repeated CDIDevice CDI_devices = 17; + + // The custom stop signal for the container + Signal stop_signal = 18; +} + +enum Signal { + RUNTIME_DEFAULT = 0; + SIGABRT = 1; + SIGALRM = 2; + SIGBUS = 3; + SIGCHLD = 4; + SIGCLD = 5; + SIGCONT = 6; + SIGFPE = 7; + SIGHUP = 8; + SIGILL = 9; + SIGINT = 10; + SIGIO = 11; + SIGIOT = 12; + SIGKILL = 13; + SIGPIPE = 14; + SIGPOLL = 15; + SIGPROF = 16; + SIGPWR = 17; + SIGQUIT = 18; + SIGSEGV = 19; + SIGSTKFLT = 20; + SIGSTOP = 21; + SIGSYS = 22; + SIGTERM = 23; + SIGTRAP = 24; + SIGTSTP = 25; + SIGTTIN = 26; + SIGTTOU = 27; + SIGURG = 28; + SIGUSR1 = 29; + SIGUSR2 = 30; + SIGVTALRM = 31; + SIGWINCH = 32; + SIGXCPU = 33; + SIGXFSZ = 34; + SIGRTMIN = 35; + SIGRTMINPLUS1 = 36; + SIGRTMINPLUS2 = 37; + SIGRTMINPLUS3 = 38; + SIGRTMINPLUS4 = 39; + SIGRTMINPLUS5 = 40; + SIGRTMINPLUS6 = 41; + SIGRTMINPLUS7 = 42; + SIGRTMINPLUS8 = 43; + SIGRTMINPLUS9 = 44; + SIGRTMINPLUS10 = 45; + SIGRTMINPLUS11 = 46; + SIGRTMINPLUS12 = 47; + SIGRTMINPLUS13 = 48; + SIGRTMINPLUS14 = 49; + SIGRTMINPLUS15 = 50; + SIGRTMAXMINUS14 = 51; + SIGRTMAXMINUS13 = 52; + SIGRTMAXMINUS12 = 53; + SIGRTMAXMINUS11 = 54; + SIGRTMAXMINUS10 = 55; + SIGRTMAXMINUS9 = 56; + SIGRTMAXMINUS8 = 57; + SIGRTMAXMINUS7 = 58; + SIGRTMAXMINUS6 = 59; + SIGRTMAXMINUS5 = 60; + SIGRTMAXMINUS4 = 61; + SIGRTMAXMINUS3 = 62; + SIGRTMAXMINUS2 = 63; + SIGRTMAXMINUS1 = 64; + SIGRTMAX = 65; } message CreateContainerRequest { @@ -1337,6 +1433,9 @@ message ContainerStatus { string image_id = 17; // User identities initially attached to the container ContainerUser user = 18; + + // Returns the stop signal used by the container runtime to terminate the container + Signal stop_signal = 19; } message ContainerStatusResponse { @@ -1771,6 +1870,8 @@ message ContainerStats { FilesystemUsage writable_layer = 4; // Swap usage gathered from the container. SwapUsage swap = 5; + // IO usage gathered from the container. + IoUsage io = 6; } // WindowsContainerStats provides the resource usage statistics for a container specific for Windows @@ -1785,6 +1886,27 @@ message WindowsContainerStats { WindowsFilesystemUsage writable_layer = 4; } +// PSI statistics for an individual resource. +message PsiStats { + // PSI data for all tasks in the cgroup. + PsiData Full = 1; + // PSI data for some tasks in the cgroup. + PsiData Some = 2; +} + +// PSI data for an individual resource. +message PsiData { + // Total time duration for tasks in the cgroup have waited due to congestion. + // Unit: nanoseconds. + uint64 Total = 1; + // The average (in %) tasks have waited due to congestion over a 10 second window. + double Avg10 = 2; + // The average (in %) tasks have waited due to congestion over a 60 second window. + double Avg60 = 3; + // The average (in %) tasks have waited due to congestion over a 300 second window. + double Avg300 = 4; +} + // CpuUsage provides the CPU usage information. message CpuUsage { // Timestamp in nanoseconds at which the information were collected. Must be > 0. @@ -1794,6 +1916,8 @@ message CpuUsage { // Total CPU usage (sum of all cores) averaged over the sample window. // The "core" unit can be interpreted as CPU core-nanoseconds per second. UInt64Value usage_nano_cores = 3; + // CPU PSI statistics. + PsiStats psi = 4; } // WindowsCpuUsage provides the CPU usage information specific to Windows @@ -1823,6 +1947,15 @@ message MemoryUsage { UInt64Value page_faults = 6; // Cumulative number of major page faults. UInt64Value major_page_faults = 7; + // Memory PSI statistics. + PsiStats psi = 8; +} + +message IoUsage { + // Timestamp in nanoseconds at which the information were collected. Must be > 0. + int64 timestamp = 1; + // IO PSI statistics. + PsiStats psi = 2; } message SwapUsage { @@ -1982,3 +2115,14 @@ enum CgroupDriver { CGROUPFS = 1; } +message UpdatePodSandboxResourcesRequest { + // ID of the PodSandbox to update. + string pod_sandbox_id = 1; + + // Optional overhead represents the overheads associated with this sandbox + LinuxContainerResources overhead = 2; + // Optional resources represents the sum of container resources for this sandbox + LinuxContainerResources resources = 3; +} + +message UpdatePodSandboxResourcesResponse {} diff --git a/e2e/vendor/k8s.io/cri-api/pkg/apis/services.go b/e2e/vendor/k8s.io/cri-api/pkg/apis/services.go index 2d56783ab..58cee8c14 100644 --- a/e2e/vendor/k8s.io/cri-api/pkg/apis/services.go +++ b/e2e/vendor/k8s.io/cri-api/pkg/apis/services.go @@ -72,7 +72,7 @@ type PodSandboxManager interface { RunPodSandbox(ctx context.Context, config *runtimeapi.PodSandboxConfig, runtimeHandler string) (string, error) // StopPodSandbox stops the sandbox. If there are any running containers in the // sandbox, they should be force terminated. - StopPodSandbox(pctx context.Context, odSandboxID string) error + StopPodSandbox(ctx context.Context, podSandboxID string) error // RemovePodSandbox removes the sandbox. If there are running containers in the // sandbox, they should be forcibly removed. RemovePodSandbox(ctx context.Context, podSandboxID string) error @@ -82,6 +82,12 @@ type PodSandboxManager interface { ListPodSandbox(ctx context.Context, filter *runtimeapi.PodSandboxFilter) ([]*runtimeapi.PodSandbox, error) // PortForward prepares a streaming endpoint to forward ports from a PodSandbox, and returns the address. PortForward(ctx context.Context, request *runtimeapi.PortForwardRequest) (*runtimeapi.PortForwardResponse, error) + // UpdatePodSandboxResources synchronously updates the PodSandboxConfig with + // the pod-level resource configuration. This method is called _after_ the + // Kubelet reconfigures the pod-level cgroups. + // This request is treated as best effort, and failure will not block the + // Kubelet with proceeding with a resize. + UpdatePodSandboxResources(ctx context.Context, request *runtimeapi.UpdatePodSandboxResourcesRequest) (*runtimeapi.UpdatePodSandboxResourcesResponse, error) } // ContainerStatsManager contains methods for retrieving the container diff --git a/e2e/vendor/k8s.io/cri-client/pkg/remote_runtime.go b/e2e/vendor/k8s.io/cri-client/pkg/remote_runtime.go index aa1518e0a..f5f3970be 100644 --- a/e2e/vendor/k8s.io/cri-client/pkg/remote_runtime.go +++ b/e2e/vendor/k8s.io/cri-client/pkg/remote_runtime.go @@ -610,6 +610,23 @@ func (r *remoteRuntimeService) portForwardV1(ctx context.Context, req *runtimeap return resp, nil } +// UpdatePodSandboxResources synchronously updates the PodSandboxConfig with +// the pod-level resource configuration. +func (r *remoteRuntimeService) UpdatePodSandboxResources(ctx context.Context, req *runtimeapi.UpdatePodSandboxResourcesRequest) (*runtimeapi.UpdatePodSandboxResourcesResponse, error) { + r.log(10, "[RemoteRuntimeService] UpdatePodSandboxResources", "PodSandboxId", req.PodSandboxId, "timeout", r.timeout) + ctx, cancel := context.WithTimeout(ctx, r.timeout) + defer cancel() + + resp, err := r.runtimeClient.UpdatePodSandboxResources(ctx, req) + if err != nil { + r.logErr(err, "UpdatePodSandboxResources from runtime service failed", "podSandboxID", req.PodSandboxId) + return nil, err + } + r.log(10, "[RemoteRuntimeService] UpdatePodSandboxResources Response", "podSandboxID", req.PodSandboxId) + + return resp, nil +} + // UpdateRuntimeConfig updates the config of a runtime service. The only // update payload currently supported is the pod CIDR assigned to a node, // and the runtime service just proxies it down to the network plugin. diff --git a/e2e/vendor/k8s.io/dynamic-resource-allocation/api/types.go b/e2e/vendor/k8s.io/dynamic-resource-allocation/api/types.go index 16682ff57..e14fe11fd 100644 --- a/e2e/vendor/k8s.io/dynamic-resource-allocation/api/types.go +++ b/e2e/vendor/k8s.io/dynamic-resource-allocation/api/types.go @@ -18,6 +18,7 @@ package api import ( v1 "k8s.io/api/core/v1" + resourceapi "k8s.io/api/resource/v1beta1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -29,12 +30,19 @@ type ResourceSlice struct { } type ResourceSliceSpec struct { - Driver UniqueString - Pool ResourcePool - NodeName UniqueString - NodeSelector *v1.NodeSelector - AllNodes bool - Devices []Device + Driver UniqueString + Pool ResourcePool + NodeName UniqueString + NodeSelector *v1.NodeSelector + AllNodes bool + Devices []Device + PerDeviceNodeSelection *bool + SharedCounters []CounterSet +} + +type CounterSet struct { + Name UniqueString + Counters map[string]Counter } type ResourcePool struct { @@ -48,8 +56,18 @@ type Device struct { } type BasicDevice struct { - Attributes map[QualifiedName]DeviceAttribute - Capacity map[QualifiedName]DeviceCapacity + Attributes map[QualifiedName]DeviceAttribute + Capacity map[QualifiedName]DeviceCapacity + ConsumesCounters []DeviceCounterConsumption + NodeName *string + NodeSelector *v1.NodeSelector + AllNodes *bool + Taints []resourceapi.DeviceTaint +} + +type DeviceCounterConsumption struct { + CounterSet UniqueString + Counters map[string]Counter } type QualifiedName string @@ -66,3 +84,22 @@ type DeviceAttribute struct { type DeviceCapacity struct { Value resource.Quantity } + +type Counter struct { + Value resource.Quantity +} + +type DeviceTaint struct { + Key string + Value string + Effect DeviceTaintEffect + TimeAdded *metav1.Time +} + +type DeviceTaintEffect string + +const ( + DeviceTaintEffectNoSchedule DeviceTaintEffect = "NoSchedule" + + DeviceTaintEffectNoExecute DeviceTaintEffect = "NoExecute" +) diff --git a/e2e/vendor/k8s.io/dynamic-resource-allocation/api/zz_generated.conversion.go b/e2e/vendor/k8s.io/dynamic-resource-allocation/api/zz_generated.conversion.go index 36481d9af..f509b7aea 100644 --- a/e2e/vendor/k8s.io/dynamic-resource-allocation/api/zz_generated.conversion.go +++ b/e2e/vendor/k8s.io/dynamic-resource-allocation/api/zz_generated.conversion.go @@ -26,6 +26,7 @@ import ( v1 "k8s.io/api/core/v1" v1beta1 "k8s.io/api/resource/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -47,6 +48,26 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*Counter)(nil), (*v1beta1.Counter)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_api_Counter_To_v1beta1_Counter(a.(*Counter), b.(*v1beta1.Counter), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.Counter)(nil), (*Counter)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Counter_To_api_Counter(a.(*v1beta1.Counter), b.(*Counter), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*CounterSet)(nil), (*v1beta1.CounterSet)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_api_CounterSet_To_v1beta1_CounterSet(a.(*CounterSet), b.(*v1beta1.CounterSet), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.CounterSet)(nil), (*CounterSet)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_CounterSet_To_api_CounterSet(a.(*v1beta1.CounterSet), b.(*CounterSet), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*Device)(nil), (*v1beta1.Device)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_api_Device_To_v1beta1_Device(a.(*Device), b.(*v1beta1.Device), scope) }); err != nil { @@ -77,6 +98,26 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*DeviceCounterConsumption)(nil), (*v1beta1.DeviceCounterConsumption)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_api_DeviceCounterConsumption_To_v1beta1_DeviceCounterConsumption(a.(*DeviceCounterConsumption), b.(*v1beta1.DeviceCounterConsumption), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.DeviceCounterConsumption)(nil), (*DeviceCounterConsumption)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_DeviceCounterConsumption_To_api_DeviceCounterConsumption(a.(*v1beta1.DeviceCounterConsumption), b.(*DeviceCounterConsumption), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*DeviceTaint)(nil), (*v1beta1.DeviceTaint)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_api_DeviceTaint_To_v1beta1_DeviceTaint(a.(*DeviceTaint), b.(*v1beta1.DeviceTaint), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.DeviceTaint)(nil), (*DeviceTaint)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_DeviceTaint_To_api_DeviceTaint(a.(*v1beta1.DeviceTaint), b.(*DeviceTaint), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*ResourcePool)(nil), (*v1beta1.ResourcePool)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_api_ResourcePool_To_v1beta1_ResourcePool(a.(*ResourcePool), b.(*v1beta1.ResourcePool), scope) }); err != nil { @@ -123,6 +164,21 @@ func RegisterConversions(s *runtime.Scheme) error { func autoConvert_api_BasicDevice_To_v1beta1_BasicDevice(in *BasicDevice, out *v1beta1.BasicDevice, s conversion.Scope) error { out.Attributes = *(*map[v1beta1.QualifiedName]v1beta1.DeviceAttribute)(unsafe.Pointer(&in.Attributes)) out.Capacity = *(*map[v1beta1.QualifiedName]v1beta1.DeviceCapacity)(unsafe.Pointer(&in.Capacity)) + if in.ConsumesCounters != nil { + in, out := &in.ConsumesCounters, &out.ConsumesCounters + *out = make([]v1beta1.DeviceCounterConsumption, len(*in)) + for i := range *in { + if err := Convert_api_DeviceCounterConsumption_To_v1beta1_DeviceCounterConsumption(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.ConsumesCounters = nil + } + out.NodeName = (*string)(unsafe.Pointer(in.NodeName)) + out.NodeSelector = (*v1.NodeSelector)(unsafe.Pointer(in.NodeSelector)) + out.AllNodes = (*bool)(unsafe.Pointer(in.AllNodes)) + out.Taints = *(*[]v1beta1.DeviceTaint)(unsafe.Pointer(&in.Taints)) return nil } @@ -134,6 +190,21 @@ func Convert_api_BasicDevice_To_v1beta1_BasicDevice(in *BasicDevice, out *v1beta func autoConvert_v1beta1_BasicDevice_To_api_BasicDevice(in *v1beta1.BasicDevice, out *BasicDevice, s conversion.Scope) error { out.Attributes = *(*map[QualifiedName]DeviceAttribute)(unsafe.Pointer(&in.Attributes)) out.Capacity = *(*map[QualifiedName]DeviceCapacity)(unsafe.Pointer(&in.Capacity)) + if in.ConsumesCounters != nil { + in, out := &in.ConsumesCounters, &out.ConsumesCounters + *out = make([]DeviceCounterConsumption, len(*in)) + for i := range *in { + if err := Convert_v1beta1_DeviceCounterConsumption_To_api_DeviceCounterConsumption(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.ConsumesCounters = nil + } + out.NodeName = (*string)(unsafe.Pointer(in.NodeName)) + out.NodeSelector = (*v1.NodeSelector)(unsafe.Pointer(in.NodeSelector)) + out.AllNodes = (*bool)(unsafe.Pointer(in.AllNodes)) + out.Taints = *(*[]v1beta1.DeviceTaint)(unsafe.Pointer(&in.Taints)) return nil } @@ -142,11 +213,65 @@ func Convert_v1beta1_BasicDevice_To_api_BasicDevice(in *v1beta1.BasicDevice, out return autoConvert_v1beta1_BasicDevice_To_api_BasicDevice(in, out, s) } +func autoConvert_api_Counter_To_v1beta1_Counter(in *Counter, out *v1beta1.Counter, s conversion.Scope) error { + out.Value = in.Value + return nil +} + +// Convert_api_Counter_To_v1beta1_Counter is an autogenerated conversion function. +func Convert_api_Counter_To_v1beta1_Counter(in *Counter, out *v1beta1.Counter, s conversion.Scope) error { + return autoConvert_api_Counter_To_v1beta1_Counter(in, out, s) +} + +func autoConvert_v1beta1_Counter_To_api_Counter(in *v1beta1.Counter, out *Counter, s conversion.Scope) error { + out.Value = in.Value + return nil +} + +// Convert_v1beta1_Counter_To_api_Counter is an autogenerated conversion function. +func Convert_v1beta1_Counter_To_api_Counter(in *v1beta1.Counter, out *Counter, s conversion.Scope) error { + return autoConvert_v1beta1_Counter_To_api_Counter(in, out, s) +} + +func autoConvert_api_CounterSet_To_v1beta1_CounterSet(in *CounterSet, out *v1beta1.CounterSet, s conversion.Scope) error { + if err := Convert_api_UniqueString_To_string(&in.Name, &out.Name, s); err != nil { + return err + } + out.Counters = *(*map[string]v1beta1.Counter)(unsafe.Pointer(&in.Counters)) + return nil +} + +// Convert_api_CounterSet_To_v1beta1_CounterSet is an autogenerated conversion function. +func Convert_api_CounterSet_To_v1beta1_CounterSet(in *CounterSet, out *v1beta1.CounterSet, s conversion.Scope) error { + return autoConvert_api_CounterSet_To_v1beta1_CounterSet(in, out, s) +} + +func autoConvert_v1beta1_CounterSet_To_api_CounterSet(in *v1beta1.CounterSet, out *CounterSet, s conversion.Scope) error { + if err := Convert_string_To_api_UniqueString(&in.Name, &out.Name, s); err != nil { + return err + } + out.Counters = *(*map[string]Counter)(unsafe.Pointer(&in.Counters)) + return nil +} + +// Convert_v1beta1_CounterSet_To_api_CounterSet is an autogenerated conversion function. +func Convert_v1beta1_CounterSet_To_api_CounterSet(in *v1beta1.CounterSet, out *CounterSet, s conversion.Scope) error { + return autoConvert_v1beta1_CounterSet_To_api_CounterSet(in, out, s) +} + func autoConvert_api_Device_To_v1beta1_Device(in *Device, out *v1beta1.Device, s conversion.Scope) error { if err := Convert_api_UniqueString_To_string(&in.Name, &out.Name, s); err != nil { return err } - out.Basic = (*v1beta1.BasicDevice)(unsafe.Pointer(in.Basic)) + if in.Basic != nil { + in, out := &in.Basic, &out.Basic + *out = new(v1beta1.BasicDevice) + if err := Convert_api_BasicDevice_To_v1beta1_BasicDevice(*in, *out, s); err != nil { + return err + } + } else { + out.Basic = nil + } return nil } @@ -159,7 +284,15 @@ func autoConvert_v1beta1_Device_To_api_Device(in *v1beta1.Device, out *Device, s if err := Convert_string_To_api_UniqueString(&in.Name, &out.Name, s); err != nil { return err } - out.Basic = (*BasicDevice)(unsafe.Pointer(in.Basic)) + if in.Basic != nil { + in, out := &in.Basic, &out.Basic + *out = new(BasicDevice) + if err := Convert_v1beta1_BasicDevice_To_api_BasicDevice(*in, *out, s); err != nil { + return err + } + } else { + out.Basic = nil + } return nil } @@ -214,6 +347,58 @@ func Convert_v1beta1_DeviceCapacity_To_api_DeviceCapacity(in *v1beta1.DeviceCapa return autoConvert_v1beta1_DeviceCapacity_To_api_DeviceCapacity(in, out, s) } +func autoConvert_api_DeviceCounterConsumption_To_v1beta1_DeviceCounterConsumption(in *DeviceCounterConsumption, out *v1beta1.DeviceCounterConsumption, s conversion.Scope) error { + if err := Convert_api_UniqueString_To_string(&in.CounterSet, &out.CounterSet, s); err != nil { + return err + } + out.Counters = *(*map[string]v1beta1.Counter)(unsafe.Pointer(&in.Counters)) + return nil +} + +// Convert_api_DeviceCounterConsumption_To_v1beta1_DeviceCounterConsumption is an autogenerated conversion function. +func Convert_api_DeviceCounterConsumption_To_v1beta1_DeviceCounterConsumption(in *DeviceCounterConsumption, out *v1beta1.DeviceCounterConsumption, s conversion.Scope) error { + return autoConvert_api_DeviceCounterConsumption_To_v1beta1_DeviceCounterConsumption(in, out, s) +} + +func autoConvert_v1beta1_DeviceCounterConsumption_To_api_DeviceCounterConsumption(in *v1beta1.DeviceCounterConsumption, out *DeviceCounterConsumption, s conversion.Scope) error { + if err := Convert_string_To_api_UniqueString(&in.CounterSet, &out.CounterSet, s); err != nil { + return err + } + out.Counters = *(*map[string]Counter)(unsafe.Pointer(&in.Counters)) + return nil +} + +// Convert_v1beta1_DeviceCounterConsumption_To_api_DeviceCounterConsumption is an autogenerated conversion function. +func Convert_v1beta1_DeviceCounterConsumption_To_api_DeviceCounterConsumption(in *v1beta1.DeviceCounterConsumption, out *DeviceCounterConsumption, s conversion.Scope) error { + return autoConvert_v1beta1_DeviceCounterConsumption_To_api_DeviceCounterConsumption(in, out, s) +} + +func autoConvert_api_DeviceTaint_To_v1beta1_DeviceTaint(in *DeviceTaint, out *v1beta1.DeviceTaint, s conversion.Scope) error { + out.Key = in.Key + out.Value = in.Value + out.Effect = v1beta1.DeviceTaintEffect(in.Effect) + out.TimeAdded = (*metav1.Time)(unsafe.Pointer(in.TimeAdded)) + return nil +} + +// Convert_api_DeviceTaint_To_v1beta1_DeviceTaint is an autogenerated conversion function. +func Convert_api_DeviceTaint_To_v1beta1_DeviceTaint(in *DeviceTaint, out *v1beta1.DeviceTaint, s conversion.Scope) error { + return autoConvert_api_DeviceTaint_To_v1beta1_DeviceTaint(in, out, s) +} + +func autoConvert_v1beta1_DeviceTaint_To_api_DeviceTaint(in *v1beta1.DeviceTaint, out *DeviceTaint, s conversion.Scope) error { + out.Key = in.Key + out.Value = in.Value + out.Effect = DeviceTaintEffect(in.Effect) + out.TimeAdded = (*metav1.Time)(unsafe.Pointer(in.TimeAdded)) + return nil +} + +// Convert_v1beta1_DeviceTaint_To_api_DeviceTaint is an autogenerated conversion function. +func Convert_v1beta1_DeviceTaint_To_api_DeviceTaint(in *v1beta1.DeviceTaint, out *DeviceTaint, s conversion.Scope) error { + return autoConvert_v1beta1_DeviceTaint_To_api_DeviceTaint(in, out, s) +} + func autoConvert_api_ResourcePool_To_v1beta1_ResourcePool(in *ResourcePool, out *v1beta1.ResourcePool, s conversion.Scope) error { if err := Convert_api_UniqueString_To_string(&in.Name, &out.Name, s); err != nil { return err @@ -291,6 +476,18 @@ func autoConvert_api_ResourceSliceSpec_To_v1beta1_ResourceSliceSpec(in *Resource } else { out.Devices = nil } + out.PerDeviceNodeSelection = (*bool)(unsafe.Pointer(in.PerDeviceNodeSelection)) + if in.SharedCounters != nil { + in, out := &in.SharedCounters, &out.SharedCounters + *out = make([]v1beta1.CounterSet, len(*in)) + for i := range *in { + if err := Convert_api_CounterSet_To_v1beta1_CounterSet(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.SharedCounters = nil + } return nil } @@ -322,6 +519,18 @@ func autoConvert_v1beta1_ResourceSliceSpec_To_api_ResourceSliceSpec(in *v1beta1. } else { out.Devices = nil } + out.PerDeviceNodeSelection = (*bool)(unsafe.Pointer(in.PerDeviceNodeSelection)) + if in.SharedCounters != nil { + in, out := &in.SharedCounters, &out.SharedCounters + *out = make([]CounterSet, len(*in)) + for i := range *in { + if err := Convert_v1beta1_CounterSet_To_api_CounterSet(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.SharedCounters = nil + } return nil } diff --git a/e2e/vendor/k8s.io/dynamic-resource-allocation/cel/cache.go b/e2e/vendor/k8s.io/dynamic-resource-allocation/cel/cache.go index 2868886c5..e807ba2b9 100644 --- a/e2e/vendor/k8s.io/dynamic-resource-allocation/cel/cache.go +++ b/e2e/vendor/k8s.io/dynamic-resource-allocation/cel/cache.go @@ -43,6 +43,8 @@ func NewCache(maxCacheEntries int) *Cache { // GetOrCompile checks whether the cache already has a compilation result // and returns that if available. Otherwise it compiles, stores successful // results and returns the new result. +// +// Cost estimation is disabled. func (c *Cache) GetOrCompile(expression string) CompilationResult { // Compiling a CEL expression is expensive enough that it is cheaper // to lock a mutex than doing it several times in parallel. @@ -55,7 +57,7 @@ func (c *Cache) GetOrCompile(expression string) CompilationResult { return *cached } - expr := GetCompiler().CompileCELExpression(expression, Options{}) + expr := GetCompiler().CompileCELExpression(expression, Options{DisableCostEstimation: true}) if expr.Error == nil { c.add(expression, &expr) } diff --git a/e2e/vendor/k8s.io/dynamic-resource-allocation/cel/compile.go b/e2e/vendor/k8s.io/dynamic-resource-allocation/cel/compile.go index 9ad4bed0f..3c3b1265b 100644 --- a/e2e/vendor/k8s.io/dynamic-resource-allocation/cel/compile.go +++ b/e2e/vendor/k8s.io/dynamic-resource-allocation/cel/compile.go @@ -20,24 +20,27 @@ import ( "context" "errors" "fmt" + "math" "reflect" "strings" "sync" "github.com/blang/semver/v4" "github.com/google/cel-go/cel" + "github.com/google/cel-go/checker" "github.com/google/cel-go/common/types" "github.com/google/cel-go/common/types/ref" "github.com/google/cel-go/common/types/traits" "github.com/google/cel-go/ext" + "k8s.io/utils/ptr" + resourceapi "k8s.io/api/resource/v1beta1" "k8s.io/apimachinery/pkg/util/version" celconfig "k8s.io/apiserver/pkg/apis/cel" apiservercel "k8s.io/apiserver/pkg/cel" "k8s.io/apiserver/pkg/cel/environment" "k8s.io/apiserver/pkg/cel/library" - "k8s.io/utils/ptr" ) const ( @@ -50,6 +53,23 @@ const ( var ( lazyCompilerInit sync.Once lazyCompiler *compiler + + // A variant of AnyType = https://github.com/kubernetes/kubernetes/blob/ec2e0de35a298363872897e5904501b029817af3/staging/src/k8s.io/apiserver/pkg/cel/types.go#L550: + // unknown actual type (could be bool, int, string, etc.) but with a known maximum size. + attributeType = withMaxElements(apiservercel.AnyType, resourceapi.DeviceAttributeMaxValueLength) + + // Other strings also have a known maximum size. + domainType = withMaxElements(apiservercel.StringType, resourceapi.DeviceMaxDomainLength) + idType = withMaxElements(apiservercel.StringType, resourceapi.DeviceMaxIDLength) + driverType = withMaxElements(apiservercel.StringType, resourceapi.DriverNameMaxLength) + + // Each map is bound by the maximum number of different attributes. + innerAttributesMapType = apiservercel.NewMapType(idType, attributeType, resourceapi.ResourceSliceMaxAttributesAndCapacitiesPerDevice) + outerAttributesMapType = apiservercel.NewMapType(domainType, innerAttributesMapType, resourceapi.ResourceSliceMaxAttributesAndCapacitiesPerDevice) + + // Same for capacity. + innerCapacityMapType = apiservercel.NewMapType(idType, apiservercel.QuantityDeclType, resourceapi.ResourceSliceMaxAttributesAndCapacitiesPerDevice) + outerCapacityMapType = apiservercel.NewMapType(domainType, innerCapacityMapType, resourceapi.ResourceSliceMaxAttributesAndCapacitiesPerDevice) ) func GetCompiler() *compiler { @@ -85,11 +105,12 @@ type Device struct { } type compiler struct { - envset *environment.EnvSet -} - -func newCompiler() *compiler { - return &compiler{envset: mustBuildEnv()} + // deviceType is a definition for the type of the `device` variable. + // This is needed for the cost estimator. Both are currently version-independent. + // If that ever changes, some additional logic might be needed to make + // cost estimates version-dependent. + deviceType *apiservercel.DeclType + envset *environment.EnvSet } // Options contains several additional parameters @@ -101,6 +122,10 @@ type Options struct { // CostLimit allows overriding the default runtime cost limit [resourceapi.CELSelectorExpressionMaxCost]. CostLimit *uint64 + + // DisableCostEstimation can be set to skip estimating the worst-case CEL cost. + // If disabled or after an error, [CompilationResult.MaxCost] will be set to [math.Uint64]. + DisableCostEstimation bool } // CompileCELExpression returns a compiled CEL expression. It evaluates to bool. @@ -114,6 +139,7 @@ func (c compiler) CompileCELExpression(expression string, options Options) Compi Detail: errorString, }, Expression: expression, + MaxCost: math.MaxUint64, } } @@ -122,10 +148,6 @@ func (c compiler) CompileCELExpression(expression string, options Options) Compi return resultError(fmt.Sprintf("unexpected error loading CEL environment: %v", err), apiservercel.ErrorTypeInternal) } - // We don't have a SizeEstimator. The potential size of the input (= a - // device) is already declared in the definition of the environment. - estimator := &library.CostEstimator{} - ast, issues := env.Compile(expression) if issues != nil { return resultError("compilation failed: "+issues.String(), apiservercel.ErrorTypeInvalid) @@ -157,18 +179,28 @@ func (c compiler) CompileCELExpression(expression string, options Options) Compi OutputType: ast.OutputType(), Environment: env, emptyMapVal: env.CELTypeAdapter().NativeToValue(map[string]any{}), + MaxCost: math.MaxUint64, } - costEst, err := env.EstimateCost(ast, estimator) - if err != nil { - compilationResult.Error = &apiservercel.Error{Type: apiservercel.ErrorTypeInternal, Detail: "cost estimation failed: " + err.Error()} - return compilationResult + if !options.DisableCostEstimation { + // We don't have a SizeEstimator. The potential size of the input (= a + // device) is already declared in the definition of the environment. + estimator := c.newCostEstimator() + costEst, err := env.EstimateCost(ast, estimator) + if err != nil { + compilationResult.Error = &apiservercel.Error{Type: apiservercel.ErrorTypeInternal, Detail: "cost estimation failed: " + err.Error()} + return compilationResult + } + compilationResult.MaxCost = costEst.Max } - compilationResult.MaxCost = costEst.Max return compilationResult } +func (c *compiler) newCostEstimator() *library.CostEstimator { + return &library.CostEstimator{SizeEstimator: &sizeEstimator{compiler: c}} +} + // getAttributeValue returns the native representation of the one value that // should be stored in the attribute, otherwise an error. An error is // also returned when there is no supported value. @@ -241,7 +273,7 @@ func (c CompilationResult) DeviceMatches(ctx context.Context, input Device) (boo return resultBool, details, nil } -func mustBuildEnv() *environment.EnvSet { +func newCompiler() *compiler { envset := environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion(), true /* strictCost */) field := func(name string, declType *apiservercel.DeclType, required bool) *apiservercel.DeclField { return apiservercel.NewDeclField(name, declType, required, nil, nil) @@ -253,10 +285,11 @@ func mustBuildEnv() *environment.EnvSet { } return result } + deviceType := apiservercel.NewObjectType("kubernetes.DRADevice", fields( - field(driverVar, apiservercel.StringType, true), - field(attributesVar, apiservercel.NewMapType(apiservercel.StringType, apiservercel.NewMapType(apiservercel.StringType, apiservercel.AnyType, resourceapi.ResourceSliceMaxAttributesAndCapacitiesPerDevice), resourceapi.ResourceSliceMaxAttributesAndCapacitiesPerDevice), true), - field(capacityVar, apiservercel.NewMapType(apiservercel.StringType, apiservercel.NewMapType(apiservercel.StringType, apiservercel.QuantityDeclType, resourceapi.ResourceSliceMaxAttributesAndCapacitiesPerDevice), resourceapi.ResourceSliceMaxAttributesAndCapacitiesPerDevice), true), + field(driverVar, driverType, true), + field(attributesVar, outerAttributesMapType, true), + field(capacityVar, outerCapacityMapType, true), )) versioned := []environment.VersionedOptions{ @@ -265,8 +298,6 @@ func mustBuildEnv() *environment.EnvSet { EnvOptions: []cel.EnvOption{ cel.Variable(deviceVar, deviceType.CelType()), - environment.UnversionedLib(library.SemverLib), - // https://pkg.go.dev/github.com/google/cel-go/ext#Bindings // // This is useful to simplify attribute lookups because the @@ -279,12 +310,34 @@ func mustBuildEnv() *environment.EnvSet { deviceType, }, }, + { + IntroducedVersion: version.MajorMinor(1, 31), + // This library has added to base environment of Kubernetes + // in 1.33 at version 1. It will continue to be available for + // use in this environment, but does not need to be included + // directly since it becomes available indirectly via the base + // environment shared across Kubernetes. + // In Kubernetes 1.34, version 1 feature of this library will + // become available, and will be rollback safe to 1.33. + // TODO: In Kubernetes 1.34: Add compile tests that demonstrate that + // `isSemver("v1.0.0", true)` and `semver("v1.0.0", true)` are supported. + RemovedVersion: version.MajorMinor(1, 33), + EnvOptions: []cel.EnvOption{ + library.SemverLib(library.SemverVersion(0)), + }, + }, } envset, err := envset.Extend(versioned...) if err != nil { panic(fmt.Errorf("internal error building CEL environment: %w", err)) } - return envset + return &compiler{envset: envset, deviceType: deviceType} +} + +func withMaxElements(in *apiservercel.DeclType, maxElements uint64) *apiservercel.DeclType { + out := *in + out.MaxElements = int64(maxElements) + return &out } // parseQualifiedName splits into domain and identified, using the default domain @@ -322,3 +375,67 @@ func (m mapper) Find(key ref.Val) (ref.Val, bool) { return m.defaultValue, true } + +// sizeEstimator tells the cost estimator the maximum size of maps or strings accessible through the `device` variable. +// Without this, the maximum string size of e.g. `device.attributes["dra.example.com"].services` would be unknown. +// +// sizeEstimator is derived from the sizeEstimator in k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel. +type sizeEstimator struct { + compiler *compiler +} + +func (s *sizeEstimator) EstimateSize(element checker.AstNode) *checker.SizeEstimate { + path := element.Path() + if len(path) == 0 { + // Path() can return an empty list, early exit if it does since we can't + // provide size estimates when that happens + return nil + } + + // The estimator provides information about the environment's variable(s). + var currentNode *apiservercel.DeclType + switch path[0] { + case deviceVar: + currentNode = s.compiler.deviceType + default: + // Unknown root, shouldn't happen. + return nil + } + + // Cut off initial variable from path, it was checked above. + for _, name := range path[1:] { + switch name { + case "@items", "@values": + if currentNode.ElemType == nil { + return nil + } + currentNode = currentNode.ElemType + case "@keys": + if currentNode.KeyType == nil { + return nil + } + currentNode = currentNode.KeyType + default: + field, ok := currentNode.Fields[name] + if !ok { + // If this is an attribute map, then we know that all elements + // have the same maximum size as set in attributeType, regardless + // of their name. + if currentNode.ElemType == attributeType { + currentNode = attributeType + continue + } + return nil + } + if field.Type == nil { + return nil + } + currentNode = field.Type + } + } + return &checker.SizeEstimate{Min: 0, Max: uint64(currentNode.MaxElements)} +} + +func (s *sizeEstimator) EstimateCallCost(function, overloadID string, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate { + return nil +} diff --git a/e2e/vendor/k8s.io/dynamic-resource-allocation/internal/queue/fifo.go b/e2e/vendor/k8s.io/dynamic-resource-allocation/internal/queue/fifo.go new file mode 100644 index 000000000..23d4157d6 --- /dev/null +++ b/e2e/vendor/k8s.io/dynamic-resource-allocation/internal/queue/fifo.go @@ -0,0 +1,112 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// TODO: This is duplicated from ./pkg/scheduler/util/queue because that +// package is not allowed to be imported here. +package queue + +const ( + // normalSize limits the size of the buffer that is kept + // for reuse. + normalSize = 4 +) + +// FIFO implements a first-in-first-out queue with unbounded size. +// The null FIFO is a valid empty queue. +// +// Access must be protected by the caller when used concurrently by +// different goroutines, the queue itself implements no locking. +type FIFO[T any] struct { + // elements contains a buffer for elements which have been + // pushed and not popped yet. Two scenarios are possible: + // - one chunk in the middle (start <= end) + // - one chunk at the end, followed by one chunk at the + // beginning (end <= start) + // + // start == end can be either an empty queue or a completely + // full one (with two chunks). + elements []T + + // len counts the number of elements which have been pushed and + // not popped yet. + len int + + // start is the index of the first valid element. + start int + + // end is the index after the last valid element. + end int +} + +func (q *FIFO[T]) Len() int { + return q.len +} + +func (q *FIFO[T]) Push(element T) { + size := len(q.elements) + if q.len == size { + // Need larger buffer. + newSize := size * 2 + if newSize == 0 { + newSize = normalSize + } + elements := make([]T, newSize) + if q.start == 0 { + copy(elements, q.elements) + } else { + copy(elements, q.elements[q.start:]) + copy(elements[len(q.elements)-q.start:], q.elements[0:q.end]) + } + q.start = 0 + q.end = q.len + q.elements = elements + size = newSize + } + if q.end == size { + // Wrap around. + q.elements[0] = element + q.end = 1 + q.len++ + return + } + q.elements[q.end] = element + q.end++ + q.len++ +} + +func (q *FIFO[T]) Pop() (element T, ok bool) { + if q.len == 0 { + return + } + element = q.elements[q.start] + q.start++ + if q.start == len(q.elements) { + // Wrap around. + q.start = 0 + } + q.len-- + + // Once it is empty, shrink down to avoid hanging onto + // a large buffer forever. + if q.len == 0 && len(q.elements) > normalSize { + q.elements = make([]T, normalSize) + q.start = 0 + q.end = 0 + } + + ok = true + return +} diff --git a/e2e/vendor/k8s.io/dynamic-resource-allocation/resourceclaim/devicetoleration.go b/e2e/vendor/k8s.io/dynamic-resource-allocation/resourceclaim/devicetoleration.go new file mode 100644 index 000000000..4e14f8772 --- /dev/null +++ b/e2e/vendor/k8s.io/dynamic-resource-allocation/resourceclaim/devicetoleration.go @@ -0,0 +1,53 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package resourceclaim + +import ( + resourceapi "k8s.io/api/resource/v1beta1" +) + +// ToleratesTaint checks if the toleration tolerates the taint. +// The matching follows the rules below: +// +// 1. Empty toleration.effect means to match all taint effects, +// otherwise taint effect must equal to toleration.effect. +// 2. If toleration.operator is 'Exists', it means to match all taint values. +// 3. Empty toleration.key means to match all taint keys. +// If toleration.key is empty, toleration.operator must be 'Exists'; +// this combination means to match all taint values and all taint keys. +func ToleratesTaint(toleration resourceapi.DeviceToleration, taint resourceapi.DeviceTaint) bool { + // This code was copied from https://github.com/kubernetes/kubernetes/blob/f007012f5fe49e40ae0596cf463a8e7b247b3357/staging/src/k8s.io/api/core/v1/toleration.go#L39-L56. + // It wasn't placed in the resourceapi package because code related to logic + // doesn't belong there. + if toleration.Effect != "" && toleration.Effect != taint.Effect { + return false + } + + if toleration.Key != "" && toleration.Key != taint.Key { + return false + } + + switch toleration.Operator { + // Empty operator means Equal, should be set because of defaulting. + case "", resourceapi.DeviceTolerationOpEqual: + return toleration.Value == taint.Value + case resourceapi.DeviceTolerationOpExists: + return true + default: + return false + } +} diff --git a/e2e/vendor/k8s.io/dynamic-resource-allocation/resourceclaim/resourceclaim.go b/e2e/vendor/k8s.io/dynamic-resource-allocation/resourceclaim/resourceclaim.go index e2c895f34..d25c70f5e 100644 --- a/e2e/vendor/k8s.io/dynamic-resource-allocation/resourceclaim/resourceclaim.go +++ b/e2e/vendor/k8s.io/dynamic-resource-allocation/resourceclaim/resourceclaim.go @@ -26,6 +26,8 @@ package resourceclaim import ( "errors" "fmt" + "slices" + "strings" v1 "k8s.io/api/core/v1" resourceapi "k8s.io/api/resource/v1beta1" @@ -106,3 +108,36 @@ func CanBeReserved(claim *resourceapi.ResourceClaim) bool { // Currently no restrictions on sharing... return true } + +// BaseRequestRef returns the request name if the reference is to a top-level +// request and the name of the parent request if the reference is to a subrequest. +func BaseRequestRef(requestRef string) string { + segments := strings.Split(requestRef, "/") + return segments[0] +} + +// ConfigForResult returns the configs that are applicable to device +// allocated for the provided result. +func ConfigForResult(deviceConfigurations []resourceapi.DeviceAllocationConfiguration, result resourceapi.DeviceRequestAllocationResult) []resourceapi.DeviceAllocationConfiguration { + var configs []resourceapi.DeviceAllocationConfiguration + for _, deviceConfiguration := range deviceConfigurations { + if deviceConfiguration.Opaque != nil && + isMatch(deviceConfiguration.Requests, result.Request) { + configs = append(configs, deviceConfiguration) + } + } + return configs +} + +func isMatch(requests []string, requestRef string) bool { + if len(requests) == 0 { + return true + } + + if slices.Contains(requests, requestRef) { + return true + } + + baseRequestRef := BaseRequestRef(requestRef) + return slices.Contains(requests, baseRequestRef) +} diff --git a/e2e/vendor/k8s.io/dynamic-resource-allocation/resourceslice/tracker/tracker.go b/e2e/vendor/k8s.io/dynamic-resource-allocation/resourceslice/tracker/tracker.go new file mode 100644 index 000000000..2f198b130 --- /dev/null +++ b/e2e/vendor/k8s.io/dynamic-resource-allocation/resourceslice/tracker/tracker.go @@ -0,0 +1,798 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package tracker + +import ( + "context" + "errors" + "fmt" + "slices" + "sync" + + "github.com/google/go-cmp/cmp" //nolint:depguard + + v1 "k8s.io/api/core/v1" + resourcealphaapi "k8s.io/api/resource/v1alpha3" + resourceapi "k8s.io/api/resource/v1beta1" + labels "k8s.io/apimachinery/pkg/labels" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/apimachinery/pkg/util/sets" + resourcealphainformers "k8s.io/client-go/informers/resource/v1alpha3" + resourceinformers "k8s.io/client-go/informers/resource/v1beta1" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/kubernetes/scheme" + v1core "k8s.io/client-go/kubernetes/typed/core/v1" + resourcelisters "k8s.io/client-go/listers/resource/v1beta1" + "k8s.io/client-go/tools/cache" + "k8s.io/client-go/tools/record" + "k8s.io/dynamic-resource-allocation/cel" + "k8s.io/dynamic-resource-allocation/internal/queue" + "k8s.io/klog/v2" + "k8s.io/utils/ptr" +) + +const ( + driverPoolDeviceIndexName = "driverPoolDevice" + + anyDriver = "*" + anyPool = "*" + anyDevice = "*" +) + +// Tracker maintains a view of ResourceSlice objects with matching +// DeviceTaintRules applied. It is backed by informers to process +// potential changes to resolved ResourceSlices asynchronously. +type Tracker struct { + enableDeviceTaints bool + + resourceSliceLister resourcelisters.ResourceSliceLister + resourceSlices cache.SharedIndexInformer + resourceSlicesHandle cache.ResourceEventHandlerRegistration + deviceTaints cache.SharedIndexInformer + deviceTaintsHandle cache.ResourceEventHandlerRegistration + deviceClasses cache.SharedIndexInformer + deviceClassesHandle cache.ResourceEventHandlerRegistration + celCache *cel.Cache + patchedResourceSlices cache.Store + broadcaster record.EventBroadcaster + recorder record.EventRecorder + // handleError usually refers to [utilruntime.HandleErrorWithContext] but + // may be overridden in tests. + handleError func(context.Context, error, string, ...any) + + // Synchronizes updates to these fields related to event handlers. + rwMutex sync.RWMutex + // All registered event handlers. + eventHandlers []cache.ResourceEventHandler + // The eventQueue contains functions which deliver an event to one + // event handler. + // + // These functions must be invoked while *not locking* rwMutex because + // the event handlers are allowed to access the cache. Holding rwMutex + // then would cause a deadlock. + // + // New functions get added as part of processing a cache update while + // the rwMutex is locked. Each function which adds something to the queue + // also drains the queue before returning, therefore it is guaranteed + // that all event handlers get notified immediately (useful for unit + // testing). + // + // A channel cannot be used here because it cannot have an unbounded + // capacity. This could lead to a deadlock (writer holds rwMutex, + // gets blocked because capacity is exhausted, reader is in a handler + // which tries to lock the rwMutex). Writing into such a channel + // while not holding the rwMutex doesn't work because in-order delivery + // of events would no longer be guaranteed. + eventQueue queue.FIFO[func()] +} + +// Options configure a [Tracker]. +type Options struct { + // EnableDeviceTaints controls whether DeviceTaintRules + // will be reflected in ResourceSlices reported by the tracker. + // + // If false, then TaintInformer and ClassInformer + // are not needed. The tracker turns into + // a thin wrapper around the underlying + // SliceInformer, with no processing of its own. + EnableDeviceTaints bool + + SliceInformer resourceinformers.ResourceSliceInformer + TaintInformer resourcealphainformers.DeviceTaintRuleInformer + ClassInformer resourceinformers.DeviceClassInformer + + // KubeClient is used to generate Events when CEL expressions + // encounter runtime errors. + KubeClient kubernetes.Interface +} + +// StartTracker creates and initializes informers for a new [Tracker]. +func StartTracker(ctx context.Context, opts Options) (finalT *Tracker, finalErr error) { + if !opts.EnableDeviceTaints { + // Minimal wrapper. All public methods shortcut by calling the underlying informer. + return &Tracker{ + resourceSliceLister: opts.SliceInformer.Lister(), + resourceSlices: opts.SliceInformer.Informer(), + }, nil + } + + t, err := newTracker(ctx, opts) + if err != nil { + return nil, err + } + defer func() { + // If we don't return the tracker, stop the partially initialized instance. + if finalErr != nil { + t.Stop() + } + }() + if err := t.initInformers(ctx); err != nil { + return nil, fmt.Errorf("initialize informers: %w", err) + } + return t, nil +} + +// newTracker is used in testing to construct a tracker without informer event handlers. +func newTracker(ctx context.Context, opts Options) (finalT *Tracker, finalErr error) { + t := &Tracker{ + enableDeviceTaints: opts.EnableDeviceTaints, + resourceSliceLister: opts.SliceInformer.Lister(), + resourceSlices: opts.SliceInformer.Informer(), + deviceTaints: opts.TaintInformer.Informer(), + deviceClasses: opts.ClassInformer.Informer(), + celCache: cel.NewCache(10), + patchedResourceSlices: cache.NewStore(cache.MetaNamespaceKeyFunc), + handleError: utilruntime.HandleErrorWithContext, + } + defer func() { + // If we don't return the tracker, stop the partially initialized instance. + if finalErr != nil { + t.Stop() + } + }() + err := t.resourceSlices.AddIndexers(cache.Indexers{driverPoolDeviceIndexName: sliceDriverPoolDeviceIndexFunc}) + if err != nil { + return nil, fmt.Errorf("failed to add %s index to ResourceSlice informer: %w", driverPoolDeviceIndexName, err) + } + // KubeClient is not always set in unit tests. + if opts.KubeClient != nil { + t.broadcaster = record.NewBroadcaster(record.WithContext(ctx)) + t.broadcaster.StartLogging(klog.Infof) + t.broadcaster.StartRecordingToSink(&v1core.EventSinkImpl{Interface: opts.KubeClient.CoreV1().Events("")}) + t.recorder = t.broadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: "resource_slice_tracker"}) + } + + return t, nil +} + +// initInformers adds event handlers to a tracker constructed with newTracker. +func (t *Tracker) initInformers(ctx context.Context) error { + var err error + + sliceHandler := cache.ResourceEventHandlerFuncs{ + AddFunc: t.resourceSliceAdd(ctx), + UpdateFunc: t.resourceSliceUpdate(ctx), + DeleteFunc: t.resourceSliceDelete(ctx), + } + t.resourceSlicesHandle, err = t.resourceSlices.AddEventHandler(sliceHandler) + if err != nil { + return fmt.Errorf("add event handler for ResourceSlices: %w", err) + } + + taintHandler := cache.ResourceEventHandlerFuncs{ + AddFunc: t.deviceTaintAdd(ctx), + UpdateFunc: t.deviceTaintUpdate(ctx), + DeleteFunc: t.deviceTaintDelete(ctx), + } + t.deviceTaintsHandle, err = t.deviceTaints.AddEventHandler(taintHandler) + if err != nil { + return fmt.Errorf("add event handler for DeviceTaintRules: %w", err) + } + + classHandler := cache.ResourceEventHandlerFuncs{ + AddFunc: t.deviceClassAdd(ctx), + UpdateFunc: t.deviceClassUpdate(ctx), + DeleteFunc: t.deviceClassDelete(ctx), + } + t.deviceClassesHandle, err = t.deviceClasses.AddEventHandler(classHandler) + if err != nil { + return fmt.Errorf("add event handler for DeviceClasses: %w", err) + } + + return nil +} + +// HasSynced returns true if the tracker is done with processing all +// currently existing input objects. Adding a new event handler at that +// point is possible and will emit events with up-to-date ResourceSlice +// objects. +func (t *Tracker) HasSynced() bool { + if !t.enableDeviceTaints { + return t.resourceSlices.HasSynced() + } + + if t.resourceSlicesHandle != nil && !t.resourceSlicesHandle.HasSynced() { + return false + } + if t.deviceTaintsHandle != nil && !t.deviceTaintsHandle.HasSynced() { + return false + } + if t.deviceClassesHandle != nil && !t.deviceClassesHandle.HasSynced() { + return false + } + + return true +} + +// Stop ends all background activity and blocks until that shutdown is complete. +func (t *Tracker) Stop() { + if !t.enableDeviceTaints { + return + } + + if t.broadcaster != nil { + t.broadcaster.Shutdown() + } + _ = t.resourceSlices.RemoveEventHandler(t.resourceSlicesHandle) + _ = t.deviceTaints.RemoveEventHandler(t.deviceTaintsHandle) + _ = t.deviceClasses.RemoveEventHandler(t.deviceClassesHandle) +} + +// ListPatchedResourceSlices returns all ResourceSlices in the cluster with +// modifications from DeviceTaints applied. +func (t *Tracker) ListPatchedResourceSlices() ([]*resourceapi.ResourceSlice, error) { + if !t.enableDeviceTaints { + return t.resourceSliceLister.List(labels.Everything()) + } + + return typedSlice[*resourceapi.ResourceSlice](t.patchedResourceSlices.List()), nil +} + +// AddEventHandler adds an event handler to the tracker. Events to a +// single handler are delivered sequentially, but there is no +// coordination between different handlers. A handler may use the +// tracker. +// +// The return value can be used to wait for cache synchronization. +// All currently know ResourceSlices get delivered via Add events +// before this method returns. +func (t *Tracker) AddEventHandler(handler cache.ResourceEventHandler) (cache.ResourceEventHandlerRegistration, error) { + if !t.enableDeviceTaints { + return t.resourceSlices.AddEventHandler(handler) + } + + defer t.emitEvents() + t.rwMutex.Lock() + defer t.rwMutex.Unlock() + + t.eventHandlers = append(t.eventHandlers, handler) + allObjs, _ := t.ListPatchedResourceSlices() + for _, obj := range allObjs { + t.eventQueue.Push(func() { + handler.OnAdd(obj, true) + }) + } + + // The tracker itself provides HasSynced for all registered event handlers. + // We don't support removal, so returning the same handle here for all + // of them is fine. + return t, nil +} + +// emitEvents delivers all pending events that are in the queue, in the order +// in which they were stored there (FIFO). +func (t *Tracker) emitEvents() { + for { + t.rwMutex.Lock() + deliver, ok := t.eventQueue.Pop() + t.rwMutex.Unlock() + + if !ok { + return + } + func() { + defer utilruntime.HandleCrash() + deliver() + }() + } +} + +// pushEvent ensures that all currently registered event handlers get +// notified about a change when the caller starts delivering +// those with emitEvents. +// +// For a delete event, newObj is nil. For an add, oldObj is nil. +// An update has both as non-nil. +func (t *Tracker) pushEvent(oldObj, newObj any) { + t.rwMutex.Lock() + defer t.rwMutex.Unlock() + for _, handler := range t.eventHandlers { + handler := handler + if oldObj == nil { + t.eventQueue.Push(func() { + handler.OnAdd(newObj, false) + }) + } else if newObj == nil { + t.eventQueue.Push(func() { + handler.OnDelete(oldObj) + }) + } else { + t.eventQueue.Push(func() { + handler.OnUpdate(oldObj, newObj) + }) + } + } +} + +func sliceDriverPoolDeviceIndexFunc(obj any) ([]string, error) { + slice := obj.(*resourceapi.ResourceSlice) + drivers := []string{ + anyDriver, + slice.Spec.Driver, + } + pools := []string{ + anyPool, + slice.Spec.Pool.Name, + } + indexValues := make([]string, 0, len(drivers)*len(pools)*(1+len(slice.Spec.Devices))) + for _, driver := range drivers { + for _, pool := range pools { + indexValues = append(indexValues, deviceID(driver, pool, anyDevice)) + for _, device := range slice.Spec.Devices { + indexValues = append(indexValues, deviceID(driver, pool, device.Name)) + } + } + } + return indexValues, nil +} + +func driverPoolDeviceIndexPatchKey(patch *resourcealphaapi.DeviceTaintRule) string { + deviceSelector := ptr.Deref(patch.Spec.DeviceSelector, resourcealphaapi.DeviceTaintSelector{}) + driverKey := ptr.Deref(deviceSelector.Driver, anyDriver) + poolKey := ptr.Deref(deviceSelector.Pool, anyPool) + deviceKey := ptr.Deref(deviceSelector.Device, anyDevice) + return deviceID(driverKey, poolKey, deviceKey) +} + +func (t *Tracker) sliceNamesForPatch(ctx context.Context, patch *resourcealphaapi.DeviceTaintRule) []string { + patchKey := driverPoolDeviceIndexPatchKey(patch) + sliceNames, err := t.resourceSlices.GetIndexer().IndexKeys(driverPoolDeviceIndexName, patchKey) + if err != nil { + t.handleError(ctx, err, "failed listing ResourceSlices for driver/pool/device key", "key", patchKey) + return nil + } + return sliceNames +} + +func (t *Tracker) resourceSliceAdd(ctx context.Context) func(obj any) { + logger := klog.FromContext(ctx) + return func(obj any) { + slice, ok := obj.(*resourceapi.ResourceSlice) + if !ok { + return + } + logger.V(5).Info("ResourceSlice add", "slice", klog.KObj(slice)) + t.syncSlice(ctx, slice.Name, true) + } +} + +func (t *Tracker) resourceSliceUpdate(ctx context.Context) func(oldObj, newObj any) { + logger := klog.FromContext(ctx) + return func(oldObj, newObj any) { + oldSlice, ok := oldObj.(*resourceapi.ResourceSlice) + if !ok { + return + } + newSlice, ok := newObj.(*resourceapi.ResourceSlice) + if !ok { + return + } + if loggerV := logger.V(6); loggerV.Enabled() { + // While debugging, one needs a full dump of the objects for context *and* + // a diff because otherwise small changes would be hard to spot. + loggerV.Info("ResourceSlice update", "slice", klog.Format(oldSlice), "oldSlice", klog.Format(newSlice), "diff", cmp.Diff(oldSlice, newSlice)) + } else { + logger.V(5).Info("ResourceSlice update", "slice", klog.KObj(newSlice)) + } + t.syncSlice(ctx, newSlice.Name, true) + } +} + +func (t *Tracker) resourceSliceDelete(ctx context.Context) func(obj any) { + logger := klog.FromContext(ctx) + return func(obj any) { + if tombstone, ok := obj.(cache.DeletedFinalStateUnknown); ok { + obj = tombstone.Obj + } + slice, ok := obj.(*resourceapi.ResourceSlice) + if !ok { + return + } + logger.V(5).Info("ResourceSlice delete", "slice", klog.KObj(slice)) + t.syncSlice(ctx, slice.Name, true) + } +} + +func (t *Tracker) deviceTaintAdd(ctx context.Context) func(obj any) { + logger := klog.FromContext(ctx) + return func(obj any) { + patch, ok := obj.(*resourcealphaapi.DeviceTaintRule) + if !ok { + return + } + logger.V(5).Info("DeviceTaintRule add", "patch", klog.KObj(patch)) + for _, sliceName := range t.sliceNamesForPatch(ctx, patch) { + t.syncSlice(ctx, sliceName, false) + } + } +} + +func (t *Tracker) deviceTaintUpdate(ctx context.Context) func(oldObj, newObj any) { + logger := klog.FromContext(ctx) + return func(oldObj, newObj any) { + oldPatch, ok := oldObj.(*resourcealphaapi.DeviceTaintRule) + if !ok { + return + } + newPatch, ok := newObj.(*resourcealphaapi.DeviceTaintRule) + if !ok { + return + } + if loggerV := logger.V(6); loggerV.Enabled() { + loggerV.Info("DeviceTaintRule update", "patch", klog.KObj(newPatch), "diff", cmp.Diff(oldPatch, newPatch)) + } else { + logger.V(5).Info("DeviceTaintRule update", "patch", klog.KObj(newPatch)) + } + + // Slices that matched the old patch may need to be updated, in + // case they no longer match the new patch and need to have the + // patch's changes reverted. + slicesToSync := sets.New[string]() + slicesToSync.Insert(t.sliceNamesForPatch(ctx, oldPatch)...) + slicesToSync.Insert(t.sliceNamesForPatch(ctx, newPatch)...) + for _, sliceName := range slicesToSync.UnsortedList() { + t.syncSlice(ctx, sliceName, false) + } + } +} + +func (t *Tracker) deviceTaintDelete(ctx context.Context) func(obj any) { + logger := klog.FromContext(ctx) + return func(obj any) { + if tombstone, ok := obj.(cache.DeletedFinalStateUnknown); ok { + obj = tombstone.Obj + } + patch, ok := obj.(*resourcealphaapi.DeviceTaintRule) + if !ok { + return + } + logger.V(5).Info("DeviceTaintRule delete", "patch", klog.KObj(patch)) + for _, sliceName := range t.sliceNamesForPatch(ctx, patch) { + t.syncSlice(ctx, sliceName, false) + } + } +} + +func (t *Tracker) deviceClassAdd(ctx context.Context) func(obj any) { + logger := klog.FromContext(ctx) + return func(obj any) { + class, ok := obj.(*resourceapi.DeviceClass) + if !ok { + return + } + logger.V(5).Info("DeviceClass add", "class", klog.KObj(class)) + for _, sliceName := range t.resourceSlices.GetIndexer().ListKeys() { + t.syncSlice(ctx, sliceName, false) + } + } +} + +func (t *Tracker) deviceClassUpdate(ctx context.Context) func(oldObj, newObj any) { + logger := klog.FromContext(ctx) + return func(oldObj, newObj any) { + oldClass, ok := oldObj.(*resourceapi.DeviceClass) + if !ok { + return + } + newClass, ok := newObj.(*resourceapi.DeviceClass) + if !ok { + return + } + if loggerV := logger.V(6); loggerV.Enabled() { + loggerV.Info("DeviceClass update", "class", klog.KObj(newClass), "diff", cmp.Diff(oldClass, newClass)) + } else { + logger.V(5).Info("DeviceClass update", "class", klog.KObj(newClass)) + } + for _, sliceName := range t.resourceSlices.GetIndexer().ListKeys() { + t.syncSlice(ctx, sliceName, false) + } + } +} + +func (t *Tracker) deviceClassDelete(ctx context.Context) func(obj any) { + logger := klog.FromContext(ctx) + return func(obj any) { + if tombstone, ok := obj.(cache.DeletedFinalStateUnknown); ok { + obj = tombstone.Obj + } + class, ok := obj.(*resourceapi.ResourceSlice) + if !ok { + return + } + logger.V(5).Info("DeviceClass delete", "class", klog.KObj(class)) + for _, sliceName := range t.resourceSlices.GetIndexer().ListKeys() { + t.syncSlice(ctx, sliceName, false) + } + } +} + +// syncSlice updates the slice with the given name, applying +// DeviceTaints that match. sendEvent is used to force the Tracker +// to publish an event for listeners added by [Tracker.AddEventHandler]. It +// is set when syncSlice is triggered by a ResourceSlice event to avoid +// doing costly DeepEqual comparisons where possible. +func (t *Tracker) syncSlice(ctx context.Context, name string, sendEvent bool) { + defer t.emitEvents() + + logger := klog.FromContext(ctx) + logger = klog.LoggerWithValues(logger, "resourceslice", name) + ctx = klog.NewContext(ctx, logger) + logger.V(5).Info("syncing ResourceSlice") + + obj, sliceExists, err := t.resourceSlices.GetIndexer().GetByKey(name) + if err != nil { + t.handleError(ctx, err, "failed to lookup existing resource slice", "resourceslice", name) + return + } + oldPatchedObj, oldSliceExists, err := t.patchedResourceSlices.GetByKey(name) + if err != nil { + t.handleError(ctx, err, "failed to lookup cached patched resource slice", "resourceslice", name) + return + } + if !sliceExists { + err := t.patchedResourceSlices.Delete(oldPatchedObj) + if err != nil { + t.handleError(ctx, err, "failed to delete cached patched resource slice", "resourceslice", name) + return + } + t.pushEvent(oldPatchedObj, nil) + logger.V(5).Info("patched ResourceSlice deleted") + return + } + var oldPatchedSlice *resourceapi.ResourceSlice + if oldSliceExists { + var ok bool + oldPatchedSlice, ok = oldPatchedObj.(*resourceapi.ResourceSlice) + if !ok { + t.handleError(ctx, errors.New("invalid type in resource slice cache"), "expectedType", fmt.Sprintf("%T", (*resourceapi.ResourceSlice)(nil)), "gotType", fmt.Sprintf("%T", oldPatchedObj)) + return + } + } + slice, ok := obj.(*resourceapi.ResourceSlice) + if !ok { + t.handleError(ctx, errors.New("invalid type in resource slice cache"), fmt.Sprintf("expected type to be %T, got %T", (*resourceapi.ResourceSlice)(nil), obj)) + return + } + + patches := typedSlice[*resourcealphaapi.DeviceTaintRule](t.deviceTaints.GetIndexer().List()) + patchedSlice, err := t.applyPatches(ctx, slice, patches) + if err != nil { + t.handleError(ctx, err, "failed to apply patches to ResourceSlice", "resourceslice", klog.KObj(slice)) + return + } + + // When syncSlice is triggered by something other than a ResourceSlice + // event, only the device attributes and capacity might change. We + // deliberately avoid any costly DeepEqual-style comparisons here. + if !sendEvent && oldPatchedSlice != nil { + for i := range patchedSlice.Spec.Devices { + oldDevice := oldPatchedSlice.Spec.Devices[i] + newDevice := patchedSlice.Spec.Devices[i] + sendEvent = sendEvent || + !slices.EqualFunc(getTaints(oldDevice), getTaints(newDevice), taintsEqual) + } + } + + err = t.patchedResourceSlices.Add(patchedSlice) + if err != nil { + t.handleError(ctx, err, "failed to add patched resource slice to cache", "resourceslice", klog.KObj(patchedSlice)) + return + } + if sendEvent { + t.pushEvent(oldPatchedObj, patchedSlice) + } + + if loggerV := logger.V(6); loggerV.Enabled() { + loggerV.Info("ResourceSlice synced", "diff", cmp.Diff(oldPatchedObj, patchedSlice)) + } else { + logger.V(5).Info("ResourceSlice synced") + } +} + +func (t *Tracker) applyPatches(ctx context.Context, slice *resourceapi.ResourceSlice, taintRules []*resourcealphaapi.DeviceTaintRule) (*resourceapi.ResourceSlice, error) { + logger := klog.FromContext(ctx) + + // slice will be DeepCopied just-in-time, only when necessary. + patchedSlice := slice + + for _, taintRule := range taintRules { + logger := klog.LoggerWithValues(logger, "deviceTaintRule", klog.KObj(taintRule)) + logger.V(6).Info("processing DeviceTaintRule") + + deviceSelector := taintRule.Spec.DeviceSelector + var deviceClassExprs []cel.CompilationResult + var selectorExprs []cel.CompilationResult + var deviceName *string + if deviceSelector != nil { + if deviceSelector.Driver != nil && *deviceSelector.Driver != slice.Spec.Driver { + logger.V(7).Info("DeviceTaintRule does not apply, mismatched driver", "sliceDriver", slice.Spec.Driver, "taintDriver", *deviceSelector.Driver) + continue + } + if deviceSelector.Pool != nil && *deviceSelector.Pool != slice.Spec.Pool.Name { + logger.V(7).Info("DeviceTaintRule does not apply, mismatched pool", "slicePool", slice.Spec.Pool.Name, "taintPool", *deviceSelector.Pool) + continue + } + deviceName = deviceSelector.Device + if deviceSelector.DeviceClassName != nil { + logger := logger.WithValues("deviceClassName", *deviceSelector.DeviceClassName) + classObj, exists, err := t.deviceClasses.GetIndexer().GetByKey(*deviceSelector.DeviceClassName) + if err != nil { + return nil, fmt.Errorf("failed to get device class %s for DeviceTaintRule %s", *deviceSelector.DeviceClassName, taintRule.Name) + } + if !exists { + logger.V(7).Info("DeviceTaintRule does not apply, DeviceClass does not exist") + continue + } + class := classObj.(*resourceapi.DeviceClass) + for _, selector := range class.Spec.Selectors { + if selector.CEL != nil { + expr := t.celCache.GetOrCompile(selector.CEL.Expression) + deviceClassExprs = append(deviceClassExprs, expr) + } + } + } + for _, selector := range deviceSelector.Selectors { + if selector.CEL != nil { + expr := t.celCache.GetOrCompile(selector.CEL.Expression) + selectorExprs = append(selectorExprs, expr) + } + } + } + devices: + for dIndex, device := range slice.Spec.Devices { + deviceID := deviceID(slice.Spec.Driver, slice.Spec.Pool.Name, device.Name) + logger := logger.WithValues("device", deviceID) + + if deviceName != nil && *deviceName != device.Name { + logger.V(7).Info("DeviceTaintRule does not apply, mismatched device", "sliceDevice", device.Name, "taintDevice", *deviceSelector.Device) + continue + } + + deviceAttributes := getAttributes(device) + deviceCapacity := getCapacity(device) + + for i, expr := range deviceClassExprs { + if expr.Error != nil { + // Could happen if some future apiserver accepted some + // future expression and then got downgraded. Normally + // the "stored expression" mechanism prevents that, but + // this code here might be more than one release older + // than the cluster it runs in. + return nil, fmt.Errorf("DeviceTaintRule %s: class %s: selector #%d: CEL compile error: %w", taintRule.Name, *deviceSelector.DeviceClassName, i, expr.Error) + } + matches, details, err := expr.DeviceMatches(ctx, cel.Device{Driver: slice.Spec.Driver, Attributes: deviceAttributes, Capacity: deviceCapacity}) + logger.V(7).Info("CEL result", "class", *deviceSelector.DeviceClassName, "selector", i, "expression", expr.Expression, "matches", matches, "actualCost", ptr.Deref(details.ActualCost(), 0), "err", err) + if err != nil { + continue devices + } + if !matches { + continue devices + } + } + + for i, expr := range selectorExprs { + if expr.Error != nil { + // Could happen if some future apiserver accepted some + // future expression and then got downgraded. Normally + // the "stored expression" mechanism prevents that, but + // this code here might be more than one release older + // than the cluster it runs in. + return nil, fmt.Errorf("DeviceTaintRule %s: selector #%d: CEL compile error: %w", taintRule.Name, i, expr.Error) + } + matches, details, err := expr.DeviceMatches(ctx, cel.Device{Driver: slice.Spec.Driver, Attributes: deviceAttributes, Capacity: deviceCapacity}) + logger.V(7).Info("CEL result", "selector", i, "expression", expr.Expression, "matches", matches, "actualCost", ptr.Deref(details.ActualCost(), 0), "err", err) + if err != nil { + if t.recorder != nil { + t.recorder.Eventf(taintRule, v1.EventTypeWarning, "CELRuntimeError", "selector #%d: runtime error: %v", i, err) + } + continue devices + } + if !matches { + continue devices + } + } + + logger.V(6).Info("applying matching DeviceTaintRule") + + // TODO: remove conversion once taint is already in the right API package. + ta := resourceapi.DeviceTaint{ + Key: taintRule.Spec.Taint.Key, + Value: taintRule.Spec.Taint.Value, + Effect: resourceapi.DeviceTaintEffect(taintRule.Spec.Taint.Effect), + TimeAdded: taintRule.Spec.Taint.TimeAdded, + } + + if patchedSlice == slice { + patchedSlice = slice.DeepCopy() + } + + appendTaint(&patchedSlice.Spec.Devices[dIndex], ta) + } + } + + return patchedSlice, nil +} + +func getAttributes(device resourceapi.Device) map[resourceapi.QualifiedName]resourceapi.DeviceAttribute { + if device.Basic != nil { + return device.Basic.Attributes + } + return nil +} + +func getCapacity(device resourceapi.Device) map[resourceapi.QualifiedName]resourceapi.DeviceCapacity { + if device.Basic != nil { + return device.Basic.Capacity + } + return nil +} + +func getTaints(device resourceapi.Device) []resourceapi.DeviceTaint { + if device.Basic != nil { + return device.Basic.Taints + } + return nil +} + +func appendTaint(device *resourceapi.Device, taint resourceapi.DeviceTaint) { + if device.Basic != nil { + device.Basic.Taints = append(device.Basic.Taints, taint) + return + } +} + +func taintsEqual(a, b resourceapi.DeviceTaint) bool { + return a.Key == b.Key && + a.Effect == b.Effect && + a.Value == b.Value && + a.TimeAdded.Equal(b.TimeAdded) // Equal deals with nil. +} + +func deviceID(driver, pool, device string) string { + return driver + "/" + pool + "/" + device +} + +func typedSlice[T any](objs []any) []T { + if objs == nil { + return nil + } + typed := make([]T, 0, len(objs)) + for _, obj := range objs { + typed = append(typed, obj.(T)) + } + return typed +} diff --git a/e2e/vendor/k8s.io/dynamic-resource-allocation/structured/allocator.go b/e2e/vendor/k8s.io/dynamic-resource-allocation/structured/allocator.go index ac2bf8580..37a192008 100644 --- a/e2e/vendor/k8s.io/dynamic-resource-allocation/structured/allocator.go +++ b/e2e/vendor/k8s.io/dynamic-resource-allocation/structured/allocator.go @@ -21,6 +21,7 @@ import ( "errors" "fmt" "math" + "slices" "strings" v1 "k8s.io/api/core/v1" @@ -28,6 +29,7 @@ import ( "k8s.io/apimachinery/pkg/util/sets" draapi "k8s.io/dynamic-resource-allocation/api" "k8s.io/dynamic-resource-allocation/cel" + "k8s.io/dynamic-resource-allocation/resourceclaim" "k8s.io/klog/v2" "k8s.io/utils/ptr" ) @@ -46,12 +48,19 @@ type deviceClassLister interface { // available and the current state of the cluster (claims, classes, resource // slices). type Allocator struct { - adminAccessEnabled bool - claimsToAllocate []*resourceapi.ResourceClaim - allocatedDevices sets.Set[DeviceID] - classLister deviceClassLister - slices []*resourceapi.ResourceSlice - celCache *cel.Cache + features Features + claimsToAllocate []*resourceapi.ResourceClaim + allocatedDevices sets.Set[DeviceID] + classLister deviceClassLister + slices []*resourceapi.ResourceSlice + celCache *cel.Cache +} + +type Features struct { + AdminAccess bool + PrioritizedList bool + PartitionableDevices bool + DeviceTaints bool } // NewAllocator returns an allocator for a certain set of claims or an error if @@ -59,7 +68,7 @@ type Allocator struct { // // The returned Allocator can be used multiple times and is thread-safe. func NewAllocator(ctx context.Context, - adminAccessEnabled bool, + features Features, claimsToAllocate []*resourceapi.ResourceClaim, allocatedDevices sets.Set[DeviceID], classLister deviceClassLister, @@ -67,12 +76,12 @@ func NewAllocator(ctx context.Context, celCache *cel.Cache, ) (*Allocator, error) { return &Allocator{ - adminAccessEnabled: adminAccessEnabled, - claimsToAllocate: claimsToAllocate, - allocatedDevices: allocatedDevices, - classLister: classLister, - slices: slices, - celCache: celCache, + features: features, + claimsToAllocate: claimsToAllocate, + allocatedDevices: allocatedDevices, + classLister: classLister, + slices: slices, + celCache: celCache, }, nil } @@ -109,6 +118,7 @@ func (a *Allocator) Allocate(ctx context.Context, node *v1.Node) (finalResult [] Allocator: a, ctx: ctx, // all methods share the same a and thus ctx logger: klog.FromContext(ctx), + node: node, deviceMatchesRequest: make(map[matchKey]bool), constraints: make([][]constraint, len(a.claimsToAllocate)), requestData: make(map[requestIndices]requestData), @@ -118,7 +128,7 @@ func (a *Allocator) Allocate(ctx context.Context, node *v1.Node) (finalResult [] defer alloc.logger.V(5).Info("Done with allocation", "success", len(finalResult) == len(alloc.claimsToAllocate), "err", finalErr) // First determine all eligible pools. - pools, err := GatherPools(ctx, alloc.slices, node) + pools, err := GatherPools(ctx, alloc.slices, node, a.features) if err != nil { return nil, fmt.Errorf("gather pool information: %w", err) } @@ -148,9 +158,9 @@ func (a *Allocator) Allocate(ctx context.Context, node *v1.Node) (finalResult [] // and their requests. For each claim we determine how many devices // need to be allocated. If not all can be stored in the result, the // claim cannot be allocated. - numDevicesTotal := 0 + minDevicesTotal := 0 for claimIndex, claim := range alloc.claimsToAllocate { - numDevicesPerClaim := 0 + minDevicesPerClaim := 0 // If we have any any request that wants "all" devices, we need to // figure out how much "all" is. If some pool is incomplete, we stop @@ -161,87 +171,57 @@ func (a *Allocator) Allocate(ctx context.Context, node *v1.Node) (finalResult [] // has some matching device. for requestIndex := range claim.Spec.Devices.Requests { request := &claim.Spec.Devices.Requests[requestIndex] - for i, selector := range request.Selectors { - if selector.CEL == nil { - // Unknown future selector type! - return nil, fmt.Errorf("claim %s, request %s, selector #%d: CEL expression empty (unsupported selector type?)", klog.KObj(claim), request.Name, i) - } - } - - if !a.adminAccessEnabled && request.AdminAccess != nil { - return nil, fmt.Errorf("claim %s, request %s: admin access is requested, but the feature is disabled", klog.KObj(claim), request.Name) - } - - // Should be set. If it isn't, something changed and we should refuse to proceed. - if request.DeviceClassName == "" { - return nil, fmt.Errorf("claim %s, request %s: missing device class name (unsupported request type?)", klog.KObj(claim), request.Name) - } - class, err := alloc.classLister.Get(request.DeviceClassName) - if err != nil { - return nil, fmt.Errorf("claim %s, request %s: could not retrieve device class %s: %w", klog.KObj(claim), request.Name, request.DeviceClassName, err) - } - - // Start collecting information about the request. - // The class must be set and stored before calling isSelectable. - requestData := requestData{ - class: class, - } requestKey := requestIndices{claimIndex: claimIndex, requestIndex: requestIndex} - alloc.requestData[requestKey] = requestData + hasSubRequests := len(request.FirstAvailable) > 0 - switch request.AllocationMode { - case resourceapi.DeviceAllocationModeExactCount: - numDevices := request.Count - if numDevices > math.MaxInt { - // Allowed by API validation, but doesn't make sense. - return nil, fmt.Errorf("claim %s, request %s: exact count %d is too large", klog.KObj(claim), request.Name, numDevices) - } - requestData.numDevices = int(numDevices) - case resourceapi.DeviceAllocationModeAll: - requestData.allDevices = make([]deviceWithID, 0, resourceapi.AllocationResultsMaxSize) - for _, pool := range pools { - if pool.IsIncomplete { - return nil, fmt.Errorf("claim %s, request %s: asks for all devices, but resource pool %s is currently being updated", klog.KObj(claim), request.Name, pool.PoolID) - } - if pool.IsInvalid { - return nil, fmt.Errorf("claim %s, request %s: asks for all devices, but resource pool %s is currently invalid", klog.KObj(claim), request.Name, pool.PoolID) - } - - for _, slice := range pool.Slices { - for deviceIndex := range slice.Spec.Devices { - selectable, err := alloc.isSelectable(requestKey, slice, deviceIndex) - if err != nil { - return nil, err - } - if selectable { - device := deviceWithID{ - id: DeviceID{Driver: slice.Spec.Driver, Pool: slice.Spec.Pool.Name, Device: slice.Spec.Devices[deviceIndex].Name}, - basic: slice.Spec.Devices[deviceIndex].Basic, - slice: slice, - } - requestData.allDevices = append(requestData.allDevices, device) - } - } - } - } - requestData.numDevices = len(requestData.allDevices) - alloc.logger.V(6).Info("Request for 'all' devices", "claim", klog.KObj(claim), "request", request.Name, "numDevicesPerRequest", requestData.numDevices) - default: - return nil, fmt.Errorf("claim %s, request %s: unsupported count mode %s", klog.KObj(claim), request.Name, request.AllocationMode) + // Error out if the prioritizedList feature is not enabled and the request + // has subrequests. This is to avoid surprising behavior for users. + if !a.features.PrioritizedList && hasSubRequests { + return nil, fmt.Errorf("claim %s, request %s: has subrequests, but the DRAPrioritizedList feature is disabled", klog.KObj(claim), request.Name) } - alloc.requestData[requestKey] = requestData - numDevicesPerClaim += requestData.numDevices - } - alloc.logger.V(6).Info("Checked claim", "claim", klog.KObj(claim), "numDevices", numDevicesPerClaim) + if hasSubRequests { + // We need to find the minimum number of devices that can be allocated + // for the request, so setting this to a high number so we can do the + // easy comparison in the loop. + minDevicesPerRequest := math.MaxInt + + // A request with subrequests gets one entry per subrequest in alloc.requestData. + // We can only predict a lower number of devices because it depends on which + // subrequest gets chosen. + for i, subReq := range request.FirstAvailable { + reqData, err := alloc.validateDeviceRequest(&deviceSubRequestAccessor{subRequest: &subReq}, + &deviceRequestAccessor{request: request}, requestKey, pools) + if err != nil { + return nil, err + } + requestKey.subRequestIndex = i + alloc.requestData[requestKey] = reqData + if reqData.numDevices < minDevicesPerRequest { + minDevicesPerRequest = reqData.numDevices + } + } + minDevicesPerClaim += minDevicesPerRequest + } else { + reqData, err := alloc.validateDeviceRequest(&deviceRequestAccessor{request: request}, nil, requestKey, pools) + if err != nil { + return nil, err + } + alloc.requestData[requestKey] = reqData + minDevicesPerClaim += reqData.numDevices + } + } + alloc.logger.V(6).Info("Checked claim", "claim", klog.KObj(claim), "minDevices", minDevicesPerClaim) // Check that we don't end up with too many results. - if numDevicesPerClaim > resourceapi.AllocationResultsMaxSize { - return nil, fmt.Errorf("claim %s: number of requested devices %d exceeds the claim limit of %d", klog.KObj(claim), numDevicesPerClaim, resourceapi.AllocationResultsMaxSize) + // This isn't perfectly reliable because numDevicesPerClaim is + // only a lower bound, so allocation also has to check this. + if minDevicesPerClaim > resourceapi.AllocationResultsMaxSize { + return nil, fmt.Errorf("claim %s: number of requested devices %d exceeds the claim limit of %d", klog.KObj(claim), minDevicesPerClaim, resourceapi.AllocationResultsMaxSize) } // If we don't, then we can pre-allocate the result slices for // appending the actual results later. - alloc.result[claimIndex].devices = make([]internalDeviceResult, 0, numDevicesPerClaim) + alloc.result[claimIndex].devices = make([]internalDeviceResult, 0, minDevicesPerClaim) // Constraints are assumed to be monotonic: once a constraint returns // false, adding more devices will not cause it to return true. This @@ -268,7 +248,7 @@ func (a *Allocator) Allocate(ctx context.Context, node *v1.Node) (finalResult [] } } alloc.constraints[claimIndex] = constraints - numDevicesTotal += numDevicesPerClaim + minDevicesTotal += minDevicesPerClaim } // Selecting a device for a request is independent of what has been @@ -279,9 +259,9 @@ func (a *Allocator) Allocate(ctx context.Context, node *v1.Node) (finalResult [] alloc.deviceMatchesRequest = make(map[matchKey]bool) // We can estimate the size based on what we need to allocate. - alloc.allocatingDevices = make(map[DeviceID]bool, numDevicesTotal) + alloc.allocatingDevices = make(map[DeviceID]bool, minDevicesTotal) - alloc.logger.V(6).Info("Gathered information about devices", "numAllocated", len(alloc.allocatedDevices), "toBeAllocated", numDevicesTotal) + alloc.logger.V(6).Info("Gathered information about devices", "numAllocated", len(alloc.allocatedDevices), "minDevicesToBeAllocated", minDevicesTotal) // In practice, there aren't going to be many different CEL // expressions. Most likely, there is going to be handful of different @@ -296,7 +276,7 @@ func (a *Allocator) Allocate(ctx context.Context, node *v1.Node) (finalResult [] // All errors get created such that they can be returned by Allocate // without further wrapping. - done, err := alloc.allocateOne(deviceIndices{}) + done, err := alloc.allocateOne(deviceIndices{}, false) if errors.Is(err, errStop) { return nil, nil } @@ -314,7 +294,7 @@ func (a *Allocator) Allocate(ctx context.Context, node *v1.Node) (finalResult [] allocationResult.Devices.Results = make([]resourceapi.DeviceRequestAllocationResult, len(internalResult.devices)) for i, internal := range internalResult.devices { allocationResult.Devices.Results[i] = resourceapi.DeviceRequestAllocationResult{ - Request: internal.request, + Request: internal.requestName(), Driver: internal.id.Driver.String(), Pool: internal.id.Pool.String(), Device: internal.id.Device.String(), @@ -324,7 +304,15 @@ func (a *Allocator) Allocate(ctx context.Context, node *v1.Node) (finalResult [] // Populate configs. for requestIndex := range claim.Spec.Devices.Requests { - class := alloc.requestData[requestIndices{claimIndex: claimIndex, requestIndex: requestIndex}].class + requestKey := requestIndices{claimIndex: claimIndex, requestIndex: requestIndex} + requestData := alloc.requestData[requestKey] + if requestData.parentRequest != nil { + // We need the class of the selected subrequest. + requestKey.subRequestIndex = requestData.selectedSubRequestIndex + requestData = alloc.requestData[requestKey] + } + + class := requestData.class if class != nil { for _, config := range class.Spec.Config { allocationResult.Devices.Config = append(allocationResult.Devices.Config, resourceapi.DeviceAllocationConfiguration{ @@ -336,11 +324,42 @@ func (a *Allocator) Allocate(ctx context.Context, node *v1.Node) (finalResult [] } } for _, config := range claim.Spec.Devices.Config { - allocationResult.Devices.Config = append(allocationResult.Devices.Config, resourceapi.DeviceAllocationConfiguration{ - Source: resourceapi.AllocationConfigSourceClaim, - Requests: config.Requests, - DeviceConfiguration: config.DeviceConfiguration, - }) + // If Requests are empty, it applies to all. So it can just be included. + if len(config.Requests) == 0 { + allocationResult.Devices.Config = append(allocationResult.Devices.Config, resourceapi.DeviceAllocationConfiguration{ + Source: resourceapi.AllocationConfigSourceClaim, + Requests: config.Requests, + DeviceConfiguration: config.DeviceConfiguration, + }) + continue + } + + for i, request := range claim.Spec.Devices.Requests { + if slices.Contains(config.Requests, request.Name) { + allocationResult.Devices.Config = append(allocationResult.Devices.Config, resourceapi.DeviceAllocationConfiguration{ + Source: resourceapi.AllocationConfigSourceClaim, + Requests: config.Requests, + DeviceConfiguration: config.DeviceConfiguration, + }) + continue + } + + requestKey := requestIndices{claimIndex: claimIndex, requestIndex: i} + requestData := alloc.requestData[requestKey] + if requestData.parentRequest == nil { + continue + } + + subRequest := request.FirstAvailable[requestData.selectedSubRequestIndex] + subRequestName := fmt.Sprintf("%s/%s", request.Name, subRequest.Name) + if slices.Contains(config.Requests, subRequestName) { + allocationResult.Devices.Config = append(allocationResult.Devices.Config, resourceapi.DeviceAllocationConfiguration{ + Source: resourceapi.AllocationConfigSourceClaim, + Requests: config.Requests, + DeviceConfiguration: config.DeviceConfiguration, + }) + } + } } // Determine node selector. @@ -354,6 +373,86 @@ func (a *Allocator) Allocate(ctx context.Context, node *v1.Node) (finalResult [] return result, nil } +func (a *allocator) validateDeviceRequest(request requestAccessor, parentRequest requestAccessor, requestKey requestIndices, pools []*Pool) (requestData, error) { + claim := a.claimsToAllocate[requestKey.claimIndex] + requestData := requestData{ + request: request, + parentRequest: parentRequest, + } + for i, selector := range request.selectors() { + if selector.CEL == nil { + // Unknown future selector type! + return requestData, fmt.Errorf("claim %s, request %s, selector #%d: CEL expression empty (unsupported selector type?)", klog.KObj(claim), request.name(), i) + } + } + + if !a.features.AdminAccess && request.hasAdminAccess() { + return requestData, fmt.Errorf("claim %s, request %s: admin access is requested, but the feature is disabled", klog.KObj(claim), request.name()) + } + + // Should be set. If it isn't, something changed and we should refuse to proceed. + if request.deviceClassName() == "" { + return requestData, fmt.Errorf("claim %s, request %s: missing device class name (unsupported request type?)", klog.KObj(claim), request.name()) + } + class, err := a.classLister.Get(request.deviceClassName()) + if err != nil { + return requestData, fmt.Errorf("claim %s, request %s: could not retrieve device class %s: %w", klog.KObj(claim), request.name(), request.deviceClassName(), err) + } + + // Start collecting information about the request. + // The class must be set and stored before calling isSelectable. + requestData.class = class + + switch request.allocationMode() { + case resourceapi.DeviceAllocationModeExactCount: + numDevices := request.count() + if numDevices > math.MaxInt { + // Allowed by API validation, but doesn't make sense. + return requestData, fmt.Errorf("claim %s, request %s: exact count %d is too large", klog.KObj(claim), request.name(), numDevices) + } + requestData.numDevices = int(numDevices) + case resourceapi.DeviceAllocationModeAll: + // If we have any any request that wants "all" devices, we need to + // figure out how much "all" is. If some pool is incomplete, we stop + // here because allocation cannot succeed. Once we do scoring, we should + // stop in all cases, not just when "all" devices are needed, because + // pulling from an incomplete might not pick the best solution and it's + // better to wait. This does not matter yet as long the incomplete pool + // has some matching device. + requestData.allDevices = make([]deviceWithID, 0, resourceapi.AllocationResultsMaxSize) + for _, pool := range pools { + if pool.IsIncomplete { + return requestData, fmt.Errorf("claim %s, request %s: asks for all devices, but resource pool %s is currently being updated", klog.KObj(claim), request.name(), pool.PoolID) + } + if pool.IsInvalid { + return requestData, fmt.Errorf("claim %s, request %s: asks for all devices, but resource pool %s is currently invalid", klog.KObj(claim), request.name(), pool.PoolID) + } + + for _, slice := range pool.Slices { + for deviceIndex := range slice.Spec.Devices { + selectable, err := a.isSelectable(requestKey, requestData, slice, deviceIndex) + if err != nil { + return requestData, err + } + if selectable { + device := deviceWithID{ + id: DeviceID{Driver: slice.Spec.Driver, Pool: slice.Spec.Pool.Name, Device: slice.Spec.Devices[deviceIndex].Name}, + basic: slice.Spec.Devices[deviceIndex].Basic, + slice: slice, + } + requestData.allDevices = append(requestData.allDevices, device) + } + } + } + } + requestData.numDevices = len(requestData.allDevices) + a.logger.V(6).Info("Request for 'all' devices", "claim", klog.KObj(claim), "request", request.name(), "numDevicesPerRequest", requestData.numDevices) + default: + return requestData, fmt.Errorf("claim %s, request %s: unsupported count mode %s", klog.KObj(claim), request.name(), request.allocationMode()) + } + return requestData, nil +} + // errStop is a special error that gets returned by allocateOne if it detects // that allocation cannot succeed. var errStop = errors.New("stop allocation") @@ -364,10 +463,11 @@ type allocator struct { *Allocator ctx context.Context logger klog.Logger + node *v1.Node pools []*Pool deviceMatchesRequest map[matchKey]bool constraints [][]constraint // one list of constraints per claim - requestData map[requestIndices]requestData // one entry per request + requestData map[requestIndices]requestData // one entry per request with no subrequests and one entry per subrequest allocatingDevices map[DeviceID]bool result []internalAllocationResult } @@ -378,21 +478,38 @@ type matchKey struct { requestIndices } -// requestIndices identifies one specific request by its -// claim and request index. +// requestIndices identifies one specific request +// or subrequest by three properties: +// +// - claimIndex: The index of the claim in the requestData map. +// - requestIndex: The index of the request in the claim. +// - subRequestIndex: The index of the subrequest in the parent request. type requestIndices struct { claimIndex, requestIndex int + subRequestIndex int } // deviceIndices identifies one specific required device inside -// a request of a certain claim. +// a request or subrequest of a certain claim. type deviceIndices struct { - claimIndex, requestIndex, deviceIndex int + claimIndex int // The index of the claim in the allocator. + requestIndex int // The index of the request in the claim. + subRequestIndex int // The index of the subrequest within the request (ignored if subRequest is false). + deviceIndex int // The index of a device within a request or subrequest. } type requestData struct { - class *resourceapi.DeviceClass - numDevices int + // The request or subrequest which needs to be allocated. + // Never nil. + request requestAccessor + // The parent of a subrequest, nil if not a subrequest. + parentRequest requestAccessor + class *resourceapi.DeviceClass + numDevices int + + // selectedSubRequestIndex is set for the entry with requestIndices.subRequestIndex == 0. + // It is the index of the subrequest which got picked during allocation. + selectedSubRequestIndex int // pre-determined set of devices for allocating "all" devices allDevices []deviceWithID @@ -409,21 +526,30 @@ type internalAllocationResult struct { } type internalDeviceResult struct { - request string - id DeviceID - slice *draapi.ResourceSlice - adminAccess *bool + request string // name of the request (if no subrequests) or the subrequest + parentRequest string // name of the request which contains the subrequest, empty otherwise + id DeviceID + basic *draapi.BasicDevice + slice *draapi.ResourceSlice + adminAccess *bool +} + +func (i internalDeviceResult) requestName() string { + if i.parentRequest == "" { + return i.request + } + return fmt.Sprintf("%s/%s", i.parentRequest, i.request) } type constraint interface { // add is called whenever a device is about to be allocated. It must // check whether the device matches the constraint and if yes, // track that it is allocated. - add(requestName string, device *draapi.BasicDevice, deviceID DeviceID) bool + add(requestName, subRequestName string, device *draapi.BasicDevice, deviceID DeviceID) bool // For every successful add there is exactly one matching removed call // with the exact same parameters. - remove(requestName string, device *draapi.BasicDevice, deviceID DeviceID) + remove(requestName, subRequestName string, device *draapi.BasicDevice, deviceID DeviceID) } // matchAttributeConstraint compares an attribute value across devices. @@ -442,8 +568,8 @@ type matchAttributeConstraint struct { numDevices int } -func (m *matchAttributeConstraint) add(requestName string, device *draapi.BasicDevice, deviceID DeviceID) bool { - if m.requestNames.Len() > 0 && !m.requestNames.Has(requestName) { +func (m *matchAttributeConstraint) add(requestName, subRequestName string, device *draapi.BasicDevice, deviceID DeviceID) bool { + if m.requestNames.Len() > 0 && !m.matches(requestName, subRequestName) { // Device not affected by constraint. m.logger.V(7).Info("Constraint does not apply to request", "request", requestName) return true @@ -499,8 +625,8 @@ func (m *matchAttributeConstraint) add(requestName string, device *draapi.BasicD return true } -func (m *matchAttributeConstraint) remove(requestName string, device *draapi.BasicDevice, deviceID DeviceID) { - if m.requestNames.Len() > 0 && !m.requestNames.Has(requestName) { +func (m *matchAttributeConstraint) remove(requestName, subRequestName string, device *draapi.BasicDevice, deviceID DeviceID) { + if m.requestNames.Len() > 0 && !m.matches(requestName, subRequestName) { // Device not affected by constraint. return } @@ -509,6 +635,15 @@ func (m *matchAttributeConstraint) remove(requestName string, device *draapi.Bas m.logger.V(7).Info("Device removed from constraint set", "device", deviceID, "numDevices", m.numDevices) } +func (m *matchAttributeConstraint) matches(requestName, subRequestName string) bool { + if subRequestName == "" { + return m.requestNames.Has(requestName) + } else { + fullSubRequestName := fmt.Sprintf("%s/%s", requestName, subRequestName) + return m.requestNames.Has(requestName) || m.requestNames.Has(fullSubRequestName) + } +} + func lookupAttribute(device *draapi.BasicDevice, deviceID DeviceID, attributeName draapi.FullyQualifiedName) *draapi.DeviceAttribute { // Fully-qualified match? if attr, ok := device.Attributes[draapi.QualifiedName(attributeName)]; ok { @@ -537,7 +672,11 @@ func lookupAttribute(device *draapi.BasicDevice, deviceID DeviceID, attributeNam // allocateOne iterates over all eligible devices (not in use, match selector, // satisfy constraints) for a specific required device. It returns true if // everything got allocated, an error if allocation needs to stop. -func (alloc *allocator) allocateOne(r deviceIndices) (bool, error) { +// +// allocateSubRequest is true when trying to allocate one particular subrequest. +// This allows the logic for subrequests to call allocateOne with the same +// device index without causing infinite recursion. +func (alloc *allocator) allocateOne(r deviceIndices, allocateSubRequest bool) (bool, error) { if r.claimIndex >= len(alloc.claimsToAllocate) { // Done! If we were doing scoring, we would compare the current allocation result // against the previous one, keep the best, and continue. Without scoring, we stop @@ -549,20 +688,73 @@ func (alloc *allocator) allocateOne(r deviceIndices) (bool, error) { claim := alloc.claimsToAllocate[r.claimIndex] if r.requestIndex >= len(claim.Spec.Devices.Requests) { // Done with the claim, continue with the next one. - return alloc.allocateOne(deviceIndices{claimIndex: r.claimIndex + 1}) + return alloc.allocateOne(deviceIndices{claimIndex: r.claimIndex + 1}, false) + } + + // r.subRequestIndex is zero unless the for loop below is in the + // recursion chain. + requestKey := requestIndices{claimIndex: r.claimIndex, requestIndex: r.requestIndex, subRequestIndex: r.subRequestIndex} + requestData := alloc.requestData[requestKey] + + // Subrequests are special: we only need to allocate one of them, then + // we can move on to the next request. We enter this for loop when + // hitting the first subrequest, but not if we are already working on a + // specific subrequest. + if !allocateSubRequest && requestData.parentRequest != nil { + for subRequestIndex := 0; ; subRequestIndex++ { + nextSubRequestKey := requestKey + nextSubRequestKey.subRequestIndex = subRequestIndex + if _, ok := alloc.requestData[nextSubRequestKey]; !ok { + // Past the end of the subrequests without finding a solution -> give up. + return false, nil + } + + r.subRequestIndex = subRequestIndex + success, err := alloc.allocateOne(r, true /* prevent infinite recusion */) + if err != nil { + return false, err + } + // If allocation with a subrequest succeeds, return without + // attempting the remaining subrequests. + if success { + // Store the index of the selected subrequest + requestData.selectedSubRequestIndex = subRequestIndex + alloc.requestData[requestKey] = requestData + return true, nil + } + } + // This is unreachable, so no need to have a return statement here. + } + + // Look up the current request that we are attempting to satisfy. This can + // be either a request or a subrequest. + request := requestData.request + doAllDevices := request.allocationMode() == resourceapi.DeviceAllocationModeAll + + // At least one device is required for 'All' allocation mode. + if doAllDevices && len(requestData.allDevices) == 0 { + alloc.logger.V(6).Info("Allocation for 'all' devices didn't succeed: no devices found", "claim", klog.KObj(claim), "request", requestData.request.name()) + return false, nil } // We already know how many devices per request are needed. - // Ready to move on to the next request? - requestData := alloc.requestData[requestIndices{claimIndex: r.claimIndex, requestIndex: r.requestIndex}] if r.deviceIndex >= requestData.numDevices { - return alloc.allocateOne(deviceIndices{claimIndex: r.claimIndex, requestIndex: r.requestIndex + 1}) + // Done with request, continue with next one. We have completed the work for + // the request or subrequest, so we can no longer be allocating devices for + // a subrequest. + return alloc.allocateOne(deviceIndices{claimIndex: r.claimIndex, requestIndex: r.requestIndex + 1}, false) } - request := &alloc.claimsToAllocate[r.claimIndex].Spec.Devices.Requests[r.requestIndex] - doAllDevices := request.AllocationMode == resourceapi.DeviceAllocationModeAll - alloc.logger.V(6).Info("Allocating one device", "currentClaim", r.claimIndex, "totalClaims", len(alloc.claimsToAllocate), "currentRequest", r.requestIndex, "totalRequestsPerClaim", len(claim.Spec.Devices.Requests), "currentDevice", r.deviceIndex, "devicesPerRequest", requestData.numDevices, "allDevices", doAllDevices, "adminAccess", request.AdminAccess) + // Before trying to allocate devices, check if allocating the devices + // in the current request will put us over the threshold. + numDevicesAfterAlloc := len(alloc.result[r.claimIndex].devices) + requestData.numDevices + if numDevicesAfterAlloc > resourceapi.AllocationResultsMaxSize { + // Don't return an error here since we want to keep searching for + // a solution that works. + return false, nil + } + alloc.logger.V(6).Info("Allocating one device", "currentClaim", r.claimIndex, "totalClaims", len(alloc.claimsToAllocate), "currentRequest", r.requestIndex, "currentSubRequest", r.subRequestIndex, "totalRequestsPerClaim", len(claim.Spec.Devices.Requests), "currentDevice", r.deviceIndex, "devicesPerRequest", requestData.numDevices, "allDevices", doAllDevices, "adminAccess", request.adminAccess()) if doAllDevices { // For "all" devices we already know which ones we need. We // just need to check whether we can use them. @@ -575,9 +767,9 @@ func (alloc *allocator) allocateOne(r deviceIndices) (bool, error) { // The order in which we allocate "all" devices doesn't matter, // so we only try with the one which was up next. If we couldn't // get all of them, then there is no solution and we have to stop. - return false, errStop + return false, nil } - done, err := alloc.allocateOne(deviceIndices{claimIndex: r.claimIndex, requestIndex: r.requestIndex, deviceIndex: r.deviceIndex + 1}) + done, err := alloc.allocateOne(deviceIndices{claimIndex: r.claimIndex, requestIndex: r.requestIndex, deviceIndex: r.deviceIndex + 1}, allocateSubRequest) if err != nil { return false, err } @@ -590,18 +782,25 @@ func (alloc *allocator) allocateOne(r deviceIndices) (bool, error) { // We need to find suitable devices. for _, pool := range alloc.pools { + // If the pool is not valid, then fail now. It's okay when pools of one driver + // are invalid if we allocate from some other pool, but it's not safe to + // allocated from an invalid pool. + if pool.IsInvalid { + return false, fmt.Errorf("pool %s is invalid: %s", pool.Pool, pool.InvalidReason) + } for _, slice := range pool.Slices { for deviceIndex := range slice.Spec.Devices { deviceID := DeviceID{Driver: pool.Driver, Pool: pool.Pool, Device: slice.Spec.Devices[deviceIndex].Name} // Checking for "in use" is cheap and thus gets done first. - if !ptr.Deref(request.AdminAccess, false) && (alloc.allocatedDevices.Has(deviceID) || alloc.allocatingDevices[deviceID]) { + if !request.adminAccess() && (alloc.allocatedDevices.Has(deviceID) || alloc.allocatingDevices[deviceID]) { alloc.logger.V(7).Info("Device in use", "device", deviceID) continue } // Next check selectors. - selectable, err := alloc.isSelectable(requestIndices{claimIndex: r.claimIndex, requestIndex: r.requestIndex}, slice, deviceIndex) + requestKey := requestIndices{claimIndex: r.claimIndex, requestIndex: r.requestIndex, subRequestIndex: r.subRequestIndex} + selectable, err := alloc.isSelectable(requestKey, requestData, slice, deviceIndex) if err != nil { return false, err } @@ -610,13 +809,6 @@ func (alloc *allocator) allocateOne(r deviceIndices) (bool, error) { continue } - // If the pool is not valid, then fail now. It's okay when pools of one driver - // are invalid if we allocate from some other pool, but it's not safe to - // allocated from an invalid pool. - if pool.IsInvalid { - return false, fmt.Errorf("pool %s is invalid: %s", pool.Pool, pool.InvalidReason) - } - // Finally treat as allocated and move on to the next device. device := deviceWithID{ id: deviceID, @@ -632,7 +824,13 @@ func (alloc *allocator) allocateOne(r deviceIndices) (bool, error) { alloc.logger.V(7).Info("Device not usable", "device", deviceID) continue } - done, err := alloc.allocateOne(deviceIndices{claimIndex: r.claimIndex, requestIndex: r.requestIndex, deviceIndex: r.deviceIndex + 1}) + deviceKey := deviceIndices{ + claimIndex: r.claimIndex, + requestIndex: r.requestIndex, + subRequestIndex: r.subRequestIndex, + deviceIndex: r.deviceIndex + 1, + } + done, err := alloc.allocateOne(deviceKey, allocateSubRequest) if err != nil { return false, err } @@ -653,7 +851,7 @@ func (alloc *allocator) allocateOne(r deviceIndices) (bool, error) { } // isSelectable checks whether a device satisfies the request and class selectors. -func (alloc *allocator) isSelectable(r requestIndices, slice *draapi.ResourceSlice, deviceIndex int) (bool, error) { +func (alloc *allocator) isSelectable(r requestIndices, requestData requestData, slice *draapi.ResourceSlice, deviceIndex int) (bool, error) { // This is the only supported device type at the moment. device := slice.Spec.Devices[deviceIndex].Basic if device == nil { @@ -668,7 +866,6 @@ func (alloc *allocator) isSelectable(r requestIndices, slice *draapi.ResourceSli return matches, nil } - requestData := alloc.requestData[r] if requestData.class != nil { match, err := alloc.selectorsMatch(r, device, deviceID, requestData.class, requestData.class.Spec.Selectors) if err != nil { @@ -680,8 +877,8 @@ func (alloc *allocator) isSelectable(r requestIndices, slice *draapi.ResourceSli } } - request := &alloc.claimsToAllocate[r.claimIndex].Spec.Devices.Requests[r.requestIndex] - match, err := alloc.selectorsMatch(r, device, deviceID, nil, request.Selectors) + request := requestData.request + match, err := alloc.selectorsMatch(r, device, deviceID, nil, request.selectors()) if err != nil { return false, err } @@ -690,6 +887,25 @@ func (alloc *allocator) isSelectable(r requestIndices, slice *draapi.ResourceSli return false, nil } + if ptr.Deref(slice.Spec.PerDeviceNodeSelection, false) { + var nodeName string + var allNodes bool + if device.NodeName != nil { + nodeName = *device.NodeName + } + if device.AllNodes != nil { + allNodes = *device.AllNodes + } + matches, err := nodeMatches(alloc.node, nodeName, allNodes, device.NodeSelector) + if err != nil { + return false, err + } + if !matches { + alloc.deviceMatchesRequest[matchKey] = false + return false, nil + } + } + alloc.deviceMatchesRequest[matchKey] = true return true, nil @@ -748,26 +964,58 @@ func (alloc *allocator) selectorsMatch(r requestIndices, device *draapi.BasicDev // restore the previous state. func (alloc *allocator) allocateDevice(r deviceIndices, device deviceWithID, must bool) (bool, func(), error) { claim := alloc.claimsToAllocate[r.claimIndex] - request := &claim.Spec.Devices.Requests[r.requestIndex] - adminAccess := ptr.Deref(request.AdminAccess, false) - if !adminAccess && (alloc.allocatedDevices.Has(device.id) || alloc.allocatingDevices[device.id]) { + requestKey := requestIndices{claimIndex: r.claimIndex, requestIndex: r.requestIndex, subRequestIndex: r.subRequestIndex} + requestData := alloc.requestData[requestKey] + request := requestData.request + if !request.adminAccess() && (alloc.allocatedDevices.Has(device.id) || alloc.allocatingDevices[device.id]) { alloc.logger.V(7).Info("Device in use", "device", device.id) return false, nil, nil } + // The API validation logic has checked the ConsumesCounters referred should exist inside SharedCounters. + if alloc.features.PartitionableDevices && len(device.basic.ConsumesCounters) > 0 { + // If a device consumes capacity from a capacity pool, verify that + // there is sufficient capacity available. + ok, err := alloc.checkAvailableCapacity(device) + if err != nil { + return false, nil, err + } + if !ok { + alloc.logger.V(7).Info("Insufficient capacity", "device", device.id) + return false, nil, nil + } + } + + var parentRequestName string + var baseRequestName string + var subRequestName string + if requestData.parentRequest == nil { + baseRequestName = requestData.request.name() + } else { + parentRequestName = requestData.parentRequest.name() + baseRequestName = parentRequestName + subRequestName = requestData.request.name() + } + + // Might be tainted, in which case the taint has to be tolerated. + // The check is skipped if the feature is disabled. + if alloc.features.DeviceTaints && !allTaintsTolerated(device.basic, request) { + return false, nil, nil + } + // It's available. Now check constraints. for i, constraint := range alloc.constraints[r.claimIndex] { - added := constraint.add(request.Name, device.basic, device.id) + added := constraint.add(baseRequestName, subRequestName, device.basic, device.id) if !added { if must { // It does not make sense to declare a claim where a constraint prevents getting // all devices. Treat this as an error. - return false, nil, fmt.Errorf("claim %s, request %s: cannot add device %s because a claim constraint would not be satisfied", klog.KObj(claim), request.Name, device.id) + return false, nil, fmt.Errorf("claim %s, request %s: cannot add device %s because a claim constraint would not be satisfied", klog.KObj(claim), request.name(), device.id) } // Roll back for all previous constraints before we return. for e := 0; e < i; e++ { - alloc.constraints[r.claimIndex][e].remove(request.Name, device.basic, device.id) + alloc.constraints[r.claimIndex][e].remove(baseRequestName, subRequestName, device.basic, device.id) } return false, nil, nil } @@ -776,25 +1024,27 @@ func (alloc *allocator) allocateDevice(r deviceIndices, device deviceWithID, mus // All constraints satisfied. Mark as in use (unless we do admin access) // and record the result. alloc.logger.V(7).Info("Device allocated", "device", device.id) - if !adminAccess { + if !request.adminAccess() { alloc.allocatingDevices[device.id] = true } result := internalDeviceResult{ - request: request.Name, - id: device.id, - slice: device.slice, + request: request.name(), + parentRequest: parentRequestName, + id: device.id, + basic: device.basic, + slice: device.slice, } - if adminAccess { - result.adminAccess = &adminAccess + if request.adminAccess() { + result.adminAccess = ptr.To(request.adminAccess()) } previousNumResults := len(alloc.result[r.claimIndex].devices) alloc.result[r.claimIndex].devices = append(alloc.result[r.claimIndex].devices, result) return true, func() { for _, constraint := range alloc.constraints[r.claimIndex] { - constraint.remove(request.Name, device.basic, device.id) + constraint.remove(baseRequestName, subRequestName, device.basic, device.id) } - if !adminAccess { + if !request.adminAccess() { alloc.allocatingDevices[device.id] = false } // Truncate, but keep the underlying slice. @@ -803,18 +1053,117 @@ func (alloc *allocator) allocateDevice(r deviceIndices, device deviceWithID, mus }, nil } +func allTaintsTolerated(device *draapi.BasicDevice, request requestAccessor) bool { + for _, taint := range device.Taints { + if !taintTolerated(taint, request) { + return false + } + } + return true +} + +func taintTolerated(taint resourceapi.DeviceTaint, request requestAccessor) bool { + for _, toleration := range request.tolerations() { + if resourceclaim.ToleratesTaint(toleration, taint) { + return true + } + } + return false +} + +func (alloc *allocator) checkAvailableCapacity(device deviceWithID) (bool, error) { + slice := device.slice + + referencedSharedCounters := sets.New[draapi.UniqueString]() + for _, consumedCounter := range device.basic.ConsumesCounters { + referencedSharedCounters.Insert(consumedCounter.CounterSet) + } + + // Create a structure that captures the initial counter for all sharedCounters + // referenced by the device. + availableCounters := make(map[draapi.UniqueString]map[string]draapi.Counter) + for _, counterSet := range slice.Spec.SharedCounters { + if !referencedSharedCounters.Has(counterSet.Name) { + // the API validation logic has been added to make sure the counterSet referred should exist in capacityPools + continue + } + counterShared := make(map[string]draapi.Counter, len(counterSet.Counters)) + for name, cap := range counterSet.Counters { + counterShared[name] = cap + } + availableCounters[counterSet.Name] = counterShared + } + + // Update the data structure to reflect capacity already in use. + for _, device := range slice.Spec.Devices { + deviceID := DeviceID{ + Driver: slice.Spec.Driver, + Pool: slice.Spec.Pool.Name, + Device: device.Name, + } + if !alloc.allocatedDevices.Has(deviceID) && !alloc.allocatingDevices[deviceID] { + continue + } + for _, consumedCounter := range device.Basic.ConsumesCounters { + counterShared := availableCounters[consumedCounter.CounterSet] + for name, cap := range consumedCounter.Counters { + existingCap, ok := counterShared[name] + if !ok { + // the API validation logic has been added to make sure the capacity referred should exist in capacityPools + continue + } + // This can potentially result in negative available capacity. That is fine, + // we just treat it as no capacity available. + existingCap.Value.Sub(cap.Value) + counterShared[name] = existingCap + } + } + } + + // Check if all consumed capacities for the device can be satisfied. + for _, deviceConsumedCounter := range device.basic.ConsumesCounters { + counterShared := availableCounters[deviceConsumedCounter.CounterSet] + for name, cap := range deviceConsumedCounter.Counters { + availableCap, found := counterShared[name] + // If the device requests a capacity that doesn't exist in + // the pool, it can not be allocated. + if !found { + return false, nil + } + // If the device requests more capacity than is available, it + // can not be allocated. + if availableCap.Value.Cmp(cap.Value) < 0 { + return false, nil + } + } + } + + return true, nil +} + // createNodeSelector constructs a node selector for the allocation, if needed, // otherwise it returns nil. func (alloc *allocator) createNodeSelector(result []internalDeviceResult) (*v1.NodeSelector, error) { // Selector with one term. That term gets extended with additional // requirements from the different devices. - nodeSelector := &v1.NodeSelector{ + ns := &v1.NodeSelector{ NodeSelectorTerms: []v1.NodeSelectorTerm{{}}, } for i := range result { slice := result[i].slice - if slice.Spec.NodeName != draapi.NullUniqueString { + var nodeName draapi.UniqueString + var nodeSelector *v1.NodeSelector + if ptr.Deref(slice.Spec.PerDeviceNodeSelection, false) { + if result[i].basic.NodeName != nil { + nodeName = draapi.MakeUniqueString(*result[i].basic.NodeName) + } + nodeSelector = result[i].basic.NodeSelector + } else { + nodeName = slice.Spec.NodeName + nodeSelector = slice.Spec.NodeSelector + } + if nodeName != draapi.NullUniqueString { // At least one device is local to one node. This // restricts the allocation to that node. return &v1.NodeSelector{ @@ -822,35 +1171,126 @@ func (alloc *allocator) createNodeSelector(result []internalDeviceResult) (*v1.N MatchFields: []v1.NodeSelectorRequirement{{ Key: "metadata.name", Operator: v1.NodeSelectorOpIn, - Values: []string{slice.Spec.NodeName.String()}, + Values: []string{nodeName.String()}, }}, }}, }, nil } - if slice.Spec.NodeSelector != nil { - switch len(slice.Spec.NodeSelector.NodeSelectorTerms) { + if nodeSelector != nil { + switch len(nodeSelector.NodeSelectorTerms) { case 0: // Nothing? case 1: // Add all terms if they are not present already. - addNewNodeSelectorRequirements(slice.Spec.NodeSelector.NodeSelectorTerms[0].MatchFields, &nodeSelector.NodeSelectorTerms[0].MatchFields) - addNewNodeSelectorRequirements(slice.Spec.NodeSelector.NodeSelectorTerms[0].MatchExpressions, &nodeSelector.NodeSelectorTerms[0].MatchExpressions) + addNewNodeSelectorRequirements(nodeSelector.NodeSelectorTerms[0].MatchFields, &ns.NodeSelectorTerms[0].MatchFields) + addNewNodeSelectorRequirements(nodeSelector.NodeSelectorTerms[0].MatchExpressions, &ns.NodeSelectorTerms[0].MatchExpressions) default: // This shouldn't occur, validation must prevent creation of such slices. - return nil, fmt.Errorf("unsupported ResourceSlice.NodeSelector with %d terms", len(slice.Spec.NodeSelector.NodeSelectorTerms)) + return nil, fmt.Errorf("unsupported ResourceSlice.NodeSelector with %d terms", len(nodeSelector.NodeSelectorTerms)) } } } - if len(nodeSelector.NodeSelectorTerms[0].MatchFields) > 0 || len(nodeSelector.NodeSelectorTerms[0].MatchExpressions) > 0 { + if len(ns.NodeSelectorTerms[0].MatchFields) > 0 || len(ns.NodeSelectorTerms[0].MatchExpressions) > 0 { // We have a valid node selector. - return nodeSelector, nil + return ns, nil } // Available everywhere. return nil, nil } +// requestAccessor is an interface for accessing either +// DeviceRequests or DeviceSubRequests. It lets most +// of the allocator code work with either DeviceRequests +// or DeviceSubRequests. +type requestAccessor interface { + name() string + deviceClassName() string + allocationMode() resourceapi.DeviceAllocationMode + count() int64 + adminAccess() bool + hasAdminAccess() bool + selectors() []resourceapi.DeviceSelector + tolerations() []resourceapi.DeviceToleration +} + +// deviceRequestAccessor is an implementation of the +// requestAccessor interface for DeviceRequests. +type deviceRequestAccessor struct { + request *resourceapi.DeviceRequest +} + +func (d *deviceRequestAccessor) name() string { + return d.request.Name +} + +func (d *deviceRequestAccessor) deviceClassName() string { + return d.request.DeviceClassName +} + +func (d *deviceRequestAccessor) allocationMode() resourceapi.DeviceAllocationMode { + return d.request.AllocationMode +} + +func (d *deviceRequestAccessor) count() int64 { + return d.request.Count +} + +func (d *deviceRequestAccessor) adminAccess() bool { + return ptr.Deref(d.request.AdminAccess, false) +} + +func (d *deviceRequestAccessor) hasAdminAccess() bool { + return d.request.AdminAccess != nil +} + +func (d *deviceRequestAccessor) selectors() []resourceapi.DeviceSelector { + return d.request.Selectors +} + +func (d *deviceRequestAccessor) tolerations() []resourceapi.DeviceToleration { + return d.request.Tolerations +} + +// deviceSubRequestAccessor is an implementation of the +// requestAccessor interface for DeviceSubRequests. +type deviceSubRequestAccessor struct { + subRequest *resourceapi.DeviceSubRequest +} + +func (d *deviceSubRequestAccessor) name() string { + return d.subRequest.Name +} + +func (d *deviceSubRequestAccessor) deviceClassName() string { + return d.subRequest.DeviceClassName +} + +func (d *deviceSubRequestAccessor) allocationMode() resourceapi.DeviceAllocationMode { + return d.subRequest.AllocationMode +} + +func (d *deviceSubRequestAccessor) count() int64 { + return d.subRequest.Count +} + +func (d *deviceSubRequestAccessor) adminAccess() bool { + return false +} + +func (d *deviceSubRequestAccessor) hasAdminAccess() bool { + return false +} + +func (d *deviceSubRequestAccessor) selectors() []resourceapi.DeviceSelector { + return d.subRequest.Selectors +} + +func (d *deviceSubRequestAccessor) tolerations() []resourceapi.DeviceToleration { + return d.subRequest.Tolerations +} + func addNewNodeSelectorRequirements(from []v1.NodeSelectorRequirement, to *[]v1.NodeSelectorRequirement) { for _, requirement := range from { if !containsNodeSelectorRequirement(*to, requirement) { diff --git a/e2e/vendor/k8s.io/dynamic-resource-allocation/structured/pools.go b/e2e/vendor/k8s.io/dynamic-resource-allocation/structured/pools.go index 6087dbc18..fbb247c63 100644 --- a/e2e/vendor/k8s.io/dynamic-resource-allocation/structured/pools.go +++ b/e2e/vendor/k8s.io/dynamic-resource-allocation/structured/pools.go @@ -27,40 +27,71 @@ import ( draapi "k8s.io/dynamic-resource-allocation/api" ) +func nodeMatches(node *v1.Node, nodeNameToMatch string, allNodesMatch bool, nodeSelector *v1.NodeSelector) (bool, error) { + switch { + case nodeNameToMatch != "": + return node != nil && node.Name == nodeNameToMatch, nil + case allNodesMatch: + return true, nil + case nodeSelector != nil: + selector, err := nodeaffinity.NewNodeSelector(nodeSelector) + if err != nil { + return false, fmt.Errorf("failed to parse node selector %s: %w", nodeSelector.String(), err) + } + return selector.Match(node), nil + } + + return false, nil +} + // GatherPools collects information about all resource pools which provide // devices that are accessible from the given node. // // Out-dated slices are silently ignored. Pools may be incomplete (not all // required slices available) or invalid (for example, device names not unique). // Both is recorded in the result. -func GatherPools(ctx context.Context, slices []*resourceapi.ResourceSlice, node *v1.Node) ([]*Pool, error) { +func GatherPools(ctx context.Context, slices []*resourceapi.ResourceSlice, node *v1.Node, features Features) ([]*Pool, error) { pools := make(map[PoolID]*Pool) - nodeName := "" - if node != nil { - nodeName = node.Name - } for _, slice := range slices { + if !features.PartitionableDevices && (len(slice.Spec.SharedCounters) > 0 || slice.Spec.PerDeviceNodeSelection != nil) { + continue + } + switch { - case slice.Spec.NodeName != "": - if slice.Spec.NodeName == nodeName { + case slice.Spec.NodeName != "" || slice.Spec.AllNodes || slice.Spec.NodeSelector != nil: + match, err := nodeMatches(node, slice.Spec.NodeName, slice.Spec.AllNodes, slice.Spec.NodeSelector) + if err != nil { + return nil, fmt.Errorf("failed to perform node selection for slice %s: %w", slice.Name, err) + } + if match { if err := addSlice(pools, slice); err != nil { - return nil, fmt.Errorf("add node slice %s: %w", slice.Name, err) + return nil, fmt.Errorf("failed to add node slice %s: %w", slice.Name, err) } } - case slice.Spec.AllNodes: - if err := addSlice(pools, slice); err != nil { - return nil, fmt.Errorf("add cluster slice %s: %w", slice.Name, err) - } - case slice.Spec.NodeSelector != nil: - // TODO: move conversion into api. - selector, err := nodeaffinity.NewNodeSelector(slice.Spec.NodeSelector) - if err != nil { - return nil, fmt.Errorf("node selector in resource slice %s: %w", slice.Name, err) - } - if selector.Match(node) { - if err := addSlice(pools, slice); err != nil { - return nil, fmt.Errorf("add matching slice %s: %w", slice.Name, err) + case slice.Spec.PerDeviceNodeSelection != nil && *slice.Spec.PerDeviceNodeSelection: + for _, device := range slice.Spec.Devices { + if device.Basic == nil { + continue + } + var nodeName string + var allNodes bool + if device.Basic.NodeName != nil { + nodeName = *device.Basic.NodeName + } + if device.Basic.AllNodes != nil { + allNodes = *device.Basic.AllNodes + } + match, err := nodeMatches(node, nodeName, allNodes, device.Basic.NodeSelector) + if err != nil { + return nil, fmt.Errorf("failed to perform node selection for device %s in slice %s: %w", + device.String(), slice.Name, err) + } + if match { + if err := addSlice(pools, slice); err != nil { + return nil, fmt.Errorf("failed to add node slice %s: %w", slice.Name, err) + } + break } } default: diff --git a/e2e/vendor/k8s.io/kms/apis/v1beta1/api.pb.go b/e2e/vendor/k8s.io/kms/apis/v1beta1/api.pb.go deleted file mode 100644 index 3361bc5f5..000000000 --- a/e2e/vendor/k8s.io/kms/apis/v1beta1/api.pb.go +++ /dev/null @@ -1,510 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// api.proto is a deprecated file. - -package v1beta1 - -import ( - context "context" - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Deprecated: KMSv1 is deprecated in v1.28 and will only receive security updates going forward. Use KMSv2 instead. -type VersionRequest struct { - // Version of the KMS plugin API. - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VersionRequest) Reset() { *m = VersionRequest{} } -func (m *VersionRequest) String() string { return proto.CompactTextString(m) } -func (*VersionRequest) ProtoMessage() {} -func (*VersionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{0} -} -func (m *VersionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VersionRequest.Unmarshal(m, b) -} -func (m *VersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VersionRequest.Marshal(b, m, deterministic) -} -func (m *VersionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_VersionRequest.Merge(m, src) -} -func (m *VersionRequest) XXX_Size() int { - return xxx_messageInfo_VersionRequest.Size(m) -} -func (m *VersionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_VersionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_VersionRequest proto.InternalMessageInfo - -func (m *VersionRequest) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -// Deprecated: KMSv1 is deprecated in v1.28 and will only receive security updates going forward. Use KMSv2 instead. -type VersionResponse struct { - // Version of the KMS plugin API. - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // Name of the KMS provider. - RuntimeName string `protobuf:"bytes,2,opt,name=runtime_name,json=runtimeName,proto3" json:"runtime_name,omitempty"` - // Version of the KMS provider. The string must be semver-compatible. - RuntimeVersion string `protobuf:"bytes,3,opt,name=runtime_version,json=runtimeVersion,proto3" json:"runtime_version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VersionResponse) Reset() { *m = VersionResponse{} } -func (m *VersionResponse) String() string { return proto.CompactTextString(m) } -func (*VersionResponse) ProtoMessage() {} -func (*VersionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{1} -} -func (m *VersionResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VersionResponse.Unmarshal(m, b) -} -func (m *VersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VersionResponse.Marshal(b, m, deterministic) -} -func (m *VersionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_VersionResponse.Merge(m, src) -} -func (m *VersionResponse) XXX_Size() int { - return xxx_messageInfo_VersionResponse.Size(m) -} -func (m *VersionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_VersionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_VersionResponse proto.InternalMessageInfo - -func (m *VersionResponse) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *VersionResponse) GetRuntimeName() string { - if m != nil { - return m.RuntimeName - } - return "" -} - -func (m *VersionResponse) GetRuntimeVersion() string { - if m != nil { - return m.RuntimeVersion - } - return "" -} - -// Deprecated: KMSv1 is deprecated in v1.28 and will only receive security updates going forward. Use KMSv2 instead. -type DecryptRequest struct { - // Version of the KMS plugin API. - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // The data to be decrypted. - Cipher []byte `protobuf:"bytes,2,opt,name=cipher,proto3" json:"cipher,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DecryptRequest) Reset() { *m = DecryptRequest{} } -func (m *DecryptRequest) String() string { return proto.CompactTextString(m) } -func (*DecryptRequest) ProtoMessage() {} -func (*DecryptRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{2} -} -func (m *DecryptRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DecryptRequest.Unmarshal(m, b) -} -func (m *DecryptRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DecryptRequest.Marshal(b, m, deterministic) -} -func (m *DecryptRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DecryptRequest.Merge(m, src) -} -func (m *DecryptRequest) XXX_Size() int { - return xxx_messageInfo_DecryptRequest.Size(m) -} -func (m *DecryptRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DecryptRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DecryptRequest proto.InternalMessageInfo - -func (m *DecryptRequest) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *DecryptRequest) GetCipher() []byte { - if m != nil { - return m.Cipher - } - return nil -} - -// Deprecated: KMSv1 is deprecated in v1.28 and will only receive security updates going forward. Use KMSv2 instead. -type DecryptResponse struct { - // The decrypted data. - Plain []byte `protobuf:"bytes,1,opt,name=plain,proto3" json:"plain,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DecryptResponse) Reset() { *m = DecryptResponse{} } -func (m *DecryptResponse) String() string { return proto.CompactTextString(m) } -func (*DecryptResponse) ProtoMessage() {} -func (*DecryptResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{3} -} -func (m *DecryptResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DecryptResponse.Unmarshal(m, b) -} -func (m *DecryptResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DecryptResponse.Marshal(b, m, deterministic) -} -func (m *DecryptResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DecryptResponse.Merge(m, src) -} -func (m *DecryptResponse) XXX_Size() int { - return xxx_messageInfo_DecryptResponse.Size(m) -} -func (m *DecryptResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DecryptResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DecryptResponse proto.InternalMessageInfo - -func (m *DecryptResponse) GetPlain() []byte { - if m != nil { - return m.Plain - } - return nil -} - -// Deprecated: KMSv1 is deprecated in v1.28 and will only receive security updates going forward. Use KMSv2 instead. -type EncryptRequest struct { - // Version of the KMS plugin API. - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // The data to be encrypted. - Plain []byte `protobuf:"bytes,2,opt,name=plain,proto3" json:"plain,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EncryptRequest) Reset() { *m = EncryptRequest{} } -func (m *EncryptRequest) String() string { return proto.CompactTextString(m) } -func (*EncryptRequest) ProtoMessage() {} -func (*EncryptRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{4} -} -func (m *EncryptRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EncryptRequest.Unmarshal(m, b) -} -func (m *EncryptRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EncryptRequest.Marshal(b, m, deterministic) -} -func (m *EncryptRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_EncryptRequest.Merge(m, src) -} -func (m *EncryptRequest) XXX_Size() int { - return xxx_messageInfo_EncryptRequest.Size(m) -} -func (m *EncryptRequest) XXX_DiscardUnknown() { - xxx_messageInfo_EncryptRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_EncryptRequest proto.InternalMessageInfo - -func (m *EncryptRequest) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *EncryptRequest) GetPlain() []byte { - if m != nil { - return m.Plain - } - return nil -} - -// Deprecated: KMSv1 is deprecated in v1.28 and will only receive security updates going forward. Use KMSv2 instead. -type EncryptResponse struct { - // The encrypted data. - Cipher []byte `protobuf:"bytes,1,opt,name=cipher,proto3" json:"cipher,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EncryptResponse) Reset() { *m = EncryptResponse{} } -func (m *EncryptResponse) String() string { return proto.CompactTextString(m) } -func (*EncryptResponse) ProtoMessage() {} -func (*EncryptResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{5} -} -func (m *EncryptResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EncryptResponse.Unmarshal(m, b) -} -func (m *EncryptResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EncryptResponse.Marshal(b, m, deterministic) -} -func (m *EncryptResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_EncryptResponse.Merge(m, src) -} -func (m *EncryptResponse) XXX_Size() int { - return xxx_messageInfo_EncryptResponse.Size(m) -} -func (m *EncryptResponse) XXX_DiscardUnknown() { - xxx_messageInfo_EncryptResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_EncryptResponse proto.InternalMessageInfo - -func (m *EncryptResponse) GetCipher() []byte { - if m != nil { - return m.Cipher - } - return nil -} - -func init() { - proto.RegisterType((*VersionRequest)(nil), "v1beta1.VersionRequest") - proto.RegisterType((*VersionResponse)(nil), "v1beta1.VersionResponse") - proto.RegisterType((*DecryptRequest)(nil), "v1beta1.DecryptRequest") - proto.RegisterType((*DecryptResponse)(nil), "v1beta1.DecryptResponse") - proto.RegisterType((*EncryptRequest)(nil), "v1beta1.EncryptRequest") - proto.RegisterType((*EncryptResponse)(nil), "v1beta1.EncryptResponse") -} - -func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } - -var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 314 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xcf, 0x4a, 0xf3, 0x40, - 0x10, 0xef, 0xf6, 0xe3, 0x6b, 0xe9, 0x58, 0x12, 0x58, 0x8a, 0x0d, 0xe2, 0x41, 0xf7, 0x52, 0xf5, - 0x90, 0x52, 0xbd, 0x78, 0x12, 0x29, 0x7a, 0x12, 0x3d, 0x44, 0xf0, 0xe0, 0x45, 0xb6, 0x61, 0xd0, - 0xa5, 0x66, 0xb3, 0xee, 0x6e, 0x23, 0x7d, 0x33, 0x9f, 0xc4, 0xe7, 0x11, 0x93, 0x4d, 0xdc, 0x54, - 0x44, 0x8f, 0x33, 0xfb, 0xfb, 0x33, 0xbf, 0x99, 0x85, 0x01, 0x57, 0x22, 0x56, 0x3a, 0xb7, 0x39, - 0xed, 0x17, 0xb3, 0x05, 0x5a, 0x3e, 0x63, 0x47, 0x10, 0xdc, 0xa1, 0x36, 0x22, 0x97, 0x09, 0xbe, - 0xac, 0xd0, 0x58, 0x1a, 0x41, 0xbf, 0xa8, 0x3a, 0x11, 0xd9, 0x23, 0x07, 0x83, 0xa4, 0x2e, 0xd9, - 0x2b, 0x84, 0x0d, 0xd6, 0xa8, 0x5c, 0x1a, 0xfc, 0x19, 0x4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f9, 0x08, 0x00, 0x00, - 0xff, 0xff, 0x18, 0x47, 0x93, 0xb2, 0x92, 0x02, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// KeyManagementServiceClient is the client API for KeyManagementService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type KeyManagementServiceClient interface { - // Version returns the runtime name and runtime version of the KMS provider. - Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error) - // Execute decryption operation in KMS provider. - Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error) - // Execute encryption operation in KMS provider. - Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error) -} - -type keyManagementServiceClient struct { - cc *grpc.ClientConn -} - -func NewKeyManagementServiceClient(cc *grpc.ClientConn) KeyManagementServiceClient { - return &keyManagementServiceClient{cc} -} - -func (c *keyManagementServiceClient) Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error) { - out := new(VersionResponse) - err := c.cc.Invoke(ctx, "/v1beta1.KeyManagementService/Version", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error) { - out := new(DecryptResponse) - err := c.cc.Invoke(ctx, "/v1beta1.KeyManagementService/Decrypt", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error) { - out := new(EncryptResponse) - err := c.cc.Invoke(ctx, "/v1beta1.KeyManagementService/Encrypt", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// KeyManagementServiceServer is the server API for KeyManagementService service. -type KeyManagementServiceServer interface { - // Version returns the runtime name and runtime version of the KMS provider. - Version(context.Context, *VersionRequest) (*VersionResponse, error) - // Execute decryption operation in KMS provider. - Decrypt(context.Context, *DecryptRequest) (*DecryptResponse, error) - // Execute encryption operation in KMS provider. - Encrypt(context.Context, *EncryptRequest) (*EncryptResponse, error) -} - -// UnimplementedKeyManagementServiceServer can be embedded to have forward compatible implementations. -type UnimplementedKeyManagementServiceServer struct { -} - -func (*UnimplementedKeyManagementServiceServer) Version(ctx context.Context, req *VersionRequest) (*VersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Version not implemented") -} -func (*UnimplementedKeyManagementServiceServer) Decrypt(ctx context.Context, req *DecryptRequest) (*DecryptResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Decrypt not implemented") -} -func (*UnimplementedKeyManagementServiceServer) Encrypt(ctx context.Context, req *EncryptRequest) (*EncryptResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Encrypt not implemented") -} - -func RegisterKeyManagementServiceServer(s *grpc.Server, srv KeyManagementServiceServer) { - s.RegisterService(&_KeyManagementService_serviceDesc, srv) -} - -func _KeyManagementService_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(VersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).Version(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta1.KeyManagementService/Version", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).Version(ctx, req.(*VersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_Decrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DecryptRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).Decrypt(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta1.KeyManagementService/Decrypt", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).Decrypt(ctx, req.(*DecryptRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_Encrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EncryptRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).Encrypt(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1beta1.KeyManagementService/Encrypt", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).Encrypt(ctx, req.(*EncryptRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _KeyManagementService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "v1beta1.KeyManagementService", - HandlerType: (*KeyManagementServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Version", - Handler: _KeyManagementService_Version_Handler, - }, - { - MethodName: "Decrypt", - Handler: _KeyManagementService_Decrypt_Handler, - }, - { - MethodName: "Encrypt", - Handler: _KeyManagementService_Encrypt_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "api.proto", -} diff --git a/e2e/vendor/k8s.io/kms/apis/v1beta1/api.proto b/e2e/vendor/k8s.io/kms/apis/v1beta1/api.proto deleted file mode 100644 index f62abc7bf..000000000 --- a/e2e/vendor/k8s.io/kms/apis/v1beta1/api.proto +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// To regenerate api.pb.go run `hack/update-codegen.sh protobindings` -syntax = "proto3"; - -package v1beta1; -option go_package = "k8s.io/kms/apis/v1beta1"; -option deprecated = true; - -// This service defines the public APIs for remote KMS provider. -service KeyManagementService { - // Version returns the runtime name and runtime version of the KMS provider. - rpc Version(VersionRequest) returns (VersionResponse) {} - - // Execute decryption operation in KMS provider. - rpc Decrypt(DecryptRequest) returns (DecryptResponse) {} - // Execute encryption operation in KMS provider. - rpc Encrypt(EncryptRequest) returns (EncryptResponse) {} -} - -// Deprecated: KMSv1 is deprecated in v1.28 and will only receive security updates going forward. Use KMSv2 instead. -message VersionRequest { - // Version of the KMS plugin API. - string version = 1; -} - -// Deprecated: KMSv1 is deprecated in v1.28 and will only receive security updates going forward. Use KMSv2 instead. -message VersionResponse { - // Version of the KMS plugin API. - string version = 1; - // Name of the KMS provider. - string runtime_name = 2; - // Version of the KMS provider. The string must be semver-compatible. - string runtime_version = 3; -} - -// Deprecated: KMSv1 is deprecated in v1.28 and will only receive security updates going forward. Use KMSv2 instead. -message DecryptRequest { - // Version of the KMS plugin API. - string version = 1; - // The data to be decrypted. - bytes cipher = 2; -} - -// Deprecated: KMSv1 is deprecated in v1.28 and will only receive security updates going forward. Use KMSv2 instead. -message DecryptResponse { - // The decrypted data. - bytes plain = 1; -} - -// Deprecated: KMSv1 is deprecated in v1.28 and will only receive security updates going forward. Use KMSv2 instead. -message EncryptRequest { - // Version of the KMS plugin API. - string version = 1; - // The data to be encrypted. - bytes plain = 2; -} - -// Deprecated: KMSv1 is deprecated in v1.28 and will only receive security updates going forward. Use KMSv2 instead. -message EncryptResponse { - // The encrypted data. - bytes cipher = 1; -} diff --git a/e2e/vendor/k8s.io/kms/apis/v2/api.pb.go b/e2e/vendor/k8s.io/kms/apis/v2/api.pb.go deleted file mode 100644 index 225cc3f8f..000000000 --- a/e2e/vendor/k8s.io/kms/apis/v2/api.pb.go +++ /dev/null @@ -1,554 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: api.proto - -package v2 - -import ( - context "context" - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type StatusRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StatusRequest) Reset() { *m = StatusRequest{} } -func (m *StatusRequest) String() string { return proto.CompactTextString(m) } -func (*StatusRequest) ProtoMessage() {} -func (*StatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{0} -} -func (m *StatusRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StatusRequest.Unmarshal(m, b) -} -func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StatusRequest.Marshal(b, m, deterministic) -} -func (m *StatusRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_StatusRequest.Merge(m, src) -} -func (m *StatusRequest) XXX_Size() int { - return xxx_messageInfo_StatusRequest.Size(m) -} -func (m *StatusRequest) XXX_DiscardUnknown() { - xxx_messageInfo_StatusRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_StatusRequest proto.InternalMessageInfo - -type StatusResponse struct { - // Version of the KMS gRPC plugin API. Must equal v2 to v2beta1 (v2 is recommended, but both are equivalent). - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // Any value other than "ok" is failing healthz. On failure, the associated API server healthz endpoint will contain this value as part of the error message. - Healthz string `protobuf:"bytes,2,opt,name=healthz,proto3" json:"healthz,omitempty"` - // the current write key, used to determine staleness of data updated via value.Transformer.TransformFromStorage. - // keyID must satisfy the following constraints: - // 1. The keyID is not empty. - // 2. The size of keyID is less than 1 kB. - KeyId string `protobuf:"bytes,3,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StatusResponse) Reset() { *m = StatusResponse{} } -func (m *StatusResponse) String() string { return proto.CompactTextString(m) } -func (*StatusResponse) ProtoMessage() {} -func (*StatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{1} -} -func (m *StatusResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StatusResponse.Unmarshal(m, b) -} -func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StatusResponse.Marshal(b, m, deterministic) -} -func (m *StatusResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_StatusResponse.Merge(m, src) -} -func (m *StatusResponse) XXX_Size() int { - return xxx_messageInfo_StatusResponse.Size(m) -} -func (m *StatusResponse) XXX_DiscardUnknown() { - xxx_messageInfo_StatusResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_StatusResponse proto.InternalMessageInfo - -func (m *StatusResponse) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *StatusResponse) GetHealthz() string { - if m != nil { - return m.Healthz - } - return "" -} - -func (m *StatusResponse) GetKeyId() string { - if m != nil { - return m.KeyId - } - return "" -} - -type DecryptRequest struct { - // The data to be decrypted. - Ciphertext []byte `protobuf:"bytes,1,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"` - // UID is a unique identifier for the request. - Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` - // The keyID that was provided to the apiserver during encryption. - // This represents the KMS KEK that was used to encrypt the data. - KeyId string `protobuf:"bytes,3,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` - // Additional metadata that was sent by the KMS plugin during encryption. - Annotations map[string][]byte `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DecryptRequest) Reset() { *m = DecryptRequest{} } -func (m *DecryptRequest) String() string { return proto.CompactTextString(m) } -func (*DecryptRequest) ProtoMessage() {} -func (*DecryptRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{2} -} -func (m *DecryptRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DecryptRequest.Unmarshal(m, b) -} -func (m *DecryptRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DecryptRequest.Marshal(b, m, deterministic) -} -func (m *DecryptRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DecryptRequest.Merge(m, src) -} -func (m *DecryptRequest) XXX_Size() int { - return xxx_messageInfo_DecryptRequest.Size(m) -} -func (m *DecryptRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DecryptRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DecryptRequest proto.InternalMessageInfo - -func (m *DecryptRequest) GetCiphertext() []byte { - if m != nil { - return m.Ciphertext - } - return nil -} - -func (m *DecryptRequest) GetUid() string { - if m != nil { - return m.Uid - } - return "" -} - -func (m *DecryptRequest) GetKeyId() string { - if m != nil { - return m.KeyId - } - return "" -} - -func (m *DecryptRequest) GetAnnotations() map[string][]byte { - if m != nil { - return m.Annotations - } - return nil -} - -type DecryptResponse struct { - // The decrypted data. - Plaintext []byte `protobuf:"bytes,1,opt,name=plaintext,proto3" json:"plaintext,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DecryptResponse) Reset() { *m = DecryptResponse{} } -func (m *DecryptResponse) String() string { return proto.CompactTextString(m) } -func (*DecryptResponse) ProtoMessage() {} -func (*DecryptResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{3} -} -func (m *DecryptResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DecryptResponse.Unmarshal(m, b) -} -func (m *DecryptResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DecryptResponse.Marshal(b, m, deterministic) -} -func (m *DecryptResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DecryptResponse.Merge(m, src) -} -func (m *DecryptResponse) XXX_Size() int { - return xxx_messageInfo_DecryptResponse.Size(m) -} -func (m *DecryptResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DecryptResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DecryptResponse proto.InternalMessageInfo - -func (m *DecryptResponse) GetPlaintext() []byte { - if m != nil { - return m.Plaintext - } - return nil -} - -type EncryptRequest struct { - // The data to be encrypted. - Plaintext []byte `protobuf:"bytes,1,opt,name=plaintext,proto3" json:"plaintext,omitempty"` - // UID is a unique identifier for the request. - Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EncryptRequest) Reset() { *m = EncryptRequest{} } -func (m *EncryptRequest) String() string { return proto.CompactTextString(m) } -func (*EncryptRequest) ProtoMessage() {} -func (*EncryptRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{4} -} -func (m *EncryptRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EncryptRequest.Unmarshal(m, b) -} -func (m *EncryptRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EncryptRequest.Marshal(b, m, deterministic) -} -func (m *EncryptRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_EncryptRequest.Merge(m, src) -} -func (m *EncryptRequest) XXX_Size() int { - return xxx_messageInfo_EncryptRequest.Size(m) -} -func (m *EncryptRequest) XXX_DiscardUnknown() { - xxx_messageInfo_EncryptRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_EncryptRequest proto.InternalMessageInfo - -func (m *EncryptRequest) GetPlaintext() []byte { - if m != nil { - return m.Plaintext - } - return nil -} - -func (m *EncryptRequest) GetUid() string { - if m != nil { - return m.Uid - } - return "" -} - -type EncryptResponse struct { - // The encrypted data. - // ciphertext must satisfy the following constraints: - // 1. The ciphertext is not empty. - // 2. The ciphertext is less than 1 kB. - Ciphertext []byte `protobuf:"bytes,1,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"` - // The KMS key ID used to encrypt the data. This must always refer to the KMS KEK and not any local KEKs that may be in use. - // This can be used to inform staleness of data updated via value.Transformer.TransformFromStorage. - // keyID must satisfy the following constraints: - // 1. The keyID is not empty. - // 2. The size of keyID is less than 1 kB. - KeyId string `protobuf:"bytes,2,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` - // Additional metadata to be stored with the encrypted data. - // This data is stored in plaintext in etcd. KMS plugin implementations are responsible for pre-encrypting any sensitive data. - // Annotations must satisfy the following constraints: - // 1. Annotation key must be a fully qualified domain name that conforms to the definition in DNS (RFC 1123). - // 2. The size of annotations keys + values is less than 32 kB. - Annotations map[string][]byte `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EncryptResponse) Reset() { *m = EncryptResponse{} } -func (m *EncryptResponse) String() string { return proto.CompactTextString(m) } -func (*EncryptResponse) ProtoMessage() {} -func (*EncryptResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{5} -} -func (m *EncryptResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EncryptResponse.Unmarshal(m, b) -} -func (m *EncryptResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EncryptResponse.Marshal(b, m, deterministic) -} -func (m *EncryptResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_EncryptResponse.Merge(m, src) -} -func (m *EncryptResponse) XXX_Size() int { - return xxx_messageInfo_EncryptResponse.Size(m) -} -func (m *EncryptResponse) XXX_DiscardUnknown() { - xxx_messageInfo_EncryptResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_EncryptResponse proto.InternalMessageInfo - -func (m *EncryptResponse) GetCiphertext() []byte { - if m != nil { - return m.Ciphertext - } - return nil -} - -func (m *EncryptResponse) GetKeyId() string { - if m != nil { - return m.KeyId - } - return "" -} - -func (m *EncryptResponse) GetAnnotations() map[string][]byte { - if m != nil { - return m.Annotations - } - return nil -} - -func init() { - proto.RegisterType((*StatusRequest)(nil), "v2.StatusRequest") - proto.RegisterType((*StatusResponse)(nil), "v2.StatusResponse") - proto.RegisterType((*DecryptRequest)(nil), "v2.DecryptRequest") - proto.RegisterMapType((map[string][]byte)(nil), "v2.DecryptRequest.AnnotationsEntry") - proto.RegisterType((*DecryptResponse)(nil), "v2.DecryptResponse") - proto.RegisterType((*EncryptRequest)(nil), "v2.EncryptRequest") - proto.RegisterType((*EncryptResponse)(nil), "v2.EncryptResponse") - proto.RegisterMapType((map[string][]byte)(nil), "v2.EncryptResponse.AnnotationsEntry") -} - -func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } - -var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 403 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x93, 0xcd, 0x6e, 0xda, 0x40, - 0x10, 0xc7, 0xb1, 0x5d, 0x40, 0x0c, 0x14, 0xe8, 0x96, 0x4a, 0x16, 0xaa, 0x2a, 0xb4, 0xed, 0x81, - 0x93, 0xad, 0xba, 0x3d, 0xa0, 0x1e, 0xaa, 0xb6, 0x2a, 0x95, 0xaa, 0xaa, 0x17, 0x73, 0x6b, 0x0f, - 0xd1, 0x06, 0x46, 0x61, 0x65, 0x58, 0x3b, 0xde, 0xb5, 0x15, 0xe7, 0xbd, 0xf2, 0x1e, 0x79, 0x84, - 0x3c, 0x4a, 0x64, 0x7b, 0x01, 0x1b, 0x94, 0xe4, 0x94, 0x9b, 0xe7, 0xf3, 0x3f, 0xf3, 0xdb, 0x31, - 0x74, 0x58, 0xc4, 0x9d, 0x28, 0x0e, 0x55, 0x48, 0xcc, 0xd4, 0xa3, 0x03, 0x78, 0xb9, 0x50, 0x4c, - 0x25, 0xd2, 0xc7, 0xcb, 0x04, 0xa5, 0xa2, 0xff, 0xa1, 0xbf, 0x73, 0xc8, 0x28, 0x14, 0x12, 0x89, - 0x0d, 0xed, 0x14, 0x63, 0xc9, 0x43, 0x61, 0x1b, 0x13, 0x63, 0xda, 0xf1, 0x77, 0x66, 0x1e, 0x59, - 0x23, 0xdb, 0xa8, 0xf5, 0xb5, 0x6d, 0x96, 0x11, 0x6d, 0x92, 0x37, 0xd0, 0x0a, 0x30, 0x3b, 0xe3, - 0x2b, 0xdb, 0x2a, 0x02, 0xcd, 0x00, 0x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0xb5, 0xdb, 0x1d, 0x93, - 0xaa, 0xab, 0x9c, 0x93, 0x36, 0xc8, 0x67, 0x68, 0xeb, 0x17, 0x21, 0xe4, 0xf4, 0x1c, 0xc6, 0xaf, - 0x6b, 0xbe, 0x6a, 0x95, 0x5e, 0xb9, 0xac, 0xaa, 0xbf, 0x51, 0x59, 0x75, 0xc4, 0x84, 0x36, 0x7e, - 0x8c, 0xfe, 0x91, 0x60, 0x26, 0x1d, 0x1e, 0xba, 0xc1, 0x56, 0xba, 0x2c, 0xe2, 0xd2, 0x4d, 0xbd, - 0xf3, 0x56, 0xf1, 0xbf, 0x7d, 0xba, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x5f, 0xf8, 0x49, 0x17, 0x7c, - 0x03, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// KeyManagementServiceClient is the client API for KeyManagementService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type KeyManagementServiceClient interface { - // this API is meant to be polled - Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) - // Execute decryption operation in KMS provider. - Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error) - // Execute encryption operation in KMS provider. - Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error) -} - -type keyManagementServiceClient struct { - cc *grpc.ClientConn -} - -func NewKeyManagementServiceClient(cc *grpc.ClientConn) KeyManagementServiceClient { - return &keyManagementServiceClient{cc} -} - -func (c *keyManagementServiceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { - out := new(StatusResponse) - err := c.cc.Invoke(ctx, "/v2.KeyManagementService/Status", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error) { - out := new(DecryptResponse) - err := c.cc.Invoke(ctx, "/v2.KeyManagementService/Decrypt", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error) { - out := new(EncryptResponse) - err := c.cc.Invoke(ctx, "/v2.KeyManagementService/Encrypt", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// KeyManagementServiceServer is the server API for KeyManagementService service. -type KeyManagementServiceServer interface { - // this API is meant to be polled - Status(context.Context, *StatusRequest) (*StatusResponse, error) - // Execute decryption operation in KMS provider. - Decrypt(context.Context, *DecryptRequest) (*DecryptResponse, error) - // Execute encryption operation in KMS provider. - Encrypt(context.Context, *EncryptRequest) (*EncryptResponse, error) -} - -// UnimplementedKeyManagementServiceServer can be embedded to have forward compatible implementations. -type UnimplementedKeyManagementServiceServer struct { -} - -func (*UnimplementedKeyManagementServiceServer) Status(ctx context.Context, req *StatusRequest) (*StatusResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") -} -func (*UnimplementedKeyManagementServiceServer) Decrypt(ctx context.Context, req *DecryptRequest) (*DecryptResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Decrypt not implemented") -} -func (*UnimplementedKeyManagementServiceServer) Encrypt(ctx context.Context, req *EncryptRequest) (*EncryptResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Encrypt not implemented") -} - -func RegisterKeyManagementServiceServer(s *grpc.Server, srv KeyManagementServiceServer) { - s.RegisterService(&_KeyManagementService_serviceDesc, srv) -} - -func _KeyManagementService_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).Status(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v2.KeyManagementService/Status", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).Status(ctx, req.(*StatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_Decrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DecryptRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).Decrypt(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v2.KeyManagementService/Decrypt", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).Decrypt(ctx, req.(*DecryptRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_Encrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EncryptRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).Encrypt(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v2.KeyManagementService/Encrypt", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).Encrypt(ctx, req.(*EncryptRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _KeyManagementService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "v2.KeyManagementService", - HandlerType: (*KeyManagementServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Status", - Handler: _KeyManagementService_Status_Handler, - }, - { - MethodName: "Decrypt", - Handler: _KeyManagementService_Decrypt_Handler, - }, - { - MethodName: "Encrypt", - Handler: _KeyManagementService_Encrypt_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "api.proto", -} diff --git a/e2e/vendor/k8s.io/kms/apis/v2/api.proto b/e2e/vendor/k8s.io/kms/apis/v2/api.proto deleted file mode 100644 index be4752f47..000000000 --- a/e2e/vendor/k8s.io/kms/apis/v2/api.proto +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// To regenerate api.pb.go run `hack/update-codegen.sh protobindings` -syntax = "proto3"; - -package v2; -option go_package = "k8s.io/kms/apis/v2"; - -// This service defines the public APIs for remote KMS provider. -service KeyManagementService { - // this API is meant to be polled - rpc Status(StatusRequest) returns (StatusResponse) {} - - // Execute decryption operation in KMS provider. - rpc Decrypt(DecryptRequest) returns (DecryptResponse) {} - // Execute encryption operation in KMS provider. - rpc Encrypt(EncryptRequest) returns (EncryptResponse) {} -} - -message StatusRequest {} - -message StatusResponse { - // Version of the KMS gRPC plugin API. Must equal v2 to v2beta1 (v2 is recommended, but both are equivalent). - string version = 1; - // Any value other than "ok" is failing healthz. On failure, the associated API server healthz endpoint will contain this value as part of the error message. - string healthz = 2; - // the current write key, used to determine staleness of data updated via value.Transformer.TransformFromStorage. - // keyID must satisfy the following constraints: - // 1. The keyID is not empty. - // 2. The size of keyID is less than 1 kB. - string key_id = 3; -} - -message DecryptRequest { - // The data to be decrypted. - bytes ciphertext = 1; - // UID is a unique identifier for the request. - string uid = 2; - // The keyID that was provided to the apiserver during encryption. - // This represents the KMS KEK that was used to encrypt the data. - string key_id = 3; - // Additional metadata that was sent by the KMS plugin during encryption. - map annotations = 4; -} - -message DecryptResponse { - // The decrypted data. - bytes plaintext = 1; -} - -message EncryptRequest { - // The data to be encrypted. - bytes plaintext = 1; - // UID is a unique identifier for the request. - string uid = 2; -} - -message EncryptResponse { - // The encrypted data. - // ciphertext must satisfy the following constraints: - // 1. The ciphertext is not empty. - // 2. The ciphertext is less than 1 kB. - bytes ciphertext = 1; - // The KMS key ID used to encrypt the data. This must always refer to the KMS KEK and not any local KEKs that may be in use. - // This can be used to inform staleness of data updated via value.Transformer.TransformFromStorage. - // keyID must satisfy the following constraints: - // 1. The keyID is not empty. - // 2. The size of keyID is less than 1 kB. - string key_id = 2; - // Additional metadata to be stored with the encrypted data. - // This data is stored in plaintext in etcd. KMS plugin implementations are responsible for pre-encrypting any sensitive data. - // Annotations must satisfy the following constraints: - // 1. Annotation key must be a fully qualified domain name that conforms to the definition in DNS (RFC 1123). - // 2. The size of annotations keys + values is less than 32 kB. - map annotations = 3; -} diff --git a/e2e/vendor/k8s.io/kms/apis/v2/v2.go b/e2e/vendor/k8s.io/kms/apis/v2/v2.go deleted file mode 100644 index 99c4b57cc..000000000 --- a/e2e/vendor/k8s.io/kms/apis/v2/v2.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v2 contains definition of kms-plugin's gRPC service. -package v2 diff --git a/e2e/vendor/k8s.io/kms/pkg/service/grpc_service.go b/e2e/vendor/k8s.io/kms/pkg/service/grpc_service.go deleted file mode 100644 index d2d06da27..000000000 --- a/e2e/vendor/k8s.io/kms/pkg/service/grpc_service.go +++ /dev/null @@ -1,131 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package service - -import ( - "context" - "net" - "time" - - "google.golang.org/grpc" - - kmsapi "k8s.io/kms/apis/v2" -) - -// GRPCService is a grpc server that runs the kms v2 alpha1 API. -type GRPCService struct { - addr string - timeout time.Duration - server *grpc.Server - - kmsService Service -} - -var _ kmsapi.KeyManagementServiceServer = (*GRPCService)(nil) - -// NewGRPCService creates an instance of GRPCService. -func NewGRPCService( - address string, - timeout time.Duration, - - kmsService Service, -) *GRPCService { - return &GRPCService{ - addr: address, - timeout: timeout, - kmsService: kmsService, - } -} - -// ListenAndServe accepts incoming connections on a Unix socket. It is a blocking method. -// Returns non-nil error unless Close or Shutdown is called. -func (s *GRPCService) ListenAndServe() error { - ln, err := net.Listen("unix", s.addr) - if err != nil { - return err - } - defer ln.Close() - - gs := grpc.NewServer( - grpc.ConnectionTimeout(s.timeout), - ) - s.server = gs - - kmsapi.RegisterKeyManagementServiceServer(gs, s) - - return gs.Serve(ln) -} - -// Shutdown performs a graceful shutdown. Doesn't accept new connections and -// blocks until all pending RPCs are finished. -func (s *GRPCService) Shutdown() { - if s.server != nil { - s.server.GracefulStop() - } -} - -// Close stops the server by closing all connections immediately and cancels -// all active RPCs. -func (s *GRPCService) Close() { - if s.server != nil { - s.server.Stop() - } -} - -// Status sends a status request to specified kms service. -func (s *GRPCService) Status(ctx context.Context, _ *kmsapi.StatusRequest) (*kmsapi.StatusResponse, error) { - res, err := s.kmsService.Status(ctx) - if err != nil { - return nil, err - } - - return &kmsapi.StatusResponse{ - Version: res.Version, - Healthz: res.Healthz, - KeyId: res.KeyID, - }, nil -} - -// Decrypt sends a decryption request to specified kms service. -func (s *GRPCService) Decrypt(ctx context.Context, req *kmsapi.DecryptRequest) (*kmsapi.DecryptResponse, error) { - plaintext, err := s.kmsService.Decrypt(ctx, req.Uid, &DecryptRequest{ - Ciphertext: req.Ciphertext, - KeyID: req.KeyId, - Annotations: req.Annotations, - }) - if err != nil { - return nil, err - } - - return &kmsapi.DecryptResponse{ - Plaintext: plaintext, - }, nil -} - -// Encrypt sends an encryption request to specified kms service. -func (s *GRPCService) Encrypt(ctx context.Context, req *kmsapi.EncryptRequest) (*kmsapi.EncryptResponse, error) { - encRes, err := s.kmsService.Encrypt(ctx, req.Uid, req.Plaintext) - if err != nil { - return nil, err - } - - return &kmsapi.EncryptResponse{ - Ciphertext: encRes.Ciphertext, - KeyId: encRes.KeyID, - Annotations: encRes.Annotations, - }, nil -} diff --git a/e2e/vendor/k8s.io/kms/pkg/service/interface.go b/e2e/vendor/k8s.io/kms/pkg/service/interface.go deleted file mode 100644 index fad71fa0a..000000000 --- a/e2e/vendor/k8s.io/kms/pkg/service/interface.go +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package service - -import "context" - -// Service allows encrypting and decrypting data using an external Key Management Service. -type Service interface { - // Decrypt a given bytearray to obtain the original data as bytes. - Decrypt(ctx context.Context, uid string, req *DecryptRequest) ([]byte, error) - // Encrypt bytes to a ciphertext. - Encrypt(ctx context.Context, uid string, data []byte) (*EncryptResponse, error) - // Status returns the status of the KMS. - Status(ctx context.Context) (*StatusResponse, error) -} - -// EncryptResponse is the response from the Envelope service when encrypting data. -type EncryptResponse struct { - Ciphertext []byte - KeyID string - Annotations map[string][]byte -} - -// DecryptRequest is the request to the Envelope service when decrypting data. -type DecryptRequest struct { - Ciphertext []byte - KeyID string - Annotations map[string][]byte -} - -// StatusResponse is the response from the Envelope service when getting the status of the service. -type StatusResponse struct { - Version string - Healthz string - KeyID string -} diff --git a/e2e/vendor/k8s.io/kms/pkg/util/util.go b/e2e/vendor/k8s.io/kms/pkg/util/util.go deleted file mode 100644 index 008c6a532..000000000 --- a/e2e/vendor/k8s.io/kms/pkg/util/util.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package util - -import ( - "fmt" - "net/url" - "strings" -) - -const ( - // unixProtocol is the only supported protocol for remote KMS provider. - unixProtocol = "unix" -) - -// ParseEndpoint parses the endpoint to extract schema, host or path. -func ParseEndpoint(endpoint string) (string, error) { - if len(endpoint) == 0 { - return "", fmt.Errorf("remote KMS provider can't use empty string as endpoint") - } - - u, err := url.Parse(endpoint) - if err != nil { - return "", fmt.Errorf("invalid endpoint %q for remote KMS provider, error: %v", endpoint, err) - } - - if u.Scheme != unixProtocol { - return "", fmt.Errorf("unsupported scheme %q for remote KMS provider", u.Scheme) - } - - // Linux abstract namespace socket - no physical file required - // Warning: Linux Abstract sockets have not concept of ACL (unlike traditional file based sockets). - // However, Linux Abstract sockets are subject to Linux networking namespace, so will only be accessible to - // containers within the same pod (unless host networking is used). - if strings.HasPrefix(u.Path, "/@") { - return strings.TrimPrefix(u.Path, "/"), nil - } - - return u.Path, nil -} diff --git a/e2e/vendor/k8s.io/kube-openapi/pkg/builder/doc.go b/e2e/vendor/k8s.io/kube-openapi/pkg/builder/doc.go deleted file mode 100644 index c3109067f..000000000 --- a/e2e/vendor/k8s.io/kube-openapi/pkg/builder/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package builder contains code to generate OpenAPI discovery spec (which -// initial version of it also known as Swagger 2.0). -// For more details: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md -package builder diff --git a/e2e/vendor/k8s.io/kube-openapi/pkg/builder/openapi.go b/e2e/vendor/k8s.io/kube-openapi/pkg/builder/openapi.go deleted file mode 100644 index 1c4cb5bf8..000000000 --- a/e2e/vendor/k8s.io/kube-openapi/pkg/builder/openapi.go +++ /dev/null @@ -1,468 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package builder - -import ( - "encoding/json" - "fmt" - "net/http" - "strings" - - restful "github.com/emicklei/go-restful/v3" - - "k8s.io/kube-openapi/pkg/common" - "k8s.io/kube-openapi/pkg/common/restfuladapter" - "k8s.io/kube-openapi/pkg/util" - "k8s.io/kube-openapi/pkg/validation/spec" -) - -const ( - OpenAPIVersion = "2.0" -) - -type openAPI struct { - config *common.Config - swagger *spec.Swagger - protocolList []string - definitions map[string]common.OpenAPIDefinition -} - -// BuildOpenAPISpec builds OpenAPI spec given a list of route containers and common.Config to customize it. -// -// Deprecated: BuildOpenAPISpecFromRoutes should be used instead. -func BuildOpenAPISpec(routeContainers []*restful.WebService, config *common.Config) (*spec.Swagger, error) { - return BuildOpenAPISpecFromRoutes(restfuladapter.AdaptWebServices(routeContainers), config) -} - -// BuildOpenAPISpecFromRoutes builds OpenAPI spec given a list of route containers and common.Config to customize it. -func BuildOpenAPISpecFromRoutes(routeContainers []common.RouteContainer, config *common.Config) (*spec.Swagger, error) { - o := newOpenAPI(config) - err := o.buildPaths(routeContainers) - if err != nil { - return nil, err - } - return o.finalizeSwagger() -} - -// BuildOpenAPIDefinitionsForResource builds a partial OpenAPI spec given a sample object and common.Config to customize it. -func BuildOpenAPIDefinitionsForResource(model interface{}, config *common.Config) (*spec.Definitions, error) { - o := newOpenAPI(config) - // We can discard the return value of toSchema because all we care about is the side effect of calling it. - // All the models created for this resource get added to o.swagger.Definitions - _, err := o.toSchema(util.GetCanonicalTypeName(model)) - if err != nil { - return nil, err - } - swagger, err := o.finalizeSwagger() - if err != nil { - return nil, err - } - return &swagger.Definitions, nil -} - -// BuildOpenAPIDefinitionsForResources returns the OpenAPI spec which includes the definitions for the -// passed type names. -func BuildOpenAPIDefinitionsForResources(config *common.Config, names ...string) (*spec.Swagger, error) { - o := newOpenAPI(config) - // We can discard the return value of toSchema because all we care about is the side effect of calling it. - // All the models created for this resource get added to o.swagger.Definitions - for _, name := range names { - _, err := o.toSchema(name) - if err != nil { - return nil, err - } - } - return o.finalizeSwagger() -} - -// newOpenAPI sets up the openAPI object so we can build the spec. -func newOpenAPI(config *common.Config) openAPI { - o := openAPI{ - config: config, - swagger: &spec.Swagger{ - SwaggerProps: spec.SwaggerProps{ - Swagger: OpenAPIVersion, - Definitions: spec.Definitions{}, - Responses: config.ResponseDefinitions, - Paths: &spec.Paths{Paths: map[string]spec.PathItem{}}, - Info: config.Info, - }, - }, - } - - if o.config.GetOperationIDAndTagsFromRoute == nil { - // Map the deprecated handler to the common interface, if provided. - if o.config.GetOperationIDAndTags != nil { - o.config.GetOperationIDAndTagsFromRoute = func(r common.Route) (string, []string, error) { - restfulRouteAdapter, ok := r.(*restfuladapter.RouteAdapter) - if !ok { - return "", nil, fmt.Errorf("config.GetOperationIDAndTags specified but route is not a restful v1 Route") - } - - return o.config.GetOperationIDAndTags(restfulRouteAdapter.Route) - } - } else { - o.config.GetOperationIDAndTagsFromRoute = func(r common.Route) (string, []string, error) { - return r.OperationName(), nil, nil - } - } - } - - if o.config.GetDefinitionName == nil { - o.config.GetDefinitionName = func(name string) (string, spec.Extensions) { - return name[strings.LastIndex(name, "/")+1:], nil - } - } - o.definitions = o.config.GetDefinitions(func(name string) spec.Ref { - defName, _ := o.config.GetDefinitionName(name) - return spec.MustCreateRef("#/definitions/" + common.EscapeJsonPointer(defName)) - }) - if o.config.CommonResponses == nil { - o.config.CommonResponses = map[int]spec.Response{} - } - return o -} - -// finalizeSwagger is called after the spec is built and returns the final spec. -// NOTE: finalizeSwagger also make changes to the final spec, as specified in the config. -func (o *openAPI) finalizeSwagger() (*spec.Swagger, error) { - if o.config.SecurityDefinitions != nil { - o.swagger.SecurityDefinitions = *o.config.SecurityDefinitions - o.swagger.Security = o.config.DefaultSecurity - } - if o.config.PostProcessSpec != nil { - var err error - o.swagger, err = o.config.PostProcessSpec(o.swagger) - if err != nil { - return nil, err - } - } - - return deduplicateParameters(o.swagger) -} - -func (o *openAPI) buildDefinitionRecursively(name string) error { - uniqueName, extensions := o.config.GetDefinitionName(name) - if _, ok := o.swagger.Definitions[uniqueName]; ok { - return nil - } - if item, ok := o.definitions[name]; ok { - schema := spec.Schema{ - VendorExtensible: item.Schema.VendorExtensible, - SchemaProps: item.Schema.SchemaProps, - SwaggerSchemaProps: item.Schema.SwaggerSchemaProps, - } - if extensions != nil { - if schema.Extensions == nil { - schema.Extensions = spec.Extensions{} - } - for k, v := range extensions { - schema.Extensions[k] = v - } - } - if v, ok := item.Schema.Extensions[common.ExtensionV2Schema]; ok { - if v2Schema, isOpenAPISchema := v.(spec.Schema); isOpenAPISchema { - schema = v2Schema - } - } - o.swagger.Definitions[uniqueName] = schema - for _, v := range item.Dependencies { - if err := o.buildDefinitionRecursively(v); err != nil { - return err - } - } - } else { - return fmt.Errorf("cannot find model definition for %v. If you added a new type, you may need to add +k8s:openapi-gen=true to the package or type and run code-gen again", name) - } - return nil -} - -// buildDefinitionForType build a definition for a given type and return a referable name to its definition. -// This is the main function that keep track of definitions used in this spec and is depend on code generated -// by k8s.io/kubernetes/cmd/libs/go2idl/openapi-gen. -func (o *openAPI) buildDefinitionForType(name string) (string, error) { - if err := o.buildDefinitionRecursively(name); err != nil { - return "", err - } - defName, _ := o.config.GetDefinitionName(name) - return "#/definitions/" + common.EscapeJsonPointer(defName), nil -} - -// buildPaths builds OpenAPI paths using go-restful's web services. -func (o *openAPI) buildPaths(routeContainers []common.RouteContainer) error { - pathsToIgnore := util.NewTrie(o.config.IgnorePrefixes) - duplicateOpId := make(map[string]string) - for _, w := range routeContainers { - rootPath := w.RootPath() - if pathsToIgnore.HasPrefix(rootPath) { - continue - } - commonParams, err := o.buildParameters(w.PathParameters()) - if err != nil { - return err - } - for path, routes := range groupRoutesByPath(w.Routes()) { - // go-swagger has special variable definition {$NAME:*} that can only be - // used at the end of the path and it is not recognized by OpenAPI. - if strings.HasSuffix(path, ":*}") { - path = path[:len(path)-3] + "}" - } - if pathsToIgnore.HasPrefix(path) { - continue - } - // Aggregating common parameters make API spec (and generated clients) simpler - inPathCommonParamsMap, err := o.findCommonParameters(routes) - if err != nil { - return err - } - pathItem, exists := o.swagger.Paths.Paths[path] - if exists { - return fmt.Errorf("duplicate webservice route has been found for path: %v", path) - } - pathItem = spec.PathItem{ - PathItemProps: spec.PathItemProps{ - Parameters: make([]spec.Parameter, 0), - }, - } - // add web services's parameters as well as any parameters appears in all ops, as common parameters - pathItem.Parameters = append(pathItem.Parameters, commonParams...) - for _, p := range inPathCommonParamsMap { - pathItem.Parameters = append(pathItem.Parameters, p) - } - sortParameters(pathItem.Parameters) - for _, route := range routes { - op, err := o.buildOperations(route, inPathCommonParamsMap) - sortParameters(op.Parameters) - if err != nil { - return err - } - dpath, exists := duplicateOpId[op.ID] - if exists { - return fmt.Errorf("duplicate Operation ID %v for path %v and %v", op.ID, dpath, path) - } else { - duplicateOpId[op.ID] = path - } - switch strings.ToUpper(route.Method()) { - case "GET": - pathItem.Get = op - case "POST": - pathItem.Post = op - case "HEAD": - pathItem.Head = op - case "PUT": - pathItem.Put = op - case "DELETE": - pathItem.Delete = op - case "OPTIONS": - pathItem.Options = op - case "PATCH": - pathItem.Patch = op - } - } - o.swagger.Paths.Paths[path] = pathItem - } - } - return nil -} - -// buildOperations builds operations for each webservice path -func (o *openAPI) buildOperations(route common.Route, inPathCommonParamsMap map[interface{}]spec.Parameter) (ret *spec.Operation, err error) { - ret = &spec.Operation{ - OperationProps: spec.OperationProps{ - Description: route.Description(), - Consumes: route.Consumes(), - Produces: route.Produces(), - Schemes: o.config.ProtocolList, - Responses: &spec.Responses{ - ResponsesProps: spec.ResponsesProps{ - StatusCodeResponses: make(map[int]spec.Response), - }, - }, - }, - } - for k, v := range route.Metadata() { - if strings.HasPrefix(k, common.ExtensionPrefix) { - if ret.Extensions == nil { - ret.Extensions = spec.Extensions{} - } - ret.Extensions.Add(k, v) - } - } - if ret.ID, ret.Tags, err = o.config.GetOperationIDAndTagsFromRoute(route); err != nil { - return ret, err - } - - // Build responses - for _, resp := range route.StatusCodeResponses() { - ret.Responses.StatusCodeResponses[resp.Code()], err = o.buildResponse(resp.Model(), resp.Message()) - if err != nil { - return ret, err - } - } - // If there is no response but a write sample, assume that write sample is an http.StatusOK response. - if len(ret.Responses.StatusCodeResponses) == 0 && route.ResponsePayloadSample() != nil { - ret.Responses.StatusCodeResponses[http.StatusOK], err = o.buildResponse(route.ResponsePayloadSample(), "OK") - if err != nil { - return ret, err - } - } - for code, resp := range o.config.CommonResponses { - if _, exists := ret.Responses.StatusCodeResponses[code]; !exists { - ret.Responses.StatusCodeResponses[code] = resp - } - } - // If there is still no response, use default response provided. - if len(ret.Responses.StatusCodeResponses) == 0 { - ret.Responses.Default = o.config.DefaultResponse - } - - // Build non-common Parameters - ret.Parameters = make([]spec.Parameter, 0) - for _, param := range route.Parameters() { - if _, isCommon := inPathCommonParamsMap[mapKeyFromParam(param)]; !isCommon { - openAPIParam, err := o.buildParameter(param, route.RequestPayloadSample()) - if err != nil { - return ret, err - } - ret.Parameters = append(ret.Parameters, openAPIParam) - } - } - return ret, nil -} - -func (o *openAPI) buildResponse(model interface{}, description string) (spec.Response, error) { - schema, err := o.toSchema(util.GetCanonicalTypeName(model)) - if err != nil { - return spec.Response{}, err - } - return spec.Response{ - ResponseProps: spec.ResponseProps{ - Description: description, - Schema: schema, - }, - }, nil -} - -func (o *openAPI) findCommonParameters(routes []common.Route) (map[interface{}]spec.Parameter, error) { - commonParamsMap := make(map[interface{}]spec.Parameter, 0) - paramOpsCountByName := make(map[interface{}]int, 0) - paramNameKindToDataMap := make(map[interface{}]common.Parameter, 0) - for _, route := range routes { - routeParamDuplicateMap := make(map[interface{}]bool) - s := "" - params := route.Parameters() - for _, param := range params { - m, _ := json.Marshal(param) - s += string(m) + "\n" - key := mapKeyFromParam(param) - if routeParamDuplicateMap[key] { - msg, _ := json.Marshal(params) - return commonParamsMap, fmt.Errorf("duplicate parameter %v for route %v, %v", param.Name(), string(msg), s) - } - routeParamDuplicateMap[key] = true - paramOpsCountByName[key]++ - paramNameKindToDataMap[key] = param - } - } - for key, count := range paramOpsCountByName { - paramData := paramNameKindToDataMap[key] - if count == len(routes) && paramData.Kind() != common.BodyParameterKind { - openAPIParam, err := o.buildParameter(paramData, nil) - if err != nil { - return commonParamsMap, err - } - commonParamsMap[key] = openAPIParam - } - } - return commonParamsMap, nil -} - -func (o *openAPI) toSchema(name string) (_ *spec.Schema, err error) { - if openAPIType, openAPIFormat := common.OpenAPITypeFormat(name); openAPIType != "" { - return &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{openAPIType}, - Format: openAPIFormat, - }, - }, nil - } else { - ref, err := o.buildDefinitionForType(name) - if err != nil { - return nil, err - } - return &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: spec.MustCreateRef(ref), - }, - }, nil - } -} - -func (o *openAPI) buildParameter(restParam common.Parameter, bodySample interface{}) (ret spec.Parameter, err error) { - ret = spec.Parameter{ - ParamProps: spec.ParamProps{ - Name: restParam.Name(), - Description: restParam.Description(), - Required: restParam.Required(), - }, - } - switch restParam.Kind() { - case common.BodyParameterKind: - if bodySample != nil { - ret.In = "body" - ret.Schema, err = o.toSchema(util.GetCanonicalTypeName(bodySample)) - return ret, err - } else { - // There is not enough information in the body parameter to build the definition. - // Body parameter has a data type that is a short name but we need full package name - // of the type to create a definition. - return ret, fmt.Errorf("restful body parameters are not supported: %v", restParam.DataType()) - } - case common.PathParameterKind: - ret.In = "path" - if !restParam.Required() { - return ret, fmt.Errorf("path parameters should be marked at required for parameter %v", restParam) - } - case common.QueryParameterKind: - ret.In = "query" - case common.HeaderParameterKind: - ret.In = "header" - case common.FormParameterKind: - ret.In = "formData" - default: - return ret, fmt.Errorf("unknown restful operation kind : %v", restParam.Kind()) - } - openAPIType, openAPIFormat := common.OpenAPITypeFormat(restParam.DataType()) - if openAPIType == "" { - return ret, fmt.Errorf("non-body Restful parameter type should be a simple type, but got : %v", restParam.DataType()) - } - ret.Type = openAPIType - ret.Format = openAPIFormat - ret.UniqueItems = !restParam.AllowMultiple() - return ret, nil -} - -func (o *openAPI) buildParameters(restParam []common.Parameter) (ret []spec.Parameter, err error) { - ret = make([]spec.Parameter, len(restParam)) - for i, v := range restParam { - ret[i], err = o.buildParameter(v, nil) - if err != nil { - return ret, err - } - } - return ret, nil -} diff --git a/e2e/vendor/k8s.io/kube-openapi/pkg/builder/parameters.go b/e2e/vendor/k8s.io/kube-openapi/pkg/builder/parameters.go deleted file mode 100644 index 2bb8bd885..000000000 --- a/e2e/vendor/k8s.io/kube-openapi/pkg/builder/parameters.go +++ /dev/null @@ -1,259 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package builder - -import ( - "encoding/base64" - "encoding/json" - "fmt" - "hash/fnv" - "sort" - "strconv" - "strings" - - "k8s.io/kube-openapi/pkg/validation/spec" -) - -// deduplicateParameters finds parameters that are shared across multiple endpoints and replace them with -// references to the shared parameters in order to avoid repetition. -// -// deduplicateParameters does not mutate the source. -func deduplicateParameters(sp *spec.Swagger) (*spec.Swagger, error) { - names, parameters, err := collectSharedParameters(sp) - if err != nil { - return nil, err - } - - if sp.Parameters != nil { - return nil, fmt.Errorf("shared parameters already exist") // should not happen with the builder, but to be sure - } - - clone := *sp - clone.Parameters = parameters - return replaceSharedParameters(names, &clone) -} - -// collectSharedParameters finds parameters that show up for many endpoints. These -// are basically all parameters with the exceptions of those where we know they are -// endpoint specific, e.g. because they reference the schema of the kind, or have -// the kind or resource name in the description. -func collectSharedParameters(sp *spec.Swagger) (namesByJSON map[string]string, ret map[string]spec.Parameter, err error) { - if sp == nil || sp.Paths == nil { - return nil, nil, nil - } - - countsByJSON := map[string]int{} - shared := map[string]spec.Parameter{} - var keys []string - - collect := func(p *spec.Parameter) error { - if (p.In == "query" || p.In == "path") && p.Name == "name" { - return nil // ignore name parameter as they are never shared with the Kind in the description - } - if p.In == "query" && p.Name == "fieldValidation" { - return nil // keep fieldValidation parameter unshared because kubectl uses it (until 1.27) to detect server-side field validation support - } - if p.In == "query" && p.Name == "dryRun" { - return nil // keep fieldValidation parameter unshared because kubectl uses it (until 1.26) to detect dry-run support - } - if p.Schema != nil && p.In == "body" && p.Name == "body" && !strings.HasPrefix(p.Schema.Ref.String(), "#/definitions/io.k8s.apimachinery") { - return nil // ignore non-generic body parameters as they reference the custom schema of the kind - } - - bs, err := json.Marshal(p) - if err != nil { - return err - } - - k := string(bs) - countsByJSON[k]++ - if count := countsByJSON[k]; count == 1 { - shared[k] = *p - keys = append(keys, k) - } - - return nil - } - - for _, path := range sp.Paths.Paths { - // per operation parameters - for _, op := range operations(&path) { - if op == nil { - continue // shouldn't happen, but ignore if it does; tested through unit test - } - for _, p := range op.Parameters { - if p.Ref.String() != "" { - // shouldn't happen, but ignore if it does - continue - } - if err := collect(&p); err != nil { - return nil, nil, err - } - } - } - - // per path parameters - for _, p := range path.Parameters { - if p.Ref.String() != "" { - continue // shouldn't happen, but ignore if it does - } - if err := collect(&p); err != nil { - return nil, nil, err - } - } - } - - // name deterministically - sort.Strings(keys) - ret = map[string]spec.Parameter{} - namesByJSON = map[string]string{} - for _, k := range keys { - name := shared[k].Name - if name == "" { - // this should never happen as the name is a required field. But if it does, let's be safe. - name = "param" - } - name += "-" + base64Hash(k) - i := 0 - for { - if _, ok := ret[name]; !ok { - ret[name] = shared[k] - namesByJSON[k] = name - break - } - i++ // only on hash conflict, unlikely with our few variants - name = shared[k].Name + "-" + strconv.Itoa(i) - } - } - - return namesByJSON, ret, nil -} - -func operations(path *spec.PathItem) []*spec.Operation { - return []*spec.Operation{path.Get, path.Put, path.Post, path.Delete, path.Options, path.Head, path.Patch} -} - -func base64Hash(s string) string { - hash := fnv.New64() - hash.Write([]byte(s)) //nolint:errcheck - return base64.URLEncoding.EncodeToString(hash.Sum(make([]byte, 0, 8))[:6]) // 8 characters -} - -func replaceSharedParameters(sharedParameterNamesByJSON map[string]string, sp *spec.Swagger) (*spec.Swagger, error) { - if sp == nil || sp.Paths == nil { - return sp, nil - } - - ret := sp - - firstPathChange := true - for k, path := range sp.Paths.Paths { - pathChanged := false - - // per operation parameters - for _, op := range []**spec.Operation{&path.Get, &path.Put, &path.Post, &path.Delete, &path.Options, &path.Head, &path.Patch} { - if *op == nil { - continue - } - - firstParamChange := true - for i := range (*op).Parameters { - p := (*op).Parameters[i] - - if p.Ref.String() != "" { - // shouldn't happen, but be idem-potent if it does - continue - } - - bs, err := json.Marshal(p) - if err != nil { - return nil, err - } - - if name, ok := sharedParameterNamesByJSON[string(bs)]; ok { - if firstParamChange { - orig := *op - *op = &spec.Operation{} - **op = *orig - (*op).Parameters = make([]spec.Parameter, len(orig.Parameters)) - copy((*op).Parameters, orig.Parameters) - firstParamChange = false - } - - (*op).Parameters[i] = spec.Parameter{ - Refable: spec.Refable{ - Ref: spec.MustCreateRef("#/parameters/" + name), - }, - } - pathChanged = true - } - } - } - - // per path parameters - firstParamChange := true - for i := range path.Parameters { - p := path.Parameters[i] - - if p.Ref.String() != "" { - // shouldn't happen, but be idem-potent if it does - continue - } - - bs, err := json.Marshal(p) - if err != nil { - return nil, err - } - - if name, ok := sharedParameterNamesByJSON[string(bs)]; ok { - if firstParamChange { - orig := path.Parameters - path.Parameters = make([]spec.Parameter, len(orig)) - copy(path.Parameters, orig) - firstParamChange = false - } - - path.Parameters[i] = spec.Parameter{ - Refable: spec.Refable{ - Ref: spec.MustCreateRef("#/parameters/" + name), - }, - } - pathChanged = true - } - } - - if pathChanged { - if firstPathChange { - clone := *sp - ret = &clone - - pathsClone := *ret.Paths - ret.Paths = &pathsClone - - ret.Paths.Paths = make(map[string]spec.PathItem, len(sp.Paths.Paths)) - for k, v := range sp.Paths.Paths { - ret.Paths.Paths[k] = v - } - - firstPathChange = false - } - ret.Paths.Paths[k] = path - } - } - - return ret, nil -} diff --git a/e2e/vendor/k8s.io/kube-openapi/pkg/builder/util.go b/e2e/vendor/k8s.io/kube-openapi/pkg/builder/util.go deleted file mode 100644 index 3621a4de1..000000000 --- a/e2e/vendor/k8s.io/kube-openapi/pkg/builder/util.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package builder - -import ( - "sort" - - "k8s.io/kube-openapi/pkg/common" - "k8s.io/kube-openapi/pkg/validation/spec" -) - -type parameters []spec.Parameter - -func (s parameters) Len() int { return len(s) } -func (s parameters) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// byNameIn used in sorting parameters by Name and In fields. -type byNameIn struct { - parameters -} - -func (s byNameIn) Less(i, j int) bool { - return s.parameters[i].Name < s.parameters[j].Name || (s.parameters[i].Name == s.parameters[j].Name && s.parameters[i].In < s.parameters[j].In) -} - -// SortParameters sorts parameters by Name and In fields. -func sortParameters(p []spec.Parameter) { - sort.Sort(byNameIn{p}) -} - -func groupRoutesByPath(routes []common.Route) map[string][]common.Route { - pathToRoutes := make(map[string][]common.Route) - for _, r := range routes { - pathToRoutes[r.Path()] = append(pathToRoutes[r.Path()], r) - } - return pathToRoutes -} - -func mapKeyFromParam(param common.Parameter) interface{} { - return struct { - Name string - Kind common.ParameterKind - }{ - Name: param.Name(), - Kind: param.Kind(), - } -} diff --git a/e2e/vendor/k8s.io/kube-openapi/pkg/builder3/openapi.go b/e2e/vendor/k8s.io/kube-openapi/pkg/builder3/openapi.go deleted file mode 100644 index 0ce85af9f..000000000 --- a/e2e/vendor/k8s.io/kube-openapi/pkg/builder3/openapi.go +++ /dev/null @@ -1,498 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package builder3 - -import ( - "encoding/json" - "fmt" - "net/http" - "strings" - - restful "github.com/emicklei/go-restful/v3" - - builderutil "k8s.io/kube-openapi/pkg/builder3/util" - "k8s.io/kube-openapi/pkg/common" - "k8s.io/kube-openapi/pkg/common/restfuladapter" - "k8s.io/kube-openapi/pkg/spec3" - "k8s.io/kube-openapi/pkg/util" - "k8s.io/kube-openapi/pkg/validation/spec" -) - -const ( - OpenAPIVersion = "3.0" -) - -type openAPI struct { - config *common.OpenAPIV3Config - spec *spec3.OpenAPI - definitions map[string]common.OpenAPIDefinition -} - -func groupRoutesByPath(routes []common.Route) map[string][]common.Route { - pathToRoutes := make(map[string][]common.Route) - for _, r := range routes { - pathToRoutes[r.Path()] = append(pathToRoutes[r.Path()], r) - } - return pathToRoutes -} - -func (o *openAPI) buildResponse(model interface{}, description string, content []string) (*spec3.Response, error) { - response := &spec3.Response{ - ResponseProps: spec3.ResponseProps{ - Description: description, - Content: make(map[string]*spec3.MediaType), - }, - } - - s, err := o.toSchema(util.GetCanonicalTypeName(model)) - if err != nil { - return nil, err - } - - for _, contentType := range content { - response.ResponseProps.Content[contentType] = &spec3.MediaType{ - MediaTypeProps: spec3.MediaTypeProps{ - Schema: s, - }, - } - } - return response, nil -} - -func (o *openAPI) buildOperations(route common.Route, inPathCommonParamsMap map[interface{}]*spec3.Parameter) (*spec3.Operation, error) { - ret := &spec3.Operation{ - OperationProps: spec3.OperationProps{ - Description: route.Description(), - Responses: &spec3.Responses{ - ResponsesProps: spec3.ResponsesProps{ - StatusCodeResponses: make(map[int]*spec3.Response), - }, - }, - }, - } - for k, v := range route.Metadata() { - if strings.HasPrefix(k, common.ExtensionPrefix) { - if ret.Extensions == nil { - ret.Extensions = spec.Extensions{} - } - ret.Extensions.Add(k, v) - } - } - - var err error - if ret.OperationId, ret.Tags, err = o.config.GetOperationIDAndTagsFromRoute(route); err != nil { - return ret, err - } - - // Build responses - for _, resp := range route.StatusCodeResponses() { - ret.Responses.StatusCodeResponses[resp.Code()], err = o.buildResponse(resp.Model(), resp.Message(), route.Produces()) - if err != nil { - return ret, err - } - } - - // If there is no response but a write sample, assume that write sample is an http.StatusOK response. - if len(ret.Responses.StatusCodeResponses) == 0 && route.ResponsePayloadSample() != nil { - ret.Responses.StatusCodeResponses[http.StatusOK], err = o.buildResponse(route.ResponsePayloadSample(), "OK", route.Produces()) - if err != nil { - return ret, err - } - } - - for code, resp := range o.config.CommonResponses { - if _, exists := ret.Responses.StatusCodeResponses[code]; !exists { - ret.Responses.StatusCodeResponses[code] = resp - } - } - - if len(ret.Responses.StatusCodeResponses) == 0 { - ret.Responses.Default = o.config.DefaultResponse - } - - params := route.Parameters() - for _, param := range params { - _, isCommon := inPathCommonParamsMap[mapKeyFromParam(param)] - if !isCommon && param.Kind() != common.BodyParameterKind { - openAPIParam, err := o.buildParameter(param) - if err != nil { - return ret, err - } - ret.Parameters = append(ret.Parameters, openAPIParam) - } - } - - body, err := o.buildRequestBody(params, route.Consumes(), route.RequestPayloadSample()) - if err != nil { - return nil, err - } - - if body != nil { - ret.RequestBody = body - } - return ret, nil -} - -func (o *openAPI) buildRequestBody(parameters []common.Parameter, consumes []string, bodySample interface{}) (*spec3.RequestBody, error) { - for _, param := range parameters { - if param.Kind() == common.BodyParameterKind && bodySample != nil { - schema, err := o.toSchema(util.GetCanonicalTypeName(bodySample)) - if err != nil { - return nil, err - } - r := &spec3.RequestBody{ - RequestBodyProps: spec3.RequestBodyProps{ - Content: map[string]*spec3.MediaType{}, - Description: param.Description(), - Required: param.Required(), - }, - } - for _, consume := range consumes { - r.Content[consume] = &spec3.MediaType{ - MediaTypeProps: spec3.MediaTypeProps{ - Schema: schema, - }, - } - } - return r, nil - } - } - return nil, nil -} - -func newOpenAPI(config *common.OpenAPIV3Config) openAPI { - o := openAPI{ - config: config, - spec: &spec3.OpenAPI{ - Version: "3.0.0", - Info: config.Info, - Paths: &spec3.Paths{ - Paths: map[string]*spec3.Path{}, - }, - Components: &spec3.Components{ - Schemas: map[string]*spec.Schema{}, - }, - }, - } - if len(o.config.ResponseDefinitions) > 0 { - o.spec.Components.Responses = make(map[string]*spec3.Response) - - } - for k, response := range o.config.ResponseDefinitions { - o.spec.Components.Responses[k] = response - } - - if len(o.config.SecuritySchemes) > 0 { - o.spec.Components.SecuritySchemes = make(spec3.SecuritySchemes) - - } - for k, securityScheme := range o.config.SecuritySchemes { - o.spec.Components.SecuritySchemes[k] = securityScheme - } - - if o.config.GetOperationIDAndTagsFromRoute == nil { - // Map the deprecated handler to the common interface, if provided. - if o.config.GetOperationIDAndTags != nil { - o.config.GetOperationIDAndTagsFromRoute = func(r common.Route) (string, []string, error) { - restfulRouteAdapter, ok := r.(*restfuladapter.RouteAdapter) - if !ok { - return "", nil, fmt.Errorf("config.GetOperationIDAndTags specified but route is not a restful v1 Route") - } - - return o.config.GetOperationIDAndTags(restfulRouteAdapter.Route) - } - } else { - o.config.GetOperationIDAndTagsFromRoute = func(r common.Route) (string, []string, error) { - return r.OperationName(), nil, nil - } - } - } - - if o.config.GetDefinitionName == nil { - o.config.GetDefinitionName = func(name string) (string, spec.Extensions) { - return name[strings.LastIndex(name, "/")+1:], nil - } - } - - if o.config.Definitions != nil { - o.definitions = o.config.Definitions - } else { - o.definitions = o.config.GetDefinitions(func(name string) spec.Ref { - defName, _ := o.config.GetDefinitionName(name) - return spec.MustCreateRef("#/components/schemas/" + common.EscapeJsonPointer(defName)) - }) - } - - return o -} - -func (o *openAPI) buildOpenAPISpec(webServices []common.RouteContainer) error { - pathsToIgnore := util.NewTrie(o.config.IgnorePrefixes) - for _, w := range webServices { - rootPath := w.RootPath() - if pathsToIgnore.HasPrefix(rootPath) { - continue - } - - commonParams, err := o.buildParameters(w.PathParameters()) - if err != nil { - return err - } - - for path, routes := range groupRoutesByPath(w.Routes()) { - // go-swagger has special variable definition {$NAME:*} that can only be - // used at the end of the path and it is not recognized by OpenAPI. - if strings.HasSuffix(path, ":*}") { - path = path[:len(path)-3] + "}" - } - if pathsToIgnore.HasPrefix(path) { - continue - } - - // Aggregating common parameters make API spec (and generated clients) simpler - inPathCommonParamsMap, err := o.findCommonParameters(routes) - if err != nil { - return err - } - pathItem, exists := o.spec.Paths.Paths[path] - if exists { - return fmt.Errorf("duplicate webservice route has been found for path: %v", path) - } - - pathItem = &spec3.Path{ - PathProps: spec3.PathProps{}, - } - - // add web services's parameters as well as any parameters appears in all ops, as common parameters - pathItem.Parameters = append(pathItem.Parameters, commonParams...) - for _, p := range inPathCommonParamsMap { - pathItem.Parameters = append(pathItem.Parameters, p) - } - sortParameters(pathItem.Parameters) - - for _, route := range routes { - op, err := o.buildOperations(route, inPathCommonParamsMap) - if err != nil { - return err - } - sortParameters(op.Parameters) - - switch strings.ToUpper(route.Method()) { - case "GET": - pathItem.Get = op - case "POST": - pathItem.Post = op - case "HEAD": - pathItem.Head = op - case "PUT": - pathItem.Put = op - case "DELETE": - pathItem.Delete = op - case "OPTIONS": - pathItem.Options = op - case "PATCH": - pathItem.Patch = op - } - - } - o.spec.Paths.Paths[path] = pathItem - } - } - return nil -} - -// BuildOpenAPISpec builds OpenAPI v3 spec given a list of route containers and common.Config to customize it. -// -// Deprecated: BuildOpenAPISpecFromRoutes should be used instead. -func BuildOpenAPISpec(webServices []*restful.WebService, config *common.OpenAPIV3Config) (*spec3.OpenAPI, error) { - return BuildOpenAPISpecFromRoutes(restfuladapter.AdaptWebServices(webServices), config) -} - -// BuildOpenAPISpecFromRoutes builds OpenAPI v3 spec given a list of route containers and common.Config to customize it. -func BuildOpenAPISpecFromRoutes(webServices []common.RouteContainer, config *common.OpenAPIV3Config) (*spec3.OpenAPI, error) { - a := newOpenAPI(config) - err := a.buildOpenAPISpec(webServices) - if err != nil { - return nil, err - } - if config.PostProcessSpec != nil { - return config.PostProcessSpec(a.spec) - } - return a.spec, nil -} - -// BuildOpenAPIDefinitionsForResource builds a partial OpenAPI spec given a sample object and common.Config to customize it. -// BuildOpenAPIDefinitionsForResources returns the OpenAPI spec which includes the definitions for the -// passed type names. -func BuildOpenAPIDefinitionsForResources(config *common.OpenAPIV3Config, names ...string) (map[string]*spec.Schema, error) { - o := newOpenAPI(config) - // We can discard the return value of toSchema because all we care about is the side effect of calling it. - // All the models created for this resource get added to o.swagger.Definitions - for _, name := range names { - _, err := o.toSchema(name) - if err != nil { - return nil, err - } - } - return o.spec.Components.Schemas, nil -} -func (o *openAPI) findCommonParameters(routes []common.Route) (map[interface{}]*spec3.Parameter, error) { - commonParamsMap := make(map[interface{}]*spec3.Parameter, 0) - paramOpsCountByName := make(map[interface{}]int, 0) - paramNameKindToDataMap := make(map[interface{}]common.Parameter, 0) - for _, route := range routes { - routeParamDuplicateMap := make(map[interface{}]bool) - s := "" - params := route.Parameters() - for _, param := range params { - m, _ := json.Marshal(param) - s += string(m) + "\n" - key := mapKeyFromParam(param) - if routeParamDuplicateMap[key] { - msg, _ := json.Marshal(params) - return commonParamsMap, fmt.Errorf("duplicate parameter %v for route %v, %v", param.Name(), string(msg), s) - } - routeParamDuplicateMap[key] = true - paramOpsCountByName[key]++ - paramNameKindToDataMap[key] = param - } - } - for key, count := range paramOpsCountByName { - paramData := paramNameKindToDataMap[key] - if count == len(routes) && paramData.Kind() != common.BodyParameterKind { - openAPIParam, err := o.buildParameter(paramData) - if err != nil { - return commonParamsMap, err - } - commonParamsMap[key] = openAPIParam - } - } - return commonParamsMap, nil -} - -func (o *openAPI) buildParameters(restParam []common.Parameter) (ret []*spec3.Parameter, err error) { - ret = make([]*spec3.Parameter, len(restParam)) - for i, v := range restParam { - ret[i], err = o.buildParameter(v) - if err != nil { - return ret, err - } - } - return ret, nil -} - -func (o *openAPI) buildParameter(restParam common.Parameter) (ret *spec3.Parameter, err error) { - ret = &spec3.Parameter{ - ParameterProps: spec3.ParameterProps{ - Name: restParam.Name(), - Description: restParam.Description(), - Required: restParam.Required(), - }, - } - switch restParam.Kind() { - case common.BodyParameterKind: - return nil, nil - case common.PathParameterKind: - ret.In = "path" - if !restParam.Required() { - return ret, fmt.Errorf("path parameters should be marked as required for parameter %v", restParam) - } - case common.QueryParameterKind: - ret.In = "query" - case common.HeaderParameterKind: - ret.In = "header" - /* TODO: add support for the cookie param */ - default: - return ret, fmt.Errorf("unsupported restful parameter kind : %v", restParam.Kind()) - } - openAPIType, openAPIFormat := common.OpenAPITypeFormat(restParam.DataType()) - if openAPIType == "" { - return ret, fmt.Errorf("non-body Restful parameter type should be a simple type, but got : %v", restParam.DataType()) - } - - ret.Schema = &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{openAPIType}, - Format: openAPIFormat, - UniqueItems: !restParam.AllowMultiple(), - }, - } - return ret, nil -} - -func (o *openAPI) buildDefinitionRecursively(name string) error { - uniqueName, extensions := o.config.GetDefinitionName(name) - if _, ok := o.spec.Components.Schemas[uniqueName]; ok { - return nil - } - if item, ok := o.definitions[name]; ok { - schema := &spec.Schema{ - VendorExtensible: item.Schema.VendorExtensible, - SchemaProps: item.Schema.SchemaProps, - SwaggerSchemaProps: item.Schema.SwaggerSchemaProps, - } - if extensions != nil { - if schema.Extensions == nil { - schema.Extensions = spec.Extensions{} - } - for k, v := range extensions { - schema.Extensions[k] = v - } - } - // delete the embedded v2 schema if exists, otherwise no-op - delete(schema.VendorExtensible.Extensions, common.ExtensionV2Schema) - schema = builderutil.WrapRefs(schema) - o.spec.Components.Schemas[uniqueName] = schema - for _, v := range item.Dependencies { - if err := o.buildDefinitionRecursively(v); err != nil { - return err - } - } - } else { - return fmt.Errorf("cannot find model definition for %v. If you added a new type, you may need to add +k8s:openapi-gen=true to the package or type and run code-gen again", name) - } - return nil -} - -func (o *openAPI) buildDefinitionForType(name string) (string, error) { - if err := o.buildDefinitionRecursively(name); err != nil { - return "", err - } - defName, _ := o.config.GetDefinitionName(name) - return "#/components/schemas/" + common.EscapeJsonPointer(defName), nil -} - -func (o *openAPI) toSchema(name string) (_ *spec.Schema, err error) { - if openAPIType, openAPIFormat := common.OpenAPITypeFormat(name); openAPIType != "" { - return &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{openAPIType}, - Format: openAPIFormat, - }, - }, nil - } else { - ref, err := o.buildDefinitionForType(name) - if err != nil { - return nil, err - } - return &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: spec.MustCreateRef(ref), - }, - }, nil - } -} diff --git a/e2e/vendor/k8s.io/kube-openapi/pkg/builder3/util.go b/e2e/vendor/k8s.io/kube-openapi/pkg/builder3/util.go deleted file mode 100644 index a8a90fa15..000000000 --- a/e2e/vendor/k8s.io/kube-openapi/pkg/builder3/util.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package builder3 - -import ( - "sort" - - "k8s.io/kube-openapi/pkg/common" - "k8s.io/kube-openapi/pkg/spec3" -) - -func mapKeyFromParam(param common.Parameter) interface{} { - return struct { - Name string - Kind common.ParameterKind - }{ - Name: param.Name(), - Kind: param.Kind(), - } -} - -func (s parameters) Len() int { return len(s) } -func (s parameters) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -type parameters []*spec3.Parameter - -type byNameIn struct { - parameters -} - -func (s byNameIn) Less(i, j int) bool { - return s.parameters[i].Name < s.parameters[j].Name || (s.parameters[i].Name == s.parameters[j].Name && s.parameters[i].In < s.parameters[j].In) -} - -// SortParameters sorts parameters by Name and In fields. -func sortParameters(p []*spec3.Parameter) { - sort.Sort(byNameIn{p}) -} diff --git a/e2e/vendor/k8s.io/kube-openapi/pkg/builder3/util/util.go b/e2e/vendor/k8s.io/kube-openapi/pkg/builder3/util/util.go deleted file mode 100644 index e01566925..000000000 --- a/e2e/vendor/k8s.io/kube-openapi/pkg/builder3/util/util.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package util - -import ( - "reflect" - - "k8s.io/kube-openapi/pkg/schemamutation" - "k8s.io/kube-openapi/pkg/validation/spec" -) - -// wrapRefs wraps OpenAPI V3 Schema refs that contain sibling elements. -// AllOf is used to wrap the Ref to prevent references from having sibling elements -// Please see https://github.com/kubernetes/kubernetes/issues/106387#issuecomment-967640388 -func WrapRefs(schema *spec.Schema) *spec.Schema { - walker := schemamutation.Walker{ - SchemaCallback: func(schema *spec.Schema) *spec.Schema { - orig := schema - clone := func() { - if orig == schema { - schema = new(spec.Schema) - *schema = *orig - } - } - if schema.Ref.String() != "" && !reflect.DeepEqual(*schema, spec.Schema{SchemaProps: spec.SchemaProps{Ref: schema.Ref}}) { - clone() - refSchema := new(spec.Schema) - refSchema.Ref = schema.Ref - schema.Ref = spec.Ref{} - schema.AllOf = []spec.Schema{*refSchema} - } - return schema - }, - RefCallback: schemamutation.RefCallbackNoop, - } - return walker.WalkSchema(schema) -} diff --git a/e2e/vendor/k8s.io/kube-openapi/pkg/common/restfuladapter/adapter.go b/e2e/vendor/k8s.io/kube-openapi/pkg/common/restfuladapter/adapter.go deleted file mode 100644 index 932b84a01..000000000 --- a/e2e/vendor/k8s.io/kube-openapi/pkg/common/restfuladapter/adapter.go +++ /dev/null @@ -1,15 +0,0 @@ -package restfuladapter - -import ( - "github.com/emicklei/go-restful/v3" - "k8s.io/kube-openapi/pkg/common" -) - -// AdaptWebServices adapts a slice of restful.WebService into the common interfaces. -func AdaptWebServices(webServices []*restful.WebService) []common.RouteContainer { - var containers []common.RouteContainer - for _, ws := range webServices { - containers = append(containers, &WebServiceAdapter{ws}) - } - return containers -} diff --git a/e2e/vendor/k8s.io/kube-openapi/pkg/common/restfuladapter/param_adapter.go b/e2e/vendor/k8s.io/kube-openapi/pkg/common/restfuladapter/param_adapter.go deleted file mode 100644 index 6805dd6c7..000000000 --- a/e2e/vendor/k8s.io/kube-openapi/pkg/common/restfuladapter/param_adapter.go +++ /dev/null @@ -1,54 +0,0 @@ -package restfuladapter - -import ( - "encoding/json" - "github.com/emicklei/go-restful/v3" - "k8s.io/kube-openapi/pkg/common" -) - -var _ common.Parameter = &ParamAdapter{} - -type ParamAdapter struct { - Param *restful.Parameter -} - -func (r *ParamAdapter) MarshalJSON() ([]byte, error) { - return json.Marshal(r.Param) -} - -func (r *ParamAdapter) Name() string { - return r.Param.Data().Name -} - -func (r *ParamAdapter) Description() string { - return r.Param.Data().Description -} - -func (r *ParamAdapter) Required() bool { - return r.Param.Data().Required -} - -func (r *ParamAdapter) Kind() common.ParameterKind { - switch r.Param.Kind() { - case restful.PathParameterKind: - return common.PathParameterKind - case restful.QueryParameterKind: - return common.QueryParameterKind - case restful.BodyParameterKind: - return common.BodyParameterKind - case restful.HeaderParameterKind: - return common.HeaderParameterKind - case restful.FormParameterKind: - return common.FormParameterKind - default: - return common.UnknownParameterKind - } -} - -func (r *ParamAdapter) DataType() string { - return r.Param.Data().DataType -} - -func (r *ParamAdapter) AllowMultiple() bool { - return r.Param.Data().AllowMultiple -} diff --git a/e2e/vendor/k8s.io/kube-openapi/pkg/common/restfuladapter/response_error_adapter.go b/e2e/vendor/k8s.io/kube-openapi/pkg/common/restfuladapter/response_error_adapter.go deleted file mode 100644 index 92556398e..000000000 --- a/e2e/vendor/k8s.io/kube-openapi/pkg/common/restfuladapter/response_error_adapter.go +++ /dev/null @@ -1,25 +0,0 @@ -package restfuladapter - -import ( - "github.com/emicklei/go-restful/v3" - "k8s.io/kube-openapi/pkg/common" -) - -var _ common.StatusCodeResponse = &ResponseErrorAdapter{} - -// ResponseErrorAdapter adapts a restful.ResponseError to common.StatusCodeResponse. -type ResponseErrorAdapter struct { - Err *restful.ResponseError -} - -func (r *ResponseErrorAdapter) Message() string { - return r.Err.Message -} - -func (r *ResponseErrorAdapter) Model() interface{} { - return r.Err.Model -} - -func (r *ResponseErrorAdapter) Code() int { - return r.Err.Code -} diff --git a/e2e/vendor/k8s.io/kube-openapi/pkg/common/restfuladapter/route_adapter.go b/e2e/vendor/k8s.io/kube-openapi/pkg/common/restfuladapter/route_adapter.go deleted file mode 100644 index c7ba3a564..000000000 --- a/e2e/vendor/k8s.io/kube-openapi/pkg/common/restfuladapter/route_adapter.go +++ /dev/null @@ -1,68 +0,0 @@ -package restfuladapter - -import ( - "github.com/emicklei/go-restful/v3" - "k8s.io/kube-openapi/pkg/common" -) - -var _ common.Route = &RouteAdapter{} - -// RouteAdapter adapts a restful.Route to common.Route. -type RouteAdapter struct { - Route *restful.Route -} - -func (r *RouteAdapter) StatusCodeResponses() []common.StatusCodeResponse { - // go-restful uses the ResponseErrors field to contain both error and regular responses. - var responses []common.StatusCodeResponse - for _, res := range r.Route.ResponseErrors { - localRes := res - responses = append(responses, &ResponseErrorAdapter{&localRes}) - } - - return responses -} - -func (r *RouteAdapter) OperationName() string { - return r.Route.Operation -} - -func (r *RouteAdapter) Method() string { - return r.Route.Method -} - -func (r *RouteAdapter) Path() string { - return r.Route.Path -} - -func (r *RouteAdapter) Parameters() []common.Parameter { - var params []common.Parameter - for _, rParam := range r.Route.ParameterDocs { - params = append(params, &ParamAdapter{rParam}) - } - return params -} - -func (r *RouteAdapter) Description() string { - return r.Route.Doc -} - -func (r *RouteAdapter) Consumes() []string { - return r.Route.Consumes -} - -func (r *RouteAdapter) Produces() []string { - return r.Route.Produces -} - -func (r *RouteAdapter) Metadata() map[string]interface{} { - return r.Route.Metadata -} - -func (r *RouteAdapter) RequestPayloadSample() interface{} { - return r.Route.ReadSample -} - -func (r *RouteAdapter) ResponsePayloadSample() interface{} { - return r.Route.WriteSample -} diff --git a/e2e/vendor/k8s.io/kube-openapi/pkg/common/restfuladapter/webservice_adapter.go b/e2e/vendor/k8s.io/kube-openapi/pkg/common/restfuladapter/webservice_adapter.go deleted file mode 100644 index 995586538..000000000 --- a/e2e/vendor/k8s.io/kube-openapi/pkg/common/restfuladapter/webservice_adapter.go +++ /dev/null @@ -1,34 +0,0 @@ -package restfuladapter - -import ( - "github.com/emicklei/go-restful/v3" - "k8s.io/kube-openapi/pkg/common" -) - -var _ common.RouteContainer = &WebServiceAdapter{} - -// WebServiceAdapter adapts a restful.WebService to common.RouteContainer. -type WebServiceAdapter struct { - WebService *restful.WebService -} - -func (r *WebServiceAdapter) RootPath() string { - return r.WebService.RootPath() -} - -func (r *WebServiceAdapter) PathParameters() []common.Parameter { - var params []common.Parameter - for _, rParam := range r.WebService.PathParameters() { - params = append(params, &ParamAdapter{rParam}) - } - return params -} - -func (r *WebServiceAdapter) Routes() []common.Route { - var routes []common.Route - for _, rRoute := range r.WebService.Routes() { - localRoute := rRoute - routes = append(routes, &RouteAdapter{&localRoute}) - } - return routes -} diff --git a/e2e/vendor/k8s.io/kube-openapi/pkg/handler/default_pruning.go b/e2e/vendor/k8s.io/kube-openapi/pkg/handler/default_pruning.go deleted file mode 100644 index 53bd9a640..000000000 --- a/e2e/vendor/k8s.io/kube-openapi/pkg/handler/default_pruning.go +++ /dev/null @@ -1,208 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package handler - -import "k8s.io/kube-openapi/pkg/validation/spec" - -// PruneDefaults remove all the defaults recursively from all the -// schemas in the definitions, and does not modify the definitions in -// place. -func PruneDefaults(definitions spec.Definitions) spec.Definitions { - definitionsCloned := false - for k, v := range definitions { - if s := PruneDefaultsSchema(&v); s != &v { - if !definitionsCloned { - definitionsCloned = true - orig := definitions - definitions = make(spec.Definitions, len(orig)) - for k2, v2 := range orig { - definitions[k2] = v2 - } - } - definitions[k] = *s - } - } - return definitions -} - -// PruneDefaultsSchema remove all the defaults recursively from the -// schema in place. -func PruneDefaultsSchema(schema *spec.Schema) *spec.Schema { - if schema == nil { - return nil - } - - orig := schema - clone := func() { - if orig == schema { - schema = &spec.Schema{} - *schema = *orig - } - } - - if schema.Default != nil { - clone() - schema.Default = nil - } - - definitionsCloned := false - for k, v := range schema.Definitions { - if s := PruneDefaultsSchema(&v); s != &v { - if !definitionsCloned { - definitionsCloned = true - clone() - schema.Definitions = make(spec.Definitions, len(orig.Definitions)) - for k2, v2 := range orig.Definitions { - schema.Definitions[k2] = v2 - } - } - schema.Definitions[k] = *s - } - } - - propertiesCloned := false - for k, v := range schema.Properties { - if s := PruneDefaultsSchema(&v); s != &v { - if !propertiesCloned { - propertiesCloned = true - clone() - schema.Properties = make(map[string]spec.Schema, len(orig.Properties)) - for k2, v2 := range orig.Properties { - schema.Properties[k2] = v2 - } - } - schema.Properties[k] = *s - } - } - - patternPropertiesCloned := false - for k, v := range schema.PatternProperties { - if s := PruneDefaultsSchema(&v); s != &v { - if !patternPropertiesCloned { - patternPropertiesCloned = true - clone() - schema.PatternProperties = make(map[string]spec.Schema, len(orig.PatternProperties)) - for k2, v2 := range orig.PatternProperties { - schema.PatternProperties[k2] = v2 - } - } - schema.PatternProperties[k] = *s - } - } - - dependenciesCloned := false - for k, v := range schema.Dependencies { - if s := PruneDefaultsSchema(v.Schema); s != v.Schema { - if !dependenciesCloned { - dependenciesCloned = true - clone() - schema.Dependencies = make(spec.Dependencies, len(orig.Dependencies)) - for k2, v2 := range orig.Dependencies { - schema.Dependencies[k2] = v2 - } - } - v.Schema = s - schema.Dependencies[k] = v - } - } - - allOfCloned := false - for i := range schema.AllOf { - if s := PruneDefaultsSchema(&schema.AllOf[i]); s != &schema.AllOf[i] { - if !allOfCloned { - allOfCloned = true - clone() - schema.AllOf = make([]spec.Schema, len(orig.AllOf)) - copy(schema.AllOf, orig.AllOf) - } - schema.AllOf[i] = *s - } - } - - anyOfCloned := false - for i := range schema.AnyOf { - if s := PruneDefaultsSchema(&schema.AnyOf[i]); s != &schema.AnyOf[i] { - if !anyOfCloned { - anyOfCloned = true - clone() - schema.AnyOf = make([]spec.Schema, len(orig.AnyOf)) - copy(schema.AnyOf, orig.AnyOf) - } - schema.AnyOf[i] = *s - } - } - - oneOfCloned := false - for i := range schema.OneOf { - if s := PruneDefaultsSchema(&schema.OneOf[i]); s != &schema.OneOf[i] { - if !oneOfCloned { - oneOfCloned = true - clone() - schema.OneOf = make([]spec.Schema, len(orig.OneOf)) - copy(schema.OneOf, orig.OneOf) - } - schema.OneOf[i] = *s - } - } - - if schema.Not != nil { - if s := PruneDefaultsSchema(schema.Not); s != schema.Not { - clone() - schema.Not = s - } - } - - if schema.AdditionalProperties != nil && schema.AdditionalProperties.Schema != nil { - if s := PruneDefaultsSchema(schema.AdditionalProperties.Schema); s != schema.AdditionalProperties.Schema { - clone() - schema.AdditionalProperties = &spec.SchemaOrBool{Schema: s, Allows: schema.AdditionalProperties.Allows} - } - } - - if schema.AdditionalItems != nil && schema.AdditionalItems.Schema != nil { - if s := PruneDefaultsSchema(schema.AdditionalItems.Schema); s != schema.AdditionalItems.Schema { - clone() - schema.AdditionalItems = &spec.SchemaOrBool{Schema: s, Allows: schema.AdditionalItems.Allows} - } - } - - if schema.Items != nil { - if schema.Items.Schema != nil { - if s := PruneDefaultsSchema(schema.Items.Schema); s != schema.Items.Schema { - clone() - schema.Items = &spec.SchemaOrArray{Schema: s} - } - } else { - itemsCloned := false - for i := range schema.Items.Schemas { - if s := PruneDefaultsSchema(&schema.Items.Schemas[i]); s != &schema.Items.Schemas[i] { - if !itemsCloned { - clone() - schema.Items = &spec.SchemaOrArray{ - Schemas: make([]spec.Schema, len(orig.Items.Schemas)), - } - itemsCloned = true - copy(schema.Items.Schemas, orig.Items.Schemas) - } - schema.Items.Schemas[i] = *s - } - } - } - } - - return schema -} diff --git a/e2e/vendor/k8s.io/kube-openapi/pkg/handler/handler.go b/e2e/vendor/k8s.io/kube-openapi/pkg/handler/handler.go deleted file mode 100644 index 5102e7125..000000000 --- a/e2e/vendor/k8s.io/kube-openapi/pkg/handler/handler.go +++ /dev/null @@ -1,202 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package handler - -import ( - "bytes" - "crypto/sha512" - "fmt" - "net/http" - "strconv" - "time" - - "github.com/NYTimes/gziphandler" - "github.com/emicklei/go-restful/v3" - openapi_v2 "github.com/google/gnostic-models/openapiv2" - "github.com/google/uuid" - "github.com/munnerz/goautoneg" - "google.golang.org/protobuf/proto" - - klog "k8s.io/klog/v2" - "k8s.io/kube-openapi/pkg/builder" - "k8s.io/kube-openapi/pkg/cached" - "k8s.io/kube-openapi/pkg/common" - "k8s.io/kube-openapi/pkg/common/restfuladapter" - "k8s.io/kube-openapi/pkg/validation/spec" -) - -const ( - subTypeProtobufDeprecated = "com.github.proto-openapi.spec.v2@v1.0+protobuf" - subTypeProtobuf = "com.github.proto-openapi.spec.v2.v1.0+protobuf" - subTypeJSON = "json" -) - -func computeETag(data []byte) string { - if data == nil { - return "" - } - return fmt.Sprintf("%X", sha512.Sum512(data)) -} - -type timedSpec struct { - spec []byte - lastModified time.Time -} - -// OpenAPIService is the service responsible for serving OpenAPI spec. It has -// the ability to safely change the spec while serving it. -type OpenAPIService struct { - specCache cached.LastSuccess[*spec.Swagger] - jsonCache cached.Value[timedSpec] - protoCache cached.Value[timedSpec] -} - -// NewOpenAPIService builds an OpenAPIService starting with the given spec. -func NewOpenAPIService(swagger *spec.Swagger) *OpenAPIService { - return NewOpenAPIServiceLazy(cached.Static(swagger, uuid.New().String())) -} - -// NewOpenAPIServiceLazy builds an OpenAPIService from lazy spec. -func NewOpenAPIServiceLazy(swagger cached.Value[*spec.Swagger]) *OpenAPIService { - o := &OpenAPIService{} - o.UpdateSpecLazy(swagger) - - o.jsonCache = cached.Transform[*spec.Swagger](func(spec *spec.Swagger, etag string, err error) (timedSpec, string, error) { - if err != nil { - return timedSpec{}, "", err - } - json, err := spec.MarshalJSON() - if err != nil { - return timedSpec{}, "", err - } - return timedSpec{spec: json, lastModified: time.Now()}, computeETag(json), nil - }, &o.specCache) - o.protoCache = cached.Transform(func(ts timedSpec, etag string, err error) (timedSpec, string, error) { - if err != nil { - return timedSpec{}, "", err - } - proto, err := ToProtoBinary(ts.spec) - if err != nil { - return timedSpec{}, "", err - } - // We can re-use the same etag as json because of the Vary header. - return timedSpec{spec: proto, lastModified: ts.lastModified}, etag, nil - }, o.jsonCache) - return o -} - -func (o *OpenAPIService) UpdateSpec(swagger *spec.Swagger) error { - o.UpdateSpecLazy(cached.Static(swagger, uuid.New().String())) - return nil -} - -func (o *OpenAPIService) UpdateSpecLazy(swagger cached.Value[*spec.Swagger]) { - o.specCache.Store(swagger) -} - -func ToProtoBinary(json []byte) ([]byte, error) { - document, err := openapi_v2.ParseDocument(json) - if err != nil { - return nil, err - } - return proto.Marshal(document) -} - -// RegisterOpenAPIVersionedService registers a handler to provide access to provided swagger spec. -// -// Deprecated: use OpenAPIService.RegisterOpenAPIVersionedService instead. -func RegisterOpenAPIVersionedService(spec *spec.Swagger, servePath string, handler common.PathHandler) *OpenAPIService { - o := NewOpenAPIService(spec) - o.RegisterOpenAPIVersionedService(servePath, handler) - return o -} - -// RegisterOpenAPIVersionedService registers a handler to provide access to provided swagger spec. -func (o *OpenAPIService) RegisterOpenAPIVersionedService(servePath string, handler common.PathHandler) { - accepted := []struct { - Type string - SubType string - ReturnedContentType string - GetDataAndEtag cached.Value[timedSpec] - }{ - {"application", subTypeJSON, "application/" + subTypeJSON, o.jsonCache}, - {"application", subTypeProtobufDeprecated, "application/" + subTypeProtobuf, o.protoCache}, - {"application", subTypeProtobuf, "application/" + subTypeProtobuf, o.protoCache}, - } - - handler.Handle(servePath, gziphandler.GzipHandler(http.HandlerFunc( - func(w http.ResponseWriter, r *http.Request) { - decipherableFormats := r.Header.Get("Accept") - if decipherableFormats == "" { - decipherableFormats = "*/*" - } - clauses := goautoneg.ParseAccept(decipherableFormats) - w.Header().Add("Vary", "Accept") - for _, clause := range clauses { - for _, accepts := range accepted { - if clause.Type != accepts.Type && clause.Type != "*" { - continue - } - if clause.SubType != accepts.SubType && clause.SubType != "*" { - continue - } - // serve the first matching media type in the sorted clause list - ts, etag, err := accepts.GetDataAndEtag.Get() - if err != nil { - klog.Errorf("Error in OpenAPI handler: %s", err) - // only return a 503 if we have no older cache data to serve - if ts.spec == nil { - w.WriteHeader(http.StatusServiceUnavailable) - return - } - } - // Set Content-Type header in the reponse - w.Header().Set("Content-Type", accepts.ReturnedContentType) - - // ETag must be enclosed in double quotes: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag - w.Header().Set("Etag", strconv.Quote(etag)) - // ServeContent will take care of caching using eTag. - http.ServeContent(w, r, servePath, ts.lastModified, bytes.NewReader(ts.spec)) - return - } - } - // Return 406 for not acceptable format - w.WriteHeader(406) - return - }), - )) -} - -// BuildAndRegisterOpenAPIVersionedService builds the spec and registers a handler to provide access to it. -// Use this method if your OpenAPI spec is static. If you want to update the spec, use BuildOpenAPISpec then RegisterOpenAPIVersionedService. -// -// Deprecated: BuildAndRegisterOpenAPIVersionedServiceFromRoutes should be used instead. -func BuildAndRegisterOpenAPIVersionedService(servePath string, webServices []*restful.WebService, config *common.Config, handler common.PathHandler) (*OpenAPIService, error) { - return BuildAndRegisterOpenAPIVersionedServiceFromRoutes(servePath, restfuladapter.AdaptWebServices(webServices), config, handler) -} - -// BuildAndRegisterOpenAPIVersionedServiceFromRoutes builds the spec and registers a handler to provide access to it. -// Use this method if your OpenAPI spec is static. If you want to update the spec, use BuildOpenAPISpec then RegisterOpenAPIVersionedService. -func BuildAndRegisterOpenAPIVersionedServiceFromRoutes(servePath string, routeContainers []common.RouteContainer, config *common.Config, handler common.PathHandler) (*OpenAPIService, error) { - spec, err := builder.BuildOpenAPISpecFromRoutes(routeContainers, config) - if err != nil { - return nil, err - } - o := NewOpenAPIService(spec) - o.RegisterOpenAPIVersionedService(servePath, handler) - return o, nil -} diff --git a/e2e/vendor/k8s.io/kube-openapi/pkg/schemamutation/walker.go b/e2e/vendor/k8s.io/kube-openapi/pkg/schemamutation/walker.go deleted file mode 100644 index 3fac658e3..000000000 --- a/e2e/vendor/k8s.io/kube-openapi/pkg/schemamutation/walker.go +++ /dev/null @@ -1,519 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package schemamutation - -import ( - "k8s.io/kube-openapi/pkg/validation/spec" -) - -// Walker runs callback functions on all references of an OpenAPI spec, -// replacing the values when visiting corresponding types. -type Walker struct { - // SchemaCallback will be called on each schema, taking the original schema, - // and before any other callbacks of the Walker. - // If the schema needs to be mutated, DO NOT mutate it in-place, - // always create a copy, mutate, and return it. - SchemaCallback func(schema *spec.Schema) *spec.Schema - - // RefCallback will be called on each ref. - // If the ref needs to be mutated, DO NOT mutate it in-place, - // always create a copy, mutate, and return it. - RefCallback func(ref *spec.Ref) *spec.Ref -} - -type SchemaCallbackFunc func(schema *spec.Schema) *spec.Schema -type RefCallbackFunc func(ref *spec.Ref) *spec.Ref - -var SchemaCallBackNoop SchemaCallbackFunc = func(schema *spec.Schema) *spec.Schema { - return schema -} -var RefCallbackNoop RefCallbackFunc = func(ref *spec.Ref) *spec.Ref { - return ref -} - -// ReplaceReferences rewrites the references without mutating the input. -// The output might share data with the input. -func ReplaceReferences(walkRef func(ref *spec.Ref) *spec.Ref, sp *spec.Swagger) *spec.Swagger { - walker := &Walker{RefCallback: walkRef, SchemaCallback: SchemaCallBackNoop} - return walker.WalkRoot(sp) -} - -func (w *Walker) WalkSchema(schema *spec.Schema) *spec.Schema { - if schema == nil { - return nil - } - - orig := schema - clone := func() { - if orig == schema { - schema = &spec.Schema{} - *schema = *orig - } - } - - // Always run callback on the whole schema first - // so that SchemaCallback can take the original schema as input. - schema = w.SchemaCallback(schema) - - if r := w.RefCallback(&schema.Ref); r != &schema.Ref { - clone() - schema.Ref = *r - } - - definitionsCloned := false - for k, v := range schema.Definitions { - if s := w.WalkSchema(&v); s != &v { - if !definitionsCloned { - definitionsCloned = true - clone() - schema.Definitions = make(spec.Definitions, len(orig.Definitions)) - for k2, v2 := range orig.Definitions { - schema.Definitions[k2] = v2 - } - } - schema.Definitions[k] = *s - } - } - - propertiesCloned := false - for k, v := range schema.Properties { - if s := w.WalkSchema(&v); s != &v { - if !propertiesCloned { - propertiesCloned = true - clone() - schema.Properties = make(map[string]spec.Schema, len(orig.Properties)) - for k2, v2 := range orig.Properties { - schema.Properties[k2] = v2 - } - } - schema.Properties[k] = *s - } - } - - patternPropertiesCloned := false - for k, v := range schema.PatternProperties { - if s := w.WalkSchema(&v); s != &v { - if !patternPropertiesCloned { - patternPropertiesCloned = true - clone() - schema.PatternProperties = make(map[string]spec.Schema, len(orig.PatternProperties)) - for k2, v2 := range orig.PatternProperties { - schema.PatternProperties[k2] = v2 - } - } - schema.PatternProperties[k] = *s - } - } - - allOfCloned := false - for i := range schema.AllOf { - if s := w.WalkSchema(&schema.AllOf[i]); s != &schema.AllOf[i] { - if !allOfCloned { - allOfCloned = true - clone() - schema.AllOf = make([]spec.Schema, len(orig.AllOf)) - copy(schema.AllOf, orig.AllOf) - } - schema.AllOf[i] = *s - } - } - - anyOfCloned := false - for i := range schema.AnyOf { - if s := w.WalkSchema(&schema.AnyOf[i]); s != &schema.AnyOf[i] { - if !anyOfCloned { - anyOfCloned = true - clone() - schema.AnyOf = make([]spec.Schema, len(orig.AnyOf)) - copy(schema.AnyOf, orig.AnyOf) - } - schema.AnyOf[i] = *s - } - } - - oneOfCloned := false - for i := range schema.OneOf { - if s := w.WalkSchema(&schema.OneOf[i]); s != &schema.OneOf[i] { - if !oneOfCloned { - oneOfCloned = true - clone() - schema.OneOf = make([]spec.Schema, len(orig.OneOf)) - copy(schema.OneOf, orig.OneOf) - } - schema.OneOf[i] = *s - } - } - - if schema.Not != nil { - if s := w.WalkSchema(schema.Not); s != schema.Not { - clone() - schema.Not = s - } - } - - if schema.AdditionalProperties != nil && schema.AdditionalProperties.Schema != nil { - if s := w.WalkSchema(schema.AdditionalProperties.Schema); s != schema.AdditionalProperties.Schema { - clone() - schema.AdditionalProperties = &spec.SchemaOrBool{Schema: s, Allows: schema.AdditionalProperties.Allows} - } - } - - if schema.AdditionalItems != nil && schema.AdditionalItems.Schema != nil { - if s := w.WalkSchema(schema.AdditionalItems.Schema); s != schema.AdditionalItems.Schema { - clone() - schema.AdditionalItems = &spec.SchemaOrBool{Schema: s, Allows: schema.AdditionalItems.Allows} - } - } - - if schema.Items != nil { - if schema.Items.Schema != nil { - if s := w.WalkSchema(schema.Items.Schema); s != schema.Items.Schema { - clone() - schema.Items = &spec.SchemaOrArray{Schema: s} - } - } else { - itemsCloned := false - for i := range schema.Items.Schemas { - if s := w.WalkSchema(&schema.Items.Schemas[i]); s != &schema.Items.Schemas[i] { - if !itemsCloned { - clone() - schema.Items = &spec.SchemaOrArray{ - Schemas: make([]spec.Schema, len(orig.Items.Schemas)), - } - itemsCloned = true - copy(schema.Items.Schemas, orig.Items.Schemas) - } - schema.Items.Schemas[i] = *s - } - } - } - } - - return schema -} - -func (w *Walker) walkParameter(param *spec.Parameter) *spec.Parameter { - if param == nil { - return nil - } - - orig := param - cloned := false - clone := func() { - if !cloned { - cloned = true - param = &spec.Parameter{} - *param = *orig - } - } - - if r := w.RefCallback(¶m.Ref); r != ¶m.Ref { - clone() - param.Ref = *r - } - if s := w.WalkSchema(param.Schema); s != param.Schema { - clone() - param.Schema = s - } - if param.Items != nil { - if r := w.RefCallback(¶m.Items.Ref); r != ¶m.Items.Ref { - param.Items.Ref = *r - } - } - - return param -} - -func (w *Walker) walkParameters(params []spec.Parameter) ([]spec.Parameter, bool) { - if params == nil { - return nil, false - } - - orig := params - cloned := false - clone := func() { - if !cloned { - cloned = true - params = make([]spec.Parameter, len(params)) - copy(params, orig) - } - } - - for i := range params { - if s := w.walkParameter(¶ms[i]); s != ¶ms[i] { - clone() - params[i] = *s - } - } - - return params, cloned -} - -func (w *Walker) walkResponse(resp *spec.Response) *spec.Response { - if resp == nil { - return nil - } - - orig := resp - cloned := false - clone := func() { - if !cloned { - cloned = true - resp = &spec.Response{} - *resp = *orig - } - } - - if r := w.RefCallback(&resp.Ref); r != &resp.Ref { - clone() - resp.Ref = *r - } - if s := w.WalkSchema(resp.Schema); s != resp.Schema { - clone() - resp.Schema = s - } - - return resp -} - -func (w *Walker) walkResponses(resps *spec.Responses) *spec.Responses { - if resps == nil { - return nil - } - - orig := resps - cloned := false - clone := func() { - if !cloned { - cloned = true - resps = &spec.Responses{} - *resps = *orig - } - } - - if r := w.walkResponse(resps.ResponsesProps.Default); r != resps.ResponsesProps.Default { - clone() - resps.Default = r - } - - responsesCloned := false - for k, v := range resps.ResponsesProps.StatusCodeResponses { - if r := w.walkResponse(&v); r != &v { - if !responsesCloned { - responsesCloned = true - clone() - resps.ResponsesProps.StatusCodeResponses = make(map[int]spec.Response, len(orig.StatusCodeResponses)) - for k2, v2 := range orig.StatusCodeResponses { - resps.ResponsesProps.StatusCodeResponses[k2] = v2 - } - } - resps.ResponsesProps.StatusCodeResponses[k] = *r - } - } - - return resps -} - -func (w *Walker) walkOperation(op *spec.Operation) *spec.Operation { - if op == nil { - return nil - } - - orig := op - cloned := false - clone := func() { - if !cloned { - cloned = true - op = &spec.Operation{} - *op = *orig - } - } - - parametersCloned := false - for i := range op.Parameters { - if s := w.walkParameter(&op.Parameters[i]); s != &op.Parameters[i] { - if !parametersCloned { - parametersCloned = true - clone() - op.Parameters = make([]spec.Parameter, len(orig.Parameters)) - copy(op.Parameters, orig.Parameters) - } - op.Parameters[i] = *s - } - } - - if r := w.walkResponses(op.Responses); r != op.Responses { - clone() - op.Responses = r - } - - return op -} - -func (w *Walker) walkPathItem(pathItem *spec.PathItem) *spec.PathItem { - if pathItem == nil { - return nil - } - - orig := pathItem - cloned := false - clone := func() { - if !cloned { - cloned = true - pathItem = &spec.PathItem{} - *pathItem = *orig - } - } - - if p, changed := w.walkParameters(pathItem.Parameters); changed { - clone() - pathItem.Parameters = p - } - if op := w.walkOperation(pathItem.Get); op != pathItem.Get { - clone() - pathItem.Get = op - } - if op := w.walkOperation(pathItem.Head); op != pathItem.Head { - clone() - pathItem.Head = op - } - if op := w.walkOperation(pathItem.Delete); op != pathItem.Delete { - clone() - pathItem.Delete = op - } - if op := w.walkOperation(pathItem.Options); op != pathItem.Options { - clone() - pathItem.Options = op - } - if op := w.walkOperation(pathItem.Patch); op != pathItem.Patch { - clone() - pathItem.Patch = op - } - if op := w.walkOperation(pathItem.Post); op != pathItem.Post { - clone() - pathItem.Post = op - } - if op := w.walkOperation(pathItem.Put); op != pathItem.Put { - clone() - pathItem.Put = op - } - - return pathItem -} - -func (w *Walker) walkPaths(paths *spec.Paths) *spec.Paths { - if paths == nil { - return nil - } - - orig := paths - cloned := false - clone := func() { - if !cloned { - cloned = true - paths = &spec.Paths{} - *paths = *orig - } - } - - pathsCloned := false - for k, v := range paths.Paths { - if p := w.walkPathItem(&v); p != &v { - if !pathsCloned { - pathsCloned = true - clone() - paths.Paths = make(map[string]spec.PathItem, len(orig.Paths)) - for k2, v2 := range orig.Paths { - paths.Paths[k2] = v2 - } - } - paths.Paths[k] = *p - } - } - - return paths -} - -func (w *Walker) WalkRoot(swagger *spec.Swagger) *spec.Swagger { - if swagger == nil { - return nil - } - - orig := swagger - cloned := false - clone := func() { - if !cloned { - cloned = true - swagger = &spec.Swagger{} - *swagger = *orig - } - } - - parametersCloned := false - for k, v := range swagger.Parameters { - if p := w.walkParameter(&v); p != &v { - if !parametersCloned { - parametersCloned = true - clone() - swagger.Parameters = make(map[string]spec.Parameter, len(orig.Parameters)) - for k2, v2 := range orig.Parameters { - swagger.Parameters[k2] = v2 - } - } - swagger.Parameters[k] = *p - } - } - - responsesCloned := false - for k, v := range swagger.Responses { - if r := w.walkResponse(&v); r != &v { - if !responsesCloned { - responsesCloned = true - clone() - swagger.Responses = make(map[string]spec.Response, len(orig.Responses)) - for k2, v2 := range orig.Responses { - swagger.Responses[k2] = v2 - } - } - swagger.Responses[k] = *r - } - } - - definitionsCloned := false - for k, v := range swagger.Definitions { - if s := w.WalkSchema(&v); s != &v { - if !definitionsCloned { - definitionsCloned = true - clone() - swagger.Definitions = make(spec.Definitions, len(orig.Definitions)) - for k2, v2 := range orig.Definitions { - swagger.Definitions[k2] = v2 - } - } - swagger.Definitions[k] = *s - } - } - - if swagger.Paths != nil { - if p := w.walkPaths(swagger.Paths); p != swagger.Paths { - clone() - swagger.Paths = p - } - } - - return swagger -} diff --git a/e2e/vendor/k8s.io/kube-scheduler/config/v1/doc.go b/e2e/vendor/k8s.io/kube-scheduler/config/v1/doc.go index bbc4641e7..2d0e79e13 100644 --- a/e2e/vendor/k8s.io/kube-scheduler/config/v1/doc.go +++ b/e2e/vendor/k8s.io/kube-scheduler/config/v1/doc.go @@ -18,4 +18,4 @@ limitations under the License. // +k8s:openapi-gen=true // +groupName=kubescheduler.config.k8s.io -package v1 // import "k8s.io/kube-scheduler/config/v1" +package v1 diff --git a/e2e/vendor/k8s.io/kube-scheduler/config/v1/types_pluginargs.go b/e2e/vendor/k8s.io/kube-scheduler/config/v1/types_pluginargs.go index 3be0d9ce1..e1f3e7cf5 100644 --- a/e2e/vendor/k8s.io/kube-scheduler/config/v1/types_pluginargs.go +++ b/e2e/vendor/k8s.io/kube-scheduler/config/v1/types_pluginargs.go @@ -159,17 +159,17 @@ type VolumeBindingArgs struct { BindTimeoutSeconds *int64 `json:"bindTimeoutSeconds,omitempty"` // Shape specifies the points defining the score function shape, which is - // used to score nodes based on the utilization of statically provisioned - // PVs. The utilization is calculated by dividing the total requested + // used to score nodes based on the utilization of provisioned PVs. + // The utilization is calculated by dividing the total requested // storage of the pod by the total capacity of feasible PVs on each node. // Each point contains utilization (ranges from 0 to 100) and its // associated score (ranges from 0 to 10). You can turn the priority by // specifying different scores for different utilization numbers. // The default shape points are: - // 1) 0 for 0 utilization - // 2) 10 for 100 utilization + // 1) 10 for 0 utilization + // 2) 0 for 100 utilization // All points must be sorted in increasing order by utilization. - // +featureGate=VolumeCapacityPriority + // +featureGate=StorageCapacityScoring // +optional // +listType=atomic Shape []UtilizationShapePoint `json:"shape,omitempty"` diff --git a/e2e/vendor/k8s.io/kube-scheduler/extender/v1/doc.go b/e2e/vendor/k8s.io/kube-scheduler/extender/v1/doc.go index 202572083..4b311d4b7 100644 --- a/e2e/vendor/k8s.io/kube-scheduler/extender/v1/doc.go +++ b/e2e/vendor/k8s.io/kube-scheduler/extender/v1/doc.go @@ -17,4 +17,4 @@ limitations under the License. // +k8s:deepcopy-gen=package // Package v1 contains scheduler API objects. -package v1 // import "k8s.io/kube-scheduler/extender/v1" +package v1 diff --git a/e2e/vendor/k8s.io/kubelet/pkg/apis/stats/v1alpha1/types.go b/e2e/vendor/k8s.io/kubelet/pkg/apis/stats/v1alpha1/types.go index b63a17ace..5e8553f8a 100644 --- a/e2e/vendor/k8s.io/kubelet/pkg/apis/stats/v1alpha1/types.go +++ b/e2e/vendor/k8s.io/kubelet/pkg/apis/stats/v1alpha1/types.go @@ -46,6 +46,9 @@ type NodeStats struct { // Stats pertaining to memory (RAM) resources. // +optional Memory *MemoryStats `json:"memory,omitempty"` + // Stats pertaining to IO resources. + // +optional + IO *IOStats `json:"io,omitempty"` // Stats pertaining to network resources. // +optional Network *NetworkStats `json:"network,omitempty"` @@ -127,6 +130,9 @@ type PodStats struct { // Stats pertaining to memory (RAM) resources consumed by pod cgroup (which includes all containers' resource usage and pod overhead). // +optional Memory *MemoryStats `json:"memory,omitempty"` + // Stats pertaining to IO resources consumed by pod cgroup (which includes all containers' resource usage and pod overhead). + // +optional + IO *IOStats `json:"io,omitempty"` // Stats pertaining to network resources. // +optional Network *NetworkStats `json:"network,omitempty"` @@ -159,6 +165,9 @@ type ContainerStats struct { // Stats pertaining to memory (RAM) resources. // +optional Memory *MemoryStats `json:"memory,omitempty"` + // Stats pertaining to IO resources. + // +optional + IO *IOStats `json:"io,omitempty"` // Metrics for Accelerators. Each Accelerator corresponds to one element in the array. Accelerators []AcceleratorStats `json:"accelerators,omitempty"` // Stats pertaining to container rootfs usage of filesystem resources. @@ -225,6 +234,9 @@ type CPUStats struct { // Cumulative CPU usage (sum of all cores) since object creation. // +optional UsageCoreNanoSeconds *uint64 `json:"usageCoreNanoSeconds,omitempty"` + // CPU PSI stats. + // +optional + PSI *PSIStats `json:"psi,omitempty"` } // MemoryStats contains data about memory usage. @@ -252,6 +264,39 @@ type MemoryStats struct { // Cumulative number of major page faults. // +optional MajorPageFaults *uint64 `json:"majorPageFaults,omitempty"` + // Memory PSI stats. + // +optional + PSI *PSIStats `json:"psi,omitempty"` +} + +// IOStats contains data about IO usage. +type IOStats struct { + // The time at which these stats were updated. + Time metav1.Time `json:"time"` + // IO PSI stats. + // +optional + PSI *PSIStats `json:"psi,omitempty"` +} + +// PSI statistics for an individual resource. +type PSIStats struct { + // PSI data for all tasks in the cgroup. + Full PSIData `json:"full"` + // PSI data for some tasks in the cgroup. + Some PSIData `json:"some"` +} + +// PSI data for an individual resource. +type PSIData struct { + // Total time duration for tasks in the cgroup have waited due to congestion. + // Unit: nanoseconds. + Total uint64 `json:"total"` + // The average (in %) tasks have waited due to congestion over a 10 second window. + Avg10 float64 `json:"avg10"` + // The average (in %) tasks have waited due to congestion over a 60 second window. + Avg60 float64 `json:"avg60"` + // The average (in %) tasks have waited due to congestion over a 300 second window. + Avg300 float64 `json:"avg300"` } // SwapStats contains data about memory usage diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/api/service/warnings.go b/e2e/vendor/k8s.io/kubernetes/pkg/api/service/warnings.go index 29b1097df..75fb43b7e 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/api/service/warnings.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/api/service/warnings.go @@ -18,8 +18,8 @@ package service import ( "fmt" - "net/netip" + utilvalidation "k8s.io/apimachinery/pkg/util/validation" "k8s.io/apimachinery/pkg/util/validation/field" api "k8s.io/kubernetes/pkg/apis/core" "k8s.io/kubernetes/pkg/apis/core/helper" @@ -37,20 +37,20 @@ func GetWarningsForService(service, oldService *api.Service) []string { if helper.IsServiceIPSet(service) { for i, clusterIP := range service.Spec.ClusterIPs { - warnings = append(warnings, getWarningsForIP(field.NewPath("spec").Child("clusterIPs").Index(i), clusterIP)...) + warnings = append(warnings, utilvalidation.GetWarningsForIP(field.NewPath("spec").Child("clusterIPs").Index(i), clusterIP)...) } } for i, externalIP := range service.Spec.ExternalIPs { - warnings = append(warnings, getWarningsForIP(field.NewPath("spec").Child("externalIPs").Index(i), externalIP)...) + warnings = append(warnings, utilvalidation.GetWarningsForIP(field.NewPath("spec").Child("externalIPs").Index(i), externalIP)...) } if len(service.Spec.LoadBalancerIP) > 0 { - warnings = append(warnings, getWarningsForIP(field.NewPath("spec").Child("loadBalancerIP"), service.Spec.LoadBalancerIP)...) + warnings = append(warnings, utilvalidation.GetWarningsForIP(field.NewPath("spec").Child("loadBalancerIP"), service.Spec.LoadBalancerIP)...) } for i, cidr := range service.Spec.LoadBalancerSourceRanges { - warnings = append(warnings, getWarningsForCIDR(field.NewPath("spec").Child("loadBalancerSourceRanges").Index(i), cidr)...) + warnings = append(warnings, utilvalidation.GetWarningsForCIDR(field.NewPath("spec").Child("loadBalancerSourceRanges").Index(i), cidr)...) } if service.Spec.Type == api.ServiceTypeExternalName && len(service.Spec.ExternalIPs) > 0 { @@ -62,45 +62,3 @@ func GetWarningsForService(service, oldService *api.Service) []string { return warnings } - -func getWarningsForIP(fieldPath *field.Path, address string) []string { - // IPv4 addresses with leading zeros CVE-2021-29923 are not valid in golang since 1.17 - // This will also warn about possible future changes on the golang std library - // xref: https://issues.k8s.io/108074 - ip, err := netip.ParseAddr(address) - if err != nil { - return []string{fmt.Sprintf("%s: IP address was accepted, but will be invalid in a future Kubernetes release: %v", fieldPath, err)} - } - // A Recommendation for IPv6 Address Text Representation - // - // "All of the above examples represent the same IPv6 address. This - // flexibility has caused many problems for operators, systems - // engineers, and customers. - // ..." - // https://datatracker.ietf.org/doc/rfc5952/ - if ip.Is6() && ip.String() != address { - return []string{fmt.Sprintf("%s: IPv6 address %q is not in RFC 5952 canonical format (%q), which may cause controller apply-loops", fieldPath, address, ip.String())} - } - return []string{} -} - -func getWarningsForCIDR(fieldPath *field.Path, cidr string) []string { - // IPv4 addresses with leading zeros CVE-2021-29923 are not valid in golang since 1.17 - // This will also warn about possible future changes on the golang std library - // xref: https://issues.k8s.io/108074 - prefix, err := netip.ParsePrefix(cidr) - if err != nil { - return []string{fmt.Sprintf("%s: IP prefix was accepted, but will be invalid in a future Kubernetes release: %v", fieldPath, err)} - } - // A Recommendation for IPv6 Address Text Representation - // - // "All of the above examples represent the same IPv6 address. This - // flexibility has caused many problems for operators, systems - // engineers, and customers. - // ..." - // https://datatracker.ietf.org/doc/rfc5952/ - if prefix.Addr().Is6() && prefix.String() != cidr { - return []string{fmt.Sprintf("%s: IPv6 prefix %q is not in RFC 5952 canonical format (%q), which may cause controller apply-loops", fieldPath, cidr, prefix.String())} - } - return []string{} -} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/api/v1/pod/util.go b/e2e/vendor/k8s.io/kubernetes/pkg/api/v1/pod/util.go index c2fe51971..7ba94b421 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/api/v1/pod/util.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/api/v1/pod/util.go @@ -23,6 +23,8 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" + utilfeature "k8s.io/apiserver/pkg/util/feature" + "k8s.io/kubernetes/pkg/features" ) // FindPort locates the container port for the given pod and portName. If the @@ -416,3 +418,31 @@ func IsRestartableInitContainer(initContainer *v1.Container) bool { } return *initContainer.RestartPolicy == v1.ContainerRestartPolicyAlways } + +// We will emit status.observedGeneration if the feature is enabled OR if status.observedGeneration is already set. +// This protects against an infinite loop of kubelet trying to clear the value after the FG is turned off, and +// the API server preserving existing values when an incoming update tries to clear it. +func GetPodObservedGenerationIfEnabled(pod *v1.Pod) int64 { + if pod.Status.ObservedGeneration != 0 || utilfeature.DefaultFeatureGate.Enabled(features.PodObservedGenerationTracking) { + return pod.Generation + } + return 0 +} + +// We will emit condition.observedGeneration if the feature is enabled OR if condition.observedGeneration is already set. +// This protects against an infinite loop of kubelet trying to clear the value after the FG is turned off, and +// the API server preserving existing values when an incoming update tries to clear it. +func GetPodObservedGenerationIfEnabledOnCondition(podStatus *v1.PodStatus, generation int64, conditionType v1.PodConditionType) int64 { + if podStatus == nil { + return 0 + } + if utilfeature.DefaultFeatureGate.Enabled(features.PodObservedGenerationTracking) { + return generation + } + for _, condition := range podStatus.Conditions { + if condition.Type == conditionType && condition.ObservedGeneration != 0 { + return generation + } + } + return 0 +} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/apps/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/apps/doc.go index 1ff549998..91d117598 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/apps/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/apps/doc.go @@ -16,4 +16,4 @@ limitations under the License. // +k8s:deepcopy-gen=package -package apps // import "k8s.io/kubernetes/pkg/apis/apps" +package apps diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/apps/types.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/apps/types.go index 1cd08ce84..7e4bf6d49 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/apps/types.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/apps/types.go @@ -198,6 +198,7 @@ type StatefulSetSpec struct { // the network identity of the set. Pods get DNS/hostnames that follow the // pattern: pod-specific-string.serviceName.default.svc.cluster.local // where "pod-specific-string" is managed by the StatefulSet controller. + // +optional ServiceName string // PodManagementPolicy controls how pods are created during initial scale up, @@ -507,19 +508,19 @@ type DeploymentStatus struct { // +optional ObservedGeneration int64 - // Total number of non-terminated pods targeted by this deployment (their labels match the selector). + // Total number of non-terminating pods targeted by this deployment (their labels match the selector). // +optional Replicas int32 - // Total number of non-terminated pods targeted by this deployment that have the desired template spec. + // Total number of non-terminating pods targeted by this deployment that have the desired template spec. // +optional UpdatedReplicas int32 - // Total number of ready pods targeted by this deployment. + // Total number of non-terminating pods targeted by this Deployment with a Ready Condition. // +optional ReadyReplicas int32 - // Total number of available pods (ready for at least minReadySeconds) targeted by this deployment. + // Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment. // +optional AvailableReplicas int32 @@ -529,6 +530,13 @@ type DeploymentStatus struct { // +optional UnavailableReplicas int32 + // Total number of terminating pods targeted by this deployment. Terminating pods have a non-null + // .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. + // + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. + // +optional + TerminatingReplicas *int32 + // Represents the latest available observations of a deployment's current state. Conditions []DeploymentCondition @@ -865,22 +873,30 @@ type ReplicaSetSpec struct { // ReplicaSetStatus represents the current status of a ReplicaSet. type ReplicaSetStatus struct { - // Replicas is the number of actual replicas. + // Replicas is the most recently observed number of non-terminating pods. + // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset Replicas int32 - // The number of pods that have labels matching the labels of the pod template of the replicaset. + // The number of non-terminating pods that have labels matching the labels of the pod template of the replicaset. // +optional FullyLabeledReplicas int32 - // The number of ready replicas for this replica set. + // The number of non-terminating pods targeted by this ReplicaSet with a Ready Condition. // +optional ReadyReplicas int32 - // The number of available replicas (ready for at least minReadySeconds) for this replica set. + // The number of available non-terminating pods (ready for at least minReadySeconds) for this replica set. // +optional AvailableReplicas int32 - // ObservedGeneration is the most recent generation observed by the controller. + // The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp + // and have not yet reached the Failed or Succeeded .status.phase. + // + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. + // +optional + TerminatingReplicas *int32 + + // ObservedGeneration reflects the generation of the most recently observed ReplicaSet. // +optional ObservedGeneration int64 diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/apps/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/apps/zz_generated.deepcopy.go index 14beed8f5..e9b214234 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/apps/zz_generated.deepcopy.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/apps/zz_generated.deepcopy.go @@ -396,6 +396,11 @@ func (in *DeploymentSpec) DeepCopy() *DeploymentSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DeploymentStatus) DeepCopyInto(out *DeploymentStatus) { *out = *in + if in.TerminatingReplicas != nil { + in, out := &in.TerminatingReplicas, &out.TerminatingReplicas + *out = new(int32) + **out = **in + } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions *out = make([]DeploymentCondition, len(*in)) @@ -545,6 +550,11 @@ func (in *ReplicaSetSpec) DeepCopy() *ReplicaSetSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ReplicaSetStatus) DeepCopyInto(out *ReplicaSetStatus) { *out = *in + if in.TerminatingReplicas != nil { + in, out := &in.TerminatingReplicas, &out.TerminatingReplicas + *out = new(int32) + **out = **in + } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions *out = make([]ReplicaSetCondition, len(*in)) diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/annotations.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/annotations.go index e49aaab2e..d793cd4aa 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/annotations.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/annotations.go @@ -36,3 +36,11 @@ const DefaultCPUUtilization = 80 // BehaviorSpecsAnnotation is the annotation which holds the HPA constraints specs // when converting the `Behavior` field from autoscaling/v2beta2 const BehaviorSpecsAnnotation = "autoscaling.alpha.kubernetes.io/behavior" + +// ToleranceScaleDownAnnotation is the annotation which holds the HPA tolerance specs +// when converting the `ScaleDown.Tolerance` field from autoscaling/v2 +const ToleranceScaleDownAnnotation = "autoscaling.alpha.kubernetes.io/scale-down-tolerance" + +// ToleranceScaleUpAnnotation is the annotation which holds the HPA tolerance specs +// when converting the `ScaleUp.Tolerance` field from autoscaling/v2 +const ToleranceScaleUpAnnotation = "autoscaling.alpha.kubernetes.io/scale-up-tolerance" diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/doc.go index 7c91aac8b..047eedde4 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/doc.go @@ -16,4 +16,4 @@ limitations under the License. // +k8s:deepcopy-gen=package -package autoscaling // import "k8s.io/kubernetes/pkg/apis/autoscaling" +package autoscaling diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/helpers.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/helpers.go index f66a12f4d..67853dc29 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/helpers.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/helpers.go @@ -16,8 +16,10 @@ limitations under the License. package autoscaling -// DropRoundTripHorizontalPodAutoscalerAnnotations removes any annotations used to serialize round-tripped fields from later API versions, +// DropRoundTripHorizontalPodAutoscalerAnnotations removes any annotations used to +// serialize round-tripped fields from HorizontalPodAutoscaler later API versions, // and returns false if no changes were made and the original input object was returned. +// // It should always be called when converting internal -> external versions, prior // to setting any of the custom annotations: // @@ -34,12 +36,16 @@ package autoscaling func DropRoundTripHorizontalPodAutoscalerAnnotations(in map[string]string) (out map[string]string, copied bool) { _, hasMetricsSpecs := in[MetricSpecsAnnotation] _, hasBehaviorSpecs := in[BehaviorSpecsAnnotation] + _, hasToleranceScaleDown := in[ToleranceScaleDownAnnotation] + _, hasToleranceScaleUp := in[ToleranceScaleUpAnnotation] _, hasMetricsStatuses := in[MetricStatusesAnnotation] _, hasConditions := in[HorizontalPodAutoscalerConditionsAnnotation] - if hasMetricsSpecs || hasBehaviorSpecs || hasMetricsStatuses || hasConditions { + if hasMetricsSpecs || hasBehaviorSpecs || hasToleranceScaleDown || hasToleranceScaleUp || hasMetricsStatuses || hasConditions { out = DeepCopyStringMap(in) delete(out, MetricSpecsAnnotation) delete(out, BehaviorSpecsAnnotation) + delete(out, ToleranceScaleDownAnnotation) + delete(out, ToleranceScaleUpAnnotation) delete(out, MetricStatusesAnnotation) delete(out, HorizontalPodAutoscalerConditionsAnnotation) return out, true diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/types.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/types.go index 7f254442b..db9ac4408 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/types.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/types.go @@ -138,12 +138,18 @@ const ( DisabledPolicySelect ScalingPolicySelect = "Disabled" ) -// HPAScalingRules configures the scaling behavior for one direction. -// These Rules are applied after calculating DesiredReplicas from metrics for the HPA. +// HPAScalingRules configures the scaling behavior for one direction via +// scaling Policy Rules and a configurable metric tolerance. +// +// Scaling Policy Rules are applied after calculating DesiredReplicas from metrics for the HPA. // They can limit the scaling velocity by specifying scaling policies. // They can prevent flapping by specifying the stabilization window, so that the // number of replicas is not set instantly, instead, the safest value from the stabilization // window is chosen. +// +// The tolerance is applied to the metric values and prevents scaling too +// eagerly for small metric variations. (Note that setting a tolerance requires +// enabling the alpha HPAConfigurableTolerance feature gate.) type HPAScalingRules struct { // StabilizationWindowSeconds is the number of seconds for which past recommendations should be // considered while scaling up or scaling down. @@ -157,10 +163,27 @@ type HPAScalingRules struct { // If not set, the default value MaxPolicySelect is used. // +optional SelectPolicy *ScalingPolicySelect - // policies is a list of potential scaling polices which can used during scaling. - // At least one policy must be specified, otherwise the HPAScalingRules will be discarded as invalid + // policies is a list of potential scaling polices which can be used during scaling. + // If not set, use the default values: + // - For scale up: allow doubling the number of pods, or an absolute change of 4 pods in a 15s window. + // - For scale down: allow all pods to be removed in a 15s window. // +optional Policies []HPAScalingPolicy + // tolerance is the tolerance on the ratio between the current and desired + // metric value under which no updates are made to the desired number of + // replicas (e.g. 0.01 for 1%). Must be greater than or equal to zero. If not + // set, the default cluster-wide tolerance is applied (by default 10%). + // + // For example, if autoscaling is configured with a memory consumption target of 100Mi, + // and scale-down and scale-up tolerances of 5% and 1% respectively, scaling will be + // triggered when the actual consumption falls below 95Mi or exceeds 101Mi. + // + // This is an alpha field and requires enabling the HPAConfigurableTolerance + // feature gate. + // + // +featureGate=HPAConfigurableTolerance + // +optional + Tolerance *resource.Quantity } // HPAScalingPolicyType is the type of the policy which could be used while making scaling decisions. diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/zz_generated.deepcopy.go index 9f2d6c2e5..9e2ac0f00 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/zz_generated.deepcopy.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/autoscaling/zz_generated.deepcopy.go @@ -146,6 +146,11 @@ func (in *HPAScalingRules) DeepCopyInto(out *HPAScalingRules) { *out = make([]HPAScalingPolicy, len(*in)) copy(*out, *in) } + if in.Tolerance != nil { + in, out := &in.Tolerance, &out.Tolerance + x := (*in).DeepCopy() + *out = &x + } return } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/batch/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/batch/doc.go index a80b3597f..65fa657f8 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/batch/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/batch/doc.go @@ -16,4 +16,4 @@ limitations under the License. // +k8s:deepcopy-gen=package -package batch // import "k8s.io/kubernetes/pkg/apis/batch" +package batch diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/batch/types.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/batch/types.go index aa9874507..11a5b0cc2 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/batch/types.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/batch/types.go @@ -132,7 +132,6 @@ const ( // This is an action which might be taken on a pod failure - mark the // Job's index as failed to avoid restarts within this index. This action // can only be used when backoffLimitPerIndex is set. - // This value is beta-level. PodFailurePolicyActionFailIndex PodFailurePolicyAction = "FailIndex" // This is an action which might be taken on a pod failure - the counter towards @@ -226,8 +225,6 @@ type PodFailurePolicyRule struct { // running pods are terminated. // - FailIndex: indicates that the pod's index is marked as Failed and will // not be restarted. - // This value is alpha-level. It can be used when the - // `JobBackoffLimitPerIndex` feature gate is enabled (disabled by default). // - Ignore: indicates that the counter towards the .backoffLimit is not // incremented and a replacement pod is created. // - Count: indicates that the pod is handled in the default way - the @@ -339,8 +336,6 @@ type JobSpec struct { // When the field is specified, it must be immutable and works only for the Indexed Jobs. // Once the Job meets the SuccessPolicy, the lingering pods are terminated. // - // This field is beta-level. To use this field, you must enable the - // `JobSuccessPolicy` feature gate (enabled by default). // +optional SuccessPolicy *SuccessPolicy @@ -363,8 +358,6 @@ type JobSpec struct { // batch.kubernetes.io/job-index-failure-count annotation. It can only // be set when Job's completionMode=Indexed, and the Pod's restart // policy is Never. The field is immutable. - // This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` - // feature gate is enabled (enabled by default). // +optional BackoffLimitPerIndex *int32 @@ -376,8 +369,6 @@ type JobSpec struct { // It can only be specified when backoffLimitPerIndex is set. // It can be null or up to completions. It is required and must be // less than or equal to 10^4 when is completions greater than 10^5. - // This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` - // feature gate is enabled (enabled by default). // +optional MaxFailedIndexes *int32 @@ -571,8 +562,6 @@ type JobStatus struct { // represented as "1,3-5,7". // The set of failed indexes cannot overlap with the set of completed indexes. // - // This field is beta-level. It can be used when the `JobBackoffLimitPerIndex` - // feature gate is enabled (enabled by default). // +optional FailedIndexes *string diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/doc.go index 79ef0e05d..555c96110 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/doc.go @@ -22,4 +22,4 @@ limitations under the License. // The contract presented to clients is located in the versioned packages, // which are sub-directories. The first one is "v1". Those packages // describe how a particular version is serialized to storage/network. -package core // import "k8s.io/kubernetes/pkg/apis/core" +package core diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/helper/helpers.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/helper/helpers.go index 0724e6378..43d482f52 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/helper/helpers.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/helper/helpers.go @@ -119,6 +119,7 @@ var standardResourceQuotaScopes = sets.New( core.ResourceQuotaScopeBestEffort, core.ResourceQuotaScopeNotBestEffort, core.ResourceQuotaScopePriorityClass, + core.ResourceQuotaScopeVolumeAttributesClass, ) // IsStandardResourceQuotaScope returns true if the scope is a standard value @@ -139,6 +140,14 @@ var podComputeQuotaResources = sets.New( core.ResourceRequestsMemory, ) +var pvcObjectCountQuotaResources = sets.New( + core.ResourcePersistentVolumeClaims, +) + +var pvcStorageQuotaResources = sets.New( + core.ResourceRequestsStorage, +) + // IsResourceQuotaScopeValidForResource returns true if the resource applies to the specified scope func IsResourceQuotaScopeValidForResource(scope core.ResourceQuotaScope, resource core.ResourceName) bool { switch scope { @@ -147,6 +156,8 @@ func IsResourceQuotaScopeValidForResource(scope core.ResourceQuotaScope, resourc return podObjectCountQuotaResources.Has(resource) || podComputeQuotaResources.Has(resource) case core.ResourceQuotaScopeBestEffort: return podObjectCountQuotaResources.Has(resource) + case core.ResourceQuotaScopeVolumeAttributesClass: + return pvcObjectCountQuotaResources.Has(resource) || pvcStorageQuotaResources.Has(resource) default: return true } @@ -500,3 +511,18 @@ func validFirstDigit(str string) bool { } return str[0] == '-' || (str[0] == '0' && str == "0") || (str[0] >= '1' && str[0] <= '9') } + +// HasInvalidLabelValueInNodeSelectorTerms checks if there's an invalid label value +// in one NodeSelectorTerm's MatchExpression values +func HasInvalidLabelValueInNodeSelectorTerms(terms []core.NodeSelectorTerm) bool { + for _, term := range terms { + for _, expression := range term.MatchExpressions { + for _, value := range expression.Values { + if len(validation.IsValidLabelValue(value)) > 0 { + return true + } + } + } + } + return false +} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/types.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/types.go index 664eb4897..21ffb64de 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/types.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/types.go @@ -220,7 +220,7 @@ type VolumeSource struct { // The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. // The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. // The volume will be mounted read-only (ro) and non-executable files (noexec). - // Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath). + // Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. // The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type. // +featureGate=ImageVolume // +optional @@ -531,8 +531,8 @@ type PersistentVolumeClaimSpec struct { // * An existing PVC (PersistentVolumeClaim) // If the provisioner or an external controller can support the specified data source, // it will create a new volume based on the contents of the specified data source. - // When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, - // and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + // dataSource contents will be copied to dataSourceRef, and dataSourceRef contents + // will be copied to dataSource when dataSourceRef.namespace is not specified. // If the namespace is specified, then dataSourceRef will not be copied to dataSource. // +optional DataSource *TypedLocalObjectReference @@ -557,8 +557,6 @@ type PersistentVolumeClaimSpec struct { // specified. // * While dataSource only allows local objects, dataSourceRef allows objects // in any namespaces. - // (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. - // (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. // +optional DataSourceRef *TypedObjectReference // volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. @@ -2263,9 +2261,9 @@ type SecretKeySelector struct { Optional *bool } -// EnvFromSource represents the source of a set of ConfigMaps +// EnvFromSource represents the source of a set of ConfigMaps or Secrets type EnvFromSource struct { - // An optional identifier to prepend to each key in the ConfigMap. + // Optional text to prepend to the name of each environment variable. Must be a C_IDENTIFIER. // +optional Prefix string // The ConfigMap to select from. @@ -2675,6 +2673,78 @@ type GRPCAction struct { Service *string } +// Signal defines the stop signal of containers +// +enum +type Signal string + +const ( + SIGABRT Signal = "SIGABRT" + SIGALRM Signal = "SIGALRM" + SIGBUS Signal = "SIGBUS" + SIGCHLD Signal = "SIGCHLD" + SIGCLD Signal = "SIGCLD" + SIGCONT Signal = "SIGCONT" + SIGFPE Signal = "SIGFPE" + SIGHUP Signal = "SIGHUP" + SIGILL Signal = "SIGILL" + SIGINT Signal = "SIGINT" + SIGIO Signal = "SIGIO" + SIGIOT Signal = "SIGIOT" + SIGKILL Signal = "SIGKILL" + SIGPIPE Signal = "SIGPIPE" + SIGPOLL Signal = "SIGPOLL" + SIGPROF Signal = "SIGPROF" + SIGPWR Signal = "SIGPWR" + SIGQUIT Signal = "SIGQUIT" + SIGSEGV Signal = "SIGSEGV" + SIGSTKFLT Signal = "SIGSTKFLT" + SIGSTOP Signal = "SIGSTOP" + SIGSYS Signal = "SIGSYS" + SIGTERM Signal = "SIGTERM" + SIGTRAP Signal = "SIGTRAP" + SIGTSTP Signal = "SIGTSTP" + SIGTTIN Signal = "SIGTTIN" + SIGTTOU Signal = "SIGTTOU" + SIGURG Signal = "SIGURG" + SIGUSR1 Signal = "SIGUSR1" + SIGUSR2 Signal = "SIGUSR2" + SIGVTALRM Signal = "SIGVTALRM" + SIGWINCH Signal = "SIGWINCH" + SIGXCPU Signal = "SIGXCPU" + SIGXFSZ Signal = "SIGXFSZ" + SIGRTMIN Signal = "SIGRTMIN" + SIGRTMINPLUS1 Signal = "SIGRTMIN+1" + SIGRTMINPLUS2 Signal = "SIGRTMIN+2" + SIGRTMINPLUS3 Signal = "SIGRTMIN+3" + SIGRTMINPLUS4 Signal = "SIGRTMIN+4" + SIGRTMINPLUS5 Signal = "SIGRTMIN+5" + SIGRTMINPLUS6 Signal = "SIGRTMIN+6" + SIGRTMINPLUS7 Signal = "SIGRTMIN+7" + SIGRTMINPLUS8 Signal = "SIGRTMIN+8" + SIGRTMINPLUS9 Signal = "SIGRTMIN+9" + SIGRTMINPLUS10 Signal = "SIGRTMIN+10" + SIGRTMINPLUS11 Signal = "SIGRTMIN+11" + SIGRTMINPLUS12 Signal = "SIGRTMIN+12" + SIGRTMINPLUS13 Signal = "SIGRTMIN+13" + SIGRTMINPLUS14 Signal = "SIGRTMIN+14" + SIGRTMINPLUS15 Signal = "SIGRTMIN+15" + SIGRTMAXMINUS14 Signal = "SIGRTMAX-14" + SIGRTMAXMINUS13 Signal = "SIGRTMAX-13" + SIGRTMAXMINUS12 Signal = "SIGRTMAX-12" + SIGRTMAXMINUS11 Signal = "SIGRTMAX-11" + SIGRTMAXMINUS10 Signal = "SIGRTMAX-10" + SIGRTMAXMINUS9 Signal = "SIGRTMAX-9" + SIGRTMAXMINUS8 Signal = "SIGRTMAX-8" + SIGRTMAXMINUS7 Signal = "SIGRTMAX-7" + SIGRTMAXMINUS6 Signal = "SIGRTMAX-6" + SIGRTMAXMINUS5 Signal = "SIGRTMAX-5" + SIGRTMAXMINUS4 Signal = "SIGRTMAX-4" + SIGRTMAXMINUS3 Signal = "SIGRTMAX-3" + SIGRTMAXMINUS2 Signal = "SIGRTMAX-2" + SIGRTMAXMINUS1 Signal = "SIGRTMAX-1" + SIGRTMAX Signal = "SIGRTMAX" +) + // Lifecycle describes actions that the management system should take in response to container lifecycle // events. For the PostStart and PreStop lifecycle handlers, management of the container blocks // until the action is complete, unless the container process fails, in which case the handler is aborted. @@ -2695,6 +2765,11 @@ type Lifecycle struct { // More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks // +optional PreStop *LifecycleHandler + // StopSignal defines which signal will be sent to a container when it is being stopped. + // If not specified, the default is defined by the container runtime in use. + // StopSignal can only be set for Pods with a non-empty .spec.os.name + // +optional + StopSignal *Signal } // The below types are used by kube_client and api_server. @@ -2833,6 +2908,12 @@ type ContainerStatus struct { // +featureGate=ResourceHealthStatus // +optional AllocatedResourcesStatus []ResourceStatus + // StopSignal is the signal which will be sent to this container when it is stopped. This might be + // the stop signal specified by the user, the signal specified in the container image, or the default + // stop signal of the container runtime on this node. + // +featureGate=ContainerStopSignals + // +optional + StopSignal *Signal } type ResourceStatus struct { @@ -2953,12 +3034,26 @@ const ( // DisruptionTarget indicates the pod is about to be terminated due to a // disruption (such as preemption, eviction API or garbage-collection). DisruptionTarget PodConditionType = "DisruptionTarget" + // PodResizePending indicates that the pod has been resized, but kubelet has not + // yet allocated the resources. If both PodResizePending and PodResizeInProgress + // are set, it means that a new resize was requested in the middle of a previous + // pod resize that is still in progress. + PodResizePending PodConditionType = "PodResizePending" + // PodResizeInProgress indicates that a resize is in progress, and is present whenever + // the Kubelet has allocated resources for the resize, but has not yet actuated all of + // the required changes. + // If both PodResizePending and PodResizeInProgress are set, it means that a new resize was + // requested in the middle of a previous pod resize that is still in progress. + PodResizeInProgress PodConditionType = "PodResizeInProgress" ) // PodCondition represents pod's condition type PodCondition struct { - Type PodConditionType - Status ConditionStatus + Type PodConditionType + // +featureGate=PodObservedGenerationTracking + // +optional + ObservedGeneration int64 + Status ConditionStatus // +optional LastProbeTime metav1.Time // +optional @@ -2969,12 +3064,10 @@ type PodCondition struct { Message string } -// PodResizeStatus shows status of desired resize of a pod's containers. +// Deprecated: PodResizeStatus shows status of desired resize of a pod's containers. type PodResizeStatus string const ( - // Pod resources resize has been requested and will be evaluated by node. - PodResizeStatusProposed PodResizeStatus = "Proposed" // Pod resources resize has been accepted by node and is being actuated. PodResizeStatusInProgress PodResizeStatus = "InProgress" // Node cannot resize the pod at this time and will keep retrying. @@ -3258,7 +3351,6 @@ type PodAffinityTerm struct { // pod labels will be ignored. The default value is empty. // The same key is forbidden to exist in both matchLabelKeys and labelSelector. // Also, matchLabelKeys cannot be set when labelSelector isn't set. - // This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). // // +listType=atomic // +optional @@ -3271,7 +3363,6 @@ type PodAffinityTerm struct { // pod labels will be ignored. The default value is empty. // The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. // Also, mismatchLabelKeys cannot be set when labelSelector isn't set. - // This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). // // +listType=atomic // +optional @@ -3959,7 +4050,7 @@ type AppArmorProfile struct { // Localhost - a profile pre-loaded on the node. // RuntimeDefault - the container runtime's default profile. // Unconfined - no AppArmor enforcement. - // +unionDescriminator + // +unionDiscriminator Type AppArmorProfileType // localhostProfile indicates a profile loaded on the node that should be used. @@ -4166,6 +4257,11 @@ type EphemeralContainer struct { // PodStatus represents information about the status of a pod. Status may trail the actual // state of a system. type PodStatus struct { + // If set, this represents the .metadata.generation that the pod status was set based upon. + // This is an alpha field. Enable PodObservedGenerationTracking to be able to use this field. + // +featureGate=PodObservedGenerationTracking + // +optional + ObservedGeneration int64 // +optional Phase PodPhase // +optional @@ -4247,6 +4343,9 @@ type PodStatus struct { // Status of resources resize desired for pod's containers. // It is empty if no resources resize is pending. // Any changes to container resources will automatically set this to "Proposed" + // Deprecated: Resize status is moved to two pod conditions PodResizePending and PodResizeInProgress. + // PodResizePending will track states where the spec has been resized, but the Kubelet has not yet allocated the resources. + // PodResizeInProgress will track in-progress resizes, and should be present whenever allocated resources != acknowledged resources. // +featureGate=InPlacePodVerticalScaling // +optional Resize PodResizeStatus @@ -4328,7 +4427,7 @@ type PodTemplateList struct { // a TemplateRef or a Template set. type ReplicationControllerSpec struct { // Replicas is the number of desired replicas. - Replicas int32 + Replicas *int32 // 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. @@ -4544,14 +4643,27 @@ const ( // These are valid values for the TrafficDistribution field of a Service. const ( - // Indicates a preference for routing traffic to endpoints that are - // topologically proximate to the client. The interpretation of "topologically - // proximate" may vary across implementations and could encompass endpoints - // within the same node, rack, zone, or even region. Setting this value gives - // implementations permission to make different tradeoffs, e.g. optimizing for - // proximity rather than equal distribution of load. Users should not set this - // value if such tradeoffs are not acceptable. + // Indicates a preference for routing traffic to endpoints that are in the same + // zone as the client. Users should not set this value unless they have ensured + // that clients and endpoints are distributed in such a way that the "same zone" + // preference will not result in endpoints getting overloaded. ServiceTrafficDistributionPreferClose = "PreferClose" + + // Indicates a preference for routing traffic to endpoints that are in the same + // zone as the client. Users should not set this value unless they have ensured + // that clients and endpoints are distributed in such a way that the "same zone" + // preference will not result in endpoints getting overloaded. + // This is an alias for "PreferClose", but it is an Alpha feature and is only + // recognized if the PreferSameTrafficDistribution feature gate is enabled. + ServiceTrafficDistributionPreferSameZone = "PreferSameZone" + + // Indicates a preference for routing traffic to endpoints that are on the same + // node as the client. Users should not set this value unless they have ensured + // that clients and endpoints are distributed in such a way that the "same node" + // preference will not result in endpoints getting overloaded. + // This is an Alpha feature and is only recognized if the + // PreferSameTrafficDistribution feature gate is enabled. + ServiceTrafficDistributionPreferSameNode = "PreferSameNode" ) // These are the valid conditions of a service. @@ -4818,12 +4930,12 @@ type ServiceSpec struct { // +optional InternalTrafficPolicy *ServiceInternalTrafficPolicy - // TrafficDistribution offers a way to express preferences for how traffic is - // distributed to Service endpoints. Implementations can use this field as a - // hint, but are not required to guarantee strict adherence. If the field is - // not set, the implementation will apply its default routing strategy. If set - // to "PreferClose", implementations should prioritize endpoints that are - // topologically close (e.g., same zone). + // TrafficDistribution offers a way to express preferences for how traffic + // is distributed to Service endpoints. Implementations can use this field + // as a hint, but are not required to guarantee strict adherence. If the + // field is not set, the implementation will apply its default routing + // strategy. If set to "PreferClose", implementations should prioritize + // endpoints that are in the same zone. // +optional TrafficDistribution *string } @@ -5174,6 +5286,15 @@ type NodeSystemInfo struct { OperatingSystem string // The Architecture reported by the node Architecture string + // Swap Info reported by the node. + Swap *NodeSwapStatus +} + +// NodeSwapStatus represents swap memory information. +type NodeSwapStatus struct { + // Total amount of swap memory in bytes. + // +optional + Capacity *int64 } // NodeConfigStatus describes the status of the config assigned by Node.Spec.ConfigSource. @@ -6046,6 +6167,9 @@ const ( ResourceQuotaScopePriorityClass ResourceQuotaScope = "PriorityClass" // Match all pod objects that have cross-namespace pod (anti)affinity mentioned ResourceQuotaScopeCrossNamespacePodAffinity ResourceQuotaScope = "CrossNamespacePodAffinity" + + // Match all pvc objects that have volume attributes class mentioned. + ResourceQuotaScopeVolumeAttributesClass ResourceQuotaScope = "VolumeAttributesClass" ) // ResourceQuotaSpec defines the desired hard limits to enforce for Quota @@ -6682,7 +6806,6 @@ type TopologySpreadConstraint struct { // - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations. // // If this value is nil, the behavior is equivalent to the Honor policy. - // This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. // +optional NodeAffinityPolicy *NodeInclusionPolicy // NodeTaintsPolicy indicates how we will treat node taints when calculating @@ -6692,7 +6815,6 @@ type TopologySpreadConstraint struct { // - Ignore: node taints are ignored. All nodes are included. // // If this value is nil, the behavior is equivalent to the Ignore policy. - // This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag. // +optional NodeTaintsPolicy *NodeInclusionPolicy // MatchLabelKeys is a set of pod label keys to select the pods over which diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/conversion.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/conversion.go index 2ec47908e..06a916fe6 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/conversion.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/conversion.go @@ -199,7 +199,9 @@ func Convert_apps_ReplicaSetStatus_To_v1_ReplicationControllerStatus(in *apps.Re } func Convert_core_ReplicationControllerSpec_To_v1_ReplicationControllerSpec(in *core.ReplicationControllerSpec, out *v1.ReplicationControllerSpec, s conversion.Scope) error { - out.Replicas = &in.Replicas + if err := autoConvert_core_ReplicationControllerSpec_To_v1_ReplicationControllerSpec(in, out, s); err != nil { + return err + } out.MinReadySeconds = in.MinReadySeconds out.Selector = in.Selector if in.Template != nil { @@ -214,8 +216,8 @@ func Convert_core_ReplicationControllerSpec_To_v1_ReplicationControllerSpec(in * } func Convert_v1_ReplicationControllerSpec_To_core_ReplicationControllerSpec(in *v1.ReplicationControllerSpec, out *core.ReplicationControllerSpec, s conversion.Scope) error { - if in.Replicas != nil { - out.Replicas = *in.Replicas + if err := autoConvert_v1_ReplicationControllerSpec_To_core_ReplicationControllerSpec(in, out, s); err != nil { + return err } out.MinReadySeconds = in.MinReadySeconds out.Selector = in.Selector diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/defaults.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/defaults.go index a058c5f7c..fc6a6ad25 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/defaults.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/defaults.go @@ -27,6 +27,7 @@ import ( utilfeature "k8s.io/apiserver/pkg/util/feature" resourcehelper "k8s.io/component-helpers/resource" "k8s.io/kubernetes/pkg/api/v1/service" + corev1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/util/parsers" ) @@ -60,10 +61,7 @@ func SetDefaults_ReplicationController(obj *v1.ReplicationController) { obj.Labels = labels } } - if obj.Spec.Replicas == nil { - obj.Spec.Replicas = new(int32) - *obj.Spec.Replicas = 1 - } + // obj.Spec.Replicas is defaulted declaratively } func SetDefaults_Volume(obj *v1.Volume) { if ptr.AllPtrFieldsNil(&obj.VolumeSource) { @@ -182,29 +180,6 @@ func SetDefaults_Pod(obj *v1.Pod) { } } } - if utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling) && - obj.Spec.Containers[i].Resources.Requests != nil { - // For normal containers, set resize restart policy to default value (NotRequired), if not specified. - resizePolicySpecified := make(map[v1.ResourceName]bool) - for _, p := range obj.Spec.Containers[i].ResizePolicy { - resizePolicySpecified[p.ResourceName] = true - } - setDefaultResizePolicy := func(resourceName v1.ResourceName) { - if _, found := resizePolicySpecified[resourceName]; !found { - obj.Spec.Containers[i].ResizePolicy = append(obj.Spec.Containers[i].ResizePolicy, - v1.ContainerResizePolicy{ - ResourceName: resourceName, - RestartPolicy: v1.NotRequired, - }) - } - } - if _, exists := obj.Spec.Containers[i].Resources.Requests[v1.ResourceCPU]; exists { - setDefaultResizePolicy(v1.ResourceCPU) - } - if _, exists := obj.Spec.Containers[i].Resources.Requests[v1.ResourceMemory]; exists { - setDefaultResizePolicy(v1.ResourceMemory) - } - } } for i := range obj.Spec.InitContainers { if obj.Spec.InitContainers[i].Resources.Limits != nil { @@ -222,6 +197,7 @@ func SetDefaults_Pod(obj *v1.Pod) { // Pod Requests default values must be applied after container-level default values // have been populated. if utilfeature.DefaultFeatureGate.Enabled(features.PodLevelResources) { + defaultHugePagePodLimits(obj) defaultPodRequests(obj) } @@ -479,7 +455,9 @@ func defaultPodRequests(obj *v1.Pod) { // PodLevelResources feature) and pod-level requests are not set, the pod-level requests // default to the effective requests of all the containers for that resource. for key, aggrCtrLim := range aggrCtrReqs { - if _, exists := podReqs[key]; !exists && resourcehelper.IsSupportedPodLevelResource(key) { + // Defaulting for pod level hugepages requests takes them directly from the pod limit, + // hugepages cannot be overcommited and must have the limit, so we skip them here. + if _, exists := podReqs[key]; !exists && resourcehelper.IsSupportedPodLevelResource(key) && !corev1helper.IsHugePageResourceName(key) { podReqs[key] = aggrCtrLim.DeepCopy() } } @@ -487,6 +465,8 @@ func defaultPodRequests(obj *v1.Pod) { // When no containers specify requests for a resource, the pod-level requests // will default to match the pod-level limits, if pod-level // limits exist for that resource. + // Defaulting for pod level hugepages requests is dependent on defaultHugePagePodLimits, + // if defaultHugePagePodLimits defined the limit, the request will be set here. for key, podLim := range obj.Spec.Resources.Limits { if _, exists := podReqs[key]; !exists && resourcehelper.IsSupportedPodLevelResource(key) { podReqs[key] = podLim.DeepCopy() @@ -499,3 +479,44 @@ func defaultPodRequests(obj *v1.Pod) { obj.Spec.Resources.Requests = podReqs } } + +// defaultHugePagePodLimits applies default values for pod-level limits, only when +// container hugepage limits are set, but not at pod level, in following +// scenario: +// 1. When at least one container (regular, init or sidecar) has hugepage +// limits set: +// The pod-level limit becomes equal to the aggregated hugepages limit of all +// the containers in the pod. +func defaultHugePagePodLimits(obj *v1.Pod) { + // We only populate defaults when the pod-level resources are partly specified already. + if obj.Spec.Resources == nil { + return + } + + if len(obj.Spec.Resources.Limits) == 0 && len(obj.Spec.Resources.Requests) == 0 { + return + } + + var podLims v1.ResourceList + podLims = obj.Spec.Resources.Limits + if podLims == nil { + podLims = make(v1.ResourceList) + } + + aggrCtrLims := resourcehelper.AggregateContainerLimits(obj, resourcehelper.PodResourcesOptions{}) + + // When containers specify limits for hugepages and pod-level limits are not + // set for that resource, the pod-level limit will default to the aggregated + // hugepages limit of all the containers. + for key, aggrCtrLim := range aggrCtrLims { + if _, exists := podLims[key]; !exists && resourcehelper.IsSupportedPodLevelResource(key) && corev1helper.IsHugePageResourceName(key) { + podLims[key] = aggrCtrLim.DeepCopy() + } + } + + // Only set pod-level resource limits in the PodSpec if the requirements map + // contains entries after collecting container-level limits and pod-level limits for hugepages. + if len(podLims) > 0 { + obj.Spec.Resources.Limits = podLims + } +} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/doc.go index 2dc9f4c50..879079662 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/doc.go @@ -18,6 +18,8 @@ limitations under the License. // +k8s:conversion-gen-external-types=k8s.io/api/core/v1 // +k8s:defaulter-gen=TypeMeta // +k8s:defaulter-gen-input=k8s.io/api/core/v1 +// +k8s:validation-gen=TypeMeta +// +k8s:validation-gen-input=k8s.io/api/core/v1 // Package v1 is the v1 version of the API. -package v1 // import "k8s.io/kubernetes/pkg/apis/core/v1" +package v1 diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.conversion.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.conversion.go index 6a842771a..d8baad0bd 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.conversion.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.conversion.go @@ -1162,6 +1162,16 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*corev1.NodeSwapStatus)(nil), (*core.NodeSwapStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_NodeSwapStatus_To_core_NodeSwapStatus(a.(*corev1.NodeSwapStatus), b.(*core.NodeSwapStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*core.NodeSwapStatus)(nil), (*corev1.NodeSwapStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_core_NodeSwapStatus_To_v1_NodeSwapStatus(a.(*core.NodeSwapStatus), b.(*corev1.NodeSwapStatus), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*corev1.NodeSystemInfo)(nil), (*core.NodeSystemInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_NodeSystemInfo_To_core_NodeSystemInfo(a.(*corev1.NodeSystemInfo), b.(*core.NodeSystemInfo), scope) }); err != nil { @@ -3405,6 +3415,7 @@ func autoConvert_v1_ContainerStatus_To_core_ContainerStatus(in *corev1.Container out.VolumeMounts = *(*[]core.VolumeMountStatus)(unsafe.Pointer(&in.VolumeMounts)) out.User = (*core.ContainerUser)(unsafe.Pointer(in.User)) out.AllocatedResourcesStatus = *(*[]core.ResourceStatus)(unsafe.Pointer(&in.AllocatedResourcesStatus)) + out.StopSignal = (*core.Signal)(unsafe.Pointer(in.StopSignal)) return nil } @@ -3432,6 +3443,7 @@ func autoConvert_core_ContainerStatus_To_v1_ContainerStatus(in *core.ContainerSt out.VolumeMounts = *(*[]corev1.VolumeMountStatus)(unsafe.Pointer(&in.VolumeMounts)) out.User = (*corev1.ContainerUser)(unsafe.Pointer(in.User)) out.AllocatedResourcesStatus = *(*[]corev1.ResourceStatus)(unsafe.Pointer(&in.AllocatedResourcesStatus)) + out.StopSignal = (*corev1.Signal)(unsafe.Pointer(in.StopSignal)) return nil } @@ -4493,6 +4505,7 @@ func Convert_core_KeyToPath_To_v1_KeyToPath(in *core.KeyToPath, out *corev1.KeyT func autoConvert_v1_Lifecycle_To_core_Lifecycle(in *corev1.Lifecycle, out *core.Lifecycle, s conversion.Scope) error { out.PostStart = (*core.LifecycleHandler)(unsafe.Pointer(in.PostStart)) out.PreStop = (*core.LifecycleHandler)(unsafe.Pointer(in.PreStop)) + out.StopSignal = (*core.Signal)(unsafe.Pointer(in.StopSignal)) return nil } @@ -4504,6 +4517,7 @@ func Convert_v1_Lifecycle_To_core_Lifecycle(in *corev1.Lifecycle, out *core.Life func autoConvert_core_Lifecycle_To_v1_Lifecycle(in *core.Lifecycle, out *corev1.Lifecycle, s conversion.Scope) error { out.PostStart = (*corev1.LifecycleHandler)(unsafe.Pointer(in.PostStart)) out.PreStop = (*corev1.LifecycleHandler)(unsafe.Pointer(in.PreStop)) + out.StopSignal = (*corev1.Signal)(unsafe.Pointer(in.StopSignal)) return nil } @@ -5419,6 +5433,26 @@ func Convert_core_NodeStatus_To_v1_NodeStatus(in *core.NodeStatus, out *corev1.N return autoConvert_core_NodeStatus_To_v1_NodeStatus(in, out, s) } +func autoConvert_v1_NodeSwapStatus_To_core_NodeSwapStatus(in *corev1.NodeSwapStatus, out *core.NodeSwapStatus, s conversion.Scope) error { + out.Capacity = (*int64)(unsafe.Pointer(in.Capacity)) + return nil +} + +// Convert_v1_NodeSwapStatus_To_core_NodeSwapStatus is an autogenerated conversion function. +func Convert_v1_NodeSwapStatus_To_core_NodeSwapStatus(in *corev1.NodeSwapStatus, out *core.NodeSwapStatus, s conversion.Scope) error { + return autoConvert_v1_NodeSwapStatus_To_core_NodeSwapStatus(in, out, s) +} + +func autoConvert_core_NodeSwapStatus_To_v1_NodeSwapStatus(in *core.NodeSwapStatus, out *corev1.NodeSwapStatus, s conversion.Scope) error { + out.Capacity = (*int64)(unsafe.Pointer(in.Capacity)) + return nil +} + +// Convert_core_NodeSwapStatus_To_v1_NodeSwapStatus is an autogenerated conversion function. +func Convert_core_NodeSwapStatus_To_v1_NodeSwapStatus(in *core.NodeSwapStatus, out *corev1.NodeSwapStatus, s conversion.Scope) error { + return autoConvert_core_NodeSwapStatus_To_v1_NodeSwapStatus(in, out, s) +} + func autoConvert_v1_NodeSystemInfo_To_core_NodeSystemInfo(in *corev1.NodeSystemInfo, out *core.NodeSystemInfo, s conversion.Scope) error { out.MachineID = in.MachineID out.SystemUUID = in.SystemUUID @@ -5430,6 +5464,7 @@ func autoConvert_v1_NodeSystemInfo_To_core_NodeSystemInfo(in *corev1.NodeSystemI out.KubeProxyVersion = in.KubeProxyVersion out.OperatingSystem = in.OperatingSystem out.Architecture = in.Architecture + out.Swap = (*core.NodeSwapStatus)(unsafe.Pointer(in.Swap)) return nil } @@ -5449,6 +5484,7 @@ func autoConvert_core_NodeSystemInfo_To_v1_NodeSystemInfo(in *core.NodeSystemInf out.KubeProxyVersion = in.KubeProxyVersion out.OperatingSystem = in.OperatingSystem out.Architecture = in.Architecture + out.Swap = (*corev1.NodeSwapStatus)(unsafe.Pointer(in.Swap)) return nil } @@ -6105,6 +6141,7 @@ func Convert_url_Values_To_v1_PodAttachOptions(in *url.Values, out *corev1.PodAt func autoConvert_v1_PodCondition_To_core_PodCondition(in *corev1.PodCondition, out *core.PodCondition, s conversion.Scope) error { out.Type = core.PodConditionType(in.Type) + out.ObservedGeneration = in.ObservedGeneration out.Status = core.ConditionStatus(in.Status) out.LastProbeTime = in.LastProbeTime out.LastTransitionTime = in.LastTransitionTime @@ -6120,6 +6157,7 @@ func Convert_v1_PodCondition_To_core_PodCondition(in *corev1.PodCondition, out * func autoConvert_core_PodCondition_To_v1_PodCondition(in *core.PodCondition, out *corev1.PodCondition, s conversion.Scope) error { out.Type = corev1.PodConditionType(in.Type) + out.ObservedGeneration = in.ObservedGeneration out.Status = corev1.ConditionStatus(in.Status) out.LastProbeTime = in.LastProbeTime out.LastTransitionTime = in.LastTransitionTime @@ -6811,6 +6849,7 @@ func autoConvert_core_PodSpec_To_v1_PodSpec(in *core.PodSpec, out *corev1.PodSpe } func autoConvert_v1_PodStatus_To_core_PodStatus(in *corev1.PodStatus, out *core.PodStatus, s conversion.Scope) error { + out.ObservedGeneration = in.ObservedGeneration out.Phase = core.PodPhase(in.Phase) out.Conditions = *(*[]core.PodCondition)(unsafe.Pointer(&in.Conditions)) out.Message = in.Message @@ -6831,6 +6870,7 @@ func autoConvert_v1_PodStatus_To_core_PodStatus(in *corev1.PodStatus, out *core. } func autoConvert_core_PodStatus_To_v1_PodStatus(in *core.PodStatus, out *corev1.PodStatus, s conversion.Scope) error { + out.ObservedGeneration = in.ObservedGeneration out.Phase = corev1.PodPhase(in.Phase) out.Conditions = *(*[]corev1.PodCondition)(unsafe.Pointer(&in.Conditions)) out.Message = in.Message @@ -7412,9 +7452,7 @@ func Convert_core_ReplicationControllerList_To_v1_ReplicationControllerList(in * } func autoConvert_v1_ReplicationControllerSpec_To_core_ReplicationControllerSpec(in *corev1.ReplicationControllerSpec, out *core.ReplicationControllerSpec, s conversion.Scope) error { - if err := metav1.Convert_Pointer_int32_To_int32(&in.Replicas, &out.Replicas, s); err != nil { - return err - } + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) out.MinReadySeconds = in.MinReadySeconds out.Selector = *(*map[string]string)(unsafe.Pointer(&in.Selector)) if in.Template != nil { @@ -7430,9 +7468,7 @@ func autoConvert_v1_ReplicationControllerSpec_To_core_ReplicationControllerSpec( } func autoConvert_core_ReplicationControllerSpec_To_v1_ReplicationControllerSpec(in *core.ReplicationControllerSpec, out *corev1.ReplicationControllerSpec, s conversion.Scope) error { - if err := metav1.Convert_int32_To_Pointer_int32(&in.Replicas, &out.Replicas, s); err != nil { - return err - } + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) out.MinReadySeconds = in.MinReadySeconds out.Selector = *(*map[string]string)(unsafe.Pointer(&in.Selector)) if in.Template != nil { diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.defaults.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.defaults.go index 3b6eb4f0a..567c49053 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.defaults.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.defaults.go @@ -878,6 +878,10 @@ func SetObjectDefaults_PodTemplateList(in *corev1.PodTemplateList) { func SetObjectDefaults_ReplicationController(in *corev1.ReplicationController) { SetDefaults_ReplicationController(in) + if in.Spec.Replicas == nil { + var ptrVar1 int32 = 1 + in.Spec.Replicas = &ptrVar1 + } if in.Spec.Template != nil { SetDefaults_PodSpec(&in.Spec.Template.Spec) for i := range in.Spec.Template.Spec.Volumes { diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.validations.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.validations.go new file mode 100644 index 000000000..7e3701c1a --- /dev/null +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/v1/zz_generated.validations.go @@ -0,0 +1,112 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by validation-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + fmt "fmt" + + corev1 "k8s.io/api/core/v1" + operation "k8s.io/apimachinery/pkg/api/operation" + safe "k8s.io/apimachinery/pkg/api/safe" + validate "k8s.io/apimachinery/pkg/api/validate" + runtime "k8s.io/apimachinery/pkg/runtime" + field "k8s.io/apimachinery/pkg/util/validation/field" +) + +func init() { localSchemeBuilder.Register(RegisterValidations) } + +// RegisterValidations adds validation functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterValidations(scheme *runtime.Scheme) error { + scheme.AddValidationFunc((*corev1.ReplicationController)(nil), func(ctx context.Context, op operation.Operation, obj, oldObj interface{}, subresources ...string) field.ErrorList { + if len(subresources) == 0 { + return Validate_ReplicationController(ctx, op, nil /* fldPath */, obj.(*corev1.ReplicationController), safe.Cast[*corev1.ReplicationController](oldObj)) + } + if len(subresources) == 1 && subresources[0] == "status" { + return nil // corev1.ReplicationControllerStatus has no validation + } + return field.ErrorList{field.InternalError(nil, fmt.Errorf("no validation found for %T, subresources: %v", obj, subresources))} + }) + scheme.AddValidationFunc((*corev1.ReplicationControllerList)(nil), func(ctx context.Context, op operation.Operation, obj, oldObj interface{}, subresources ...string) field.ErrorList { + if len(subresources) == 0 { + return Validate_ReplicationControllerList(ctx, op, nil /* fldPath */, obj.(*corev1.ReplicationControllerList), safe.Cast[*corev1.ReplicationControllerList](oldObj)) + } + return field.ErrorList{field.InternalError(nil, fmt.Errorf("no validation found for %T, subresources: %v", obj, subresources))} + }) + return nil +} + +func Validate_ReplicationController(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *corev1.ReplicationController) (errs field.ErrorList) { + // field corev1.ReplicationController.TypeMeta has no validation + // field corev1.ReplicationController.ObjectMeta has no validation + + // field corev1.ReplicationController.Spec + errs = append(errs, + func(fldPath *field.Path, obj, oldObj *corev1.ReplicationControllerSpec) (errs field.ErrorList) { + errs = append(errs, Validate_ReplicationControllerSpec(ctx, op, fldPath, obj, oldObj)...) + return + }(fldPath.Child("spec"), &obj.Spec, safe.Field(oldObj, func(oldObj *corev1.ReplicationController) *corev1.ReplicationControllerSpec { return &oldObj.Spec }))...) + + // field corev1.ReplicationController.Status has no validation + return errs +} + +func Validate_ReplicationControllerList(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *corev1.ReplicationControllerList) (errs field.ErrorList) { + // field corev1.ReplicationControllerList.TypeMeta has no validation + // field corev1.ReplicationControllerList.ListMeta has no validation + + // field corev1.ReplicationControllerList.Items + errs = append(errs, + func(fldPath *field.Path, obj, oldObj []corev1.ReplicationController) (errs field.ErrorList) { + errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, nil, Validate_ReplicationController)...) + return + }(fldPath.Child("items"), obj.Items, safe.Field(oldObj, func(oldObj *corev1.ReplicationControllerList) []corev1.ReplicationController { return oldObj.Items }))...) + + return errs +} + +func Validate_ReplicationControllerSpec(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *corev1.ReplicationControllerSpec) (errs field.ErrorList) { + // field corev1.ReplicationControllerSpec.Replicas + errs = append(errs, + func(fldPath *field.Path, obj, oldObj *int32) (errs field.ErrorList) { + // optional fields with default values are effectively required + if e := validate.RequiredPointer(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + return // do not proceed + } + errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0)...) + return + }(fldPath.Child("replicas"), obj.Replicas, safe.Field(oldObj, func(oldObj *corev1.ReplicationControllerSpec) *int32 { return oldObj.Replicas }))...) + + // field corev1.ReplicationControllerSpec.MinReadySeconds + errs = append(errs, + func(fldPath *field.Path, obj, oldObj *int32) (errs field.ErrorList) { + // optional value-type fields with zero-value defaults are purely documentation + errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0)...) + return + }(fldPath.Child("minReadySeconds"), &obj.MinReadySeconds, safe.Field(oldObj, func(oldObj *corev1.ReplicationControllerSpec) *int32 { return &oldObj.MinReadySeconds }))...) + + // field corev1.ReplicationControllerSpec.Selector has no validation + // field corev1.ReplicationControllerSpec.Template has no validation + return errs +} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/validation/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/validation/doc.go index 0c1cfaab5..f17a15cf9 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/validation/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/validation/doc.go @@ -16,4 +16,4 @@ limitations under the License. // Package validation has functions for validating the correctness of api // objects and explaining what is wrong with them when they aren't valid. -package validation // import "k8s.io/kubernetes/pkg/apis/core/validation" +package validation diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/validation/validation.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/validation/validation.go index 694896ee7..fa96a7232 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/validation/validation.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/validation/validation.go @@ -25,12 +25,13 @@ import ( "path/filepath" "reflect" "regexp" + "slices" "strings" "sync" "unicode" "unicode/utf8" - "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp" //nolint:depguard netutils "k8s.io/utils/net" v1 "k8s.io/api/core/v1" @@ -58,7 +59,6 @@ import ( podshelper "k8s.io/kubernetes/pkg/apis/core/pods" corev1 "k8s.io/kubernetes/pkg/apis/core/v1" "k8s.io/kubernetes/pkg/capabilities" - "k8s.io/kubernetes/pkg/cluster/ports" "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/fieldpath" ) @@ -134,7 +134,7 @@ func ValidateAnnotations(annotations map[string]string, fldPath *field.Path) fie func ValidateDNS1123Label(value string, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} for _, msg := range validation.IsDNS1123Label(value) { - allErrs = append(allErrs, field.Invalid(fldPath, value, msg)) + allErrs = append(allErrs, field.Invalid(fldPath, value, msg).WithOrigin("format=dns-label")) } return allErrs } @@ -143,7 +143,7 @@ func ValidateDNS1123Label(value string, fldPath *field.Path) field.ErrorList { func ValidateQualifiedName(value string, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} for _, msg := range validation.IsQualifiedName(value) { - allErrs = append(allErrs, field.Invalid(fldPath, value, msg)) + allErrs = append(allErrs, field.Invalid(fldPath, value, msg).WithOrigin("format=qualified-name")) } return allErrs } @@ -351,6 +351,15 @@ func ValidateNonnegativeQuantity(value resource.Quantity, fldPath *field.Path) f return allErrs } +// Validates that given value is positive. +func ValidatePositiveField(value int64, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + if value <= 0 { + allErrs = append(allErrs, field.Invalid(fldPath, value, isNotPositiveErrorMsg).WithOrigin("minimum")) + } + return allErrs +} + // Validates that a Quantity is positive func ValidatePositiveQuantityValue(value resource.Quantity, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} @@ -1777,6 +1786,8 @@ var allowedTemplateObjectMetaFields = map[string]bool{ type PersistentVolumeSpecValidationOptions struct { // Allow users to modify the class of volume attributes EnableVolumeAttributesClass bool + // Allow invalid label-value in RequiredNodeSelector + AllowInvalidLabelValueInRequiredNodeAffinity bool } // ValidatePersistentVolumeName checks that a name is appropriate for a @@ -1798,11 +1809,17 @@ var supportedVolumeModes = sets.New(core.PersistentVolumeBlock, core.PersistentV func ValidationOptionsForPersistentVolume(pv, oldPv *core.PersistentVolume) PersistentVolumeSpecValidationOptions { opts := PersistentVolumeSpecValidationOptions{ - EnableVolumeAttributesClass: utilfeature.DefaultMutableFeatureGate.Enabled(features.VolumeAttributesClass), + EnableVolumeAttributesClass: utilfeature.DefaultMutableFeatureGate.Enabled(features.VolumeAttributesClass), + AllowInvalidLabelValueInRequiredNodeAffinity: false, } if oldPv != nil && oldPv.Spec.VolumeAttributesClassName != nil { opts.EnableVolumeAttributesClass = true } + if oldPv != nil && oldPv.Spec.NodeAffinity != nil && + oldPv.Spec.NodeAffinity.Required != nil { + terms := oldPv.Spec.NodeAffinity.Required.NodeSelectorTerms + opts.AllowInvalidLabelValueInRequiredNodeAffinity = helper.HasInvalidLabelValueInNodeSelectorTerms(terms) + } return opts } @@ -1874,7 +1891,7 @@ func ValidatePersistentVolumeSpec(pvSpec *core.PersistentVolumeSpec, pvName stri if validateInlinePersistentVolumeSpec { allErrs = append(allErrs, field.Forbidden(fldPath.Child("nodeAffinity"), "may not be specified in the context of inline volumes")) } else { - nodeAffinitySpecified, errs = validateVolumeNodeAffinity(pvSpec.NodeAffinity, fldPath.Child("nodeAffinity")) + nodeAffinitySpecified, errs = validateVolumeNodeAffinity(pvSpec.NodeAffinity, opts, fldPath.Child("nodeAffinity")) allErrs = append(allErrs, errs...) } } @@ -2930,16 +2947,6 @@ func ValidateVolumeMounts(mounts []core.VolumeMount, voldevices map[string]strin allErrs = append(allErrs, field.Invalid(idxPath.Child("mountPath"), mnt.MountPath, "must not already exist as a path in volumeDevices")) } - // Disallow subPath/subPathExpr for image volumes - if v, ok := volumes[mnt.Name]; ok && v.Image != nil { - if len(mnt.SubPath) != 0 { - allErrs = append(allErrs, field.Invalid(idxPath.Child("subPath"), mnt.SubPath, "not allowed in image volume sources")) - } - if len(mnt.SubPathExpr) != 0 { - allErrs = append(allErrs, field.Invalid(idxPath.Child("subPathExpr"), mnt.SubPathExpr, "not allowed in image volume sources")) - } - } - if len(mnt.SubPath) > 0 { allErrs = append(allErrs, validateLocalDescendingPath(mnt.SubPath, fldPath.Child("subPath"))...) } @@ -3336,7 +3343,48 @@ func validateHandler(handler commonHandler, gracePeriod *int64, fldPath *field.P return allErrors } -func validateLifecycle(lifecycle *core.Lifecycle, gracePeriod *int64, fldPath *field.Path, opts PodValidationOptions) field.ErrorList { +var supportedStopSignalsLinux = sets.New( + core.SIGABRT, core.SIGALRM, core.SIGBUS, core.SIGCHLD, + core.SIGCLD, core.SIGCONT, core.SIGFPE, core.SIGHUP, + core.SIGILL, core.SIGINT, core.SIGIO, core.SIGIOT, + core.SIGKILL, core.SIGPIPE, core.SIGPOLL, core.SIGPROF, + core.SIGPWR, core.SIGQUIT, core.SIGSEGV, core.SIGSTKFLT, + core.SIGSTOP, core.SIGSYS, core.SIGTERM, core.SIGTRAP, + core.SIGTSTP, core.SIGTTIN, core.SIGTTOU, core.SIGURG, + core.SIGUSR1, core.SIGUSR2, core.SIGVTALRM, core.SIGWINCH, + core.SIGXCPU, core.SIGXFSZ, core.SIGRTMIN, core.SIGRTMINPLUS1, + core.SIGRTMINPLUS2, core.SIGRTMINPLUS3, core.SIGRTMINPLUS4, + core.SIGRTMINPLUS5, core.SIGRTMINPLUS6, core.SIGRTMINPLUS7, + core.SIGRTMINPLUS8, core.SIGRTMINPLUS9, core.SIGRTMINPLUS10, + core.SIGRTMINPLUS11, core.SIGRTMINPLUS12, core.SIGRTMINPLUS13, + core.SIGRTMINPLUS14, core.SIGRTMINPLUS15, core.SIGRTMAXMINUS14, + core.SIGRTMAXMINUS13, core.SIGRTMAXMINUS12, core.SIGRTMAXMINUS11, + core.SIGRTMAXMINUS10, core.SIGRTMAXMINUS9, core.SIGRTMAXMINUS8, + core.SIGRTMAXMINUS7, core.SIGRTMAXMINUS6, core.SIGRTMAXMINUS5, + core.SIGRTMAXMINUS4, core.SIGRTMAXMINUS3, core.SIGRTMAXMINUS2, + core.SIGRTMAXMINUS1, core.SIGRTMAX) + +var supportedStopSignalsWindows = sets.New(core.SIGKILL, core.SIGTERM) + +func validateStopSignal(stopSignal *core.Signal, fldPath *field.Path, os *core.PodOS) field.ErrorList { + allErrors := field.ErrorList{} + + if os == nil { + allErrors = append(allErrors, field.Forbidden(fldPath, "may not be set for containers with empty `spec.os.name`")) + } else if os.Name == core.Windows { + if !supportedStopSignalsWindows.Has(*stopSignal) { + allErrors = append(allErrors, field.NotSupported(fldPath, stopSignal, sets.List(supportedStopSignalsWindows))) + } + } else if os.Name == core.Linux { + if !supportedStopSignalsLinux.Has(*stopSignal) { + allErrors = append(allErrors, field.NotSupported(fldPath, stopSignal, sets.List(supportedStopSignalsLinux))) + } + } + + return allErrors +} + +func validateLifecycle(lifecycle *core.Lifecycle, gracePeriod *int64, fldPath *field.Path, opts PodValidationOptions, os *core.PodOS) field.ErrorList { allErrs := field.ErrorList{} if lifecycle.PostStart != nil { allErrs = append(allErrs, validateHandler(handlerFromLifecycle(lifecycle.PostStart), gracePeriod, fldPath.Child("postStart"), opts)...) @@ -3344,6 +3392,9 @@ func validateLifecycle(lifecycle *core.Lifecycle, gracePeriod *int64, fldPath *f if lifecycle.PreStop != nil { allErrs = append(allErrs, validateHandler(handlerFromLifecycle(lifecycle.PreStop), gracePeriod, fldPath.Child("preStop"), opts)...) } + if lifecycle.StopSignal != nil { + allErrs = append(allErrs, validateStopSignal(lifecycle.StopSignal, fldPath.Child("stopSignal"), os)...) + } return allErrs } @@ -3487,7 +3538,7 @@ func validateFieldAllowList(value interface{}, allowedFields map[string]bool, er } // validateInitContainers is called by pod spec and template validation to validate the list of init containers -func validateInitContainers(containers []core.Container, regularContainers []core.Container, volumes map[string]core.VolumeSource, podClaimNames sets.Set[string], gracePeriod *int64, fldPath *field.Path, opts PodValidationOptions, podRestartPolicy *core.RestartPolicy, hostUsers bool) field.ErrorList { +func validateInitContainers(containers []core.Container, os *core.PodOS, regularContainers []core.Container, volumes map[string]core.VolumeSource, podClaimNames sets.Set[string], gracePeriod *int64, fldPath *field.Path, opts PodValidationOptions, podRestartPolicy *core.RestartPolicy, hostUsers bool) field.ErrorList { var allErrs field.ErrorList allNames := sets.Set[string]{} @@ -3521,7 +3572,7 @@ func validateInitContainers(containers []core.Container, regularContainers []cor switch { case restartAlways: if ctr.Lifecycle != nil { - allErrs = append(allErrs, validateLifecycle(ctr.Lifecycle, gracePeriod, idxPath.Child("lifecycle"), opts)...) + allErrs = append(allErrs, validateLifecycle(ctr.Lifecycle, gracePeriod, idxPath.Child("lifecycle"), opts, os)...) } allErrs = append(allErrs, validateLivenessProbe(ctr.LivenessProbe, gracePeriod, idxPath.Child("livenessProbe"), opts)...) allErrs = append(allErrs, validateReadinessProbe(ctr.ReadinessProbe, gracePeriod, idxPath.Child("readinessProbe"), opts)...) @@ -3625,7 +3676,7 @@ func validateHostUsers(spec *core.PodSpec, fldPath *field.Path) field.ErrorList } // validateContainers is called by pod spec and template validation to validate the list of regular containers. -func validateContainers(containers []core.Container, volumes map[string]core.VolumeSource, podClaimNames sets.Set[string], gracePeriod *int64, fldPath *field.Path, opts PodValidationOptions, podRestartPolicy *core.RestartPolicy, hostUsers bool) field.ErrorList { +func validateContainers(containers []core.Container, os *core.PodOS, volumes map[string]core.VolumeSource, podClaimNames sets.Set[string], gracePeriod *int64, fldPath *field.Path, opts PodValidationOptions, podRestartPolicy *core.RestartPolicy, hostUsers bool) field.ErrorList { allErrs := field.ErrorList{} if len(containers) == 0 { @@ -3653,7 +3704,7 @@ func validateContainers(containers []core.Container, volumes map[string]core.Vol // Regular init container and ephemeral container validation will return // field.Forbidden() for these paths. if ctr.Lifecycle != nil { - allErrs = append(allErrs, validateLifecycle(ctr.Lifecycle, gracePeriod, path.Child("lifecycle"), opts)...) + allErrs = append(allErrs, validateLifecycle(ctr.Lifecycle, gracePeriod, path.Child("lifecycle"), opts, os)...) } allErrs = append(allErrs, validateLivenessProbe(ctr.LivenessProbe, gracePeriod, path.Child("livenessProbe"), opts)...) allErrs = append(allErrs, validateReadinessProbe(ctr.ReadinessProbe, gracePeriod, path.Child("readinessProbe"), opts)...) @@ -3774,7 +3825,7 @@ func validatePodDNSConfig(dnsConfig *core.PodDNSConfig, dnsPolicy *core.DNSPolic allErrs = append(allErrs, field.Invalid(fldPath.Child("nameservers"), dnsConfig.Nameservers, fmt.Sprintf("must not have more than %v nameservers", MaxDNSNameservers))) } for i, ns := range dnsConfig.Nameservers { - allErrs = append(allErrs, validation.IsValidIP(fldPath.Child("nameservers").Index(i), ns)...) + allErrs = append(allErrs, IsValidIPForLegacyField(fldPath.Child("nameservers").Index(i), ns, nil)...) } // Validate searches. if len(dnsConfig.Searches) > MaxDNSSearchPaths { @@ -3865,7 +3916,7 @@ func validateAffinity(affinity *core.Affinity, opts PodValidationOptions, fldPat if affinity != nil { if affinity.NodeAffinity != nil { - allErrs = append(allErrs, validateNodeAffinity(affinity.NodeAffinity, fldPath.Child("nodeAffinity"))...) + allErrs = append(allErrs, validateNodeAffinity(affinity.NodeAffinity, opts, fldPath.Child("nodeAffinity"))...) } if affinity.PodAffinity != nil { allErrs = append(allErrs, validatePodAffinity(affinity.PodAffinity, opts.AllowInvalidLabelValueInSelector, fldPath.Child("podAffinity"))...) @@ -3950,7 +4001,7 @@ func validateOnlyDeletedSchedulingGates(newGates, oldGates []core.PodSchedulingG func ValidateHostAliases(hostAliases []core.HostAlias, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} for i, hostAlias := range hostAliases { - allErrs = append(allErrs, validation.IsValidIP(fldPath.Index(i).Child("ip"), hostAlias.IP)...) + allErrs = append(allErrs, IsValidIPForLegacyField(fldPath.Index(i).Child("ip"), hostAlias.IP, nil)...) for j, hostname := range hostAlias.Hostnames { allErrs = append(allErrs, ValidateDNS1123Subdomain(hostname, fldPath.Index(i).Child("hostnames").Index(j))...) } @@ -4053,6 +4104,8 @@ type PodValidationOptions struct { PodLevelResourcesEnabled bool // Allow sidecar containers resize policy for backward compatibility AllowSidecarResizePolicy bool + // Allow invalid label-value in RequiredNodeSelector + AllowInvalidLabelValueInRequiredNodeAffinity bool } // validatePodMetadataAndSpec tests if required fields in the pod.metadata and pod.spec are set, @@ -4090,19 +4143,24 @@ func validatePodMetadataAndSpec(pod *core.Pod, opts PodValidationOptions) field. } // validatePodIPs validates IPs in pod status -func validatePodIPs(pod *core.Pod) field.ErrorList { +func validatePodIPs(pod, oldPod *core.Pod) field.ErrorList { allErrs := field.ErrorList{} podIPsField := field.NewPath("status", "podIPs") - // all PodIPs must be valid IPs + // all new PodIPs must be valid IPs, but existing invalid ones can be kept. + var existingPodIPs []string + if oldPod != nil { + existingPodIPs = make([]string, len(oldPod.Status.PodIPs)) + for i, podIP := range oldPod.Status.PodIPs { + existingPodIPs[i] = podIP.IP + } + } for i, podIP := range pod.Status.PodIPs { - allErrs = append(allErrs, validation.IsValidIP(podIPsField.Index(i), podIP.IP)...) + allErrs = append(allErrs, IsValidIPForLegacyField(podIPsField.Index(i), podIP.IP, existingPodIPs)...) } - // if we have more than one Pod.PodIP then - // - validate for dual stack - // - validate for duplication + // if we have more than one Pod.PodIP then we must have a dual-stack pair if len(pod.Status.PodIPs) > 1 { podIPs := make([]string, 0, len(pod.Status.PodIPs)) for _, podIP := range pod.Status.PodIPs { @@ -4118,22 +4176,13 @@ func validatePodIPs(pod *core.Pod) field.ErrorList { if !dualStack || len(podIPs) > 2 { allErrs = append(allErrs, field.Invalid(podIPsField, pod.Status.PodIPs, "may specify no more than one IP for each IP family")) } - - // There should be no duplicates in list of Pod.PodIPs - seen := sets.Set[string]{} // := make(map[string]int) - for i, podIP := range pod.Status.PodIPs { - if seen.Has(podIP.IP) { - allErrs = append(allErrs, field.Duplicate(podIPsField.Index(i), podIP)) - } - seen.Insert(podIP.IP) - } } return allErrs } // validateHostIPs validates IPs in pod status -func validateHostIPs(pod *core.Pod) field.ErrorList { +func validateHostIPs(pod, oldPod *core.Pod) field.ErrorList { allErrs := field.ErrorList{} if len(pod.Status.HostIPs) == 0 { @@ -4147,25 +4196,23 @@ func validateHostIPs(pod *core.Pod) field.ErrorList { allErrs = append(allErrs, field.Invalid(hostIPsField.Index(0).Child("ip"), pod.Status.HostIPs[0].IP, "must be equal to `hostIP`")) } - // all HostPs must be valid IPs + // all new HostIPs must be valid IPs, but existing invalid ones can be kept. + var existingHostIPs []string + if oldPod != nil { + existingHostIPs = make([]string, len(oldPod.Status.HostIPs)) + for i, hostIP := range oldPod.Status.HostIPs { + existingHostIPs[i] = hostIP.IP + } + } for i, hostIP := range pod.Status.HostIPs { - allErrs = append(allErrs, validation.IsValidIP(hostIPsField.Index(i), hostIP.IP)...) + allErrs = append(allErrs, IsValidIPForLegacyField(hostIPsField.Index(i), hostIP.IP, existingHostIPs)...) } - // if we have more than one Pod.HostIP then - // - validate for dual stack - // - validate for duplication + // if we have more than one Pod.HostIP then we must have a dual-stack pair if len(pod.Status.HostIPs) > 1 { - seen := sets.Set[string]{} hostIPs := make([]string, 0, len(pod.Status.HostIPs)) - - // There should be no duplicates in list of Pod.HostIPs - for i, hostIP := range pod.Status.HostIPs { + for _, hostIP := range pod.Status.HostIPs { hostIPs = append(hostIPs, hostIP.IP) - if seen.Has(hostIP.IP) { - allErrs = append(allErrs, field.Duplicate(hostIPsField.Index(i), hostIP)) - } - seen.Insert(hostIP.IP) } dualStack, err := netutils.IsDualStackIPStrings(hostIPs) @@ -4204,8 +4251,8 @@ func ValidatePodSpec(spec *core.PodSpec, podMeta *metav1.ObjectMeta, fldPath *fi allErrs = append(allErrs, vErrs...) podClaimNames := gatherPodResourceClaimNames(spec.ResourceClaims) allErrs = append(allErrs, validatePodResourceClaims(podMeta, spec.ResourceClaims, fldPath.Child("resourceClaims"))...) - allErrs = append(allErrs, validateContainers(spec.Containers, vols, podClaimNames, gracePeriod, fldPath.Child("containers"), opts, &spec.RestartPolicy, hostUsers)...) - allErrs = append(allErrs, validateInitContainers(spec.InitContainers, spec.Containers, vols, podClaimNames, gracePeriod, fldPath.Child("initContainers"), opts, &spec.RestartPolicy, hostUsers)...) + allErrs = append(allErrs, validateContainers(spec.Containers, spec.OS, vols, podClaimNames, gracePeriod, fldPath.Child("containers"), opts, &spec.RestartPolicy, hostUsers)...) + allErrs = append(allErrs, validateInitContainers(spec.InitContainers, spec.OS, spec.Containers, vols, podClaimNames, gracePeriod, fldPath.Child("initContainers"), opts, &spec.RestartPolicy, hostUsers)...) allErrs = append(allErrs, validateEphemeralContainers(spec.EphemeralContainers, spec.Containers, spec.InitContainers, vols, podClaimNames, fldPath.Child("ephemeralContainers"), opts, &spec.RestartPolicy, hostUsers)...) if opts.PodLevelResourcesEnabled { @@ -4730,14 +4777,14 @@ func validatePodAntiAffinity(podAntiAffinity *core.PodAntiAffinity, allowInvalid } // validateNodeAffinity tests that the specified nodeAffinity fields have valid data -func validateNodeAffinity(na *core.NodeAffinity, fldPath *field.Path) field.ErrorList { +func validateNodeAffinity(na *core.NodeAffinity, opts PodValidationOptions, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} // TODO: Uncomment the next three lines once RequiredDuringSchedulingRequiredDuringExecution is implemented. // if na.RequiredDuringSchedulingRequiredDuringExecution != nil { // allErrs = append(allErrs, ValidateNodeSelector(na.RequiredDuringSchedulingRequiredDuringExecution, fldPath.Child("requiredDuringSchedulingRequiredDuringExecution"))...) // } if na.RequiredDuringSchedulingIgnoredDuringExecution != nil { - allErrs = append(allErrs, ValidateNodeSelector(na.RequiredDuringSchedulingIgnoredDuringExecution, true /* TODO: opts.AllowInvalidLabelValueInRequiredNodeAffinity */, fldPath.Child("requiredDuringSchedulingIgnoredDuringExecution"))...) + allErrs = append(allErrs, ValidateNodeSelector(na.RequiredDuringSchedulingIgnoredDuringExecution, opts.AllowInvalidLabelValueInRequiredNodeAffinity, fldPath.Child("requiredDuringSchedulingIgnoredDuringExecution"))...) } if len(na.PreferredDuringSchedulingIgnoredDuringExecution) > 0 { allErrs = append(allErrs, ValidatePreferredSchedulingTerms(na.PreferredDuringSchedulingIgnoredDuringExecution, fldPath.Child("preferredDuringSchedulingIgnoredDuringExecution"))...) @@ -5404,16 +5451,16 @@ func ValidateInitContainerStateTransition(newStatuses, oldStatuses []core.Contai } // Skip any restartable init container that is allowed to restart - isRestartableInitContainer := false + isRestartableInitCtr := false for _, c := range podSpec.InitContainers { if oldStatus.Name == c.Name { - if c.RestartPolicy != nil && *c.RestartPolicy == core.ContainerRestartPolicyAlways { - isRestartableInitContainer = true + if isRestartableInitContainer(&c) { + isRestartableInitCtr = true } break } } - if isRestartableInitContainer { + if isRestartableInitCtr { continue } @@ -5431,9 +5478,10 @@ func ValidatePodStatusUpdate(newPod, oldPod *core.Pod, opts PodValidationOptions fldPath := field.NewPath("metadata") allErrs := ValidateObjectMetaUpdate(&newPod.ObjectMeta, &oldPod.ObjectMeta, fldPath) allErrs = append(allErrs, ValidatePodSpecificAnnotationUpdates(newPod, oldPod, fldPath.Child("annotations"), opts)...) - allErrs = append(allErrs, validatePodConditions(newPod.Status.Conditions, fldPath.Child("conditions"))...) fldPath = field.NewPath("status") + allErrs = append(allErrs, validatePodConditions(newPod.Status.Conditions, fldPath.Child("conditions"))...) + if newPod.Spec.NodeName != oldPod.Spec.NodeName { allErrs = append(allErrs, field.Forbidden(fldPath.Child("nodeName"), "may not be changed directly")) } @@ -5444,6 +5492,10 @@ func ValidatePodStatusUpdate(newPod, oldPod *core.Pod, opts PodValidationOptions } } + if newPod.Status.ObservedGeneration < 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("observedGeneration"), newPod.Status.ObservedGeneration, "must be a non-negative integer")) + } + // Pod QoS is immutable allErrs = append(allErrs, ValidateImmutableField(newPod.Status.QOSClass, oldPod.Status.QOSClass, fldPath.Child("qosClass"))...) @@ -5459,11 +5511,11 @@ func ValidatePodStatusUpdate(newPod, oldPod *core.Pod, opts PodValidationOptions allErrs = append(allErrs, ValidateContainerStateTransition(newPod.Status.EphemeralContainerStatuses, oldPod.Status.EphemeralContainerStatuses, fldPath.Child("ephemeralContainerStatuses"), core.RestartPolicyNever)...) allErrs = append(allErrs, validatePodResourceClaimStatuses(newPod.Status.ResourceClaimStatuses, newPod.Spec.ResourceClaims, fldPath.Child("resourceClaimStatuses"))...) - if newIPErrs := validatePodIPs(newPod); len(newIPErrs) > 0 { + if newIPErrs := validatePodIPs(newPod, oldPod); len(newIPErrs) > 0 { allErrs = append(allErrs, newIPErrs...) } - if newIPErrs := validateHostIPs(newPod); len(newIPErrs) > 0 { + if newIPErrs := validateHostIPs(newPod, oldPod); len(newIPErrs) > 0 { allErrs = append(allErrs, newIPErrs...) } @@ -5479,7 +5531,8 @@ func ValidatePodStatusUpdate(newPod, oldPod *core.Pod, opts PodValidationOptions return allErrs } -// validatePodConditions tests if the custom pod conditions are valid. +// validatePodConditions tests if the custom pod conditions are valid, and that the observedGeneration +// is a non-negative integer. func validatePodConditions(conditions []core.PodCondition, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} systemConditions := sets.New( @@ -5487,6 +5540,9 @@ func validatePodConditions(conditions []core.PodCondition, fldPath *field.Path) core.PodReady, core.PodInitialized) for i, condition := range conditions { + if condition.ObservedGeneration < 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Index(i).Child("observedGeneration"), condition.ObservedGeneration, "must be a non-negative integer")) + } if systemConditions.Has(condition.Type) { continue } @@ -5572,7 +5628,7 @@ func ValidatePodEphemeralContainersUpdate(newPod, oldPod *core.Pod, opts PodVali func ValidatePodResize(newPod, oldPod *core.Pod, opts PodValidationOptions) field.ErrorList { // Part 1: Validate newPod's spec and updates to metadata fldPath := field.NewPath("metadata") - allErrs := ValidateImmutableField(&newPod.ObjectMeta, &oldPod.ObjectMeta, fldPath) + allErrs := ValidateObjectMetaUpdate(&newPod.ObjectMeta, &oldPod.ObjectMeta, fldPath) allErrs = append(allErrs, validatePodMetadataAndSpec(newPod, opts)...) // pods with pod-level resources cannot be resized @@ -5596,7 +5652,8 @@ func ValidatePodResize(newPod, oldPod *core.Pod, opts PodValidationOptions) fiel } // Part 2: Validate that the changes between oldPod.Spec.Containers[].Resources and - // newPod.Spec.Containers[].Resources are allowed. + // newPod.Spec.Containers[].Resources are allowed. Also validate that the changes between oldPod.Spec.InitContainers[].Resources and + // newPod.Spec.InitContainers[].Resources are allowed. specPath := field.NewPath("spec") if qos.GetPodQOS(oldPod) != qos.ComputePodQOS(newPod) { allErrs = append(allErrs, field.Invalid(specPath, newPod.Status.QOSClass, "Pod QOS Class may not change as a result of resizing")) @@ -5606,69 +5663,135 @@ func ValidatePodResize(newPod, oldPod *core.Pod, opts PodValidationOptions) fiel allErrs = append(allErrs, field.Forbidden(specPath, "Pod running on node without support for resize")) } + // The rest of the validation assumes that the containers are in the same order, + // so we proceed only if that assumption is true. + containerOrderErrs := validatePodResizeContainerOrdering(newPod, oldPod, specPath) + allErrs = append(allErrs, containerOrderErrs...) + if containerOrderErrs != nil { + return allErrs + } + // Do not allow removing resource requests/limits on resize. if utilfeature.DefaultFeatureGate.Enabled(features.SidecarContainers) { for ix, ctr := range oldPod.Spec.InitContainers { - if ctr.RestartPolicy != nil && *ctr.RestartPolicy != core.ContainerRestartPolicyAlways { + if !isRestartableInitContainer(&ctr) { continue } - if resourcesRemoved(newPod.Spec.InitContainers[ix].Resources.Requests, ctr.Resources.Requests) { - allErrs = append(allErrs, field.Forbidden(specPath.Child("initContainers").Index(ix).Child("resources").Child("requests"), "resource requests cannot be removed")) - } - if resourcesRemoved(newPod.Spec.InitContainers[ix].Resources.Limits, ctr.Resources.Limits) { - allErrs = append(allErrs, field.Forbidden(specPath.Child("initContainers").Index(ix).Child("resources").Child("limits"), "resource limits cannot be removed")) - } + allErrs = append(allErrs, validateContainerResize( + &newPod.Spec.InitContainers[ix].Resources, + &oldPod.Spec.InitContainers[ix].Resources, + newPod.Spec.InitContainers[ix].ResizePolicy, + specPath.Child("initContainers").Index(ix).Child("resources"))...) } } - for ix, ctr := range oldPod.Spec.Containers { - if resourcesRemoved(newPod.Spec.Containers[ix].Resources.Requests, ctr.Resources.Requests) { - allErrs = append(allErrs, field.Forbidden(specPath.Child("containers").Index(ix).Child("resources").Child("requests"), "resource requests cannot be removed")) - } - if resourcesRemoved(newPod.Spec.Containers[ix].Resources.Limits, ctr.Resources.Limits) { - allErrs = append(allErrs, field.Forbidden(specPath.Child("containers").Index(ix).Child("resources").Child("limits"), "resource limits cannot be removed")) - } + for ix := range oldPod.Spec.Containers { + allErrs = append(allErrs, validateContainerResize( + &newPod.Spec.Containers[ix].Resources, + &oldPod.Spec.Containers[ix].Resources, + newPod.Spec.Containers[ix].ResizePolicy, + specPath.Child("containers").Index(ix).Child("resources"))...) } - // Ensure that only CPU and memory resources are mutable. + // Ensure that only CPU and memory resources are mutable for regular containers. originalCPUMemPodSpec := *newPod.Spec.DeepCopy() var newContainers []core.Container for ix, container := range originalCPUMemPodSpec.Containers { - dropCPUMemoryUpdates := func(resourceList, oldResourceList core.ResourceList) core.ResourceList { - if oldResourceList == nil { - return nil - } - var mungedResourceList core.ResourceList - if resourceList == nil { - mungedResourceList = make(core.ResourceList) - } else { - mungedResourceList = resourceList.DeepCopy() - } - delete(mungedResourceList, core.ResourceCPU) - delete(mungedResourceList, core.ResourceMemory) - if cpu, found := oldResourceList[core.ResourceCPU]; found { - mungedResourceList[core.ResourceCPU] = cpu - } - if mem, found := oldResourceList[core.ResourceMemory]; found { - mungedResourceList[core.ResourceMemory] = mem - } - return mungedResourceList + dropCPUMemoryResourcesFromContainer(&container, &oldPod.Spec.Containers[ix]) + if !apiequality.Semantic.DeepEqual(container, oldPod.Spec.Containers[ix]) { + // This likely means that the user has made changes to resources other than CPU and memory for regular container. + errs := field.Forbidden(specPath, "only cpu and memory resources are mutable") + allErrs = append(allErrs, errs) } - lim := dropCPUMemoryUpdates(container.Resources.Limits, oldPod.Spec.Containers[ix].Resources.Limits) - req := dropCPUMemoryUpdates(container.Resources.Requests, oldPod.Spec.Containers[ix].Resources.Requests) - container.Resources = core.ResourceRequirements{Limits: lim, Requests: req} - container.ResizePolicy = oldPod.Spec.Containers[ix].ResizePolicy // +k8s:verify-mutation:reason=clone newContainers = append(newContainers, container) } originalCPUMemPodSpec.Containers = newContainers + + // Ensure that only CPU and memory resources are mutable for restartable init containers. + // Also ensure that resources are immutable for non-restartable init containers. + var newInitContainers []core.Container + if utilfeature.DefaultFeatureGate.Enabled(features.SidecarContainers) { + for ix, container := range originalCPUMemPodSpec.InitContainers { + if isRestartableInitContainer(&container) { // restartable init container + dropCPUMemoryResourcesFromContainer(&container, &oldPod.Spec.InitContainers[ix]) + if !apiequality.Semantic.DeepEqual(container, oldPod.Spec.InitContainers[ix]) { + // This likely means that the user has made changes to resources other than CPU and memory for sidecar container. + errs := field.Forbidden(specPath, "only cpu and memory resources for sidecar containers are mutable") + allErrs = append(allErrs, errs) + } + } else if !apiequality.Semantic.DeepEqual(container, oldPod.Spec.InitContainers[ix]) { // non-restartable init container + // This likely means that the user has modified resources of non-sidecar init container. + errs := field.Forbidden(specPath, "resources for non-sidecar init containers are immutable") + allErrs = append(allErrs, errs) + } + newInitContainers = append(newInitContainers, container) + } + originalCPUMemPodSpec.InitContainers = newInitContainers + } + + if len(allErrs) > 0 { + return allErrs + } + if !apiequality.Semantic.DeepEqual(originalCPUMemPodSpec, oldPod.Spec) { // This likely means that the user has made changes to resources other than CPU and Memory. - specDiff := cmp.Diff(oldPod.Spec, originalCPUMemPodSpec) - errs := field.Forbidden(specPath, fmt.Sprintf("only cpu and memory resources are mutable\n%v", specDiff)) + errs := field.Forbidden(specPath, "only cpu and memory resources are mutable") allErrs = append(allErrs, errs) } return allErrs } +// validatePodResizeContainerOrdering validates container ordering for a resize request. +// We do not allow adding, removing, re-ordering, or renaming containers on resize. +func validatePodResizeContainerOrdering(newPod, oldPod *core.Pod, specPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + if len(newPod.Spec.Containers) != len(oldPod.Spec.Containers) { + allErrs = append(allErrs, field.Forbidden(specPath.Child("containers"), "containers may not be added or removed on resize")) + } else { + for i, oldCtr := range oldPod.Spec.Containers { + if newPod.Spec.Containers[i].Name != oldCtr.Name { + allErrs = append(allErrs, field.Forbidden(specPath.Child("containers").Index(i).Child("name"), "containers may not be renamed or reordered on resize")) + } + } + } + if len(newPod.Spec.InitContainers) != len(oldPod.Spec.InitContainers) { + allErrs = append(allErrs, field.Forbidden(specPath.Child("initContainers"), "initContainers may not be added or removed on resize")) + } else { + for i, oldCtr := range oldPod.Spec.InitContainers { + if newPod.Spec.InitContainers[i].Name != oldCtr.Name { + allErrs = append(allErrs, field.Forbidden(specPath.Child("initContainers").Index(i).Child("name"), "initContainers may not be renamed or reordered on resize")) + } + } + } + return allErrs +} + +// dropCPUMemoryResourcesFromContainer deletes the cpu and memory resources from the container, and copies them from the old pod container resources if present. +func dropCPUMemoryResourcesFromContainer(container *core.Container, oldPodSpecContainer *core.Container) { + dropCPUMemoryUpdates := func(resourceList, oldResourceList core.ResourceList) core.ResourceList { + if oldResourceList == nil { + return nil + } + var mungedResourceList core.ResourceList + if resourceList == nil { + mungedResourceList = make(core.ResourceList) + } else { + mungedResourceList = resourceList.DeepCopy() + } + delete(mungedResourceList, core.ResourceCPU) + delete(mungedResourceList, core.ResourceMemory) + if cpu, found := oldResourceList[core.ResourceCPU]; found { + mungedResourceList[core.ResourceCPU] = cpu + } + if mem, found := oldResourceList[core.ResourceMemory]; found { + mungedResourceList[core.ResourceMemory] = mem + } + return mungedResourceList + } + lim := dropCPUMemoryUpdates(container.Resources.Limits, oldPodSpecContainer.Resources.Limits) + req := dropCPUMemoryUpdates(container.Resources.Requests, oldPodSpecContainer.Resources.Requests) + container.Resources = core.ResourceRequirements{Limits: lim, Requests: req} +} + // isPodResizeRequestSupported checks whether the pod is running on a node with InPlacePodVerticalScaling enabled. func isPodResizeRequestSupported(pod core.Pod) bool { // TODO: Remove this after GA+3 releases of InPlacePodVerticalScaling @@ -5686,6 +5809,49 @@ func isPodResizeRequestSupported(pod core.Pod) bool { return true } +// validateContainerResize validates the changes to the container's resource requirements for a pod resize request. +// newRequriements and oldRequirements must be non-nil. +func validateContainerResize(newRequirements, oldRequirements *core.ResourceRequirements, resizePolicies []core.ContainerResizePolicy, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + + // Removing resource requirements is not supported. + if resourcesRemoved(newRequirements.Requests, oldRequirements.Requests) { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("requests"), "resource requests cannot be removed")) + } + if resourcesRemoved(newRequirements.Limits, oldRequirements.Limits) { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("limits"), "resource limits cannot be removed")) + } + + // Special case: memory limits may not be decreased if resize policy is NotRequired. + var memRestartPolicy core.ResourceResizeRestartPolicy + for _, policy := range resizePolicies { + if policy.ResourceName == core.ResourceMemory { + memRestartPolicy = policy.RestartPolicy + break + } + } + if memRestartPolicy == core.NotRequired || memRestartPolicy == "" { + newLimit, hasNewLimit := newRequirements.Limits[core.ResourceMemory] + oldLimit, hasOldLimit := oldRequirements.Limits[core.ResourceMemory] + if hasNewLimit && hasOldLimit { + if newLimit.Cmp(oldLimit) < 0 { + allErrs = append(allErrs, field.Forbidden( + fldPath.Child("limits").Key(core.ResourceMemory.String()), + fmt.Sprintf("memory limits cannot be decreased unless resizePolicy is %s", core.RestartContainer))) + } + } else if hasNewLimit && !hasOldLimit { + // Adding a memory limit is implicitly decreasing the memory limit (from 'max') + allErrs = append(allErrs, field.Forbidden( + fldPath.Child("limits").Key(core.ResourceMemory.String()), + fmt.Sprintf("memory limits cannot be added unless resizePolicy is %s", core.RestartContainer))) + } + } + + // TODO(tallclair): Move resizable resource checks here. + + return allErrs +} + func resourcesRemoved(resourceList, oldResourceList core.ResourceList) bool { if len(oldResourceList) > len(resourceList) { return true @@ -5743,7 +5909,7 @@ var supportedServiceIPFamilyPolicy = sets.New( core.IPFamilyPolicyRequireDualStack) // ValidateService tests if required fields/annotations of a Service are valid. -func ValidateService(service *core.Service) field.ErrorList { +func ValidateService(service, oldService *core.Service) field.ErrorList { metaPath := field.NewPath("metadata") allErrs := ValidateObjectMeta(&service.ObjectMeta, true, ValidateServiceName, metaPath) @@ -5762,16 +5928,6 @@ func ValidateService(service *core.Service) field.ErrorList { } switch service.Spec.Type { case core.ServiceTypeLoadBalancer: - for ix := range service.Spec.Ports { - port := &service.Spec.Ports[ix] - // This is a workaround for broken cloud environments that - // over-open firewalls. Hopefully it can go away when more clouds - // understand containers better. - if port.Port == ports.KubeletPort { - portPath := specPath.Child("ports").Index(ix) - allErrs = append(allErrs, field.Invalid(portPath, port.Port, fmt.Sprintf("may not expose port %v externally since it is used by kubelet", ports.KubeletPort))) - } - } if isHeadlessService(service) { allErrs = append(allErrs, field.Invalid(specPath.Child("clusterIPs").Index(0), service.Spec.ClusterIPs[0], "may not be set to 'None' for LoadBalancer services")) } @@ -5828,15 +5984,24 @@ func ValidateService(service *core.Service) field.ErrorList { } // dualstack <-> ClusterIPs <-> ipfamilies - allErrs = append(allErrs, ValidateServiceClusterIPsRelatedFields(service)...) + allErrs = append(allErrs, ValidateServiceClusterIPsRelatedFields(service, oldService)...) + // All new ExternalIPs must be valid and "non-special". (Existing ExternalIPs may + // have been validated against older rules, but if we allowed them before we can't + // reject them now.) ipPath := specPath.Child("externalIPs") + var existingExternalIPs []string + if oldService != nil { + existingExternalIPs = oldService.Spec.ExternalIPs // +k8s:verify-mutation:reason=clone + } for i, ip := range service.Spec.ExternalIPs { idxPath := ipPath.Index(i) - if errs := validation.IsValidIP(idxPath, ip); len(errs) != 0 { + if errs := IsValidIPForLegacyField(idxPath, ip, existingExternalIPs); len(errs) != 0 { allErrs = append(allErrs, errs...) } else { - allErrs = append(allErrs, ValidateNonSpecialIP(ip, idxPath)...) + // For historical reasons, this uses ValidateEndpointIP even + // though that is not exactly the appropriate set of checks. + allErrs = append(allErrs, ValidateEndpointIP(ip, idxPath)...) } } @@ -5888,18 +6053,27 @@ func ValidateService(service *core.Service) field.ErrorList { ports[key] = true } - // Validate SourceRanges field or annotation. + // Validate SourceRanges field or annotation. Existing invalid CIDR values do not + // need to be fixed. Note that even with the tighter CIDR validation we still + // allow excess whitespace, because that is effectively part of the API. if len(service.Spec.LoadBalancerSourceRanges) > 0 { fieldPath := specPath.Child("LoadBalancerSourceRanges") if service.Spec.Type != core.ServiceTypeLoadBalancer { allErrs = append(allErrs, field.Forbidden(fieldPath, "may only be used when `type` is 'LoadBalancer'")) } + var existingSourceRanges []string + if oldService != nil { + existingSourceRanges = make([]string, len(oldService.Spec.LoadBalancerSourceRanges)) + for i, value := range oldService.Spec.LoadBalancerSourceRanges { + existingSourceRanges[i] = strings.TrimSpace(value) + } + } for idx, value := range service.Spec.LoadBalancerSourceRanges { // Note: due to a historical accident around transition from the // annotation value, these values are allowed to be space-padded. value = strings.TrimSpace(value) - allErrs = append(allErrs, validation.IsValidCIDR(fieldPath.Index(idx), value)...) + allErrs = append(allErrs, IsValidCIDRForLegacyField(fieldPath.Index(idx), value, existingSourceRanges)...) } } else if val, annotationSet := service.Annotations[core.AnnotationLoadBalancerSourceRangesKey]; annotationSet { fieldPath := field.NewPath("metadata", "annotations").Key(core.AnnotationLoadBalancerSourceRangesKey) @@ -5907,12 +6081,14 @@ func ValidateService(service *core.Service) field.ErrorList { allErrs = append(allErrs, field.Forbidden(fieldPath, "may only be used when `type` is 'LoadBalancer'")) } - val = strings.TrimSpace(val) - if val != "" { - cidrs := strings.Split(val, ",") - for _, value := range cidrs { - value = strings.TrimSpace(value) - allErrs = append(allErrs, validation.IsValidCIDR(fieldPath, value)...) + if oldService == nil || oldService.Annotations[core.AnnotationLoadBalancerSourceRangesKey] != val { + val = strings.TrimSpace(val) + if val != "" { + cidrs := strings.Split(val, ",") + for _, value := range cidrs { + value = strings.TrimSpace(value) + allErrs = append(allErrs, IsValidCIDRForLegacyField(fieldPath, value, nil)...) + } } } } @@ -6063,8 +6239,21 @@ func validateServiceTrafficDistribution(service *core.Service) field.ErrorList { return allErrs } - if *service.Spec.TrafficDistribution != v1.ServiceTrafficDistributionPreferClose { - allErrs = append(allErrs, field.NotSupported(field.NewPath("spec").Child("trafficDistribution"), *service.Spec.TrafficDistribution, []string{v1.ServiceTrafficDistributionPreferClose})) + var supportedTrafficDistribution []string + if !utilfeature.DefaultFeatureGate.Enabled(features.PreferSameTrafficDistribution) { + supportedTrafficDistribution = []string{ + v1.ServiceTrafficDistributionPreferClose, + } + } else { + supportedTrafficDistribution = []string{ + v1.ServiceTrafficDistributionPreferClose, + v1.ServiceTrafficDistributionPreferSameZone, + v1.ServiceTrafficDistributionPreferSameNode, + } + } + + if !slices.Contains(supportedTrafficDistribution, *service.Spec.TrafficDistribution) { + allErrs = append(allErrs, field.NotSupported(field.NewPath("spec").Child("trafficDistribution"), *service.Spec.TrafficDistribution, supportedTrafficDistribution)) } return allErrs @@ -6072,7 +6261,7 @@ func validateServiceTrafficDistribution(service *core.Service) field.ErrorList { // ValidateServiceCreate validates Services as they are created. func ValidateServiceCreate(service *core.Service) field.ErrorList { - return ValidateService(service) + return ValidateService(service, nil) } // ValidateServiceUpdate tests if required fields in the service are set during an update @@ -6095,13 +6284,13 @@ func ValidateServiceUpdate(service, oldService *core.Service) field.ErrorList { allErrs = append(allErrs, validateServiceExternalTrafficFieldsUpdate(oldService, service)...) - return append(allErrs, ValidateService(service)...) + return append(allErrs, ValidateService(service, oldService)...) } // ValidateServiceStatusUpdate tests if required fields in the Service are set when updating status. func ValidateServiceStatusUpdate(service, oldService *core.Service) field.ErrorList { allErrs := ValidateObjectMetaUpdate(&service.ObjectMeta, &oldService.ObjectMeta, field.NewPath("metadata")) - allErrs = append(allErrs, ValidateLoadBalancerStatus(&service.Status.LoadBalancer, field.NewPath("status", "loadBalancer"), &service.Spec)...) + allErrs = append(allErrs, ValidateLoadBalancerStatus(&service.Status.LoadBalancer, &oldService.Status.LoadBalancer, field.NewPath("status", "loadBalancer"), &service.Spec)...) return allErrs } @@ -6160,7 +6349,7 @@ func ValidateNonEmptySelector(selectorMap map[string]string, fldPath *field.Path } // Validates the given template and ensures that it is in accordance with the desired selector and replicas. -func ValidatePodTemplateSpecForRC(template *core.PodTemplateSpec, selectorMap map[string]string, replicas int32, fldPath *field.Path, opts PodValidationOptions) field.ErrorList { +func ValidatePodTemplateSpecForRC(template *core.PodTemplateSpec, selectorMap map[string]string, fldPath *field.Path, opts PodValidationOptions) field.ErrorList { allErrs := field.ErrorList{} if template == nil { allErrs = append(allErrs, field.Required(fldPath, "")) @@ -6188,10 +6377,14 @@ func ValidatePodTemplateSpecForRC(template *core.PodTemplateSpec, selectorMap ma // ValidateReplicationControllerSpec tests if required fields in the replication controller spec are set. func ValidateReplicationControllerSpec(spec, oldSpec *core.ReplicationControllerSpec, fldPath *field.Path, opts PodValidationOptions) field.ErrorList { allErrs := field.ErrorList{} - allErrs = append(allErrs, ValidateNonnegativeField(int64(spec.MinReadySeconds), fldPath.Child("minReadySeconds"))...) + allErrs = append(allErrs, ValidateNonnegativeField(int64(spec.MinReadySeconds), fldPath.Child("minReadySeconds")).MarkCoveredByDeclarative()...) allErrs = append(allErrs, ValidateNonEmptySelector(spec.Selector, fldPath.Child("selector"))...) - allErrs = append(allErrs, ValidateNonnegativeField(int64(spec.Replicas), fldPath.Child("replicas"))...) - allErrs = append(allErrs, ValidatePodTemplateSpecForRC(spec.Template, spec.Selector, spec.Replicas, fldPath.Child("template"), opts)...) + if spec.Replicas == nil { + allErrs = append(allErrs, field.Required(fldPath.Child("replicas"), "").MarkCoveredByDeclarative()) + } else { + allErrs = append(allErrs, ValidateNonnegativeField(int64(*spec.Replicas), fldPath.Child("replicas")).MarkCoveredByDeclarative()...) + } + allErrs = append(allErrs, ValidatePodTemplateSpecForRC(spec.Template, spec.Selector, fldPath.Child("template"), opts)...) return allErrs } @@ -6289,6 +6482,7 @@ func ValidateNode(node *core.Node) field.ErrorList { // All status fields are optional and can be updated later. // That said, if specified, we need to ensure they are valid. allErrs = append(allErrs, ValidateNodeResources(node)...) + allErrs = append(allErrs, validateNodeSwapStatus(node.Status.NodeInfo.Swap, fldPath.Child("nodeSwapStatus"))...) // validate PodCIDRS only if we need to if len(node.Spec.PodCIDRs) > 0 { @@ -6296,12 +6490,10 @@ func ValidateNode(node *core.Node) field.ErrorList { // all PodCIDRs should be valid ones for idx, value := range node.Spec.PodCIDRs { - allErrs = append(allErrs, validation.IsValidCIDR(podCIDRsField.Index(idx), value)...) + allErrs = append(allErrs, IsValidCIDRForLegacyField(podCIDRsField.Index(idx), value, nil)...) } - // if more than PodCIDR then - // - validate for dual stack - // - validate for duplication + // if more than PodCIDR then it must be a dual-stack pair if len(node.Spec.PodCIDRs) > 1 { dualStack, err := netutils.IsDualStackCIDRStrings(node.Spec.PodCIDRs) if err != nil { @@ -6310,15 +6502,6 @@ func ValidateNode(node *core.Node) field.ErrorList { if !dualStack || len(node.Spec.PodCIDRs) > 2 { allErrs = append(allErrs, field.Invalid(podCIDRsField, node.Spec.PodCIDRs, "may specify no more than one CIDR for each IP family")) } - - // PodCIDRs must not contain duplicates - seen := sets.Set[string]{} - for i, value := range node.Spec.PodCIDRs { - if seen.Has(value) { - allErrs = append(allErrs, field.Duplicate(podCIDRsField.Index(i), value)) - } - seen.Insert(value) - } } } @@ -7334,16 +7517,28 @@ func ValidateNamespaceFinalizeUpdate(newNamespace, oldNamespace *core.Namespace) } // ValidateEndpoints validates Endpoints on create and update. -func ValidateEndpoints(endpoints *core.Endpoints) field.ErrorList { +func ValidateEndpoints(endpoints, oldEndpoints *core.Endpoints) field.ErrorList { allErrs := ValidateObjectMeta(&endpoints.ObjectMeta, true, ValidateEndpointsName, field.NewPath("metadata")) allErrs = append(allErrs, ValidateEndpointsSpecificAnnotations(endpoints.Annotations, field.NewPath("annotations"))...) - allErrs = append(allErrs, validateEndpointSubsets(endpoints.Subsets, field.NewPath("subsets"))...) + + subsetErrs := validateEndpointSubsets(endpoints.Subsets, field.NewPath("subsets")) + if len(subsetErrs) != 0 { + // If this is an update, and Subsets was unchanged, then ignore the + // validation errors, since apparently older versions of Kubernetes + // considered the data valid. (We only check this after getting a + // validation error since Endpoints may be large and DeepEqual is slow.) + if oldEndpoints != nil && apiequality.Semantic.DeepEqual(oldEndpoints.Subsets, endpoints.Subsets) { + subsetErrs = nil + } + } + allErrs = append(allErrs, subsetErrs...) + return allErrs } // ValidateEndpointsCreate validates Endpoints on create. func ValidateEndpointsCreate(endpoints *core.Endpoints) field.ErrorList { - return ValidateEndpoints(endpoints) + return ValidateEndpoints(endpoints, nil) } // ValidateEndpointsUpdate validates Endpoints on update. NodeName changes are @@ -7352,7 +7547,7 @@ func ValidateEndpointsCreate(endpoints *core.Endpoints) field.ErrorList { // happens. func ValidateEndpointsUpdate(newEndpoints, oldEndpoints *core.Endpoints) field.ErrorList { allErrs := ValidateObjectMetaUpdate(&newEndpoints.ObjectMeta, &oldEndpoints.ObjectMeta, field.NewPath("metadata")) - allErrs = append(allErrs, ValidateEndpoints(newEndpoints)...) + allErrs = append(allErrs, ValidateEndpoints(newEndpoints, oldEndpoints)...) return allErrs } @@ -7383,33 +7578,35 @@ func validateEndpointSubsets(subsets []core.EndpointSubset, fldPath *field.Path) func validateEndpointAddress(address *core.EndpointAddress, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} - allErrs = append(allErrs, validation.IsValidIP(fldPath.Child("ip"), address.IP)...) + allErrs = append(allErrs, IsValidIPForLegacyField(fldPath.Child("ip"), address.IP, nil)...) if len(address.Hostname) > 0 { allErrs = append(allErrs, ValidateDNS1123Label(address.Hostname, fldPath.Child("hostname"))...) } // During endpoint update, verify that NodeName is a DNS subdomain and transition rules allow the update if address.NodeName != nil { for _, msg := range ValidateNodeName(*address.NodeName, false) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("nodeName"), *address.NodeName, msg)) + allErrs = append(allErrs, field.Invalid(fldPath.Child("nodeName"), *address.NodeName, msg).WithOrigin("format=dns-label")) } } - allErrs = append(allErrs, ValidateNonSpecialIP(address.IP, fldPath.Child("ip"))...) + allErrs = append(allErrs, ValidateEndpointIP(address.IP, fldPath.Child("ip"))...) return allErrs } -// ValidateNonSpecialIP is used to validate Endpoints, EndpointSlices, and -// external IPs. Specifically, this disallows unspecified and loopback addresses -// are nonsensical and link-local addresses tend to be used for node-centric -// purposes (e.g. metadata service). +// ValidateEndpointIP is used to validate Endpoints and EndpointSlice addresses, and also +// (for historical reasons) external IPs. It disallows certain address types that don't +// make sense in those contexts. Note that this function is _almost_, but not exactly, +// equivalent to net.IP.IsGlobalUnicast(). (Unlike IsGlobalUnicast, it allows global +// multicast IPs, which is probably a bug.) // -// IPv6 references -// - https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml -// - https://www.iana.org/assignments/ipv6-multicast-addresses/ipv6-multicast-addresses.xhtml -func ValidateNonSpecialIP(ipAddress string, fldPath *field.Path) field.ErrorList { +// This function should not be used for new validations; the exact set of IPs that do and +// don't make sense in a particular field is context-dependent (e.g., localhost makes +// sense in some places; unspecified IPs make sense in fields that are used as bind +// addresses rather than destination addresses). +func ValidateEndpointIP(ipAddress string, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} ip := netutils.ParseIPSloppy(ipAddress) if ip == nil { - allErrs = append(allErrs, field.Invalid(fldPath, ipAddress, "must be a valid IP address")) + allErrs = append(allErrs, field.Invalid(fldPath, ipAddress, "must be a valid IP address").WithOrigin("format=ip-sloppy")) return allErrs } if ip.IsUnspecified() { @@ -7424,7 +7621,7 @@ func ValidateNonSpecialIP(ipAddress string, fldPath *field.Path) field.ErrorList if ip.IsLinkLocalMulticast() { allErrs = append(allErrs, field.Invalid(fldPath, ipAddress, "may not be in the link-local multicast range (224.0.0.0/24, ff02::/10)")) } - return allErrs + return allErrs.WithOrigin("format=endpoint-ip") } func validateEndpointPort(port *core.EndpointPort, requireName bool, fldPath *field.Path) field.ErrorList { @@ -7435,7 +7632,7 @@ func validateEndpointPort(port *core.EndpointPort, requireName bool, fldPath *fi allErrs = append(allErrs, ValidateDNS1123Label(port.Name, fldPath.Child("name"))...) } for _, msg := range validation.IsValidPortNum(int(port.Port)) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("port"), port.Port, msg)) + allErrs = append(allErrs, field.Invalid(fldPath.Child("port"), port.Port, msg).WithOrigin("portNum")) } if len(port.Protocol) == 0 { allErrs = append(allErrs, field.Required(fldPath.Child("protocol"), "")) @@ -7744,16 +7941,25 @@ var ( ) // ValidateLoadBalancerStatus validates required fields on a LoadBalancerStatus -func ValidateLoadBalancerStatus(status *core.LoadBalancerStatus, fldPath *field.Path, spec *core.ServiceSpec) field.ErrorList { +func ValidateLoadBalancerStatus(status, oldStatus *core.LoadBalancerStatus, fldPath *field.Path, spec *core.ServiceSpec) field.ErrorList { allErrs := field.ErrorList{} ingrPath := fldPath.Child("ingress") if !utilfeature.DefaultFeatureGate.Enabled(features.AllowServiceLBStatusOnNonLB) && spec.Type != core.ServiceTypeLoadBalancer && len(status.Ingress) != 0 { allErrs = append(allErrs, field.Forbidden(ingrPath, "may only be used when `spec.type` is 'LoadBalancer'")) } else { + var existingIngressIPs []string + if oldStatus != nil { + existingIngressIPs = make([]string, 0, len(oldStatus.Ingress)) + for _, ingress := range oldStatus.Ingress { + if len(ingress.IP) > 0 { + existingIngressIPs = append(existingIngressIPs, ingress.IP) + } + } + } for i, ingress := range status.Ingress { idxPath := ingrPath.Index(i) if len(ingress.IP) > 0 { - allErrs = append(allErrs, validation.IsValidIP(idxPath.Child("ip"), ingress.IP)...) + allErrs = append(allErrs, IsValidIPForLegacyField(idxPath.Child("ip"), ingress.IP, existingIngressIPs)...) } if utilfeature.DefaultFeatureGate.Enabled(features.LoadBalancerIPMode) && ingress.IPMode == nil { @@ -7783,7 +7989,7 @@ func ValidateLoadBalancerStatus(status *core.LoadBalancerStatus, fldPath *field. // returns: // - true if volumeNodeAffinity is set // - errorList if there are validation errors -func validateVolumeNodeAffinity(nodeAffinity *core.VolumeNodeAffinity, fldPath *field.Path) (bool, field.ErrorList) { +func validateVolumeNodeAffinity(nodeAffinity *core.VolumeNodeAffinity, opts PersistentVolumeSpecValidationOptions, fldPath *field.Path) (bool, field.ErrorList) { allErrs := field.ErrorList{} if nodeAffinity == nil { @@ -7791,7 +7997,7 @@ func validateVolumeNodeAffinity(nodeAffinity *core.VolumeNodeAffinity, fldPath * } if nodeAffinity.Required != nil { - allErrs = append(allErrs, ValidateNodeSelector(nodeAffinity.Required, true /* TODO: opts.AllowInvalidLabelValueInRequiredNodeAffinity */, fldPath.Child("required"))...) + allErrs = append(allErrs, ValidateNodeSelector(nodeAffinity.Required, opts.AllowInvalidLabelValueInRequiredNodeAffinity, fldPath.Child("required"))...) } else { allErrs = append(allErrs, field.Required(fldPath.Child("required"), "must specify required node constraints")) } @@ -7829,8 +8035,8 @@ func validateTopologySpreadConstraints(constraints []core.TopologySpreadConstrai for i, constraint := range constraints { subFldPath := fldPath.Index(i) - if err := ValidateMaxSkew(subFldPath.Child("maxSkew"), constraint.MaxSkew); err != nil { - allErrs = append(allErrs, err) + if errs := ValidatePositiveField(int64(constraint.MaxSkew), subFldPath.Child("maxSkew")); len(errs) > 0 { + allErrs = append(allErrs, errs...) } if err := ValidateTopologyKey(subFldPath.Child("topologyKey"), constraint.TopologyKey); err != nil { allErrs = append(allErrs, err) @@ -7858,26 +8064,16 @@ func validateTopologySpreadConstraints(constraints []core.TopologySpreadConstrai return allErrs } -// ValidateMaxSkew tests that the argument is a valid MaxSkew. -func ValidateMaxSkew(fldPath *field.Path, maxSkew int32) *field.Error { - if maxSkew <= 0 { - return field.Invalid(fldPath, maxSkew, isNotPositiveErrorMsg) - } - return nil -} - // validateMinDomains tests that the argument is a valid MinDomains. func validateMinDomains(fldPath *field.Path, minDomains *int32, action core.UnsatisfiableConstraintAction) field.ErrorList { if minDomains == nil { return nil } var allErrs field.ErrorList - if *minDomains <= 0 { - allErrs = append(allErrs, field.Invalid(fldPath, minDomains, isNotPositiveErrorMsg)) - } + allErrs = append(allErrs, ValidatePositiveField(int64(*minDomains), fldPath)...) // When MinDomains is non-nil, whenUnsatisfiable must be DoNotSchedule. if action != core.DoNotSchedule { - allErrs = append(allErrs, field.Invalid(fldPath, minDomains, fmt.Sprintf("can only use minDomains if whenUnsatisfiable=%s, not %s", core.DoNotSchedule, action))) + allErrs = append(allErrs, field.Invalid(fldPath, minDomains, fmt.Sprintf("can only use minDomains if whenUnsatisfiable=%s, not %s", core.DoNotSchedule, action)).WithOrigin("dependsOn")) } return allErrs } @@ -8001,7 +8197,7 @@ func validateMatchLabelKeysInTopologySpread(fldPath *field.Path, matchLabelKeys for i, key := range matchLabelKeys { allErrs = append(allErrs, unversionedvalidation.ValidateLabelName(key, fldPath.Index(i))...) if labelSelectorKeys.Has(key) { - allErrs = append(allErrs, field.Invalid(fldPath.Index(i), key, "exists in both matchLabelKeys and labelSelector")) + allErrs = append(allErrs, field.Invalid(fldPath.Index(i), key, "exists in both matchLabelKeys and labelSelector").WithOrigin("overlappingKeys")) } } @@ -8030,7 +8226,7 @@ func validateLabelKeys(fldPath *field.Path, labelKeys []string, labelSelector *m // ValidateServiceClusterIPsRelatedFields validates .spec.ClusterIPs,, // .spec.IPFamilies, .spec.ipFamilyPolicy. This is exported because it is used // during IP init and allocation. -func ValidateServiceClusterIPsRelatedFields(service *core.Service) field.ErrorList { +func ValidateServiceClusterIPsRelatedFields(service, oldService *core.Service) field.ErrorList { // ClusterIP, ClusterIPs, IPFamilyPolicy and IPFamilies are validated prior (all must be unset) for ExternalName service if service.Spec.Type == core.ServiceTypeExternalName { return field.ErrorList{} @@ -8084,6 +8280,11 @@ func ValidateServiceClusterIPsRelatedFields(service *core.Service) field.ErrorLi } } + var existingClusterIPs []string + if oldService != nil { + existingClusterIPs = oldService.Spec.ClusterIPs // +k8s:verify-mutation:reason=clone + } + // clusterIPs stand alone validation // valid ips with None and empty string handling // duplication check is done as part of DualStackvalidation below @@ -8097,8 +8298,8 @@ func ValidateServiceClusterIPsRelatedFields(service *core.Service) field.ErrorLi continue } - // is it valid ip? - errorMessages := validation.IsValidIP(clusterIPsField.Index(i), clusterIP) + // is it a valid ip? (or was it at least previously considered valid?) + errorMessages := IsValidIPForLegacyField(clusterIPsField.Index(i), clusterIP, existingClusterIPs) hasInvalidIPs = (len(errorMessages) != 0) || hasInvalidIPs allErrs = append(allErrs, errorMessages...) } @@ -8467,10 +8668,10 @@ func validateContainerStatusUsers(containerStatuses []core.ContainerStatus, fldP switch osName { case core.Windows: if containerUser.Linux != nil { - allErrors = append(allErrors, field.Forbidden(fldPath.Index(i).Child("linux"), "cannot be set for a windows pod")) + allErrors = append(allErrors, field.Forbidden(fldPath.Index(i).Child("user").Child("linux"), "cannot be set for a windows pod")) } case core.Linux: - allErrors = append(allErrors, validateLinuxContainerUser(containerUser.Linux, fldPath.Index(i).Child("linux"))...) + allErrors = append(allErrors, validateLinuxContainerUser(containerUser.Linux, fldPath.Index(i).Child("user").Child("linux"))...) } } return allErrors @@ -8605,3 +8806,44 @@ func validateImageVolumeSource(imageVolume *core.ImageVolumeSource, fldPath *fie allErrs = append(allErrs, validatePullPolicy(imageVolume.PullPolicy, fldPath.Child("pullPolicy"))...) return allErrs } + +// isRestartableInitContainer returns true if the container has ContainerRestartPolicyAlways. +func isRestartableInitContainer(initContainer *core.Container) bool { + if initContainer == nil || initContainer.RestartPolicy == nil { + return false + } + return *initContainer.RestartPolicy == core.ContainerRestartPolicyAlways +} + +// IsValidIPForLegacyField is a wrapper around validation.IsValidIPForLegacyField that +// handles setting strictValidation correctly. This is only for fields that use legacy IP +// address validation; use validation.IsValidIP for new fields. +func IsValidIPForLegacyField(fldPath *field.Path, value string, validOldIPs []string) field.ErrorList { + return validation.IsValidIPForLegacyField(fldPath, value, utilfeature.DefaultFeatureGate.Enabled(features.StrictIPCIDRValidation), validOldIPs) +} + +// IsValidCIDRForLegacyField is a wrapper around validation.IsValidCIDRForLegacyField that +// handles setting strictValidation correctly. This is only for fields that use legacy CIDR +// value validation; use validation.IsValidCIDR for new fields. +func IsValidCIDRForLegacyField(fldPath *field.Path, value string, validOldCIDRs []string) field.ErrorList { + return validation.IsValidCIDRForLegacyField(fldPath, value, utilfeature.DefaultFeatureGate.Enabled(features.StrictIPCIDRValidation), validOldCIDRs) +} + +func validateNodeSwapStatus(nodeSwapStatus *core.NodeSwapStatus, fldPath *field.Path) field.ErrorList { + allErrors := field.ErrorList{} + + if nodeSwapStatus == nil { + return allErrors + } + + if nodeSwapStatus.Capacity != nil { + capacityFld := fldPath.Child("capacity") + + errs := ValidatePositiveField(*nodeSwapStatus.Capacity, capacityFld) + if len(errs) > 0 { + allErrors = append(allErrors, errs...) + } + } + + return allErrors +} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/zz_generated.deepcopy.go index a9d32c1ca..3dee0599b 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/zz_generated.deepcopy.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/core/zz_generated.deepcopy.go @@ -1055,6 +1055,11 @@ func (in *ContainerStatus) DeepCopyInto(out *ContainerStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.StopSignal != nil { + in, out := &in.StopSignal, &out.StopSignal + *out = new(Signal) + **out = **in + } return } @@ -2101,6 +2106,11 @@ func (in *Lifecycle) DeepCopyInto(out *Lifecycle) { *out = new(LifecycleHandler) (*in).DeepCopyInto(*out) } + if in.StopSignal != nil { + in, out := &in.StopSignal, &out.StopSignal + *out = new(Signal) + **out = **in + } return } @@ -3004,7 +3014,7 @@ func (in *NodeStatus) DeepCopyInto(out *NodeStatus) { copy(*out, *in) } out.DaemonEndpoints = in.DaemonEndpoints - out.NodeInfo = in.NodeInfo + in.NodeInfo.DeepCopyInto(&out.NodeInfo) if in.Images != nil { in, out := &in.Images, &out.Images *out = make([]ContainerImage, len(*in)) @@ -3052,9 +3062,35 @@ func (in *NodeStatus) DeepCopy() *NodeStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeSwapStatus) DeepCopyInto(out *NodeSwapStatus) { + *out = *in + if in.Capacity != nil { + in, out := &in.Capacity, &out.Capacity + *out = new(int64) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeSwapStatus. +func (in *NodeSwapStatus) DeepCopy() *NodeSwapStatus { + if in == nil { + return nil + } + out := new(NodeSwapStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodeSystemInfo) DeepCopyInto(out *NodeSystemInfo) { *out = *in + if in.Swap != nil { + in, out := &in.Swap, &out.Swap + *out = new(NodeSwapStatus) + (*in).DeepCopyInto(*out) + } return } @@ -4920,6 +4956,11 @@ func (in *ReplicationControllerList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ReplicationControllerSpec) DeepCopyInto(out *ReplicationControllerSpec) { *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } if in.Selector != nil { in, out := &in.Selector, &out.Selector *out = make(map[string]string, len(*in)) diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/extensions/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/extensions/doc.go index d97cffdbc..a48d5d279 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/extensions/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/extensions/doc.go @@ -16,4 +16,4 @@ limitations under the License. // +k8s:deepcopy-gen=package -package extensions // import "k8s.io/kubernetes/pkg/apis/extensions" +package extensions diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/networking/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/networking/doc.go index 218cd6c2f..a26b8a07f 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/networking/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/networking/doc.go @@ -17,4 +17,4 @@ limitations under the License. // +k8s:deepcopy-gen=package // +groupName=networking.k8s.io -package networking // import "k8s.io/kubernetes/pkg/apis/networking" +package networking diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/apis/scheduling/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/apis/scheduling/doc.go index bab0ae332..399bb1e1b 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/apis/scheduling/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/apis/scheduling/doc.go @@ -17,4 +17,4 @@ limitations under the License. // +k8s:deepcopy-gen=package // +groupName=scheduling.k8s.io -package scheduling // import "k8s.io/kubernetes/pkg/apis/scheduling" +package scheduling diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/capabilities/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/capabilities/doc.go index e8d3aa3e5..68db7faa2 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/capabilities/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/capabilities/doc.go @@ -15,4 +15,4 @@ limitations under the License. */ // Package capabilities manages system level capabilities -package capabilities // import "k8s.io/kubernetes/pkg/capabilities" +package capabilities diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/cluster/ports/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/cluster/ports/doc.go deleted file mode 100644 index 0810294e0..000000000 --- a/e2e/vendor/k8s.io/kubernetes/pkg/cluster/ports/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -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 ports defines ports used by various pieces of the kubernetes -// infrastructure. -package ports // import "k8s.io/kubernetes/pkg/cluster/ports" diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/cluster/ports/ports.go b/e2e/vendor/k8s.io/kubernetes/pkg/cluster/ports/ports.go deleted file mode 100644 index 01f9f2dbd..000000000 --- a/e2e/vendor/k8s.io/kubernetes/pkg/cluster/ports/ports.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -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 ports - -import ( - cpoptions "k8s.io/cloud-provider/options" -) - -// In this file, we can see all default port of cluster. -// It's also an important documentation for us. So don't remove them easily. -const ( - // ProxyStatusPort is the default port for the proxy metrics server. - // May be overridden by a flag at startup. - ProxyStatusPort = 10249 - // KubeletPort is the default port for the kubelet server on each host machine. - // May be overridden by a flag at startup. - KubeletPort = 10250 - // KubeletReadOnlyPort exposes basic read-only services from the kubelet. - // May be overridden by a flag at startup. - // This is necessary for heapster to collect monitoring stats from the kubelet - // until heapster can transition to using the SSL endpoint. - // TODO(roberthbailey): Remove this once we have a better solution for heapster. - KubeletReadOnlyPort = 10255 - // KubeletHealthzPort exposes a healthz endpoint from the kubelet. - // May be overridden by a flag at startup. - KubeletHealthzPort = 10248 - // ProxyHealthzPort is the default port for the proxy healthz server. - // May be overridden by a flag at startup. - ProxyHealthzPort = 10256 - // KubeControllerManagerPort is the default port for the controller manager status server. - // May be overridden by a flag at startup. - KubeControllerManagerPort = 10257 - // CloudControllerManagerPort is the default port for the cloud controller manager server. - // This value may be overridden by a flag at startup. - CloudControllerManagerPort = 10258 - // CloudControllerManagerWebhookPort is the default port for the cloud - // controller manager webhook server. May be overridden by a flag at - // startup. - CloudControllerManagerWebhookPort = cpoptions.CloudControllerManagerWebhookPort -) diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/controller/controller_utils.go b/e2e/vendor/k8s.io/kubernetes/pkg/controller/controller_utils.go index ffd99ed12..2dc46a46a 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/controller/controller_utils.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/controller/controller_utils.go @@ -83,6 +83,16 @@ const ( // The number of batches is given by: // 1+floor(log_2(ceil(N/SlowStartInitialBatchSize))) SlowStartInitialBatchSize = 1 + + // PodNodeNameKeyIndex is the name of the index used by PodInformer to index pods by their node name. + PodNodeNameKeyIndex = "spec.nodeName" + + // OrphanPodIndexKey is used to index all Orphan pods to this key + OrphanPodIndexKey = "_ORPHAN_POD" + + // podControllerUIDIndex is the name for the Pod store's index function, + // which is to index by pods's controllerUID. + PodControllerUIDIndex = "podControllerUID" ) var UpdateTaintBackoff = wait.Backoff{ @@ -973,14 +983,27 @@ func compareMaxContainerRestarts(pi *v1.Pod, pj *v1.Pod) *bool { return nil } +// FilterClaimedPods returns pods that are controlled by the controller and match the selector. +func FilterClaimedPods(controller metav1.Object, selector labels.Selector, pods []*v1.Pod) []*v1.Pod { + var result []*v1.Pod + for _, pod := range pods { + if !metav1.IsControlledBy(pod, controller) { + // It's an orphan or owned by someone else. + continue + } + if selector.Matches(labels.Set(pod.Labels)) { + result = append(result, pod) + } + } + return result +} + // FilterActivePods returns pods that have not terminated. func FilterActivePods(logger klog.Logger, pods []*v1.Pod) []*v1.Pod { var result []*v1.Pod for _, p := range pods { if IsPodActive(p) { result = append(result, p) - } else { - logger.V(4).Info("Ignoring inactive pod", "pod", klog.KObj(p), "phase", p.Status.Phase, "deletionTime", klog.SafePtr(p.DeletionTimestamp)) } } return result @@ -1038,6 +1061,52 @@ func FilterReplicaSets(RSes []*apps.ReplicaSet, filterFn filterRS) []*apps.Repli return filtered } +// AddPodNodeNameIndexer adds an indexer for Pod's nodeName to the given PodInformer. +// This indexer is used to efficiently look up pods by their node name. +func AddPodNodeNameIndexer(podInformer cache.SharedIndexInformer) error { + if _, exists := podInformer.GetIndexer().GetIndexers()[PodNodeNameKeyIndex]; exists { + // indexer already exists, do nothing + return nil + } + + return podInformer.AddIndexers(cache.Indexers{ + PodNodeNameKeyIndex: func(obj interface{}) ([]string, error) { + pod, ok := obj.(*v1.Pod) + if !ok { + return []string{}, nil + } + if len(pod.Spec.NodeName) == 0 { + return []string{}, nil + } + return []string{pod.Spec.NodeName}, nil + }, + }) +} + +// AddPodControllerUIDIndexer adds an indexer for Pod's controllerRef.UID to the given PodInformer. +// This indexer is used to efficiently look up pods by their ControllerRef.UID +func AddPodControllerUIDIndexer(podInformer cache.SharedIndexInformer) error { + if _, exists := podInformer.GetIndexer().GetIndexers()[PodControllerUIDIndex]; exists { + // indexer already exists, do nothing + return nil + } + return podInformer.AddIndexers(cache.Indexers{ + PodControllerUIDIndex: func(obj interface{}) ([]string, error) { + pod, ok := obj.(*v1.Pod) + if !ok { + return nil, nil + } + // Get the ControllerRef of the Pod to check if it's managed by a controller + if ref := metav1.GetControllerOf(pod); ref != nil { + return []string{string(ref.UID)}, nil + } + // If the Pod has no controller (i.e., it's orphaned), index it with the OrphanPodIndexKey + // This helps identify orphan pods for reconciliation and adoption by controllers + return []string{OrphanPodIndexKey}, nil + }, + }) +} + // PodKey returns a key unique to the given pod within a cluster. // It's used so we consistently use the same key scheme in this module. // It does exactly what cache.MetaNamespaceKeyFunc would have done diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/controller/deployment/util/deployment_util.go b/e2e/vendor/k8s.io/kubernetes/pkg/controller/deployment/util/deployment_util.go index 341d0a9e4..473812a12 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/controller/deployment/util/deployment_util.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/controller/deployment/util/deployment_util.go @@ -714,6 +714,26 @@ func GetAvailableReplicaCountForReplicaSets(replicaSets []*apps.ReplicaSet) int3 return totalAvailableReplicas } +// GetTerminatingReplicaCountForReplicaSets returns the number of terminating pods for all replica sets +// or returns an error if any replica sets have been synced by the controller but do not report their terminating count. +func GetTerminatingReplicaCountForReplicaSets(replicaSets []*apps.ReplicaSet) *int32 { + terminatingReplicas := int32(0) + for _, rs := range replicaSets { + switch { + case rs == nil: + // No-op + case rs.Status.ObservedGeneration == 0 && rs.Status.TerminatingReplicas == nil: + // Replicasets that have never been synced by the controller don't contribute to TerminatingReplicas + case rs.Status.TerminatingReplicas == nil: + // If any replicaset synced by the controller hasn't reported TerminatingReplicas, we cannot calculate a sum + return nil + default: + terminatingReplicas += *rs.Status.TerminatingReplicas + } + } + return &terminatingReplicas +} + // IsRollingUpdate returns true if the strategy type is a rolling update. func IsRollingUpdate(deployment *apps.Deployment) bool { return deployment.Spec.Strategy.Type == apps.RollingUpdateDeploymentStrategyType diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/controller/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/controller/doc.go index 3c5c943da..ded390582 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/controller/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/controller/doc.go @@ -16,4 +16,4 @@ limitations under the License. // Package controller contains code for controllers (like the replication // controller). -package controller // import "k8s.io/kubernetes/pkg/controller" +package controller diff --git a/e2e/vendor/k8s.io/apiserver/pkg/authentication/request/x509/OWNERS b/e2e/vendor/k8s.io/kubernetes/pkg/credentialprovider/OWNERS similarity index 55% rename from e2e/vendor/k8s.io/apiserver/pkg/authentication/request/x509/OWNERS rename to e2e/vendor/k8s.io/kubernetes/pkg/credentialprovider/OWNERS index 3c3b94c58..c4ea6463d 100644 --- a/e2e/vendor/k8s.io/apiserver/pkg/authentication/request/x509/OWNERS +++ b/e2e/vendor/k8s.io/kubernetes/pkg/credentialprovider/OWNERS @@ -1,8 +1,8 @@ # See the OWNERS docs at https://go.k8s.io/owners approvers: - - sig-auth-certificates-approvers + - sig-auth-authenticators-approvers reviewers: - - sig-auth-certificates-reviewers + - sig-auth-authenticators-reviewers labels: - sig/auth diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/credentialprovider/config.go b/e2e/vendor/k8s.io/kubernetes/pkg/credentialprovider/config.go new file mode 100644 index 000000000..203ad14df --- /dev/null +++ b/e2e/vendor/k8s.io/kubernetes/pkg/credentialprovider/config.go @@ -0,0 +1,319 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +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 credentialprovider + +import ( + "encoding/base64" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "os" + "path/filepath" + "strings" + "sync" + + "k8s.io/klog/v2" +) + +const ( + maxReadLength = 10 * 1 << 20 // 10MB +) + +// DockerConfigJSON represents ~/.docker/config.json file info +// see https://github.com/docker/docker/pull/12009 +type DockerConfigJSON struct { + Auths DockerConfig `json:"auths"` + // +optional + HTTPHeaders map[string]string `json:"HttpHeaders,omitempty"` +} + +// DockerConfig represents the config file used by the docker CLI. +// This config that represents the credentials that should be used +// when pulling images from specific image repositories. +type DockerConfig map[string]DockerConfigEntry + +// DockerConfigEntry wraps a docker config as a entry +type DockerConfigEntry struct { + Username string + Password string + Email string + Provider DockerConfigProvider +} + +var ( + preferredPathLock sync.Mutex + preferredPath = "" + workingDirPath = "" + homeDirPath, _ = os.UserHomeDir() + rootDirPath = "/" + homeJSONDirPath = filepath.Join(homeDirPath, ".docker") + rootJSONDirPath = filepath.Join(rootDirPath, ".docker") + + configFileName = ".dockercfg" + configJSONFileName = "config.json" +) + +// SetPreferredDockercfgPath set preferred docker config path +func SetPreferredDockercfgPath(path string) { + preferredPathLock.Lock() + defer preferredPathLock.Unlock() + preferredPath = path +} + +// GetPreferredDockercfgPath get preferred docker config path +func GetPreferredDockercfgPath() string { + preferredPathLock.Lock() + defer preferredPathLock.Unlock() + return preferredPath +} + +// DefaultDockercfgPaths returns default search paths of .dockercfg +func DefaultDockercfgPaths() []string { + return []string{GetPreferredDockercfgPath(), workingDirPath, homeDirPath, rootDirPath} +} + +// DefaultDockerConfigJSONPaths returns default search paths of .docker/config.json +func DefaultDockerConfigJSONPaths() []string { + return []string{GetPreferredDockercfgPath(), workingDirPath, homeJSONDirPath, rootJSONDirPath} +} + +// ReadDockercfgFile attempts to read a legacy dockercfg file from the given paths. +// if searchPaths is empty, the default paths are used. +func ReadDockercfgFile(searchPaths []string) (cfg DockerConfig, err error) { + if len(searchPaths) == 0 { + searchPaths = DefaultDockercfgPaths() + } + + for _, configPath := range searchPaths { + absDockerConfigFileLocation, err := filepath.Abs(filepath.Join(configPath, configFileName)) + if err != nil { + klog.Errorf("while trying to canonicalize %s: %v", configPath, err) + continue + } + klog.V(4).Infof("looking for .dockercfg at %s", absDockerConfigFileLocation) + contents, err := os.ReadFile(absDockerConfigFileLocation) + if os.IsNotExist(err) { + continue + } + if err != nil { + klog.V(4).Infof("while trying to read %s: %v", absDockerConfigFileLocation, err) + continue + } + cfg, err := ReadDockerConfigFileFromBytes(contents) + if err != nil { + klog.V(4).Infof("couldn't get the config from %q contents: %v", absDockerConfigFileLocation, err) + continue + } + + klog.V(4).Infof("found .dockercfg at %s", absDockerConfigFileLocation) + return cfg, nil + + } + return nil, fmt.Errorf("couldn't find valid .dockercfg after checking in %v", searchPaths) +} + +// ReadDockerConfigJSONFile attempts to read a docker config.json file from the given paths. +// if searchPaths is empty, the default paths are used. +func ReadDockerConfigJSONFile(searchPaths []string) (cfg DockerConfig, err error) { + if len(searchPaths) == 0 { + searchPaths = DefaultDockerConfigJSONPaths() + } + for _, configPath := range searchPaths { + absDockerConfigFileLocation, err := filepath.Abs(filepath.Join(configPath, configJSONFileName)) + if err != nil { + klog.Errorf("while trying to canonicalize %s: %v", configPath, err) + continue + } + klog.V(4).Infof("looking for %s at %s", configJSONFileName, absDockerConfigFileLocation) + cfg, err = ReadSpecificDockerConfigJSONFile(absDockerConfigFileLocation) + if err != nil { + if !os.IsNotExist(err) { + klog.V(4).Infof("while trying to read %s: %v", absDockerConfigFileLocation, err) + } + continue + } + klog.V(4).Infof("found valid %s at %s", configJSONFileName, absDockerConfigFileLocation) + return cfg, nil + } + return nil, fmt.Errorf("couldn't find valid %s after checking in %v", configJSONFileName, searchPaths) + +} + +// ReadSpecificDockerConfigJSONFile attempts to read docker configJSON from a given file path. +func ReadSpecificDockerConfigJSONFile(filePath string) (cfg DockerConfig, err error) { + var contents []byte + + if contents, err = os.ReadFile(filePath); err != nil { + return nil, err + } + return readDockerConfigJSONFileFromBytes(contents) +} + +// ReadDockerConfigFile read a docker config file from default path +func ReadDockerConfigFile() (cfg DockerConfig, err error) { + if cfg, err := ReadDockerConfigJSONFile(nil); err == nil { + return cfg, nil + } + // Can't find latest config file so check for the old one + return ReadDockercfgFile(nil) +} + +// HTTPError wraps a non-StatusOK error code as an error. +type HTTPError struct { + StatusCode int + URL string +} + +// Error implements error +func (he *HTTPError) Error() string { + return fmt.Sprintf("http status code: %d while fetching url %s", + he.StatusCode, he.URL) +} + +// ReadURL read contents from given url +func ReadURL(url string, client *http.Client, header *http.Header) (body []byte, err error) { + req, err := http.NewRequest("GET", url, nil) + if err != nil { + return nil, err + } + if header != nil { + req.Header = *header + } + resp, err := client.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + klog.V(2).InfoS("Failed to read URL", "statusCode", resp.StatusCode, "URL", url) + return nil, &HTTPError{ + StatusCode: resp.StatusCode, + URL: url, + } + } + + limitedReader := &io.LimitedReader{R: resp.Body, N: maxReadLength} + contents, err := io.ReadAll(limitedReader) + if err != nil { + return nil, err + } + + if limitedReader.N <= 0 { + return nil, errors.New("the read limit is reached") + } + + return contents, nil +} + +// ReadDockerConfigFileFromBytes read a docker config file from the given bytes +func ReadDockerConfigFileFromBytes(contents []byte) (cfg DockerConfig, err error) { + if err = json.Unmarshal(contents, &cfg); err != nil { + return nil, errors.New("error occurred while trying to unmarshal json") + } + return +} + +func readDockerConfigJSONFileFromBytes(contents []byte) (cfg DockerConfig, err error) { + var cfgJSON DockerConfigJSON + if err = json.Unmarshal(contents, &cfgJSON); err != nil { + return nil, errors.New("error occurred while trying to unmarshal json") + } + cfg = cfgJSON.Auths + return +} + +// dockerConfigEntryWithAuth is used solely for deserializing the Auth field +// into a dockerConfigEntry during JSON deserialization. +type dockerConfigEntryWithAuth struct { + // +optional + Username string `json:"username,omitempty"` + // +optional + Password string `json:"password,omitempty"` + // +optional + Email string `json:"email,omitempty"` + // +optional + Auth string `json:"auth,omitempty"` +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (ident *DockerConfigEntry) UnmarshalJSON(data []byte) error { + var tmp dockerConfigEntryWithAuth + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + ident.Username = tmp.Username + ident.Password = tmp.Password + ident.Email = tmp.Email + + if len(tmp.Auth) == 0 { + return nil + } + + ident.Username, ident.Password, err = decodeDockerConfigFieldAuth(tmp.Auth) + return err +} + +// MarshalJSON implements the json.Marshaler interface. +func (ident DockerConfigEntry) MarshalJSON() ([]byte, error) { + toEncode := dockerConfigEntryWithAuth{ident.Username, ident.Password, ident.Email, ""} + toEncode.Auth = encodeDockerConfigFieldAuth(ident.Username, ident.Password) + + return json.Marshal(toEncode) +} + +// decodeDockerConfigFieldAuth deserializes the "auth" field from dockercfg into a +// username and a password. The format of the auth field is base64(:). +func decodeDockerConfigFieldAuth(field string) (username, password string, err error) { + + var decoded []byte + + // StdEncoding can only decode padded string + // RawStdEncoding can only decode unpadded string + if strings.HasSuffix(strings.TrimSpace(field), "=") { + // decode padded data + decoded, err = base64.StdEncoding.DecodeString(field) + } else { + // decode unpadded data + decoded, err = base64.RawStdEncoding.DecodeString(field) + } + + if err != nil { + return + } + + parts := strings.SplitN(string(decoded), ":", 2) + if len(parts) != 2 { + err = fmt.Errorf("unable to parse auth field, must be formatted as base64(username:password)") + return + } + + username = parts[0] + password = parts[1] + + return +} + +func encodeDockerConfigFieldAuth(username, password string) string { + fieldValue := username + ":" + password + + return base64.StdEncoding.EncodeToString([]byte(fieldValue)) +} diff --git a/e2e/vendor/k8s.io/apiserver/pkg/endpoints/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/credentialprovider/doc.go similarity index 77% rename from e2e/vendor/k8s.io/apiserver/pkg/endpoints/doc.go rename to e2e/vendor/k8s.io/kubernetes/pkg/credentialprovider/doc.go index f92c0e95f..41c12410f 100644 --- a/e2e/vendor/k8s.io/apiserver/pkg/endpoints/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/credentialprovider/doc.go @@ -14,5 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package endpoints contains the generic code that provides a RESTful Kubernetes-style API service. -package endpoints +// Package credentialprovider supplies interfaces and implementations for +// docker registry providers to expose their authentication scheme. +package credentialprovider diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/credentialprovider/keyring.go b/e2e/vendor/k8s.io/kubernetes/pkg/credentialprovider/keyring.go new file mode 100644 index 000000000..63005f632 --- /dev/null +++ b/e2e/vendor/k8s.io/kubernetes/pkg/credentialprovider/keyring.go @@ -0,0 +1,367 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +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 credentialprovider + +import ( + "crypto/sha256" + "encoding/hex" + "encoding/json" + "net" + "net/url" + "path/filepath" + "sort" + "strings" + + "k8s.io/apimachinery/pkg/util/sets" + utilfeature "k8s.io/apiserver/pkg/util/feature" + "k8s.io/klog/v2" + "k8s.io/kubernetes/pkg/features" +) + +// DockerKeyring tracks a set of docker registry credentials, maintaining a +// reverse index across the registry endpoints. A registry endpoint is made +// up of a host (e.g. registry.example.com), but it may also contain a path +// (e.g. registry.example.com/foo) This index is important for two reasons: +// - registry endpoints may overlap, and when this happens we must find the +// most specific match for a given image +// - iterating a map does not yield predictable results +type DockerKeyring interface { + Lookup(image string) ([]TrackedAuthConfig, bool) +} + +// BasicDockerKeyring is a trivial map-backed implementation of DockerKeyring +type BasicDockerKeyring struct { + index []string + creds map[string][]TrackedAuthConfig +} + +// providersDockerKeyring is an implementation of DockerKeyring that +// materializes its dockercfg based on a set of dockerConfigProviders. +type providersDockerKeyring struct { + Providers []DockerConfigProvider +} + +// TrackedAuthConfig wraps the AuthConfig and adds information about the source +// of the credentials. +type TrackedAuthConfig struct { + AuthConfig + AuthConfigHash string + + Source *CredentialSource +} + +// NewTrackedAuthConfig initializes the TrackedAuthConfig structure by adding +// the source information to the supplied AuthConfig. It also counts a hash of the +// AuthConfig and keeps it in the returned structure. +// +// The supplied CredentialSource is only used when the "KubeletEnsureSecretPulledImages" +// is enabled, the same applies for counting the hash. +func NewTrackedAuthConfig(c *AuthConfig, src *CredentialSource) *TrackedAuthConfig { + if c == nil { + panic("cannot construct TrackedAuthConfig with a nil AuthConfig") + } + + authConfig := &TrackedAuthConfig{ + AuthConfig: *c, + } + + if utilfeature.DefaultFeatureGate.Enabled(features.KubeletEnsureSecretPulledImages) { + authConfig.Source = src + authConfig.AuthConfigHash = hashAuthConfig(c) + } + return authConfig +} + +type CredentialSource struct { + Secret SecretCoordinates +} + +type SecretCoordinates struct { + UID string + Namespace string + Name string +} + +// AuthConfig contains authorization information for connecting to a Registry +// This type mirrors "github.com/docker/docker/api/types.AuthConfig" +type AuthConfig struct { + Username string `json:"username,omitempty"` + Password string `json:"password,omitempty"` + Auth string `json:"auth,omitempty"` + + // Email is an optional value associated with the username. + // This field is deprecated and will be removed in a later + // version of docker. + Email string `json:"email,omitempty"` + + ServerAddress string `json:"serveraddress,omitempty"` + + // IdentityToken is used to authenticate the user and get + // an access token for the registry. + IdentityToken string `json:"identitytoken,omitempty"` + + // RegistryToken is a bearer token to be sent to a registry + RegistryToken string `json:"registrytoken,omitempty"` +} + +// Add inserts the docker config `cfg` into the basic docker keyring. It attaches +// the `src` information that describes where the docker config `cfg` comes from. +// `src` is nil if the docker config is globally available on the node. +func (dk *BasicDockerKeyring) Add(src *CredentialSource, cfg DockerConfig) { + if dk.index == nil { + dk.index = make([]string, 0) + dk.creds = make(map[string][]TrackedAuthConfig) + } + for loc, ident := range cfg { + creds := AuthConfig{ + Username: ident.Username, + Password: ident.Password, + Email: ident.Email, + } + + value := loc + if !strings.HasPrefix(value, "https://") && !strings.HasPrefix(value, "http://") { + value = "https://" + value + } + parsed, err := url.Parse(value) + if err != nil { + klog.Errorf("Entry %q in dockercfg invalid (%v), ignoring", loc, err) + continue + } + + // The docker client allows exact matches: + // foo.bar.com/namespace + // Or hostname matches: + // foo.bar.com + // It also considers /v2/ and /v1/ equivalent to the hostname + // See ResolveAuthConfig in docker/registry/auth.go. + effectivePath := parsed.Path + if strings.HasPrefix(effectivePath, "/v2/") || strings.HasPrefix(effectivePath, "/v1/") { + effectivePath = effectivePath[3:] + } + var key string + if (len(effectivePath) > 0) && (effectivePath != "/") { + key = parsed.Host + effectivePath + } else { + key = parsed.Host + } + trackedCreds := NewTrackedAuthConfig(&creds, src) + + dk.creds[key] = append(dk.creds[key], *trackedCreds) + dk.index = append(dk.index, key) + } + + eliminateDupes := sets.NewString(dk.index...) + dk.index = eliminateDupes.List() + + // Update the index used to identify which credentials to use for a given + // image. The index is reverse-sorted so more specific paths are matched + // first. For example, if for the given image "gcr.io/etcd-development/etcd", + // credentials for "quay.io/coreos" should match before "quay.io". + sort.Sort(sort.Reverse(sort.StringSlice(dk.index))) +} + +const ( + defaultRegistryHost = "index.docker.io" + defaultRegistryKey = defaultRegistryHost + "/v1/" +) + +// isDefaultRegistryMatch determines whether the given image will +// pull from the default registry (DockerHub) based on the +// characteristics of its name. +func isDefaultRegistryMatch(image string) bool { + parts := strings.SplitN(image, "/", 2) + + if len(parts[0]) == 0 { + return false + } + + if len(parts) == 1 { + // e.g. library/ubuntu + return true + } + + if parts[0] == "docker.io" || parts[0] == "index.docker.io" { + // resolve docker.io/image and index.docker.io/image as default registry + return true + } + + // From: http://blog.docker.com/2013/07/how-to-use-your-own-registry/ + // Docker looks for either a “.” (domain separator) or “:” (port separator) + // to learn that the first part of the repository name is a location and not + // a user name. + return !strings.ContainsAny(parts[0], ".:") +} + +// ParseSchemelessURL parses a schemeless url and returns a url.URL +// url.Parse require a scheme, but ours don't have schemes. Adding a +// scheme to make url.Parse happy, then clear out the resulting scheme. +func ParseSchemelessURL(schemelessURL string) (*url.URL, error) { + parsed, err := url.Parse("https://" + schemelessURL) + if err != nil { + return nil, err + } + // clear out the resulting scheme + parsed.Scheme = "" + return parsed, nil +} + +// SplitURL splits the host name into parts, as well as the port +func SplitURL(url *url.URL) (parts []string, port string) { + host, port, err := net.SplitHostPort(url.Host) + if err != nil { + // could not parse port + host, port = url.Host, "" + } + return strings.Split(host, "."), port +} + +// URLsMatchStr is wrapper for URLsMatch, operating on strings instead of URLs. +func URLsMatchStr(glob string, target string) (bool, error) { + globURL, err := ParseSchemelessURL(glob) + if err != nil { + return false, err + } + targetURL, err := ParseSchemelessURL(target) + if err != nil { + return false, err + } + return URLsMatch(globURL, targetURL) +} + +// URLsMatch checks whether the given target url matches the glob url, which may have +// glob wild cards in the host name. +// +// Examples: +// +// globURL=*.docker.io, targetURL=blah.docker.io => match +// globURL=*.docker.io, targetURL=not.right.io => no match +// +// Note that we don't support wildcards in ports and paths yet. +func URLsMatch(globURL *url.URL, targetURL *url.URL) (bool, error) { + globURLParts, globPort := SplitURL(globURL) + targetURLParts, targetPort := SplitURL(targetURL) + if globPort != targetPort { + // port doesn't match + return false, nil + } + if len(globURLParts) != len(targetURLParts) { + // host name does not have the same number of parts + return false, nil + } + if !strings.HasPrefix(targetURL.Path, globURL.Path) { + // the path of the credential must be a prefix + return false, nil + } + for k, globURLPart := range globURLParts { + targetURLPart := targetURLParts[k] + matched, err := filepath.Match(globURLPart, targetURLPart) + if err != nil { + return false, err + } + if !matched { + // glob mismatch for some part + return false, nil + } + } + // everything matches + return true, nil +} + +// Lookup implements the DockerKeyring method for fetching credentials based on image name. +// Multiple credentials may be returned if there are multiple potentially valid credentials +// available. This allows for rotation. +func (dk *BasicDockerKeyring) Lookup(image string) ([]TrackedAuthConfig, bool) { + // range over the index as iterating over a map does not provide a predictable ordering + ret := []TrackedAuthConfig{} + for _, k := range dk.index { + // both k and image are schemeless URLs because even though schemes are allowed + // in the credential configurations, we remove them in Add. + if matched, _ := URLsMatchStr(k, image); matched { + ret = append(ret, dk.creds[k]...) + } + } + + if len(ret) > 0 { + return ret, true + } + + // Use credentials for the default registry if provided, and appropriate + if isDefaultRegistryMatch(image) { + if auth, ok := dk.creds[defaultRegistryHost]; ok { + return auth, true + } + } + + return []TrackedAuthConfig{}, false +} + +// Lookup implements the DockerKeyring method for fetching credentials +// based on image name. +func (dk *providersDockerKeyring) Lookup(image string) ([]TrackedAuthConfig, bool) { + keyring := &BasicDockerKeyring{} + + for _, p := range dk.Providers { + // TODO: the source should probably change once we depend on service accounts (KEP-4412). + // Perhaps `Provide()` should return the source modified to accommodate this? + keyring.Add(nil, p.Provide(image)) + } + + return keyring.Lookup(image) +} + +// FakeKeyring a fake config credentials +type FakeKeyring struct { + auth []TrackedAuthConfig + ok bool +} + +// Lookup implements the DockerKeyring method for fetching credentials based on image name +// return fake auth and ok +func (f *FakeKeyring) Lookup(image string) ([]TrackedAuthConfig, bool) { + return f.auth, f.ok +} + +// UnionDockerKeyring delegates to a set of keyrings. +type UnionDockerKeyring []DockerKeyring + +// Lookup implements the DockerKeyring method for fetching credentials based on image name. +// return each credentials +func (k UnionDockerKeyring) Lookup(image string) ([]TrackedAuthConfig, bool) { + authConfigs := []TrackedAuthConfig{} + for _, subKeyring := range k { + if subKeyring == nil { + continue + } + + currAuthResults, _ := subKeyring.Lookup(image) + authConfigs = append(authConfigs, currAuthResults...) + } + + return authConfigs, (len(authConfigs) > 0) +} + +func hashAuthConfig(creds *AuthConfig) string { + credBytes, err := json.Marshal(creds) + if err != nil { + return "" + } + + hash := sha256.New() + hash.Write([]byte(credBytes)) + return hex.EncodeToString(hash.Sum(nil)) +} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/credentialprovider/provider.go b/e2e/vendor/k8s.io/kubernetes/pkg/credentialprovider/provider.go new file mode 100644 index 000000000..636f94242 --- /dev/null +++ b/e2e/vendor/k8s.io/kubernetes/pkg/credentialprovider/provider.go @@ -0,0 +1,113 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +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 credentialprovider + +import ( + "os" + "reflect" + "sync" + "time" + + "k8s.io/klog/v2" +) + +// DockerConfigProvider is the interface that registered extensions implement +// to materialize 'dockercfg' credentials. +type DockerConfigProvider interface { + // Enabled returns true if the config provider is enabled. + // Implementations can be blocking - e.g. metadata server unavailable. + Enabled() bool + // Provide returns docker configuration. + // Implementations can be blocking - e.g. metadata server unavailable. + // The image is passed in as context in the event that the + // implementation depends on information in the image name to return + // credentials; implementations are safe to ignore the image. + Provide(image string) DockerConfig +} + +// A DockerConfigProvider that simply reads the .dockercfg file +type defaultDockerConfigProvider struct{} + +// CachingDockerConfigProvider implements DockerConfigProvider by composing +// with another DockerConfigProvider and caching the DockerConfig it provides +// for a pre-specified lifetime. +type CachingDockerConfigProvider struct { + Provider DockerConfigProvider + Lifetime time.Duration + + // ShouldCache is an optional function that returns true if the specific config should be cached. + // If nil, all configs are treated as cacheable. + ShouldCache func(DockerConfig) bool + + // cache fields + cacheDockerConfig DockerConfig + expiration time.Time + mu sync.Mutex +} + +// Enabled implements dockerConfigProvider +func (d *defaultDockerConfigProvider) Enabled() bool { + return true +} + +// Provide implements dockerConfigProvider +func (d *defaultDockerConfigProvider) Provide(image string) DockerConfig { + // Read the standard Docker credentials from .dockercfg + if cfg, err := ReadDockerConfigFile(); err == nil { + return cfg + } else if !os.IsNotExist(err) { + klog.V(2).Infof("Docker config file not found: %v", err) + } + return DockerConfig{} +} + +// Enabled implements dockerConfigProvider +func (d *CachingDockerConfigProvider) Enabled() bool { + return d.Provider.Enabled() +} + +// Provide implements dockerConfigProvider +func (d *CachingDockerConfigProvider) Provide(image string) DockerConfig { + d.mu.Lock() + defer d.mu.Unlock() + + // If the cache hasn't expired, return our cache + if time.Now().Before(d.expiration) { + return d.cacheDockerConfig + } + + klog.V(2).Infof("Refreshing cache for provider: %v", reflect.TypeOf(d.Provider).String()) + config := d.Provider.Provide(image) + if d.ShouldCache == nil || d.ShouldCache(config) { + d.cacheDockerConfig = config + d.expiration = time.Now().Add(d.Lifetime) + } + return config +} + +// NewDefaultDockerKeyring creates a DockerKeyring to use for resolving credentials, +// which returns the default credentials from the .dockercfg file. +func NewDefaultDockerKeyring() DockerKeyring { + return &providersDockerKeyring{ + Providers: []DockerConfigProvider{ + &CachingDockerConfigProvider{ + Provider: &defaultDockerConfigProvider{}, + Lifetime: 5 * time.Minute, + }, + }, + } +} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/features/client_adapter.go b/e2e/vendor/k8s.io/kubernetes/pkg/features/client_adapter.go index a24a1f873..00a0fd92a 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/features/client_adapter.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/features/client_adapter.go @@ -65,7 +65,7 @@ func (a *clientAdapter) Add(in map[clientfeatures.Feature]clientfeatures.Feature } out[featuregate.Feature(name)] = converted } - return a.mfg.Add(out) + return a.mfg.Add(out) //nolint:forbidigo // No need to support versioned feature gates in client adapter } // Set implements the unexported interface that client-go feature gate testing expects for diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/features/kube_features.go b/e2e/vendor/k8s.io/kubernetes/pkg/features/kube_features.go index 262f396b8..c942dfea9 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/features/kube_features.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/features/kube_features.go @@ -17,11 +17,15 @@ limitations under the License. package features import ( + apiextensionsfeatures "k8s.io/apiextensions-apiserver/pkg/features" "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/apimachinery/pkg/util/version" + genericfeatures "k8s.io/apiserver/pkg/features" utilfeature "k8s.io/apiserver/pkg/util/feature" clientfeatures "k8s.io/client-go/features" "k8s.io/component-base/featuregate" zpagesfeatures "k8s.io/component-base/zpages/features" + kcmfeatures "k8s.io/controller-manager/pkg/features" ) const ( @@ -37,20 +41,17 @@ const ( // across the file. // owner: @aojea - // Deprecated: v1.31 // // Allow kubelet to request a certificate without any Node IP available, only // with DNS names. AllowDNSOnlyNodeCSR featuregate.Feature = "AllowDNSOnlyNodeCSR" // owner: @HirazawaUi - // Deprecated: v1.32 // // Allow spec.terminationGracePeriodSeconds to be overridden by MaxPodGracePeriodSeconds in soft evictions. AllowOverwriteTerminationGracePeriodSeconds featuregate.Feature = "AllowOverwriteTerminationGracePeriodSeconds" // owner: @thockin - // Deprecated: v1.29 // // Enables Service.status.ingress.loadBanace to be set on // services of types other than LoadBalancer. @@ -61,14 +62,8 @@ const ( // Enables usage of any object for volume data source in PVCs AnyVolumeDataSource featuregate.Feature = "AnyVolumeDataSource" - // owner: @tallclair - AppArmor featuregate.Feature = "AppArmor" - - // owner: @tallclair - AppArmorFields featuregate.Feature = "AppArmorFields" - // owner: @liggitt - // kep: + // kep: https://kep.k8s.io/4601 // // Make the Node authorizer use fine-grained selector authorization. // Requires AuthorizeWithSelectors to be enabled. @@ -84,16 +79,16 @@ const ( // Enable ClusterTrustBundle Kubelet projected volumes. Depends on ClusterTrustBundle. ClusterTrustBundleProjection featuregate.Feature = "ClusterTrustBundleProjection" + // owner: @sreeram-venkitesh + // + // Enables configuring custom stop signals for containers from container lifecycle + ContainerStopSignals featuregate.Feature = "ContainerStopSignals" + // owner: @szuecs // // Enable nodes to change CPUCFSQuotaPeriod CPUCFSQuotaPeriod featuregate.Feature = "CustomCPUCFSQuotaPeriod" - // owner: @ConnorDoyle, @fromanirh (only for GA graduation) - // - // Alternative container-level CPU affinity policies. - CPUManager featuregate.Feature = "CPUManager" - // owner: @fromanirh // beta: see below. // @@ -119,7 +114,7 @@ const ( // for details about the removal of this feature gate. CPUManagerPolicyBetaOptions featuregate.Feature = "CPUManagerPolicyBetaOptions" - // owner: @fromanirh + // owner: @ffromani // // Allow the usage of options to fine-tune the cpumanager policies. CPUManagerPolicyOptions featuregate.Feature = "CPUManagerPolicyOptions" @@ -159,6 +154,34 @@ const ( // Enable usage of Provision of PVCs from snapshots in other namespaces CrossNamespaceVolumeDataSource featuregate.Feature = "CrossNamespaceVolumeDataSource" + // owner: @jpbetz @aaron-prindle @yongruilin + // kep: http://kep.k8s.io/5073 + // beta: v1.33 + // + // Enables running declarative validation of APIs, where declared. When enabled, APIs with + // declarative validation rules will validate objects using the generated + // declarative validation code and compare the results to the regular imperative validation. + // See DeclarativeValidationTakeover for more. + DeclarativeValidation featuregate.Feature = "DeclarativeValidation" + + // owner: @jpbetz @aaron-prindle @yongruilin + // kep: http://kep.k8s.io/5073 + // beta: v1.33 + // + // When enabled, declarative validation errors are returned directly to the caller, + // replacing hand-written validation errors for rules that have declarative implementations. + // When disabled, hand-written validation errors are always returned, effectively putting + // declarative validation in a "shadow mode" that monitors but does not affect API responses. + // Note: Although declarative validation aims for functional equivalence with hand-written validation, + // the exact number, format, and content of error messages may differ between the two approaches. + DeclarativeValidationTakeover featuregate.Feature = "DeclarativeValidationTakeover" + + // owner: @atiratree + // kep: http://kep.k8s.io/3973 + // + // Deployments and replica sets can now also track terminating pods via .status.terminatingReplicas. + DeploymentReplicaSetTerminatingReplicas featuregate.Feature = "DeploymentReplicaSetTerminatingReplicas" + // owner: @elezar // kep: http://kep.k8s.io/4009 // @@ -172,34 +195,19 @@ const ( // both allocators. This feature gate disables the dual write on the new Cluster IP allocators. DisableAllocatorDualWrite featuregate.Feature = "DisableAllocatorDualWrite" - // owner: @andrewsykim - // - // Disable any functionality in kube-apiserver, kube-controller-manager and kubelet related to the `--cloud-provider` component flag. - DisableCloudProviders featuregate.Feature = "DisableCloudProviders" - - // owner: @andrewsykim - // - // Disable in-tree functionality in kubelet to authenticate to cloud provider container registries for image pull credentials. - DisableKubeletCloudCredentialProviders featuregate.Feature = "DisableKubeletCloudCredentialProviders" - // owner: @micahhausler - // Deprecated: v1.31 // // Setting AllowInsecureKubeletCertificateSigningRequests to true disables node admission validation of CSRs // for kubelet signers where CN=system:node:$nodeName. - // Remove in v1.33 AllowInsecureKubeletCertificateSigningRequests featuregate.Feature = "AllowInsecureKubeletCertificateSigningRequests" // owner: @hoskeri - // Deprecated: v1.32 // // Restores previous behavior where Kubelet fails self registration if node create returns 403 Forbidden. - // Remove in v1.34 KubeletRegistrationGetOnExistsOnly featuregate.Feature = "KubeletRegistrationGetOnExistsOnly" // owner: @HirazawaUi // kep: http://kep.k8s.io/4004 - // Deprecated: v1.31 (default off) // // DisableNodeKubeProxyVersion disable the status.nodeInfo.kubeProxyVersion field of v1.Node DisableNodeKubeProxyVersion featuregate.Feature = "DisableNodeKubeProxyVersion" @@ -216,6 +224,36 @@ const ( // is to move it into a separate KEP. DRAAdminAccess featuregate.Feature = "DRAAdminAccess" + // owner: @pohly + // kep: http://kep.k8s.io/5055 + // + // Marking devices as tainted can prevent using them for new pods and/or + // cause pods using them to stop. Users can decide to tolerate taints. + DRADeviceTaints featuregate.Feature = "DRADeviceTaints" + + // owner: @mortent, @cici37 + // kep: http://kep.k8s.io/4815 + // + // Enables support for dynamically partitioning devices based on + // which parts of them were allocated during scheduling. + // + DRAPartitionableDevices featuregate.Feature = "DRAPartitionableDevices" + + // owner: @mortent + // kep: http://kep.k8s.io/4816 + // + // Enables support for providing a prioritized list of requests + // for resources. The first entry that can be satisfied will + // be selected. + DRAPrioritizedList featuregate.Feature = "DRAPrioritizedList" + + // owner: @LionelJouin + // kep: http://kep.k8s.io/4817 + // + // Enables support the ResourceClaim.status.devices field and for setting this + // status from DRA drivers. + DRAResourceClaimDeviceStatus featuregate.Feature = "DRAResourceClaimDeviceStatus" + // owner: @pohly // kep: http://kep.k8s.io/4381 // @@ -224,16 +262,6 @@ const ( // based on "structured parameters". DynamicResourceAllocation featuregate.Feature = "DynamicResourceAllocation" - // owner: @LionelJouin - // kep: http://kep.k8s.io/4817 - // alpha: v1.32 - // - // Enables support the ResourceClaim.status.devices field and for setting this - // status from DRA drivers. - DRAResourceClaimDeviceStatus featuregate.Feature = "DRAResourceClaimDeviceStatus" - - // owner: @lauralorenz - // kep: https://kep.k8s.io/4603 // owner: @lauralorenz // kep: https://kep.k8s.io/4603 // @@ -255,6 +283,13 @@ const ( // Lock to default and remove after v1.22 based on user feedback that should be reflected in KEP #1972 update ExecProbeTimeout featuregate.Feature = "ExecProbeTimeout" + // owner: @vinayakankugoyal @thockin + // + // Controls if the gitRepo volume plugin is supported or not. + // KEP #5040 disables the gitRepo volume plugin by default starting v1.33, + // this provides a way for users to override it. + GitRepoVolumeDriver featuregate.Feature = "GitRepoVolumeDriver" + // owner: @bobbypage // Adds support for kubelet to detect node shutdown and gracefully terminate pods prior to the node being shutdown. GracefulNodeShutdown featuregate.Feature = "GracefulNodeShutdown" @@ -263,6 +298,12 @@ const ( // Make the kubelet use shutdown configuration based on pod priority values for graceful shutdown. GracefulNodeShutdownBasedOnPodPriority featuregate.Feature = "GracefulNodeShutdownBasedOnPodPriority" + // owner: @jm-franc + // kep: https://kep.k8s.io/4951 + // + // Enables support of configurable HPA scale-up and scale-down tolerances. + HPAConfigurableTolerance featuregate.Feature = "HPAConfigurableTolerance" + // owner: @dxist // // Enables support of HPA scaling to zero pods when an object or custom metric is configured. @@ -284,12 +325,12 @@ const ( // owner: @tallclair // kep: http://kep.k8s.io/1287 // - // Enables the AllocatedResources field in container status. This feature requires + // Deprecated: This feature gate is no longer used. + // Was: Enables the AllocatedResources field in container status. This feature requires // InPlacePodVerticalScaling also be enabled. InPlacePodVerticalScalingAllocatedStatus featuregate.Feature = "InPlacePodVerticalScalingAllocatedStatus" // owner: @tallclair @esotsal - // alpha: v1.32 // // Allow resource resize for containers in Guaranteed pods with integer CPU requests ( default false ). // Applies only in nodes with InPlacePodVerticalScaling and CPU Manager features enabled, and @@ -309,19 +350,10 @@ const ( // owner: @mimowo // kep: https://kep.k8s.io/4368 - // alpha: v1.30 - // beta: v1.32 // // Allows to delegate reconciliation of a Job object to an external controller. JobManagedBy featuregate.Feature = "JobManagedBy" - // owner: @mimowo - // kep: https://kep.k8s.io/3329 - // - // Allow users to specify handling of pod failures based on container exit codes - // and pod conditions. - JobPodFailurePolicy featuregate.Feature = "JobPodFailurePolicy" - // owner: @kannon92 // kep : https://kep.k8s.io/3939 // @@ -346,6 +378,13 @@ const ( // fallback to using it's cgroupDriver option. KubeletCgroupDriverFromCRI featuregate.Feature = "KubeletCgroupDriverFromCRI" + // owner: @stlaz + // kep: https://kep.k8s.io/2535 + // + // Enables tracking credentials for image pulls in order to authorize image + // access for different tenants. + KubeletEnsureSecretPulledImages featuregate.Feature = "KubeletEnsureSecretPulledImages" + // owner: @vinayakankugoyal // kep: http://kep.k8s.io/2862 // @@ -370,6 +409,12 @@ const ( // Enable POD resources API with Get method KubeletPodResourcesGet featuregate.Feature = "KubeletPodResourcesGet" + // KubeletPSI enables Kubelet to surface PSI metrics + // owner: @roycaihw + // kep: https://kep.k8s.io/4205 + // alpha: v1.33 + KubeletPSI featuregate.Feature = "KubeletPSI" + // owner: @kannon92 // kep: https://kep.k8s.io/4191 // @@ -378,18 +423,26 @@ const ( // separate filesystems. KubeletSeparateDiskGC featuregate.Feature = "KubeletSeparateDiskGC" + // owner: @aramase + // kep: http://kep.k8s.io/4412 + // + // Enable kubelet to send the service account token bound to the pod for which the image + // is being pulled to the credential provider plugin. + KubeletServiceAccountTokenForCredentialProviders featuregate.Feature = "KubeletServiceAccountTokenForCredentialProviders" + // owner: @sallyom // kep: https://kep.k8s.io/2832 // // Add support for distributed tracing in the kubelet KubeletTracing featuregate.Feature = "KubeletTracing" - // owner: @alexanderConstantinescu - // kep: http://kep.k8s.io/3836 + // owner: @gjkim42 // - // Implement connection draining for terminating nodes for - // `externalTrafficPolicy: Cluster` services. - KubeProxyDrainingTerminatingNodes featuregate.Feature = "KubeProxyDrainingTerminatingNodes" + // Enable legacy code path in pkg/kubelet/kuberuntime that predates the + // SidecarContainers feature. This temporary feature gate is disabled by + // default and intended to safely remove the redundant code path. This is + // only available in v1.33 and will be removed in v1.34. + LegacySidecarContainers featuregate.Feature = "LegacySidecarContainers" // owner: @RobertKrawitz // @@ -437,6 +490,13 @@ const ( // Enables the dynamic configuration of Service IP ranges MultiCIDRServiceAllocator featuregate.Feature = "MultiCIDRServiceAllocator" + // owner: torredil + // kep: https://kep.k8s.io/4876 + // + // Makes CSINode.Spec.Drivers[*].Allocatable.Count mutable, allowing CSI drivers to + // update the number of volumes that can be allocated on a node + MutableCSINodeAllocatableCount featuregate.Feature = "MutableCSINodeAllocatableCount" + // owner: @danwinship // kep: https://kep.k8s.io/3866 // @@ -462,18 +522,6 @@ const ( // Enables ordered namespace deletion. OrderedNamespaceDeletion featuregate.Feature = "OrderedNamespaceDeletion" - // owner: @mortent, @atiratree, @ravig - // kep: http://kep.k8s.io/3018 - // - // Enables PDBUnhealthyPodEvictionPolicy for PodDisruptionBudgets - PDBUnhealthyPodEvictionPolicy featuregate.Feature = "PDBUnhealthyPodEvictionPolicy" - - // owner: @RomanBednar - // kep: https://kep.k8s.io/3762 - // - // Adds a new field to persistent volumes which holds a timestamp of when the volume last transitioned its phase. - PersistentVolumeLastPhaseTransitionTime featuregate.Feature = "PersistentVolumeLastPhaseTransitionTime" - // owner: @haircommander // kep: https://kep.k8s.io/2364 // @@ -501,7 +549,6 @@ const ( // owner: @knight42 // kep: https://kep.k8s.io/3288 - // alpha: v1.32 // // Enables only stdout or stderr of the container to be retrievd. PodLogsQuerySplitStreams featuregate.Feature = "PodLogsQuerySplitStreams" @@ -524,6 +571,12 @@ const ( // Allows zero value for sleep duration in SleepAction in container lifecycle hooks PodLifecycleSleepActionAllowZero featuregate.Feature = "PodLifecycleSleepActionAllowZero" + // owner: @natasha41575 + // kep: http://kep.k8s.io/5067 + // + // Enables the pod to report status.ObservedGeneration to reflect the generation of the last observed podspec. + PodObservedGenerationTracking featuregate.Feature = "PodObservedGenerationTracking" + // owner: @Huang-Wei // kep: https://kep.k8s.io/3521 // @@ -536,6 +589,12 @@ const ( // Enables PortForward to be proxied with a websocket client PortForwardWebsockets featuregate.Feature = "PortForwardWebsockets" + // owner: @danwinship + // kep: https://kep.k8s.io/3015 + // + // Enables PreferSameZone and PreferSameNode values for trafficDistribution + PreferSameTrafficDistribution featuregate.Feature = "PreferSameTrafficDistribution" + // owner: @jessfraz // // Enables control over ProcMountType for containers. @@ -549,7 +608,6 @@ const ( // owner: @gnufied // kep: https://kep.k8s.io/1790 - // beta - v1.32 // // Allow users to recover from volume expansion failure RecoverVolumeExpansionFailure featuregate.Feature = "RecoverVolumeExpansionFailure" @@ -560,6 +618,13 @@ const ( // Allows recursive read-only mounts. RecursiveReadOnlyMounts featuregate.Feature = "RecursiveReadOnlyMounts" + // owner: @lauralorenz + // kep: https://kep.k8s.io/4603 + // + // Enables support for a lower internal cluster-wide backoff maximum for restarting + // containers (aka containers in CrashLoopBackOff) + ReduceDefaultCrashLoopBackOffDecay featuregate.Feature = "ReduceDefaultCrashLoopBackOffDecay" + // owner: @adrianmoisey // kep: https://kep.k8s.io/4427 // @@ -615,12 +680,18 @@ const ( // owner: @sanposhiho // kep: http://kep.k8s.io/4832 - // alpha: v1.32 // // Running some expensive operation within the scheduler's preemption asynchronously, // which improves the scheduling latency when the preemption involves in. SchedulerAsyncPreemption featuregate.Feature = "SchedulerAsyncPreemption" + // owner: @macsko + // kep: http://kep.k8s.io/5142 + // + // Improves scheduling queue behavior by popping pods from the backoffQ when the activeQ is empty. + // This allows to process potentially schedulable pods ASAP, eliminating a penalty effect of the backoff queue. + SchedulerPopFromBackoffQ featuregate.Feature = "SchedulerPopFromBackoffQ" + // owner: @atosatto @yuanchen8911 // kep: http://kep.k8s.io/3902 // @@ -666,6 +737,13 @@ const ( // Enables trafficDistribution field on Services. ServiceTrafficDistribution featuregate.Feature = "ServiceTrafficDistribution" + // owner: @cupnes + // kep: https://kep.k8s.io/4049 + // + // Enables scoring nodes by available storage capacity with + // StorageCapacityScoring feature gate. + StorageCapacityScoring featuregate.Feature = "StorageCapacityScoring" + // owner: @gjkim42 @SergeyKanzhelev @matthyx @tzneal // kep: http://kep.k8s.io/753 // @@ -694,6 +772,7 @@ const ( // owner: @ahutsunshine // // Allows namespace indexer for namespace scope resources in apiserver cache to accelerate list operations. + // Superseded by BtreeWatchCache. StorageNamespaceIndex featuregate.Feature = "StorageNamespaceIndex" // owner: @nilekhc @@ -702,6 +781,20 @@ const ( // Enables support for the StorageVersionMigrator controller. StorageVersionMigrator featuregate.Feature = "StorageVersionMigrator" + // owner: @serathius + // Allow API server JSON encoder to encode collections item by item, instead of all at once. + StreamingCollectionEncodingToJSON featuregate.Feature = "StreamingCollectionEncodingToJSON" + + // owner: serathius + // Allow API server Protobuf encoder to encode collections item by item, instead of all at once. + StreamingCollectionEncodingToProtobuf featuregate.Feature = "StreamingCollectionEncodingToProtobuf" + + // owner: @danwinship + // kep: https://kep.k8s.io/4858 + // + // Requires stricter validation of IP addresses and CIDR values in API objects. + StrictIPCIDRValidation featuregate.Feature = "StrictIPCIDRValidation" + // owner: @robscott // kep: https://kep.k8s.io/2433 // @@ -757,9 +850,6 @@ const ( // Enables user specified volume attributes for persistent volumes, like iops and throughput. VolumeAttributesClass featuregate.Feature = "VolumeAttributesClass" - // owner: @cofyc - VolumeCapacityPriority featuregate.Feature = "VolumeCapacityPriority" - // owner: @ksubrmnn // // Allows kube-proxy to create DSR loadbalancers for Windows @@ -767,7 +857,6 @@ const ( // owner: @zylxjtu // kep: https://kep.k8s.io/4802 - // alpha: v1.32 // // Enables support for graceful shutdown windows node. WindowsGracefulNodeShutdown featuregate.Feature = "WindowsGracefulNodeShutdown" @@ -844,7 +933,6 @@ const ( ImageVolume featuregate.Feature = "ImageVolume" // owner: @zhifei92 - // beta: v1.32 // // Enables the systemd watchdog for the kubelet. When enabled, the kubelet will // periodically notify the systemd watchdog to indicate that it is still alive. @@ -855,7 +943,6 @@ const ( // owner: @jsafrane // kep: https://kep.k8s.io/1710 - // alpha: v1.32 // // Speed up container startup by mounting volumes with the correct SELinux label // instead of changing each file on the volumes recursively. @@ -863,7 +950,6 @@ const ( SELinuxChangePolicy featuregate.Feature = "SELinuxChangePolicy" // owner: @HarshalNeelkamal - // alpha: v1.32 // // Enables external service account JWT signing and key management. // If enabled, it allows passing --service-account-signing-endpoint flag to configure external signer. @@ -871,14 +957,929 @@ const ( // owner: @ndixita // key: https://kep.k8s.io/2837 - // alpha: 1.32 // // Enables specifying resources at pod-level. PodLevelResources featuregate.Feature = "PodLevelResources" + + // owner: @ffromani + // beta: v1.33 + // + // Disables CPU Quota for containers which have exclusive CPUs allocated. + // Disables pod-Level CPU Quota for pods containing at least one container with exclusive CPUs allocated + // Exclusive CPUs for a container (init, application, sidecar) are allocated when: + // (1) cpumanager policy is static, + // (2) the pod has QoS Guaranteed, + // (3) the container has integer cpu request. + // The expected behavior is that CPU Quota for containers having exclusive CPUs allocated is disabled. + // Because this fix changes a long-established (but incorrect) behavior, users observing + // any regressions can use the DisableCPUQuotaWithExclusiveCPUs feature gate (default on) to + // restore the old behavior. Please file issues if you hit issues and have to use this Feature Gate. + // The Feature Gate will be locked to true and then removed in +2 releases (1.35) if there are no bug reported + DisableCPUQuotaWithExclusiveCPUs featuregate.Feature = "DisableCPUQuotaWithExclusiveCPUs" + + // owner: @munnerz + // kep: https://kep.k8s.io/4742 + // alpha: v1.33 + // + // Enables the PodTopologyLabelsAdmission admission plugin that mutates `pod/binding` + // requests by copying the `topology.k8s.io/{zone,region}` labels from the assigned + // Node object (in the Binding being admitted) onto the Binding + // so that it can be persisted onto the Pod object when the Pod is being scheduled. + // This allows workloads running in pods to understand the topology information of their assigned node. + // Enabling this feature also permits external schedulers to set labels on pods in an atomic + // operation when scheduling a Pod by setting the `metadata.labels` field on the submitted Binding, + // similar to how `metadata.annotations` behaves. + PodTopologyLabelsAdmission featuregate.Feature = "PodTopologyLabelsAdmission" ) +// defaultVersionedKubernetesFeatureGates consists of all known Kubernetes-specific feature keys with VersionedSpecs. +// To add a new feature, define a key for it in pkg/features/kube_features.go and add it here. The features will be +// available throughout Kubernetes binaries. +// For features available via specific kubernetes components like apiserver, +// cloud-controller-manager, etc find the respective kube_features.go file +// (eg:staging/src/apiserver/pkg/features/kube_features.go), define the versioned +// feature gate there, and reference it in this file. +// To support n-3 compatibility version, features may only be removed 3 releases after graduation. +// +// Entries are alphabetized. +var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate.VersionedSpecs{ + AllowDNSOnlyNodeCSR: { + {Version: version.MustParse("1.0"), Default: true, PreRelease: featuregate.GA}, + {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Deprecated}, + }, + + AllowInsecureKubeletCertificateSigningRequests: { + {Version: version.MustParse("1.0"), Default: true, PreRelease: featuregate.GA}, + {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Deprecated}, + }, + + AllowOverwriteTerminationGracePeriodSeconds: { + {Version: version.MustParse("1.0"), Default: true, PreRelease: featuregate.GA}, + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Deprecated}, + }, + + AllowServiceLBStatusOnNonLB: { + {Version: version.MustParse("1.0"), Default: true, PreRelease: featuregate.GA}, + {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Deprecated}, + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Deprecated, LockToDefault: true}, // remove in 1.35 + }, + + AnyVolumeDataSource: { + {Version: version.MustParse("1.18"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.24"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // GA in 1.33 -> remove in 1.36 + }, + + AuthorizeNodeWithSelectors: { + {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, + }, + + kcmfeatures.CloudControllerManagerWebhook: { + {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha}, + }, + + ClusterTrustBundle: { + {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Beta}, + }, + + ClusterTrustBundleProjection: { + {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Beta}, + }, + + ContainerStopSignals: { + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Alpha}, + }, + + ContainerCheckpoint: { + {Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, + }, + + CPUCFSQuotaPeriod: { + {Version: version.MustParse("1.12"), Default: false, PreRelease: featuregate.Alpha}, + }, + + CPUManagerPolicyAlphaOptions: { + {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha}, + }, + + CPUManagerPolicyBetaOptions: { + {Version: version.MustParse("1.23"), Default: true, PreRelease: featuregate.Beta}, + }, + + CPUManagerPolicyOptions: { + {Version: version.MustParse("1.22"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.23"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.36 + }, + + CronJobsScheduledAnnotation: { + {Version: version.MustParse("1.28"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.35 + }, + + // inherited features from apiextensions-apiserver, relisted here to get a conflict if it is changed + // unintentionally on either side: + apiextensionsfeatures.CRDValidationRatcheting: { + {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + }, + + CrossNamespaceVolumeDataSource: { + {Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha}, + }, + + CSIMigrationPortworx: { + {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, // On by default (requires Portworx CSI driver) + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.36 + }, + + CSIVolumeHealth: { + {Version: version.MustParse("1.21"), Default: false, PreRelease: featuregate.Alpha}, + }, + + // inherited features from apiextensions-apiserver, relisted here to get a conflict if it is changed + // unintentionally on either side: + apiextensionsfeatures.CustomResourceFieldSelectors: { + {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.32"), Default: true, LockToDefault: true, PreRelease: featuregate.GA}, + }, + + DeclarativeValidation: { + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta}, + }, + + DeclarativeValidationTakeover: { + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Beta}, + }, + + DeploymentReplicaSetTerminatingReplicas: { + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Alpha}, + }, + + DevicePluginCDIDevices: { + {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.33 + }, + + DisableAllocatorDualWrite: { + {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Beta}, // remove after MultiCIDRServiceAllocator is GA + }, + + DisableNodeKubeProxyVersion: { + {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Deprecated}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Deprecated}, // lock to default in 1.34 and remove in v1.37 + }, + + DRAAdminAccess: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + }, + + DRADeviceTaints: { + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Alpha}, + }, + + DRAPartitionableDevices: { + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Alpha}, + }, + + DRAPrioritizedList: { + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Alpha}, + }, + + DRAResourceClaimDeviceStatus: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta}, + }, + + DynamicResourceAllocation: { + {Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Beta}, + }, + + KubeletCrashLoopBackOffMax: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + }, + + ElasticIndexedJob: { + {Version: version.MustParse("1.27"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // GA in 1.31, remove in 1.32 + }, + + EventedPLEG: { + {Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha}, + }, + + ExecProbeTimeout: { + {Version: version.MustParse("1.20"), Default: true, PreRelease: featuregate.GA}, // lock to default and remove after v1.22 based on KEP #1972 update + }, + + ExternalServiceAccountTokenSigner: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + }, + + genericfeatures.AggregatedDiscoveryRemoveBetaType: { + {Version: version.MustParse("1.0"), Default: false, PreRelease: featuregate.GA}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Deprecated}, + }, + + genericfeatures.AllowParsingUserUIDFromCertAuth: { + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta}, + }, + + genericfeatures.AllowUnsafeMalformedObjectDeletion: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + }, + + genericfeatures.AnonymousAuthConfigurableEndpoints: { + {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, + }, + + genericfeatures.APIResponseCompression: { + {Version: version.MustParse("1.8"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.16"), Default: true, PreRelease: featuregate.Beta}, + }, + + genericfeatures.APIServerIdentity: { + {Version: version.MustParse("1.20"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.26"), Default: true, PreRelease: featuregate.Beta}, + }, + + genericfeatures.APIServerTracing: { + {Version: version.MustParse("1.22"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.27"), Default: true, PreRelease: featuregate.Beta}, + }, + + genericfeatures.APIServingWithRoutine: { + {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, + }, + + genericfeatures.AuthorizeWithSelectors: { + {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, + }, + + genericfeatures.BtreeWatchCache: { + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + }, + + genericfeatures.CBORServingAndStorage: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + }, + + genericfeatures.ConcurrentWatchObjectDecode: { + {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Beta}, + }, + + genericfeatures.ConsistentListFromCache: { + {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, + }, + + genericfeatures.CoordinatedLeaderElection: { + {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Beta}, + }, + + genericfeatures.KMSv1: { + {Version: version.MustParse("1.0"), Default: true, PreRelease: featuregate.GA}, + {Version: version.MustParse("1.28"), Default: true, PreRelease: featuregate.Deprecated}, + {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Deprecated}, + }, + + genericfeatures.ListFromCacheSnapshot: { + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Alpha}, + }, + + genericfeatures.MutatingAdmissionPolicy: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + }, + + genericfeatures.OpenAPIEnums: { + {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.24"), Default: true, PreRelease: featuregate.Beta}, + }, + + genericfeatures.RemoteRequestHeaderUID: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta}, + }, + + genericfeatures.ResilientWatchCacheInitialization: { + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, + }, + + genericfeatures.RetryGenerateName: { + {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.32"), Default: true, LockToDefault: true, PreRelease: featuregate.GA}, + }, + + genericfeatures.SeparateCacheWatchRPC: { + {Version: version.MustParse("1.28"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Deprecated}, + }, + + genericfeatures.StorageVersionAPI: { + {Version: version.MustParse("1.20"), Default: false, PreRelease: featuregate.Alpha}, + }, + + genericfeatures.StorageVersionHash: { + {Version: version.MustParse("1.14"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.15"), Default: true, PreRelease: featuregate.Beta}, + }, + + genericfeatures.StrictCostEnforcementForVAP: { + {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + }, + + genericfeatures.StrictCostEnforcementForWebhooks: { + {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + }, + + genericfeatures.StructuredAuthenticationConfiguration: { + {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, + }, + + genericfeatures.StructuredAuthorizationConfiguration: { + {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + }, + + genericfeatures.UnauthenticatedHTTP2DOSMitigation: { + {Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.Beta}, + }, + + genericfeatures.WatchCacheInitializationPostStartHook: { + {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Beta}, + }, + + genericfeatures.WatchFromStorageWithoutResourceVersion: { + {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Deprecated, LockToDefault: true}, + }, + + genericfeatures.WatchList: { + {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, + // switch this back to false because the json and proto streaming encoders appear to work better. + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Beta}, + }, + + GitRepoVolumeDriver: { + {Version: version.MustParse("1.0"), Default: true, PreRelease: featuregate.GA}, + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Deprecated}, + }, + + GracefulNodeShutdown: { + {Version: version.MustParse("1.20"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.21"), Default: true, PreRelease: featuregate.Beta}, + }, + + GracefulNodeShutdownBasedOnPodPriority: { + {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.24"), Default: true, PreRelease: featuregate.Beta}, + }, + + HonorPVReclaimPolicy: { + {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.36 + }, + + HPAConfigurableTolerance: { + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Alpha}, + }, + + HPAScaleToZero: { + {Version: version.MustParse("1.16"), Default: false, PreRelease: featuregate.Alpha}, + }, + + ImageMaximumGCAge: { + {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, + }, + + ImageVolume: { + {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Beta}, + }, + + InPlacePodVerticalScaling: { + {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta}, + }, + + InPlacePodVerticalScalingAllocatedStatus: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Deprecated}, // remove in 1.36 + }, + + InPlacePodVerticalScalingExclusiveCPUs: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + }, + + InTreePluginPortworxUnregister: { + {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha}, // remove it along with CSIMigrationPortworx in 1.36 + }, + + JobBackoffLimitPerIndex: { + {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.36 + }, + + JobManagedBy: { + {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, + }, + + JobPodReplacementPolicy: { + {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.Beta}, + }, + + JobSuccessPolicy: { + {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.36 + }, + + KubeletCgroupDriverFromCRI: { + {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, + }, + + KubeletEnsureSecretPulledImages: { + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Alpha}, + }, + + KubeletFineGrainedAuthz: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta}, + }, + + KubeletInUserNamespace: { + {Version: version.MustParse("1.22"), Default: false, PreRelease: featuregate.Alpha}, + }, + + KubeletPodResourcesDynamicResources: { + {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha}, + }, + + KubeletPodResourcesGet: { + {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha}, + }, + + KubeletPSI: { + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Alpha}, + }, + + KubeletRegistrationGetOnExistsOnly: { + {Version: version.MustParse("1.0"), Default: true, PreRelease: featuregate.GA}, + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Deprecated}, + }, + + KubeletSeparateDiskGC: { + {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, + }, + + KubeletServiceAccountTokenForCredentialProviders: { + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Alpha}, + }, + + KubeletTracing: { + {Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.27"), Default: true, PreRelease: featuregate.Beta}, + }, + + LegacySidecarContainers: { + {Version: version.MustParse("1.0"), Default: true, PreRelease: featuregate.GA}, + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Deprecated}, + }, + + LoadBalancerIPMode: { + {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + }, + + LocalStorageCapacityIsolationFSQuotaMonitoring: { + {Version: version.MustParse("1.15"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Beta}, + }, + + LogarithmicScaleDown: { + {Version: version.MustParse("1.21"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.22"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + }, + + MatchLabelKeysInPodAffinity: { + {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + }, + + MatchLabelKeysInPodTopologySpread: { + {Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.27"), Default: true, PreRelease: featuregate.Beta}, + }, + + MaxUnavailableStatefulSet: { + {Version: version.MustParse("1.24"), Default: false, PreRelease: featuregate.Alpha}, + }, + + MemoryManager: { + {Version: version.MustParse("1.21"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.22"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + }, + + MemoryQoS: { + {Version: version.MustParse("1.22"), Default: false, PreRelease: featuregate.Alpha}, + }, + + MultiCIDRServiceAllocator: { + {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.GA, LockToDefault: false}, // remove in 1.36 + }, + + MutableCSINodeAllocatableCount: { + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Alpha}, + }, + + NFTablesProxyMode: { + {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + }, + + NodeInclusionPolicyInPodTopologySpread: { + {Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.26"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + }, + + NodeLogQuery: { + {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Beta}, + }, + + NodeSwap: { + {Version: version.MustParse("1.22"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, + }, + + OrderedNamespaceDeletion: { + {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta}, + }, + + PodAndContainerStatsFromCRI: { + {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha}, + }, + + PodDeletionCost: { + {Version: version.MustParse("1.21"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.22"), Default: true, PreRelease: featuregate.Beta}, + }, + + PodDisruptionConditions: { + {Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.26"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.33 + }, + + PodIndexLabel: { + {Version: version.MustParse("1.28"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.35 + }, + + PodLevelResources: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + }, + + PodLifecycleSleepAction: { + {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, + }, + + PodReadyToStartContainersCondition: { + {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.Beta}, + }, + + PodLifecycleSleepActionAllowZero: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta}, + }, + + PodObservedGenerationTracking: { + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Alpha}, + }, + + PodSchedulingReadiness: { + {Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.27"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // GA in 1.30; remove in 1.32 + }, + + PodTopologyLabelsAdmission: { + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Alpha}, + }, + + PortForwardWebsockets: { + {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, + }, + + PreferSameTrafficDistribution: { + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Alpha}, + }, + + ProcMountType: { + {Version: version.MustParse("1.12"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta}, + }, + + QOSReserved: { + {Version: version.MustParse("1.11"), Default: false, PreRelease: featuregate.Alpha}, + }, + + RecoverVolumeExpansionFailure: { + {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, + }, + RecursiveReadOnlyMounts: { + {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.36 + }, + + ReduceDefaultCrashLoopBackOffDecay: { + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Alpha}, + }, + + RelaxedDNSSearchValidation: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta}, + }, + + RelaxedEnvironmentVariableValidation: { + {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, + }, + + ReloadKubeletServerCertificateFile: { + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, + }, + + ResourceHealthStatus: { + {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Alpha}, + }, + + RotateKubeletServerCertificate: { + {Version: version.MustParse("1.7"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.12"), Default: true, PreRelease: featuregate.Beta}, + }, + + RuntimeClassInImageCriAPI: { + {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, + }, + + SchedulerAsyncPreemption: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta}, + }, + + SchedulerPopFromBackoffQ: { + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta}, + }, + + SchedulerQueueingHints: { + {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, + }, + + SELinuxChangePolicy: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta}, + }, + + SELinuxMount: { + {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Beta}, + }, + + SELinuxMountReadWriteOncePod: { + {Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.28"), Default: true, PreRelease: featuregate.Beta}, + }, + + SeparateTaintEvictionController: { + {Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.Beta}, + }, + + StorageNamespaceIndex: { + {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Deprecated}, + }, + + ServiceAccountNodeAudienceRestriction: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta}, + }, + + ServiceAccountTokenJTI: { + {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + }, + + ServiceAccountTokenNodeBinding: { + {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + }, + + ServiceAccountTokenNodeBindingValidation: { + {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + }, + + ServiceAccountTokenPodNodeInfo: { + {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + }, + + ServiceTrafficDistribution: { + {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // GA and LockToDefault in 1.33, remove in 1.36 + }, + + SidecarContainers: { + {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, LockToDefault: true, PreRelease: featuregate.GA}, // GA in 1.33 remove in 1.36 + }, + + SizeMemoryBackedVolumes: { + {Version: version.MustParse("1.20"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.22"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.32"), Default: true, LockToDefault: true, PreRelease: featuregate.GA}, + }, + + PodLogsQuerySplitStreams: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + }, + + StatefulSetAutoDeletePVC: { + {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.27"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // GA in 1.32, remove in 1.35 + }, + + StatefulSetStartOrdinal: { + {Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.27"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // GA in 1.31, remove in 1.33 + }, + + StorageCapacityScoring: { + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Alpha}, + }, + + StorageVersionMigrator: { + {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, + }, + + StreamingCollectionEncodingToJSON: { + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta}, + }, + + StreamingCollectionEncodingToProtobuf: { + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta}, + }, + + SupplementalGroupsPolicy: { + {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta}, + }, + + SystemdWatchdog: { + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, + }, + + StrictIPCIDRValidation: { + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Alpha}, + }, + + TopologyAwareHints: { + {Version: version.MustParse("1.21"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.24"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + }, + + TopologyManagerPolicyAlphaOptions: { + {Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha}, + }, + + TopologyManagerPolicyBetaOptions: { + {Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.28"), Default: true, PreRelease: featuregate.Beta}, + }, + + TopologyManagerPolicyOptions: { + {Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.28"), Default: true, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA}, + }, + + TranslateStreamCloseWebsocketRequests: { + {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, + }, + + UnknownVersionInteroperabilityProxy: { + {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, + }, + + UserNamespacesPodSecurityStandards: { + {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, + }, + + UserNamespacesSupport: { + {Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Beta}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta}, + }, + + VolumeAttributesClass: { + {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Beta}, + }, + + WinDSR: { + {Version: version.MustParse("1.14"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta}, + }, + WindowsGracefulNodeShutdown: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + }, + WinOverlay: { + {Version: version.MustParse("1.14"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.20"), Default: true, PreRelease: featuregate.Beta}, + }, + + WindowsCPUAndMemoryAffinity: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + }, + + WindowsHostNetwork: { + {Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Deprecated}, + }, + + zpagesfeatures.ComponentFlagz: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + }, + + zpagesfeatures.ComponentStatusz: { + {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, + }, + DisableCPUQuotaWithExclusiveCPUs: { + {Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.Beta}, + }, +} + func init() { - runtime.Must(utilfeature.DefaultMutableFeatureGate.Add(defaultKubernetesFeatureGates)) runtime.Must(utilfeature.DefaultMutableFeatureGate.AddVersioned(defaultVersionedKubernetesFeatureGates)) runtime.Must(zpagesfeatures.AddFeatureGates(utilfeature.DefaultMutableFeatureGate)) @@ -891,10 +1892,3 @@ func init() { runtime.Must(clientfeatures.AddFeaturesToExistingFeatureGates(ca)) clientfeatures.ReplaceFeatureGates(ca) } - -// defaultKubernetesFeatureGates consists of legacy unversioned Kubernetes-specific feature keys. -// Please do not add to this file and use pkg/features/versioned_kube_features.go instead. -// -// Entries are separated from each other with blank lines to avoid sweeping gofmt changes -// when adding or removing one entry. -var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/features/versioned_kube_features.go b/e2e/vendor/k8s.io/kubernetes/pkg/features/versioned_kube_features.go deleted file mode 100644 index 30406ae3e..000000000 --- a/e2e/vendor/k8s.io/kubernetes/pkg/features/versioned_kube_features.go +++ /dev/null @@ -1,841 +0,0 @@ -/* -Copyright 2024 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package features - -import ( - apiextensionsfeatures "k8s.io/apiextensions-apiserver/pkg/features" - "k8s.io/apimachinery/pkg/util/version" - genericfeatures "k8s.io/apiserver/pkg/features" - "k8s.io/component-base/featuregate" - zpagesfeatures "k8s.io/component-base/zpages/features" - kcmfeatures "k8s.io/controller-manager/pkg/features" -) - -// defaultVersionedKubernetesFeatureGates consists of all known Kubernetes-specific feature keys with VersionedSpecs. -// To add a new feature, define a key for it in pkg/features/kube_features.go and add it here. The features will be -// available throughout Kubernetes binaries. -// For features available via specific kubernetes components like apiserver, -// cloud-controller-manager, etc find the respective kube_features.go file -// (eg:staging/src/apiserver/pkg/features/kube_features.go), define the versioned -// feature gate there, and reference it in this file. -// To support n-3 compatibility version, features may only be removed 3 releases after graduation. -// -// Entries are alphabetized. -var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate.VersionedSpecs{ - AllowDNSOnlyNodeCSR: { - {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Deprecated}, - }, - - AllowInsecureKubeletCertificateSigningRequests: { - {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Deprecated}, - }, - - AllowOverwriteTerminationGracePeriodSeconds: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Deprecated}, - }, - - AllowServiceLBStatusOnNonLB: { - {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Deprecated}, - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Deprecated, LockToDefault: true}, // remove in 1.35 - }, - - AnyVolumeDataSource: { - {Version: version.MustParse("1.18"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.24"), Default: true, PreRelease: featuregate.Beta}, - }, - - AppArmor: { - {Version: version.MustParse("1.4"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.33 - }, - - AppArmorFields: { - {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.33 - }, - - AuthorizeNodeWithSelectors: { - {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, - }, - - kcmfeatures.CloudControllerManagerWebhook: { - {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha}, - }, - - ClusterTrustBundle: { - {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha}, - }, - - ClusterTrustBundleProjection: { - {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, - }, - - ContainerCheckpoint: { - {Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, - }, - - CPUCFSQuotaPeriod: { - {Version: version.MustParse("1.12"), Default: false, PreRelease: featuregate.Alpha}, - }, - - CPUManager: { - {Version: version.MustParse("1.8"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.10"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.26"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // GA in 1.26 - }, - - CPUManagerPolicyAlphaOptions: { - {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha}, - }, - - CPUManagerPolicyBetaOptions: { - {Version: version.MustParse("1.23"), Default: true, PreRelease: featuregate.Beta}, - }, - - CPUManagerPolicyOptions: { - {Version: version.MustParse("1.22"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.23"), Default: true, PreRelease: featuregate.Beta}, - }, - - CronJobsScheduledAnnotation: { - {Version: version.MustParse("1.28"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.35 - }, - - // inherited features from apiextensions-apiserver, relisted here to get a conflict if it is changed - // unintentionally on either side: - apiextensionsfeatures.CRDValidationRatcheting: { - {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, - }, - - CrossNamespaceVolumeDataSource: { - {Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha}, - }, - - CSIMigrationPortworx: { - {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, // On by default (requires Portworx CSI driver) - }, - - CSIVolumeHealth: { - {Version: version.MustParse("1.21"), Default: false, PreRelease: featuregate.Alpha}, - }, - - // inherited features from apiextensions-apiserver, relisted here to get a conflict if it is changed - // unintentionally on either side: - apiextensionsfeatures.CustomResourceFieldSelectors: { - {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.32"), Default: true, LockToDefault: true, PreRelease: featuregate.GA}, - }, - - DevicePluginCDIDevices: { - {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.33 - }, - - DisableAllocatorDualWrite: { - {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Alpha}, // remove after MultiCIDRServiceAllocator is GA - }, - - DisableCloudProviders: { - {Version: version.MustParse("1.22"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, - }, - - DisableKubeletCloudCredentialProviders: { - {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, - }, - - DisableNodeKubeProxyVersion: { - {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Deprecated}, - }, - - DRAAdminAccess: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, - - DynamicResourceAllocation: { - {Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Beta}, - }, - - DRAResourceClaimDeviceStatus: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, - - KubeletCrashLoopBackOffMax: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, - - ElasticIndexedJob: { - {Version: version.MustParse("1.27"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // GA in 1.31, remove in 1.32 - }, - - EventedPLEG: { - {Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha}, - }, - - ExecProbeTimeout: { - {Version: version.MustParse("1.20"), Default: true, PreRelease: featuregate.GA}, // lock to default and remove after v1.22 based on KEP #1972 update - }, - - ExternalServiceAccountTokenSigner: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, - - genericfeatures.AdmissionWebhookMatchConditions: { - {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.28"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, - }, - - genericfeatures.AggregatedDiscoveryEndpoint: { - {Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.27"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, - }, - - genericfeatures.AllowUnsafeMalformedObjectDeletion: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, - - genericfeatures.AnonymousAuthConfigurableEndpoints: { - {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, - }, - - genericfeatures.APIListChunking: { - {Version: version.MustParse("1.8"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.9"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, - }, - - genericfeatures.APIResponseCompression: { - {Version: version.MustParse("1.8"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.16"), Default: true, PreRelease: featuregate.Beta}, - }, - - genericfeatures.APIServerIdentity: { - {Version: version.MustParse("1.20"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.26"), Default: true, PreRelease: featuregate.Beta}, - }, - - genericfeatures.APIServerTracing: { - {Version: version.MustParse("1.22"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.27"), Default: true, PreRelease: featuregate.Beta}, - }, - - genericfeatures.APIServingWithRoutine: { - {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, - }, - - genericfeatures.AuthorizeWithSelectors: { - {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, - }, - - genericfeatures.BtreeWatchCache: { - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, - }, - - genericfeatures.CBORServingAndStorage: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, - - genericfeatures.ConcurrentWatchObjectDecode: { - {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Beta}, - }, - - genericfeatures.ConsistentListFromCache: { - {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, - }, - - genericfeatures.CoordinatedLeaderElection: { - {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Alpha}, - }, - - genericfeatures.EfficientWatchResumption: { - {Version: version.MustParse("1.20"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.21"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.24"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, - }, - - genericfeatures.KMSv1: { - {Version: version.MustParse("1.28"), Default: true, PreRelease: featuregate.Deprecated}, - {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Deprecated}, - }, - - genericfeatures.MutatingAdmissionPolicy: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, - - genericfeatures.OpenAPIEnums: { - {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.24"), Default: true, PreRelease: featuregate.Beta}, - }, - - genericfeatures.RemainingItemCount: { - {Version: version.MustParse("1.15"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.16"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, - }, - - genericfeatures.RemoteRequestHeaderUID: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, - - genericfeatures.ResilientWatchCacheInitialization: { - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, - }, - - genericfeatures.RetryGenerateName: { - {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.32"), Default: true, LockToDefault: true, PreRelease: featuregate.GA}, - }, - - genericfeatures.SeparateCacheWatchRPC: { - {Version: version.MustParse("1.28"), Default: true, PreRelease: featuregate.Beta}, - }, - - genericfeatures.StorageVersionAPI: { - {Version: version.MustParse("1.20"), Default: false, PreRelease: featuregate.Alpha}, - }, - - genericfeatures.StorageVersionHash: { - {Version: version.MustParse("1.14"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.15"), Default: true, PreRelease: featuregate.Beta}, - }, - - genericfeatures.StrictCostEnforcementForVAP: { - {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, - }, - - genericfeatures.StrictCostEnforcementForWebhooks: { - {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, - }, - - genericfeatures.StructuredAuthenticationConfiguration: { - {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, - }, - - genericfeatures.StructuredAuthorizationConfiguration: { - {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, - }, - - genericfeatures.UnauthenticatedHTTP2DOSMitigation: { - {Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.Beta}, - }, - - genericfeatures.WatchBookmark: { - {Version: version.MustParse("1.15"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.16"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.17"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, - }, - - genericfeatures.WatchCacheInitializationPostStartHook: { - {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Beta}, - }, - - genericfeatures.WatchFromStorageWithoutResourceVersion: { - {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Beta}, - }, - - genericfeatures.WatchList: { - {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, - }, - - GracefulNodeShutdown: { - {Version: version.MustParse("1.20"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.21"), Default: true, PreRelease: featuregate.Beta}, - }, - - GracefulNodeShutdownBasedOnPodPriority: { - {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.24"), Default: true, PreRelease: featuregate.Beta}, - }, - - HonorPVReclaimPolicy: { - {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, - }, - - HPAScaleToZero: { - {Version: version.MustParse("1.16"), Default: false, PreRelease: featuregate.Alpha}, - }, - - ImageMaximumGCAge: { - {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, - }, - - ImageVolume: { - {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Alpha}, - }, - - InPlacePodVerticalScaling: { - {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha}, - }, - - InPlacePodVerticalScalingAllocatedStatus: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, - - InPlacePodVerticalScalingExclusiveCPUs: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, - - InTreePluginPortworxUnregister: { - {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha}, - }, - - JobBackoffLimitPerIndex: { - {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.Beta}, - }, - - JobManagedBy: { - {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, - }, - - JobPodFailurePolicy: { - {Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.26"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.33 - }, - - JobPodReplacementPolicy: { - {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.Beta}, - }, - - JobSuccessPolicy: { - {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, - }, - - KubeletCgroupDriverFromCRI: { - {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, - }, - - KubeletFineGrainedAuthz: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, - - KubeletInUserNamespace: { - {Version: version.MustParse("1.22"), Default: false, PreRelease: featuregate.Alpha}, - }, - - KubeletPodResourcesDynamicResources: { - {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha}, - }, - - KubeletPodResourcesGet: { - {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha}, - }, - - KubeletRegistrationGetOnExistsOnly: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Deprecated}, - }, - - KubeletSeparateDiskGC: { - {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, - }, - - KubeletTracing: { - {Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.27"), Default: true, PreRelease: featuregate.Beta}, - }, - - KubeProxyDrainingTerminatingNodes: { - {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // GA in 1.31; remove in 1.33 - }, - - LoadBalancerIPMode: { - {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, - }, - - LocalStorageCapacityIsolationFSQuotaMonitoring: { - {Version: version.MustParse("1.15"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Beta}, - }, - - LogarithmicScaleDown: { - {Version: version.MustParse("1.21"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.22"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, - }, - - MatchLabelKeysInPodAffinity: { - {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, - }, - - MatchLabelKeysInPodTopologySpread: { - {Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.27"), Default: true, PreRelease: featuregate.Beta}, - }, - - MaxUnavailableStatefulSet: { - {Version: version.MustParse("1.24"), Default: false, PreRelease: featuregate.Alpha}, - }, - - MemoryManager: { - {Version: version.MustParse("1.21"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.22"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, - }, - - MemoryQoS: { - {Version: version.MustParse("1.22"), Default: false, PreRelease: featuregate.Alpha}, - }, - - MultiCIDRServiceAllocator: { - {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Beta}, - }, - - NFTablesProxyMode: { - {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, - }, - - NodeInclusionPolicyInPodTopologySpread: { - {Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.26"), Default: true, PreRelease: featuregate.Beta}, - }, - - NodeLogQuery: { - {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Beta}, - }, - - NodeSwap: { - {Version: version.MustParse("1.22"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, - }, - - OrderedNamespaceDeletion: { - {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Beta}, - }, - - PDBUnhealthyPodEvictionPolicy: { - {Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.27"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.33 - }, - - PersistentVolumeLastPhaseTransitionTime: { - {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.33 - }, - - PodAndContainerStatsFromCRI: { - {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha}, - }, - - PodDeletionCost: { - {Version: version.MustParse("1.21"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.22"), Default: true, PreRelease: featuregate.Beta}, - }, - - PodDisruptionConditions: { - {Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.26"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.33 - }, - - PodIndexLabel: { - {Version: version.MustParse("1.28"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.35 - }, - - PodLevelResources: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, - - PodLifecycleSleepAction: { - {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, - }, - PodReadyToStartContainersCondition: { - {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.Beta}, - }, - PodLifecycleSleepActionAllowZero: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, - PodSchedulingReadiness: { - {Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.27"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // GA in 1.30; remove in 1.32 - }, - - PortForwardWebsockets: { - {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, - }, - - ProcMountType: { - {Version: version.MustParse("1.12"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Beta}, - }, - - QOSReserved: { - {Version: version.MustParse("1.11"), Default: false, PreRelease: featuregate.Alpha}, - }, - - RecoverVolumeExpansionFailure: { - {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, - }, - RecursiveReadOnlyMounts: { - {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, - }, - - RelaxedDNSSearchValidation: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, - - RelaxedEnvironmentVariableValidation: { - {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, - }, - - ReloadKubeletServerCertificateFile: { - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, - }, - - ResourceHealthStatus: { - {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Alpha}, - }, - - RotateKubeletServerCertificate: { - {Version: version.MustParse("1.7"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.12"), Default: true, PreRelease: featuregate.Beta}, - }, - - RuntimeClassInImageCriAPI: { - {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, - }, - - SchedulerAsyncPreemption: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, - - SchedulerQueueingHints: { - {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, - }, - - SELinuxChangePolicy: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, - - SELinuxMount: { - {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, - }, - - SELinuxMountReadWriteOncePod: { - {Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.28"), Default: true, PreRelease: featuregate.Beta}, - }, - - SeparateTaintEvictionController: { - {Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.Beta}, - }, - - StorageNamespaceIndex: { - {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, - }, - - ServiceAccountNodeAudienceRestriction: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Beta}, - }, - - ServiceAccountTokenJTI: { - {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.34 - }, - - ServiceAccountTokenNodeBinding: { - {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, - }, - - ServiceAccountTokenNodeBindingValidation: { - {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.34 - }, - - ServiceAccountTokenPodNodeInfo: { - {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.34 - }, - - ServiceTrafficDistribution: { - {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta}, - }, - - SidecarContainers: { - {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.29"), Default: true, PreRelease: featuregate.Beta}, - }, - - SizeMemoryBackedVolumes: { - {Version: version.MustParse("1.20"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.22"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.32"), Default: true, LockToDefault: true, PreRelease: featuregate.GA}, - }, - - PodLogsQuerySplitStreams: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, - - StatefulSetAutoDeletePVC: { - {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.27"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // GA in 1.32, remove in 1.35 - }, - - StatefulSetStartOrdinal: { - {Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.27"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // GA in 1.31, remove in 1.33 - }, - - StorageVersionMigrator: { - {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Alpha}, - }, - - SupplementalGroupsPolicy: { - {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Alpha}, - }, - - SystemdWatchdog: { - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta}, - }, - - TopologyAwareHints: { - {Version: version.MustParse("1.21"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.24"), Default: true, PreRelease: featuregate.Beta}, - }, - - TopologyManagerPolicyAlphaOptions: { - {Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha}, - }, - - TopologyManagerPolicyBetaOptions: { - {Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.28"), Default: true, PreRelease: featuregate.Beta}, - }, - - TopologyManagerPolicyOptions: { - {Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.28"), Default: true, PreRelease: featuregate.Beta}, - {Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA}, - }, - - TranslateStreamCloseWebsocketRequests: { - {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta}, - }, - - UnknownVersionInteroperabilityProxy: { - {Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Alpha}, - }, - - UserNamespacesPodSecurityStandards: { - {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, - }, - - UserNamespacesSupport: { - {Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.30"), Default: false, PreRelease: featuregate.Beta}, - }, - - VolumeAttributesClass: { - {Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.31"), Default: false, PreRelease: featuregate.Beta}, - }, - - VolumeCapacityPriority: { - {Version: version.MustParse("1.21"), Default: false, PreRelease: featuregate.Alpha}, - }, - - WinDSR: { - {Version: version.MustParse("1.14"), Default: false, PreRelease: featuregate.Alpha}, - }, - WindowsGracefulNodeShutdown: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, - WinOverlay: { - {Version: version.MustParse("1.14"), Default: false, PreRelease: featuregate.Alpha}, - {Version: version.MustParse("1.20"), Default: true, PreRelease: featuregate.Beta}, - }, - - WindowsCPUAndMemoryAffinity: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, - - WindowsHostNetwork: { - {Version: version.MustParse("1.26"), Default: true, PreRelease: featuregate.Alpha}, - }, - - zpagesfeatures.ComponentFlagz: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, - - zpagesfeatures.ComponentStatusz: { - {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, - }, -} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/fieldpath/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/fieldpath/doc.go index 400d001e7..83cbdce0c 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/fieldpath/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/fieldpath/doc.go @@ -16,4 +16,4 @@ limitations under the License. // Package fieldpath supplies methods for extracting fields from objects // given a path to a field. -package fieldpath // import "k8s.io/kubernetes/pkg/fieldpath" +package fieldpath diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/apis/config/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/apis/config/doc.go index ad40e6834..78af11794 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/apis/config/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/apis/config/doc.go @@ -17,4 +17,4 @@ limitations under the License. // +k8s:deepcopy-gen=package // +groupName=kubelet.config.k8s.io -package config // import "k8s.io/kubernetes/pkg/kubelet/apis/config" +package config diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/apis/config/register.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/apis/config/register.go index d13cc6bdb..307995d1b 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/apis/config/register.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/apis/config/register.go @@ -40,6 +40,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &KubeletConfiguration{}, &SerializedNodeConfigSource{}, &CredentialProviderConfig{}, + &ImagePullIntent{}, + &ImagePulledRecord{}, ) return nil } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/apis/config/types.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/apis/config/types.go index a7024cc99..3a3da8db5 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/apis/config/types.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/apis/config/types.go @@ -155,6 +155,25 @@ type KubeletConfiguration struct { // pulls to burst to this number, while still not exceeding registryPullQPS. // Only used if registryPullQPS > 0. RegistryBurst int32 + // imagePullCredentialsVerificationPolicy determines how credentials should be + // verified when pod requests an image that is already present on the node: + // - NeverVerify + // - anyone on a node can use any image present on the node + // - NeverVerifyPreloadedImages + // - images that were pulled to the node by something else than the kubelet + // can be used without reverifying pull credentials + // - NeverVerifyAllowlistedImages + // - like "NeverVerifyPreloadedImages" but only node images from + // `preloadedImagesVerificationAllowlist` don't require reverification + // - AlwaysVerify + // - all images require credential reverification + ImagePullCredentialsVerificationPolicy string + // preloadedImagesVerificationAllowlist specifies a list of images that are + // exempted from credential reverification for the "NeverVerifyAllowlistedImages" + // `imagePullCredentialsVerificationPolicy`. + // The list accepts a full path segment wildcard suffix "/*". + // Only use image specs without an image tag or digest. + PreloadedImagesVerificationAllowlist []string // eventRecordQPS is the maximum event creations per second. If 0, there // is no limit enforced. EventRecordQPS int32 @@ -234,14 +253,11 @@ type KubeletConfiguration struct { // a group. It means that if true, the behavior aligns with the behavior of cgroups v1. SingleProcessOOMKill *bool // CPUManagerPolicy is the name of the policy to use. - // Requires the CPUManager feature gate to be enabled. CPUManagerPolicy string // CPUManagerPolicyOptions is a set of key=value which allows to set extra options // to fine tune the behaviour of the cpu manager policies. - // Requires both the "CPUManager" and "CPUManagerPolicyOptions" feature gates to be enabled. CPUManagerPolicyOptions map[string]string // CPU Manager reconciliation period. - // Requires the CPUManager feature gate to be enabled. CPUManagerReconcilePeriod metav1.Duration // MemoryManagerPolicy is the name of the policy to use. // Requires the MemoryManager feature gate to be enabled. @@ -322,6 +338,14 @@ type KubeletConfiguration struct { // amount of a given resource the kubelet will reclaim when performing a pod eviction while // that resource is under pressure. For example: {"imagefs.available": "2Gi"} EvictionMinimumReclaim map[string]string + // mergeDefaultEvictionSettings indicates that defaults for the evictionHard, evictionSoft, evictionSoftGracePeriod, and evictionMinimumReclaim + // fields should be merged into values specified for those fields in this configuration. + // Signals specified in this configuration take precedence. + // Signals not specified in this configuration inherit their defaults. + // If false, and if any signal is specified in this configuration then other signals that + // are not specified in this configuration will be set to 0. + // It applies to merging the fields for which the default exists, and currently only evictionHard has default values. + MergeDefaultEvictionSettings bool // podsPerCore is the maximum number of pods per core. Cannot exceed MaxPods. // If 0, this field is ignored. PodsPerCore int32 @@ -514,6 +538,11 @@ type KubeletConfiguration struct { // +featureGate=KubeletCrashLoopBackoffMax // +optional CrashLoopBackOff CrashLoopBackOffConfig + + // UserNamespaces contains User Namespace configurations. + // +featureGate=UserNamespaceSupport + // +optional + UserNamespaces *UserNamespaces } // KubeletAuthorizationMode denotes the authorization mode for the kubelet @@ -604,7 +633,7 @@ type CredentialProviderConfig struct { // Multiple providers may match against a single image, in which case credentials // from all providers will be returned to the kubelet. If multiple providers are called // for a single image, the results are combined. If providers return overlapping - // auth keys, the value from the provider earlier in this list is used. + // auth keys, the value from the provider earlier in this list is attempted first. Providers []CredentialProvider } @@ -614,6 +643,7 @@ type CredentialProvider struct { // name is the required name of the credential provider. It must match the name of the // provider executable as seen by the kubelet. The executable must be in the kubelet's // bin directory (set by the --credential-provider-bin-dir flag). + // Required to be unique across all providers. Name string // matchImages is a required list of strings used to match against images in order to @@ -661,6 +691,64 @@ type CredentialProvider struct { // to pass argument to the plugin. // +optional Env []ExecEnvVar + + // tokenAttributes is the configuration for the service account token that will be passed to the plugin. + // The credential provider opts in to using service account tokens for image pull by setting this field. + // When this field is set, kubelet will generate a service account token bound to the pod for which the + // image is being pulled and pass to the plugin as part of CredentialProviderRequest along with other + // attributes required by the plugin. + // + // The service account metadata and token attributes will be used as a dimension to cache + // the credentials in kubelet. The cache key is generated by combining the service account metadata + // (namespace, name, UID, and annotations key+value for the keys defined in + // serviceAccountTokenAttribute.requiredServiceAccountAnnotationKeys and serviceAccountTokenAttribute.optionalServiceAccountAnnotationKeys). + // The pod metadata (namespace, name, UID) that are in the service account token are not used as a dimension + // to cache the credentials in kubelet. This means workloads that are using the same service account + // could end up using the same credentials for image pull. For plugins that don't want this behavior, or + // plugins that operate in pass-through mode; i.e., they return the service account token as-is, they + // can set the credentialProviderResponse.cacheDuration to 0. This will disable the caching of + // credentials in kubelet and the plugin will be invoked for every image pull. This does result in + // token generation overhead for every image pull, but it is the only way to ensure that the + // credentials are not shared across pods (even if they are using the same service account). + // +optional + TokenAttributes *ServiceAccountTokenAttributes +} + +// ServiceAccountTokenAttributes is the configuration for the service account token that will be passed to the plugin. +type ServiceAccountTokenAttributes struct { + // serviceAccountTokenAudience is the intended audience for the projected service account token. + // +required + ServiceAccountTokenAudience string + + // requireServiceAccount indicates whether the plugin requires the pod to have a service account. + // If set to true, kubelet will only invoke the plugin if the pod has a service account. + // If set to false, kubelet will invoke the plugin even if the pod does not have a service account + // and will not include a token in the CredentialProviderRequest in that scenario. This is useful for plugins that + // are used to pull images for pods without service accounts (e.g., static pods). + // +required + RequireServiceAccount *bool + + // requiredServiceAccountAnnotationKeys is the list of annotation keys that the plugin is interested in + // and that are required to be present in the service account. + // The keys defined in this list will be extracted from the corresponding service account and passed + // to the plugin as part of the CredentialProviderRequest. If any of the keys defined in this list + // are not present in the service account, kubelet will not invoke the plugin and will return an error. + // This field is optional and may be empty. Plugins may use this field to extract + // additional information required to fetch credentials or allow workloads to opt in to + // using service account tokens for image pull. + // If non-empty, requireServiceAccount must be set to true. + // +optional + RequiredServiceAccountAnnotationKeys []string + + // optionalServiceAccountAnnotationKeys is the list of annotation keys that the plugin is interested in + // and that are optional to be present in the service account. + // The keys defined in this list will be extracted from the corresponding service account and passed + // to the plugin as part of the CredentialProviderRequest. The plugin is responsible for validating + // the existence of annotations and their values. + // This field is optional and may be empty. Plugins may use this field to extract + // additional information required to fetch credentials. + // +optional + OptionalServiceAccountAnnotationKeys []string } // ExecEnvVar is used for setting environment variables when executing an exec-based @@ -702,3 +790,107 @@ type CrashLoopBackOffConfig struct { // +optional MaxContainerRestartPeriod *metav1.Duration } + +// ImagePullCredentialsVerificationPolicy is an enum for the policy that is enforced +// when pod is requesting an image that appears on the system +type ImagePullCredentialsVerificationPolicy string + +const ( + // NeverVerify will never require credential verification for images that + // already exist on the node + NeverVerify ImagePullCredentialsVerificationPolicy = "NeverVerify" + // NeverVerifyPreloadedImages does not require credential verification for images + // pulled outside the kubelet process + NeverVerifyPreloadedImages ImagePullCredentialsVerificationPolicy = "NeverVerifyPreloadedImages" + // NeverVerifyAllowlistedImages does not require credential verification for + // a list of images that were pulled outside the kubelet process + NeverVerifyAllowlistedImages ImagePullCredentialsVerificationPolicy = "NeverVerifyAllowlistedImages" + // AlwaysVerify requires credential verification for accessing any image on the + // node irregardless how it was pulled + AlwaysVerify ImagePullCredentialsVerificationPolicy = "AlwaysVerify" +) + +// ImagePullIntent is a record of the kubelet attempting to pull an image. +// +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ImagePullIntent struct { + metav1.TypeMeta + + // Image is the image spec from a Container's `image` field. + // The filename is a SHA-256 hash of this value. This is to avoid filename-unsafe + // characters like ':' and '/'. + Image string +} + +// ImagePullRecord is a record of an image that was pulled by the kubelet. +// +// If there are no records in the `kubernetesSecrets` field and both `nodeWideCredentials` +// and `anonymous` are `false`, credentials must be re-checked the next time an +// image represented by this record is being requested. +// +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ImagePulledRecord struct { + metav1.TypeMeta + + // LastUpdatedTime is the time of the last update to this record + LastUpdatedTime metav1.Time + + // ImageRef is a reference to the image represented by this file as received + // from the CRI. + // The filename is a SHA-256 hash of this value. This is to avoid filename-unsafe + // characters like ':' and '/'. + ImageRef string + + // CredentialMapping maps `image` to the set of credentials that it was + // previously pulled with. + // `image` in this case is the content of a pod's container `image` field that's + // got its tag/digest removed. + // + // Example: + // Container requests the `hello-world:latest@sha256:91fb4b041da273d5a3273b6d587d62d518300a6ad268b28628f74997b93171b2` image: + // "credentialMapping": { + // "hello-world": { "nodePodsAccessible": true } + // } + CredentialMapping map[string]ImagePullCredentials +} + +// ImagePullCredentials describe credentials that can be used to pull an image. +type ImagePullCredentials struct { + // KuberneteSecretCoordinates is an index of coordinates of all the kubernetes + // secrets that were used to pull the image. + // +optional + KubernetesSecrets []ImagePullSecret + + // NodePodsAccessible is a flag denoting the pull credentials are accessible + // by all the pods on the node, or that no credentials are needed for the pull. + // + // If true, it is mutually exclusive with the `kubernetesSecrets` field. + // +optional + NodePodsAccessible bool +} + +// ImagePullSecret is a representation of a Kubernetes secret object coordinates along +// with a credential hash of the pull secret credentials this object contains. +type ImagePullSecret struct { + UID string + Namespace string + Name string + + // CredentialHash is a SHA-256 retrieved by hashing the image pull credentials + // content of the secret specified by the UID/Namespace/Name coordinates. + CredentialHash string +} + +// UserNamespaces contains User Namespace configurations. +type UserNamespaces struct { + // IDsPerPod is the mapping length of UIDs and GIDs. + // The length must be a multiple of 65536, and must be less than 1<<32. + // On non-linux such as windows, only null / absent is allowed. + // + // Changing the value may require recreating all containers on the node. + // + // Default: 65536 + // +featureGate=UserNamespaceSupport + // +optional + IDsPerPod *int64 +} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/apis/config/zz_generated.deepcopy.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/apis/config/zz_generated.deepcopy.go index 2942552e3..dc1baba0f 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/apis/config/zz_generated.deepcopy.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/apis/config/zz_generated.deepcopy.go @@ -72,6 +72,11 @@ func (in *CredentialProvider) DeepCopyInto(out *CredentialProvider) { *out = make([]ExecEnvVar, len(*in)) copy(*out, *in) } + if in.TokenAttributes != nil { + in, out := &in.TokenAttributes, &out.TokenAttributes + *out = new(ServiceAccountTokenAttributes) + (*in).DeepCopyInto(*out) + } return } @@ -133,6 +138,101 @@ func (in *ExecEnvVar) DeepCopy() *ExecEnvVar { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImagePullCredentials) DeepCopyInto(out *ImagePullCredentials) { + *out = *in + if in.KubernetesSecrets != nil { + in, out := &in.KubernetesSecrets, &out.KubernetesSecrets + *out = make([]ImagePullSecret, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImagePullCredentials. +func (in *ImagePullCredentials) DeepCopy() *ImagePullCredentials { + if in == nil { + return nil + } + out := new(ImagePullCredentials) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImagePullIntent) DeepCopyInto(out *ImagePullIntent) { + *out = *in + out.TypeMeta = in.TypeMeta + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImagePullIntent. +func (in *ImagePullIntent) DeepCopy() *ImagePullIntent { + if in == nil { + return nil + } + out := new(ImagePullIntent) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ImagePullIntent) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImagePullSecret) DeepCopyInto(out *ImagePullSecret) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImagePullSecret. +func (in *ImagePullSecret) DeepCopy() *ImagePullSecret { + if in == nil { + return nil + } + out := new(ImagePullSecret) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImagePulledRecord) DeepCopyInto(out *ImagePulledRecord) { + *out = *in + out.TypeMeta = in.TypeMeta + in.LastUpdatedTime.DeepCopyInto(&out.LastUpdatedTime) + if in.CredentialMapping != nil { + in, out := &in.CredentialMapping, &out.CredentialMapping + *out = make(map[string]ImagePullCredentials, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImagePulledRecord. +func (in *ImagePulledRecord) DeepCopy() *ImagePulledRecord { + if in == nil { + return nil + } + out := new(ImagePulledRecord) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ImagePulledRecord) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KubeletAnonymousAuthentication) DeepCopyInto(out *KubeletAnonymousAuthentication) { *out = *in @@ -214,6 +314,11 @@ func (in *KubeletConfiguration) DeepCopyInto(out *KubeletConfiguration) { } out.Authentication = in.Authentication out.Authorization = in.Authorization + if in.PreloadedImagesVerificationAllowlist != nil { + in, out := &in.PreloadedImagesVerificationAllowlist, &out.PreloadedImagesVerificationAllowlist + *out = make([]string, len(*in)) + copy(*out, *in) + } if in.ClusterDNS != nil { in, out := &in.ClusterDNS, &out.ClusterDNS *out = make([]string, len(*in)) @@ -354,6 +459,11 @@ func (in *KubeletConfiguration) DeepCopyInto(out *KubeletConfiguration) { (*in).DeepCopyInto(*out) } in.CrashLoopBackOff.DeepCopyInto(&out.CrashLoopBackOff) + if in.UserNamespaces != nil { + in, out := &in.UserNamespaces, &out.UserNamespaces + *out = new(UserNamespaces) + (*in).DeepCopyInto(*out) + } return } @@ -491,6 +601,37 @@ func (in *SerializedNodeConfigSource) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceAccountTokenAttributes) DeepCopyInto(out *ServiceAccountTokenAttributes) { + *out = *in + if in.RequireServiceAccount != nil { + in, out := &in.RequireServiceAccount, &out.RequireServiceAccount + *out = new(bool) + **out = **in + } + if in.RequiredServiceAccountAnnotationKeys != nil { + in, out := &in.RequiredServiceAccountAnnotationKeys, &out.RequiredServiceAccountAnnotationKeys + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.OptionalServiceAccountAnnotationKeys != nil { + in, out := &in.OptionalServiceAccountAnnotationKeys, &out.OptionalServiceAccountAnnotationKeys + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceAccountTokenAttributes. +func (in *ServiceAccountTokenAttributes) DeepCopy() *ServiceAccountTokenAttributes { + if in == nil { + return nil + } + out := new(ServiceAccountTokenAttributes) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ShutdownGracePeriodByPodPriority) DeepCopyInto(out *ShutdownGracePeriodByPodPriority) { *out = *in @@ -506,3 +647,24 @@ func (in *ShutdownGracePeriodByPodPriority) DeepCopy() *ShutdownGracePeriodByPod in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserNamespaces) DeepCopyInto(out *UserNamespaces) { + *out = *in + if in.IDsPerPod != nil { + in, out := &in.IDsPerPod, &out.IDsPerPod + *out = new(int64) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserNamespaces. +func (in *UserNamespaces) DeepCopy() *UserNamespaces { + if in == nil { + return nil + } + out := new(UserNamespaces) + in.DeepCopyInto(out) + return out +} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/apis/podresources/server_v1.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/apis/podresources/server_v1.go index 7d10449ad..d69aba1e8 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/apis/podresources/server_v1.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/apis/podresources/server_v1.go @@ -66,16 +66,13 @@ func (p *v1PodResourcesServer) List(ctx context.Context, req *podresourcesv1.Lis Containers: make([]*podresourcesv1.ContainerResources, 0, len(pod.Spec.Containers)), } - if utilfeature.DefaultFeatureGate.Enabled(kubefeatures.SidecarContainers) { - pRes.Containers = make([]*podresourcesv1.ContainerResources, 0, len(pod.Spec.InitContainers)+len(pod.Spec.Containers)) - - for _, container := range pod.Spec.InitContainers { - if !podutil.IsRestartableInitContainer(&container) { - continue - } - - pRes.Containers = append(pRes.Containers, p.getContainerResources(pod, &container)) + pRes.Containers = make([]*podresourcesv1.ContainerResources, 0, len(pod.Spec.InitContainers)+len(pod.Spec.Containers)) + for _, container := range pod.Spec.InitContainers { + if !podutil.IsRestartableInitContainer(&container) { + continue } + + pRes.Containers = append(pRes.Containers, p.getContainerResources(pod, &container)) } for _, container := range pod.Spec.Containers { @@ -126,16 +123,13 @@ func (p *v1PodResourcesServer) Get(ctx context.Context, req *podresourcesv1.GetP Containers: make([]*podresourcesv1.ContainerResources, 0, len(pod.Spec.Containers)), } - if utilfeature.DefaultFeatureGate.Enabled(kubefeatures.SidecarContainers) { - podResources.Containers = make([]*podresourcesv1.ContainerResources, 0, len(pod.Spec.InitContainers)+len(pod.Spec.Containers)) - - for _, container := range pod.Spec.InitContainers { - if !podutil.IsRestartableInitContainer(&container) { - continue - } - - podResources.Containers = append(podResources.Containers, p.getContainerResources(pod, &container)) + podResources.Containers = make([]*podresourcesv1.ContainerResources, 0, len(pod.Spec.InitContainers)+len(pod.Spec.Containers)) + for _, container := range pod.Spec.InitContainers { + if !podutil.IsRestartableInitContainer(&container) { + continue } + + podResources.Containers = append(podResources.Containers, p.getContainerResources(pod, &container)) } for _, container := range pod.Spec.Containers { diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cadvisor/cadvisor_linux.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cadvisor/cadvisor_linux.go index c2756c6f1..2120adfcf 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cadvisor/cadvisor_linux.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cadvisor/cadvisor_linux.go @@ -39,7 +39,9 @@ import ( cadvisorapiv2 "github.com/google/cadvisor/info/v2" "github.com/google/cadvisor/manager" "github.com/google/cadvisor/utils/sysfs" + utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/klog/v2" + "k8s.io/kubernetes/pkg/features" "k8s.io/utils/ptr" ) @@ -93,6 +95,10 @@ func New(imageFsInfoProvider ImageFsInfoProvider, rootPath string, cgroupRoots [ cadvisormetrics.OOMMetrics: struct{}{}, } + if utilfeature.DefaultFeatureGate.Enabled(features.KubeletPSI) { + includedMetrics[cadvisormetrics.PressureMetrics] = struct{}{} + } + if usingLegacyStats || localStorageCapacityIsolation { includedMetrics[cadvisormetrics.DiskUsageMetrics] = struct{}{} } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cadvisor/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cadvisor/doc.go index afd79492d..113bacf37 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cadvisor/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cadvisor/doc.go @@ -15,4 +15,4 @@ limitations under the License. */ // Package cadvisor provides an interface for Kubelet interactions with cAdvisor. -package cadvisor // import "k8s.io/kubernetes/pkg/kubelet/cadvisor" +package cadvisor diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/OWNERS b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/OWNERS index cc6704003..2c23842e9 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/OWNERS +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/OWNERS @@ -6,6 +6,7 @@ approvers: - derekwaynecarr - yujuhong - klueska + - ffromani reviewers: - sig-node-reviewers emeritus_approvers: diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_manager_linux.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_manager_linux.go index 6bcb1298c..9b975a363 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_manager_linux.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_manager_linux.go @@ -25,11 +25,10 @@ import ( "sync" "time" - libcontainercgroups "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" - libcontainercgroupmanager "github.com/opencontainers/runc/libcontainer/cgroups/manager" - cgroupsystemd "github.com/opencontainers/runc/libcontainer/cgroups/systemd" - libcontainerconfigs "github.com/opencontainers/runc/libcontainer/configs" + libcontainercgroups "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/fscommon" + libcontainercgroupmanager "github.com/opencontainers/cgroups/manager" + cgroupsystemd "github.com/opencontainers/cgroups/systemd" "k8s.io/klog/v2" v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" @@ -195,14 +194,14 @@ func (m *cgroupCommon) buildCgroupPaths(name CgroupName) map[string]string { } // libctCgroupConfig converts CgroupConfig to libcontainer's Cgroup config. -func (m *cgroupCommon) libctCgroupConfig(in *CgroupConfig, needResources bool) *libcontainerconfigs.Cgroup { - config := &libcontainerconfigs.Cgroup{ +func (m *cgroupCommon) libctCgroupConfig(in *CgroupConfig, needResources bool) *libcontainercgroups.Cgroup { + config := &libcontainercgroups.Cgroup{ Systemd: m.useSystemd, } if needResources { config.Resources = m.toResources(in.ResourceParameters) } else { - config.Resources = &libcontainerconfigs.Resources{} + config.Resources = &libcontainercgroups.Resources{} } if !config.Systemd { @@ -279,8 +278,8 @@ var ( availableRootControllers sets.Set[string] ) -func (m *cgroupCommon) toResources(resourceConfig *ResourceConfig) *libcontainerconfigs.Resources { - resources := &libcontainerconfigs.Resources{ +func (m *cgroupCommon) toResources(resourceConfig *ResourceConfig) *libcontainercgroups.Resources { + resources := &libcontainercgroups.Resources{ SkipDevices: true, SkipFreezeOnSet: true, } @@ -324,7 +323,7 @@ func (m *cgroupCommon) toResources(resourceConfig *ResourceConfig) *libcontainer return resources } -func (m *cgroupCommon) maybeSetHugetlb(resourceConfig *ResourceConfig, resources *libcontainerconfigs.Resources) { +func (m *cgroupCommon) maybeSetHugetlb(resourceConfig *ResourceConfig, resources *libcontainercgroups.Resources) { // Check if hugetlb is supported. if libcontainercgroups.IsCgroup2UnifiedMode() { if !getSupportedUnifiedControllers().Has("hugetlb") { @@ -344,7 +343,7 @@ func (m *cgroupCommon) maybeSetHugetlb(resourceConfig *ResourceConfig, resources klog.InfoS("Invalid pageSize", "err", err) continue } - resources.HugetlbLimit = append(resources.HugetlbLimit, &libcontainerconfigs.HugepageLimit{ + resources.HugetlbLimit = append(resources.HugetlbLimit, &libcontainercgroups.HugepageLimit{ Pagesize: sizeString, Limit: uint64(limit), }) @@ -355,7 +354,7 @@ func (m *cgroupCommon) maybeSetHugetlb(resourceConfig *ResourceConfig, resources if pageSizes.Has(pageSize) { continue } - resources.HugetlbLimit = append(resources.HugetlbLimit, &libcontainerconfigs.HugepageLimit{ + resources.HugetlbLimit = append(resources.HugetlbLimit, &libcontainercgroups.HugepageLimit{ Pagesize: pageSize, Limit: uint64(0), }) diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_v1_manager_linux.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_v1_manager_linux.go index afd029258..fac37b6e7 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_v1_manager_linux.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_v1_manager_linux.go @@ -22,8 +22,8 @@ import ( "strconv" "strings" - libcontainercgroups "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" + libcontainercgroups "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/fscommon" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/sets" ) diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_v2_manager_linux.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_v2_manager_linux.go index ad93e971f..84f7b01c5 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_v2_manager_linux.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cgroup_v2_manager_linux.go @@ -24,13 +24,17 @@ import ( "strconv" "strings" - "github.com/opencontainers/runc/libcontainer/cgroups/fscommon" + "github.com/opencontainers/cgroups/fscommon" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/sets" cmutil "k8s.io/kubernetes/pkg/kubelet/cm/util" ) -const cgroupv2MemLimitFile string = "memory.max" +const ( + cgroupv2MemLimitFile = "memory.max" + cgroupv2CpuMaxFile = "cpu.max" + cgroupv2CpuWeightFile = "cpu.weight" +) // cgroupV2impl implements the CgroupManager interface // for cgroup v2. @@ -100,14 +104,14 @@ func (c *cgroupV2impl) GetCgroupConfig(name CgroupName, resource v1.ResourceName func (c *cgroupV2impl) getCgroupCPUConfig(cgroupPath string) (*ResourceConfig, error) { var cpuLimitStr, cpuPeriodStr string - cpuLimitAndPeriod, err := fscommon.GetCgroupParamString(cgroupPath, "cpu.max") + cpuLimitAndPeriod, err := fscommon.GetCgroupParamString(cgroupPath, cgroupv2CpuMaxFile) if err != nil { - return nil, fmt.Errorf("failed to read cpu.max file for cgroup %v: %w", cgroupPath, err) + return nil, fmt.Errorf("failed to read %s file for cgroup %v: %w", cgroupv2CpuMaxFile, cgroupPath, err) } numItems, errScan := fmt.Sscanf(cpuLimitAndPeriod, "%s %s", &cpuLimitStr, &cpuPeriodStr) if errScan != nil || numItems != 2 { - return nil, fmt.Errorf("failed to correctly parse content of cpu.max file ('%s') for cgroup %v: %w", - cpuLimitAndPeriod, cgroupPath, errScan) + return nil, fmt.Errorf("failed to correctly parse content of %s file ('%s') for cgroup %v: %w", + cgroupv2CpuMaxFile, cpuLimitAndPeriod, cgroupPath, errScan) } cpuLimit := int64(-1) if cpuLimitStr != Cgroup2MaxCpuLimit { @@ -120,7 +124,7 @@ func (c *cgroupV2impl) getCgroupCPUConfig(cgroupPath string) (*ResourceConfig, e if errPeriod != nil { return nil, fmt.Errorf("failed to convert CPU period as integer for cgroup %v: %w", cgroupPath, errPeriod) } - cpuWeight, errWeight := fscommon.GetCgroupParamUint(cgroupPath, "cpu.weight") + cpuWeight, errWeight := fscommon.GetCgroupParamUint(cgroupPath, cgroupv2CpuWeightFile) if errWeight != nil { return nil, fmt.Errorf("failed to read CPU weight for cgroup %v: %w", cgroupPath, errWeight) } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager.go index 71a1291d1..0f4a20807 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager.go @@ -31,6 +31,7 @@ import ( v1 "k8s.io/api/core/v1" "k8s.io/apiserver/pkg/server/healthz" internalapi "k8s.io/cri-api/pkg/apis" + "k8s.io/klog/v2" podresourcesapi "k8s.io/kubelet/pkg/apis/podresources/v1" kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config" "k8s.io/kubernetes/pkg/kubelet/apis/podresources" @@ -154,6 +155,13 @@ type ContainerManager interface { // Updates returns a channel that receives an Update when the device changed its status. Updates() <-chan resourceupdates.Update + // PodHasExclusiveCPUs returns true if the provided pod has containers with exclusive CPUs, + // This means that at least one sidecar container or one app container has exclusive CPUs allocated. + PodHasExclusiveCPUs(pod *v1.Pod) bool + + // ContainerHasExclusiveCPUs returns true if the provided container in the pod has exclusive cpu + ContainerHasExclusiveCPUs(pod *v1.Pod, container *v1.Container) bool + // Implements the PodResources Provider API podresources.CPUsProvider podresources.DevicesProvider @@ -161,6 +169,10 @@ type ContainerManager interface { podresources.DynamicResourcesProvider } +type cpuAllocationReader interface { + GetExclusiveCPUs(podUID, containerName string) cpuset.CPUSet +} + type NodeConfig struct { NodeName types.NodeName RuntimeCgroupsName string @@ -174,19 +186,19 @@ type NodeConfig struct { KubeletRootDir string ProtectKernelDefaults bool NodeAllocatableConfig - QOSReserved map[v1.ResourceName]int64 - CPUManagerPolicy string - CPUManagerPolicyOptions map[string]string - TopologyManagerScope string - CPUManagerReconcilePeriod time.Duration - ExperimentalMemoryManagerPolicy string - ExperimentalMemoryManagerReservedMemory []kubeletconfig.MemoryReservation - PodPidsLimit int64 - EnforceCPULimits bool - CPUCFSQuotaPeriod time.Duration - TopologyManagerPolicy string - TopologyManagerPolicyOptions map[string]string - CgroupVersion int + QOSReserved map[v1.ResourceName]int64 + CPUManagerPolicy string + CPUManagerPolicyOptions map[string]string + TopologyManagerScope string + CPUManagerReconcilePeriod time.Duration + MemoryManagerPolicy string + MemoryManagerReservedMemory []kubeletconfig.MemoryReservation + PodPidsLimit int64 + EnforceCPULimits bool + CPUCFSQuotaPeriod time.Duration + TopologyManagerPolicy string + TopologyManagerPolicyOptions map[string]string + CgroupVersion int } type NodeAllocatableConfig struct { @@ -212,6 +224,30 @@ func int64Slice(in []int) []int64 { return out } +func podHasExclusiveCPUs(cr cpuAllocationReader, pod *v1.Pod) bool { + for _, container := range pod.Spec.InitContainers { + if containerHasExclusiveCPUs(cr, pod, &container) { + return true + } + } + for _, container := range pod.Spec.Containers { + if containerHasExclusiveCPUs(cr, pod, &container) { + return true + } + } + klog.V(4).InfoS("Pod contains no container with pinned cpus", "podName", pod.Name) + return false +} + +func containerHasExclusiveCPUs(cr cpuAllocationReader, pod *v1.Pod, container *v1.Container) bool { + exclusiveCPUs := cr.GetExclusiveCPUs(string(pod.UID), container.Name) + if !exclusiveCPUs.IsEmpty() { + klog.V(4).InfoS("Container has pinned cpus", "podName", pod.Name, "containerName", container.Name) + return true + } + return false +} + // parsePercentage parses the percentage string to numeric value. func parsePercentage(v string) (int64, error) { if !strings.HasSuffix(v, "%") { diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_linux.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_linux.go index efbd90c1d..515360106 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_linux.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_linux.go @@ -27,9 +27,8 @@ import ( "sync" "time" - "github.com/opencontainers/runc/libcontainer/cgroups" - "github.com/opencontainers/runc/libcontainer/cgroups/manager" - "github.com/opencontainers/runc/libcontainer/configs" + "github.com/opencontainers/cgroups" + "github.com/opencontainers/cgroups/manager" "k8s.io/klog/v2" "k8s.io/mount-utils" utilpath "k8s.io/utils/path" @@ -336,10 +335,10 @@ func NewContainerManager(mountUtil mount.Interface, cadvisorInterface cadvisor.I cm.topologyManager.AddHintProvider(cm.cpuManager) cm.memoryManager, err = memorymanager.NewManager( - nodeConfig.ExperimentalMemoryManagerPolicy, + nodeConfig.MemoryManagerPolicy, machineInfo, cm.GetNodeAllocatableReservation(), - nodeConfig.ExperimentalMemoryManagerReservedMemory, + nodeConfig.MemoryManagerReservedMemory, nodeConfig.KubeletRootDir, cm.topologyManager, ) @@ -365,7 +364,8 @@ func (cm *containerManagerImpl) NewPodContainerManager() PodContainerManager { enforceCPULimits: cm.EnforceCPULimits, // cpuCFSQuotaPeriod is in microseconds. NodeConfig.CPUCFSQuotaPeriod is time.Duration (measured in nano seconds). // Convert (cm.CPUCFSQuotaPeriod) [nanoseconds] / time.Microsecond (1000) to get cpuCFSQuotaPeriod in microseconds. - cpuCFSQuotaPeriod: uint64(cm.CPUCFSQuotaPeriod / time.Microsecond), + cpuCFSQuotaPeriod: uint64(cm.CPUCFSQuotaPeriod / time.Microsecond), + podContainerManager: cm, } } return &podContainerManagerNoop{ @@ -373,16 +373,24 @@ func (cm *containerManagerImpl) NewPodContainerManager() PodContainerManager { } } +func (cm *containerManagerImpl) PodHasExclusiveCPUs(pod *v1.Pod) bool { + return podHasExclusiveCPUs(cm.cpuManager, pod) +} + +func (cm *containerManagerImpl) ContainerHasExclusiveCPUs(pod *v1.Pod, container *v1.Container) bool { + return containerHasExclusiveCPUs(cm.cpuManager, pod, container) +} + func (cm *containerManagerImpl) InternalContainerLifecycle() InternalContainerLifecycle { return &internalContainerLifecycleImpl{cm.cpuManager, cm.memoryManager, cm.topologyManager} } // Create a cgroup container manager. func createManager(containerName string) (cgroups.Manager, error) { - cg := &configs.Cgroup{ + cg := &cgroups.Cgroup{ Parent: "/", Name: containerName, - Resources: &configs.Resources{ + Resources: &cgroups.Resources{ SkipDevices: true, }, Systemd: false, diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_stub.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_stub.go index e117a7377..429ccf0b4 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_stub.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_stub.go @@ -195,6 +195,14 @@ func (cm *containerManagerStub) Updates() <-chan resourceupdates.Update { return nil } +func (cm *containerManagerStub) PodHasExclusiveCPUs(pod *v1.Pod) bool { + return false +} + +func (cm *containerManagerStub) ContainerHasExclusiveCPUs(pod *v1.Pod, container *v1.Container) bool { + return false +} + func NewStubContainerManager() ContainerManager { return &containerManagerStub{shouldResetExtendedResourceCapacity: false} } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_windows.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_windows.go index 352660dd6..d3e080614 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_windows.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/container_manager_windows.go @@ -168,10 +168,10 @@ func NewContainerManager(mountUtil mount.Interface, cadvisorInterface cadvisor.I klog.InfoS("Creating memory manager") cm.memoryManager, err = memorymanager.NewManager( - nodeConfig.ExperimentalMemoryManagerPolicy, + nodeConfig.MemoryManagerPolicy, machineInfo, cm.GetNodeAllocatableReservation(), - nodeConfig.ExperimentalMemoryManagerReservedMemory, + nodeConfig.MemoryManagerReservedMemory, nodeConfig.KubeletRootDir, cm.topologyManager, ) @@ -369,3 +369,11 @@ func (cm *containerManagerImpl) UnprepareDynamicResources(ctx context.Context, p func (cm *containerManagerImpl) PodMightNeedToUnprepareResources(UID types.UID) bool { return false } + +func (cm *containerManagerImpl) PodHasExclusiveCPUs(pod *v1.Pod) bool { + return podHasExclusiveCPUs(cm.cpuManager, pod) +} + +func (cm *containerManagerImpl) ContainerHasExclusiveCPUs(pod *v1.Pod, container *v1.Container) bool { + return containerHasExclusiveCPUs(cm.cpuManager, pod, container) +} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/containermap/container_map.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/containermap/container_map.go index 1d3fce813..dc01f6ec7 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/containermap/container_map.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/containermap/container_map.go @@ -18,6 +18,7 @@ package containermap import ( "fmt" + "maps" ) // cmItem (ContainerMap ITEM) is a pair podUID, containerName @@ -36,11 +37,7 @@ func NewContainerMap() ContainerMap { // Clone creates a deep copy of the ContainerMap func (cm ContainerMap) Clone() ContainerMap { - ret := make(ContainerMap, len(cm)) - for key, val := range cm { - ret[key] = val - } - return ret + return maps.Clone(cm) } // Add adds a mapping of (containerID)->(podUID, containerName) to the ContainerMap diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_assignment.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_assignment.go index b4abf3712..27afabefa 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_assignment.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_assignment.go @@ -18,6 +18,7 @@ package cpumanager import ( "fmt" + "maps" "math" "sort" @@ -39,11 +40,7 @@ const ( type mapIntInt map[int]int func (m mapIntInt) Clone() mapIntInt { - cp := make(mapIntInt, len(m)) - for k, v := range m { - cp[k] = v - } - return cp + return maps.Clone(m) } func (m mapIntInt) Keys() []int { diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_manager.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_manager.go index 9e72a7cc9..8b59ba671 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_manager.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/cpu_manager.go @@ -239,6 +239,8 @@ func (m *manager) Start(activePods ActivePodsFunc, sourcesReady config.SourcesRe return err } + klog.V(4).InfoS("CPU manager started", "policy", m.policy.Name()) + m.allocatableCPUs = m.policy.GetAllocatableCPUs(m.state) if m.policy.Name() == string(PolicyNone) { @@ -465,7 +467,7 @@ func (m *manager) reconcileState() (success []reconciledContainer, failure []rec cset := m.state.GetCPUSetOrDefault(string(pod.UID), container.Name) if cset.IsEmpty() { // NOTE: This should not happen outside of tests. - klog.V(2).InfoS("ReconcileState: skipping container; assigned cpuset is empty", "pod", klog.KObj(pod), "containerName", container.Name) + klog.V(2).InfoS("ReconcileState: skipping container; empty cpuset assigned", "pod", klog.KObj(pod), "containerName", container.Name) failure = append(failure, reconciledContainer{pod.Name, container.Name, containerID}) continue } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/policy_options.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/policy_options.go index 5b30d04a3..65b415bda 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/policy_options.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/policy_options.go @@ -39,16 +39,17 @@ const ( var ( alphaOptions = sets.New[string]( - DistributeCPUsAcrossNUMAOption, AlignBySocketOption, DistributeCPUsAcrossCoresOption, - StrictCPUReservationOption, PreferAlignByUnCoreCacheOption, ) betaOptions = sets.New[string]( + StrictCPUReservationOption, + DistributeCPUsAcrossNUMAOption, + ) + stableOptions = sets.New[string]( FullPCPUsOnlyOption, ) - stableOptions = sets.New[string]() ) // CheckPolicyOptionAvailable verifies if the given option can be used depending on the Feature Gate Settings. @@ -66,6 +67,7 @@ func CheckPolicyOptionAvailable(option string) error { return fmt.Errorf("CPU Manager Policy Beta-level Options not enabled, but option %q provided", option) } + // if the option is stable, we need no CPUManagerPolicy*Options feature gate check return nil } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/policy_static.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/policy_static.go index 26d1fc6d9..28591c5ba 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/policy_static.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/policy_static.go @@ -18,6 +18,7 @@ package cpumanager import ( "fmt" + "strconv" v1 "k8s.io/api/core/v1" utilfeature "k8s.io/apiserver/pkg/util/feature" @@ -325,13 +326,16 @@ func (p *staticPolicy) Allocate(s state.State, pod *v1.Pod, container *v1.Contai defer func() { if rerr != nil { metrics.CPUManagerPinningErrorsTotal.Inc() + if p.options.FullPhysicalCPUsOnly { + metrics.ContainerAlignedComputeResourcesFailure.WithLabelValues(metrics.AlignScopeContainer, metrics.AlignedPhysicalCPU).Inc() + } return } - if !p.options.FullPhysicalCPUsOnly { + // TODO: move in updateMetricsOnAllocate + if p.options.FullPhysicalCPUsOnly { // increment only if we know we allocate aligned resources - return + metrics.ContainerAlignedComputeResources.WithLabelValues(metrics.AlignScopeContainer, metrics.AlignedPhysicalCPU).Inc() } - metrics.ContainerAlignedComputeResources.WithLabelValues(metrics.AlignScopeContainer, metrics.AlignedPhysicalCPU).Inc() }() if p.options.FullPhysicalCPUsOnly { @@ -367,8 +371,8 @@ func (p *staticPolicy) Allocate(s state.State, pod *v1.Pod, container *v1.Contai } } } - if cpuset, ok := s.GetCPUSet(string(pod.UID), container.Name); ok { - p.updateCPUsToReuse(pod, container, cpuset) + if cset, ok := s.GetCPUSet(string(pod.UID), container.Name); ok { + p.updateCPUsToReuse(pod, container, cset) klog.InfoS("Static policy: container already present in state, skipping", "pod", klog.KObj(pod), "containerName", container.Name) return nil } @@ -378,16 +382,17 @@ func (p *staticPolicy) Allocate(s state.State, pod *v1.Pod, container *v1.Contai klog.InfoS("Topology Affinity", "pod", klog.KObj(pod), "containerName", container.Name, "affinity", hint) // Allocate CPUs according to the NUMA affinity contained in the hint. - cpuset, err := p.allocateCPUs(s, numCPUs, hint.NUMANodeAffinity, p.cpusToReuse[string(pod.UID)]) + cpuAllocation, err := p.allocateCPUs(s, numCPUs, hint.NUMANodeAffinity, p.cpusToReuse[string(pod.UID)]) if err != nil { klog.ErrorS(err, "Unable to allocate CPUs", "pod", klog.KObj(pod), "containerName", container.Name, "numCPUs", numCPUs) return err } - s.SetCPUSet(string(pod.UID), container.Name, cpuset) - p.updateCPUsToReuse(pod, container, cpuset) - p.updateMetricsOnAllocate(cpuset) + s.SetCPUSet(string(pod.UID), container.Name, cpuAllocation.CPUs) + p.updateCPUsToReuse(pod, container, cpuAllocation.CPUs) + p.updateMetricsOnAllocate(s, cpuAllocation) + klog.V(4).InfoS("Allocated exclusive CPUs", "pod", klog.KObj(pod), "containerName", container.Name, "cpuset", cpuAllocation.CPUs.String()) return nil } @@ -412,18 +417,19 @@ func (p *staticPolicy) RemoveContainer(s state.State, podUID string, containerNa // Mutate the shared pool, adding released cpus. toRelease = toRelease.Difference(cpusInUse) s.SetDefaultCPUSet(s.GetDefaultCPUSet().Union(toRelease)) - p.updateMetricsOnRelease(toRelease) + p.updateMetricsOnRelease(s, toRelease) + } return nil } -func (p *staticPolicy) allocateCPUs(s state.State, numCPUs int, numaAffinity bitmask.BitMask, reusableCPUs cpuset.CPUSet) (cpuset.CPUSet, error) { +func (p *staticPolicy) allocateCPUs(s state.State, numCPUs int, numaAffinity bitmask.BitMask, reusableCPUs cpuset.CPUSet) (topology.Allocation, error) { klog.InfoS("AllocateCPUs", "numCPUs", numCPUs, "socket", numaAffinity) allocatableCPUs := p.GetAvailableCPUs(s).Union(reusableCPUs) // If there are aligned CPUs in numaAffinity, attempt to take those first. - result := cpuset.New() + result := topology.EmptyAllocation() if numaAffinity != nil { alignedCPUs := p.getAlignedCPUs(numaAffinity, allocatableCPUs) @@ -432,30 +438,33 @@ func (p *staticPolicy) allocateCPUs(s state.State, numCPUs int, numaAffinity bit numAlignedToAlloc = numCPUs } - alignedCPUs, err := p.takeByTopology(alignedCPUs, numAlignedToAlloc) + allocatedCPUs, err := p.takeByTopology(alignedCPUs, numAlignedToAlloc) if err != nil { - return cpuset.New(), err + return topology.EmptyAllocation(), err } - result = result.Union(alignedCPUs) + result.CPUs = result.CPUs.Union(allocatedCPUs) } // Get any remaining CPUs from what's leftover after attempting to grab aligned ones. - remainingCPUs, err := p.takeByTopology(allocatableCPUs.Difference(result), numCPUs-result.Size()) + remainingCPUs, err := p.takeByTopology(allocatableCPUs.Difference(result.CPUs), numCPUs-result.CPUs.Size()) if err != nil { - return cpuset.New(), err + return topology.EmptyAllocation(), err } - result = result.Union(remainingCPUs) + result.CPUs = result.CPUs.Union(remainingCPUs) + result.Aligned = p.topology.CheckAlignment(result.CPUs) // Remove allocated CPUs from the shared CPUSet. - s.SetDefaultCPUSet(s.GetDefaultCPUSet().Difference(result)) + s.SetDefaultCPUSet(s.GetDefaultCPUSet().Difference(result.CPUs)) - klog.InfoS("AllocateCPUs", "result", result) + klog.InfoS("AllocateCPUs", "result", result.String()) return result, nil } func (p *staticPolicy) guaranteedCPUs(pod *v1.Pod, container *v1.Container) int { - if v1qos.GetPodQOS(pod) != v1.PodQOSGuaranteed { + qos := v1qos.GetPodQOS(pod) + if qos != v1.PodQOSGuaranteed { + klog.V(5).InfoS("Exclusive CPU allocation skipped, pod QoS is not guaranteed", "pod", klog.KObj(pod), "containerName", container.Name, "qos", qos) return 0 } cpuQuantity := container.Resources.Requests[v1.ResourceCPU] @@ -464,11 +473,19 @@ func (p *staticPolicy) guaranteedCPUs(pod *v1.Pod, container *v1.Container) int // We should return this value because this is what kubelet agreed to allocate for the container // and the value configured with runtime. if utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling) { - if cs, ok := podutil.GetContainerStatus(pod.Status.ContainerStatuses, container.Name); ok { + containerStatuses := pod.Status.ContainerStatuses + if podutil.IsRestartableInitContainer(container) { + if len(pod.Status.InitContainerStatuses) != 0 { + containerStatuses = append(containerStatuses, pod.Status.InitContainerStatuses...) + } + } + if cs, ok := podutil.GetContainerStatus(containerStatuses, container.Name); ok { cpuQuantity = cs.AllocatedResources[v1.ResourceCPU] } } - if cpuQuantity.Value()*1000 != cpuQuantity.MilliValue() { + cpuValue := cpuQuantity.Value() + if cpuValue*1000 != cpuQuantity.MilliValue() { + klog.V(5).InfoS("Exclusive CPU allocation skipped, pod requested non-integral CPUs", "pod", klog.KObj(pod), "containerName", container.Name, "cpu", cpuValue) return 0 } // Safe downcast to do for all systems with < 2.1 billion CPUs. @@ -740,27 +757,60 @@ func (p *staticPolicy) getAlignedCPUs(numaAffinity bitmask.BitMask, allocatableC func (p *staticPolicy) initializeMetrics(s state.State) { metrics.CPUManagerSharedPoolSizeMilliCores.Set(float64(p.GetAvailableCPUs(s).Size() * 1000)) - metrics.CPUManagerExclusiveCPUsAllocationCount.Set(float64(countExclusiveCPUs(s))) + metrics.ContainerAlignedComputeResourcesFailure.WithLabelValues(metrics.AlignScopeContainer, metrics.AlignedPhysicalCPU).Add(0) // ensure the value exists + metrics.ContainerAlignedComputeResources.WithLabelValues(metrics.AlignScopeContainer, metrics.AlignedPhysicalCPU).Add(0) // ensure the value exists + metrics.ContainerAlignedComputeResources.WithLabelValues(metrics.AlignScopeContainer, metrics.AlignedUncoreCache).Add(0) // ensure the value exists + totalAssignedCPUs := getTotalAssignedExclusiveCPUs(s) + metrics.CPUManagerExclusiveCPUsAllocationCount.Set(float64(totalAssignedCPUs.Size())) + updateAllocationPerNUMAMetric(p.topology, totalAssignedCPUs) } -func (p *staticPolicy) updateMetricsOnAllocate(cset cpuset.CPUSet) { - ncpus := cset.Size() +func (p *staticPolicy) updateMetricsOnAllocate(s state.State, cpuAlloc topology.Allocation) { + ncpus := cpuAlloc.CPUs.Size() metrics.CPUManagerExclusiveCPUsAllocationCount.Add(float64(ncpus)) metrics.CPUManagerSharedPoolSizeMilliCores.Add(float64(-ncpus * 1000)) + if cpuAlloc.Aligned.UncoreCache { + metrics.ContainerAlignedComputeResources.WithLabelValues(metrics.AlignScopeContainer, metrics.AlignedUncoreCache).Inc() + } + totalAssignedCPUs := getTotalAssignedExclusiveCPUs(s) + updateAllocationPerNUMAMetric(p.topology, totalAssignedCPUs) } -func (p *staticPolicy) updateMetricsOnRelease(cset cpuset.CPUSet) { +func (p *staticPolicy) updateMetricsOnRelease(s state.State, cset cpuset.CPUSet) { ncpus := cset.Size() metrics.CPUManagerExclusiveCPUsAllocationCount.Add(float64(-ncpus)) metrics.CPUManagerSharedPoolSizeMilliCores.Add(float64(ncpus * 1000)) + totalAssignedCPUs := getTotalAssignedExclusiveCPUs(s) + updateAllocationPerNUMAMetric(p.topology, totalAssignedCPUs.Difference(cset)) } -func countExclusiveCPUs(s state.State) int { - exclusiveCPUs := 0 - for _, cpuAssign := range s.GetCPUAssignments() { - for _, cset := range cpuAssign { - exclusiveCPUs += cset.Size() +func getTotalAssignedExclusiveCPUs(s state.State) cpuset.CPUSet { + totalAssignedCPUs := cpuset.New() + for _, assignment := range s.GetCPUAssignments() { + for _, cset := range assignment { + totalAssignedCPUs = totalAssignedCPUs.Union(cset) } + + } + return totalAssignedCPUs +} + +func updateAllocationPerNUMAMetric(topo *topology.CPUTopology, allocatedCPUs cpuset.CPUSet) { + numaCount := make(map[int]int) + + // Count CPUs allocated per NUMA node + for _, cpuID := range allocatedCPUs.UnsortedList() { + numaNode, err := topo.CPUNUMANodeID(cpuID) + if err != nil { + //NOTE: We are logging the error but it is highly unlikely to happen as the CPUset + // is already computed, evaluated and there is no room for user tampering. + klog.ErrorS(err, "Unable to determine NUMA node", "cpuID", cpuID) + } + numaCount[numaNode]++ + } + + // Update metric + for numaNode, count := range numaCount { + metrics.CPUManagerAllocationPerNUMA.WithLabelValues(strconv.Itoa(numaNode)).Set(float64(count)) } - return exclusiveCPUs } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/state/state_checkpoint.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/state/state_checkpoint.go index f6acc7c42..bda90ba1f 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/state/state_checkpoint.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/state/state_checkpoint.go @@ -201,7 +201,7 @@ func (sc *stateCheckpoint) SetCPUSet(podUID string, containerName string, cset c sc.cache.SetCPUSet(podUID, containerName, cset) err := sc.storeState() if err != nil { - klog.InfoS("Store state to checkpoint error", "err", err) + klog.ErrorS(err, "Failed to store state to checkpoint", "podUID", podUID, "containerName", containerName) } } @@ -212,7 +212,7 @@ func (sc *stateCheckpoint) SetDefaultCPUSet(cset cpuset.CPUSet) { sc.cache.SetDefaultCPUSet(cset) err := sc.storeState() if err != nil { - klog.InfoS("Store state to checkpoint error", "err", err) + klog.ErrorS(err, "Failed to store state to checkpoint") } } @@ -223,7 +223,7 @@ func (sc *stateCheckpoint) SetCPUAssignments(a ContainerCPUAssignments) { sc.cache.SetCPUAssignments(a) err := sc.storeState() if err != nil { - klog.InfoS("Store state to checkpoint error", "err", err) + klog.ErrorS(err, "Failed to store state to checkpoint") } } @@ -234,7 +234,7 @@ func (sc *stateCheckpoint) Delete(podUID string, containerName string) { sc.cache.Delete(podUID, containerName) err := sc.storeState() if err != nil { - klog.InfoS("Store state to checkpoint error", "err", err) + klog.ErrorS(err, "Failed to store state to checkpoint", "podUID", podUID, "containerName", containerName) } } @@ -245,6 +245,6 @@ func (sc *stateCheckpoint) ClearState() { sc.cache.ClearState() err := sc.storeState() if err != nil { - klog.InfoS("Store state to checkpoint error", "err", err) + klog.ErrorS(err, "Failed to store state to checkpoint") } } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/topology/alignment.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/topology/alignment.go new file mode 100644 index 000000000..4f3dfe297 --- /dev/null +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/topology/alignment.go @@ -0,0 +1,78 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package topology + +import ( + "fmt" + + "k8s.io/utils/cpuset" +) + +// Alignment is metadata about a cpuset allocation +type Alignment struct { + // UncoreCache is true if all the CPUs are uncore-cache aligned, + // IOW if they all share the same Uncore cache block. + // If the allocated CPU count is greater than a Uncore Group size, + // CPUs can't be uncore-aligned; otherwise, they are. + // This flag tracks alignment, not interference or lack thereof. + UncoreCache bool +} + +func (ca Alignment) String() string { + return fmt.Sprintf("aligned=", ca.UncoreCache) +} + +// Allocation represents a CPU set plus alignment metadata +type Allocation struct { + CPUs cpuset.CPUSet + Aligned Alignment +} + +func (ca Allocation) String() string { + return ca.CPUs.String() + " " + ca.Aligned.String() +} + +// EmptyAllocation returns a new zero-valued CPU allocation. Please note that +// a empty cpuset is aligned according to every possible way we can consider +func EmptyAllocation() Allocation { + return Allocation{ + CPUs: cpuset.New(), + Aligned: Alignment{ + UncoreCache: true, + }, + } +} + +func isAlignedAtUncoreCache(topo *CPUTopology, cpuList ...int) bool { + if len(cpuList) <= 1 { + return true + } + reference, ok := topo.CPUDetails[cpuList[0]] + if !ok { + return false + } + for _, cpu := range cpuList[1:] { + info, ok := topo.CPUDetails[cpu] + if !ok { + return false + } + if info.UncoreCacheID != reference.UncoreCacheID { + return false + } + } + return true +} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/topology/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/topology/doc.go index 76ff22991..8a22c5db7 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/topology/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/topology/doc.go @@ -15,4 +15,4 @@ limitations under the License. */ // Package topology contains helpers for the CPU manager. -package topology // import "k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/topology" +package topology diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/topology/topology.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/topology/topology.go index 18b382336..36291e6f5 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/topology/topology.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/topology/topology.go @@ -101,6 +101,15 @@ func (topo *CPUTopology) CPUNUMANodeID(cpu int) (int, error) { return info.NUMANodeID, nil } +// CheckAlignment returns alignment information for the given cpuset in +// the context of the current CPU topology +func (topo *CPUTopology) CheckAlignment(cpus cpuset.CPUSet) Alignment { + cpuList := cpus.UnsortedList() + return Alignment{ + UncoreCache: isAlignedAtUncoreCache(topo, cpuList...), + } +} + // CPUInfo contains the NUMA, socket, UncoreCache and core IDs associated with a CPU. type CPUInfo struct { NUMANodeID int diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/manager.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/manager.go index b6a810462..9ed9c1322 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/manager.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/manager.go @@ -202,15 +202,12 @@ func (m *ManagerImpl) CleanupPluginDirectory(dir string) error { if filePath == m.checkpointFile() { continue } - // TODO: Until the bug - https://github.com/golang/go/issues/33357 is fixed, os.stat wouldn't return the - // right mode(socket) on windows. Hence deleting the file, without checking whether - // its a socket, on windows. - stat, err := os.Lstat(filePath) + stat, err := os.Stat(filePath) if err != nil { klog.ErrorS(err, "Failed to stat file", "path", filePath) continue } - if stat.IsDir() { + if stat.IsDir() || stat.Mode()&os.ModeSocket == 0 { continue } err = os.RemoveAll(filePath) @@ -351,7 +348,7 @@ func (m *ManagerImpl) Start(activePods ActivePodsFunc, sourcesReady config.Sourc // Loads in allocatedDevices information from disk. err := m.readCheckpoint() if err != nil { - klog.InfoS("Continue after failing to read checkpoint file. Device allocation info may NOT be up-to-date", "err", err) + klog.ErrorS(err, "Continue after failing to read checkpoint file. Device allocation info may NOT be up-to-date") } return m.server.Start() @@ -453,7 +450,7 @@ func (m *ManagerImpl) GetCapacity() (v1.ResourceList, v1.ResourceList, []string) // should always be consistent. Otherwise, we run with the risk // of failing to garbage collect non-existing resources or devices. if !ok { - klog.ErrorS(nil, "Unexpected: healthyDevices and endpoints are out of sync") + klog.InfoS("Unexpected: healthyDevices and endpoints are out of sync") } delete(m.endpoints, resourceName) delete(m.healthyDevices, resourceName) @@ -468,7 +465,7 @@ func (m *ManagerImpl) GetCapacity() (v1.ResourceList, v1.ResourceList, []string) eI, ok := m.endpoints[resourceName] if (ok && eI.e.stopGracePeriodExpired()) || !ok { if !ok { - klog.ErrorS(nil, "Unexpected: unhealthyDevices and endpoints are out of sync") + klog.InfoS("Unexpected: unhealthyDevices and endpoints became out of sync") } delete(m.endpoints, resourceName) delete(m.unhealthyDevices, resourceName) @@ -484,7 +481,7 @@ func (m *ManagerImpl) GetCapacity() (v1.ResourceList, v1.ResourceList, []string) m.mutex.Unlock() if needsUpdateCheckpoint { if err := m.writeCheckpoint(); err != nil { - klog.ErrorS(err, "Error on writing checkpoint") + klog.ErrorS(err, "Failed to write checkpoint file") } } return capacity, allocatable, deletedResources.UnsortedList() @@ -503,9 +500,10 @@ func (m *ManagerImpl) writeCheckpoint() error { err := m.checkpointManager.CreateCheckpoint(kubeletDeviceManagerCheckpoint, data) if err != nil { err2 := fmt.Errorf("failed to write checkpoint file %q: %v", kubeletDeviceManagerCheckpoint, err) - klog.InfoS("Failed to write checkpoint file", "err", err) + klog.ErrorS(err, "Failed to write checkpoint file") return err2 } + klog.V(4).InfoS("Checkpoint file written", "checkpoint", kubeletDeviceManagerCheckpoint) return nil } @@ -516,7 +514,7 @@ func (m *ManagerImpl) readCheckpoint() error { if err != nil { if err == errors.ErrCheckpointNotFound { // no point in trying anything else - klog.InfoS("Failed to read data from checkpoint", "checkpoint", kubeletDeviceManagerCheckpoint, "err", err) + klog.ErrorS(err, "Failed to read data from checkpoint", "checkpoint", kubeletDeviceManagerCheckpoint) return nil } return err @@ -534,6 +532,8 @@ func (m *ManagerImpl) readCheckpoint() error { m.unhealthyDevices[resource] = sets.New[string]() m.endpoints[resource] = endpointInfo{e: newStoppedEndpointImpl(resource), opts: nil} } + + klog.V(4).InfoS("Read data from checkpoint file", "checkpoint", kubeletDeviceManagerCheckpoint) return nil } @@ -596,7 +596,7 @@ func (m *ManagerImpl) devicesToAllocate(podUID, contName, resource string, requi // running, then it can only be a kubelet restart. On node reboot the runtime and the containers were also shut down. Then, if the container was running, it can only be // because it already has access to all the required devices, so we got nothing to do and we can bail out. if !m.sourcesReady.AllReady() && m.isContainerAlreadyRunning(podUID, contName) { - klog.V(3).InfoS("container detected running, nothing to do", "deviceNumber", needed, "resourceName", resource, "podUID", podUID, "containerName", contName) + klog.V(3).InfoS("Container detected running, nothing to do", "deviceNumber", needed, "resourceName", resource, "podUID", podUID, "containerName", contName) return nil, nil } @@ -627,7 +627,7 @@ func (m *ManagerImpl) devicesToAllocate(podUID, contName, resource string, requi // We handled the known error paths in scenario 3 (node reboot), so from now on we can fall back in a common path. // We cover container restart on kubelet steady state with the same flow. if needed == 0 { - klog.V(3).InfoS("no devices needed, nothing to do", "deviceNumber", needed, "resourceName", resource, "podUID", podUID, "containerName", contName) + klog.V(3).InfoS("No devices needed, nothing to do", "deviceNumber", needed, "resourceName", resource, "podUID", podUID, "containerName", contName) // No change, no work. return nil, nil } @@ -836,7 +836,7 @@ func (m *ManagerImpl) allocateContainerResources(pod *v1.Pod, container *v1.Cont for k, v := range container.Resources.Limits { resource := string(k) needed := int(v.Value()) - klog.V(3).InfoS("Looking for needed resources", "needed", needed, "resourceName", resource) + klog.V(3).InfoS("Looking for needed resources", "resourceName", resource, "pod", klog.KObj(pod), "containerName", container.Name, "needed", needed) if !m.isDevicePluginResource(resource) { continue } @@ -882,7 +882,7 @@ func (m *ManagerImpl) allocateContainerResources(pod *v1.Pod, container *v1.Cont devs := allocDevices.UnsortedList() // TODO: refactor this part of code to just append a ContainerAllocationRequest // in a passed in AllocateRequest pointer, and issues a single Allocate call per pod. - klog.V(3).InfoS("Making allocation request for device plugin", "devices", devs, "resourceName", resource) + klog.V(4).InfoS("Making allocation request for device plugin", "devices", devs, "resourceName", resource, "pod", klog.KObj(pod), "containerName", container.Name) resp, err := eI.e.allocate(devs) metrics.DevicePluginAllocationDuration.WithLabelValues(resource).Observe(metrics.SinceInSeconds(startRPCTime)) if err != nil { @@ -952,7 +952,7 @@ func (m *ManagerImpl) GetDeviceRunContainerOptions(pod *v1.Pod, container *v1.Co } if !m.checkPodActive(pod) { - klog.ErrorS(nil, "pod deleted from activePods, skip to reAllocate", "podUID", podUID) + klog.V(5).InfoS("Pod deleted from activePods, skip to reAllocate", "pod", klog.KObj(pod), "podUID", podUID, "containerName", container.Name) continue } @@ -984,7 +984,7 @@ func (m *ManagerImpl) callPreStartContainerIfNeeded(podUID, contName, resource s if eI.opts == nil || !eI.opts.PreStartRequired { m.mutex.Unlock() - klog.V(4).InfoS("Plugin options indicate to skip PreStartContainer for resource", "resourceName", resource) + klog.V(5).InfoS("Plugin options indicate to skip PreStartContainer for resource", "podUID", podUID, "resourceName", resource, "containerName", contName) return nil } @@ -1014,12 +1014,12 @@ func (m *ManagerImpl) callGetPreferredAllocationIfAvailable(podUID, contName, re } if eI.opts == nil || !eI.opts.GetPreferredAllocationAvailable { - klog.V(4).InfoS("Plugin options indicate to skip GetPreferredAllocation for resource", "resourceName", resource) + klog.V(5).InfoS("Plugin options indicate to skip GetPreferredAllocation for resource", "resourceName", resource, "podUID", podUID, "containerName", contName) return nil, nil } m.mutex.Unlock() - klog.V(4).InfoS("Issuing a GetPreferredAllocation call for container", "containerName", contName, "podUID", podUID) + klog.V(4).InfoS("Issuing a GetPreferredAllocation call for container", "resourceName", resource, "containerName", contName, "podUID", podUID) resp, err := eI.e.getPreferredAllocation(available.UnsortedList(), mustInclude.UnsortedList(), size) m.mutex.Lock() if err != nil { @@ -1167,7 +1167,7 @@ func (m *ManagerImpl) ShouldResetExtendedResourceCapacity() bool { func (m *ManagerImpl) isContainerAlreadyRunning(podUID, cntName string) bool { cntID, err := m.containerMap.GetContainerID(podUID, cntName) if err != nil { - klog.V(4).InfoS("container not found in the initial map, assumed NOT running", "podUID", podUID, "containerName", cntName, "err", err) + klog.ErrorS(err, "Container not found in the initial map, assumed NOT running", "podUID", podUID, "containerName", cntName) return false } @@ -1175,11 +1175,11 @@ func (m *ManagerImpl) isContainerAlreadyRunning(podUID, cntName string) bool { // so on kubelet restart containers will again fail admission, hitting https://github.com/kubernetes/kubernetes/issues/118559 again. // This scenario should however be rare enough. if !m.containerRunningSet.Has(cntID) { - klog.V(4).InfoS("container not present in the initial running set", "podUID", podUID, "containerName", cntName, "containerID", cntID) + klog.V(4).InfoS("Container not present in the initial running set", "podUID", podUID, "containerName", cntName, "containerID", cntID) return false } // Once we make it here we know we have a running container. - klog.V(4).InfoS("container found in the initial set, assumed running", "podUID", podUID, "containerName", cntName, "containerID", cntID) + klog.V(4).InfoS("Container found in the initial set, assumed running", "podUID", podUID, "containerName", cntName, "containerID", cntID) return true } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/plugin/v1beta1/client.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/plugin/v1beta1/client.go index bf66875a4..98359ab32 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/plugin/v1beta1/client.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/plugin/v1beta1/client.go @@ -106,6 +106,8 @@ func (c *client) Disconnect() error { } c.mutex.Unlock() c.handler.PluginDisconnected(c.resource) + + klog.V(2).InfoS("Device plugin disconnected", "resource", c.resource) return nil } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/plugin/v1beta1/handler.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/plugin/v1beta1/handler.go index 9c3af0f90..204afd3d1 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/plugin/v1beta1/handler.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/plugin/v1beta1/handler.go @@ -43,8 +43,8 @@ func (s *server) RegisterPlugin(pluginName string, endpoint string, versions []s return s.connectClient(pluginName, endpoint) } -func (s *server) DeRegisterPlugin(pluginName string) { - klog.V(2).InfoS("Deregistering plugin", "plugin", pluginName) +func (s *server) DeRegisterPlugin(pluginName, endpoint string) { + klog.V(2).InfoS("Deregistering plugin", "plugin", pluginName, "endpoint", endpoint) client := s.getClient(pluginName) if client != nil { s.disconnectClient(pluginName, client) @@ -62,6 +62,7 @@ func (s *server) ValidatePlugin(pluginName string, endpoint string, versions []s return fmt.Errorf("invalid name of device plugin socket: %s", fmt.Sprintf(errInvalidResourceName, pluginName)) } + klog.V(2).InfoS("Device plugin validated", "plugin", pluginName, "endpoint", endpoint, "versions", versions) return nil } @@ -75,6 +76,7 @@ func (s *server) connectClient(name string, socketPath string) error { return err } + klog.V(2).InfoS("Connected to new client", "resource", name) go func() { s.runClient(name, c) }() @@ -86,7 +88,6 @@ func (s *server) disconnectClient(name string, c Client) error { s.deregisterClient(name) return c.Disconnect() } - func (s *server) registerClient(name string, c Client) { s.mutex.Lock() defer s.mutex.Unlock() @@ -112,7 +113,7 @@ func (s *server) runClient(name string, c Client) { } if err := s.disconnectClient(name, c); err != nil { - klog.V(2).InfoS("Unable to disconnect client", "resource", name, "client", c, "err", err) + klog.ErrorS(err, "Unable to disconnect client", "resource", name, "client", c) } } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/plugin/v1beta1/server.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/plugin/v1beta1/server.go index 312aa930a..fd3731581 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/plugin/v1beta1/server.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/plugin/v1beta1/server.go @@ -91,7 +91,7 @@ func (s *server) Start() error { if selinux.GetEnabled() { if err := selinux.SetFileLabel(s.socketDir, config.KubeletPluginsDirSELinuxLabel); err != nil { - klog.InfoS("Unprivileged containerized plugins might not work. Could not set selinux context on socket dir", "path", s.socketDir, "err", err) + klog.ErrorS(err, "Unprivileged containerized plugins might not work. Could not set selinux context on socket dir", "path", s.socketDir) } } @@ -128,7 +128,7 @@ func (s *server) Start() error { func (s *server) Stop() error { s.visitClients(func(r string, c Client) { if err := s.disconnectClient(r, c); err != nil { - klog.InfoS("Error disconnecting device plugin client", "resourceName", r, "err", err) + klog.ErrorS(err, "Failed to disconnect device plugin client", "resourceName", r) } }) @@ -145,6 +145,7 @@ func (s *server) Stop() error { // During kubelet termination, we do not need the registration server, // and we consider the kubelet to be healthy even when it is down. s.setHealthy() + klog.V(2).InfoS("Stopping device plugin registration server") return nil } @@ -159,18 +160,18 @@ func (s *server) Register(ctx context.Context, r *api.RegisterRequest) (*api.Emp if !s.isVersionCompatibleWithPlugin(r.Version) { err := fmt.Errorf(errUnsupportedVersion, r.Version, api.SupportedVersions) - klog.InfoS("Bad registration request from device plugin with resource", "resourceName", r.ResourceName, "err", err) + klog.ErrorS(err, "Bad registration request from device plugin with resource", "resourceName", r.ResourceName) return &api.Empty{}, err } if !v1helper.IsExtendedResourceName(core.ResourceName(r.ResourceName)) { err := fmt.Errorf(errInvalidResourceName, r.ResourceName) - klog.InfoS("Bad registration request from device plugin", "err", err) + klog.ErrorS(err, "Bad registration request from device plugin") return &api.Empty{}, err } if err := s.connectClient(r.ResourceName, filepath.Join(s.socketDir, r.Endpoint)); err != nil { - klog.InfoS("Error connecting to device plugin client", "err", err) + klog.ErrorS(err, "Error connecting to device plugin client") return &api.Empty{}, err } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/pod_devices.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/pod_devices.go index 13dcae0fc..806ab3c61 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/pod_devices.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/pod_devices.go @@ -17,6 +17,7 @@ limitations under the License. package devicemanager import ( + "maps" "sync" "k8s.io/klog/v2" @@ -429,10 +430,7 @@ func NewResourceDeviceInstances() ResourceDeviceInstances { func (rdev ResourceDeviceInstances) Clone() ResourceDeviceInstances { clone := NewResourceDeviceInstances() for resourceName, resourceDevs := range rdev { - clone[resourceName] = make(map[string]pluginapi.Device) - for devID, dev := range resourceDevs { - clone[resourceName][devID] = dev - } + clone[resourceName] = maps.Clone(resourceDevs) } return clone } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/topology_hints.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/topology_hints.go index 7b5c9f4c9..f4d7fa73a 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/topology_hints.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/topology_hints.go @@ -43,7 +43,7 @@ func (m *ManagerImpl) GetTopologyHints(pod *v1.Pod, container *v1.Container) map for resource, requested := range accumulatedResourceRequests { // Only consider devices that actually contain topology information. if aligned := m.deviceHasTopologyAlignment(resource); !aligned { - klog.InfoS("Resource does not have a topology preference", "resource", resource) + klog.InfoS("Resource does not have a topology preference", "resourceName", resource, "pod", klog.KObj(pod), "containerName", container.Name, "request", requested) deviceHints[resource] = nil continue } @@ -54,11 +54,11 @@ func (m *ManagerImpl) GetTopologyHints(pod *v1.Pod, container *v1.Container) map allocated := m.podDevices.containerDevices(string(pod.UID), container.Name, resource) if allocated.Len() > 0 { if allocated.Len() != requested { - klog.ErrorS(nil, "Resource already allocated to pod with different number than request", "resource", resource, "pod", klog.KObj(pod), "containerName", container.Name, "request", requested, "allocated", allocated.Len()) + klog.InfoS("Resource already allocated to pod with different number than request", "resourceName", resource, "pod", klog.KObj(pod), "containerName", container.Name, "request", requested, "allocated", allocated.Len()) deviceHints[resource] = []topologymanager.TopologyHint{} continue } - klog.InfoS("Regenerating TopologyHints for resource already allocated to pod", "resource", resource, "pod", klog.KObj(pod), "containerName", container.Name) + klog.InfoS("Regenerating TopologyHints for resource already allocated to pod", "resourceName", resource, "pod", klog.KObj(pod), "containerName", container.Name) deviceHints[resource] = m.generateDeviceTopologyHints(resource, allocated, sets.Set[string]{}, requested) continue } @@ -67,7 +67,7 @@ func (m *ManagerImpl) GetTopologyHints(pod *v1.Pod, container *v1.Container) map available := m.getAvailableDevices(resource) reusable := m.devicesToReuse[string(pod.UID)][resource] if available.Union(reusable).Len() < requested { - klog.ErrorS(nil, "Unable to generate topology hints: requested number of devices unavailable", "resource", resource, "request", requested, "available", available.Union(reusable).Len()) + klog.InfoS("Unable to generate topology hints: requested number of devices unavailable", "resourceName", resource, "pod", klog.KObj(pod), "containerName", container.Name, "request", requested, "available", available.Union(reusable).Len()) deviceHints[resource] = []topologymanager.TopologyHint{} continue } @@ -94,7 +94,7 @@ func (m *ManagerImpl) GetPodTopologyHints(pod *v1.Pod) map[string][]topologymana for resource, requested := range accumulatedResourceRequests { // Only consider devices that actually contain topology information. if aligned := m.deviceHasTopologyAlignment(resource); !aligned { - klog.InfoS("Resource does not have a topology preference", "resource", resource) + klog.InfoS("Resource does not have a topology preference", "resourceName", resource, "pod", klog.KObj(pod), "request", requested) deviceHints[resource] = nil continue } @@ -105,11 +105,11 @@ func (m *ManagerImpl) GetPodTopologyHints(pod *v1.Pod) map[string][]topologymana allocated := m.podDevices.podDevices(string(pod.UID), resource) if allocated.Len() > 0 { if allocated.Len() != requested { - klog.ErrorS(nil, "Resource already allocated to pod with different number than request", "resource", resource, "pod", klog.KObj(pod), "request", requested, "allocated", allocated.Len()) + klog.InfoS("Resource already allocated to pod with different number than request", "resourceName", resource, "pod", klog.KObj(pod), "request", requested, "allocated", allocated.Len()) deviceHints[resource] = []topologymanager.TopologyHint{} continue } - klog.InfoS("Regenerating TopologyHints for resource already allocated to pod", "resource", resource, "pod", klog.KObj(pod)) + klog.InfoS("Regenerating TopologyHints for resource already allocated to pod", "resourceName", resource, "pod", klog.KObj(pod), "allocated", allocated.Len()) deviceHints[resource] = m.generateDeviceTopologyHints(resource, allocated, sets.Set[string]{}, requested) continue } @@ -117,7 +117,7 @@ func (m *ManagerImpl) GetPodTopologyHints(pod *v1.Pod) map[string][]topologymana // Get the list of available devices, for which TopologyHints should be generated. available := m.getAvailableDevices(resource) if available.Len() < requested { - klog.ErrorS(nil, "Unable to generate topology hints: requested number of devices unavailable", "resource", resource, "request", requested, "available", available.Len()) + klog.InfoS("Unable to generate topology hints: requested number of devices unavailable", "resourceName", resource, "pod", klog.KObj(pod), "request", requested, "available", available.Len()) deviceHints[resource] = []topologymanager.TopologyHint{} continue } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/doc.go index 422aca075..4f007f7ce 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/doc.go @@ -18,4 +18,4 @@ limitations under the License. // to manage containers. For example, they contain functions to configure containers' cgroups, // ensure containers run with the desired QoS, and allocate compute resources like cpus, memory, // devices... -package cm // import "k8s.io/kubernetes/pkg/kubelet/cm" +package cm diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/dra/manager.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/dra/manager.go index 8e965c6b6..26043a0fd 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/dra/manager.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/dra/manager.go @@ -98,7 +98,20 @@ func NewManagerImpl(kubeClient clientset.Interface, stateFileDirectory string, n } func (m *ManagerImpl) GetWatcherHandler() cache.PluginHandler { - return cache.PluginHandler(dra.NewRegistrationHandler(m.kubeClient, m.getNode)) + // The time that DRA drivers have to come back after being unregistered + // before the kubelet removes their ResourceSlices. + // + // This must be long enough to actually allow stopping a pod and + // starting the replacement (otherwise ResourceSlices get deleted + // unnecessarily) and not too long (otherwise the time window were + // pods might still get scheduled to the node after removal of a + // driver is too long). + // + // 30 seconds might be long enough for a simple container restart. + // If a DRA driver wants to be sure that slices don't get wiped, + // it should use rolling updates. + wipingDelay := 30 * time.Second + return cache.PluginHandler(dra.NewRegistrationHandler(m.kubeClient, m.getNode, wipingDelay)) } // Start starts the reconcile loop of the manager. diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/dra/plugin/plugins_store.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/dra/plugin/plugins_store.go index d2f36c178..cc2fc240b 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/dra/plugin/plugins_store.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/dra/plugin/plugins_store.go @@ -18,13 +18,16 @@ package plugin import ( "errors" + "fmt" + "slices" "sync" ) // PluginsStore holds a list of DRA Plugins. type pluginsStore struct { sync.RWMutex - store map[string]*Plugin + // plugin name -> Plugin in the order in which they got added + store map[string][]*Plugin } // draPlugins map keeps track of all registered DRA plugins on the node @@ -37,43 +40,57 @@ func (s *pluginsStore) get(pluginName string) *Plugin { s.RLock() defer s.RUnlock() - return s.store[pluginName] + instances := s.store[pluginName] + if len(instances) == 0 { + return nil + } + // Heuristic: pick the most recent one. It's most likely + // the newest, except when kubelet got restarted and registered + // all running plugins in random order. + return instances[len(instances)-1] } // Set lets you save a DRA Plugin to the list and give it a specific name. // This method is protected by a mutex. -func (s *pluginsStore) add(p *Plugin) (replacedPlugin *Plugin, replaced bool) { +func (s *pluginsStore) add(p *Plugin) error { s.Lock() defer s.Unlock() if s.store == nil { - s.store = make(map[string]*Plugin) + s.store = make(map[string][]*Plugin) } - - replacedPlugin, exists := s.store[p.name] - s.store[p.name] = p - - if replacedPlugin != nil && replacedPlugin.cancel != nil { - replacedPlugin.cancel(errors.New("plugin got replaced")) + for _, oldP := range s.store[p.name] { + if oldP.endpoint == p.endpoint { + // One plugin instance cannot hijack the endpoint of another instance. + return fmt.Errorf("endpoint %s already registered for plugin %s", p.endpoint, p.name) + } } - - return replacedPlugin, exists + s.store[p.name] = append(s.store[p.name], p) + return nil } -// Delete lets you delete a DRA Plugin by name. -// This method is protected by a mutex. -func (s *pluginsStore) delete(pluginName string) *Plugin { +// remove lets you remove one endpoint for a DRA Plugin. +// This method is protected by a mutex. It returns the +// plugin if found and true if that was the last instance +func (s *pluginsStore) remove(pluginName, endpoint string) (*Plugin, bool) { s.Lock() defer s.Unlock() - p, exists := s.store[pluginName] - if !exists { - return nil + instances := s.store[pluginName] + i := slices.IndexFunc(instances, func(p *Plugin) bool { return p.endpoint == endpoint }) + if i == -1 { + return nil, false } + p := instances[i] + last := len(instances) == 1 + if last { + delete(s.store, pluginName) + } else { + s.store[pluginName] = slices.Delete(instances, i, i+1) + } + if p.cancel != nil { p.cancel(errors.New("plugin got removed")) } - delete(s.store, pluginName) - - return p + return p, last } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/dra/plugin/registration.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/dra/plugin/registration.go index 23ddbb73a..0f410c429 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/dra/plugin/registration.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/dra/plugin/registration.go @@ -21,6 +21,7 @@ import ( "errors" "fmt" "slices" + "sync" "time" v1 "k8s.io/api/core/v1" @@ -51,8 +52,22 @@ type RegistrationHandler struct { // This is necessary because it implements APIs which don't // provide a context. backgroundCtx context.Context + cancel func(err error) kubeClient kubernetes.Interface getNode func() (*v1.Node, error) + wipingDelay time.Duration + + wg sync.WaitGroup + mutex sync.Mutex + + // pendingWipes maps a plugin name to a cancel function for + // wiping of that plugin's ResourceSlices. Entries get added + // in DeRegisterPlugin and check in RegisterPlugin. If + // wiping is pending during RegisterPlugin, it gets canceled. + // + // Must use pointers to functions because the entries have to + // be comparable. + pendingWipes map[string]*context.CancelCauseFunc } var _ cache.PluginHandler = &RegistrationHandler{} @@ -62,12 +77,20 @@ var _ cache.PluginHandler = &RegistrationHandler{} // Must only be called once per process because it manages global state. // If a kubeClient is provided, then it synchronizes ResourceSlices // with the resource information provided by plugins. -func NewRegistrationHandler(kubeClient kubernetes.Interface, getNode func() (*v1.Node, error)) *RegistrationHandler { +func NewRegistrationHandler(kubeClient kubernetes.Interface, getNode func() (*v1.Node, error), wipingDelay time.Duration) *RegistrationHandler { + // The context and thus logger should come from the caller. + return newRegistrationHandler(context.TODO(), kubeClient, getNode, wipingDelay) +} + +func newRegistrationHandler(ctx context.Context, kubeClient kubernetes.Interface, getNode func() (*v1.Node, error), wipingDelay time.Duration) *RegistrationHandler { + ctx, cancel := context.WithCancelCause(ctx) handler := &RegistrationHandler{ - // The context and thus logger should come from the caller. - backgroundCtx: klog.NewContext(context.TODO(), klog.LoggerWithName(klog.TODO(), "DRA registration handler")), + backgroundCtx: klog.NewContext(ctx, klog.LoggerWithName(klog.FromContext(ctx), "DRA registration handler")), + cancel: cancel, kubeClient: kubeClient, getNode: getNode, + wipingDelay: wipingDelay, + pendingWipes: make(map[string]*context.CancelCauseFunc), } // When kubelet starts up, no DRA driver has registered yet. None of @@ -77,19 +100,45 @@ func NewRegistrationHandler(kubeClient kubernetes.Interface, getNode func() (*v1 // to start up. // // This has to run in the background. - go handler.wipeResourceSlices("") + handler.wg.Add(1) + go func() { + defer handler.wg.Done() + + logger := klog.LoggerWithName(klog.FromContext(handler.backgroundCtx), "startup") + ctx := klog.NewContext(handler.backgroundCtx, logger) + handler.wipeResourceSlices(ctx, 0 /* no delay */, "" /* all drivers */) + }() return handler } +// Stop cancels any remaining background activities and blocks until all goroutines have stopped. +func (h *RegistrationHandler) Stop() { + h.cancel(errors.New("Stop was called")) + h.wg.Wait() +} + // wipeResourceSlices deletes ResourceSlices of the node, optionally just for a specific driver. -func (h *RegistrationHandler) wipeResourceSlices(driver string) { +// Wiping will delay for a while and can be canceled by canceling the context. +func (h *RegistrationHandler) wipeResourceSlices(ctx context.Context, delay time.Duration, driver string) { if h.kubeClient == nil { return } - ctx := h.backgroundCtx logger := klog.FromContext(ctx) + if delay != 0 { + // Before we start deleting, give the driver time to bounce back. + // Perhaps it got removed as part of a DaemonSet update and the + // replacement pod is about to start. + logger.V(4).Info("Starting to wait before wiping ResourceSlices", "delay", delay) + select { + case <-ctx.Done(): + logger.V(4).Info("Aborting wiping of ResourceSlices", "reason", context.Cause(ctx)) + case <-time.After(delay): + logger.V(4).Info("Starting to wipe ResourceSlices after waiting", "delay", delay) + } + } + backoff := wait.Backoff{ Duration: time.Second, Factor: 2, @@ -148,10 +197,10 @@ func (h *RegistrationHandler) RegisterPlugin(pluginName string, endpoint string, // into all log output related to the plugin. ctx := h.backgroundCtx logger := klog.FromContext(ctx) - logger = klog.LoggerWithValues(logger, "pluginName", pluginName) + logger = klog.LoggerWithValues(logger, "pluginName", pluginName, "endpoint", endpoint) ctx = klog.NewContext(ctx, logger) - logger.V(3).Info("Register new DRA plugin", "endpoint", endpoint) + logger.V(3).Info("Register new DRA plugin") chosenService, err := h.validateSupportedServices(pluginName, supportedServices) if err != nil { @@ -179,9 +228,19 @@ func (h *RegistrationHandler) RegisterPlugin(pluginName string, endpoint string, // Storing endpoint of newly registered DRA Plugin into the map, where plugin name will be the key // all other DRA components will be able to get the actual socket of DRA plugins by its name. + if err := draPlugins.add(pluginInstance); err != nil { + cancel(err) + // No wrapping, the error already contains details. + return err + } - if oldPlugin, replaced := draPlugins.add(pluginInstance); replaced { - logger.V(1).Info("DRA plugin already registered, the old plugin was replaced and will be forgotten by the kubelet till the next kubelet restart", "oldEndpoint", oldPlugin.endpoint) + // Now cancel any pending ResourceSlice wiping for this plugin. + // Only needs to be done once. + h.mutex.Lock() + defer h.mutex.Unlock() + if cancel := h.pendingWipes[pluginName]; cancel != nil { + (*cancel)(errors.New("new plugin instance registered")) + delete(h.pendingWipes, pluginName) } return nil @@ -220,16 +279,53 @@ func (h *RegistrationHandler) validateSupportedServices(pluginName string, suppo // DeRegisterPlugin is called when a plugin has removed its socket, // signaling it is no longer available. -func (h *RegistrationHandler) DeRegisterPlugin(pluginName string) { - if p := draPlugins.delete(pluginName); p != nil { +func (h *RegistrationHandler) DeRegisterPlugin(pluginName, endpoint string) { + if p, last := draPlugins.remove(pluginName, endpoint); p != nil { + // This logger includes endpoint and pluginName. logger := klog.FromContext(p.backgroundCtx) - logger.V(3).Info("Deregister DRA plugin", "endpoint", p.endpoint) + logger.V(3).Info("Deregister DRA plugin", "lastInstance", last) + if !last { + return + } + + // Prepare for canceling the background wiping. This needs to run + // in the context of the registration handler, the one from + // the plugin is canceled. + logger = klog.FromContext(h.backgroundCtx) + logger = klog.LoggerWithName(logger, "driver-cleanup") + logger = klog.LoggerWithValues(logger, "pluginName", pluginName) + ctx, cancel := context.WithCancelCause(h.backgroundCtx) + ctx = klog.NewContext(ctx, logger) // Clean up the ResourceSlices for the deleted Plugin since it // may have died without doing so itself and might never come // back. - go h.wipeResourceSlices(pluginName) + // + // May get canceled if the plugin comes back quickly enough + // (see RegisterPlugin). + h.mutex.Lock() + defer h.mutex.Unlock() + if cancel := h.pendingWipes[pluginName]; cancel != nil { + (*cancel)(errors.New("plugin deregistered a second time")) + } + h.pendingWipes[pluginName] = &cancel + h.wg.Add(1) + go func() { + defer h.wg.Done() + defer func() { + h.mutex.Lock() + defer h.mutex.Unlock() + + // Cancel our own context, but remove it from the map only if it + // is the current entry. Perhaps it already got replaced. + cancel(errors.New("wiping done")) + if h.pendingWipes[pluginName] == &cancel { + delete(h.pendingWipes, pluginName) + } + }() + h.wipeResourceSlices(ctx, h.wipingDelay, pluginName) + }() return } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/fake_container_manager.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/fake_container_manager.go index 63f974c10..dee9ccc22 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/fake_container_manager.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/fake_container_manager.go @@ -268,3 +268,11 @@ func (cm *FakeContainerManager) UpdateAllocatedResourcesStatus(pod *v1.Pod, stat func (cm *FakeContainerManager) Updates() <-chan resourceupdates.Update { return nil } + +func (cm *FakeContainerManager) PodHasExclusiveCPUs(pod *v1.Pod) bool { + return false +} + +func (cm *FakeContainerManager) ContainerHasExclusiveCPUs(pod *v1.Pod, container *v1.Container) bool { + return false +} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/helpers_linux.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/helpers_linux.go index 6e1ee829d..8e2ffd7d2 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/helpers_linux.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/helpers_linux.go @@ -23,7 +23,7 @@ import ( "path/filepath" "strconv" - libcontainercgroups "github.com/opencontainers/runc/libcontainer/cgroups" + libcontainercgroups "github.com/opencontainers/cgroups" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" utilfeature "k8s.io/apiserver/pkg/util/feature" diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/memory_manager.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/memory_manager.go index d09a21ad1..448539fc0 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/memory_manager.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/memory_manager.go @@ -205,6 +205,7 @@ func (m *manager) Start(activePods ActivePodsFunc, sourcesReady config.SourcesRe m.allocatableMemory = m.policy.GetAllocatableMemory(m.state) + klog.V(4).InfoS("memorymanager started", "policy", m.policy.Name()) return nil } @@ -248,7 +249,7 @@ func (m *manager) GetMemoryNUMANodes(pod *v1.Pod, container *v1.Container) sets. } if numaNodes.Len() == 0 { - klog.V(5).InfoS("No allocation is available", "pod", klog.KObj(pod), "containerName", container.Name) + klog.V(5).InfoS("NUMA nodes not available for allocation", "pod", klog.KObj(pod), "containerName", container.Name) return nil } @@ -266,7 +267,7 @@ func (m *manager) Allocate(pod *v1.Pod, container *v1.Container) error { // Call down into the policy to assign this container memory if required. if err := m.policy.Allocate(m.state, pod, container); err != nil { - klog.ErrorS(err, "Allocate error") + klog.ErrorS(err, "Allocate error", "pod", klog.KObj(pod), "containerName", container.Name) return err } return nil @@ -280,7 +281,7 @@ func (m *manager) RemoveContainer(containerID string) error { // if error appears it means container entry already does not exist under the container map podUID, containerName, err := m.containerMap.GetContainerRef(containerID) if err != nil { - klog.InfoS("Failed to get container from container map", "containerID", containerID, "err", err) + klog.ErrorS(err, "Failed to get container from container map", "containerID", containerID) return nil } @@ -344,7 +345,7 @@ func (m *manager) removeStaleState() { for podUID := range assignments { for containerName := range assignments[podUID] { if _, ok := activeContainers[podUID][containerName]; !ok { - klog.InfoS("RemoveStaleState removing state", "podUID", podUID, "containerName", containerName) + klog.V(2).InfoS("RemoveStaleState removing state", "podUID", podUID, "containerName", containerName) m.policyRemoveContainerByRef(podUID, containerName) } } @@ -352,7 +353,7 @@ func (m *manager) removeStaleState() { m.containerMap.Visit(func(podUID, containerName, containerID string) { if _, ok := activeContainers[podUID][containerName]; !ok { - klog.InfoS("RemoveStaleState removing state", "podUID", podUID, "containerName", containerName) + klog.V(2).InfoS("RemoveStaleState removing state", "podUID", podUID, "containerName", containerName) m.policyRemoveContainerByRef(podUID, containerName) } }) diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/policy_static.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/policy_static.go index 115e74afa..eabbab236 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/policy_static.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/policy_static.go @@ -96,7 +96,9 @@ func (p *staticPolicy) Start(s state.State) error { // Allocate call is idempotent func (p *staticPolicy) Allocate(s state.State, pod *v1.Pod, container *v1.Container) (rerr error) { // allocate the memory only for guaranteed pods - if v1qos.GetPodQOS(pod) != v1.PodQOSGuaranteed { + qos := v1qos.GetPodQOS(pod) + if qos != v1.PodQOSGuaranteed { + klog.V(5).InfoS("Exclusive memory allocation skipped, pod QoS is not guaranteed", "pod", klog.KObj(pod), "containerName", container.Name, "qos", qos) return nil } @@ -196,6 +198,7 @@ func (p *staticPolicy) Allocate(s state.State, pod *v1.Pod, container *v1.Contai // TODO: we should refactor our state structs to reflect the amount of the re-used memory p.updateInitContainersMemoryBlocks(s, pod, container, containerBlocks) + klog.V(4).InfoS("Allocated exclusive memory", "pod", klog.KObj(pod), "containerName", container.Name) return nil } @@ -304,24 +307,24 @@ func regenerateHints(pod *v1.Pod, ctn *v1.Container, ctnBlocks []state.Block, re } if len(ctnBlocks) != len(reqRsrc) { - klog.ErrorS(nil, "The number of requested resources by the container differs from the number of memory blocks", "containerName", ctn.Name) + klog.InfoS("The number of requested resources by the container differs from the number of memory blocks", "pod", klog.KObj(pod), "containerName", ctn.Name) return nil } for _, b := range ctnBlocks { if _, ok := reqRsrc[b.Type]; !ok { - klog.ErrorS(nil, "Container requested resources do not have resource of this type", "containerName", ctn.Name, "type", b.Type) + klog.InfoS("Container requested resources but none available of this type", "pod", klog.KObj(pod), "containerName", ctn.Name, "type", b.Type) return nil } if b.Size != reqRsrc[b.Type] { - klog.ErrorS(nil, "Memory already allocated with different numbers than requested", "podUID", pod.UID, "type", b.Type, "containerName", ctn.Name, "requestedResource", reqRsrc[b.Type], "allocatedSize", b.Size) + klog.InfoS("Memory already allocated with different numbers than requested", "pod", klog.KObj(pod), "containerName", ctn.Name, "type", b.Type, "requestedResource", reqRsrc[b.Type], "allocatedSize", b.Size) return nil } containerNUMAAffinity, err := bitmask.NewBitMask(b.NUMAAffinity...) if err != nil { - klog.ErrorS(err, "Failed to generate NUMA bitmask") + klog.ErrorS(err, "Failed to generate NUMA bitmask", "pod", klog.KObj(pod), "containerName", ctn.Name, "type", b.Type) return nil } @@ -447,7 +450,13 @@ func getRequestedResources(pod *v1.Pod, container *v1.Container) (map[v1.Resourc // We should return this value because this is what kubelet agreed to allocate for the container // and the value configured with runtime. if utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling) { - if cs, ok := podutil.GetContainerStatus(pod.Status.ContainerStatuses, container.Name); ok { + containerStatuses := pod.Status.ContainerStatuses + if podutil.IsRestartableInitContainer(container) { + if len(pod.Status.InitContainerStatuses) != 0 { + containerStatuses = append(containerStatuses, pod.Status.InitContainerStatuses...) + } + } + if cs, ok := podutil.GetContainerStatus(containerStatuses, container.Name); ok { resources = cs.AllocatedResources } } @@ -654,36 +663,36 @@ func (p *staticPolicy) validateState(s state.State) error { func areMachineStatesEqual(ms1, ms2 state.NUMANodeMap) bool { if len(ms1) != len(ms2) { - klog.ErrorS(nil, "Node states are different", "lengthNode1", len(ms1), "lengthNode2", len(ms2)) + klog.InfoS("Node states were different", "lengthNode1", len(ms1), "lengthNode2", len(ms2)) return false } for nodeID, nodeState1 := range ms1 { nodeState2, ok := ms2[nodeID] if !ok { - klog.ErrorS(nil, "Node state does not have node ID", "nodeID", nodeID) + klog.InfoS("Node state didn't have node ID", "nodeID", nodeID) return false } if nodeState1.NumberOfAssignments != nodeState2.NumberOfAssignments { - klog.ErrorS(nil, "Node states number of assignments are different", "assignment1", nodeState1.NumberOfAssignments, "assignment2", nodeState2.NumberOfAssignments) + klog.InfoS("Node state had a different number of memory assignments.", "assignment1", nodeState1.NumberOfAssignments, "assignment2", nodeState2.NumberOfAssignments) return false } if !areGroupsEqual(nodeState1.Cells, nodeState2.Cells) { - klog.ErrorS(nil, "Node states groups are different", "stateNode1", nodeState1.Cells, "stateNode2", nodeState2.Cells) + klog.InfoS("Node states had different groups", "stateNode1", nodeState1.Cells, "stateNode2", nodeState2.Cells) return false } if len(nodeState1.MemoryMap) != len(nodeState2.MemoryMap) { - klog.ErrorS(nil, "Node states memory map have different lengths", "lengthNode1", len(nodeState1.MemoryMap), "lengthNode2", len(nodeState2.MemoryMap)) + klog.InfoS("Node state had memory maps of different lengths", "lengthNode1", len(nodeState1.MemoryMap), "lengthNode2", len(nodeState2.MemoryMap)) return false } for resourceName, memoryState1 := range nodeState1.MemoryMap { memoryState2, ok := nodeState2.MemoryMap[resourceName] if !ok { - klog.ErrorS(nil, "Memory state does not have resource", "resource", resourceName) + klog.InfoS("Memory state didn't have resource", "resource", resourceName) return false } @@ -701,11 +710,11 @@ func areMachineStatesEqual(ms1, ms2 state.NUMANodeMap) bool { } if tmpState1.Free != tmpState2.Free { - klog.InfoS("Memory states for the NUMA node and resource are different", "node", nodeID, "resource", resourceName, "field", "free", "free1", tmpState1.Free, "free2", tmpState2.Free, "memoryState1", *memoryState1, "memoryState2", *memoryState2) + klog.InfoS("NUMA node and resource had different memory states", "node", nodeID, "resource", resourceName, "field", "free", "free1", tmpState1.Free, "free2", tmpState2.Free, "memoryState1", *memoryState1, "memoryState2", *memoryState2) return false } if tmpState1.Reserved != tmpState2.Reserved { - klog.InfoS("Memory states for the NUMA node and resource are different", "node", nodeID, "resource", resourceName, "field", "reserved", "reserved1", tmpState1.Reserved, "reserved2", tmpState2.Reserved, "memoryState1", *memoryState1, "memoryState2", *memoryState2) + klog.InfoS("NUMA node and resource had different memory states", "node", nodeID, "resource", resourceName, "field", "reserved", "reserved1", tmpState1.Reserved, "reserved2", tmpState2.Reserved, "memoryState1", *memoryState1, "memoryState2", *memoryState2) return false } } @@ -715,17 +724,17 @@ func areMachineStatesEqual(ms1, ms2 state.NUMANodeMap) bool { func areMemoryStatesEqual(memoryState1, memoryState2 *state.MemoryTable, nodeID int, resourceName v1.ResourceName) bool { if memoryState1.TotalMemSize != memoryState2.TotalMemSize { - klog.ErrorS(nil, "Memory states for the NUMA node and resource are different", "node", nodeID, "resource", resourceName, "field", "TotalMemSize", "TotalMemSize1", memoryState1.TotalMemSize, "TotalMemSize2", memoryState2.TotalMemSize, "memoryState1", *memoryState1, "memoryState2", *memoryState2) + klog.InfoS("Memory states for the NUMA node and resource are different", "node", nodeID, "resource", resourceName, "field", "TotalMemSize", "TotalMemSize1", memoryState1.TotalMemSize, "TotalMemSize2", memoryState2.TotalMemSize, "memoryState1", *memoryState1, "memoryState2", *memoryState2) return false } if memoryState1.SystemReserved != memoryState2.SystemReserved { - klog.ErrorS(nil, "Memory states for the NUMA node and resource are different", "node", nodeID, "resource", resourceName, "field", "SystemReserved", "SystemReserved1", memoryState1.SystemReserved, "SystemReserved2", memoryState2.SystemReserved, "memoryState1", *memoryState1, "memoryState2", *memoryState2) + klog.InfoS("Memory states for the NUMA node and resource are different", "node", nodeID, "resource", resourceName, "field", "SystemReserved", "SystemReserved1", memoryState1.SystemReserved, "SystemReserved2", memoryState2.SystemReserved, "memoryState1", *memoryState1, "memoryState2", *memoryState2) return false } if memoryState1.Allocatable != memoryState2.Allocatable { - klog.ErrorS(nil, "Memory states for the NUMA node and resource are different", "node", nodeID, "resource", resourceName, "field", "Allocatable", "Allocatable1", memoryState1.Allocatable, "Allocatable2", memoryState2.Allocatable, "memoryState1", *memoryState1, "memoryState2", *memoryState2) + klog.InfoS("Memory states for the NUMA node and resource are different", "node", nodeID, "resource", resourceName, "field", "Allocatable", "Allocatable1", memoryState1.Allocatable, "Allocatable2", memoryState2.Allocatable, "memoryState1", *memoryState1, "memoryState2", *memoryState2) return false } return true diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/state/state_checkpoint.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/state/state_checkpoint.go index 05e32b751..dce0bda55 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/state/state_checkpoint.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/state/state_checkpoint.go @@ -131,7 +131,7 @@ func (sc *stateCheckpoint) SetMachineState(memoryMap NUMANodeMap) { sc.cache.SetMachineState(memoryMap) err := sc.storeState() if err != nil { - klog.InfoS("Store state to checkpoint error", "err", err) + klog.ErrorS(err, "Failed to store state to checkpoint") } } @@ -143,7 +143,7 @@ func (sc *stateCheckpoint) SetMemoryBlocks(podUID string, containerName string, sc.cache.SetMemoryBlocks(podUID, containerName, blocks) err := sc.storeState() if err != nil { - klog.InfoS("Store state to checkpoint error", "err", err) + klog.ErrorS(err, "Failed to store state to checkpoint", "podUID", podUID, "containerName", containerName) } } @@ -155,7 +155,7 @@ func (sc *stateCheckpoint) SetMemoryAssignments(assignments ContainerMemoryAssig sc.cache.SetMemoryAssignments(assignments) err := sc.storeState() if err != nil { - klog.InfoS("Store state to checkpoint error", "err", err) + klog.ErrorS(err, "Failed to store state to checkpoint") } } @@ -167,7 +167,7 @@ func (sc *stateCheckpoint) Delete(podUID string, containerName string) { sc.cache.Delete(podUID, containerName) err := sc.storeState() if err != nil { - klog.InfoS("Store state to checkpoint error", "err", err) + klog.ErrorS(err, "Failed to store state to checkpoint", "podUID", podUID, "containerName", containerName) } } @@ -179,6 +179,6 @@ func (sc *stateCheckpoint) ClearState() { sc.cache.ClearState() err := sc.storeState() if err != nil { - klog.InfoS("Store state to checkpoint error", "err", err) + klog.ErrorS(err, "Failed to store state to checkpoint") } } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/state/state_mem.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/state/state_mem.go index 7e4da7ab6..19861c6e3 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/state/state_mem.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/memorymanager/state/state_mem.go @@ -94,6 +94,7 @@ func (s *stateMemory) SetMemoryAssignments(assignments ContainerMemoryAssignment defer s.Unlock() s.assignments = assignments.Clone() + klog.V(5).InfoS("Updated Memory assignments", "assignments", assignments) } // Delete deletes corresponding Blocks from ContainerMemoryAssignments diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/pod_container_manager_linux.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/pod_container_manager_linux.go index c67f0cd48..3159e0ed7 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/pod_container_manager_linux.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/pod_container_manager_linux.go @@ -23,7 +23,7 @@ import ( "path" "strings" - libcontainercgroups "github.com/opencontainers/runc/libcontainer/cgroups" + libcontainercgroups "github.com/opencontainers/cgroups" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" utilerrors "k8s.io/apimachinery/pkg/util/errors" @@ -55,6 +55,8 @@ type podContainerManagerImpl struct { // cpuCFSQuotaPeriod is the cfs period value, cfs_period_us, setting per // node for all containers in usec cpuCFSQuotaPeriod uint64 + // podContainerManager is the ContainerManager running on the machine + podContainerManager ContainerManager } // Make sure that podContainerManagerImpl implements the PodContainerManager interface @@ -73,6 +75,11 @@ func (m *podContainerManagerImpl) EnsureExists(pod *v1.Pod) error { // check if container already exist alreadyExists := m.Exists(pod) if !alreadyExists { + enforceCPULimits := m.enforceCPULimits + if utilfeature.DefaultFeatureGate.Enabled(kubefeatures.DisableCPUQuotaWithExclusiveCPUs) && m.podContainerManager.PodHasExclusiveCPUs(pod) { + klog.V(2).InfoS("Disabled CFS quota", "pod", klog.KObj(pod)) + enforceCPULimits = false + } enforceMemoryQoS := false if utilfeature.DefaultFeatureGate.Enabled(kubefeatures.MemoryQoS) && libcontainercgroups.IsCgroup2UnifiedMode() { @@ -82,7 +89,7 @@ func (m *podContainerManagerImpl) EnsureExists(pod *v1.Pod) error { podContainerName, _ := m.GetPodContainerName(pod) containerConfig := &CgroupConfig{ Name: podContainerName, - ResourceParameters: ResourceConfigForPod(pod, m.enforceCPULimits, m.cpuCFSQuotaPeriod, enforceMemoryQoS), + ResourceParameters: ResourceConfigForPod(pod, enforceCPULimits, m.cpuCFSQuotaPeriod, enforceMemoryQoS), } if m.podPidsLimit > 0 { containerConfig.ResourceParameters.PidsLimit = &m.podPidsLimit diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/qos_container_manager_linux.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/qos_container_manager_linux.go index 0f88e10ff..aac639c1e 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/qos_container_manager_linux.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/qos_container_manager_linux.go @@ -29,7 +29,7 @@ import ( "k8s.io/apimachinery/pkg/util/wait" units "github.com/docker/go-units" - libcontainercgroups "github.com/opencontainers/runc/libcontainer/cgroups" + libcontainercgroups "github.com/opencontainers/cgroups" utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/component-helpers/resource" diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/fake_topology_manager.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/fake_topology_manager.go index 921b47dab..19b07a719 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/fake_topology_manager.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/fake_topology_manager.go @@ -45,7 +45,7 @@ func NewFakeManagerWithHint(hint *TopologyHint) Manager { // NewFakeManagerWithPolicy returns an instance of fake topology manager with specified policy func NewFakeManagerWithPolicy(policy Policy) Manager { - klog.InfoS("NewFakeManagerWithPolicy") + klog.InfoS("NewFakeManagerWithPolicy", "policy", policy.Name()) return &fakeManager{ policy: policy, } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/policy_options.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/policy_options.go index 43eb9d886..5490aba11 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/policy_options.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/policy_options.go @@ -47,11 +47,11 @@ func CheckPolicyOptionAvailable(option string) error { } if alphaOptions.Has(option) && !utilfeature.DefaultFeatureGate.Enabled(kubefeatures.TopologyManagerPolicyAlphaOptions) { - return fmt.Errorf("Topology Manager Policy Alpha-level Options not enabled, but option %q provided", option) + return fmt.Errorf("topology manager policy alpha-level options not enabled, but option %q provided", option) } if betaOptions.Has(option) && !utilfeature.DefaultFeatureGate.Enabled(kubefeatures.TopologyManagerPolicyBetaOptions) { - return fmt.Errorf("Topology Manager Policy Beta-level Options not enabled, but option %q provided", option) + return fmt.Errorf("topology manager policy beta-level options not enabled, but option %q provided", option) } return nil diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_container.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_container.go index 61cef19df..7c06c090c 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_container.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_container.go @@ -50,6 +50,9 @@ func (s *containerScope) Admit(pod *v1.Pod) lifecycle.PodAdmitResult { klog.InfoS("Best TopologyHint", "bestHint", bestHint, "pod", klog.KObj(pod), "containerName", container.Name) if !admit { + if IsAlignmentGuaranteed(s.policy) { + metrics.ContainerAlignedComputeResourcesFailure.WithLabelValues(metrics.AlignScopeContainer, metrics.AlignedNUMANode).Inc() + } metrics.TopologyManagerAdmissionErrorsTotal.Inc() return admission.GetPodAdmitResult(&TopologyAffinityError{}) } @@ -63,6 +66,7 @@ func (s *containerScope) Admit(pod *v1.Pod) lifecycle.PodAdmitResult { } if IsAlignmentGuaranteed(s.policy) { + klog.V(4).InfoS("Resource alignment at container scope guaranteed", "pod", klog.KObj(pod)) metrics.ContainerAlignedComputeResources.WithLabelValues(metrics.AlignScopeContainer, metrics.AlignedNUMANode).Inc() } } @@ -84,6 +88,6 @@ func (s *containerScope) accumulateProvidersHints(pod *v1.Pod, container *v1.Con func (s *containerScope) calculateAffinity(pod *v1.Pod, container *v1.Container) (TopologyHint, bool) { providersHints := s.accumulateProvidersHints(pod, container) bestHint, admit := s.policy.Merge(providersHints) - klog.InfoS("ContainerTopologyHint", "bestHint", bestHint) + klog.InfoS("ContainerTopologyHint", "bestHint", bestHint, "pod", klog.KObj(pod), "containerName", container.Name) return bestHint, admit } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_pod.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_pod.go index 61d599ebc..bcb421d61 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_pod.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_pod.go @@ -48,6 +48,10 @@ func (s *podScope) Admit(pod *v1.Pod) lifecycle.PodAdmitResult { bestHint, admit := s.calculateAffinity(pod) klog.InfoS("Best TopologyHint", "bestHint", bestHint, "pod", klog.KObj(pod)) if !admit { + if IsAlignmentGuaranteed(s.policy) { + // increment only if we know we allocate aligned resources. + metrics.ContainerAlignedComputeResourcesFailure.WithLabelValues(metrics.AlignScopePod, metrics.AlignedNUMANode).Inc() + } metrics.TopologyManagerAdmissionErrorsTotal.Inc() return admission.GetPodAdmitResult(&TopologyAffinityError{}) } @@ -64,6 +68,7 @@ func (s *podScope) Admit(pod *v1.Pod) lifecycle.PodAdmitResult { } if IsAlignmentGuaranteed(s.policy) { // increment only if we know we allocate aligned resources. + klog.V(4).InfoS("Resource alignment at pod scope guaranteed", "pod", klog.KObj(pod)) metrics.ContainerAlignedComputeResources.WithLabelValues(metrics.AlignScopePod, metrics.AlignedNUMANode).Inc() } return admission.GetPodAdmitResult(nil) @@ -84,6 +89,6 @@ func (s *podScope) accumulateProvidersHints(pod *v1.Pod) []map[string][]Topology func (s *podScope) calculateAffinity(pod *v1.Pod) (TopologyHint, bool) { providersHints := s.accumulateProvidersHints(pod) bestHint, admit := s.policy.Merge(providersHints) - klog.InfoS("PodTopologyHint", "bestHint", bestHint) + klog.InfoS("PodTopologyHint", "bestHint", bestHint, "pod", klog.KObj(pod)) return bestHint, admit } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/topology_manager.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/topology_manager.go index 7c5e9d3d8..ccaba099f 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/topology_manager.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/topology_manager.go @@ -188,9 +188,19 @@ func NewManager(topology []cadvisorapi.Node, topologyPolicyName string, topology scope: scope, } + manager.initializeMetrics() + return manager, nil } +func (m *manager) initializeMetrics() { + // ensure the values exist + metrics.ContainerAlignedComputeResources.WithLabelValues(metrics.AlignScopeContainer, metrics.AlignedNUMANode).Add(0) + metrics.ContainerAlignedComputeResources.WithLabelValues(metrics.AlignScopePod, metrics.AlignedNUMANode).Add(0) + metrics.ContainerAlignedComputeResourcesFailure.WithLabelValues(metrics.AlignScopeContainer, metrics.AlignedNUMANode).Add(0) + metrics.ContainerAlignedComputeResourcesFailure.WithLabelValues(metrics.AlignScopePod, metrics.AlignedNUMANode).Add(0) +} + func (m *manager) GetAffinity(podUID string, containerName string) TopologyHint { return m.scope.GetAffinity(podUID, containerName) } @@ -212,11 +222,13 @@ func (m *manager) RemoveContainer(containerID string) error { } func (m *manager) Admit(attrs *lifecycle.PodAdmitAttributes) lifecycle.PodAdmitResult { + klog.V(4).InfoS("Topology manager admission check", "pod", klog.KObj(attrs.Pod)) metrics.TopologyManagerAdmissionRequestsTotal.Inc() startTime := time.Now() podAdmitResult := m.scope.Admit(attrs.Pod) metrics.TopologyManagerAdmissionDuration.Observe(float64(time.Since(startTime).Milliseconds())) + klog.V(4).InfoS("Pod Admit Result", "Message", podAdmitResult.Message, "pod", klog.KObj(attrs.Pod)) return podAdmitResult } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/util/cgroups_linux.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/util/cgroups_linux.go index 94f4b9e6c..c63c0b410 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/util/cgroups_linux.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/cm/util/cgroups_linux.go @@ -21,7 +21,7 @@ import ( libcontainerutils "k8s.io/kubernetes/third_party/forked/libcontainer/utils" - libcontainercgroups "github.com/opencontainers/runc/libcontainer/cgroups" + libcontainercgroups "github.com/opencontainers/cgroups" ) const ( diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/config/config.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/config/config.go index 34fde1a10..10a42c823 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/config/config.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/config/config.go @@ -456,6 +456,7 @@ func checkAndUpdatePod(existing, ref *v1.Pod) (needUpdate, needReconcile, needGr existing.Labels = ref.Labels existing.DeletionTimestamp = ref.DeletionTimestamp existing.DeletionGracePeriodSeconds = ref.DeletionGracePeriodSeconds + existing.Generation = ref.Generation existing.Status = ref.Status updateAnnotations(existing, ref) diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/config/defaults.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/config/defaults.go index effee19e6..b8788f9e4 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/config/defaults.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/config/defaults.go @@ -30,4 +30,5 @@ const ( KubeletPluginsDirSELinuxLabel = "system_u:object_r:container_file_t:s0" KubeletContainersSharedSELinuxLabel = "system_u:object_r:container_file_t:s0" DefaultKubeletCheckpointsDirName = "checkpoints" + DefaultKubeletUserNamespacesIDsPerPod = 65536 ) diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/config/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/config/doc.go index a72262ff0..1d839ba32 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/config/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/config/doc.go @@ -15,4 +15,4 @@ limitations under the License. */ // Package config implements the pod configuration readers. -package config // import "k8s.io/kubernetes/pkg/kubelet/config" +package config diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/container/helpers.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/container/helpers.go index fb43305fa..9e6780310 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/container/helpers.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/container/helpers.go @@ -396,6 +396,8 @@ func MakePortMappings(container *v1.Container) (ports []PortMapping) { // HasAnyRegularContainerStarted returns true if any regular container has // started, which indicates all init containers have been initialized. +// Deprecated: This function is not accurate when its pod sandbox is recreated. +// Use HasAnyActiveRegularContainerStarted instead. func HasAnyRegularContainerStarted(spec *v1.PodSpec, statuses []v1.ContainerStatus) bool { if len(statuses) == 0 { return false @@ -417,3 +419,26 @@ func HasAnyRegularContainerStarted(spec *v1.PodSpec, statuses []v1.ContainerStat return false } + +// HasAnyActiveRegularContainerStarted returns true if any regular container of +// the current pod sandbox has started, which indicates all init containers +// have been initialized. +func HasAnyActiveRegularContainerStarted(spec *v1.PodSpec, podStatus *PodStatus) bool { + if podStatus == nil { + return false + } + + containerNames := sets.New[string]() + for _, c := range spec.Containers { + containerNames.Insert(c.Name) + } + + for _, status := range podStatus.ActiveContainerStatuses { + if !containerNames.Has(status.Name) { + continue + } + return true + } + + return false +} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/container/runtime.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/container/runtime.go index 3b14039f4..02f81725f 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/container/runtime.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/container/runtime.go @@ -33,6 +33,8 @@ import ( "k8s.io/client-go/util/flowcontrol" runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1" "k8s.io/klog/v2" + "k8s.io/kubernetes/pkg/credentialprovider" + kubelettypes "k8s.io/kubernetes/pkg/kubelet/types" "k8s.io/kubernetes/pkg/volume" ) @@ -137,6 +139,9 @@ type Runtime interface { ListPodSandboxMetrics(ctx context.Context) ([]*runtimeapi.PodSandboxMetrics, error) // GetContainerStatus returns the status for the container. GetContainerStatus(ctx context.Context, id ContainerID) (*Status, error) + // GetContainerSwapBehavior reports whether a container could be swappable. + // This is used to decide whether to handle InPlacePodVerticalScaling for containers. + GetContainerSwapBehavior(pod *v1.Pod, container *v1.Container) kubelettypes.SwapBehavior } // StreamingRuntime is the interface implemented by runtimes that handle the serving of the @@ -151,8 +156,11 @@ type StreamingRuntime interface { // ImageService interfaces allows to work with image service. type ImageService interface { // PullImage pulls an image from the network to local storage using the supplied - // secrets if necessary. It returns a reference (digest or ID) to the pulled image. - PullImage(ctx context.Context, image ImageSpec, pullSecrets []v1.Secret, podSandboxConfig *runtimeapi.PodSandboxConfig) (string, error) + // secrets if necessary. + // It returns a reference (digest or ID) to the pulled image and the credentials + // that were used to pull the image. If the returned credentials are nil, the + // pull was anonymous. + PullImage(ctx context.Context, image ImageSpec, credentials []credentialprovider.TrackedAuthConfig, podSandboxConfig *runtimeapi.PodSandboxConfig) (string, *credentialprovider.TrackedAuthConfig, error) // GetImageRef gets the reference (digest or ID) of the image which has already been in // the local storage. It returns ("", nil) if the image isn't in the local storage. GetImageRef(ctx context.Context, image ImageSpec) (string, error) @@ -317,6 +325,8 @@ type PodStatus struct { IPs []string // Status of containers in the pod. ContainerStatuses []*Status + // Statuses of containers of the active sandbox in the pod. + ActiveContainerStatuses []*Status // Status of the pod sandbox. // Only for kuberuntime now, other runtime may keep it nil. SandboxStatuses []*runtimeapi.PodSandboxStatus @@ -378,6 +388,8 @@ type Status struct { User *ContainerUser // Mounts are the volume mounts of the container Mounts []Mount + // StopSignal is used to show the container's effective stop signal in the Status + StopSignal *v1.Signal } // ContainerUser represents user identity information @@ -472,6 +484,9 @@ type Mount struct { Propagation runtimeapi.MountPropagation // Image is set if an OCI volume as image ID or digest should get mounted (special case). Image *runtimeapi.ImageSpec + // ImageSubPath is set if an image volume sub path should get mounted. This + // field is only required if the above Image is set. + ImageSubPath string } // ImageVolumes is a map of image specs by volume name. diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/container/sync_result.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/container/sync_result.go index 39ab04a3c..b04456e53 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/container/sync_result.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/container/sync_result.go @@ -45,6 +45,8 @@ var ( ErrConfigPodSandbox = errors.New("ConfigPodSandboxError") // ErrKillPodSandbox returned when runtime failed to stop pod's sandbox. ErrKillPodSandbox = errors.New("KillPodSandboxError") + // ErrResizePodInPlace returned when runtime failed to resize a pod. + ErrResizePodInPlace = errors.New("ResizePodInPlaceError") ) // SyncAction indicates different kind of actions in SyncPod() and KillPod(). Now there are only actions @@ -68,6 +70,8 @@ const ( ConfigPodSandbox SyncAction = "ConfigPodSandbox" // KillPodSandbox action KillPodSandbox SyncAction = "KillPodSandbox" + // ResizePodInPlace action is included whenever any containers in the pod are resized without restart + ResizePodInPlace SyncAction = "ResizePodInPlace" ) // SyncResult is the result of sync action. diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/events/event.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/events/event.go index 0eaa82fc7..526a67cdb 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/events/event.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/events/event.go @@ -61,6 +61,7 @@ const ( VolumeResizeFailed = "VolumeResizeFailed" VolumeResizeSuccess = "VolumeResizeSuccessful" FileSystemResizeFailed = "FileSystemResizeFailed" + VolumePermissionChangeInProgress = "VolumePermissionChangeInProgress" FileSystemResizeSuccess = "FileSystemResizeSuccessful" FailedMapVolume = "FailedMapVolume" WarnAlreadyMountedVolume = "AlreadyMountedVolume" diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/lifecycle/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/lifecycle/doc.go index eab81169a..0c1dd9a1c 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/lifecycle/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/lifecycle/doc.go @@ -16,4 +16,4 @@ limitations under the License. // Package lifecycle contains handlers for pod lifecycle events and interfaces // to integrate with kubelet admission, synchronization, and eviction of pods. -package lifecycle // import "k8s.io/kubernetes/pkg/kubelet/lifecycle" +package lifecycle diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/lifecycle/predicate.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/lifecycle/predicate.go index dea1ca9a4..a505faca6 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/lifecycle/predicate.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/lifecycle/predicate.go @@ -22,15 +22,16 @@ import ( v1 "k8s.io/api/core/v1" utilfeature "k8s.io/apiserver/pkg/util/feature" + "k8s.io/component-base/featuregate" "k8s.io/component-helpers/scheduling/corev1" "k8s.io/klog/v2" - podutil "k8s.io/kubernetes/pkg/api/v1/pod" v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/kubelet/types" "k8s.io/kubernetes/pkg/scheduler" schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration" + "k8s.io/utils/ptr" ) const ( @@ -52,6 +53,11 @@ const ( // than Always for some of its init containers. InitContainerRestartPolicyForbidden = "InitContainerRestartPolicyForbidden" + // SupplementalGroupsPolicyNotSupported is used to denote that the pod was + // rejected admission to the node because the node does not support + // the pod's SupplementalGroupsPolicy. + SupplementalGroupsPolicyNotSupported = "SupplementalGroupsPolicyNotSupported" + // UnexpectedAdmissionError is used to denote that the pod was rejected // admission to the node because of an error during admission that could not // be categorized. @@ -135,25 +141,20 @@ func (w *predicateAdmitHandler) Admit(attrs *PodAdmitAttributes) PodAdmitResult } } + if rejectPodAdmissionBasedOnSupplementalGroupsPolicy(admitPod, node) { + message := fmt.Sprintf("SupplementalGroupsPolicy=%s is not supported in this node", v1.SupplementalGroupsPolicyStrict) + klog.InfoS("Failed to admit pod", "pod", klog.KObj(admitPod), "message", message) + return PodAdmitResult{ + Admit: false, + Reason: SupplementalGroupsPolicyNotSupported, + Message: message, + } + } + pods := attrs.OtherPods nodeInfo := schedulerframework.NewNodeInfo(pods...) nodeInfo.SetNode(node) - // TODO: Remove this after the SidecarContainers feature gate graduates to GA. - if !utilfeature.DefaultFeatureGate.Enabled(features.SidecarContainers) { - for _, c := range admitPod.Spec.InitContainers { - if podutil.IsRestartableInitContainer(&c) { - message := fmt.Sprintf("Init container %q may not have a non-default restartPolicy", c.Name) - klog.InfoS("Failed to admit pod", "pod", klog.KObj(admitPod), "message", message) - return PodAdmitResult{ - Admit: false, - Reason: InitContainerRestartPolicyForbidden, - Message: message, - } - } - } - } - // ensure the node has enough plugin resources for that required in pods if err = w.pluginResourceUpdateFunc(nodeInfo, attrs); err != nil { message := fmt.Sprintf("Update plugin resources failed due to %v, which is unexpected.", err) @@ -272,6 +273,45 @@ func rejectPodAdmissionBasedOnOSField(pod *v1.Pod) bool { return string(pod.Spec.OS.Name) != runtime.GOOS } +// rejectPodAdmissionBasedOnSupplementalGroupsPolicy rejects pod only if +// - the feature is beta or above, and SupplementalPolicy=Strict is set in the pod +// - but, the node does not support the feature +// +// Note: During the feature is alpha or before(not yet released) in emulated version, +// it should admit for backward compatibility +func rejectPodAdmissionBasedOnSupplementalGroupsPolicy(pod *v1.Pod, node *v1.Node) bool { + admit, reject := false, true // just for readability + + inUse := (pod.Spec.SecurityContext != nil && pod.Spec.SecurityContext.SupplementalGroupsPolicy != nil) + if !inUse { + return admit + } + + isBetaOrAbove := false + if featureSpec, ok := utilfeature.DefaultMutableFeatureGate.GetAll()[features.SupplementalGroupsPolicy]; ok { + isBetaOrAbove = (featureSpec.PreRelease == featuregate.Beta) || (featureSpec.PreRelease == featuregate.GA) + } + + if !isBetaOrAbove { + return admit + } + + featureSupportedOnNode := ptr.Deref( + ptr.Deref(node.Status.Features, v1.NodeFeatures{SupplementalGroupsPolicy: ptr.To(false)}).SupplementalGroupsPolicy, + false, + ) + effectivePolicy := ptr.Deref( + pod.Spec.SecurityContext.SupplementalGroupsPolicy, + v1.SupplementalGroupsPolicyMerge, + ) + + if effectivePolicy == v1.SupplementalGroupsPolicyStrict && !featureSupportedOnNode { + return reject + } + + return admit +} + func removeMissingExtendedResources(pod *v1.Pod, nodeInfo *schedulerframework.NodeInfo) *v1.Pod { filterExtendedResources := func(containers []v1.Container) { for i, c := range containers { diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/metrics/metrics.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/metrics/metrics.go index 28078e451..7a04387ab 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/metrics/metrics.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/metrics/metrics.go @@ -113,6 +113,7 @@ const ( CPUManagerPinningErrorsTotalKey = "cpu_manager_pinning_errors_total" CPUManagerSharedPoolSizeMilliCoresKey = "cpu_manager_shared_pool_size_millicores" CPUManagerExclusiveCPUsAllocationCountKey = "cpu_manager_exclusive_cpu_allocation_count" + CPUManagerAllocationPerNUMAKey = "cpu_manager_allocation_per_numa" // Metrics to track the Memory manager behavior MemoryManagerPinningRequestsTotalKey = "memory_manager_pinning_requests_total" @@ -132,6 +133,7 @@ const ( // Metric for tracking aligment of compute resources ContainerAlignedComputeResourcesNameKey = "container_aligned_compute_resources_count" + ContainerAlignedComputeResourcesFailureNameKey = "container_aligned_compute_resources_failure_count" ContainerAlignedComputeResourcesScopeLabelKey = "scope" ContainerAlignedComputeResourcesBoundaryLabelKey = "boundary" @@ -149,9 +151,15 @@ const ( AlignedPhysicalCPU = "physical_cpu" AlignedNUMANode = "numa_node" + AlignedUncoreCache = "uncore_cache" // Metrics to track kubelet admission rejections. AdmissionRejectionsTotalKey = "admission_rejections_total" + + // Image Volume metrics + ImageVolumeRequestedTotalKey = "image_volume_requested_total" + ImageVolumeMountedSucceedTotalKey = "image_volume_mounted_succeed_total" + ImageVolumeMountedErrorsTotalKey = "image_volume_mounted_errors_total" ) type imageSizeBucket struct { @@ -808,6 +816,17 @@ var ( }, ) + // CPUManagerAllocationPerNUMA tracks the count of CPUs allocated per NUMA node + CPUManagerAllocationPerNUMA = metrics.NewGaugeVec( + &metrics.GaugeOpts{ + Subsystem: KubeletSubsystem, + Name: CPUManagerAllocationPerNUMAKey, + Help: "Number of CPUs allocated per NUMA node", + StabilityLevel: metrics.ALPHA, + }, + []string{AlignedNUMANode}, + ) + // ContainerAlignedComputeResources reports the count of resources allocation which granted aligned resources, per alignment boundary ContainerAlignedComputeResources = metrics.NewCounterVec( &metrics.CounterOpts{ @@ -818,7 +837,18 @@ var ( }, []string{ContainerAlignedComputeResourcesScopeLabelKey, ContainerAlignedComputeResourcesBoundaryLabelKey}, ) - // MemoryManagerPinningRequestTotal tracks the number of times the pod spec required the memory manager to pin memory pages + + // ContainerAlignedComputeResourcesFailure reports the count of resources allocation attempts which failed to align resources, per alignment boundary + ContainerAlignedComputeResourcesFailure = metrics.NewCounterVec( + &metrics.CounterOpts{ + Subsystem: KubeletSubsystem, + Name: ContainerAlignedComputeResourcesFailureNameKey, + Help: "Cumulative number of failures to allocate aligned compute resources to containers by alignment type.", + StabilityLevel: metrics.ALPHA, + }, + []string{ContainerAlignedComputeResourcesScopeLabelKey, ContainerAlignedComputeResourcesBoundaryLabelKey}, + ) + MemoryManagerPinningRequestTotal = metrics.NewCounter( &metrics.CounterOpts{ Subsystem: KubeletSubsystem, @@ -1008,6 +1038,36 @@ var ( }, []string{"reason"}, ) + + // ImageVolumeRequestedTotal trakcs the number of requested image volumes. + ImageVolumeRequestedTotal = metrics.NewCounter( + &metrics.CounterOpts{ + Subsystem: KubeletSubsystem, + Name: ImageVolumeRequestedTotalKey, + Help: "Number of requested image volumes.", + StabilityLevel: metrics.ALPHA, + }, + ) + + // ImageVolumeMountedSucceedTotal tracks the number of successful image volume mounts. + ImageVolumeMountedSucceedTotal = metrics.NewCounter( + &metrics.CounterOpts{ + Subsystem: KubeletSubsystem, + Name: ImageVolumeMountedSucceedTotalKey, + Help: "Number of successful image volume mounts.", + StabilityLevel: metrics.ALPHA, + }, + ) + + // ImageVolumeMountedErrorsTotal tracks the number of failed image volume mounts. + ImageVolumeMountedErrorsTotal = metrics.NewCounter( + &metrics.CounterOpts{ + Subsystem: KubeletSubsystem, + Name: ImageVolumeMountedErrorsTotalKey, + Help: "Number of failed image volume mounts.", + StabilityLevel: metrics.ALPHA, + }, + ) ) var registerMetrics sync.Once @@ -1078,7 +1138,9 @@ func Register(collectors ...metrics.StableCollector) { legacyregistry.MustRegister(CPUManagerPinningErrorsTotal) legacyregistry.MustRegister(CPUManagerSharedPoolSizeMilliCores) legacyregistry.MustRegister(CPUManagerExclusiveCPUsAllocationCount) + legacyregistry.MustRegister(CPUManagerAllocationPerNUMA) legacyregistry.MustRegister(ContainerAlignedComputeResources) + legacyregistry.MustRegister(ContainerAlignedComputeResourcesFailure) legacyregistry.MustRegister(MemoryManagerPinningRequestTotal) legacyregistry.MustRegister(MemoryManagerPinningErrorsTotal) legacyregistry.MustRegister(TopologyManagerAdmissionRequestsTotal) @@ -1107,6 +1169,12 @@ func Register(collectors ...metrics.StableCollector) { } legacyregistry.MustRegister(AdmissionRejectionsTotal) + + if utilfeature.DefaultFeatureGate.Enabled(features.ImageVolume) { + legacyregistry.MustRegister(ImageVolumeRequestedTotal) + legacyregistry.MustRegister(ImageVolumeMountedSucceedTotal) + legacyregistry.MustRegister(ImageVolumeMountedErrorsTotal) + } }) } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache/actual_state_of_world.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache/actual_state_of_world.go index 50b5658af..cdaa42c0a 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache/actual_state_of_world.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache/actual_state_of_world.go @@ -89,6 +89,7 @@ type PluginInfo struct { UUID types.UID Handler PluginHandler Name string + Endpoint string } func (asw *actualStateOfWorld) AddPlugin(pluginInfo PluginInfo) error { diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache/types.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache/types.go index 0656bc906..bcffd117e 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache/types.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache/types.go @@ -56,5 +56,5 @@ type PluginHandler interface { RegisterPlugin(pluginName, endpoint string, versions []string, pluginClientTimeout *time.Duration) error // DeRegisterPlugin is called once the pluginwatcher observes that the socket has // been deleted. - DeRegisterPlugin(pluginName string) + DeRegisterPlugin(pluginName, endpoint string) } diff --git a/e2e/vendor/k8s.io/apiserver/pkg/server/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/qos/doc.go similarity index 53% rename from e2e/vendor/k8s.io/apiserver/pkg/server/doc.go rename to e2e/vendor/k8s.io/kubernetes/pkg/kubelet/qos/doc.go index b5f97c658..acd561b21 100644 --- a/e2e/vendor/k8s.io/apiserver/pkg/server/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/qos/doc.go @@ -14,5 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package server contains the plumbing to create kubernetes-like API server command. -package server +// Package qos contains helper functions for quality of service. +// For each resource (memory, CPU) Kubelet supports three classes of containers. +// Memory guaranteed containers will receive the highest priority and will get all the resources +// they need. +// Burstable containers will be guaranteed their request and can "burst" and use more resources +// when available. +// Best-Effort containers, which don't specify a request, can use resources only if not being used +// by other pods. +package qos diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/qos/helpers.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/qos/helpers.go new file mode 100644 index 000000000..33b6c166b --- /dev/null +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/qos/helpers.go @@ -0,0 +1,71 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package qos contains helper functions for quality of service. +// For each resource (memory, CPU) Kubelet supports three classes of containers. +// Memory guaranteed containers will receive the highest priority and will get all the resources +// they need. +// Burstable containers will be guaranteed their request and can "burst" and use more resources +// when available. +// Best-Effort containers, which don't specify a request, can use resources only if not being used +// by other pods. + +package qos + +import ( + v1 "k8s.io/api/core/v1" + resourcehelper "k8s.io/component-helpers/resource" +) + +// minRegularContainerMemory returns the minimum memory resource quantity +// across all regular containers in pod.Spec.Containers. +// It does not include initContainers (both restartable and non-restartable). +func minRegularContainerMemory(pod v1.Pod) int64 { + memoryValue := pod.Spec.Containers[0].Resources.Requests.Memory().Value() + for _, container := range pod.Spec.Containers[1:] { + if container.Resources.Requests.Memory().Value() < memoryValue { + memoryValue = container.Resources.Requests.Memory().Value() + } + } + return memoryValue +} + +// remainingPodMemReqPerContainer calculates the remaining pod memory request per +// container by: +// 1. Taking the total pod memory requests +// 2. Subtracting total container memory requests from pod memory requests +// 3. Dividing the remainder by the number of containers. +// This gives us the additional memory request that is not allocated to any +// containers in the pod. This value will be divided equally among all containers to +// calculate oom score adjusment. +// See https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/2837-pod-level-resource-spec/README.md#oom-score-adjustment +// for more details. +func remainingPodMemReqPerContainer(pod *v1.Pod) int64 { + var remainingMemory int64 + if pod.Spec.Resources.Requests.Memory().IsZero() { + return remainingMemory + } + + numContainers := len(pod.Spec.Containers) + len(pod.Spec.InitContainers) + + // Aggregated requests of all containers. + aggrContainerReqs := resourcehelper.AggregateContainerRequests(pod, resourcehelper.PodResourcesOptions{}) + + remainingMemory = pod.Spec.Resources.Requests.Memory().Value() - aggrContainerReqs.Memory().Value() + + remainingMemoryPerContainer := remainingMemory / int64(numContainers) + return remainingMemoryPerContainer +} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/qos/policy.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/qos/policy.go new file mode 100644 index 000000000..a70945ed2 --- /dev/null +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/qos/policy.go @@ -0,0 +1,135 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package qos + +import ( + v1 "k8s.io/api/core/v1" + utilfeature "k8s.io/apiserver/pkg/util/feature" + resourcehelper "k8s.io/component-helpers/resource" + v1qos "k8s.io/kubernetes/pkg/apis/core/v1/helper/qos" + "k8s.io/kubernetes/pkg/features" + "k8s.io/kubernetes/pkg/kubelet/types" +) + +const ( + // KubeletOOMScoreAdj is the OOM score adjustment for Kubelet + KubeletOOMScoreAdj int = -999 + // KubeProxyOOMScoreAdj is the OOM score adjustment for kube-proxy + KubeProxyOOMScoreAdj int = -999 + guaranteedOOMScoreAdj int = -997 + besteffortOOMScoreAdj int = 1000 +) + +// GetContainerOOMScoreAdjust returns the amount by which the OOM score of all processes in the +// container should be adjusted. +// The OOM score of a process is the percentage of memory it consumes +// multiplied by 10 (barring exceptional cases) + a configurable quantity which is between -1000 +// and 1000. Containers with higher OOM scores are killed if the system runs out of memory. +// See https://lwn.net/Articles/391222/ for more information. +// OOMScoreAdjust should be calculated based on the allocated resources, so the pod argument should +// contain the allocated resources in the spec. +func GetContainerOOMScoreAdjust(pod *v1.Pod, container *v1.Container, memoryCapacity int64) int { + if types.IsNodeCriticalPod(pod) { + // Only node critical pod should be the last to get killed. + return guaranteedOOMScoreAdj + } + + switch v1qos.GetPodQOS(pod) { + case v1.PodQOSGuaranteed: + // Guaranteed containers should be the last to get killed. + return guaranteedOOMScoreAdj + case v1.PodQOSBestEffort: + return besteffortOOMScoreAdj + } + + // Burstable containers are a middle tier, between Guaranteed and Best-Effort. Ideally, + // we want to protect Burstable containers that consume less memory than requested. + // The formula below is a heuristic. A container requesting for 10% of a system's + // memory will have an OOM score adjust of 900. If a process in container Y + // uses over 10% of memory, its OOM score will be 1000. The idea is that containers + // which use more than their request will have an OOM score of 1000 and will be prime + // targets for OOM kills. + // Note that this is a heuristic, it won't work if a container has many small processes. + containerMemReq := container.Resources.Requests.Memory().Value() + + var oomScoreAdjust, remainingReqPerContainer int64 + // When PodLevelResources feature is enabled, the OOM score adjustment formula is modified + // to account for pod-level memory requests. Any extra pod memory request that's + // not allocated to the containers is divided equally among all containers and + // added to their individual memory requests when calculating the OOM score + // adjustment. Otherwise, only container-level memory requests are used. See + // https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/2837-pod-level-resource-spec/README.md#oom-score-adjustment + // for more details. + if utilfeature.DefaultFeatureGate.Enabled(features.PodLevelResources) && + resourcehelper.IsPodLevelRequestsSet(pod) { + // TODO(ndixita): Refactor to use this formula in all cases, as + // remainingReqPerContainer will be 0 when pod-level resources are not set. + remainingReqPerContainer = remainingPodMemReqPerContainer(pod) + oomScoreAdjust = 1000 - (1000 * (containerMemReq + remainingReqPerContainer) / memoryCapacity) + } else { + oomScoreAdjust = 1000 - (1000*containerMemReq)/memoryCapacity + } + + // adapt the sidecarContainer memoryRequest for OOM ADJ calculation + // calculate the oom score adjustment based on: max-memory( currentSideCarContainer , min-memory(regular containers) ) . + if isSidecarContainer(pod, container) { + // check min memory quantity in regular containers + minMemoryRequest := minRegularContainerMemory(*pod) + + // When calculating minMemoryOomScoreAdjust for sidecar containers with PodLevelResources enabled, + // we add the per-container share of unallocated pod memory requests to the minimum memory request. + // This ensures the OOM score adjustment i.e. minMemoryOomScoreAdjust + // calculation remains consistent + // with how we handle pod-level memory requests for regular containers. + if utilfeature.DefaultFeatureGate.Enabled(features.PodLevelResources) && + resourcehelper.IsPodLevelRequestsSet(pod) { + minMemoryRequest += remainingReqPerContainer + } + minMemoryOomScoreAdjust := 1000 - (1000*minMemoryRequest)/memoryCapacity + // the OOM adjustment for sidecar container will match + // or fall below the OOM score adjustment of regular containers in the Pod. + if oomScoreAdjust > minMemoryOomScoreAdjust { + oomScoreAdjust = minMemoryOomScoreAdjust + } + } + + // A guaranteed pod using 100% of memory can have an OOM score of 10. Ensure + // that burstable pods have a higher OOM score adjustment. + if int(oomScoreAdjust) < (1000 + guaranteedOOMScoreAdj) { + return (1000 + guaranteedOOMScoreAdj) + } + // Give burstable pods a higher chance of survival over besteffort pods. + if int(oomScoreAdjust) == besteffortOOMScoreAdj { + return int(oomScoreAdjust - 1) + } + return int(oomScoreAdjust) +} + +// isSidecarContainer returns a boolean indicating whether a container is a sidecar or not. +// Since v1.Container does not directly specify whether a container is a sidecar, +// this function uses available indicators (container.RestartPolicy == v1.ContainerRestartPolicyAlways) +// to make that determination. +func isSidecarContainer(pod *v1.Pod, container *v1.Container) bool { + if container.RestartPolicy != nil && *container.RestartPolicy == v1.ContainerRestartPolicyAlways { + for _, initContainer := range pod.Spec.InitContainers { + if initContainer.Name == container.Name { + return true + } + } + } + return false +} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/fake_status_manager.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/fake_status_manager.go deleted file mode 100644 index 6d2031419..000000000 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/fake_status_manager.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package status - -import ( - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/klog/v2" - kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" - "k8s.io/kubernetes/pkg/kubelet/status/state" -) - -type fakeManager struct { - state state.State -} - -func (m *fakeManager) Start() { - klog.InfoS("Start()") - return -} - -func (m *fakeManager) GetPodStatus(uid types.UID) (v1.PodStatus, bool) { - klog.InfoS("GetPodStatus()") - return v1.PodStatus{}, false -} - -func (m *fakeManager) SetPodStatus(pod *v1.Pod, status v1.PodStatus) { - klog.InfoS("SetPodStatus()") - return -} - -func (m *fakeManager) SetContainerReadiness(podUID types.UID, containerID kubecontainer.ContainerID, ready bool) { - klog.InfoS("SetContainerReadiness()") - return -} - -func (m *fakeManager) SetContainerStartup(podUID types.UID, containerID kubecontainer.ContainerID, started bool) { - klog.InfoS("SetContainerStartup()") - return -} - -func (m *fakeManager) TerminatePod(pod *v1.Pod) { - klog.InfoS("TerminatePod()") - return -} - -func (m *fakeManager) RemoveOrphanedStatuses(podUIDs map[types.UID]bool) { - klog.InfoS("RemoveOrphanedStatuses()") - return -} - -func (m *fakeManager) GetContainerResourceAllocation(podUID string, containerName string) (v1.ResourceRequirements, bool) { - klog.InfoS("GetContainerResourceAllocation()") - return m.state.GetContainerResourceAllocation(podUID, containerName) -} - -func (m *fakeManager) GetPodResizeStatus(podUID types.UID) v1.PodResizeStatus { - return m.state.GetPodResizeStatus(string(podUID)) -} - -func (m *fakeManager) UpdatePodFromAllocation(pod *v1.Pod) (*v1.Pod, bool) { - allocs := m.state.GetPodResourceAllocation() - return updatePodFromAllocation(pod, allocs) -} - -func (m *fakeManager) SetPodAllocation(pod *v1.Pod) error { - klog.InfoS("SetPodAllocation()") - for _, container := range pod.Spec.Containers { - alloc := *container.Resources.DeepCopy() - m.state.SetContainerResourceAllocation(string(pod.UID), container.Name, alloc) - } - return nil -} - -func (m *fakeManager) SetPodResizeStatus(podUID types.UID, resizeStatus v1.PodResizeStatus) { - m.state.SetPodResizeStatus(string(podUID), resizeStatus) -} - -// NewFakeManager creates empty/fake memory manager -func NewFakeManager() Manager { - return &fakeManager{ - state: state.NewStateMemory(), - } -} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/generate.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/generate.go index 2c3a9b080..d519bf4c7 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/generate.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/generate.go @@ -43,19 +43,20 @@ const ( // GenerateContainersReadyCondition returns the status of "ContainersReady" condition. // The status of "ContainersReady" condition is true when all containers are ready. -func GenerateContainersReadyCondition(spec *v1.PodSpec, containerStatuses []v1.ContainerStatus, podPhase v1.PodPhase) v1.PodCondition { +func GenerateContainersReadyCondition(pod *v1.Pod, oldPodStatus *v1.PodStatus, containerStatuses []v1.ContainerStatus, podPhase v1.PodPhase) v1.PodCondition { // Find if all containers are ready or not. if containerStatuses == nil { return v1.PodCondition{ - Type: v1.ContainersReady, - Status: v1.ConditionFalse, - Reason: UnknownContainerStatuses, + Type: v1.ContainersReady, + ObservedGeneration: podutil.GetPodObservedGenerationIfEnabledOnCondition(oldPodStatus, pod.Generation, v1.ContainersReady), + Status: v1.ConditionFalse, + Reason: UnknownContainerStatuses, } } unknownContainers := []string{} unreadyContainers := []string{} - for _, container := range spec.InitContainers { + for _, container := range pod.Spec.InitContainers { if !podutil.IsRestartableInitContainer(&container) { continue } @@ -69,7 +70,7 @@ func GenerateContainersReadyCondition(spec *v1.PodSpec, containerStatuses []v1.C } } - for _, container := range spec.Containers { + for _, container := range pod.Spec.Containers { if containerStatus, ok := podutil.GetContainerStatus(containerStatuses, container.Name); ok { if !containerStatus.Ready { unreadyContainers = append(unreadyContainers, container.Name) @@ -81,12 +82,12 @@ func GenerateContainersReadyCondition(spec *v1.PodSpec, containerStatuses []v1.C // If all containers are known and succeeded, just return PodCompleted. if podPhase == v1.PodSucceeded && len(unknownContainers) == 0 { - return generateContainersReadyConditionForTerminalPhase(podPhase) + return generateContainersReadyConditionForTerminalPhase(pod, oldPodStatus, podPhase) } // If the pod phase is failed, explicitly set the ready condition to false for containers since they may be in progress of terminating. if podPhase == v1.PodFailed { - return generateContainersReadyConditionForTerminalPhase(podPhase) + return generateContainersReadyConditionForTerminalPhase(pod, oldPodStatus, podPhase) } // Generate message for containers in unknown condition. @@ -100,38 +101,41 @@ func GenerateContainersReadyCondition(spec *v1.PodSpec, containerStatuses []v1.C unreadyMessage := strings.Join(unreadyMessages, ", ") if unreadyMessage != "" { return v1.PodCondition{ - Type: v1.ContainersReady, - Status: v1.ConditionFalse, - Reason: ContainersNotReady, - Message: unreadyMessage, + Type: v1.ContainersReady, + ObservedGeneration: podutil.GetPodObservedGenerationIfEnabledOnCondition(oldPodStatus, pod.Generation, v1.ContainersReady), + Status: v1.ConditionFalse, + Reason: ContainersNotReady, + Message: unreadyMessage, } } return v1.PodCondition{ - Type: v1.ContainersReady, - Status: v1.ConditionTrue, + Type: v1.ContainersReady, + ObservedGeneration: podutil.GetPodObservedGenerationIfEnabledOnCondition(oldPodStatus, pod.Generation, v1.ContainersReady), + Status: v1.ConditionTrue, } } // GeneratePodReadyCondition returns "Ready" condition of a pod. // The status of "Ready" condition is "True", if all containers in a pod are ready // AND all matching conditions specified in the ReadinessGates have status equal to "True". -func GeneratePodReadyCondition(spec *v1.PodSpec, conditions []v1.PodCondition, containerStatuses []v1.ContainerStatus, podPhase v1.PodPhase) v1.PodCondition { - containersReady := GenerateContainersReadyCondition(spec, containerStatuses, podPhase) +func GeneratePodReadyCondition(pod *v1.Pod, oldPodStatus *v1.PodStatus, conditions []v1.PodCondition, containerStatuses []v1.ContainerStatus, podPhase v1.PodPhase) v1.PodCondition { + containersReady := GenerateContainersReadyCondition(pod, oldPodStatus, containerStatuses, podPhase) // If the status of ContainersReady is not True, return the same status, reason and message as ContainersReady. if containersReady.Status != v1.ConditionTrue { return v1.PodCondition{ - Type: v1.PodReady, - Status: containersReady.Status, - Reason: containersReady.Reason, - Message: containersReady.Message, + Type: v1.PodReady, + ObservedGeneration: podutil.GetPodObservedGenerationIfEnabledOnCondition(oldPodStatus, pod.Generation, v1.PodReady), + Status: containersReady.Status, + Reason: containersReady.Reason, + Message: containersReady.Message, } } // Evaluate corresponding conditions specified in readiness gate // Generate message if any readiness gate is not satisfied. unreadyMessages := []string{} - for _, rg := range spec.ReadinessGates { + for _, rg := range pod.Spec.ReadinessGates { _, c := podutil.GetPodConditionFromList(conditions, rg.ConditionType) if c == nil { unreadyMessages = append(unreadyMessages, fmt.Sprintf("corresponding condition of pod readiness gate %q does not exist.", string(rg.ConditionType))) @@ -144,16 +148,18 @@ func GeneratePodReadyCondition(spec *v1.PodSpec, conditions []v1.PodCondition, c if len(unreadyMessages) != 0 { unreadyMessage := strings.Join(unreadyMessages, ", ") return v1.PodCondition{ - Type: v1.PodReady, - Status: v1.ConditionFalse, - Reason: ReadinessGatesNotReady, - Message: unreadyMessage, + Type: v1.PodReady, + ObservedGeneration: podutil.GetPodObservedGenerationIfEnabledOnCondition(oldPodStatus, pod.Generation, v1.PodReady), + Status: v1.ConditionFalse, + Reason: ReadinessGatesNotReady, + Message: unreadyMessage, } } return v1.PodCondition{ - Type: v1.PodReady, - Status: v1.ConditionTrue, + Type: v1.PodReady, + ObservedGeneration: podutil.GetPodObservedGenerationIfEnabledOnCondition(oldPodStatus, pod.Generation, v1.PodReady), + Status: v1.ConditionTrue, } } @@ -172,19 +178,20 @@ func isInitContainerInitialized(initContainer *v1.Container, containerStatus *v1 // GeneratePodInitializedCondition returns initialized condition if all init containers in a pod are ready, else it // returns an uninitialized condition. -func GeneratePodInitializedCondition(spec *v1.PodSpec, containerStatuses []v1.ContainerStatus, podPhase v1.PodPhase) v1.PodCondition { +func GeneratePodInitializedCondition(pod *v1.Pod, oldPodStatus *v1.PodStatus, containerStatuses []v1.ContainerStatus, podPhase v1.PodPhase) v1.PodCondition { // Find if all containers are ready or not. - if containerStatuses == nil && len(spec.InitContainers) > 0 { + if containerStatuses == nil && len(pod.Spec.InitContainers) > 0 { return v1.PodCondition{ - Type: v1.PodInitialized, - Status: v1.ConditionFalse, - Reason: UnknownContainerStatuses, + Type: v1.PodInitialized, + ObservedGeneration: podutil.GetPodObservedGenerationIfEnabledOnCondition(oldPodStatus, pod.Generation, v1.PodInitialized), + Status: v1.ConditionFalse, + Reason: UnknownContainerStatuses, } } unknownContainers := []string{} incompleteContainers := []string{} - for _, container := range spec.InitContainers { + for _, container := range pod.Spec.InitContainers { containerStatus, ok := podutil.GetContainerStatus(containerStatuses, container.Name) if !ok { unknownContainers = append(unknownContainers, container.Name) @@ -198,9 +205,10 @@ func GeneratePodInitializedCondition(spec *v1.PodSpec, containerStatuses []v1.Co // If all init containers are known and succeeded, just return PodCompleted. if podPhase == v1.PodSucceeded && len(unknownContainers) == 0 { return v1.PodCondition{ - Type: v1.PodInitialized, - Status: v1.ConditionTrue, - Reason: PodCompleted, + Type: v1.PodInitialized, + ObservedGeneration: podutil.GetPodObservedGenerationIfEnabledOnCondition(oldPodStatus, pod.Generation, v1.PodInitialized), + Status: v1.ConditionTrue, + Reason: PodCompleted, } } @@ -208,10 +216,11 @@ func GeneratePodInitializedCondition(spec *v1.PodSpec, containerStatuses []v1.Co // been initialized before. // This is needed to handle the case where the pod has been initialized but // the restartable init containers are restarting. - if kubecontainer.HasAnyRegularContainerStarted(spec, containerStatuses) { + if kubecontainer.HasAnyRegularContainerStarted(&pod.Spec, containerStatuses) { return v1.PodCondition{ - Type: v1.PodInitialized, - Status: v1.ConditionTrue, + Type: v1.PodInitialized, + ObservedGeneration: podutil.GetPodObservedGenerationIfEnabledOnCondition(oldPodStatus, pod.Generation, v1.PodInitialized), + Status: v1.ConditionTrue, } } @@ -225,20 +234,22 @@ func GeneratePodInitializedCondition(spec *v1.PodSpec, containerStatuses []v1.Co unreadyMessage := strings.Join(unreadyMessages, ", ") if unreadyMessage != "" { return v1.PodCondition{ - Type: v1.PodInitialized, - Status: v1.ConditionFalse, - Reason: ContainersNotInitialized, - Message: unreadyMessage, + Type: v1.PodInitialized, + ObservedGeneration: podutil.GetPodObservedGenerationIfEnabledOnCondition(oldPodStatus, pod.Generation, v1.PodInitialized), + Status: v1.ConditionFalse, + Reason: ContainersNotInitialized, + Message: unreadyMessage, } } return v1.PodCondition{ - Type: v1.PodInitialized, - Status: v1.ConditionTrue, + Type: v1.PodInitialized, + ObservedGeneration: podutil.GetPodObservedGenerationIfEnabledOnCondition(oldPodStatus, pod.Generation, v1.PodInitialized), + Status: v1.ConditionTrue, } } -func GeneratePodReadyToStartContainersCondition(pod *v1.Pod, podStatus *kubecontainer.PodStatus) v1.PodCondition { +func GeneratePodReadyToStartContainersCondition(pod *v1.Pod, oldPodStatus *v1.PodStatus, podStatus *kubecontainer.PodStatus) v1.PodCondition { newSandboxNeeded, _, _ := runtimeutil.PodSandboxChanged(pod, podStatus) // if a new sandbox does not need to be created for a pod, it indicates that // a sandbox for the pod with networking configured already exists. @@ -246,20 +257,23 @@ func GeneratePodReadyToStartContainersCondition(pod *v1.Pod, podStatus *kubecont // fresh sandbox and configure networking for the sandbox. if !newSandboxNeeded { return v1.PodCondition{ - Type: v1.PodReadyToStartContainers, - Status: v1.ConditionTrue, + Type: v1.PodReadyToStartContainers, + ObservedGeneration: podutil.GetPodObservedGenerationIfEnabledOnCondition(oldPodStatus, pod.Generation, v1.PodReadyToStartContainers), + Status: v1.ConditionTrue, } } return v1.PodCondition{ - Type: v1.PodReadyToStartContainers, - Status: v1.ConditionFalse, + Type: v1.PodReadyToStartContainers, + ObservedGeneration: podutil.GetPodObservedGenerationIfEnabledOnCondition(oldPodStatus, pod.Generation, v1.PodReadyToStartContainers), + Status: v1.ConditionFalse, } } -func generateContainersReadyConditionForTerminalPhase(podPhase v1.PodPhase) v1.PodCondition { +func generateContainersReadyConditionForTerminalPhase(pod *v1.Pod, oldPodStatus *v1.PodStatus, podPhase v1.PodPhase) v1.PodCondition { condition := v1.PodCondition{ - Type: v1.ContainersReady, - Status: v1.ConditionFalse, + Type: v1.ContainersReady, + ObservedGeneration: podutil.GetPodObservedGenerationIfEnabledOnCondition(oldPodStatus, pod.Generation, v1.ContainersReady), + Status: v1.ConditionFalse, } if podPhase == v1.PodFailed { @@ -271,10 +285,11 @@ func generateContainersReadyConditionForTerminalPhase(podPhase v1.PodPhase) v1.P return condition } -func generatePodReadyConditionForTerminalPhase(podPhase v1.PodPhase) v1.PodCondition { +func generatePodReadyConditionForTerminalPhase(pod *v1.Pod, oldPodStatus *v1.PodStatus, podPhase v1.PodPhase) v1.PodCondition { condition := v1.PodCondition{ - Type: v1.PodReady, - Status: v1.ConditionFalse, + Type: v1.PodReady, + ObservedGeneration: podutil.GetPodObservedGenerationIfEnabledOnCondition(oldPodStatus, pod.Generation, v1.PodReady), + Status: v1.ConditionFalse, } if podPhase == v1.PodFailed { diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/state/checkpoint.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/state/checkpoint.go deleted file mode 100644 index 8bc85ac18..000000000 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/state/checkpoint.go +++ /dev/null @@ -1,80 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package state - -import ( - "encoding/json" - "fmt" - - v1 "k8s.io/api/core/v1" - "k8s.io/kubernetes/pkg/kubelet/checkpointmanager" - "k8s.io/kubernetes/pkg/kubelet/checkpointmanager/checksum" -) - -var _ checkpointmanager.Checkpoint = &Checkpoint{} - -type PodResourceAllocationInfo struct { - AllocationEntries map[string]map[string]v1.ResourceRequirements `json:"allocationEntries,omitempty"` -} - -// Checkpoint represents a structure to store pod resource allocation checkpoint data -type Checkpoint struct { - // Data is a serialized PodResourceAllocationInfo - Data string `json:"data"` - // Checksum is a checksum of Data - Checksum checksum.Checksum `json:"checksum"` -} - -// NewCheckpoint creates a new checkpoint from a list of claim info states -func NewCheckpoint(allocations *PodResourceAllocationInfo) (*Checkpoint, error) { - - serializedAllocations, err := json.Marshal(allocations) - if err != nil { - return nil, fmt.Errorf("failed to serialize allocations for checkpointing: %w", err) - } - - cp := &Checkpoint{ - Data: string(serializedAllocations), - } - cp.Checksum = checksum.New(cp.Data) - return cp, nil -} - -func (cp *Checkpoint) MarshalCheckpoint() ([]byte, error) { - return json.Marshal(cp) -} - -// UnmarshalCheckpoint unmarshals checkpoint from JSON -func (cp *Checkpoint) UnmarshalCheckpoint(blob []byte) error { - return json.Unmarshal(blob, cp) -} - -// VerifyChecksum verifies that current checksum -// of checkpointed Data is valid -func (cp *Checkpoint) VerifyChecksum() error { - return cp.Checksum.Verify(cp.Data) -} - -// GetPodResourceAllocationInfo returns Pod Resource Allocation info states from checkpoint -func (cp *Checkpoint) GetPodResourceAllocationInfo() (*PodResourceAllocationInfo, error) { - var data PodResourceAllocationInfo - if err := json.Unmarshal([]byte(cp.Data), &data); err != nil { - return nil, err - } - - return &data, nil -} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/state/state.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/state/state.go deleted file mode 100644 index 10a66be46..000000000 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/state/state.go +++ /dev/null @@ -1,60 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package state - -import ( - v1 "k8s.io/api/core/v1" -) - -// PodResourceAllocation type is used in tracking resources allocated to pod's containers -type PodResourceAllocation map[string]map[string]v1.ResourceRequirements - -// PodResizeStatus type is used in tracking the last resize decision for pod -type PodResizeStatus map[string]v1.PodResizeStatus - -// Clone returns a copy of PodResourceAllocation -func (pr PodResourceAllocation) Clone() PodResourceAllocation { - prCopy := make(PodResourceAllocation) - for pod := range pr { - prCopy[pod] = make(map[string]v1.ResourceRequirements) - for container, alloc := range pr[pod] { - prCopy[pod][container] = *alloc.DeepCopy() - } - } - return prCopy -} - -// Reader interface used to read current pod resource allocation state -type Reader interface { - GetContainerResourceAllocation(podUID string, containerName string) (v1.ResourceRequirements, bool) - GetPodResourceAllocation() PodResourceAllocation - GetPodResizeStatus(podUID string) v1.PodResizeStatus -} - -type writer interface { - SetContainerResourceAllocation(podUID string, containerName string, alloc v1.ResourceRequirements) error - SetPodResourceAllocation(PodResourceAllocation) error - SetPodResizeStatus(podUID string, resizeStatus v1.PodResizeStatus) - Delete(podUID string, containerName string) error - ClearState() error -} - -// State interface provides methods for tracking and setting pod resource allocation -type State interface { - Reader - writer -} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/state/state_checkpoint.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/state/state_checkpoint.go deleted file mode 100644 index 2e1ca7291..000000000 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/state/state_checkpoint.go +++ /dev/null @@ -1,200 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package state - -import ( - "fmt" - "path" - "sync" - - v1 "k8s.io/api/core/v1" - "k8s.io/klog/v2" - "k8s.io/kubernetes/pkg/kubelet/checkpointmanager" - "k8s.io/kubernetes/pkg/kubelet/checkpointmanager/errors" -) - -var _ State = &stateCheckpoint{} - -type stateCheckpoint struct { - mux sync.RWMutex - cache State - checkpointManager checkpointmanager.CheckpointManager - checkpointName string -} - -// NewStateCheckpoint creates new State for keeping track of pod resource allocations with checkpoint backend -func NewStateCheckpoint(stateDir, checkpointName string) (State, error) { - checkpointManager, err := checkpointmanager.NewCheckpointManager(stateDir) - if err != nil { - return nil, fmt.Errorf("failed to initialize checkpoint manager for pod allocation tracking: %v", err) - } - stateCheckpoint := &stateCheckpoint{ - cache: NewStateMemory(), - checkpointManager: checkpointManager, - checkpointName: checkpointName, - } - - if err := stateCheckpoint.restoreState(); err != nil { - //lint:ignore ST1005 user-facing error message - return nil, fmt.Errorf("could not restore state from checkpoint: %v, please drain this node and delete pod allocation checkpoint file %q before restarting Kubelet", err, path.Join(stateDir, checkpointName)) - } - return stateCheckpoint, nil -} - -// restores state from a checkpoint and creates it if it doesn't exist -func (sc *stateCheckpoint) restoreState() error { - sc.mux.Lock() - defer sc.mux.Unlock() - var err error - - checkpoint, err := NewCheckpoint(nil) - if err != nil { - return fmt.Errorf("failed to create new checkpoint: %w", err) - } - - if err = sc.checkpointManager.GetCheckpoint(sc.checkpointName, checkpoint); err != nil { - if err == errors.ErrCheckpointNotFound { - return sc.storeState() - } - return err - } - praInfo, err := checkpoint.GetPodResourceAllocationInfo() - if err != nil { - return fmt.Errorf("failed to get pod resource allocation info: %w", err) - } - err = sc.cache.SetPodResourceAllocation(praInfo.AllocationEntries) - if err != nil { - return fmt.Errorf("failed to set pod resource allocation: %w", err) - } - klog.V(2).InfoS("State checkpoint: restored pod resource allocation state from checkpoint") - return nil -} - -// saves state to a checkpoint, caller is responsible for locking -func (sc *stateCheckpoint) storeState() error { - podAllocation := sc.cache.GetPodResourceAllocation() - - checkpoint, err := NewCheckpoint(&PodResourceAllocationInfo{ - AllocationEntries: podAllocation, - }) - if err != nil { - return fmt.Errorf("failed to create checkpoint: %w", err) - } - err = sc.checkpointManager.CreateCheckpoint(sc.checkpointName, checkpoint) - if err != nil { - klog.ErrorS(err, "Failed to save pod allocation checkpoint") - return err - } - return nil -} - -// GetContainerResourceAllocation returns current resources allocated to a pod's container -func (sc *stateCheckpoint) GetContainerResourceAllocation(podUID string, containerName string) (v1.ResourceRequirements, bool) { - sc.mux.RLock() - defer sc.mux.RUnlock() - return sc.cache.GetContainerResourceAllocation(podUID, containerName) -} - -// GetPodResourceAllocation returns current pod resource allocation -func (sc *stateCheckpoint) GetPodResourceAllocation() PodResourceAllocation { - sc.mux.RLock() - defer sc.mux.RUnlock() - return sc.cache.GetPodResourceAllocation() -} - -// GetPodResizeStatus returns the last resize decision for a pod -func (sc *stateCheckpoint) GetPodResizeStatus(podUID string) v1.PodResizeStatus { - sc.mux.RLock() - defer sc.mux.RUnlock() - return sc.cache.GetPodResizeStatus(podUID) -} - -// SetContainerResourceAllocation sets resources allocated to a pod's container -func (sc *stateCheckpoint) SetContainerResourceAllocation(podUID string, containerName string, alloc v1.ResourceRequirements) error { - sc.mux.Lock() - defer sc.mux.Unlock() - sc.cache.SetContainerResourceAllocation(podUID, containerName, alloc) - return sc.storeState() -} - -// SetPodResourceAllocation sets pod resource allocation -func (sc *stateCheckpoint) SetPodResourceAllocation(a PodResourceAllocation) error { - sc.mux.Lock() - defer sc.mux.Unlock() - sc.cache.SetPodResourceAllocation(a) - return sc.storeState() -} - -// SetPodResizeStatus sets the last resize decision for a pod -func (sc *stateCheckpoint) SetPodResizeStatus(podUID string, resizeStatus v1.PodResizeStatus) { - sc.mux.Lock() - defer sc.mux.Unlock() - sc.cache.SetPodResizeStatus(podUID, resizeStatus) -} - -// Delete deletes allocations for specified pod -func (sc *stateCheckpoint) Delete(podUID string, containerName string) error { - sc.mux.Lock() - defer sc.mux.Unlock() - sc.cache.Delete(podUID, containerName) - return sc.storeState() -} - -// ClearState clears the state and saves it in a checkpoint -func (sc *stateCheckpoint) ClearState() error { - sc.mux.Lock() - defer sc.mux.Unlock() - sc.cache.ClearState() - return sc.storeState() -} - -type noopStateCheckpoint struct{} - -// NewNoopStateCheckpoint creates a dummy state checkpoint manager -func NewNoopStateCheckpoint() State { - return &noopStateCheckpoint{} -} - -func (sc *noopStateCheckpoint) GetContainerResourceAllocation(_ string, _ string) (v1.ResourceRequirements, bool) { - return v1.ResourceRequirements{}, false -} - -func (sc *noopStateCheckpoint) GetPodResourceAllocation() PodResourceAllocation { - return nil -} - -func (sc *noopStateCheckpoint) GetPodResizeStatus(_ string) v1.PodResizeStatus { - return "" -} - -func (sc *noopStateCheckpoint) SetContainerResourceAllocation(_ string, _ string, _ v1.ResourceRequirements) error { - return nil -} - -func (sc *noopStateCheckpoint) SetPodResourceAllocation(_ PodResourceAllocation) error { - return nil -} - -func (sc *noopStateCheckpoint) SetPodResizeStatus(_ string, _ v1.PodResizeStatus) {} - -func (sc *noopStateCheckpoint) Delete(_ string, _ string) error { - return nil -} - -func (sc *noopStateCheckpoint) ClearState() error { - return nil -} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/state/state_mem.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/state/state_mem.go deleted file mode 100644 index c8107dacb..000000000 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/state/state_mem.go +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package state - -import ( - "sync" - - v1 "k8s.io/api/core/v1" - "k8s.io/klog/v2" -) - -type stateMemory struct { - sync.RWMutex - podAllocation PodResourceAllocation - podResizeStatus PodResizeStatus -} - -var _ State = &stateMemory{} - -// NewStateMemory creates new State to track resources allocated to pods -func NewStateMemory() State { - klog.V(2).InfoS("Initialized new in-memory state store for pod resource allocation tracking") - return &stateMemory{ - podAllocation: PodResourceAllocation{}, - podResizeStatus: PodResizeStatus{}, - } -} - -func (s *stateMemory) GetContainerResourceAllocation(podUID string, containerName string) (v1.ResourceRequirements, bool) { - s.RLock() - defer s.RUnlock() - - alloc, ok := s.podAllocation[podUID][containerName] - return *alloc.DeepCopy(), ok -} - -func (s *stateMemory) GetPodResourceAllocation() PodResourceAllocation { - s.RLock() - defer s.RUnlock() - return s.podAllocation.Clone() -} - -func (s *stateMemory) GetPodResizeStatus(podUID string) v1.PodResizeStatus { - s.RLock() - defer s.RUnlock() - - return s.podResizeStatus[podUID] -} - -func (s *stateMemory) SetContainerResourceAllocation(podUID string, containerName string, alloc v1.ResourceRequirements) error { - s.Lock() - defer s.Unlock() - - if _, ok := s.podAllocation[podUID]; !ok { - s.podAllocation[podUID] = make(map[string]v1.ResourceRequirements) - } - - s.podAllocation[podUID][containerName] = alloc - klog.V(3).InfoS("Updated container resource allocation", "podUID", podUID, "containerName", containerName, "alloc", alloc) - return nil -} - -func (s *stateMemory) SetPodResourceAllocation(a PodResourceAllocation) error { - s.Lock() - defer s.Unlock() - - s.podAllocation = a.Clone() - klog.V(3).InfoS("Updated pod resource allocation", "allocation", a) - return nil -} - -func (s *stateMemory) SetPodResizeStatus(podUID string, resizeStatus v1.PodResizeStatus) { - s.Lock() - defer s.Unlock() - - if resizeStatus != "" { - s.podResizeStatus[podUID] = resizeStatus - } else { - delete(s.podResizeStatus, podUID) - } - klog.V(3).InfoS("Updated pod resize state", "podUID", podUID, "resizeStatus", resizeStatus) -} - -func (s *stateMemory) deleteContainer(podUID string, containerName string) { - delete(s.podAllocation[podUID], containerName) - if len(s.podAllocation[podUID]) == 0 { - delete(s.podAllocation, podUID) - delete(s.podResizeStatus, podUID) - } - klog.V(3).InfoS("Deleted pod resource allocation", "podUID", podUID, "containerName", containerName) -} - -func (s *stateMemory) Delete(podUID string, containerName string) error { - s.Lock() - defer s.Unlock() - if len(containerName) == 0 { - delete(s.podAllocation, podUID) - delete(s.podResizeStatus, podUID) - klog.V(3).InfoS("Deleted pod resource allocation and resize state", "podUID", podUID) - return nil - } - s.deleteContainer(podUID, containerName) - return nil -} - -func (s *stateMemory) ClearState() error { - s.Lock() - defer s.Unlock() - - s.podAllocation = make(PodResourceAllocation) - s.podResizeStatus = make(PodResizeStatus) - klog.V(3).InfoS("Cleared state") - return nil -} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/status_manager.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/status_manager.go index 3da131d53..c86bef17f 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/status_manager.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/status/status_manager.go @@ -25,7 +25,7 @@ import ( "sync" "time" - "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp" //nolint:depguard clientset "k8s.io/client-go/kubernetes" v1 "k8s.io/api/core/v1" @@ -40,15 +40,11 @@ import ( "k8s.io/kubernetes/pkg/features" kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/metrics" - "k8s.io/kubernetes/pkg/kubelet/status/state" kubetypes "k8s.io/kubernetes/pkg/kubelet/types" kubeutil "k8s.io/kubernetes/pkg/kubelet/util" statusutil "k8s.io/kubernetes/pkg/util/pod" ) -// podStatusManagerStateFile is the file name where status manager stores its state -const podStatusManagerStateFile = "pod_status_manager_state" - // A wrapper around v1.PodStatus that includes a version to enforce that stale pod statuses are // not sent to the API server. type versionedPodStatus struct { @@ -72,19 +68,32 @@ type manager struct { kubeClient clientset.Interface podManager PodManager // Map from pod UID to sync status of the corresponding pod. - podStatuses map[types.UID]versionedPodStatus - podStatusesLock sync.RWMutex - podStatusChannel chan struct{} + podStatuses map[types.UID]versionedPodStatus + podResizeConditions map[types.UID]podResizeConditions + podStatusesLock sync.RWMutex + podStatusChannel chan struct{} // Map from (mirror) pod UID to latest status version successfully sent to the API server. // apiStatusVersions must only be accessed from the sync thread. apiStatusVersions map[kubetypes.MirrorPodUID]uint64 podDeletionSafety PodDeletionSafetyProvider podStartupLatencyHelper PodStartupLatencyStateHelper - // state allows to save/restore pod resource allocation and tolerate kubelet restarts. - state state.State - // stateFileDirectory holds the directory where the state file for checkpoints is held. - stateFileDirectory string +} + +type podResizeConditions struct { + PodResizePending *v1.PodCondition + PodResizeInProgress *v1.PodCondition +} + +func (prc podResizeConditions) List() []*v1.PodCondition { + var conditions []*v1.PodCondition + if prc.PodResizePending != nil { + conditions = append(conditions, prc.PodResizePending) + } + if prc.PodResizeInProgress != nil { + conditions = append(conditions, prc.PodResizeInProgress) + } + return conditions } // PodManager is the subset of methods the manager needs to observe the actual state of the kubelet. @@ -143,42 +152,35 @@ type Manager interface { // the provided podUIDs. RemoveOrphanedStatuses(podUIDs map[types.UID]bool) - // GetPodResizeStatus returns cached PodStatus.Resize value - GetPodResizeStatus(podUID types.UID) v1.PodResizeStatus + // GetPodResizeConditions returns cached PodStatus Resize conditions value + GetPodResizeConditions(podUID types.UID) []*v1.PodCondition - // SetPodResizeStatus caches the last resizing decision for the pod. - SetPodResizeStatus(podUID types.UID, resize v1.PodResizeStatus) + // SetPodResizePendingCondition caches the last PodResizePending condition for the pod. + SetPodResizePendingCondition(podUID types.UID, reason, message string) - allocationManager -} + // SetPodResizeInProgressCondition caches the last PodResizeInProgress condition for the pod. + SetPodResizeInProgressCondition(podUID types.UID, reason, message string, allowReasonToBeCleared bool) -// TODO(tallclair): Refactor allocation state handling out of the status manager. -type allocationManager interface { - // GetContainerResourceAllocation returns the checkpointed AllocatedResources value for the container - GetContainerResourceAllocation(podUID string, containerName string) (v1.ResourceRequirements, bool) + // ClearPodResizePendingCondition clears the PodResizePending condition for the pod from the cache. + ClearPodResizePendingCondition(podUID types.UID) - // UpdatePodFromAllocation overwrites the pod spec with the allocation. - // This function does a deep copy only if updates are needed. - // Returns the updated (or original) pod, and whether there was an allocation stored. - UpdatePodFromAllocation(pod *v1.Pod) (*v1.Pod, bool) - - // SetPodAllocation checkpoints the resources allocated to a pod's containers. - SetPodAllocation(pod *v1.Pod) error + // ClearPodResizeInProgressCondition clears the PodResizeInProgress condition for the pod from the cache. + ClearPodResizeInProgressCondition(podUID types.UID) } const syncPeriod = 10 * time.Second // NewManager returns a functional Manager. -func NewManager(kubeClient clientset.Interface, podManager PodManager, podDeletionSafety PodDeletionSafetyProvider, podStartupLatencyHelper PodStartupLatencyStateHelper, stateFileDirectory string) Manager { +func NewManager(kubeClient clientset.Interface, podManager PodManager, podDeletionSafety PodDeletionSafetyProvider, podStartupLatencyHelper PodStartupLatencyStateHelper) Manager { return &manager{ kubeClient: kubeClient, podManager: podManager, podStatuses: make(map[types.UID]versionedPodStatus), + podResizeConditions: make(map[types.UID]podResizeConditions), podStatusChannel: make(chan struct{}, 1), apiStatusVersions: make(map[kubetypes.MirrorPodUID]uint64), podDeletionSafety: podDeletionSafety, podStartupLatencyHelper: podStartupLatencyHelper, - stateFileDirectory: stateFileDirectory, } } @@ -188,34 +190,35 @@ func NewManager(kubeClient clientset.Interface, podManager PodManager, podDeleti // changes will be ignored. func isPodStatusByKubeletEqual(oldStatus, status *v1.PodStatus) bool { oldCopy := oldStatus.DeepCopy() + + newConditions := make(map[v1.PodConditionType]*v1.PodCondition, len(status.Conditions)) + oldConditions := make(map[v1.PodConditionType]*v1.PodCondition, len(oldStatus.Conditions)) for _, c := range status.Conditions { - // both owned and shared conditions are used for kubelet status equality if kubetypes.PodConditionByKubelet(c.Type) || kubetypes.PodConditionSharedByKubelet(c.Type) { - _, oc := podutil.GetPodCondition(oldCopy, c.Type) - if oc == nil || oc.Status != c.Status || oc.Message != c.Message || oc.Reason != c.Reason { - return false - } + newConditions[c.Type] = &c } } + for _, c := range oldStatus.Conditions { + if kubetypes.PodConditionByKubelet(c.Type) || kubetypes.PodConditionSharedByKubelet(c.Type) { + oldConditions[c.Type] = &c + } + } + + if len(newConditions) != len(oldConditions) { + return false + } + for _, newCondition := range newConditions { + oldCondition := oldConditions[newCondition.Type] + if oldCondition == nil || oldCondition.Status != newCondition.Status || oldCondition.Message != newCondition.Message || oldCondition.Reason != newCondition.Reason { + return false + } + } + oldCopy.Conditions = status.Conditions return apiequality.Semantic.DeepEqual(oldCopy, status) } func (m *manager) Start() { - // Initialize m.state to no-op state checkpoint manager - m.state = state.NewNoopStateCheckpoint() - - // Create pod allocation checkpoint manager even if client is nil so as to allow local get/set of AllocatedResources & Resize - if utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling) { - stateImpl, err := state.NewStateCheckpoint(m.stateFileDirectory, podStatusManagerStateFile) - if err != nil { - // This is a crictical, non-recoverable failure. - klog.ErrorS(err, "Could not initialize pod allocation checkpoint manager, please drain node and remove policy state file") - panic(err) - } - m.state = stateImpl - } - // Don't start the status manager if we don't have a client. This will happen // on the master, where the kubelet is responsible for bootstrapping the pods // of the master components. @@ -244,72 +247,65 @@ func (m *manager) Start() { }, 0) } -// GetContainerResourceAllocation returns the last checkpointed AllocatedResources values -// If checkpoint manager has not been initialized, it returns nil, false -func (m *manager) GetContainerResourceAllocation(podUID string, containerName string) (v1.ResourceRequirements, bool) { +// GetPodResizeConditions returns the last cached ResizeStatus value. +func (m *manager) GetPodResizeConditions(podUID types.UID) []*v1.PodCondition { m.podStatusesLock.RLock() defer m.podStatusesLock.RUnlock() - return m.state.GetContainerResourceAllocation(podUID, containerName) + return m.podResizeConditions[podUID].List() } -// UpdatePodFromAllocation overwrites the pod spec with the allocation. -// This function does a deep copy only if updates are needed. -func (m *manager) UpdatePodFromAllocation(pod *v1.Pod) (*v1.Pod, bool) { - m.podStatusesLock.RLock() - defer m.podStatusesLock.RUnlock() - // TODO(tallclair): This clones the whole cache, but we only need 1 pod. - allocs := m.state.GetPodResourceAllocation() - return updatePodFromAllocation(pod, allocs) -} +// SetPodResizePendingCondition caches the last PodResizePending condition for the pod. +func (m *manager) SetPodResizePendingCondition(podUID types.UID, reason, message string) { + m.podStatusesLock.Lock() + defer m.podStatusesLock.Unlock() -func updatePodFromAllocation(pod *v1.Pod, allocs state.PodResourceAllocation) (*v1.Pod, bool) { - allocated, found := allocs[string(pod.UID)] - if !found { - return pod, false + m.podResizeConditions[podUID] = podResizeConditions{ + PodResizePending: updatedPodResizeCondition(v1.PodResizePending, m.podResizeConditions[podUID].PodResizePending, reason, message), + PodResizeInProgress: m.podResizeConditions[podUID].PodResizeInProgress, } +} - updated := false - for i, c := range pod.Spec.Containers { - if cAlloc, ok := allocated[c.Name]; ok { - if !apiequality.Semantic.DeepEqual(c.Resources, cAlloc) { - // Allocation differs from pod spec, update - if !updated { - // If this is the first update, copy the pod - pod = pod.DeepCopy() - updated = true - } - pod.Spec.Containers[i].Resources = cAlloc +// SetPodResizeInProgressCondition caches the last PodResizeInProgress condition for the pod. +func (m *manager) SetPodResizeInProgressCondition(podUID types.UID, reason, message string, allowReasonToBeCleared bool) { + oldConditions := m.GetPodResizeConditions(podUID) + + m.podStatusesLock.Lock() + defer m.podStatusesLock.Unlock() + + if !allowReasonToBeCleared && reason == "" && message == "" { + // Preserve the old reason and message if there is one. + for _, c := range oldConditions { + if c.Type == v1.PodResizeInProgress { + reason = c.Reason + message = c.Message } } } - return pod, updated -} -// GetPodResizeStatus returns the last cached ResizeStatus value. -func (m *manager) GetPodResizeStatus(podUID types.UID) v1.PodResizeStatus { - m.podStatusesLock.RLock() - defer m.podStatusesLock.RUnlock() - return m.state.GetPodResizeStatus(string(podUID)) -} - -// SetPodAllocation checkpoints the resources allocated to a pod's containers -func (m *manager) SetPodAllocation(pod *v1.Pod) error { - m.podStatusesLock.RLock() - defer m.podStatusesLock.RUnlock() - for _, container := range pod.Spec.Containers { - alloc := *container.Resources.DeepCopy() - if err := m.state.SetContainerResourceAllocation(string(pod.UID), container.Name, alloc); err != nil { - return err - } + m.podResizeConditions[podUID] = podResizeConditions{ + PodResizeInProgress: updatedPodResizeCondition(v1.PodResizeInProgress, m.podResizeConditions[podUID].PodResizeInProgress, reason, message), + PodResizePending: m.podResizeConditions[podUID].PodResizePending, } - return nil } -// SetPodResizeStatus checkpoints the last resizing decision for the pod. -func (m *manager) SetPodResizeStatus(podUID types.UID, resizeStatus v1.PodResizeStatus) { - m.podStatusesLock.RLock() - defer m.podStatusesLock.RUnlock() - m.state.SetPodResizeStatus(string(podUID), resizeStatus) +// ClearPodResizePendingCondition clears the PodResizePending condition for the pod from the cache. +func (m *manager) ClearPodResizePendingCondition(podUID types.UID) { + m.podStatusesLock.Lock() + defer m.podStatusesLock.Unlock() + m.podResizeConditions[podUID] = podResizeConditions{ + PodResizePending: nil, + PodResizeInProgress: m.podResizeConditions[podUID].PodResizeInProgress, + } +} + +// ClearPodResizeInProgressCondition clears the PodResizeInProgress condition for the pod from the cache. +func (m *manager) ClearPodResizeInProgressCondition(podUID types.UID) { + m.podStatusesLock.Lock() + defer m.podStatusesLock.Unlock() + m.podResizeConditions[podUID] = podResizeConditions{ + PodResizePending: m.podResizeConditions[podUID].PodResizePending, + PodResizeInProgress: nil, + } } func (m *manager) GetPodStatus(uid types.UID) (v1.PodStatus, bool) { @@ -326,6 +322,9 @@ func (m *manager) SetPodStatus(pod *v1.Pod, status v1.PodStatus) { // Make sure we're caching a deep copy. status = *status.DeepCopy() + // Set the observedGeneration for this pod status. + status.ObservedGeneration = podutil.GetPodObservedGenerationIfEnabled(pod) + // Force a status update if deletion timestamp is set. This is necessary // because if the pod is in the non-running state, the pod worker still // needs to be able to trigger an update and/or deletion. @@ -388,9 +387,10 @@ func (m *manager) SetContainerReadiness(podUID types.UID, containerID kubecontai status.Conditions = append(status.Conditions, condition) } } + allContainerStatuses := append(status.InitContainerStatuses, status.ContainerStatuses...) - updateConditionFunc(v1.PodReady, GeneratePodReadyCondition(&pod.Spec, status.Conditions, allContainerStatuses, status.Phase)) - updateConditionFunc(v1.ContainersReady, GenerateContainersReadyCondition(&pod.Spec, allContainerStatuses, status.Phase)) + updateConditionFunc(v1.PodReady, GeneratePodReadyCondition(pod, &oldStatus.status, status.Conditions, allContainerStatuses, status.Phase)) + updateConditionFunc(v1.ContainersReady, GenerateContainersReadyCondition(pod, &oldStatus.status, allContainerStatuses, status.Phase)) m.updateStatusInternal(pod, status, false, false) } @@ -690,6 +690,11 @@ func (m *manager) updateStatusInternal(pod *v1.Pod, status v1.PodStatus, forceUp status.StartTime = &now } + // prevent sending unnecessary patches + if oldStatus.ObservedGeneration > status.ObservedGeneration { + status.ObservedGeneration = oldStatus.ObservedGeneration + } + normalizeStatus(pod, &status) // Perform some more extensive logging of container termination state to assist in @@ -779,7 +784,7 @@ func (m *manager) deletePodStatus(uid types.UID) { delete(m.podStatuses, uid) m.podStartupLatencyHelper.DeletePodStartupState(uid) if utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling) { - m.state.Delete(string(uid), "") + delete(m.podResizeConditions, uid) } } @@ -792,7 +797,7 @@ func (m *manager) RemoveOrphanedStatuses(podUIDs map[types.UID]bool) { klog.V(5).InfoS("Removing pod from status map.", "podUID", key) delete(m.podStatuses, key) if utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling) { - m.state.Delete(string(key), "") + delete(m.podResizeConditions, key) } } } @@ -905,7 +910,7 @@ func (m *manager) syncPod(uid types.UID, status versionedPodStatus) { return } - mergedStatus := mergePodStatus(pod.Status, status.status, m.podDeletionSafety.PodCouldHaveRunningContainers(pod)) + mergedStatus := mergePodStatus(pod, pod.Status, status.status, m.podDeletionSafety.PodCouldHaveRunningContainers(pod)) newPod, patchBytes, unchanged, err := statusutil.PatchPodStatus(context.TODO(), m.kubeClient, pod.Namespace, pod.Name, pod.UID, pod.Status, mergedStatus) klog.V(3).InfoS("Patch status for pod", "pod", klog.KObj(pod), "podUID", uid, "patch", string(patchBytes)) @@ -1083,7 +1088,7 @@ func normalizeStatus(pod *v1.Pod, status *v1.PodStatus) *v1.PodStatus { // mergePodStatus merges oldPodStatus and newPodStatus to preserve where pod conditions // not owned by kubelet and to ensure terminal phase transition only happens after all // running containers have terminated. This method does not modify the old status. -func mergePodStatus(oldPodStatus, newPodStatus v1.PodStatus, couldHaveRunningContainers bool) v1.PodStatus { +func mergePodStatus(pod *v1.Pod, oldPodStatus, newPodStatus v1.PodStatus, couldHaveRunningContainers bool) v1.PodStatus { podConditions := make([]v1.PodCondition, 0, len(oldPodStatus.Conditions)+len(newPodStatus.Conditions)) for _, c := range oldPodStatus.Conditions { @@ -1145,10 +1150,10 @@ func mergePodStatus(oldPodStatus, newPodStatus v1.PodStatus, couldHaveRunningCon // See https://issues.k8s.io/108594 for more details. if podutil.IsPodPhaseTerminal(newPodStatus.Phase) { if podutil.IsPodReadyConditionTrue(newPodStatus) || podutil.IsContainersReadyConditionTrue(newPodStatus) { - containersReadyCondition := generateContainersReadyConditionForTerminalPhase(newPodStatus.Phase) + containersReadyCondition := generateContainersReadyConditionForTerminalPhase(pod, &oldPodStatus, newPodStatus.Phase) podutil.UpdatePodCondition(&newPodStatus, &containersReadyCondition) - podReadyCondition := generatePodReadyConditionForTerminalPhase(newPodStatus.Phase) + podReadyCondition := generatePodReadyConditionForTerminalPhase(pod, &oldPodStatus, newPodStatus.Phase) podutil.UpdatePodCondition(&newPodStatus, &podReadyCondition) } } @@ -1161,7 +1166,7 @@ func NeedToReconcilePodReadiness(pod *v1.Pod) bool { if len(pod.Spec.ReadinessGates) == 0 { return false } - podReadyCondition := GeneratePodReadyCondition(&pod.Spec, pod.Status.Conditions, pod.Status.ContainerStatuses, pod.Status.Phase) + podReadyCondition := GeneratePodReadyCondition(pod, &pod.Status, pod.Status.Conditions, pod.Status.ContainerStatuses, pod.Status.Phase) i, curCondition := podutil.GetPodConditionFromList(pod.Status.Conditions, v1.PodReady) // Only reconcile if "Ready" condition is present and Status or Message is not expected if i >= 0 && (curCondition.Status != podReadyCondition.Status || curCondition.Message != podReadyCondition.Message) { @@ -1169,3 +1174,22 @@ func NeedToReconcilePodReadiness(pod *v1.Pod) bool { } return false } + +func updatedPodResizeCondition(conditionType v1.PodConditionType, oldCondition *v1.PodCondition, reason, message string) *v1.PodCondition { + now := metav1.NewTime(time.Now()) + var lastTransitionTime metav1.Time + if oldCondition == nil || oldCondition.Reason != reason { + lastTransitionTime = now + } else { + lastTransitionTime = oldCondition.LastTransitionTime + } + + return &v1.PodCondition{ + Type: conditionType, + Status: v1.ConditionTrue, + LastProbeTime: now, + LastTransitionTime: lastTransitionTime, + Reason: reason, + Message: message, + } +} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/types/constants.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/types/constants.go index 56cba9c43..791052dbb 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/types/constants.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/types/constants.go @@ -32,7 +32,9 @@ const ( ) // SwapBehavior types +type SwapBehavior string + const ( - LimitedSwap = "LimitedSwap" - NoSwap = "NoSwap" + LimitedSwap SwapBehavior = "LimitedSwap" + NoSwap SwapBehavior = "NoSwap" ) diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/types/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/types/doc.go index 814bf6db3..9227a16ef 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/types/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/types/doc.go @@ -15,4 +15,4 @@ limitations under the License. */ // Package types contains common types in the Kubelet. -package types // import "k8s.io/kubernetes/pkg/kubelet/types" +package types diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/types/pod_status.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/types/pod_status.go index 593e9ce4e..24612e40d 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/types/pod_status.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/types/pod_status.go @@ -28,6 +28,8 @@ var PodConditionsByKubelet = []v1.PodConditionType{ v1.PodReady, v1.PodInitialized, v1.ContainersReady, + v1.PodResizeInProgress, + v1.PodResizePending, } // PodConditionByKubelet returns if the pod condition type is owned by kubelet diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/util/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/util/doc.go index eaccd63a3..0f119d2f5 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/util/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/util/doc.go @@ -15,4 +15,4 @@ limitations under the License. */ // Package util holds utility functions. -package util // import "k8s.io/kubernetes/pkg/kubelet/util" +package util diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/util/store/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/util/store/doc.go index b4d8523a0..04f0129b2 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/util/store/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/util/store/doc.go @@ -15,4 +15,4 @@ limitations under the License. */ // Package store hosts a Store interface and its implementations. -package store // import "k8s.io/kubernetes/pkg/kubelet/util/store" +package store diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/util/util_linux.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/util/util_linux.go index 56b9b920f..98efbb46f 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/util/util_linux.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/util/util_linux.go @@ -20,7 +20,7 @@ limitations under the License. package util import ( - libcontainercgroups "github.com/opencontainers/runc/libcontainer/cgroups" + libcontainercgroups "github.com/opencontainers/cgroups" ) // IsCgroup2UnifiedMode returns true if the cgroup v2 unified mode is enabled diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/winstats/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/winstats/doc.go index 1a9f7decd..9802d587b 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/winstats/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/kubelet/winstats/doc.go @@ -15,4 +15,4 @@ limitations under the License. */ // Package winstats provides a client to get node and pod level stats on windows -package winstats // import "k8s.io/kubernetes/pkg/kubelet/winstats" +package winstats diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/probe/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/probe/doc.go index 10fad9706..89c70b2c1 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/probe/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/probe/doc.go @@ -15,4 +15,4 @@ limitations under the License. */ // Package probe contains utilities for health probing, as well as health status information. -package probe // import "k8s.io/kubernetes/pkg/probe" +package probe diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/doc.go index 896eaa83b..ac48d0307 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/doc.go @@ -17,4 +17,4 @@ limitations under the License. // +k8s:deepcopy-gen=package // +groupName=kubescheduler.config.k8s.io -package config // import "k8s.io/kubernetes/pkg/scheduler/apis/config" +package config diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/types_pluginargs.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/types_pluginargs.go index 6a09d143a..a3db9a904 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/types_pluginargs.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/types_pluginargs.go @@ -163,7 +163,7 @@ type VolumeBindingArgs struct { // 1) 0 for 0 utilization // 2) 10 for 100 utilization // All points must be sorted in increasing order by utilization. - // +featureGate=VolumeCapacityPriority + // +featureGate=StorageCapacityScoring // +optional Shape []UtilizationShapePoint } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1/defaults.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1/defaults.go index c3775adcf..1310ea47a 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1/defaults.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1/defaults.go @@ -192,15 +192,15 @@ func SetDefaults_VolumeBindingArgs(obj *configv1.VolumeBindingArgs) { if obj.BindTimeoutSeconds == nil { obj.BindTimeoutSeconds = ptr.To[int64](600) } - if len(obj.Shape) == 0 && feature.DefaultFeatureGate.Enabled(features.VolumeCapacityPriority) { + if len(obj.Shape) == 0 && feature.DefaultFeatureGate.Enabled(features.StorageCapacityScoring) { obj.Shape = []configv1.UtilizationShapePoint{ { Utilization: 0, - Score: 0, + Score: int32(config.MaxCustomPriorityScore), }, { Utilization: 100, - Score: int32(config.MaxCustomPriorityScore), + Score: 0, }, } } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1/doc.go index 7fa215827..4e2ff4456 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1/doc.go @@ -21,4 +21,4 @@ limitations under the License. // +k8s:defaulter-gen-input=k8s.io/kube-scheduler/config/v1 // +groupName=kubescheduler.config.k8s.io -package v1 // import "k8s.io/kubernetes/pkg/scheduler/apis/config/v1" +package v1 diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/validation/validation_pluginargs.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/validation/validation_pluginargs.go index 15c9ddfaa..e3797dc87 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/validation/validation_pluginargs.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/validation/validation_pluginargs.go @@ -261,13 +261,13 @@ func ValidateNodeAffinityArgs(path *field.Path, args *config.NodeAffinityArgs) e // VolumeBindingArgsValidationOptions contains the different settings for validation. type VolumeBindingArgsValidationOptions struct { - AllowVolumeCapacityPriority bool + AllowStorageCapacityScoring bool } // ValidateVolumeBindingArgs validates that VolumeBindingArgs are set correctly. func ValidateVolumeBindingArgs(path *field.Path, args *config.VolumeBindingArgs) error { return ValidateVolumeBindingArgsWithOptions(path, args, VolumeBindingArgsValidationOptions{ - AllowVolumeCapacityPriority: utilfeature.DefaultFeatureGate.Enabled(features.VolumeCapacityPriority), + AllowStorageCapacityScoring: utilfeature.DefaultFeatureGate.Enabled(features.StorageCapacityScoring), }) } @@ -279,13 +279,13 @@ func ValidateVolumeBindingArgsWithOptions(path *field.Path, args *config.VolumeB allErrs = append(allErrs, field.Invalid(path.Child("bindTimeoutSeconds"), args.BindTimeoutSeconds, "invalid BindTimeoutSeconds, should not be a negative value")) } - if opts.AllowVolumeCapacityPriority { + if opts.AllowStorageCapacityScoring { allErrs = append(allErrs, validateFunctionShape(args.Shape, path.Child("shape"))...) } else if args.Shape != nil { // When the feature is off, return an error if the config is not nil. // This prevents unexpected configuration from taking effect when the // feature turns on in the future. - allErrs = append(allErrs, field.Invalid(path.Child("shape"), args.Shape, "unexpected field `shape`, remove it or turn on the feature gate VolumeCapacityPriority")) + allErrs = append(allErrs, field.Invalid(path.Child("shape"), args.Shape, "unexpected field `shape`, remove it or turn on the feature gate StorageCapacityScoring")) } return allErrs.ToAggregate() } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/backend/cache/cache.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/backend/cache/cache.go index 997364481..97d540110 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/backend/cache/cache.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/backend/cache/cache.go @@ -757,4 +757,12 @@ func (cache *cacheImpl) updateMetrics() { metrics.CacheSize.WithLabelValues("assumed_pods").Set(float64(len(cache.assumedPods))) metrics.CacheSize.WithLabelValues("pods").Set(float64(len(cache.podStates))) metrics.CacheSize.WithLabelValues("nodes").Set(float64(len(cache.nodes))) + + // we intentionally keep them with the deprecation and will remove at v1.34. + //nolint:staticcheck + metrics.SchedulerCacheSize.WithLabelValues("assumed_pods").Set(float64(len(cache.assumedPods))) + //nolint:staticcheck + metrics.SchedulerCacheSize.WithLabelValues("pods").Set(float64(len(cache.podStates))) + //nolint:staticcheck + metrics.SchedulerCacheSize.WithLabelValues("nodes").Set(float64(len(cache.nodes))) } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/backend/queue/active_queue.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/backend/queue/active_queue.go index bb53bf18d..14c734d75 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/backend/queue/active_queue.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/backend/queue/active_queue.go @@ -20,6 +20,7 @@ import ( "container/list" "fmt" "sync" + "time" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" @@ -61,14 +62,63 @@ type activeQueuer interface { // underLock() method should be used to protect these methods. type unlockedActiveQueuer interface { unlockedActiveQueueReader - AddOrUpdate(pInfo *framework.QueuedPodInfo) + // add adds a new pod to the activeQ. + // The event should show which event triggered this addition and is used for the metric recording. + // This method should be called in activeQueue.underLock(). + add(pInfo *framework.QueuedPodInfo, event string) } // unlockedActiveQueueReader defines activeQ read-only methods that are not protected by the lock itself. // underLock() or underRLock() method should be used to protect these methods. type unlockedActiveQueueReader interface { - Get(pInfo *framework.QueuedPodInfo) (*framework.QueuedPodInfo, bool) - Has(pInfo *framework.QueuedPodInfo) bool + // get returns the pod matching pInfo inside the activeQ. + // Returns false if the pInfo doesn't exist in the queue. + // This method should be called in activeQueue.underLock() or activeQueue.underRLock(). + get(pInfo *framework.QueuedPodInfo) (*framework.QueuedPodInfo, bool) + // has returns if pInfo exists in the queue. + // This method should be called in activeQueue.underLock() or activeQueue.underRLock(). + has(pInfo *framework.QueuedPodInfo) bool +} + +// unlockedActiveQueue defines activeQ methods that are not protected by the lock itself. +// activeQueue.underLock() or activeQueue.underRLock() method should be used to protect these methods. +type unlockedActiveQueue struct { + queue *heap.Heap[*framework.QueuedPodInfo] +} + +func newUnlockedActiveQueue(queue *heap.Heap[*framework.QueuedPodInfo]) *unlockedActiveQueue { + return &unlockedActiveQueue{ + queue: queue, + } +} + +// add adds a new pod to the activeQ. +// The event should show which event triggered this addition and is used for the metric recording. +// This method should be called in activeQueue.underLock(). +func (uaq *unlockedActiveQueue) add(pInfo *framework.QueuedPodInfo, event string) { + uaq.queue.AddOrUpdate(pInfo) + metrics.SchedulerQueueIncomingPods.WithLabelValues("active", event).Inc() +} + +// get returns the pod matching pInfo inside the activeQ. +// Returns false if the pInfo doesn't exist in the queue. +// This method should be called in activeQueue.underLock() or activeQueue.underRLock(). +func (uaq *unlockedActiveQueue) get(pInfo *framework.QueuedPodInfo) (*framework.QueuedPodInfo, bool) { + return uaq.queue.Get(pInfo) +} + +// has returns if pInfo exists in the queue. +// This method should be called in activeQueue.underLock() or activeQueue.underRLock(). +func (uaq *unlockedActiveQueue) has(pInfo *framework.QueuedPodInfo) bool { + return uaq.queue.Has(pInfo) +} + +// backoffQPopper defines method that is used to pop from the backoffQ when the activeQ is empty. +type backoffQPopper interface { + // popBackoff pops the pInfo from the podBackoffQ. + popBackoff() (*framework.QueuedPodInfo, error) + // len returns length of the podBackoffQ queue. + lenBackoff() int } // activeQueue implements activeQueuer. All of the fields have to be protected using the lock. @@ -77,15 +127,21 @@ type activeQueue struct { // It protects activeQ, inFlightPods, inFlightEvents, schedulingCycle and closed fields. // Caution: DO NOT take "SchedulingQueue.lock" after taking "lock". // You should always take "SchedulingQueue.lock" first, otherwise the queue could end up in deadlock. - // "lock" should not be taken after taking "nLock". - // Correct locking order is: SchedulingQueue.lock > lock > nominator.nLock. + // "lock" should not be taken after taking "backoffQueue.lock" or "nominator.nLock". + // Correct locking order is: SchedulingQueue.lock > lock > backoffQueue.lock > nominator.nLock. lock sync.RWMutex // activeQ is heap structure that scheduler actively looks at to find pods to // schedule. Head of heap is the highest priority pod. queue *heap.Heap[*framework.QueuedPodInfo] + // unlockedQueue is a wrapper of queue providing methods that are not locked themselves + // and can be used in the underLock() or underRLock(). + unlockedQueue *unlockedActiveQueue + // cond is a condition that is notified when the pod is added to activeQ. + // When SchedulerPopFromBackoffQ feature is enabled, + // condition is also notified when the pod is added to backoffQ. // It is used with lock. cond sync.Cond @@ -125,15 +181,21 @@ type activeQueue struct { isSchedulingQueueHintEnabled bool metricsRecorder metrics.MetricAsyncRecorder + + // backoffQPopper is used to pop from backoffQ when activeQ is empty. + // It is non-nil only when SchedulerPopFromBackoffQ feature is enabled. + backoffQPopper backoffQPopper } -func newActiveQueue(queue *heap.Heap[*framework.QueuedPodInfo], isSchedulingQueueHintEnabled bool, metricRecorder metrics.MetricAsyncRecorder) *activeQueue { +func newActiveQueue(queue *heap.Heap[*framework.QueuedPodInfo], isSchedulingQueueHintEnabled bool, metricRecorder metrics.MetricAsyncRecorder, backoffQPopper backoffQPopper) *activeQueue { aq := &activeQueue{ queue: queue, inFlightPods: make(map[types.UID]*list.Element), inFlightEvents: list.New(), isSchedulingQueueHintEnabled: isSchedulingQueueHintEnabled, metricsRecorder: metricRecorder, + unlockedQueue: newUnlockedActiveQueue(queue), + backoffQPopper: backoffQPopper, } aq.cond.L = &aq.lock @@ -146,7 +208,7 @@ func newActiveQueue(queue *heap.Heap[*framework.QueuedPodInfo], isSchedulingQueu func (aq *activeQueue) underLock(fn func(unlockedActiveQ unlockedActiveQueuer)) { aq.lock.Lock() defer aq.lock.Unlock() - fn(aq.queue) + fn(aq.unlockedQueue) } // underLock runs the fn function under the lock.RLock. @@ -155,7 +217,7 @@ func (aq *activeQueue) underLock(fn func(unlockedActiveQ unlockedActiveQueuer)) func (aq *activeQueue) underRLock(fn func(unlockedActiveQ unlockedActiveQueueReader)) { aq.lock.RLock() defer aq.lock.RUnlock() - fn(aq.queue) + fn(aq.unlockedQueue) } // update updates the pod in activeQ if oldPodInfo is already in the queue. @@ -191,7 +253,13 @@ func (aq *activeQueue) pop(logger klog.Logger) (*framework.QueuedPodInfo, error) } func (aq *activeQueue) unlockedPop(logger klog.Logger) (*framework.QueuedPodInfo, error) { + var pInfo *framework.QueuedPodInfo for aq.queue.Len() == 0 { + // backoffQPopper is non-nil only if SchedulerPopFromBackoffQ feature is enabled. + // In case of non-empty backoffQ, try popping from there. + if aq.backoffQPopper != nil && aq.backoffQPopper.lenBackoff() != 0 { + break + } // When the queue is empty, invocation of Pop() is blocked until new item is enqueued. // When Close() is called, the p.closed is set and the condition is broadcast, // which causes this loop to continue and return from the Pop(). @@ -203,9 +271,18 @@ func (aq *activeQueue) unlockedPop(logger klog.Logger) (*framework.QueuedPodInfo } pInfo, err := aq.queue.Pop() if err != nil { - return nil, err + if aq.backoffQPopper == nil { + return nil, err + } + // Try to pop from backoffQ when activeQ is empty. + pInfo, err = aq.backoffQPopper.popBackoff() + if err != nil { + return nil, err + } + metrics.SchedulerQueueIncomingPods.WithLabelValues("active", framework.PopFromBackoffQ).Inc() } pInfo.Attempts++ + pInfo.BackoffExpiration = time.Time{} // In flight, no concurrent events yet. if aq.isSchedulingQueueHintEnabled { // If the pod is already in the map, we shouldn't overwrite the inFlightPods otherwise it'd lead to a memory leak. @@ -354,6 +431,12 @@ func (aq *activeQueue) done(pod types.UID) { aq.lock.Lock() defer aq.lock.Unlock() + aq.unlockedDone(pod) +} + +// unlockedDone is used by the activeQueue internally and doesn't take the lock itself. +// It assumes the lock is already taken outside before the method is called. +func (aq *activeQueue) unlockedDone(pod types.UID) { inFlightPod, ok := aq.inFlightPods[pod] if !ok { // This Pod is already done()ed. @@ -398,15 +481,15 @@ func (aq *activeQueue) done(pod types.UID) { // close closes the activeQueue. func (aq *activeQueue) close() { + aq.lock.Lock() + defer aq.lock.Unlock() // We should call done() for all in-flight pods to clean up the inFlightEvents metrics. // It's safe even if the binding cycle running asynchronously calls done() afterwards // done() will just be a no-op. for pod := range aq.inFlightPods { - aq.done(pod) + aq.unlockedDone(pod) } - aq.lock.Lock() aq.closed = true - aq.lock.Unlock() } // broadcast notifies the pop() operation that new pod(s) was added to the activeQueue. diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/backend/queue/backoff_queue.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/backend/queue/backoff_queue.go new file mode 100644 index 000000000..6e0bbd680 --- /dev/null +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/backend/queue/backoff_queue.go @@ -0,0 +1,405 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package queue + +import ( + "sync" + "time" + + v1 "k8s.io/api/core/v1" + "k8s.io/klog/v2" + "k8s.io/kubernetes/pkg/scheduler/backend/heap" + "k8s.io/kubernetes/pkg/scheduler/framework" + "k8s.io/kubernetes/pkg/scheduler/metrics" + "k8s.io/utils/clock" +) + +// backoffQOrderingWindowDuration is a duration of an ordering window in the podBackoffQ. +// In each window, represented as a whole second, pods are ordered by priority. +// It is the same as interval of flushing the pods from the podBackoffQ to the activeQ, to flush the whole windows there. +// This works only if PopFromBackoffQ feature is enabled. +// See the KEP-5142 (http://kep.k8s.io/5142) for rationale. +const backoffQOrderingWindowDuration = time.Second + +// backoffQueuer is a wrapper for backoffQ related operations. +// Its methods that relies on the queues, take the lock inside. +type backoffQueuer interface { + // isPodBackingoff returns true if a pod is still waiting for its backoff timer. + // If this returns true, the pod should not be re-tried. + // If the pod backoff time is in the actual ordering window, it should still be backing off. + isPodBackingoff(podInfo *framework.QueuedPodInfo) bool + // popAllBackoffCompleted pops all pods from podBackoffQ and podErrorBackoffQ that completed backoff. + popAllBackoffCompleted(logger klog.Logger) []*framework.QueuedPodInfo + + // podInitialBackoffDuration returns initial backoff duration that pod can get. + podInitialBackoffDuration() time.Duration + // podMaxBackoffDuration returns maximum backoff duration that pod can get. + podMaxBackoffDuration() time.Duration + // waitUntilAlignedWithOrderingWindow waits until the time reaches a multiple of backoffQOrderingWindowDuration. + // It then runs the f function at the backoffQOrderingWindowDuration interval using a ticker. + // It's important to align the flushing time, because podBackoffQ's ordering is based on the windows + // and whole windows have to be flushed at one time without a visible latency. + waitUntilAlignedWithOrderingWindow(f func(), stopCh <-chan struct{}) + + // add adds the pInfo to backoffQueue. + // The event should show which event triggered this addition and is used for the metric recording. + // It also ensures that pInfo is not in both queues. + add(logger klog.Logger, pInfo *framework.QueuedPodInfo, event string) + // update updates the pod in backoffQueue if oldPodInfo is already in the queue. + // It returns new pod info if updated, nil otherwise. + update(newPod *v1.Pod, oldPodInfo *framework.QueuedPodInfo) *framework.QueuedPodInfo + // delete deletes the pInfo from backoffQueue. + // It returns true if the pod was deleted. + delete(pInfo *framework.QueuedPodInfo) bool + // get returns the pInfo matching given pInfoLookup, if exists. + get(pInfoLookup *framework.QueuedPodInfo) (*framework.QueuedPodInfo, bool) + // has inform if pInfo exists in the queue. + has(pInfo *framework.QueuedPodInfo) bool + // list returns all pods that are in the queue. + list() []*v1.Pod + // len returns length of the queue. + len() int +} + +// backoffQueue implements backoffQueuer and wraps two queues inside, +// providing seamless access as if it were one queue. +type backoffQueue struct { + // lock synchronizes all operations related to backoffQ. + // It protects both podBackoffQ and podErrorBackoffQ. + // Caution: DO NOT take "SchedulingQueue.lock" or "activeQueue.lock" after taking "lock". + // You should always take "SchedulingQueue.lock" and "activeQueue.lock" first, otherwise the queue could end up in deadlock. + // "lock" should not be taken after taking "nominator.nLock". + // Correct locking order is: SchedulingQueue.lock > activeQueue.lock > lock > nominator.nLock. + lock sync.RWMutex + + clock clock.WithTicker + + // podBackoffQ is a heap ordered by backoff expiry. Pods which have completed backoff + // are popped from this heap before the scheduler looks at activeQ + podBackoffQ *heap.Heap[*framework.QueuedPodInfo] + // podErrorBackoffQ is a heap ordered by error backoff expiry. Pods which have completed backoff + // are popped from this heap before the scheduler looks at activeQ + podErrorBackoffQ *heap.Heap[*framework.QueuedPodInfo] + + podInitialBackoff time.Duration + podMaxBackoff time.Duration + // activeQLessFn is used as an eventual less function if two backoff times are equal, + // when the SchedulerPopFromBackoffQ feature is enabled. + activeQLessFn framework.LessFunc + + // isPopFromBackoffQEnabled indicates whether the feature gate SchedulerPopFromBackoffQ is enabled. + isPopFromBackoffQEnabled bool +} + +func newBackoffQueue(clock clock.WithTicker, podInitialBackoffDuration time.Duration, podMaxBackoffDuration time.Duration, activeQLessFn framework.LessFunc, popFromBackoffQEnabled bool) *backoffQueue { + bq := &backoffQueue{ + clock: clock, + podInitialBackoff: podInitialBackoffDuration, + podMaxBackoff: podMaxBackoffDuration, + isPopFromBackoffQEnabled: popFromBackoffQEnabled, + activeQLessFn: activeQLessFn, + } + podBackoffQLessFn := bq.lessBackoffCompleted + if popFromBackoffQEnabled { + podBackoffQLessFn = bq.lessBackoffCompletedWithPriority + } + bq.podBackoffQ = heap.NewWithRecorder(podInfoKeyFunc, podBackoffQLessFn, metrics.NewBackoffPodsRecorder()) + bq.podErrorBackoffQ = heap.NewWithRecorder(podInfoKeyFunc, bq.lessBackoffCompleted, metrics.NewBackoffPodsRecorder()) + + return bq +} + +// podInitialBackoffDuration returns initial backoff duration that pod can get. +func (bq *backoffQueue) podInitialBackoffDuration() time.Duration { + return bq.podInitialBackoff +} + +// podMaxBackoffDuration returns maximum backoff duration that pod can get. +func (bq *backoffQueue) podMaxBackoffDuration() time.Duration { + return bq.podMaxBackoff +} + +// alignToWindow truncates the provided time to the podBackoffQ ordering window. +// It returns the lowest possible timestamp in the window. +func (bq *backoffQueue) alignToWindow(t time.Time) time.Time { + if !bq.isPopFromBackoffQEnabled { + return t + } + return t.Truncate(backoffQOrderingWindowDuration) +} + +// waitUntilAlignedWithOrderingWindow waits until the time reaches a multiple of backoffQOrderingWindowDuration. +// It then runs the f function at the backoffQOrderingWindowDuration interval using a ticker. +// It's important to align the flushing time, because podBackoffQ's ordering is based on the windows +// and whole windows have to be flushed at one time without a visible latency. +func (bq *backoffQueue) waitUntilAlignedWithOrderingWindow(f func(), stopCh <-chan struct{}) { + now := bq.clock.Now() + // Wait until the time reaches the multiple of backoffQOrderingWindowDuration. + durationToNextWindow := bq.alignToWindow(now.Add(backoffQOrderingWindowDuration)).Sub(now) + timer := bq.clock.NewTimer(durationToNextWindow) + select { + case <-stopCh: + timer.Stop() + return + case <-timer.C(): + } + + // Run a ticker to make sure the invocations of f function + // are aligned with the backoffQ's ordering window. + ticker := bq.clock.NewTicker(backoffQOrderingWindowDuration) + for { + select { + case <-stopCh: + return + default: + } + + f() + + // NOTE: b/c there is no priority selection in golang + // it is possible for this to race, meaning we could + // trigger ticker.C and stopCh, and ticker.C select falls through. + // In order to mitigate we re-check stopCh at the beginning + // of every loop to prevent extra executions of f(). + select { + case <-stopCh: + ticker.Stop() + return + case <-ticker.C(): + } + } +} + +// lessBackoffCompletedWithPriority is a less function of podBackoffQ if PopFromBackoffQ feature is enabled. +// It orders the pods in the same BackoffOrderingWindow the same as the activeQ will do to improve popping order from backoffQ when activeQ is empty. +func (bq *backoffQueue) lessBackoffCompletedWithPriority(pInfo1, pInfo2 *framework.QueuedPodInfo) bool { + bo1 := bq.getBackoffTime(pInfo1) + bo2 := bq.getBackoffTime(pInfo2) + if !bo1.Equal(bo2) { + return bo1.Before(bo2) + } + // If the backoff time is the same, sort the pod in the same manner as activeQ does. + return bq.activeQLessFn(pInfo1, pInfo2) +} + +// lessBackoffCompleted is a less function of podErrorBackoffQ. +func (bq *backoffQueue) lessBackoffCompleted(pInfo1, pInfo2 *framework.QueuedPodInfo) bool { + bo1 := bq.getBackoffTime(pInfo1) + bo2 := bq.getBackoffTime(pInfo2) + return bo1.Before(bo2) +} + +// isPodBackingoff returns true if a pod is still waiting for its backoff timer. +// If this returns true, the pod should not be re-tried. +// If the pod backoff time is in the actual ordering window, it should still be backing off. +func (bq *backoffQueue) isPodBackingoff(podInfo *framework.QueuedPodInfo) bool { + boTime := bq.getBackoffTime(podInfo) + // Don't use After, because in case of windows equality we want to return true. + return !boTime.Before(bq.alignToWindow(bq.clock.Now())) +} + +// getBackoffTime returns the time that podInfo completes backoff. +// It caches the result in podInfo.BackoffExpiration and returns this value in subsequent calls. +// The cache will be cleared when this pod is poped from the scheduling queue again (i.e., at activeQ's pop), +// because of the fact that the backoff time is calculated based on podInfo.Attempts, +// which doesn't get changed until the pod's scheduling is retried. +func (bq *backoffQueue) getBackoffTime(podInfo *framework.QueuedPodInfo) time.Time { + if podInfo.Attempts == 0 { + // Don't store backoff expiration if the duration is 0 + // to correctly handle isPodBackingoff, if pod should skip backoff, when it wasn't tried at all. + return time.Time{} + } + if podInfo.BackoffExpiration.IsZero() { + duration := bq.calculateBackoffDuration(podInfo) + podInfo.BackoffExpiration = bq.alignToWindow(podInfo.Timestamp.Add(duration)) + } + return podInfo.BackoffExpiration +} + +// calculateBackoffDuration is a helper function for calculating the backoffDuration +// based on the number of attempts the pod has made. +func (bq *backoffQueue) calculateBackoffDuration(podInfo *framework.QueuedPodInfo) time.Duration { + if podInfo.Attempts == 0 { + // When the Pod hasn't experienced any scheduling attempts, + // they aren't obliged to get a backoff penalty at all. + return 0 + } + + duration := bq.podInitialBackoff + for i := 1; i < podInfo.Attempts; i++ { + // Use subtraction instead of addition or multiplication to avoid overflow. + if duration > bq.podMaxBackoff-duration { + return bq.podMaxBackoff + } + duration += duration + } + return duration +} + +func (bq *backoffQueue) popAllBackoffCompletedWithQueue(logger klog.Logger, queue *heap.Heap[*framework.QueuedPodInfo]) []*framework.QueuedPodInfo { + var poppedPods []*framework.QueuedPodInfo + for { + pInfo, ok := queue.Peek() + if !ok || pInfo == nil { + break + } + pod := pInfo.Pod + if bq.isPodBackingoff(pInfo) { + break + } + _, err := queue.Pop() + if err != nil { + logger.Error(err, "Unable to pop pod from backoff queue despite backoff completion", "pod", klog.KObj(pod)) + break + } + poppedPods = append(poppedPods, pInfo) + } + return poppedPods +} + +// popAllBackoffCompleted pops all pods from podBackoffQ and podErrorBackoffQ that completed backoff. +func (bq *backoffQueue) popAllBackoffCompleted(logger klog.Logger) []*framework.QueuedPodInfo { + bq.lock.Lock() + defer bq.lock.Unlock() + + // Ensure both queues are called + return append(bq.popAllBackoffCompletedWithQueue(logger, bq.podBackoffQ), bq.popAllBackoffCompletedWithQueue(logger, bq.podErrorBackoffQ)...) +} + +// add adds the pInfo to backoffQueue. +// The event should show which event triggered this addition and is used for the metric recording. +// It also ensures that pInfo is not in both queues. +func (bq *backoffQueue) add(logger klog.Logger, pInfo *framework.QueuedPodInfo, event string) { + bq.lock.Lock() + defer bq.lock.Unlock() + + // If pod has empty both unschedulable plugins and pending plugins, + // it means that it failed because of error and should be moved to podErrorBackoffQ. + if pInfo.UnschedulablePlugins.Len() == 0 && pInfo.PendingPlugins.Len() == 0 { + bq.podErrorBackoffQ.AddOrUpdate(pInfo) + // Ensure the pod is not in the podBackoffQ and report the error if it happens. + err := bq.podBackoffQ.Delete(pInfo) + if err == nil { + logger.Error(nil, "BackoffQueue add() was called with a pod that was already in the podBackoffQ", "pod", klog.KObj(pInfo.Pod)) + return + } + metrics.SchedulerQueueIncomingPods.WithLabelValues("backoff", event).Inc() + return + } + bq.podBackoffQ.AddOrUpdate(pInfo) + // Ensure the pod is not in the podErrorBackoffQ and report the error if it happens. + err := bq.podErrorBackoffQ.Delete(pInfo) + if err == nil { + logger.Error(nil, "BackoffQueue add() was called with a pod that was already in the podErrorBackoffQ", "pod", klog.KObj(pInfo.Pod)) + return + } + metrics.SchedulerQueueIncomingPods.WithLabelValues("backoff", event).Inc() +} + +// update updates the pod in backoffQueue if oldPodInfo is already in the queue. +// It returns new pod info if updated, nil otherwise. +func (bq *backoffQueue) update(newPod *v1.Pod, oldPodInfo *framework.QueuedPodInfo) *framework.QueuedPodInfo { + bq.lock.Lock() + defer bq.lock.Unlock() + + // If the pod is in the backoff queue, update it there. + if pInfo, exists := bq.podBackoffQ.Get(oldPodInfo); exists { + _ = pInfo.Update(newPod) + bq.podBackoffQ.AddOrUpdate(pInfo) + return pInfo + } + // If the pod is in the error backoff queue, update it there. + if pInfo, exists := bq.podErrorBackoffQ.Get(oldPodInfo); exists { + _ = pInfo.Update(newPod) + bq.podErrorBackoffQ.AddOrUpdate(pInfo) + return pInfo + } + return nil +} + +// delete deletes the pInfo from backoffQueue. +// It returns true if the pod was deleted. +func (bq *backoffQueue) delete(pInfo *framework.QueuedPodInfo) bool { + bq.lock.Lock() + defer bq.lock.Unlock() + + if bq.podBackoffQ.Delete(pInfo) == nil { + return true + } + return bq.podErrorBackoffQ.Delete(pInfo) == nil +} + +// popBackoff pops the pInfo from the podBackoffQ. +// It returns error if the queue is empty. +// This doesn't pop the pods from the podErrorBackoffQ. +func (bq *backoffQueue) popBackoff() (*framework.QueuedPodInfo, error) { + bq.lock.Lock() + defer bq.lock.Unlock() + + return bq.podBackoffQ.Pop() +} + +// get returns the pInfo matching given pInfoLookup, if exists. +func (bq *backoffQueue) get(pInfoLookup *framework.QueuedPodInfo) (*framework.QueuedPodInfo, bool) { + bq.lock.RLock() + defer bq.lock.RUnlock() + + pInfo, exists := bq.podBackoffQ.Get(pInfoLookup) + if exists { + return pInfo, true + } + return bq.podErrorBackoffQ.Get(pInfoLookup) +} + +// has inform if pInfo exists in the queue. +func (bq *backoffQueue) has(pInfo *framework.QueuedPodInfo) bool { + bq.lock.RLock() + defer bq.lock.RUnlock() + + return bq.podBackoffQ.Has(pInfo) || bq.podErrorBackoffQ.Has(pInfo) +} + +// list returns all pods that are in the queue. +func (bq *backoffQueue) list() []*v1.Pod { + bq.lock.RLock() + defer bq.lock.RUnlock() + + var result []*v1.Pod + for _, pInfo := range bq.podBackoffQ.List() { + result = append(result, pInfo.Pod) + } + for _, pInfo := range bq.podErrorBackoffQ.List() { + result = append(result, pInfo.Pod) + } + return result +} + +// len returns length of the queue. +func (bq *backoffQueue) len() int { + bq.lock.RLock() + defer bq.lock.RUnlock() + + return bq.podBackoffQ.Len() + bq.podErrorBackoffQ.Len() +} + +// lenBackoff returns length of the podBackoffQ. +func (bq *backoffQueue) lenBackoff() int { + bq.lock.RLock() + defer bq.lock.RUnlock() + + return bq.podBackoffQ.Len() +} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/backend/queue/nominator.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/backend/queue/nominator.go index 59f7eaa48..4d6ceaabc 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/backend/queue/nominator.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/backend/queue/nominator.go @@ -35,10 +35,10 @@ import ( type nominator struct { // nLock synchronizes all operations related to nominator. // It should not be used anywhere else. - // Caution: DO NOT take ("SchedulingQueue.lock" or "activeQueue.lock") after taking "nLock". - // You should always take "SchedulingQueue.lock" and "activeQueue.lock" first, + // Caution: DO NOT take ("SchedulingQueue.lock" or "activeQueue.lock" or "backoffQueue.lock") after taking "nLock". + // You should always take "SchedulingQueue.lock" and "activeQueue.lock" and "backoffQueue.lock" first, // otherwise the nominator could end up in deadlock. - // Correct locking order is: SchedulingQueue.lock > activeQueue.lock > nLock. + // Correct locking order is: SchedulingQueue.lock > activeQueue.lock = backoffQueue.lock > nLock. nLock sync.RWMutex // podLister is used to verify if the given pod is alive. diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/backend/queue/scheduling_queue.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/backend/queue/scheduling_queue.go index 06f25037b..69eae17fd 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/backend/queue/scheduling_queue.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/backend/queue/scheduling_queue.go @@ -132,6 +132,9 @@ type SchedulingQueue interface { PendingPods() ([]*v1.Pod, string) InFlightPods() []*v1.Pod PodsInActiveQ() []*v1.Pod + // PodsInBackoffQ returns all the Pods in the backoffQ. + PodsInBackoffQ() []*v1.Pod + UnschedulablePods() []*v1.Pod } // NewSchedulingQueue initializes a priority queue as a new scheduling queue. @@ -155,24 +158,18 @@ type PriorityQueue struct { *nominator stop chan struct{} - clock clock.Clock + clock clock.WithTicker // lock takes precedence and should be taken first, - // before any other locks in the queue (activeQueue.lock or nominator.nLock). - // Correct locking order is: lock > activeQueue.lock > nominator.nLock. + // before any other locks in the queue (activeQueue.lock or backoffQueue.lock or nominator.nLock). + // Correct locking order is: lock > activeQueue.lock > backoffQueue.lock > nominator.nLock. lock sync.RWMutex - // pod initial backoff duration. - podInitialBackoffDuration time.Duration - // pod maximum backoff duration. - podMaxBackoffDuration time.Duration // the maximum time a pod can stay in the unschedulablePods. podMaxInUnschedulablePodsDuration time.Duration - activeQ activeQueuer - // podBackoffQ is a heap ordered by backoff expiry. Pods which have completed backoff - // are popped from this heap before the scheduler looks at activeQ - podBackoffQ *heap.Heap[*framework.QueuedPodInfo] + activeQ activeQueuer + backoffQ backoffQueuer // unschedulablePods holds pods that have been tried and determined unschedulable. unschedulablePods *UnschedulablePods // moveRequestCycle caches the sequence number of scheduling cycle when we @@ -195,6 +192,8 @@ type PriorityQueue struct { // isSchedulingQueueHintEnabled indicates whether the feature gate for the scheduling queue is enabled. isSchedulingQueueHintEnabled bool + // isPopFromBackoffQEnabled indicates whether the feature gate SchedulerPopFromBackoffQ is enabled. + isPopFromBackoffQEnabled bool } // QueueingHintFunction is the wrapper of QueueingHintFn that has PluginName. @@ -213,7 +212,7 @@ type clusterEvent struct { } type priorityQueueOptions struct { - clock clock.Clock + clock clock.WithTicker podInitialBackoffDuration time.Duration podMaxBackoffDuration time.Duration podMaxInUnschedulablePodsDuration time.Duration @@ -228,7 +227,7 @@ type priorityQueueOptions struct { type Option func(*priorityQueueOptions) // WithClock sets clock for PriorityQueue, the default clock is clock.RealClock. -func WithClock(clock clock.Clock) Option { +func WithClock(clock clock.WithTicker) Option { return func(o *priorityQueueOptions) { o.clock = clock } @@ -331,14 +330,14 @@ func NewPriorityQueue( } isSchedulingQueueHintEnabled := utilfeature.DefaultFeatureGate.Enabled(features.SchedulerQueueingHints) + isPopFromBackoffQEnabled := utilfeature.DefaultFeatureGate.Enabled(features.SchedulerPopFromBackoffQ) + backoffQ := newBackoffQueue(options.clock, options.podInitialBackoffDuration, options.podMaxBackoffDuration, lessFn, isPopFromBackoffQEnabled) pq := &PriorityQueue{ clock: options.clock, stop: make(chan struct{}), - podInitialBackoffDuration: options.podInitialBackoffDuration, - podMaxBackoffDuration: options.podMaxBackoffDuration, podMaxInUnschedulablePodsDuration: options.podMaxInUnschedulablePodsDuration, - activeQ: newActiveQueue(heap.NewWithRecorder(podInfoKeyFunc, heap.LessFunc[*framework.QueuedPodInfo](lessFn), metrics.NewActivePodsRecorder()), isSchedulingQueueHintEnabled, options.metricsRecorder), + backoffQ: backoffQ, unschedulablePods: newUnschedulablePods(metrics.NewUnschedulablePodsRecorder(), metrics.NewGatedPodsRecorder()), preEnqueuePluginMap: options.preEnqueuePluginMap, queueingHintMap: options.queueingHintMap, @@ -346,19 +345,24 @@ func NewPriorityQueue( pluginMetricsSamplePercent: options.pluginMetricsSamplePercent, moveRequestCycle: -1, isSchedulingQueueHintEnabled: isSchedulingQueueHintEnabled, + isPopFromBackoffQEnabled: isPopFromBackoffQEnabled, } - pq.podBackoffQ = heap.NewWithRecorder(podInfoKeyFunc, pq.podsCompareBackoffCompleted, metrics.NewBackoffPodsRecorder()) + var backoffQPopper backoffQPopper + if isPopFromBackoffQEnabled { + backoffQPopper = backoffQ + } + pq.activeQ = newActiveQueue(heap.NewWithRecorder(podInfoKeyFunc, heap.LessFunc[*framework.QueuedPodInfo](lessFn), metrics.NewActivePodsRecorder()), isSchedulingQueueHintEnabled, options.metricsRecorder, backoffQPopper) pq.nsLister = informerFactory.Core().V1().Namespaces().Lister() pq.nominator = newPodNominator(options.podLister) return pq } -// Run starts the goroutine to pump from podBackoffQ to activeQ +// Run starts the goroutine to pump from backoffQ to activeQ func (p *PriorityQueue) Run(logger klog.Logger) { - go wait.Until(func() { + go p.backoffQ.waitUntilAlignedWithOrderingWindow(func() { p.flushBackoffQCompleted(logger) - }, 1.0*time.Second, p.stop) + }, p.stop) go wait.Until(func() { p.flushUnschedulablePodsLeftover(logger) }, 30*time.Second, p.stop) @@ -553,25 +557,33 @@ func (p *PriorityQueue) runPreEnqueuePlugin(ctx context.Context, pl framework.Pr return s } -// moveToActiveQ tries to add pod to active queue and remove it from unschedulable and backoff queues. -// It returns 2 parameters: -// 1. a boolean flag to indicate whether the pod is added successfully. -// 2. an error for the caller to act on. +// moveToActiveQ tries to add the pod to the active queue. +// If the pod doesn't pass PreEnqueue plugins, it gets added to unschedulablePods instead. +// It returns a boolean flag to indicate whether the pod is added successfully. func (p *PriorityQueue) moveToActiveQ(logger klog.Logger, pInfo *framework.QueuedPodInfo, event string) bool { gatedBefore := pInfo.Gated - pInfo.Gated = !p.runPreEnqueuePlugins(context.Background(), pInfo) + // If SchedulerPopFromBackoffQ feature gate is enabled, + // PreEnqueue plugins were called when the pod was added to the backoffQ. + // Don't need to repeat it here when the pod is directly moved from the backoffQ. + if !p.isPopFromBackoffQEnabled || event != framework.BackoffComplete { + pInfo.Gated = !p.runPreEnqueuePlugins(context.Background(), pInfo) + } added := false p.activeQ.underLock(func(unlockedActiveQ unlockedActiveQueuer) { if pInfo.Gated { // Add the Pod to unschedulablePods if it's not passing PreEnqueuePlugins. - if unlockedActiveQ.Has(pInfo) { + if unlockedActiveQ.has(pInfo) { return } - if p.podBackoffQ.Has(pInfo) { + if p.backoffQ.has(pInfo) { return } - p.unschedulablePods.addOrUpdate(pInfo) + if p.unschedulablePods.get(pInfo.Pod) != nil { + return + } + p.unschedulablePods.addOrUpdate(pInfo, event) + logger.V(5).Info("Pod moved to an internal scheduling queue, because the pod is gated", "pod", klog.KObj(pInfo.Pod), "event", event, "queue", unschedulablePods) return } if pInfo.InitialAttemptTimestamp == nil { @@ -579,13 +591,12 @@ func (p *PriorityQueue) moveToActiveQ(logger klog.Logger, pInfo *framework.Queue pInfo.InitialAttemptTimestamp = &now } - unlockedActiveQ.AddOrUpdate(pInfo) + unlockedActiveQ.add(pInfo, event) added = true p.unschedulablePods.delete(pInfo.Pod, gatedBefore) - _ = p.podBackoffQ.Delete(pInfo) // Don't need to react when pInfo is not found. + p.backoffQ.delete(pInfo) logger.V(5).Info("Pod moved to an internal scheduling queue", "pod", klog.KObj(pInfo.Pod), "event", event, "queue", activeQ) - metrics.SchedulerQueueIncomingPods.WithLabelValues("active", event).Inc() if event == framework.EventUnscheduledPodAdd.Label() || event == framework.EventUnscheduledPodUpdate.Label() { p.AddNominatedPod(logger, pInfo.PodInfo, nil) } @@ -593,6 +604,28 @@ func (p *PriorityQueue) moveToActiveQ(logger klog.Logger, pInfo *framework.Queue return added } +// moveToBackoffQ tries to add the pod to the backoff queue. +// If SchedulerPopFromBackoffQ feature gate is enabled and the pod doesn't pass PreEnqueue plugins, it gets added to unschedulablePods instead. +// It returns a boolean flag to indicate whether the pod is added successfully. +func (p *PriorityQueue) moveToBackoffQ(logger klog.Logger, pInfo *framework.QueuedPodInfo, event string) bool { + // If SchedulerPopFromBackoffQ feature gate is enabled, + // PreEnqueue plugins are called on inserting pods to the backoffQ, + // not to call them again on popping out. + if p.isPopFromBackoffQEnabled { + pInfo.Gated = !p.runPreEnqueuePlugins(context.Background(), pInfo) + if pInfo.Gated { + if p.unschedulablePods.get(pInfo.Pod) == nil { + p.unschedulablePods.addOrUpdate(pInfo, event) + logger.V(5).Info("Pod moved to an internal scheduling queue", "pod", klog.KObj(pInfo.Pod), "event", event, "queue", unschedulablePods) + } + return false + } + } + p.backoffQ.add(logger, pInfo, event) + logger.V(5).Info("Pod moved to an internal scheduling queue", "pod", klog.KObj(pInfo.Pod), "event", event, "queue", backoffQ) + return true +} + // Add adds a pod to the active queue. It should be called only when a new pod // is added so there is no chance the pod is already in active/unschedulable/backoff queues func (p *PriorityQueue) Add(logger klog.Logger, pod *v1.Pod) { @@ -641,10 +674,16 @@ func (p *PriorityQueue) activate(logger klog.Logger, pod *v1.Pod) bool { // If the pod doesn't belong to unschedulablePods or backoffQ, don't activate it. // The pod can be already in activeQ. var exists bool - pInfo, exists = p.podBackoffQ.Get(newQueuedPodInfoForLookup(pod)) + pInfo, exists = p.backoffQ.get(newQueuedPodInfoForLookup(pod)) if !exists { return false } + // Delete pod from the backoffQ now to make sure it won't be popped from the backoffQ + // just before moving it to the activeQ + if deleted := p.backoffQ.delete(pInfo); !deleted { + // Pod was popped from the backoffQ in the meantime. Don't activate it. + return false + } } if pInfo == nil { @@ -656,13 +695,6 @@ func (p *PriorityQueue) activate(logger klog.Logger, pod *v1.Pod) bool { return p.moveToActiveQ(logger, pInfo, framework.ForceActivate) } -// isPodBackingoff returns true if a pod is still waiting for its backoff timer. -// If this returns true, the pod should not be re-tried. -func (p *PriorityQueue) isPodBackingoff(podInfo *framework.QueuedPodInfo) bool { - boTime := p.getBackoffTime(podInfo) - return boTime.After(p.clock.Now()) -} - // SchedulingCycle returns current scheduling cycle. func (p *PriorityQueue) SchedulingCycle() int64 { return p.activeQ.schedulingCycle() @@ -712,7 +744,7 @@ func (p *PriorityQueue) determineSchedulingHintForInFlightPod(logger klog.Logger // addUnschedulableIfNotPresentWithoutQueueingHint inserts a pod that cannot be scheduled into // the queue, unless it is already in the queue. Normally, PriorityQueue puts // unschedulable pods in `unschedulablePods`. But if there has been a recent move -// request, then the pod is put in `podBackoffQ`. +// request, then the pod is put in `backoffQ`. // TODO: This function is called only when p.isSchedulingQueueHintEnabled is false, // and this will be removed after SchedulingQueueHint goes to stable and the feature gate is removed. func (p *PriorityQueue) addUnschedulableWithoutQueueingHint(logger klog.Logger, pInfo *framework.QueuedPodInfo, podSchedulingCycle int64) error { @@ -736,13 +768,14 @@ func (p *PriorityQueue) addUnschedulableWithoutQueueingHint(logger klog.Logger, // - No unschedulable plugins are associated with this Pod, // meaning something unusual (a temporal failure on kube-apiserver, etc) happened and this Pod gets moved back to the queue. // In this case, we should retry scheduling it because this Pod may not be retried until the next flush. - p.podBackoffQ.AddOrUpdate(pInfo) - logger.V(5).Info("Pod moved to an internal scheduling queue", "pod", klog.KObj(pod), "event", framework.ScheduleAttemptFailure, "queue", backoffQ) - metrics.SchedulerQueueIncomingPods.WithLabelValues("backoff", framework.ScheduleAttemptFailure).Inc() + if added := p.moveToBackoffQ(logger, pInfo, framework.ScheduleAttemptFailure); added { + if p.isPopFromBackoffQEnabled { + p.activeQ.broadcast() + } + } } else { - p.unschedulablePods.addOrUpdate(pInfo) + p.unschedulablePods.addOrUpdate(pInfo, framework.ScheduleAttemptFailure) logger.V(5).Info("Pod moved to an internal scheduling queue", "pod", klog.KObj(pod), "event", framework.ScheduleAttemptFailure, "queue", unschedulablePods) - metrics.SchedulerQueueIncomingPods.WithLabelValues("unschedulable", framework.ScheduleAttemptFailure).Inc() } return nil @@ -751,7 +784,7 @@ func (p *PriorityQueue) addUnschedulableWithoutQueueingHint(logger klog.Logger, // AddUnschedulableIfNotPresent inserts a pod that cannot be scheduled into // the queue, unless it is already in the queue. Normally, PriorityQueue puts // unschedulable pods in `unschedulablePods`. But if there has been a recent move -// request, then the pod is put in `podBackoffQ`. +// request, then the pod is put in `backoffQ`. func (p *PriorityQueue) AddUnschedulableIfNotPresent(logger klog.Logger, pInfo *framework.QueuedPodInfo, podSchedulingCycle int64) error { p.lock.Lock() defer p.lock.Unlock() @@ -767,7 +800,7 @@ func (p *PriorityQueue) AddUnschedulableIfNotPresent(logger klog.Logger, pInfo * if p.activeQ.has(pInfo) { return fmt.Errorf("Pod %v is already present in the active queue", klog.KObj(pod)) } - if p.podBackoffQ.Has(pInfo) { + if p.backoffQ.has(pInfo) { return fmt.Errorf("Pod %v is already present in the backoff queue", klog.KObj(pod)) } @@ -792,7 +825,7 @@ func (p *PriorityQueue) AddUnschedulableIfNotPresent(logger klog.Logger, pInfo * // In this case, we try to requeue this Pod to activeQ/backoffQ. queue := p.requeuePodViaQueueingHint(logger, pInfo, schedulingHint, framework.ScheduleAttemptFailure) logger.V(3).Info("Pod moved to an internal scheduling queue", "pod", klog.KObj(pod), "event", framework.ScheduleAttemptFailure, "queue", queue, "schedulingCycle", podSchedulingCycle, "hint", schedulingHint, "unschedulable plugins", rejectorPlugins) - if queue == activeQ { + if queue == activeQ || (p.isPopFromBackoffQEnabled && queue == backoffQ) { // When the Pod is moved to activeQ, need to let p.cond know so that the Pod will be pop()ed out. p.activeQ.broadcast() } @@ -805,25 +838,12 @@ func (p *PriorityQueue) flushBackoffQCompleted(logger klog.Logger) { p.lock.Lock() defer p.lock.Unlock() activated := false - for { - pInfo, ok := p.podBackoffQ.Peek() - if !ok || pInfo == nil { - break - } - pod := pInfo.Pod - if p.isPodBackingoff(pInfo) { - break - } - _, err := p.podBackoffQ.Pop() - if err != nil { - logger.Error(err, "Unable to pop pod from backoff queue despite backoff completion", "pod", klog.KObj(pod)) - break - } + podsCompletedBackoff := p.backoffQ.popAllBackoffCompleted(logger) + for _, pInfo := range podsCompletedBackoff { if added := p.moveToActiveQ(logger, pInfo, framework.BackoffComplete); added { activated = true } } - if activated { p.activeQ.broadcast() } @@ -928,10 +948,8 @@ func (p *PriorityQueue) Update(logger klog.Logger, oldPod, newPod *v1.Pod) { } // If the pod is in the backoff queue, update it there. - if pInfo, exists := p.podBackoffQ.Get(oldPodInfo); exists { - _ = pInfo.Update(newPod) + if pInfo := p.backoffQ.update(newPod, oldPodInfo); pInfo != nil { p.UpdateNominatedPod(logger, oldPod, pInfo.PodInfo) - p.podBackoffQ.AddOrUpdate(pInfo) return } } @@ -953,7 +971,7 @@ func (p *PriorityQueue) Update(logger klog.Logger, oldPod, newPod *v1.Pod) { logger.V(5).Info("Pod moved to an internal scheduling queue because the Pod is updated", "pod", klog.KObj(newPod), "event", evt.Label(), "queue", queue) p.unschedulablePods.delete(pInfo.Pod, gated) } - if queue == activeQ { + if queue == activeQ || (p.isPopFromBackoffQEnabled && queue == backoffQ) { p.activeQ.broadcast() break } @@ -961,21 +979,26 @@ func (p *PriorityQueue) Update(logger klog.Logger, oldPod, newPod *v1.Pod) { return } if isPodUpdated(oldPod, newPod) { - if p.isPodBackingoff(pInfo) { - p.podBackoffQ.AddOrUpdate(pInfo) - p.unschedulablePods.delete(pInfo.Pod, gated) - logger.V(5).Info("Pod moved to an internal scheduling queue", "pod", klog.KObj(pInfo.Pod), "event", framework.EventUnscheduledPodUpdate.Label(), "queue", backoffQ) + // Pod might have completed its backoff time while being in unschedulablePods, + // so we should check isPodBackingoff before moving the pod to backoffQ. + if p.backoffQ.isPodBackingoff(pInfo) { + if added := p.moveToBackoffQ(logger, pInfo, framework.EventUnscheduledPodUpdate.Label()); added { + p.unschedulablePods.delete(pInfo.Pod, gated) + if p.isPopFromBackoffQEnabled { + p.activeQ.broadcast() + } + } return } - if added := p.moveToActiveQ(logger, pInfo, framework.BackoffComplete); added { + if added := p.moveToActiveQ(logger, pInfo, framework.EventUnscheduledPodUpdate.Label()); added { p.activeQ.broadcast() } return } // Pod update didn't make it schedulable, keep it in the unschedulable queue. - p.unschedulablePods.addOrUpdate(pInfo) + p.unschedulablePods.addOrUpdate(pInfo, framework.EventUnscheduledPodUpdate.Label()) return } // If pod is not in any of the queues, we put it in the active queue. @@ -992,12 +1015,14 @@ func (p *PriorityQueue) Delete(pod *v1.Pod) { defer p.lock.Unlock() p.DeleteNominatedPodIfExists(pod) pInfo := newQueuedPodInfoForLookup(pod) - if err := p.activeQ.delete(pInfo); err != nil { - // The item was probably not found in the activeQ. - p.podBackoffQ.Delete(pInfo) - if pInfo = p.unschedulablePods.get(pod); pInfo != nil { - p.unschedulablePods.delete(pod, pInfo.Gated) - } + if err := p.activeQ.delete(pInfo); err == nil { + return + } + if deleted := p.backoffQ.delete(pInfo); deleted { + return + } + if pInfo = p.unschedulablePods.get(pod); pInfo != nil { + p.unschedulablePods.delete(pod, pInfo.Gated) } } @@ -1065,28 +1090,24 @@ func (p *PriorityQueue) MoveAllToActiveOrBackoffQueue(logger klog.Logger, event // NOTE: this function assumes lock has been acquired in caller func (p *PriorityQueue) requeuePodViaQueueingHint(logger klog.Logger, pInfo *framework.QueuedPodInfo, strategy queueingStrategy, event string) string { if strategy == queueSkip { - p.unschedulablePods.addOrUpdate(pInfo) - metrics.SchedulerQueueIncomingPods.WithLabelValues("unschedulable", event).Inc() + p.unschedulablePods.addOrUpdate(pInfo, event) return unschedulablePods } - if strategy == queueAfterBackoff && p.isPodBackingoff(pInfo) { - p.podBackoffQ.AddOrUpdate(pInfo) - metrics.SchedulerQueueIncomingPods.WithLabelValues("backoff", event).Inc() - return backoffQ + // Pod might have completed its backoff time while being in unschedulablePods, + // so we should check isPodBackingoff before moving the pod to backoffQ. + if strategy == queueAfterBackoff && p.backoffQ.isPodBackingoff(pInfo) { + if added := p.moveToBackoffQ(logger, pInfo, event); added { + return backoffQ + } + return unschedulablePods } // Reach here if schedulingHint is QueueImmediately, or schedulingHint is Queue but the pod is not backing off. if added := p.moveToActiveQ(logger, pInfo, event); added { return activeQ } - if pInfo.Gated { - // In case the pod is gated, the Pod is pushed back to unschedulable Pods pool in moveToActiveQ. - return unschedulablePods - } - - p.unschedulablePods.addOrUpdate(pInfo) - metrics.SchedulerQueueIncomingPods.WithLabelValues("unschedulable", framework.ScheduleAttemptFailure).Inc() + // Pod is gated. We don't have to push it back to unschedulable queue, because moveToActiveQ should already have done that. return unschedulablePods } @@ -1128,7 +1149,7 @@ func (p *PriorityQueue) movePodsToActiveOrBackoffQueue(logger klog.Logger, podIn p.unschedulablePods.delete(pInfo.Pod, pInfo.Gated) queue := p.requeuePodViaQueueingHint(logger, pInfo, schedulingHint, event.Label()) logger.V(4).Info("Pod moved to an internal scheduling queue", "pod", klog.KObj(pInfo.Pod), "event", event.Label(), "queue", queue, "hint", schedulingHint) - if queue == activeQ { + if queue == activeQ || (p.isPopFromBackoffQEnabled && queue == backoffQ) { activated = true } } @@ -1180,6 +1201,20 @@ func (p *PriorityQueue) PodsInActiveQ() []*v1.Pod { return p.activeQ.list() } +// PodsInBackoffQ returns all the Pods in the backoffQ. +func (p *PriorityQueue) PodsInBackoffQ() []*v1.Pod { + return p.backoffQ.list() +} + +// UnschedulablePods returns all the pods in unschedulable state. +func (p *PriorityQueue) UnschedulablePods() []*v1.Pod { + var result []*v1.Pod + for _, pInfo := range p.unschedulablePods.podInfoMap { + result = append(result, pInfo.Pod) + } + return result +} + var pendingPodsSummary = "activeQ:%v; backoffQ:%v; unschedulablePods:%v" // GetPod searches for a pod in the activeQ, backoffQ, and unschedulablePods. @@ -1197,7 +1232,7 @@ func (p *PriorityQueue) GetPod(name, namespace string) (pInfo *framework.QueuedP }, }, } - if pInfo, ok = p.podBackoffQ.Get(pInfoLookup); ok { + if pInfo, ok = p.backoffQ.get(pInfoLookup); ok { return pInfo, true } if pInfo = p.unschedulablePods.get(pInfoLookup.Pod); pInfo != nil { @@ -1205,7 +1240,7 @@ func (p *PriorityQueue) GetPod(name, namespace string) (pInfo *framework.QueuedP } p.activeQ.underRLock(func(unlockedActiveQ unlockedActiveQueueReader) { - pInfo, ok = unlockedActiveQ.Get(pInfoLookup) + pInfo, ok = unlockedActiveQ.get(pInfoLookup) }) return } @@ -1216,15 +1251,15 @@ func (p *PriorityQueue) GetPod(name, namespace string) (pInfo *framework.QueuedP func (p *PriorityQueue) PendingPods() ([]*v1.Pod, string) { p.lock.RLock() defer p.lock.RUnlock() - result := p.activeQ.list() + result := p.PodsInActiveQ() activeQLen := len(result) - for _, pInfo := range p.podBackoffQ.List() { - result = append(result, pInfo.Pod) - } + backoffQPods := p.PodsInBackoffQ() + backoffQLen := len(backoffQPods) + result = append(result, backoffQPods...) for _, pInfo := range p.unschedulablePods.podInfoMap { result = append(result, pInfo.Pod) } - return result, fmt.Sprintf(pendingPodsSummary, activeQLen, p.podBackoffQ.Len(), len(p.unschedulablePods.podInfoMap)) + return result, fmt.Sprintf(pendingPodsSummary, activeQLen, backoffQLen, len(p.unschedulablePods.podInfoMap)) } // Note: this function assumes the caller locks both p.lock.RLock and p.activeQ.getLock().RLock. @@ -1232,7 +1267,7 @@ func (p *PriorityQueue) nominatedPodToInfo(np podRef, unlockedActiveQ unlockedAc pod := np.toPod() pInfoLookup := newQueuedPodInfoForLookup(pod) - queuedPodInfo, exists := unlockedActiveQ.Get(pInfoLookup) + queuedPodInfo, exists := unlockedActiveQ.get(pInfoLookup) if exists { return queuedPodInfo.PodInfo } @@ -1242,7 +1277,7 @@ func (p *PriorityQueue) nominatedPodToInfo(np podRef, unlockedActiveQ unlockedAc return queuedPodInfo.PodInfo } - queuedPodInfo, exists = p.podBackoffQ.Get(pInfoLookup) + queuedPodInfo, exists = p.backoffQ.get(pInfoLookup) if exists { return queuedPodInfo.PodInfo } @@ -1276,12 +1311,6 @@ func (p *PriorityQueue) NominatedPodsForNode(nodeName string) []*framework.PodIn return pods } -func (p *PriorityQueue) podsCompareBackoffCompleted(pInfo1, pInfo2 *framework.QueuedPodInfo) bool { - bo1 := p.getBackoffTime(pInfo1) - bo2 := p.getBackoffTime(pInfo2) - return bo1.Before(bo2) -} - // newQueuedPodInfo builds a QueuedPodInfo object. func (p *PriorityQueue) newQueuedPodInfo(pod *v1.Pod, plugins ...string) *framework.QueuedPodInfo { now := p.clock.Now() @@ -1296,33 +1325,6 @@ func (p *PriorityQueue) newQueuedPodInfo(pod *v1.Pod, plugins ...string) *framew } } -// getBackoffTime returns the time that podInfo completes backoff -func (p *PriorityQueue) getBackoffTime(podInfo *framework.QueuedPodInfo) time.Time { - duration := p.calculateBackoffDuration(podInfo) - backoffTime := podInfo.Timestamp.Add(duration) - return backoffTime -} - -// calculateBackoffDuration is a helper function for calculating the backoffDuration -// based on the number of attempts the pod has made. -func (p *PriorityQueue) calculateBackoffDuration(podInfo *framework.QueuedPodInfo) time.Duration { - if podInfo.Attempts == 0 { - // When the Pod hasn't experienced any scheduling attempts, - // they aren't obliged to get a backoff penalty at all. - return 0 - } - - duration := p.podInitialBackoffDuration - for i := 1; i < podInfo.Attempts; i++ { - // Use subtraction instead of addition or multiplication to avoid overflow. - if duration > p.podMaxBackoffDuration-duration { - return p.podMaxBackoffDuration - } - duration += duration - } - return duration -} - // UnschedulablePods holds pods that cannot be scheduled. This data structure // is used to implement unschedulablePods. type UnschedulablePods struct { @@ -1335,7 +1337,8 @@ type UnschedulablePods struct { } // addOrUpdate adds a pod to the unschedulable podInfoMap. -func (u *UnschedulablePods) addOrUpdate(pInfo *framework.QueuedPodInfo) { +// The event should show which event triggered the addition and is used for the metric recording. +func (u *UnschedulablePods) addOrUpdate(pInfo *framework.QueuedPodInfo, event string) { podID := u.keyFunc(pInfo.Pod) if _, exists := u.podInfoMap[podID]; !exists { if pInfo.Gated && u.gatedRecorder != nil { @@ -1343,6 +1346,7 @@ func (u *UnschedulablePods) addOrUpdate(pInfo *framework.QueuedPodInfo) { } else if !pInfo.Gated && u.unschedulableRecorder != nil { u.unschedulableRecorder.Inc() } + metrics.SchedulerQueueIncomingPods.WithLabelValues("unschedulable", event).Inc() } u.podInfoMap[podID] = pInfo } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/eventhandlers.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/eventhandlers.go index 3b009d76f..09c4200ff 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/eventhandlers.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/eventhandlers.go @@ -33,6 +33,7 @@ import ( "k8s.io/client-go/tools/cache" corev1helpers "k8s.io/component-helpers/scheduling/corev1" corev1nodeaffinity "k8s.io/component-helpers/scheduling/corev1/nodeaffinity" + resourceslicetracker "k8s.io/dynamic-resource-allocation/resourceslice/tracker" "k8s.io/klog/v2" "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/scheduler/backend/queue" @@ -160,6 +161,16 @@ func (sched *Scheduler) updatePodInSchedulingQueue(oldObj, newObj interface{}) { logger.V(4).Info("Update event for unscheduled pod", "pod", klog.KObj(newPod)) sched.SchedulingQueue.Update(logger, oldPod, newPod) + if hasNominatedNodeNameChanged(oldPod, newPod) { + // Nominated node changed in pod, so we need to treat it as if the pod was deleted from the old nominated node, + // because the scheduler treats such a pod as if it was already assigned when scheduling lower or equal priority pods. + sched.SchedulingQueue.MoveAllToActiveOrBackoffQueue(logger, framework.EventAssignedPodDelete, oldPod, nil, getLEPriorityPreCheck(corev1helpers.PodPriority(oldPod))) + } +} + +// hasNominatedNodeNameChanged returns true when nominated node name has existed but changed. +func hasNominatedNodeNameChanged(oldPod, newPod *v1.Pod) bool { + return len(oldPod.Status.NominatedNodeName) > 0 && oldPod.Status.NominatedNodeName != newPod.Status.NominatedNodeName } func (sched *Scheduler) deletePodFromSchedulingQueue(obj interface{}) { @@ -195,8 +206,21 @@ func (sched *Scheduler) deletePodFromSchedulingQueue(obj interface{}) { // If a waiting pod is rejected, it indicates it's previously assumed and we're // removing it from the scheduler cache. In this case, signal a AssignedPodDelete // event to immediately retry some unscheduled Pods. + // Similarly when a pod that had nominated node is deleted, it can unblock scheduling of other pods, + // because the lower or equal priority pods treat such a pod as if it was assigned. if fwk.RejectWaitingPod(pod.UID) { sched.SchedulingQueue.MoveAllToActiveOrBackoffQueue(logger, framework.EventAssignedPodDelete, pod, nil, nil) + } else if pod.Status.NominatedNodeName != "" { + // Note that a nominated pod can fall into `RejectWaitingPod` case as well, + // but in that case the `MoveAllToActiveOrBackoffQueue` already covered lower priority pods. + sched.SchedulingQueue.MoveAllToActiveOrBackoffQueue(logger, framework.EventAssignedPodDelete, pod, nil, getLEPriorityPreCheck(corev1helpers.PodPriority(pod))) + } +} + +// getLEPriorityPreCheck is a PreEnqueueCheck function that selects only lower or equal priority pods. +func getLEPriorityPreCheck(priority int32) queue.PreEnqueueCheck { + return func(pod *v1.Pod) bool { + return corev1helpers.PodPriority(pod) <= priority } } @@ -343,6 +367,7 @@ func addAllEventHandlers( informerFactory informers.SharedInformerFactory, dynInformerFactory dynamicinformer.DynamicSharedInformerFactory, resourceClaimCache *assumecache.AssumeCache, + resourceSliceTracker *resourceslicetracker.Tracker, gvkMap map[framework.EventResource]framework.ActionType, ) error { var ( @@ -532,7 +557,7 @@ func addAllEventHandlers( } case framework.ResourceSlice: if utilfeature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation) { - if handlerRegistration, err = informerFactory.Resource().V1beta1().ResourceSlices().Informer().AddEventHandler( + if handlerRegistration, err = resourceSliceTracker.AddEventHandler( buildEvtResHandler(at, framework.ResourceSlice), ); err != nil { return err diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/events.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/events.go index 910c254c5..1fe1b0b97 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/events.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/events.go @@ -31,6 +31,8 @@ const ( ScheduleAttemptFailure = "ScheduleAttemptFailure" // BackoffComplete is the event when a pod finishes backoff. BackoffComplete = "BackoffComplete" + // PopFromBackoffQ is the event when a pod is popped from backoffQ when activeQ is empty. + PopFromBackoffQ = "PopFromBackoffQ" // ForceActivate is the event when a pod is moved from unschedulablePods/backoffQ // to activeQ. Usually it's triggered by plugin implementations. ForceActivate = "ForceActivate" @@ -130,7 +132,7 @@ func extractPodTolerationChange(newPod *v1.Pod, oldPod *v1.Pod) ActionType { // Due to API validation, the user can add, but cannot modify or remove tolerations. // So, it's enough to just check the length of tolerations to notice the update. // And, any updates in tolerations could make Pod schedulable. - return UpdatePodTolerations + return UpdatePodToleration } return none diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/interface.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/interface.go index 433de93f2..10ee4203d 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/interface.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/interface.go @@ -26,8 +26,8 @@ import ( "sync" "time" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" + "github.com/google/go-cmp/cmp" //nolint:depguard + "github.com/google/go-cmp/cmp/cmpopts" //nolint:depguard v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" @@ -227,8 +227,8 @@ const ( // Pending means that the scheduling process is finished successfully, // but the plugin wants to stop the scheduling cycle/binding cycle here. // - // For example, the DRA plugin sometimes needs to wait for the external device driver - // to provision the resource for the Pod. + // For example, if your plugin has to notify the scheduling result to an external component, + // and wait for it to complete something **before** binding. // It's different from when to return Unschedulable/UnschedulableAndUnresolvable, // because in this case, the scheduler decides where the Pod can go successfully, // but we need to wait for the external component to do something based on that scheduling result. @@ -609,7 +609,7 @@ type ScorePlugin interface { // Score is called on each filtered node. It must return success and an integer // indicating the rank of the node. All scoring plugins must return success or // the pod will be rejected. - Score(ctx context.Context, state *CycleState, p *v1.Pod, nodeName string) (int64, *Status) + Score(ctx context.Context, state *CycleState, p *v1.Pod, nodeInfo *NodeInfo) (int64, *Status) // ScoreExtensions returns a ScoreExtensions interface if it implements one, or nil if does not. ScoreExtensions() ScoreExtensions diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/listers.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/listers.go index f6e04dfa8..e56266ba1 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/listers.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/listers.go @@ -50,8 +50,13 @@ type SharedLister interface { // ResourceSliceLister can be used to obtain ResourceSlices. type ResourceSliceLister interface { - // List returns a list of all ResourceSlices. - List() ([]*resourceapi.ResourceSlice, error) + // ListWithDeviceTaintRules returns a list of all ResourceSlices with DeviceTaintRules applied + // if the DRADeviceTaints feature is enabled, otherwise without them. + // + // k8s.io/dynamic-resource-allocation/resourceslice/tracker provides an implementation + // of the necessary logic. That tracker can be instantiated as a replacement for + // a normal ResourceSlice informer and provides a ListPatchedResourceSlices method. + ListWithDeviceTaintRules() ([]*resourceapi.ResourceSlice, error) } // DeviceClassLister can be used to obtain DeviceClasses. diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/parallelize/parallelism.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/parallelize/parallelism.go index 94441b97d..2ac14289a 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/parallelize/parallelism.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/parallelize/parallelism.go @@ -51,15 +51,28 @@ func chunkSizeFor(n, parallelism int) int { return s } +// numWorkersForChunkSize returns number of workers (goroutines) +// that will be created in workqueue.ParallelizeUntil +// for given parallelism, pieces and chunkSize values. +func numWorkersForChunkSize(parallelism, pieces, chunkSize int) int { + chunks := (pieces + chunkSize - 1) / chunkSize + if chunks < parallelism { + return chunks + } + return parallelism +} + // Until is a wrapper around workqueue.ParallelizeUntil to use in scheduling algorithms. // A given operation will be a label that is recorded in the goroutine metric. func (p Parallelizer) Until(ctx context.Context, pieces int, doWorkPiece workqueue.DoWorkPieceFunc, operation string) { - goroutinesMetric := metrics.Goroutines.WithLabelValues(operation) - withMetrics := func(piece int) { - goroutinesMetric.Inc() - doWorkPiece(piece) - goroutinesMetric.Dec() - } + chunkSize := chunkSizeFor(pieces, p.parallelism) + workers := numWorkersForChunkSize(p.parallelism, pieces, chunkSize) - workqueue.ParallelizeUntil(ctx, p.parallelism, pieces, withMetrics, workqueue.WithChunkSize(chunkSizeFor(pieces, p.parallelism))) + goroutinesMetric := metrics.Goroutines.WithLabelValues(operation) + // Calling single Add with workers' count is more efficient than calling Inc or Dec per each work piece. + // This approach improves performance of some plugins (affinity, topology spreading) as well as preemption. + goroutinesMetric.Add(float64(workers)) + defer goroutinesMetric.Add(float64(-workers)) + + workqueue.ParallelizeUntil(ctx, p.parallelism, pieces, doWorkPiece, workqueue.WithChunkSize(chunkSize)) } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go index c9144cb17..c36528530 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go @@ -136,10 +136,14 @@ func (pl *DefaultPreemption) calculateNumCandidates(numNodes int32) int32 { return n } +// getOffsetRand is a dedicated random source for GetOffsetAndNumCandidates calls. +// It defaults to rand.Int31n, but is a package variable so it can be overridden to make unit tests deterministic. +var getOffsetRand = rand.Int31n + // GetOffsetAndNumCandidates chooses a random offset and calculates the number // of candidates that should be shortlisted for dry running preemption. func (pl *DefaultPreemption) GetOffsetAndNumCandidates(numNodes int32) (int32, int32) { - return rand.Int31n(numNodes), pl.calculateNumCandidates(numNodes) + return getOffsetRand(numNodes), pl.calculateNumCandidates(numNodes) } // This function is not applicable for out-of-tree preemption plugins that exercise diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/dynamicresources/dra_manager.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/dynamicresources/dra_manager.go index db10e126a..47d3d5de4 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/dynamicresources/dra_manager.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/dynamicresources/dra_manager.go @@ -27,6 +27,7 @@ import ( "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/informers" resourcelisters "k8s.io/client-go/listers/resource/v1beta1" + resourceslicetracker "k8s.io/dynamic-resource-allocation/resourceslice/tracker" "k8s.io/dynamic-resource-allocation/structured" "k8s.io/klog/v2" "k8s.io/kubernetes/pkg/scheduler/framework" @@ -44,8 +45,9 @@ type DefaultDRAManager struct { deviceClassLister *deviceClassLister } -func NewDRAManager(ctx context.Context, claimsCache *assumecache.AssumeCache, informerFactory informers.SharedInformerFactory) *DefaultDRAManager { +func NewDRAManager(ctx context.Context, claimsCache *assumecache.AssumeCache, resourceSliceTracker *resourceslicetracker.Tracker, informerFactory informers.SharedInformerFactory) *DefaultDRAManager { logger := klog.FromContext(ctx) + manager := &DefaultDRAManager{ resourceClaimTracker: &claimTracker{ cache: claimsCache, @@ -53,7 +55,7 @@ func NewDRAManager(ctx context.Context, claimsCache *assumecache.AssumeCache, in allocatedDevices: newAllocatedDevices(logger), logger: logger, }, - resourceSliceLister: &resourceSliceLister{sliceLister: informerFactory.Resource().V1beta1().ResourceSlices().Lister()}, + resourceSliceLister: &resourceSliceLister{tracker: resourceSliceTracker}, deviceClassLister: &deviceClassLister{classLister: informerFactory.Resource().V1beta1().DeviceClasses().Lister()}, } @@ -79,11 +81,11 @@ func (s *DefaultDRAManager) DeviceClasses() framework.DeviceClassLister { var _ framework.ResourceSliceLister = &resourceSliceLister{} type resourceSliceLister struct { - sliceLister resourcelisters.ResourceSliceLister + tracker *resourceslicetracker.Tracker } -func (l *resourceSliceLister) List() ([]*resourceapi.ResourceSlice, error) { - return l.sliceLister.List(labels.Everything()) +func (l *resourceSliceLister) ListWithDeviceTaintRules() ([]*resourceapi.ResourceSlice, error) { + return l.tracker.ListPatchedResourceSlices() } var _ framework.DeviceClassLister = &deviceClassLister{} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go index 886a9b9c8..dd1adfc5a 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go @@ -21,9 +21,10 @@ import ( "errors" "fmt" "slices" + "strings" "sync" - "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp" //nolint:depguard v1 "k8s.io/api/core/v1" resourceapi "k8s.io/api/resource/v1beta1" @@ -101,9 +102,12 @@ type informationForClaim struct { // DynamicResources is a plugin that ensures that ResourceClaims are allocated. type DynamicResources struct { - enabled bool - enableAdminAccess bool - enableSchedulingQueueHint bool + enabled bool + enableAdminAccess bool + enablePrioritizedList bool + enableSchedulingQueueHint bool + enablePartitionableDevices bool + enableDeviceTaints bool fh framework.Handle clientset kubernetes.Interface @@ -119,9 +123,12 @@ func New(ctx context.Context, plArgs runtime.Object, fh framework.Handle, fts fe } pl := &DynamicResources{ - enabled: true, - enableAdminAccess: fts.EnableDRAAdminAccess, - enableSchedulingQueueHint: fts.EnableSchedulingQueueHint, + enabled: true, + enableAdminAccess: fts.EnableDRAAdminAccess, + enableDeviceTaints: fts.EnableDRADeviceTaints, + enablePrioritizedList: fts.EnableDRAPrioritizedList, + enableSchedulingQueueHint: fts.EnableSchedulingQueueHint, + enablePartitionableDevices: fts.EnablePartitionableDevices, fh: fh, clientset: fh.ClientSet(), @@ -176,7 +183,7 @@ func (pl *DynamicResources) EventsToRegister(_ context.Context) ([]framework.Clu // A pod might be waiting for a class to get created or modified. {Event: framework.ClusterEvent{Resource: framework.DeviceClass, ActionType: framework.Add | framework.Update}}, // Adding or updating a ResourceSlice might make a pod schedulable because new resources became available. - {Event: framework.ClusterEvent{Resource: framework.ResourceSlice, ActionType: framework.Add | framework.Update}, QueueingHintFn: pl.isSchedulableAfterResourceSliceChange}, + {Event: framework.ClusterEvent{Resource: framework.ResourceSlice, ActionType: framework.Add | framework.Update}}, } return events, nil @@ -288,38 +295,6 @@ func (pl *DynamicResources) isSchedulableAfterPodChange(logger klog.Logger, pod return framework.Queue, nil } -// isSchedulableAfterResourceSliceChange is invoked for add and update slice events reported by -// an informer. Such changes can make an unschedulable pod schedulable when the pod requests a device -// and the change adds a suitable device. -// -// For the sake of faster execution and avoiding code duplication, isSchedulableAfterResourceSliceChange -// only checks whether the pod uses claims. All of the more detailed checks are done in the scheduling -// attempt. -// -// The delete claim event will not invoke it, so newObj will never be nil. -func (pl *DynamicResources) isSchedulableAfterResourceSliceChange(logger klog.Logger, pod *v1.Pod, oldObj, newObj interface{}) (framework.QueueingHint, error) { - _, modifiedSlice, err := schedutil.As[*resourceapi.ResourceSlice](oldObj, newObj) - if err != nil { - // Shouldn't happen. - return framework.Queue, fmt.Errorf("unexpected object in isSchedulableAfterResourceSliceChange: %w", err) - } - - if err := pl.foreachPodResourceClaim(pod, nil); err != nil { - // This is not an unexpected error: we know that - // foreachPodResourceClaim only returns errors for "not - // schedulable". - logger.V(6).Info("pod is not schedulable after resource slice change", "pod", klog.KObj(pod), "resourceSlice", klog.KObj(modifiedSlice), "reason", err.Error()) - return framework.QueueSkip, nil - } - - // We could check what got changed in the slice, but right now that's likely to be - // about the spec (there's no status yet...). - // We could check whether all claims use classic DRA, but that doesn't seem worth it. - // Let's assume that changing the slice may make the pod schedulable. - logger.V(5).Info("ResourceSlice change might make pod schedulable", "pod", klog.KObj(pod), "resourceSlice", klog.KObj(modifiedSlice)) - return framework.Queue, nil -} - // podResourceClaims returns the ResourceClaims for all pod.Spec.PodResourceClaims. func (pl *DynamicResources) podResourceClaims(pod *v1.Pod) ([]*resourceapi.ResourceClaim, error) { claims := make([]*resourceapi.ResourceClaim, 0, len(pod.Spec.ResourceClaims)) @@ -437,20 +412,22 @@ func (pl *DynamicResources) PreFilter(ctx context.Context, state *framework.Cycl // initial set of potential nodes before we ask the // driver(s) for information about the specific pod. for _, request := range claim.Spec.Devices.Requests { - if request.DeviceClassName == "" { - return nil, statusError(logger, fmt.Errorf("request %s: unsupported request type", request.Name)) - } - - _, err := pl.draManager.DeviceClasses().Get(request.DeviceClassName) - if err != nil { - // If the class cannot be retrieved, allocation cannot proceed. - if apierrors.IsNotFound(err) { - // Here we mark the pod as "unschedulable", so it'll sleep in - // the unscheduleable queue until a DeviceClass event occurs. - return nil, statusUnschedulable(logger, fmt.Sprintf("request %s: device class %s does not exist", request.Name, request.DeviceClassName)) + // The requirements differ depending on whether the request has a list of + // alternative subrequests defined in the firstAvailable field. + if len(request.FirstAvailable) == 0 { + if status := pl.validateDeviceClass(logger, request.DeviceClassName, request.Name); status != nil { + return nil, status + } + } else { + if !pl.enablePrioritizedList { + return nil, statusUnschedulable(logger, fmt.Sprintf("resource claim %s, request %s: has subrequests, but the DRAPrioritizedList feature is disabled", klog.KObj(claim), request.Name)) + } + for _, subRequest := range request.FirstAvailable { + qualRequestName := strings.Join([]string{request.Name, subRequest.Name}, "/") + if status := pl.validateDeviceClass(logger, subRequest.DeviceClassName, qualRequestName); status != nil { + return nil, status + } } - // Other error, retry with backoff. - return nil, statusError(logger, fmt.Errorf("request %s: look up device class: %w", request.Name, err)) } } } @@ -475,11 +452,17 @@ func (pl *DynamicResources) PreFilter(ctx context.Context, state *framework.Cycl if err != nil { return nil, statusError(logger, err) } - slices, err := pl.draManager.ResourceSlices().List() + slices, err := pl.draManager.ResourceSlices().ListWithDeviceTaintRules() if err != nil { return nil, statusError(logger, err) } - allocator, err := structured.NewAllocator(ctx, pl.enableAdminAccess, allocateClaims, allAllocatedDevices, pl.draManager.DeviceClasses(), slices, pl.celCache) + features := structured.Features{ + AdminAccess: pl.enableAdminAccess, + PrioritizedList: pl.enablePrioritizedList, + PartitionableDevices: pl.enablePartitionableDevices, + DeviceTaints: pl.enableDeviceTaints, + } + allocator, err := structured.NewAllocator(ctx, features, allocateClaims, allAllocatedDevices, pl.draManager.DeviceClasses(), slices, pl.celCache) if err != nil { return nil, statusError(logger, err) } @@ -491,6 +474,23 @@ func (pl *DynamicResources) PreFilter(ctx context.Context, state *framework.Cycl return nil, nil } +func (pl *DynamicResources) validateDeviceClass(logger klog.Logger, deviceClassName, requestName string) *framework.Status { + if deviceClassName == "" { + return statusError(logger, fmt.Errorf("request %s: unsupported request type", requestName)) + } + + _, err := pl.draManager.DeviceClasses().Get(deviceClassName) + if err != nil { + // If the class cannot be retrieved, allocation cannot proceed. + if apierrors.IsNotFound(err) { + // Here we mark the pod as "unschedulable", so it'll sleep in + // the unscheduleable queue until a DeviceClass event occurs. + return statusUnschedulable(logger, fmt.Sprintf("request %s: device class %s does not exist", requestName, deviceClassName)) + } + } + return nil +} + // PreFilterExtensions returns prefilter extensions, pod add and remove. func (pl *DynamicResources) PreFilterExtensions() framework.PreFilterExtensions { return nil @@ -608,6 +608,11 @@ func (pl *DynamicResources) PostFilter(ctx context.Context, cs *framework.CycleS if !pl.enabled { return nil, framework.NewStatus(framework.Unschedulable, "plugin disabled") } + // If a Pod doesn't have any resource claims attached to it, there is no need for further processing. + // Thus we provide a fast path for this case to avoid unnecessary computations. + if len(pod.Spec.ResourceClaims) == 0 { + return nil, framework.NewStatus(framework.Unschedulable) + } logger := klog.FromContext(ctx) state, err := getStateData(cs) if err != nil { diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/feature/feature.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/feature/feature.go index d4c5cc62d..7e7f1a1b8 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/feature/feature.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/feature/feature.go @@ -20,9 +20,12 @@ package feature // This struct allows us to break the dependency of the plugins on // the internal k8s features pkg. type Features struct { + EnableDRAPrioritizedList bool EnableDRAAdminAccess bool + EnableDRADeviceTaints bool EnableDynamicResourceAllocation bool - EnableVolumeCapacityPriority bool + EnableVolumeAttributesClass bool + EnableCSIMigrationPortworx bool EnableNodeInclusionPolicyInPodTopologySpread bool EnableMatchLabelKeysInPodTopologySpread bool EnableInPlacePodVerticalScaling bool @@ -30,4 +33,6 @@ type Features struct { EnableSchedulingQueueHint bool EnableAsyncPreemption bool EnablePodLevelResources bool + EnablePartitionableDevices bool + EnableStorageCapacityScoring bool } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/imagelocality/image_locality.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/imagelocality/image_locality.go index 3b0a77229..694d457c7 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/imagelocality/image_locality.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/imagelocality/image_locality.go @@ -18,7 +18,6 @@ package imagelocality import ( "context" - "fmt" "strings" v1 "k8s.io/api/core/v1" @@ -51,12 +50,7 @@ func (pl *ImageLocality) Name() string { } // Score invoked at the score extension point. -func (pl *ImageLocality) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) { - nodeInfo, err := pl.handle.SnapshotSharedLister().NodeInfos().Get(nodeName) - if err != nil { - return 0, framework.AsStatus(fmt.Errorf("getting node %q from Snapshot: %w", nodeName, err)) - } - +func (pl *ImageLocality) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) (int64, *framework.Status) { nodeInfos, err := pl.handle.SnapshotSharedLister().NodeInfos().List() if err != nil { return 0, framework.AsStatus(err) diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go index d65524119..6d5106f02 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go @@ -89,15 +89,21 @@ type topologyPair struct { } type topologyToMatchedTermCount map[topologyPair]int64 -func (m topologyToMatchedTermCount) append(toAppend topologyToMatchedTermCount) { - for pair := range toAppend { - m[pair] += toAppend[pair] +func (m topologyToMatchedTermCount) merge(toMerge topologyToMatchedTermCount) { + for pair, count := range toMerge { + m[pair] += count + } +} + +func (m topologyToMatchedTermCount) mergeWithList(toMerge topologyToMatchedTermCountList) { + for _, tmtc := range toMerge { + m[tmtc.topologyPair] += tmtc.count } } func (m topologyToMatchedTermCount) clone() topologyToMatchedTermCount { copy := make(topologyToMatchedTermCount, len(m)) - copy.append(m) + copy.merge(m) return copy } @@ -134,6 +140,48 @@ func (m topologyToMatchedTermCount) updateWithAntiAffinityTerms(terms []framewor } } +// topologyToMatchedTermCountList is a slice equivalent of topologyToMatchedTermCount map. +// The use of slice improves the performance of PreFilter, +// especially due to faster iteration when merging than with topologyToMatchedTermCount. +type topologyToMatchedTermCountList []topologyPairCount + +type topologyPairCount struct { + topologyPair topologyPair + count int64 +} + +func (m *topologyToMatchedTermCountList) append(node *v1.Node, tk string, value int64) { + if tv, ok := node.Labels[tk]; ok { + pair := topologyPair{key: tk, value: tv} + *m = append(*m, topologyPairCount{ + topologyPair: pair, + count: value, + }) + } +} + +// appends the specified value to the topologyToMatchedTermCountList +// for each affinity term if "targetPod" matches ALL terms. +func (m *topologyToMatchedTermCountList) appendWithAffinityTerms( + terms []framework.AffinityTerm, pod *v1.Pod, node *v1.Node, value int64) { + if podMatchesAllAffinityTerms(terms, pod) { + for _, t := range terms { + m.append(node, t.TopologyKey, value) + } + } +} + +// appends the specified value to the topologyToMatchedTermCountList +// for each anti-affinity term matched the target pod. +func (m *topologyToMatchedTermCountList) appendWithAntiAffinityTerms(terms []framework.AffinityTerm, pod *v1.Pod, nsLabels labels.Set, node *v1.Node, value int64) { + // Check anti-affinity terms. + for _, t := range terms { + if t.Matches(pod, nsLabels) { + m.append(node, t.TopologyKey, value) + } + } +} + // returns true IFF the given pod matches all the given terms. func podMatchesAllAffinityTerms(terms []framework.AffinityTerm, pod *v1.Pod) bool { if len(terms) == 0 { @@ -153,25 +201,26 @@ func podMatchesAllAffinityTerms(terms []framework.AffinityTerm, pod *v1.Pod) boo // 1. Whether it has PodAntiAffinity // 2. Whether any AntiAffinityTerm matches the incoming pod func (pl *InterPodAffinity) getExistingAntiAffinityCounts(ctx context.Context, pod *v1.Pod, nsLabels labels.Set, nodes []*framework.NodeInfo) topologyToMatchedTermCount { - topoMaps := make([]topologyToMatchedTermCount, len(nodes)) + antiAffinityCountsList := make([]topologyToMatchedTermCountList, len(nodes)) index := int32(-1) processNode := func(i int) { nodeInfo := nodes[i] node := nodeInfo.Node() - topoMap := make(topologyToMatchedTermCount) + antiAffinityCounts := make(topologyToMatchedTermCountList, 0) for _, existingPod := range nodeInfo.PodsWithRequiredAntiAffinity { - topoMap.updateWithAntiAffinityTerms(existingPod.RequiredAntiAffinityTerms, pod, nsLabels, node, 1) + antiAffinityCounts.appendWithAntiAffinityTerms(existingPod.RequiredAntiAffinityTerms, pod, nsLabels, node, 1) } - if len(topoMap) != 0 { - topoMaps[atomic.AddInt32(&index, 1)] = topoMap + if len(antiAffinityCounts) != 0 { + antiAffinityCountsList[atomic.AddInt32(&index, 1)] = antiAffinityCounts } } pl.parallelizer.Until(ctx, len(nodes), processNode, pl.Name()) result := make(topologyToMatchedTermCount) + // Traditional for loop is slightly faster in this case than its "for range" equivalent. for i := 0; i <= int(index); i++ { - result.append(topoMaps[i]) + result.mergeWithList(antiAffinityCountsList[i]) } return result @@ -188,20 +237,20 @@ func (pl *InterPodAffinity) getIncomingAffinityAntiAffinityCounts(ctx context.Co return affinityCounts, antiAffinityCounts } - affinityCountsList := make([]topologyToMatchedTermCount, len(allNodes)) - antiAffinityCountsList := make([]topologyToMatchedTermCount, len(allNodes)) + affinityCountsList := make([]topologyToMatchedTermCountList, len(allNodes)) + antiAffinityCountsList := make([]topologyToMatchedTermCountList, len(allNodes)) index := int32(-1) processNode := func(i int) { nodeInfo := allNodes[i] node := nodeInfo.Node() - affinity := make(topologyToMatchedTermCount) - antiAffinity := make(topologyToMatchedTermCount) + affinity := make(topologyToMatchedTermCountList, 0) + antiAffinity := make(topologyToMatchedTermCountList, 0) for _, existingPod := range nodeInfo.Pods { - affinity.updateWithAffinityTerms(podInfo.RequiredAffinityTerms, existingPod.Pod, node, 1) + affinity.appendWithAffinityTerms(podInfo.RequiredAffinityTerms, existingPod.Pod, node, 1) // The incoming pod's terms have the namespaceSelector merged into the namespaces, and so // here we don't lookup the existing pod's namespace labels, hence passing nil for nsLabels. - antiAffinity.updateWithAntiAffinityTerms(podInfo.RequiredAntiAffinityTerms, existingPod.Pod, nil, node, 1) + antiAffinity.appendWithAntiAffinityTerms(podInfo.RequiredAntiAffinityTerms, existingPod.Pod, nil, node, 1) } if len(affinity) > 0 || len(antiAffinity) > 0 { @@ -213,8 +262,8 @@ func (pl *InterPodAffinity) getIncomingAffinityAntiAffinityCounts(ctx context.Co pl.parallelizer.Until(ctx, len(allNodes), processNode, pl.Name()) for i := 0; i <= int(index); i++ { - affinityCounts.append(affinityCountsList[i]) - antiAffinityCounts.append(antiAffinityCountsList[i]) + affinityCounts.mergeWithList(affinityCountsList[i]) + antiAffinityCounts.mergeWithList(antiAffinityCountsList[i]) } return affinityCounts, antiAffinityCounts diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/plugin.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/plugin.go index f29994d3d..78d6d65e8 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/plugin.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/plugin.go @@ -211,7 +211,7 @@ func (pl *InterPodAffinity) isSchedulableAfterPodChange(logger klog.Logger, pod } func (pl *InterPodAffinity) isSchedulableAfterNodeChange(logger klog.Logger, pod *v1.Pod, oldObj, newObj interface{}) (framework.QueueingHint, error) { - _, modifiedNode, err := util.As[*v1.Node](oldObj, newObj) + originalNode, modifiedNode, err := util.As[*v1.Node](oldObj, newObj) if err != nil { return framework.Queue, err } @@ -221,11 +221,35 @@ func (pl *InterPodAffinity) isSchedulableAfterNodeChange(logger klog.Logger, pod return framework.Queue, err } + // When queuing this Pod: + // - 1. A new node is added with the pod affinity topologyKey, the pod may become schedulable. + // - 2. The original node does not have the pod affinity topologyKey but the modified node does, the pod may become schedulable. + // - 3. Both the original and modified nodes have the pod affinity topologyKey and they differ, the pod may become schedulable. for _, term := range terms { - if _, ok := modifiedNode.Labels[term.TopologyKey]; ok { - logger.V(5).Info("a node with matched pod affinity topologyKey was added/updated and it may make pod schedulable", + if originalNode == nil { + if _, ok := modifiedNode.Labels[term.TopologyKey]; ok { + // Case 1: A new node is added with the pod affinity topologyKey. + logger.V(5).Info("A node with a matched pod affinity topologyKey was added and it may make the pod schedulable", + "pod", klog.KObj(pod), "node", klog.KObj(modifiedNode)) + return framework.Queue, nil + } + continue + } + originalTopologyValue, originalHasKey := originalNode.Labels[term.TopologyKey] + modifiedTopologyValue, modifiedHasKey := modifiedNode.Labels[term.TopologyKey] + + if !originalHasKey && modifiedHasKey { + // Case 2: Original node does not have the pod affinity topologyKey, but the modified node does. + logger.V(5).Info("A node got updated to have the topology key of pod affinity, which may make the pod schedulable", "pod", klog.KObj(pod), "node", klog.KObj(modifiedNode)) - return framework.Queue, err + return framework.Queue, nil + } + + if originalHasKey && modifiedHasKey && (originalTopologyValue != modifiedTopologyValue) { + // Case 3: Both nodes have the pod affinity topologyKey, but the values differ. + logger.V(5).Info("A node is moved to a different domain of pod affinity, which may make the pod schedulable", + "pod", klog.KObj(pod), "node", klog.KObj(modifiedNode)) + return framework.Queue, nil } } @@ -234,11 +258,39 @@ func (pl *InterPodAffinity) isSchedulableAfterNodeChange(logger klog.Logger, pod return framework.Queue, err } + // When queuing this Pod: + // - 1. A new node is added, the pod may become schedulable. + // - 2. The original node have the pod anti-affinity topologyKey but the modified node does not, the pod may become schedulable. + // - 3. Both the original and modified nodes have the pod anti-affinity topologyKey and they differ, the pod may become schedulable. for _, term := range antiTerms { - if _, ok := modifiedNode.Labels[term.TopologyKey]; ok { - logger.V(5).Info("a node with matched pod anti-affinity topologyKey was added/updated and it may make pod schedulable", + if originalNode == nil { + // Case 1: A new node is added. + // We always requeue the Pod with anti-affinity because: + // - the node without the topology key is always allowed to have a Pod with anti-affinity. + // - the addition of a node with the topology key makes Pods schedulable only when the topology it joins doesn't have any Pods that the Pod hates. + // But, it's out-of-scope of this QHint to check which Pods are in the topology this Node is in. + logger.V(5).Info("A node was added and it may make the pod schedulable", "pod", klog.KObj(pod), "node", klog.KObj(modifiedNode)) - return framework.Queue, err + return framework.Queue, nil + } + + originalTopologyValue, originalHasKey := originalNode.Labels[term.TopologyKey] + modifiedTopologyValue, modifiedHasKey := modifiedNode.Labels[term.TopologyKey] + + if originalHasKey && !modifiedHasKey { + // Case 2: The original node have the pod anti-affinity topologyKey but the modified node does not. + // Note that we don't need to check the opposite case (!originalHasKey && modifiedHasKey) + // because the node without the topology label can always accept pods with pod anti-affinity. + logger.V(5).Info("A node got updated to not have the topology key of pod anti-affinity, which may make the pod schedulable", + "pod", klog.KObj(pod), "node", klog.KObj(modifiedNode)) + return framework.Queue, nil + } + + if originalHasKey && modifiedHasKey && (originalTopologyValue != modifiedTopologyValue) { + // Case 3: Both nodes have the pod anti-affinity topologyKey, but the values differ. + logger.V(5).Info("A node is moved to a different domain of pod anti-affinity, which may make the pod schedulable", + "pod", klog.KObj(pod), "node", klog.KObj(modifiedNode)) + return framework.Queue, nil } } logger.V(5).Info("a node is added/updated but doesn't have any topologyKey which matches pod affinity/anti-affinity", diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/scoring.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/scoring.go index 44a173aee..126f54a47 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/scoring.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity/scoring.go @@ -130,10 +130,6 @@ func (pl *InterPodAffinity) PreScore( pod *v1.Pod, nodes []*framework.NodeInfo, ) *framework.Status { - if len(nodes) == 0 { - // No nodes to score. - return framework.NewStatus(framework.Skip) - } if pl.sharedLister == nil { return framework.NewStatus(framework.Error, "empty shared lister in InterPodAffinity PreScore") @@ -240,11 +236,7 @@ func getPreScoreState(cycleState *framework.CycleState) (*preScoreState, error) // The "score" returned in this function is the sum of weights got from cycleState which have its topologyKey matching with the node's labels. // it is normalized later. // Note: the returned "score" is positive for pod-affinity, and negative for pod-antiaffinity. -func (pl *InterPodAffinity) Score(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) { - nodeInfo, err := pl.sharedLister.NodeInfos().Get(nodeName) - if err != nil { - return 0, framework.AsStatus(fmt.Errorf("failed to get node %q from Snapshot: %w", nodeName, err)) - } +func (pl *InterPodAffinity) Score(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) (int64, *framework.Status) { node := nodeInfo.Node() s, err := getPreScoreState(cycleState) diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go index 0a8c4f356..f63efb616 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go @@ -238,9 +238,6 @@ func (s *preScoreState) Clone() framework.StateData { // PreScore builds and writes cycle state used by Score and NormalizeScore. func (pl *NodeAffinity) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodes []*framework.NodeInfo) *framework.Status { - if len(nodes) == 0 { - return nil - } preferredNodeAffinity, err := getPodPreferredNodeAffinity(pod) if err != nil { return framework.AsStatus(err) @@ -259,12 +256,7 @@ func (pl *NodeAffinity) PreScore(ctx context.Context, cycleState *framework.Cycl // Score returns the sum of the weights of the terms that match the Node. // Terms came from the Pod .spec.affinity.nodeAffinity and from the plugin's // default affinity. -func (pl *NodeAffinity) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) { - nodeInfo, err := pl.handle.SnapshotSharedLister().NodeInfos().Get(nodeName) - if err != nil { - return 0, framework.AsStatus(fmt.Errorf("getting node %q from Snapshot: %w", nodeName, err)) - } - +func (pl *NodeAffinity) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) (int64, *framework.Status) { node := nodeInfo.Node() var count int64 diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeports/node_ports.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeports/node_ports.go index 74350150c..21835f6c1 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeports/node_ports.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeports/node_ports.go @@ -143,7 +143,7 @@ func (pl *NodePorts) isSchedulableAfterPodDeleted(logger klog.Logger, pod *v1.Po } // If the deleted pod is unscheduled, it doesn't make the target pod schedulable. - if deletedPod.Spec.NodeName == "" { + if deletedPod.Spec.NodeName == "" && deletedPod.Status.NominatedNodeName == "" { logger.V(4).Info("the deleted pod is unscheduled and it doesn't make the target pod schedulable", "pod", klog.KObj(pod), "deletedPod", klog.KObj(deletedPod)) return framework.QueueSkip, nil } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/balanced_allocation.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/balanced_allocation.go index e11569102..30c31f14e 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/balanced_allocation.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/balanced_allocation.go @@ -63,8 +63,15 @@ func (s *balancedAllocationPreScoreState) Clone() framework.StateData { // PreScore calculates incoming pod's resource requests and writes them to the cycle state used. func (ba *BalancedAllocation) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodes []*framework.NodeInfo) *framework.Status { + podRequests := ba.calculatePodResourceRequestList(pod, ba.resources) + if ba.isBestEffortPod(podRequests) { + // Skip BalancedAllocation scoring for best-effort pods to + // prevent a large number of pods from being scheduled to the same node. + // See https://github.com/kubernetes/kubernetes/issues/129138 for details. + return framework.NewStatus(framework.Skip) + } state := &balancedAllocationPreScoreState{ - podRequests: ba.calculatePodResourceRequestList(pod, ba.resources), + podRequests: podRequests, } cycleState.Write(balancedAllocationPreScoreStateKey, state) return nil @@ -89,15 +96,13 @@ func (ba *BalancedAllocation) Name() string { } // Score invoked at the score extension point. -func (ba *BalancedAllocation) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) { - nodeInfo, err := ba.handle.SnapshotSharedLister().NodeInfos().Get(nodeName) - if err != nil { - return 0, framework.AsStatus(fmt.Errorf("getting node %q from Snapshot: %w", nodeName, err)) - } - +func (ba *BalancedAllocation) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) (int64, *framework.Status) { s, err := getBalancedAllocationPreScoreState(state) if err != nil { s = &balancedAllocationPreScoreState{podRequests: ba.calculatePodResourceRequestList(pod, ba.resources)} + if ba.isBestEffortPod(s.podRequests) { + return 0, nil + } } // ba.score favors nodes with balanced resource usage rate. @@ -127,10 +132,12 @@ func NewBalancedAllocation(_ context.Context, baArgs runtime.Object, h framework return &BalancedAllocation{ handle: h, resourceAllocationScorer: resourceAllocationScorer{ - Name: BalancedAllocationName, - scorer: balancedResourceScorer, - useRequested: true, - resources: args.Resources, + Name: BalancedAllocationName, + enableInPlacePodVerticalScaling: fts.EnableInPlacePodVerticalScaling, + enablePodLevelResources: fts.EnablePodLevelResources, + scorer: balancedResourceScorer, + useRequested: true, + resources: args.Resources, }, }, nil } @@ -157,7 +164,6 @@ func balancedResourceScorer(requested, allocable []int64) int64 { // Otherwise, set the std to zero is enough. if len(resourceToFractions) == 2 { std = math.Abs((resourceToFractions[0] - resourceToFractions[1]) / 2) - } else if len(resourceToFractions) > 2 { mean := totalFraction / float64(len(resourceToFractions)) var sum float64 diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/fit.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/fit.go index cd464dd51..d94554ad6 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/fit.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/fit.go @@ -21,7 +21,7 @@ import ( "fmt" "strings" - "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp" //nolint:depguard v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" @@ -294,7 +294,7 @@ func (f *Fit) isSchedulableAfterPodEvent(logger klog.Logger, pod *v1.Pod, oldObj } if modifiedPod == nil { - if originalPod.Spec.NodeName == "" { + if originalPod.Spec.NodeName == "" && originalPod.Status.NominatedNodeName == "" { logger.V(5).Info("the deleted pod was unscheduled and it wouldn't make the unscheduled pod schedulable", "pod", klog.KObj(pod), "deletedPod", klog.KObj(originalPod)) return framework.QueueSkip, nil } @@ -579,12 +579,7 @@ func fitsRequest(podRequest *preFilterState, nodeInfo *framework.NodeInfo, ignor } // Score invoked at the Score extension point. -func (f *Fit) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) { - nodeInfo, err := f.handle.SnapshotSharedLister().NodeInfos().Get(nodeName) - if err != nil { - return 0, framework.AsStatus(fmt.Errorf("getting node %q from Snapshot: %w", nodeName, err)) - } - +func (f *Fit) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) (int64, *framework.Status) { s, err := getPreScoreState(state) if err != nil { s = &preScoreState{ diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/resource_allocation.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/resource_allocation.go index e85266294..71eb9138b 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/resource_allocation.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/resource_allocation.go @@ -21,11 +21,9 @@ import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" - utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/klog/v2" resourcehelper "k8s.io/component-helpers/resource" - "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/scheduler/apis/config" "k8s.io/kubernetes/pkg/scheduler/framework" schedutil "k8s.io/kubernetes/pkg/scheduler/util" @@ -36,7 +34,9 @@ type scorer func(args *config.NodeResourcesFitArgs) *resourceAllocationScorer // resourceAllocationScorer contains information to calculate resource allocation score. type resourceAllocationScorer struct { - Name string + Name string + enableInPlacePodVerticalScaling bool + enablePodLevelResources bool // used to decide whether to use Requested or NonZeroRequested for // cpu and memory. useRequested bool @@ -118,9 +118,9 @@ func (r *resourceAllocationScorer) calculateResourceAllocatableRequest(logger kl func (r *resourceAllocationScorer) calculatePodResourceRequest(pod *v1.Pod, resourceName v1.ResourceName) int64 { opts := resourcehelper.PodResourcesOptions{ - UseStatusResources: utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling), + UseStatusResources: r.enableInPlacePodVerticalScaling, // SkipPodLevelResources is set to false when PodLevelResources feature is enabled. - SkipPodLevelResources: !utilfeature.DefaultFeatureGate.Enabled(features.PodLevelResources), + SkipPodLevelResources: !r.enablePodLevelResources, } if !r.useRequested { @@ -146,3 +146,12 @@ func (r *resourceAllocationScorer) calculatePodResourceRequestList(pod *v1.Pod, } return podRequests } + +func (r *resourceAllocationScorer) isBestEffortPod(podRequests []int64) bool { + for _, request := range podRequests { + if request != 0 { + return false + } + } + return true +} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/test_util.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/test_util.go index 183306871..fd4345117 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/test_util.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources/test_util.go @@ -17,7 +17,7 @@ limitations under the License. package noderesources import ( - "github.com/google/go-cmp/cmp/cmpopts" + "github.com/google/go-cmp/cmp/cmpopts" //nolint:depguard v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeunschedulable/node_unschedulable.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeunschedulable/node_unschedulable.go index f807f95d5..50a4264aa 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeunschedulable/node_unschedulable.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeunschedulable/node_unschedulable.go @@ -68,7 +68,7 @@ func (pl *NodeUnschedulable) EventsToRegister(_ context.Context) ([]framework.Cl // the scheduling queue uses Pod/Update Queueing Hint // to determine whether a Pod's update makes the Pod schedulable or not. // https://github.com/kubernetes/kubernetes/pull/122234 - {Event: framework.ClusterEvent{Resource: framework.Pod, ActionType: framework.UpdatePodTolerations}, QueueingHintFn: pl.isSchedulableAfterPodTolerationChange}, + {Event: framework.ClusterEvent{Resource: framework.Pod, ActionType: framework.UpdatePodToleration}, QueueingHintFn: pl.isSchedulableAfterPodTolerationChange}, }, nil } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/csi.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/csi.go index 13d0ba8c9..1a3f12d03 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/csi.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/csi.go @@ -63,7 +63,8 @@ type CSILimits struct { scLister storagelisters.StorageClassLister vaLister storagelisters.VolumeAttachmentLister - randomVolumeIDPrefix string + enableCSIMigrationPortworx bool + randomVolumeIDPrefix string translator InTreeToCSITranslator } @@ -87,9 +88,10 @@ func (pl *CSILimits) EventsToRegister(_ context.Context) ([]framework.ClusterEve // We don't register any `QueueingHintFn` intentionally // because any new CSINode could make pods that were rejected by CSI volumes schedulable. {Event: framework.ClusterEvent{Resource: framework.CSINode, ActionType: framework.Add}}, + {Event: framework.ClusterEvent{Resource: framework.CSINode, ActionType: framework.Update}, QueueingHintFn: pl.isSchedulableAfterCSINodeUpdated}, {Event: framework.ClusterEvent{Resource: framework.Pod, ActionType: framework.Delete}, QueueingHintFn: pl.isSchedulableAfterPodDeleted}, {Event: framework.ClusterEvent{Resource: framework.PersistentVolumeClaim, ActionType: framework.Add}, QueueingHintFn: pl.isSchedulableAfterPVCAdded}, - {Event: framework.ClusterEvent{Resource: framework.VolumeAttachment, ActionType: framework.Delete}}, + {Event: framework.ClusterEvent{Resource: framework.VolumeAttachment, ActionType: framework.Delete}, QueueingHintFn: pl.isSchedulableAfterVolumeAttachmentDeleted}, }, nil } @@ -103,7 +105,7 @@ func (pl *CSILimits) isSchedulableAfterPodDeleted(logger klog.Logger, pod *v1.Po return framework.QueueSkip, nil } - if deletedPod.Spec.NodeName == "" { + if deletedPod.Spec.NodeName == "" && deletedPod.Status.NominatedNodeName == "" { return framework.QueueSkip, nil } @@ -149,6 +151,85 @@ func (pl *CSILimits) isSchedulableAfterPVCAdded(logger klog.Logger, pod *v1.Pod, return framework.QueueSkip, nil } +func (pl *CSILimits) isSchedulableAfterVolumeAttachmentDeleted(logger klog.Logger, pod *v1.Pod, oldObj, newObj interface{}) (framework.QueueingHint, error) { + deletedVolumeAttachment, _, err := util.As[*storagev1.VolumeAttachment](oldObj, newObj) + if err != nil { + return framework.Queue, fmt.Errorf("unexpected objects in isSchedulableAfterVolumeAttachmentDeleted: %w", err) + } + + for _, vol := range pod.Spec.Volumes { + // Check if the pod volume uses a PVC + // If it does, return Queue + if vol.PersistentVolumeClaim != nil { + logger.V(5).Info("Pod volume uses PersistentVolumeClaim, which might make this pod schedulable due to VolumeAttachment deletion", "pod", klog.KObj(pod), "volumeAttachment", klog.KObj(deletedVolumeAttachment), "volume", vol.Name) + return framework.Queue, nil + } + + if !pl.translator.IsInlineMigratable(&vol) { + continue + } + + translatedPV, err := pl.translator.TranslateInTreeInlineVolumeToCSI(logger, &vol, pod.Namespace) + if err != nil || translatedPV == nil { + return framework.Queue, fmt.Errorf("converting volume(%s) from inline to csi: %w", vol.Name, err) + } + + if translatedPV.Spec.CSI != nil && deletedVolumeAttachment.Spec.Attacher == translatedPV.Spec.CSI.Driver { + // deleted VolumeAttachment Attacher matches the translated PV CSI driver + logger.V(5).Info("Pod volume is an Inline Migratable volume that matches the CSI driver, which might make this pod schedulable due to VolumeAttachment deletion", + "pod", klog.KObj(pod), "volumeAttachment", klog.KObj(deletedVolumeAttachment), + "volume", vol.Name, "csiDriver", translatedPV.Spec.CSI.Driver, + ) + return framework.Queue, nil + } + } + + logger.V(5).Info("the VolumeAttachment deletion wouldn't make this pod schedulable because the pod has no volume related to a deleted VolumeAttachment", + "pod", klog.KObj(pod), "volumeAttachment", klog.KObj(deletedVolumeAttachment)) + return framework.QueueSkip, nil +} + +func (pl *CSILimits) isSchedulableAfterCSINodeUpdated(logger klog.Logger, pod *v1.Pod, oldObj, newObj interface{}) (framework.QueueingHint, error) { + oldCSINode, newCSINode, err := util.As[*storagev1.CSINode](oldObj, newObj) + if err != nil { + return framework.Queue, fmt.Errorf("unexpected objects in isSchedulableAfterCSINodeUpdated: %w", err) + } + + oldLimits := make(map[string]int32) + for _, d := range oldCSINode.Spec.Drivers { + var count int32 + if d.Allocatable != nil && d.Allocatable.Count != nil { + count = *d.Allocatable.Count + } + oldLimits[d.Name] = count + } + + // Compare new driver limits vs. old. If limit increased, queue pod. + for _, d := range newCSINode.Spec.Drivers { + var oldLimit int32 + if val, exists := oldLimits[d.Name]; exists { + oldLimit = val + } + newLimit := int32(0) + if d.Allocatable != nil && d.Allocatable.Count != nil { + newLimit = *d.Allocatable.Count + } + + if newLimit > oldLimit { + logger.V(5).Info("CSINode driver limit increased, might make this pod schedulable", + "pod", klog.KObj(pod), + "driver", d.Name, + "oldLimit", oldLimit, + "newLimit", newLimit, + ) + return framework.Queue, nil + } + } + + // If no driver limit was increased, skip queueing. + return framework.QueueSkip, nil +} + // PreFilter invoked at the prefilter extension point // // If the pod haven't those types of volumes, we'll skip the Filter phase @@ -339,7 +420,7 @@ func (pl *CSILimits) checkAttachableInlineVolume(logger klog.Logger, vol *v1.Vol if err != nil { return fmt.Errorf("looking up provisioner name for volume %s: %w", vol.Name, err) } - if !isCSIMigrationOn(csiNode, inTreeProvisionerName) { + if !isCSIMigrationOn(csiNode, inTreeProvisionerName, pl.enableCSIMigrationPortworx) { csiNodeName := "" if csiNode != nil { csiNodeName = csiNode.Name @@ -400,7 +481,7 @@ func (pl *CSILimits) getCSIDriverInfo(logger klog.Logger, csiNode *storagev1.CSI return "", "" } - if !isCSIMigrationOn(csiNode, pluginName) { + if !isCSIMigrationOn(csiNode, pluginName, pl.enableCSIMigrationPortworx) { logger.V(5).Info("CSI Migration of plugin is not enabled", "plugin", pluginName) return "", "" } @@ -448,7 +529,7 @@ func (pl *CSILimits) getCSIDriverInfoFromSC(logger klog.Logger, csiNode *storage provisioner := storageClass.Provisioner if pl.translator.IsMigratableIntreePluginByName(provisioner) { - if !isCSIMigrationOn(csiNode, provisioner) { + if !isCSIMigrationOn(csiNode, provisioner, pl.enableCSIMigrationPortworx) { logger.V(5).Info("CSI Migration of provisioner is not enabled", "provisioner", provisioner) return "", "" } @@ -475,13 +556,14 @@ func NewCSI(_ context.Context, _ runtime.Object, handle framework.Handle, fts fe csiTranslator := csitrans.New() return &CSILimits{ - csiNodeLister: csiNodesLister, - pvLister: pvLister, - pvcLister: pvcLister, - scLister: scLister, - vaLister: vaLister, - randomVolumeIDPrefix: rand.String(32), - translator: csiTranslator, + csiNodeLister: csiNodesLister, + pvLister: pvLister, + pvcLister: pvcLister, + scLister: scLister, + vaLister: vaLister, + enableCSIMigrationPortworx: fts.EnableCSIMigrationPortworx, + randomVolumeIDPrefix: rand.String(32), + translator: csiTranslator, }, nil } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/utils.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/utils.go index d70b18f72..7cb761379 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/utils.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/utils.go @@ -22,14 +22,12 @@ import ( v1 "k8s.io/api/core/v1" storagev1 "k8s.io/api/storage/v1" "k8s.io/apimachinery/pkg/util/sets" - utilfeature "k8s.io/apiserver/pkg/util/feature" csilibplugins "k8s.io/csi-translation-lib/plugins" - "k8s.io/kubernetes/pkg/features" ) // isCSIMigrationOn returns a boolean value indicating whether // the CSI migration has been enabled for a particular storage plugin. -func isCSIMigrationOn(csiNode *storagev1.CSINode, pluginName string) bool { +func isCSIMigrationOn(csiNode *storagev1.CSINode, pluginName string, enableCSIMigrationPortworx bool) bool { if csiNode == nil || len(pluginName) == 0 { return false } @@ -40,7 +38,7 @@ func isCSIMigrationOn(csiNode *storagev1.CSINode, pluginName string) bool { case csilibplugins.AWSEBSInTreePluginName: return true case csilibplugins.PortworxVolumePluginName: - if !utilfeature.DefaultFeatureGate.Enabled(features.CSIMigrationPortworx) { + if !enableCSIMigrationPortworx { return false } case csilibplugins.GCEPDInTreePluginName: diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/common.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/common.go index 6f5898fe4..5896aad65 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/common.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/common.go @@ -27,11 +27,6 @@ import ( "k8s.io/utils/ptr" ) -type topologyPair struct { - key string - value string -} - // topologySpreadConstraint is an internal version for v1.TopologySpreadConstraint // and where the selector is parsed. // Fields are exported for comparison during testing. diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go index 11322a4cc..2b0d5d8f3 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go @@ -19,6 +19,7 @@ package podtopologyspread import ( "context" "fmt" + "maps" "math" v1 "k8s.io/api/core/v1" @@ -31,7 +32,7 @@ import ( const preFilterStateKey = "PreFilter" + Name // preFilterState computed at PreFilter and used at Filter. -// It combines TpKeyToCriticalPaths and TpPairToMatchNum to represent: +// It combines CriticalPaths and TpValueToMatchNum to represent: // (1) critical paths where the least pods are matched on each spread constraint. // (2) number of pods matched on each spread constraint. // A nil preFilterState denotes it's not set at all (in PreFilter phase); @@ -39,29 +40,23 @@ const preFilterStateKey = "PreFilter" + Name // Fields are exported for comparison during testing. type preFilterState struct { Constraints []topologySpreadConstraint - // We record 2 critical paths instead of all critical paths here. - // criticalPaths[0].MatchNum always holds the minimum matching number. - // criticalPaths[1].MatchNum is always greater or equal to criticalPaths[0].MatchNum, but + // CriticalPaths is a slice indexed by constraint index. + // Per each entry, we record 2 critical paths instead of all critical paths. + // CriticalPaths[i][0].MatchNum always holds the minimum matching number. + // CriticalPaths[i][1].MatchNum is always greater or equal to CriticalPaths[i][0].MatchNum, but // it's not guaranteed to be the 2nd minimum match number. - TpKeyToCriticalPaths map[string]*criticalPaths - // TpKeyToDomainsNum is keyed with topologyKey, and valued with the number of domains. - TpKeyToDomainsNum map[string]int - // TpPairToMatchNum is keyed with topologyPair, and valued with the number of matching pods. - TpPairToMatchNum map[topologyPair]int + CriticalPaths []*criticalPaths + // TpValueToMatchNum is a slice indexed by constraint index. + // Each entry is keyed with topology value, and valued with the number of matching pods. + TpValueToMatchNum []map[string]int } // minMatchNum returns the global minimum for the calculation of skew while taking MinDomains into account. -func (s *preFilterState) minMatchNum(tpKey string, minDomains int32) (int, error) { - paths, ok := s.TpKeyToCriticalPaths[tpKey] - if !ok { - return 0, fmt.Errorf("failed to retrieve path by topology key") - } +func (s *preFilterState) minMatchNum(constraintID int, minDomains int32) (int, error) { + paths := s.CriticalPaths[constraintID] minMatchNum := paths[0].MatchNum - domainsNum, ok := s.TpKeyToDomainsNum[tpKey] - if !ok { - return 0, fmt.Errorf("failed to retrieve the number of domains by topology key") - } + domainsNum := len(s.TpValueToMatchNum[constraintID]) if domainsNum < int(minDomains) { // When the number of eligible domains with matching topology keys is less than `minDomains`, @@ -79,17 +74,15 @@ func (s *preFilterState) Clone() framework.StateData { } copy := preFilterState{ // Constraints are shared because they don't change. - Constraints: s.Constraints, - TpKeyToCriticalPaths: make(map[string]*criticalPaths, len(s.TpKeyToCriticalPaths)), - // The number of domains does not change as a result of AddPod/RemovePod methods on PreFilter Extensions - TpKeyToDomainsNum: s.TpKeyToDomainsNum, - TpPairToMatchNum: make(map[topologyPair]int, len(s.TpPairToMatchNum)), + Constraints: s.Constraints, + CriticalPaths: make([]*criticalPaths, len(s.CriticalPaths)), + TpValueToMatchNum: make([]map[string]int, len(s.TpValueToMatchNum)), } - for tpKey, paths := range s.TpKeyToCriticalPaths { - copy.TpKeyToCriticalPaths[tpKey] = &criticalPaths{paths[0], paths[1]} + for i, paths := range s.CriticalPaths { + copy.CriticalPaths[i] = &criticalPaths{paths[0], paths[1]} } - for tpPair, matchNum := range s.TpPairToMatchNum { - copy.TpPairToMatchNum[tpPair] = matchNum + for i, tpMap := range s.TpValueToMatchNum { + copy.TpValueToMatchNum[i] = maps.Clone(tpMap) } return © } @@ -200,7 +193,7 @@ func (pl *PodTopologySpread) updateWithPod(s *preFilterState, updatedPod, preemp } podLabelSet := labels.Set(updatedPod.Labels) - for _, constraint := range s.Constraints { + for i, constraint := range s.Constraints { if !constraint.Selector.Matches(podLabelSet) { continue } @@ -210,10 +203,9 @@ func (pl *PodTopologySpread) updateWithPod(s *preFilterState, updatedPod, preemp continue } - k, v := constraint.TopologyKey, node.Labels[constraint.TopologyKey] - pair := topologyPair{key: k, value: v} - s.TpPairToMatchNum[pair] += delta - s.TpKeyToCriticalPaths[k].update(v, s.TpPairToMatchNum[pair]) + v := node.Labels[constraint.TopologyKey] + s.TpValueToMatchNum[i][v] += delta + s.CriticalPaths[i].update(v, s.TpValueToMatchNum[i][v]) } } @@ -232,6 +224,12 @@ func getPreFilterState(cycleState *framework.CycleState) (*preFilterState, error return s, nil } +type topologyCount struct { + topologyValue string + constraintID int + count int +} + // calPreFilterState computes preFilterState describing how pods are spread on topologies. func (pl *PodTopologySpread) calPreFilterState(ctx context.Context, pod *v1.Pod) (*preFilterState, error) { constraints, err := pl.getConstraints(pod) @@ -248,15 +246,18 @@ func (pl *PodTopologySpread) calPreFilterState(ctx context.Context, pod *v1.Pod) } s := preFilterState{ - Constraints: constraints, - TpKeyToCriticalPaths: make(map[string]*criticalPaths, len(constraints)), - TpPairToMatchNum: make(map[topologyPair]int, sizeHeuristic(len(allNodes), constraints)), + Constraints: constraints, + CriticalPaths: make([]*criticalPaths, len(constraints)), + TpValueToMatchNum: make([]map[string]int, len(constraints)), + } + for i := 0; i < len(constraints); i++ { + s.TpValueToMatchNum[i] = make(map[string]int, sizeHeuristic(len(allNodes), constraints[i])) } - tpCountsByNode := make([]map[topologyPair]int, len(allNodes)) + tpCountsByNode := make([][]topologyCount, len(allNodes)) requiredNodeAffinity := nodeaffinity.GetRequiredNodeAffinity(pod) - processNode := func(i int) { - nodeInfo := allNodes[i] + processNode := func(n int) { + nodeInfo := allNodes[n] node := nodeInfo.Node() if !pl.enableNodeInclusionPolicyInPodTopologySpread { @@ -272,38 +273,39 @@ func (pl *PodTopologySpread) calPreFilterState(ctx context.Context, pod *v1.Pod) return } - tpCounts := make(map[topologyPair]int, len(constraints)) - for _, c := range constraints { + tpCounts := make([]topologyCount, 0, len(constraints)) + for i, c := range constraints { if pl.enableNodeInclusionPolicyInPodTopologySpread && !c.matchNodeInclusionPolicies(pod, node, requiredNodeAffinity) { continue } - pair := topologyPair{key: c.TopologyKey, value: node.Labels[c.TopologyKey]} + value := node.Labels[c.TopologyKey] count := countPodsMatchSelector(nodeInfo.Pods, c.Selector, pod.Namespace) - tpCounts[pair] = count + tpCounts = append(tpCounts, topologyCount{ + topologyValue: value, + constraintID: i, + count: count, + }) } - tpCountsByNode[i] = tpCounts + tpCountsByNode[n] = tpCounts } pl.parallelizer.Until(ctx, len(allNodes), processNode, pl.Name()) for _, tpCounts := range tpCountsByNode { - for tp, count := range tpCounts { - s.TpPairToMatchNum[tp] += count + // tpCounts might not hold all the constraints, so index can't be used here as constraintID. + for _, tpCount := range tpCounts { + s.TpValueToMatchNum[tpCount.constraintID][tpCount.topologyValue] += tpCount.count } } - s.TpKeyToDomainsNum = make(map[string]int, len(constraints)) - for tp := range s.TpPairToMatchNum { - s.TpKeyToDomainsNum[tp.key]++ - } - // calculate min match for each topology pair + // calculate min match for each constraint and topology value for i := 0; i < len(constraints); i++ { - key := constraints[i].TopologyKey - s.TpKeyToCriticalPaths[key] = newCriticalPaths() - } - for pair, num := range s.TpPairToMatchNum { - s.TpKeyToCriticalPaths[pair.key].update(pair.value, num) + s.CriticalPaths[i] = newCriticalPaths() + + for value, num := range s.TpValueToMatchNum[i] { + s.CriticalPaths[i].update(value, num) + } } return &s, nil @@ -325,19 +327,19 @@ func (pl *PodTopologySpread) Filter(ctx context.Context, cycleState *framework.C logger := klog.FromContext(ctx) podLabelSet := labels.Set(pod.Labels) - for _, c := range s.Constraints { + for i, c := range s.Constraints { tpKey := c.TopologyKey - tpVal, ok := node.Labels[c.TopologyKey] + tpVal, ok := node.Labels[tpKey] if !ok { - logger.V(5).Info("Node doesn't have required label", "node", klog.KObj(node), "label", tpKey) + logger.V(5).Info("Node doesn't have required topology label for spread constraint", "node", klog.KObj(node), "topologyKey", tpKey) return framework.NewStatus(framework.UnschedulableAndUnresolvable, ErrReasonNodeLabelNotMatch) } // judging criteria: // 'existing matching num' + 'if self-match (1 or 0)' - 'global minimum' <= 'maxSkew' - minMatchNum, err := s.minMatchNum(tpKey, c.MinDomains) + minMatchNum, err := s.minMatchNum(i, c.MinDomains) if err != nil { - logger.Error(err, "Internal error occurred while retrieving value precalculated in PreFilter", "topologyKey", tpKey, "paths", s.TpKeyToCriticalPaths) + logger.Error(err, "Internal error occurred while retrieving value precalculated in PreFilter", "topologyKey", tpKey, "paths", s.CriticalPaths[i]) continue } @@ -346,11 +348,7 @@ func (pl *PodTopologySpread) Filter(ctx context.Context, cycleState *framework.C selfMatchNum = 1 } - pair := topologyPair{key: tpKey, value: tpVal} - matchNum := 0 - if tpCount, ok := s.TpPairToMatchNum[pair]; ok { - matchNum = tpCount - } + matchNum := s.TpValueToMatchNum[i][tpVal] skew := matchNum + selfMatchNum - minMatchNum if skew > int(c.MaxSkew) { logger.V(5).Info("Node failed spreadConstraint: matchNum + selfMatchNum - minMatchNum > maxSkew", "node", klog.KObj(node), "topologyKey", tpKey, "matchNum", matchNum, "selfMatchNum", selfMatchNum, "minMatchNum", minMatchNum, "maxSkew", c.MaxSkew) @@ -361,11 +359,9 @@ func (pl *PodTopologySpread) Filter(ctx context.Context, cycleState *framework.C return nil } -func sizeHeuristic(nodes int, constraints []topologySpreadConstraint) int { - for _, c := range constraints { - if c.TopologyKey == v1.LabelHostname { - return nodes - } +func sizeHeuristic(nodes int, constraint topologySpreadConstraint) int { + if constraint.TopologyKey == v1.LabelHostname { + return nodes } return 0 } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/plugin.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/plugin.go index a0406c661..4295755ca 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/plugin.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/plugin.go @@ -146,8 +146,8 @@ func (pl *PodTopologySpread) EventsToRegister(_ context.Context) ([]framework.Cl // // The Pod rejected by this plugin can be schedulable when the Pod has a spread constraint with NodeTaintsPolicy:Honor // and has got a new toleration. - // So, we add UpdatePodTolerations here only when QHint is enabled. - podActionType = framework.Add | framework.UpdatePodLabel | framework.UpdatePodTolerations | framework.Delete + // So, we add UpdatePodToleration here only when QHint is enabled. + podActionType = framework.Add | framework.UpdatePodLabel | framework.UpdatePodToleration | framework.Delete } return []framework.ClusterEventWithHint{ diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/scoring.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/scoring.go index b377ce6a5..ed8a9542f 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/scoring.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread/scoring.go @@ -37,8 +37,9 @@ type preScoreState struct { Constraints []topologySpreadConstraint // IgnoredNodes is a set of node names which miss some Constraints[*].topologyKey. IgnoredNodes sets.Set[string] - // TopologyPairToPodCounts is keyed with topologyPair, and valued with the number of matching pods. - TopologyPairToPodCounts map[topologyPair]*int64 + // TopologyValueToPodCounts is a slice indexed by constraint index. + // Each entry is keyed with topology value, and valued with the number of matching pods. + TopologyValueToPodCounts []map[string]*int64 // TopologyNormalizingWeight is the weight we give to the counts per topology. // This allows the pod counts of smaller topologies to not be watered down by // bigger ones. @@ -76,6 +77,10 @@ func (pl *PodTopologySpread) initPreScoreState(s *preScoreState, pod *v1.Pod, fi if len(s.Constraints) == 0 { return nil } + s.TopologyValueToPodCounts = make([]map[string]*int64, len(s.Constraints)) + for i := 0; i < len(s.Constraints); i++ { + s.TopologyValueToPodCounts[i] = make(map[string]*int64) + } topoSize := make([]int, len(s.Constraints)) for _, node := range filteredNodes { if requireAllTopologies && !nodeLabelsMatchSpreadConstraints(node.Node().Labels, s.Constraints) { @@ -89,9 +94,9 @@ func (pl *PodTopologySpread) initPreScoreState(s *preScoreState, pod *v1.Pod, fi if constraint.TopologyKey == v1.LabelHostname { continue } - pair := topologyPair{key: constraint.TopologyKey, value: node.Node().Labels[constraint.TopologyKey]} - if s.TopologyPairToPodCounts[pair] == nil { - s.TopologyPairToPodCounts[pair] = new(int64) + value := node.Node().Labels[constraint.TopologyKey] + if s.TopologyValueToPodCounts[i][value] == nil { + s.TopologyValueToPodCounts[i][value] = new(int64) topoSize[i]++ } } @@ -126,8 +131,7 @@ func (pl *PodTopologySpread) PreScore( } state := &preScoreState{ - IgnoredNodes: sets.New[string](), - TopologyPairToPodCounts: make(map[topologyPair]*int64), + IgnoredNodes: sets.New[string](), } // Only require that nodes have all the topology labels if using // non-system-default spreading rules. This allows nodes that don't have a @@ -145,8 +149,8 @@ func (pl *PodTopologySpread) PreScore( // Ignore parsing errors for backwards compatibility. requiredNodeAffinity := nodeaffinity.GetRequiredNodeAffinity(pod) - processAllNode := func(i int) { - nodeInfo := allNodes[i] + processAllNode := func(n int) { + nodeInfo := allNodes[n] node := nodeInfo.Node() if !pl.enableNodeInclusionPolicyInPodTopologySpread { @@ -161,17 +165,17 @@ func (pl *PodTopologySpread) PreScore( return } - for _, c := range state.Constraints { + for i, c := range state.Constraints { if pl.enableNodeInclusionPolicyInPodTopologySpread && !c.matchNodeInclusionPolicies(pod, node, requiredNodeAffinity) { continue } - pair := topologyPair{key: c.TopologyKey, value: node.Labels[c.TopologyKey]} + value := node.Labels[c.TopologyKey] // If current topology pair is not associated with any candidate node, // continue to avoid unnecessary calculation. // Per-node counts are also skipped, as they are done during Score. - tpCount := state.TopologyPairToPodCounts[pair] + tpCount := state.TopologyValueToPodCounts[i][value] if tpCount == nil { continue } @@ -188,12 +192,7 @@ func (pl *PodTopologySpread) PreScore( // Score invoked at the Score extension point. // The "score" returned in this function is the matching number of pods on the `nodeName`, // it is normalized later. -func (pl *PodTopologySpread) Score(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) { - nodeInfo, err := pl.sharedLister.NodeInfos().Get(nodeName) - if err != nil { - return 0, framework.AsStatus(fmt.Errorf("getting node %q from Snapshot: %w", nodeName, err)) - } - +func (pl *PodTopologySpread) Score(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) (int64, *framework.Status) { node := nodeInfo.Node() s, err := getPreScoreState(cycleState) if err != nil { @@ -214,8 +213,7 @@ func (pl *PodTopologySpread) Score(ctx context.Context, cycleState *framework.Cy if c.TopologyKey == v1.LabelHostname { cnt = int64(countPodsMatchSelector(nodeInfo.Pods, c.Selector, pod.Namespace)) } else { - pair := topologyPair{key: c.TopologyKey, value: tpVal} - cnt = *s.TopologyPairToPodCounts[pair] + cnt = *s.TopologyValueToPodCounts[i][tpVal] } score += scoreForCount(cnt, c.MaxSkew, s.TopologyNormalizingWeight[i]) } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/registry.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/registry.go index ae50798a3..3e3f27092 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/registry.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/registry.go @@ -46,9 +46,12 @@ import ( // through the WithFrameworkOutOfTreeRegistry option. func NewInTreeRegistry() runtime.Registry { fts := plfeature.Features{ + EnableDRAPrioritizedList: feature.DefaultFeatureGate.Enabled(features.DRAPrioritizedList), EnableDRAAdminAccess: feature.DefaultFeatureGate.Enabled(features.DRAAdminAccess), + EnableDRADeviceTaints: feature.DefaultFeatureGate.Enabled(features.DRADeviceTaints), EnableDynamicResourceAllocation: feature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation), - EnableVolumeCapacityPriority: feature.DefaultFeatureGate.Enabled(features.VolumeCapacityPriority), + EnableVolumeAttributesClass: feature.DefaultFeatureGate.Enabled(features.VolumeAttributesClass), + EnableCSIMigrationPortworx: feature.DefaultFeatureGate.Enabled(features.CSIMigrationPortworx), EnableNodeInclusionPolicyInPodTopologySpread: feature.DefaultFeatureGate.Enabled(features.NodeInclusionPolicyInPodTopologySpread), EnableMatchLabelKeysInPodTopologySpread: feature.DefaultFeatureGate.Enabled(features.MatchLabelKeysInPodTopologySpread), EnableInPlacePodVerticalScaling: feature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling), @@ -56,6 +59,8 @@ func NewInTreeRegistry() runtime.Registry { EnableSchedulingQueueHint: feature.DefaultFeatureGate.Enabled(features.SchedulerQueueingHints), EnableAsyncPreemption: feature.DefaultFeatureGate.Enabled(features.SchedulerAsyncPreemption), EnablePodLevelResources: feature.DefaultFeatureGate.Enabled(features.PodLevelResources), + EnablePartitionableDevices: feature.DefaultFeatureGate.Enabled(features.DRAPartitionableDevices), + EnableStorageCapacityScoring: feature.DefaultFeatureGate.Enabled(features.StorageCapacityScoring), } registry := runtime.Registry{ diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go index 78bb73f1e..3eb8f5e1a 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go @@ -67,7 +67,7 @@ func (pl *TaintToleration) EventsToRegister(_ context.Context) ([]framework.Clus // the scheduling queue uses Pod/Update Queueing Hint // to determine whether a Pod's update makes the Pod schedulable or not. // https://github.com/kubernetes/kubernetes/pull/122234 - {Event: framework.ClusterEvent{Resource: framework.Pod, ActionType: framework.UpdatePodTolerations}, QueueingHintFn: pl.isSchedulableAfterPodTolerationChange}, + {Event: framework.ClusterEvent{Resource: framework.Pod, ActionType: framework.UpdatePodToleration}, QueueingHintFn: pl.isSchedulableAfterPodTolerationChange}, }, nil } @@ -143,9 +143,6 @@ func getAllTolerationPreferNoSchedule(tolerations []v1.Toleration) (tolerationLi // PreScore builds and writes cycle state used by Score and NormalizeScore. func (pl *TaintToleration) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodes []*framework.NodeInfo) *framework.Status { - if len(nodes) == 0 { - return nil - } tolerationsPreferNoSchedule := getAllTolerationPreferNoSchedule(pod.Spec.Tolerations) state := &preScoreState{ tolerationsPreferNoSchedule: tolerationsPreferNoSchedule, @@ -183,11 +180,7 @@ func countIntolerableTaintsPreferNoSchedule(taints []v1.Taint, tolerations []v1. } // Score invoked at the Score extension point. -func (pl *TaintToleration) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) { - nodeInfo, err := pl.handle.SnapshotSharedLister().NodeInfos().Get(nodeName) - if err != nil { - return 0, framework.AsStatus(fmt.Errorf("getting node %q from Snapshot: %w", nodeName, err)) - } +func (pl *TaintToleration) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) (int64, *framework.Status) { node := nodeInfo.Node() s, err := getPreScoreState(state) diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding/binder.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding/binder.go index d20ca9318..783d65889 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding/binder.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding/binder.go @@ -33,7 +33,6 @@ import ( "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apiserver/pkg/storage" - utilfeature "k8s.io/apiserver/pkg/util/feature" coreinformers "k8s.io/client-go/informers/core/v1" storageinformers "k8s.io/client-go/informers/storage/v1" clientset "k8s.io/client-go/kubernetes" @@ -45,7 +44,7 @@ import ( csiplugins "k8s.io/csi-translation-lib/plugins" "k8s.io/klog/v2" v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" - "k8s.io/kubernetes/pkg/features" + "k8s.io/kubernetes/pkg/scheduler/framework/plugins/feature" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding/metrics" "k8s.io/kubernetes/pkg/scheduler/util/assumecache" ) @@ -65,7 +64,7 @@ const ( // ErrReasonBindConflict is used for VolumeBindingNoMatch predicate error. ErrReasonBindConflict ConflictReason = "node(s) didn't find available persistent volumes to bind" // ErrReasonNodeConflict is used for VolumeNodeAffinityConflict predicate error. - ErrReasonNodeConflict ConflictReason = "node(s) had volume node affinity conflict" + ErrReasonNodeConflict ConflictReason = "node(s) didn't match PersistentVolume's node affinity" // ErrReasonNotEnoughSpace is used when a pod cannot start on a node because not enough storage space is available. ErrReasonNotEnoughSpace = "node(s) did not have enough free storage" // ErrReasonPVNotExist is used when a pod has one or more PVC(s) bound to non-existent persistent volume(s)" @@ -103,13 +102,19 @@ func (b *BindingInfo) StorageResource() *StorageResource { } } +// DynamicProvision represents a dynamically provisioned volume. +type DynamicProvision struct { + PVC *v1.PersistentVolumeClaim + NodeCapacity *storagev1.CSIStorageCapacity +} + // PodVolumes holds pod's volumes information used in volume scheduling. type PodVolumes struct { // StaticBindings are binding decisions for PVCs which can be bound to // pre-provisioned static PVs. StaticBindings []*BindingInfo // DynamicProvisions are PVCs that require dynamic provisioning - DynamicProvisions []*v1.PersistentVolumeClaim + DynamicProvisions []*DynamicProvision } // InTreeToCSITranslator contains methods required to check migratable status @@ -203,7 +208,9 @@ type PodVolumeClaims struct { } type volumeBinder struct { - kubeClient clientset.Interface + kubeClient clientset.Interface + enableVolumeAttributesClass bool + enableCSIMigrationPortworx bool classLister storagelisters.StorageClassLister podLister corelisters.PodLister @@ -238,6 +245,7 @@ type CapacityCheck struct { func NewVolumeBinder( logger klog.Logger, kubeClient clientset.Interface, + fts feature.Features, podInformer coreinformers.PodInformer, nodeInformer coreinformers.NodeInformer, csiNodeInformer storageinformers.CSINodeInformer, @@ -247,15 +255,17 @@ func NewVolumeBinder( capacityCheck CapacityCheck, bindTimeout time.Duration) SchedulerVolumeBinder { b := &volumeBinder{ - kubeClient: kubeClient, - podLister: podInformer.Lister(), - classLister: storageClassInformer.Lister(), - nodeLister: nodeInformer.Lister(), - csiNodeLister: csiNodeInformer.Lister(), - pvcCache: NewPVCAssumeCache(logger, pvcInformer.Informer()), - pvCache: NewPVAssumeCache(logger, pvInformer.Informer()), - bindTimeout: bindTimeout, - translator: csitrans.New(), + kubeClient: kubeClient, + enableVolumeAttributesClass: fts.EnableVolumeAttributesClass, + enableCSIMigrationPortworx: fts.EnableCSIMigrationPortworx, + podLister: podInformer.Lister(), + classLister: storageClassInformer.Lister(), + nodeLister: nodeInformer.Lister(), + csiNodeLister: csiNodeInformer.Lister(), + pvcCache: NewPVCAssumeCache(logger, pvcInformer.Informer()), + pvCache: NewPVAssumeCache(logger, pvInformer.Informer()), + bindTimeout: bindTimeout, + translator: csitrans.New(), } b.csiDriverLister = capacityCheck.CSIDriverInformer.Lister() @@ -306,7 +316,7 @@ func (b *volumeBinder) FindPodVolumes(logger klog.Logger, pod *v1.Pod, podVolume var ( staticBindings []*BindingInfo - dynamicProvisions []*v1.PersistentVolumeClaim + dynamicProvisions []*DynamicProvision ) defer func() { // Although we do not distinguish nil from empty in this function, for @@ -373,6 +383,16 @@ func (b *volumeBinder) FindPodVolumes(logger klog.Logger, pod *v1.Pod, podVolume return } +// ConvertDynamicProvisionsToPVCs converts a slice of *DynamicProvision to a +// slice of PersistentVolumeClaim +func convertDynamicProvisionsToPVCs(dynamicProvisions []*DynamicProvision) []*v1.PersistentVolumeClaim { + pvcs := make([]*v1.PersistentVolumeClaim, 0, len(dynamicProvisions)) + for _, dynamicProvision := range dynamicProvisions { + pvcs = append(pvcs, dynamicProvision.PVC) + } + return pvcs +} + // AssumePodVolumes will take the matching PVs and PVCs to provision in pod's // volume information for the chosen node, and: // 1. Update the pvCache with the new prebound PV. @@ -419,20 +439,21 @@ func (b *volumeBinder) AssumePodVolumes(logger klog.Logger, assumedPod *v1.Pod, } // Assume PVCs - newProvisionedPVCs := []*v1.PersistentVolumeClaim{} - for _, claim := range podVolumes.DynamicProvisions { + newProvisionedPVCs := []*DynamicProvision{} + for _, dynamicProvision := range podVolumes.DynamicProvisions { // The claims from method args can be pointing to watcher cache. We must not // modify these, therefore create a copy. - claimClone := claim.DeepCopy() + claimClone := dynamicProvision.PVC.DeepCopy() metav1.SetMetaDataAnnotation(&claimClone.ObjectMeta, volume.AnnSelectedNode, nodeName) err = b.pvcCache.Assume(claimClone) if err != nil { + pvcs := convertDynamicProvisionsToPVCs(newProvisionedPVCs) b.revertAssumedPVs(newBindings) - b.revertAssumedPVCs(newProvisionedPVCs) + b.revertAssumedPVCs(pvcs) return } - newProvisionedPVCs = append(newProvisionedPVCs, claimClone) + newProvisionedPVCs = append(newProvisionedPVCs, &DynamicProvision{PVC: claimClone}) } podVolumes.StaticBindings = newBindings @@ -442,8 +463,9 @@ func (b *volumeBinder) AssumePodVolumes(logger klog.Logger, assumedPod *v1.Pod, // RevertAssumedPodVolumes will revert assumed PV and PVC cache. func (b *volumeBinder) RevertAssumedPodVolumes(podVolumes *PodVolumes) { + pvcs := convertDynamicProvisionsToPVCs(podVolumes.DynamicProvisions) b.revertAssumedPVs(podVolumes.StaticBindings) - b.revertAssumedPVCs(podVolumes.DynamicProvisions) + b.revertAssumedPVCs(pvcs) } // BindPodVolumes gets the cached bindings and PVCs to provision in pod's volumes information, @@ -460,7 +482,7 @@ func (b *volumeBinder) BindPodVolumes(ctx context.Context, assumedPod *v1.Pod, p }() bindings := podVolumes.StaticBindings - claimsToProvision := podVolumes.DynamicProvisions + claimsToProvision := convertDynamicProvisionsToPVCs(podVolumes.DynamicProvisions) // Start API operations err = b.bindAPIUpdate(ctx, assumedPod, bindings, claimsToProvision) @@ -855,7 +877,7 @@ func (b *volumeBinder) findMatchingVolumes(logger klog.Logger, pod *v1.Pod, clai pvs := unboundVolumesDelayBinding[storageClassName] // Find a matching PV - pv, err := volume.FindMatchingVolume(pvc, pvs, node, chosenPVs, true, utilfeature.DefaultFeatureGate.Enabled(features.VolumeAttributesClass)) + pv, err := volume.FindMatchingVolume(pvc, pvs, node, chosenPVs, true, b.enableVolumeAttributesClass) if err != nil { return false, nil, nil, err } @@ -882,8 +904,8 @@ func (b *volumeBinder) findMatchingVolumes(logger klog.Logger, pod *v1.Pod, clai // checkVolumeProvisions checks given unbound claims (the claims have gone through func // findMatchingVolumes, and do not have matching volumes for binding), and return true // if all of the claims are eligible for dynamic provision. -func (b *volumeBinder) checkVolumeProvisions(logger klog.Logger, pod *v1.Pod, claimsToProvision []*v1.PersistentVolumeClaim, node *v1.Node) (provisionSatisfied, sufficientStorage bool, dynamicProvisions []*v1.PersistentVolumeClaim, err error) { - dynamicProvisions = []*v1.PersistentVolumeClaim{} +func (b *volumeBinder) checkVolumeProvisions(logger klog.Logger, pod *v1.Pod, claimsToProvision []*v1.PersistentVolumeClaim, node *v1.Node) (provisionSatisfied, sufficientStorage bool, dynamicProvisions []*DynamicProvision, err error) { + dynamicProvisions = []*DynamicProvision{} // We return early with provisionedClaims == nil if a check // fails or we encounter an error. @@ -911,7 +933,7 @@ func (b *volumeBinder) checkVolumeProvisions(logger klog.Logger, pod *v1.Pod, cl } // Check storage capacity. - sufficient, err := b.hasEnoughCapacity(logger, provisioner, claim, class, node) + sufficient, capacity, err := b.hasEnoughCapacity(logger, provisioner, claim, class, node) if err != nil { return false, false, nil, err } @@ -920,8 +942,10 @@ func (b *volumeBinder) checkVolumeProvisions(logger klog.Logger, pod *v1.Pod, cl return true, false, nil, nil } - dynamicProvisions = append(dynamicProvisions, claim) - + dynamicProvisions = append(dynamicProvisions, &DynamicProvision{ + PVC: claim, + NodeCapacity: capacity, + }) } logger.V(4).Info("Provisioning for claims of pod that has no matching volumes...", "claimCount", len(claimsToProvision), "pod", klog.KObj(pod), "node", klog.KObj(node)) @@ -941,12 +965,12 @@ func (b *volumeBinder) revertAssumedPVCs(claims []*v1.PersistentVolumeClaim) { } // hasEnoughCapacity checks whether the provisioner has enough capacity left for a new volume of the given size -// that is available from the node. -func (b *volumeBinder) hasEnoughCapacity(logger klog.Logger, provisioner string, claim *v1.PersistentVolumeClaim, storageClass *storagev1.StorageClass, node *v1.Node) (bool, error) { +// that is available from the node. This function returns the node capacity based on the PVC's storage class. +func (b *volumeBinder) hasEnoughCapacity(logger klog.Logger, provisioner string, claim *v1.PersistentVolumeClaim, storageClass *storagev1.StorageClass, node *v1.Node) (bool, *storagev1.CSIStorageCapacity, error) { quantity, ok := claim.Spec.Resources.Requests[v1.ResourceStorage] if !ok { // No capacity to check for. - return true, nil + return true, nil, nil } // Only enabled for CSI drivers which opt into it. @@ -956,19 +980,19 @@ func (b *volumeBinder) hasEnoughCapacity(logger klog.Logger, provisioner string, // Either the provisioner is not a CSI driver or the driver does not // opt into storage capacity scheduling. Either way, skip // capacity checking. - return true, nil + return true, nil, nil } - return false, err + return false, nil, err } if driver.Spec.StorageCapacity == nil || !*driver.Spec.StorageCapacity { - return true, nil + return true, nil, nil } // Look for a matching CSIStorageCapacity object(s). // TODO (for beta): benchmark this and potentially introduce some kind of lookup structure (https://github.com/kubernetes/enhancements/issues/1698#issuecomment-654356718). capacities, err := b.csiStorageCapacityLister.List(labels.Everything()) if err != nil { - return false, err + return false, nil, err } sizeInBytes := quantity.Value() @@ -977,7 +1001,7 @@ func (b *volumeBinder) hasEnoughCapacity(logger klog.Logger, provisioner string, capacitySufficient(capacity, sizeInBytes) && b.nodeHasAccess(logger, node, capacity) { // Enough capacity found. - return true, nil + return true, capacity, nil } } @@ -985,7 +1009,7 @@ func (b *volumeBinder) hasEnoughCapacity(logger klog.Logger, provisioner string, // they had to be rejected. Log that above? But that might be a lot of log output... logger.V(4).Info("Node has no accessible CSIStorageCapacity with enough capacity for PVC", "node", klog.KObj(node), "PVC", klog.KObj(claim), "size", sizeInBytes, "storageClass", klog.KObj(storageClass)) - return false, nil + return false, nil, nil } func capacitySufficient(capacity *storagev1.CSIStorageCapacity, sizeInBytes int64) bool { @@ -1033,7 +1057,7 @@ func (a byPVCSize) Less(i, j int) bool { } // isCSIMigrationOnForPlugin checks if CSI migration is enabled for a given plugin. -func isCSIMigrationOnForPlugin(pluginName string) bool { +func isCSIMigrationOnForPlugin(pluginName string, enableCSIMigrationPortworx bool) bool { switch pluginName { case csiplugins.AWSEBSInTreePluginName: return true @@ -1044,7 +1068,7 @@ func isCSIMigrationOnForPlugin(pluginName string) bool { case csiplugins.CinderInTreePluginName: return true case csiplugins.PortworxVolumePluginName: - return utilfeature.DefaultFeatureGate.Enabled(features.CSIMigrationPortworx) + return enableCSIMigrationPortworx } return false } @@ -1083,7 +1107,7 @@ func (b *volumeBinder) tryTranslatePVToCSI(logger klog.Logger, pv *v1.Persistent return nil, fmt.Errorf("could not get plugin name from pv: %v", err) } - if !isCSIMigrationOnForPlugin(pluginName) { + if !isCSIMigrationOnForPlugin(pluginName, b.enableCSIMigrationPortworx) { return pv, nil } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding/volume_binding.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding/volume_binding.go index 3eff2df8b..16179ec6b 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding/volume_binding.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding/volume_binding.go @@ -29,6 +29,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" corelisters "k8s.io/client-go/listers/core/v1" + storagelisters "k8s.io/client-go/listers/storage/v1" "k8s.io/component-helpers/storage/ephemeral" "k8s.io/klog/v2" "k8s.io/kubernetes/pkg/scheduler/apis/config" @@ -70,10 +71,11 @@ func (d *stateData) Clone() framework.StateData { // In the Filter phase, pod binding cache is created for the pod and used in // Reserve and PreBind phases. type VolumeBinding struct { - Binder SchedulerVolumeBinder - PVCLister corelisters.PersistentVolumeClaimLister - scorer volumeCapacityScorer - fts feature.Features + Binder SchedulerVolumeBinder + PVCLister corelisters.PersistentVolumeClaimLister + classLister storagelisters.StorageClassLister + scorer volumeCapacityScorer + fts feature.Features } var _ framework.PreFilterPlugin = &VolumeBinding{} @@ -451,14 +453,14 @@ func (pl *VolumeBinding) PreScore(ctx context.Context, cs *framework.CycleState, if err != nil { return framework.AsStatus(err) } - if state.hasStaticBindings { + if state.hasStaticBindings || pl.fts.EnableStorageCapacityScoring { return nil } return framework.NewStatus(framework.Skip) } // Score invoked at the score extension point. -func (pl *VolumeBinding) Score(ctx context.Context, cs *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) { +func (pl *VolumeBinding) Score(ctx context.Context, cs *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) (int64, *framework.Status) { if pl.scorer == nil { return 0, nil } @@ -466,24 +468,49 @@ func (pl *VolumeBinding) Score(ctx context.Context, cs *framework.CycleState, po if err != nil { return 0, framework.AsStatus(err) } + nodeName := nodeInfo.Node().Name podVolumes, ok := state.podVolumesByNode[nodeName] if !ok { return 0, nil } - // group by storage class + classResources := make(classResourceMap) - for _, staticBinding := range podVolumes.StaticBindings { - class := staticBinding.StorageClassName() - storageResource := staticBinding.StorageResource() - if _, ok := classResources[class]; !ok { - classResources[class] = &StorageResource{ - Requested: 0, - Capacity: 0, + if len(podVolumes.StaticBindings) != 0 || !pl.fts.EnableStorageCapacityScoring { + // group static binding volumes by storage class + for _, staticBinding := range podVolumes.StaticBindings { + class := staticBinding.StorageClassName() + storageResource := staticBinding.StorageResource() + if _, ok := classResources[class]; !ok { + classResources[class] = &StorageResource{ + Requested: 0, + Capacity: 0, + } } + classResources[class].Requested += storageResource.Requested + classResources[class].Capacity += storageResource.Capacity + } + } else { + // group dynamic binding volumes by storage class + for _, provision := range podVolumes.DynamicProvisions { + if provision.NodeCapacity == nil { + continue + } + class := *provision.PVC.Spec.StorageClassName + if _, ok := classResources[class]; !ok { + classResources[class] = &StorageResource{ + Requested: 0, + Capacity: 0, + } + } + // The following line cannot be +=. For example, if a Pod requests two 50GB volumes from + // a StorageClass with 100GB of capacity on a node, this part of the code will be executed twice. + // In that case, using += would incorrectly set classResources[class].Capacity to 200GB. + classResources[class].Capacity = provision.NodeCapacity.Capacity.Value() + requestedQty := provision.PVC.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)] + classResources[class].Requested += requestedQty.Value() } - classResources[class].Requested += storageResource.Requested - classResources[class].Capacity += storageResource.Capacity } + return pl.scorer(classResources), nil } @@ -565,7 +592,7 @@ func New(ctx context.Context, plArgs runtime.Object, fh framework.Handle, fts fe return nil, fmt.Errorf("want args to be of type VolumeBindingArgs, got %T", plArgs) } if err := validation.ValidateVolumeBindingArgsWithOptions(nil, args, validation.VolumeBindingArgsValidationOptions{ - AllowVolumeCapacityPriority: fts.EnableVolumeCapacityPriority, + AllowStorageCapacityScoring: fts.EnableStorageCapacityScoring, }); err != nil { return nil, err } @@ -579,11 +606,11 @@ func New(ctx context.Context, plArgs runtime.Object, fh framework.Handle, fts fe CSIDriverInformer: fh.SharedInformerFactory().Storage().V1().CSIDrivers(), CSIStorageCapacityInformer: fh.SharedInformerFactory().Storage().V1().CSIStorageCapacities(), } - binder := NewVolumeBinder(klog.FromContext(ctx), fh.ClientSet(), podInformer, nodeInformer, csiNodeInformer, pvcInformer, pvInformer, storageClassInformer, capacityCheck, time.Duration(args.BindTimeoutSeconds)*time.Second) + binder := NewVolumeBinder(klog.FromContext(ctx), fh.ClientSet(), fts, podInformer, nodeInformer, csiNodeInformer, pvcInformer, pvInformer, storageClassInformer, capacityCheck, time.Duration(args.BindTimeoutSeconds)*time.Second) // build score function var scorer volumeCapacityScorer - if fts.EnableVolumeCapacityPriority { + if fts.EnableStorageCapacityScoring { shape := make(helper.FunctionShape, 0, len(args.Shape)) for _, point := range args.Shape { shape = append(shape, helper.FunctionShapePoint{ @@ -594,9 +621,10 @@ func New(ctx context.Context, plArgs runtime.Object, fh framework.Handle, fts fe scorer = buildScorerFunction(shape) } return &VolumeBinding{ - Binder: binder, - PVCLister: pvcInformer.Lister(), - scorer: scorer, - fts: fts, + Binder: binder, + PVCLister: pvcInformer.Lister(), + classLister: storageClassInformer.Lister(), + scorer: scorer, + fts: fts, }, nil } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/preemption/preemption.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/preemption/preemption.go index 3b5c8daff..d23c18595 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/preemption/preemption.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/preemption/preemption.go @@ -40,7 +40,6 @@ import ( apipod "k8s.io/kubernetes/pkg/api/v1/pod" "k8s.io/kubernetes/pkg/scheduler/framework" "k8s.io/kubernetes/pkg/scheduler/framework/parallelize" - "k8s.io/kubernetes/pkg/scheduler/framework/plugins/names" "k8s.io/kubernetes/pkg/scheduler/metrics" "k8s.io/kubernetes/pkg/scheduler/util" ) @@ -149,7 +148,7 @@ func NewEvaluator(pluginName string, fh framework.Handle, i Interface, enableAsy pdbLister := fh.SharedInformerFactory().Policy().V1().PodDisruptionBudgets().Lister() ev := &Evaluator{ - PluginName: names.DefaultPreemption, + PluginName: pluginName, Handler: fh, PodLister: podLister, PdbLister: pdbLister, @@ -172,10 +171,11 @@ func NewEvaluator(pluginName string, fh framework.Handle, i Interface, enableAsy logger.V(2).Info("Preemptor pod rejected a waiting pod", "preemptor", klog.KObj(preemptor), "waitingPod", klog.KObj(victim), "node", c.Name()) } else { condition := &v1.PodCondition{ - Type: v1.DisruptionTarget, - Status: v1.ConditionTrue, - Reason: v1.PodReasonPreemptionByScheduler, - Message: fmt.Sprintf("%s: preempting to accommodate a higher priority pod", preemptor.Spec.SchedulerName), + Type: v1.DisruptionTarget, + ObservedGeneration: apipod.GetPodObservedGenerationIfEnabledOnCondition(&victim.Status, victim.Generation, v1.DisruptionTarget), + Status: v1.ConditionTrue, + Reason: v1.PodReasonPreemptionByScheduler, + Message: fmt.Sprintf("%s: preempting to accommodate a higher priority pod", preemptor.Spec.SchedulerName), } newStatus := victim.Status.DeepCopy() updated := apipod.UpdatePodCondition(newStatus, condition) @@ -261,6 +261,7 @@ func (ev *Evaluator) Preempt(ctx context.Context, state *framework.CycleState, p // Return a FitError only when there are no candidates that fit the pod. if len(candidates) == 0 { + logger.V(2).Info("No preemption candidate is found; preemption is not helpful for scheduling", "pod", klog.KObj(pod)) fitError := &framework.FitError{ Pod: pod, NumAllNodes: len(allNodes), diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/runtime/framework.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/runtime/framework.go index 0fe2a0257..77dc23bc5 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/runtime/framework.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/runtime/framework.go @@ -1011,7 +1011,7 @@ func (f *frameworkImpl) RunFilterPluginsWithNominatedPods(ctx context.Context, s nodeInfoToUse := info if i == 0 { var err error - podsAdded, stateToUse, nodeInfoToUse, err = addNominatedPods(ctx, f, pod, state, info) + podsAdded, stateToUse, nodeInfoToUse, err = addGENominatedPods(ctx, f, pod, state, info) if err != nil { return framework.AsStatus(err) } @@ -1028,10 +1028,10 @@ func (f *frameworkImpl) RunFilterPluginsWithNominatedPods(ctx context.Context, s return status } -// addNominatedPods adds pods with equal or greater priority which are nominated +// addGENominatedPods adds pods with equal or greater priority which are nominated // to run on the node. It returns 1) whether any pod was added, 2) augmented cycleState, // 3) augmented nodeInfo. -func addNominatedPods(ctx context.Context, fh framework.Handle, pod *v1.Pod, state *framework.CycleState, nodeInfo *framework.NodeInfo) (bool, *framework.CycleState, *framework.NodeInfo, error) { +func addGENominatedPods(ctx context.Context, fh framework.Handle, pod *v1.Pod, state *framework.CycleState, nodeInfo *framework.NodeInfo) (bool, *framework.CycleState, *framework.NodeInfo, error) { if fh == nil { // This may happen only in tests. return false, state, nodeInfo, nil @@ -1137,7 +1137,8 @@ func (f *frameworkImpl) RunScorePlugins(ctx context.Context, state *framework.Cy } // Run Score method for each node in parallel. f.Parallelizer().Until(ctx, len(nodes), func(index int) { - nodeName := nodes[index].Node().Name + nodeInfo := nodes[index] + nodeName := nodeInfo.Node().Name logger := logger if verboseLogs { logger = klog.LoggerWithValues(logger, "node", klog.ObjectRef{Name: nodeName}) @@ -1148,7 +1149,7 @@ func (f *frameworkImpl) RunScorePlugins(ctx context.Context, state *framework.Cy logger := klog.LoggerWithName(logger, pl.Name()) ctx = klog.NewContext(ctx, logger) } - s, status := f.runScorePlugin(ctx, pl, state, pod, nodeName) + s, status := f.runScorePlugin(ctx, pl, state, pod, nodeInfo) if !status.IsSuccess() { err := fmt.Errorf("plugin %q failed with: %w", pl.Name(), status.AsError()) errCh.SendErrorWithCancel(err, cancel) @@ -1217,12 +1218,12 @@ func (f *frameworkImpl) RunScorePlugins(ctx context.Context, state *framework.Cy return allNodePluginScores, nil } -func (f *frameworkImpl) runScorePlugin(ctx context.Context, pl framework.ScorePlugin, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) { +func (f *frameworkImpl) runScorePlugin(ctx context.Context, pl framework.ScorePlugin, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) (int64, *framework.Status) { if !state.ShouldRecordPluginMetrics() { - return pl.Score(ctx, state, pod, nodeName) + return pl.Score(ctx, state, pod, nodeInfo) } startTime := time.Now() - s, status := pl.Score(ctx, state, pod, nodeName) + s, status := pl.Score(ctx, state, pod, nodeInfo) f.metricsRecorder.ObservePluginDurationAsync(metrics.Score, pl.Name(), status.Code().String(), metrics.SinceInSeconds(startTime)) return s, status } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/runtime/instrumented_plugins.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/runtime/instrumented_plugins.go index f285ad00b..04e9004c8 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/runtime/instrumented_plugins.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/runtime/instrumented_plugins.go @@ -77,7 +77,7 @@ type instrumentedScorePlugin struct { var _ framework.ScorePlugin = &instrumentedScorePlugin{} -func (p *instrumentedScorePlugin) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) { +func (p *instrumentedScorePlugin) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) (int64, *framework.Status) { p.metric.Inc() - return p.ScorePlugin.Score(ctx, state, pod, nodeName) + return p.ScorePlugin.Score(ctx, state, pod, nodeInfo) } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/types.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/types.go index ac6718997..fbc02a223 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/types.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/framework/types.go @@ -72,9 +72,9 @@ const ( UpdatePodLabel // UpdatePodScaleDown is an update for pod's scale down (i.e., any resource request is reduced). UpdatePodScaleDown - // UpdatePodTolerations is an addition for pod's tolerations. + // UpdatePodToleration is an addition for pod's tolerations. // (Due to API validation, we can add, but cannot modify or remove tolerations.) - UpdatePodTolerations + UpdatePodToleration // UpdatePodSchedulingGatesEliminated is an update for pod's scheduling gates, which eliminates all scheduling gates in the Pod. UpdatePodSchedulingGatesEliminated // UpdatePodGeneratedResourceClaim is an update of the list of ResourceClaims generated for the pod. @@ -88,7 +88,7 @@ const ( All ActionType = 1< 0 { +func (n *NodeInfo) update(podInfo *PodInfo, sign int64) { + podResource := podInfo.calculateResource() + n.Requested.MilliCPU += sign * podResource.resource.MilliCPU + n.Requested.Memory += sign * podResource.resource.Memory + n.Requested.EphemeralStorage += sign * podResource.resource.EphemeralStorage + if n.Requested.ScalarResources == nil && len(podResource.resource.ScalarResources) > 0 { n.Requested.ScalarResources = map[v1.ResourceName]int64{} } - for rName, rQuant := range res.ScalarResources { + for rName, rQuant := range podResource.resource.ScalarResources { n.Requested.ScalarResources[rName] += sign * rQuant } - n.NonZeroRequested.MilliCPU += sign * non0CPU - n.NonZeroRequested.Memory += sign * non0Mem + n.NonZeroRequested.MilliCPU += sign * podResource.non0CPU + n.NonZeroRequested.Memory += sign * podResource.non0Mem // Consume ports when pod added or release ports when pod removed. - n.updateUsedPorts(pod, sign > 0) - n.updatePVCRefCounts(pod, sign > 0) + n.updateUsedPorts(podInfo.Pod, sign > 0) + n.updatePVCRefCounts(podInfo.Pod, sign > 0) n.Generation = nextGeneration() } @@ -1103,20 +1126,25 @@ func getNonMissingContainerRequests(requests v1.ResourceList, podLevelResourcesS } -func calculateResource(pod *v1.Pod) (Resource, int64, int64) { - requests := resourcehelper.PodRequests(pod, resourcehelper.PodResourcesOptions{ - UseStatusResources: utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling), +func (pi *PodInfo) calculateResource() podResource { + if pi.cachedResource != nil { + return *pi.cachedResource + } + inPlacePodVerticalScalingEnabled := utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling) + podLevelResourcesEnabled := utilfeature.DefaultFeatureGate.Enabled(features.PodLevelResources) + requests := resourcehelper.PodRequests(pi.Pod, resourcehelper.PodResourcesOptions{ + UseStatusResources: inPlacePodVerticalScalingEnabled, // SkipPodLevelResources is set to false when PodLevelResources feature is enabled. - SkipPodLevelResources: !utilfeature.DefaultFeatureGate.Enabled(features.PodLevelResources), + SkipPodLevelResources: !podLevelResourcesEnabled, }) - isPodLevelResourcesSet := utilfeature.DefaultFeatureGate.Enabled(features.PodLevelResources) && resourcehelper.IsPodLevelRequestsSet(pod) + isPodLevelResourcesSet := podLevelResourcesEnabled && resourcehelper.IsPodLevelRequestsSet(pi.Pod) nonMissingContainerRequests := getNonMissingContainerRequests(requests, isPodLevelResourcesSet) non0Requests := requests if len(nonMissingContainerRequests) > 0 { - non0Requests = resourcehelper.PodRequests(pod, resourcehelper.PodResourcesOptions{ - UseStatusResources: utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling), + non0Requests = resourcehelper.PodRequests(pi.Pod, resourcehelper.PodResourcesOptions{ + UseStatusResources: inPlacePodVerticalScalingEnabled, // SkipPodLevelResources is set to false when PodLevelResources feature is enabled. - SkipPodLevelResources: !utilfeature.DefaultFeatureGate.Enabled(features.PodLevelResources), + SkipPodLevelResources: !podLevelResourcesEnabled, NonMissingContainerRequests: nonMissingContainerRequests, }) } @@ -1125,7 +1153,13 @@ func calculateResource(pod *v1.Pod) (Resource, int64, int64) { var res Resource res.Add(requests) - return res, non0CPU.MilliValue(), non0Mem.Value() + podResource := podResource{ + resource: res, + non0CPU: non0CPU.MilliValue(), + non0Mem: non0Mem.Value(), + } + pi.cachedResource = &podResource + return podResource } // updateUsedPorts updates the UsedPorts of NodeInfo. diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/metrics/metrics.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/metrics/metrics.go index 7fc649793..3d0edacd9 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/metrics/metrics.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/metrics/metrics.go @@ -102,16 +102,16 @@ var ( InFlightEvents *metrics.GaugeVec Goroutines *metrics.GaugeVec - // PodSchedulingDuration is deprecated as of Kubernetes v1.28, and will be removed - // in v1.31. Please use PodSchedulingSLIDuration instead. - PodSchedulingDuration *metrics.HistogramVec PodSchedulingSLIDuration *metrics.HistogramVec PodSchedulingAttempts *metrics.Histogram FrameworkExtensionPointDuration *metrics.HistogramVec PluginExecutionDuration *metrics.HistogramVec - PermitWaitDuration *metrics.HistogramVec - CacheSize *metrics.GaugeVec + PermitWaitDuration *metrics.HistogramVec + CacheSize *metrics.GaugeVec + // Deprecated: SchedulerCacheSize is deprecated, + // and will be removed at v1.34. Please use CacheSize instead. + SchedulerCacheSize *metrics.GaugeVec unschedulableReasons *metrics.GaugeVec PluginEvaluationTotal *metrics.CounterVec @@ -220,20 +220,6 @@ func InitMetrics() { StabilityLevel: metrics.ALPHA, }, []string{"operation"}) - // PodSchedulingDuration is deprecated as of Kubernetes v1.28, and will be removed - // in v1.31. Please use PodSchedulingSLIDuration instead. - PodSchedulingDuration = metrics.NewHistogramVec( - &metrics.HistogramOpts{ - Subsystem: SchedulerSubsystem, - Name: "pod_scheduling_duration_seconds", - Help: "E2e latency for a pod being scheduled which may include multiple scheduling attempts.", - // Start with 10ms with the last bucket being [~88m, Inf). - Buckets: metrics.ExponentialBuckets(0.01, 2, 20), - StabilityLevel: metrics.STABLE, - DeprecatedVersion: "1.29.0", - }, - []string{"attempts"}) - PodSchedulingSLIDuration = metrics.NewHistogramVec( &metrics.HistogramOpts{ Subsystem: SchedulerSubsystem, @@ -308,10 +294,19 @@ func InitMetrics() { }, []string{"result"}) + SchedulerCacheSize = metrics.NewGaugeVec( + &metrics.GaugeOpts{ + Subsystem: SchedulerSubsystem, + Name: "scheduler_cache_size", + Help: "Number of nodes, pods, and assumed (bound) pods in the scheduler cache.", + StabilityLevel: metrics.ALPHA, + DeprecatedVersion: "1.33.0", + }, []string{"type"}) + CacheSize = metrics.NewGaugeVec( &metrics.GaugeOpts{ Subsystem: SchedulerSubsystem, - Name: "scheduler_cache_size", + Name: "cache_size", Help: "Number of nodes, pods, and assumed (bound) pods in the scheduler cache.", StabilityLevel: metrics.ALPHA, }, []string{"type"}) @@ -359,7 +354,6 @@ func InitMetrics() { PreemptionVictims, PreemptionAttempts, pendingPods, - PodSchedulingDuration, PodSchedulingSLIDuration, PodSchedulingAttempts, FrameworkExtensionPointDuration, @@ -368,6 +362,7 @@ func InitMetrics() { Goroutines, PermitWaitDuration, CacheSize, + SchedulerCacheSize, unschedulableReasons, PluginEvaluationTotal, } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/profile/profile.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/profile/profile.go index 692104abe..9cd510d35 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/profile/profile.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/profile/profile.go @@ -22,7 +22,7 @@ import ( "errors" "fmt" - "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp" //nolint:depguard "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/scheme" diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/schedule_one.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/schedule_one.go index 11bb49338..35b784922 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/schedule_one.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/schedule_one.go @@ -292,30 +292,19 @@ func (sched *Scheduler) bindingCycle( return status } - // Run "prebind" plugins. - if status := fwk.RunPreBindPlugins(ctx, state, assumedPod, scheduleResult.SuggestedHost); !status.IsSuccess() { - if status.IsRejected() { - fitErr := &framework.FitError{ - NumAllNodes: 1, - Pod: assumedPodInfo.Pod, - Diagnosis: framework.Diagnosis{ - NodeToStatus: framework.NewDefaultNodeToStatus(), - UnschedulablePlugins: sets.New(status.Plugin()), - }, - } - fitErr.Diagnosis.NodeToStatus.Set(scheduleResult.SuggestedHost, status) - return framework.NewStatus(status.Code()).WithError(fitErr) - } - return status - } - // Any failures after this point cannot lead to the Pod being considered unschedulable. - // We define the Pod as "unschedulable" only when Pods are rejected at specific extension points, and PreBind is the last one in the scheduling/binding cycle. + // We define the Pod as "unschedulable" only when Pods are rejected at specific extension points, and Permit is the last one in the scheduling/binding cycle. + // If a Pod fails on PreBind or Bind, it should be moved to BackoffQ for retry. // // We can call Done() here because - // we can free the cluster events stored in the scheduling queue sonner, which is worth for busy clusters memory consumption wise. + // we can free the cluster events stored in the scheduling queue sooner, which is worth for busy clusters memory consumption wise. sched.SchedulingQueue.Done(assumedPod.UID) + // Run "prebind" plugins. + if status := fwk.RunPreBindPlugins(ctx, state, assumedPod, scheduleResult.SuggestedHost); !status.IsSuccess() { + return status + } + // Run "bind" plugins. if status := sched.bind(ctx, fwk, assumedPod, scheduleResult.SuggestedHost, state); !status.IsSuccess() { return status @@ -326,7 +315,6 @@ func (sched *Scheduler) bindingCycle( metrics.PodScheduled(fwk.ProfileName(), metrics.SinceInSeconds(start)) metrics.PodSchedulingAttempts.Observe(float64(assumedPodInfo.Attempts)) if assumedPodInfo.InitialAttemptTimestamp != nil { - metrics.PodSchedulingDuration.WithLabelValues(getAttemptsLabel(assumedPodInfo)).Observe(metrics.SinceInSeconds(*assumedPodInfo.InitialAttemptTimestamp)) metrics.PodSchedulingSLIDuration.WithLabelValues(getAttemptsLabel(assumedPodInfo)).Observe(metrics.SinceInSeconds(*assumedPodInfo.InitialAttemptTimestamp)) } // Run "postbind" plugins. @@ -1098,10 +1086,11 @@ func (sched *Scheduler) handleSchedulingFailure(ctx context.Context, fwk framewo msg := truncateMessage(errMsg) fwk.EventRecorder().Eventf(pod, nil, v1.EventTypeWarning, "FailedScheduling", "Scheduling", msg) if err := updatePod(ctx, sched.client, pod, &v1.PodCondition{ - Type: v1.PodScheduled, - Status: v1.ConditionFalse, - Reason: reason, - Message: errMsg, + Type: v1.PodScheduled, + ObservedGeneration: podutil.GetPodObservedGenerationIfEnabledOnCondition(&pod.Status, pod.Generation, v1.PodScheduled), + Status: v1.ConditionFalse, + Reason: reason, + Message: errMsg, }, nominatingInfo); err != nil { logger.Error(err, "Error updating pod", "pod", klog.KObj(pod)) } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/scheduler.go b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/scheduler.go index e0b6ba644..0fd972fbc 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/scheduler.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/scheduler/scheduler.go @@ -33,6 +33,7 @@ import ( clientset "k8s.io/client-go/kubernetes" restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/cache" + resourceslicetracker "k8s.io/dynamic-resource-allocation/resourceslice/tracker" "k8s.io/klog/v2" configv1 "k8s.io/kube-scheduler/config/v1" "k8s.io/kubernetes/pkg/features" @@ -50,6 +51,7 @@ import ( "k8s.io/kubernetes/pkg/scheduler/metrics" "k8s.io/kubernetes/pkg/scheduler/profile" "k8s.io/kubernetes/pkg/scheduler/util/assumecache" + "k8s.io/utils/clock" ) const ( @@ -116,6 +118,7 @@ func (sched *Scheduler) applyDefaultHandlers() { } type schedulerOptions struct { + clock clock.WithTicker componentConfigVersion string kubeConfig *restclient.Config // Overridden by profile level percentageOfNodesToScore if set in v1. @@ -227,6 +230,13 @@ func WithExtenders(e ...schedulerapi.Extender) Option { } } +// WithClock sets clock for PriorityQueue, the default clock is clock.RealClock. +func WithClock(clock clock.WithTicker) Option { + return func(o *schedulerOptions) { + o.clock = clock + } +} + // FrameworkCapturer is used for registering a notify function in building framework. type FrameworkCapturer func(schedulerapi.KubeSchedulerProfile) @@ -238,6 +248,7 @@ func WithBuildFrameworkCapturer(fc FrameworkCapturer) Option { } var defaultSchedulerOptions = schedulerOptions{ + clock: clock.RealClock{}, percentageOfNodesToScore: schedulerapi.DefaultPercentageOfNodesToScore, podInitialBackoffSeconds: int64(internalqueue.DefaultPodInitialBackoffDuration.Seconds()), podMaxBackoffSeconds: int64(internalqueue.DefaultPodMaxBackoffDuration.Seconds()), @@ -297,11 +308,27 @@ func New(ctx context.Context, waitingPods := frameworkruntime.NewWaitingPodsMap() var resourceClaimCache *assumecache.AssumeCache + var resourceSliceTracker *resourceslicetracker.Tracker var draManager framework.SharedDRAManager if utilfeature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation) { resourceClaimInformer := informerFactory.Resource().V1beta1().ResourceClaims().Informer() resourceClaimCache = assumecache.NewAssumeCache(logger, resourceClaimInformer, "ResourceClaim", "", nil) - draManager = dynamicresources.NewDRAManager(ctx, resourceClaimCache, informerFactory) + resourceSliceTrackerOpts := resourceslicetracker.Options{ + EnableDeviceTaints: utilfeature.DefaultFeatureGate.Enabled(features.DRADeviceTaints), + SliceInformer: informerFactory.Resource().V1beta1().ResourceSlices(), + KubeClient: client, + } + // If device taints are disabled, the additional informers are not needed and + // the tracker turns into a simple wrapper around the slice informer. + if resourceSliceTrackerOpts.EnableDeviceTaints { + resourceSliceTrackerOpts.TaintInformer = informerFactory.Resource().V1alpha3().DeviceTaintRules() + resourceSliceTrackerOpts.ClassInformer = informerFactory.Resource().V1beta1().DeviceClasses() + } + resourceSliceTracker, err = resourceslicetracker.StartTracker(ctx, resourceSliceTrackerOpts) + if err != nil { + return nil, fmt.Errorf("couldn't start resource slice tracker: %w", err) + } + draManager = dynamicresources.NewDRAManager(ctx, resourceClaimCache, resourceSliceTracker, informerFactory) } profiles, err := profile.NewMap(ctx, options.profiles, registry, recorderFactory, @@ -343,6 +370,7 @@ func New(ctx context.Context, podQueue := internalqueue.NewSchedulingQueue( profiles[options.profiles[0].SchedulerName].QueueSortFunc(), informerFactory, + internalqueue.WithClock(options.clock), internalqueue.WithPodInitialBackoffDuration(time.Duration(options.podInitialBackoffSeconds)*time.Second), internalqueue.WithPodMaxBackoffDuration(time.Duration(options.podMaxBackoffSeconds)*time.Second), internalqueue.WithPodLister(podLister), @@ -378,7 +406,7 @@ func New(ctx context.Context, sched.NextPod = podQueue.Pop sched.applyDefaultHandlers() - if err = addAllEventHandlers(sched, informerFactory, dynInformerFactory, resourceClaimCache, unionedGVKs(queueingHintsPerProfile)); err != nil { + if err = addAllEventHandlers(sched, informerFactory, dynInformerFactory, resourceClaimCache, resourceSliceTracker, unionedGVKs(queueingHintsPerProfile)); err != nil { return nil, fmt.Errorf("adding event handlers: %w", err) } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/securitycontext/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/securitycontext/doc.go index 3ec795d47..529451e50 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/securitycontext/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/securitycontext/doc.go @@ -15,4 +15,4 @@ limitations under the License. */ // Package securitycontext contains security context api implementations -package securitycontext // import "k8s.io/kubernetes/pkg/securitycontext" +package securitycontext diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/util/filesystem/defaultfs.go b/e2e/vendor/k8s.io/kubernetes/pkg/util/filesystem/defaultfs.go index ef99bd3bc..0dfd11fb4 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/util/filesystem/defaultfs.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/util/filesystem/defaultfs.go @@ -90,7 +90,7 @@ func MkdirAllWithPathCheck(path string, perm os.FileMode) error { // 1. for Unix/Linux OS, check if the path is directory. // 2. for windows NTFS, check if the path is symlink instead of directory. if dir.IsDir() || - (runtime.GOOS == "windows" && (dir.Mode()&os.ModeSymlink != 0)) { + (runtime.GOOS == "windows" && (dir.Mode()&os.ModeSymlink != 0 || dir.Mode()&os.ModeIrregular != 0)) { return nil } return fmt.Errorf("path %v exists but is not a directory", path) diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/util/filesystem/util_windows.go b/e2e/vendor/k8s.io/kubernetes/pkg/util/filesystem/util_windows.go index 5cdc586d6..95616d34f 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/util/filesystem/util_windows.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/util/filesystem/util_windows.go @@ -46,20 +46,21 @@ const ( // Note that due to the retry logic inside, it could take up to 4 seconds // to determine whether or not the file path supplied is a Unix domain socket func IsUnixDomainSocket(filePath string) (bool, error) { - // Due to the absence of golang support for os.ModeSocket in Windows (https://github.com/golang/go/issues/33357) - // we need to dial the file and check if we receive an error to determine if a file is Unix Domain Socket file. - // Note that querrying for the Reparse Points (https://docs.microsoft.com/en-us/windows/win32/fileio/reparse-points) // for the file (using FSCTL_GET_REPARSE_POINT) and checking for reparse tag: reparseTagSocket // does NOT work in 1809 if the socket file is created within a bind mounted directory by a container // and the FSCTL is issued in the host by the kubelet. // If the file does not exist, it cannot be a Unix domain socket. - if _, err := os.Stat(filePath); os.IsNotExist(err) { + if info, err := os.Stat(filePath); os.IsNotExist(err) { return false, fmt.Errorf("File %s not found. Err: %v", filePath, err) + } else if err == nil && info.Mode()&os.ModeSocket != 0 { // Use os.ModeSocket (introduced in Go 1.23 on Windows) + klog.V(6).InfoS("File identified as a Unix domain socket", "filePath", filePath) + return true, nil } - klog.V(6).InfoS("Function IsUnixDomainSocket starts", "filePath", filePath) + // Due to the absence of golang support for os.ModeSocket in Windows (https://github.com/golang/go/issues/33357) + // we need to dial the file and check if we receive an error to determine if a file is Unix Domain Socket file. // As detailed in https://github.com/kubernetes/kubernetes/issues/104584 we cannot rely // on the Unix Domain socket working on the very first try, hence the potential need to // dial multiple times @@ -94,14 +95,21 @@ func IsUnixDomainSocket(filePath string) (bool, error) { // permissions once the directory is created. func MkdirAll(path string, perm os.FileMode) error { klog.V(6).InfoS("Function MkdirAll starts", "path", path, "perm", perm) + if _, err := os.Stat(path); err == nil { + // Path already exists: nothing to do. + return nil + } else if !os.IsNotExist(err) { + return fmt.Errorf("error checking path %s: %w", path, err) + } + err := os.MkdirAll(path, perm) if err != nil { - return fmt.Errorf("Error creating directory %s: %v", path, err) + return fmt.Errorf("error creating directory %s: %w", path, err) } err = Chmod(path, perm) if err != nil { - return fmt.Errorf("Error setting permissions for directory %s: %v", path, err) + return fmt.Errorf("error setting permissions for directory %s: %w", path, err) } return nil diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/util/kernel/constants.go b/e2e/vendor/k8s.io/kubernetes/pkg/util/kernel/constants.go index ea46d46cb..1467f6c22 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/util/kernel/constants.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/util/kernel/constants.go @@ -44,10 +44,6 @@ const TCPFinTimeoutNamespacedKernelVersion = "4.6" // (ref: https://github.com/torvalds/linux/commit/35dfb013149f74c2be1ff9c78f14e6a3cd1539d1) const IPVSConnReuseModeFixedKernelVersion = "5.9" -// UserNamespacesSupportKernelVersion is the kernel version where idmap for tmpfs support was added -// (ref: https://github.com/torvalds/linux/commit/05e6295f7b5e05f09e369a3eb2882ec5b40fff20) -const UserNamespacesSupportKernelVersion = "6.3" - const TmpfsNoswapSupportKernelVersion = "6.4" // NFTablesKubeProxyKernelVersion is the lowest kernel version kube-proxy supports using diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/util/oom/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/util/oom/doc.go index 29148f6f5..9825a53f2 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/util/oom/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/util/oom/doc.go @@ -15,4 +15,4 @@ limitations under the License. */ // Package oom implements utility functions relating to out of memory management. -package oom // import "k8s.io/kubernetes/pkg/util/oom" +package oom diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/volume/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/volume/doc.go index c98a5a153..df39f3291 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/volume/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/volume/doc.go @@ -16,4 +16,4 @@ limitations under the License. // Package volume includes internal representations of external volume types // as well as utility methods required to mount/unmount volumes to kubelets. -package volume // import "k8s.io/kubernetes/pkg/volume" +package volume diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/volume/metrics_block.go b/e2e/vendor/k8s.io/kubernetes/pkg/volume/metrics_block.go index e370afca2..2376f468b 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/volume/metrics_block.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/volume/metrics_block.go @@ -37,7 +37,7 @@ type metricsBlock struct { device string } -// NewMetricsStatfs creates a new metricsBlock with the device node of the +// NewMetricsBlock creates a new metricsBlock with the device node of the // Volume. func NewMetricsBlock(device string) MetricsProvider { return &metricsBlock{device} diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/volume/metrics_errors.go b/e2e/vendor/k8s.io/kubernetes/pkg/volume/metrics_errors.go index 0f7987e09..93858b1c0 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/volume/metrics_errors.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/volume/metrics_errors.go @@ -23,7 +23,11 @@ import ( const ( // ErrCodeNotSupported code for NotSupported Errors. ErrCodeNotSupported int = iota + 1 + + // ErrCodeNoPathDefined code for NoPathDefined Errors. ErrCodeNoPathDefined + + // ErrCodeFsInfoFailed code for FsInfoFailed Errors. ErrCodeFsInfoFailed ) diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/volume/metrics_statfs.go b/e2e/vendor/k8s.io/kubernetes/pkg/volume/metrics_statfs.go index 81a6748b1..74b3a1fb7 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/volume/metrics_statfs.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/volume/metrics_statfs.go @@ -34,7 +34,7 @@ type metricsStatFS struct { path string } -// NewMetricsStatfs creates a new metricsStatFS with the Volume path. +// NewMetricsStatFS creates a new metricsStatFS with the Volume path. func NewMetricsStatFS(path string) MetricsProvider { return &metricsStatFS{path} } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/volume/plugins.go b/e2e/vendor/k8s.io/kubernetes/pkg/volume/plugins.go index 8eea6f6ac..c4e5fee28 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/volume/plugins.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/volume/plugins.go @@ -44,7 +44,10 @@ import ( "k8s.io/kubernetes/pkg/volume/util/subpath" ) +// ProbeOperation represents a type of operation for probing volume plugins. type ProbeOperation uint32 + +// ProbeEvent represents an event triggered during a volume plugin probe operation. type ProbeEvent struct { Plugin VolumePlugin // VolumePlugin that was added/updated/removed. if ProbeEvent.Op is 'ProbeRemove', Plugin should be nil PluginName string @@ -52,17 +55,22 @@ type ProbeEvent struct { } const ( - // Common parameter which can be specified in StorageClass to specify the desired FSType + // VolumeParameterFSType is a common parameter which can be specified in StorageClass to specify the desired FSType // Provisioners SHOULD implement support for this if they are block device based // Must be a filesystem type supported by the host operating system. // Ex. "ext4", "xfs", "ntfs". Default value depends on the provisioner VolumeParameterFSType = "fstype" + // ProbeAddOrUpdate represents an operation where a probe is added or updated. ProbeAddOrUpdate ProbeOperation = 1 << iota + + // ProbeRemove represents an operation to remove a probe. + // This operation is used to indicate that a previously added probe should be removed. ProbeRemove ) -var ErrNoPluiginMatched = errors.New("no volume plugin matched") +// ErrNoPluginMatched is used to return when no volume plugin matches the requested type. +var ErrNoPluginMatched = errors.New("no volume plugin matched") // VolumeOptions contains option information about a volume. type VolumeOptions struct { @@ -108,6 +116,7 @@ type NodeResizeOptions struct { OldSize resource.Quantity } +// DynamicPluginProber is an interface that defines methods for probing dynamic volume plugins. type DynamicPluginProber interface { Init() error @@ -225,6 +234,7 @@ type AttachableVolumePlugin interface { NewDetacher() (Detacher, error) // CanAttach tests if provided volume spec is attachable CanAttach(spec *Spec) (bool, error) + VerifyExhaustedResource(spec *Spec, nodeName types.NodeName) } // DeviceMountableVolumePlugin is an extended interface of VolumePlugin and is used @@ -628,9 +638,8 @@ func (pm *VolumePluginMgr) initProbedPlugin(probedPlugin VolumePlugin) error { // specification. If no plugins can support or more than one plugin can // support it, return error. func (pm *VolumePluginMgr) FindPluginBySpec(spec *Spec) (VolumePlugin, error) { - pm.mutex.RLock() - defer pm.mutex.RUnlock() - + pm.mutex.Lock() + defer pm.mutex.Unlock() if spec == nil { return nil, fmt.Errorf("could not find plugin because volume spec is nil") } @@ -643,8 +652,8 @@ func (pm *VolumePluginMgr) FindPluginBySpec(spec *Spec) (VolumePlugin, error) { matchedPluginNames = append(matchedPluginNames, v.GetPluginName()) } } - pm.refreshProbedPlugins() + for _, plugin := range pm.probedPlugins { if plugin.CanSupport(spec) { match = plugin @@ -653,7 +662,7 @@ func (pm *VolumePluginMgr) FindPluginBySpec(spec *Spec) (VolumePlugin, error) { } if len(matchedPluginNames) == 0 { - return nil, ErrNoPluiginMatched + return nil, ErrNoPluginMatched } if len(matchedPluginNames) > 1 { return nil, fmt.Errorf("multiple volume plugins matched: %s", strings.Join(matchedPluginNames, ",")) @@ -664,14 +673,13 @@ func (pm *VolumePluginMgr) FindPluginBySpec(spec *Spec) (VolumePlugin, error) { // FindPluginByName fetches a plugin by name. If no plugin is found, returns error. func (pm *VolumePluginMgr) FindPluginByName(name string) (VolumePlugin, error) { - pm.mutex.RLock() - defer pm.mutex.RUnlock() + pm.mutex.Lock() + defer pm.mutex.Unlock() var match VolumePlugin if v, found := pm.plugins[name]; found { match = v } - pm.refreshProbedPlugins() if plugin, found := pm.probedPlugins[name]; found { if match != nil { @@ -698,6 +706,7 @@ func (pm *VolumePluginMgr) refreshProbedPlugins() { // because the probe function can return a list of valid plugins // even when an error is present we still must add the plugins // or they will be skipped because each event only fires once + for _, event := range events { if event.Op == ProbeAddOrUpdate { if err := pm.initProbedPlugin(event.Plugin); err != nil { @@ -730,7 +739,7 @@ func (pm *VolumePluginMgr) FindPersistentPluginBySpec(spec *Spec) (PersistentVol return nil, fmt.Errorf("no persistent volume plugin matched") } -// FindPersistentPluginByName fetches a persistent volume plugin by name. If +// FindPersistentPluginByName fetches a recyclable persistent volume plugin by name. If // no plugin is found, returns error. func (pm *VolumePluginMgr) FindPersistentPluginByName(name string) (PersistentVolumePlugin, error) { volumePlugin, err := pm.FindPluginByName(name) @@ -743,7 +752,7 @@ func (pm *VolumePluginMgr) FindPersistentPluginByName(name string) (PersistentVo return nil, fmt.Errorf("no persistent volume plugin matched") } -// FindRecyclablePluginByName fetches a persistent volume plugin by name. If +// FindRecyclablePluginBySpec fetches a recyclable persistent volume plugin by spec. If // no plugin is found, returns error. func (pm *VolumePluginMgr) FindRecyclablePluginBySpec(spec *Spec) (RecyclableVolumePlugin, error) { volumePlugin, err := pm.FindPluginBySpec(spec) @@ -756,7 +765,7 @@ func (pm *VolumePluginMgr) FindRecyclablePluginBySpec(spec *Spec) (RecyclableVol return nil, fmt.Errorf("no recyclable volume plugin matched") } -// FindProvisionablePluginByName fetches a persistent volume plugin by name. If +// FindProvisionablePluginByName fetches a provisionable persistent volume plugin by name. If // no plugin is found, returns error. func (pm *VolumePluginMgr) FindProvisionablePluginByName(name string) (ProvisionableVolumePlugin, error) { volumePlugin, err := pm.FindPluginByName(name) @@ -769,7 +778,7 @@ func (pm *VolumePluginMgr) FindProvisionablePluginByName(name string) (Provision return nil, fmt.Errorf("no provisionable volume plugin matched") } -// FindDeletablePluginBySpec fetches a persistent volume plugin by spec. If +// FindDeletablePluginBySpec fetches a provisionable persistent volume plugin by spec. If // no plugin is found, returns error. func (pm *VolumePluginMgr) FindDeletablePluginBySpec(spec *Spec) (DeletableVolumePlugin, error) { volumePlugin, err := pm.FindPluginBySpec(spec) @@ -782,7 +791,7 @@ func (pm *VolumePluginMgr) FindDeletablePluginBySpec(spec *Spec) (DeletableVolum return nil, fmt.Errorf("no deletable volume plugin matched") } -// FindDeletablePluginByName fetches a persistent volume plugin by name. If +// FindDeletablePluginByName fetches a deleteable persistent volume plugin by name. If // no plugin is found, returns error. func (pm *VolumePluginMgr) FindDeletablePluginByName(name string) (DeletableVolumePlugin, error) { volumePlugin, err := pm.FindPluginByName(name) @@ -829,7 +838,7 @@ func (pm *VolumePluginMgr) FindAttachablePluginByName(name string) (AttachableVo return nil, nil } -// FindDeviceMountablePluginBySpec fetches a persistent volume plugin by spec. +// FindDeviceMountablePluginBySpec fetches a devicemountable persistent volume plugin by spec. func (pm *VolumePluginMgr) FindDeviceMountablePluginBySpec(spec *Spec) (DeviceMountableVolumePlugin, error) { volumePlugin, err := pm.FindPluginBySpec(spec) if err != nil { @@ -845,7 +854,7 @@ func (pm *VolumePluginMgr) FindDeviceMountablePluginBySpec(spec *Spec) (DeviceMo return nil, nil } -// FindDeviceMountablePluginByName fetches a devicemountable volume plugin by name. +// FindDeviceMountablePluginByName fetches a devicemountable persistent volume plugin by name. func (pm *VolumePluginMgr) FindDeviceMountablePluginByName(name string) (DeviceMountableVolumePlugin, error) { volumePlugin, err := pm.FindPluginByName(name) if err != nil { @@ -857,7 +866,7 @@ func (pm *VolumePluginMgr) FindDeviceMountablePluginByName(name string) (DeviceM return nil, nil } -// FindExpandablePluginBySpec fetches a persistent volume plugin by spec. +// FindExpandablePluginBySpec fetches an expandable persistent volume plugin by spec. func (pm *VolumePluginMgr) FindExpandablePluginBySpec(spec *Spec) (ExpandableVolumePlugin, error) { volumePlugin, err := pm.FindPluginBySpec(spec) if err != nil { @@ -867,7 +876,7 @@ func (pm *VolumePluginMgr) FindExpandablePluginBySpec(spec *Spec) (ExpandableVol klog.V(4).InfoS("FindExpandablePluginBySpec -> returning noopExpandableVolumePluginInstance", "specName", spec.Name()) return &noopExpandableVolumePluginInstance{spec}, nil } - if errors.Is(err, ErrNoPluiginMatched) { + if errors.Is(err, ErrNoPluginMatched) { return nil, nil } klog.V(4).InfoS("FindExpandablePluginBySpec -> err", "specName", spec.Name(), "err", err) @@ -880,7 +889,7 @@ func (pm *VolumePluginMgr) FindExpandablePluginBySpec(spec *Spec) (ExpandableVol return nil, nil } -// FindExpandablePluginBySpec fetches a persistent volume plugin by name. +// FindExpandablePluginByName fetches an expandable persistent volume plugin by name. func (pm *VolumePluginMgr) FindExpandablePluginByName(name string) (ExpandableVolumePlugin, error) { volumePlugin, err := pm.FindPluginByName(name) if err != nil { @@ -919,7 +928,7 @@ func (pm *VolumePluginMgr) FindMapperPluginByName(name string) (BlockVolumePlugi return nil, nil } -// FindNodeExpandablePluginBySpec fetches a persistent volume plugin by spec +// FindNodeExpandablePluginBySpec fetches a node expandable persistent volume plugin by spec func (pm *VolumePluginMgr) FindNodeExpandablePluginBySpec(spec *Spec) (NodeExpandableVolumePlugin, error) { volumePlugin, err := pm.FindPluginBySpec(spec) if err != nil { @@ -931,7 +940,7 @@ func (pm *VolumePluginMgr) FindNodeExpandablePluginBySpec(spec *Spec) (NodeExpan return nil, nil } -// FindNodeExpandablePluginByName fetches a persistent volume plugin by name +// FindNodeExpandablePluginByName fetches a node expandable persistent volume plugin by name func (pm *VolumePluginMgr) FindNodeExpandablePluginByName(name string) (NodeExpandableVolumePlugin, error) { volumePlugin, err := pm.FindPluginByName(name) if err != nil { @@ -945,6 +954,9 @@ func (pm *VolumePluginMgr) FindNodeExpandablePluginByName(name string) (NodeExpa return nil, nil } +// Run starts the volume plugin manager, initializing and running the necessary +// tasks for managing volume plugins. This method is typically called to begin +// the plugin management lifecycle. func (pm *VolumePluginMgr) Run(stopCh <-chan struct{}) { kletHost, ok := pm.Host.(KubeletVolumeHost) if ok { @@ -1007,7 +1019,7 @@ func NewPersistentVolumeRecyclerPodTemplate() *v1.Pod { return pod } -// Check validity of recycle pod template +// ValidateRecyclerPodTemplate checks validity of recycle pod template // List of checks: // - at least one volume is defined in the recycle pod template // If successful, returns nil diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/doc.go b/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/doc.go index b32dae216..d36990b8f 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/doc.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/doc.go @@ -15,4 +15,4 @@ limitations under the License. */ // Package util contains utility code for use by volume plugins. -package util // import "k8s.io/kubernetes/pkg/volume/util" +package util diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/fs/fs_windows.go b/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/fs/fs_windows.go index 6e138514a..3e654d3fd 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/fs/fs_windows.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/fs/fs_windows.go @@ -85,6 +85,11 @@ func diskUsage(currPath string, info os.FileInfo) (int64, error) { return size, nil } + // go1.23 behavior change: https://github.com/golang/go/issues/63703#issuecomment-2535941458 + if info.Mode()&os.ModeIrregular != 0 { + return size, nil + } + size += info.Size() if !info.IsDir() { diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/hostutil/hostutil.go b/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/hostutil/hostutil.go index 4539afd70..0e57821d3 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/hostutil/hostutil.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/hostutil/hostutil.go @@ -19,8 +19,6 @@ package hostutil import ( "fmt" "os" - - "k8s.io/mount-utils" ) // FileType enumerates the known set of possible file types. @@ -52,10 +50,6 @@ type HostUtils interface { DeviceOpened(pathname string) (bool, error) // PathIsDevice determines if a path is a device. PathIsDevice(pathname string) (bool, error) - // GetDeviceNameFromMount finds the device name by checking the mount path - // to get the global mount path within its plugin directory. - // TODO: Remove this method once the rbd and vsphere plugins are removed from in-tree. - GetDeviceNameFromMount(mounter mount.Interface, mountPath, pluginMountDir string) (string, error) // MakeRShared checks that given path is on a mount with 'rshared' mount // propagation. If not, it bind-mounts the path as rshared. MakeRShared(path string) error diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/hostutil/hostutil_linux.go b/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/hostutil/hostutil_linux.go index cc480407c..19bcc5f14 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/hostutil/hostutil_linux.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/hostutil/hostutil_linux.go @@ -66,7 +66,7 @@ func (hu *HostUtil) PathIsDevice(pathname string) (bool, error) { return isDevice, err } -// ExclusiveOpenFailsOnDevice is shared with NsEnterMounter +// ExclusiveOpenFailsOnDevice checks if block device in use by calling Open with O_EXCL flag. func ExclusiveOpenFailsOnDevice(pathname string) (bool, error) { var isDevice bool finfo, err := os.Stat(pathname) @@ -154,8 +154,6 @@ func (hu *HostUtil) PathExists(pathname string) (bool, error) { } // EvalHostSymlinks returns the path name after evaluating symlinks. -// TODO once the nsenter implementation is removed, this method can be removed -// from the interface and filepath.EvalSymlinks used directly func (hu *HostUtil) EvalHostSymlinks(pathname string) (string, error) { return filepath.EvalSymlinks(pathname) } @@ -280,8 +278,8 @@ func (hu *HostUtil) GetMode(pathname string) (os.FileMode, error) { return GetModeLinux(pathname) } -// GetOwnerLinux is shared between Linux and NsEnterMounter -// pathname must already be evaluated for symlinks +// pathname must already be evaluated for symlinks. +// GetOwnerLinux returns the integer ID for the user and group of the given path. func GetOwnerLinux(pathname string) (int64, int64, error) { info, err := os.Stat(pathname) if err != nil { @@ -291,7 +289,7 @@ func GetOwnerLinux(pathname string) (int64, int64, error) { return int64(stat.Uid), int64(stat.Gid), nil } -// GetModeLinux is shared between Linux and NsEnterMounter +// GetModeLinux returns permissions of the pathname. func GetModeLinux(pathname string) (os.FileMode, error) { info, err := os.Stat(pathname) if err != nil { diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/hostutil/hostutil_windows.go b/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/hostutil/hostutil_windows.go index 27bc8b212..b702d1e7e 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/hostutil/hostutil_windows.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/hostutil/hostutil_windows.go @@ -29,7 +29,6 @@ import ( "golang.org/x/sys/windows" "k8s.io/klog/v2" - "k8s.io/kubernetes/pkg/util/filesystem" "k8s.io/mount-utils" utilpath "k8s.io/utils/path" ) @@ -103,14 +102,6 @@ func isSystemCannotAccessErr(err error) bool { func (hu *(HostUtil)) GetFileType(pathname string) (FileType, error) { filetype, err := getFileType(pathname) - // os.Stat will return a 1920 error (windows.ERROR_CANT_ACCESS_FILE) if we use it on a Unix Socket - // on Windows. In this case, we need to use a different method to check if it's a Unix Socket. - if err == errUnknownFileType || isSystemCannotAccessErr(err) { - if isSocket, errSocket := filesystem.IsUnixDomainSocket(pathname); errSocket == nil && isSocket { - return FileTypeSocket, nil - } - } - return filetype, err } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/subpath/subpath_linux.go b/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/subpath/subpath_linux.go index 583939bdc..f1958cd60 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/subpath/subpath_linux.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/subpath/subpath_linux.go @@ -78,7 +78,7 @@ func (sp *subpath) PrepareSafeSubpath(subPath Subpath) (newHostPath string, clea return newHostPath, cleanupAction, err } -// This implementation is shared between Linux and NsEnter +// safeOpenSubPath opens subpath and returns its fd. func safeOpenSubPath(mounter mount.Interface, subpath Subpath) (int, error) { if !mount.PathWithinBase(subpath.Path, subpath.VolumePath) { return -1, fmt.Errorf("subpath %q not within volume path %q", subpath.Path, subpath.VolumePath) @@ -92,11 +92,6 @@ func safeOpenSubPath(mounter mount.Interface, subpath Subpath) (int, error) { // prepareSubpathTarget creates target for bind-mount of subpath. It returns // "true" when the target already exists and something is mounted there. -// Given Subpath must have all paths with already resolved symlinks and with -// paths relevant to kubelet (when it runs in a container). -// This function is called also by NsEnterMounter. It works because -// /var/lib/kubelet is mounted from the host into the container with Kubelet as -// /var/lib/kubelet too. func prepareSubpathTarget(mounter mount.Interface, subpath Subpath) (bool, string, error) { // Early check for already bind-mounted subpath. bindPathTarget := getSubpathBindTarget(subpath) @@ -237,7 +232,7 @@ func doBindSubPath(mounter mount.Interface, subpath Subpath) (hostPath string, e return bindPathTarget, nil } -// This implementation is shared between Linux and NsEnter +// doCleanSubPaths tears down the subpath bind mounts for a pod func doCleanSubPaths(mounter mount.Interface, podDir string, volumeName string) error { // scan /var/lib/kubelet/pods//volume-subpaths//* subPathDir := filepath.Join(podDir, containerSubPathDirectoryName, volumeName) @@ -372,9 +367,7 @@ func removeEmptyDirs(baseDir, endDir string) error { return nil } -// This implementation is shared between Linux and NsEnterMounter. Both pathname -// and base must be either already resolved symlinks or thet will be resolved in -// kubelet's mount namespace (in case it runs containerized). +// doSafeMakeDir creates a directory at pathname, but only if it is within base. func doSafeMakeDir(pathname string, base string, perm os.FileMode) error { klog.V(4).Infof("Creating directory %q within base %q", pathname, base) @@ -523,7 +516,6 @@ func findExistingPrefix(base, pathname string) (string, []string, error) { return pathname, []string{}, nil } -// This implementation is shared between Linux and NsEnterMounter // Open path and return its fd. // Symlinks are disallowed (pathname must already resolve symlinks), // and the path must be within the base directory. diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/subpath/subpath_unsupported.go b/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/subpath/subpath_unsupported.go index 21493426d..1771bc16b 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/subpath/subpath_unsupported.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/subpath/subpath_unsupported.go @@ -24,7 +24,6 @@ import ( "os" "k8s.io/mount-utils" - "k8s.io/utils/nsenter" ) type subpath struct{} @@ -36,12 +35,6 @@ func New(mount.Interface) Interface { return &subpath{} } -// NewNSEnter is to satisfy the compiler for having NewSubpathNSEnter exist for all -// OS choices. however, NSEnter is only valid on Linux -func NewNSEnter(mounter mount.Interface, ne *nsenter.Nsenter, rootDir string) Interface { - return nil -} - func (sp *subpath) PrepareSafeSubpath(subPath Subpath) (newHostPath string, cleanupAction func(), err error) { return subPath.Path, nil, errUnsupported } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/subpath/subpath_windows.go b/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/subpath/subpath_windows.go index bf02de632..14b52a365 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/subpath/subpath_windows.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/subpath/subpath_windows.go @@ -29,7 +29,6 @@ import ( "k8s.io/klog/v2" "k8s.io/mount-utils" - "k8s.io/utils/nsenter" ) // MaxPathLength is the maximum length of Windows path. Normally, it is 260, but if long path is enable, @@ -43,12 +42,6 @@ func New(mount.Interface) Interface { return &subpath{} } -// NewNSEnter is to satisfy the compiler for having NewSubpathNSEnter exist for all -// OS choices. however, NSEnter is only valid on Linux -func NewNSEnter(mounter mount.Interface, ne *nsenter.Nsenter, rootDir string) Interface { - return nil -} - // isDriveLetterPath returns true if the given path is empty or it ends with ":" or ":\" or ":\\" func isDriveLetterorEmptyPath(path string) bool { if path == "" || strings.HasSuffix(path, ":\\\\") || strings.HasSuffix(path, ":") || strings.HasSuffix(path, ":\\") { @@ -208,6 +201,12 @@ func lockAndCheckSubPathWithoutSymlink(volumePath, subPath string) ([]uintptr, e break } + // go1.23 behavior change: https://github.com/golang/go/issues/63703#issuecomment-2535941458 + if stat.Mode()&os.ModeIrregular != 0 { + errorResult = fmt.Errorf("subpath %q is an unexpected irregular file after EvalSymlinks", currentFullPath) + break + } + if !mount.PathWithinBase(currentFullPath, volumePath) { errorResult = fmt.Errorf("SubPath %q not within volume path %q", currentFullPath, volumePath) break @@ -342,6 +341,10 @@ func doSafeMakeDir(pathname string, base string, perm os.FileMode) error { if stat.Mode()&os.ModeSymlink != 0 { return fmt.Errorf("subpath %q is an unexpected symlink after Mkdir", currentPath) } + // go1.23 behavior change: https://github.com/golang/go/issues/63703#issuecomment-2535941458 + if stat.Mode()&os.ModeIrregular != 0 { + return fmt.Errorf("subpath %q is an unexpected irregular file after Mkdir", currentPath) + } } return nil diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/volumepathhandler/volume_path_handler.go b/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/volumepathhandler/volume_path_handler.go index e632843d1..fa0b24a18 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/volumepathhandler/volume_path_handler.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/volume/util/volumepathhandler/volume_path_handler.go @@ -20,6 +20,7 @@ import ( "fmt" "os" "path/filepath" + "runtime" "k8s.io/klog/v2" "k8s.io/mount-utils" @@ -232,7 +233,7 @@ func (v VolumePathHandler) RemoveMapPath(mapPath string) error { return nil } -// IsSymlinkExist returns true if specified file exists and the type is symbolik link. +// IsSymlinkExist returns true if specified file exists and the type is symbolik link or irregular file on Windows. // If file doesn't exist, or file exists but not symbolic link, return false with no error. // On other cases, return false with error from Lstat(). func (v VolumePathHandler) IsSymlinkExist(mapPath string) (bool, error) { @@ -249,6 +250,10 @@ func (v VolumePathHandler) IsSymlinkExist(mapPath string) (bool, error) { if fi.Mode()&os.ModeSymlink == os.ModeSymlink { return true, nil } + // go1.23 behavior change: https://github.com/golang/go/issues/63703#issuecomment-2535941458 + if (runtime.GOOS == "windows") && (fi.Mode()&os.ModeIrregular != 0) { + return true, nil + } // If file exits but it's not symbolic link, return false and no error return false, nil } diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/volume/volume.go b/e2e/vendor/k8s.io/kubernetes/pkg/volume/volume.go index 70bf7decc..f5f933e0c 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/volume/volume.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/volume/volume.go @@ -17,12 +17,15 @@ limitations under the License. package volume import ( + "sync/atomic" "time" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/tools/record" + volumetypes "k8s.io/kubernetes/pkg/volume/util/types" ) // Volume represents a directory used by pods or hosts on a node. All method @@ -130,6 +133,20 @@ type MounterArgs struct { FSGroupChangePolicy *v1.PodFSGroupChangePolicy DesiredSize *resource.Quantity SELinuxLabel string + Recorder record.EventRecorder +} + +type VolumeOwnership struct { + mounter Mounter + dir string + fsGroup *int64 + fsGroupChangePolicy *v1.PodFSGroupChangePolicy + completionCallback func(volumetypes.CompleteFuncParam) + + // for monitoring progress of permission change operation + pod *v1.Pod + fileCounter atomic.Int64 + recorder record.EventRecorder } // Mounter interface provides methods to set up/mount the volume. diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/volume/volume_linux.go b/e2e/vendor/k8s.io/kubernetes/pkg/volume/volume_linux.go index ec7f6da4b..9d023abfa 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/volume/volume_linux.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/volume/volume_linux.go @@ -20,14 +20,19 @@ limitations under the License. package volume import ( + "context" + "fmt" "path/filepath" + "strings" "syscall" "os" "time" v1 "k8s.io/api/core/v1" + "k8s.io/client-go/tools/record" "k8s.io/klog/v2" + "k8s.io/kubernetes/pkg/kubelet/events" "k8s.io/kubernetes/pkg/volume/util/types" ) @@ -37,38 +42,110 @@ const ( execMask = os.FileMode(0110) ) -// SetVolumeOwnership modifies the given volume to be owned by -// fsGroup, and sets SetGid so that newly created files are owned by -// fsGroup. If fsGroup is nil nothing is done. -func SetVolumeOwnership(mounter Mounter, dir string, fsGroup *int64, fsGroupChangePolicy *v1.PodFSGroupChangePolicy, completeFunc func(types.CompleteFuncParam)) error { - if fsGroup == nil { +var ( + // function that will be used for changing file permissions on linux + // mainly stored here as a variable so as it can replaced in tests + filePermissionChangeFunc = changeFilePermission + progressReportDuration = 60 * time.Second + firstEventReportDuration = 30 * time.Second +) + +// NewVolumeOwnership returns an interface that can be used to recursively change volume permissions and ownership +func NewVolumeOwnership(mounter Mounter, dir string, fsGroup *int64, fsGroupChangePolicy *v1.PodFSGroupChangePolicy, completeFunc func(types.CompleteFuncParam)) *VolumeOwnership { + vo := &VolumeOwnership{ + mounter: mounter, + dir: dir, + fsGroup: fsGroup, + fsGroupChangePolicy: fsGroupChangePolicy, + completionCallback: completeFunc, + } + vo.fileCounter.Store(0) + return vo +} + +func (vo *VolumeOwnership) AddProgressNotifier(pod *v1.Pod, recorder record.EventRecorder) *VolumeOwnership { + vo.pod = pod + vo.recorder = recorder + return vo +} + +func (vo *VolumeOwnership) ChangePermissions() error { + if vo.fsGroup == nil { return nil } - timer := time.AfterFunc(30*time.Second, func() { - klog.Warningf("Setting volume ownership for %s and fsGroup set. If the volume has a lot of files then setting volume ownership could be slow, see https://github.com/kubernetes/kubernetes/issues/69699", dir) + if skipPermissionChange(vo.mounter, vo.dir, vo.fsGroup, vo.fsGroupChangePolicy) { + klog.V(3).InfoS("Skipping permission and ownership change for volume", "path", vo.dir) + return nil + } + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + timer := time.AfterFunc(firstEventReportDuration, func() { + vo.initiateProgressMonitor(ctx) }) defer timer.Stop() - if skipPermissionChange(mounter, dir, fsGroup, fsGroupChangePolicy) { - klog.V(3).InfoS("Skipping permission and ownership change for volume", "path", dir) - return nil - } + return vo.changePermissionsRecursively() +} - err := walkDeep(dir, func(path string, info os.FileInfo, err error) error { +func (vo *VolumeOwnership) initiateProgressMonitor(ctx context.Context) { + klog.Warningf("Setting volume ownership for %s and fsGroup set. If the volume has a lot of files then setting volume ownership could be slow, see https://github.com/kubernetes/kubernetes/issues/69699", vo.dir) + if vo.pod != nil { + go vo.monitorProgress(ctx) + } +} + +func (vo *VolumeOwnership) changePermissionsRecursively() error { + err := walkDeep(vo.dir, func(path string, info os.FileInfo, err error) error { if err != nil { return err } - return changeFilePermission(path, fsGroup, mounter.GetAttributes().ReadOnly, info) + vo.fileCounter.Add(1) + return filePermissionChangeFunc(path, vo.fsGroup, vo.mounter.GetAttributes().ReadOnly, info) }) - if completeFunc != nil { - completeFunc(types.CompleteFuncParam{ + + if vo.completionCallback != nil { + vo.completionCallback(types.CompleteFuncParam{ Err: &err, }) } return err } +func (vo *VolumeOwnership) monitorProgress(ctx context.Context) { + dirName := getDirnameToReport(vo.dir, string(vo.pod.UID)) + msg := fmt.Sprintf("Setting volume ownership for %s is taking longer than expected, consider using OnRootMismatch - https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#configure-volume-permission-and-ownership-change-policy-for-pods", dirName) + vo.recorder.Event(vo.pod, v1.EventTypeWarning, events.VolumePermissionChangeInProgress, msg) + ticker := time.NewTicker(progressReportDuration) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + vo.logWarning() + } + } +} + +// report everything after podUID in dir string, including podUID +func getDirnameToReport(dir, podUID string) string { + podUIDIndex := strings.Index(dir, podUID) + if podUIDIndex == -1 { + return dir + } + return dir[podUIDIndex:] +} + +func (vo *VolumeOwnership) logWarning() { + dirName := getDirnameToReport(vo.dir, string(vo.pod.UID)) + msg := fmt.Sprintf("Setting volume ownership for %s, processed %d files.", dirName, vo.fileCounter.Load()) + klog.Warning(msg) + vo.recorder.Event(vo.pod, v1.EventTypeWarning, events.VolumePermissionChangeInProgress, msg) +} + func changeFilePermission(filename string, fsGroup *int64, readonly bool, info os.FileInfo) error { err := os.Lchown(filename, -1, int(*fsGroup)) if err != nil { diff --git a/e2e/vendor/k8s.io/kubernetes/pkg/volume/volume_unsupported.go b/e2e/vendor/k8s.io/kubernetes/pkg/volume/volume_unsupported.go index 3b5a200a6..cfedeaa32 100644 --- a/e2e/vendor/k8s.io/kubernetes/pkg/volume/volume_unsupported.go +++ b/e2e/vendor/k8s.io/kubernetes/pkg/volume/volume_unsupported.go @@ -21,9 +21,19 @@ package volume import ( v1 "k8s.io/api/core/v1" + "k8s.io/client-go/tools/record" "k8s.io/kubernetes/pkg/volume/util/types" ) -func SetVolumeOwnership(mounter Mounter, dir string, fsGroup *int64, fsGroupChangePolicy *v1.PodFSGroupChangePolicy, completeFunc func(types.CompleteFuncParam)) error { +// NewVolumeOwnership returns an interface that can be used to recursively change volume permissions and ownership +func NewVolumeOwnership(mounter Mounter, dir string, fsGroup *int64, fsGroupChangePolicy *v1.PodFSGroupChangePolicy, completeFunc func(types.CompleteFuncParam)) *VolumeOwnership { + return nil +} + +func (vo *VolumeOwnership) AddProgressNotifier(pod *v1.Pod, recorder record.EventRecorder) *VolumeOwnership { + return vo +} + +func (vo *VolumeOwnership) ChangePermissions() error { return nil } diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/.import-restrictions b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/.import-restrictions index d5f497667..fc52e328d 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/.import-restrictions +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/.import-restrictions @@ -46,7 +46,6 @@ rules: "github.com/google/gnostic-models/openapiv3", "github.com/google/go-cmp/cmp", "github.com/google/go-cmp/cmp/cmpopts", - "github.com/google/gofuzz", "github.com/google/uuid", "github.com/imdario/mergo", "github.com/prometheus/client_golang/", diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/OWNERS b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/OWNERS index 75130916b..eb91e3dd8 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/OWNERS +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/OWNERS @@ -4,17 +4,16 @@ approvers: - andrewsykim - pohly - oomichi - - neolit123 - SataQiu reviewers: - sig-testing-reviewers - andrewsykim - pohly - oomichi - - neolit123 - SataQiu labels: - area/e2e-test-framework emeritus_approvers: - fabriziopandini - timothysc + - neolit123 diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/ginkgowrapper.go b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/ginkgowrapper.go index 8517e4b51..ccc045ba7 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/ginkgowrapper.go +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/ginkgowrapper.go @@ -41,11 +41,6 @@ type Feature string // "Linux" or "Windows". type Environment string -// NodeFeature is the name of a feature that a node must support. To be -// removed, see -// https://github.com/kubernetes/enhancements/tree/master/keps/sig-testing/3041-node-conformance-and-features#nodefeature. -type NodeFeature string - type Valid[T comparable] struct { items sets.Set[T] frozen bool @@ -76,14 +71,13 @@ func (v *Valid[T]) Freeze() { v.frozen = true } -// These variables contain the parameters that [WithFeature], [WithEnvironment] -// and [WithNodeFeatures] accept. The framework itself has no pre-defined +// These variables contain the parameters that [WithFeature] and [WithEnvironment] accept. +// The framework itself has no pre-defined // constants. Test suites and tests may define their own and then add them here // before calling these With functions. var ( ValidFeatures Valid[Feature] ValidEnvironments Valid[Environment] - ValidNodeFeatures Valid[NodeFeature] ) var errInterface = reflect.TypeOf((*error)(nil)).Elem() @@ -97,7 +91,12 @@ func IgnoreNotFound(in any) any { inType := reflect.TypeOf(in) inValue := reflect.ValueOf(in) return reflect.MakeFunc(inType, func(args []reflect.Value) []reflect.Value { - out := inValue.Call(args) + var out []reflect.Value + if inType.IsVariadic() { + out = inValue.CallSlice(args) + } else { + out = inValue.Call(args) + } if len(out) > 0 { lastValue := out[len(out)-1] last := lastValue.Interface() @@ -209,9 +208,18 @@ func registerInSuite(ginkgoCall func(string, ...interface{}) bool, args []interf case label: fullLabel := strings.Join(arg.parts, ":") addLabel(fullLabel) - if arg.extraFeature != "" { - texts = append(texts, fmt.Sprintf("[%s]", arg.extraFeature)) - ginkgoArgs = append(ginkgoArgs, ginkgo.Label("Feature:"+arg.extraFeature)) + if arg.alphaBetaLevel != "" { + texts = append(texts, fmt.Sprintf("[%[1]s]", arg.alphaBetaLevel)) + ginkgoArgs = append(ginkgoArgs, ginkgo.Label(arg.alphaBetaLevel)) + } + if arg.offByDefault { + texts = append(texts, "[Feature:OffByDefault]") + ginkgoArgs = append(ginkgoArgs, ginkgo.Label("Feature:OffByDefault")) + // Alphas are always off by default but we may want to select + // betas based on defaulted-ness. + if arg.alphaBetaLevel == "Beta" { + ginkgoArgs = append(ginkgoArgs, ginkgo.Label("BetaOffByDefault")) + } } if fullLabel == "Serial" { ginkgoArgs = append(ginkgoArgs, ginkgo.Serial) @@ -306,6 +314,12 @@ func validateText(location types.CodeLocation, text string, labels []string) { // Okay, was also set as label. continue } + // TODO: we currently only set this as a text value + // We should probably reflect it into labels, but that could break some + // existing jobs and we're still setting on an exact plan + if tag == "Feature:OffByDefault" { + continue + } if deprecatedTags.Has(tag) { recordTextBug(location, fmt.Sprintf("[%s] in plain text is deprecated and must be added through With%s instead", tag, tag)) } @@ -351,7 +365,8 @@ func withFeature(name Feature) interface{} { } // WithFeatureGate specifies that a certain test or group of tests depends on a -// feature gate being enabled. The return value must be passed as additional +// feature gate and the corresponding API group (if there is one) +// being enabled. The return value must be passed as additional // argument to [framework.It], [framework.Describe], [framework.Context]. // // The feature gate must be listed in @@ -360,9 +375,21 @@ func withFeature(name Feature) interface{} { // also need to be removed. // // [Alpha] resp. [Beta] get added to the test name automatically depending -// on the current stability level of the feature. Feature:Alpha resp. -// Feature:Beta get added to the Ginkgo labels because this is a special -// requirement for how the cluster needs to be configured. +// on the current stability level of the feature, to emulate historic +// usage of those tags. +// +// For label filtering, Alpha resp. Beta get added to the Ginkgo labels. +// +// [Feature:OffByDefault] gets added to support skipping a test with +// a dependency on an alpha or beta feature gate in jobs which use the +// traditional \[Feature:.*\] skip regular expression. +// +// Feature:OffByDefault is also available for label filtering. +// +// BetaOffByDefault is also added *only as a label* when the feature gate is +// an off by default beta feature. This can be used to include/exclude based +// on beta + defaulted-ness. Alpha has no equivalent because all alphas are +// off by default. // // If the test can run in any cluster that has alpha resp. beta features and // API groups enabled, then annotating it with just WithFeatureGate is @@ -391,7 +418,8 @@ func withFeatureGate(featureGate featuregate.Feature) interface{} { } l := newLabel("FeatureGate", string(featureGate)) - l.extraFeature = level + l.offByDefault = !spec.Default + l.alphaBetaLevel = level return l } @@ -416,28 +444,6 @@ func withEnvironment(name Environment) interface{} { return newLabel("Environment", string(name)) } -// WithNodeFeature specifies that a certain test or group of tests only works -// if the node supports a certain feature. The return value must be passed as -// additional argument to [framework.It], [framework.Describe], -// [framework.Context]. -// -// The environment must be listed in ValidNodeFeatures. -func WithNodeFeature(name NodeFeature) interface{} { - return withNodeFeature(name) -} - -// WithNodeFeature is a shorthand for the corresponding package function. -func (f *Framework) WithNodeFeature(name NodeFeature) interface{} { - return withNodeFeature(name) -} - -func withNodeFeature(name NodeFeature) interface{} { - if !ValidNodeFeatures.items.Has(name) { - RecordBug(NewBug(fmt.Sprintf("WithNodeFeature: unknown environment %q", name), 2)) - } - return newLabel("NodeFeature", string(name)) -} - // WithConformace specifies that a certain test or group of tests must pass in // all conformant Kubernetes clusters. The return value must be passed as // additional argument to [framework.It], [framework.Describe], @@ -559,13 +565,19 @@ func withFlaky() interface{} { type label struct { // parts get concatenated with ":" to build the full label. parts []string - // extra is an optional feature name. It gets added as [] - // to the test name and as Feature: to the labels. - extraFeature string // explanation gets set for each label to help developers // who pass a label to a ginkgo function. They need to use // the corresponding framework function instead. explanation string + + // TODO: the fields below are only used for FeatureGates, we may want to refactor + + // alphaBetaLevel is "Alpha", "Beta" or empty for GA features + // It gets added as [] [Feature:] + // to the test name and as Feature: to the labels. + alphaBetaLevel string + // set based on featuregate default state + offByDefault bool } func newLabel(parts ...string) label { @@ -588,7 +600,10 @@ func TagsEqual(a, b interface{}) bool { if !ok { return false } - if al.extraFeature != bl.extraFeature { + if al.alphaBetaLevel != bl.alphaBetaLevel { + return false + } + if al.offByDefault != bl.offByDefault { return false } return slices.Equal(al.parts, bl.parts) diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/node/helper.go b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/node/helper.go index 604404bf7..012d97127 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/node/helper.go +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/node/helper.go @@ -188,10 +188,15 @@ func AddExtendedResource(ctx context.Context, clientSet clientset.Interface, nod extendedResourceList := v1.ResourceList{ extendedResource: extendedResourceQuantity, } - patchPayload, err := json.Marshal(v1.Node{ - Status: v1.NodeStatus{ - Capacity: extendedResourceList, - Allocatable: extendedResourceList, + + // This is a workaround for the fact that we shouldn't marshal a Node struct to JSON + // because it wipes out some fields from node status like the daemonEndpoints and + // nodeInfo which should not be changed at this time. We need to use a map instead. + // See https://github.com/kubernetes/kubernetes/issues/131229 + patchPayload, err := json.Marshal(map[string]any{ + "status": map[string]any{ + "capacity": extendedResourceList, + "allocatable": extendedResourceList, }, }) framework.ExpectNoError(err, "Failed to marshal node JSON") diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/create.go b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/create.go index 7378fa3e5..47c25b2c0 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/create.go +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/create.go @@ -25,6 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/uuid" clientset "k8s.io/client-go/kubernetes" + "k8s.io/kubernetes/test/e2e/framework" imageutils "k8s.io/kubernetes/test/utils/image" admissionapi "k8s.io/pod-security-admission/api" ) @@ -176,7 +177,7 @@ func MakeSecPod(podConfig *Config) (*v1.Pod, error) { } podName := "pod-" + string(uuid.NewUUID()) - if podConfig.FsGroup == nil && !NodeOSDistroIs("windows") { + if podConfig.FsGroup == nil && !framework.NodeOSDistroIs("windows") { podConfig.FsGroup = func(i int64) *int64 { return &i }(1000) diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/dial.go b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/dial.go index ef223e86e..7846426d6 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/dial.go +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/dial.go @@ -36,6 +36,7 @@ import ( "k8s.io/client-go/tools/portforward" "k8s.io/client-go/transport/spdy" "k8s.io/klog/v2" + "k8s.io/kubernetes/test/e2e/framework" ) // NewTransport creates a transport which uses the port forward dialer. @@ -91,6 +92,20 @@ func (d *Dialer) DialContainerPort(ctx context.Context, addr Addr) (conn net.Con } dialer := spdy.NewDialer(upgrader, &http.Client{Transport: transport}, "POST", req.URL()) + tunnelingDialer, err := portforward.NewSPDYOverWebsocketDialer(req.URL(), restConfig) + if err != nil { + return nil, err + } + // First attempt tunneling (websocket) dialer, then fallback to spdy dialer. + dialer = portforward.NewFallbackDialer(tunnelingDialer, dialer, func(err error) bool { + if httpstream.IsUpgradeFailure(err) || httpstream.IsHTTPSProxyError(err) { + framework.Logf("fallback to secondary dialer from primary dialer err: %v", err) + return true + } + framework.Logf("unexpected error trying to use websockets for portforward: %v", err) + return false + }) + streamConn, _, err := dialer.Dial(portforward.PortForwardProtocolV1Name) if err != nil { return nil, fmt.Errorf("dialer failed: %w", err) diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/exec_util.go b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/exec_util.go index 7f6e6064e..d2d09c464 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/exec_util.go +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/exec_util.go @@ -19,15 +19,19 @@ package pod import ( "bytes" "context" + "errors" + "fmt" "io" "net/url" "strings" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/client-go/kubernetes/scheme" restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/remotecommand" + clientexec "k8s.io/client-go/util/exec" "k8s.io/kubernetes/test/e2e/framework" "github.com/onsi/gomega" @@ -77,8 +81,8 @@ func ExecWithOptionsContext(ctx context.Context, f *framework.Framework, options }, scheme.ParameterCodec) var stdout, stderr bytes.Buffer - framework.Logf("ExecWithOptions: execute(POST %s)", req.URL()) - err := execute(ctx, "POST", req.URL(), f.ClientConfig(), options.Stdin, &stdout, &stderr, tty) + framework.Logf("ExecWithOptions: execute(%s)", req.URL()) + err := execute(ctx, req.URL(), f.ClientConfig(), options.Stdin, &stdout, &stderr, tty) if options.PreserveWhitespace { return stdout.String(), stderr.String(), err @@ -141,11 +145,66 @@ func ExecShellInPodWithFullOutput(ctx context.Context, f *framework.Framework, p return execCommandInPodWithFullOutput(ctx, f, podName, "/bin/sh", "-c", cmd) } -func execute(ctx context.Context, method string, url *url.URL, config *restclient.Config, stdin io.Reader, stdout, stderr io.Writer, tty bool) error { - exec, err := remotecommand.NewSPDYExecutor(config, method, url) +// VerifyExecInPodSucceed verifies shell cmd in target pod succeed +func VerifyExecInPodSucceed(ctx context.Context, f *framework.Framework, pod *v1.Pod, shExec string) error { + stdout, stderr, err := ExecShellInPodWithFullOutput(ctx, f, pod.Name, shExec) + if err != nil { + var exitError clientexec.CodeExitError + if errors.As(err, &exitError) { + exitCode := exitError.ExitStatus() + return fmt.Errorf("%q should succeed, but failed with exit code %d and error message %w\nstdout: %s\nstderr: %s", + shExec, exitCode, exitError, stdout, stderr) + } else { + return fmt.Errorf("%q should succeed, but failed with error message %w\nstdout: %s\nstderr: %s", + shExec, err, stdout, stderr) + } + } + return nil +} + +// VerifyExecInPodFail verifies shell cmd in target pod fail with certain exit code +func VerifyExecInPodFail(ctx context.Context, f *framework.Framework, pod *v1.Pod, shExec string, exitCode int) error { + stdout, stderr, err := ExecShellInPodWithFullOutput(ctx, f, pod.Name, shExec) + if err != nil { + var exitError clientexec.CodeExitError + if errors.As(err, &exitError) { + actualExitCode := exitError.ExitStatus() + if actualExitCode == exitCode { + return nil + } + return fmt.Errorf("%q should fail with exit code %d, but failed with exit code %d and error message %w\nstdout: %s\nstderr: %s", + shExec, exitCode, actualExitCode, exitError, stdout, stderr) + } else { + return fmt.Errorf("%q should fail with exit code %d, but failed with error message %w\nstdout: %s\nstderr: %s", + shExec, exitCode, err, stdout, stderr) + } + } + return fmt.Errorf("%q should fail with exit code %d, but exit without error", shExec, exitCode) +} + +func execute(ctx context.Context, url *url.URL, config *restclient.Config, stdin io.Reader, stdout, stderr io.Writer, tty bool) error { + // WebSocketExecutor executor is default + // WebSocketExecutor must be "GET" method as described in RFC 6455 Sec. 4.1 (page 17). + websocketExec, err := remotecommand.NewWebSocketExecutor(config, "GET", url.String()) if err != nil { return err } + spdyExec, err := remotecommand.NewSPDYExecutor(config, "POST", url) + if err != nil { + return err + } + exec, err := remotecommand.NewFallbackExecutor(websocketExec, spdyExec, func(err error) bool { + if httpstream.IsUpgradeFailure(err) || httpstream.IsHTTPSProxyError(err) { + framework.Logf("fallback to secondary dialer from primary dialer err: %v", err) + return true + } + framework.Logf("unexpected error trying to use websockets for pod exec: %v", err) + return false + }) + if err != nil { + return err + } + return exec.StreamWithContext(ctx, remotecommand.StreamOptions{ Stdin: stdin, Stdout: stdout, diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/output/output.go b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/output/output.go index b649f99c1..fac007644 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/output/output.go +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/output/output.go @@ -176,7 +176,7 @@ func MatchMultipleContainerOutputs( createdPod := podClient.Create(ctx, pod) defer func() { ginkgo.By("delete the pod") - podClient.DeleteSync(ctx, createdPod.Name, metav1.DeleteOptions{}, e2epod.DefaultPodDeletionTimeout) + podClient.DeleteSync(ctx, createdPod.Name, metav1.DeleteOptions{}, f.Timeouts.PodDelete) }() // Wait for client pod to complete. diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/resize.go b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/resize.go index bc01b3464..af8d43ac3 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/resize.go +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/resize.go @@ -28,7 +28,10 @@ import ( "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" utilerrors "k8s.io/apimachinery/pkg/util/errors" + helpers "k8s.io/component-helpers/resource" + "k8s.io/kubectl/pkg/util/podutils" kubecm "k8s.io/kubernetes/pkg/kubelet/cm" + kubeqos "k8s.io/kubernetes/pkg/kubelet/qos" "k8s.io/kubernetes/test/e2e/framework" imageutils "k8s.io/kubernetes/test/utils/image" @@ -98,11 +101,13 @@ func (cr *ContainerResources) ResourceRequirements() *v1.ResourceRequirements { } type ResizableContainerInfo struct { - Name string - Resources *ContainerResources - CPUPolicy *v1.ResourceResizeRestartPolicy - MemPolicy *v1.ResourceResizeRestartPolicy - RestartCount int32 + Name string + Resources *ContainerResources + CPUPolicy *v1.ResourceResizeRestartPolicy + MemPolicy *v1.ResourceResizeRestartPolicy + RestartCount int32 + RestartPolicy v1.ContainerRestartPolicy + InitCtr bool } type containerPatch struct { @@ -142,21 +147,6 @@ func getTestResourceInfo(tcInfo ResizableContainerInfo) (res v1.ResourceRequirem return res, resizePol } -func InitDefaultResizePolicy(containers []ResizableContainerInfo) { - noRestart := v1.NotRequired - setDefaultPolicy := func(ci *ResizableContainerInfo) { - if ci.CPUPolicy == nil { - ci.CPUPolicy = &noRestart - } - if ci.MemPolicy == nil { - ci.MemPolicy = &noRestart - } - } - for i := range containers { - setDefaultPolicy(&containers[i]) - } -} - func makeResizableContainer(tcInfo ResizableContainerInfo) v1.Container { cmd := "grep Cpus_allowed_list /proc/self/status | cut -f2 && sleep 1d" res, resizePol := getTestResourceInfo(tcInfo) @@ -169,17 +159,17 @@ func makeResizableContainer(tcInfo ResizableContainerInfo) v1.Container { Resources: res, ResizePolicy: resizePol, } + if tcInfo.RestartPolicy != "" { + tc.RestartPolicy = &tcInfo.RestartPolicy + } return tc } func MakePodWithResizableContainers(ns, name, timeStamp string, tcInfo []ResizableContainerInfo) *v1.Pod { - var testContainers []v1.Container + testInitContainers, testContainers := separateContainers(tcInfo) - for _, ci := range tcInfo { - tc := makeResizableContainer(ci) - testContainers = append(testContainers, tc) - } + minGracePeriodSeconds := int64(0) pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: name, @@ -189,54 +179,120 @@ func MakePodWithResizableContainers(ns, name, timeStamp string, tcInfo []Resizab }, }, Spec: v1.PodSpec{ - OS: &v1.PodOS{Name: v1.Linux}, - Containers: testContainers, - RestartPolicy: v1.RestartPolicyOnFailure, + OS: &v1.PodOS{Name: v1.Linux}, + InitContainers: testInitContainers, + Containers: testContainers, + RestartPolicy: v1.RestartPolicyOnFailure, + TerminationGracePeriodSeconds: &minGracePeriodSeconds, }, } return pod } -func VerifyPodResizePolicy(gotPod *v1.Pod, wantCtrs []ResizableContainerInfo) { +// separateContainers splits the input into initContainers and normal containers. +func separateContainers(tcInfo []ResizableContainerInfo) ([]v1.Container, []v1.Container) { + var initContainers, containers []v1.Container + + for _, ci := range tcInfo { + tc := makeResizableContainer(ci) + if ci.InitCtr { + initContainers = append(initContainers, tc) + } else { + containers = append(containers, tc) + } + } + + return initContainers, containers +} + +// separateContainerStatuses splits the input into initContainerStatuses and containerStatuses. +func separateContainerStatuses(tcInfo []ResizableContainerInfo) ([]v1.ContainerStatus, []v1.ContainerStatus) { + var containerStatuses, initContainerStatuses []v1.ContainerStatus + + for _, ci := range tcInfo { + ctrStatus := v1.ContainerStatus{ + Name: ci.Name, + RestartCount: ci.RestartCount, + } + if ci.InitCtr { + initContainerStatuses = append(initContainerStatuses, ctrStatus) + } else { + containerStatuses = append(containerStatuses, ctrStatus) + } + } + + return initContainerStatuses, containerStatuses +} + +func VerifyPodResizePolicy(gotPod *v1.Pod, wantInfo []ResizableContainerInfo) { ginkgo.GinkgoHelper() - gomega.Expect(gotPod.Spec.Containers).To(gomega.HaveLen(len(wantCtrs)), "number of containers in pod spec should match") - for i, wantCtr := range wantCtrs { - gotCtr := &gotPod.Spec.Containers[i] - ctr := makeResizableContainer(wantCtr) - gomega.Expect(gotCtr.Name).To(gomega.Equal(ctr.Name)) - gomega.Expect(gotCtr.ResizePolicy).To(gomega.Equal(ctr.ResizePolicy)) + + gotCtrs := append(append([]v1.Container{}, gotPod.Spec.Containers...), gotPod.Spec.InitContainers...) + var wantCtrs []v1.Container + for _, ci := range wantInfo { + wantCtrs = append(wantCtrs, makeResizableContainer(ci)) + } + gomega.Expect(gotCtrs).To(gomega.HaveLen(len(wantCtrs)), "number of containers in pod spec should match") + for _, wantCtr := range wantCtrs { + for _, gotCtr := range gotCtrs { + if wantCtr.Name != gotCtr.Name { + continue + } + gomega.Expect(v1.Container{Name: gotCtr.Name, ResizePolicy: gotCtr.ResizePolicy}).To(gomega.Equal(v1.Container{Name: wantCtr.Name, ResizePolicy: wantCtr.ResizePolicy})) + } } } -func VerifyPodResources(gotPod *v1.Pod, wantCtrs []ResizableContainerInfo) { +func VerifyPodResources(gotPod *v1.Pod, wantInfo []ResizableContainerInfo) { ginkgo.GinkgoHelper() - gomega.Expect(gotPod.Spec.Containers).To(gomega.HaveLen(len(wantCtrs)), "number of containers in pod spec should match") - for i, wantCtr := range wantCtrs { - gotCtr := &gotPod.Spec.Containers[i] - ctr := makeResizableContainer(wantCtr) - gomega.Expect(gotCtr.Name).To(gomega.Equal(ctr.Name)) - gomega.Expect(gotCtr.Resources).To(gomega.Equal(ctr.Resources)) + + gotCtrs := append(append([]v1.Container{}, gotPod.Spec.Containers...), gotPod.Spec.InitContainers...) + var wantCtrs []v1.Container + for _, ci := range wantInfo { + wantCtrs = append(wantCtrs, makeResizableContainer(ci)) + } + gomega.Expect(gotCtrs).To(gomega.HaveLen(len(wantCtrs)), "number of containers in pod spec should match") + for _, wantCtr := range wantCtrs { + for _, gotCtr := range gotCtrs { + if wantCtr.Name != gotCtr.Name { + continue + } + gomega.Expect(v1.Container{Name: gotCtr.Name, Resources: gotCtr.Resources}).To(gomega.Equal(v1.Container{Name: wantCtr.Name, Resources: wantCtr.Resources})) + } } } -func VerifyPodStatusResources(gotPod *v1.Pod, wantCtrs []ResizableContainerInfo) error { +func VerifyPodStatusResources(gotPod *v1.Pod, wantInfo []ResizableContainerInfo) error { + ginkgo.GinkgoHelper() + + wantInitCtrs, wantCtrs := separateContainers(wantInfo) + var errs []error + if err := verifyPodContainersStatusResources(gotPod.Status.InitContainerStatuses, wantInitCtrs); err != nil { + errs = append(errs, err) + } + if err := verifyPodContainersStatusResources(gotPod.Status.ContainerStatuses, wantCtrs); err != nil { + errs = append(errs, err) + } + + return utilerrors.NewAggregate(errs) +} + +func verifyPodContainersStatusResources(gotCtrStatuses []v1.ContainerStatus, wantCtrs []v1.Container) error { ginkgo.GinkgoHelper() var errs []error - - if len(gotPod.Status.ContainerStatuses) != len(wantCtrs) { + if len(gotCtrStatuses) != len(wantCtrs) { return fmt.Errorf("expectation length mismatch: got %d statuses, want %d", - len(gotPod.Status.ContainerStatuses), len(wantCtrs)) + len(gotCtrStatuses), len(wantCtrs)) } for i, wantCtr := range wantCtrs { - gotCtrStatus := &gotPod.Status.ContainerStatuses[i] - ctr := makeResizableContainer(wantCtr) - if gotCtrStatus.Name != ctr.Name { - errs = append(errs, fmt.Errorf("container status %d name %q != expected name %q", i, gotCtrStatus.Name, ctr.Name)) + gotCtrStatus := gotCtrStatuses[i] + if gotCtrStatus.Name != wantCtr.Name { + errs = append(errs, fmt.Errorf("container status %d name %q != expected name %q", i, gotCtrStatus.Name, wantCtr.Name)) continue } - if err := framework.Gomega().Expect(*gotCtrStatus.Resources).To(gomega.Equal(ctr.Resources)); err != nil { - errs = append(errs, fmt.Errorf("container[%s] status resources mismatch: %w", ctr.Name, err)) + if err := framework.Gomega().Expect(*gotCtrStatus.Resources).To(gomega.Equal(wantCtr.Resources)); err != nil { + errs = append(errs, fmt.Errorf("container[%s] status resources mismatch: %w", wantCtr.Name, err)) } } @@ -266,7 +322,7 @@ func VerifyPodContainersCgroupValues(ctx context.Context, f *framework.Framework tc := makeResizableContainer(ci) if tc.Resources.Limits != nil || tc.Resources.Requests != nil { var expectedCPUShares int64 - var expectedCPULimitString, expectedMemLimitString string + var expectedMemLimitString string expectedMemLimitInBytes := tc.Resources.Limits.Memory().Value() cpuRequest := tc.Resources.Requests.Cpu() cpuLimit := tc.Resources.Limits.Cpu() @@ -275,17 +331,10 @@ func VerifyPodContainersCgroupValues(ctx context.Context, f *framework.Framework } else { expectedCPUShares = int64(kubecm.MilliCPUToShares(cpuRequest.MilliValue())) } - cpuQuota := kubecm.MilliCPUToQuota(cpuLimit.MilliValue(), kubecm.QuotaPeriod) - if cpuLimit.IsZero() { - cpuQuota = -1 - } - expectedCPULimitString = strconv.FormatInt(cpuQuota, 10) + + expectedCPULimits := GetCPULimitCgroupExpectations(cpuLimit) expectedMemLimitString = strconv.FormatInt(expectedMemLimitInBytes, 10) if *podOnCgroupv2Node { - if expectedCPULimitString == "-1" { - expectedCPULimitString = "max" - } - expectedCPULimitString = fmt.Sprintf("%s %s", expectedCPULimitString, CPUPeriod) if expectedMemLimitString == "0" { expectedMemLimitString = "max" } @@ -293,45 +342,110 @@ func VerifyPodContainersCgroupValues(ctx context.Context, f *framework.Framework // https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2254-cgroup-v2#phase-1-convert-from-cgroups-v1-settings-to-v2 expectedCPUShares = int64(1 + ((expectedCPUShares-2)*9999)/262142) } + if expectedMemLimitString != "0" { errs = append(errs, VerifyCgroupValue(f, pod, ci.Name, cgroupMemLimit, expectedMemLimitString)) } - errs = append(errs, VerifyCgroupValue(f, pod, ci.Name, cgroupCPULimit, expectedCPULimitString)) + errs = append(errs, VerifyCgroupValue(f, pod, ci.Name, cgroupCPULimit, expectedCPULimits...)) errs = append(errs, VerifyCgroupValue(f, pod, ci.Name, cgroupCPURequest, strconv.FormatInt(expectedCPUShares, 10))) + // TODO(vinaykul,InPlacePodVerticalScaling): Verify oom_score_adj when runc adds support for updating it + // See https://github.com/opencontainers/runc/pull/4669 } } return utilerrors.NewAggregate(errs) } -func verifyContainerRestarts(pod *v1.Pod, expectedContainers []ResizableContainerInfo) error { +func verifyPodRestarts(f *framework.Framework, pod *v1.Pod, wantInfo []ResizableContainerInfo) error { ginkgo.GinkgoHelper() - expectContainerRestarts := map[string]int32{} - for _, ci := range expectedContainers { - expectContainerRestarts[ci.Name] = ci.RestartCount + initCtrStatuses, ctrStatuses := separateContainerStatuses(wantInfo) + errs := []error{} + if err := verifyContainerRestarts(f, pod, pod.Status.InitContainerStatuses, initCtrStatuses); err != nil { + errs = append(errs, err) + } + if err := verifyContainerRestarts(f, pod, pod.Status.ContainerStatuses, ctrStatuses); err != nil { + errs = append(errs, err) + } + + return utilerrors.NewAggregate(errs) +} + +func verifyContainerRestarts(f *framework.Framework, pod *v1.Pod, gotStatuses []v1.ContainerStatus, wantStatuses []v1.ContainerStatus) error { + ginkgo.GinkgoHelper() + + if len(gotStatuses) != len(wantStatuses) { + return fmt.Errorf("expectation length mismatch: got %d statuses, want %d", + len(gotStatuses), len(wantStatuses)) } errs := []error{} - for _, cs := range pod.Status.ContainerStatuses { - expectedRestarts := expectContainerRestarts[cs.Name] - if cs.RestartCount != expectedRestarts { - errs = append(errs, fmt.Errorf("unexpected number of restarts for container %s: got %d, want %d", cs.Name, cs.RestartCount, expectedRestarts)) + for i, gotStatus := range gotStatuses { + if gotStatus.RestartCount != wantStatuses[i].RestartCount { + errs = append(errs, fmt.Errorf("unexpected number of restarts for container %s: got %d, want %d", gotStatus.Name, gotStatus.RestartCount, wantStatuses[i].RestartCount)) + } else if gotStatus.RestartCount > 0 { + err := verifyOomScoreAdj(f, pod, gotStatus.Name) + if err != nil { + errs = append(errs, err) + } } } return utilerrors.NewAggregate(errs) } -func WaitForPodResizeActuation(ctx context.Context, f *framework.Framework, podClient *PodClient, pod *v1.Pod) *v1.Pod { +func verifyOomScoreAdj(f *framework.Framework, pod *v1.Pod, containerName string) error { + container := FindContainerInPod(pod, containerName) + if container == nil { + return fmt.Errorf("failed to find container %s in pod %s", containerName, pod.Name) + } + + node, err := f.ClientSet.CoreV1().Nodes().Get(context.Background(), pod.Spec.NodeName, metav1.GetOptions{}) + if err != nil { + return err + } + + nodeMemoryCapacity := node.Status.Capacity[v1.ResourceMemory] + oomScoreAdj := kubeqos.GetContainerOOMScoreAdjust(pod, container, int64(nodeMemoryCapacity.Value())) + expectedOomScoreAdj := strconv.FormatInt(int64(oomScoreAdj), 10) + + return VerifyOomScoreAdjValue(f, pod, container.Name, expectedOomScoreAdj) +} + +func WaitForPodResizeActuation(ctx context.Context, f *framework.Framework, podClient *PodClient, pod *v1.Pod, expectedContainers []ResizableContainerInfo) *v1.Pod { ginkgo.GinkgoHelper() // Wait for resize to complete. - framework.ExpectNoError(WaitForPodCondition(ctx, f.ClientSet, pod.Namespace, pod.Name, "resize status cleared", f.Timeouts.PodStart, - func(pod *v1.Pod) (bool, error) { - if pod.Status.Resize == v1.PodResizeStatusInfeasible { + + framework.ExpectNoError(framework.Gomega(). + Eventually(ctx, framework.RetryNotFound(framework.GetObject(f.ClientSet.CoreV1().Pods(pod.Namespace).Get, pod.Name, metav1.GetOptions{}))). + WithTimeout(f.Timeouts.PodStart). + Should(framework.MakeMatcher(func(pod *v1.Pod) (func() string, error) { + if helpers.IsPodResizeInfeasible(pod) { // This is a terminal resize state - return false, fmt.Errorf("resize is infeasible") + return func() string { + return "resize is infeasible" + }, nil } - return pod.Status.Resize == "", nil - }), "pod should finish resizing") + // TODO: Replace this check with a combination of checking the status.observedGeneration + // and the resize status when available. + if resourceErrs := VerifyPodStatusResources(pod, expectedContainers); resourceErrs != nil { + return func() string { + return fmt.Sprintf("container status resources don't match expected: %v", formatErrors(resourceErrs)) + }, nil + } + // Wait for kubelet to clear the resize status conditions. + for _, c := range pod.Status.Conditions { + if c.Type == v1.PodResizePending || c.Type == v1.PodResizeInProgress { + return func() string { + return fmt.Sprintf("resize status %v is still present in the pod status", c) + }, nil + } + } + // Wait for the pod to be ready. + if !podutils.IsPodReady(pod) { + return func() string { return "pod is not ready" }, nil + } + return nil, nil + })), + ) resizedPod, err := framework.GetObject(podClient.Get, pod.Name, metav1.GetOptions{})(ctx) framework.ExpectNoError(err, "failed to get resized pod") @@ -341,19 +455,6 @@ func WaitForPodResizeActuation(ctx context.Context, f *framework.Framework, podC func ExpectPodResized(ctx context.Context, f *framework.Framework, resizedPod *v1.Pod, expectedContainers []ResizableContainerInfo) { ginkgo.GinkgoHelper() - // Put each error on a new line for readability. - formatErrors := func(err error) error { - var agg utilerrors.Aggregate - if !errors.As(err, &agg) { - return err - } - - errStrings := make([]string, len(agg.Errors())) - for i, err := range agg.Errors() { - errStrings[i] = err.Error() - } - return fmt.Errorf("[\n%s\n]", strings.Join(errStrings, ",\n")) - } // Verify Pod Containers Cgroup Values var errs []error if cgroupErrs := VerifyPodContainersCgroupValues(ctx, f, resizedPod, expectedContainers); cgroupErrs != nil { @@ -362,10 +463,17 @@ func ExpectPodResized(ctx context.Context, f *framework.Framework, resizedPod *v if resourceErrs := VerifyPodStatusResources(resizedPod, expectedContainers); resourceErrs != nil { errs = append(errs, fmt.Errorf("container status resources don't match expected: %w", formatErrors(resourceErrs))) } - if restartErrs := verifyContainerRestarts(resizedPod, expectedContainers); restartErrs != nil { + if restartErrs := verifyPodRestarts(f, resizedPod, expectedContainers); restartErrs != nil { errs = append(errs, fmt.Errorf("container restart counts don't match expected: %w", formatErrors(restartErrs))) } + // Verify Pod Resize conditions are empty. + for _, condition := range resizedPod.Status.Conditions { + if condition.Type == v1.PodResizeInProgress || condition.Type == v1.PodResizePending { + errs = append(errs, fmt.Errorf("unexpected resize condition type %s found in pod status", condition.Type)) + } + } + if len(errs) > 0 { resizedPod.ManagedFields = nil // Suppress managed fields in error output. framework.ExpectNoError(formatErrors(utilerrors.NewAggregate(errs)), @@ -395,3 +503,35 @@ func ResizeContainerPatch(containers []ResizableContainerInfo) (string, error) { return string(patchBytes), nil } + +// UpdateExpectedContainerRestarts updates the RestartCounts in expectedContainers by +// adding them to the existing RestartCounts in the containerStatuses of the provided pod. +// This reduces the flakiness of the RestartCount assertions by grabbing the current +// restart count right before the resize operation, and verify the expected increment (0 or 1) +// rather than the absolute count. +func UpdateExpectedContainerRestarts(ctx context.Context, pod *v1.Pod, expectedContainers []ResizableContainerInfo) []ResizableContainerInfo { + initialRestarts := make(map[string]int32) + newExpectedContainers := []ResizableContainerInfo{} + for _, ctr := range pod.Status.ContainerStatuses { + initialRestarts[ctr.Name] = ctr.RestartCount + } + for i, ctr := range expectedContainers { + newExpectedContainers = append(newExpectedContainers, expectedContainers[i]) + newExpectedContainers[i].RestartCount += initialRestarts[ctr.Name] + } + return newExpectedContainers +} + +func formatErrors(err error) error { + // Put each error on a new line for readability. + var agg utilerrors.Aggregate + if !errors.As(err, &agg) { + return err + } + + errStrings := make([]string, len(agg.Errors())) + for i, err := range agg.Errors() { + errStrings[i] = err.Error() + } + return fmt.Errorf("[\n%s\n]", strings.Join(errStrings, ",\n")) +} diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/resource.go b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/resource.go index 3039a9bc8..6dc039587 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/resource.go +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/resource.go @@ -59,12 +59,6 @@ func expectNoErrorWithOffset(offset int, err error, explain ...interface{}) { gomega.ExpectWithOffset(1+offset, err).NotTo(gomega.HaveOccurred(), explain...) } -// PodsCreated returns a pod list matched by the given name. -func PodsCreated(ctx context.Context, c clientset.Interface, ns, name string, replicas int32) (*v1.PodList, error) { - label := labels.SelectorFromSet(labels.Set(map[string]string{"name": name})) - return PodsCreatedByLabel(ctx, c, ns, name, replicas, label) -} - // PodsCreatedByLabel returns a created pod list matched by the given label. func PodsCreatedByLabel(ctx context.Context, c clientset.Interface, ns, name string, replicas int32, label labels.Selector) (*v1.PodList, error) { timeout := 2 * time.Minute @@ -95,26 +89,32 @@ func PodsCreatedByLabel(ctx context.Context, c clientset.Interface, ns, name str } // VerifyPods checks if the specified pod is responding. -func VerifyPods(ctx context.Context, c clientset.Interface, ns, name string, wantName bool, replicas int32) error { - return podRunningMaybeResponding(ctx, c, ns, name, wantName, replicas, true) -} - -// VerifyPodsRunning checks if the specified pod is running. -func VerifyPodsRunning(ctx context.Context, c clientset.Interface, ns, name string, wantName bool, replicas int32) error { - return podRunningMaybeResponding(ctx, c, ns, name, wantName, replicas, false) -} - -func podRunningMaybeResponding(ctx context.Context, c clientset.Interface, ns, name string, wantName bool, replicas int32, checkResponding bool) error { - pods, err := PodsCreated(ctx, c, ns, name, replicas) +func VerifyPods(ctx context.Context, c clientset.Interface, ns, name string, selector labels.Selector, wantName bool, replicas int32) error { + pods, err := PodsCreatedByLabel(ctx, c, ns, name, replicas, selector) if err != nil { return err } + + return podsRunningMaybeResponding(ctx, c, ns, name, selector, pods, wantName, true) +} + +// VerifyPodsRunning checks if the specified pod is running. +func VerifyPodsRunning(ctx context.Context, c clientset.Interface, ns, name string, selector labels.Selector, wantName bool, replicas int32) error { + pods, err := PodsCreatedByLabel(ctx, c, ns, name, replicas, selector) + if err != nil { + return err + } + + return podsRunningMaybeResponding(ctx, c, ns, name, selector, pods, wantName, false) +} + +func podsRunningMaybeResponding(ctx context.Context, c clientset.Interface, ns string, name string, selector labels.Selector, pods *v1.PodList, wantName bool, checkResponding bool) error { e := podsRunning(ctx, c, pods) if len(e) > 0 { return fmt.Errorf("failed to wait for pods running: %v", e) } if checkResponding { - return WaitForPodsResponding(ctx, c, ns, name, wantName, podRespondingTimeout, pods) + return WaitForPodsResponding(ctx, c, ns, name, selector, wantName, podRespondingTimeout, pods) } return nil } @@ -172,7 +172,7 @@ func LogPodStates(pods []v1.Pod) { if pod.DeletionGracePeriodSeconds != nil { grace = fmt.Sprintf("%ds", *pod.DeletionGracePeriodSeconds) } - framework.Logf("%-[1]*[2]s %-[3]*[4]s %-[5]*[6]s %-[7]*[8]s %[9]s", + framework.Logf("%-[1]*[2]s %-[3]*[4]s %-[5]*[6]s %-[7]*[8]s %[9]v", maxPodW, pod.ObjectMeta.Name, maxNodeW, pod.Spec.NodeName, maxPhaseW, pod.Status.Phase, maxGraceW, grace, pod.Status.Conditions) } framework.Logf("") // Final empty line helps for readability. diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/utils.go b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/utils.go index d28a26c33..db7106e86 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/utils.go +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/utils.go @@ -17,14 +17,16 @@ limitations under the License. package pod import ( - "flag" "fmt" + "strconv" "strings" "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + kubecm "k8s.io/kubernetes/pkg/kubelet/cm" "k8s.io/kubernetes/test/e2e/framework" imageutils "k8s.io/kubernetes/test/utils/image" psaapi "k8s.io/pod-security-admission/api" @@ -32,21 +34,20 @@ import ( "k8s.io/utils/pointer" ) -// NodeOSDistroIs returns true if the distro is the same as `--node-os-distro` -// the package framework/pod can't import the framework package (see #81245) -// we need to check if the --node-os-distro=windows is set and the framework package -// is the one that's parsing the flags, as a workaround this method is looking for the same flag again -// TODO: replace with `framework.NodeOSDistroIs` when #81245 is complete -func NodeOSDistroIs(distro string) bool { - var nodeOsDistro *flag.Flag = flag.Lookup("node-os-distro") - if nodeOsDistro != nil && nodeOsDistro.Value.String() == distro { - return true - } - return false -} - +// This command runs an infinite loop, sleeping for 1 second in each iteration. +// It sets up a trap to exit gracefully when a TERM signal is received. +// +// This is useful for testing scenarios where the container is terminated +// with a zero exit code. const InfiniteSleepCommand = "trap exit TERM; while true; do sleep 1; done" +// This command will cause the shell to remain in a sleep state indefinitely, +// and it won't exit unless it receives a KILL signal. +// +// This is useful for testing scenarios where the container is terminated +// with a non-zero exit code. +const InfiniteSleepCommandWithoutGracefulShutdown = "while true; do sleep 100000; done" + // GenerateScriptCmd generates the corresponding command lines to execute a command. func GenerateScriptCmd(command string) []string { return []string{"/bin/sh", "-c", command} @@ -72,7 +73,7 @@ func GetDefaultTestImageID() imageutils.ImageID { // If the Node OS is windows, currently we return Agnhost image for Windows node // due to the issue of #https://github.com/kubernetes-sigs/windows-testing/pull/35. func GetTestImage(id imageutils.ImageID) string { - if NodeOSDistroIs("windows") { + if framework.NodeOSDistroIs("windows") { return imageutils.GetE2EImage(imageutils.Agnhost) } return imageutils.GetE2EImage(id) @@ -82,7 +83,7 @@ func GetTestImage(id imageutils.ImageID) string { // If the Node OS is windows, currently we return Agnhost image for Windows node // due to the issue of #https://github.com/kubernetes-sigs/windows-testing/pull/35. func GetTestImageID(id imageutils.ImageID) imageutils.ImageID { - if NodeOSDistroIs("windows") { + if framework.NodeOSDistroIs("windows") { return imageutils.Agnhost } return id @@ -92,7 +93,7 @@ func GetTestImageID(id imageutils.ImageID) imageutils.ImageID { // If the Node OS is windows, we return nill due to issue with invalid permissions set on projected volumes // https://github.com/kubernetes/kubernetes/issues/102849 func GetDefaultNonRootUser() *int64 { - if NodeOSDistroIs("windows") { + if framework.NodeOSDistroIs("windows") { return nil } return pointer.Int64(DefaultNonRootUser) @@ -102,7 +103,7 @@ func GetDefaultNonRootUser() *int64 { // If the Node OS is windows, currently we will ignore the inputs and return nil. // TODO: Will modify it after windows has its own security context func GeneratePodSecurityContext(fsGroup *int64, seLinuxOptions *v1.SELinuxOptions) *v1.PodSecurityContext { - if NodeOSDistroIs("windows") { + if framework.NodeOSDistroIs("windows") { return nil } return &v1.PodSecurityContext{ @@ -115,7 +116,7 @@ func GeneratePodSecurityContext(fsGroup *int64, seLinuxOptions *v1.SELinuxOption // If the Node OS is windows, currently we will ignore the inputs and return nil. // TODO: Will modify it after windows has its own security context func GenerateContainerSecurityContext(level psaapi.Level) *v1.SecurityContext { - if NodeOSDistroIs("windows") { + if framework.NodeOSDistroIs("windows") { return nil } @@ -139,7 +140,7 @@ func GenerateContainerSecurityContext(level psaapi.Level) *v1.SecurityContext { // GetLinuxLabel returns the default SELinuxLabel based on OS. // If the node OS is windows, it will return nil func GetLinuxLabel() *v1.SELinuxOptions { - if NodeOSDistroIs("windows") { + if framework.NodeOSDistroIs("windows") { return nil } return &v1.SELinuxOptions{ @@ -162,7 +163,7 @@ func GetRestrictedPodSecurityContext() *v1.PodSecurityContext { SeccompProfile: &v1.SeccompProfile{Type: v1.SeccompProfileTypeRuntimeDefault}, } - if NodeOSDistroIs("windows") { + if framework.NodeOSDistroIs("windows") { psc.WindowsOptions = &v1.WindowsSecurityContextOptions{} psc.WindowsOptions.RunAsUserName = pointer.String(DefaultNonRootUserName) } @@ -205,7 +206,7 @@ func MixinRestrictedPodSecurity(pod *v1.Pod) error { if pod.Spec.SecurityContext.SeccompProfile == nil { pod.Spec.SecurityContext.SeccompProfile = &v1.SeccompProfile{Type: v1.SeccompProfileTypeRuntimeDefault} } - if NodeOSDistroIs("windows") && pod.Spec.SecurityContext.WindowsOptions == nil { + if framework.NodeOSDistroIs("windows") && pod.Spec.SecurityContext.WindowsOptions == nil { pod.Spec.SecurityContext.WindowsOptions = &v1.WindowsSecurityContextOptions{} pod.Spec.SecurityContext.WindowsOptions.RunAsUserName = pointer.String(DefaultNonRootUserName) } @@ -258,6 +259,21 @@ func FindPodConditionByType(podStatus *v1.PodStatus, conditionType v1.PodConditi return nil } +// FindContainerInPod finds the container in a pod by its name +func FindContainerInPod(pod *v1.Pod, containerName string) *v1.Container { + for _, container := range pod.Spec.InitContainers { + if container.Name == containerName { + return &container + } + } + for _, container := range pod.Spec.Containers { + if container.Name == containerName { + return &container + } + } + return nil +} + // FindContainerStatusInPod finds a container status by its name in the provided pod func FindContainerStatusInPod(pod *v1.Pod, containerName string) *v1.ContainerStatus { for _, containerStatus := range pod.Status.InitContainerStatuses { @@ -279,19 +295,40 @@ func FindContainerStatusInPod(pod *v1.Pod, containerName string) *v1.ContainerSt } // VerifyCgroupValue verifies that the given cgroup path has the expected value in -// the specified container of the pod. It execs into the container to retrive the -// cgroup value and compares it against the expected value. -func VerifyCgroupValue(f *framework.Framework, pod *v1.Pod, cName, cgPath, expectedCgValue string) error { +// the specified container of the pod. It execs into the container to retrieve the +// cgroup value, and ensures that the retrieved cgroup value is equivalent to at +// least one of the values in expectedCgValues. +func VerifyCgroupValue(f *framework.Framework, pod *v1.Pod, cName, cgPath string, expectedCgValues ...string) error { cmd := fmt.Sprintf("head -n 1 %s", cgPath) - framework.Logf("Namespace %s Pod %s Container %s - looking for cgroup value %s in path %s", - pod.Namespace, pod.Name, cName, expectedCgValue, cgPath) + framework.Logf("Namespace %s Pod %s Container %s - looking for one of the expected cgroup values %s in path %s", + pod.Namespace, pod.Name, cName, expectedCgValues, cgPath) cgValue, _, err := ExecCommandInContainerWithFullOutput(f, pod.Name, cName, "/bin/sh", "-c", cmd) if err != nil { - return fmt.Errorf("failed to find expected value %q in container cgroup %q", expectedCgValue, cgPath) + return fmt.Errorf("failed to find one of the expected cgroup values %q in container cgroup %q", expectedCgValues, cgPath) } cgValue = strings.Trim(cgValue, "\n") - if cgValue != expectedCgValue { - return fmt.Errorf("cgroup value %q not equal to expected %q", cgValue, expectedCgValue) + + if err := framework.Gomega().Expect(cgValue).To(gomega.BeElementOf(expectedCgValues)); err != nil { + return fmt.Errorf("value of cgroup %q for container %q should match one of the expectations: %w", cgPath, cName, err) + } + + return nil +} + +// VerifyOomScoreAdjValue verifies that oom_score_adj for pid 1 (pidof init/systemd -> app) +// has the expected value in specified container of the pod. It execs into the container, +// reads the oom_score_adj value from procfs, and compares it against the expected value. +func VerifyOomScoreAdjValue(f *framework.Framework, pod *v1.Pod, cName, expectedOomScoreAdj string) error { + cmd := "cat /proc/1/oom_score_adj" + framework.Logf("Namespace %s Pod %s Container %s - looking for oom_score_adj value %s", + pod.Namespace, pod.Name, cName, expectedOomScoreAdj) + oomScoreAdj, _, err := ExecCommandInContainerWithFullOutput(f, pod.Name, cName, "/bin/sh", "-c", cmd) + if err != nil { + return fmt.Errorf("failed to find expected value %s for container app process", expectedOomScoreAdj) + } + oomScoreAdj = strings.Trim(oomScoreAdj, "\n") + if oomScoreAdj != expectedOomScoreAdj { + return fmt.Errorf("oom_score_adj value %s not equal to expected %s", oomScoreAdj, expectedOomScoreAdj) } return nil } @@ -307,3 +344,35 @@ func IsPodOnCgroupv2Node(f *framework.Framework, pod *v1.Pod) bool { } return len(out) != 0 } + +// TODO: Remove the rounded cpu limit values when https://github.com/opencontainers/runc/issues/4622 +// is fixed. +func GetCPULimitCgroupExpectations(cpuLimit *resource.Quantity) []string { + var expectedCPULimits []string + milliCPULimit := cpuLimit.MilliValue() + + cpuQuota := kubecm.MilliCPUToQuota(milliCPULimit, kubecm.QuotaPeriod) + if cpuLimit.IsZero() { + cpuQuota = -1 + } + expectedCPULimits = append(expectedCPULimits, getExpectedCPULimitFromCPUQuota(cpuQuota)) + + if milliCPULimit%10 != 0 && cpuQuota != -1 { + roundedCPULimit := (milliCPULimit/10 + 1) * 10 + cpuQuotaRounded := kubecm.MilliCPUToQuota(roundedCPULimit, kubecm.QuotaPeriod) + expectedCPULimits = append(expectedCPULimits, getExpectedCPULimitFromCPUQuota(cpuQuotaRounded)) + } + + return expectedCPULimits +} + +func getExpectedCPULimitFromCPUQuota(cpuQuota int64) string { + expectedCPULimitString := strconv.FormatInt(cpuQuota, 10) + if *podOnCgroupv2Node { + if expectedCPULimitString == "-1" { + expectedCPULimitString = "max" + } + expectedCPULimitString = fmt.Sprintf("%s %s", expectedCPULimitString, CPUPeriod) + } + return expectedCPULimitString +} diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/wait.go b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/wait.go index 537d59c32..d7067be28 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/wait.go +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pod/wait.go @@ -84,6 +84,27 @@ func BeRunningNoRetries() types.GomegaMatcher { ) } +// BeRunningReadyNoRetries verifies that a pod starts running and has a ready +// condition of status true. It's a permanent failure when the pod enters some +// other permanent phase. +func BeRunningReadyNoRetries() types.GomegaMatcher { + return gomega.And( + // This additional matcher checks for the final error condition. + gcustom.MakeMatcher(func(pod *v1.Pod) (bool, error) { + switch pod.Status.Phase { + case v1.PodFailed, v1.PodSucceeded: + return false, gomega.StopTrying(fmt.Sprintf("Expected pod to reach phase %q, got final phase %q instead:\n%s", v1.PodRunning, pod.Status.Phase, format.Object(pod, 1))) + default: + return true, nil + } + }), + BeInPhase(v1.PodRunning), + gcustom.MakeMatcher(func(pod *v1.Pod) (bool, error) { + return podutils.IsPodReady(pod), nil + }).WithMessage("Expected pod to have a ready condition of status true"), + ) +} + // BeInPhase matches if pod.status.phase is the expected phase. func BeInPhase(phase v1.PodPhase) types.GomegaMatcher { // A simple implementation of this would be: @@ -285,7 +306,7 @@ func WaitForPodsRunningReady(ctx context.Context, c clientset.Interface, ns stri } -// WaitForPodCondition waits a pods to be matched to the given condition. +// WaitForPodCondition waits for a pod to be matched to the given condition. // The condition callback may use gomega.StopTrying to abort early. func WaitForPodCondition(ctx context.Context, c clientset.Interface, ns, podName, conditionDesc string, timeout time.Duration, condition podCondition) error { return framework.Gomega(). @@ -305,6 +326,45 @@ func WaitForPodCondition(ctx context.Context, c clientset.Interface, ns, podName })) } +// WaitForPodObservedGeneration waits for a pod to have the given observed generation. +func WaitForPodObservedGeneration(ctx context.Context, c clientset.Interface, ns, podName string, expectedGeneration int64, timeout time.Duration) error { + return framework.Gomega(). + Eventually(ctx, framework.RetryNotFound(framework.GetObject(c.CoreV1().Pods(ns).Get, podName, metav1.GetOptions{}))). + WithTimeout(timeout). + Should(framework.MakeMatcher(func(pod *v1.Pod) (func() string, error) { + if pod.Status.ObservedGeneration == expectedGeneration { + return nil, nil + } + return func() string { + return fmt.Sprintf("expected pod generation to be %d, got %d instead:\n", expectedGeneration, pod.Status.ObservedGeneration) + }, nil + })) +} + +// WaitForPodConditionObservedGeneration waits for a pod condition to have the given observed generation. +func WaitForPodConditionObservedGeneration(ctx context.Context, c clientset.Interface, ns, podName string, conditionType v1.PodConditionType, expectedGeneration int64, timeout time.Duration) error { + return framework.Gomega(). + Eventually(ctx, framework.RetryNotFound(framework.GetObject(c.CoreV1().Pods(ns).Get, podName, metav1.GetOptions{}))). + WithTimeout(timeout). + Should(framework.MakeMatcher(func(pod *v1.Pod) (func() string, error) { + for _, condition := range pod.Status.Conditions { + if condition.Type == conditionType { + if condition.ObservedGeneration == expectedGeneration { + return nil, nil + } else { + return func() string { + return fmt.Sprintf("expected condition %s generation to be %d, got %d instead:\n", conditionType, expectedGeneration, condition.ObservedGeneration) + }, nil + } + } + } + + return func() string { + return fmt.Sprintf("could not find condition %s:\n", conditionType) + }, nil + })) +} + // Range determines how many items must exist and how many must match a certain // condition. Values <= 0 are ignored. // TODO (?): move to test/e2e/framework/range @@ -526,6 +586,16 @@ func WaitTimeoutForPodRunningInNamespace(ctx context.Context, c clientset.Interf Should(BeRunningNoRetries()) } +// WaitTimeoutForPodRunningReadyInNamespace waits the given timeout duration for the specified pod to become running +// and have a ready condition of status true. +// It does not need to exist yet when this function gets called and the pod is not expected to be recreated +// when it succeeds or fails. +func WaitTimeoutForPodRunningReadyInNamespace(ctx context.Context, c clientset.Interface, podName, namespace string, timeout time.Duration) error { + return framework.Gomega().Eventually(ctx, framework.RetryNotFound(framework.GetObject(c.CoreV1().Pods(namespace).Get, podName, metav1.GetOptions{}))). + WithTimeout(timeout). + Should(BeRunningReadyNoRetries()) +} + // WaitForPodRunningInNamespace 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(ctx context.Context, c clientset.Interface, pod *v1.Pod) error { @@ -604,13 +674,12 @@ func WaitForPodNotFoundInNamespace(ctx context.Context, c clientset.Interface, p } // WaitForPodsResponding waits for the pods to response. -func WaitForPodsResponding(ctx context.Context, c clientset.Interface, ns string, controllerName string, wantName bool, timeout time.Duration, pods *v1.PodList) error { +func WaitForPodsResponding(ctx context.Context, c clientset.Interface, ns string, controllerName string, selector labels.Selector, wantName bool, timeout time.Duration, pods *v1.PodList) error { if timeout == 0 { timeout = podRespondingTimeout } ginkgo.By("trying to dial each unique pod") - label := labels.SelectorFromSet(labels.Set(map[string]string{"name": controllerName})) - options := metav1.ListOptions{LabelSelector: label.String()} + options := metav1.ListOptions{LabelSelector: selector.String()} type response struct { podName string @@ -801,7 +870,7 @@ func WaitForPodScheduled(ctx context.Context, c clientset.Interface, namespace, func WaitForPodContainerStarted(ctx context.Context, c clientset.Interface, namespace, podName string, containerIndex int, timeout time.Duration) error { conditionDesc := fmt.Sprintf("container %d started", containerIndex) return WaitForPodCondition(ctx, c, namespace, podName, conditionDesc, timeout, func(pod *v1.Pod) (bool, error) { - if containerIndex > len(pod.Status.ContainerStatuses)-1 { + if containerIndex >= len(pod.Status.ContainerStatuses) { return false, nil } containerStatus := pod.Status.ContainerStatuses[containerIndex] @@ -813,7 +882,7 @@ func WaitForPodContainerStarted(ctx context.Context, c clientset.Interface, name func WaitForPodInitContainerStarted(ctx context.Context, c clientset.Interface, namespace, podName string, initContainerIndex int, timeout time.Duration) error { conditionDesc := fmt.Sprintf("init container %d started", initContainerIndex) return WaitForPodCondition(ctx, c, namespace, podName, conditionDesc, timeout, func(pod *v1.Pod) (bool, error) { - if initContainerIndex > len(pod.Status.InitContainerStatuses)-1 { + if initContainerIndex >= len(pod.Status.InitContainerStatuses) { return false, nil } initContainerStatus := pod.Status.InitContainerStatuses[initContainerIndex] diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pv/wait.go b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pv/wait.go index 6f903d996..ebfe227af 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pv/wait.go +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/pv/wait.go @@ -68,3 +68,42 @@ func WaitForPersistentVolumeClaimModified(ctx context.Context, c clientset.Inter }, nil })) } + +// WaitForPersistentVolumeClaimModificationFailure waits the given timeout duration for the specified claim to have +// failed to bind to the invalid volume attributes class. +// Returns an error if timeout occurs first. +func WaitForPersistentVolumeClaimModificationFailure(ctx context.Context, c clientset.Interface, claim *v1.PersistentVolumeClaim, timeout time.Duration) error { + desiredClass := ptr.Deref(claim.Spec.VolumeAttributesClassName, "") + + var match = func(claim *v1.PersistentVolumeClaim) bool { + for _, condition := range claim.Status.Conditions { + if condition.Type != v1.PersistentVolumeClaimVolumeModifyVolumeError { + return false + } + } + + // check if claim's current volume attributes class is NOT desired one, and has appropriate ModifyVolumeStatus + currentClass := ptr.Deref(claim.Status.CurrentVolumeAttributesClassName, "") + return claim.Status.Phase == v1.ClaimBound && + desiredClass != currentClass && claim.Status.ModifyVolumeStatus != nil && + (claim.Status.ModifyVolumeStatus.Status == v1.PersistentVolumeClaimModifyVolumeInProgress || + claim.Status.ModifyVolumeStatus.Status == v1.PersistentVolumeClaimModifyVolumeInfeasible) + } + + if match(claim) { + return nil + } + + return framework.Gomega(). + Eventually(ctx, framework.GetObject(c.CoreV1().PersistentVolumeClaims(claim.Namespace).Get, claim.Name, metav1.GetOptions{})). + WithTimeout(timeout). + Should(framework.MakeMatcher(func(claim *v1.PersistentVolumeClaim) (func() string, error) { + if match(claim) { + return nil, nil + } + + return func() string { + return fmt.Sprintf("expected claim's status to NOT be modified with the given VolumeAttirbutesClass %s, got instead:\n%s", desiredClass, format.Object(claim, 1)) + }, nil + })) +} diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/ssh/ssh.go b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/ssh/ssh.go index b1f0901f8..e19317545 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/ssh/ssh.go +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/ssh/ssh.go @@ -66,7 +66,7 @@ func GetSigner(provider string) (ssh.Signer, error) { // support. keyfile := "" switch provider { - case "gce", "gke", "kubemark": + case "gce", "kubemark": keyfile = os.Getenv("GCE_SSH_KEY") if keyfile == "" { keyfile = os.Getenv("GCE_SSH_PRIVATE_KEY_FILE") diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/util.go b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/util.go index a6dc9b125..7eed8e367 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/util.go +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/util.go @@ -53,12 +53,6 @@ import ( "k8s.io/client-go/tools/clientcmd" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" watchtools "k8s.io/client-go/tools/watch" - netutils "k8s.io/utils/net" -) - -const ( - // TODO(justinsb): Avoid hardcoding this. - awsMasterIP = "172.20.0.9" ) // DEPRECATED constants. Use the timeouts in framework.Framework instead. @@ -135,7 +129,7 @@ const ( var ( // ProvidersWithSSH are those providers where each node is accessible with SSH - ProvidersWithSSH = []string{"gce", "gke", "aws", "local", "azure"} + ProvidersWithSSH = []string{"gce", "aws", "local", "azure"} ) // RunID is a unique identifier of the e2e run. @@ -416,29 +410,12 @@ func CheckTestingNSDeletedExcept(ctx context.Context, c clientset.Interface, ski return fmt.Errorf("Waiting for terminating namespaces to be deleted timed out") } -// WaitForServiceEndpointsNum waits until the amount of endpoints that implement service to expectNum. -// Some components use EndpointSlices other Endpoints, we must verify that both objects meet the requirements. +// WaitForServiceEndpointsNum waits until there are EndpointSlices for serviceName +// containing a total of expectNum endpoints. (If the service is dual-stack, expectNum +// must count the endpoints of both IP families.) func WaitForServiceEndpointsNum(ctx context.Context, c clientset.Interface, namespace, serviceName string, expectNum int, interval, timeout time.Duration) error { return wait.PollUntilContextTimeout(ctx, interval, timeout, false, func(ctx context.Context) (bool, error) { Logf("Waiting for amount of service:%s endpoints to be %d", serviceName, expectNum) - endpoint, err := c.CoreV1().Endpoints(namespace).Get(ctx, serviceName, metav1.GetOptions{}) - if err != nil { - Logf("Unexpected error trying to get Endpoints for %s : %v", serviceName, err) - return false, nil - } - - if countEndpointsNum(endpoint) != expectNum { - Logf("Unexpected number of Endpoints, got %d, expected %d", countEndpointsNum(endpoint), expectNum) - return false, nil - } - - // Endpoints are single family but EndpointSlices can have dual stack addresses, - // so we verify the number of addresses that matches the same family on both. - addressType := discoveryv1.AddressTypeIPv4 - if isIPv6Endpoint(endpoint) { - addressType = discoveryv1.AddressTypeIPv6 - } - esList, err := c.DiscoveryV1().EndpointSlices(namespace).List(ctx, metav1.ListOptions{LabelSelector: fmt.Sprintf("%s=%s", discoveryv1.LabelServiceName, serviceName)}) if err != nil { Logf("Unexpected error trying to get EndpointSlices for %s : %v", serviceName, err) @@ -450,44 +427,18 @@ func WaitForServiceEndpointsNum(ctx context.Context, c clientset.Interface, name return false, nil } - if countEndpointsSlicesNum(esList, addressType) != expectNum { - Logf("Unexpected number of Endpoints on Slices, got %d, expected %d", countEndpointsSlicesNum(esList, addressType), expectNum) + if countEndpointsSlicesNum(esList) != expectNum { + Logf("Unexpected number of Endpoints on Slices, got %d, expected %d", countEndpointsSlicesNum(esList), expectNum) return false, nil } return true, nil }) } -func countEndpointsNum(e *v1.Endpoints) int { - num := 0 - for _, sub := range e.Subsets { - num += len(sub.Addresses) - } - return num -} - -// isIPv6Endpoint returns true if the Endpoint uses IPv6 addresses -func isIPv6Endpoint(e *v1.Endpoints) bool { - for _, sub := range e.Subsets { - for _, addr := range sub.Addresses { - if len(addr.IP) == 0 { - continue - } - // Endpoints are single family, so it is enough to check only one address - return netutils.IsIPv6String(addr.IP) - } - } - // default to IPv4 an Endpoint without IP addresses - return false -} - -func countEndpointsSlicesNum(epList *discoveryv1.EndpointSliceList, addressType discoveryv1.AddressType) int { +func countEndpointsSlicesNum(epList *discoveryv1.EndpointSliceList) int { // EndpointSlices can contain the same address on multiple Slices addresses := sets.Set[string]{} for _, epSlice := range epList.Items { - if epSlice.AddressType != addressType { - continue - } for _, ep := range epSlice.Endpoints { if len(ep.Addresses) > 0 { addresses.Insert(ep.Addresses[0]) @@ -678,38 +629,6 @@ func GetNodeExternalIPs(node *v1.Node) (ips []string) { return } -// getControlPlaneAddresses returns the externalIP, internalIP and hostname fields of control plane nodes. -// If any of these is unavailable, empty slices are returned. -func getControlPlaneAddresses(ctx context.Context, c clientset.Interface) ([]string, []string, []string) { - var externalIPs, internalIPs, hostnames []string - - // Populate the internal IPs. - eps, err := c.CoreV1().Endpoints(metav1.NamespaceDefault).Get(ctx, "kubernetes", metav1.GetOptions{}) - if err != nil { - Failf("Failed to get kubernetes endpoints: %v", err) - } - for _, subset := range eps.Subsets { - for _, address := range subset.Addresses { - if address.IP != "" { - internalIPs = append(internalIPs, address.IP) - } - } - } - - // Populate the external IP/hostname. - hostURL, err := url.Parse(TestContext.Host) - if err != nil { - Failf("Failed to parse hostname: %v", err) - } - if netutils.ParseIPSloppy(hostURL.Host) != nil { - externalIPs = append(externalIPs, hostURL.Host) - } else { - hostnames = append(hostnames, hostURL.Host) - } - - return externalIPs, internalIPs, hostnames -} - // GetControlPlaneNodes returns a list of control plane nodes func GetControlPlaneNodes(ctx context.Context, c clientset.Interface) *v1.NodeList { allNodes, err := c.CoreV1().Nodes().List(ctx, metav1.ListOptions{}) @@ -737,30 +656,6 @@ func GetControlPlaneNodes(ctx context.Context, c clientset.Interface) *v1.NodeLi return &cpNodes } -// GetControlPlaneAddresses returns all IP addresses on which the kubelet can reach the control plane. -// It may return internal and external IPs, even if we expect for -// e.g. internal IPs to be used (issue #56787), so that we can be -// sure to block the control plane fully during tests. -func GetControlPlaneAddresses(ctx context.Context, c clientset.Interface) []string { - externalIPs, internalIPs, _ := getControlPlaneAddresses(ctx, c) - - ips := sets.NewString() - switch TestContext.Provider { - case "gce", "gke": - for _, ip := range externalIPs { - ips.Insert(ip) - } - for _, ip := range internalIPs { - ips.Insert(ip) - } - case "aws": - ips.Insert(awsMasterIP) - default: - Failf("This test is not supported for provider %s and should be disabled", TestContext.Provider) - } - return ips.List() -} - // PrettyPrintJSON converts metrics to JSON format. func PrettyPrintJSON(metrics interface{}) string { output := &bytes.Buffer{} diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/volume/fixtures.go b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/volume/fixtures.go index 9f0425ed5..830ec08f2 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/volume/fixtures.go +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/framework/volume/fixtures.go @@ -53,14 +53,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" clientset "k8s.io/client-go/kubernetes" - clientexec "k8s.io/client-go/util/exec" "k8s.io/kubernetes/test/e2e/framework" e2ekubectl "k8s.io/kubernetes/test/e2e/framework/kubectl" e2epod "k8s.io/kubernetes/test/e2e/framework/pod" e2epodoutput "k8s.io/kubernetes/test/e2e/framework/pod/output" imageutils "k8s.io/kubernetes/test/utils/image" admissionapi "k8s.io/pod-security-admission/api" - uexec "k8s.io/utils/exec" "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" @@ -179,18 +177,18 @@ func NewNFSServerWithNodeName(ctx context.Context, cs clientset.Interface, names // Restart the passed-in nfs-server by issuing a `rpc.nfsd 1` command in the // pod's (only) container. This command changes the number of nfs server threads from // (presumably) zero back to 1, and therefore allows nfs to open connections again. -func RestartNFSServer(f *framework.Framework, serverPod *v1.Pod) { +func RestartNFSServer(ctx context.Context, f *framework.Framework, serverPod *v1.Pod) { const startcmd = "rpc.nfsd 1" - _, _, err := PodExec(f, serverPod, startcmd) + _, _, err := e2epod.ExecShellInPodWithFullOutput(ctx, f, serverPod.Name, startcmd) framework.ExpectNoError(err) } // Stop the passed-in nfs-server by issuing a `rpc.nfsd 0` command in the // pod's (only) container. This command changes the number of nfs server threads to 0, // thus closing all open nfs connections. -func StopNFSServer(f *framework.Framework, serverPod *v1.Pod) { +func StopNFSServer(ctx context.Context, f *framework.Framework, serverPod *v1.Pod) { const stopcmd = "rpc.nfsd 0 && for i in $(seq 200); do rpcinfo -p | grep -q nfs || break; sleep 1; done" - _, _, err := PodExec(f, serverPod, stopcmd) + _, _, err := e2epod.ExecShellInPodWithFullOutput(ctx, f, serverPod.Name, stopcmd) framework.ExpectNoError(err) } @@ -501,7 +499,7 @@ func runVolumeTesterPod(ctx context.Context, client clientset.Interface, timeout return clientPod, nil } -func testVolumeContent(f *framework.Framework, pod *v1.Pod, containerName string, fsGroup *int64, fsType string, tests []Test) { +func testVolumeContent(ctx context.Context, f *framework.Framework, pod *v1.Pod, containerName string, fsGroup *int64, fsType string, tests []Test) { ginkgo.By("Checking that text file contents are perfect.") for i, test := range tests { if test.Mode == v1.PersistentVolumeBlock { @@ -512,7 +510,8 @@ func testVolumeContent(f *framework.Framework, pod *v1.Pod, containerName string framework.ExpectNoError(err, "failed: finding the contents of the block device %s.", deviceName) // Check that it's a real block device - CheckVolumeModeOfPath(f, pod, test.Mode, deviceName) + err = CheckVolumeModeOfPath(ctx, f, pod, test.Mode, deviceName) + framework.ExpectNoError(err, "failed: getting the right privileges in the block device %v", deviceName) } else { // Filesystem: check content fileName := fmt.Sprintf("/opt/%d/%s", i, test.File) @@ -522,7 +521,8 @@ func testVolumeContent(f *framework.Framework, pod *v1.Pod, containerName string // Check that a directory has been mounted dirName := filepath.Dir(fileName) - CheckVolumeModeOfPath(f, pod, test.Mode, dirName) + err = CheckVolumeModeOfPath(ctx, f, pod, test.Mode, dirName) + framework.ExpectNoError(err, "failed: getting the right privileges in the directory %v", dirName) if !framework.NodeOSDistroIs("windows") { // Filesystem: check fsgroup @@ -576,7 +576,7 @@ func testVolumeClient(ctx context.Context, f *framework.Framework, config TestCo framework.ExpectNoError(e2epod.WaitForPodNotFoundInNamespace(ctx, f.ClientSet, clientPod.Name, clientPod.Namespace, timeouts.PodDelete)) }() - testVolumeContent(f, clientPod, "", fsGroup, fsType, tests) + testVolumeContent(ctx, f, clientPod, "", fsGroup, fsType, tests) ginkgo.By("Repeating the test on an ephemeral container (if enabled)") ec := &v1.EphemeralContainer{ @@ -587,7 +587,7 @@ func testVolumeClient(ctx context.Context, f *framework.Framework, config TestCo err = e2epod.NewPodClient(f).AddEphemeralContainerSync(ctx, clientPod, ec, timeouts.PodStart) // The API server will return NotFound for the subresource when the feature is disabled framework.ExpectNoError(err, "failed to add ephemeral container for re-test") - testVolumeContent(f, clientPod, ec.Name, fsGroup, fsType, tests) + testVolumeContent(ctx, f, clientPod, ec.Name, fsGroup, fsType, tests) } // InjectContent inserts index.html with given content into given volume. It does so by @@ -630,7 +630,7 @@ func InjectContent(ctx context.Context, f *framework.Framework, config TestConfi // Check that the data have been really written in this pod. // This tests non-persistent volume types - testVolumeContent(f, injectorPod, "", fsGroup, fsType, tests) + testVolumeContent(ctx, f, injectorPod, "", fsGroup, fsType, tests) } // generateWriteCmd is used by generateWriteBlockCmd and generateWriteFileCmd @@ -665,64 +665,27 @@ func generateWriteFileCmd(content, fullPath string) []string { } // CheckVolumeModeOfPath check mode of volume -func CheckVolumeModeOfPath(f *framework.Framework, pod *v1.Pod, volMode v1.PersistentVolumeMode, path string) { +func CheckVolumeModeOfPath(ctx context.Context, f *framework.Framework, pod *v1.Pod, volMode v1.PersistentVolumeMode, path string) error { if volMode == v1.PersistentVolumeBlock { // Check if block exists - VerifyExecInPodSucceed(f, pod, fmt.Sprintf("test -b %s", path)) + if err := e2epod.VerifyExecInPodSucceed(ctx, f, pod, fmt.Sprintf("test -b %s", path)); err != nil { + return err + } // Double check that it's not directory - VerifyExecInPodFail(f, pod, fmt.Sprintf("test -d %s", path), 1) + if err := e2epod.VerifyExecInPodFail(ctx, f, pod, fmt.Sprintf("test -d %s", path), 1); err != nil { + return err + } } else { // Check if directory exists - VerifyExecInPodSucceed(f, pod, fmt.Sprintf("test -d %s", path)) + if err := e2epod.VerifyExecInPodSucceed(ctx, f, pod, fmt.Sprintf("test -d %s", path)); err != nil { + return err + } // Double check that it's not block - VerifyExecInPodFail(f, pod, fmt.Sprintf("test -b %s", path), 1) - } -} - -// PodExec runs f.ExecCommandInContainerWithFullOutput to execute a shell cmd in target pod -// TODO: put this under e2epod once https://github.com/kubernetes/kubernetes/issues/81245 -// is resolved. Otherwise there will be dependency issue. -func PodExec(f *framework.Framework, pod *v1.Pod, shExec string) (string, string, error) { - return e2epod.ExecCommandInContainerWithFullOutput(f, pod.Name, pod.Spec.Containers[0].Name, "/bin/sh", "-c", shExec) -} - -// VerifyExecInPodSucceed verifies shell cmd in target pod succeed -// TODO: put this under e2epod once https://github.com/kubernetes/kubernetes/issues/81245 -// is resolved. Otherwise there will be dependency issue. -func VerifyExecInPodSucceed(f *framework.Framework, pod *v1.Pod, shExec string) { - stdout, stderr, err := PodExec(f, pod, shExec) - if err != nil { - if exiterr, ok := err.(uexec.CodeExitError); ok { - exitCode := exiterr.ExitStatus() - framework.ExpectNoError(err, - "%q should succeed, but failed with exit code %d and error message %q\nstdout: %s\nstderr: %s", - shExec, exitCode, exiterr, stdout, stderr) - } else { - framework.ExpectNoError(err, - "%q should succeed, but failed with error message %q\nstdout: %s\nstderr: %s", - shExec, err, stdout, stderr) + if err := e2epod.VerifyExecInPodFail(ctx, f, pod, fmt.Sprintf("test -b %s", path), 1); err != nil { + return err } } -} - -// VerifyExecInPodFail verifies shell cmd in target pod fail with certain exit code -// TODO: put this under e2epod once https://github.com/kubernetes/kubernetes/issues/81245 -// is resolved. Otherwise there will be dependency issue. -func VerifyExecInPodFail(f *framework.Framework, pod *v1.Pod, shExec string, exitCode int) { - stdout, stderr, err := PodExec(f, pod, shExec) - if err != nil { - if exiterr, ok := err.(clientexec.ExitError); ok { - actualExitCode := exiterr.ExitStatus() - gomega.Expect(actualExitCode).To(gomega.Equal(exitCode), - "%q should fail with exit code %d, but failed with exit code %d and error message %q\nstdout: %s\nstderr: %s", - shExec, exitCode, actualExitCode, exiterr, stdout, stderr) - } else { - framework.ExpectNoError(err, - "%q should fail with exit code %d, but failed with error message %q\nstdout: %s\nstderr: %s", - shExec, exitCode, err, stdout, stderr) - } - } - gomega.Expect(err).To(gomega.HaveOccurred(), "%q should fail with exit code %d, but exit without error", shExec, exitCode) + return nil } diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/storage/podlogs/podlogs.go b/e2e/vendor/k8s.io/kubernetes/test/e2e/storage/podlogs/podlogs.go index 692078b83..da1c35fcc 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/storage/podlogs/podlogs.go +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/storage/podlogs/podlogs.go @@ -313,7 +313,7 @@ func WatchPods(ctx context.Context, cs clientset.Interface, ns string, to io.Wri } buffer := new(bytes.Buffer) fmt.Fprintf(buffer, - "%s pod: %s: %s/%s %s: %s %s\n", + "%s pod: %s: %s/%s %s: %s %v\n", time.Now().Format(timeFormat), e.Type, pod.Namespace, diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/storage/utils/local.go b/e2e/vendor/k8s.io/kubernetes/test/e2e/storage/utils/local.go index df96eac12..1dccee346 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/storage/utils/local.go +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/storage/utils/local.go @@ -27,6 +27,7 @@ import ( "strings" "github.com/onsi/ginkgo/v2" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/uuid" "k8s.io/kubernetes/test/e2e/framework" @@ -215,7 +216,7 @@ func (l *ltrMgr) cleanupLocalVolumeDirectory(ctx context.Context, ltr *LocalTest func (l *ltrMgr) setupLocalVolumeDirectoryLink(ctx context.Context, node *v1.Node, parameters map[string]string) *LocalTestResource { hostDir := l.getTestDir() hostDirBackend := hostDir + "-backend" - cmd := fmt.Sprintf("mkdir %s && ln -s %s %s", hostDirBackend, hostDirBackend, hostDir) + cmd := fmt.Sprintf("mkdir -p %s && ln -s %s %s", hostDirBackend, hostDirBackend, hostDir) err := l.hostExec.IssueCommand(ctx, cmd, node) framework.ExpectNoError(err) return &LocalTestResource{ @@ -235,7 +236,7 @@ func (l *ltrMgr) cleanupLocalVolumeDirectoryLink(ctx context.Context, ltr *Local func (l *ltrMgr) setupLocalVolumeDirectoryBindMounted(ctx context.Context, node *v1.Node, parameters map[string]string) *LocalTestResource { hostDir := l.getTestDir() - cmd := fmt.Sprintf("mkdir %s && mount --bind %s %s", hostDir, hostDir, hostDir) + cmd := fmt.Sprintf("mkdir -p %s && mount --bind %s %s", hostDir, hostDir, hostDir) err := l.hostExec.IssueCommand(ctx, cmd, node) framework.ExpectNoError(err) return &LocalTestResource{ @@ -255,7 +256,7 @@ func (l *ltrMgr) cleanupLocalVolumeDirectoryBindMounted(ctx context.Context, ltr func (l *ltrMgr) setupLocalVolumeDirectoryLinkBindMounted(ctx context.Context, node *v1.Node, parameters map[string]string) *LocalTestResource { hostDir := l.getTestDir() hostDirBackend := hostDir + "-backend" - cmd := fmt.Sprintf("mkdir %s && mount --bind %s %s && ln -s %s %s", hostDirBackend, hostDirBackend, hostDirBackend, hostDirBackend, hostDir) + cmd := fmt.Sprintf("mkdir -p %s && mount --bind %s %s && ln -s %s %s", hostDirBackend, hostDirBackend, hostDirBackend, hostDirBackend, hostDir) err := l.hostExec.IssueCommand(ctx, cmd, node) framework.ExpectNoError(err) return &LocalTestResource{ diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/storage/utils/utils.go b/e2e/vendor/k8s.io/kubernetes/test/e2e/storage/utils/utils.go index e902d5224..9a40ff43f 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/storage/utils/utils.go +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/storage/utils/utils.go @@ -64,9 +64,9 @@ const ( ) // VerifyFSGroupInPod verifies that the passed in filePath contains the expectedFSGroup -func VerifyFSGroupInPod(f *framework.Framework, filePath, expectedFSGroup string, pod *v1.Pod) { +func VerifyFSGroupInPod(ctx context.Context, f *framework.Framework, filePath, expectedFSGroup string, pod *v1.Pod) { cmd := fmt.Sprintf("ls -l %s", filePath) - stdout, stderr, err := e2evolume.PodExec(f, pod, cmd) + stdout, stderr, err := e2epod.ExecShellInPodWithFullOutput(ctx, f, pod.Name, cmd) framework.ExpectNoError(err) framework.Logf("pod %s/%s exec for cmd %s, stdout: %s, stderr: %s", pod.Namespace, pod.Name, cmd, stdout, stderr) fsGroupResult := strings.Fields(stdout)[3] @@ -91,7 +91,7 @@ func TestKubeletRestartsAndRestoresMount(ctx context.Context, c clientset.Interf seed := time.Now().UTC().UnixNano() ginkgo.By("Writing to the volume.") - CheckWriteToPath(f, clientPod, v1.PersistentVolumeFilesystem, false, volumePath, byteLen, seed) + CheckWriteToPath(ctx, f, clientPod, v1.PersistentVolumeFilesystem, false, volumePath, byteLen, seed) ginkgo.By("Restarting kubelet") KubeletCommand(ctx, KRestart, c, clientPod) @@ -100,7 +100,7 @@ func TestKubeletRestartsAndRestoresMount(ctx context.Context, c clientset.Interf time.Sleep(20 * time.Second) ginkgo.By("Testing that written file is accessible.") - CheckReadFromPath(f, clientPod, v1.PersistentVolumeFilesystem, false, volumePath, byteLen, seed) + CheckReadFromPath(ctx, f, clientPod, v1.PersistentVolumeFilesystem, false, volumePath, byteLen, seed) framework.Logf("Volume mount detected on pod %s and written file %s is readable post-restart.", clientPod.Name, volumePath) } @@ -111,7 +111,7 @@ func TestKubeletRestartsAndRestoresMap(ctx context.Context, c clientset.Interfac seed := time.Now().UTC().UnixNano() ginkgo.By("Writing to the volume.") - CheckWriteToPath(f, clientPod, v1.PersistentVolumeBlock, false, volumePath, byteLen, seed) + CheckWriteToPath(ctx, f, clientPod, v1.PersistentVolumeBlock, false, volumePath, byteLen, seed) ginkgo.By("Restarting kubelet") KubeletCommand(ctx, KRestart, c, clientPod) @@ -120,7 +120,7 @@ func TestKubeletRestartsAndRestoresMap(ctx context.Context, c clientset.Interfac time.Sleep(20 * time.Second) ginkgo.By("Testing that written pv is accessible.") - CheckReadFromPath(f, clientPod, v1.PersistentVolumeBlock, false, volumePath, byteLen, seed) + CheckReadFromPath(ctx, f, clientPod, v1.PersistentVolumeBlock, false, volumePath, byteLen, seed) framework.Logf("Volume map detected on pod %s and written data %s is readable post-restart.", clientPod.Name, volumePath) } @@ -151,7 +151,7 @@ func TestVolumeUnmountsFromDeletedPodWithForceOption(ctx context.Context, c clie ginkgo.By("Writing to the volume.") byteLen := 64 seed := time.Now().UTC().UnixNano() - CheckWriteToPath(f, clientPod, v1.PersistentVolumeFilesystem, false, volumePath, byteLen, seed) + CheckWriteToPath(ctx, f, clientPod, v1.PersistentVolumeFilesystem, false, volumePath, byteLen, seed) // This command is to make sure kubelet is started after test finishes no matter it fails or not. ginkgo.DeferCleanup(KubeletCommand, KStart, c, clientPod) @@ -201,7 +201,7 @@ func TestVolumeUnmountsFromDeletedPodWithForceOption(ctx context.Context, c clie gomega.Expect(result.Code).To(gomega.Equal(0), fmt.Sprintf("Expected grep exit code of 0, got %d", result.Code)) ginkgo.By("Testing that written file is accessible in the second pod.") - CheckReadFromPath(f, secondPod, v1.PersistentVolumeFilesystem, false, volumePath, byteLen, seed) + CheckReadFromPath(ctx, f, secondPod, v1.PersistentVolumeFilesystem, false, volumePath, byteLen, seed) err = c.CoreV1().Pods(secondPod.Namespace).Delete(context.TODO(), secondPod.Name, metav1.DeleteOptions{}) framework.ExpectNoError(err, "when deleting the second pod") err = e2epod.WaitForPodNotFoundInNamespace(ctx, f.ClientSet, secondPod.Name, f.Namespace.Name, f.Timeouts.PodDelete) @@ -446,28 +446,37 @@ func isSudoPresent(ctx context.Context, nodeIP string, provider string) bool { } // CheckReadWriteToPath check that path can b e read and written -func CheckReadWriteToPath(f *framework.Framework, pod *v1.Pod, volMode v1.PersistentVolumeMode, path string) { +func CheckReadWriteToPath(ctx context.Context, f *framework.Framework, pod *v1.Pod, volMode v1.PersistentVolumeMode, path string) { if volMode == v1.PersistentVolumeBlock { // random -> file1 - e2evolume.VerifyExecInPodSucceed(f, pod, "dd if=/dev/urandom of=/tmp/file1 bs=64 count=1") + err := e2epod.VerifyExecInPodSucceed(ctx, f, pod, "dd if=/dev/urandom of=/tmp/file1 bs=64 count=1") + framework.ExpectNoError(err, "Failed to write to file1") // file1 -> dev (write to dev) - e2evolume.VerifyExecInPodSucceed(f, pod, fmt.Sprintf("dd if=/tmp/file1 of=%s bs=64 count=1", path)) + err = e2epod.VerifyExecInPodSucceed(ctx, f, pod, fmt.Sprintf("dd if=/tmp/file1 of=%s bs=64 count=1", path)) + framework.ExpectNoError(err, "Failed to write to block volume") // dev -> file2 (read from dev) - e2evolume.VerifyExecInPodSucceed(f, pod, fmt.Sprintf("dd if=%s of=/tmp/file2 bs=64 count=1", path)) + err = e2epod.VerifyExecInPodSucceed(ctx, f, pod, fmt.Sprintf("dd if=%s of=/tmp/file2 bs=64 count=1", path)) + framework.ExpectNoError(err, "Failed to read from block volume") // file1 == file2 (check contents) - e2evolume.VerifyExecInPodSucceed(f, pod, "diff /tmp/file1 /tmp/file2") + err = e2epod.VerifyExecInPodSucceed(ctx, f, pod, "diff /tmp/file1 /tmp/file2") + framework.ExpectNoError(err, "Failed to compare file1 and file2") // Clean up temp files - e2evolume.VerifyExecInPodSucceed(f, pod, "rm -f /tmp/file1 /tmp/file2") + err = e2epod.VerifyExecInPodSucceed(ctx, f, pod, "rm -f /tmp/file1 /tmp/file2") + framework.ExpectNoError(err, "Failed to clean up temp files") // Check that writing file to block volume fails - e2evolume.VerifyExecInPodFail(f, pod, fmt.Sprintf("echo 'Hello world.' > %s/file1.txt", path), 1) + err = e2epod.VerifyExecInPodFail(ctx, f, pod, fmt.Sprintf("echo 'Hello world.' > %s/file1.txt", path), 1) + framework.ExpectNoError(err, "Expected write to block volume to fail") } else { // text -> file1 (write to file) - e2evolume.VerifyExecInPodSucceed(f, pod, fmt.Sprintf("echo 'Hello world.' > %s/file1.txt", path)) + err := e2epod.VerifyExecInPodSucceed(ctx, f, pod, fmt.Sprintf("echo 'Hello world.' > %s/file1.txt", path)) + framework.ExpectNoError(err, "Failed to write to file1") // grep file1 (read from file and check contents) - e2evolume.VerifyExecInPodSucceed(f, pod, readFile("Hello word.", path)) + err = e2epod.VerifyExecInPodSucceed(ctx, f, pod, readFile("Hello word.", path)) + framework.ExpectNoError(err, "Failed to read from file1") // Check that writing to directory as block volume fails - e2evolume.VerifyExecInPodFail(f, pod, fmt.Sprintf("dd if=/dev/urandom of=%s bs=64 count=1", path), 1) + err = e2epod.VerifyExecInPodFail(ctx, f, pod, fmt.Sprintf("dd if=/dev/urandom of=%s bs=64 count=1", path), 1) + framework.ExpectNoError(err, "Expected write to directory to fail") } } @@ -481,9 +490,9 @@ func readFile(content, path string) string { // genBinDataFromSeed generate binData with random seed func genBinDataFromSeed(len int, seed int64) []byte { binData := make([]byte, len) - rand.Seed(seed) + r := rand.New(rand.NewSource(seed)) - _, err := rand.Read(binData) + _, err := r.Read(binData) if err != nil { fmt.Printf("Error: %v\n", err) } @@ -497,7 +506,7 @@ func genBinDataFromSeed(len int, seed int64) []byte { // directIO to function correctly, is to read whole sector(s) for Block-mode // PVCs (normally a sector is 512 bytes), or memory pages for files (commonly // 4096 bytes). -func CheckReadFromPath(f *framework.Framework, pod *v1.Pod, volMode v1.PersistentVolumeMode, directIO bool, path string, len int, seed int64) { +func CheckReadFromPath(ctx context.Context, f *framework.Framework, pod *v1.Pod, volMode v1.PersistentVolumeMode, directIO bool, path string, len int, seed int64) { var pathForVolMode string var iflag string @@ -513,8 +522,10 @@ func CheckReadFromPath(f *framework.Framework, pod *v1.Pod, volMode v1.Persisten sum := sha256.Sum256(genBinDataFromSeed(len, seed)) - e2evolume.VerifyExecInPodSucceed(f, pod, fmt.Sprintf("dd if=%s %s bs=%d count=1 | sha256sum", pathForVolMode, iflag, len)) - e2evolume.VerifyExecInPodSucceed(f, pod, fmt.Sprintf("dd if=%s %s bs=%d count=1 | sha256sum | grep -Fq %x", pathForVolMode, iflag, len, sum)) + err := e2epod.VerifyExecInPodSucceed(ctx, f, pod, fmt.Sprintf("dd if=%s %s bs=%d count=1 | sha256sum", pathForVolMode, iflag, len)) + framework.ExpectNoError(err, "Failed to read from %s", pathForVolMode) + err = e2epod.VerifyExecInPodSucceed(ctx, f, pod, fmt.Sprintf("dd if=%s %s bs=%d count=1 | sha256sum | grep -Fq %x", pathForVolMode, iflag, len, sum)) + framework.ExpectNoError(err, "Failed to read from %s", pathForVolMode) } // CheckWriteToPath that file can be properly written. @@ -522,7 +533,7 @@ func CheckReadFromPath(f *framework.Framework, pod *v1.Pod, volMode v1.Persisten // Note: nocache does not work with (default) BusyBox Pods. To read without // caching, enable directIO with CheckReadFromPath and check the hints about // the len requirements. -func CheckWriteToPath(f *framework.Framework, pod *v1.Pod, volMode v1.PersistentVolumeMode, nocache bool, path string, len int, seed int64) { +func CheckWriteToPath(ctx context.Context, f *framework.Framework, pod *v1.Pod, volMode v1.PersistentVolumeMode, nocache bool, path string, len int, seed int64) { var pathForVolMode string var oflag string @@ -538,13 +549,15 @@ func CheckWriteToPath(f *framework.Framework, pod *v1.Pod, volMode v1.Persistent encoded := base64.StdEncoding.EncodeToString(genBinDataFromSeed(len, seed)) - e2evolume.VerifyExecInPodSucceed(f, pod, fmt.Sprintf("echo %s | base64 -d | sha256sum", encoded)) - e2evolume.VerifyExecInPodSucceed(f, pod, fmt.Sprintf("echo %s | base64 -d | dd of=%s %s bs=%d count=1", encoded, pathForVolMode, oflag, len)) + err := e2epod.VerifyExecInPodSucceed(ctx, f, pod, fmt.Sprintf("echo %s | base64 -d | sha256sum", encoded)) + framework.ExpectNoError(err, "Failed to generate sha256sum of encoded data") + err = e2epod.VerifyExecInPodSucceed(ctx, f, pod, fmt.Sprintf("echo %s | base64 -d | dd of=%s %s bs=%d count=1", encoded, pathForVolMode, oflag, len)) + framework.ExpectNoError(err, "Failed to write to %s", pathForVolMode) } // GetSectorSize returns the sector size of the device. -func GetSectorSize(f *framework.Framework, pod *v1.Pod, device string) int { - stdout, _, err := e2evolume.PodExec(f, pod, fmt.Sprintf("blockdev --getss %s", device)) +func GetSectorSize(ctx context.Context, f *framework.Framework, pod *v1.Pod, device string) int { + stdout, _, err := e2epod.ExecShellInPodWithFullOutput(ctx, f, pod.Name, fmt.Sprintf("blockdev --getss %s", device)) framework.ExpectNoError(err, "Failed to get sector size of %s", device) ss, err := strconv.Atoi(stdout) framework.ExpectNoError(err, "Sector size returned by blockdev command isn't integer value.") @@ -722,23 +735,23 @@ func WaitForGVRFinalizer(ctx context.Context, c dynamic.Interface, gvr schema.Gr return err } -// VerifyFilePathGidInPod verfies expected GID of the target filepath -func VerifyFilePathGidInPod(f *framework.Framework, filePath, expectedGid string, pod *v1.Pod) { +// VerifyFilePathGIDInPod verfies expected GID of the target filepath +func VerifyFilePathGIDInPod(ctx context.Context, f *framework.Framework, filePath, expectedGID string, pod *v1.Pod) { cmd := fmt.Sprintf("ls -l %s", filePath) - stdout, stderr, err := e2evolume.PodExec(f, pod, cmd) + stdout, stderr, err := e2epod.ExecShellInPodWithFullOutput(ctx, f, pod.Name, cmd) framework.ExpectNoError(err) framework.Logf("pod %s/%s exec for cmd %s, stdout: %s, stderr: %s", pod.Namespace, pod.Name, cmd, stdout, stderr) ll := strings.Fields(stdout) - framework.Logf("stdout split: %v, expected gid: %v", ll, expectedGid) - gomega.Expect(ll[3]).To(gomega.Equal(expectedGid)) + framework.Logf("stdout split: %v, expected gid: %v", ll, expectedGID) + gomega.Expect(ll[3]).To(gomega.Equal(expectedGID)) } -// ChangeFilePathGidInPod changes the GID of the target filepath. -func ChangeFilePathGidInPod(f *framework.Framework, filePath, targetGid string, pod *v1.Pod) { - cmd := fmt.Sprintf("chgrp %s %s", targetGid, filePath) - _, _, err := e2evolume.PodExec(f, pod, cmd) +// ChangeFilePathGIDInPod changes the GID of the target filepath. +func ChangeFilePathGIDInPod(ctx context.Context, f *framework.Framework, filePath, targetGID string, pod *v1.Pod) { + cmd := fmt.Sprintf("chgrp %s %s", targetGID, filePath) + _, _, err := e2epod.ExecShellInPodWithFullOutput(ctx, f, pod.Name, cmd) framework.ExpectNoError(err) - VerifyFilePathGidInPod(f, filePath, targetGid, pod) + VerifyFilePathGIDInPod(ctx, f, filePath, targetGID, pod) } // DeleteStorageClass deletes the passed in StorageClass and catches errors other than "Not Found" diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/storage/utils/volume_group_snapshot.go b/e2e/vendor/k8s.io/kubernetes/test/e2e/storage/utils/volume_group_snapshot.go index b8a9fca9c..b5515e879 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/storage/utils/volume_group_snapshot.go +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/storage/utils/volume_group_snapshot.go @@ -33,15 +33,16 @@ const ( // VolumeGroupSnapshot is the group snapshot api VolumeGroupSnapshotAPIGroup = "groupsnapshot.storage.k8s.io" // VolumeGroupSnapshotAPIVersion is the group snapshot api version - VolumeGroupSnapshotAPIVersion = "groupsnapshot.storage.k8s.io/v1alpha1" + VolumeGroupSnapshotAPIVersion = "groupsnapshot.storage.k8s.io/v1beta1" ) var ( // VolumeGroupSnapshotGVR is GroupVersionResource for volumegroupsnapshots - VolumeGroupSnapshotGVR = schema.GroupVersionResource{Group: VolumeGroupSnapshotAPIGroup, Version: "v1alpha1", Resource: "volumegroupsnapshots"} + VolumeGroupSnapshotGVR = schema.GroupVersionResource{Group: VolumeGroupSnapshotAPIGroup, Version: "v1beta1", Resource: "volumegroupsnapshots"} // VolumeGroupSnapshotClassGVR is GroupVersionResource for volumegroupsnapshotsclasses - VolumeGroupSnapshotClassGVR = schema.GroupVersionResource{Group: VolumeGroupSnapshotAPIGroup, Version: "v1alpha1", Resource: "volumegroupsnapshotclasses"} + VolumeGroupSnapshotClassGVR = schema.GroupVersionResource{Group: VolumeGroupSnapshotAPIGroup, Version: "v1beta1", Resource: "volumegroupsnapshotclasses"} + VolumeGroupSnapshotContentGVR = schema.GroupVersionResource{Group: VolumeGroupSnapshotAPIGroup, Version: "v1beta1", Resource: "volumegroupsnapshotcontents"} ) // WaitForVolumeGroupSnapshotReady waits for a VolumeGroupSnapshot to be ready to use or until timeout occurs, whichever comes first. diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/dra/dra-test-driver-proxy.yaml b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/dra/dra-test-driver-proxy.yaml index 377bb2e58..ed32a26ac 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/dra/dra-test-driver-proxy.yaml +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/dra/dra-test-driver-proxy.yaml @@ -46,40 +46,35 @@ spec: topologyKey: kubernetes.io/hostname containers: - - name: registrar + - name: pause image: registry.k8s.io/sig-storage/hostpathplugin:v1.7.3 - args: - - "--v=5" - - "--endpoint=/plugins_registry/dra-test-driver-reg.sock" - - "--proxy-endpoint=tcp://:9000" + command: + - /bin/sh + - -c + - while true; do sleep 10000; done volumeMounts: - - mountPath: /plugins_registry - name: registration-dir - - - name: plugin - image: registry.k8s.io/sig-storage/hostpathplugin:v1.7.3 - args: - - "--v=5" - - "--endpoint=/dra/dra-test-driver.sock" - - "--proxy-endpoint=tcp://:9001" - securityContext: - privileged: true - volumeMounts: - - mountPath: /dra + - mountPath: /var/lib/kubelet/plugins/test-driver.dra.k8s.io name: socket-dir + - mountPath: /var/lib/kubelet/plugins_registry + name: registration-dir - mountPath: /cdi name: cdi-dir + securityContext: + privileged: true volumes: - hostPath: - path: /var/lib/kubelet/plugins + # There's no way to remove this. Conceptually, it may have to + # survive Pod restarts and there's no way to tell the kubelet + # that this isn't the case for this Pod. + path: /var/lib/kubelet/plugins/test-driver.dra.k8s.io type: DirectoryOrCreate name: socket-dir - - hostPath: - path: /var/run/cdi - type: DirectoryOrCreate - name: cdi-dir - hostPath: path: /var/lib/kubelet/plugins_registry type: DirectoryOrCreate name: registration-dir + - hostPath: + path: /var/run/cdi + type: DirectoryOrCreate + name: cdi-dir diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/groupsnapshot.storage.k8s.io_volumegroupsnapshotclasses.yaml b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/groupsnapshot.storage.k8s.io_volumegroupsnapshotclasses.yaml index aff3a5719..e552f81b5 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/groupsnapshot.storage.k8s.io_volumegroupsnapshotclasses.yaml +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/groupsnapshot.storage.k8s.io_volumegroupsnapshotclasses.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/814" + api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/1150" controller-gen.kubebuilder.io/version: v0.15.0 name: volumegroupsnapshotclasses.groupsnapshot.storage.k8s.io spec: @@ -31,7 +31,7 @@ spec: - jsonPath: .metadata.creationTimestamp name: Age type: date - name: v1alpha1 + name: v1beta1 schema: openAPIV3Schema: description: |- diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/groupsnapshot.storage.k8s.io_volumegroupsnapshotcontents.yaml b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/groupsnapshot.storage.k8s.io_volumegroupsnapshotcontents.yaml index 28584e56b..a6d15d8ad 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/groupsnapshot.storage.k8s.io_volumegroupsnapshotcontents.yaml +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/groupsnapshot.storage.k8s.io_volumegroupsnapshotcontents.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/1068" + api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/1150" controller-gen.kubebuilder.io/version: v0.15.0 name: volumegroupsnapshotcontents.groupsnapshot.storage.k8s.io spec: @@ -53,7 +53,7 @@ spec: - jsonPath: .metadata.creationTimestamp name: Age type: date - name: v1alpha1 + name: v1beta1 schema: openAPIV3Schema: description: |- @@ -237,8 +237,6 @@ spec: - message: both volumeGroupSnapshotRef.name and volumeGroupSnapshotRef.namespace must be set rule: has(self.name) && has(self.__namespace__) - - message: volumeGroupSnapshotRef is immutable - rule: self == oldSelf required: - deletionPolicy - driver @@ -257,8 +255,9 @@ spec: The format of this field is a Unix nanoseconds time encoded as an int64. On Unix, the command date +%s%N returns the current time in nanoseconds since 1970-01-01 00:00:00 UTC. - format: int64 - type: integer + This field is the source for the CreationTime field in VolumeGroupSnapshotStatus + format: date-time + type: string error: description: |- Error is the last observed error during group snapshot creation, if any. @@ -276,42 +275,6 @@ spec: format: date-time type: string type: object - pvVolumeSnapshotContentList: - description: |- - PVVolumeSnapshotContentList is the list of pairs of PV and - VolumeSnapshotContent for this group snapshot - The maximum number of allowed snapshots in the group is 100. - items: - description: |- - PVVolumeSnapshotContentPair represent a pair of PV names and - VolumeSnapshotContent names - properties: - persistentVolumeRef: - description: PersistentVolumeRef is a reference to the persistent - volume resource - properties: - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? - type: string - type: object - x-kubernetes-map-type: atomic - volumeSnapshotContentRef: - description: VolumeSnapshotContentRef is a reference to the - volume snapshot content resource - properties: - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? - type: string - type: object - x-kubernetes-map-type: atomic - type: object - type: array readyToUse: description: |- ReadyToUse indicates if all the individual snapshots in the group are ready to be @@ -325,6 +288,32 @@ spec: If a storage system does not provide such an id, the CSI driver can choose to return the VolumeGroupSnapshot name. type: string + volumeSnapshotHandlePairList: + description: |- + VolumeSnapshotHandlePairList is a list of CSI "volume_id" and "snapshot_id" + pair returned by the CSI driver to identify snapshots and their source volumes + on the storage system. + items: + description: VolumeSnapshotHandlePair defines a pair of a source + volume handle and a snapshot handle + properties: + snapshotHandle: + description: |- + SnapshotHandle is a unique id returned by the CSI driver to identify a volume + snapshot on the storage system + Required. + type: string + volumeHandle: + description: |- + VolumeHandle is a unique id returned by the CSI driver to identify a volume + on the storage system + Required. + type: string + required: + - snapshotHandle + - volumeHandle + type: object + type: array type: object required: - spec diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/groupsnapshot.storage.k8s.io_volumegroupsnapshots.yaml b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/groupsnapshot.storage.k8s.io_volumegroupsnapshots.yaml index 3d9a771de..145d1211d 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/groupsnapshot.storage.k8s.io_volumegroupsnapshots.yaml +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/groupsnapshot.storage.k8s.io_volumegroupsnapshots.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/1068" + api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/1150" controller-gen.kubebuilder.io/version: v0.15.0 name: volumegroupsnapshots.groupsnapshot.storage.k8s.io spec: @@ -43,7 +43,7 @@ spec: - jsonPath: .metadata.creationTimestamp name: Age type: date - name: v1alpha1 + name: v1beta1 schema: openAPIV3Schema: description: |- @@ -198,6 +198,7 @@ spec: The format of this field is a Unix nanoseconds time encoded as an int64. On Unix, the command date +%s%N returns the current time in nanoseconds since 1970-01-01 00:00:00 UTC. + This field is updated based on the CreationTime field in VolumeGroupSnapshotContentStatus format: date-time type: string error: @@ -221,41 +222,6 @@ spec: format: date-time type: string type: object - pvcVolumeSnapshotRefList: - description: |- - VolumeSnapshotRefList is the list of PVC and VolumeSnapshot pairs that - is part of this group snapshot. - The maximum number of allowed snapshots in the group is 100. - items: - description: PVCVolumeSnapshotPair defines a pair of a PVC reference - and a Volume Snapshot Reference - properties: - persistentVolumeClaimRef: - description: PersistentVolumeClaimRef is a reference to the - PVC this pair is referring to - properties: - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? - type: string - type: object - x-kubernetes-map-type: atomic - volumeSnapshotRef: - description: VolumeSnapshotRef is a reference to the VolumeSnapshot - this pair is referring to - properties: - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? - type: string - type: object - x-kubernetes-map-type: atomic - type: object - type: array readyToUse: description: |- ReadyToUse indicates if all the individual snapshots in the group are ready diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/volume-group-snapshots/csi-hostpath-plugin.yaml b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/volume-group-snapshots/csi-hostpath-plugin.yaml index 44fefe22c..666dd4e0f 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/volume-group-snapshots/csi-hostpath-plugin.yaml +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/volume-group-snapshots/csi-hostpath-plugin.yaml @@ -219,7 +219,7 @@ spec: serviceAccountName: csi-hostpathplugin-sa containers: - name: hostpath - image: registry.k8s.io/sig-storage/hostpathplugin:v1.14.0 + image: registry.k8s.io/sig-storage/hostpathplugin:v1.16.1 args: - "--drivername=hostpath.csi.k8s.io" - "--v=5" @@ -276,7 +276,7 @@ spec: mountPath: /csi - name: node-driver-registrar - image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.10.1 + image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.13.0 args: - --v=5 - --csi-address=/csi/csi.sock @@ -304,13 +304,13 @@ spec: volumeMounts: - mountPath: /csi name: socket-dir - image: registry.k8s.io/sig-storage/livenessprobe:v2.12.0 + image: registry.k8s.io/sig-storage/livenessprobe:v2.15.0 args: - --csi-address=/csi/csi.sock - --health-port=9898 - name: csi-attacher - image: registry.k8s.io/sig-storage/csi-attacher:v4.6.1 + image: registry.k8s.io/sig-storage/csi-attacher:v4.8.0 args: - --v=5 - --csi-address=/csi/csi.sock @@ -324,7 +324,7 @@ spec: name: socket-dir - name: csi-provisioner - image: registry.k8s.io/sig-storage/csi-provisioner:v5.0.1 + image: registry.k8s.io/sig-storage/csi-provisioner:v5.1.0 args: - -v=5 - --csi-address=/csi/csi.sock @@ -340,7 +340,7 @@ spec: name: socket-dir - name: csi-resizer - image: registry.k8s.io/sig-storage/csi-resizer:v1.11.1 + image: registry.k8s.io/sig-storage/csi-resizer:v1.13.1 args: - -v=5 - -csi-address=/csi/csi.sock @@ -354,11 +354,11 @@ spec: name: socket-dir - name: csi-snapshotter - image: registry.k8s.io/sig-storage/csi-snapshotter:v8.0.1 + image: registry.k8s.io/sig-storage/csi-snapshotter:v8.2.0 args: - -v=5 - --csi-address=/csi/csi.sock - - --enable-volume-group-snapshots=true + - --feature-gates=CSIVolumeGroupSnapshot=true securityContext: # This is necessary only for systems with SELinux, where # non-privileged sidecar containers cannot access unix domain socket diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/volume-group-snapshots/run_group_snapshot_e2e.sh b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/volume-group-snapshots/run_group_snapshot_e2e.sh index b6386e8bd..0ff1f9cb5 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/volume-group-snapshots/run_group_snapshot_e2e.sh +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/external-snapshotter/volume-group-snapshots/run_group_snapshot_e2e.sh @@ -278,10 +278,10 @@ run_tests() { kubectl apply -f test/e2e/testing-manifests/storage-csi/external-snapshotter/groupsnapshot.storage.k8s.io_volumegroupsnapshotcontents.yaml || exit 1 kubectl apply -f test/e2e/testing-manifests/storage-csi/external-snapshotter/groupsnapshot.storage.k8s.io_volumegroupsnapshots.yaml || exit 1 - - kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/v8.0.0/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml || exit 1 - curl -s https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-8.1/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml | \ -awk '/--leader-election=true/ {print; print " - \"--enable-volume-group-snapshots=true\""; next}1' | \ + kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/refs/tags/v8.2.0/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml || exit 1 + curl -s https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/refs/tags/v8.2.0/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml | \ +awk '/--leader-election=true/ {print; print " - \"--feature-gates=CSIVolumeGroupSnapshot=true\""; next}1' | \ +sed 's|image: registry.k8s.io/sig-storage/snapshot-controller:v8.0.1|image: registry.k8s.io/sig-storage/snapshot-controller:v8.2.0|' | \ kubectl apply -f - || exit 1 diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/gce-pd/node_ds.yaml b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/gce-pd/node_ds.yaml index c3ea3e7c6..30a82723a 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/gce-pd/node_ds.yaml +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/gce-pd/node_ds.yaml @@ -13,7 +13,7 @@ spec: spec: containers: - name: csi-driver-registrar - image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.5.1 + image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.13.0 args: - "--v=5" - "--csi-address=/csi/csi.sock" @@ -48,7 +48,7 @@ spec: - name: gce-pd-driver securityContext: privileged: true - image: registry.k8s.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver:v1.2.2 + image: registry.k8s.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver:v1.4.0 args: - "--v=5" - "--endpoint=unix:/csi/csi.sock" diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-plugin.yaml b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-plugin.yaml index 3ac441b93..3671e05c1 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-plugin.yaml +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-plugin.yaml @@ -219,7 +219,7 @@ spec: serviceAccountName: csi-hostpathplugin-sa containers: - name: hostpath - image: registry.k8s.io/sig-storage/hostpathplugin:v1.15.0 + image: registry.k8s.io/sig-storage/hostpathplugin:v1.16.1 args: - "--drivername=hostpath.csi.k8s.io" - "--v=5" @@ -354,7 +354,7 @@ spec: name: socket-dir - name: csi-snapshotter - image: registry.k8s.io/sig-storage/csi-snapshotter:v8.1.0 + image: registry.k8s.io/sig-storage/csi-snapshotter:v8.2.0 args: - -v=5 - --csi-address=/csi/csi.sock diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-testing.yaml b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-testing.yaml index 19c9888ee..494f2aacc 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-testing.yaml +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-testing.yaml @@ -66,7 +66,7 @@ spec: topologyKey: kubernetes.io/hostname containers: - name: socat - image: registry.k8s.io/sig-storage/hostpathplugin:v1.15.0 + image: registry.k8s.io/sig-storage/hostpathplugin:v1.16.1 command: - socat args: diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/mock/csi-mock-driver.yaml b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/mock/csi-mock-driver.yaml index ecd0bdb8a..21b3d7339 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/mock/csi-mock-driver.yaml +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/mock/csi-mock-driver.yaml @@ -53,7 +53,7 @@ spec: - mountPath: /registration name: registration-dir - name: mock - image: registry.k8s.io/sig-storage/hostpathplugin:v1.15.0 + image: registry.k8s.io/sig-storage/hostpathplugin:v1.16.1 args: - "--drivername=mock.storage.k8s.io" - "--nodeid=$(KUBE_NODE_NAME)" diff --git a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/mock/csi-mock-proxy.yaml b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/mock/csi-mock-proxy.yaml index 0517d3eff..a267f4f59 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/mock/csi-mock-proxy.yaml +++ b/e2e/vendor/k8s.io/kubernetes/test/e2e/testing-manifests/storage-csi/mock/csi-mock-proxy.yaml @@ -53,7 +53,7 @@ spec: - mountPath: /registration name: registration-dir - name: mock - image: registry.k8s.io/sig-storage/hostpathplugin:v1.15.0 + image: registry.k8s.io/sig-storage/hostpathplugin:v1.16.1 args: - -v=5 - -nodeid=$(KUBE_NODE_NAME) @@ -77,7 +77,7 @@ spec: # test for directories or create them. It needs additional privileges # for that. - name: busybox - image: registry.k8s.io/e2e-test-images/busybox:1.29-2 + image: registry.k8s.io/e2e-test-images/busybox:1.36.1-1 securityContext: privileged: true command: diff --git a/e2e/vendor/k8s.io/kubernetes/test/utils/image/manifest.go b/e2e/vendor/k8s.io/kubernetes/test/utils/image/manifest.go index 02876dd94..6d0d44f92 100644 --- a/e2e/vendor/k8s.io/kubernetes/test/utils/image/manifest.go +++ b/e2e/vendor/k8s.io/kubernetes/test/utils/image/manifest.go @@ -223,8 +223,8 @@ func initImageConfigs(list RegistryList) (map[ImageID]Config, map[ImageID]Config configs[APIServer] = Config{list.PromoterE2eRegistry, "sample-apiserver", "1.29.2"} configs[AppArmorLoader] = Config{list.PromoterE2eRegistry, "apparmor-loader", "1.4"} configs[BusyBox] = Config{list.PromoterE2eRegistry, "busybox", "1.36.1-1"} - configs[DistrolessIptables] = Config{list.BuildImageRegistry, "distroless-iptables", "v0.6.8"} - configs[Etcd] = Config{list.GcEtcdRegistry, "etcd", "3.5.16-0"} + configs[DistrolessIptables] = Config{list.BuildImageRegistry, "distroless-iptables", "v0.7.4"} + configs[Etcd] = Config{list.GcEtcdRegistry, "etcd", "3.5.21-0"} configs[Httpd] = Config{list.PromoterE2eRegistry, "httpd", "2.4.38-4"} configs[HttpdNew] = Config{list.PromoterE2eRegistry, "httpd", "2.4.39-4"} configs[InvalidRegistryImage] = Config{list.InvalidRegistry, "alpine", "3.1"} diff --git a/e2e/vendor/k8s.io/utils/clock/testing/fake_clock.go b/e2e/vendor/k8s.io/utils/clock/testing/fake_clock.go deleted file mode 100644 index 462c40c2c..000000000 --- a/e2e/vendor/k8s.io/utils/clock/testing/fake_clock.go +++ /dev/null @@ -1,362 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -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 testing - -import ( - "sync" - "time" - - "k8s.io/utils/clock" -) - -var ( - _ = clock.PassiveClock(&FakePassiveClock{}) - _ = clock.WithTicker(&FakeClock{}) - _ = clock.Clock(&IntervalClock{}) -) - -// FakePassiveClock implements PassiveClock, but returns an arbitrary time. -type FakePassiveClock struct { - lock sync.RWMutex - time time.Time -} - -// FakeClock implements clock.Clock, but returns an arbitrary time. -type FakeClock struct { - FakePassiveClock - - // waiters are waiting for the fake time to pass their specified time - waiters []*fakeClockWaiter -} - -type fakeClockWaiter struct { - targetTime time.Time - stepInterval time.Duration - skipIfBlocked bool - destChan chan time.Time - afterFunc func() -} - -// NewFakePassiveClock returns a new FakePassiveClock. -func NewFakePassiveClock(t time.Time) *FakePassiveClock { - return &FakePassiveClock{ - time: t, - } -} - -// NewFakeClock constructs a fake clock set to the provided time. -func NewFakeClock(t time.Time) *FakeClock { - return &FakeClock{ - FakePassiveClock: *NewFakePassiveClock(t), - } -} - -// Now returns f's time. -func (f *FakePassiveClock) Now() time.Time { - f.lock.RLock() - defer f.lock.RUnlock() - return f.time -} - -// Since returns time since the time in f. -func (f *FakePassiveClock) Since(ts time.Time) time.Duration { - f.lock.RLock() - defer f.lock.RUnlock() - return f.time.Sub(ts) -} - -// SetTime sets the time on the FakePassiveClock. -func (f *FakePassiveClock) SetTime(t time.Time) { - f.lock.Lock() - defer f.lock.Unlock() - f.time = t -} - -// After is the 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 -} - -// NewTimer constructs a fake timer, akin to time.NewTimer(d). -func (f *FakeClock) NewTimer(d time.Duration) clock.Timer { - f.lock.Lock() - defer f.lock.Unlock() - stopTime := f.time.Add(d) - ch := make(chan time.Time, 1) // Don't block! - timer := &fakeTimer{ - fakeClock: f, - waiter: fakeClockWaiter{ - targetTime: stopTime, - destChan: ch, - }, - } - f.waiters = append(f.waiters, &timer.waiter) - return timer -} - -// AfterFunc is the Fake version of time.AfterFunc(d, cb). -func (f *FakeClock) AfterFunc(d time.Duration, cb func()) clock.Timer { - f.lock.Lock() - defer f.lock.Unlock() - stopTime := f.time.Add(d) - ch := make(chan time.Time, 1) // Don't block! - - timer := &fakeTimer{ - fakeClock: f, - waiter: fakeClockWaiter{ - targetTime: stopTime, - destChan: ch, - afterFunc: cb, - }, - } - f.waiters = append(f.waiters, &timer.waiter) - return timer -} - -// Tick constructs a fake ticker, akin to time.Tick -func (f *FakeClock) Tick(d time.Duration) <-chan time.Time { - if d <= 0 { - return nil - } - f.lock.Lock() - defer f.lock.Unlock() - tickTime := f.time.Add(d) - ch := make(chan time.Time, 1) // hold one tick - f.waiters = append(f.waiters, &fakeClockWaiter{ - targetTime: tickTime, - stepInterval: d, - skipIfBlocked: true, - destChan: ch, - }) - - return ch -} - -// NewTicker returns a new Ticker. -func (f *FakeClock) NewTicker(d time.Duration) clock.Ticker { - f.lock.Lock() - defer f.lock.Unlock() - tickTime := f.time.Add(d) - ch := make(chan time.Time, 1) // hold one tick - f.waiters = append(f.waiters, &fakeClockWaiter{ - targetTime: tickTime, - stepInterval: d, - skipIfBlocked: true, - destChan: ch, - }) - - return &fakeTicker{ - c: ch, - } -} - -// Step moves the clock by Duration and notifies anyone that's called After, -// Tick, or NewTimer. -func (f *FakeClock) Step(d time.Duration) { - f.lock.Lock() - defer f.lock.Unlock() - f.setTimeLocked(f.time.Add(d)) -} - -// SetTime 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) { - if w.skipIfBlocked { - select { - case w.destChan <- t: - default: - } - } else { - w.destChan <- t - } - - if w.afterFunc != nil { - w.afterFunc() - } - - if w.stepInterval > 0 { - for !w.targetTime.After(t) { - w.targetTime = w.targetTime.Add(w.stepInterval) - } - newWaiters = append(newWaiters, w) - } - - } else { - newWaiters = append(newWaiters, f.waiters[i]) - } - } - f.waiters = newWaiters -} - -// HasWaiters returns true if After or AfterFunc 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 -} - -// Sleep is akin to time.Sleep -func (f *FakeClock) Sleep(d time.Duration) { - f.Step(d) -} - -// IntervalClock implements clock.PassiveClock, but each invocation of Now steps the clock forward the specified duration. -// IntervalClock technically implements the other methods of clock.Clock, but each implementation is just a panic. -// -// Deprecated: See SimpleIntervalClock for an alternative that only has the methods of PassiveClock. -type IntervalClock struct { - Time time.Time - Duration time.Duration -} - -// Now returns i's time. -func (i *IntervalClock) Now() time.Time { - i.Time = i.Time.Add(i.Duration) - return i.Time -} - -// Since returns time since the time in i. -func (i *IntervalClock) Since(ts time.Time) time.Duration { - return i.Time.Sub(ts) -} - -// After is 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") -} - -// NewTimer is unimplemented, will panic. -// TODO: make interval clock use FakeClock so this can be implemented. -func (*IntervalClock) NewTimer(d time.Duration) clock.Timer { - panic("IntervalClock doesn't implement NewTimer") -} - -// AfterFunc is unimplemented, will panic. -// TODO: make interval clock use FakeClock so this can be implemented. -func (*IntervalClock) AfterFunc(d time.Duration, f func()) clock.Timer { - panic("IntervalClock doesn't implement AfterFunc") -} - -// Tick is unimplemented, will panic. -// TODO: make interval clock use FakeClock so this can be implemented. -func (*IntervalClock) Tick(d time.Duration) <-chan time.Time { - panic("IntervalClock doesn't implement Tick") -} - -// NewTicker has no implementation yet and is omitted. -// TODO: make interval clock use FakeClock so this can be implemented. -func (*IntervalClock) NewTicker(d time.Duration) clock.Ticker { - panic("IntervalClock doesn't implement NewTicker") -} - -// Sleep is unimplemented, will panic. -func (*IntervalClock) Sleep(d time.Duration) { - panic("IntervalClock doesn't implement Sleep") -} - -var _ = clock.Timer(&fakeTimer{}) - -// fakeTimer implements clock.Timer based on a FakeClock. -type fakeTimer struct { - fakeClock *FakeClock - waiter fakeClockWaiter -} - -// C returns the channel that notifies when this timer has fired. -func (f *fakeTimer) C() <-chan time.Time { - return f.waiter.destChan -} - -// Stop prevents the Timer from firing. It returns true if the call stops the -// timer, false if the timer has already expired or been stopped. -func (f *fakeTimer) Stop() bool { - f.fakeClock.lock.Lock() - defer f.fakeClock.lock.Unlock() - - active := false - newWaiters := make([]*fakeClockWaiter, 0, len(f.fakeClock.waiters)) - for i := range f.fakeClock.waiters { - w := f.fakeClock.waiters[i] - if w != &f.waiter { - newWaiters = append(newWaiters, w) - continue - } - // If timer is found, it has not been fired yet. - active = true - } - - f.fakeClock.waiters = newWaiters - - return active -} - -// Reset changes the timer to expire after duration d. It returns true if the -// timer had been active, false if the timer had expired or been stopped. -func (f *fakeTimer) Reset(d time.Duration) bool { - f.fakeClock.lock.Lock() - defer f.fakeClock.lock.Unlock() - - active := false - - f.waiter.targetTime = f.fakeClock.time.Add(d) - - for i := range f.fakeClock.waiters { - w := f.fakeClock.waiters[i] - if w == &f.waiter { - // If timer is found, it has not been fired yet. - active = true - break - } - } - if !active { - f.fakeClock.waiters = append(f.fakeClock.waiters, &f.waiter) - } - - return active -} - -type fakeTicker struct { - c <-chan time.Time -} - -func (t *fakeTicker) C() <-chan time.Time { - return t.c -} - -func (t *fakeTicker) Stop() { -} diff --git a/e2e/vendor/k8s.io/utils/clock/testing/simple_interval_clock.go b/e2e/vendor/k8s.io/utils/clock/testing/simple_interval_clock.go deleted file mode 100644 index 951ca4d17..000000000 --- a/e2e/vendor/k8s.io/utils/clock/testing/simple_interval_clock.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package testing - -import ( - "time" - - "k8s.io/utils/clock" -) - -var ( - _ = clock.PassiveClock(&SimpleIntervalClock{}) -) - -// SimpleIntervalClock implements clock.PassiveClock, but each invocation of Now steps the clock forward the specified duration -type SimpleIntervalClock struct { - Time time.Time - Duration time.Duration -} - -// Now returns i's time. -func (i *SimpleIntervalClock) Now() time.Time { - i.Time = i.Time.Add(i.Duration) - return i.Time -} - -// Since returns time since the time in i. -func (i *SimpleIntervalClock) Since(ts time.Time) time.Duration { - return i.Time.Sub(ts) -} diff --git a/e2e/vendor/k8s.io/utils/nsenter/OWNERS b/e2e/vendor/k8s.io/utils/nsenter/OWNERS deleted file mode 100644 index 46895cbda..000000000 --- a/e2e/vendor/k8s.io/utils/nsenter/OWNERS +++ /dev/null @@ -1,10 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: - - jsafrane - - msau42 - - cofyc -approvers: - - jsafrane - - msau42 - - cofyc diff --git a/e2e/vendor/k8s.io/utils/nsenter/README.md b/e2e/vendor/k8s.io/utils/nsenter/README.md deleted file mode 100644 index aaacf8e3d..000000000 --- a/e2e/vendor/k8s.io/utils/nsenter/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# NSEnter - -This package provides interfaces for executing and interacting with processes -running within a namespace. diff --git a/e2e/vendor/k8s.io/utils/nsenter/nsenter.go b/e2e/vendor/k8s.io/utils/nsenter/nsenter.go deleted file mode 100644 index 6f847db87..000000000 --- a/e2e/vendor/k8s.io/utils/nsenter/nsenter.go +++ /dev/null @@ -1,264 +0,0 @@ -//go:build linux -// +build linux - -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package nsenter - -import ( - "context" - "errors" - "fmt" - "os" - "path/filepath" - "strings" - - "k8s.io/klog/v2" - "k8s.io/utils/exec" -) - -const ( - // DefaultHostRootFsPath is path to host's filesystem mounted into container - // with kubelet. - DefaultHostRootFsPath = "/rootfs" - // mountNsPath is the default mount namespace of the host - mountNsPath = "/proc/1/ns/mnt" - // nsenterPath is the default nsenter command - nsenterPath = "nsenter" -) - -// Nsenter is a type alias for backward compatibility -type Nsenter = NSEnter - -// NSEnter is part of experimental support for running the kubelet -// in a container. -// -// NSEnter requires: -// -// 1. Docker >= 1.6 due to the dependency on the slave propagation mode -// of the bind-mount of the kubelet root directory in the container. -// Docker 1.5 used a private propagation mode for bind-mounts, so mounts -// performed in the host's mount namespace do not propagate out to the -// bind-mount in this docker version. -// 2. The host's root filesystem must be available at /rootfs -// 3. The nsenter binary must be on the Kubelet process' PATH in the container's -// filesystem. -// 4. The Kubelet process must have CAP_SYS_ADMIN (required by nsenter); at -// the present, this effectively means that the kubelet is running in a -// privileged container. -// 5. The volume path used by the Kubelet must be the same inside and outside -// the container and be writable by the container (to initialize volume) -// contents. TODO: remove this requirement. -// 6. The host image must have "mount", "findmnt", "umount", "stat", "touch", -// "mkdir", "ls", "sh" and "chmod" binaries in /bin, /usr/sbin, or /usr/bin -// 7. The host image should have systemd-run in /bin, /usr/sbin, or /usr/bin if -// systemd is installed/enabled in the operating system. -// -// For more information about mount propagation modes, see: -// -// https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt -type NSEnter struct { - // a map of commands to their paths on the host filesystem - paths map[string]string - - // Path to the host filesystem, typically "/rootfs". Used only for testing. - hostRootFsPath string - - // Exec implementation - executor exec.Interface -} - -// NewNsenter constructs a new instance of NSEnter -func NewNsenter(hostRootFsPath string, executor exec.Interface) (*NSEnter, error) { - ne := &NSEnter{ - hostRootFsPath: hostRootFsPath, - executor: executor, - } - if err := ne.initPaths(); err != nil { - return nil, err - } - return ne, nil -} - -func (ne *NSEnter) initPaths() error { - ne.paths = map[string]string{} - binaries := []string{ - "mount", - "findmnt", - "umount", - "systemd-run", - "stat", - "touch", - "mkdir", - "sh", - "chmod", - "realpath", - } - // search for the required commands in other locations besides /usr/bin - for _, binary := range binaries { - // check for binary under the following directories - for _, path := range []string{"/", "/bin", "/usr/sbin", "/usr/bin"} { - binPath := filepath.Join(path, binary) - if _, err := os.Stat(filepath.Join(ne.hostRootFsPath, binPath)); err != nil { - continue - } - ne.paths[binary] = binPath - break - } - // systemd-run is optional, bailout if we don't find any of the other binaries - if ne.paths[binary] == "" && binary != "systemd-run" { - return fmt.Errorf("unable to find %v", binary) - } - } - return nil -} - -// Exec executes nsenter commands in hostProcMountNsPath mount namespace -func (ne *NSEnter) Exec(cmd string, args []string) exec.Cmd { - hostProcMountNsPath := filepath.Join(ne.hostRootFsPath, mountNsPath) - fullArgs := append([]string{fmt.Sprintf("--mount=%s", hostProcMountNsPath), "--"}, - append([]string{ne.AbsHostPath(cmd)}, args...)...) - klog.V(5).Infof("Running nsenter command: %v %v", nsenterPath, fullArgs) - return ne.executor.Command(nsenterPath, fullArgs...) -} - -// Command returns a command wrapped with nsenter -func (ne *NSEnter) Command(cmd string, args ...string) exec.Cmd { - return ne.Exec(cmd, args) -} - -// CommandContext returns a CommandContext wrapped with nsenter -func (ne *NSEnter) CommandContext(ctx context.Context, cmd string, args ...string) exec.Cmd { - hostProcMountNsPath := filepath.Join(ne.hostRootFsPath, mountNsPath) - fullArgs := append([]string{fmt.Sprintf("--mount=%s", hostProcMountNsPath), "--"}, - append([]string{ne.AbsHostPath(cmd)}, args...)...) - klog.V(5).Infof("Running nsenter command: %v %v", nsenterPath, fullArgs) - return ne.executor.CommandContext(ctx, nsenterPath, fullArgs...) -} - -// LookPath returns a LookPath wrapped with nsenter -func (ne *NSEnter) LookPath(file string) (string, error) { - return "", fmt.Errorf("not implemented, error looking up : %s", file) -} - -// AbsHostPath returns the absolute runnable path for a specified command -func (ne *NSEnter) AbsHostPath(command string) string { - path, ok := ne.paths[command] - if !ok { - return command - } - return path -} - -// SupportsSystemd checks whether command systemd-run exists -func (ne *NSEnter) SupportsSystemd() (string, bool) { - systemdRunPath, ok := ne.paths["systemd-run"] - return systemdRunPath, ok && systemdRunPath != "" -} - -// EvalSymlinks returns the path name on the host after evaluating symlinks on the -// host. -// mustExist makes EvalSymlinks to return error when the path does not -// exist. When it's false, it evaluates symlinks of the existing part and -// blindly adds the non-existing part: -// pathname: /mnt/volume/non/existing/directory -// -// /mnt/volume exists -// non/existing/directory does not exist -// -// -> It resolves symlinks in /mnt/volume to say /mnt/foo and returns -// -// /mnt/foo/non/existing/directory. -// -// BEWARE! EvalSymlinks is not able to detect symlink looks with mustExist=false! -// If /tmp/link is symlink to /tmp/link, EvalSymlinks(/tmp/link/foo) returns /tmp/link/foo. -func (ne *NSEnter) EvalSymlinks(pathname string, mustExist bool) (string, error) { - var args []string - if mustExist { - // "realpath -e: all components of the path must exist" - args = []string{"-e", pathname} - } else { - // "realpath -m: no path components need exist or be a directory" - args = []string{"-m", pathname} - } - outBytes, err := ne.Exec("realpath", args).CombinedOutput() - if err != nil { - klog.Infof("failed to resolve symbolic links on %s: %v", pathname, err) - return "", err - } - return strings.TrimSpace(string(outBytes)), nil -} - -// KubeletPath returns the path name that can be accessed by containerized -// kubelet. It is recommended to resolve symlinks on the host by EvalSymlinks -// before calling this function -func (ne *NSEnter) KubeletPath(pathname string) string { - return filepath.Join(ne.hostRootFsPath, pathname) -} - -// NewFakeNsenter returns a NSEnter that does not run "nsenter --mount=... --", -// but runs everything in the same mount namespace as the unit test binary. -// rootfsPath is supposed to be a symlink, e.g. /tmp/xyz/rootfs -> /. -// This fake NSEnter is enough for most operations, e.g. to resolve symlinks, -// but it's not enough to call /bin/mount - unit tests don't run as root. -func NewFakeNsenter(rootfsPath string) (*NSEnter, error) { - executor := &fakeExec{ - rootfsPath: rootfsPath, - } - // prepare /rootfs/bin, usr/bin and usr/sbin - bin := filepath.Join(rootfsPath, "bin") - if err := os.Symlink("/bin", bin); err != nil { - return nil, err - } - - usr := filepath.Join(rootfsPath, "usr") - if err := os.Mkdir(usr, 0755); err != nil { - return nil, err - } - usrbin := filepath.Join(usr, "bin") - if err := os.Symlink("/usr/bin", usrbin); err != nil { - return nil, err - } - usrsbin := filepath.Join(usr, "sbin") - if err := os.Symlink("/usr/sbin", usrsbin); err != nil { - return nil, err - } - - return NewNsenter(rootfsPath, executor) -} - -type fakeExec struct { - rootfsPath string -} - -func (f fakeExec) Command(cmd string, args ...string) exec.Cmd { - // This will intentionaly panic if NSEnter does not provide enough arguments. - realCmd := args[2] - realArgs := args[3:] - return exec.New().Command(realCmd, realArgs...) -} - -func (fakeExec) LookPath(file string) (string, error) { - return "", errors.New("not implemented") -} - -func (fakeExec) CommandContext(ctx context.Context, cmd string, args ...string) exec.Cmd { - return nil -} - -var _ exec.Interface = fakeExec{} -var _ exec.Interface = &NSEnter{} diff --git a/e2e/vendor/k8s.io/utils/nsenter/nsenter_unsupported.go b/e2e/vendor/k8s.io/utils/nsenter/nsenter_unsupported.go deleted file mode 100644 index 8b56e91d2..000000000 --- a/e2e/vendor/k8s.io/utils/nsenter/nsenter_unsupported.go +++ /dev/null @@ -1,80 +0,0 @@ -//go:build !linux -// +build !linux - -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package nsenter - -import ( - "context" - "fmt" - - "k8s.io/utils/exec" -) - -const ( - // DefaultHostRootFsPath is path to host's filesystem mounted into container - // with kubelet. - DefaultHostRootFsPath = "/rootfs" -) - -// Nsenter is a type alias for backward compatibility -type Nsenter = NSEnter - -// NSEnter is part of experimental support for running the kubelet -// in a container. -type NSEnter struct { - // a map of commands to their paths on the host filesystem - Paths map[string]string -} - -// NewNsenter constructs a new instance of NSEnter -func NewNsenter(hostRootFsPath string, executor exec.Interface) (*Nsenter, error) { - return &Nsenter{}, nil -} - -// Exec executes nsenter commands in hostProcMountNsPath mount namespace -func (ne *NSEnter) Exec(cmd string, args []string) exec.Cmd { - return nil -} - -// AbsHostPath returns the absolute runnable path for a specified command -func (ne *NSEnter) AbsHostPath(command string) string { - return "" -} - -// SupportsSystemd checks whether command systemd-run exists -func (ne *NSEnter) SupportsSystemd() (string, bool) { - return "", false -} - -// Command returns a command wrapped with nenter -func (ne *NSEnter) Command(cmd string, args ...string) exec.Cmd { - return nil -} - -// CommandContext returns a CommandContext wrapped with nsenter -func (ne *NSEnter) CommandContext(ctx context.Context, cmd string, args ...string) exec.Cmd { - return nil -} - -// LookPath returns a LookPath wrapped with nsenter -func (ne *NSEnter) LookPath(file string) (string, error) { - return "", fmt.Errorf("not implemented, error looking up : %s", file) -} - -var _ exec.Interface = &NSEnter{} diff --git a/e2e/vendor/modules.txt b/e2e/vendor/modules.txt index 1f19e2c27..4b839d3f0 100644 --- a/e2e/vendor/modules.txt +++ b/e2e/vendor/modules.txt @@ -11,9 +11,6 @@ github.com/Microsoft/go-winio/internal/fs github.com/Microsoft/go-winio/internal/socket github.com/Microsoft/go-winio/internal/stringbuffer github.com/Microsoft/go-winio/pkg/guid -# github.com/NYTimes/gziphandler v1.1.1 -## explicit; go 1.11 -github.com/NYTimes/gziphandler # github.com/antlr4-go/antlr/v4 v4.13.0 ## explicit; go 1.20 github.com/antlr4-go/antlr/v4 @@ -37,32 +34,35 @@ github.com/ceph/ceph-csi/api/deploy/kubernetes # github.com/cespare/xxhash/v2 v2.3.0 ## explicit; go 1.11 github.com/cespare/xxhash/v2 -# github.com/containerd/containerd/api v1.7.19 +# github.com/containerd/containerd/api v1.8.0 ## explicit; go 1.21 github.com/containerd/containerd/api/services/containers/v1 github.com/containerd/containerd/api/services/tasks/v1 github.com/containerd/containerd/api/services/version/v1 github.com/containerd/containerd/api/types github.com/containerd/containerd/api/types/task -# github.com/containerd/errdefs v0.1.0 +# github.com/containerd/errdefs v1.0.0 ## explicit; go 1.20 github.com/containerd/errdefs +# github.com/containerd/errdefs/pkg v0.3.0 +## explicit; go 1.22 +github.com/containerd/errdefs/pkg/errgrpc +github.com/containerd/errdefs/pkg/internal/cause +github.com/containerd/errdefs/pkg/internal/types # github.com/containerd/log v0.1.0 ## explicit; go 1.20 github.com/containerd/log -# github.com/containerd/ttrpc v1.2.5 +# github.com/containerd/ttrpc v1.2.6 ## explicit; go 1.19 github.com/containerd/ttrpc -# github.com/coreos/go-semver v0.3.1 -## explicit; go 1.8 -github.com/coreos/go-semver/semver +# github.com/containerd/typeurl/v2 v2.2.2 +## explicit; go 1.21 +github.com/containerd/typeurl/v2 # github.com/coreos/go-systemd/v22 v22.5.0 ## explicit; go 1.12 -github.com/coreos/go-systemd/v22/daemon github.com/coreos/go-systemd/v22/dbus -github.com/coreos/go-systemd/v22/journal -# github.com/cyphar/filepath-securejoin v0.3.4 -## explicit; go 1.21 +# github.com/cyphar/filepath-securejoin v0.4.1 +## explicit; go 1.18 github.com/cyphar/filepath-securejoin # github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc ## explicit @@ -118,14 +118,8 @@ github.com/gogo/protobuf/gogoproto github.com/gogo/protobuf/proto github.com/gogo/protobuf/protoc-gen-gogo/descriptor github.com/gogo/protobuf/sortkeys -# github.com/golang/protobuf v1.5.4 -## explicit; go 1.17 -github.com/golang/protobuf/proto -# github.com/google/btree v1.1.3 -## explicit; go 1.18 -github.com/google/btree -# github.com/google/cadvisor v0.51.0 -## explicit; go 1.21 +# github.com/google/cadvisor v0.52.1 +## explicit; go 1.23.0 github.com/google/cadvisor/cache/memory github.com/google/cadvisor/collector github.com/google/cadvisor/container @@ -212,9 +206,6 @@ github.com/google/uuid # github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 ## explicit; go 1.20 github.com/gorilla/websocket -# github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 -## explicit -github.com/grpc-ecosystem/go-grpc-prometheus # github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 ## explicit; go 1.22.7 github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule @@ -308,21 +299,23 @@ github.com/onsi/gomega/matchers/support/goraph/edge github.com/onsi/gomega/matchers/support/goraph/node github.com/onsi/gomega/matchers/support/goraph/util github.com/onsi/gomega/types +# github.com/opencontainers/cgroups v0.0.1 +## explicit; go 1.23.0 +github.com/opencontainers/cgroups +github.com/opencontainers/cgroups/devices/config +github.com/opencontainers/cgroups/fs +github.com/opencontainers/cgroups/fs2 +github.com/opencontainers/cgroups/fscommon +github.com/opencontainers/cgroups/internal/path +github.com/opencontainers/cgroups/manager +github.com/opencontainers/cgroups/systemd # github.com/opencontainers/go-digest v1.0.0 ## explicit; go 1.13 github.com/opencontainers/go-digest -# github.com/opencontainers/runc v1.2.1 -## explicit; go 1.22 -github.com/opencontainers/runc/libcontainer/cgroups -github.com/opencontainers/runc/libcontainer/cgroups/fs -github.com/opencontainers/runc/libcontainer/cgroups/fs2 -github.com/opencontainers/runc/libcontainer/cgroups/fscommon -github.com/opencontainers/runc/libcontainer/cgroups/manager -github.com/opencontainers/runc/libcontainer/cgroups/systemd -github.com/opencontainers/runc/libcontainer/configs -github.com/opencontainers/runc/libcontainer/devices -github.com/opencontainers/runc/libcontainer/intelrdt -github.com/opencontainers/runc/libcontainer/utils +# github.com/opencontainers/image-spec v1.1.1 +## explicit; go 1.18 +github.com/opencontainers/image-spec/specs-go +github.com/opencontainers/image-spec/specs-go/v1 # github.com/opencontainers/runtime-spec v1.2.0 ## explicit github.com/opencontainers/runtime-spec/specs-go @@ -373,29 +366,6 @@ github.com/stoewer/go-strcase # github.com/x448/float16 v0.8.4 ## explicit; go 1.11 github.com/x448/float16 -# go.etcd.io/etcd/api/v3 v3.5.21 -## explicit; go 1.23.0 -go.etcd.io/etcd/api/v3/authpb -go.etcd.io/etcd/api/v3/etcdserverpb -go.etcd.io/etcd/api/v3/membershippb -go.etcd.io/etcd/api/v3/mvccpb -go.etcd.io/etcd/api/v3/v3rpc/rpctypes -go.etcd.io/etcd/api/v3/version -# go.etcd.io/etcd/client/pkg/v3 v3.5.21 -## explicit; go 1.23.0 -go.etcd.io/etcd/client/pkg/v3/fileutil -go.etcd.io/etcd/client/pkg/v3/logutil -go.etcd.io/etcd/client/pkg/v3/systemd -go.etcd.io/etcd/client/pkg/v3/tlsutil -go.etcd.io/etcd/client/pkg/v3/transport -go.etcd.io/etcd/client/pkg/v3/types -# go.etcd.io/etcd/client/v3 v3.5.21 -## explicit; go 1.23.0 -go.etcd.io/etcd/client/v3 -go.etcd.io/etcd/client/v3/credentials -go.etcd.io/etcd/client/v3/internal/endpoint -go.etcd.io/etcd/client/v3/internal/resolver -go.etcd.io/etcd/client/v3/kubernetes # go.opentelemetry.io/auto/sdk v1.1.0 ## explicit; go 1.22.0 go.opentelemetry.io/auto/sdk @@ -421,8 +391,6 @@ go.opentelemetry.io/otel/internal/attribute go.opentelemetry.io/otel/internal/baggage go.opentelemetry.io/otel/internal/global go.opentelemetry.io/otel/propagation -go.opentelemetry.io/otel/semconv/internal -go.opentelemetry.io/otel/semconv/v1.12.0 go.opentelemetry.io/otel/semconv/v1.17.0 go.opentelemetry.io/otel/semconv/v1.20.0 go.opentelemetry.io/otel/semconv/v1.26.0 @@ -467,33 +435,13 @@ go.uber.org/automaxprocs go.uber.org/automaxprocs/internal/cgroups go.uber.org/automaxprocs/internal/runtime go.uber.org/automaxprocs/maxprocs -# go.uber.org/multierr v1.11.0 -## explicit; go 1.19 -go.uber.org/multierr -# go.uber.org/zap v1.27.0 -## explicit; go 1.19 -go.uber.org/zap -go.uber.org/zap/buffer -go.uber.org/zap/internal -go.uber.org/zap/internal/bufferpool -go.uber.org/zap/internal/color -go.uber.org/zap/internal/exit -go.uber.org/zap/internal/pool -go.uber.org/zap/internal/stacktrace -go.uber.org/zap/zapcore -go.uber.org/zap/zapgrpc # golang.org/x/crypto v0.37.0 ## explicit; go 1.23.0 golang.org/x/crypto/blowfish golang.org/x/crypto/chacha20 -golang.org/x/crypto/cryptobyte -golang.org/x/crypto/cryptobyte/asn1 golang.org/x/crypto/curve25519 -golang.org/x/crypto/hkdf golang.org/x/crypto/internal/alias golang.org/x/crypto/internal/poly1305 -golang.org/x/crypto/nacl/secretbox -golang.org/x/crypto/salsa20/salsa golang.org/x/crypto/ssh golang.org/x/crypto/ssh/internal/bcrypt_pbkdf # golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 @@ -573,8 +521,6 @@ golang.org/x/tools/go/ast/inspector golang.org/x/tools/internal/astutil/edge # google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a ## explicit; go 1.22 -google.golang.org/genproto/googleapis/api -google.golang.org/genproto/googleapis/api/annotations google.golang.org/genproto/googleapis/api/expr/v1alpha1 google.golang.org/genproto/googleapis/api/httpbody # google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a @@ -641,7 +587,6 @@ google.golang.org/grpc/metadata google.golang.org/grpc/peer google.golang.org/grpc/resolver google.golang.org/grpc/resolver/dns -google.golang.org/grpc/resolver/manual google.golang.org/grpc/serviceconfig google.golang.org/grpc/stats google.golang.org/grpc/status @@ -697,14 +642,11 @@ gopkg.in/evanphx/json-patch.v4 # gopkg.in/inf.v0 v0.9.1 ## explicit gopkg.in/inf.v0 -# gopkg.in/natefinch/lumberjack.v2 v2.2.1 -## explicit; go 1.13 -gopkg.in/natefinch/lumberjack.v2 # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 -# k8s.io/api v0.33.0 => k8s.io/api v0.32.2 -## explicit; go 1.23.0 +# k8s.io/api v0.33.0 => k8s.io/api v0.33.0 +## explicit; go 1.24.0 k8s.io/api/admission/v1 k8s.io/api/admission/v1beta1 k8s.io/api/admissionregistration/v1 @@ -757,6 +699,7 @@ k8s.io/api/rbac/v1alpha1 k8s.io/api/rbac/v1beta1 k8s.io/api/resource/v1alpha3 k8s.io/api/resource/v1beta1 +k8s.io/api/resource/v1beta2 k8s.io/api/scheduling/v1 k8s.io/api/scheduling/v1alpha1 k8s.io/api/scheduling/v1beta1 @@ -764,8 +707,8 @@ k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 k8s.io/api/storagemigration/v1alpha1 -# k8s.io/apiextensions-apiserver v0.32.1 => k8s.io/apiextensions-apiserver v0.32.2 -## explicit; go 1.23.0 +# k8s.io/apiextensions-apiserver v0.32.1 => k8s.io/apiextensions-apiserver v0.33.0 +## explicit; go 1.24.0 k8s.io/apiextensions-apiserver/pkg/apis/apiextensions k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 k8s.io/apiextensions-apiserver/pkg/features @@ -777,9 +720,12 @@ k8s.io/apimachinery/pkg/api/meta k8s.io/apimachinery/pkg/api/meta/testrestmapper k8s.io/apimachinery/pkg/api/operation k8s.io/apimachinery/pkg/api/resource +k8s.io/apimachinery/pkg/api/safe +k8s.io/apimachinery/pkg/api/validate +k8s.io/apimachinery/pkg/api/validate/constraints +k8s.io/apimachinery/pkg/api/validate/content k8s.io/apimachinery/pkg/api/validation k8s.io/apimachinery/pkg/api/validation/path -k8s.io/apimachinery/pkg/apis/asn1 k8s.io/apimachinery/pkg/apis/meta/internalversion k8s.io/apimachinery/pkg/apis/meta/internalversion/scheme k8s.io/apimachinery/pkg/apis/meta/internalversion/validation @@ -787,7 +733,6 @@ k8s.io/apimachinery/pkg/apis/meta/v1 k8s.io/apimachinery/pkg/apis/meta/v1/unstructured k8s.io/apimachinery/pkg/apis/meta/v1/validation k8s.io/apimachinery/pkg/apis/meta/v1beta1 -k8s.io/apimachinery/pkg/apis/meta/v1beta1/validation k8s.io/apimachinery/pkg/conversion k8s.io/apimachinery/pkg/conversion/queryparams k8s.io/apimachinery/pkg/fields @@ -832,7 +777,6 @@ k8s.io/apimachinery/pkg/util/validation k8s.io/apimachinery/pkg/util/validation/field k8s.io/apimachinery/pkg/util/version k8s.io/apimachinery/pkg/util/wait -k8s.io/apimachinery/pkg/util/waitgroup k8s.io/apimachinery/pkg/util/yaml k8s.io/apimachinery/pkg/version k8s.io/apimachinery/pkg/watch @@ -845,16 +789,7 @@ k8s.io/apiserver/pkg/admission k8s.io/apiserver/pkg/admission/configuration k8s.io/apiserver/pkg/admission/initializer k8s.io/apiserver/pkg/admission/metrics -k8s.io/apiserver/pkg/admission/plugin/authorizer k8s.io/apiserver/pkg/admission/plugin/cel -k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle -k8s.io/apiserver/pkg/admission/plugin/policy/generic -k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic -k8s.io/apiserver/pkg/admission/plugin/policy/matching -k8s.io/apiserver/pkg/admission/plugin/policy/mutating -k8s.io/apiserver/pkg/admission/plugin/policy/mutating/patch -k8s.io/apiserver/pkg/admission/plugin/policy/validating -k8s.io/apiserver/pkg/admission/plugin/policy/validating/metrics k8s.io/apiserver/pkg/admission/plugin/webhook k8s.io/apiserver/pkg/admission/plugin/webhook/config k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission @@ -868,41 +803,18 @@ k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/namespace k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/object k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/rules k8s.io/apiserver/pkg/admission/plugin/webhook/request -k8s.io/apiserver/pkg/admission/plugin/webhook/validating -k8s.io/apiserver/pkg/apis/apidiscovery/v2 k8s.io/apiserver/pkg/apis/apiserver k8s.io/apiserver/pkg/apis/apiserver/install k8s.io/apiserver/pkg/apis/apiserver/v1 k8s.io/apiserver/pkg/apis/apiserver/v1alpha1 k8s.io/apiserver/pkg/apis/apiserver/v1beta1 -k8s.io/apiserver/pkg/apis/apiserver/validation k8s.io/apiserver/pkg/apis/audit -k8s.io/apiserver/pkg/apis/audit/install k8s.io/apiserver/pkg/apis/audit/v1 -k8s.io/apiserver/pkg/apis/audit/validation k8s.io/apiserver/pkg/apis/cel -k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap k8s.io/apiserver/pkg/audit -k8s.io/apiserver/pkg/audit/policy -k8s.io/apiserver/pkg/authentication/authenticator -k8s.io/apiserver/pkg/authentication/authenticatorfactory -k8s.io/apiserver/pkg/authentication/cel -k8s.io/apiserver/pkg/authentication/group -k8s.io/apiserver/pkg/authentication/request/anonymous -k8s.io/apiserver/pkg/authentication/request/bearertoken -k8s.io/apiserver/pkg/authentication/request/headerrequest -k8s.io/apiserver/pkg/authentication/request/union -k8s.io/apiserver/pkg/authentication/request/websocket -k8s.io/apiserver/pkg/authentication/request/x509 k8s.io/apiserver/pkg/authentication/serviceaccount -k8s.io/apiserver/pkg/authentication/token/cache -k8s.io/apiserver/pkg/authentication/token/tokenfile k8s.io/apiserver/pkg/authentication/user k8s.io/apiserver/pkg/authorization/authorizer -k8s.io/apiserver/pkg/authorization/authorizerfactory -k8s.io/apiserver/pkg/authorization/cel -k8s.io/apiserver/pkg/authorization/path -k8s.io/apiserver/pkg/authorization/union k8s.io/apiserver/pkg/cel k8s.io/apiserver/pkg/cel/common k8s.io/apiserver/pkg/cel/environment @@ -910,96 +822,27 @@ k8s.io/apiserver/pkg/cel/lazy k8s.io/apiserver/pkg/cel/library k8s.io/apiserver/pkg/cel/mutation k8s.io/apiserver/pkg/cel/mutation/dynamic -k8s.io/apiserver/pkg/cel/openapi k8s.io/apiserver/pkg/cel/openapi/resolver -k8s.io/apiserver/pkg/endpoints -k8s.io/apiserver/pkg/endpoints/deprecation -k8s.io/apiserver/pkg/endpoints/discovery -k8s.io/apiserver/pkg/endpoints/discovery/aggregated -k8s.io/apiserver/pkg/endpoints/filterlatency -k8s.io/apiserver/pkg/endpoints/filters -k8s.io/apiserver/pkg/endpoints/handlers -k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager -k8s.io/apiserver/pkg/endpoints/handlers/finisher -k8s.io/apiserver/pkg/endpoints/handlers/metrics -k8s.io/apiserver/pkg/endpoints/handlers/negotiation -k8s.io/apiserver/pkg/endpoints/handlers/responsewriters k8s.io/apiserver/pkg/endpoints/metrics k8s.io/apiserver/pkg/endpoints/openapi k8s.io/apiserver/pkg/endpoints/request k8s.io/apiserver/pkg/endpoints/responsewriter -k8s.io/apiserver/pkg/endpoints/warning k8s.io/apiserver/pkg/features k8s.io/apiserver/pkg/quota/v1 -k8s.io/apiserver/pkg/registry/generic -k8s.io/apiserver/pkg/registry/generic/registry -k8s.io/apiserver/pkg/registry/rest -k8s.io/apiserver/pkg/server -k8s.io/apiserver/pkg/server/dynamiccertificates k8s.io/apiserver/pkg/server/egressselector k8s.io/apiserver/pkg/server/egressselector/metrics -k8s.io/apiserver/pkg/server/filters k8s.io/apiserver/pkg/server/healthz k8s.io/apiserver/pkg/server/httplog -k8s.io/apiserver/pkg/server/mux -k8s.io/apiserver/pkg/server/options -k8s.io/apiserver/pkg/server/options/encryptionconfig -k8s.io/apiserver/pkg/server/options/encryptionconfig/controller -k8s.io/apiserver/pkg/server/options/encryptionconfig/metrics -k8s.io/apiserver/pkg/server/resourceconfig -k8s.io/apiserver/pkg/server/routes k8s.io/apiserver/pkg/server/routine -k8s.io/apiserver/pkg/server/storage k8s.io/apiserver/pkg/storage -k8s.io/apiserver/pkg/storage/cacher -k8s.io/apiserver/pkg/storage/cacher/delegator -k8s.io/apiserver/pkg/storage/cacher/metrics -k8s.io/apiserver/pkg/storage/cacher/progress -k8s.io/apiserver/pkg/storage/errors -k8s.io/apiserver/pkg/storage/etcd3 -k8s.io/apiserver/pkg/storage/etcd3/metrics -k8s.io/apiserver/pkg/storage/feature k8s.io/apiserver/pkg/storage/names -k8s.io/apiserver/pkg/storage/storagebackend -k8s.io/apiserver/pkg/storage/storagebackend/factory -k8s.io/apiserver/pkg/storage/value -k8s.io/apiserver/pkg/storage/value/encrypt/aes -k8s.io/apiserver/pkg/storage/value/encrypt/envelope -k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2 -k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/v2 -k8s.io/apiserver/pkg/storage/value/encrypt/envelope/metrics -k8s.io/apiserver/pkg/storage/value/encrypt/identity -k8s.io/apiserver/pkg/storage/value/encrypt/secretbox -k8s.io/apiserver/pkg/storageversion -k8s.io/apiserver/pkg/util/apihelpers k8s.io/apiserver/pkg/util/compatibility -k8s.io/apiserver/pkg/util/dryrun k8s.io/apiserver/pkg/util/feature -k8s.io/apiserver/pkg/util/flowcontrol -k8s.io/apiserver/pkg/util/flowcontrol/debug -k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing -k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/eventclock -k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/promise -k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset -k8s.io/apiserver/pkg/util/flowcontrol/format -k8s.io/apiserver/pkg/util/flowcontrol/metrics -k8s.io/apiserver/pkg/util/flowcontrol/request -k8s.io/apiserver/pkg/util/flushwriter -k8s.io/apiserver/pkg/util/peerproxy/metrics -k8s.io/apiserver/pkg/util/shufflesharding k8s.io/apiserver/pkg/util/webhook k8s.io/apiserver/pkg/util/x509metrics -k8s.io/apiserver/pkg/validation k8s.io/apiserver/pkg/warning -k8s.io/apiserver/plugin/pkg/audit/buffered -k8s.io/apiserver/plugin/pkg/audit/log -k8s.io/apiserver/plugin/pkg/audit/truncate -k8s.io/apiserver/plugin/pkg/audit/webhook -k8s.io/apiserver/plugin/pkg/authenticator/token/webhook -k8s.io/apiserver/plugin/pkg/authorizer/webhook -k8s.io/apiserver/plugin/pkg/authorizer/webhook/metrics -# k8s.io/client-go v12.0.0+incompatible => k8s.io/client-go v0.32.2 -## explicit; go 1.23.0 +# k8s.io/client-go v12.0.0+incompatible => k8s.io/client-go v0.33.0 +## explicit; go 1.24.0 k8s.io/client-go/applyconfigurations k8s.io/client-go/applyconfigurations/admissionregistration/v1 k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1 @@ -1046,6 +889,7 @@ k8s.io/client-go/applyconfigurations/rbac/v1alpha1 k8s.io/client-go/applyconfigurations/rbac/v1beta1 k8s.io/client-go/applyconfigurations/resource/v1alpha3 k8s.io/client-go/applyconfigurations/resource/v1beta1 +k8s.io/client-go/applyconfigurations/resource/v1beta2 k8s.io/client-go/applyconfigurations/scheduling/v1 k8s.io/client-go/applyconfigurations/scheduling/v1alpha1 k8s.io/client-go/applyconfigurations/scheduling/v1beta1 @@ -1059,7 +903,6 @@ k8s.io/client-go/discovery/fake k8s.io/client-go/dynamic k8s.io/client-go/dynamic/dynamicinformer k8s.io/client-go/dynamic/dynamiclister -k8s.io/client-go/dynamic/fake k8s.io/client-go/features k8s.io/client-go/gentype k8s.io/client-go/informers @@ -1123,6 +966,7 @@ k8s.io/client-go/informers/rbac/v1beta1 k8s.io/client-go/informers/resource k8s.io/client-go/informers/resource/v1alpha3 k8s.io/client-go/informers/resource/v1beta1 +k8s.io/client-go/informers/resource/v1beta2 k8s.io/client-go/informers/scheduling k8s.io/client-go/informers/scheduling/v1 k8s.io/client-go/informers/scheduling/v1alpha1 @@ -1230,6 +1074,8 @@ k8s.io/client-go/kubernetes/typed/resource/v1alpha3 k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake k8s.io/client-go/kubernetes/typed/resource/v1beta1 k8s.io/client-go/kubernetes/typed/resource/v1beta1/fake +k8s.io/client-go/kubernetes/typed/resource/v1beta2 +k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake k8s.io/client-go/kubernetes/typed/scheduling/v1 k8s.io/client-go/kubernetes/typed/scheduling/v1/fake k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1 @@ -1287,6 +1133,7 @@ k8s.io/client-go/listers/rbac/v1alpha1 k8s.io/client-go/listers/rbac/v1beta1 k8s.io/client-go/listers/resource/v1alpha3 k8s.io/client-go/listers/resource/v1beta1 +k8s.io/client-go/listers/resource/v1beta2 k8s.io/client-go/listers/scheduling/v1 k8s.io/client-go/listers/scheduling/v1alpha1 k8s.io/client-go/listers/scheduling/v1beta1 @@ -1348,17 +1195,6 @@ k8s.io/client-go/util/watchlist k8s.io/client-go/util/workqueue # k8s.io/cloud-provider v0.33.0 ## explicit; go 1.24.0 -k8s.io/cloud-provider -k8s.io/cloud-provider/app/config -k8s.io/cloud-provider/config -k8s.io/cloud-provider/config/install -k8s.io/cloud-provider/config/v1alpha1 -k8s.io/cloud-provider/controllers/node/config -k8s.io/cloud-provider/controllers/node/config/v1alpha1 -k8s.io/cloud-provider/controllers/service/config -k8s.io/cloud-provider/controllers/service/config/v1alpha1 -k8s.io/cloud-provider/names -k8s.io/cloud-provider/options k8s.io/cloud-provider/volume k8s.io/cloud-provider/volume/helpers # k8s.io/component-base v0.33.0 @@ -1366,7 +1202,6 @@ k8s.io/cloud-provider/volume/helpers k8s.io/component-base/cli/flag k8s.io/component-base/compatibility k8s.io/component-base/config -k8s.io/component-base/config/options k8s.io/component-base/config/v1alpha1 k8s.io/component-base/config/validation k8s.io/component-base/featuregate @@ -1377,19 +1212,15 @@ k8s.io/component-base/logs/klogflags k8s.io/component-base/logs/logreduction k8s.io/component-base/logs/testinit k8s.io/component-base/metrics -k8s.io/component-base/metrics/features k8s.io/component-base/metrics/legacyregistry k8s.io/component-base/metrics/prometheus/feature k8s.io/component-base/metrics/prometheus/slis -k8s.io/component-base/metrics/prometheus/workqueue k8s.io/component-base/metrics/prometheusextension k8s.io/component-base/metrics/testutil k8s.io/component-base/tracing k8s.io/component-base/tracing/api/v1 k8s.io/component-base/version k8s.io/component-base/zpages/features -k8s.io/component-base/zpages/flagz -k8s.io/component-base/zpages/httputil # k8s.io/component-helpers v0.33.0 ## explicit; go 1.24.0 k8s.io/component-helpers/node/topology @@ -1401,35 +1232,28 @@ k8s.io/component-helpers/storage/ephemeral k8s.io/component-helpers/storage/volume # k8s.io/controller-manager v0.33.0 ## explicit; go 1.24.0 -k8s.io/controller-manager/config -k8s.io/controller-manager/config/v1 -k8s.io/controller-manager/config/v1alpha1 -k8s.io/controller-manager/config/v1beta1 -k8s.io/controller-manager/options -k8s.io/controller-manager/pkg/clientbuilder k8s.io/controller-manager/pkg/features -k8s.io/controller-manager/pkg/features/register -k8s.io/controller-manager/pkg/leadermigration/config -k8s.io/controller-manager/pkg/leadermigration/options -# k8s.io/cri-api v0.32.2 -## explicit; go 1.23.0 +# k8s.io/cri-api v0.33.0 +## explicit; go 1.24.0 k8s.io/cri-api/pkg/apis k8s.io/cri-api/pkg/apis/runtime/v1 -# k8s.io/cri-client v0.0.0 => k8s.io/cri-client v0.32.2 -## explicit; go 1.23.0 +# k8s.io/cri-client v0.0.0 => k8s.io/cri-client v0.33.0 +## explicit; go 1.24.0 k8s.io/cri-client/pkg k8s.io/cri-client/pkg/internal k8s.io/cri-client/pkg/logs k8s.io/cri-client/pkg/util -# k8s.io/csi-translation-lib v0.32.2 => k8s.io/csi-translation-lib v0.32.2 -## explicit; go 1.23.0 +# k8s.io/csi-translation-lib v0.32.2 => k8s.io/csi-translation-lib v0.33.0 +## explicit; go 1.24.0 k8s.io/csi-translation-lib k8s.io/csi-translation-lib/plugins -# k8s.io/dynamic-resource-allocation v0.0.0 => k8s.io/dynamic-resource-allocation v0.32.2 -## explicit; go 1.23.0 +# k8s.io/dynamic-resource-allocation v0.0.0 => k8s.io/dynamic-resource-allocation v0.33.0 +## explicit; go 1.24.0 k8s.io/dynamic-resource-allocation/api k8s.io/dynamic-resource-allocation/cel +k8s.io/dynamic-resource-allocation/internal/queue k8s.io/dynamic-resource-allocation/resourceclaim +k8s.io/dynamic-resource-allocation/resourceslice/tracker k8s.io/dynamic-resource-allocation/structured # k8s.io/klog/v2 v2.130.1 ## explicit; go 1.18 @@ -1442,27 +1266,15 @@ k8s.io/klog/v2/internal/severity k8s.io/klog/v2/internal/sloghandler k8s.io/klog/v2/internal/verbosity k8s.io/klog/v2/textlogger -# k8s.io/kms v0.33.0 -## explicit; go 1.24.0 -k8s.io/kms/apis/v1beta1 -k8s.io/kms/apis/v2 -k8s.io/kms/pkg/service -k8s.io/kms/pkg/util # k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff ## explicit; go 1.21 -k8s.io/kube-openapi/pkg/builder -k8s.io/kube-openapi/pkg/builder3 -k8s.io/kube-openapi/pkg/builder3/util k8s.io/kube-openapi/pkg/cached k8s.io/kube-openapi/pkg/common -k8s.io/kube-openapi/pkg/common/restfuladapter -k8s.io/kube-openapi/pkg/handler k8s.io/kube-openapi/pkg/handler3 k8s.io/kube-openapi/pkg/internal k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json k8s.io/kube-openapi/pkg/internal/third_party/govalidator k8s.io/kube-openapi/pkg/schemaconv -k8s.io/kube-openapi/pkg/schemamutation k8s.io/kube-openapi/pkg/spec3 k8s.io/kube-openapi/pkg/util k8s.io/kube-openapi/pkg/util/proto @@ -1470,16 +1282,16 @@ k8s.io/kube-openapi/pkg/validation/errors k8s.io/kube-openapi/pkg/validation/spec k8s.io/kube-openapi/pkg/validation/strfmt k8s.io/kube-openapi/pkg/validation/strfmt/bson -# k8s.io/kube-scheduler v0.0.0 => k8s.io/kube-scheduler v0.32.2 -## explicit; go 1.23.0 +# k8s.io/kube-scheduler v0.0.0 => k8s.io/kube-scheduler v0.33.0 +## explicit; go 1.24.0 k8s.io/kube-scheduler/config/v1 k8s.io/kube-scheduler/extender/v1 -# k8s.io/kubectl v0.0.0 => k8s.io/kubectl v0.32.2 -## explicit; go 1.23.0 +# k8s.io/kubectl v0.0.0 => k8s.io/kubectl v0.33.0 +## explicit; go 1.24.0 k8s.io/kubectl/pkg/scale k8s.io/kubectl/pkg/util/podutils -# k8s.io/kubelet v0.32.2 => k8s.io/kubelet v0.32.2 -## explicit; go 1.23.0 +# k8s.io/kubelet v0.33.0 => k8s.io/kubelet v0.33.0 +## explicit; go 1.24.0 k8s.io/kubelet/pkg/apis k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1 k8s.io/kubelet/pkg/apis/dra/v1alpha4 @@ -1488,8 +1300,8 @@ k8s.io/kubelet/pkg/apis/pluginregistration/v1 k8s.io/kubelet/pkg/apis/podresources/v1 k8s.io/kubelet/pkg/apis/podresources/v1alpha1 k8s.io/kubelet/pkg/apis/stats/v1alpha1 -# k8s.io/kubernetes v1.32.3 -## explicit; go 1.23.0 +# k8s.io/kubernetes v1.33.0 +## explicit; go 1.24.0 k8s.io/kubernetes/pkg/api/legacyscheme k8s.io/kubernetes/pkg/api/service k8s.io/kubernetes/pkg/api/v1/pod @@ -1511,9 +1323,9 @@ k8s.io/kubernetes/pkg/apis/networking k8s.io/kubernetes/pkg/apis/scheduling k8s.io/kubernetes/pkg/capabilities k8s.io/kubernetes/pkg/client/conditions -k8s.io/kubernetes/pkg/cluster/ports k8s.io/kubernetes/pkg/controller k8s.io/kubernetes/pkg/controller/deployment/util +k8s.io/kubernetes/pkg/credentialprovider k8s.io/kubernetes/pkg/features k8s.io/kubernetes/pkg/fieldpath k8s.io/kubernetes/pkg/kubelet/apis/config @@ -1548,10 +1360,10 @@ k8s.io/kubernetes/pkg/kubelet/kuberuntime/util k8s.io/kubernetes/pkg/kubelet/lifecycle k8s.io/kubernetes/pkg/kubelet/metrics k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache +k8s.io/kubernetes/pkg/kubelet/qos k8s.io/kubernetes/pkg/kubelet/server/metrics k8s.io/kubernetes/pkg/kubelet/stats/pidlimit k8s.io/kubernetes/pkg/kubelet/status -k8s.io/kubernetes/pkg/kubelet/status/state k8s.io/kubernetes/pkg/kubelet/types k8s.io/kubernetes/pkg/kubelet/util k8s.io/kubernetes/pkg/kubelet/util/format @@ -1658,7 +1470,6 @@ k8s.io/pod-security-admission/policy ## explicit; go 1.18 k8s.io/utils/buffer k8s.io/utils/clock -k8s.io/utils/clock/testing k8s.io/utils/cpuset k8s.io/utils/exec k8s.io/utils/inotify @@ -1669,7 +1480,6 @@ k8s.io/utils/io k8s.io/utils/keymutex k8s.io/utils/lru k8s.io/utils/net -k8s.io/utils/nsenter k8s.io/utils/path k8s.io/utils/pointer k8s.io/utils/ptr @@ -1702,12 +1512,12 @@ sigs.k8s.io/yaml sigs.k8s.io/yaml/goyaml.v2 # github.com/ceph/ceph-csi => ../ # github.com/ceph/ceph-csi/api => ../api -# k8s.io/api => k8s.io/api v0.32.2 -# k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.32.2 -# k8s.io/client-go => k8s.io/client-go v0.32.2 -# k8s.io/cri-client => k8s.io/cri-client v0.32.2 -# k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.32.2 -# k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.32.2 -# k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.32.2 -# k8s.io/kubectl => k8s.io/kubectl v0.32.2 -# k8s.io/kubelet => k8s.io/kubelet v0.32.2 +# k8s.io/api => k8s.io/api v0.33.0 +# k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.33.0 +# k8s.io/client-go => k8s.io/client-go v0.33.0 +# k8s.io/cri-client => k8s.io/cri-client v0.33.0 +# k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.33.0 +# k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.33.0 +# k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.33.0 +# k8s.io/kubectl => k8s.io/kubectl v0.33.0 +# k8s.io/kubelet => k8s.io/kubelet v0.33.0