From 92aa86d5dc38f18707ea00628dfca96ca3eb8648 Mon Sep 17 00:00:00 2001 From: esara Date: Sat, 12 Oct 2024 16:15:04 -0400 Subject: [PATCH 1/7] parse sql host address and port --- bpf/go_sql.h | 54 +++++++++++++++++++ bpf/tracer_common.h | 1 + pkg/internal/ebpf/common/bpf_arm64_bpfel.go | 2 + pkg/internal/ebpf/common/bpf_x86_bpfel.go | 2 + pkg/internal/ebpf/common/spanner.go | 19 +++++-- .../ebpf/common/sql_detect_transform.go | 4 +- pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.go | 2 + .../ebpf/gotracer/bpf_debug_arm64_bpfel.go | 2 + .../ebpf/gotracer/bpf_debug_x86_bpfel.go | 2 + .../ebpf/gotracer/bpf_tp_arm64_bpfel.go | 2 + .../ebpf/gotracer/bpf_tp_debug_arm64_bpfel.go | 2 + .../ebpf/gotracer/bpf_tp_debug_x86_bpfel.go | 2 + .../ebpf/gotracer/bpf_tp_x86_bpfel.go | 2 + pkg/internal/ebpf/gotracer/bpf_x86_bpfel.go | 2 + 14 files changed, 93 insertions(+), 5 deletions(-) diff --git a/bpf/go_sql.h b/bpf/go_sql.h index 4037d4c2a..07dd1fb51 100644 --- a/bpf/go_sql.h +++ b/bpf/go_sql.h @@ -30,6 +30,7 @@ typedef struct sql_func_invocation { u64 start_monotime_ns; u64 sql_param; u64 query_len; + connection_info_t conn __attribute__((aligned(8))); tp_info_t tp; } sql_func_invocation_t; @@ -65,6 +66,43 @@ int uprobe_queryDC(struct pt_regs *ctx) { void *sql_param = GO_PARAM8(ctx); void *query_len = GO_PARAM9(ctx); + + off_table_t *ot = get_offsets_table(); + go_addr_key_t g_key = {}; + go_addr_key_from_id(&g_key, goroutine_addr); + + connection_info_t *existing = bpf_map_lookup_elem(&ongoing_server_connections, &g_key); + + if (!existing) { + void *c_ptr = GO_PARAM1(ctx); + if (c_ptr) { + void *conn_conn_ptr = + c_ptr + 8 + go_offset_of(ot, (go_offset){.v = _c_rwc_pos}); // embedded struct + void *tls_state = 0; + bpf_probe_read(&tls_state, + sizeof(tls_state), + (void *)(c_ptr + go_offset_of(ot, (go_offset){.v = _c_tls_pos}))); + conn_conn_ptr = unwrap_tls_conn_info(conn_conn_ptr, tls_state); + //bpf_dbg_printk("conn_conn_ptr %llx, tls_state %llx, c_tls_pos = %d, c_tls_ptr = %llx", conn_conn_ptr, tls_state, c_tls_pos, c_ptr + c_tls_pos); + if (conn_conn_ptr) { + void *conn_ptr = 0; + bpf_probe_read( + &conn_ptr, + sizeof(conn_ptr), + (void *)(conn_conn_ptr + + go_offset_of(ot, (go_offset){.v = _net_conn_pos}))); // find conn + bpf_dbg_printk("conn_ptr %llx", conn_ptr); + if (conn_ptr) { + connection_info_t conn = {0}; + get_conn_info( + conn_ptr, + &conn); // initialized to 0, no need to check the result if we succeeded + bpf_map_update_elem(&ongoing_server_connections, &g_key, &conn, BPF_ANY); + } + } + } + } + set_sql_info(goroutine_addr, sql_param, query_len); return 0; } @@ -117,6 +155,22 @@ int uprobe_queryReturn(struct pt_regs *ctx) { if (query_len < sizeof(trace->sql)) { trace->sql[query_len] = 0; } + + connection_info_t *info = bpf_map_lookup_elem(&ongoing_server_connections, &g_key); + + if (info) { + //dbg_print_http_connection_info(info); + __builtin_memcpy(&trace->conn, info, sizeof(connection_info_t)); + } else { + // We can't find the connection info, this typically means there are too many requests per second + // and the connection map is too small for the workload. + bpf_dbg_printk("Can't find connection info for %llx", goroutine_addr); + __builtin_memset(&trace->conn, 0, sizeof(connection_info_t)); + } + + // Server connections have opposite order, source port is the server port + swap_connection_info_order(&trace->conn); + // submit the completed trace via ringbuffer bpf_ringbuf_submit(trace, get_flags()); } else { diff --git a/bpf/tracer_common.h b/bpf/tracer_common.h index 746df96f5..2fcb6b2c7 100644 --- a/bpf/tracer_common.h +++ b/bpf/tracer_common.h @@ -51,6 +51,7 @@ typedef struct sql_request_trace_t { u64 end_monotime_ns; u8 sql[SQL_MAX_LEN]; u16 status; + connection_info_t conn __attribute__((aligned(8))); tp_info_t tp; pid_info pid; } __attribute__((packed)) sql_request_trace; diff --git a/pkg/internal/ebpf/common/bpf_arm64_bpfel.go b/pkg/internal/ebpf/common/bpf_arm64_bpfel.go index 11a17b7ca..17f827402 100644 --- a/pkg/internal/ebpf/common/bpf_arm64_bpfel.go +++ b/pkg/internal/ebpf/common/bpf_arm64_bpfel.go @@ -174,6 +174,8 @@ type bpfSqlRequestTrace struct { EndMonotimeNs uint64 Sql [500]uint8 Status uint16 + _ [1]byte + Conn bpfConnectionInfoT Tp struct { TraceId [16]uint8 SpanId [8]uint8 diff --git a/pkg/internal/ebpf/common/bpf_x86_bpfel.go b/pkg/internal/ebpf/common/bpf_x86_bpfel.go index be5a2390d..12b31bd99 100644 --- a/pkg/internal/ebpf/common/bpf_x86_bpfel.go +++ b/pkg/internal/ebpf/common/bpf_x86_bpfel.go @@ -174,6 +174,8 @@ type bpfSqlRequestTrace struct { EndMonotimeNs uint64 Sql [500]uint8 Status uint16 + _ [1]byte + Conn bpfConnectionInfoT Tp struct { TraceId [16]uint8 SpanId [8]uint8 diff --git a/pkg/internal/ebpf/common/spanner.go b/pkg/internal/ebpf/common/spanner.go index b4bcb1d87..43fad0cd6 100644 --- a/pkg/internal/ebpf/common/spanner.go +++ b/pkg/internal/ebpf/common/spanner.go @@ -76,14 +76,25 @@ func SQLRequestTraceToSpan(trace *SQLRequestTrace) request.Span { method, path := sqlprune.SQLParseOperationAndTable(sql) + peer := "" + peerPort := 0 + hostname := "" + hostPort := 0 + + if trace.Conn.S_port != 0 || trace.Conn.D_port != 0 { + peer, hostname = (*BPFConnInfo)(unsafe.Pointer(&trace.Conn)).reqHostInfo() + peerPort = int(trace.Conn.S_port) + hostPort = int(trace.Conn.D_port) + } + return request.Span{ Type: request.EventType(trace.Type), Method: method, Path: path, - Peer: "", - PeerPort: 0, - Host: "", - HostPort: 0, + Peer: peer, + PeerPort: peerPort, + Host: hostname, + HostPort: hostPort, ContentLength: 0, RequestStart: int64(trace.StartMonotimeNs), Start: int64(trace.StartMonotimeNs), diff --git a/pkg/internal/ebpf/common/sql_detect_transform.go b/pkg/internal/ebpf/common/sql_detect_transform.go index f7d2bdd54..c01d670b8 100644 --- a/pkg/internal/ebpf/common/sql_detect_transform.go +++ b/pkg/internal/ebpf/common/sql_detect_transform.go @@ -209,11 +209,13 @@ func parsePosgresQueryCommand(buf []byte) (string, error) { func TCPToSQLToSpan(trace *TCPRequestInfo, op, table, sql string) request.Span { peer := "" + peerPort := 0 hostname := "" hostPort := 0 if trace.ConnInfo.S_port != 0 || trace.ConnInfo.D_port != 0 { peer, hostname = (*BPFConnInfo)(unsafe.Pointer(&trace.ConnInfo)).reqHostInfo() + peerPort = int(trace.ConnInfo.S_port) hostPort = int(trace.ConnInfo.D_port) } @@ -222,7 +224,7 @@ func TCPToSQLToSpan(trace *TCPRequestInfo, op, table, sql string) request.Span { Method: op, Path: table, Peer: peer, - PeerPort: int(trace.ConnInfo.S_port), + PeerPort: peerPort, Host: hostname, HostPort: hostPort, ContentLength: 0, diff --git a/pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.go b/pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.go index 961953411..02cde33cb 100644 --- a/pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.go +++ b/pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.go @@ -141,6 +141,8 @@ type bpfSqlFuncInvocationT struct { StartMonotimeNs uint64 SqlParam uint64 QueryLen uint64 + Conn bpfConnectionInfoT + _ [4]byte Tp bpfTpInfoT } diff --git a/pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.go b/pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.go index fbc88dbae..34c6e03cc 100644 --- a/pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.go +++ b/pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.go @@ -141,6 +141,8 @@ type bpf_debugSqlFuncInvocationT struct { StartMonotimeNs uint64 SqlParam uint64 QueryLen uint64 + Conn bpf_debugConnectionInfoT + _ [4]byte Tp bpf_debugTpInfoT } diff --git a/pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.go b/pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.go index 828140e9c..b7f336e4a 100644 --- a/pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.go +++ b/pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.go @@ -141,6 +141,8 @@ type bpf_debugSqlFuncInvocationT struct { StartMonotimeNs uint64 SqlParam uint64 QueryLen uint64 + Conn bpf_debugConnectionInfoT + _ [4]byte Tp bpf_debugTpInfoT } diff --git a/pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.go b/pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.go index b8901a386..630d92afc 100644 --- a/pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.go +++ b/pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.go @@ -153,6 +153,8 @@ type bpf_tpSqlFuncInvocationT struct { StartMonotimeNs uint64 SqlParam uint64 QueryLen uint64 + Conn bpf_tpConnectionInfoT + _ [4]byte Tp bpf_tpTpInfoT } diff --git a/pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.go b/pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.go index 7519e85a9..b2411ee0b 100644 --- a/pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.go +++ b/pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.go @@ -153,6 +153,8 @@ type bpf_tp_debugSqlFuncInvocationT struct { StartMonotimeNs uint64 SqlParam uint64 QueryLen uint64 + Conn bpf_tp_debugConnectionInfoT + _ [4]byte Tp bpf_tp_debugTpInfoT } diff --git a/pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.go b/pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.go index a3e1c4127..67263cf3c 100644 --- a/pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.go +++ b/pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.go @@ -153,6 +153,8 @@ type bpf_tp_debugSqlFuncInvocationT struct { StartMonotimeNs uint64 SqlParam uint64 QueryLen uint64 + Conn bpf_tp_debugConnectionInfoT + _ [4]byte Tp bpf_tp_debugTpInfoT } diff --git a/pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.go b/pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.go index 751b3b4fd..b386e0b71 100644 --- a/pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.go +++ b/pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.go @@ -153,6 +153,8 @@ type bpf_tpSqlFuncInvocationT struct { StartMonotimeNs uint64 SqlParam uint64 QueryLen uint64 + Conn bpf_tpConnectionInfoT + _ [4]byte Tp bpf_tpTpInfoT } diff --git a/pkg/internal/ebpf/gotracer/bpf_x86_bpfel.go b/pkg/internal/ebpf/gotracer/bpf_x86_bpfel.go index ff00235c0..56055593c 100644 --- a/pkg/internal/ebpf/gotracer/bpf_x86_bpfel.go +++ b/pkg/internal/ebpf/gotracer/bpf_x86_bpfel.go @@ -141,6 +141,8 @@ type bpfSqlFuncInvocationT struct { StartMonotimeNs uint64 SqlParam uint64 QueryLen uint64 + Conn bpfConnectionInfoT + _ [4]byte Tp bpfTpInfoT } From 2b3b270df614a82ad073d11c1deadaa627263fdf Mon Sep 17 00:00:00 2001 From: Nikola Grcevski Date: Wed, 16 Oct 2024 15:56:26 -0400 Subject: [PATCH 2/7] Add postgres go example --- .gitignore | 1 + test/integration/components/gosql/Dockerfile | 27 ++++++++ test/integration/components/gosql/go.mod | 7 +++ test/integration/components/gosql/go.sum | 2 + test/integration/components/gosql/gosql.go | 66 ++++++++++++++++++++ 5 files changed, 103 insertions(+) create mode 100644 test/integration/components/gosql/Dockerfile create mode 100644 test/integration/components/gosql/go.mod create mode 100644 test/integration/components/gosql/go.sum create mode 100644 test/integration/components/gosql/gosql.go diff --git a/.gitignore b/.gitignore index 6619d7cb1..3569a3ea1 100644 --- a/.gitignore +++ b/.gitignore @@ -85,3 +85,4 @@ test/integration/components/go_otel_grpc/rolldice test/integration/components/pythonserver/lib/ test/integration/components/pythonserver/lib64 test/integration/components/pythonserver/pyvenv.cfg +test/integration/components/gosql/qosql diff --git a/test/integration/components/gosql/Dockerfile b/test/integration/components/gosql/Dockerfile new file mode 100644 index 000000000..63042048b --- /dev/null +++ b/test/integration/components/gosql/Dockerfile @@ -0,0 +1,27 @@ +# Build the testserver binary +# Docker command must be invoked from the projec root directory +FROM golang:1.23 AS builder + +ARG TARGETARCH + +ENV GOARCH=$TARGETARCH + +WORKDIR /src + +# Copy the go manifests and source +COPY go.mod go.mod +COPY go.sum go.sum +COPY gosql.go gosql.go + +# Build +RUN go mod download +RUN go build -o qosql gosql.go + +# Create final image from minimal + built binary +FROM debian:bookworm-slim + +WORKDIR / +COPY --from=builder /src/gosql . +USER 0:0 + +CMD [ "/qosql" ] \ No newline at end of file diff --git a/test/integration/components/gosql/go.mod b/test/integration/components/gosql/go.mod new file mode 100644 index 000000000..dfa7bdd69 --- /dev/null +++ b/test/integration/components/gosql/go.mod @@ -0,0 +1,7 @@ +module github.com/beyla/test/integration/components/gosql + +go 1.21 + +toolchain go1.23.0 + +require github.com/lib/pq v1.10.9 diff --git a/test/integration/components/gosql/go.sum b/test/integration/components/gosql/go.sum new file mode 100644 index 000000000..aeddeae36 --- /dev/null +++ b/test/integration/components/gosql/go.sum @@ -0,0 +1,2 @@ +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= diff --git a/test/integration/components/gosql/gosql.go b/test/integration/components/gosql/gosql.go new file mode 100644 index 000000000..cf58c7d2a --- /dev/null +++ b/test/integration/components/gosql/gosql.go @@ -0,0 +1,66 @@ +package main + +import ( + "database/sql" + "fmt" + "log" + "net/http" + + _ "github.com/lib/pq" +) + +func main() { + psqlInit := false + var db *sql.DB + var err error + + http.HandleFunc("/psqltest", func(w http.ResponseWriter, r *http.Request) { + if !psqlInit { + db, err = sql.Open("postgres", "user=postgres dbname=sqltest sslmode=disable password=postgres host=localhost port=5432") + if err != nil { + log.Fatal(err) + } + psqlInit = true + } + // Ping the database to verify the connection + err = db.Ping() + if err != nil { + log.Printf("%v\n", err) + w.WriteHeader(500) + return + } + + // Execute a query + rows, err := db.Query("SELECT * from accounting.contacts WHERE id=1") + if err != nil { + log.Printf("%v\n", err) + w.WriteHeader(500) + return + } + defer rows.Close() + + var name, lastNames, address string + var id int + + if rows.Next() { + err = rows.Scan(&id, &name, &lastNames, &address) + if err != nil { + log.Printf("%v\n", err) + w.WriteHeader(500) + return + } + fmt.Println("name: ", name, " id: ", id) + } else { + log.Printf("no data", err) + w.WriteHeader(500) + return + } + + w.Write([]byte(name + " " + lastNames)) + }) + + err = http.ListenAndServe(":8080", nil) + if db != nil { + db.Close() + } +} From dca8168ceb7ad77d9e2533e8de4407d68e46a202 Mon Sep 17 00:00:00 2001 From: Nikola Grcevski Date: Wed, 16 Oct 2024 16:26:42 -0400 Subject: [PATCH 3/7] Track connection info for gosql --- bpf/go_common.h | 35 ++++++++++ bpf/go_grpc.h | 42 ------------ bpf/go_nethttp.h | 38 +++++++++-- bpf/go_sql.h | 67 +------------------ pkg/internal/ebpf/common/bpf_arm64_bpfel.o | 4 +- pkg/internal/ebpf/common/bpf_x86_bpfel.o | 4 +- pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.go | 3 - pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.o | 4 +- .../ebpf/gotracer/bpf_debug_arm64_bpfel.go | 3 - .../ebpf/gotracer/bpf_debug_arm64_bpfel.o | 4 +- .../ebpf/gotracer/bpf_debug_x86_bpfel.go | 3 - .../ebpf/gotracer/bpf_debug_x86_bpfel.o | 4 +- .../ebpf/gotracer/bpf_tp_arm64_bpfel.go | 3 - .../ebpf/gotracer/bpf_tp_arm64_bpfel.o | 4 +- .../ebpf/gotracer/bpf_tp_debug_arm64_bpfel.go | 3 - .../ebpf/gotracer/bpf_tp_debug_arm64_bpfel.o | 4 +- .../ebpf/gotracer/bpf_tp_debug_x86_bpfel.go | 3 - .../ebpf/gotracer/bpf_tp_debug_x86_bpfel.o | 4 +- .../ebpf/gotracer/bpf_tp_x86_bpfel.go | 3 - pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.o | 4 +- pkg/internal/ebpf/gotracer/bpf_x86_bpfel.go | 3 - pkg/internal/ebpf/gotracer/bpf_x86_bpfel.o | 4 +- pkg/internal/ebpf/gotracer/gotracer.go | 3 - 23 files changed, 88 insertions(+), 161 deletions(-) diff --git a/bpf/go_common.h b/bpf/go_common.h index 01ca823fa..987b7f9a2 100644 --- a/bpf/go_common.h +++ b/bpf/go_common.h @@ -73,6 +73,41 @@ struct { __uint(pinning, LIBBPF_PIN_BY_NAME); } go_trace_map SEC(".maps"); +struct { + __uint(type, BPF_MAP_TYPE_LRU_HASH); + __type(key, go_addr_key_t); // key: goroutine + __type(value, void *); // the transport * + __uint(max_entries, MAX_CONCURRENT_REQUESTS); +} ongoing_grpc_operate_headers SEC(".maps"); + +typedef struct grpc_transports { + u8 type; + connection_info_t conn; +} grpc_transports_t; + +// TODO: use go_addr_key_t as key +struct { + __uint(type, BPF_MAP_TYPE_LRU_HASH); + __type(key, void *); // key: pointer to the transport pointer + __type(value, grpc_transports_t); + __uint(max_entries, MAX_CONCURRENT_REQUESTS); +} ongoing_grpc_transports SEC(".maps"); + +typedef struct sql_func_invocation { + u64 start_monotime_ns; + u64 sql_param; + u64 query_len; + connection_info_t conn __attribute__((aligned(8))); + tp_info_t tp; +} sql_func_invocation_t; + +struct { + __uint(type, BPF_MAP_TYPE_LRU_HASH); + __type(key, go_addr_key_t); // key: pointer to the request goroutine + __type(value, sql_func_invocation_t); + __uint(max_entries, MAX_CONCURRENT_REQUESTS); +} ongoing_sql_queries SEC(".maps"); + static __always_inline void go_addr_key_from_id(go_addr_key_t *current, void *addr) { u64 pid_tid = bpf_get_current_pid_tgid(); u32 pid = pid_from_pid_tgid(pid_tid); diff --git a/bpf/go_grpc.h b/bpf/go_grpc.h index 764b51b59..c407dbfdb 100644 --- a/bpf/go_grpc.h +++ b/bpf/go_grpc.h @@ -42,26 +42,6 @@ typedef struct grpc_client_func_invocation { u64 flags; } grpc_client_func_invocation_t; -typedef struct grpc_transports { - u8 type; - connection_info_t conn; -} grpc_transports_t; - -// TODO: use go_addr_key_t as key -struct { - __uint(type, BPF_MAP_TYPE_LRU_HASH); - __type(key, void *); // key: pointer to the transport pointer - __type(value, grpc_transports_t); - __uint(max_entries, MAX_CONCURRENT_REQUESTS); -} ongoing_grpc_transports SEC(".maps"); - -struct { - __uint(type, BPF_MAP_TYPE_LRU_HASH); - __type(key, go_addr_key_t); // key: goroutine - __type(value, void *); // the transport * - __uint(max_entries, MAX_CONCURRENT_REQUESTS); -} ongoing_grpc_operate_headers SEC(".maps"); - struct { __uint(type, BPF_MAP_TYPE_LRU_HASH); __type(key, go_addr_key_t); // key: pointer to the request goroutine @@ -141,28 +121,6 @@ int uprobe_server_handleStream(struct pt_regs *ctx) { return 0; } -// Sets up the connection info to be grabbed and mapped over the transport to operateHeaders -SEC("uprobe/netFdReadGRPC") -int uprobe_netFdReadGRPC(struct pt_regs *ctx) { - void *goroutine_addr = GOROUTINE_PTR(ctx); - bpf_dbg_printk("=== uprobe/proc netFD read goroutine %lx === ", goroutine_addr); - go_addr_key_t g_key = {}; - go_addr_key_from_id(&g_key, goroutine_addr); - - void *tr = bpf_map_lookup_elem(&ongoing_grpc_operate_headers, &g_key); - bpf_dbg_printk("tr %llx", tr); - if (tr) { - grpc_transports_t *t = bpf_map_lookup_elem(&ongoing_grpc_transports, tr); - bpf_dbg_printk("t %llx", t); - if (t) { - void *fd_ptr = GO_PARAM1(ctx); - get_conn_info_from_fd(fd_ptr, &t->conn); // ok to not check the result, we leave it as 0 - } - } - - return 0; -} - // Handles finding the connection information for http2 servers in grpc SEC("uprobe/http2Server_operateHeaders") int uprobe_http2Server_operateHeaders(struct pt_regs *ctx) { diff --git a/bpf/go_nethttp.h b/bpf/go_nethttp.h index b09ccfe2b..532107f3d 100644 --- a/bpf/go_nethttp.h +++ b/bpf/go_nethttp.h @@ -912,18 +912,42 @@ int uprobe_netFdRead(struct pt_regs *ctx) { go_addr_key_t g_key = {}; go_addr_key_from_id(&g_key, goroutine_addr); + // lookup active HTTP connection connection_info_t *conn = bpf_map_lookup_elem(&ongoing_server_connections, &g_key); - if (conn) { - bpf_dbg_printk( - "Found existing server connection, parsing FD information for socket tuples, %llx", - goroutine_addr); - - void *fd_ptr = GO_PARAM1(ctx); - get_conn_info_from_fd(fd_ptr, conn); // ok to not check the result, we leave it as 0 + if (conn->d_port == 0 && conn->s_port == 0) { + bpf_dbg_printk( + "Found existing server connection, parsing FD information for socket tuples, %llx", + goroutine_addr); + void *fd_ptr = GO_PARAM1(ctx); + get_conn_info_from_fd(fd_ptr, conn); // ok to not check the result, we leave it as 0 + } //dbg_print_http_connection_info(conn); } + // lookup a grpc connection + // Sets up the connection info to be grabbed and mapped over the transport to operateHeaders + void *tr = bpf_map_lookup_elem(&ongoing_grpc_operate_headers, &g_key); + bpf_dbg_printk("tr %llx", tr); + if (tr) { + grpc_transports_t *t = bpf_map_lookup_elem(&ongoing_grpc_transports, tr); + bpf_dbg_printk("t %llx", t); + if (t) { + if (t->conn.d_port == 0 && t->conn.s_port == 0) { + void *fd_ptr = GO_PARAM1(ctx); + get_conn_info_from_fd(fd_ptr, + &t->conn); // ok to not check the result, we leave it as 0 + } + } + } + // lookup active sql connection + sql_func_invocation_t *sql_conn = bpf_map_lookup_elem(&ongoing_sql_queries, &g_key); + bpf_dbg_printk("sql_conn %llx", sql_conn); + if (sql_conn) { + void *fd_ptr = GO_PARAM1(ctx); + get_conn_info_from_fd(fd_ptr, + &sql_conn->conn); // ok to not check the result, we leave it as 0 + } return 0; } diff --git a/bpf/go_sql.h b/bpf/go_sql.h index 07dd1fb51..7b451d4fc 100644 --- a/bpf/go_sql.h +++ b/bpf/go_sql.h @@ -26,25 +26,11 @@ #include "go_common.h" #include "ringbuf.h" -typedef struct sql_func_invocation { - u64 start_monotime_ns; - u64 sql_param; - u64 query_len; - connection_info_t conn __attribute__((aligned(8))); - tp_info_t tp; -} sql_func_invocation_t; - -struct { - __uint(type, BPF_MAP_TYPE_LRU_HASH); - __type(key, go_addr_key_t); // key: pointer to the request goroutine - __type(value, sql_func_invocation_t); - __uint(max_entries, MAX_CONCURRENT_REQUESTS); -} ongoing_sql_queries SEC(".maps"); - static __always_inline void set_sql_info(void *goroutine_addr, void *sql_param, void *query_len) { sql_func_invocation_t invocation = {.start_monotime_ns = bpf_ktime_get_ns(), .sql_param = (u64)sql_param, .query_len = (u64)query_len, + .conn = {0}, .tp = {0}}; // We don't look up in the headers, no http/grpc request, therefore 0 as last argument @@ -67,42 +53,6 @@ int uprobe_queryDC(struct pt_regs *ctx) { void *sql_param = GO_PARAM8(ctx); void *query_len = GO_PARAM9(ctx); - off_table_t *ot = get_offsets_table(); - go_addr_key_t g_key = {}; - go_addr_key_from_id(&g_key, goroutine_addr); - - connection_info_t *existing = bpf_map_lookup_elem(&ongoing_server_connections, &g_key); - - if (!existing) { - void *c_ptr = GO_PARAM1(ctx); - if (c_ptr) { - void *conn_conn_ptr = - c_ptr + 8 + go_offset_of(ot, (go_offset){.v = _c_rwc_pos}); // embedded struct - void *tls_state = 0; - bpf_probe_read(&tls_state, - sizeof(tls_state), - (void *)(c_ptr + go_offset_of(ot, (go_offset){.v = _c_tls_pos}))); - conn_conn_ptr = unwrap_tls_conn_info(conn_conn_ptr, tls_state); - //bpf_dbg_printk("conn_conn_ptr %llx, tls_state %llx, c_tls_pos = %d, c_tls_ptr = %llx", conn_conn_ptr, tls_state, c_tls_pos, c_ptr + c_tls_pos); - if (conn_conn_ptr) { - void *conn_ptr = 0; - bpf_probe_read( - &conn_ptr, - sizeof(conn_ptr), - (void *)(conn_conn_ptr + - go_offset_of(ot, (go_offset){.v = _net_conn_pos}))); // find conn - bpf_dbg_printk("conn_ptr %llx", conn_ptr); - if (conn_ptr) { - connection_info_t conn = {0}; - get_conn_info( - conn_ptr, - &conn); // initialized to 0, no need to check the result if we succeeded - bpf_map_update_elem(&ongoing_server_connections, &g_key, &conn, BPF_ANY); - } - } - } - } - set_sql_info(goroutine_addr, sql_param, query_len); return 0; } @@ -156,20 +106,7 @@ int uprobe_queryReturn(struct pt_regs *ctx) { trace->sql[query_len] = 0; } - connection_info_t *info = bpf_map_lookup_elem(&ongoing_server_connections, &g_key); - - if (info) { - //dbg_print_http_connection_info(info); - __builtin_memcpy(&trace->conn, info, sizeof(connection_info_t)); - } else { - // We can't find the connection info, this typically means there are too many requests per second - // and the connection map is too small for the workload. - bpf_dbg_printk("Can't find connection info for %llx", goroutine_addr); - __builtin_memset(&trace->conn, 0, sizeof(connection_info_t)); - } - - // Server connections have opposite order, source port is the server port - swap_connection_info_order(&trace->conn); + __builtin_memcpy(&trace->conn, &invocation->conn, sizeof(connection_info_t)); // submit the completed trace via ringbuffer bpf_ringbuf_submit(trace, get_flags()); diff --git a/pkg/internal/ebpf/common/bpf_arm64_bpfel.o b/pkg/internal/ebpf/common/bpf_arm64_bpfel.o index 6556c24f6..5ad5e9c95 100644 --- a/pkg/internal/ebpf/common/bpf_arm64_bpfel.o +++ b/pkg/internal/ebpf/common/bpf_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b73865e52c411d74a5fb8b419c9ed7480c36f905e63dcc553ccba7b7ea6bb4ff -size 4416 +oid sha256:34d534081f766ad8d8e1ad3aa023b0160c094ad8169e0749992b08521734b822 +size 4432 diff --git a/pkg/internal/ebpf/common/bpf_x86_bpfel.o b/pkg/internal/ebpf/common/bpf_x86_bpfel.o index 6556c24f6..5ad5e9c95 100644 --- a/pkg/internal/ebpf/common/bpf_x86_bpfel.o +++ b/pkg/internal/ebpf/common/bpf_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b73865e52c411d74a5fb8b419c9ed7480c36f905e63dcc553ccba7b7ea6bb4ff -size 4416 +oid sha256:34d534081f766ad8d8e1ad3aa023b0160c094ad8169e0749992b08521734b822 +size 4432 diff --git a/pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.go b/pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.go index 02cde33cb..b0e13961f 100644 --- a/pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.go +++ b/pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.go @@ -229,7 +229,6 @@ type bpfProgramSpecs struct { UprobeHttp2ServerOperateHeaders *ebpf.ProgramSpec `ebpf:"uprobe_http2Server_operateHeaders"` UprobeHttp2serverConnRunHandler *ebpf.ProgramSpec `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.ProgramSpec `ebpf:"uprobe_netFdRead"` - UprobeNetFdReadGRPC *ebpf.ProgramSpec `ebpf:"uprobe_netFdReadGRPC"` UprobePersistConnRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_persistConnRoundTrip"` UprobeProcGoexit1 *ebpf.ProgramSpec `ebpf:"uprobe_proc_goexit1"` UprobeProcNewproc1 *ebpf.ProgramSpec `ebpf:"uprobe_proc_newproc1"` @@ -412,7 +411,6 @@ type bpfPrograms struct { UprobeHttp2ServerOperateHeaders *ebpf.Program `ebpf:"uprobe_http2Server_operateHeaders"` UprobeHttp2serverConnRunHandler *ebpf.Program `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.Program `ebpf:"uprobe_netFdRead"` - UprobeNetFdReadGRPC *ebpf.Program `ebpf:"uprobe_netFdReadGRPC"` UprobePersistConnRoundTrip *ebpf.Program `ebpf:"uprobe_persistConnRoundTrip"` UprobeProcGoexit1 *ebpf.Program `ebpf:"uprobe_proc_goexit1"` UprobeProcNewproc1 *ebpf.Program `ebpf:"uprobe_proc_newproc1"` @@ -468,7 +466,6 @@ func (p *bpfPrograms) Close() error { p.UprobeHttp2ServerOperateHeaders, p.UprobeHttp2serverConnRunHandler, p.UprobeNetFdRead, - p.UprobeNetFdReadGRPC, p.UprobePersistConnRoundTrip, p.UprobeProcGoexit1, p.UprobeProcNewproc1, diff --git a/pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.o index 6be6745fe..47430d683 100644 --- a/pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:071123225984f9740cd1fb793bd6dc642bb8086c6d4ffdf255983c72d9d769a8 -size 391560 +oid sha256:eff29edf6c7d97295378a49172e306b0a9f269f8d03b062bbebe7ea7e001b365 +size 398120 diff --git a/pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.go b/pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.go index 34c6e03cc..786390bb7 100644 --- a/pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.go +++ b/pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.go @@ -229,7 +229,6 @@ type bpf_debugProgramSpecs struct { UprobeHttp2ServerOperateHeaders *ebpf.ProgramSpec `ebpf:"uprobe_http2Server_operateHeaders"` UprobeHttp2serverConnRunHandler *ebpf.ProgramSpec `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.ProgramSpec `ebpf:"uprobe_netFdRead"` - UprobeNetFdReadGRPC *ebpf.ProgramSpec `ebpf:"uprobe_netFdReadGRPC"` UprobePersistConnRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_persistConnRoundTrip"` UprobeProcGoexit1 *ebpf.ProgramSpec `ebpf:"uprobe_proc_goexit1"` UprobeProcNewproc1 *ebpf.ProgramSpec `ebpf:"uprobe_proc_newproc1"` @@ -415,7 +414,6 @@ type bpf_debugPrograms struct { UprobeHttp2ServerOperateHeaders *ebpf.Program `ebpf:"uprobe_http2Server_operateHeaders"` UprobeHttp2serverConnRunHandler *ebpf.Program `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.Program `ebpf:"uprobe_netFdRead"` - UprobeNetFdReadGRPC *ebpf.Program `ebpf:"uprobe_netFdReadGRPC"` UprobePersistConnRoundTrip *ebpf.Program `ebpf:"uprobe_persistConnRoundTrip"` UprobeProcGoexit1 *ebpf.Program `ebpf:"uprobe_proc_goexit1"` UprobeProcNewproc1 *ebpf.Program `ebpf:"uprobe_proc_newproc1"` @@ -471,7 +469,6 @@ func (p *bpf_debugPrograms) Close() error { p.UprobeHttp2ServerOperateHeaders, p.UprobeHttp2serverConnRunHandler, p.UprobeNetFdRead, - p.UprobeNetFdReadGRPC, p.UprobePersistConnRoundTrip, p.UprobeProcGoexit1, p.UprobeProcNewproc1, diff --git a/pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.o index d3ce6ef36..beb05750d 100644 --- a/pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:111be7bb730eaeda13976aab671d34f6c61b3cecdfc57ac93e0c737e2c876922 -size 877992 +oid sha256:9dbfb1ba005c60f0b29fe9cbf8544d6e8146c26907865f0225c33f872d8c7881 +size 885760 diff --git a/pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.go b/pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.go index b7f336e4a..6a827dcc0 100644 --- a/pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.go +++ b/pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.go @@ -229,7 +229,6 @@ type bpf_debugProgramSpecs struct { UprobeHttp2ServerOperateHeaders *ebpf.ProgramSpec `ebpf:"uprobe_http2Server_operateHeaders"` UprobeHttp2serverConnRunHandler *ebpf.ProgramSpec `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.ProgramSpec `ebpf:"uprobe_netFdRead"` - UprobeNetFdReadGRPC *ebpf.ProgramSpec `ebpf:"uprobe_netFdReadGRPC"` UprobePersistConnRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_persistConnRoundTrip"` UprobeProcGoexit1 *ebpf.ProgramSpec `ebpf:"uprobe_proc_goexit1"` UprobeProcNewproc1 *ebpf.ProgramSpec `ebpf:"uprobe_proc_newproc1"` @@ -415,7 +414,6 @@ type bpf_debugPrograms struct { UprobeHttp2ServerOperateHeaders *ebpf.Program `ebpf:"uprobe_http2Server_operateHeaders"` UprobeHttp2serverConnRunHandler *ebpf.Program `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.Program `ebpf:"uprobe_netFdRead"` - UprobeNetFdReadGRPC *ebpf.Program `ebpf:"uprobe_netFdReadGRPC"` UprobePersistConnRoundTrip *ebpf.Program `ebpf:"uprobe_persistConnRoundTrip"` UprobeProcGoexit1 *ebpf.Program `ebpf:"uprobe_proc_goexit1"` UprobeProcNewproc1 *ebpf.Program `ebpf:"uprobe_proc_newproc1"` @@ -471,7 +469,6 @@ func (p *bpf_debugPrograms) Close() error { p.UprobeHttp2ServerOperateHeaders, p.UprobeHttp2serverConnRunHandler, p.UprobeNetFdRead, - p.UprobeNetFdReadGRPC, p.UprobePersistConnRoundTrip, p.UprobeProcGoexit1, p.UprobeProcNewproc1, diff --git a/pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.o index 36e6f6f49..d3067e3f3 100644 --- a/pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5f3edc0530c9670e71ba790450de591c938685c2dce61ab67618b0ae098be83e -size 879824 +oid sha256:d9e9be61b2385d2b03d899fcc7c3d5c9e61fa1cfb424592c2411abbcd21b4afc +size 887592 diff --git a/pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.go b/pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.go index 630d92afc..3091d0779 100644 --- a/pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.go +++ b/pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.go @@ -241,7 +241,6 @@ type bpf_tpProgramSpecs struct { UprobeHttp2ServerOperateHeaders *ebpf.ProgramSpec `ebpf:"uprobe_http2Server_operateHeaders"` UprobeHttp2serverConnRunHandler *ebpf.ProgramSpec `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.ProgramSpec `ebpf:"uprobe_netFdRead"` - UprobeNetFdReadGRPC *ebpf.ProgramSpec `ebpf:"uprobe_netFdReadGRPC"` UprobePersistConnRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_persistConnRoundTrip"` UprobeProcGoexit1 *ebpf.ProgramSpec `ebpf:"uprobe_proc_goexit1"` UprobeProcNewproc1 *ebpf.ProgramSpec `ebpf:"uprobe_proc_newproc1"` @@ -436,7 +435,6 @@ type bpf_tpPrograms struct { UprobeHttp2ServerOperateHeaders *ebpf.Program `ebpf:"uprobe_http2Server_operateHeaders"` UprobeHttp2serverConnRunHandler *ebpf.Program `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.Program `ebpf:"uprobe_netFdRead"` - UprobeNetFdReadGRPC *ebpf.Program `ebpf:"uprobe_netFdReadGRPC"` UprobePersistConnRoundTrip *ebpf.Program `ebpf:"uprobe_persistConnRoundTrip"` UprobeProcGoexit1 *ebpf.Program `ebpf:"uprobe_proc_goexit1"` UprobeProcNewproc1 *ebpf.Program `ebpf:"uprobe_proc_newproc1"` @@ -492,7 +490,6 @@ func (p *bpf_tpPrograms) Close() error { p.UprobeHttp2ServerOperateHeaders, p.UprobeHttp2serverConnRunHandler, p.UprobeNetFdRead, - p.UprobeNetFdReadGRPC, p.UprobePersistConnRoundTrip, p.UprobeProcGoexit1, p.UprobeProcNewproc1, diff --git a/pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.o index b3544290c..6b5657fe1 100644 --- a/pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:229e3c5cd2ee5e79bb620ed1e9f550cee7a053ccf996d4d4eadbeb4dfea4ca0c -size 438160 +oid sha256:9c4fbfd08163575e0f9d525b725e8ba5b1c8c39b01b2af549ae3098873b4736c +size 444720 diff --git a/pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.go b/pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.go index b2411ee0b..ae1edbfb0 100644 --- a/pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.go +++ b/pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.go @@ -241,7 +241,6 @@ type bpf_tp_debugProgramSpecs struct { UprobeHttp2ServerOperateHeaders *ebpf.ProgramSpec `ebpf:"uprobe_http2Server_operateHeaders"` UprobeHttp2serverConnRunHandler *ebpf.ProgramSpec `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.ProgramSpec `ebpf:"uprobe_netFdRead"` - UprobeNetFdReadGRPC *ebpf.ProgramSpec `ebpf:"uprobe_netFdReadGRPC"` UprobePersistConnRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_persistConnRoundTrip"` UprobeProcGoexit1 *ebpf.ProgramSpec `ebpf:"uprobe_proc_goexit1"` UprobeProcNewproc1 *ebpf.ProgramSpec `ebpf:"uprobe_proc_newproc1"` @@ -439,7 +438,6 @@ type bpf_tp_debugPrograms struct { UprobeHttp2ServerOperateHeaders *ebpf.Program `ebpf:"uprobe_http2Server_operateHeaders"` UprobeHttp2serverConnRunHandler *ebpf.Program `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.Program `ebpf:"uprobe_netFdRead"` - UprobeNetFdReadGRPC *ebpf.Program `ebpf:"uprobe_netFdReadGRPC"` UprobePersistConnRoundTrip *ebpf.Program `ebpf:"uprobe_persistConnRoundTrip"` UprobeProcGoexit1 *ebpf.Program `ebpf:"uprobe_proc_goexit1"` UprobeProcNewproc1 *ebpf.Program `ebpf:"uprobe_proc_newproc1"` @@ -495,7 +493,6 @@ func (p *bpf_tp_debugPrograms) Close() error { p.UprobeHttp2ServerOperateHeaders, p.UprobeHttp2serverConnRunHandler, p.UprobeNetFdRead, - p.UprobeNetFdReadGRPC, p.UprobePersistConnRoundTrip, p.UprobeProcGoexit1, p.UprobeProcNewproc1, diff --git a/pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.o index 1c7b34121..c91bdab8a 100644 --- a/pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d3fef143984a45c24843bf1d525db1a0da704f3a3d40b21d12f7320521cb2233 -size 975920 +oid sha256:1ff2e0f5ee2a31b1afbc37497fc0eebc1c995847df7dc11a0c889b21f292cdc7 +size 983680 diff --git a/pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.go b/pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.go index 67263cf3c..6c951f5d0 100644 --- a/pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.go +++ b/pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.go @@ -241,7 +241,6 @@ type bpf_tp_debugProgramSpecs struct { UprobeHttp2ServerOperateHeaders *ebpf.ProgramSpec `ebpf:"uprobe_http2Server_operateHeaders"` UprobeHttp2serverConnRunHandler *ebpf.ProgramSpec `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.ProgramSpec `ebpf:"uprobe_netFdRead"` - UprobeNetFdReadGRPC *ebpf.ProgramSpec `ebpf:"uprobe_netFdReadGRPC"` UprobePersistConnRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_persistConnRoundTrip"` UprobeProcGoexit1 *ebpf.ProgramSpec `ebpf:"uprobe_proc_goexit1"` UprobeProcNewproc1 *ebpf.ProgramSpec `ebpf:"uprobe_proc_newproc1"` @@ -439,7 +438,6 @@ type bpf_tp_debugPrograms struct { UprobeHttp2ServerOperateHeaders *ebpf.Program `ebpf:"uprobe_http2Server_operateHeaders"` UprobeHttp2serverConnRunHandler *ebpf.Program `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.Program `ebpf:"uprobe_netFdRead"` - UprobeNetFdReadGRPC *ebpf.Program `ebpf:"uprobe_netFdReadGRPC"` UprobePersistConnRoundTrip *ebpf.Program `ebpf:"uprobe_persistConnRoundTrip"` UprobeProcGoexit1 *ebpf.Program `ebpf:"uprobe_proc_goexit1"` UprobeProcNewproc1 *ebpf.Program `ebpf:"uprobe_proc_newproc1"` @@ -495,7 +493,6 @@ func (p *bpf_tp_debugPrograms) Close() error { p.UprobeHttp2ServerOperateHeaders, p.UprobeHttp2serverConnRunHandler, p.UprobeNetFdRead, - p.UprobeNetFdReadGRPC, p.UprobePersistConnRoundTrip, p.UprobeProcGoexit1, p.UprobeProcNewproc1, diff --git a/pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.o index 891e41066..b026e5109 100644 --- a/pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:58d88ce943d9b8efe56ba6f92af83a9c3c6cd263a61d8a4bddba41bbed8a83c5 -size 977744 +oid sha256:991c59999e1b34fad4fb85daf91a0bec4c04ef7f3cd9f35d1249f80b117327ce +size 985504 diff --git a/pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.go b/pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.go index b386e0b71..cdbb19a80 100644 --- a/pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.go +++ b/pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.go @@ -241,7 +241,6 @@ type bpf_tpProgramSpecs struct { UprobeHttp2ServerOperateHeaders *ebpf.ProgramSpec `ebpf:"uprobe_http2Server_operateHeaders"` UprobeHttp2serverConnRunHandler *ebpf.ProgramSpec `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.ProgramSpec `ebpf:"uprobe_netFdRead"` - UprobeNetFdReadGRPC *ebpf.ProgramSpec `ebpf:"uprobe_netFdReadGRPC"` UprobePersistConnRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_persistConnRoundTrip"` UprobeProcGoexit1 *ebpf.ProgramSpec `ebpf:"uprobe_proc_goexit1"` UprobeProcNewproc1 *ebpf.ProgramSpec `ebpf:"uprobe_proc_newproc1"` @@ -436,7 +435,6 @@ type bpf_tpPrograms struct { UprobeHttp2ServerOperateHeaders *ebpf.Program `ebpf:"uprobe_http2Server_operateHeaders"` UprobeHttp2serverConnRunHandler *ebpf.Program `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.Program `ebpf:"uprobe_netFdRead"` - UprobeNetFdReadGRPC *ebpf.Program `ebpf:"uprobe_netFdReadGRPC"` UprobePersistConnRoundTrip *ebpf.Program `ebpf:"uprobe_persistConnRoundTrip"` UprobeProcGoexit1 *ebpf.Program `ebpf:"uprobe_proc_goexit1"` UprobeProcNewproc1 *ebpf.Program `ebpf:"uprobe_proc_newproc1"` @@ -492,7 +490,6 @@ func (p *bpf_tpPrograms) Close() error { p.UprobeHttp2ServerOperateHeaders, p.UprobeHttp2serverConnRunHandler, p.UprobeNetFdRead, - p.UprobeNetFdReadGRPC, p.UprobePersistConnRoundTrip, p.UprobeProcGoexit1, p.UprobeProcNewproc1, diff --git a/pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.o index 6fa40288e..cd6a3026f 100644 --- a/pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a24461d952bb1600eb072e7f53826042aa80bdef774520dd431fd8daa50bd1aa -size 439920 +oid sha256:795a1d9533f2f3b0671d253f7a7cdcaa035f247952e0515ec2eea9a7e88d8d29 +size 446480 diff --git a/pkg/internal/ebpf/gotracer/bpf_x86_bpfel.go b/pkg/internal/ebpf/gotracer/bpf_x86_bpfel.go index 56055593c..55ab40ae0 100644 --- a/pkg/internal/ebpf/gotracer/bpf_x86_bpfel.go +++ b/pkg/internal/ebpf/gotracer/bpf_x86_bpfel.go @@ -229,7 +229,6 @@ type bpfProgramSpecs struct { UprobeHttp2ServerOperateHeaders *ebpf.ProgramSpec `ebpf:"uprobe_http2Server_operateHeaders"` UprobeHttp2serverConnRunHandler *ebpf.ProgramSpec `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.ProgramSpec `ebpf:"uprobe_netFdRead"` - UprobeNetFdReadGRPC *ebpf.ProgramSpec `ebpf:"uprobe_netFdReadGRPC"` UprobePersistConnRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_persistConnRoundTrip"` UprobeProcGoexit1 *ebpf.ProgramSpec `ebpf:"uprobe_proc_goexit1"` UprobeProcNewproc1 *ebpf.ProgramSpec `ebpf:"uprobe_proc_newproc1"` @@ -412,7 +411,6 @@ type bpfPrograms struct { UprobeHttp2ServerOperateHeaders *ebpf.Program `ebpf:"uprobe_http2Server_operateHeaders"` UprobeHttp2serverConnRunHandler *ebpf.Program `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.Program `ebpf:"uprobe_netFdRead"` - UprobeNetFdReadGRPC *ebpf.Program `ebpf:"uprobe_netFdReadGRPC"` UprobePersistConnRoundTrip *ebpf.Program `ebpf:"uprobe_persistConnRoundTrip"` UprobeProcGoexit1 *ebpf.Program `ebpf:"uprobe_proc_goexit1"` UprobeProcNewproc1 *ebpf.Program `ebpf:"uprobe_proc_newproc1"` @@ -468,7 +466,6 @@ func (p *bpfPrograms) Close() error { p.UprobeHttp2ServerOperateHeaders, p.UprobeHttp2serverConnRunHandler, p.UprobeNetFdRead, - p.UprobeNetFdReadGRPC, p.UprobePersistConnRoundTrip, p.UprobeProcGoexit1, p.UprobeProcNewproc1, diff --git a/pkg/internal/ebpf/gotracer/bpf_x86_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_x86_bpfel.o index c9d733907..f994bf962 100644 --- a/pkg/internal/ebpf/gotracer/bpf_x86_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0bf98c268e2dc35a9bdd74152f3b4b8f7e739df8b2ed1cdf6eb6d1681c0892c0 -size 393392 +oid sha256:6e68460db9ca75b69d56d154c3d8564ba6ef359432a002f9b51524379cddcfee +size 399952 diff --git a/pkg/internal/ebpf/gotracer/gotracer.go b/pkg/internal/ebpf/gotracer/gotracer.go index a29559920..54f9d6112 100644 --- a/pkg/internal/ebpf/gotracer/gotracer.go +++ b/pkg/internal/ebpf/gotracer/gotracer.go @@ -227,9 +227,6 @@ func (p *Tracer) GoProbes() map[string][]ebpfcommon.FunctionPrograms { { Start: p.bpfObjects.UprobeNetFdRead, }, - { // for grpc - Start: p.bpfObjects.UprobeNetFdReadGRPC, - }, }, "net/http.(*persistConn).roundTrip": {{ // http client Start: p.bpfObjects.UprobePersistConnRoundTrip, From 233fd32e03fb1ec13206315118614ada52235ff0 Mon Sep 17 00:00:00 2001 From: Mario Macias Date: Thu, 17 Oct 2024 10:02:34 +0200 Subject: [PATCH 4/7] Use informer code from beyla-k8s-cache (#1256) * simplifying informer and use k8s-cache one * Going on with refactoring * fix k8s test * changes compiling despite not passing unit tests * passed watcher_kube_test * Unit tests passing * some fixes * Fixed race condition in k8s initialization code * Fix formatting * Fix linting * Fix linting and some race conditions in tests * fix linting * Fix goimports-reviser * fix checkfmt * amend resplicaset testing * Improve watcher kube enricher test * temptative fix to a race condition that prevented kube finder pipeline to start * Fixed watcherkubeenricher * Reverted go.mod replacement * fix compilation error * fixed all tests * Implemented multiple owners * reworked code and added some comments * update vendor * Fix wrong context cancellation * Adding rafael's comments --- Makefile | 6 +- go.mod | 4 +- go.sum | 4 +- pkg/components/beyla.go | 5 - pkg/internal/appolly/appolly.go | 14 +- pkg/internal/discover/attacher.go | 3 +- pkg/internal/discover/container_updater.go | 22 +- pkg/internal/discover/finder.go | 3 +- pkg/internal/discover/watcher_kube.go | 155 +- pkg/internal/discover/watcher_kube_test.go | 228 +-- pkg/internal/kube/cni/ovn_kubernetes_test.go | 55 - pkg/internal/kube/informer.go | 330 ---- pkg/internal/kube/informer_ip.go | 200 -- pkg/internal/kube/informer_provider.go | 130 +- pkg/internal/kube/informer_test.go | 38 - pkg/internal/kube/informer_type.go | 25 - pkg/internal/kube/informer_type_test.go | 21 - pkg/internal/kube/owner.go | 105 - pkg/internal/kube/owner_test.go | 93 - pkg/internal/kube/owners.go | 15 + pkg/internal/kube/store.go | 199 ++ .../netolly/transform/k8s/kubernetes.go | 29 +- pkg/internal/pipe/global/context.go | 3 - pkg/internal/pipe/instrumenter.go | 2 +- pkg/internal/transform/kube/db.go | 293 --- pkg/internal/transform/kube/db_test.go | 61 - pkg/transform/k8s.go | 91 +- pkg/transform/k8s_test.go | 93 +- pkg/transform/name_resolver.go | 33 +- pkg/transform/name_resolver_test.go | 143 +- .../old_grpc/backend/cmd/backend/main.go | 1 - .../old_grpc/worker/cmd/worker/main.go | 3 +- .../grafana/beyla-k8s-cache/LICENSE | 201 ++ .../pkg/informer/informer.pb.go | 511 +++++ .../pkg/informer/informer_grpc.pb.go | 130 ++ .../pkg/meta}/cni/ovn_kubernetes.go | 0 .../beyla-k8s-cache/pkg/meta/informers.go | 43 + .../pkg/meta/informers_init.go | 308 +++ .../beyla-k8s-cache/pkg/meta/observer.go | 49 + .../grafana/beyla-k8s-cache/pkg/meta/types.go | 41 + .../gopkg.in/evanphx/json-patch.v4/.gitignore | 6 - vendor/gopkg.in/evanphx/json-patch.v4/LICENSE | 25 - .../gopkg.in/evanphx/json-patch.v4/README.md | 317 --- .../gopkg.in/evanphx/json-patch.v4/errors.go | 38 - .../gopkg.in/evanphx/json-patch.v4/merge.go | 389 ---- .../gopkg.in/evanphx/json-patch.v4/patch.go | 851 -------- vendor/k8s.io/api/imagepolicy/v1alpha1/doc.go | 23 - .../api/imagepolicy/v1alpha1/generated.pb.go | 1374 ------------- .../api/imagepolicy/v1alpha1/generated.proto | 89 - .../api/imagepolicy/v1alpha1/register.go | 51 - .../k8s.io/api/imagepolicy/v1alpha1/types.go | 83 - .../v1alpha1/types_swagger_doc_generated.go | 72 - .../v1alpha1/zz_generated.deepcopy.go | 121 -- .../meta/testrestmapper/test_restmapper.go | 165 -- .../client-go/applyconfigurations/OWNERS | 5 - .../client-go/applyconfigurations/doc.go | 151 -- .../imagepolicy/v1alpha1/imagereview.go | 262 --- .../v1alpha1/imagereviewcontainerspec.go | 39 - .../imagepolicy/v1alpha1/imagereviewspec.go | 68 - .../imagepolicy/v1alpha1/imagereviewstatus.go | 63 - .../client-go/applyconfigurations/utils.go | 1740 ----------------- .../client-go/discovery/fake/discovery.go | 180 -- .../kubernetes/fake/clientset_generated.go | 486 ----- .../k8s.io/client-go/kubernetes/fake/doc.go | 20 - .../client-go/kubernetes/fake/register.go | 160 -- .../admissionregistration/v1/fake/doc.go | 20 - .../fake/fake_admissionregistration_client.go | 52 - .../fake/fake_mutatingwebhookconfiguration.go | 151 -- .../v1/fake/fake_validatingadmissionpolicy.go | 186 -- .../fake_validatingadmissionpolicybinding.go | 151 -- .../fake_validatingwebhookconfiguration.go | 151 -- .../v1alpha1/fake/doc.go | 20 - .../fake/fake_admissionregistration_client.go | 44 - .../fake/fake_validatingadmissionpolicy.go | 186 -- .../fake_validatingadmissionpolicybinding.go | 151 -- .../admissionregistration/v1beta1/fake/doc.go | 20 - .../fake/fake_admissionregistration_client.go | 52 - .../fake/fake_mutatingwebhookconfiguration.go | 151 -- .../fake/fake_validatingadmissionpolicy.go | 186 -- .../fake_validatingadmissionpolicybinding.go | 151 -- .../fake_validatingwebhookconfiguration.go | 151 -- .../apiserverinternal/v1alpha1/fake/doc.go | 20 - .../fake/fake_apiserverinternal_client.go | 40 - .../v1alpha1/fake/fake_storageversion.go | 186 -- .../kubernetes/typed/apps/v1/fake/doc.go | 20 - .../typed/apps/v1/fake/fake_apps_client.go | 56 - .../apps/v1/fake/fake_controllerrevision.go | 160 -- .../typed/apps/v1/fake/fake_daemonset.go | 197 -- .../typed/apps/v1/fake/fake_deployment.go | 243 --- .../typed/apps/v1/fake/fake_replicaset.go | 243 --- .../typed/apps/v1/fake/fake_statefulset.go | 243 --- .../kubernetes/typed/apps/v1beta1/fake/doc.go | 20 - .../apps/v1beta1/fake/fake_apps_client.go | 48 - .../v1beta1/fake/fake_controllerrevision.go | 160 -- .../apps/v1beta1/fake/fake_deployment.go | 197 -- .../apps/v1beta1/fake/fake_statefulset.go | 197 -- .../kubernetes/typed/apps/v1beta2/fake/doc.go | 20 - .../apps/v1beta2/fake/fake_apps_client.go | 56 - .../v1beta2/fake/fake_controllerrevision.go | 160 -- .../typed/apps/v1beta2/fake/fake_daemonset.go | 197 -- .../apps/v1beta2/fake/fake_deployment.go | 197 -- .../apps/v1beta2/fake/fake_replicaset.go | 197 -- .../apps/v1beta2/fake/fake_statefulset.go | 241 --- .../typed/authentication/v1/fake/doc.go | 20 - .../v1/fake/fake_authentication_client.go | 44 - .../v1/fake/fake_selfsubjectreview.go | 47 - .../v1/fake/fake_tokenreview.go | 47 - .../typed/authentication/v1alpha1/fake/doc.go | 20 - .../fake/fake_authentication_client.go | 40 - .../v1alpha1/fake/fake_selfsubjectreview.go | 47 - .../typed/authentication/v1beta1/fake/doc.go | 20 - .../fake/fake_authentication_client.go | 44 - .../v1beta1/fake/fake_selfsubjectreview.go | 47 - .../v1beta1/fake/fake_tokenreview.go | 47 - .../typed/authorization/v1/fake/doc.go | 20 - .../v1/fake/fake_authorization_client.go | 52 - .../v1/fake/fake_localsubjectaccessreview.go | 49 - .../v1/fake/fake_selfsubjectaccessreview.go | 47 - .../v1/fake/fake_selfsubjectrulesreview.go | 47 - .../v1/fake/fake_subjectaccessreview.go | 47 - .../typed/authorization/v1beta1/fake/doc.go | 20 - .../v1beta1/fake/fake_authorization_client.go | 52 - .../fake/fake_localsubjectaccessreview.go | 49 - .../fake/fake_selfsubjectaccessreview.go | 47 - .../fake/fake_selfsubjectrulesreview.go | 47 - .../v1beta1/fake/fake_subjectaccessreview.go | 47 - .../typed/autoscaling/v1/fake/doc.go | 20 - .../v1/fake/fake_autoscaling_client.go | 40 - .../v1/fake/fake_horizontalpodautoscaler.go | 197 -- .../typed/autoscaling/v2/fake/doc.go | 20 - .../v2/fake/fake_autoscaling_client.go | 40 - .../v2/fake/fake_horizontalpodautoscaler.go | 197 -- .../typed/autoscaling/v2beta1/fake/doc.go | 20 - .../v2beta1/fake/fake_autoscaling_client.go | 40 - .../fake/fake_horizontalpodautoscaler.go | 197 -- .../typed/autoscaling/v2beta2/fake/doc.go | 20 - .../v2beta2/fake/fake_autoscaling_client.go | 40 - .../fake/fake_horizontalpodautoscaler.go | 197 -- .../kubernetes/typed/batch/v1/fake/doc.go | 20 - .../typed/batch/v1/fake/fake_batch_client.go | 44 - .../typed/batch/v1/fake/fake_cronjob.go | 197 -- .../typed/batch/v1/fake/fake_job.go | 197 -- .../typed/batch/v1beta1/fake/doc.go | 20 - .../batch/v1beta1/fake/fake_batch_client.go | 40 - .../typed/batch/v1beta1/fake/fake_cronjob.go | 197 -- .../typed/certificates/v1/fake/doc.go | 20 - .../v1/fake/fake_certificates_client.go | 40 - .../v1/fake/fake_certificatesigningrequest.go | 197 -- .../typed/certificates/v1alpha1/fake/doc.go | 20 - .../v1alpha1/fake/fake_certificates_client.go | 40 - .../v1alpha1/fake/fake_clustertrustbundle.go | 151 -- .../typed/certificates/v1beta1/fake/doc.go | 20 - .../v1beta1/fake/fake_certificates_client.go | 40 - .../fake/fake_certificatesigningrequest.go | 186 -- ...ake_certificatesigningrequest_expansion.go | 34 - .../typed/coordination/v1/fake/doc.go | 20 - .../v1/fake/fake_coordination_client.go | 40 - .../typed/coordination/v1/fake/fake_lease.go | 160 -- .../typed/coordination/v1alpha1/fake/doc.go | 20 - .../v1alpha1/fake/fake_coordination_client.go | 40 - .../v1alpha1/fake/fake_leasecandidate.go | 160 -- .../typed/coordination/v1beta1/fake/doc.go | 20 - .../v1beta1/fake/fake_coordination_client.go | 40 - .../coordination/v1beta1/fake/fake_lease.go | 160 -- .../kubernetes/typed/core/v1/fake/doc.go | 20 - .../core/v1/fake/fake_componentstatus.go | 151 -- .../typed/core/v1/fake/fake_configmap.go | 160 -- .../typed/core/v1/fake/fake_core_client.go | 100 - .../typed/core/v1/fake/fake_endpoints.go | 160 -- .../typed/core/v1/fake/fake_event.go | 160 -- .../core/v1/fake/fake_event_expansion.go | 101 - .../typed/core/v1/fake/fake_limitrange.go | 160 -- .../typed/core/v1/fake/fake_namespace.go | 178 -- .../core/v1/fake/fake_namespace_expansion.go | 40 - .../typed/core/v1/fake/fake_node.go | 186 -- .../typed/core/v1/fake/fake_node_expansion.go | 38 - .../core/v1/fake/fake_persistentvolume.go | 186 -- .../v1/fake/fake_persistentvolumeclaim.go | 197 -- .../kubernetes/typed/core/v1/fake/fake_pod.go | 209 -- .../typed/core/v1/fake/fake_pod_expansion.go | 112 -- .../typed/core/v1/fake/fake_podtemplate.go | 160 -- .../v1/fake/fake_replicationcontroller.go | 222 --- .../typed/core/v1/fake/fake_resourcequota.go | 197 -- .../typed/core/v1/fake/fake_secret.go | 160 -- .../typed/core/v1/fake/fake_service.go | 189 -- .../core/v1/fake/fake_service_expansion.go | 26 - .../typed/core/v1/fake/fake_serviceaccount.go | 173 -- .../kubernetes/typed/discovery/v1/fake/doc.go | 20 - .../v1/fake/fake_discovery_client.go | 40 - .../discovery/v1/fake/fake_endpointslice.go | 160 -- .../typed/discovery/v1beta1/fake/doc.go | 20 - .../v1beta1/fake/fake_discovery_client.go | 40 - .../v1beta1/fake/fake_endpointslice.go | 160 -- .../kubernetes/typed/events/v1/fake/doc.go | 20 - .../typed/events/v1/fake/fake_event.go | 160 -- .../events/v1/fake/fake_events_client.go | 40 - .../typed/events/v1beta1/fake/doc.go | 20 - .../typed/events/v1beta1/fake/fake_event.go | 160 -- .../v1beta1/fake/fake_event_expansion.go | 66 - .../events/v1beta1/fake/fake_events_client.go | 40 - .../typed/extensions/v1beta1/fake/doc.go | 20 - .../extensions/v1beta1/fake/fake_daemonset.go | 197 -- .../v1beta1/fake/fake_deployment.go | 241 --- .../v1beta1/fake/fake_deployment_expansion.go | 36 - .../v1beta1/fake/fake_extensions_client.go | 56 - .../extensions/v1beta1/fake/fake_ingress.go | 197 -- .../v1beta1/fake/fake_networkpolicy.go | 160 -- .../v1beta1/fake/fake_replicaset.go | 241 --- .../typed/flowcontrol/v1/fake/doc.go | 20 - .../v1/fake/fake_flowcontrol_client.go | 44 - .../flowcontrol/v1/fake/fake_flowschema.go | 186 -- .../fake/fake_prioritylevelconfiguration.go | 186 -- .../typed/flowcontrol/v1beta1/fake/doc.go | 20 - .../v1beta1/fake/fake_flowcontrol_client.go | 44 - .../v1beta1/fake/fake_flowschema.go | 186 -- .../fake/fake_prioritylevelconfiguration.go | 186 -- .../typed/flowcontrol/v1beta2/fake/doc.go | 20 - .../v1beta2/fake/fake_flowcontrol_client.go | 44 - .../v1beta2/fake/fake_flowschema.go | 186 -- .../fake/fake_prioritylevelconfiguration.go | 186 -- .../typed/flowcontrol/v1beta3/fake/doc.go | 20 - .../v1beta3/fake/fake_flowcontrol_client.go | 44 - .../v1beta3/fake/fake_flowschema.go | 186 -- .../fake/fake_prioritylevelconfiguration.go | 186 -- .../typed/networking/v1/fake/doc.go | 20 - .../typed/networking/v1/fake/fake_ingress.go | 197 -- .../networking/v1/fake/fake_ingressclass.go | 151 -- .../v1/fake/fake_networking_client.go | 48 - .../networking/v1/fake/fake_networkpolicy.go | 160 -- .../typed/networking/v1alpha1/fake/doc.go | 20 - .../v1alpha1/fake/fake_ipaddress.go | 151 -- .../v1alpha1/fake/fake_networking_client.go | 44 - .../v1alpha1/fake/fake_servicecidr.go | 186 -- .../typed/networking/v1beta1/fake/doc.go | 20 - .../networking/v1beta1/fake/fake_ingress.go | 197 -- .../v1beta1/fake/fake_ingressclass.go | 151 -- .../networking/v1beta1/fake/fake_ipaddress.go | 151 -- .../v1beta1/fake/fake_networking_client.go | 52 - .../v1beta1/fake/fake_servicecidr.go | 186 -- .../kubernetes/typed/node/v1/fake/doc.go | 20 - .../typed/node/v1/fake/fake_node_client.go | 40 - .../typed/node/v1/fake/fake_runtimeclass.go | 151 -- .../typed/node/v1alpha1/fake/doc.go | 20 - .../node/v1alpha1/fake/fake_node_client.go | 40 - .../node/v1alpha1/fake/fake_runtimeclass.go | 151 -- .../kubernetes/typed/node/v1beta1/fake/doc.go | 20 - .../node/v1beta1/fake/fake_node_client.go | 40 - .../node/v1beta1/fake/fake_runtimeclass.go | 151 -- .../kubernetes/typed/policy/v1/fake/doc.go | 20 - .../typed/policy/v1/fake/fake_eviction.go | 25 - .../policy/v1/fake/fake_eviction_expansion.go | 37 - .../v1/fake/fake_poddisruptionbudget.go | 197 -- .../policy/v1/fake/fake_policy_client.go | 44 - .../typed/policy/v1beta1/fake/doc.go | 20 - .../policy/v1beta1/fake/fake_eviction.go | 25 - .../v1beta1/fake/fake_eviction_expansion.go | 37 - .../v1beta1/fake/fake_poddisruptionbudget.go | 197 -- .../policy/v1beta1/fake/fake_policy_client.go | 44 - .../kubernetes/typed/rbac/v1/fake/doc.go | 20 - .../typed/rbac/v1/fake/fake_clusterrole.go | 151 -- .../rbac/v1/fake/fake_clusterrolebinding.go | 151 -- .../typed/rbac/v1/fake/fake_rbac_client.go | 52 - .../typed/rbac/v1/fake/fake_role.go | 160 -- .../typed/rbac/v1/fake/fake_rolebinding.go | 160 -- .../typed/rbac/v1alpha1/fake/doc.go | 20 - .../rbac/v1alpha1/fake/fake_clusterrole.go | 151 -- .../v1alpha1/fake/fake_clusterrolebinding.go | 151 -- .../rbac/v1alpha1/fake/fake_rbac_client.go | 52 - .../typed/rbac/v1alpha1/fake/fake_role.go | 160 -- .../rbac/v1alpha1/fake/fake_rolebinding.go | 160 -- .../kubernetes/typed/rbac/v1beta1/fake/doc.go | 20 - .../rbac/v1beta1/fake/fake_clusterrole.go | 151 -- .../v1beta1/fake/fake_clusterrolebinding.go | 151 -- .../rbac/v1beta1/fake/fake_rbac_client.go | 52 - .../typed/rbac/v1beta1/fake/fake_role.go | 160 -- .../rbac/v1beta1/fake/fake_rolebinding.go | 160 -- .../typed/resource/v1alpha3/fake/doc.go | 20 - .../v1alpha3/fake/fake_deviceclass.go | 151 -- .../fake/fake_podschedulingcontext.go | 197 -- .../v1alpha3/fake/fake_resource_client.go | 56 - .../v1alpha3/fake/fake_resourceclaim.go | 197 -- .../fake/fake_resourceclaimtemplate.go | 160 -- .../v1alpha3/fake/fake_resourceslice.go | 151 -- .../typed/scheduling/v1/fake/doc.go | 20 - .../scheduling/v1/fake/fake_priorityclass.go | 151 -- .../v1/fake/fake_scheduling_client.go | 40 - .../typed/scheduling/v1alpha1/fake/doc.go | 20 - .../v1alpha1/fake/fake_priorityclass.go | 151 -- .../v1alpha1/fake/fake_scheduling_client.go | 40 - .../typed/scheduling/v1beta1/fake/doc.go | 20 - .../v1beta1/fake/fake_priorityclass.go | 151 -- .../v1beta1/fake/fake_scheduling_client.go | 40 - .../kubernetes/typed/storage/v1/fake/doc.go | 20 - .../typed/storage/v1/fake/fake_csidriver.go | 151 -- .../typed/storage/v1/fake/fake_csinode.go | 151 -- .../v1/fake/fake_csistoragecapacity.go | 160 -- .../storage/v1/fake/fake_storage_client.go | 56 - .../storage/v1/fake/fake_storageclass.go | 151 -- .../storage/v1/fake/fake_volumeattachment.go | 186 -- .../typed/storage/v1alpha1/fake/doc.go | 20 - .../v1alpha1/fake/fake_csistoragecapacity.go | 160 -- .../v1alpha1/fake/fake_storage_client.go | 48 - .../v1alpha1/fake/fake_volumeattachment.go | 186 -- .../fake/fake_volumeattributesclass.go | 151 -- .../typed/storage/v1beta1/fake/doc.go | 20 - .../storage/v1beta1/fake/fake_csidriver.go | 151 -- .../storage/v1beta1/fake/fake_csinode.go | 151 -- .../v1beta1/fake/fake_csistoragecapacity.go | 160 -- .../v1beta1/fake/fake_storage_client.go | 60 - .../storage/v1beta1/fake/fake_storageclass.go | 151 -- .../v1beta1/fake/fake_volumeattachment.go | 186 -- .../fake/fake_volumeattributesclass.go | 151 -- .../storagemigration/v1alpha1/fake/doc.go | 20 - .../fake/fake_storagemigration_client.go | 40 - .../fake/fake_storageversionmigration.go | 186 -- vendor/k8s.io/client-go/rest/fake/fake.go | 118 -- vendor/k8s.io/client-go/testing/actions.go | 897 --------- vendor/k8s.io/client-go/testing/fake.go | 220 --- vendor/k8s.io/client-go/testing/fixture.go | 1005 ---------- vendor/k8s.io/client-go/testing/interface.go | 66 - vendor/modules.txt | 69 +- 321 files changed, 2040 insertions(+), 36321 deletions(-) delete mode 100644 pkg/internal/kube/cni/ovn_kubernetes_test.go delete mode 100644 pkg/internal/kube/informer.go delete mode 100644 pkg/internal/kube/informer_ip.go delete mode 100644 pkg/internal/kube/informer_test.go delete mode 100644 pkg/internal/kube/informer_type.go delete mode 100644 pkg/internal/kube/informer_type_test.go delete mode 100644 pkg/internal/kube/owner.go delete mode 100644 pkg/internal/kube/owner_test.go create mode 100644 pkg/internal/kube/owners.go create mode 100644 pkg/internal/kube/store.go delete mode 100644 pkg/internal/transform/kube/db.go delete mode 100644 pkg/internal/transform/kube/db_test.go create mode 100644 vendor/github.com/grafana/beyla-k8s-cache/LICENSE create mode 100644 vendor/github.com/grafana/beyla-k8s-cache/pkg/informer/informer.pb.go create mode 100644 vendor/github.com/grafana/beyla-k8s-cache/pkg/informer/informer_grpc.pb.go rename {pkg/internal/kube => vendor/github.com/grafana/beyla-k8s-cache/pkg/meta}/cni/ovn_kubernetes.go (100%) create mode 100644 vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/informers.go create mode 100644 vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/informers_init.go create mode 100644 vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/observer.go create mode 100644 vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/types.go delete mode 100644 vendor/gopkg.in/evanphx/json-patch.v4/.gitignore delete mode 100644 vendor/gopkg.in/evanphx/json-patch.v4/LICENSE delete mode 100644 vendor/gopkg.in/evanphx/json-patch.v4/README.md delete mode 100644 vendor/gopkg.in/evanphx/json-patch.v4/errors.go delete mode 100644 vendor/gopkg.in/evanphx/json-patch.v4/merge.go delete mode 100644 vendor/gopkg.in/evanphx/json-patch.v4/patch.go delete mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/doc.go delete mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/generated.pb.go delete mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/generated.proto delete mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/register.go delete mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/types.go delete mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/types_swagger_doc_generated.go delete mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/apimachinery/pkg/api/meta/testrestmapper/test_restmapper.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/OWNERS delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/doc.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereview.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewcontainerspec.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewspec.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewstatus.go delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/utils.go delete mode 100644 vendor/k8s.io/client-go/discovery/fake/discovery.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/fake/register.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_admissionregistration_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_mutatingwebhookconfiguration.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicy.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicybinding.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_validatingwebhookconfiguration.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicy.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicybinding.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_admissionregistration_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicy.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicybinding.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/fake/fake_apiserverinternal_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/fake/fake_storageversion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_apps_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_daemonset.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_apps_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_apps_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_authentication_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_selfsubjectreview.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake/fake_authentication_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake/fake_selfsubjectreview.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_authentication_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_selfsubjectreview.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_authorization_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_authorization_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_autoscaling_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2/fake/fake_autoscaling_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2/fake/fake_horizontalpodautoscaler.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_autoscaling_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/fake_autoscaling_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/fake_horizontalpodautoscaler.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_batch_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_cronjob.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_batch_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/fake/fake_certificates_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/fake/fake_certificatesigningrequest.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificates_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_clustertrustbundle.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificates_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/fake/fake_coordination_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/fake/fake_lease.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha1/fake/fake_coordination_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha1/fake/fake_leasecandidate.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_coordination_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_lease.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_core_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/discovery/v1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/discovery/v1/fake/fake_discovery_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/discovery/v1/fake/fake_endpointslice.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake/fake_discovery_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake/fake_endpointslice.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/events/v1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/events/v1/fake/fake_event.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/events/v1/fake/fake_events_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_events_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_extensions_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_networkpolicy.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowcontrol_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowschema.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake/fake_flowcontrol_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake/fake_flowschema.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake/fake_prioritylevelconfiguration.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake/fake_flowcontrol_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake/fake_flowschema.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake/fake_prioritylevelconfiguration.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowcontrol_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowschema.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/fake_prioritylevelconfiguration.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_ingress.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_ingressclass.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networking_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_ipaddress.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_networking_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_servicecidr.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ingress.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ingressclass.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ipaddress.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_networking_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_servicecidr.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/node/v1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/node/v1/fake/fake_node_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/node/v1/fake/fake_runtimeclass.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake/fake_node_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake/fake_runtimeclass.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/fake/fake_node_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/fake/fake_runtimeclass.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_eviction.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_eviction_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_poddisruptionbudget.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_policy_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_eviction.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_eviction_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rbac_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_role.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rbac_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rbac_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_role.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_deviceclass.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_podschedulingcontext.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resource_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaim.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaimtemplate.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceslice.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/fake/fake_priorityclass.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/fake/fake_scheduling_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_scheduling_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake/fake_priorityclass.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake/fake_scheduling_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_csidriver.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_csinode.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_csistoragecapacity.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_csistoragecapacity.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_storage_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattributesclass.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csidriver.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csinode.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csistoragecapacity.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_volumeattributesclass.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/fake/doc.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storagemigration_client.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storageversionmigration.go delete mode 100644 vendor/k8s.io/client-go/rest/fake/fake.go delete mode 100644 vendor/k8s.io/client-go/testing/actions.go delete mode 100644 vendor/k8s.io/client-go/testing/fake.go delete mode 100644 vendor/k8s.io/client-go/testing/fixture.go delete mode 100644 vendor/k8s.io/client-go/testing/interface.go diff --git a/Makefile b/Makefile index a1fb67a5e..b9900a4b5 100644 --- a/Makefile +++ b/Makefile @@ -91,9 +91,11 @@ KIND = $(TOOLS_DIR)/kind DASHBOARD_LINTER = $(TOOLS_DIR)/dashboard-linter GINKGO = $(TOOLS_DIR)/ginkgo +GOIMPORTS_REVISER_ARGS = -company-prefixes github.com/grafana -project-name github.com/grafana/beyla/ + define check_format $(shell $(foreach FILE, $(shell find . -name "*.go" -not -path "**/vendor/*"), \ - $(GOIMPORTS_REVISER) -company-prefixes github.com/grafana -list-diff -output stdout $(FILE);)) + $(GOIMPORTS_REVISER) $(GOIMPORTS_REVISER_ARGS) -list-diff -output stdout $(FILE);)) endef @@ -121,7 +123,7 @@ prereqs: install-hooks fmt: prereqs @echo "### Formatting code and fixing imports" @$(foreach FILE, $(shell find . -name "*.go" -not -path "**/vendor/*"), \ - $(GOIMPORTS_REVISER) -company-prefixes github.com/grafana $(FILE);) + $(GOIMPORTS_REVISER) $(GOIMPORTS_REVISER_ARGS) $(FILE);) .PHONY: checkfmt checkfmt: diff --git a/go.mod b/go.mod index 267bd4ede..caef4369e 100644 --- a/go.mod +++ b/go.mod @@ -13,6 +13,7 @@ require ( github.com/goccy/go-json v0.10.2 github.com/google/uuid v1.6.0 github.com/gorilla/mux v1.8.1 + github.com/grafana/beyla-k8s-cache v0.0.0-20241016170428-8b4efb83c725 github.com/grafana/go-offsets-tracker v0.1.7 github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/mariomac/guara v0.0.0-20230621100729-42bd7716e524 @@ -62,7 +63,6 @@ require ( google.golang.org/grpc v1.67.1 google.golang.org/protobuf v1.34.2 gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.31.1 k8s.io/apimachinery v0.31.1 k8s.io/client-go v0.31.1 sigs.k8s.io/e2e-framework v0.3.0 @@ -171,9 +171,9 @@ require ( golang.org/x/time v0.5.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect - gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect + k8s.io/api v0.31.1 // indirect k8s.io/klog/v2 v2.130.1 // indirect k8s.io/kube-openapi v0.0.0-20240620174524-b456828f718b // indirect k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect diff --git a/go.sum b/go.sum index dca308db1..ba2dd8d8f 100644 --- a/go.sum +++ b/go.sum @@ -103,6 +103,8 @@ github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grafana/beyla-k8s-cache v0.0.0-20241016170428-8b4efb83c725 h1:auLp/060bWP2uWVKH3MIAzL61ttGujsNXry6NI8Un/M= +github.com/grafana/beyla-k8s-cache v0.0.0-20241016170428-8b4efb83c725/go.mod h1:+Y9gUSD7rptXXZ0OL0aRcBLAgzBm+nE4OH1QB9LqHYc= github.com/grafana/go-offsets-tracker v0.1.7 h1:2zBQ7iiGzvyXY7LA8kaaSiEqH/Yx82UcfRabbY5aOG4= github.com/grafana/go-offsets-tracker v0.1.7/go.mod h1:qcQdu7zlUKIFNUdBJlLyNHuJGW0SKWKjkrN6jtt+jds= github.com/grafana/opentelemetry-go v1.28.0-grafana.3 h1:vExZiZKDZTdDi7fP1GG3GOGuoZ0GNu76408tNXfsnD0= @@ -435,8 +437,6 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= -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/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/pkg/components/beyla.go b/pkg/components/beyla.go index 95bc85e0c..bba274c8a 100644 --- a/pkg/components/beyla.go +++ b/pkg/components/beyla.go @@ -60,11 +60,6 @@ func RunBeyla(ctx context.Context, cfg *beyla.Config) error { func setupAppO11y(ctx context.Context, ctxInfo *global.ContextInfo, config *beyla.Config) error { slog.Info("starting Beyla in Application Observability mode") - // TODO: when we split Beyla in two processes with different permissions, this code can be split: - // in two parts: - // 1st process (privileged) - Invoke FindTarget, which also mounts the BPF maps - // 2nd executable (unprivileged) - Invoke ReadAndForward, receiving the BPF map mountpoint as argument - instr := appolly.New(ctx, ctxInfo, config) if err := instr.FindAndInstrument(); err != nil { return fmt.Errorf("can't find target process: %w", err) diff --git a/pkg/internal/appolly/appolly.go b/pkg/internal/appolly/appolly.go index e8c9ca081..d28b5c50f 100644 --- a/pkg/internal/appolly/appolly.go +++ b/pkg/internal/appolly/appolly.go @@ -12,7 +12,6 @@ import ( "github.com/grafana/beyla/pkg/internal/pipe" "github.com/grafana/beyla/pkg/internal/pipe/global" "github.com/grafana/beyla/pkg/internal/request" - "github.com/grafana/beyla/pkg/internal/transform/kube" ) func log() *slog.Logger { @@ -124,17 +123,16 @@ func setupKubernetes(ctx context.Context, ctxInfo *global.ContextInfo) { return } - informer, err := ctxInfo.K8sInformer.Get(ctx) - if err != nil { + if err := refreshK8sInformerCache(ctx, ctxInfo); err != nil { slog.Error("can't init Kubernetes informer. You can't setup Kubernetes discovery and your"+ " traces won't be decorated with Kubernetes metadata", "error", err) ctxInfo.K8sInformer.ForceDisable() return } +} - if ctxInfo.AppO11y.K8sDatabase, err = kube.StartDatabase(informer); err != nil { - slog.Error("can't setup Kubernetes database. Your traces won't be decorated with Kubernetes metadata", - "error", err) - ctxInfo.K8sInformer.ForceDisable() - } +func refreshK8sInformerCache(ctx context.Context, ctxInfo *global.ContextInfo) error { + // force the cache to be populated and cached + _, err := ctxInfo.K8sInformer.Get(ctx) + return err } diff --git a/pkg/internal/discover/attacher.go b/pkg/internal/discover/attacher.go index 7e117af3f..fe99ae417 100644 --- a/pkg/internal/discover/attacher.go +++ b/pkg/internal/discover/attacher.go @@ -65,7 +65,8 @@ func (ta *TraceAttacher) attacherLoop() (pipe.FinalFunc[[]Event[ebpf.Instrumenta mainLoop: for instrumentables := range in { for _, instr := range instrumentables { - ta.log.Debug("Instrumentable", "len", len(instrumentables), "inst", instr) + ta.log.Debug("Instrumentable", "created", instr.Type, "type", instr.Obj.Type, + "exec", instr.Obj.FileInfo.CmdExePath, "pid", instr.Obj.FileInfo.Pid) switch instr.Type { case EventCreated: ta.processInstances.Inc(instr.Obj.FileInfo.Ino) diff --git a/pkg/internal/discover/container_updater.go b/pkg/internal/discover/container_updater.go index 4a3f662f1..44aa830c9 100644 --- a/pkg/internal/discover/container_updater.go +++ b/pkg/internal/discover/container_updater.go @@ -1,37 +1,45 @@ package discover import ( + "context" + "fmt" + "log/slog" + "github.com/mariomac/pipes/pipe" "github.com/grafana/beyla/pkg/internal/ebpf" - "github.com/grafana/beyla/pkg/internal/transform/kube" + "github.com/grafana/beyla/pkg/internal/kube" ) // ContainerDBUpdaterProvider is a stage in the Process Finder pipeline that will be // enabled only if Kubernetes decoration is enabled. // It just updates part of the kubernetes database when a new process is discovered. -func ContainerDBUpdaterProvider(enabled bool, db *kube.Database) pipe.MiddleProvider[[]Event[ebpf.Instrumentable], []Event[ebpf.Instrumentable]] { +func ContainerDBUpdaterProvider(ctx context.Context, meta kubeMetadataProvider) pipe.MiddleProvider[[]Event[ebpf.Instrumentable], []Event[ebpf.Instrumentable]] { return func() (pipe.MiddleFunc[[]Event[ebpf.Instrumentable], []Event[ebpf.Instrumentable]], error) { - if !enabled { + if !meta.IsKubeEnabled() { return pipe.Bypass[[]Event[ebpf.Instrumentable]](), nil } - return updateLoop(db), nil + store, err := meta.Get(ctx) + if err != nil { + return nil, fmt.Errorf("instantiating ContainerDBUpdater: %w", err) + } + return updateLoop(store), nil } } -func updateLoop(db *kube.Database) pipe.MiddleFunc[[]Event[ebpf.Instrumentable], []Event[ebpf.Instrumentable]] { +func updateLoop(db *kube.Store) pipe.MiddleFunc[[]Event[ebpf.Instrumentable], []Event[ebpf.Instrumentable]] { + log := slog.With("component", "ContainerDBUpdater") return func(in <-chan []Event[ebpf.Instrumentable], out chan<- []Event[ebpf.Instrumentable]) { for instrumentables := range in { for i := range instrumentables { ev := &instrumentables[i] switch ev.Type { case EventCreated: + log.Debug("adding process", "pid", ev.Obj.FileInfo.Pid) db.AddProcess(uint32(ev.Obj.FileInfo.Pid)) case EventDeleted: // we don't need to handle process deletion from here, as the Kubernetes informer will // remove the process from the database when the Pod that contains it is deleted. - // However we clean-up the performance related caches, in case we miss pod removal event - db.CleanProcessCaches(ev.Obj.FileInfo.Ns) } } out <- instrumentables diff --git a/pkg/internal/discover/finder.go b/pkg/internal/discover/finder.go index 594759ef6..d959a7344 100644 --- a/pkg/internal/discover/finder.go +++ b/pkg/internal/discover/finder.go @@ -71,8 +71,7 @@ func (pf *ProcessFinder) Start() (<-chan *ebpf.Instrumentable, <-chan *ebpf.Inst WatcherKubeEnricherProvider(pf.ctx, pf.ctxInfo.K8sInformer)) pipe.AddMiddleProvider(gb, criteriaMatcher, CriteriaMatcherProvider(pf.cfg)) pipe.AddMiddleProvider(gb, execTyper, ExecTyperProvider(pf.cfg, pf.ctxInfo.Metrics)) - pipe.AddMiddleProvider(gb, containerDBUpdater, - ContainerDBUpdaterProvider(pf.ctxInfo.K8sInformer.IsKubeEnabled(), pf.ctxInfo.AppO11y.K8sDatabase)) + pipe.AddMiddleProvider(gb, containerDBUpdater, ContainerDBUpdaterProvider(pf.ctx, pf.ctxInfo.K8sInformer)) pipe.AddFinalProvider(gb, traceAttacher, TraceAttacherProvider(&TraceAttacher{ Cfg: pf.cfg, Ctx: pf.ctx, diff --git a/pkg/internal/discover/watcher_kube.go b/pkg/internal/discover/watcher_kube.go index b1fadc308..34629643d 100644 --- a/pkg/internal/discover/watcher_kube.go +++ b/pkg/internal/discover/watcher_kube.go @@ -4,15 +4,16 @@ import ( "context" "fmt" "log/slog" + "sync" "github.com/mariomac/pipes/pipe" - "k8s.io/client-go/tools/cache" - attr "github.com/grafana/beyla/pkg/export/attributes/names" + "github.com/grafana/beyla-k8s-cache/pkg/informer" + "github.com/grafana/beyla/pkg/internal/helpers/container" - "github.com/grafana/beyla/pkg/internal/helpers/maps" "github.com/grafana/beyla/pkg/internal/kube" "github.com/grafana/beyla/pkg/services" + "github.com/grafana/beyla/pkg/transform" ) // injectable functions for testing @@ -20,96 +21,84 @@ var ( containerInfoForPID = container.InfoForPID ) -// kubeMetadata is implemented by kube.Metadata -type kubeMetadata interface { - GetContainerPod(containerID string) (*kube.PodInfo, bool) - AddPodEventHandler(handler cache.ResourceEventHandler) error -} - // watcherKubeEnricher keeps an update relational snapshot of the in-host process-pods-deployments, -// which is continuously updated from two sources: the input from the ProcessWatcher and the kube.Metadata informers. +// which is continuously updated from two sources: the input from the ProcessWatcher and the kube.Store. type watcherKubeEnricher struct { - informer kubeMetadata + store *kube.Store log *slog.Logger // cached system objects + mt sync.RWMutex containerByPID map[PID]container.Info processByContainer map[string]processAttrs - // podByOwners indexes all the PodInfos owned by a given ReplicaSet - // we use our own indexer instead an informer indexer because we need a 1:N relation while - // the other indices provide N:1 relation - // level-1 key: replicaset ns/name. Level-2 key: Pod name - podsByOwner maps.Map2[nsName, string, *kube.PodInfo] - - podsInfoCh chan Event[*kube.PodInfo] -} -type nsName struct { - namespace string - name string + podsInfoCh chan Event[*informer.ObjectMeta] } // kubeMetadataProvider abstracts kube.MetadataProvider for easier dependency // injection in tests type kubeMetadataProvider interface { IsKubeEnabled() bool - Get(context.Context) (*kube.Metadata, error) + Get(context.Context) (*kube.Store, error) } func WatcherKubeEnricherProvider( ctx context.Context, - informerProvider kubeMetadataProvider, + kubeMetaProvider kubeMetadataProvider, ) pipe.MiddleProvider[[]Event[processAttrs], []Event[processAttrs]] { return func() (pipe.MiddleFunc[[]Event[processAttrs], []Event[processAttrs]], error) { - if !informerProvider.IsKubeEnabled() { + if !kubeMetaProvider.IsKubeEnabled() { return pipe.Bypass[[]Event[processAttrs]](), nil } - informer, err := informerProvider.Get(ctx) + store, err := kubeMetaProvider.Get(ctx) if err != nil { return nil, fmt.Errorf("instantiating WatcherKubeEnricher: %w", err) } - wk := watcherKubeEnricher{informer: informer} - if err := wk.init(); err != nil { - return nil, err + wk := watcherKubeEnricher{ + log: slog.With("component", "discover.watcherKubeEnricher"), + store: store, + containerByPID: map[PID]container.Info{}, + processByContainer: map[string]processAttrs{}, + podsInfoCh: make(chan Event[*informer.ObjectMeta], 10), } - return wk.enrich, nil } } -func (wk *watcherKubeEnricher) init() error { - wk.log = slog.With("component", "discover.watcherKubeEnricher") - wk.containerByPID = map[PID]container.Info{} - wk.processByContainer = map[string]processAttrs{} - wk.podsByOwner = maps.Map2[nsName, string, *kube.PodInfo]{} - - // the podsInfoCh channel will receive any update about pods being created or deleted - wk.podsInfoCh = make(chan Event[*kube.PodInfo], 10) - if err := wk.informer.AddPodEventHandler(cache.ResourceEventHandlerFuncs{ - AddFunc: func(obj interface{}) { - wk.podsInfoCh <- Event[*kube.PodInfo]{Type: EventCreated, Obj: obj.(*kube.PodInfo)} - }, - UpdateFunc: func(_, newObj interface{}) { - wk.podsInfoCh <- Event[*kube.PodInfo]{Type: EventCreated, Obj: newObj.(*kube.PodInfo)} - }, - DeleteFunc: func(obj interface{}) { - wk.podsInfoCh <- Event[*kube.PodInfo]{Type: EventDeleted, Obj: obj.(*kube.PodInfo)} - }, - }); err != nil { - return fmt.Errorf("can't register watcherKubeEnricher as Pod event handler in the K8s informer: %w", err) - } +func (wk *watcherKubeEnricher) ID() string { return "unique-watcher-kube-enricher-id" } - return nil +// On is invoked every time an object metadata instance is stored or deleted in the +// kube.Store. It will just forward the event via the channel for proper asynchronous +// handling in the enrich main loop +func (wk *watcherKubeEnricher) On(event *informer.Event) { + // ignoring updates on non-pod resources + if event.Resource.Pod == nil { + return + } + switch event.Type { + case informer.EventType_CREATED, informer.EventType_UPDATED: + wk.podsInfoCh <- Event[*informer.ObjectMeta]{Type: EventCreated, Obj: event.Resource} + case informer.EventType_DELETED: + wk.podsInfoCh <- Event[*informer.ObjectMeta]{Type: EventDeleted, Obj: event.Resource} + default: + wk.log.Debug("ignoring unknown event type", "event", event) + } } // enrich listens for any potential instrumentable process from three asyncronous sources: -// ProcessWatcher, and the ReplicaSet and Pod informers from kube.Metadata. +// ProcessWatcher, and the ReplicaSet and Pod informers from kube.Store. // We can't assume any order in the reception of the events, so we always keep an in-memory -// snapshot of the process-pod-replicaset 3-tuple that is updated as long as each event +// snapshot of the process-pod tuple that is updated as long as each event // is received from different sources. func (wk *watcherKubeEnricher) enrich(in <-chan []Event[processAttrs], out chan<- []Event[processAttrs]) { wk.log.Debug("starting watcherKubeEnricher") + // the initialization needs to go in a different thread, + // as the subscription "welcome message" would otherwise be blocked + // trying to send events to the wk.podsInfoCh channel + // before the enrich loop has the chance to receive them + go wk.store.Subscribe(wk) + for { select { case podEvent := <-wk.podsInfoCh: @@ -124,11 +113,12 @@ func (wk *watcherKubeEnricher) enrich(in <-chan []Event[processAttrs], out chan< } } -func (wk *watcherKubeEnricher) enrichPodEvent(podEvent Event[*kube.PodInfo], out chan<- []Event[processAttrs]) { +func (wk *watcherKubeEnricher) enrichPodEvent(podEvent Event[*informer.ObjectMeta], out chan<- []Event[processAttrs]) { switch podEvent.Type { case EventCreated: wk.log.Debug("Pod added", - "namespace", podEvent.Obj.Namespace, "name", podEvent.Obj.Name, "containers", podEvent.Obj.ContainerIDs) + "namespace", podEvent.Obj.Namespace, "name", podEvent.Obj.Name, + "containers", podEvent.Obj.Pod.ContainerIds) if events := wk.onNewPod(podEvent.Obj); len(events) > 0 { out <- events } @@ -156,7 +146,13 @@ func (wk *watcherKubeEnricher) enrichProcessEvent(processEvents []Event[processA } case EventDeleted: wk.log.Debug("process stopped", "pid", procEvent.Obj.pid) + wk.mt.Lock() + if cnt, ok := wk.containerByPID[procEvent.Obj.pid]; ok { + delete(wk.processByContainer, cnt.ContainerID) + } delete(wk.containerByPID, procEvent.Obj.pid) + wk.store.DeleteProcess(uint32(procEvent.Obj.pid)) + wk.mt.Unlock() // no need to decorate deleted processes eventsWithMeta = append(eventsWithMeta, procEvent) } @@ -165,6 +161,8 @@ func (wk *watcherKubeEnricher) enrichProcessEvent(processEvents []Event[processA } func (wk *watcherKubeEnricher) onNewProcess(procInfo processAttrs) (processAttrs, bool) { + wk.mt.Lock() + defer wk.mt.Unlock() // 1. get container owning the process and cache it // 2. if there is already a pod registered for that container, decorate processAttrs with pod attributes containerInfo, err := wk.getContainerInfo(procInfo.pid) @@ -176,17 +174,17 @@ func (wk *watcherKubeEnricher) onNewProcess(procInfo processAttrs) (processAttrs wk.processByContainer[containerInfo.ContainerID] = procInfo - if pod, ok := wk.informer.GetContainerPod(containerInfo.ContainerID); ok { + if pod := wk.store.PodByContainerID(containerInfo.ContainerID); pod != nil { procInfo = withMetadata(procInfo, pod) } return procInfo, true } -func (wk *watcherKubeEnricher) onNewPod(pod *kube.PodInfo) []Event[processAttrs] { - wk.updateNewPodsByOwnerIndex(pod) - +func (wk *watcherKubeEnricher) onNewPod(pod *informer.ObjectMeta) []Event[processAttrs] { + wk.mt.RLock() + defer wk.mt.RUnlock() var events []Event[processAttrs] - for _, containerID := range pod.ContainerIDs { + for _, containerID := range pod.Pod.ContainerIds { if procInfo, ok := wk.processByContainer[containerID]; ok { events = append(events, Event[processAttrs]{ Type: EventCreated, @@ -197,9 +195,13 @@ func (wk *watcherKubeEnricher) onNewPod(pod *kube.PodInfo) []Event[processAttrs] return events } -func (wk *watcherKubeEnricher) onDeletedPod(pod *kube.PodInfo) { - wk.updateDeletedPodsByOwnerIndex(pod) - for _, containerID := range pod.ContainerIDs { +func (wk *watcherKubeEnricher) onDeletedPod(pod *informer.ObjectMeta) { + wk.mt.Lock() + defer wk.mt.Unlock() + for _, containerID := range pod.Pod.ContainerIds { + if pbc, ok := wk.processByContainer[containerID]; ok { + delete(wk.containerByPID, pbc.pid) + } delete(wk.processByContainer, containerID) } } @@ -216,32 +218,25 @@ func (wk *watcherKubeEnricher) getContainerInfo(pid PID) (container.Info, error) return cntInfo, nil } -func (wk *watcherKubeEnricher) updateNewPodsByOwnerIndex(pod *kube.PodInfo) { - if pod.Owner != nil { - wk.podsByOwner.Put(nsName{namespace: pod.Namespace, name: pod.Owner.Name}, pod.Name, pod) - } -} +// withMetadata returns a copy with a new map to avoid race conditions in later stages of the pipeline +func withMetadata(pp processAttrs, info *informer.ObjectMeta) processAttrs { -func (wk *watcherKubeEnricher) updateDeletedPodsByOwnerIndex(pod *kube.PodInfo) { - if pod.Owner != nil { - wk.podsByOwner.Delete(nsName{namespace: pod.Namespace, name: pod.Owner.Name}, pod.Name) + ownerName := info.Name + if topOwner := kube.TopOwner(info.Pod); topOwner != nil { + ownerName = topOwner.Name } -} -// withMetadata returns a copy with a new map to avoid race conditions in later stages of the pipeline -func withMetadata(pp processAttrs, info *kube.PodInfo) processAttrs { ret := pp ret.metadata = map[string]string{ services.AttrNamespace: info.Namespace, services.AttrPodName: info.Name, + services.AttrOwnerName: ownerName, } ret.podLabels = info.Labels - if info.Owner != nil { - ret.metadata[attr.Name(info.Owner.LabelName).Prom()] = info.Owner.Name - topOwner := info.Owner.TopOwner() - ret.metadata[attr.Name(topOwner.LabelName).Prom()] = topOwner.Name - ret.metadata[services.AttrOwnerName] = topOwner.Name + // add any other owner name (they might be several, e.g. replicaset and deployment) + for _, owner := range info.Pod.Owners { + ret.metadata[transform.OwnerLabelName(owner.Kind).Prom()] = owner.Name } return ret } diff --git a/pkg/internal/discover/watcher_kube_test.go b/pkg/internal/discover/watcher_kube_test.go index ba89b13bb..1cb16d5b7 100644 --- a/pkg/internal/discover/watcher_kube_test.go +++ b/pkg/internal/discover/watcher_kube_test.go @@ -4,17 +4,16 @@ import ( "context" "fmt" "strings" + "sync" "testing" "time" - "github.com/mariomac/guara/pkg/test" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "gopkg.in/yaml.v3" - appsv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - fakek8sclientset "k8s.io/client-go/kubernetes/fake" + + "github.com/grafana/beyla-k8s-cache/pkg/informer" + "github.com/grafana/beyla-k8s-cache/pkg/meta" "github.com/grafana/beyla/pkg/beyla" "github.com/grafana/beyla/pkg/internal/helpers/container" @@ -24,6 +23,7 @@ import ( ) const timeout = 5 * time.Second + const ( namespace = "test-ns" containerPID = 123 @@ -35,79 +35,70 @@ const ( ) func TestWatcherKubeEnricher(t *testing.T) { - type fn func(t *testing.T, inputCh chan []Event[processAttrs], k8sClient *fakek8sclientset.Clientset) + type event struct { + fn func(inputCh chan []Event[processAttrs], fInformer meta.Notifier) + shouldNotify bool + } type testCase struct { name string - steps []fn + steps []event } // test deployment functions - var process = func(_ *testing.T, inputCh chan []Event[processAttrs], _ *fakek8sclientset.Clientset) { + var process = func(inputCh chan []Event[processAttrs], _ meta.Notifier) { newProcess(inputCh, containerPID, []uint32{containerPort}) } - var pod = func(t *testing.T, _ chan []Event[processAttrs], k8sClient *fakek8sclientset.Clientset) { - deployPod(t, k8sClient, namespace, podName, containerID, nil) - } - var ownedPod = func(t *testing.T, _ chan []Event[processAttrs], k8sClient *fakek8sclientset.Clientset) { - deployOwnedPod(t, k8sClient, namespace, podName, replicaSetName, containerID) + var pod = func(_ chan []Event[processAttrs], fInformer meta.Notifier) { + deployPod(fInformer, namespace, podName, containerID, nil) } - var replicaSet = func(t *testing.T, _ chan []Event[processAttrs], k8sClient *fakek8sclientset.Clientset) { - deployReplicaSet(t, k8sClient, namespace, replicaSetName, deploymentName) + var ownedPod = func(_ chan []Event[processAttrs], fInformer meta.Notifier) { + deployOwnedPod(fInformer, namespace, podName, replicaSetName, deploymentName, containerID) } // The watcherKubeEnricher has to listen and relate information from multiple asynchronous sources. // Each test case verifies that whatever the order of the events is, testCases := []testCase{ - {name: "process-pod-rs", steps: []fn{process, ownedPod, replicaSet}}, - {name: "process-rs-pod", steps: []fn{process, replicaSet, ownedPod}}, - {name: "pod-process-rs", steps: []fn{ownedPod, process, replicaSet}}, - {name: "pod-rs-process", steps: []fn{ownedPod, replicaSet, process}}, - {name: "rs-pod-process", steps: []fn{replicaSet, ownedPod, process}}, - {name: "rs-process-pod", steps: []fn{process, ownedPod, replicaSet}}, - {name: "process-pod (no rs)", steps: []fn{process, pod}}, - {name: "pod-process (no rs)", steps: []fn{pod, process}}} + {name: "process-pod", steps: []event{{fn: process, shouldNotify: true}, {fn: ownedPod, shouldNotify: true}}}, + {name: "pod-process", steps: []event{{fn: ownedPod, shouldNotify: false}, {fn: process, shouldNotify: true}}}, + {name: "process-pod (no owner)", steps: []event{{fn: process, shouldNotify: true}, {fn: pod, shouldNotify: true}}}, + {name: "pod-process (no owner)", steps: []event{{fn: pod, shouldNotify: false}, {fn: process, shouldNotify: true}}}} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { containerInfoForPID = fakeContainerInfo + // Setup a fake K8s API connected to the watcherKubeEnricher - k8sClient := fakek8sclientset.NewSimpleClientset() - informer := kube.Metadata{SyncTimeout: 30 * time.Minute} - require.NoError(t, informer.InitFromClient(context.TODO(), k8sClient)) - wkeNodeFunc, err := WatcherKubeEnricherProvider(context.TODO(), &informerProvider{informer: &informer})() + fInformer := &fakeInformer{} + store := kube.NewStore(fInformer) + wkeNodeFunc, err := WatcherKubeEnricherProvider(context.TODO(), &fakeMetadataProvider{store: store})() require.NoError(t, err) inputCh, outputCh := make(chan []Event[processAttrs], 10), make(chan []Event[processAttrs], 10) defer close(inputCh) go wkeNodeFunc(inputCh, outputCh) - _, err = k8sClient.CoreV1().Namespaces().Create( - context.Background(), - &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: namespace}}, - metav1.CreateOptions{}) - require.NoError(t, err) - // deploy all the involved elements where the metadata are composed of + // in different orders to test that watcherKubeEnricher will eventually handle everything + var events []Event[processAttrs] for _, step := range tc.steps { - step(t, inputCh, k8sClient) + step.fn(inputCh, fInformer) + if step.shouldNotify { + events = testutil.ReadChannel(t, outputCh, timeout) + } } - // check that the watcherKubeEnricher eventually submits an event with the expected metadata - test.Eventually(t, timeout, func(t require.TestingT) { - events := <-outputCh - require.Len(t, events, 1) - event := events[0] - assert.Equal(t, EventCreated, event.Type) - assert.EqualValues(t, containerPID, event.Obj.pid) - assert.Equal(t, []uint32{containerPort}, event.Obj.openPorts) - assert.Equal(t, namespace, event.Obj.metadata[services.AttrNamespace]) - assert.Equal(t, podName, event.Obj.metadata[services.AttrPodName]) - if strings.Contains(tc.name, "(no rs)") { - assert.Empty(t, event.Obj.metadata[services.AttrReplicaSetName]) - assert.Empty(t, event.Obj.metadata[services.AttrDeploymentName]) - } else { - assert.Equal(t, replicaSetName, event.Obj.metadata[services.AttrReplicaSetName]) - assert.Equal(t, deploymentName, event.Obj.metadata[services.AttrDeploymentName]) - } - }) + require.Len(t, events, 1) + event := events[0] + assert.Equal(t, EventCreated, event.Type) + assert.EqualValues(t, containerPID, event.Obj.pid) + assert.Equal(t, []uint32{containerPort}, event.Obj.openPorts) + assert.Equal(t, namespace, event.Obj.metadata[services.AttrNamespace]) + assert.Equal(t, podName, event.Obj.metadata[services.AttrPodName]) + if strings.Contains(tc.name, "(no owner)") { + assert.Empty(t, event.Obj.metadata[services.AttrReplicaSetName]) + assert.Empty(t, event.Obj.metadata[services.AttrDeploymentName]) + } else { + assert.Equal(t, replicaSetName, event.Obj.metadata[services.AttrReplicaSetName]) + assert.Equal(t, deploymentName, event.Obj.metadata[services.AttrDeploymentName]) + } }) } } @@ -116,10 +107,9 @@ func TestWatcherKubeEnricherWithMatcher(t *testing.T) { containerInfoForPID = fakeContainerInfo processInfo = fakeProcessInfo // Setup a fake K8s API connected to the watcherKubeEnricher - k8sClient := fakek8sclientset.NewSimpleClientset() - informer := kube.Metadata{SyncTimeout: 30 * time.Minute} - require.NoError(t, informer.InitFromClient(context.TODO(), k8sClient)) - wkeNodeFunc, err := WatcherKubeEnricherProvider(context.TODO(), &informerProvider{informer: &informer})() + fInformer := &fakeInformer{} + store := kube.NewStore(fInformer) + wkeNodeFunc, err := WatcherKubeEnricherProvider(context.TODO(), &fakeMetadataProvider{store: store})() require.NoError(t, err) pipeConfig := beyla.Config{} require.NoError(t, yaml.Unmarshal([]byte(`discovery: @@ -150,13 +140,10 @@ func TestWatcherKubeEnricherWithMatcher(t *testing.T) { // sending some events that shouldn't match any of the above discovery criteria // so they won't be forwarded before any of later matched events - t.Run("unmatched events", func(t *testing.T) { - newProcess(inputCh, 123, []uint32{777}) - newProcess(inputCh, 456, []uint32{}) - newProcess(inputCh, 789, []uint32{443}) - deployOwnedPod(t, k8sClient, namespace, "depl-rsid-podid", "depl-rsid", "container-789") - deployReplicaSet(t, k8sClient, namespace, "depl-rsid", "depl") - }) + newProcess(inputCh, 123, []uint32{777}) + newProcess(inputCh, 456, []uint32{}) + newProcess(inputCh, 789, []uint32{443}) + deployOwnedPod(fInformer, namespace, "depl-rsid-podid", "depl-rsid", "depl", "container-789") // sending events that will match and will be forwarded t.Run("port-only match", func(t *testing.T) { @@ -171,7 +158,7 @@ func TestWatcherKubeEnricherWithMatcher(t *testing.T) { t.Run("metadata-only match", func(t *testing.T) { newProcess(inputCh, 34, []uint32{8080}) - deployPod(t, k8sClient, namespace, "chichi", "container-34", nil) + deployPod(fInformer, namespace, "chichi", "container-34", nil) matches := testutil.ReadChannel(t, outputCh, timeout) require.Len(t, matches, 1) m := matches[0] @@ -182,7 +169,7 @@ func TestWatcherKubeEnricherWithMatcher(t *testing.T) { t.Run("pod-label-only match", func(t *testing.T) { newProcess(inputCh, 42, []uint32{8080}) - deployPod(t, k8sClient, namespace, "labeltest", "container-42", map[string]string{"instrument": "beyla"}) + deployPod(fInformer, namespace, "labeltest", "container-42", map[string]string{"instrument": "beyla"}) matches := testutil.ReadChannel(t, outputCh, timeout) require.Len(t, matches, 1) m := matches[0] @@ -193,7 +180,7 @@ func TestWatcherKubeEnricherWithMatcher(t *testing.T) { t.Run("pod-multi-label-only match", func(t *testing.T) { newProcess(inputCh, 43, []uint32{8080}) - deployPod(t, k8sClient, namespace, "multi-labeltest", "container-43", map[string]string{"instrument": "ebpf", "lang": "golang"}) + deployPod(fInformer, namespace, "multi-labeltest", "container-43", map[string]string{"instrument": "ebpf", "lang": "golang"}) matches := testutil.ReadChannel(t, outputCh, timeout) require.Len(t, matches, 1) m := matches[0] @@ -204,8 +191,7 @@ func TestWatcherKubeEnricherWithMatcher(t *testing.T) { t.Run("both process and metadata match", func(t *testing.T) { newProcess(inputCh, 56, []uint32{443}) - deployOwnedPod(t, k8sClient, namespace, "chacha-rsid-podid", "chacha-rsid", "container-56") - deployReplicaSet(t, k8sClient, namespace, "chacha-rsid", "chacha") + deployOwnedPod(fInformer, namespace, "chacha-rsid-podid", "chacha-rsid", "chacha", "container-56") matches := testutil.ReadChannel(t, outputCh, timeout) require.Len(t, matches, 1) m := matches[0] @@ -243,58 +229,32 @@ func newProcess(inputCh chan []Event[processAttrs], pid PID, ports []uint32) { }} } -func deployPod(t *testing.T, k8sClient *fakek8sclientset.Clientset, ns, name, containerID string, labels map[string]string) { - t.Helper() - _, err := k8sClient.CoreV1().Pods(ns).Create( - context.Background(), - &corev1.Pod{ObjectMeta: metav1.ObjectMeta{ - Name: name, Namespace: ns, - Labels: labels, - }, Status: corev1.PodStatus{ - ContainerStatuses: []corev1.ContainerStatus{{ - ContainerID: containerID, - }}, - }}, - metav1.CreateOptions{}) - require.NoError(t, err) +func deployPod(fInformer meta.Notifier, ns, name, containerID string, labels map[string]string) { + fInformer.Notify(&informer.Event{ + Type: informer.EventType_CREATED, + Resource: &informer.ObjectMeta{ + Name: name, Namespace: ns, Labels: labels, + Kind: "Pod", + Pod: &informer.PodInfo{ + ContainerIds: []string{containerID}, + }, + }, + }) } -func deployOwnedPod(t *testing.T, k8sClient *fakek8sclientset.Clientset, ns, name, rsName, containerID string) { - t.Helper() - _, err := k8sClient.CoreV1().Pods(ns).Create( - context.Background(), - &corev1.Pod{ObjectMeta: metav1.ObjectMeta{ +func deployOwnedPod(fInformer meta.Notifier, ns, name, replicaSetName, deploymentName, containerID string) { + fInformer.Notify(&informer.Event{ + Type: informer.EventType_CREATED, + Resource: &informer.ObjectMeta{ Name: name, Namespace: ns, - OwnerReferences: []metav1.OwnerReference{{ - APIVersion: "apps/v1", - Kind: "ReplicaSet", - Name: rsName, - }}, - }, Status: corev1.PodStatus{ - ContainerStatuses: []corev1.ContainerStatus{{ - ContainerID: containerID, - }}, - }}, - metav1.CreateOptions{}) - require.NoError(t, err) -} - -func deployReplicaSet(t *testing.T, k8sClient *fakek8sclientset.Clientset, ns, name, deploymentName string) { - t.Helper() - _, err := k8sClient.AppsV1().ReplicaSets(ns).Create(context.Background(), - &appsv1.ReplicaSet{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: ns, - Name: name, - OwnerReferences: []metav1.OwnerReference{{ - APIVersion: "apps/v1", - Kind: "Deployment", - Name: deploymentName, - }}, + Kind: "Pod", + Pod: &informer.PodInfo{ + ContainerIds: []string{containerID}, + Owners: []*informer.Owner{{Name: replicaSetName, Kind: "ReplicaSet"}, + {Name: deploymentName, Kind: "Deployment"}}, }, }, - metav1.CreateOptions{}) - require.NoError(t, err) + }) } func fakeContainerInfo(pid uint32) (container.Info, error) { @@ -309,14 +269,40 @@ func fakeProcessInfo(pp processAttrs) (*services.ProcessInfo, error) { }, nil } -type informerProvider struct { - informer *kube.Metadata +type fakeMetadataProvider struct { + store *kube.Store } -func (*informerProvider) IsKubeEnabled() bool { - return true +func (i *fakeMetadataProvider) IsKubeEnabled() bool { return true } + +func (i *fakeMetadataProvider) Get(_ context.Context) (*kube.Store, error) { + return i.store, nil } -func (ip *informerProvider) Get(_ context.Context) (*kube.Metadata, error) { - return ip.informer, nil +type fakeInformer struct { + mt sync.Mutex + observers map[string]meta.Observer +} + +func (f *fakeInformer) Subscribe(observer meta.Observer) { + f.mt.Lock() + defer f.mt.Unlock() + if f.observers == nil { + f.observers = map[string]meta.Observer{} + } + f.observers[observer.ID()] = observer +} + +func (f *fakeInformer) Unsubscribe(observer meta.Observer) { + f.mt.Lock() + defer f.mt.Unlock() + delete(f.observers, observer.ID()) +} + +func (f *fakeInformer) Notify(event *informer.Event) { + f.mt.Lock() + defer f.mt.Unlock() + for _, observer := range f.observers { + observer.On(event) + } } diff --git a/pkg/internal/kube/cni/ovn_kubernetes_test.go b/pkg/internal/kube/cni/ovn_kubernetes_test.go deleted file mode 100644 index 2c1b08e8f..000000000 --- a/pkg/internal/kube/cni/ovn_kubernetes_test.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright Red Hat / IBM -// Copyright Grafana Labs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 implementation is a derivation of the code in -// https://github.com/netobserv/netobserv-ebpf-agent/tree/release-1.4 - -package cni - -import ( - "testing" - - "github.com/stretchr/testify/require" -) - -func TestFindOvnMp0IP(t *testing.T) { - // Annotation not found => no error, no ip - ip, err := findOvnMp0IP(map[string]string{}) - require.NoError(t, err) - require.Empty(t, ip) - - // Annotation malformed => error, no ip - ip, err = findOvnMp0IP(map[string]string{ - ovnSubnetAnnotation: "whatever", - }) - require.Error(t, err) - require.Contains(t, err.Error(), "cannot read annotation") - require.Empty(t, ip) - - // IP malformed => error, no ip - ip, err = findOvnMp0IP(map[string]string{ - ovnSubnetAnnotation: `{"default":"10.129/23"}`, - }) - require.Error(t, err) - require.Contains(t, err.Error(), "invalid CIDR address") - require.Empty(t, ip) - - // Valid annotation => no error, ip - ip, err = findOvnMp0IP(map[string]string{ - ovnSubnetAnnotation: `{"default":"10.129.0.0/23"}`, - }) - require.NoError(t, err) - require.Equal(t, "10.129.0.2", ip) -} diff --git a/pkg/internal/kube/informer.go b/pkg/internal/kube/informer.go deleted file mode 100644 index 34c2a2044..000000000 --- a/pkg/internal/kube/informer.go +++ /dev/null @@ -1,330 +0,0 @@ -package kube - -import ( - "context" - "fmt" - "log/slog" - "os" - "path" - "strings" - "time" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/informers" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/cache" - "k8s.io/client-go/tools/clientcmd" - - "github.com/grafana/beyla/pkg/internal/helpers/maps" -) - -const ( - kubeConfigEnvVariable = "KUBECONFIG" - defaultResyncTime = 30 * time.Minute - defaultSyncTimeout = 30 * time.Second - IndexPodByContainerIDs = "idx_pod_by_container" - IndexIP = "idx_ip" - typeNode = "Node" - typePod = "Pod" - typeService = "Service" -) - -func klog() *slog.Logger { - return slog.With("component", "kube.Metadata") -} - -// ContainerEventHandler listens for the deletion of containers, as triggered -// by a Pod deletion. -type ContainerEventHandler interface { - OnDeletion(containerID []string) -} - -// Metadata stores an in-memory copy of the different Kubernetes objects whose metadata is relevant to us. -type Metadata struct { - log *slog.Logger - // pods and replicaSets cache the different K8s types to custom, smaller object types - pods cache.SharedIndexInformer - nodesIP cache.SharedIndexInformer - servicesIP cache.SharedIndexInformer - - containerEventHandlers []ContainerEventHandler - - SyncTimeout time.Duration - resyncPeriod time.Duration - disabledInformers maps.Bits -} - -// PodInfo contains precollected metadata for Pods. -type PodInfo struct { - // Informers need that internal object is an ObjectMeta instance - metav1.ObjectMeta - NodeName string - - Owner *Owner - - // StartTimeStr caches value of ObjectMeta.StartTimestamp.String() - StartTimeStr string - ContainerIDs []string - IPInfo IPInfo -} - -// ServiceInfo contains precollected metadata for services. -type ServiceInfo struct { - metav1.ObjectMeta - IPInfo IPInfo -} - -// ReplicaSetInfo contains precollected metadata for ReplicaSets -type ReplicaSetInfo struct { - metav1.ObjectMeta - Owner *Owner -} - -// NodeInfo contains precollected metadata for nodes -type NodeInfo struct { - metav1.ObjectMeta - IPInfo IPInfo -} - -var podIndexers = cache.Indexers{ - IndexPodByContainerIDs: func(obj interface{}) ([]string, error) { - pi := obj.(*PodInfo) - return pi.ContainerIDs, nil - }, - IndexIP: func(obj interface{}) ([]string, error) { - pi := obj.(*PodInfo) - return pi.IPInfo.IPs, nil - }, -} - -var serviceIndexers = cache.Indexers{ - IndexIP: func(obj interface{}) ([]string, error) { - pi := obj.(*ServiceInfo) - return pi.IPInfo.IPs, nil - }, -} - -var nodeIndexers = cache.Indexers{ - IndexIP: func(obj interface{}) ([]string, error) { - pi := obj.(*NodeInfo) - return pi.IPInfo.IPs, nil - }, -} - -// GetContainerPod fetches metadata from a Pod given the name of one of its containers -func (k *Metadata) GetContainerPod(containerID string) (*PodInfo, bool) { - objs, err := k.pods.GetIndexer().ByIndex(IndexPodByContainerIDs, containerID) - if err != nil { - k.log.Debug("error accessing index by container ID. Ignoring", "error", err, "containerID", containerID) - return nil, false - } - if len(objs) == 0 { - return nil, false - } - return objs[0].(*PodInfo), true -} - -func (k *Metadata) initPodInformer(informerFactory informers.SharedInformerFactory) error { - pods := informerFactory.Core().V1().Pods().Informer() - - k.initContainerListeners(pods) - - // Transform any *v1.Pod instance into a *PodInfo instance to save space - // in the informer's cache - if err := pods.SetTransform(func(i interface{}) (interface{}, error) { - pod, ok := i.(*v1.Pod) - if !ok { - // it's Ok. The K8s library just informed from an entity - // that has been previously transformed/stored - if pi, ok := i.(*PodInfo); ok { - return pi, nil - } - return nil, fmt.Errorf("was expecting a Pod. Got: %T", i) - } - containerIDs := make([]string, 0, - len(pod.Status.ContainerStatuses)+ - len(pod.Status.InitContainerStatuses)+ - len(pod.Status.EphemeralContainerStatuses)) - for i := range pod.Status.ContainerStatuses { - containerIDs = append(containerIDs, - rmContainerIDSchema(pod.Status.ContainerStatuses[i].ContainerID)) - } - for i := range pod.Status.InitContainerStatuses { - containerIDs = append(containerIDs, - rmContainerIDSchema(pod.Status.InitContainerStatuses[i].ContainerID)) - } - for i := range pod.Status.EphemeralContainerStatuses { - containerIDs = append(containerIDs, - rmContainerIDSchema(pod.Status.EphemeralContainerStatuses[i].ContainerID)) - } - - ips := make([]string, 0, len(pod.Status.PodIPs)) - for _, ip := range pod.Status.PodIPs { - // ignoring host-networked Pod IPs - if ip.IP != pod.Status.HostIP { - ips = append(ips, ip.IP) - } - } - - owner := OwnerFrom(pod.OwnerReferences) - startTime := pod.GetCreationTimestamp().String() - if k.log.Enabled(context.TODO(), slog.LevelDebug) { - k.log.Debug("inserting pod", "name", pod.Name, "namespace", pod.Namespace, - "uid", pod.UID, "owner", owner, - "node", pod.Spec.NodeName, "startTime", startTime, - "containerIDs", containerIDs) - } - return &PodInfo{ - ObjectMeta: metav1.ObjectMeta{ - Name: pod.Name, - Namespace: pod.Namespace, - UID: pod.UID, - Labels: pod.Labels, - OwnerReferences: pod.OwnerReferences, - }, - Owner: owner, - NodeName: pod.Spec.NodeName, - StartTimeStr: startTime, - ContainerIDs: containerIDs, - IPInfo: IPInfo{ - Kind: typePod, - HostIP: pod.Status.HostIP, - IPs: ips, - }, - }, nil - }); err != nil { - return fmt.Errorf("can't set pods transform: %w", err) - } - if err := pods.AddIndexers(podIndexers); err != nil { - return fmt.Errorf("can't add indexers to Pods informer: %w", err) - } - - k.pods = pods - return nil -} - -// initContainerListeners listens for deletions of pods, to forward them to the ContainerEventHandler subscribers. -func (k *Metadata) initContainerListeners(pods cache.SharedIndexInformer) { - if _, err := pods.AddEventHandler(cache.ResourceEventHandlerFuncs{ - DeleteFunc: func(obj interface{}) { - pod := obj.(*PodInfo) - k.log.Debug("deleting containers for pod", "pod", pod.Name, "containers", pod.ContainerIDs) - for _, listener := range k.containerEventHandlers { - listener.OnDeletion(pod.ContainerIDs) - } - }, - }); err != nil { - k.log.Warn("can't attach container listener to the Kubernetes informer."+ - " Your kubernetes metadata might be outdated in the long term", "error", err) - } -} - -// rmContainerIDSchema extracts the hex ID of a container ID that is provided in the form: -// containerd://40c03570b6f4c30bc8d69923d37ee698f5cfcced92c7b7df1c47f6f7887378a9 -func rmContainerIDSchema(containerID string) string { - if parts := strings.Split(containerID, "://"); len(parts) > 1 { - return parts[1] - } - return containerID -} - -func (k *Metadata) InitFromClient(ctx context.Context, client kubernetes.Interface) error { - // Initialization variables - k.log = klog() - return k.initInformers(ctx, client) -} - -func LoadConfig(kubeConfigPath string) (*rest.Config, error) { - // if no config path is provided, load it from the env variable - if kubeConfigPath == "" { - kubeConfigPath = os.Getenv(kubeConfigEnvVariable) - } - // otherwise, load it from the $HOME/.kube/config file - if kubeConfigPath == "" { - homeDir, err := os.UserHomeDir() - if err != nil { - return nil, fmt.Errorf("can't get user home dir: %w", err) - } - kubeConfigPath = path.Join(homeDir, ".kube", "config") - } - config, err := clientcmd.BuildConfigFromFlags("", kubeConfigPath) - if err == nil { - return config, nil - } - // fallback: use in-cluster config - config, err = rest.InClusterConfig() - if err != nil { - return nil, fmt.Errorf("can't access kubenetes. Tried using config from: "+ - "config parameter, %s env, homedir and InClusterConfig. Got: %w", - kubeConfigEnvVariable, err) - } - return config, nil -} - -func (k *Metadata) initInformers(ctx context.Context, client kubernetes.Interface) error { - informerFactory := informers.NewSharedInformerFactory(client, k.resyncPeriod) - - if err := k.initPodInformer(informerFactory); err != nil { - return err - } - if err := k.initNodeIPInformer(informerFactory); err != nil { - return err - } - if err := k.initServiceIPInformer(informerFactory); err != nil { - return err - } - - k.log.Debug("starting kubernetes informers, waiting for syncronization") - informerFactory.Start(ctx.Done()) - finishedCacheSync := make(chan struct{}) - go func() { - informerFactory.WaitForCacheSync(ctx.Done()) - close(finishedCacheSync) - }() - select { - case <-finishedCacheSync: - k.log.Debug("kubernetes informers started") - case <-time.After(k.SyncTimeout): - k.log.Warn("kubernetes cache has not been synced after timeout. The kubernetes attributes might be incomplete."+ - " Consider increasing the BEYLA_KUBE_INFORMERS_SYNC_TIMEOUT value", "timeout", k.SyncTimeout) - } - return nil -} - -func (k *Metadata) AddContainerEventHandler(eh ContainerEventHandler) { - k.containerEventHandlers = append(k.containerEventHandlers, eh) -} - -func (k *Metadata) AddPodEventHandler(h cache.ResourceEventHandler) error { - _, err := k.pods.AddEventHandler(h) - // passing a snapshot of the currently stored entities - go func() { - for _, pod := range k.pods.GetStore().List() { - h.OnAdd(pod, true) - } - }() - return err -} - -func (k *Metadata) AddNodeEventHandler(h cache.ResourceEventHandler) error { - if k.disabledInformers.Has(InformerNode) { - return nil - } - _, err := k.nodesIP.AddEventHandler(h) - // passing a snapshot of the currently stored entities - go func() { - for _, node := range k.nodesIP.GetStore().List() { - h.OnAdd(node, true) - } - }() - return err -} - -func (i *PodInfo) ServiceName() string { - if to := i.Owner.TopOwner(); to != nil { - return to.Name - } - return i.Name -} diff --git a/pkg/internal/kube/informer_ip.go b/pkg/internal/kube/informer_ip.go deleted file mode 100644 index f545fab11..000000000 --- a/pkg/internal/kube/informer_ip.go +++ /dev/null @@ -1,200 +0,0 @@ -package kube - -import ( - "fmt" - "net" - - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/informers" - "k8s.io/client-go/tools/cache" - - "github.com/grafana/beyla/pkg/internal/kube/cni" -) - -// IPInfo contains precollected metadata for Pods, Nodes and Services. -// Not all the fields are populated for all the above types. To save -// memory, we just keep in memory the necessary data for each Type. -// For more information about which fields are set for each type, please -// refer to the instantiation function of the respective informers. -type IPInfo struct { - Kind string - Owner Owner - HostName string - HostIP string - IPs []string -} - -func (k *Metadata) initServiceIPInformer(informerFactory informers.SharedInformerFactory) error { - if k.disabledInformers.Has(InformerService) { - return nil - } - services := informerFactory.Core().V1().Services().Informer() - // Transform any *v1.Service instance into a *IPInfo instance to save space - // in the informer's cache - if err := services.SetTransform(func(i interface{}) (interface{}, error) { - svc, ok := i.(*corev1.Service) - if !ok { - // it's Ok. The K8s library just informed from an entity - // that has been previously transformed/stored - if pi, ok := i.(*ServiceInfo); ok { - return pi, nil - } - return nil, fmt.Errorf("was expecting a Service. Got: %T", i) - } - if svc.Spec.ClusterIP == corev1.ClusterIPNone { - // this will be normal for headless services - k.log.Debug("Service doesn't have any ClusterIP. Beyla won't decorate their flows", - "namespace", svc.Namespace, "name", svc.Name) - } - return &ServiceInfo{ - ObjectMeta: metav1.ObjectMeta{ - Name: svc.Name, - Namespace: svc.Namespace, - Labels: svc.Labels, - OwnerReferences: svc.OwnerReferences, - }, - IPInfo: IPInfo{ - Kind: typeService, - IPs: svc.Spec.ClusterIPs, - }, - }, nil - }); err != nil { - return fmt.Errorf("can't set servicesIP transform: %w", err) - } - if err := services.AddIndexers(serviceIndexers); err != nil { - return fmt.Errorf("can't add %s indexer to Pods informer: %w", IndexIP, err) - } - - k.servicesIP = services - return nil -} - -func (k *Metadata) initNodeIPInformer(informerFactory informers.SharedInformerFactory) error { - if k.disabledInformers.Has(InformerNode) { - return nil - } - nodes := informerFactory.Core().V1().Nodes().Informer() - // Transform any *v1.Node instance into a *IPInfo instance to save space - // in the informer's cache - if err := nodes.SetTransform(func(i interface{}) (interface{}, error) { - node, ok := i.(*corev1.Node) - if !ok { - // it's Ok. The K8s library just informed from an entity - // that has been previously transformed/stored - if pi, ok := i.(*NodeInfo); ok { - return pi, nil - } - return nil, fmt.Errorf("was expecting a Node. Got: %T", i) - } - ips := make([]string, 0, len(node.Status.Addresses)) - for _, address := range node.Status.Addresses { - ip := net.ParseIP(address.Address) - if ip != nil { - ips = append(ips, ip.String()) - } - } - // CNI-dependent logic (must work regardless of whether the CNI is installed) - ips = cni.AddOvnIPs(ips, node) - - return &NodeInfo{ - ObjectMeta: metav1.ObjectMeta{ - Name: node.Name, - Namespace: node.Namespace, - Labels: node.Labels, - }, - IPInfo: IPInfo{ - IPs: ips, - Kind: typeNode, - }, - }, nil - }); err != nil { - return fmt.Errorf("can't set nodesIP transform: %w", err) - } - if err := nodes.AddIndexers(nodeIndexers); err != nil { - return fmt.Errorf("can't add %s indexer to Nodes informer: %w", IndexIP, err) - } - k.nodesIP = nodes - return nil -} - -func (k *Metadata) GetInfo(ip string) (*IPInfo, *metav1.ObjectMeta, bool) { - if info, meta, ok := k.fetchInformersByIP(ip); ok { - // Owner data might be discovered after the owned, so we fetch it - // at the last moment - if info.Owner.Name == "" { - info.Owner = k.getOwner(meta, info) - } - return info, meta, true - } - - return nil, nil, false -} - -func (k *Metadata) fetchInformersByIP(ip string) (*IPInfo, *metav1.ObjectMeta, bool) { - if info, ok := k.infoForIP(k.pods.GetIndexer(), ip); ok { - info := info.(*PodInfo) - // it might happen that the Host is discovered after the Pod - if info.IPInfo.HostName == "" { - info.IPInfo.HostName = k.getHostName(info.IPInfo.HostIP) - } - return &info.IPInfo, &info.ObjectMeta, true - } - if !k.disabledInformers.Has(InformerNode) { - if info, ok := k.infoForIP(k.nodesIP.GetIndexer(), ip); ok { - return &info.(*NodeInfo).IPInfo, &info.(*NodeInfo).ObjectMeta, true - } - } - if !k.disabledInformers.Has(InformerService) { - if info, ok := k.infoForIP(k.servicesIP.GetIndexer(), ip); ok { - return &info.(*ServiceInfo).IPInfo, &info.(*ServiceInfo).ObjectMeta, true - } - } - return nil, nil, false -} - -func (k *Metadata) infoForIP(idx cache.Indexer, ip string) (any, bool) { - objs, err := idx.ByIndex(IndexIP, ip) - if err != nil { - k.log.Debug("error accessing index. Ignoring", "ip", ip, "error", err) - return nil, false - } - if len(objs) == 0 { - return nil, false - } - return objs[0], true -} - -func (k *Metadata) getOwner(meta *metav1.ObjectMeta, info *IPInfo) Owner { - if len(meta.OwnerReferences) > 0 { - return *OwnerFrom(meta.OwnerReferences) - } - // If no owner references found, return itself as owner - return Owner{ - Name: meta.Name, - Kind: info.Kind, - } -} - -func (k *Metadata) getHostName(hostIP string) string { - if !k.disabledInformers.Has(InformerNode) && hostIP != "" { - if info, ok := k.infoForIP(k.nodesIP.GetIndexer(), hostIP); ok { - return info.(*NodeInfo).Name - } - } - return "" -} - -func (k *Metadata) AddServiceIPEventHandler(s cache.ResourceEventHandler) error { - if k.disabledInformers.Has(InformerService) { - return nil - } - _, err := k.servicesIP.AddEventHandler(s) - // passing a snapshot of the currently stored entities - go func() { - for _, svc := range k.servicesIP.GetStore().List() { - s.OnAdd(svc, true) - } - }() - return err -} diff --git a/pkg/internal/kube/informer_provider.go b/pkg/internal/kube/informer_provider.go index d72185de9..42b04d354 100644 --- a/pkg/internal/kube/informer_provider.go +++ b/pkg/internal/kube/informer_provider.go @@ -3,19 +3,33 @@ package kube import ( "context" "fmt" + "log/slog" "os" + "path" "strings" "sync" - "sync/atomic" "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" + "k8s.io/client-go/rest" + "k8s.io/client-go/tools/clientcmd" + + "github.com/grafana/beyla-k8s-cache/pkg/meta" - "github.com/grafana/beyla/pkg/internal/helpers/maps" "github.com/grafana/beyla/pkg/kubeflags" ) +const ( + kubeConfigEnvVariable = "KUBECONFIG" + defaultResyncTime = 30 * time.Minute + defaultSyncTimeout = 60 * time.Second +) + +func klog() *slog.Logger { + return slog.With("component", "kube.MetadataProvider") +} + type MetadataConfig struct { Enable kubeflags.EnableFlag DisabledInformers []string @@ -25,15 +39,16 @@ type MetadataConfig struct { } type MetadataProvider struct { - mt sync.Mutex - metadata *Metadata + mt sync.Mutex + + metadata *Store + informer *meta.Informers kubeConfigPath string syncTimeout time.Duration resyncPeriod time.Duration - enable atomic.Value - disabledInformers maps.Bits + enable kubeflags.EnableFlag } func NewMetadataProvider(config MetadataConfig) *MetadataProvider { @@ -44,12 +59,11 @@ func NewMetadataProvider(config MetadataConfig) *MetadataProvider { config.ResyncPeriod = defaultResyncTime } mp := &MetadataProvider{ - kubeConfigPath: config.KubeConfigPath, - syncTimeout: config.SyncTimeout, - resyncPeriod: config.ResyncPeriod, - disabledInformers: informerTypes(config.DisabledInformers), + kubeConfigPath: config.KubeConfigPath, + syncTimeout: config.SyncTimeout, + resyncPeriod: config.ResyncPeriod, + enable: config.Enable, } - mp.enable.Store(config.Enable) return mp } @@ -57,40 +71,44 @@ func (mp *MetadataProvider) IsKubeEnabled() bool { if mp == nil { return false } - switch strings.ToLower(string(mp.enable.Load().(kubeflags.EnableFlag))) { + mp.mt.Lock() + defer mp.mt.Unlock() + switch strings.ToLower(string(mp.enable)) { case string(kubeflags.EnabledTrue): return true case string(kubeflags.EnabledFalse), "": // empty value is disabled return false case string(kubeflags.EnabledAutodetect): // We autodetect that we are in a kubernetes if we can properly load a K8s configuration file - _, err := LoadConfig(mp.kubeConfigPath) + _, err := loadKubeConfig(mp.kubeConfigPath) if err != nil { klog().Debug("kubeconfig can't be detected. Assuming we are not in Kubernetes", "error", err) - mp.enable.Store(kubeflags.EnabledFalse) + mp.enable = kubeflags.EnabledFalse return false } - mp.enable.Store(kubeflags.EnabledTrue) + mp.enable = kubeflags.EnabledTrue return true default: - klog().Warn("invalid value for Enable value. Ignoring stage", "value", mp.enable.Load()) + klog().Warn("invalid value for Enable value. Ignoring stage", "value", mp.enable) return false } } func (mp *MetadataProvider) ForceDisable() { - mp.enable.Store(kubeflags.EnabledFalse) + mp.mt.Lock() + defer mp.mt.Unlock() + mp.enable = kubeflags.EnabledFalse } func (mp *MetadataProvider) KubeClient() (kubernetes.Interface, error) { - restCfg, err := LoadConfig(mp.kubeConfigPath) + restCfg, err := loadKubeConfig(mp.kubeConfigPath) if err != nil { return nil, fmt.Errorf("kubeconfig can't be detected: %w", err) } return kubernetes.NewForConfig(restCfg) } -func (mp *MetadataProvider) Get(ctx context.Context) (*Metadata, error) { +func (mp *MetadataProvider) Get(ctx context.Context) (*Store, error) { mp.mt.Lock() defer mp.mt.Unlock() @@ -98,20 +116,26 @@ func (mp *MetadataProvider) Get(ctx context.Context) (*Metadata, error) { return mp.metadata, nil } - kubeClient, err := mp.KubeClient() + informer, err := mp.getInformer(ctx) if err != nil { - return nil, fmt.Errorf("kubernetes client can't be initialized: %w", err) + return nil, err } - mp.metadata = &Metadata{ - disabledInformers: mp.disabledInformers, - SyncTimeout: mp.syncTimeout, - resyncPeriod: mp.resyncPeriod, + mp.metadata = NewStore(informer) + + return mp.metadata, nil +} + +func (mp *MetadataProvider) getInformer(ctx context.Context) (*meta.Informers, error) { + if mp.informer != nil { + return mp.informer, nil } - if err := mp.metadata.InitFromClient(ctx, kubeClient); err != nil { - return nil, fmt.Errorf("can't initialize kubernetes metadata: %w", err) + var err error + mp.informer, err = mp.initInformers(ctx) + if err != nil { + return nil, fmt.Errorf("can't get informer: %w", err) } - return mp.metadata, nil + return mp.informer, nil } func (mp *MetadataProvider) CurrentNodeName(ctx context.Context) (string, error) { @@ -142,3 +166,53 @@ func (mp *MetadataProvider) CurrentNodeName(ctx context.Context) (string, error) } return pods.Items[0].Spec.NodeName, nil } + +func (mp *MetadataProvider) initInformers(ctx context.Context) (*meta.Informers, error) { + done := make(chan error) + var informers *meta.Informers + go func() { + var err error + if informers, err = meta.InitInformers(ctx, mp.kubeConfigPath, defaultResyncTime); err != nil { + done <- err + } + close(done) + }() + + select { + case <-time.After(mp.syncTimeout): + klog().Warn("kubernetes cache has not been synced after timeout. The kubernetes attributes might be incomplete."+ + " Consider increasing the BEYLA_KUBE_INFORMERS_SYNC_TIMEOUT value", "timeout", mp.syncTimeout) + case err, ok := <-done: + if ok { + return nil, fmt.Errorf("failed to initialize Kubernetes informers: %w", err) + } + } + return informers, nil +} + +func loadKubeConfig(kubeConfigPath string) (*rest.Config, error) { + // if no config path is provided, load it from the env variable + if kubeConfigPath == "" { + kubeConfigPath = os.Getenv(kubeConfigEnvVariable) + } + // otherwise, load it from the $HOME/.kube/config file + if kubeConfigPath == "" { + homeDir, err := os.UserHomeDir() + if err != nil { + return nil, fmt.Errorf("can't get user home dir: %w", err) + } + kubeConfigPath = path.Join(homeDir, ".kube", "config") + } + config, err := clientcmd.BuildConfigFromFlags("", kubeConfigPath) + if err == nil { + return config, nil + } + // fallback: use in-cluster config + config, err = rest.InClusterConfig() + if err != nil { + return nil, fmt.Errorf("can't access kubenetes. Tried using config from: "+ + "config parameter, %s env, homedir and InClusterConfig. Got: %w", + kubeConfigEnvVariable, err) + } + return config, nil +} diff --git a/pkg/internal/kube/informer_test.go b/pkg/internal/kube/informer_test.go deleted file mode 100644 index b6455a2e1..000000000 --- a/pkg/internal/kube/informer_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package kube - -import ( - "testing" - - "github.com/stretchr/testify/assert" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -func TestServiceName(t *testing.T) { - pod := PodInfo{ - Owner: &Owner{ - Name: "nested_one", - }, - } - - pod2 := PodInfo{ - Owner: &Owner{ - LabelName: OwnerReplicaSet, - Owner: &Owner{ - Name: "nested_two", - }, - }, - } - - pod3 := PodInfo{ - ObjectMeta: metav1.ObjectMeta{ - Name: "not_nested", - }, - } - - pod5 := PodInfo{} - - assert.Equal(t, "nested_one", pod.ServiceName()) - assert.Equal(t, "nested_two", pod2.ServiceName()) - assert.Equal(t, "not_nested", pod3.ServiceName()) - assert.Equal(t, "", pod5.ServiceName()) -} diff --git a/pkg/internal/kube/informer_type.go b/pkg/internal/kube/informer_type.go deleted file mode 100644 index b54da9d1a..000000000 --- a/pkg/internal/kube/informer_type.go +++ /dev/null @@ -1,25 +0,0 @@ -package kube - -import ( - "strings" - - "github.com/grafana/beyla/pkg/internal/helpers/maps" -) - -const ( - InformerService = maps.Bits(1 << iota) - InformerNode -) - -func informerTypes(str []string) maps.Bits { - return maps.MappedBits( - str, - map[string]maps.Bits{ - "service": InformerService, - "services": InformerService, - "node": InformerNode, - "nodes": InformerNode, - }, - maps.WithTransform(strings.ToLower), - ) -} diff --git a/pkg/internal/kube/informer_type_test.go b/pkg/internal/kube/informer_type_test.go deleted file mode 100644 index 96c06f792..000000000 --- a/pkg/internal/kube/informer_type_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package kube - -import ( - "testing" - - "github.com/stretchr/testify/require" -) - -func TestInformerTypeHas(t *testing.T) { - it := informerTypes([]string{"Service", "Node"}) - require.True(t, it.Has(InformerService)) - require.True(t, it.Has(InformerNode)) - - it = informerTypes([]string{"Service"}) - require.True(t, it.Has(InformerService)) - require.False(t, it.Has(InformerNode)) - - it = informerTypes(nil) - require.False(t, it.Has(InformerService)) - require.False(t, it.Has(InformerNode)) -} diff --git a/pkg/internal/kube/owner.go b/pkg/internal/kube/owner.go deleted file mode 100644 index 13bfbb5ea..000000000 --- a/pkg/internal/kube/owner.go +++ /dev/null @@ -1,105 +0,0 @@ -package kube - -import ( - "strings" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - attr "github.com/grafana/beyla/pkg/export/attributes/names" -) - -type OwnerLabel attr.Name - -const ( - OwnerReplicaSet = OwnerLabel(attr.K8sReplicaSetName) - OwnerDeployment = OwnerLabel(attr.K8sDeploymentName) - OwnerStatefulSet = OwnerLabel(attr.K8sStatefulSetName) - OwnerDaemonSet = OwnerLabel(attr.K8sDaemonSetName) - OwnerGeneric = OwnerLabel(attr.K8sOwnerName) -) - -type Owner struct { - Kind string - LabelName OwnerLabel - Name string - // Owner of the owner. For example, a ReplicaSet might be owned by a Deployment - Owner *Owner -} - -// OwnerFrom returns the most plausible Owner reference. It might be -// null if the entity does not have any owner -func OwnerFrom(orefs []metav1.OwnerReference) *Owner { - // fallback will store any found owner that is not part of the bundled - // K8s owner types (e.g. argocd rollouts). - // It will be returned if any of the standard K8s owners are found - var fallback *Owner - for i := range orefs { - or := &orefs[i] - if or.APIVersion != "apps/v1" { - fallback = unrecognizedOwner(or) - continue - } - switch or.Kind { - case "ReplicaSet": - return &Owner{LabelName: OwnerReplicaSet, Name: or.Name, Kind: or.Kind} - case "Deployment": - return &Owner{LabelName: OwnerDeployment, Name: or.Name, Kind: or.Kind} - case "StatefulSet": - return &Owner{LabelName: OwnerStatefulSet, Name: or.Name, Kind: or.Kind} - case "DaemonSet": - return &Owner{LabelName: OwnerDaemonSet, Name: or.Name, Kind: or.Kind} - default: - fallback = unrecognizedOwner(or) - } - } - return fallback -} - -func unrecognizedOwner(or *metav1.OwnerReference) *Owner { - return &Owner{ - LabelName: OwnerLabel(attr.K8sOwnerName), - Name: or.Name, - } -} - -// TopOwner returns the top Owner in the owner chain. -// For example, if the owner is a ReplicaSet, it will return the Deployment name. -func (o *Owner) TopOwner() *Owner { - // we have two levels of ownership at most - if o != nil && o.LabelName == OwnerReplicaSet && o.Owner == nil { - // we heuristically extract the Deployment name from the replicaset name - if idx := strings.LastIndexByte(o.Name, '-'); idx > 0 { - o.Owner = &Owner{ - Name: o.Name[:idx], - LabelName: OwnerDeployment, - Kind: "Deployment", - } - } else { - // just caching the own replicaset as owner, in order to cache the result - o.Owner = o - } - return o.Owner - } - - // just return the highest existing owner (two levels of ownership maximum) - if o == nil || o.Owner == nil { - return o - } - return o.Owner -} - -func (o *Owner) String() string { - sb := strings.Builder{} - o.string(&sb) - return sb.String() -} - -func (o *Owner) string(sb *strings.Builder) { - if o.Owner != nil { - o.Owner.string(sb) - sb.WriteString("->") - } - sb.WriteString(string(o.LabelName)) - sb.WriteByte(':') - sb.WriteString(o.Name) -} diff --git a/pkg/internal/kube/owner_test.go b/pkg/internal/kube/owner_test.go deleted file mode 100644 index 9e2cba65c..000000000 --- a/pkg/internal/kube/owner_test.go +++ /dev/null @@ -1,93 +0,0 @@ -package kube - -import ( - "fmt" - "strings" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -func TestOwnerString(t *testing.T) { - owner := Owner{LabelName: OwnerReplicaSet, Name: "rs"} - assert.Equal(t, "k8s.replicaset.name:rs", owner.String()) - owner.Owner = &Owner{LabelName: OwnerDeployment, Name: "dep"} - assert.Equal(t, "k8s.deployment.name:dep->k8s.replicaset.name:rs", owner.String()) -} - -func TestOwnerFrom(t *testing.T) { - for _, kind := range []string{"ReplicaSet", "Deployment", "StatefulSet", "DaemonSet"} { - t.Run(kind, func(t *testing.T) { - owner := OwnerFrom([]v1.OwnerReference{ - {APIVersion: "foo/bar", Kind: kind, Name: "no"}, - {APIVersion: "apps/v1", Kind: "Unknown", Name: "no"}, - {APIVersion: "apps/v1", Kind: kind, Name: "theowner"}, - }) - require.NotNil(t, owner) - assert.Equal(t, &Owner{ - Kind: kind, - LabelName: OwnerLabel(fmt.Sprintf("k8s.%s.name", strings.ToLower(kind))), - Name: "theowner", - }, owner) - }) - } -} - -func TestOwnerFrom_Unrecognized(t *testing.T) { - owner := OwnerFrom([]v1.OwnerReference{ - {APIVersion: "foo/v1", Kind: "Unknown", Name: "theowner"}, - }) - require.NotNil(t, owner) - assert.Equal(t, &Owner{ - LabelName: OwnerGeneric, - Name: "theowner", - }, owner) -} - -func TestOwnerFrom_Unrecognized_AppsV1(t *testing.T) { - owner := OwnerFrom([]v1.OwnerReference{ - {APIVersion: "apps/v1", Kind: "Unknown", Name: "theowner"}, - }) - require.NotNil(t, owner) - assert.Equal(t, &Owner{ - LabelName: OwnerGeneric, - Name: "theowner", - }, owner) -} - -func TestTopOwnerLabel(t *testing.T) { - type testCase struct { - expectedLabel OwnerLabel - expectedName string - expectedKind string - owner *Owner - } - for _, tc := range []testCase{ - {expectedLabel: OwnerDaemonSet, expectedName: "ds", expectedKind: "DaemonSet", - owner: &Owner{LabelName: OwnerDaemonSet, Name: "ds", Kind: "DaemonSet"}}, - {expectedLabel: OwnerDeployment, expectedName: "rs-without-dep-meta", expectedKind: "Deployment", - owner: &Owner{LabelName: OwnerReplicaSet, Name: "rs-without-dep-meta-34fb1fa3a", Kind: "ReplicaSet"}}, - {expectedLabel: OwnerDeployment, expectedName: "dep", expectedKind: "Deployment", - owner: &Owner{LabelName: OwnerReplicaSet, Name: "dep-34fb1fa3a", Kind: "ReplicaSet", - Owner: &Owner{LabelName: OwnerDeployment, Name: "dep", Kind: "Deployment"}}}, - } { - t.Run(tc.expectedName, func(t *testing.T) { - topOwner := tc.owner.TopOwner() - assert.Equal(t, tc.expectedName, topOwner.Name) - assert.Equal(t, tc.expectedLabel, topOwner.LabelName) - assert.Equal(t, tc.expectedKind, topOwner.Kind) - - // check that the output is consistent (e.g. after ReplicaSet owner data is cached) - topOwner = tc.owner.TopOwner() - assert.Equal(t, tc.expectedName, topOwner.Name) - assert.Equal(t, tc.expectedLabel, topOwner.LabelName) - assert.Equal(t, tc.expectedKind, topOwner.Kind) - }) - } -} - -func TestTopOwner_Nil(t *testing.T) { - assert.Nil(t, (*Owner)(nil).TopOwner()) -} diff --git a/pkg/internal/kube/owners.go b/pkg/internal/kube/owners.go new file mode 100644 index 000000000..3f9a56f66 --- /dev/null +++ b/pkg/internal/kube/owners.go @@ -0,0 +1,15 @@ +package kube + +import ( + "github.com/grafana/beyla-k8s-cache/pkg/informer" +) + +// TopOwner assumes that the owners slice as returned by the informers' cache library, +// is sorted from lower-level to upper-level, so the last owner will be the top owner +// (e.g. the Deployment that owns the ReplicaSet that owns a Pod). +func TopOwner(pod *informer.PodInfo) *informer.Owner { + if pod == nil || len(pod.Owners) == 0 { + return nil + } + return pod.Owners[len(pod.Owners)-1] +} diff --git a/pkg/internal/kube/store.go b/pkg/internal/kube/store.go new file mode 100644 index 000000000..95c940b25 --- /dev/null +++ b/pkg/internal/kube/store.go @@ -0,0 +1,199 @@ +package kube + +import ( + "log/slog" + "sync" + + "github.com/grafana/beyla-k8s-cache/pkg/informer" + "github.com/grafana/beyla-k8s-cache/pkg/meta" + + "github.com/grafana/beyla/pkg/internal/helpers/container" +) + +func dblog() *slog.Logger { + return slog.With("component", "kube.Store") +} + +// Store aggregates Kubernetes information from multiple sources: +// - the informer that keep an indexed copy of the existing pods and replicasets. +// - the inspected container.Info objects, indexed either by container ID and PID namespace +// - a cache of decorated PodInfo that would avoid reconstructing them on each trace decoration +type Store struct { + log *slog.Logger + access sync.RWMutex + + metadataNotifier meta.Notifier + + containerIDs map[string]*container.Info + + // stores container info by PID. It is only required for + // deleting entries in namespaces and podsByContainer when DeleteProcess is called + containerByPID map[uint32]*container.Info + + // a single namespace will point to any container inside the pod + // but we don't care which one + namespaces map[uint32]*container.Info + + // container ID to pod matcher + podsByContainer map[string]*informer.ObjectMeta + + // ip to generic IP info (Node, Service, *including* Pods) + ipInfos map[string]*informer.ObjectMeta + + // Instead of subscribing to the informer directly, the rest of components + // will subscribe to this store, to make sure that any "new object" notification + // they receive is already present in the store + meta.BaseNotifier +} + +func NewStore(kubeMetadata meta.Notifier) *Store { + db := &Store{ + log: dblog(), + containerIDs: map[string]*container.Info{}, + namespaces: map[uint32]*container.Info{}, + podsByContainer: map[string]*informer.ObjectMeta{}, + containerByPID: map[uint32]*container.Info{}, + ipInfos: map[string]*informer.ObjectMeta{}, + metadataNotifier: kubeMetadata, + BaseNotifier: meta.NewBaseNotifier(), + } + kubeMetadata.Subscribe(db) + return db +} + +func (s *Store) ID() string { return "unique-metadata-observer" } + +// On is invoked by the informer when a new Kube object is created, updated or deleted. +// It will forward the notification to all the Stroe subscribers +func (s *Store) On(event *informer.Event) { + switch event.Type { + case informer.EventType_CREATED, informer.EventType_UPDATED: + s.updateNewObjectMetaByIPIndex(event.Resource) + // TODO: if the updated message lacks an IP that was previously present in the pod + // this might cause a memory leak, as we are not removing old entries + // this is very unlikely and the IP could be reused by another pod later + case informer.EventType_DELETED: + s.updateDeletedObjectMetaByIPIndex(event.Resource) + } + s.BaseNotifier.Notify(event) +} + +// InfoForPID is an injectable dependency for system-independent testing +var InfoForPID = container.InfoForPID + +func (s *Store) AddProcess(pid uint32) { + ifp, err := InfoForPID(pid) + if err != nil { + s.log.Debug("failing to get container information", "pid", pid, "error", err) + return + } + + s.log.Debug("Adding containerID for process", "pid", pid, "containerID", ifp.ContainerID, "pidNs", ifp.PIDNamespace) + + s.access.Lock() + defer s.access.Unlock() + s.namespaces[ifp.PIDNamespace] = &ifp + s.containerIDs[ifp.ContainerID] = &ifp + s.containerByPID[pid] = &ifp +} + +func (s *Store) DeleteProcess(pid uint32) { + s.access.Lock() + defer s.access.Unlock() + info, ok := s.containerByPID[pid] + if !ok { + return + } + delete(s.containerByPID, pid) + delete(s.namespaces, info.PIDNamespace) + delete(s.containerIDs, info.ContainerID) +} + +func (s *Store) updateNewObjectMetaByIPIndex(meta *informer.ObjectMeta) { + s.access.Lock() + defer s.access.Unlock() + for _, ip := range meta.Ips { + s.ipInfos[ip] = meta + } + if meta.Pod != nil { + s.log.Debug("adding pod to store", + "ips", meta.Ips, "pod", meta.Name, "namespace", meta.Namespace, "containerIDs", meta.Pod.ContainerIds) + for _, cid := range meta.Pod.ContainerIds { + s.podsByContainer[cid] = meta + // TODO: make sure we can handle when the containerIDs is set after this function is triggered + info, ok := s.containerIDs[cid] + if ok { + s.namespaces[info.PIDNamespace] = info + } + } + } +} + +func (s *Store) updateDeletedObjectMetaByIPIndex(meta *informer.ObjectMeta) { + s.access.Lock() + defer s.access.Unlock() + for _, ip := range meta.Ips { + delete(s.ipInfos, ip) + } + if meta.Pod != nil { + s.log.Debug("deleting pod from store", + "ips", meta.Ips, "pod", meta.Name, "namespace", meta.Namespace, "containerIDs", meta.Pod.ContainerIds) + for _, cid := range meta.Pod.ContainerIds { + info, ok := s.containerIDs[cid] + if ok { + delete(s.containerIDs, cid) + delete(s.namespaces, info.PIDNamespace) + } + } + } +} + +func (s *Store) PodByContainerID(cid string) *informer.ObjectMeta { + s.access.RLock() + defer s.access.RUnlock() + return s.podsByContainer[cid] +} + +func (s *Store) PodByPIDNs(pidns uint32) *informer.ObjectMeta { + s.access.RLock() + defer s.access.RUnlock() + if info, ok := s.namespaces[pidns]; ok { + return s.podsByContainer[info.ContainerID] + } + return nil +} + +func (s *Store) ObjectMetaByIP(ip string) *informer.ObjectMeta { + s.access.RLock() + defer s.access.RUnlock() + return s.ipInfos[ip] +} + +// ServiceNameNamespaceForIP returns the service name and namespace for a given IP address +// This means that, for a given Pod, we will not return the Pod Name, but the Pod Owner Name +func (s *Store) ServiceNameNamespaceForIP(ip string) (string, string) { + if om := s.ObjectMetaByIP(ip); om != nil { + if owner := TopOwner(om.Pod); owner != nil { + return owner.Name, om.Namespace + } + return om.Name, om.Namespace + } + return "", "" +} + +// Subscribe overrides BaseNotifier to send a "welcome message" to each new observer +// containing the whole metadata store +func (s *Store) Subscribe(observer meta.Observer) { + s.access.RLock() + defer s.access.RUnlock() + s.BaseNotifier.Subscribe(observer) + for _, pod := range s.podsByContainer { + observer.On(&informer.Event{Type: informer.EventType_CREATED, Resource: pod}) + } + // the IPInfos could contain IPInfo data from Pods already sent in the previous loop + // is the subscriber the one that should decide whether to ignore such duplicates or + // incomplete info + for _, ips := range s.ipInfos { + observer.On(&informer.Event{Type: informer.EventType_CREATED, Resource: ips}) + } +} diff --git a/pkg/internal/netolly/transform/k8s/kubernetes.go b/pkg/internal/netolly/transform/k8s/kubernetes.go index cd7a69a54..ee84f74ca 100644 --- a/pkg/internal/netolly/transform/k8s/kubernetes.go +++ b/pkg/internal/netolly/transform/k8s/kubernetes.go @@ -84,7 +84,7 @@ func MetadataDecoratorProvider( type decorator struct { log *slog.Logger alreadyLoggedIPs *simplelru.LRU[string, struct{}] - kube *kube.Metadata + kube *kube.Store clusterName string } @@ -119,8 +119,8 @@ func (n *decorator) transform(flow *ebpf.Record) bool { // decorate the flow with Kube metadata. Returns false if there is no metadata found for such IP func (n *decorator) decorate(flow *ebpf.Record, prefix, ip string) bool { - ipinfo, meta, ok := n.kube.GetInfo(ip) - if !ok { + meta := n.kube.ObjectMetaByIP(ip) + if meta == nil { if n.log.Enabled(context.TODO(), slog.LevelDebug) { // avoid spoofing the debug logs with the same message for each flow whose IP can't be decorated if !n.alreadyLoggedIPs.Contains(ip) { @@ -130,16 +130,21 @@ func (n *decorator) decorate(flow *ebpf.Record, prefix, ip string) bool { } return false } - topOwner := ipinfo.Owner.TopOwner() + ownerName, ownerKind := meta.Name, meta.Kind + if owner := kube.TopOwner(meta.Pod); owner != nil { + ownerName, ownerKind = owner.Name, owner.Kind + } + flow.Attrs.Metadata[attr.Name(prefix+attrSuffixNs)] = meta.Namespace flow.Attrs.Metadata[attr.Name(prefix+attrSuffixName)] = meta.Name - flow.Attrs.Metadata[attr.Name(prefix+attrSuffixType)] = ipinfo.Kind - flow.Attrs.Metadata[attr.Name(prefix+attrSuffixOwnerName)] = topOwner.Name - flow.Attrs.Metadata[attr.Name(prefix+attrSuffixOwnerType)] = topOwner.Kind - if ipinfo.HostIP != "" { - flow.Attrs.Metadata[attr.Name(prefix+attrSuffixHostIP)] = ipinfo.HostIP - if ipinfo.HostName != "" { - flow.Attrs.Metadata[attr.Name(prefix+attrSuffixHostName)] = ipinfo.HostName + flow.Attrs.Metadata[attr.Name(prefix+attrSuffixType)] = meta.Kind + flow.Attrs.Metadata[attr.Name(prefix+attrSuffixOwnerName)] = ownerName + flow.Attrs.Metadata[attr.Name(prefix+attrSuffixOwnerType)] = ownerKind + // add any other ownership label (they might be several, e.g. replicaset and deployment)¡ + if meta.Pod != nil && meta.Pod.HostIp != "" { + flow.Attrs.Metadata[attr.Name(prefix+attrSuffixHostIP)] = meta.Pod.HostIp + if host := n.kube.ObjectMetaByIP(meta.Pod.HostIp); host != nil { + flow.Attrs.Metadata[attr.Name(prefix+attrSuffixHostName)] = host.Name } } // decorate other names from metadata, if required @@ -156,7 +161,7 @@ func (n *decorator) decorate(flow *ebpf.Record, prefix, ip string) bool { } // newDecorator create a new transform -func newDecorator(ctx context.Context, cfg *transform.KubernetesDecorator, meta *kube.Metadata) (*decorator, error) { +func newDecorator(ctx context.Context, cfg *transform.KubernetesDecorator, meta *kube.Store) (*decorator, error) { nt := decorator{ log: log(), clusterName: transform.KubeClusterName(ctx, cfg), diff --git a/pkg/internal/pipe/global/context.go b/pkg/internal/pipe/global/context.go index a1a7a077c..e86de3511 100644 --- a/pkg/internal/pipe/global/context.go +++ b/pkg/internal/pipe/global/context.go @@ -5,7 +5,6 @@ import ( "github.com/grafana/beyla/pkg/internal/connector" "github.com/grafana/beyla/pkg/internal/imetrics" kube2 "github.com/grafana/beyla/pkg/internal/kube" - "github.com/grafana/beyla/pkg/internal/transform/kube" ) // ContextInfo stores some context information that must be shared across some nodes of the @@ -33,6 +32,4 @@ type ContextInfo struct { type AppO11y struct { // ReportRoutes sets whether the metrics should set the http.route attribute ReportRoutes bool - // K8sDatabase provides access to shared kubernetes metadata - K8sDatabase *kube.Database } diff --git a/pkg/internal/pipe/instrumenter.go b/pkg/internal/pipe/instrumenter.go index 9679e70f3..23edc03e1 100644 --- a/pkg/internal/pipe/instrumenter.go +++ b/pkg/internal/pipe/instrumenter.go @@ -108,7 +108,7 @@ func newGraphBuilder(ctx context.Context, config *beyla.Config, ctxInfo *global. pipe.AddMiddleProvider(gnb, router, transform.RoutesProvider(config.Routes)) pipe.AddMiddleProvider(gnb, kubernetes, transform.KubeDecoratorProvider(ctx, &config.Attributes.Kubernetes, ctxInfo)) - pipe.AddMiddleProvider(gnb, nameResolver, transform.NameResolutionProvider(gb.ctxInfo, config.NameResolver)) + pipe.AddMiddleProvider(gnb, nameResolver, transform.NameResolutionProvider(ctx, gb.ctxInfo, config.NameResolver)) pipe.AddMiddleProvider(gnb, attrFilter, filter.ByAttribute(config.Filters.Application, spanPtrPromGetters)) config.Metrics.Grafana = &gb.config.Grafana.OTLP pipe.AddFinalProvider(gnb, otelMetrics, otel.ReportMetrics(ctx, gb.ctxInfo, &config.Metrics, config.Attributes.Select)) diff --git a/pkg/internal/transform/kube/db.go b/pkg/internal/transform/kube/db.go deleted file mode 100644 index 9bf3d826a..000000000 --- a/pkg/internal/transform/kube/db.go +++ /dev/null @@ -1,293 +0,0 @@ -package kube - -import ( - "fmt" - "log/slog" - "sync" - - "k8s.io/client-go/tools/cache" - - "github.com/grafana/beyla/pkg/internal/helpers/container" - "github.com/grafana/beyla/pkg/internal/kube" -) - -func dblog() *slog.Logger { - return slog.With("component", "kube.Database") -} - -// Database aggregates Kubernetes information from multiple sources: -// - the informer that keep an indexed copy of the existing pods and replicasets. -// - the inspected container.Info objects, indexed either by container ID and PID namespace -// - a cache of decorated PodInfo that would avoid reconstructing them on each trace decoration -type Database struct { - informer *kube.Metadata - - access sync.RWMutex - - containerIDs map[string]*container.Info - - // a single namespace will point to any container inside the pod - // but we don't care which one - namespaces map[uint32]*container.Info - // key: pid namespace - fetchedPodsCache map[uint32]*kube.PodInfo - - // ip to pod name matcher - podsByIP map[string]*kube.PodInfo - - // ip to service name matcher - svcByIP map[string]*kube.ServiceInfo - - // ip to node name matcher - nodeByIP map[string]*kube.NodeInfo -} - -func CreateDatabase(kubeMetadata *kube.Metadata) Database { - return Database{ - fetchedPodsCache: map[uint32]*kube.PodInfo{}, - containerIDs: map[string]*container.Info{}, - namespaces: map[uint32]*container.Info{}, - podsByIP: map[string]*kube.PodInfo{}, - svcByIP: map[string]*kube.ServiceInfo{}, - nodeByIP: map[string]*kube.NodeInfo{}, - informer: kubeMetadata, - } -} - -func StartDatabase(kubeMetadata *kube.Metadata) (*Database, error) { - db := CreateDatabase(kubeMetadata) - db.informer.AddContainerEventHandler(&db) - - if err := db.informer.AddPodEventHandler(cache.ResourceEventHandlerFuncs{ - AddFunc: func(obj interface{}) { - db.UpdateNewPodsByIPIndex(obj.(*kube.PodInfo)) - }, - UpdateFunc: func(oldObj, newObj interface{}) { - db.UpdatePodsByIPIndex(oldObj.(*kube.PodInfo), newObj.(*kube.PodInfo)) - }, - DeleteFunc: func(obj interface{}) { - db.UpdateDeletedPodsByIPIndex(obj.(*kube.PodInfo)) - }, - }); err != nil { - return nil, fmt.Errorf("can't register Database as Pod event handler: %w", err) - } - if err := db.informer.AddServiceIPEventHandler(cache.ResourceEventHandlerFuncs{ - AddFunc: func(obj interface{}) { - db.UpdateNewServicesByIPIndex(obj.(*kube.ServiceInfo)) - }, - UpdateFunc: func(oldObj, newObj interface{}) { - db.UpdateDeletedServicesByIPIndex(oldObj.(*kube.ServiceInfo)) - db.UpdateNewServicesByIPIndex(newObj.(*kube.ServiceInfo)) - }, - DeleteFunc: func(obj interface{}) { - db.UpdateDeletedServicesByIPIndex(obj.(*kube.ServiceInfo)) - }, - }); err != nil { - return nil, fmt.Errorf("can't register Database as Service event handler: %w", err) - } - if err := db.informer.AddNodeEventHandler(cache.ResourceEventHandlerFuncs{ - AddFunc: func(obj interface{}) { - db.UpdateNewNodesByIPIndex(obj.(*kube.NodeInfo)) - }, - UpdateFunc: func(oldObj, newObj interface{}) { - db.UpdateDeletedNodesByIPIndex(oldObj.(*kube.NodeInfo)) - db.UpdateNewNodesByIPIndex(newObj.(*kube.NodeInfo)) - }, - DeleteFunc: func(obj interface{}) { - db.UpdateDeletedNodesByIPIndex(obj.(*kube.NodeInfo)) - }, - }); err != nil { - return nil, fmt.Errorf("can't register Database as Node event handler: %w", err) - } - - return &db, nil -} - -// OnDeletion implements ContainerEventHandler -func (id *Database) OnDeletion(containerID []string) { - id.access.Lock() - defer id.access.Unlock() - for _, cid := range containerID { - info, ok := id.containerIDs[cid] - delete(id.containerIDs, cid) - if ok { - delete(id.fetchedPodsCache, info.PIDNamespace) - delete(id.namespaces, info.PIDNamespace) - } - } -} - -func (id *Database) addProcess(ifp *container.Info) { - id.access.Lock() - defer id.access.Unlock() - delete(id.fetchedPodsCache, ifp.PIDNamespace) - id.namespaces[ifp.PIDNamespace] = ifp - id.containerIDs[ifp.ContainerID] = ifp -} - -// AddProcess also searches for the container.Info of the passed PID -func (id *Database) AddProcess(pid uint32) { - ifp, err := container.InfoForPID(pid) - if err != nil { - dblog().Debug("failing to get container information", "pid", pid, "error", err) - return - } - - id.addProcess(&ifp) -} - -func (id *Database) CleanProcessCaches(ns uint32) { - id.access.Lock() - defer id.access.Unlock() - // Don't delete the id.namespaces, we can't tell if Add/Delete events - // are in order. Deleting from the cache is safe, since it will be rebuilt. - delete(id.fetchedPodsCache, ns) -} - -// OwnerPodInfo returns the information of the pod owning the passed namespace -func (id *Database) OwnerPodInfo(pidNamespace uint32) (*kube.PodInfo, bool) { - id.access.Lock() - defer id.access.Unlock() - pod, ok := id.fetchedPodsCache[pidNamespace] - if !ok { - info, ok := id.namespaces[pidNamespace] - if !ok { - return nil, false - } - pod, ok = id.informer.GetContainerPod(info.ContainerID) - if !ok { - return nil, false - } - id.fetchedPodsCache[pidNamespace] = pod - } - return pod, true -} - -func (id *Database) UpdateNewPodsByIPIndex(pod *kube.PodInfo) { - id.access.Lock() - defer id.access.Unlock() - if len(pod.IPInfo.IPs) > 0 { - id.addPods(pod) - } -} - -func (id *Database) UpdateDeletedPodsByIPIndex(pod *kube.PodInfo) { - id.access.Lock() - defer id.access.Unlock() - if len(pod.IPInfo.IPs) > 0 { - id.deletePods(pod) - } -} - -func (id *Database) UpdatePodsByIPIndex(oldPod, newPod *kube.PodInfo) { - id.access.Lock() - defer id.access.Unlock() - id.deletePods(oldPod) - id.addPods(newPod) -} - -func (id *Database) addPods(pod *kube.PodInfo) { - for _, ip := range pod.IPInfo.IPs { - id.podsByIP[ip] = pod - } -} - -func (id *Database) deletePods(pod *kube.PodInfo) { - for _, ip := range pod.IPInfo.IPs { - delete(id.podsByIP, ip) - } -} - -func (id *Database) PodInfoForIP(ip string) *kube.PodInfo { - id.access.RLock() - defer id.access.RUnlock() - return id.podsByIP[ip] -} - -func (id *Database) UpdateNewServicesByIPIndex(svc *kube.ServiceInfo) { - id.access.Lock() - defer id.access.Unlock() - if len(svc.IPInfo.IPs) > 0 { - for _, ip := range svc.IPInfo.IPs { - id.svcByIP[ip] = svc - } - } -} - -func (id *Database) UpdateDeletedServicesByIPIndex(svc *kube.ServiceInfo) { - id.access.Lock() - defer id.access.Unlock() - if len(svc.IPInfo.IPs) > 0 { - for _, ip := range svc.IPInfo.IPs { - delete(id.svcByIP, ip) - } - } -} - -func (id *Database) ServiceInfoForIP(ip string) *kube.ServiceInfo { - id.access.RLock() - defer id.access.RUnlock() - return id.svcByIP[ip] -} - -func (id *Database) UpdateNewNodesByIPIndex(svc *kube.NodeInfo) { - id.access.Lock() - defer id.access.Unlock() - if len(svc.IPInfo.IPs) > 0 { - for _, ip := range svc.IPInfo.IPs { - id.nodeByIP[ip] = svc - } - } -} - -func (id *Database) UpdateDeletedNodesByIPIndex(svc *kube.NodeInfo) { - id.access.Lock() - defer id.access.Unlock() - if len(svc.IPInfo.IPs) > 0 { - for _, ip := range svc.IPInfo.IPs { - delete(id.nodeByIP, ip) - } - } -} - -func (id *Database) NodeInfoForIP(ip string) *kube.NodeInfo { - id.access.RLock() - defer id.access.RUnlock() - return id.nodeByIP[ip] -} - -func (id *Database) HostNameForIP(ip string) string { - id.access.RLock() - defer id.access.RUnlock() - svc, ok := id.svcByIP[ip] - if ok { - return svc.Name - } - pod, ok := id.podsByIP[ip] - if ok { - return pod.Name - } - node, ok := id.nodeByIP[ip] - if ok { - return node.Name - } - return "" -} - -func (id *Database) ServiceNameNamespaceForIP(ip string) (string, string) { - id.access.RLock() - defer id.access.RUnlock() - svc, ok := id.svcByIP[ip] - if ok { - return svc.Name, svc.Namespace - } - pod, ok := id.podsByIP[ip] - if ok { - return pod.ServiceName(), pod.Namespace - } - node, ok := id.nodeByIP[ip] - if ok { - return node.Name, node.Namespace - } - return "", "" -} diff --git a/pkg/internal/transform/kube/db_test.go b/pkg/internal/transform/kube/db_test.go deleted file mode 100644 index 32b8bcd30..000000000 --- a/pkg/internal/transform/kube/db_test.go +++ /dev/null @@ -1,61 +0,0 @@ -package kube - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/grafana/beyla/pkg/internal/helpers/container" - "github.com/grafana/beyla/pkg/internal/kube" -) - -func Test_NamespaceReuse(t *testing.T) { - db := CreateDatabase(&kube.Metadata{}) - ifp := container.Info{ - ContainerID: "a", - PIDNamespace: 111, - } - db.addProcess(&ifp) - // pretend we resolved some pod info earlier - db.fetchedPodsCache[ifp.PIDNamespace] = &kube.PodInfo{NodeName: "a"} - info, err := db.OwnerPodInfo(111) - assert.True(t, err) - assert.NotNil(t, info) - assert.Equal(t, "a", info.NodeName) - - _, ok := db.fetchedPodsCache[ifp.PIDNamespace] - assert.True(t, ok) - - ifp1 := container.Info{ - ContainerID: "b", - PIDNamespace: ifp.PIDNamespace, - } - - // We overwrite the container info with new namespace - db.addProcess(&ifp1) - _, ok = db.fetchedPodsCache[ifp.PIDNamespace] - assert.False(t, ok) -} - -func Test_NamespaceCacheCleanup(t *testing.T) { - db := CreateDatabase(&kube.Metadata{}) - ifp := container.Info{ - ContainerID: "a", - PIDNamespace: 111, - } - db.addProcess(&ifp) - // pretend we resolved some pod info earlier - db.fetchedPodsCache[ifp.PIDNamespace] = &kube.PodInfo{NodeName: "a"} - info, err := db.OwnerPodInfo(111) - assert.True(t, err) - assert.NotNil(t, info) - assert.Equal(t, "a", info.NodeName) - - _, ok := db.fetchedPodsCache[ifp.PIDNamespace] - assert.True(t, ok) - - // We overwrite the container info with new namespace - db.CleanProcessCaches(ifp.PIDNamespace) - _, ok = db.fetchedPodsCache[ifp.PIDNamespace] - assert.False(t, ok) -} diff --git a/pkg/transform/k8s.go b/pkg/transform/k8s.go index 554c520ec..0a5f40e9a 100644 --- a/pkg/transform/k8s.go +++ b/pkg/transform/k8s.go @@ -2,11 +2,14 @@ package transform import ( "context" + "fmt" "log/slog" "time" "github.com/mariomac/pipes/pipe" + "github.com/grafana/beyla-k8s-cache/pkg/informer" + attr "github.com/grafana/beyla/pkg/export/attributes/names" "github.com/grafana/beyla/pkg/internal/kube" "github.com/grafana/beyla/pkg/internal/pipe/global" @@ -61,19 +64,17 @@ func KubeDecoratorProvider( // if kubernetes decoration is disabled, we just bypass the node return pipe.Bypass[[]request.Span](), nil } - decorator := &metadataDecorator{db: ctxInfo.AppO11y.K8sDatabase, clusterName: KubeClusterName(ctx, cfg)} + metaStore, err := ctxInfo.K8sInformer.Get(ctx) + if err != nil { + return nil, fmt.Errorf("inititalizing KubeDecoratorProvider: %w", err) + } + decorator := &metadataDecorator{db: metaStore, clusterName: KubeClusterName(ctx, cfg)} return decorator.nodeLoop, nil } } -// production implementer: kube.Database -type kubeDatabase interface { - OwnerPodInfo(pidNamespace uint32) (*kube.PodInfo, bool) - HostNameForIP(ip string) string -} - type metadataDecorator struct { - db kubeDatabase + db *kube.Store clusterName string } @@ -90,55 +91,89 @@ func (md *metadataDecorator) nodeLoop(in <-chan []request.Span, out chan<- []req } func (md *metadataDecorator) do(span *request.Span) { - if podInfo, ok := md.db.OwnerPodInfo(span.Pid.Namespace); ok { - md.appendMetadata(span, podInfo) + if objectMeta := md.db.PodByPIDNs(span.Pid.Namespace); objectMeta != nil { + md.appendMetadata(span, objectMeta) } else { // do not leave the service attributes map as nil span.ServiceID.Metadata = map[attr.Name]string{} } // override the peer and host names from Kubernetes metadata, if found - if hn := md.db.HostNameForIP(span.Host); hn != "" { - span.HostName = hn + if ip := md.db.ObjectMetaByIP(span.Host); ip != nil { + span.HostName = ip.Name } - if pn := md.db.HostNameForIP(span.Peer); pn != "" { - span.PeerName = pn + if ip := md.db.ObjectMetaByIP(span.Peer); ip != nil { + span.PeerName = ip.Name } } -func (md *metadataDecorator) appendMetadata(span *request.Span, info *kube.PodInfo) { +func (md *metadataDecorator) appendMetadata(span *request.Span, meta *informer.ObjectMeta) { + if meta.Pod == nil { + // if this message happen, there is a bug + klog().Debug("pod metadata for is nil. Ignoring decoration", "meta", meta) + return + } + topOwner := kube.TopOwner(meta.Pod) // If the user has not defined criteria values for the reported // service name and namespace, we will automatically set it from // the kubernetes metadata if span.ServiceID.AutoName() { - span.ServiceID.Name = info.ServiceName() + // By contract, we expect that our custom Informer cache (beyla-k8s-cache) returns the top owner name for a Pod + // (this is, instead of the ReplicaSet name, the Deployment name) + if topOwner != nil { + span.ServiceID.Name = topOwner.Name + } else { + span.ServiceID.Name = meta.Name + } } if span.ServiceID.Namespace == "" { - span.ServiceID.Namespace = info.Namespace + span.ServiceID.Namespace = meta.Namespace } // overriding the UID here will avoid reusing the OTEL resource reporter // if the application/process was discovered and reported information // before the kubernetes metadata was available // (related issue: https://github.com/grafana/beyla/issues/1124) - span.ServiceID.UID = svc.NewUID(string(info.UID)) + span.ServiceID.UID = svc.NewUID(meta.Pod.Uid) // if, in the future, other pipeline steps modify the service metadata, we should // replace the map literal by individual entry insertions span.ServiceID.Metadata = map[attr.Name]string{ - attr.K8sNamespaceName: info.Namespace, - attr.K8sPodName: info.Name, - attr.K8sNodeName: info.NodeName, - attr.K8sPodUID: string(info.UID), - attr.K8sPodStartTime: info.StartTimeStr, + attr.K8sNamespaceName: meta.Namespace, + attr.K8sPodName: meta.Name, + attr.K8sNodeName: meta.Pod.NodeName, + attr.K8sPodUID: meta.Pod.Uid, + attr.K8sPodStartTime: meta.Pod.StartTimeStr, attr.K8sClusterName: md.clusterName, } - if info.Owner != nil { - span.ServiceID.Metadata[attr.Name(info.Owner.LabelName)] = info.Owner.Name - topOwner := info.Owner.TopOwner() - span.ServiceID.Metadata[attr.Name(topOwner.LabelName)] = topOwner.Name + + // ownerKind could be also "Pod", but we won't insert it as "owner" label to avoid + // growing cardinality + if topOwner != nil { span.ServiceID.Metadata[attr.K8sOwnerName] = topOwner.Name } + + for _, owner := range meta.Pod.Owners { + if kindLabel := OwnerLabelName(owner.Kind); kindLabel != "" { + span.ServiceID.Metadata[kindLabel] = owner.Name + } + } + // override hostname by the Pod name - span.ServiceID.HostName = info.Name + span.ServiceID.HostName = meta.Name +} + +func OwnerLabelName(kind string) attr.Name { + switch kind { + case "Deployment": + return attr.K8sDeploymentName + case "StatefulSet": + return attr.K8sStatefulSetName + case "DaemonSet": + return attr.K8sDaemonSetName + case "ReplicaSet": + return attr.K8sReplicaSetName + default: + return "" + } } func KubeClusterName(ctx context.Context, cfg *KubernetesDecorator) string { diff --git a/pkg/transform/k8s_test.go b/pkg/transform/k8s_test.go index 99f455683..b43cbe721 100644 --- a/pkg/transform/k8s_test.go +++ b/pkg/transform/k8s_test.go @@ -1,14 +1,18 @@ package transform import ( + "fmt" "testing" "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/grafana/beyla-k8s-cache/pkg/informer" + "github.com/grafana/beyla-k8s-cache/pkg/meta" attr "github.com/grafana/beyla/pkg/export/attributes/names" + "github.com/grafana/beyla/pkg/internal/helpers/container" "github.com/grafana/beyla/pkg/internal/kube" "github.com/grafana/beyla/pkg/internal/request" "github.com/grafana/beyla/pkg/internal/svc" @@ -18,32 +22,49 @@ import ( const timeout = 5 * time.Second func TestDecoration(t *testing.T) { + inf := &fakeInformer{} + store := kube.NewStore(inf) // pre-populated kubernetes metadata database - dec := metadataDecorator{db: &fakeDatabase{pidNSPods: map[uint32]*kube.PodInfo{ - 12: &kube.PodInfo{ - ObjectMeta: v1.ObjectMeta{ - Name: "pod-12", Namespace: "the-ns", UID: "uid-12", - }, + inf.Notify(&informer.Event{Type: informer.EventType_CREATED, Resource: &informer.ObjectMeta{ + Name: "pod-12", Namespace: "the-ns", Kind: "Pod", + Pod: &informer.PodInfo{ NodeName: "the-node", StartTimeStr: "2020-01-02 12:12:56", - Owner: &kube.Owner{LabelName: kube.OwnerDeployment, Name: "deployment-12"}, + Uid: "uid-12", + Owners: []*informer.Owner{{Kind: "Deployment", Name: "deployment-12"}}, + ContainerIds: []string{"container-12"}, }, - 34: &kube.PodInfo{ - ObjectMeta: v1.ObjectMeta{ - Name: "pod-34", Namespace: "the-ns", UID: "uid-34", - }, + }}) + inf.Notify(&informer.Event{Type: informer.EventType_CREATED, Resource: &informer.ObjectMeta{ + Name: "pod-34", Namespace: "the-ns", Kind: "Pod", + Pod: &informer.PodInfo{ NodeName: "the-node", StartTimeStr: "2020-01-02 12:34:56", - Owner: &kube.Owner{LabelName: kube.OwnerReplicaSet, Name: "rs-34"}, + Uid: "uid-34", + Owners: []*informer.Owner{{Kind: "ReplicaSet", Name: "rs"}}, + ContainerIds: []string{"container-34"}, }, - 56: &kube.PodInfo{ - ObjectMeta: v1.ObjectMeta{ - Name: "the-pod", Namespace: "the-ns", UID: "uid-56", - }, + }}) + inf.Notify(&informer.Event{Type: informer.EventType_CREATED, Resource: &informer.ObjectMeta{ + Name: "the-pod", Namespace: "the-ns", Kind: "Pod", + Pod: &informer.PodInfo{ NodeName: "the-node", + Uid: "uid-56", StartTimeStr: "2020-01-02 12:56:56", + ContainerIds: []string{"container-56"}, }, - }}, clusterName: "the-cluster"} + }}) + kube.InfoForPID = func(pid uint32) (container.Info, error) { + return container.Info{ + ContainerID: fmt.Sprintf("container-%d", pid), + PIDNamespace: 1000 + pid, + }, nil + } + store.AddProcess(12) + store.AddProcess(34) + store.AddProcess(56) + + dec := metadataDecorator{db: store, clusterName: "the-cluster"} inputCh, outputhCh := make(chan []request.Span, 10), make(chan []request.Span, 10) defer close(inputCh) go dec.nodeLoop(inputCh, outputhCh) @@ -53,7 +74,7 @@ func TestDecoration(t *testing.T) { t.Run("complete pod info should set deployment as name", func(t *testing.T) { inputCh <- []request.Span{{ - Pid: request.PidInfo{Namespace: 12}, ServiceID: autoNameSvc, + Pid: request.PidInfo{Namespace: 1012}, ServiceID: autoNameSvc, }} deco := testutil.ReadChannel(t, outputhCh, timeout) require.Len(t, deco, 1) @@ -70,9 +91,9 @@ func TestDecoration(t *testing.T) { "k8s.cluster.name": "the-cluster", }, deco[0].ServiceID.Metadata) }) - t.Run("pod info without deployment should set replicaset as name", func(t *testing.T) { + t.Run("pod info whose replicaset did not have an Owner should set the replicaSet name", func(t *testing.T) { inputCh <- []request.Span{{ - Pid: request.PidInfo{Namespace: 34}, ServiceID: autoNameSvc, + Pid: request.PidInfo{Namespace: 1034}, ServiceID: autoNameSvc, }} deco := testutil.ReadChannel(t, outputhCh, timeout) require.Len(t, deco, 1) @@ -81,8 +102,7 @@ func TestDecoration(t *testing.T) { assert.Equal(t, map[attr.Name]string{ "k8s.node.name": "the-node", "k8s.namespace.name": "the-ns", - "k8s.replicaset.name": "rs-34", - "k8s.deployment.name": "rs", + "k8s.replicaset.name": "rs", "k8s.owner.name": "rs", "k8s.pod.name": "pod-34", "k8s.pod.uid": "uid-34", @@ -92,7 +112,7 @@ func TestDecoration(t *testing.T) { }) t.Run("pod info with only pod name should set pod name as name", func(t *testing.T) { inputCh <- []request.Span{{ - Pid: request.PidInfo{Namespace: 56}, ServiceID: autoNameSvc, + Pid: request.PidInfo{Namespace: 1056}, ServiceID: autoNameSvc, }} deco := testutil.ReadChannel(t, outputhCh, timeout) require.Len(t, deco, 1) @@ -111,7 +131,7 @@ func TestDecoration(t *testing.T) { svc := svc.ID{Name: "exec"} svc.SetAutoName() inputCh <- []request.Span{{ - Pid: request.PidInfo{Namespace: 78}, ServiceID: svc, + Pid: request.PidInfo{Namespace: 1078}, ServiceID: svc, }} deco := testutil.ReadChannel(t, outputhCh, timeout) require.Len(t, deco, 1) @@ -121,7 +141,7 @@ func TestDecoration(t *testing.T) { }) t.Run("if service name or namespace are manually specified, don't override them", func(t *testing.T) { inputCh <- []request.Span{{ - Pid: request.PidInfo{Namespace: 12}, ServiceID: svc.ID{Name: "tralari", Namespace: "tralara"}, + Pid: request.PidInfo{Namespace: 1012}, ServiceID: svc.ID{Name: "tralari", Namespace: "tralara"}, }} deco := testutil.ReadChannel(t, outputhCh, timeout) require.Len(t, deco, 1) @@ -140,16 +160,23 @@ func TestDecoration(t *testing.T) { }) } -type fakeDatabase struct { - pidNSPods map[uint32]*kube.PodInfo - ipNames map[string]string +type fakeInformer struct { + observers map[string]meta.Observer +} + +func (f *fakeInformer) Subscribe(observer meta.Observer) { + if f.observers == nil { + f.observers = map[string]meta.Observer{} + } + f.observers[observer.ID()] = observer } -func (f *fakeDatabase) HostNameForIP(ip string) string { - return f.ipNames[ip] +func (f *fakeInformer) Unsubscribe(observer meta.Observer) { + delete(f.observers, observer.ID()) } -func (f *fakeDatabase) OwnerPodInfo(pidNamespace uint32) (*kube.PodInfo, bool) { - pi, ok := f.pidNSPods[pidNamespace] - return pi, ok +func (f *fakeInformer) Notify(event *informer.Event) { + for _, observer := range f.observers { + observer.On(event) + } } diff --git a/pkg/transform/name_resolver.go b/pkg/transform/name_resolver.go index 1d8cd8696..1fdfb479b 100644 --- a/pkg/transform/name_resolver.go +++ b/pkg/transform/name_resolver.go @@ -2,6 +2,7 @@ package transform import ( "context" + "fmt" "net" "strings" "time" @@ -11,10 +12,10 @@ import ( attr "github.com/grafana/beyla/pkg/export/attributes/names" "github.com/grafana/beyla/pkg/internal/helpers/maps" + kube2 "github.com/grafana/beyla/pkg/internal/kube" "github.com/grafana/beyla/pkg/internal/pipe/global" "github.com/grafana/beyla/pkg/internal/request" "github.com/grafana/beyla/pkg/internal/svc" - kube2 "github.com/grafana/beyla/pkg/internal/transform/kube" ) const ( @@ -46,26 +47,44 @@ type NameResolverConfig struct { type NameResolver struct { cache *expirable.LRU[string, string] cfg *NameResolverConfig - db *kube2.Database + db *kube2.Store sources maps.Bits } -func NameResolutionProvider(ctxInfo *global.ContextInfo, cfg *NameResolverConfig) pipe.MiddleProvider[[]request.Span, []request.Span] { +func NameResolutionProvider(ctx context.Context, ctxInfo *global.ContextInfo, cfg *NameResolverConfig) pipe.MiddleProvider[[]request.Span, []request.Span] { return func() (pipe.MiddleFunc[[]request.Span, []request.Span], error) { if cfg == nil || len(cfg.Sources) == 0 { return pipe.Bypass[[]request.Span](), nil } - return nameResolver(ctxInfo, cfg) + return nameResolver(ctx, ctxInfo, cfg) } } -func nameResolver(ctxInfo *global.ContextInfo, cfg *NameResolverConfig) (pipe.MiddleFunc[[]request.Span, []request.Span], error) { +func nameResolver(ctx context.Context, ctxInfo *global.ContextInfo, cfg *NameResolverConfig) (pipe.MiddleFunc[[]request.Span, []request.Span], error) { + sources := resolverSources(cfg.Sources) + + var kubeStore *kube2.Store + if ctxInfo.K8sInformer.IsKubeEnabled() { + var err error + kubeStore, err = ctxInfo.K8sInformer.Get(ctx) + if err != nil { + return nil, fmt.Errorf("initializing NameResolutionProvider: %w", err) + } + } else { + sources &= ^ResolverK8s + } + // after potentially remove k8s resolver, check again if + // this node needs to be bypassed + if sources == 0 { + return pipe.Bypass[[]request.Span](), nil + } + nr := NameResolver{ cfg: cfg, - db: ctxInfo.AppO11y.K8sDatabase, + db: kubeStore, cache: expirable.NewLRU[string, string](cfg.CacheLen, nil, cfg.CacheTTL), - sources: resolverSources(cfg.Sources), + sources: sources, } return func(in <-chan []request.Span, out chan<- []request.Span) { diff --git a/pkg/transform/name_resolver_test.go b/pkg/transform/name_resolver_test.go index 70fd54b0c..1fcb3bae2 100644 --- a/pkg/transform/name_resolver_test.go +++ b/pkg/transform/name_resolver_test.go @@ -6,13 +6,13 @@ import ( "github.com/hashicorp/golang-lru/v2/expirable" "github.com/stretchr/testify/assert" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/grafana/beyla-k8s-cache/pkg/informer" attr "github.com/grafana/beyla/pkg/export/attributes/names" kube2 "github.com/grafana/beyla/pkg/internal/kube" "github.com/grafana/beyla/pkg/internal/request" "github.com/grafana/beyla/pkg/internal/svc" - "github.com/grafana/beyla/pkg/internal/transform/kube" ) func TestSuffixPrefix(t *testing.T) { @@ -32,37 +32,26 @@ func TestSuffixPrefix(t *testing.T) { } func TestResolvePodsFromK8s(t *testing.T) { - db := kube.CreateDatabase(nil) - - pod1 := kube2.PodInfo{ - ObjectMeta: metav1.ObjectMeta{Name: "pod1"}, - IPInfo: kube2.IPInfo{IPs: []string{"10.0.0.1", "10.1.0.1"}}, - } - - pod2 := kube2.PodInfo{ - ObjectMeta: metav1.ObjectMeta{Name: "pod2", Namespace: "something"}, - IPInfo: kube2.IPInfo{IPs: []string{"10.0.0.2", "10.1.0.2"}}, - } - - pod3 := kube2.PodInfo{ - ObjectMeta: metav1.ObjectMeta{Name: "pod3"}, - IPInfo: kube2.IPInfo{IPs: []string{"10.0.0.3", "10.1.0.3"}}, - } - - db.UpdateNewPodsByIPIndex(&pod1) - db.UpdateNewPodsByIPIndex(&pod2) - db.UpdateNewPodsByIPIndex(&pod3) - - assert.Equal(t, &pod1, db.PodInfoForIP("10.0.0.1")) - assert.Equal(t, &pod1, db.PodInfoForIP("10.1.0.1")) - assert.Equal(t, &pod2, db.PodInfoForIP("10.0.0.2")) - assert.Equal(t, &pod2, db.PodInfoForIP("10.1.0.2")) - assert.Equal(t, &pod3, db.PodInfoForIP("10.1.0.3")) - db.UpdateDeletedPodsByIPIndex(&pod3) - assert.Nil(t, db.PodInfoForIP("10.1.0.3")) + inf := &fakeInformer{} + db := kube2.NewStore(inf) + pod1 := &informer.ObjectMeta{Name: "pod1", Kind: "Pod", Ips: []string{"10.0.0.1", "10.1.0.1"}} + pod2 := &informer.ObjectMeta{Name: "pod2", Namespace: "something", Kind: "Pod", Ips: []string{"10.0.0.2", "10.1.0.2"}} + pod3 := &informer.ObjectMeta{Name: "pod3", Kind: "Pod", Ips: []string{"10.0.0.3", "10.1.0.3"}} + inf.Notify(&informer.Event{Type: informer.EventType_CREATED, Resource: pod1}) + inf.Notify(&informer.Event{Type: informer.EventType_CREATED, Resource: pod2}) + inf.Notify(&informer.Event{Type: informer.EventType_CREATED, Resource: pod3}) + + assert.Equal(t, pod1, db.ObjectMetaByIP("10.0.0.1")) + assert.Equal(t, pod1, db.ObjectMetaByIP("10.1.0.1")) + assert.Equal(t, pod2, db.ObjectMetaByIP("10.0.0.2")) + assert.Equal(t, pod2, db.ObjectMetaByIP("10.1.0.2")) + assert.Equal(t, pod3, db.ObjectMetaByIP("10.1.0.3")) + + inf.Notify(&informer.Event{Type: informer.EventType_DELETED, Resource: pod3}) + assert.Nil(t, db.ObjectMetaByIP("10.1.0.3")) nr := NameResolver{ - db: &db, + db: db, cache: expirable.NewLRU[string, string](10, nil, 5*time.Hour), sources: resolverSources([]string{"dns", "k8s"}), } @@ -115,37 +104,25 @@ func TestResolvePodsFromK8s(t *testing.T) { } func TestResolveServiceFromK8s(t *testing.T) { - db := kube.CreateDatabase(nil) - - svc1 := kube2.ServiceInfo{ - ObjectMeta: metav1.ObjectMeta{Name: "pod1"}, - IPInfo: kube2.IPInfo{IPs: []string{"10.0.0.1", "10.1.0.1"}}, - } - - svc2 := kube2.ServiceInfo{ - ObjectMeta: metav1.ObjectMeta{Name: "pod2", Namespace: "something"}, - IPInfo: kube2.IPInfo{IPs: []string{"10.0.0.2", "10.1.0.2"}}, - } - - svc3 := kube2.ServiceInfo{ - ObjectMeta: metav1.ObjectMeta{Name: "pod3"}, - IPInfo: kube2.IPInfo{IPs: []string{"10.0.0.3", "10.1.0.3"}}, - } - - db.UpdateNewServicesByIPIndex(&svc1) - db.UpdateNewServicesByIPIndex(&svc2) - db.UpdateNewServicesByIPIndex(&svc3) - - assert.Equal(t, &svc1, db.ServiceInfoForIP("10.0.0.1")) - assert.Equal(t, &svc1, db.ServiceInfoForIP("10.1.0.1")) - assert.Equal(t, &svc2, db.ServiceInfoForIP("10.0.0.2")) - assert.Equal(t, &svc2, db.ServiceInfoForIP("10.1.0.2")) - assert.Equal(t, &svc3, db.ServiceInfoForIP("10.1.0.3")) - db.UpdateDeletedServicesByIPIndex(&svc3) - assert.Nil(t, db.PodInfoForIP("10.1.0.3")) + inf := &fakeInformer{} + db := kube2.NewStore(inf) + pod1 := &informer.ObjectMeta{Name: "pod1", Kind: "Service", Ips: []string{"10.0.0.1", "10.1.0.1"}} + pod2 := &informer.ObjectMeta{Name: "pod2", Namespace: "something", Kind: "Service", Ips: []string{"10.0.0.2", "10.1.0.2"}} + pod3 := &informer.ObjectMeta{Name: "pod3", Kind: "Service", Ips: []string{"10.0.0.3", "10.1.0.3"}} + inf.Notify(&informer.Event{Type: informer.EventType_CREATED, Resource: pod1}) + inf.Notify(&informer.Event{Type: informer.EventType_CREATED, Resource: pod2}) + inf.Notify(&informer.Event{Type: informer.EventType_CREATED, Resource: pod3}) + + assert.Equal(t, pod1, db.ObjectMetaByIP("10.0.0.1")) + assert.Equal(t, pod1, db.ObjectMetaByIP("10.1.0.1")) + assert.Equal(t, pod2, db.ObjectMetaByIP("10.0.0.2")) + assert.Equal(t, pod2, db.ObjectMetaByIP("10.1.0.2")) + assert.Equal(t, pod3, db.ObjectMetaByIP("10.1.0.3")) + inf.Notify(&informer.Event{Type: informer.EventType_DELETED, Resource: pod3}) + assert.Nil(t, db.ObjectMetaByIP("10.1.0.3")) nr := NameResolver{ - db: &db, + db: db, cache: expirable.NewLRU[string, string](10, nil, 5*time.Hour), sources: resolverSources([]string{"dns", "k8s"}), } @@ -217,37 +194,25 @@ func TestCleanName(t *testing.T) { } func TestResolveNodesFromK8s(t *testing.T) { - db := kube.CreateDatabase(nil) - - node1 := kube2.NodeInfo{ - ObjectMeta: metav1.ObjectMeta{Name: "node1"}, - IPInfo: kube2.IPInfo{IPs: []string{"10.0.0.1", "10.1.0.1"}}, - } - - node2 := kube2.NodeInfo{ - ObjectMeta: metav1.ObjectMeta{Name: "node2", Namespace: "something"}, - IPInfo: kube2.IPInfo{IPs: []string{"10.0.0.2", "10.1.0.2"}}, - } - - node3 := kube2.NodeInfo{ - ObjectMeta: metav1.ObjectMeta{Name: "node3"}, - IPInfo: kube2.IPInfo{IPs: []string{"10.0.0.3", "10.1.0.3"}}, - } - - db.UpdateNewNodesByIPIndex(&node1) - db.UpdateNewNodesByIPIndex(&node2) - db.UpdateNewNodesByIPIndex(&node3) - - assert.Equal(t, &node1, db.NodeInfoForIP("10.0.0.1")) - assert.Equal(t, &node1, db.NodeInfoForIP("10.1.0.1")) - assert.Equal(t, &node2, db.NodeInfoForIP("10.0.0.2")) - assert.Equal(t, &node2, db.NodeInfoForIP("10.1.0.2")) - assert.Equal(t, &node3, db.NodeInfoForIP("10.1.0.3")) - db.UpdateDeletedNodesByIPIndex(&node3) - assert.Nil(t, db.NodeInfoForIP("10.1.0.3")) + inf := &fakeInformer{} + db := kube2.NewStore(inf) + node1 := &informer.ObjectMeta{Name: "node1", Kind: "Node", Ips: []string{"10.0.0.1", "10.1.0.1"}} + node2 := &informer.ObjectMeta{Name: "node2", Namespace: "something", Kind: "Node", Ips: []string{"10.0.0.2", "10.1.0.2"}} + node3 := &informer.ObjectMeta{Name: "node3", Kind: "Node", Ips: []string{"10.0.0.3", "10.1.0.3"}} + inf.Notify(&informer.Event{Type: informer.EventType_CREATED, Resource: node1}) + inf.Notify(&informer.Event{Type: informer.EventType_CREATED, Resource: node2}) + inf.Notify(&informer.Event{Type: informer.EventType_CREATED, Resource: node3}) + + assert.Equal(t, node1, db.ObjectMetaByIP("10.0.0.1")) + assert.Equal(t, node1, db.ObjectMetaByIP("10.1.0.1")) + assert.Equal(t, node2, db.ObjectMetaByIP("10.0.0.2")) + assert.Equal(t, node2, db.ObjectMetaByIP("10.1.0.2")) + assert.Equal(t, node3, db.ObjectMetaByIP("10.1.0.3")) + inf.Notify(&informer.Event{Type: informer.EventType_DELETED, Resource: node3}) + assert.Nil(t, db.ObjectMetaByIP("10.1.0.3")) nr := NameResolver{ - db: &db, + db: db, cache: expirable.NewLRU[string, string](10, nil, 5*time.Hour), sources: resolverSources([]string{"dns", "k8s"}), } diff --git a/test/integration/components/old_grpc/backend/cmd/backend/main.go b/test/integration/components/old_grpc/backend/cmd/backend/main.go index 38bc93b6e..b91450887 100644 --- a/test/integration/components/old_grpc/backend/cmd/backend/main.go +++ b/test/integration/components/old_grpc/backend/cmd/backend/main.go @@ -6,7 +6,6 @@ import ( "time" "github.com/caarlos0/env/v7" - "github.com/mariomac/distributed-service-example/backend/pkg/rest" ) diff --git a/test/integration/components/old_grpc/worker/cmd/worker/main.go b/test/integration/components/old_grpc/worker/cmd/worker/main.go index 8192d8d81..18fba08b2 100644 --- a/test/integration/components/old_grpc/worker/cmd/worker/main.go +++ b/test/integration/components/old_grpc/worker/cmd/worker/main.go @@ -5,10 +5,9 @@ import ( "net" "github.com/caarlos0/env/v7" - "google.golang.org/grpc" - "github.com/mariomac/distributed-service-example/worker/pkg/gprc" "github.com/mariomac/distributed-service-example/worker/pkg/server" + "google.golang.org/grpc" ) type Config struct { diff --git a/vendor/github.com/grafana/beyla-k8s-cache/LICENSE b/vendor/github.com/grafana/beyla-k8s-cache/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/vendor/github.com/grafana/beyla-k8s-cache/LICENSE @@ -0,0 +1,201 @@ + 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/vendor/github.com/grafana/beyla-k8s-cache/pkg/informer/informer.pb.go b/vendor/github.com/grafana/beyla-k8s-cache/pkg/informer/informer.pb.go new file mode 100644 index 000000000..969b203d5 --- /dev/null +++ b/vendor/github.com/grafana/beyla-k8s-cache/pkg/informer/informer.pb.go @@ -0,0 +1,511 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v5.28.2 +// source: proto/informer.proto + +package informer + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + 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) +) + +// EventType represents the type of event. +type EventType int32 + +const ( + EventType_CREATED EventType = 0 + EventType_UPDATED EventType = 1 + EventType_DELETED EventType = 2 +) + +// Enum value maps for EventType. +var ( + EventType_name = map[int32]string{ + 0: "CREATED", + 1: "UPDATED", + 2: "DELETED", + } + EventType_value = map[string]int32{ + "CREATED": 0, + "UPDATED": 1, + "DELETED": 2, + } +) + +func (x EventType) Enum() *EventType { + p := new(EventType) + *p = x + return p +} + +func (x EventType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EventType) Descriptor() protoreflect.EnumDescriptor { + return file_proto_informer_proto_enumTypes[0].Descriptor() +} + +func (EventType) Type() protoreflect.EnumType { + return &file_proto_informer_proto_enumTypes[0] +} + +func (x EventType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use EventType.Descriptor instead. +func (EventType) EnumDescriptor() ([]byte, []int) { + return file_proto_informer_proto_rawDescGZIP(), []int{0} +} + +type ObjectMeta struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Ips []string `protobuf:"bytes,4,rep,name=ips,proto3" json:"ips,omitempty"` + Kind string `protobuf:"bytes,5,opt,name=kind,proto3" json:"kind,omitempty"` + // If the Kube object is not a Pod, this field will be empty. + Pod *PodInfo `protobuf:"bytes,6,opt,name=pod,proto3,oneof" json:"pod,omitempty"` +} + +func (x *ObjectMeta) Reset() { + *x = ObjectMeta{} + mi := &file_proto_informer_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ObjectMeta) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ObjectMeta) ProtoMessage() {} + +func (x *ObjectMeta) ProtoReflect() protoreflect.Message { + mi := &file_proto_informer_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ObjectMeta.ProtoReflect.Descriptor instead. +func (*ObjectMeta) Descriptor() ([]byte, []int) { + return file_proto_informer_proto_rawDescGZIP(), []int{0} +} + +func (x *ObjectMeta) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ObjectMeta) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *ObjectMeta) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *ObjectMeta) GetIps() []string { + if x != nil { + return x.Ips + } + return nil +} + +func (x *ObjectMeta) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +func (x *ObjectMeta) GetPod() *PodInfo { + if x != nil { + return x.Pod + } + return nil +} + +type PodInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` + NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` + StartTimeStr string `protobuf:"bytes,3,opt,name=start_time_str,json=startTimeStr,proto3" json:"start_time_str,omitempty"` + HostIp string `protobuf:"bytes,4,opt,name=host_ip,json=hostIp,proto3" json:"host_ip,omitempty"` + ContainerIds []string `protobuf:"bytes,5,rep,name=container_ids,json=containerIds,proto3" json:"container_ids,omitempty"` + Owners []*Owner `protobuf:"bytes,6,rep,name=owners,proto3" json:"owners,omitempty"` +} + +func (x *PodInfo) Reset() { + *x = PodInfo{} + mi := &file_proto_informer_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PodInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PodInfo) ProtoMessage() {} + +func (x *PodInfo) ProtoReflect() protoreflect.Message { + mi := &file_proto_informer_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PodInfo.ProtoReflect.Descriptor instead. +func (*PodInfo) Descriptor() ([]byte, []int) { + return file_proto_informer_proto_rawDescGZIP(), []int{1} +} + +func (x *PodInfo) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *PodInfo) GetNodeName() string { + if x != nil { + return x.NodeName + } + return "" +} + +func (x *PodInfo) GetStartTimeStr() string { + if x != nil { + return x.StartTimeStr + } + return "" +} + +func (x *PodInfo) GetHostIp() string { + if x != nil { + return x.HostIp + } + return "" +} + +func (x *PodInfo) GetContainerIds() []string { + if x != nil { + return x.ContainerIds + } + return nil +} + +func (x *PodInfo) GetOwners() []*Owner { + if x != nil { + return x.Owners + } + return nil +} + +type Owner struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` +} + +func (x *Owner) Reset() { + *x = Owner{} + mi := &file_proto_informer_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Owner) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Owner) ProtoMessage() {} + +func (x *Owner) ProtoReflect() protoreflect.Message { + mi := &file_proto_informer_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Owner.ProtoReflect.Descriptor instead. +func (*Owner) Descriptor() ([]byte, []int) { + return file_proto_informer_proto_rawDescGZIP(), []int{2} +} + +func (x *Owner) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Owner) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +// Event represents a single event. +type Event struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Todo: add timestamp: + // - avoids out-of-order events coming from different informers (local vs remote) + // - on failure/reconnection you don't need to receive all the events again + Type EventType `protobuf:"varint,1,opt,name=type,proto3,enum=informer.EventType" json:"type,omitempty"` + Resource *ObjectMeta `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` +} + +func (x *Event) Reset() { + *x = Event{} + mi := &file_proto_informer_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Event) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Event) ProtoMessage() {} + +func (x *Event) ProtoReflect() protoreflect.Message { + mi := &file_proto_informer_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Event.ProtoReflect.Descriptor instead. +func (*Event) Descriptor() ([]byte, []int) { + return file_proto_informer_proto_rawDescGZIP(), []int{3} +} + +func (x *Event) GetType() EventType { + if x != nil { + return x.Type + } + return EventType_CREATED +} + +func (x *Event) GetResource() *ObjectMeta { + if x != nil { + return x.Resource + } + return nil +} + +// Empty message for Subscribe RPC +type SubscribeMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SubscribeMessage) Reset() { + *x = SubscribeMessage{} + mi := &file_proto_informer_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SubscribeMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubscribeMessage) ProtoMessage() {} + +func (x *SubscribeMessage) ProtoReflect() protoreflect.Message { + mi := &file_proto_informer_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubscribeMessage.ProtoReflect.Descriptor instead. +func (*SubscribeMessage) Descriptor() ([]byte, []int) { + return file_proto_informer_proto_rawDescGZIP(), []int{4} +} + +var File_proto_informer_proto protoreflect.FileDescriptor + +var file_proto_informer_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, + 0x22, 0x8b, 0x02, 0x0a, 0x0a, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 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, 0x38, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x20, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x2e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x69, + 0x70, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x70, 0x73, 0x12, 0x12, 0x0a, + 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, + 0x64, 0x12, 0x28, 0x0a, 0x03, 0x70, 0x6f, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x2e, 0x50, 0x6f, 0x64, 0x49, 0x6e, 0x66, + 0x6f, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x64, 0x88, 0x01, 0x01, 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, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x64, 0x22, 0xc5, + 0x01, 0x0a, 0x07, 0x50, 0x6f, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, + 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x74, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x72, 0x12, + 0x17, 0x0a, 0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x70, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x73, 0x12, 0x27, 0x0a, + 0x06, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, + 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x06, + 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x22, 0x2f, 0x0a, 0x05, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0x62, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x12, 0x27, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, + 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x30, 0x0a, 0x08, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x69, 0x6e, + 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, + 0x61, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x53, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, + 0x32, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, + 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x50, 0x44, + 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, + 0x44, 0x10, 0x02, 0x32, 0x50, 0x0a, 0x12, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3a, 0x0a, 0x09, 0x53, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x1a, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x65, + 0x72, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x1a, 0x0f, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x2e, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x30, 0x01, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x72, + 0x6d, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_proto_informer_proto_rawDescOnce sync.Once + file_proto_informer_proto_rawDescData = file_proto_informer_proto_rawDesc +) + +func file_proto_informer_proto_rawDescGZIP() []byte { + file_proto_informer_proto_rawDescOnce.Do(func() { + file_proto_informer_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_informer_proto_rawDescData) + }) + return file_proto_informer_proto_rawDescData +} + +var file_proto_informer_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_proto_informer_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_proto_informer_proto_goTypes = []any{ + (EventType)(0), // 0: informer.EventType + (*ObjectMeta)(nil), // 1: informer.ObjectMeta + (*PodInfo)(nil), // 2: informer.PodInfo + (*Owner)(nil), // 3: informer.Owner + (*Event)(nil), // 4: informer.Event + (*SubscribeMessage)(nil), // 5: informer.SubscribeMessage + nil, // 6: informer.ObjectMeta.LabelsEntry +} +var file_proto_informer_proto_depIdxs = []int32{ + 6, // 0: informer.ObjectMeta.labels:type_name -> informer.ObjectMeta.LabelsEntry + 2, // 1: informer.ObjectMeta.pod:type_name -> informer.PodInfo + 3, // 2: informer.PodInfo.owners:type_name -> informer.Owner + 0, // 3: informer.Event.type:type_name -> informer.EventType + 1, // 4: informer.Event.resource:type_name -> informer.ObjectMeta + 5, // 5: informer.EventStreamService.Subscribe:input_type -> informer.SubscribeMessage + 4, // 6: informer.EventStreamService.Subscribe:output_type -> informer.Event + 6, // [6:7] is the sub-list for method output_type + 5, // [5:6] 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_proto_informer_proto_init() } +func file_proto_informer_proto_init() { + if File_proto_informer_proto != nil { + return + } + file_proto_informer_proto_msgTypes[0].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_informer_proto_rawDesc, + NumEnums: 1, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_proto_informer_proto_goTypes, + DependencyIndexes: file_proto_informer_proto_depIdxs, + EnumInfos: file_proto_informer_proto_enumTypes, + MessageInfos: file_proto_informer_proto_msgTypes, + }.Build() + File_proto_informer_proto = out.File + file_proto_informer_proto_rawDesc = nil + file_proto_informer_proto_goTypes = nil + file_proto_informer_proto_depIdxs = nil +} diff --git a/vendor/github.com/grafana/beyla-k8s-cache/pkg/informer/informer_grpc.pb.go b/vendor/github.com/grafana/beyla-k8s-cache/pkg/informer/informer_grpc.pb.go new file mode 100644 index 000000000..34ba20e98 --- /dev/null +++ b/vendor/github.com/grafana/beyla-k8s-cache/pkg/informer/informer_grpc.pb.go @@ -0,0 +1,130 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.28.2 +// source: proto/informer.proto + +package informer + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + EventStreamService_Subscribe_FullMethodName = "/informer.EventStreamService/Subscribe" +) + +// EventStreamServiceClient is the client API for EventStreamService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// EventStreamService defines the gRPC service for event streaming. +type EventStreamServiceClient interface { + // Subscribe allows clients to subscribe to a stream of events. + Subscribe(ctx context.Context, in *SubscribeMessage, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Event], error) +} + +type eventStreamServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewEventStreamServiceClient(cc grpc.ClientConnInterface) EventStreamServiceClient { + return &eventStreamServiceClient{cc} +} + +func (c *eventStreamServiceClient) Subscribe(ctx context.Context, in *SubscribeMessage, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Event], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &EventStreamService_ServiceDesc.Streams[0], EventStreamService_Subscribe_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[SubscribeMessage, Event]{ClientStream: 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 +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type EventStreamService_SubscribeClient = grpc.ServerStreamingClient[Event] + +// EventStreamServiceServer is the server API for EventStreamService service. +// All implementations must embed UnimplementedEventStreamServiceServer +// for forward compatibility. +// +// EventStreamService defines the gRPC service for event streaming. +type EventStreamServiceServer interface { + // Subscribe allows clients to subscribe to a stream of events. + Subscribe(*SubscribeMessage, grpc.ServerStreamingServer[Event]) error + mustEmbedUnimplementedEventStreamServiceServer() +} + +// UnimplementedEventStreamServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedEventStreamServiceServer struct{} + +func (UnimplementedEventStreamServiceServer) Subscribe(*SubscribeMessage, grpc.ServerStreamingServer[Event]) error { + return status.Errorf(codes.Unimplemented, "method Subscribe not implemented") +} +func (UnimplementedEventStreamServiceServer) mustEmbedUnimplementedEventStreamServiceServer() {} +func (UnimplementedEventStreamServiceServer) testEmbeddedByValue() {} + +// UnsafeEventStreamServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to EventStreamServiceServer will +// result in compilation errors. +type UnsafeEventStreamServiceServer interface { + mustEmbedUnimplementedEventStreamServiceServer() +} + +func RegisterEventStreamServiceServer(s grpc.ServiceRegistrar, srv EventStreamServiceServer) { + // If the following call pancis, it indicates UnimplementedEventStreamServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&EventStreamService_ServiceDesc, srv) +} + +func _EventStreamService_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SubscribeMessage) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(EventStreamServiceServer).Subscribe(m, &grpc.GenericServerStream[SubscribeMessage, Event]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type EventStreamService_SubscribeServer = grpc.ServerStreamingServer[Event] + +// EventStreamService_ServiceDesc is the grpc.ServiceDesc for EventStreamService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var EventStreamService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "informer.EventStreamService", + HandlerType: (*EventStreamServiceServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Subscribe", + Handler: _EventStreamService_Subscribe_Handler, + ServerStreams: true, + }, + }, + Metadata: "proto/informer.proto", +} diff --git a/pkg/internal/kube/cni/ovn_kubernetes.go b/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/cni/ovn_kubernetes.go similarity index 100% rename from pkg/internal/kube/cni/ovn_kubernetes.go rename to vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/cni/ovn_kubernetes.go diff --git a/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/informers.go b/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/informers.go new file mode 100644 index 000000000..4690d7ffd --- /dev/null +++ b/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/informers.go @@ -0,0 +1,43 @@ +package meta + +import ( + "log/slog" + + "k8s.io/client-go/tools/cache" + + "github.com/grafana/beyla-k8s-cache/pkg/informer" +) + +type Informers struct { + log *slog.Logger + // pods and replicaSets cache the different K8s types to custom, smaller object types + pods cache.SharedIndexInformer + nodes cache.SharedIndexInformer + services cache.SharedIndexInformer + + BaseNotifier +} + +func (i *Informers) Subscribe(observer Observer) { + i.BaseNotifier.Subscribe(observer) + + // as a "welcome" message, we send the whole kube metadata to the new observer + for _, pod := range i.pods.GetStore().List() { + observer.On(&informer.Event{ + Type: informer.EventType_CREATED, + Resource: pod.(*indexableEntity).EncodedMeta, + }) + } + for _, node := range i.nodes.GetStore().List() { + observer.On(&informer.Event{ + Type: informer.EventType_CREATED, + Resource: node.(*indexableEntity).EncodedMeta, + }) + } + for _, service := range i.services.GetStore().List() { + observer.On(&informer.Event{ + Type: informer.EventType_CREATED, + Resource: service.(*indexableEntity).EncodedMeta, + }) + } +} diff --git a/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/informers_init.go b/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/informers_init.go new file mode 100644 index 000000000..b621b4d13 --- /dev/null +++ b/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/informers_init.go @@ -0,0 +1,308 @@ +package meta + +import ( + "context" + "fmt" + "log/slog" + "net" + "os" + "path" + "strings" + "time" + + v1 "k8s.io/api/core/v1" + "k8s.io/client-go/informers" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/rest" + "k8s.io/client-go/tools/cache" + "k8s.io/client-go/tools/clientcmd" + + "github.com/grafana/beyla-k8s-cache/pkg/informer" + "github.com/grafana/beyla-k8s-cache/pkg/meta/cni" +) + +const ( + kubeConfigEnvVariable = "KUBECONFIG" + typeNode = "Node" + typePod = "Pod" + typeService = "Service" +) + +func InitInformers(ctx context.Context, kubeconfigPath string, resyncPeriod time.Duration) (*Informers, error) { + log := slog.With("component", "kube.Informers") + k := &Informers{log: log, BaseNotifier: NewBaseNotifier()} + + kubeCfg, err := loadKubeconfig(kubeconfigPath) + if err != nil { + return nil, fmt.Errorf("kubeconfig can't be loaded: %w", err) + } + kubeClient, err := kubernetes.NewForConfig(kubeCfg) + if err != nil { + return nil, fmt.Errorf("kubernetes client can't be initialized: %w", err) + } + + informerFactory := informers.NewSharedInformerFactory(kubeClient, resyncPeriod) + + if err := k.initPodInformer(informerFactory); err != nil { + return nil, err + } + if err := k.initNodeIPInformer(informerFactory); err != nil { + return nil, err + } + if err := k.initServiceIPInformer(informerFactory); err != nil { + return nil, err + } + + k.log.Debug("starting kubernetes informers, waiting for syncronization") + informerFactory.Start(ctx.Done()) + informerFactory.WaitForCacheSync(ctx.Done()) + k.log.Debug("kubernetes informers started") + return k, nil +} + +func loadKubeconfig(kubeConfigPath string) (*rest.Config, error) { + // if no config path is provided, load it from the env variable + if kubeConfigPath == "" { + kubeConfigPath = os.Getenv(kubeConfigEnvVariable) + } + // otherwise, load it from the $HOME/.kube/config file + if kubeConfigPath == "" { + homeDir, err := os.UserHomeDir() + if err != nil { + return nil, fmt.Errorf("can't get user home dir: %w", err) + } + kubeConfigPath = path.Join(homeDir, ".kube", "config") + } + config, err := clientcmd.BuildConfigFromFlags("", kubeConfigPath) + if err == nil { + return config, nil + } + // fallback: use in-cluster config + config, err = rest.InClusterConfig() + if err != nil { + return nil, fmt.Errorf("can't access kubenetes. Tried using config from: "+ + "config parameter, %s env, homedir and InClusterConfig. Got: %w", + kubeConfigEnvVariable, err) + } + return config, nil +} + +func (k *Informers) initPodInformer(informerFactory informers.SharedInformerFactory) error { + pods := informerFactory.Core().V1().Pods().Informer() + + // Transform any *v1.Pod instance into a *PodInfo instance to save space + // in the informer's cache + if err := pods.SetTransform(func(i interface{}) (interface{}, error) { + pod, ok := i.(*v1.Pod) + if !ok { + // it's Ok. The K8s library just informed from an entity + // that has been previously transformed/stored/deleted + if pi, ok := i.(*indexableEntity); ok { + return pi, nil + } + return nil, fmt.Errorf("was expecting a *v1.Pod. Got: %T", i) + } + containerIDs := make([]string, 0, + len(pod.Status.ContainerStatuses)+ + len(pod.Status.InitContainerStatuses)+ + len(pod.Status.EphemeralContainerStatuses)) + for i := range pod.Status.ContainerStatuses { + containerIDs = append(containerIDs, + rmContainerIDSchema(pod.Status.ContainerStatuses[i].ContainerID)) + } + for i := range pod.Status.InitContainerStatuses { + containerIDs = append(containerIDs, + rmContainerIDSchema(pod.Status.InitContainerStatuses[i].ContainerID)) + } + for i := range pod.Status.EphemeralContainerStatuses { + containerIDs = append(containerIDs, + rmContainerIDSchema(pod.Status.EphemeralContainerStatuses[i].ContainerID)) + } + + ips := make([]string, 0, len(pod.Status.PodIPs)) + for _, ip := range pod.Status.PodIPs { + // ignoring host-networked Pod IPs + // TODO: check towards all the Status.HostIPs slice + if ip.IP != pod.Status.HostIP { + ips = append(ips, ip.IP) + } + } + + startTime := pod.GetCreationTimestamp().String() + if k.log.Enabled(context.TODO(), slog.LevelDebug) { + k.log.Debug("inserting pod", "name", pod.Name, "namespace", pod.Namespace, "uid", pod.UID, + "node", pod.Spec.NodeName, "startTime", startTime, "containerIDs", containerIDs) + } + + return &indexableEntity{ + ObjectMeta: pod.ObjectMeta, + EncodedMeta: &informer.ObjectMeta{ + Name: pod.Name, + Namespace: pod.Namespace, + Labels: pod.Labels, + Ips: ips, + Kind: "Pod", + Pod: &informer.PodInfo{ + Uid: string(pod.UID), + NodeName: pod.Spec.NodeName, + StartTimeStr: startTime, + ContainerIds: containerIDs, + Owners: ownersFrom(&pod.ObjectMeta), + HostIp: pod.Status.HostIP, + }, + }, + }, nil + }); err != nil { + return fmt.Errorf("can't set pods transform: %w", err) + } + + _, err := pods.AddEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: func(obj interface{}) { + k.Notify(&informer.Event{ + Type: informer.EventType_CREATED, + Resource: obj.(*indexableEntity).EncodedMeta, + }) + }, + UpdateFunc: func(_, newObj interface{}) { + k.Notify(&informer.Event{ + Type: informer.EventType_UPDATED, + Resource: newObj.(*indexableEntity).EncodedMeta, + }) + }, + DeleteFunc: func(obj interface{}) { + k.Notify(&informer.Event{ + Type: informer.EventType_DELETED, + Resource: obj.(*indexableEntity).EncodedMeta, + }) + }, + }) + if err != nil { + return fmt.Errorf("can't register Pod event handler in the K8s informer: %w", err) + } + + k.log.Debug("registered Pod event handler in the K8s informer") + + k.pods = pods + return nil +} + +// rmContainerIDSchema extracts the hex ID of a container ID that is provided in the form: +// containerd://40c03570b6f4c30bc8d69923d37ee698f5cfcced92c7b7df1c47f6f7887378a9 +func rmContainerIDSchema(containerID string) string { + if parts := strings.SplitN(containerID, "://", 2); len(parts) > 1 { + return parts[1] + } + return containerID +} + +func (k *Informers) initNodeIPInformer(informerFactory informers.SharedInformerFactory) error { + nodes := informerFactory.Core().V1().Nodes().Informer() + // Transform any *v1.Node instance into an *indexableEntity instance to save space + // in the informer's cache + if err := nodes.SetTransform(func(i interface{}) (interface{}, error) { + node, ok := i.(*v1.Node) + if !ok { + // it's Ok. The K8s library just informed from an entity + // that has been previously transformed/stored + if pi, ok := i.(*indexableEntity); ok { + return pi, nil + } + return nil, fmt.Errorf("was expecting a *v1.Node. Got: %T", i) + } + ips := make([]string, 0, len(node.Status.Addresses)) + for _, address := range node.Status.Addresses { + ip := net.ParseIP(address.Address) + if ip != nil { + ips = append(ips, ip.String()) + } + } + // CNI-dependent logic (must work regardless of whether the CNI is installed) + ips = cni.AddOvnIPs(ips, node) + + return &indexableEntity{ + ObjectMeta: node.ObjectMeta, + EncodedMeta: &informer.ObjectMeta{ + Name: node.Name, + Namespace: node.Namespace, + Labels: node.Labels, + Ips: ips, + Kind: typeNode, + }, + }, nil + }); err != nil { + return fmt.Errorf("can't set nodes transform: %w", err) + } + + if _, err := nodes.AddEventHandler(k.ipInfoEventHandler()); err != nil { + return fmt.Errorf("can't register Node event handler in the K8s informer: %w", err) + } + k.log.Debug("registered Node event handler in the K8s informer") + + k.nodes = nodes + return nil +} + +func (k *Informers) initServiceIPInformer(informerFactory informers.SharedInformerFactory) error { + services := informerFactory.Core().V1().Services().Informer() + // Transform any *v1.Service instance into a *indexableEntity instance to save space + // in the informer's cache + if err := services.SetTransform(func(i interface{}) (interface{}, error) { + svc, ok := i.(*v1.Service) + if !ok { + // it's Ok. The K8s library just informed from an entity + // that has been previously transformed/stored + if pi, ok := i.(*indexableEntity); ok { + return pi, nil + } + return nil, fmt.Errorf("was expecting a *v1.Service. Got: %T", i) + } + if svc.Spec.ClusterIP == v1.ClusterIPNone { + // this will be normal for headless services + k.log.Debug("Service doesn't have any ClusterIP. Beyla won't decorate their flows", + "namespace", svc.Namespace, "name", svc.Name) + } + return &indexableEntity{ + ObjectMeta: svc.ObjectMeta, + EncodedMeta: &informer.ObjectMeta{ + Name: svc.Name, + Namespace: svc.Namespace, + Labels: svc.Labels, + Ips: svc.Spec.ClusterIPs, + Kind: typeService, + }, + }, nil + }); err != nil { + return fmt.Errorf("can't set services transform: %w", err) + } + + if _, err := services.AddEventHandler(k.ipInfoEventHandler()); err != nil { + return fmt.Errorf("can't register Service event handler in the K8s informer: %w", err) + } + k.log.Debug("registered Service event handler in the K8s informer") + + k.services = services + return nil +} + +func (k *Informers) ipInfoEventHandler() *cache.ResourceEventHandlerFuncs { + return &cache.ResourceEventHandlerFuncs{ + AddFunc: func(obj interface{}) { + k.Notify(&informer.Event{ + Type: informer.EventType_CREATED, + Resource: obj.(*indexableEntity).EncodedMeta, + }) + }, + UpdateFunc: func(_, newObj interface{}) { + k.Notify(&informer.Event{ + Type: informer.EventType_UPDATED, + Resource: newObj.(*indexableEntity).EncodedMeta, + }) + }, + DeleteFunc: func(obj interface{}) { + k.Notify(&informer.Event{ + Type: informer.EventType_DELETED, + Resource: obj.(*indexableEntity).EncodedMeta, + }) + }, + } +} diff --git a/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/observer.go b/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/observer.go new file mode 100644 index 000000000..12a401a73 --- /dev/null +++ b/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/observer.go @@ -0,0 +1,49 @@ +package meta + +import ( + "sync" + + "github.com/grafana/beyla-k8s-cache/pkg/informer" +) + +type Observer interface { + ID() string + On(event *informer.Event) +} + +type Notifier interface { + Subscribe(observer Observer) + Unsubscribe(observer Observer) + Notify(event *informer.Event) +} + +type BaseNotifier struct { + mutex sync.RWMutex + observers map[string]Observer +} + +func NewBaseNotifier() BaseNotifier { + return BaseNotifier{ + observers: make(map[string]Observer), + } +} + +func (i *BaseNotifier) Unsubscribe(observer Observer) { + i.mutex.Lock() + delete(i.observers, observer.ID()) + i.mutex.Unlock() +} + +func (i *BaseNotifier) Notify(event *informer.Event) { + i.mutex.RLock() + defer i.mutex.RUnlock() + for _, observer := range i.observers { + observer.On(event) + } +} + +func (i *BaseNotifier) Subscribe(observer Observer) { + i.mutex.Lock() + i.observers[observer.ID()] = observer + i.mutex.Unlock() +} diff --git a/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/types.go b/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/types.go new file mode 100644 index 000000000..8742e44b6 --- /dev/null +++ b/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/types.go @@ -0,0 +1,41 @@ +package meta + +import ( + "strings" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/grafana/beyla-k8s-cache/pkg/informer" +) + +type indexableEntity struct { + // the informers library requires to embed this field + metav1.ObjectMeta + // the protobuf-encoded object Metadata that will be actually sent over the wire + EncodedMeta *informer.ObjectMeta +} + +// ownerFrom returns the owner references, as well as the owners from the owners. It might be +// null if the entity does not have any owner +func ownersFrom(meta *metav1.ObjectMeta) []*informer.Owner { + if len(meta.OwnerReferences) == 0 { + // If no owner references' found, return itself as owner + return []*informer.Owner{{Kind: "Pod", Name: meta.Name}} + } + owners := make([]*informer.Owner, 0, len(meta.OwnerReferences)) + for i := range meta.OwnerReferences { + or := &meta.OwnerReferences[i] + owners = append(owners, &informer.Owner{Kind: or.Kind, Name: or.Name}) + // ReplicaSets usually have a Deployment as owner too. Returning it as well + if or.APIVersion == "apps/v1" && or.Kind == "ReplicaSet" { + // we heuristically extract the Deployment name from the replicaset name + if idx := strings.LastIndexByte(or.Name, '-'); idx > 0 { + owners = append(owners, &informer.Owner{Kind: "Deployment", Name: or.Name[:idx]}) + // we already have what we need for decoration and selection. Ignoring any other owner + // it might hypothetically have (it would be a rare case) + return owners + } + } + } + return owners +} diff --git a/vendor/gopkg.in/evanphx/json-patch.v4/.gitignore b/vendor/gopkg.in/evanphx/json-patch.v4/.gitignore deleted file mode 100644 index b7ed7f956..000000000 --- a/vendor/gopkg.in/evanphx/json-patch.v4/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# editor and IDE paraphernalia -.idea -.vscode - -# macOS paraphernalia -.DS_Store diff --git a/vendor/gopkg.in/evanphx/json-patch.v4/LICENSE b/vendor/gopkg.in/evanphx/json-patch.v4/LICENSE deleted file mode 100644 index df76d7d77..000000000 --- a/vendor/gopkg.in/evanphx/json-patch.v4/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) 2014, Evan Phoenix -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 the Evan Phoenix nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/gopkg.in/evanphx/json-patch.v4/README.md b/vendor/gopkg.in/evanphx/json-patch.v4/README.md deleted file mode 100644 index 28e351693..000000000 --- a/vendor/gopkg.in/evanphx/json-patch.v4/README.md +++ /dev/null @@ -1,317 +0,0 @@ -# JSON-Patch -`jsonpatch` is a library which provides functionality for both applying -[RFC6902 JSON patches](http://tools.ietf.org/html/rfc6902) against documents, as -well as for calculating & applying [RFC7396 JSON merge patches](https://tools.ietf.org/html/rfc7396). - -[![GoDoc](https://godoc.org/github.com/evanphx/json-patch?status.svg)](http://godoc.org/github.com/evanphx/json-patch) -[![Build Status](https://travis-ci.org/evanphx/json-patch.svg?branch=master)](https://travis-ci.org/evanphx/json-patch) -[![Report Card](https://goreportcard.com/badge/github.com/evanphx/json-patch)](https://goreportcard.com/report/github.com/evanphx/json-patch) - -# Get It! - -**Latest and greatest**: -```bash -go get -u github.com/evanphx/json-patch/v5 -``` - -**Stable Versions**: -* Version 5: `go get -u gopkg.in/evanphx/json-patch.v5` -* Version 4: `go get -u gopkg.in/evanphx/json-patch.v4` - -(previous versions below `v3` are unavailable) - -# Use It! -* [Create and apply a merge patch](#create-and-apply-a-merge-patch) -* [Create and apply a JSON Patch](#create-and-apply-a-json-patch) -* [Comparing JSON documents](#comparing-json-documents) -* [Combine merge patches](#combine-merge-patches) - - -# Configuration - -* There is a global configuration variable `jsonpatch.SupportNegativeIndices`. - This defaults to `true` and enables the non-standard practice of allowing - negative indices to mean indices starting at the end of an array. This - functionality can be disabled by setting `jsonpatch.SupportNegativeIndices = - false`. - -* There is a global configuration variable `jsonpatch.AccumulatedCopySizeLimit`, - which limits the total size increase in bytes caused by "copy" operations in a - patch. It defaults to 0, which means there is no limit. - -These global variables control the behavior of `jsonpatch.Apply`. - -An alternative to `jsonpatch.Apply` is `jsonpatch.ApplyWithOptions` whose behavior -is controlled by an `options` parameter of type `*jsonpatch.ApplyOptions`. - -Structure `jsonpatch.ApplyOptions` includes the configuration options above -and adds two new options: `AllowMissingPathOnRemove` and `EnsurePathExistsOnAdd`. - -When `AllowMissingPathOnRemove` is set to `true`, `jsonpatch.ApplyWithOptions` will ignore -`remove` operations whose `path` points to a non-existent location in the JSON document. -`AllowMissingPathOnRemove` defaults to `false` which will lead to `jsonpatch.ApplyWithOptions` -returning an error when hitting a missing `path` on `remove`. - -When `EnsurePathExistsOnAdd` is set to `true`, `jsonpatch.ApplyWithOptions` will make sure -that `add` operations produce all the `path` elements that are missing from the target object. - -Use `jsonpatch.NewApplyOptions` to create an instance of `jsonpatch.ApplyOptions` -whose values are populated from the global configuration variables. - -## Create and apply a merge patch -Given both an original JSON document and a modified JSON document, you can create -a [Merge Patch](https://tools.ietf.org/html/rfc7396) document. - -It can describe the changes needed to convert from the original to the -modified JSON document. - -Once you have a merge patch, you can apply it to other JSON documents using the -`jsonpatch.MergePatch(document, patch)` function. - -```go -package main - -import ( - "fmt" - - jsonpatch "github.com/evanphx/json-patch" -) - -func main() { - // Let's create a merge patch from these two documents... - original := []byte(`{"name": "John", "age": 24, "height": 3.21}`) - target := []byte(`{"name": "Jane", "age": 24}`) - - patch, err := jsonpatch.CreateMergePatch(original, target) - if err != nil { - panic(err) - } - - // Now lets apply the patch against a different JSON document... - - alternative := []byte(`{"name": "Tina", "age": 28, "height": 3.75}`) - modifiedAlternative, err := jsonpatch.MergePatch(alternative, patch) - - fmt.Printf("patch document: %s\n", patch) - fmt.Printf("updated alternative doc: %s\n", modifiedAlternative) -} -``` - -When ran, you get the following output: - -```bash -$ go run main.go -patch document: {"height":null,"name":"Jane"} -updated alternative doc: {"age":28,"name":"Jane"} -``` - -## Create and apply a JSON Patch -You can create patch objects using `DecodePatch([]byte)`, which can then -be applied against JSON documents. - -The following is an example of creating a patch from two operations, and -applying it against a JSON document. - -```go -package main - -import ( - "fmt" - - jsonpatch "github.com/evanphx/json-patch" -) - -func main() { - original := []byte(`{"name": "John", "age": 24, "height": 3.21}`) - patchJSON := []byte(`[ - {"op": "replace", "path": "/name", "value": "Jane"}, - {"op": "remove", "path": "/height"} - ]`) - - patch, err := jsonpatch.DecodePatch(patchJSON) - if err != nil { - panic(err) - } - - modified, err := patch.Apply(original) - if err != nil { - panic(err) - } - - fmt.Printf("Original document: %s\n", original) - fmt.Printf("Modified document: %s\n", modified) -} -``` - -When ran, you get the following output: - -```bash -$ go run main.go -Original document: {"name": "John", "age": 24, "height": 3.21} -Modified document: {"age":24,"name":"Jane"} -``` - -## Comparing JSON documents -Due to potential whitespace and ordering differences, one cannot simply compare -JSON strings or byte-arrays directly. - -As such, you can instead use `jsonpatch.Equal(document1, document2)` to -determine if two JSON documents are _structurally_ equal. This ignores -whitespace differences, and key-value ordering. - -```go -package main - -import ( - "fmt" - - jsonpatch "github.com/evanphx/json-patch" -) - -func main() { - original := []byte(`{"name": "John", "age": 24, "height": 3.21}`) - similar := []byte(` - { - "age": 24, - "height": 3.21, - "name": "John" - } - `) - different := []byte(`{"name": "Jane", "age": 20, "height": 3.37}`) - - if jsonpatch.Equal(original, similar) { - fmt.Println(`"original" is structurally equal to "similar"`) - } - - if !jsonpatch.Equal(original, different) { - fmt.Println(`"original" is _not_ structurally equal to "different"`) - } -} -``` - -When ran, you get the following output: -```bash -$ go run main.go -"original" is structurally equal to "similar" -"original" is _not_ structurally equal to "different" -``` - -## Combine merge patches -Given two JSON merge patch documents, it is possible to combine them into a -single merge patch which can describe both set of changes. - -The resulting merge patch can be used such that applying it results in a -document structurally similar as merging each merge patch to the document -in succession. - -```go -package main - -import ( - "fmt" - - jsonpatch "github.com/evanphx/json-patch" -) - -func main() { - original := []byte(`{"name": "John", "age": 24, "height": 3.21}`) - - nameAndHeight := []byte(`{"height":null,"name":"Jane"}`) - ageAndEyes := []byte(`{"age":4.23,"eyes":"blue"}`) - - // Let's combine these merge patch documents... - combinedPatch, err := jsonpatch.MergeMergePatches(nameAndHeight, ageAndEyes) - if err != nil { - panic(err) - } - - // Apply each patch individual against the original document - withoutCombinedPatch, err := jsonpatch.MergePatch(original, nameAndHeight) - if err != nil { - panic(err) - } - - withoutCombinedPatch, err = jsonpatch.MergePatch(withoutCombinedPatch, ageAndEyes) - if err != nil { - panic(err) - } - - // Apply the combined patch against the original document - - withCombinedPatch, err := jsonpatch.MergePatch(original, combinedPatch) - if err != nil { - panic(err) - } - - // Do both result in the same thing? They should! - if jsonpatch.Equal(withCombinedPatch, withoutCombinedPatch) { - fmt.Println("Both JSON documents are structurally the same!") - } - - fmt.Printf("combined merge patch: %s", combinedPatch) -} -``` - -When ran, you get the following output: -```bash -$ go run main.go -Both JSON documents are structurally the same! -combined merge patch: {"age":4.23,"eyes":"blue","height":null,"name":"Jane"} -``` - -# CLI for comparing JSON documents -You can install the commandline program `json-patch`. - -This program can take multiple JSON patch documents as arguments, -and fed a JSON document from `stdin`. It will apply the patch(es) against -the document and output the modified doc. - -**patch.1.json** -```json -[ - {"op": "replace", "path": "/name", "value": "Jane"}, - {"op": "remove", "path": "/height"} -] -``` - -**patch.2.json** -```json -[ - {"op": "add", "path": "/address", "value": "123 Main St"}, - {"op": "replace", "path": "/age", "value": "21"} -] -``` - -**document.json** -```json -{ - "name": "John", - "age": 24, - "height": 3.21 -} -``` - -You can then run: - -```bash -$ go install github.com/evanphx/json-patch/cmd/json-patch -$ cat document.json | json-patch -p patch.1.json -p patch.2.json -{"address":"123 Main St","age":"21","name":"Jane"} -``` - -# Help It! -Contributions are welcomed! Leave [an issue](https://github.com/evanphx/json-patch/issues) -or [create a PR](https://github.com/evanphx/json-patch/compare). - - -Before creating a pull request, we'd ask that you make sure tests are passing -and that you have added new tests when applicable. - -Contributors can run tests using: - -```bash -go test -cover ./... -``` - -Builds for pull requests are tested automatically -using [TravisCI](https://travis-ci.org/evanphx/json-patch). diff --git a/vendor/gopkg.in/evanphx/json-patch.v4/errors.go b/vendor/gopkg.in/evanphx/json-patch.v4/errors.go deleted file mode 100644 index 75304b443..000000000 --- a/vendor/gopkg.in/evanphx/json-patch.v4/errors.go +++ /dev/null @@ -1,38 +0,0 @@ -package jsonpatch - -import "fmt" - -// AccumulatedCopySizeError is an error type returned when the accumulated size -// increase caused by copy operations in a patch operation has exceeded the -// limit. -type AccumulatedCopySizeError struct { - limit int64 - accumulated int64 -} - -// NewAccumulatedCopySizeError returns an AccumulatedCopySizeError. -func NewAccumulatedCopySizeError(l, a int64) *AccumulatedCopySizeError { - return &AccumulatedCopySizeError{limit: l, accumulated: a} -} - -// Error implements the error interface. -func (a *AccumulatedCopySizeError) Error() string { - return fmt.Sprintf("Unable to complete the copy, the accumulated size increase of copy is %d, exceeding the limit %d", a.accumulated, a.limit) -} - -// ArraySizeError is an error type returned when the array size has exceeded -// the limit. -type ArraySizeError struct { - limit int - size int -} - -// NewArraySizeError returns an ArraySizeError. -func NewArraySizeError(l, s int) *ArraySizeError { - return &ArraySizeError{limit: l, size: s} -} - -// Error implements the error interface. -func (a *ArraySizeError) Error() string { - return fmt.Sprintf("Unable to create array of size %d, limit is %d", a.size, a.limit) -} diff --git a/vendor/gopkg.in/evanphx/json-patch.v4/merge.go b/vendor/gopkg.in/evanphx/json-patch.v4/merge.go deleted file mode 100644 index ad88d4018..000000000 --- a/vendor/gopkg.in/evanphx/json-patch.v4/merge.go +++ /dev/null @@ -1,389 +0,0 @@ -package jsonpatch - -import ( - "bytes" - "encoding/json" - "fmt" - "reflect" -) - -func merge(cur, patch *lazyNode, mergeMerge bool) *lazyNode { - curDoc, err := cur.intoDoc() - - if err != nil { - pruneNulls(patch) - return patch - } - - patchDoc, err := patch.intoDoc() - - if err != nil { - return patch - } - - mergeDocs(curDoc, patchDoc, mergeMerge) - - return cur -} - -func mergeDocs(doc, patch *partialDoc, mergeMerge bool) { - for k, v := range *patch { - if v == nil { - if mergeMerge { - (*doc)[k] = nil - } else { - delete(*doc, k) - } - } else { - cur, ok := (*doc)[k] - - if !ok || cur == nil { - if !mergeMerge { - pruneNulls(v) - } - - (*doc)[k] = v - } else { - (*doc)[k] = merge(cur, v, mergeMerge) - } - } - } -} - -func pruneNulls(n *lazyNode) { - sub, err := n.intoDoc() - - if err == nil { - pruneDocNulls(sub) - } else { - ary, err := n.intoAry() - - if err == nil { - pruneAryNulls(ary) - } - } -} - -func pruneDocNulls(doc *partialDoc) *partialDoc { - for k, v := range *doc { - if v == nil { - delete(*doc, k) - } else { - pruneNulls(v) - } - } - - return doc -} - -func pruneAryNulls(ary *partialArray) *partialArray { - newAry := []*lazyNode{} - - for _, v := range *ary { - if v != nil { - pruneNulls(v) - } - newAry = append(newAry, v) - } - - *ary = newAry - - return ary -} - -var ErrBadJSONDoc = fmt.Errorf("Invalid JSON Document") -var ErrBadJSONPatch = fmt.Errorf("Invalid JSON Patch") -var errBadMergeTypes = fmt.Errorf("Mismatched JSON Documents") - -// MergeMergePatches merges two merge patches together, such that -// applying this resulting merged merge patch to a document yields the same -// as merging each merge patch to the document in succession. -func MergeMergePatches(patch1Data, patch2Data []byte) ([]byte, error) { - return doMergePatch(patch1Data, patch2Data, true) -} - -// MergePatch merges the patchData into the docData. -func MergePatch(docData, patchData []byte) ([]byte, error) { - return doMergePatch(docData, patchData, false) -} - -func doMergePatch(docData, patchData []byte, mergeMerge bool) ([]byte, error) { - doc := &partialDoc{} - - docErr := json.Unmarshal(docData, doc) - - patch := &partialDoc{} - - patchErr := json.Unmarshal(patchData, patch) - - if _, ok := docErr.(*json.SyntaxError); ok { - return nil, ErrBadJSONDoc - } - - if _, ok := patchErr.(*json.SyntaxError); ok { - return nil, ErrBadJSONPatch - } - - if docErr == nil && *doc == nil { - return nil, ErrBadJSONDoc - } - - if patchErr == nil && *patch == nil { - return nil, ErrBadJSONPatch - } - - if docErr != nil || patchErr != nil { - // Not an error, just not a doc, so we turn straight into the patch - if patchErr == nil { - if mergeMerge { - doc = patch - } else { - doc = pruneDocNulls(patch) - } - } else { - patchAry := &partialArray{} - patchErr = json.Unmarshal(patchData, patchAry) - - if patchErr != nil { - return nil, ErrBadJSONPatch - } - - pruneAryNulls(patchAry) - - out, patchErr := json.Marshal(patchAry) - - if patchErr != nil { - return nil, ErrBadJSONPatch - } - - return out, nil - } - } else { - mergeDocs(doc, patch, mergeMerge) - } - - return json.Marshal(doc) -} - -// resemblesJSONArray indicates whether the byte-slice "appears" to be -// a JSON array or not. -// False-positives are possible, as this function does not check the internal -// structure of the array. It only checks that the outer syntax is present and -// correct. -func resemblesJSONArray(input []byte) bool { - input = bytes.TrimSpace(input) - - hasPrefix := bytes.HasPrefix(input, []byte("[")) - hasSuffix := bytes.HasSuffix(input, []byte("]")) - - return hasPrefix && hasSuffix -} - -// CreateMergePatch will return a merge patch document capable of converting -// the original document(s) to the modified document(s). -// The parameters can be bytes of either two JSON Documents, or two arrays of -// JSON documents. -// The merge patch returned follows the specification defined at http://tools.ietf.org/html/draft-ietf-appsawg-json-merge-patch-07 -func CreateMergePatch(originalJSON, modifiedJSON []byte) ([]byte, error) { - originalResemblesArray := resemblesJSONArray(originalJSON) - modifiedResemblesArray := resemblesJSONArray(modifiedJSON) - - // Do both byte-slices seem like JSON arrays? - if originalResemblesArray && modifiedResemblesArray { - return createArrayMergePatch(originalJSON, modifiedJSON) - } - - // Are both byte-slices are not arrays? Then they are likely JSON objects... - if !originalResemblesArray && !modifiedResemblesArray { - return createObjectMergePatch(originalJSON, modifiedJSON) - } - - // None of the above? Then return an error because of mismatched types. - return nil, errBadMergeTypes -} - -// createObjectMergePatch will return a merge-patch document capable of -// converting the original document to the modified document. -func createObjectMergePatch(originalJSON, modifiedJSON []byte) ([]byte, error) { - originalDoc := map[string]interface{}{} - modifiedDoc := map[string]interface{}{} - - err := json.Unmarshal(originalJSON, &originalDoc) - if err != nil { - return nil, ErrBadJSONDoc - } - - err = json.Unmarshal(modifiedJSON, &modifiedDoc) - if err != nil { - return nil, ErrBadJSONDoc - } - - dest, err := getDiff(originalDoc, modifiedDoc) - if err != nil { - return nil, err - } - - return json.Marshal(dest) -} - -// createArrayMergePatch will return an array of merge-patch documents capable -// of converting the original document to the modified document for each -// pair of JSON documents provided in the arrays. -// Arrays of mismatched sizes will result in an error. -func createArrayMergePatch(originalJSON, modifiedJSON []byte) ([]byte, error) { - originalDocs := []json.RawMessage{} - modifiedDocs := []json.RawMessage{} - - err := json.Unmarshal(originalJSON, &originalDocs) - if err != nil { - return nil, ErrBadJSONDoc - } - - err = json.Unmarshal(modifiedJSON, &modifiedDocs) - if err != nil { - return nil, ErrBadJSONDoc - } - - total := len(originalDocs) - if len(modifiedDocs) != total { - return nil, ErrBadJSONDoc - } - - result := []json.RawMessage{} - for i := 0; i < len(originalDocs); i++ { - original := originalDocs[i] - modified := modifiedDocs[i] - - patch, err := createObjectMergePatch(original, modified) - if err != nil { - return nil, err - } - - result = append(result, json.RawMessage(patch)) - } - - return json.Marshal(result) -} - -// Returns true if the array matches (must be json types). -// As is idiomatic for go, an empty array is not the same as a nil array. -func matchesArray(a, b []interface{}) bool { - if len(a) != len(b) { - return false - } - if (a == nil && b != nil) || (a != nil && b == nil) { - return false - } - for i := range a { - if !matchesValue(a[i], b[i]) { - return false - } - } - return true -} - -// Returns true if the values matches (must be json types) -// The types of the values must match, otherwise it will always return false -// If two map[string]interface{} are given, all elements must match. -func matchesValue(av, bv interface{}) bool { - if reflect.TypeOf(av) != reflect.TypeOf(bv) { - return false - } - switch at := av.(type) { - case string: - bt := bv.(string) - if bt == at { - return true - } - case float64: - bt := bv.(float64) - if bt == at { - return true - } - case bool: - bt := bv.(bool) - if bt == at { - return true - } - case nil: - // Both nil, fine. - return true - case map[string]interface{}: - bt := bv.(map[string]interface{}) - if len(bt) != len(at) { - return false - } - for key := range bt { - av, aOK := at[key] - bv, bOK := bt[key] - if aOK != bOK { - return false - } - if !matchesValue(av, bv) { - return false - } - } - return true - case []interface{}: - bt := bv.([]interface{}) - return matchesArray(at, bt) - } - return false -} - -// getDiff returns the (recursive) difference between a and b as a map[string]interface{}. -func getDiff(a, b map[string]interface{}) (map[string]interface{}, error) { - into := map[string]interface{}{} - for key, bv := range b { - av, ok := a[key] - // value was added - if !ok { - into[key] = bv - continue - } - // If types have changed, replace completely - if reflect.TypeOf(av) != reflect.TypeOf(bv) { - into[key] = bv - continue - } - // Types are the same, compare values - switch at := av.(type) { - case map[string]interface{}: - bt := bv.(map[string]interface{}) - dst := make(map[string]interface{}, len(bt)) - dst, err := getDiff(at, bt) - if err != nil { - return nil, err - } - if len(dst) > 0 { - into[key] = dst - } - case string, float64, bool: - if !matchesValue(av, bv) { - into[key] = bv - } - case []interface{}: - bt := bv.([]interface{}) - if !matchesArray(at, bt) { - into[key] = bv - } - case nil: - switch bv.(type) { - case nil: - // Both nil, fine. - default: - into[key] = bv - } - default: - panic(fmt.Sprintf("Unknown type:%T in key %s", av, key)) - } - } - // Now add all deleted values as nil - for key := range a { - _, found := b[key] - if !found { - into[key] = nil - } - } - return into, nil -} diff --git a/vendor/gopkg.in/evanphx/json-patch.v4/patch.go b/vendor/gopkg.in/evanphx/json-patch.v4/patch.go deleted file mode 100644 index dc2b7e51e..000000000 --- a/vendor/gopkg.in/evanphx/json-patch.v4/patch.go +++ /dev/null @@ -1,851 +0,0 @@ -package jsonpatch - -import ( - "bytes" - "encoding/json" - "fmt" - "strconv" - "strings" - - "github.com/pkg/errors" -) - -const ( - eRaw = iota - eDoc - eAry -) - -var ( - // SupportNegativeIndices decides whether to support non-standard practice of - // allowing negative indices to mean indices starting at the end of an array. - // Default to true. - SupportNegativeIndices bool = true - // AccumulatedCopySizeLimit limits the total size increase in bytes caused by - // "copy" operations in a patch. - AccumulatedCopySizeLimit int64 = 0 -) - -var ( - ErrTestFailed = errors.New("test failed") - ErrMissing = errors.New("missing value") - ErrUnknownType = errors.New("unknown object type") - ErrInvalid = errors.New("invalid state detected") - ErrInvalidIndex = errors.New("invalid index referenced") -) - -type lazyNode struct { - raw *json.RawMessage - doc partialDoc - ary partialArray - which int -} - -// Operation is a single JSON-Patch step, such as a single 'add' operation. -type Operation map[string]*json.RawMessage - -// Patch is an ordered collection of Operations. -type Patch []Operation - -type partialDoc map[string]*lazyNode -type partialArray []*lazyNode - -type container interface { - get(key string) (*lazyNode, error) - set(key string, val *lazyNode) error - add(key string, val *lazyNode) error - remove(key string) error -} - -func newLazyNode(raw *json.RawMessage) *lazyNode { - return &lazyNode{raw: raw, doc: nil, ary: nil, which: eRaw} -} - -func (n *lazyNode) MarshalJSON() ([]byte, error) { - switch n.which { - case eRaw: - return json.Marshal(n.raw) - case eDoc: - return json.Marshal(n.doc) - case eAry: - return json.Marshal(n.ary) - default: - return nil, ErrUnknownType - } -} - -func (n *lazyNode) UnmarshalJSON(data []byte) error { - dest := make(json.RawMessage, len(data)) - copy(dest, data) - n.raw = &dest - n.which = eRaw - return nil -} - -func deepCopy(src *lazyNode) (*lazyNode, int, error) { - if src == nil { - return nil, 0, nil - } - a, err := src.MarshalJSON() - if err != nil { - return nil, 0, err - } - sz := len(a) - ra := make(json.RawMessage, sz) - copy(ra, a) - return newLazyNode(&ra), sz, nil -} - -func (n *lazyNode) intoDoc() (*partialDoc, error) { - if n.which == eDoc { - return &n.doc, nil - } - - if n.raw == nil { - return nil, ErrInvalid - } - - err := json.Unmarshal(*n.raw, &n.doc) - - if err != nil { - return nil, err - } - - n.which = eDoc - return &n.doc, nil -} - -func (n *lazyNode) intoAry() (*partialArray, error) { - if n.which == eAry { - return &n.ary, nil - } - - if n.raw == nil { - return nil, ErrInvalid - } - - err := json.Unmarshal(*n.raw, &n.ary) - - if err != nil { - return nil, err - } - - n.which = eAry - return &n.ary, nil -} - -func (n *lazyNode) compact() []byte { - buf := &bytes.Buffer{} - - if n.raw == nil { - return nil - } - - err := json.Compact(buf, *n.raw) - - if err != nil { - return *n.raw - } - - return buf.Bytes() -} - -func (n *lazyNode) tryDoc() bool { - if n.raw == nil { - return false - } - - err := json.Unmarshal(*n.raw, &n.doc) - - if err != nil { - return false - } - - n.which = eDoc - return true -} - -func (n *lazyNode) tryAry() bool { - if n.raw == nil { - return false - } - - err := json.Unmarshal(*n.raw, &n.ary) - - if err != nil { - return false - } - - n.which = eAry - return true -} - -func (n *lazyNode) equal(o *lazyNode) bool { - if n.which == eRaw { - if !n.tryDoc() && !n.tryAry() { - if o.which != eRaw { - return false - } - - return bytes.Equal(n.compact(), o.compact()) - } - } - - if n.which == eDoc { - if o.which == eRaw { - if !o.tryDoc() { - return false - } - } - - if o.which != eDoc { - return false - } - - if len(n.doc) != len(o.doc) { - return false - } - - for k, v := range n.doc { - ov, ok := o.doc[k] - - if !ok { - return false - } - - if (v == nil) != (ov == nil) { - return false - } - - if v == nil && ov == nil { - continue - } - - if !v.equal(ov) { - return false - } - } - - return true - } - - if o.which != eAry && !o.tryAry() { - return false - } - - if len(n.ary) != len(o.ary) { - return false - } - - for idx, val := range n.ary { - if !val.equal(o.ary[idx]) { - return false - } - } - - return true -} - -// Kind reads the "op" field of the Operation. -func (o Operation) Kind() string { - if obj, ok := o["op"]; ok && obj != nil { - var op string - - err := json.Unmarshal(*obj, &op) - - if err != nil { - return "unknown" - } - - return op - } - - return "unknown" -} - -// Path reads the "path" field of the Operation. -func (o Operation) Path() (string, error) { - if obj, ok := o["path"]; ok && obj != nil { - var op string - - err := json.Unmarshal(*obj, &op) - - if err != nil { - return "unknown", err - } - - return op, nil - } - - return "unknown", errors.Wrapf(ErrMissing, "operation missing path field") -} - -// From reads the "from" field of the Operation. -func (o Operation) From() (string, error) { - if obj, ok := o["from"]; ok && obj != nil { - var op string - - err := json.Unmarshal(*obj, &op) - - if err != nil { - return "unknown", err - } - - return op, nil - } - - return "unknown", errors.Wrapf(ErrMissing, "operation, missing from field") -} - -func (o Operation) value() *lazyNode { - if obj, ok := o["value"]; ok { - return newLazyNode(obj) - } - - return nil -} - -// ValueInterface decodes the operation value into an interface. -func (o Operation) ValueInterface() (interface{}, error) { - if obj, ok := o["value"]; ok && obj != nil { - var v interface{} - - err := json.Unmarshal(*obj, &v) - - if err != nil { - return nil, err - } - - return v, nil - } - - return nil, errors.Wrapf(ErrMissing, "operation, missing value field") -} - -func isArray(buf []byte) bool { -Loop: - for _, c := range buf { - switch c { - case ' ': - case '\n': - case '\t': - continue - case '[': - return true - default: - break Loop - } - } - - return false -} - -func findObject(pd *container, path string) (container, string) { - doc := *pd - - split := strings.Split(path, "/") - - if len(split) < 2 { - return nil, "" - } - - parts := split[1 : len(split)-1] - - key := split[len(split)-1] - - var err error - - for _, part := range parts { - - next, ok := doc.get(decodePatchKey(part)) - - if next == nil || ok != nil { - return nil, "" - } - - if isArray(*next.raw) { - doc, err = next.intoAry() - - if err != nil { - return nil, "" - } - } else { - doc, err = next.intoDoc() - - if err != nil { - return nil, "" - } - } - } - - return doc, decodePatchKey(key) -} - -func (d *partialDoc) set(key string, val *lazyNode) error { - (*d)[key] = val - return nil -} - -func (d *partialDoc) add(key string, val *lazyNode) error { - (*d)[key] = val - return nil -} - -func (d *partialDoc) get(key string) (*lazyNode, error) { - return (*d)[key], nil -} - -func (d *partialDoc) remove(key string) error { - _, ok := (*d)[key] - if !ok { - return errors.Wrapf(ErrMissing, "Unable to remove nonexistent key: %s", key) - } - - delete(*d, key) - return nil -} - -// set should only be used to implement the "replace" operation, so "key" must -// be an already existing index in "d". -func (d *partialArray) set(key string, val *lazyNode) error { - idx, err := strconv.Atoi(key) - if err != nil { - return err - } - - if idx < 0 { - if !SupportNegativeIndices { - return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) - } - if idx < -len(*d) { - return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) - } - idx += len(*d) - } - - (*d)[idx] = val - return nil -} - -func (d *partialArray) add(key string, val *lazyNode) error { - if key == "-" { - *d = append(*d, val) - return nil - } - - idx, err := strconv.Atoi(key) - if err != nil { - return errors.Wrapf(err, "value was not a proper array index: '%s'", key) - } - - sz := len(*d) + 1 - - ary := make([]*lazyNode, sz) - - cur := *d - - if idx >= len(ary) { - return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) - } - - if idx < 0 { - if !SupportNegativeIndices { - return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) - } - if idx < -len(ary) { - return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) - } - idx += len(ary) - } - - copy(ary[0:idx], cur[0:idx]) - ary[idx] = val - copy(ary[idx+1:], cur[idx:]) - - *d = ary - return nil -} - -func (d *partialArray) get(key string) (*lazyNode, error) { - idx, err := strconv.Atoi(key) - - if err != nil { - return nil, err - } - - if idx < 0 { - if !SupportNegativeIndices { - return nil, errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) - } - if idx < -len(*d) { - return nil, errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) - } - idx += len(*d) - } - - if idx >= len(*d) { - return nil, errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) - } - - return (*d)[idx], nil -} - -func (d *partialArray) remove(key string) error { - idx, err := strconv.Atoi(key) - if err != nil { - return err - } - - cur := *d - - if idx >= len(cur) { - return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) - } - - if idx < 0 { - if !SupportNegativeIndices { - return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) - } - if idx < -len(cur) { - return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) - } - idx += len(cur) - } - - ary := make([]*lazyNode, len(cur)-1) - - copy(ary[0:idx], cur[0:idx]) - copy(ary[idx:], cur[idx+1:]) - - *d = ary - return nil - -} - -func (p Patch) add(doc *container, op Operation) error { - path, err := op.Path() - if err != nil { - return errors.Wrapf(ErrMissing, "add operation failed to decode path") - } - - con, key := findObject(doc, path) - - if con == nil { - return errors.Wrapf(ErrMissing, "add operation does not apply: doc is missing path: \"%s\"", path) - } - - err = con.add(key, op.value()) - if err != nil { - return errors.Wrapf(err, "error in add for path: '%s'", path) - } - - return nil -} - -func (p Patch) remove(doc *container, op Operation) error { - path, err := op.Path() - if err != nil { - return errors.Wrapf(ErrMissing, "remove operation failed to decode path") - } - - con, key := findObject(doc, path) - - if con == nil { - return errors.Wrapf(ErrMissing, "remove operation does not apply: doc is missing path: \"%s\"", path) - } - - err = con.remove(key) - if err != nil { - return errors.Wrapf(err, "error in remove for path: '%s'", path) - } - - return nil -} - -func (p Patch) replace(doc *container, op Operation) error { - path, err := op.Path() - if err != nil { - return errors.Wrapf(err, "replace operation failed to decode path") - } - - if path == "" { - val := op.value() - - if val.which == eRaw { - if !val.tryDoc() { - if !val.tryAry() { - return errors.Wrapf(err, "replace operation value must be object or array") - } - } - } - - switch val.which { - case eAry: - *doc = &val.ary - case eDoc: - *doc = &val.doc - case eRaw: - return errors.Wrapf(err, "replace operation hit impossible case") - } - - return nil - } - - con, key := findObject(doc, path) - - if con == nil { - return errors.Wrapf(ErrMissing, "replace operation does not apply: doc is missing path: %s", path) - } - - _, ok := con.get(key) - if ok != nil { - return errors.Wrapf(ErrMissing, "replace operation does not apply: doc is missing key: %s", path) - } - - err = con.set(key, op.value()) - if err != nil { - return errors.Wrapf(err, "error in remove for path: '%s'", path) - } - - return nil -} - -func (p Patch) move(doc *container, op Operation) error { - from, err := op.From() - if err != nil { - return errors.Wrapf(err, "move operation failed to decode from") - } - - con, key := findObject(doc, from) - - if con == nil { - return errors.Wrapf(ErrMissing, "move operation does not apply: doc is missing from path: %s", from) - } - - val, err := con.get(key) - if err != nil { - return errors.Wrapf(err, "error in move for path: '%s'", key) - } - - err = con.remove(key) - if err != nil { - return errors.Wrapf(err, "error in move for path: '%s'", key) - } - - path, err := op.Path() - if err != nil { - return errors.Wrapf(err, "move operation failed to decode path") - } - - con, key = findObject(doc, path) - - if con == nil { - return errors.Wrapf(ErrMissing, "move operation does not apply: doc is missing destination path: %s", path) - } - - err = con.add(key, val) - if err != nil { - return errors.Wrapf(err, "error in move for path: '%s'", path) - } - - return nil -} - -func (p Patch) test(doc *container, op Operation) error { - path, err := op.Path() - if err != nil { - return errors.Wrapf(err, "test operation failed to decode path") - } - - if path == "" { - var self lazyNode - - switch sv := (*doc).(type) { - case *partialDoc: - self.doc = *sv - self.which = eDoc - case *partialArray: - self.ary = *sv - self.which = eAry - } - - if self.equal(op.value()) { - return nil - } - - return errors.Wrapf(ErrTestFailed, "testing value %s failed", path) - } - - con, key := findObject(doc, path) - - if con == nil { - return errors.Wrapf(ErrMissing, "test operation does not apply: is missing path: %s", path) - } - - val, err := con.get(key) - if err != nil { - return errors.Wrapf(err, "error in test for path: '%s'", path) - } - - if val == nil { - if op.value().raw == nil { - return nil - } - return errors.Wrapf(ErrTestFailed, "testing value %s failed", path) - } else if op.value() == nil { - return errors.Wrapf(ErrTestFailed, "testing value %s failed", path) - } - - if val.equal(op.value()) { - return nil - } - - return errors.Wrapf(ErrTestFailed, "testing value %s failed", path) -} - -func (p Patch) copy(doc *container, op Operation, accumulatedCopySize *int64) error { - from, err := op.From() - if err != nil { - return errors.Wrapf(err, "copy operation failed to decode from") - } - - con, key := findObject(doc, from) - - if con == nil { - return errors.Wrapf(ErrMissing, "copy operation does not apply: doc is missing from path: %s", from) - } - - val, err := con.get(key) - if err != nil { - return errors.Wrapf(err, "error in copy for from: '%s'", from) - } - - path, err := op.Path() - if err != nil { - return errors.Wrapf(ErrMissing, "copy operation failed to decode path") - } - - con, key = findObject(doc, path) - - if con == nil { - return errors.Wrapf(ErrMissing, "copy operation does not apply: doc is missing destination path: %s", path) - } - - valCopy, sz, err := deepCopy(val) - if err != nil { - return errors.Wrapf(err, "error while performing deep copy") - } - - (*accumulatedCopySize) += int64(sz) - if AccumulatedCopySizeLimit > 0 && *accumulatedCopySize > AccumulatedCopySizeLimit { - return NewAccumulatedCopySizeError(AccumulatedCopySizeLimit, *accumulatedCopySize) - } - - err = con.add(key, valCopy) - if err != nil { - return errors.Wrapf(err, "error while adding value during copy") - } - - return nil -} - -// Equal indicates if 2 JSON documents have the same structural equality. -func Equal(a, b []byte) bool { - ra := make(json.RawMessage, len(a)) - copy(ra, a) - la := newLazyNode(&ra) - - rb := make(json.RawMessage, len(b)) - copy(rb, b) - lb := newLazyNode(&rb) - - return la.equal(lb) -} - -// DecodePatch decodes the passed JSON document as an RFC 6902 patch. -func DecodePatch(buf []byte) (Patch, error) { - var p Patch - - err := json.Unmarshal(buf, &p) - - if err != nil { - return nil, err - } - - return p, nil -} - -// Apply mutates a JSON document according to the patch, and returns the new -// document. -func (p Patch) Apply(doc []byte) ([]byte, error) { - return p.ApplyIndent(doc, "") -} - -// ApplyIndent mutates a JSON document according to the patch, and returns the new -// document indented. -func (p Patch) ApplyIndent(doc []byte, indent string) ([]byte, error) { - if len(doc) == 0 { - return doc, nil - } - - var pd container - if doc[0] == '[' { - pd = &partialArray{} - } else { - pd = &partialDoc{} - } - - err := json.Unmarshal(doc, pd) - - if err != nil { - return nil, err - } - - err = nil - - var accumulatedCopySize int64 - - for _, op := range p { - switch op.Kind() { - case "add": - err = p.add(&pd, op) - case "remove": - err = p.remove(&pd, op) - case "replace": - err = p.replace(&pd, op) - case "move": - err = p.move(&pd, op) - case "test": - err = p.test(&pd, op) - case "copy": - err = p.copy(&pd, op, &accumulatedCopySize) - default: - err = fmt.Errorf("Unexpected kind: %s", op.Kind()) - } - - if err != nil { - return nil, err - } - } - - if indent != "" { - return json.MarshalIndent(pd, "", indent) - } - - return json.Marshal(pd) -} - -// From http://tools.ietf.org/html/rfc6901#section-4 : -// -// Evaluation of each reference token begins by decoding any escaped -// character sequence. This is performed by first transforming any -// occurrence of the sequence '~1' to '/', and then transforming any -// occurrence of the sequence '~0' to '~'. - -var ( - rfc6901Decoder = strings.NewReplacer("~1", "/", "~0", "~") -) - -func decodePatchKey(k string) string { - return rfc6901Decoder.Replace(k) -} diff --git a/vendor/k8s.io/api/imagepolicy/v1alpha1/doc.go b/vendor/k8s.io/api/imagepolicy/v1alpha1/doc.go deleted file mode 100644 index 5db6d52d4..000000000 --- a/vendor/k8s.io/api/imagepolicy/v1alpha1/doc.go +++ /dev/null @@ -1,23 +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. -*/ - -// +k8s:deepcopy-gen=package -// +k8s:protobuf-gen=package -// +k8s:openapi-gen=true - -// +groupName=imagepolicy.k8s.io - -package v1alpha1 // import "k8s.io/api/imagepolicy/v1alpha1" diff --git a/vendor/k8s.io/api/imagepolicy/v1alpha1/generated.pb.go b/vendor/k8s.io/api/imagepolicy/v1alpha1/generated.pb.go deleted file mode 100644 index 57732a516..000000000 --- a/vendor/k8s.io/api/imagepolicy/v1alpha1/generated.pb.go +++ /dev/null @@ -1,1374 +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: k8s.io/api/imagepolicy/v1alpha1/generated.proto - -package v1alpha1 - -import ( - fmt "fmt" - - io "io" - - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// 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 - -func (m *ImageReview) Reset() { *m = ImageReview{} } -func (*ImageReview) ProtoMessage() {} -func (*ImageReview) Descriptor() ([]byte, []int) { - return fileDescriptor_7620d1538838ac6f, []int{0} -} -func (m *ImageReview) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ImageReview) 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 *ImageReview) XXX_Merge(src proto.Message) { - xxx_messageInfo_ImageReview.Merge(m, src) -} -func (m *ImageReview) XXX_Size() int { - return m.Size() -} -func (m *ImageReview) XXX_DiscardUnknown() { - xxx_messageInfo_ImageReview.DiscardUnknown(m) -} - -var xxx_messageInfo_ImageReview proto.InternalMessageInfo - -func (m *ImageReviewContainerSpec) Reset() { *m = ImageReviewContainerSpec{} } -func (*ImageReviewContainerSpec) ProtoMessage() {} -func (*ImageReviewContainerSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_7620d1538838ac6f, []int{1} -} -func (m *ImageReviewContainerSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ImageReviewContainerSpec) 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 *ImageReviewContainerSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_ImageReviewContainerSpec.Merge(m, src) -} -func (m *ImageReviewContainerSpec) XXX_Size() int { - return m.Size() -} -func (m *ImageReviewContainerSpec) XXX_DiscardUnknown() { - xxx_messageInfo_ImageReviewContainerSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_ImageReviewContainerSpec proto.InternalMessageInfo - -func (m *ImageReviewSpec) Reset() { *m = ImageReviewSpec{} } -func (*ImageReviewSpec) ProtoMessage() {} -func (*ImageReviewSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_7620d1538838ac6f, []int{2} -} -func (m *ImageReviewSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ImageReviewSpec) 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 *ImageReviewSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_ImageReviewSpec.Merge(m, src) -} -func (m *ImageReviewSpec) XXX_Size() int { - return m.Size() -} -func (m *ImageReviewSpec) XXX_DiscardUnknown() { - xxx_messageInfo_ImageReviewSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_ImageReviewSpec proto.InternalMessageInfo - -func (m *ImageReviewStatus) Reset() { *m = ImageReviewStatus{} } -func (*ImageReviewStatus) ProtoMessage() {} -func (*ImageReviewStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_7620d1538838ac6f, []int{3} -} -func (m *ImageReviewStatus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ImageReviewStatus) 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 *ImageReviewStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_ImageReviewStatus.Merge(m, src) -} -func (m *ImageReviewStatus) XXX_Size() int { - return m.Size() -} -func (m *ImageReviewStatus) XXX_DiscardUnknown() { - xxx_messageInfo_ImageReviewStatus.DiscardUnknown(m) -} - -var xxx_messageInfo_ImageReviewStatus proto.InternalMessageInfo - -func init() { - proto.RegisterType((*ImageReview)(nil), "k8s.io.api.imagepolicy.v1alpha1.ImageReview") - proto.RegisterType((*ImageReviewContainerSpec)(nil), "k8s.io.api.imagepolicy.v1alpha1.ImageReviewContainerSpec") - proto.RegisterType((*ImageReviewSpec)(nil), "k8s.io.api.imagepolicy.v1alpha1.ImageReviewSpec") - proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.imagepolicy.v1alpha1.ImageReviewSpec.AnnotationsEntry") - proto.RegisterType((*ImageReviewStatus)(nil), "k8s.io.api.imagepolicy.v1alpha1.ImageReviewStatus") - proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.imagepolicy.v1alpha1.ImageReviewStatus.AuditAnnotationsEntry") -} - -func init() { - proto.RegisterFile("k8s.io/api/imagepolicy/v1alpha1/generated.proto", fileDescriptor_7620d1538838ac6f) -} - -var fileDescriptor_7620d1538838ac6f = []byte{ - // 593 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x4f, 0x6f, 0xd3, 0x30, - 0x18, 0xc6, 0x9b, 0x74, 0xff, 0xea, 0x02, 0xeb, 0x0c, 0x48, 0x51, 0x0f, 0xe9, 0x54, 0x24, 0x34, - 0x0e, 0xd8, 0xb4, 0x42, 0x68, 0x70, 0x00, 0x35, 0xd3, 0x24, 0x38, 0x00, 0x92, 0xb9, 0xed, 0x84, - 0x9b, 0x9a, 0xd4, 0xb4, 0x89, 0xa3, 0xd8, 0xe9, 0xe8, 0x8d, 0x4f, 0x80, 0xf8, 0x06, 0x7c, 0x11, - 0x3e, 0x40, 0x8f, 0x3b, 0xee, 0x34, 0xd1, 0x70, 0xe4, 0x4b, 0xa0, 0x38, 0x69, 0x13, 0xda, 0xa1, - 0xa9, 0xb7, 0xbc, 0xef, 0xeb, 0xe7, 0xf7, 0x3e, 0x79, 0x62, 0x05, 0xe0, 0xd1, 0xb1, 0x44, 0x5c, - 0x60, 0x1a, 0x72, 0xcc, 0x7d, 0xea, 0xb1, 0x50, 0x8c, 0xb9, 0x3b, 0xc5, 0x93, 0x0e, 0x1d, 0x87, - 0x43, 0xda, 0xc1, 0x1e, 0x0b, 0x58, 0x44, 0x15, 0x1b, 0xa0, 0x30, 0x12, 0x4a, 0xc0, 0x56, 0x26, - 0x40, 0x34, 0xe4, 0xa8, 0x24, 0x40, 0x0b, 0x41, 0xf3, 0xb1, 0xc7, 0xd5, 0x30, 0xee, 0x23, 0x57, - 0xf8, 0xd8, 0x13, 0x9e, 0xc0, 0x5a, 0xd7, 0x8f, 0x3f, 0xe9, 0x4a, 0x17, 0xfa, 0x29, 0xe3, 0x35, - 0x9f, 0x16, 0x06, 0x7c, 0xea, 0x0e, 0x79, 0xc0, 0xa2, 0x29, 0x0e, 0x47, 0x5e, 0xda, 0x90, 0xd8, - 0x67, 0x8a, 0xe2, 0xc9, 0x9a, 0x8b, 0x26, 0xfe, 0x9f, 0x2a, 0x8a, 0x03, 0xc5, 0x7d, 0xb6, 0x26, - 0x78, 0x76, 0x93, 0x40, 0xba, 0x43, 0xe6, 0xd3, 0x55, 0x5d, 0xfb, 0x87, 0x09, 0xea, 0x6f, 0xd2, - 0xd7, 0x24, 0x6c, 0xc2, 0xd9, 0x39, 0xfc, 0x08, 0xf6, 0x52, 0x4f, 0x03, 0xaa, 0xa8, 0x65, 0x1c, - 0x1a, 0x47, 0xf5, 0xee, 0x13, 0x54, 0x24, 0xb2, 0x44, 0xa3, 0x70, 0xe4, 0xa5, 0x0d, 0x89, 0xd2, - 0xd3, 0x68, 0xd2, 0x41, 0xef, 0xfb, 0x9f, 0x99, 0xab, 0xde, 0x32, 0x45, 0x1d, 0x38, 0xbb, 0x6a, - 0x55, 0x92, 0xab, 0x16, 0x28, 0x7a, 0x64, 0x49, 0x85, 0x04, 0x6c, 0xc9, 0x90, 0xb9, 0x96, 0xb9, - 0x46, 0xbf, 0x36, 0x6f, 0x54, 0x72, 0xf7, 0x21, 0x64, 0xae, 0x73, 0x2b, 0xa7, 0x6f, 0xa5, 0x15, - 0xd1, 0x2c, 0x78, 0x06, 0x76, 0xa4, 0xa2, 0x2a, 0x96, 0x56, 0x55, 0x53, 0xbb, 0x1b, 0x51, 0xb5, - 0xd2, 0xb9, 0x93, 0x73, 0x77, 0xb2, 0x9a, 0xe4, 0xc4, 0xf6, 0x2b, 0x60, 0x95, 0x0e, 0x9f, 0x88, - 0x40, 0xd1, 0x34, 0x82, 0x74, 0x3b, 0x7c, 0x00, 0xb6, 0x35, 0x5d, 0x47, 0x55, 0x73, 0x6e, 0xe7, - 0x88, 0xed, 0x4c, 0x90, 0xcd, 0xda, 0x7f, 0x4c, 0xb0, 0xbf, 0xf2, 0x12, 0xd0, 0x07, 0xc0, 0x5d, - 0x90, 0xa4, 0x65, 0x1c, 0x56, 0x8f, 0xea, 0xdd, 0xe7, 0x9b, 0x98, 0xfe, 0xc7, 0x47, 0x91, 0xf8, - 0xb2, 0x2d, 0x49, 0x69, 0x01, 0xfc, 0x02, 0xea, 0x34, 0x08, 0x84, 0xa2, 0x8a, 0x8b, 0x40, 0x5a, - 0xa6, 0xde, 0xd7, 0xdb, 0x34, 0x7a, 0xd4, 0x2b, 0x18, 0xa7, 0x81, 0x8a, 0xa6, 0xce, 0xdd, 0x7c, - 0x6f, 0xbd, 0x34, 0x21, 0xe5, 0x55, 0x10, 0x83, 0x5a, 0x40, 0x7d, 0x26, 0x43, 0xea, 0x32, 0xfd, - 0x71, 0x6a, 0xce, 0x41, 0x2e, 0xaa, 0xbd, 0x5b, 0x0c, 0x48, 0x71, 0xa6, 0xf9, 0x12, 0x34, 0x56, - 0xd7, 0xc0, 0x06, 0xa8, 0x8e, 0xd8, 0x34, 0x0b, 0x99, 0xa4, 0x8f, 0xf0, 0x1e, 0xd8, 0x9e, 0xd0, - 0x71, 0xcc, 0xf4, 0x2d, 0xaa, 0x91, 0xac, 0x78, 0x61, 0x1e, 0x1b, 0xed, 0x9f, 0x26, 0x38, 0x58, - 0xfb, 0xb8, 0xf0, 0x11, 0xd8, 0xa5, 0xe3, 0xb1, 0x38, 0x67, 0x03, 0x4d, 0xd9, 0x73, 0xf6, 0x73, - 0x13, 0xbb, 0xbd, 0xac, 0x4d, 0x16, 0x73, 0xf8, 0x10, 0xec, 0x44, 0x8c, 0x4a, 0x11, 0x64, 0xec, - 0xe2, 0x5e, 0x10, 0xdd, 0x25, 0xf9, 0x14, 0x7e, 0x33, 0x40, 0x83, 0xc6, 0x03, 0xae, 0x4a, 0x76, - 0xad, 0xaa, 0x4e, 0xf6, 0xf5, 0xe6, 0xd7, 0x0f, 0xf5, 0x56, 0x50, 0x59, 0xc0, 0x56, 0xbe, 0xbc, - 0xb1, 0x3a, 0x26, 0x6b, 0xbb, 0x9b, 0x27, 0xe0, 0xfe, 0xb5, 0x90, 0x4d, 0xe2, 0x73, 0x4e, 0x67, - 0x73, 0xbb, 0x72, 0x31, 0xb7, 0x2b, 0x97, 0x73, 0xbb, 0xf2, 0x35, 0xb1, 0x8d, 0x59, 0x62, 0x1b, - 0x17, 0x89, 0x6d, 0x5c, 0x26, 0xb6, 0xf1, 0x2b, 0xb1, 0x8d, 0xef, 0xbf, 0xed, 0xca, 0x59, 0xeb, - 0x86, 0xbf, 0xea, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x59, 0x86, 0x92, 0x15, 0x77, 0x05, 0x00, - 0x00, -} - -func (m *ImageReview) 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 *ImageReview) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ImageReview) 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 *ImageReviewContainerSpec) 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 *ImageReviewContainerSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ImageReviewContainerSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i -= len(m.Image) - copy(dAtA[i:], m.Image) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Image))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ImageReviewSpec) 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 *ImageReviewSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ImageReviewSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i -= len(m.Namespace) - copy(dAtA[i:], m.Namespace) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace))) - i-- - dAtA[i] = 0x1a - if len(m.Annotations) > 0 { - keysForAnnotations := make([]string, 0, len(m.Annotations)) - for k := range m.Annotations { - keysForAnnotations = append(keysForAnnotations, string(k)) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) - for iNdEx := len(keysForAnnotations) - 1; iNdEx >= 0; iNdEx-- { - v := m.Annotations[string(keysForAnnotations[iNdEx])] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintGenerated(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(keysForAnnotations[iNdEx]) - copy(dAtA[i:], keysForAnnotations[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAnnotations[iNdEx]))) - i-- - dAtA[i] = 0xa - i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Containers) > 0 { - for iNdEx := len(m.Containers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Containers[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 (m *ImageReviewStatus) 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 *ImageReviewStatus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ImageReviewStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AuditAnnotations) > 0 { - keysForAuditAnnotations := make([]string, 0, len(m.AuditAnnotations)) - for k := range m.AuditAnnotations { - keysForAuditAnnotations = append(keysForAuditAnnotations, string(k)) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForAuditAnnotations) - for iNdEx := len(keysForAuditAnnotations) - 1; iNdEx >= 0; iNdEx-- { - v := m.AuditAnnotations[string(keysForAuditAnnotations[iNdEx])] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintGenerated(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(keysForAuditAnnotations[iNdEx]) - copy(dAtA[i:], keysForAuditAnnotations[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAuditAnnotations[iNdEx]))) - i-- - dAtA[i] = 0xa - i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - i -= len(m.Reason) - copy(dAtA[i:], m.Reason) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) - i-- - dAtA[i] = 0x12 - i-- - if m.Allowed { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - return len(dAtA) - i, nil -} - -func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { - offset -= sovGenerated(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ImageReview) 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 *ImageReviewContainerSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Image) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *ImageReviewSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Containers) > 0 { - for _, e := range m.Containers { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - if len(m.Annotations) > 0 { - for k, v := range m.Annotations { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) - n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) - } - } - l = len(m.Namespace) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *ImageReviewStatus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 2 - l = len(m.Reason) - n += 1 + l + sovGenerated(uint64(l)) - if len(m.AuditAnnotations) > 0 { - for k, v := range m.AuditAnnotations { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) - n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) - } - } - return n -} - -func sovGenerated(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenerated(x uint64) (n int) { - return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *ImageReview) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ImageReview{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ImageReviewSpec", "ImageReviewSpec", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "ImageReviewStatus", "ImageReviewStatus", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *ImageReviewContainerSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ImageReviewContainerSpec{`, - `Image:` + fmt.Sprintf("%v", this.Image) + `,`, - `}`, - }, "") - return s -} -func (this *ImageReviewSpec) String() string { - if this == nil { - return "nil" - } - repeatedStringForContainers := "[]ImageReviewContainerSpec{" - for _, f := range this.Containers { - repeatedStringForContainers += strings.Replace(strings.Replace(f.String(), "ImageReviewContainerSpec", "ImageReviewContainerSpec", 1), `&`, ``, 1) + "," - } - repeatedStringForContainers += "}" - keysForAnnotations := make([]string, 0, len(this.Annotations)) - for k := range this.Annotations { - keysForAnnotations = append(keysForAnnotations, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) - mapStringForAnnotations := "map[string]string{" - for _, k := range keysForAnnotations { - mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) - } - mapStringForAnnotations += "}" - s := strings.Join([]string{`&ImageReviewSpec{`, - `Containers:` + repeatedStringForContainers + `,`, - `Annotations:` + mapStringForAnnotations + `,`, - `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, - `}`, - }, "") - return s -} -func (this *ImageReviewStatus) String() string { - if this == nil { - return "nil" - } - keysForAuditAnnotations := make([]string, 0, len(this.AuditAnnotations)) - for k := range this.AuditAnnotations { - keysForAuditAnnotations = append(keysForAuditAnnotations, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForAuditAnnotations) - mapStringForAuditAnnotations := "map[string]string{" - for _, k := range keysForAuditAnnotations { - mapStringForAuditAnnotations += fmt.Sprintf("%v: %v,", k, this.AuditAnnotations[k]) - } - mapStringForAuditAnnotations += "}" - s := strings.Join([]string{`&ImageReviewStatus{`, - `Allowed:` + fmt.Sprintf("%v", this.Allowed) + `,`, - `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, - `AuditAnnotations:` + mapStringForAuditAnnotations + `,`, - `}`, - }, "") - return s -} -func valueToStringGenerated(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *ImageReview) 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: ImageReview: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ImageReview: 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 *ImageReviewContainerSpec) 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: ImageReviewContainerSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ImageReviewContainerSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Image", 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.Image = 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 *ImageReviewSpec) 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: ImageReviewSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ImageReviewSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Containers", 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.Containers = append(m.Containers, ImageReviewContainerSpec{}) - if err := m.Containers[len(m.Containers)-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 Annotations", 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.Annotations == nil { - m.Annotations = make(map[string]string) - } - var mapkey string - var mapvalue string - 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 stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthGenerated - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } 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.Annotations[mapkey] = mapvalue - 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 - 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 *ImageReviewStatus) 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: ImageReviewStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ImageReviewStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Allowed", 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 - } - } - m.Allowed = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Reason = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuditAnnotations", 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.AuditAnnotations == nil { - m.AuditAnnotations = make(map[string]string) - } - var mapkey string - var mapvalue string - 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 stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthGenerated - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } 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.AuditAnnotations[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 skipGenerated(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, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGenerated - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenerated - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenerated - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/k8s.io/api/imagepolicy/v1alpha1/generated.proto b/vendor/k8s.io/api/imagepolicy/v1alpha1/generated.proto deleted file mode 100644 index 5ea5c0ec8..000000000 --- a/vendor/k8s.io/api/imagepolicy/v1alpha1/generated.proto +++ /dev/null @@ -1,89 +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. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = "proto2"; - -package k8s.io.api.imagepolicy.v1alpha1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "k8s.io/api/imagepolicy/v1alpha1"; - -// ImageReview checks if the set of images in a pod are allowed. -message ImageReview { - // 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 holds information about the pod being evaluated - optional ImageReviewSpec spec = 2; - - // Status is filled in by the backend and indicates whether the pod should be allowed. - // +optional - optional ImageReviewStatus status = 3; -} - -// ImageReviewContainerSpec is a description of a container within the pod creation request. -message ImageReviewContainerSpec { - // This can be in the form image:tag or image@SHA:012345679abcdef. - // +optional - optional string image = 1; -} - -// ImageReviewSpec is a description of the pod creation request. -message ImageReviewSpec { - // Containers is a list of a subset of the information in each container of the Pod being created. - // +optional - // +listType=atomic - repeated ImageReviewContainerSpec containers = 1; - - // Annotations is a list of key-value pairs extracted from the Pod's annotations. - // It only includes keys which match the pattern `*.image-policy.k8s.io/*`. - // It is up to each webhook backend to determine how to interpret these annotations, if at all. - // +optional - map annotations = 2; - - // Namespace is the namespace the pod is being created in. - // +optional - optional string namespace = 3; -} - -// ImageReviewStatus is the result of the review for the pod creation request. -message ImageReviewStatus { - // Allowed indicates that all images were allowed to be run. - optional bool allowed = 1; - - // Reason should be empty unless Allowed is false in which case it - // may contain a short description of what is wrong. Kubernetes - // may truncate excessively long errors when displaying to the user. - // +optional - optional string reason = 2; - - // AuditAnnotations will be added to the attributes object of the - // admission controller request using 'AddAnnotation'. The keys should - // be prefix-less (i.e., the admission controller will add an - // appropriate prefix). - // +optional - map auditAnnotations = 3; -} - diff --git a/vendor/k8s.io/api/imagepolicy/v1alpha1/register.go b/vendor/k8s.io/api/imagepolicy/v1alpha1/register.go deleted file mode 100644 index 477571bbb..000000000 --- a/vendor/k8s.io/api/imagepolicy/v1alpha1/register.go +++ /dev/null @@ -1,51 +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 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 name for this API. -const GroupName = "imagepolicy.k8s.io" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - // TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api. - // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - localSchemeBuilder = &SchemeBuilder - AddToScheme = localSchemeBuilder.AddToScheme -) - -// Adds the list of known types to the given scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &ImageReview{}, - ) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/vendor/k8s.io/api/imagepolicy/v1alpha1/types.go b/vendor/k8s.io/api/imagepolicy/v1alpha1/types.go deleted file mode 100644 index 19ac2b536..000000000 --- a/vendor/k8s.io/api/imagepolicy/v1alpha1/types.go +++ /dev/null @@ -1,83 +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 v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +genclient:nonNamespaced -// +genclient:noVerbs -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ImageReview checks if the set of images in a pod are allowed. -type ImageReview 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 holds information about the pod being evaluated - Spec ImageReviewSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` - - // Status is filled in by the backend and indicates whether the pod should be allowed. - // +optional - Status ImageReviewStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` -} - -// ImageReviewSpec is a description of the pod creation request. -type ImageReviewSpec struct { - // Containers is a list of a subset of the information in each container of the Pod being created. - // +optional - // +listType=atomic - Containers []ImageReviewContainerSpec `json:"containers,omitempty" protobuf:"bytes,1,rep,name=containers"` - // Annotations is a list of key-value pairs extracted from the Pod's annotations. - // It only includes keys which match the pattern `*.image-policy.k8s.io/*`. - // It is up to each webhook backend to determine how to interpret these annotations, if at all. - // +optional - Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,2,rep,name=annotations"` - // Namespace is the namespace the pod is being created in. - // +optional - Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"` -} - -// ImageReviewContainerSpec is a description of a container within the pod creation request. -type ImageReviewContainerSpec struct { - // This can be in the form image:tag or image@SHA:012345679abcdef. - // +optional - Image string `json:"image,omitempty" protobuf:"bytes,1,opt,name=image"` - // In future, we may add command line overrides, exec health check command lines, and so on. -} - -// ImageReviewStatus is the result of the review for the pod creation request. -type ImageReviewStatus struct { - // Allowed indicates that all images were allowed to be run. - Allowed bool `json:"allowed" protobuf:"varint,1,opt,name=allowed"` - // Reason should be empty unless Allowed is false in which case it - // may contain a short description of what is wrong. Kubernetes - // may truncate excessively long errors when displaying to the user. - // +optional - Reason string `json:"reason,omitempty" protobuf:"bytes,2,opt,name=reason"` - // AuditAnnotations will be added to the attributes object of the - // admission controller request using 'AddAnnotation'. The keys should - // be prefix-less (i.e., the admission controller will add an - // appropriate prefix). - // +optional - AuditAnnotations map[string]string `json:"auditAnnotations,omitempty" protobuf:"bytes,3,rep,name=auditAnnotations"` -} diff --git a/vendor/k8s.io/api/imagepolicy/v1alpha1/types_swagger_doc_generated.go b/vendor/k8s.io/api/imagepolicy/v1alpha1/types_swagger_doc_generated.go deleted file mode 100644 index dadf95e1d..000000000 --- a/vendor/k8s.io/api/imagepolicy/v1alpha1/types_swagger_doc_generated.go +++ /dev/null @@ -1,72 +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. -*/ - -package v1alpha1 - -// This file contains a collection of methods that can be used from go-restful to -// generate Swagger API documentation for its models. Please read this PR for more -// information on the implementation: https://github.com/emicklei/go-restful/pull/215 -// -// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if -// they are on one line! For multiple line or blocks that you want to ignore use ---. -// Any context after a --- is ignored. -// -// Those methods can be generated by using hack/update-codegen.sh - -// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. -var map_ImageReview = map[string]string{ - "": "ImageReview checks if the set of images in a pod are allowed.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "spec": "Spec holds information about the pod being evaluated", - "status": "Status is filled in by the backend and indicates whether the pod should be allowed.", -} - -func (ImageReview) SwaggerDoc() map[string]string { - return map_ImageReview -} - -var map_ImageReviewContainerSpec = map[string]string{ - "": "ImageReviewContainerSpec is a description of a container within the pod creation request.", - "image": "This can be in the form image:tag or image@SHA:012345679abcdef.", -} - -func (ImageReviewContainerSpec) SwaggerDoc() map[string]string { - return map_ImageReviewContainerSpec -} - -var map_ImageReviewSpec = map[string]string{ - "": "ImageReviewSpec is a description of the pod creation request.", - "containers": "Containers is a list of a subset of the information in each container of the Pod being created.", - "annotations": "Annotations is a list of key-value pairs extracted from the Pod's annotations. It only includes keys which match the pattern `*.image-policy.k8s.io/*`. It is up to each webhook backend to determine how to interpret these annotations, if at all.", - "namespace": "Namespace is the namespace the pod is being created in.", -} - -func (ImageReviewSpec) SwaggerDoc() map[string]string { - return map_ImageReviewSpec -} - -var map_ImageReviewStatus = map[string]string{ - "": "ImageReviewStatus is the result of the review for the pod creation request.", - "allowed": "Allowed indicates that all images were allowed to be run.", - "reason": "Reason should be empty unless Allowed is false in which case it may contain a short description of what is wrong. Kubernetes may truncate excessively long errors when displaying to the user.", - "auditAnnotations": "AuditAnnotations will be added to the attributes object of the admission controller request using 'AddAnnotation'. The keys should be prefix-less (i.e., the admission controller will add an appropriate prefix).", -} - -func (ImageReviewStatus) SwaggerDoc() map[string]string { - return map_ImageReviewStatus -} - -// AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/k8s.io/api/imagepolicy/v1alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/api/imagepolicy/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index f230656f3..000000000 --- a/vendor/k8s.io/api/imagepolicy/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,121 +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 *ImageReview) DeepCopyInto(out *ImageReview) { - *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 ImageReview. -func (in *ImageReview) DeepCopy() *ImageReview { - if in == nil { - return nil - } - out := new(ImageReview) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ImageReview) 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 *ImageReviewContainerSpec) DeepCopyInto(out *ImageReviewContainerSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageReviewContainerSpec. -func (in *ImageReviewContainerSpec) DeepCopy() *ImageReviewContainerSpec { - if in == nil { - return nil - } - out := new(ImageReviewContainerSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ImageReviewSpec) DeepCopyInto(out *ImageReviewSpec) { - *out = *in - if in.Containers != nil { - in, out := &in.Containers, &out.Containers - *out = make([]ImageReviewContainerSpec, len(*in)) - copy(*out, *in) - } - if in.Annotations != nil { - in, out := &in.Annotations, &out.Annotations - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageReviewSpec. -func (in *ImageReviewSpec) DeepCopy() *ImageReviewSpec { - if in == nil { - return nil - } - out := new(ImageReviewSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ImageReviewStatus) DeepCopyInto(out *ImageReviewStatus) { - *out = *in - if in.AuditAnnotations != nil { - in, out := &in.AuditAnnotations, &out.AuditAnnotations - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageReviewStatus. -func (in *ImageReviewStatus) DeepCopy() *ImageReviewStatus { - if in == nil { - return nil - } - out := new(ImageReviewStatus) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/k8s.io/apimachinery/pkg/api/meta/testrestmapper/test_restmapper.go b/vendor/k8s.io/apimachinery/pkg/api/meta/testrestmapper/test_restmapper.go deleted file mode 100644 index 72c6438cb..000000000 --- a/vendor/k8s.io/apimachinery/pkg/api/meta/testrestmapper/test_restmapper.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 testrestmapper - -import ( - "k8s.io/apimachinery/pkg/api/meta" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/sets" -) - -// TestOnlyStaticRESTMapper returns a union RESTMapper of all known types with priorities chosen in the following order: -// 1. legacy kube group preferred version, extensions preferred version, metrics preferred version, legacy -// kube any version, extensions any version, metrics any version, all other groups alphabetical preferred version, -// all other groups alphabetical. -// -// TODO callers of this method should be updated to build their own specific restmapper based on their scheme for their tests -// TODO the things being tested are related to whether various cases are handled, not tied to the particular types being checked. -func TestOnlyStaticRESTMapper(scheme *runtime.Scheme, versionPatterns ...schema.GroupVersion) meta.RESTMapper { - unionMapper := meta.MultiRESTMapper{} - unionedGroups := sets.NewString() - for _, enabledVersion := range scheme.PrioritizedVersionsAllGroups() { - if !unionedGroups.Has(enabledVersion.Group) { - unionedGroups.Insert(enabledVersion.Group) - unionMapper = append(unionMapper, newRESTMapper(enabledVersion.Group, scheme)) - } - } - - if len(versionPatterns) != 0 { - resourcePriority := []schema.GroupVersionResource{} - kindPriority := []schema.GroupVersionKind{} - for _, versionPriority := range versionPatterns { - resourcePriority = append(resourcePriority, versionPriority.WithResource(meta.AnyResource)) - kindPriority = append(kindPriority, versionPriority.WithKind(meta.AnyKind)) - } - - return meta.PriorityRESTMapper{Delegate: unionMapper, ResourcePriority: resourcePriority, KindPriority: kindPriority} - } - - prioritizedGroups := []string{"", "extensions", "metrics"} - resourcePriority, kindPriority := prioritiesForGroups(scheme, prioritizedGroups...) - - prioritizedGroupsSet := sets.NewString(prioritizedGroups...) - remainingGroups := sets.String{} - for _, enabledVersion := range scheme.PrioritizedVersionsAllGroups() { - if !prioritizedGroupsSet.Has(enabledVersion.Group) { - remainingGroups.Insert(enabledVersion.Group) - } - } - - remainingResourcePriority, remainingKindPriority := prioritiesForGroups(scheme, remainingGroups.List()...) - resourcePriority = append(resourcePriority, remainingResourcePriority...) - kindPriority = append(kindPriority, remainingKindPriority...) - - return meta.PriorityRESTMapper{Delegate: unionMapper, ResourcePriority: resourcePriority, KindPriority: kindPriority} -} - -// prioritiesForGroups returns the resource and kind priorities for a PriorityRESTMapper, preferring the preferred version of each group first, -// then any non-preferred version of the group second. -func prioritiesForGroups(scheme *runtime.Scheme, groups ...string) ([]schema.GroupVersionResource, []schema.GroupVersionKind) { - resourcePriority := []schema.GroupVersionResource{} - kindPriority := []schema.GroupVersionKind{} - - for _, group := range groups { - availableVersions := scheme.PrioritizedVersionsForGroup(group) - if len(availableVersions) > 0 { - resourcePriority = append(resourcePriority, availableVersions[0].WithResource(meta.AnyResource)) - kindPriority = append(kindPriority, availableVersions[0].WithKind(meta.AnyKind)) - } - } - for _, group := range groups { - resourcePriority = append(resourcePriority, schema.GroupVersionResource{Group: group, Version: meta.AnyVersion, Resource: meta.AnyResource}) - kindPriority = append(kindPriority, schema.GroupVersionKind{Group: group, Version: meta.AnyVersion, Kind: meta.AnyKind}) - } - - return resourcePriority, kindPriority -} - -func newRESTMapper(group string, scheme *runtime.Scheme) meta.RESTMapper { - mapper := meta.NewDefaultRESTMapper(scheme.PrioritizedVersionsForGroup(group)) - for _, gv := range scheme.PrioritizedVersionsForGroup(group) { - for kind := range scheme.KnownTypes(gv) { - if ignoredKinds.Has(kind) { - continue - } - scope := meta.RESTScopeNamespace - if rootScopedKinds[gv.WithKind(kind).GroupKind()] { - scope = meta.RESTScopeRoot - } - mapper.Add(gv.WithKind(kind), scope) - } - } - - return mapper -} - -// hardcoded is good enough for the test we're running -var rootScopedKinds = map[schema.GroupKind]bool{ - {Group: "admission.k8s.io", Kind: "AdmissionReview"}: true, - - {Group: "admissionregistration.k8s.io", Kind: "ValidatingWebhookConfiguration"}: true, - {Group: "admissionregistration.k8s.io", Kind: "MutatingWebhookConfiguration"}: true, - - {Group: "authentication.k8s.io", Kind: "TokenReview"}: true, - - {Group: "authorization.k8s.io", Kind: "SubjectAccessReview"}: true, - {Group: "authorization.k8s.io", Kind: "SelfSubjectAccessReview"}: true, - {Group: "authorization.k8s.io", Kind: "SelfSubjectRulesReview"}: true, - - {Group: "certificates.k8s.io", Kind: "CertificateSigningRequest"}: true, - - {Group: "", Kind: "Node"}: true, - {Group: "", Kind: "Namespace"}: true, - {Group: "", Kind: "PersistentVolume"}: true, - {Group: "", Kind: "ComponentStatus"}: true, - - {Group: "rbac.authorization.k8s.io", Kind: "ClusterRole"}: true, - {Group: "rbac.authorization.k8s.io", Kind: "ClusterRoleBinding"}: true, - - {Group: "scheduling.k8s.io", Kind: "PriorityClass"}: true, - - {Group: "storage.k8s.io", Kind: "StorageClass"}: true, - {Group: "storage.k8s.io", Kind: "VolumeAttachment"}: true, - - {Group: "apiextensions.k8s.io", Kind: "CustomResourceDefinition"}: true, - - {Group: "apiserver.k8s.io", Kind: "AdmissionConfiguration"}: true, - - {Group: "audit.k8s.io", Kind: "Event"}: true, - {Group: "audit.k8s.io", Kind: "Policy"}: true, - - {Group: "apiregistration.k8s.io", Kind: "APIService"}: true, - - {Group: "metrics.k8s.io", Kind: "NodeMetrics"}: true, - - {Group: "wardle.example.com", Kind: "Fischer"}: true, -} - -// hardcoded is good enough for the test we're running -var ignoredKinds = sets.NewString( - "ListOptions", - "DeleteOptions", - "Status", - "PodLogOptions", - "PodExecOptions", - "PodAttachOptions", - "PodPortForwardOptions", - "PodProxyOptions", - "NodeProxyOptions", - "ServiceProxyOptions", -) diff --git a/vendor/k8s.io/client-go/applyconfigurations/OWNERS b/vendor/k8s.io/client-go/applyconfigurations/OWNERS deleted file mode 100644 index ea0928429..000000000 --- a/vendor/k8s.io/client-go/applyconfigurations/OWNERS +++ /dev/null @@ -1,5 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - apelisse - - jpbetz diff --git a/vendor/k8s.io/client-go/applyconfigurations/doc.go b/vendor/k8s.io/client-go/applyconfigurations/doc.go deleted file mode 100644 index ac426c607..000000000 --- a/vendor/k8s.io/client-go/applyconfigurations/doc.go +++ /dev/null @@ -1,151 +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 applyconfigurations provides typesafe go representations of the apply -configurations that are used to constructs Server-side Apply requests. - -# Basics - -The Apply functions in the typed client (see the k8s.io/client-go/kubernetes/typed packages) offer -a direct and typesafe way of calling Server-side Apply. Each Apply function takes an "apply -configuration" type as an argument, which is a structured representation of an Apply request. For -example: - - import ( - ... - v1ac "k8s.io/client-go/applyconfigurations/autoscaling/v1" - ) - hpaApplyConfig := v1ac.HorizontalPodAutoscaler(autoscalerName, ns). - WithSpec(v1ac.HorizontalPodAutoscalerSpec(). - WithMinReplicas(0) - ) - return hpav1client.Apply(ctx, hpaApplyConfig, metav1.ApplyOptions{FieldManager: "mycontroller", Force: true}) - -Note in this example that HorizontalPodAutoscaler is imported from an "applyconfigurations" -package. Each "apply configuration" type represents the same Kubernetes object kind as the -corresponding go struct, but where all fields are pointers to make them optional, allowing apply -requests to be accurately represented. For example, this when the apply configuration in the above -example is marshalled to YAML, it produces: - - apiVersion: autoscaling/v1 - kind: HorizontalPodAutoscaler - metadata: - name: myHPA - namespace: myNamespace - spec: - minReplicas: 0 - -To understand why this is needed, the above YAML cannot be produced by the -v1.HorizontalPodAutoscaler go struct. Take for example: - - hpa := v1.HorizontalPodAutoscaler{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "autoscaling/v1", - Kind: "HorizontalPodAutoscaler", - }, - ObjectMeta: ObjectMeta{ - Namespace: ns, - Name: autoscalerName, - }, - Spec: v1.HorizontalPodAutoscalerSpec{ - MinReplicas: pointer.Int32Ptr(0), - }, - } - -The above code attempts to declare the same apply configuration as shown in the previous examples, -but when marshalled to YAML, produces: - - kind: HorizontalPodAutoscaler - apiVersion: autoscaling/v1 - metadata: - name: myHPA - namespace: myNamespace - creationTimestamp: null - spec: - scaleTargetRef: - kind: "" - name: "" - minReplicas: 0 - maxReplicas: 0 - -Which, among other things, contains spec.maxReplicas set to 0. This is almost certainly not what -the caller intended (the intended apply configuration says nothing about the maxReplicas field), -and could have serious consequences on a production system: it directs the autoscaler to downscale -to zero pods. The problem here originates from the fact that the go structs contain required fields -that are zero valued if not set explicitly. The go structs work as intended for create and update -operations, but are fundamentally incompatible with apply, which is why we have introduced the -generated "apply configuration" types. - -The "apply configurations" also have convenience With functions that make it easier to -build apply requests. This allows developers to set fields without having to deal with the fact that -all the fields in the "apply configuration" types are pointers, and are inconvenient to set using -go. For example "MinReplicas: &0" is not legal go code, so without the With functions, developers -would work around this problem by using a library, .e.g. "MinReplicas: pointer.Int32Ptr(0)", but -string enumerations like corev1.Protocol are still a problem since they cannot be supported by a -general purpose library. In addition to the convenience, the With functions also isolate -developers from the underlying representation, which makes it safer for the underlying -representation to be changed to support additional features in the future. - -# Controller Support - -The new client-go support makes it much easier to use Server-side Apply in controllers, by either of -two mechanisms. - -Mechanism 1: - -When authoring new controllers to use Server-side Apply, a good approach is to have the controller -recreate the apply configuration for an object each time it reconciles that object. This ensures -that the controller fully reconciles all the fields that it is responsible for. Controllers -typically should unconditionally set all the fields they own by setting "Force: true" in the -ApplyOptions. Controllers must also provide a FieldManager name that is unique to the -reconciliation loop that apply is called from. - -When upgrading existing controllers to use Server-side Apply the same approach often works -well--migrate the controllers to recreate the apply configuration each time it reconciles any -object. For cases where this does not work well, see Mechanism 2. - -Mechanism 2: - -When upgrading existing controllers to use Server-side Apply, the controller might have multiple -code paths that update different parts of an object depending on various conditions. Migrating a -controller like this to Server-side Apply can be risky because if the controller forgets to include -any fields in an apply configuration that is included in a previous apply request, a field can be -accidentally deleted. For such cases, an alternative to mechanism 1 is to replace any controller -reconciliation code that performs a "read/modify-in-place/update" (or patch) workflow with a -"extract/modify-in-place/apply" workflow. Here's an example of the new workflow: - - fieldMgr := "my-field-manager" - deploymentClient := clientset.AppsV1().Deployments("default") - // read, could also be read from a shared informer - deployment, err := deploymentClient.Get(ctx, "example-deployment", metav1.GetOptions{}) - if err != nil { - // handle error - } - // extract - deploymentApplyConfig, err := appsv1ac.ExtractDeployment(deployment, fieldMgr) - if err != nil { - // handle error - } - // modify-in-place - deploymentApplyConfig.Spec.Template.Spec.WithContainers(corev1ac.Container(). - WithName("modify-slice"). - WithImage("nginx:1.14.2"), - ) - // apply - applied, err := deploymentClient.Apply(ctx, extractedDeployment, metav1.ApplyOptions{FieldManager: fieldMgr}) -*/ -package applyconfigurations // import "k8s.io/client-go/applyconfigurations" diff --git a/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereview.go b/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereview.go deleted file mode 100644 index 91944002d..000000000 --- a/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereview.go +++ /dev/null @@ -1,262 +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 applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - imagepolicyv1alpha1 "k8s.io/api/imagepolicy/v1alpha1" - 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" -) - -// ImageReviewApplyConfiguration represents a declarative configuration of the ImageReview type for use -// with apply. -type ImageReviewApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *ImageReviewSpecApplyConfiguration `json:"spec,omitempty"` - Status *ImageReviewStatusApplyConfiguration `json:"status,omitempty"` -} - -// ImageReview constructs a declarative configuration of the ImageReview type for use with -// apply. -func ImageReview(name string) *ImageReviewApplyConfiguration { - b := &ImageReviewApplyConfiguration{} - b.WithName(name) - b.WithKind("ImageReview") - b.WithAPIVersion("imagepolicy.k8s.io/v1alpha1") - return b -} - -// ExtractImageReview extracts the applied configuration owned by fieldManager from -// imageReview. If no managedFields are found in imageReview for fieldManager, a -// ImageReviewApplyConfiguration 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. -// imageReview must be a unmodified ImageReview API object that was retrieved from the Kubernetes API. -// ExtractImageReview 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 ExtractImageReview(imageReview *imagepolicyv1alpha1.ImageReview, fieldManager string) (*ImageReviewApplyConfiguration, error) { - return extractImageReview(imageReview, fieldManager, "") -} - -// ExtractImageReviewStatus is the same as ExtractImageReview except -// that it extracts the status subresource applied configuration. -// Experimental! -func ExtractImageReviewStatus(imageReview *imagepolicyv1alpha1.ImageReview, fieldManager string) (*ImageReviewApplyConfiguration, error) { - return extractImageReview(imageReview, fieldManager, "status") -} - -func extractImageReview(imageReview *imagepolicyv1alpha1.ImageReview, fieldManager string, subresource string) (*ImageReviewApplyConfiguration, error) { - b := &ImageReviewApplyConfiguration{} - err := managedfields.ExtractInto(imageReview, internal.Parser().Type("io.k8s.api.imagepolicy.v1alpha1.ImageReview"), fieldManager, b, subresource) - if err != nil { - return nil, err - } - b.WithName(imageReview.Name) - - b.WithKind("ImageReview") - b.WithAPIVersion("imagepolicy.k8s.io/v1alpha1") - 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 *ImageReviewApplyConfiguration) WithKind(value string) *ImageReviewApplyConfiguration { - b.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 *ImageReviewApplyConfiguration) WithAPIVersion(value string) *ImageReviewApplyConfiguration { - b.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 *ImageReviewApplyConfiguration) WithName(value string) *ImageReviewApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.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 *ImageReviewApplyConfiguration) WithGenerateName(value string) *ImageReviewApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.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 *ImageReviewApplyConfiguration) WithNamespace(value string) *ImageReviewApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.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 *ImageReviewApplyConfiguration) WithUID(value types.UID) *ImageReviewApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.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 *ImageReviewApplyConfiguration) WithResourceVersion(value string) *ImageReviewApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.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 *ImageReviewApplyConfiguration) WithGeneration(value int64) *ImageReviewApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.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 *ImageReviewApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ImageReviewApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.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 *ImageReviewApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ImageReviewApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.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 *ImageReviewApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ImageReviewApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.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 *ImageReviewApplyConfiguration) WithLabels(entries map[string]string) *ImageReviewApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.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 *ImageReviewApplyConfiguration) WithAnnotations(entries map[string]string) *ImageReviewApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.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 *ImageReviewApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ImageReviewApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.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 *ImageReviewApplyConfiguration) WithFinalizers(values ...string) *ImageReviewApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *ImageReviewApplyConfiguration) 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 *ImageReviewApplyConfiguration) WithSpec(value *ImageReviewSpecApplyConfiguration) *ImageReviewApplyConfiguration { - 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 *ImageReviewApplyConfiguration) WithStatus(value *ImageReviewStatusApplyConfiguration) *ImageReviewApplyConfiguration { - b.Status = value - return b -} - -// GetName retrieves the value of the Name field in the declarative configuration. -func (b *ImageReviewApplyConfiguration) GetName() *string { - b.ensureObjectMetaApplyConfigurationExists() - return b.Name -} diff --git a/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewcontainerspec.go b/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewcontainerspec.go deleted file mode 100644 index adfdb3258..000000000 --- a/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewcontainerspec.go +++ /dev/null @@ -1,39 +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 applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// ImageReviewContainerSpecApplyConfiguration represents a declarative configuration of the ImageReviewContainerSpec type for use -// with apply. -type ImageReviewContainerSpecApplyConfiguration struct { - Image *string `json:"image,omitempty"` -} - -// ImageReviewContainerSpecApplyConfiguration constructs a declarative configuration of the ImageReviewContainerSpec type for use with -// apply. -func ImageReviewContainerSpec() *ImageReviewContainerSpecApplyConfiguration { - return &ImageReviewContainerSpecApplyConfiguration{} -} - -// WithImage sets the Image field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Image field is set to the value of the last call. -func (b *ImageReviewContainerSpecApplyConfiguration) WithImage(value string) *ImageReviewContainerSpecApplyConfiguration { - b.Image = &value - return b -} diff --git a/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewspec.go b/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewspec.go deleted file mode 100644 index 7efc36a32..000000000 --- a/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewspec.go +++ /dev/null @@ -1,68 +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 applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// ImageReviewSpecApplyConfiguration represents a declarative configuration of the ImageReviewSpec type for use -// with apply. -type ImageReviewSpecApplyConfiguration struct { - Containers []ImageReviewContainerSpecApplyConfiguration `json:"containers,omitempty"` - Annotations map[string]string `json:"annotations,omitempty"` - Namespace *string `json:"namespace,omitempty"` -} - -// ImageReviewSpecApplyConfiguration constructs a declarative configuration of the ImageReviewSpec type for use with -// apply. -func ImageReviewSpec() *ImageReviewSpecApplyConfiguration { - return &ImageReviewSpecApplyConfiguration{} -} - -// WithContainers adds the given value to the Containers 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 Containers field. -func (b *ImageReviewSpecApplyConfiguration) WithContainers(values ...*ImageReviewContainerSpecApplyConfiguration) *ImageReviewSpecApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithContainers") - } - b.Containers = append(b.Containers, *values[i]) - } - 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 *ImageReviewSpecApplyConfiguration) WithAnnotations(entries map[string]string) *ImageReviewSpecApplyConfiguration { - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - 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 *ImageReviewSpecApplyConfiguration) WithNamespace(value string) *ImageReviewSpecApplyConfiguration { - b.Namespace = &value - return b -} diff --git a/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewstatus.go b/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewstatus.go deleted file mode 100644 index e26a427e6..000000000 --- a/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewstatus.go +++ /dev/null @@ -1,63 +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 applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// ImageReviewStatusApplyConfiguration represents a declarative configuration of the ImageReviewStatus type for use -// with apply. -type ImageReviewStatusApplyConfiguration struct { - Allowed *bool `json:"allowed,omitempty"` - Reason *string `json:"reason,omitempty"` - AuditAnnotations map[string]string `json:"auditAnnotations,omitempty"` -} - -// ImageReviewStatusApplyConfiguration constructs a declarative configuration of the ImageReviewStatus type for use with -// apply. -func ImageReviewStatus() *ImageReviewStatusApplyConfiguration { - return &ImageReviewStatusApplyConfiguration{} -} - -// WithAllowed sets the Allowed field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Allowed field is set to the value of the last call. -func (b *ImageReviewStatusApplyConfiguration) WithAllowed(value bool) *ImageReviewStatusApplyConfiguration { - b.Allowed = &value - return b -} - -// WithReason sets the Reason field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Reason field is set to the value of the last call. -func (b *ImageReviewStatusApplyConfiguration) WithReason(value string) *ImageReviewStatusApplyConfiguration { - b.Reason = &value - return b -} - -// WithAuditAnnotations puts the entries into the AuditAnnotations 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 AuditAnnotations field, -// overwriting an existing map entries in AuditAnnotations field with the same key. -func (b *ImageReviewStatusApplyConfiguration) WithAuditAnnotations(entries map[string]string) *ImageReviewStatusApplyConfiguration { - if b.AuditAnnotations == nil && len(entries) > 0 { - b.AuditAnnotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.AuditAnnotations[k] = v - } - return b -} diff --git a/vendor/k8s.io/client-go/applyconfigurations/utils.go b/vendor/k8s.io/client-go/applyconfigurations/utils.go deleted file mode 100644 index 0955b8f44..000000000 --- a/vendor/k8s.io/client-go/applyconfigurations/utils.go +++ /dev/null @@ -1,1740 +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 applyconfiguration-gen. DO NOT EDIT. - -package applyconfigurations - -import ( - v1 "k8s.io/api/admissionregistration/v1" - v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" - v1beta1 "k8s.io/api/admissionregistration/v1beta1" - apiserverinternalv1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" - appsv1 "k8s.io/api/apps/v1" - appsv1beta1 "k8s.io/api/apps/v1beta1" - v1beta2 "k8s.io/api/apps/v1beta2" - autoscalingv1 "k8s.io/api/autoscaling/v1" - v2 "k8s.io/api/autoscaling/v2" - v2beta1 "k8s.io/api/autoscaling/v2beta1" - v2beta2 "k8s.io/api/autoscaling/v2beta2" - batchv1 "k8s.io/api/batch/v1" - batchv1beta1 "k8s.io/api/batch/v1beta1" - certificatesv1 "k8s.io/api/certificates/v1" - certificatesv1alpha1 "k8s.io/api/certificates/v1alpha1" - certificatesv1beta1 "k8s.io/api/certificates/v1beta1" - coordinationv1 "k8s.io/api/coordination/v1" - coordinationv1alpha1 "k8s.io/api/coordination/v1alpha1" - coordinationv1beta1 "k8s.io/api/coordination/v1beta1" - corev1 "k8s.io/api/core/v1" - discoveryv1 "k8s.io/api/discovery/v1" - discoveryv1beta1 "k8s.io/api/discovery/v1beta1" - eventsv1 "k8s.io/api/events/v1" - eventsv1beta1 "k8s.io/api/events/v1beta1" - extensionsv1beta1 "k8s.io/api/extensions/v1beta1" - flowcontrolv1 "k8s.io/api/flowcontrol/v1" - flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" - flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" - v1beta3 "k8s.io/api/flowcontrol/v1beta3" - imagepolicyv1alpha1 "k8s.io/api/imagepolicy/v1alpha1" - networkingv1 "k8s.io/api/networking/v1" - networkingv1alpha1 "k8s.io/api/networking/v1alpha1" - networkingv1beta1 "k8s.io/api/networking/v1beta1" - nodev1 "k8s.io/api/node/v1" - nodev1alpha1 "k8s.io/api/node/v1alpha1" - nodev1beta1 "k8s.io/api/node/v1beta1" - policyv1 "k8s.io/api/policy/v1" - policyv1beta1 "k8s.io/api/policy/v1beta1" - rbacv1 "k8s.io/api/rbac/v1" - rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" - rbacv1beta1 "k8s.io/api/rbac/v1beta1" - v1alpha3 "k8s.io/api/resource/v1alpha3" - schedulingv1 "k8s.io/api/scheduling/v1" - schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" - schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" - storagev1 "k8s.io/api/storage/v1" - storagev1alpha1 "k8s.io/api/storage/v1alpha1" - storagev1beta1 "k8s.io/api/storage/v1beta1" - storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" - admissionregistrationv1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1" - admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" - applyconfigurationsapiserverinternalv1alpha1 "k8s.io/client-go/applyconfigurations/apiserverinternal/v1alpha1" - applyconfigurationsappsv1 "k8s.io/client-go/applyconfigurations/apps/v1" - applyconfigurationsappsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1" - appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" - applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" - autoscalingv2 "k8s.io/client-go/applyconfigurations/autoscaling/v2" - autoscalingv2beta1 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta1" - autoscalingv2beta2 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta2" - applyconfigurationsbatchv1 "k8s.io/client-go/applyconfigurations/batch/v1" - applyconfigurationsbatchv1beta1 "k8s.io/client-go/applyconfigurations/batch/v1beta1" - applyconfigurationscertificatesv1 "k8s.io/client-go/applyconfigurations/certificates/v1" - applyconfigurationscertificatesv1alpha1 "k8s.io/client-go/applyconfigurations/certificates/v1alpha1" - applyconfigurationscertificatesv1beta1 "k8s.io/client-go/applyconfigurations/certificates/v1beta1" - applyconfigurationscoordinationv1 "k8s.io/client-go/applyconfigurations/coordination/v1" - applyconfigurationscoordinationv1alpha1 "k8s.io/client-go/applyconfigurations/coordination/v1alpha1" - applyconfigurationscoordinationv1beta1 "k8s.io/client-go/applyconfigurations/coordination/v1beta1" - applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" - applyconfigurationsdiscoveryv1 "k8s.io/client-go/applyconfigurations/discovery/v1" - applyconfigurationsdiscoveryv1beta1 "k8s.io/client-go/applyconfigurations/discovery/v1beta1" - applyconfigurationseventsv1 "k8s.io/client-go/applyconfigurations/events/v1" - applyconfigurationseventsv1beta1 "k8s.io/client-go/applyconfigurations/events/v1beta1" - applyconfigurationsextensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" - applyconfigurationsflowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" - applyconfigurationsflowcontrolv1beta1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1" - applyconfigurationsflowcontrolv1beta2 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2" - flowcontrolv1beta3 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3" - applyconfigurationsimagepolicyv1alpha1 "k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1" - internal "k8s.io/client-go/applyconfigurations/internal" - applyconfigurationsmetav1 "k8s.io/client-go/applyconfigurations/meta/v1" - applyconfigurationsnetworkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" - applyconfigurationsnetworkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" - applyconfigurationsnetworkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" - applyconfigurationsnodev1 "k8s.io/client-go/applyconfigurations/node/v1" - applyconfigurationsnodev1alpha1 "k8s.io/client-go/applyconfigurations/node/v1alpha1" - applyconfigurationsnodev1beta1 "k8s.io/client-go/applyconfigurations/node/v1beta1" - applyconfigurationspolicyv1 "k8s.io/client-go/applyconfigurations/policy/v1" - applyconfigurationspolicyv1beta1 "k8s.io/client-go/applyconfigurations/policy/v1beta1" - applyconfigurationsrbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" - applyconfigurationsrbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" - applyconfigurationsrbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" - resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" - applyconfigurationsschedulingv1 "k8s.io/client-go/applyconfigurations/scheduling/v1" - applyconfigurationsschedulingv1alpha1 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha1" - applyconfigurationsschedulingv1beta1 "k8s.io/client-go/applyconfigurations/scheduling/v1beta1" - applyconfigurationsstoragev1 "k8s.io/client-go/applyconfigurations/storage/v1" - applyconfigurationsstoragev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" - applyconfigurationsstoragev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" - applyconfigurationsstoragemigrationv1alpha1 "k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no -// apply configuration type exists for the given GroupVersionKind. -func ForKind(kind schema.GroupVersionKind) interface{} { - switch kind { - // Group=admissionregistration.k8s.io, Version=v1 - case v1.SchemeGroupVersion.WithKind("AuditAnnotation"): - return &admissionregistrationv1.AuditAnnotationApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("ExpressionWarning"): - return &admissionregistrationv1.ExpressionWarningApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("MatchCondition"): - return &admissionregistrationv1.MatchConditionApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("MatchResources"): - return &admissionregistrationv1.MatchResourcesApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("MutatingWebhook"): - return &admissionregistrationv1.MutatingWebhookApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("MutatingWebhookConfiguration"): - return &admissionregistrationv1.MutatingWebhookConfigurationApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("NamedRuleWithOperations"): - return &admissionregistrationv1.NamedRuleWithOperationsApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("ParamKind"): - return &admissionregistrationv1.ParamKindApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("ParamRef"): - return &admissionregistrationv1.ParamRefApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("Rule"): - return &admissionregistrationv1.RuleApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("RuleWithOperations"): - return &admissionregistrationv1.RuleWithOperationsApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("ServiceReference"): - return &admissionregistrationv1.ServiceReferenceApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("TypeChecking"): - return &admissionregistrationv1.TypeCheckingApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy"): - return &admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding"): - return &admissionregistrationv1.ValidatingAdmissionPolicyBindingApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBindingSpec"): - return &admissionregistrationv1.ValidatingAdmissionPolicyBindingSpecApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicySpec"): - return &admissionregistrationv1.ValidatingAdmissionPolicySpecApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyStatus"): - return &admissionregistrationv1.ValidatingAdmissionPolicyStatusApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("ValidatingWebhook"): - return &admissionregistrationv1.ValidatingWebhookApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("ValidatingWebhookConfiguration"): - return &admissionregistrationv1.ValidatingWebhookConfigurationApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("Validation"): - return &admissionregistrationv1.ValidationApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("Variable"): - return &admissionregistrationv1.VariableApplyConfiguration{} - case v1.SchemeGroupVersion.WithKind("WebhookClientConfig"): - return &admissionregistrationv1.WebhookClientConfigApplyConfiguration{} - - // Group=admissionregistration.k8s.io, Version=v1alpha1 - case v1alpha1.SchemeGroupVersion.WithKind("AuditAnnotation"): - return &admissionregistrationv1alpha1.AuditAnnotationApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ExpressionWarning"): - return &admissionregistrationv1alpha1.ExpressionWarningApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("MatchCondition"): - return &admissionregistrationv1alpha1.MatchConditionApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("MatchResources"): - return &admissionregistrationv1alpha1.MatchResourcesApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("NamedRuleWithOperations"): - return &admissionregistrationv1alpha1.NamedRuleWithOperationsApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ParamKind"): - return &admissionregistrationv1alpha1.ParamKindApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ParamRef"): - return &admissionregistrationv1alpha1.ParamRefApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("TypeChecking"): - return &admissionregistrationv1alpha1.TypeCheckingApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy"): - return &admissionregistrationv1alpha1.ValidatingAdmissionPolicyApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding"): - return &admissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBindingSpec"): - return &admissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicySpec"): - return &admissionregistrationv1alpha1.ValidatingAdmissionPolicySpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyStatus"): - return &admissionregistrationv1alpha1.ValidatingAdmissionPolicyStatusApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("Validation"): - return &admissionregistrationv1alpha1.ValidationApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("Variable"): - return &admissionregistrationv1alpha1.VariableApplyConfiguration{} - - // Group=admissionregistration.k8s.io, Version=v1beta1 - case v1beta1.SchemeGroupVersion.WithKind("AuditAnnotation"): - return &admissionregistrationv1beta1.AuditAnnotationApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("ExpressionWarning"): - return &admissionregistrationv1beta1.ExpressionWarningApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("MatchCondition"): - return &admissionregistrationv1beta1.MatchConditionApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("MatchResources"): - return &admissionregistrationv1beta1.MatchResourcesApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("MutatingWebhook"): - return &admissionregistrationv1beta1.MutatingWebhookApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("MutatingWebhookConfiguration"): - return &admissionregistrationv1beta1.MutatingWebhookConfigurationApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("NamedRuleWithOperations"): - return &admissionregistrationv1beta1.NamedRuleWithOperationsApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("ParamKind"): - return &admissionregistrationv1beta1.ParamKindApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("ParamRef"): - return &admissionregistrationv1beta1.ParamRefApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("ServiceReference"): - return &admissionregistrationv1beta1.ServiceReferenceApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("TypeChecking"): - return &admissionregistrationv1beta1.TypeCheckingApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy"): - return &admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding"): - return &admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBindingSpec"): - return &admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingSpecApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicySpec"): - return &admissionregistrationv1beta1.ValidatingAdmissionPolicySpecApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyStatus"): - return &admissionregistrationv1beta1.ValidatingAdmissionPolicyStatusApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("ValidatingWebhook"): - return &admissionregistrationv1beta1.ValidatingWebhookApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("ValidatingWebhookConfiguration"): - return &admissionregistrationv1beta1.ValidatingWebhookConfigurationApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("Validation"): - return &admissionregistrationv1beta1.ValidationApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("Variable"): - return &admissionregistrationv1beta1.VariableApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("WebhookClientConfig"): - return &admissionregistrationv1beta1.WebhookClientConfigApplyConfiguration{} - - // Group=apps, Version=v1 - case appsv1.SchemeGroupVersion.WithKind("ControllerRevision"): - return &applyconfigurationsappsv1.ControllerRevisionApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("DaemonSet"): - return &applyconfigurationsappsv1.DaemonSetApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("DaemonSetCondition"): - return &applyconfigurationsappsv1.DaemonSetConditionApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("DaemonSetSpec"): - return &applyconfigurationsappsv1.DaemonSetSpecApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("DaemonSetStatus"): - return &applyconfigurationsappsv1.DaemonSetStatusApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("DaemonSetUpdateStrategy"): - return &applyconfigurationsappsv1.DaemonSetUpdateStrategyApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("Deployment"): - return &applyconfigurationsappsv1.DeploymentApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("DeploymentCondition"): - return &applyconfigurationsappsv1.DeploymentConditionApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("DeploymentSpec"): - return &applyconfigurationsappsv1.DeploymentSpecApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("DeploymentStatus"): - return &applyconfigurationsappsv1.DeploymentStatusApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("DeploymentStrategy"): - return &applyconfigurationsappsv1.DeploymentStrategyApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("ReplicaSet"): - return &applyconfigurationsappsv1.ReplicaSetApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("ReplicaSetCondition"): - return &applyconfigurationsappsv1.ReplicaSetConditionApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("ReplicaSetSpec"): - return &applyconfigurationsappsv1.ReplicaSetSpecApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("ReplicaSetStatus"): - return &applyconfigurationsappsv1.ReplicaSetStatusApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("RollingUpdateDaemonSet"): - return &applyconfigurationsappsv1.RollingUpdateDaemonSetApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("RollingUpdateDeployment"): - return &applyconfigurationsappsv1.RollingUpdateDeploymentApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("RollingUpdateStatefulSetStrategy"): - return &applyconfigurationsappsv1.RollingUpdateStatefulSetStrategyApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("StatefulSet"): - return &applyconfigurationsappsv1.StatefulSetApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("StatefulSetCondition"): - return &applyconfigurationsappsv1.StatefulSetConditionApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("StatefulSetOrdinals"): - return &applyconfigurationsappsv1.StatefulSetOrdinalsApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("StatefulSetPersistentVolumeClaimRetentionPolicy"): - return &applyconfigurationsappsv1.StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("StatefulSetSpec"): - return &applyconfigurationsappsv1.StatefulSetSpecApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("StatefulSetStatus"): - return &applyconfigurationsappsv1.StatefulSetStatusApplyConfiguration{} - case appsv1.SchemeGroupVersion.WithKind("StatefulSetUpdateStrategy"): - return &applyconfigurationsappsv1.StatefulSetUpdateStrategyApplyConfiguration{} - - // Group=apps, Version=v1beta1 - case appsv1beta1.SchemeGroupVersion.WithKind("ControllerRevision"): - return &applyconfigurationsappsv1beta1.ControllerRevisionApplyConfiguration{} - case appsv1beta1.SchemeGroupVersion.WithKind("Deployment"): - return &applyconfigurationsappsv1beta1.DeploymentApplyConfiguration{} - case appsv1beta1.SchemeGroupVersion.WithKind("DeploymentCondition"): - return &applyconfigurationsappsv1beta1.DeploymentConditionApplyConfiguration{} - case appsv1beta1.SchemeGroupVersion.WithKind("DeploymentSpec"): - return &applyconfigurationsappsv1beta1.DeploymentSpecApplyConfiguration{} - case appsv1beta1.SchemeGroupVersion.WithKind("DeploymentStatus"): - return &applyconfigurationsappsv1beta1.DeploymentStatusApplyConfiguration{} - case appsv1beta1.SchemeGroupVersion.WithKind("DeploymentStrategy"): - return &applyconfigurationsappsv1beta1.DeploymentStrategyApplyConfiguration{} - case appsv1beta1.SchemeGroupVersion.WithKind("RollbackConfig"): - return &applyconfigurationsappsv1beta1.RollbackConfigApplyConfiguration{} - case appsv1beta1.SchemeGroupVersion.WithKind("RollingUpdateDeployment"): - return &applyconfigurationsappsv1beta1.RollingUpdateDeploymentApplyConfiguration{} - case appsv1beta1.SchemeGroupVersion.WithKind("RollingUpdateStatefulSetStrategy"): - return &applyconfigurationsappsv1beta1.RollingUpdateStatefulSetStrategyApplyConfiguration{} - case appsv1beta1.SchemeGroupVersion.WithKind("StatefulSet"): - return &applyconfigurationsappsv1beta1.StatefulSetApplyConfiguration{} - case appsv1beta1.SchemeGroupVersion.WithKind("StatefulSetCondition"): - return &applyconfigurationsappsv1beta1.StatefulSetConditionApplyConfiguration{} - case appsv1beta1.SchemeGroupVersion.WithKind("StatefulSetOrdinals"): - return &applyconfigurationsappsv1beta1.StatefulSetOrdinalsApplyConfiguration{} - case appsv1beta1.SchemeGroupVersion.WithKind("StatefulSetPersistentVolumeClaimRetentionPolicy"): - return &applyconfigurationsappsv1beta1.StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration{} - case appsv1beta1.SchemeGroupVersion.WithKind("StatefulSetSpec"): - return &applyconfigurationsappsv1beta1.StatefulSetSpecApplyConfiguration{} - case appsv1beta1.SchemeGroupVersion.WithKind("StatefulSetStatus"): - return &applyconfigurationsappsv1beta1.StatefulSetStatusApplyConfiguration{} - case appsv1beta1.SchemeGroupVersion.WithKind("StatefulSetUpdateStrategy"): - return &applyconfigurationsappsv1beta1.StatefulSetUpdateStrategyApplyConfiguration{} - - // Group=apps, Version=v1beta2 - case v1beta2.SchemeGroupVersion.WithKind("ControllerRevision"): - return &appsv1beta2.ControllerRevisionApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("DaemonSet"): - return &appsv1beta2.DaemonSetApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("DaemonSetCondition"): - return &appsv1beta2.DaemonSetConditionApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("DaemonSetSpec"): - return &appsv1beta2.DaemonSetSpecApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("DaemonSetStatus"): - return &appsv1beta2.DaemonSetStatusApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("DaemonSetUpdateStrategy"): - return &appsv1beta2.DaemonSetUpdateStrategyApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("Deployment"): - return &appsv1beta2.DeploymentApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("DeploymentCondition"): - return &appsv1beta2.DeploymentConditionApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("DeploymentSpec"): - return &appsv1beta2.DeploymentSpecApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("DeploymentStatus"): - return &appsv1beta2.DeploymentStatusApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("DeploymentStrategy"): - return &appsv1beta2.DeploymentStrategyApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("ReplicaSet"): - return &appsv1beta2.ReplicaSetApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("ReplicaSetCondition"): - return &appsv1beta2.ReplicaSetConditionApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("ReplicaSetSpec"): - return &appsv1beta2.ReplicaSetSpecApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("ReplicaSetStatus"): - return &appsv1beta2.ReplicaSetStatusApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("RollingUpdateDaemonSet"): - return &appsv1beta2.RollingUpdateDaemonSetApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("RollingUpdateDeployment"): - return &appsv1beta2.RollingUpdateDeploymentApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("RollingUpdateStatefulSetStrategy"): - return &appsv1beta2.RollingUpdateStatefulSetStrategyApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("Scale"): - return &appsv1beta2.ScaleApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("StatefulSet"): - return &appsv1beta2.StatefulSetApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("StatefulSetCondition"): - return &appsv1beta2.StatefulSetConditionApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("StatefulSetOrdinals"): - return &appsv1beta2.StatefulSetOrdinalsApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("StatefulSetPersistentVolumeClaimRetentionPolicy"): - return &appsv1beta2.StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("StatefulSetSpec"): - return &appsv1beta2.StatefulSetSpecApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("StatefulSetStatus"): - return &appsv1beta2.StatefulSetStatusApplyConfiguration{} - case v1beta2.SchemeGroupVersion.WithKind("StatefulSetUpdateStrategy"): - return &appsv1beta2.StatefulSetUpdateStrategyApplyConfiguration{} - - // Group=autoscaling, Version=v1 - case autoscalingv1.SchemeGroupVersion.WithKind("CrossVersionObjectReference"): - return &applyconfigurationsautoscalingv1.CrossVersionObjectReferenceApplyConfiguration{} - case autoscalingv1.SchemeGroupVersion.WithKind("HorizontalPodAutoscaler"): - return &applyconfigurationsautoscalingv1.HorizontalPodAutoscalerApplyConfiguration{} - case autoscalingv1.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerSpec"): - return &applyconfigurationsautoscalingv1.HorizontalPodAutoscalerSpecApplyConfiguration{} - case autoscalingv1.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerStatus"): - return &applyconfigurationsautoscalingv1.HorizontalPodAutoscalerStatusApplyConfiguration{} - case autoscalingv1.SchemeGroupVersion.WithKind("Scale"): - return &applyconfigurationsautoscalingv1.ScaleApplyConfiguration{} - case autoscalingv1.SchemeGroupVersion.WithKind("ScaleSpec"): - return &applyconfigurationsautoscalingv1.ScaleSpecApplyConfiguration{} - case autoscalingv1.SchemeGroupVersion.WithKind("ScaleStatus"): - return &applyconfigurationsautoscalingv1.ScaleStatusApplyConfiguration{} - - // Group=autoscaling, Version=v2 - case v2.SchemeGroupVersion.WithKind("ContainerResourceMetricSource"): - return &autoscalingv2.ContainerResourceMetricSourceApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("ContainerResourceMetricStatus"): - return &autoscalingv2.ContainerResourceMetricStatusApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("CrossVersionObjectReference"): - return &autoscalingv2.CrossVersionObjectReferenceApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("ExternalMetricSource"): - return &autoscalingv2.ExternalMetricSourceApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("ExternalMetricStatus"): - return &autoscalingv2.ExternalMetricStatusApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("HorizontalPodAutoscaler"): - return &autoscalingv2.HorizontalPodAutoscalerApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerBehavior"): - return &autoscalingv2.HorizontalPodAutoscalerBehaviorApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerCondition"): - return &autoscalingv2.HorizontalPodAutoscalerConditionApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerSpec"): - return &autoscalingv2.HorizontalPodAutoscalerSpecApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerStatus"): - return &autoscalingv2.HorizontalPodAutoscalerStatusApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("HPAScalingPolicy"): - return &autoscalingv2.HPAScalingPolicyApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("HPAScalingRules"): - return &autoscalingv2.HPAScalingRulesApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("MetricIdentifier"): - return &autoscalingv2.MetricIdentifierApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("MetricSpec"): - return &autoscalingv2.MetricSpecApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("MetricStatus"): - return &autoscalingv2.MetricStatusApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("MetricTarget"): - return &autoscalingv2.MetricTargetApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("MetricValueStatus"): - return &autoscalingv2.MetricValueStatusApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("ObjectMetricSource"): - return &autoscalingv2.ObjectMetricSourceApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("ObjectMetricStatus"): - return &autoscalingv2.ObjectMetricStatusApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("PodsMetricSource"): - return &autoscalingv2.PodsMetricSourceApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("PodsMetricStatus"): - return &autoscalingv2.PodsMetricStatusApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("ResourceMetricSource"): - return &autoscalingv2.ResourceMetricSourceApplyConfiguration{} - case v2.SchemeGroupVersion.WithKind("ResourceMetricStatus"): - return &autoscalingv2.ResourceMetricStatusApplyConfiguration{} - - // Group=autoscaling, Version=v2beta1 - case v2beta1.SchemeGroupVersion.WithKind("ContainerResourceMetricSource"): - return &autoscalingv2beta1.ContainerResourceMetricSourceApplyConfiguration{} - case v2beta1.SchemeGroupVersion.WithKind("ContainerResourceMetricStatus"): - return &autoscalingv2beta1.ContainerResourceMetricStatusApplyConfiguration{} - case v2beta1.SchemeGroupVersion.WithKind("CrossVersionObjectReference"): - return &autoscalingv2beta1.CrossVersionObjectReferenceApplyConfiguration{} - case v2beta1.SchemeGroupVersion.WithKind("ExternalMetricSource"): - return &autoscalingv2beta1.ExternalMetricSourceApplyConfiguration{} - case v2beta1.SchemeGroupVersion.WithKind("ExternalMetricStatus"): - return &autoscalingv2beta1.ExternalMetricStatusApplyConfiguration{} - case v2beta1.SchemeGroupVersion.WithKind("HorizontalPodAutoscaler"): - return &autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration{} - case v2beta1.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerCondition"): - return &autoscalingv2beta1.HorizontalPodAutoscalerConditionApplyConfiguration{} - case v2beta1.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerSpec"): - return &autoscalingv2beta1.HorizontalPodAutoscalerSpecApplyConfiguration{} - case v2beta1.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerStatus"): - return &autoscalingv2beta1.HorizontalPodAutoscalerStatusApplyConfiguration{} - case v2beta1.SchemeGroupVersion.WithKind("MetricSpec"): - return &autoscalingv2beta1.MetricSpecApplyConfiguration{} - case v2beta1.SchemeGroupVersion.WithKind("MetricStatus"): - return &autoscalingv2beta1.MetricStatusApplyConfiguration{} - case v2beta1.SchemeGroupVersion.WithKind("ObjectMetricSource"): - return &autoscalingv2beta1.ObjectMetricSourceApplyConfiguration{} - case v2beta1.SchemeGroupVersion.WithKind("ObjectMetricStatus"): - return &autoscalingv2beta1.ObjectMetricStatusApplyConfiguration{} - case v2beta1.SchemeGroupVersion.WithKind("PodsMetricSource"): - return &autoscalingv2beta1.PodsMetricSourceApplyConfiguration{} - case v2beta1.SchemeGroupVersion.WithKind("PodsMetricStatus"): - return &autoscalingv2beta1.PodsMetricStatusApplyConfiguration{} - case v2beta1.SchemeGroupVersion.WithKind("ResourceMetricSource"): - return &autoscalingv2beta1.ResourceMetricSourceApplyConfiguration{} - case v2beta1.SchemeGroupVersion.WithKind("ResourceMetricStatus"): - return &autoscalingv2beta1.ResourceMetricStatusApplyConfiguration{} - - // Group=autoscaling, Version=v2beta2 - case v2beta2.SchemeGroupVersion.WithKind("ContainerResourceMetricSource"): - return &autoscalingv2beta2.ContainerResourceMetricSourceApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("ContainerResourceMetricStatus"): - return &autoscalingv2beta2.ContainerResourceMetricStatusApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("CrossVersionObjectReference"): - return &autoscalingv2beta2.CrossVersionObjectReferenceApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("ExternalMetricSource"): - return &autoscalingv2beta2.ExternalMetricSourceApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("ExternalMetricStatus"): - return &autoscalingv2beta2.ExternalMetricStatusApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("HorizontalPodAutoscaler"): - return &autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerBehavior"): - return &autoscalingv2beta2.HorizontalPodAutoscalerBehaviorApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerCondition"): - return &autoscalingv2beta2.HorizontalPodAutoscalerConditionApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerSpec"): - return &autoscalingv2beta2.HorizontalPodAutoscalerSpecApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerStatus"): - return &autoscalingv2beta2.HorizontalPodAutoscalerStatusApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("HPAScalingPolicy"): - return &autoscalingv2beta2.HPAScalingPolicyApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("HPAScalingRules"): - return &autoscalingv2beta2.HPAScalingRulesApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("MetricIdentifier"): - return &autoscalingv2beta2.MetricIdentifierApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("MetricSpec"): - return &autoscalingv2beta2.MetricSpecApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("MetricStatus"): - return &autoscalingv2beta2.MetricStatusApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("MetricTarget"): - return &autoscalingv2beta2.MetricTargetApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("MetricValueStatus"): - return &autoscalingv2beta2.MetricValueStatusApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("ObjectMetricSource"): - return &autoscalingv2beta2.ObjectMetricSourceApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("ObjectMetricStatus"): - return &autoscalingv2beta2.ObjectMetricStatusApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("PodsMetricSource"): - return &autoscalingv2beta2.PodsMetricSourceApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("PodsMetricStatus"): - return &autoscalingv2beta2.PodsMetricStatusApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("ResourceMetricSource"): - return &autoscalingv2beta2.ResourceMetricSourceApplyConfiguration{} - case v2beta2.SchemeGroupVersion.WithKind("ResourceMetricStatus"): - return &autoscalingv2beta2.ResourceMetricStatusApplyConfiguration{} - - // Group=batch, Version=v1 - case batchv1.SchemeGroupVersion.WithKind("CronJob"): - return &applyconfigurationsbatchv1.CronJobApplyConfiguration{} - case batchv1.SchemeGroupVersion.WithKind("CronJobSpec"): - return &applyconfigurationsbatchv1.CronJobSpecApplyConfiguration{} - case batchv1.SchemeGroupVersion.WithKind("CronJobStatus"): - return &applyconfigurationsbatchv1.CronJobStatusApplyConfiguration{} - case batchv1.SchemeGroupVersion.WithKind("Job"): - return &applyconfigurationsbatchv1.JobApplyConfiguration{} - case batchv1.SchemeGroupVersion.WithKind("JobCondition"): - return &applyconfigurationsbatchv1.JobConditionApplyConfiguration{} - case batchv1.SchemeGroupVersion.WithKind("JobSpec"): - return &applyconfigurationsbatchv1.JobSpecApplyConfiguration{} - case batchv1.SchemeGroupVersion.WithKind("JobStatus"): - return &applyconfigurationsbatchv1.JobStatusApplyConfiguration{} - case batchv1.SchemeGroupVersion.WithKind("JobTemplateSpec"): - return &applyconfigurationsbatchv1.JobTemplateSpecApplyConfiguration{} - case batchv1.SchemeGroupVersion.WithKind("PodFailurePolicy"): - return &applyconfigurationsbatchv1.PodFailurePolicyApplyConfiguration{} - case batchv1.SchemeGroupVersion.WithKind("PodFailurePolicyOnExitCodesRequirement"): - return &applyconfigurationsbatchv1.PodFailurePolicyOnExitCodesRequirementApplyConfiguration{} - case batchv1.SchemeGroupVersion.WithKind("PodFailurePolicyOnPodConditionsPattern"): - return &applyconfigurationsbatchv1.PodFailurePolicyOnPodConditionsPatternApplyConfiguration{} - case batchv1.SchemeGroupVersion.WithKind("PodFailurePolicyRule"): - return &applyconfigurationsbatchv1.PodFailurePolicyRuleApplyConfiguration{} - case batchv1.SchemeGroupVersion.WithKind("SuccessPolicy"): - return &applyconfigurationsbatchv1.SuccessPolicyApplyConfiguration{} - case batchv1.SchemeGroupVersion.WithKind("SuccessPolicyRule"): - return &applyconfigurationsbatchv1.SuccessPolicyRuleApplyConfiguration{} - case batchv1.SchemeGroupVersion.WithKind("UncountedTerminatedPods"): - return &applyconfigurationsbatchv1.UncountedTerminatedPodsApplyConfiguration{} - - // Group=batch, Version=v1beta1 - case batchv1beta1.SchemeGroupVersion.WithKind("CronJob"): - return &applyconfigurationsbatchv1beta1.CronJobApplyConfiguration{} - case batchv1beta1.SchemeGroupVersion.WithKind("CronJobSpec"): - return &applyconfigurationsbatchv1beta1.CronJobSpecApplyConfiguration{} - case batchv1beta1.SchemeGroupVersion.WithKind("CronJobStatus"): - return &applyconfigurationsbatchv1beta1.CronJobStatusApplyConfiguration{} - case batchv1beta1.SchemeGroupVersion.WithKind("JobTemplateSpec"): - return &applyconfigurationsbatchv1beta1.JobTemplateSpecApplyConfiguration{} - - // Group=certificates.k8s.io, Version=v1 - case certificatesv1.SchemeGroupVersion.WithKind("CertificateSigningRequest"): - return &applyconfigurationscertificatesv1.CertificateSigningRequestApplyConfiguration{} - case certificatesv1.SchemeGroupVersion.WithKind("CertificateSigningRequestCondition"): - return &applyconfigurationscertificatesv1.CertificateSigningRequestConditionApplyConfiguration{} - case certificatesv1.SchemeGroupVersion.WithKind("CertificateSigningRequestSpec"): - return &applyconfigurationscertificatesv1.CertificateSigningRequestSpecApplyConfiguration{} - case certificatesv1.SchemeGroupVersion.WithKind("CertificateSigningRequestStatus"): - return &applyconfigurationscertificatesv1.CertificateSigningRequestStatusApplyConfiguration{} - - // Group=certificates.k8s.io, Version=v1alpha1 - case certificatesv1alpha1.SchemeGroupVersion.WithKind("ClusterTrustBundle"): - return &applyconfigurationscertificatesv1alpha1.ClusterTrustBundleApplyConfiguration{} - case certificatesv1alpha1.SchemeGroupVersion.WithKind("ClusterTrustBundleSpec"): - return &applyconfigurationscertificatesv1alpha1.ClusterTrustBundleSpecApplyConfiguration{} - - // Group=certificates.k8s.io, Version=v1beta1 - case certificatesv1beta1.SchemeGroupVersion.WithKind("CertificateSigningRequest"): - return &applyconfigurationscertificatesv1beta1.CertificateSigningRequestApplyConfiguration{} - case certificatesv1beta1.SchemeGroupVersion.WithKind("CertificateSigningRequestCondition"): - return &applyconfigurationscertificatesv1beta1.CertificateSigningRequestConditionApplyConfiguration{} - case certificatesv1beta1.SchemeGroupVersion.WithKind("CertificateSigningRequestSpec"): - return &applyconfigurationscertificatesv1beta1.CertificateSigningRequestSpecApplyConfiguration{} - case certificatesv1beta1.SchemeGroupVersion.WithKind("CertificateSigningRequestStatus"): - return &applyconfigurationscertificatesv1beta1.CertificateSigningRequestStatusApplyConfiguration{} - - // Group=coordination.k8s.io, Version=v1 - case coordinationv1.SchemeGroupVersion.WithKind("Lease"): - return &applyconfigurationscoordinationv1.LeaseApplyConfiguration{} - case coordinationv1.SchemeGroupVersion.WithKind("LeaseSpec"): - return &applyconfigurationscoordinationv1.LeaseSpecApplyConfiguration{} - - // Group=coordination.k8s.io, Version=v1alpha1 - case coordinationv1alpha1.SchemeGroupVersion.WithKind("LeaseCandidate"): - return &applyconfigurationscoordinationv1alpha1.LeaseCandidateApplyConfiguration{} - case coordinationv1alpha1.SchemeGroupVersion.WithKind("LeaseCandidateSpec"): - return &applyconfigurationscoordinationv1alpha1.LeaseCandidateSpecApplyConfiguration{} - - // Group=coordination.k8s.io, Version=v1beta1 - case coordinationv1beta1.SchemeGroupVersion.WithKind("Lease"): - return &applyconfigurationscoordinationv1beta1.LeaseApplyConfiguration{} - case coordinationv1beta1.SchemeGroupVersion.WithKind("LeaseSpec"): - return &applyconfigurationscoordinationv1beta1.LeaseSpecApplyConfiguration{} - - // Group=core, Version=v1 - case corev1.SchemeGroupVersion.WithKind("Affinity"): - return &applyconfigurationscorev1.AffinityApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("AppArmorProfile"): - return &applyconfigurationscorev1.AppArmorProfileApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("AttachedVolume"): - return &applyconfigurationscorev1.AttachedVolumeApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("AWSElasticBlockStoreVolumeSource"): - return &applyconfigurationscorev1.AWSElasticBlockStoreVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("AzureDiskVolumeSource"): - return &applyconfigurationscorev1.AzureDiskVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("AzureFilePersistentVolumeSource"): - return &applyconfigurationscorev1.AzureFilePersistentVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("AzureFileVolumeSource"): - return &applyconfigurationscorev1.AzureFileVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("Capabilities"): - return &applyconfigurationscorev1.CapabilitiesApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("CephFSPersistentVolumeSource"): - return &applyconfigurationscorev1.CephFSPersistentVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("CephFSVolumeSource"): - return &applyconfigurationscorev1.CephFSVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("CinderPersistentVolumeSource"): - return &applyconfigurationscorev1.CinderPersistentVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("CinderVolumeSource"): - return &applyconfigurationscorev1.CinderVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ClientIPConfig"): - return &applyconfigurationscorev1.ClientIPConfigApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ClusterTrustBundleProjection"): - return &applyconfigurationscorev1.ClusterTrustBundleProjectionApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ComponentCondition"): - return &applyconfigurationscorev1.ComponentConditionApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ComponentStatus"): - return &applyconfigurationscorev1.ComponentStatusApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ConfigMap"): - return &applyconfigurationscorev1.ConfigMapApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ConfigMapEnvSource"): - return &applyconfigurationscorev1.ConfigMapEnvSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ConfigMapKeySelector"): - return &applyconfigurationscorev1.ConfigMapKeySelectorApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ConfigMapNodeConfigSource"): - return &applyconfigurationscorev1.ConfigMapNodeConfigSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ConfigMapProjection"): - return &applyconfigurationscorev1.ConfigMapProjectionApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ConfigMapVolumeSource"): - return &applyconfigurationscorev1.ConfigMapVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("Container"): - return &applyconfigurationscorev1.ContainerApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ContainerImage"): - return &applyconfigurationscorev1.ContainerImageApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ContainerPort"): - return &applyconfigurationscorev1.ContainerPortApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ContainerResizePolicy"): - return &applyconfigurationscorev1.ContainerResizePolicyApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ContainerState"): - return &applyconfigurationscorev1.ContainerStateApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ContainerStateRunning"): - return &applyconfigurationscorev1.ContainerStateRunningApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ContainerStateTerminated"): - return &applyconfigurationscorev1.ContainerStateTerminatedApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ContainerStateWaiting"): - return &applyconfigurationscorev1.ContainerStateWaitingApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ContainerStatus"): - return &applyconfigurationscorev1.ContainerStatusApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ContainerUser"): - return &applyconfigurationscorev1.ContainerUserApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("CSIPersistentVolumeSource"): - return &applyconfigurationscorev1.CSIPersistentVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("CSIVolumeSource"): - return &applyconfigurationscorev1.CSIVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("DaemonEndpoint"): - return &applyconfigurationscorev1.DaemonEndpointApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("DownwardAPIProjection"): - return &applyconfigurationscorev1.DownwardAPIProjectionApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("DownwardAPIVolumeFile"): - return &applyconfigurationscorev1.DownwardAPIVolumeFileApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("DownwardAPIVolumeSource"): - return &applyconfigurationscorev1.DownwardAPIVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("EmptyDirVolumeSource"): - return &applyconfigurationscorev1.EmptyDirVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("EndpointAddress"): - return &applyconfigurationscorev1.EndpointAddressApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("EndpointPort"): - return &applyconfigurationscorev1.EndpointPortApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("Endpoints"): - return &applyconfigurationscorev1.EndpointsApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("EndpointSubset"): - return &applyconfigurationscorev1.EndpointSubsetApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("EnvFromSource"): - return &applyconfigurationscorev1.EnvFromSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("EnvVar"): - return &applyconfigurationscorev1.EnvVarApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("EnvVarSource"): - return &applyconfigurationscorev1.EnvVarSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("EphemeralContainer"): - return &applyconfigurationscorev1.EphemeralContainerApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("EphemeralContainerCommon"): - return &applyconfigurationscorev1.EphemeralContainerCommonApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("EphemeralVolumeSource"): - return &applyconfigurationscorev1.EphemeralVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("Event"): - return &applyconfigurationscorev1.EventApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("EventSeries"): - return &applyconfigurationscorev1.EventSeriesApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("EventSource"): - return &applyconfigurationscorev1.EventSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ExecAction"): - return &applyconfigurationscorev1.ExecActionApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("FCVolumeSource"): - return &applyconfigurationscorev1.FCVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("FlexPersistentVolumeSource"): - return &applyconfigurationscorev1.FlexPersistentVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("FlexVolumeSource"): - return &applyconfigurationscorev1.FlexVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("FlockerVolumeSource"): - return &applyconfigurationscorev1.FlockerVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("GCEPersistentDiskVolumeSource"): - return &applyconfigurationscorev1.GCEPersistentDiskVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("GitRepoVolumeSource"): - return &applyconfigurationscorev1.GitRepoVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("GlusterfsPersistentVolumeSource"): - return &applyconfigurationscorev1.GlusterfsPersistentVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("GlusterfsVolumeSource"): - return &applyconfigurationscorev1.GlusterfsVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("GRPCAction"): - return &applyconfigurationscorev1.GRPCActionApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("HostAlias"): - return &applyconfigurationscorev1.HostAliasApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("HostIP"): - return &applyconfigurationscorev1.HostIPApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("HostPathVolumeSource"): - return &applyconfigurationscorev1.HostPathVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("HTTPGetAction"): - return &applyconfigurationscorev1.HTTPGetActionApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("HTTPHeader"): - return &applyconfigurationscorev1.HTTPHeaderApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ImageVolumeSource"): - return &applyconfigurationscorev1.ImageVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ISCSIPersistentVolumeSource"): - return &applyconfigurationscorev1.ISCSIPersistentVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ISCSIVolumeSource"): - return &applyconfigurationscorev1.ISCSIVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("KeyToPath"): - return &applyconfigurationscorev1.KeyToPathApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("Lifecycle"): - return &applyconfigurationscorev1.LifecycleApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("LifecycleHandler"): - return &applyconfigurationscorev1.LifecycleHandlerApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("LimitRange"): - return &applyconfigurationscorev1.LimitRangeApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("LimitRangeItem"): - return &applyconfigurationscorev1.LimitRangeItemApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("LimitRangeSpec"): - return &applyconfigurationscorev1.LimitRangeSpecApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("LinuxContainerUser"): - return &applyconfigurationscorev1.LinuxContainerUserApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("LoadBalancerIngress"): - return &applyconfigurationscorev1.LoadBalancerIngressApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("LoadBalancerStatus"): - return &applyconfigurationscorev1.LoadBalancerStatusApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("LocalObjectReference"): - return &applyconfigurationscorev1.LocalObjectReferenceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("LocalVolumeSource"): - return &applyconfigurationscorev1.LocalVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ModifyVolumeStatus"): - return &applyconfigurationscorev1.ModifyVolumeStatusApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("Namespace"): - return &applyconfigurationscorev1.NamespaceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NamespaceCondition"): - return &applyconfigurationscorev1.NamespaceConditionApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NamespaceSpec"): - return &applyconfigurationscorev1.NamespaceSpecApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NamespaceStatus"): - return &applyconfigurationscorev1.NamespaceStatusApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NFSVolumeSource"): - return &applyconfigurationscorev1.NFSVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("Node"): - return &applyconfigurationscorev1.NodeApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NodeAddress"): - return &applyconfigurationscorev1.NodeAddressApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NodeAffinity"): - return &applyconfigurationscorev1.NodeAffinityApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NodeCondition"): - return &applyconfigurationscorev1.NodeConditionApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NodeConfigSource"): - return &applyconfigurationscorev1.NodeConfigSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NodeConfigStatus"): - return &applyconfigurationscorev1.NodeConfigStatusApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NodeDaemonEndpoints"): - return &applyconfigurationscorev1.NodeDaemonEndpointsApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NodeFeatures"): - return &applyconfigurationscorev1.NodeFeaturesApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NodeRuntimeHandler"): - return &applyconfigurationscorev1.NodeRuntimeHandlerApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NodeRuntimeHandlerFeatures"): - return &applyconfigurationscorev1.NodeRuntimeHandlerFeaturesApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NodeSelector"): - return &applyconfigurationscorev1.NodeSelectorApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NodeSelectorRequirement"): - return &applyconfigurationscorev1.NodeSelectorRequirementApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NodeSelectorTerm"): - return &applyconfigurationscorev1.NodeSelectorTermApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NodeSpec"): - return &applyconfigurationscorev1.NodeSpecApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NodeStatus"): - return &applyconfigurationscorev1.NodeStatusApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("NodeSystemInfo"): - return &applyconfigurationscorev1.NodeSystemInfoApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ObjectFieldSelector"): - return &applyconfigurationscorev1.ObjectFieldSelectorApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ObjectReference"): - return &applyconfigurationscorev1.ObjectReferenceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PersistentVolume"): - return &applyconfigurationscorev1.PersistentVolumeApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PersistentVolumeClaim"): - return &applyconfigurationscorev1.PersistentVolumeClaimApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PersistentVolumeClaimCondition"): - return &applyconfigurationscorev1.PersistentVolumeClaimConditionApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PersistentVolumeClaimSpec"): - return &applyconfigurationscorev1.PersistentVolumeClaimSpecApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PersistentVolumeClaimStatus"): - return &applyconfigurationscorev1.PersistentVolumeClaimStatusApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PersistentVolumeClaimTemplate"): - return &applyconfigurationscorev1.PersistentVolumeClaimTemplateApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PersistentVolumeClaimVolumeSource"): - return &applyconfigurationscorev1.PersistentVolumeClaimVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PersistentVolumeSource"): - return &applyconfigurationscorev1.PersistentVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PersistentVolumeSpec"): - return &applyconfigurationscorev1.PersistentVolumeSpecApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PersistentVolumeStatus"): - return &applyconfigurationscorev1.PersistentVolumeStatusApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PhotonPersistentDiskVolumeSource"): - return &applyconfigurationscorev1.PhotonPersistentDiskVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("Pod"): - return &applyconfigurationscorev1.PodApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PodAffinity"): - return &applyconfigurationscorev1.PodAffinityApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PodAffinityTerm"): - return &applyconfigurationscorev1.PodAffinityTermApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PodAntiAffinity"): - return &applyconfigurationscorev1.PodAntiAffinityApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PodCondition"): - return &applyconfigurationscorev1.PodConditionApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PodDNSConfig"): - return &applyconfigurationscorev1.PodDNSConfigApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PodDNSConfigOption"): - return &applyconfigurationscorev1.PodDNSConfigOptionApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PodIP"): - return &applyconfigurationscorev1.PodIPApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PodOS"): - return &applyconfigurationscorev1.PodOSApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PodReadinessGate"): - return &applyconfigurationscorev1.PodReadinessGateApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PodResourceClaim"): - return &applyconfigurationscorev1.PodResourceClaimApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PodResourceClaimStatus"): - return &applyconfigurationscorev1.PodResourceClaimStatusApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PodSchedulingGate"): - return &applyconfigurationscorev1.PodSchedulingGateApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PodSecurityContext"): - return &applyconfigurationscorev1.PodSecurityContextApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PodSpec"): - return &applyconfigurationscorev1.PodSpecApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PodStatus"): - return &applyconfigurationscorev1.PodStatusApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PodTemplate"): - return &applyconfigurationscorev1.PodTemplateApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PodTemplateSpec"): - return &applyconfigurationscorev1.PodTemplateSpecApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PortStatus"): - return &applyconfigurationscorev1.PortStatusApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PortworxVolumeSource"): - return &applyconfigurationscorev1.PortworxVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("PreferredSchedulingTerm"): - return &applyconfigurationscorev1.PreferredSchedulingTermApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("Probe"): - return &applyconfigurationscorev1.ProbeApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ProbeHandler"): - return &applyconfigurationscorev1.ProbeHandlerApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ProjectedVolumeSource"): - return &applyconfigurationscorev1.ProjectedVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("QuobyteVolumeSource"): - return &applyconfigurationscorev1.QuobyteVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("RBDPersistentVolumeSource"): - return &applyconfigurationscorev1.RBDPersistentVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("RBDVolumeSource"): - return &applyconfigurationscorev1.RBDVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ReplicationController"): - return &applyconfigurationscorev1.ReplicationControllerApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ReplicationControllerCondition"): - return &applyconfigurationscorev1.ReplicationControllerConditionApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ReplicationControllerSpec"): - return &applyconfigurationscorev1.ReplicationControllerSpecApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ReplicationControllerStatus"): - return &applyconfigurationscorev1.ReplicationControllerStatusApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ResourceClaim"): - return &applyconfigurationscorev1.ResourceClaimApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ResourceFieldSelector"): - return &applyconfigurationscorev1.ResourceFieldSelectorApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ResourceHealth"): - return &applyconfigurationscorev1.ResourceHealthApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ResourceQuota"): - return &applyconfigurationscorev1.ResourceQuotaApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ResourceQuotaSpec"): - return &applyconfigurationscorev1.ResourceQuotaSpecApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ResourceQuotaStatus"): - return &applyconfigurationscorev1.ResourceQuotaStatusApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ResourceRequirements"): - return &applyconfigurationscorev1.ResourceRequirementsApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ResourceStatus"): - return &applyconfigurationscorev1.ResourceStatusApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ScaleIOPersistentVolumeSource"): - return &applyconfigurationscorev1.ScaleIOPersistentVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ScaleIOVolumeSource"): - return &applyconfigurationscorev1.ScaleIOVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ScopedResourceSelectorRequirement"): - return &applyconfigurationscorev1.ScopedResourceSelectorRequirementApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ScopeSelector"): - return &applyconfigurationscorev1.ScopeSelectorApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("SeccompProfile"): - return &applyconfigurationscorev1.SeccompProfileApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("Secret"): - return &applyconfigurationscorev1.SecretApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("SecretEnvSource"): - return &applyconfigurationscorev1.SecretEnvSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("SecretKeySelector"): - return &applyconfigurationscorev1.SecretKeySelectorApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("SecretProjection"): - return &applyconfigurationscorev1.SecretProjectionApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("SecretReference"): - return &applyconfigurationscorev1.SecretReferenceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("SecretVolumeSource"): - return &applyconfigurationscorev1.SecretVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("SecurityContext"): - return &applyconfigurationscorev1.SecurityContextApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("SELinuxOptions"): - return &applyconfigurationscorev1.SELinuxOptionsApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("Service"): - return &applyconfigurationscorev1.ServiceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ServiceAccount"): - return &applyconfigurationscorev1.ServiceAccountApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ServiceAccountTokenProjection"): - return &applyconfigurationscorev1.ServiceAccountTokenProjectionApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ServicePort"): - return &applyconfigurationscorev1.ServicePortApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ServiceSpec"): - return &applyconfigurationscorev1.ServiceSpecApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ServiceStatus"): - return &applyconfigurationscorev1.ServiceStatusApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("SessionAffinityConfig"): - return &applyconfigurationscorev1.SessionAffinityConfigApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("SleepAction"): - return &applyconfigurationscorev1.SleepActionApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("StorageOSPersistentVolumeSource"): - return &applyconfigurationscorev1.StorageOSPersistentVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("StorageOSVolumeSource"): - return &applyconfigurationscorev1.StorageOSVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("Sysctl"): - return &applyconfigurationscorev1.SysctlApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("Taint"): - return &applyconfigurationscorev1.TaintApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("TCPSocketAction"): - return &applyconfigurationscorev1.TCPSocketActionApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("Toleration"): - return &applyconfigurationscorev1.TolerationApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("TopologySelectorLabelRequirement"): - return &applyconfigurationscorev1.TopologySelectorLabelRequirementApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("TopologySelectorTerm"): - return &applyconfigurationscorev1.TopologySelectorTermApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("TopologySpreadConstraint"): - return &applyconfigurationscorev1.TopologySpreadConstraintApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("TypedLocalObjectReference"): - return &applyconfigurationscorev1.TypedLocalObjectReferenceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("TypedObjectReference"): - return &applyconfigurationscorev1.TypedObjectReferenceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("Volume"): - return &applyconfigurationscorev1.VolumeApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("VolumeDevice"): - return &applyconfigurationscorev1.VolumeDeviceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("VolumeMount"): - return &applyconfigurationscorev1.VolumeMountApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("VolumeMountStatus"): - return &applyconfigurationscorev1.VolumeMountStatusApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("VolumeNodeAffinity"): - return &applyconfigurationscorev1.VolumeNodeAffinityApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("VolumeProjection"): - return &applyconfigurationscorev1.VolumeProjectionApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("VolumeResourceRequirements"): - return &applyconfigurationscorev1.VolumeResourceRequirementsApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("VolumeSource"): - return &applyconfigurationscorev1.VolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("VsphereVirtualDiskVolumeSource"): - return &applyconfigurationscorev1.VsphereVirtualDiskVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("WeightedPodAffinityTerm"): - return &applyconfigurationscorev1.WeightedPodAffinityTermApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("WindowsSecurityContextOptions"): - return &applyconfigurationscorev1.WindowsSecurityContextOptionsApplyConfiguration{} - - // Group=discovery.k8s.io, Version=v1 - case discoveryv1.SchemeGroupVersion.WithKind("Endpoint"): - return &applyconfigurationsdiscoveryv1.EndpointApplyConfiguration{} - case discoveryv1.SchemeGroupVersion.WithKind("EndpointConditions"): - return &applyconfigurationsdiscoveryv1.EndpointConditionsApplyConfiguration{} - case discoveryv1.SchemeGroupVersion.WithKind("EndpointHints"): - return &applyconfigurationsdiscoveryv1.EndpointHintsApplyConfiguration{} - case discoveryv1.SchemeGroupVersion.WithKind("EndpointPort"): - return &applyconfigurationsdiscoveryv1.EndpointPortApplyConfiguration{} - case discoveryv1.SchemeGroupVersion.WithKind("EndpointSlice"): - return &applyconfigurationsdiscoveryv1.EndpointSliceApplyConfiguration{} - case discoveryv1.SchemeGroupVersion.WithKind("ForZone"): - return &applyconfigurationsdiscoveryv1.ForZoneApplyConfiguration{} - - // Group=discovery.k8s.io, Version=v1beta1 - case discoveryv1beta1.SchemeGroupVersion.WithKind("Endpoint"): - return &applyconfigurationsdiscoveryv1beta1.EndpointApplyConfiguration{} - case discoveryv1beta1.SchemeGroupVersion.WithKind("EndpointConditions"): - return &applyconfigurationsdiscoveryv1beta1.EndpointConditionsApplyConfiguration{} - case discoveryv1beta1.SchemeGroupVersion.WithKind("EndpointHints"): - return &applyconfigurationsdiscoveryv1beta1.EndpointHintsApplyConfiguration{} - case discoveryv1beta1.SchemeGroupVersion.WithKind("EndpointPort"): - return &applyconfigurationsdiscoveryv1beta1.EndpointPortApplyConfiguration{} - case discoveryv1beta1.SchemeGroupVersion.WithKind("EndpointSlice"): - return &applyconfigurationsdiscoveryv1beta1.EndpointSliceApplyConfiguration{} - case discoveryv1beta1.SchemeGroupVersion.WithKind("ForZone"): - return &applyconfigurationsdiscoveryv1beta1.ForZoneApplyConfiguration{} - - // Group=events.k8s.io, Version=v1 - case eventsv1.SchemeGroupVersion.WithKind("Event"): - return &applyconfigurationseventsv1.EventApplyConfiguration{} - case eventsv1.SchemeGroupVersion.WithKind("EventSeries"): - return &applyconfigurationseventsv1.EventSeriesApplyConfiguration{} - - // Group=events.k8s.io, Version=v1beta1 - case eventsv1beta1.SchemeGroupVersion.WithKind("Event"): - return &applyconfigurationseventsv1beta1.EventApplyConfiguration{} - case eventsv1beta1.SchemeGroupVersion.WithKind("EventSeries"): - return &applyconfigurationseventsv1beta1.EventSeriesApplyConfiguration{} - - // Group=extensions, Version=v1beta1 - case extensionsv1beta1.SchemeGroupVersion.WithKind("DaemonSet"): - return &applyconfigurationsextensionsv1beta1.DaemonSetApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("DaemonSetCondition"): - return &applyconfigurationsextensionsv1beta1.DaemonSetConditionApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("DaemonSetSpec"): - return &applyconfigurationsextensionsv1beta1.DaemonSetSpecApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("DaemonSetStatus"): - return &applyconfigurationsextensionsv1beta1.DaemonSetStatusApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("DaemonSetUpdateStrategy"): - return &applyconfigurationsextensionsv1beta1.DaemonSetUpdateStrategyApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("Deployment"): - return &applyconfigurationsextensionsv1beta1.DeploymentApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("DeploymentCondition"): - return &applyconfigurationsextensionsv1beta1.DeploymentConditionApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("DeploymentSpec"): - return &applyconfigurationsextensionsv1beta1.DeploymentSpecApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("DeploymentStatus"): - return &applyconfigurationsextensionsv1beta1.DeploymentStatusApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("DeploymentStrategy"): - return &applyconfigurationsextensionsv1beta1.DeploymentStrategyApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("HTTPIngressPath"): - return &applyconfigurationsextensionsv1beta1.HTTPIngressPathApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("HTTPIngressRuleValue"): - return &applyconfigurationsextensionsv1beta1.HTTPIngressRuleValueApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("Ingress"): - return &applyconfigurationsextensionsv1beta1.IngressApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("IngressBackend"): - return &applyconfigurationsextensionsv1beta1.IngressBackendApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("IngressLoadBalancerIngress"): - return &applyconfigurationsextensionsv1beta1.IngressLoadBalancerIngressApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("IngressLoadBalancerStatus"): - return &applyconfigurationsextensionsv1beta1.IngressLoadBalancerStatusApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("IngressPortStatus"): - return &applyconfigurationsextensionsv1beta1.IngressPortStatusApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("IngressRule"): - return &applyconfigurationsextensionsv1beta1.IngressRuleApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("IngressRuleValue"): - return &applyconfigurationsextensionsv1beta1.IngressRuleValueApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("IngressSpec"): - return &applyconfigurationsextensionsv1beta1.IngressSpecApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("IngressStatus"): - return &applyconfigurationsextensionsv1beta1.IngressStatusApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("IngressTLS"): - return &applyconfigurationsextensionsv1beta1.IngressTLSApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("IPBlock"): - return &applyconfigurationsextensionsv1beta1.IPBlockApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("NetworkPolicy"): - return &applyconfigurationsextensionsv1beta1.NetworkPolicyApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("NetworkPolicyEgressRule"): - return &applyconfigurationsextensionsv1beta1.NetworkPolicyEgressRuleApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("NetworkPolicyIngressRule"): - return &applyconfigurationsextensionsv1beta1.NetworkPolicyIngressRuleApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("NetworkPolicyPeer"): - return &applyconfigurationsextensionsv1beta1.NetworkPolicyPeerApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("NetworkPolicyPort"): - return &applyconfigurationsextensionsv1beta1.NetworkPolicyPortApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("NetworkPolicySpec"): - return &applyconfigurationsextensionsv1beta1.NetworkPolicySpecApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("ReplicaSet"): - return &applyconfigurationsextensionsv1beta1.ReplicaSetApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("ReplicaSetCondition"): - return &applyconfigurationsextensionsv1beta1.ReplicaSetConditionApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("ReplicaSetSpec"): - return &applyconfigurationsextensionsv1beta1.ReplicaSetSpecApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("ReplicaSetStatus"): - return &applyconfigurationsextensionsv1beta1.ReplicaSetStatusApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("RollbackConfig"): - return &applyconfigurationsextensionsv1beta1.RollbackConfigApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("RollingUpdateDaemonSet"): - return &applyconfigurationsextensionsv1beta1.RollingUpdateDaemonSetApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("RollingUpdateDeployment"): - return &applyconfigurationsextensionsv1beta1.RollingUpdateDeploymentApplyConfiguration{} - case extensionsv1beta1.SchemeGroupVersion.WithKind("Scale"): - return &applyconfigurationsextensionsv1beta1.ScaleApplyConfiguration{} - - // Group=flowcontrol.apiserver.k8s.io, Version=v1 - case flowcontrolv1.SchemeGroupVersion.WithKind("ExemptPriorityLevelConfiguration"): - return &applyconfigurationsflowcontrolv1.ExemptPriorityLevelConfigurationApplyConfiguration{} - case flowcontrolv1.SchemeGroupVersion.WithKind("FlowDistinguisherMethod"): - return &applyconfigurationsflowcontrolv1.FlowDistinguisherMethodApplyConfiguration{} - case flowcontrolv1.SchemeGroupVersion.WithKind("FlowSchema"): - return &applyconfigurationsflowcontrolv1.FlowSchemaApplyConfiguration{} - case flowcontrolv1.SchemeGroupVersion.WithKind("FlowSchemaCondition"): - return &applyconfigurationsflowcontrolv1.FlowSchemaConditionApplyConfiguration{} - case flowcontrolv1.SchemeGroupVersion.WithKind("FlowSchemaSpec"): - return &applyconfigurationsflowcontrolv1.FlowSchemaSpecApplyConfiguration{} - case flowcontrolv1.SchemeGroupVersion.WithKind("FlowSchemaStatus"): - return &applyconfigurationsflowcontrolv1.FlowSchemaStatusApplyConfiguration{} - case flowcontrolv1.SchemeGroupVersion.WithKind("GroupSubject"): - return &applyconfigurationsflowcontrolv1.GroupSubjectApplyConfiguration{} - case flowcontrolv1.SchemeGroupVersion.WithKind("LimitedPriorityLevelConfiguration"): - return &applyconfigurationsflowcontrolv1.LimitedPriorityLevelConfigurationApplyConfiguration{} - case flowcontrolv1.SchemeGroupVersion.WithKind("LimitResponse"): - return &applyconfigurationsflowcontrolv1.LimitResponseApplyConfiguration{} - case flowcontrolv1.SchemeGroupVersion.WithKind("NonResourcePolicyRule"): - return &applyconfigurationsflowcontrolv1.NonResourcePolicyRuleApplyConfiguration{} - case flowcontrolv1.SchemeGroupVersion.WithKind("PolicyRulesWithSubjects"): - return &applyconfigurationsflowcontrolv1.PolicyRulesWithSubjectsApplyConfiguration{} - case flowcontrolv1.SchemeGroupVersion.WithKind("PriorityLevelConfiguration"): - return &applyconfigurationsflowcontrolv1.PriorityLevelConfigurationApplyConfiguration{} - case flowcontrolv1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationCondition"): - return &applyconfigurationsflowcontrolv1.PriorityLevelConfigurationConditionApplyConfiguration{} - case flowcontrolv1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationReference"): - return &applyconfigurationsflowcontrolv1.PriorityLevelConfigurationReferenceApplyConfiguration{} - case flowcontrolv1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationSpec"): - return &applyconfigurationsflowcontrolv1.PriorityLevelConfigurationSpecApplyConfiguration{} - case flowcontrolv1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationStatus"): - return &applyconfigurationsflowcontrolv1.PriorityLevelConfigurationStatusApplyConfiguration{} - case flowcontrolv1.SchemeGroupVersion.WithKind("QueuingConfiguration"): - return &applyconfigurationsflowcontrolv1.QueuingConfigurationApplyConfiguration{} - case flowcontrolv1.SchemeGroupVersion.WithKind("ResourcePolicyRule"): - return &applyconfigurationsflowcontrolv1.ResourcePolicyRuleApplyConfiguration{} - case flowcontrolv1.SchemeGroupVersion.WithKind("ServiceAccountSubject"): - return &applyconfigurationsflowcontrolv1.ServiceAccountSubjectApplyConfiguration{} - case flowcontrolv1.SchemeGroupVersion.WithKind("Subject"): - return &applyconfigurationsflowcontrolv1.SubjectApplyConfiguration{} - case flowcontrolv1.SchemeGroupVersion.WithKind("UserSubject"): - return &applyconfigurationsflowcontrolv1.UserSubjectApplyConfiguration{} - - // Group=flowcontrol.apiserver.k8s.io, Version=v1beta1 - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("ExemptPriorityLevelConfiguration"): - return &applyconfigurationsflowcontrolv1beta1.ExemptPriorityLevelConfigurationApplyConfiguration{} - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("FlowDistinguisherMethod"): - return &applyconfigurationsflowcontrolv1beta1.FlowDistinguisherMethodApplyConfiguration{} - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("FlowSchema"): - return &applyconfigurationsflowcontrolv1beta1.FlowSchemaApplyConfiguration{} - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("FlowSchemaCondition"): - return &applyconfigurationsflowcontrolv1beta1.FlowSchemaConditionApplyConfiguration{} - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("FlowSchemaSpec"): - return &applyconfigurationsflowcontrolv1beta1.FlowSchemaSpecApplyConfiguration{} - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("FlowSchemaStatus"): - return &applyconfigurationsflowcontrolv1beta1.FlowSchemaStatusApplyConfiguration{} - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("GroupSubject"): - return &applyconfigurationsflowcontrolv1beta1.GroupSubjectApplyConfiguration{} - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("LimitedPriorityLevelConfiguration"): - return &applyconfigurationsflowcontrolv1beta1.LimitedPriorityLevelConfigurationApplyConfiguration{} - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("LimitResponse"): - return &applyconfigurationsflowcontrolv1beta1.LimitResponseApplyConfiguration{} - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("NonResourcePolicyRule"): - return &applyconfigurationsflowcontrolv1beta1.NonResourcePolicyRuleApplyConfiguration{} - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("PolicyRulesWithSubjects"): - return &applyconfigurationsflowcontrolv1beta1.PolicyRulesWithSubjectsApplyConfiguration{} - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("PriorityLevelConfiguration"): - return &applyconfigurationsflowcontrolv1beta1.PriorityLevelConfigurationApplyConfiguration{} - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationCondition"): - return &applyconfigurationsflowcontrolv1beta1.PriorityLevelConfigurationConditionApplyConfiguration{} - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationReference"): - return &applyconfigurationsflowcontrolv1beta1.PriorityLevelConfigurationReferenceApplyConfiguration{} - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationSpec"): - return &applyconfigurationsflowcontrolv1beta1.PriorityLevelConfigurationSpecApplyConfiguration{} - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationStatus"): - return &applyconfigurationsflowcontrolv1beta1.PriorityLevelConfigurationStatusApplyConfiguration{} - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("QueuingConfiguration"): - return &applyconfigurationsflowcontrolv1beta1.QueuingConfigurationApplyConfiguration{} - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("ResourcePolicyRule"): - return &applyconfigurationsflowcontrolv1beta1.ResourcePolicyRuleApplyConfiguration{} - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("ServiceAccountSubject"): - return &applyconfigurationsflowcontrolv1beta1.ServiceAccountSubjectApplyConfiguration{} - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("Subject"): - return &applyconfigurationsflowcontrolv1beta1.SubjectApplyConfiguration{} - case flowcontrolv1beta1.SchemeGroupVersion.WithKind("UserSubject"): - return &applyconfigurationsflowcontrolv1beta1.UserSubjectApplyConfiguration{} - - // Group=flowcontrol.apiserver.k8s.io, Version=v1beta2 - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("ExemptPriorityLevelConfiguration"): - return &applyconfigurationsflowcontrolv1beta2.ExemptPriorityLevelConfigurationApplyConfiguration{} - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("FlowDistinguisherMethod"): - return &applyconfigurationsflowcontrolv1beta2.FlowDistinguisherMethodApplyConfiguration{} - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("FlowSchema"): - return &applyconfigurationsflowcontrolv1beta2.FlowSchemaApplyConfiguration{} - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("FlowSchemaCondition"): - return &applyconfigurationsflowcontrolv1beta2.FlowSchemaConditionApplyConfiguration{} - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("FlowSchemaSpec"): - return &applyconfigurationsflowcontrolv1beta2.FlowSchemaSpecApplyConfiguration{} - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("FlowSchemaStatus"): - return &applyconfigurationsflowcontrolv1beta2.FlowSchemaStatusApplyConfiguration{} - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("GroupSubject"): - return &applyconfigurationsflowcontrolv1beta2.GroupSubjectApplyConfiguration{} - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("LimitedPriorityLevelConfiguration"): - return &applyconfigurationsflowcontrolv1beta2.LimitedPriorityLevelConfigurationApplyConfiguration{} - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("LimitResponse"): - return &applyconfigurationsflowcontrolv1beta2.LimitResponseApplyConfiguration{} - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("NonResourcePolicyRule"): - return &applyconfigurationsflowcontrolv1beta2.NonResourcePolicyRuleApplyConfiguration{} - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("PolicyRulesWithSubjects"): - return &applyconfigurationsflowcontrolv1beta2.PolicyRulesWithSubjectsApplyConfiguration{} - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("PriorityLevelConfiguration"): - return &applyconfigurationsflowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration{} - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("PriorityLevelConfigurationCondition"): - return &applyconfigurationsflowcontrolv1beta2.PriorityLevelConfigurationConditionApplyConfiguration{} - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("PriorityLevelConfigurationReference"): - return &applyconfigurationsflowcontrolv1beta2.PriorityLevelConfigurationReferenceApplyConfiguration{} - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("PriorityLevelConfigurationSpec"): - return &applyconfigurationsflowcontrolv1beta2.PriorityLevelConfigurationSpecApplyConfiguration{} - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("PriorityLevelConfigurationStatus"): - return &applyconfigurationsflowcontrolv1beta2.PriorityLevelConfigurationStatusApplyConfiguration{} - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("QueuingConfiguration"): - return &applyconfigurationsflowcontrolv1beta2.QueuingConfigurationApplyConfiguration{} - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("ResourcePolicyRule"): - return &applyconfigurationsflowcontrolv1beta2.ResourcePolicyRuleApplyConfiguration{} - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("ServiceAccountSubject"): - return &applyconfigurationsflowcontrolv1beta2.ServiceAccountSubjectApplyConfiguration{} - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("Subject"): - return &applyconfigurationsflowcontrolv1beta2.SubjectApplyConfiguration{} - case flowcontrolv1beta2.SchemeGroupVersion.WithKind("UserSubject"): - return &applyconfigurationsflowcontrolv1beta2.UserSubjectApplyConfiguration{} - - // Group=flowcontrol.apiserver.k8s.io, Version=v1beta3 - case v1beta3.SchemeGroupVersion.WithKind("ExemptPriorityLevelConfiguration"): - return &flowcontrolv1beta3.ExemptPriorityLevelConfigurationApplyConfiguration{} - case v1beta3.SchemeGroupVersion.WithKind("FlowDistinguisherMethod"): - return &flowcontrolv1beta3.FlowDistinguisherMethodApplyConfiguration{} - case v1beta3.SchemeGroupVersion.WithKind("FlowSchema"): - return &flowcontrolv1beta3.FlowSchemaApplyConfiguration{} - case v1beta3.SchemeGroupVersion.WithKind("FlowSchemaCondition"): - return &flowcontrolv1beta3.FlowSchemaConditionApplyConfiguration{} - case v1beta3.SchemeGroupVersion.WithKind("FlowSchemaSpec"): - return &flowcontrolv1beta3.FlowSchemaSpecApplyConfiguration{} - case v1beta3.SchemeGroupVersion.WithKind("FlowSchemaStatus"): - return &flowcontrolv1beta3.FlowSchemaStatusApplyConfiguration{} - case v1beta3.SchemeGroupVersion.WithKind("GroupSubject"): - return &flowcontrolv1beta3.GroupSubjectApplyConfiguration{} - case v1beta3.SchemeGroupVersion.WithKind("LimitedPriorityLevelConfiguration"): - return &flowcontrolv1beta3.LimitedPriorityLevelConfigurationApplyConfiguration{} - case v1beta3.SchemeGroupVersion.WithKind("LimitResponse"): - return &flowcontrolv1beta3.LimitResponseApplyConfiguration{} - case v1beta3.SchemeGroupVersion.WithKind("NonResourcePolicyRule"): - return &flowcontrolv1beta3.NonResourcePolicyRuleApplyConfiguration{} - case v1beta3.SchemeGroupVersion.WithKind("PolicyRulesWithSubjects"): - return &flowcontrolv1beta3.PolicyRulesWithSubjectsApplyConfiguration{} - case v1beta3.SchemeGroupVersion.WithKind("PriorityLevelConfiguration"): - return &flowcontrolv1beta3.PriorityLevelConfigurationApplyConfiguration{} - case v1beta3.SchemeGroupVersion.WithKind("PriorityLevelConfigurationCondition"): - return &flowcontrolv1beta3.PriorityLevelConfigurationConditionApplyConfiguration{} - case v1beta3.SchemeGroupVersion.WithKind("PriorityLevelConfigurationReference"): - return &flowcontrolv1beta3.PriorityLevelConfigurationReferenceApplyConfiguration{} - case v1beta3.SchemeGroupVersion.WithKind("PriorityLevelConfigurationSpec"): - return &flowcontrolv1beta3.PriorityLevelConfigurationSpecApplyConfiguration{} - case v1beta3.SchemeGroupVersion.WithKind("PriorityLevelConfigurationStatus"): - return &flowcontrolv1beta3.PriorityLevelConfigurationStatusApplyConfiguration{} - case v1beta3.SchemeGroupVersion.WithKind("QueuingConfiguration"): - return &flowcontrolv1beta3.QueuingConfigurationApplyConfiguration{} - case v1beta3.SchemeGroupVersion.WithKind("ResourcePolicyRule"): - return &flowcontrolv1beta3.ResourcePolicyRuleApplyConfiguration{} - case v1beta3.SchemeGroupVersion.WithKind("ServiceAccountSubject"): - return &flowcontrolv1beta3.ServiceAccountSubjectApplyConfiguration{} - case v1beta3.SchemeGroupVersion.WithKind("Subject"): - return &flowcontrolv1beta3.SubjectApplyConfiguration{} - case v1beta3.SchemeGroupVersion.WithKind("UserSubject"): - return &flowcontrolv1beta3.UserSubjectApplyConfiguration{} - - // Group=imagepolicy.k8s.io, Version=v1alpha1 - case imagepolicyv1alpha1.SchemeGroupVersion.WithKind("ImageReview"): - return &applyconfigurationsimagepolicyv1alpha1.ImageReviewApplyConfiguration{} - case imagepolicyv1alpha1.SchemeGroupVersion.WithKind("ImageReviewContainerSpec"): - return &applyconfigurationsimagepolicyv1alpha1.ImageReviewContainerSpecApplyConfiguration{} - case imagepolicyv1alpha1.SchemeGroupVersion.WithKind("ImageReviewSpec"): - return &applyconfigurationsimagepolicyv1alpha1.ImageReviewSpecApplyConfiguration{} - case imagepolicyv1alpha1.SchemeGroupVersion.WithKind("ImageReviewStatus"): - return &applyconfigurationsimagepolicyv1alpha1.ImageReviewStatusApplyConfiguration{} - - // Group=internal.apiserver.k8s.io, Version=v1alpha1 - case apiserverinternalv1alpha1.SchemeGroupVersion.WithKind("ServerStorageVersion"): - return &applyconfigurationsapiserverinternalv1alpha1.ServerStorageVersionApplyConfiguration{} - case apiserverinternalv1alpha1.SchemeGroupVersion.WithKind("StorageVersion"): - return &applyconfigurationsapiserverinternalv1alpha1.StorageVersionApplyConfiguration{} - case apiserverinternalv1alpha1.SchemeGroupVersion.WithKind("StorageVersionCondition"): - return &applyconfigurationsapiserverinternalv1alpha1.StorageVersionConditionApplyConfiguration{} - case apiserverinternalv1alpha1.SchemeGroupVersion.WithKind("StorageVersionStatus"): - return &applyconfigurationsapiserverinternalv1alpha1.StorageVersionStatusApplyConfiguration{} - - // Group=meta.k8s.io, Version=v1 - case metav1.SchemeGroupVersion.WithKind("Condition"): - return &applyconfigurationsmetav1.ConditionApplyConfiguration{} - case metav1.SchemeGroupVersion.WithKind("DeleteOptions"): - return &applyconfigurationsmetav1.DeleteOptionsApplyConfiguration{} - case metav1.SchemeGroupVersion.WithKind("LabelSelector"): - return &applyconfigurationsmetav1.LabelSelectorApplyConfiguration{} - case metav1.SchemeGroupVersion.WithKind("LabelSelectorRequirement"): - return &applyconfigurationsmetav1.LabelSelectorRequirementApplyConfiguration{} - case metav1.SchemeGroupVersion.WithKind("ManagedFieldsEntry"): - return &applyconfigurationsmetav1.ManagedFieldsEntryApplyConfiguration{} - case metav1.SchemeGroupVersion.WithKind("ObjectMeta"): - return &applyconfigurationsmetav1.ObjectMetaApplyConfiguration{} - case metav1.SchemeGroupVersion.WithKind("OwnerReference"): - return &applyconfigurationsmetav1.OwnerReferenceApplyConfiguration{} - case metav1.SchemeGroupVersion.WithKind("Preconditions"): - return &applyconfigurationsmetav1.PreconditionsApplyConfiguration{} - case metav1.SchemeGroupVersion.WithKind("TypeMeta"): - return &applyconfigurationsmetav1.TypeMetaApplyConfiguration{} - - // Group=networking.k8s.io, Version=v1 - case networkingv1.SchemeGroupVersion.WithKind("HTTPIngressPath"): - return &applyconfigurationsnetworkingv1.HTTPIngressPathApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("HTTPIngressRuleValue"): - return &applyconfigurationsnetworkingv1.HTTPIngressRuleValueApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("Ingress"): - return &applyconfigurationsnetworkingv1.IngressApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("IngressBackend"): - return &applyconfigurationsnetworkingv1.IngressBackendApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("IngressClass"): - return &applyconfigurationsnetworkingv1.IngressClassApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("IngressClassParametersReference"): - return &applyconfigurationsnetworkingv1.IngressClassParametersReferenceApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("IngressClassSpec"): - return &applyconfigurationsnetworkingv1.IngressClassSpecApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("IngressLoadBalancerIngress"): - return &applyconfigurationsnetworkingv1.IngressLoadBalancerIngressApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("IngressLoadBalancerStatus"): - return &applyconfigurationsnetworkingv1.IngressLoadBalancerStatusApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("IngressPortStatus"): - return &applyconfigurationsnetworkingv1.IngressPortStatusApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("IngressRule"): - return &applyconfigurationsnetworkingv1.IngressRuleApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("IngressRuleValue"): - return &applyconfigurationsnetworkingv1.IngressRuleValueApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("IngressServiceBackend"): - return &applyconfigurationsnetworkingv1.IngressServiceBackendApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("IngressSpec"): - return &applyconfigurationsnetworkingv1.IngressSpecApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("IngressStatus"): - return &applyconfigurationsnetworkingv1.IngressStatusApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("IngressTLS"): - return &applyconfigurationsnetworkingv1.IngressTLSApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("IPBlock"): - return &applyconfigurationsnetworkingv1.IPBlockApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("NetworkPolicy"): - return &applyconfigurationsnetworkingv1.NetworkPolicyApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("NetworkPolicyEgressRule"): - return &applyconfigurationsnetworkingv1.NetworkPolicyEgressRuleApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("NetworkPolicyIngressRule"): - return &applyconfigurationsnetworkingv1.NetworkPolicyIngressRuleApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("NetworkPolicyPeer"): - return &applyconfigurationsnetworkingv1.NetworkPolicyPeerApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("NetworkPolicyPort"): - return &applyconfigurationsnetworkingv1.NetworkPolicyPortApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("NetworkPolicySpec"): - return &applyconfigurationsnetworkingv1.NetworkPolicySpecApplyConfiguration{} - case networkingv1.SchemeGroupVersion.WithKind("ServiceBackendPort"): - return &applyconfigurationsnetworkingv1.ServiceBackendPortApplyConfiguration{} - - // Group=networking.k8s.io, Version=v1alpha1 - case networkingv1alpha1.SchemeGroupVersion.WithKind("IPAddress"): - return &applyconfigurationsnetworkingv1alpha1.IPAddressApplyConfiguration{} - case networkingv1alpha1.SchemeGroupVersion.WithKind("IPAddressSpec"): - return &applyconfigurationsnetworkingv1alpha1.IPAddressSpecApplyConfiguration{} - case networkingv1alpha1.SchemeGroupVersion.WithKind("ParentReference"): - return &applyconfigurationsnetworkingv1alpha1.ParentReferenceApplyConfiguration{} - case networkingv1alpha1.SchemeGroupVersion.WithKind("ServiceCIDR"): - return &applyconfigurationsnetworkingv1alpha1.ServiceCIDRApplyConfiguration{} - case networkingv1alpha1.SchemeGroupVersion.WithKind("ServiceCIDRSpec"): - return &applyconfigurationsnetworkingv1alpha1.ServiceCIDRSpecApplyConfiguration{} - case networkingv1alpha1.SchemeGroupVersion.WithKind("ServiceCIDRStatus"): - return &applyconfigurationsnetworkingv1alpha1.ServiceCIDRStatusApplyConfiguration{} - - // Group=networking.k8s.io, Version=v1beta1 - case networkingv1beta1.SchemeGroupVersion.WithKind("HTTPIngressPath"): - return &applyconfigurationsnetworkingv1beta1.HTTPIngressPathApplyConfiguration{} - case networkingv1beta1.SchemeGroupVersion.WithKind("HTTPIngressRuleValue"): - return &applyconfigurationsnetworkingv1beta1.HTTPIngressRuleValueApplyConfiguration{} - case networkingv1beta1.SchemeGroupVersion.WithKind("Ingress"): - return &applyconfigurationsnetworkingv1beta1.IngressApplyConfiguration{} - case networkingv1beta1.SchemeGroupVersion.WithKind("IngressBackend"): - return &applyconfigurationsnetworkingv1beta1.IngressBackendApplyConfiguration{} - case networkingv1beta1.SchemeGroupVersion.WithKind("IngressClass"): - return &applyconfigurationsnetworkingv1beta1.IngressClassApplyConfiguration{} - case networkingv1beta1.SchemeGroupVersion.WithKind("IngressClassParametersReference"): - return &applyconfigurationsnetworkingv1beta1.IngressClassParametersReferenceApplyConfiguration{} - case networkingv1beta1.SchemeGroupVersion.WithKind("IngressClassSpec"): - return &applyconfigurationsnetworkingv1beta1.IngressClassSpecApplyConfiguration{} - case networkingv1beta1.SchemeGroupVersion.WithKind("IngressLoadBalancerIngress"): - return &applyconfigurationsnetworkingv1beta1.IngressLoadBalancerIngressApplyConfiguration{} - case networkingv1beta1.SchemeGroupVersion.WithKind("IngressLoadBalancerStatus"): - return &applyconfigurationsnetworkingv1beta1.IngressLoadBalancerStatusApplyConfiguration{} - case networkingv1beta1.SchemeGroupVersion.WithKind("IngressPortStatus"): - return &applyconfigurationsnetworkingv1beta1.IngressPortStatusApplyConfiguration{} - case networkingv1beta1.SchemeGroupVersion.WithKind("IngressRule"): - return &applyconfigurationsnetworkingv1beta1.IngressRuleApplyConfiguration{} - case networkingv1beta1.SchemeGroupVersion.WithKind("IngressRuleValue"): - return &applyconfigurationsnetworkingv1beta1.IngressRuleValueApplyConfiguration{} - case networkingv1beta1.SchemeGroupVersion.WithKind("IngressSpec"): - return &applyconfigurationsnetworkingv1beta1.IngressSpecApplyConfiguration{} - case networkingv1beta1.SchemeGroupVersion.WithKind("IngressStatus"): - return &applyconfigurationsnetworkingv1beta1.IngressStatusApplyConfiguration{} - case networkingv1beta1.SchemeGroupVersion.WithKind("IngressTLS"): - return &applyconfigurationsnetworkingv1beta1.IngressTLSApplyConfiguration{} - case networkingv1beta1.SchemeGroupVersion.WithKind("IPAddress"): - return &applyconfigurationsnetworkingv1beta1.IPAddressApplyConfiguration{} - case networkingv1beta1.SchemeGroupVersion.WithKind("IPAddressSpec"): - return &applyconfigurationsnetworkingv1beta1.IPAddressSpecApplyConfiguration{} - case networkingv1beta1.SchemeGroupVersion.WithKind("ParentReference"): - return &applyconfigurationsnetworkingv1beta1.ParentReferenceApplyConfiguration{} - case networkingv1beta1.SchemeGroupVersion.WithKind("ServiceCIDR"): - return &applyconfigurationsnetworkingv1beta1.ServiceCIDRApplyConfiguration{} - case networkingv1beta1.SchemeGroupVersion.WithKind("ServiceCIDRSpec"): - return &applyconfigurationsnetworkingv1beta1.ServiceCIDRSpecApplyConfiguration{} - case networkingv1beta1.SchemeGroupVersion.WithKind("ServiceCIDRStatus"): - return &applyconfigurationsnetworkingv1beta1.ServiceCIDRStatusApplyConfiguration{} - - // Group=node.k8s.io, Version=v1 - case nodev1.SchemeGroupVersion.WithKind("Overhead"): - return &applyconfigurationsnodev1.OverheadApplyConfiguration{} - case nodev1.SchemeGroupVersion.WithKind("RuntimeClass"): - return &applyconfigurationsnodev1.RuntimeClassApplyConfiguration{} - case nodev1.SchemeGroupVersion.WithKind("Scheduling"): - return &applyconfigurationsnodev1.SchedulingApplyConfiguration{} - - // Group=node.k8s.io, Version=v1alpha1 - case nodev1alpha1.SchemeGroupVersion.WithKind("Overhead"): - return &applyconfigurationsnodev1alpha1.OverheadApplyConfiguration{} - case nodev1alpha1.SchemeGroupVersion.WithKind("RuntimeClass"): - return &applyconfigurationsnodev1alpha1.RuntimeClassApplyConfiguration{} - case nodev1alpha1.SchemeGroupVersion.WithKind("RuntimeClassSpec"): - return &applyconfigurationsnodev1alpha1.RuntimeClassSpecApplyConfiguration{} - case nodev1alpha1.SchemeGroupVersion.WithKind("Scheduling"): - return &applyconfigurationsnodev1alpha1.SchedulingApplyConfiguration{} - - // Group=node.k8s.io, Version=v1beta1 - case nodev1beta1.SchemeGroupVersion.WithKind("Overhead"): - return &applyconfigurationsnodev1beta1.OverheadApplyConfiguration{} - case nodev1beta1.SchemeGroupVersion.WithKind("RuntimeClass"): - return &applyconfigurationsnodev1beta1.RuntimeClassApplyConfiguration{} - case nodev1beta1.SchemeGroupVersion.WithKind("Scheduling"): - return &applyconfigurationsnodev1beta1.SchedulingApplyConfiguration{} - - // Group=policy, Version=v1 - case policyv1.SchemeGroupVersion.WithKind("Eviction"): - return &applyconfigurationspolicyv1.EvictionApplyConfiguration{} - case policyv1.SchemeGroupVersion.WithKind("PodDisruptionBudget"): - return &applyconfigurationspolicyv1.PodDisruptionBudgetApplyConfiguration{} - case policyv1.SchemeGroupVersion.WithKind("PodDisruptionBudgetSpec"): - return &applyconfigurationspolicyv1.PodDisruptionBudgetSpecApplyConfiguration{} - case policyv1.SchemeGroupVersion.WithKind("PodDisruptionBudgetStatus"): - return &applyconfigurationspolicyv1.PodDisruptionBudgetStatusApplyConfiguration{} - - // Group=policy, Version=v1beta1 - case policyv1beta1.SchemeGroupVersion.WithKind("Eviction"): - return &applyconfigurationspolicyv1beta1.EvictionApplyConfiguration{} - case policyv1beta1.SchemeGroupVersion.WithKind("PodDisruptionBudget"): - return &applyconfigurationspolicyv1beta1.PodDisruptionBudgetApplyConfiguration{} - case policyv1beta1.SchemeGroupVersion.WithKind("PodDisruptionBudgetSpec"): - return &applyconfigurationspolicyv1beta1.PodDisruptionBudgetSpecApplyConfiguration{} - case policyv1beta1.SchemeGroupVersion.WithKind("PodDisruptionBudgetStatus"): - return &applyconfigurationspolicyv1beta1.PodDisruptionBudgetStatusApplyConfiguration{} - - // Group=rbac.authorization.k8s.io, Version=v1 - case rbacv1.SchemeGroupVersion.WithKind("AggregationRule"): - return &applyconfigurationsrbacv1.AggregationRuleApplyConfiguration{} - case rbacv1.SchemeGroupVersion.WithKind("ClusterRole"): - return &applyconfigurationsrbacv1.ClusterRoleApplyConfiguration{} - case rbacv1.SchemeGroupVersion.WithKind("ClusterRoleBinding"): - return &applyconfigurationsrbacv1.ClusterRoleBindingApplyConfiguration{} - case rbacv1.SchemeGroupVersion.WithKind("PolicyRule"): - return &applyconfigurationsrbacv1.PolicyRuleApplyConfiguration{} - case rbacv1.SchemeGroupVersion.WithKind("Role"): - return &applyconfigurationsrbacv1.RoleApplyConfiguration{} - case rbacv1.SchemeGroupVersion.WithKind("RoleBinding"): - return &applyconfigurationsrbacv1.RoleBindingApplyConfiguration{} - case rbacv1.SchemeGroupVersion.WithKind("RoleRef"): - return &applyconfigurationsrbacv1.RoleRefApplyConfiguration{} - case rbacv1.SchemeGroupVersion.WithKind("Subject"): - return &applyconfigurationsrbacv1.SubjectApplyConfiguration{} - - // Group=rbac.authorization.k8s.io, Version=v1alpha1 - case rbacv1alpha1.SchemeGroupVersion.WithKind("AggregationRule"): - return &applyconfigurationsrbacv1alpha1.AggregationRuleApplyConfiguration{} - case rbacv1alpha1.SchemeGroupVersion.WithKind("ClusterRole"): - return &applyconfigurationsrbacv1alpha1.ClusterRoleApplyConfiguration{} - case rbacv1alpha1.SchemeGroupVersion.WithKind("ClusterRoleBinding"): - return &applyconfigurationsrbacv1alpha1.ClusterRoleBindingApplyConfiguration{} - case rbacv1alpha1.SchemeGroupVersion.WithKind("PolicyRule"): - return &applyconfigurationsrbacv1alpha1.PolicyRuleApplyConfiguration{} - case rbacv1alpha1.SchemeGroupVersion.WithKind("Role"): - return &applyconfigurationsrbacv1alpha1.RoleApplyConfiguration{} - case rbacv1alpha1.SchemeGroupVersion.WithKind("RoleBinding"): - return &applyconfigurationsrbacv1alpha1.RoleBindingApplyConfiguration{} - case rbacv1alpha1.SchemeGroupVersion.WithKind("RoleRef"): - return &applyconfigurationsrbacv1alpha1.RoleRefApplyConfiguration{} - case rbacv1alpha1.SchemeGroupVersion.WithKind("Subject"): - return &applyconfigurationsrbacv1alpha1.SubjectApplyConfiguration{} - - // Group=rbac.authorization.k8s.io, Version=v1beta1 - case rbacv1beta1.SchemeGroupVersion.WithKind("AggregationRule"): - return &applyconfigurationsrbacv1beta1.AggregationRuleApplyConfiguration{} - case rbacv1beta1.SchemeGroupVersion.WithKind("ClusterRole"): - return &applyconfigurationsrbacv1beta1.ClusterRoleApplyConfiguration{} - case rbacv1beta1.SchemeGroupVersion.WithKind("ClusterRoleBinding"): - return &applyconfigurationsrbacv1beta1.ClusterRoleBindingApplyConfiguration{} - case rbacv1beta1.SchemeGroupVersion.WithKind("PolicyRule"): - return &applyconfigurationsrbacv1beta1.PolicyRuleApplyConfiguration{} - case rbacv1beta1.SchemeGroupVersion.WithKind("Role"): - return &applyconfigurationsrbacv1beta1.RoleApplyConfiguration{} - case rbacv1beta1.SchemeGroupVersion.WithKind("RoleBinding"): - return &applyconfigurationsrbacv1beta1.RoleBindingApplyConfiguration{} - case rbacv1beta1.SchemeGroupVersion.WithKind("RoleRef"): - return &applyconfigurationsrbacv1beta1.RoleRefApplyConfiguration{} - case rbacv1beta1.SchemeGroupVersion.WithKind("Subject"): - return &applyconfigurationsrbacv1beta1.SubjectApplyConfiguration{} - - // Group=resource.k8s.io, Version=v1alpha3 - case v1alpha3.SchemeGroupVersion.WithKind("AllocationResult"): - return &resourcev1alpha3.AllocationResultApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("BasicDevice"): - return &resourcev1alpha3.BasicDeviceApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("CELDeviceSelector"): - return &resourcev1alpha3.CELDeviceSelectorApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("Device"): - return &resourcev1alpha3.DeviceApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("DeviceAllocationConfiguration"): - return &resourcev1alpha3.DeviceAllocationConfigurationApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("DeviceAllocationResult"): - return &resourcev1alpha3.DeviceAllocationResultApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("DeviceAttribute"): - return &resourcev1alpha3.DeviceAttributeApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("DeviceClaim"): - return &resourcev1alpha3.DeviceClaimApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("DeviceClaimConfiguration"): - return &resourcev1alpha3.DeviceClaimConfigurationApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("DeviceClass"): - return &resourcev1alpha3.DeviceClassApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("DeviceClassConfiguration"): - return &resourcev1alpha3.DeviceClassConfigurationApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("DeviceClassSpec"): - return &resourcev1alpha3.DeviceClassSpecApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("DeviceConfiguration"): - return &resourcev1alpha3.DeviceConfigurationApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("DeviceConstraint"): - return &resourcev1alpha3.DeviceConstraintApplyConfiguration{} - 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("OpaqueDeviceConfiguration"): - return &resourcev1alpha3.OpaqueDeviceConfigurationApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContext"): - return &resourcev1alpha3.PodSchedulingContextApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContextSpec"): - return &resourcev1alpha3.PodSchedulingContextSpecApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContextStatus"): - return &resourcev1alpha3.PodSchedulingContextStatusApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaim"): - return &resourcev1alpha3.ResourceClaimApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimConsumerReference"): - return &resourcev1alpha3.ResourceClaimConsumerReferenceApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimSchedulingStatus"): - return &resourcev1alpha3.ResourceClaimSchedulingStatusApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimSpec"): - return &resourcev1alpha3.ResourceClaimSpecApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimStatus"): - return &resourcev1alpha3.ResourceClaimStatusApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimTemplate"): - return &resourcev1alpha3.ResourceClaimTemplateApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimTemplateSpec"): - return &resourcev1alpha3.ResourceClaimTemplateSpecApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourcePool"): - return &resourcev1alpha3.ResourcePoolApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourceSlice"): - return &resourcev1alpha3.ResourceSliceApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourceSliceSpec"): - return &resourcev1alpha3.ResourceSliceSpecApplyConfiguration{} - - // Group=scheduling.k8s.io, Version=v1 - case schedulingv1.SchemeGroupVersion.WithKind("PriorityClass"): - return &applyconfigurationsschedulingv1.PriorityClassApplyConfiguration{} - - // Group=scheduling.k8s.io, Version=v1alpha1 - case schedulingv1alpha1.SchemeGroupVersion.WithKind("PriorityClass"): - return &applyconfigurationsschedulingv1alpha1.PriorityClassApplyConfiguration{} - - // Group=scheduling.k8s.io, Version=v1beta1 - case schedulingv1beta1.SchemeGroupVersion.WithKind("PriorityClass"): - return &applyconfigurationsschedulingv1beta1.PriorityClassApplyConfiguration{} - - // Group=storage.k8s.io, Version=v1 - case storagev1.SchemeGroupVersion.WithKind("CSIDriver"): - return &applyconfigurationsstoragev1.CSIDriverApplyConfiguration{} - case storagev1.SchemeGroupVersion.WithKind("CSIDriverSpec"): - return &applyconfigurationsstoragev1.CSIDriverSpecApplyConfiguration{} - case storagev1.SchemeGroupVersion.WithKind("CSINode"): - return &applyconfigurationsstoragev1.CSINodeApplyConfiguration{} - case storagev1.SchemeGroupVersion.WithKind("CSINodeDriver"): - return &applyconfigurationsstoragev1.CSINodeDriverApplyConfiguration{} - case storagev1.SchemeGroupVersion.WithKind("CSINodeSpec"): - return &applyconfigurationsstoragev1.CSINodeSpecApplyConfiguration{} - case storagev1.SchemeGroupVersion.WithKind("CSIStorageCapacity"): - return &applyconfigurationsstoragev1.CSIStorageCapacityApplyConfiguration{} - case storagev1.SchemeGroupVersion.WithKind("StorageClass"): - return &applyconfigurationsstoragev1.StorageClassApplyConfiguration{} - case storagev1.SchemeGroupVersion.WithKind("TokenRequest"): - return &applyconfigurationsstoragev1.TokenRequestApplyConfiguration{} - case storagev1.SchemeGroupVersion.WithKind("VolumeAttachment"): - return &applyconfigurationsstoragev1.VolumeAttachmentApplyConfiguration{} - case storagev1.SchemeGroupVersion.WithKind("VolumeAttachmentSource"): - return &applyconfigurationsstoragev1.VolumeAttachmentSourceApplyConfiguration{} - case storagev1.SchemeGroupVersion.WithKind("VolumeAttachmentSpec"): - return &applyconfigurationsstoragev1.VolumeAttachmentSpecApplyConfiguration{} - case storagev1.SchemeGroupVersion.WithKind("VolumeAttachmentStatus"): - return &applyconfigurationsstoragev1.VolumeAttachmentStatusApplyConfiguration{} - case storagev1.SchemeGroupVersion.WithKind("VolumeError"): - return &applyconfigurationsstoragev1.VolumeErrorApplyConfiguration{} - case storagev1.SchemeGroupVersion.WithKind("VolumeNodeResources"): - return &applyconfigurationsstoragev1.VolumeNodeResourcesApplyConfiguration{} - - // Group=storage.k8s.io, Version=v1alpha1 - case storagev1alpha1.SchemeGroupVersion.WithKind("CSIStorageCapacity"): - return &applyconfigurationsstoragev1alpha1.CSIStorageCapacityApplyConfiguration{} - case storagev1alpha1.SchemeGroupVersion.WithKind("VolumeAttachment"): - return &applyconfigurationsstoragev1alpha1.VolumeAttachmentApplyConfiguration{} - case storagev1alpha1.SchemeGroupVersion.WithKind("VolumeAttachmentSource"): - return &applyconfigurationsstoragev1alpha1.VolumeAttachmentSourceApplyConfiguration{} - case storagev1alpha1.SchemeGroupVersion.WithKind("VolumeAttachmentSpec"): - return &applyconfigurationsstoragev1alpha1.VolumeAttachmentSpecApplyConfiguration{} - case storagev1alpha1.SchemeGroupVersion.WithKind("VolumeAttachmentStatus"): - return &applyconfigurationsstoragev1alpha1.VolumeAttachmentStatusApplyConfiguration{} - case storagev1alpha1.SchemeGroupVersion.WithKind("VolumeAttributesClass"): - return &applyconfigurationsstoragev1alpha1.VolumeAttributesClassApplyConfiguration{} - case storagev1alpha1.SchemeGroupVersion.WithKind("VolumeError"): - return &applyconfigurationsstoragev1alpha1.VolumeErrorApplyConfiguration{} - - // Group=storage.k8s.io, Version=v1beta1 - case storagev1beta1.SchemeGroupVersion.WithKind("CSIDriver"): - return &applyconfigurationsstoragev1beta1.CSIDriverApplyConfiguration{} - case storagev1beta1.SchemeGroupVersion.WithKind("CSIDriverSpec"): - return &applyconfigurationsstoragev1beta1.CSIDriverSpecApplyConfiguration{} - case storagev1beta1.SchemeGroupVersion.WithKind("CSINode"): - return &applyconfigurationsstoragev1beta1.CSINodeApplyConfiguration{} - case storagev1beta1.SchemeGroupVersion.WithKind("CSINodeDriver"): - return &applyconfigurationsstoragev1beta1.CSINodeDriverApplyConfiguration{} - case storagev1beta1.SchemeGroupVersion.WithKind("CSINodeSpec"): - return &applyconfigurationsstoragev1beta1.CSINodeSpecApplyConfiguration{} - case storagev1beta1.SchemeGroupVersion.WithKind("CSIStorageCapacity"): - return &applyconfigurationsstoragev1beta1.CSIStorageCapacityApplyConfiguration{} - case storagev1beta1.SchemeGroupVersion.WithKind("StorageClass"): - return &applyconfigurationsstoragev1beta1.StorageClassApplyConfiguration{} - case storagev1beta1.SchemeGroupVersion.WithKind("TokenRequest"): - return &applyconfigurationsstoragev1beta1.TokenRequestApplyConfiguration{} - case storagev1beta1.SchemeGroupVersion.WithKind("VolumeAttachment"): - return &applyconfigurationsstoragev1beta1.VolumeAttachmentApplyConfiguration{} - case storagev1beta1.SchemeGroupVersion.WithKind("VolumeAttachmentSource"): - return &applyconfigurationsstoragev1beta1.VolumeAttachmentSourceApplyConfiguration{} - case storagev1beta1.SchemeGroupVersion.WithKind("VolumeAttachmentSpec"): - return &applyconfigurationsstoragev1beta1.VolumeAttachmentSpecApplyConfiguration{} - case storagev1beta1.SchemeGroupVersion.WithKind("VolumeAttachmentStatus"): - return &applyconfigurationsstoragev1beta1.VolumeAttachmentStatusApplyConfiguration{} - case storagev1beta1.SchemeGroupVersion.WithKind("VolumeAttributesClass"): - return &applyconfigurationsstoragev1beta1.VolumeAttributesClassApplyConfiguration{} - case storagev1beta1.SchemeGroupVersion.WithKind("VolumeError"): - return &applyconfigurationsstoragev1beta1.VolumeErrorApplyConfiguration{} - case storagev1beta1.SchemeGroupVersion.WithKind("VolumeNodeResources"): - return &applyconfigurationsstoragev1beta1.VolumeNodeResourcesApplyConfiguration{} - - // Group=storagemigration.k8s.io, Version=v1alpha1 - case storagemigrationv1alpha1.SchemeGroupVersion.WithKind("GroupVersionResource"): - return &applyconfigurationsstoragemigrationv1alpha1.GroupVersionResourceApplyConfiguration{} - case storagemigrationv1alpha1.SchemeGroupVersion.WithKind("MigrationCondition"): - return &applyconfigurationsstoragemigrationv1alpha1.MigrationConditionApplyConfiguration{} - case storagemigrationv1alpha1.SchemeGroupVersion.WithKind("StorageVersionMigration"): - return &applyconfigurationsstoragemigrationv1alpha1.StorageVersionMigrationApplyConfiguration{} - case storagemigrationv1alpha1.SchemeGroupVersion.WithKind("StorageVersionMigrationSpec"): - return &applyconfigurationsstoragemigrationv1alpha1.StorageVersionMigrationSpecApplyConfiguration{} - case storagemigrationv1alpha1.SchemeGroupVersion.WithKind("StorageVersionMigrationStatus"): - return &applyconfigurationsstoragemigrationv1alpha1.StorageVersionMigrationStatusApplyConfiguration{} - - } - return nil -} - -func NewTypeConverter(scheme *runtime.Scheme) *testing.TypeConverter { - return &testing.TypeConverter{Scheme: scheme, TypeResolver: internal.Parser()} -} diff --git a/vendor/k8s.io/client-go/discovery/fake/discovery.go b/vendor/k8s.io/client-go/discovery/fake/discovery.go deleted file mode 100644 index e5d9e7f80..000000000 --- a/vendor/k8s.io/client-go/discovery/fake/discovery.go +++ /dev/null @@ -1,180 +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 fake - -import ( - "fmt" - "net/http" - - openapi_v2 "github.com/google/gnostic-models/openapiv2" - - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/version" - "k8s.io/client-go/discovery" - "k8s.io/client-go/openapi" - kubeversion "k8s.io/client-go/pkg/version" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/testing" -) - -// FakeDiscovery implements discovery.DiscoveryInterface and sometimes calls testing.Fake.Invoke with an action, -// but doesn't respect the return value if any. There is a way to fake static values like ServerVersion by using the Faked... fields on the struct. -type FakeDiscovery struct { - *testing.Fake - FakedServerVersion *version.Info -} - -// ServerResourcesForGroupVersion returns the supported resources for a group -// and version. -func (c *FakeDiscovery) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) { - action := testing.ActionImpl{ - Verb: "get", - Resource: schema.GroupVersionResource{Resource: "resource"}, - } - if _, err := c.Invokes(action, nil); err != nil { - return nil, err - } - for _, resourceList := range c.Resources { - if resourceList.GroupVersion == groupVersion { - return resourceList, nil - } - } - return nil, &errors.StatusError{ - ErrStatus: metav1.Status{ - Status: metav1.StatusFailure, - Code: http.StatusNotFound, - Reason: metav1.StatusReasonNotFound, - Message: fmt.Sprintf("the server could not find the requested resource, GroupVersion %q not found", groupVersion), - }} -} - -// ServerGroupsAndResources returns the supported groups and resources for all groups and versions. -func (c *FakeDiscovery) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { - sgs, err := c.ServerGroups() - if err != nil { - return nil, nil, err - } - resultGroups := []*metav1.APIGroup{} - for i := range sgs.Groups { - resultGroups = append(resultGroups, &sgs.Groups[i]) - } - - action := testing.ActionImpl{ - Verb: "get", - Resource: schema.GroupVersionResource{Resource: "resource"}, - } - if _, err = c.Invokes(action, nil); err != nil { - return resultGroups, c.Resources, err - } - return resultGroups, c.Resources, nil -} - -// ServerPreferredResources returns the supported resources with the version -// preferred by the server. -func (c *FakeDiscovery) ServerPreferredResources() ([]*metav1.APIResourceList, error) { - return nil, nil -} - -// ServerPreferredNamespacedResources returns the supported namespaced resources -// with the version preferred by the server. -func (c *FakeDiscovery) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) { - return nil, nil -} - -// ServerGroups returns the supported groups, with information like supported -// versions and the preferred version. -func (c *FakeDiscovery) ServerGroups() (*metav1.APIGroupList, error) { - action := testing.ActionImpl{ - Verb: "get", - Resource: schema.GroupVersionResource{Resource: "group"}, - } - if _, err := c.Invokes(action, nil); err != nil { - return nil, err - } - - groups := map[string]*metav1.APIGroup{} - - for _, res := range c.Resources { - gv, err := schema.ParseGroupVersion(res.GroupVersion) - if err != nil { - return nil, err - } - group := groups[gv.Group] - if group == nil { - group = &metav1.APIGroup{ - Name: gv.Group, - PreferredVersion: metav1.GroupVersionForDiscovery{ - GroupVersion: res.GroupVersion, - Version: gv.Version, - }, - } - groups[gv.Group] = group - } - - group.Versions = append(group.Versions, metav1.GroupVersionForDiscovery{ - GroupVersion: res.GroupVersion, - Version: gv.Version, - }) - } - - list := &metav1.APIGroupList{} - for _, apiGroup := range groups { - list.Groups = append(list.Groups, *apiGroup) - } - - return list, nil - -} - -// ServerVersion retrieves and parses the server's version. -func (c *FakeDiscovery) ServerVersion() (*version.Info, error) { - action := testing.ActionImpl{} - action.Verb = "get" - action.Resource = schema.GroupVersionResource{Resource: "version"} - _, err := c.Invokes(action, nil) - if err != nil { - return nil, err - } - - if c.FakedServerVersion != nil { - return c.FakedServerVersion, nil - } - - versionInfo := kubeversion.Get() - return &versionInfo, nil -} - -// OpenAPISchema retrieves and parses the swagger API schema the server supports. -func (c *FakeDiscovery) OpenAPISchema() (*openapi_v2.Document, error) { - return &openapi_v2.Document{}, nil -} - -func (c *FakeDiscovery) OpenAPIV3() openapi.Client { - panic("unimplemented") -} - -// RESTClient returns a RESTClient that is used to communicate with API server -// by this client implementation. -func (c *FakeDiscovery) RESTClient() restclient.Interface { - return nil -} - -func (c *FakeDiscovery) WithLegacy() discovery.DiscoveryInterface { - panic("unimplemented") -} diff --git a/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go b/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go deleted file mode 100644 index 132f917ab..000000000 --- a/vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go +++ /dev/null @@ -1,486 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - applyconfigurations "k8s.io/client-go/applyconfigurations" - "k8s.io/client-go/discovery" - fakediscovery "k8s.io/client-go/discovery/fake" - clientset "k8s.io/client-go/kubernetes" - admissionregistrationv1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1" - fakeadmissionregistrationv1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake" - admissionregistrationv1alpha1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1" - fakeadmissionregistrationv1alpha1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake" - admissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1" - fakeadmissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake" - internalv1alpha1 "k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1" - fakeinternalv1alpha1 "k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/fake" - appsv1 "k8s.io/client-go/kubernetes/typed/apps/v1" - fakeappsv1 "k8s.io/client-go/kubernetes/typed/apps/v1/fake" - appsv1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1" - fakeappsv1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake" - appsv1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2" - fakeappsv1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake" - authenticationv1 "k8s.io/client-go/kubernetes/typed/authentication/v1" - fakeauthenticationv1 "k8s.io/client-go/kubernetes/typed/authentication/v1/fake" - authenticationv1alpha1 "k8s.io/client-go/kubernetes/typed/authentication/v1alpha1" - fakeauthenticationv1alpha1 "k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake" - authenticationv1beta1 "k8s.io/client-go/kubernetes/typed/authentication/v1beta1" - fakeauthenticationv1beta1 "k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake" - authorizationv1 "k8s.io/client-go/kubernetes/typed/authorization/v1" - fakeauthorizationv1 "k8s.io/client-go/kubernetes/typed/authorization/v1/fake" - authorizationv1beta1 "k8s.io/client-go/kubernetes/typed/authorization/v1beta1" - fakeauthorizationv1beta1 "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake" - autoscalingv1 "k8s.io/client-go/kubernetes/typed/autoscaling/v1" - fakeautoscalingv1 "k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake" - autoscalingv2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2" - fakeautoscalingv2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2/fake" - autoscalingv2beta1 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1" - fakeautoscalingv2beta1 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake" - autoscalingv2beta2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2" - fakeautoscalingv2beta2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake" - batchv1 "k8s.io/client-go/kubernetes/typed/batch/v1" - fakebatchv1 "k8s.io/client-go/kubernetes/typed/batch/v1/fake" - batchv1beta1 "k8s.io/client-go/kubernetes/typed/batch/v1beta1" - fakebatchv1beta1 "k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake" - certificatesv1 "k8s.io/client-go/kubernetes/typed/certificates/v1" - fakecertificatesv1 "k8s.io/client-go/kubernetes/typed/certificates/v1/fake" - certificatesv1alpha1 "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1" - fakecertificatesv1alpha1 "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake" - certificatesv1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1" - fakecertificatesv1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake" - coordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1" - fakecoordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1/fake" - coordinationv1alpha1 "k8s.io/client-go/kubernetes/typed/coordination/v1alpha1" - fakecoordinationv1alpha1 "k8s.io/client-go/kubernetes/typed/coordination/v1alpha1/fake" - coordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1" - fakecoordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake" - corev1 "k8s.io/client-go/kubernetes/typed/core/v1" - fakecorev1 "k8s.io/client-go/kubernetes/typed/core/v1/fake" - discoveryv1 "k8s.io/client-go/kubernetes/typed/discovery/v1" - fakediscoveryv1 "k8s.io/client-go/kubernetes/typed/discovery/v1/fake" - discoveryv1beta1 "k8s.io/client-go/kubernetes/typed/discovery/v1beta1" - fakediscoveryv1beta1 "k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake" - eventsv1 "k8s.io/client-go/kubernetes/typed/events/v1" - fakeeventsv1 "k8s.io/client-go/kubernetes/typed/events/v1/fake" - eventsv1beta1 "k8s.io/client-go/kubernetes/typed/events/v1beta1" - fakeeventsv1beta1 "k8s.io/client-go/kubernetes/typed/events/v1beta1/fake" - extensionsv1beta1 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1" - fakeextensionsv1beta1 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake" - flowcontrolv1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1" - fakeflowcontrolv1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake" - flowcontrolv1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1" - fakeflowcontrolv1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake" - flowcontrolv1beta2 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2" - fakeflowcontrolv1beta2 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake" - flowcontrolv1beta3 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3" - fakeflowcontrolv1beta3 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake" - networkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1" - fakenetworkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1/fake" - networkingv1alpha1 "k8s.io/client-go/kubernetes/typed/networking/v1alpha1" - fakenetworkingv1alpha1 "k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake" - networkingv1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1" - fakenetworkingv1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake" - nodev1 "k8s.io/client-go/kubernetes/typed/node/v1" - fakenodev1 "k8s.io/client-go/kubernetes/typed/node/v1/fake" - nodev1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1" - fakenodev1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake" - nodev1beta1 "k8s.io/client-go/kubernetes/typed/node/v1beta1" - fakenodev1beta1 "k8s.io/client-go/kubernetes/typed/node/v1beta1/fake" - policyv1 "k8s.io/client-go/kubernetes/typed/policy/v1" - fakepolicyv1 "k8s.io/client-go/kubernetes/typed/policy/v1/fake" - policyv1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1" - fakepolicyv1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake" - rbacv1 "k8s.io/client-go/kubernetes/typed/rbac/v1" - fakerbacv1 "k8s.io/client-go/kubernetes/typed/rbac/v1/fake" - rbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1" - fakerbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake" - rbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1" - fakerbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake" - resourcev1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3" - fakeresourcev1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3/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" - fakeschedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake" - schedulingv1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1" - fakeschedulingv1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake" - storagev1 "k8s.io/client-go/kubernetes/typed/storage/v1" - fakestoragev1 "k8s.io/client-go/kubernetes/typed/storage/v1/fake" - storagev1alpha1 "k8s.io/client-go/kubernetes/typed/storage/v1alpha1" - fakestoragev1alpha1 "k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake" - storagev1beta1 "k8s.io/client-go/kubernetes/typed/storage/v1beta1" - fakestoragev1beta1 "k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake" - storagemigrationv1alpha1 "k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1" - fakestoragemigrationv1alpha1 "k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/fake" - "k8s.io/client-go/testing" -) - -// NewSimpleClientset returns a clientset that will respond with the provided objects. -// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement -// for a real clientset and is mostly useful in simple unit tests. -// -// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves -// server side apply testing. NewClientset is only available when apply configurations are generated (e.g. -// via --with-applyconfig). -func NewSimpleClientset(objects ...runtime.Object) *Clientset { - o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - cs := &Clientset{tracker: o} - 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) { - 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 Clientset struct { - testing.Fake - discovery *fakediscovery.FakeDiscovery - tracker testing.ObjectTracker -} - -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - return c.discovery -} - -func (c *Clientset) Tracker() testing.ObjectTracker { - return c.tracker -} - -// NewClientset returns a clientset that will respond with the provided objects. -// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement -// for a real clientset and is mostly useful in simple unit tests. -func NewClientset(objects ...runtime.Object) *Clientset { - o := testing.NewFieldManagedObjectTracker( - scheme, - codecs.UniversalDecoder(), - applyconfigurations.NewTypeConverter(scheme), - ) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - cs := &Clientset{tracker: o} - 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) { - 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 -} - -var ( - _ clientset.Interface = &Clientset{} - _ testing.FakeClient = &Clientset{} -) - -// AdmissionregistrationV1 retrieves the AdmissionregistrationV1Client -func (c *Clientset) AdmissionregistrationV1() admissionregistrationv1.AdmissionregistrationV1Interface { - return &fakeadmissionregistrationv1.FakeAdmissionregistrationV1{Fake: &c.Fake} -} - -// AdmissionregistrationV1alpha1 retrieves the AdmissionregistrationV1alpha1Client -func (c *Clientset) AdmissionregistrationV1alpha1() admissionregistrationv1alpha1.AdmissionregistrationV1alpha1Interface { - return &fakeadmissionregistrationv1alpha1.FakeAdmissionregistrationV1alpha1{Fake: &c.Fake} -} - -// AdmissionregistrationV1beta1 retrieves the AdmissionregistrationV1beta1Client -func (c *Clientset) AdmissionregistrationV1beta1() admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface { - return &fakeadmissionregistrationv1beta1.FakeAdmissionregistrationV1beta1{Fake: &c.Fake} -} - -// InternalV1alpha1 retrieves the InternalV1alpha1Client -func (c *Clientset) InternalV1alpha1() internalv1alpha1.InternalV1alpha1Interface { - return &fakeinternalv1alpha1.FakeInternalV1alpha1{Fake: &c.Fake} -} - -// AppsV1 retrieves the AppsV1Client -func (c *Clientset) AppsV1() appsv1.AppsV1Interface { - return &fakeappsv1.FakeAppsV1{Fake: &c.Fake} -} - -// AppsV1beta1 retrieves the AppsV1beta1Client -func (c *Clientset) AppsV1beta1() appsv1beta1.AppsV1beta1Interface { - return &fakeappsv1beta1.FakeAppsV1beta1{Fake: &c.Fake} -} - -// AppsV1beta2 retrieves the AppsV1beta2Client -func (c *Clientset) AppsV1beta2() appsv1beta2.AppsV1beta2Interface { - return &fakeappsv1beta2.FakeAppsV1beta2{Fake: &c.Fake} -} - -// AuthenticationV1 retrieves the AuthenticationV1Client -func (c *Clientset) AuthenticationV1() authenticationv1.AuthenticationV1Interface { - return &fakeauthenticationv1.FakeAuthenticationV1{Fake: &c.Fake} -} - -// AuthenticationV1alpha1 retrieves the AuthenticationV1alpha1Client -func (c *Clientset) AuthenticationV1alpha1() authenticationv1alpha1.AuthenticationV1alpha1Interface { - return &fakeauthenticationv1alpha1.FakeAuthenticationV1alpha1{Fake: &c.Fake} -} - -// AuthenticationV1beta1 retrieves the AuthenticationV1beta1Client -func (c *Clientset) AuthenticationV1beta1() authenticationv1beta1.AuthenticationV1beta1Interface { - return &fakeauthenticationv1beta1.FakeAuthenticationV1beta1{Fake: &c.Fake} -} - -// AuthorizationV1 retrieves the AuthorizationV1Client -func (c *Clientset) AuthorizationV1() authorizationv1.AuthorizationV1Interface { - return &fakeauthorizationv1.FakeAuthorizationV1{Fake: &c.Fake} -} - -// AuthorizationV1beta1 retrieves the AuthorizationV1beta1Client -func (c *Clientset) AuthorizationV1beta1() authorizationv1beta1.AuthorizationV1beta1Interface { - return &fakeauthorizationv1beta1.FakeAuthorizationV1beta1{Fake: &c.Fake} -} - -// AutoscalingV1 retrieves the AutoscalingV1Client -func (c *Clientset) AutoscalingV1() autoscalingv1.AutoscalingV1Interface { - return &fakeautoscalingv1.FakeAutoscalingV1{Fake: &c.Fake} -} - -// AutoscalingV2 retrieves the AutoscalingV2Client -func (c *Clientset) AutoscalingV2() autoscalingv2.AutoscalingV2Interface { - return &fakeautoscalingv2.FakeAutoscalingV2{Fake: &c.Fake} -} - -// AutoscalingV2beta1 retrieves the AutoscalingV2beta1Client -func (c *Clientset) AutoscalingV2beta1() autoscalingv2beta1.AutoscalingV2beta1Interface { - return &fakeautoscalingv2beta1.FakeAutoscalingV2beta1{Fake: &c.Fake} -} - -// AutoscalingV2beta2 retrieves the AutoscalingV2beta2Client -func (c *Clientset) AutoscalingV2beta2() autoscalingv2beta2.AutoscalingV2beta2Interface { - return &fakeautoscalingv2beta2.FakeAutoscalingV2beta2{Fake: &c.Fake} -} - -// BatchV1 retrieves the BatchV1Client -func (c *Clientset) BatchV1() batchv1.BatchV1Interface { - return &fakebatchv1.FakeBatchV1{Fake: &c.Fake} -} - -// BatchV1beta1 retrieves the BatchV1beta1Client -func (c *Clientset) BatchV1beta1() batchv1beta1.BatchV1beta1Interface { - return &fakebatchv1beta1.FakeBatchV1beta1{Fake: &c.Fake} -} - -// CertificatesV1 retrieves the CertificatesV1Client -func (c *Clientset) CertificatesV1() certificatesv1.CertificatesV1Interface { - return &fakecertificatesv1.FakeCertificatesV1{Fake: &c.Fake} -} - -// CertificatesV1beta1 retrieves the CertificatesV1beta1Client -func (c *Clientset) CertificatesV1beta1() certificatesv1beta1.CertificatesV1beta1Interface { - return &fakecertificatesv1beta1.FakeCertificatesV1beta1{Fake: &c.Fake} -} - -// CertificatesV1alpha1 retrieves the CertificatesV1alpha1Client -func (c *Clientset) CertificatesV1alpha1() certificatesv1alpha1.CertificatesV1alpha1Interface { - return &fakecertificatesv1alpha1.FakeCertificatesV1alpha1{Fake: &c.Fake} -} - -// CoordinationV1alpha1 retrieves the CoordinationV1alpha1Client -func (c *Clientset) CoordinationV1alpha1() coordinationv1alpha1.CoordinationV1alpha1Interface { - return &fakecoordinationv1alpha1.FakeCoordinationV1alpha1{Fake: &c.Fake} -} - -// CoordinationV1beta1 retrieves the CoordinationV1beta1Client -func (c *Clientset) CoordinationV1beta1() coordinationv1beta1.CoordinationV1beta1Interface { - return &fakecoordinationv1beta1.FakeCoordinationV1beta1{Fake: &c.Fake} -} - -// CoordinationV1 retrieves the CoordinationV1Client -func (c *Clientset) CoordinationV1() coordinationv1.CoordinationV1Interface { - return &fakecoordinationv1.FakeCoordinationV1{Fake: &c.Fake} -} - -// CoreV1 retrieves the CoreV1Client -func (c *Clientset) CoreV1() corev1.CoreV1Interface { - return &fakecorev1.FakeCoreV1{Fake: &c.Fake} -} - -// DiscoveryV1 retrieves the DiscoveryV1Client -func (c *Clientset) DiscoveryV1() discoveryv1.DiscoveryV1Interface { - return &fakediscoveryv1.FakeDiscoveryV1{Fake: &c.Fake} -} - -// DiscoveryV1beta1 retrieves the DiscoveryV1beta1Client -func (c *Clientset) DiscoveryV1beta1() discoveryv1beta1.DiscoveryV1beta1Interface { - return &fakediscoveryv1beta1.FakeDiscoveryV1beta1{Fake: &c.Fake} -} - -// EventsV1 retrieves the EventsV1Client -func (c *Clientset) EventsV1() eventsv1.EventsV1Interface { - return &fakeeventsv1.FakeEventsV1{Fake: &c.Fake} -} - -// EventsV1beta1 retrieves the EventsV1beta1Client -func (c *Clientset) EventsV1beta1() eventsv1beta1.EventsV1beta1Interface { - return &fakeeventsv1beta1.FakeEventsV1beta1{Fake: &c.Fake} -} - -// ExtensionsV1beta1 retrieves the ExtensionsV1beta1Client -func (c *Clientset) ExtensionsV1beta1() extensionsv1beta1.ExtensionsV1beta1Interface { - return &fakeextensionsv1beta1.FakeExtensionsV1beta1{Fake: &c.Fake} -} - -// FlowcontrolV1 retrieves the FlowcontrolV1Client -func (c *Clientset) FlowcontrolV1() flowcontrolv1.FlowcontrolV1Interface { - return &fakeflowcontrolv1.FakeFlowcontrolV1{Fake: &c.Fake} -} - -// FlowcontrolV1beta1 retrieves the FlowcontrolV1beta1Client -func (c *Clientset) FlowcontrolV1beta1() flowcontrolv1beta1.FlowcontrolV1beta1Interface { - return &fakeflowcontrolv1beta1.FakeFlowcontrolV1beta1{Fake: &c.Fake} -} - -// FlowcontrolV1beta2 retrieves the FlowcontrolV1beta2Client -func (c *Clientset) FlowcontrolV1beta2() flowcontrolv1beta2.FlowcontrolV1beta2Interface { - return &fakeflowcontrolv1beta2.FakeFlowcontrolV1beta2{Fake: &c.Fake} -} - -// FlowcontrolV1beta3 retrieves the FlowcontrolV1beta3Client -func (c *Clientset) FlowcontrolV1beta3() flowcontrolv1beta3.FlowcontrolV1beta3Interface { - return &fakeflowcontrolv1beta3.FakeFlowcontrolV1beta3{Fake: &c.Fake} -} - -// NetworkingV1 retrieves the NetworkingV1Client -func (c *Clientset) NetworkingV1() networkingv1.NetworkingV1Interface { - return &fakenetworkingv1.FakeNetworkingV1{Fake: &c.Fake} -} - -// NetworkingV1alpha1 retrieves the NetworkingV1alpha1Client -func (c *Clientset) NetworkingV1alpha1() networkingv1alpha1.NetworkingV1alpha1Interface { - return &fakenetworkingv1alpha1.FakeNetworkingV1alpha1{Fake: &c.Fake} -} - -// NetworkingV1beta1 retrieves the NetworkingV1beta1Client -func (c *Clientset) NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Interface { - return &fakenetworkingv1beta1.FakeNetworkingV1beta1{Fake: &c.Fake} -} - -// NodeV1 retrieves the NodeV1Client -func (c *Clientset) NodeV1() nodev1.NodeV1Interface { - return &fakenodev1.FakeNodeV1{Fake: &c.Fake} -} - -// NodeV1alpha1 retrieves the NodeV1alpha1Client -func (c *Clientset) NodeV1alpha1() nodev1alpha1.NodeV1alpha1Interface { - return &fakenodev1alpha1.FakeNodeV1alpha1{Fake: &c.Fake} -} - -// NodeV1beta1 retrieves the NodeV1beta1Client -func (c *Clientset) NodeV1beta1() nodev1beta1.NodeV1beta1Interface { - return &fakenodev1beta1.FakeNodeV1beta1{Fake: &c.Fake} -} - -// PolicyV1 retrieves the PolicyV1Client -func (c *Clientset) PolicyV1() policyv1.PolicyV1Interface { - return &fakepolicyv1.FakePolicyV1{Fake: &c.Fake} -} - -// PolicyV1beta1 retrieves the PolicyV1beta1Client -func (c *Clientset) PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface { - return &fakepolicyv1beta1.FakePolicyV1beta1{Fake: &c.Fake} -} - -// RbacV1 retrieves the RbacV1Client -func (c *Clientset) RbacV1() rbacv1.RbacV1Interface { - return &fakerbacv1.FakeRbacV1{Fake: &c.Fake} -} - -// RbacV1beta1 retrieves the RbacV1beta1Client -func (c *Clientset) RbacV1beta1() rbacv1beta1.RbacV1beta1Interface { - return &fakerbacv1beta1.FakeRbacV1beta1{Fake: &c.Fake} -} - -// RbacV1alpha1 retrieves the RbacV1alpha1Client -func (c *Clientset) RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface { - return &fakerbacv1alpha1.FakeRbacV1alpha1{Fake: &c.Fake} -} - -// ResourceV1alpha3 retrieves the ResourceV1alpha3Client -func (c *Clientset) ResourceV1alpha3() resourcev1alpha3.ResourceV1alpha3Interface { - return &fakeresourcev1alpha3.FakeResourceV1alpha3{Fake: &c.Fake} -} - -// SchedulingV1alpha1 retrieves the SchedulingV1alpha1Client -func (c *Clientset) SchedulingV1alpha1() schedulingv1alpha1.SchedulingV1alpha1Interface { - return &fakeschedulingv1alpha1.FakeSchedulingV1alpha1{Fake: &c.Fake} -} - -// SchedulingV1beta1 retrieves the SchedulingV1beta1Client -func (c *Clientset) SchedulingV1beta1() schedulingv1beta1.SchedulingV1beta1Interface { - return &fakeschedulingv1beta1.FakeSchedulingV1beta1{Fake: &c.Fake} -} - -// SchedulingV1 retrieves the SchedulingV1Client -func (c *Clientset) SchedulingV1() schedulingv1.SchedulingV1Interface { - return &fakeschedulingv1.FakeSchedulingV1{Fake: &c.Fake} -} - -// StorageV1beta1 retrieves the StorageV1beta1Client -func (c *Clientset) StorageV1beta1() storagev1beta1.StorageV1beta1Interface { - return &fakestoragev1beta1.FakeStorageV1beta1{Fake: &c.Fake} -} - -// StorageV1 retrieves the StorageV1Client -func (c *Clientset) StorageV1() storagev1.StorageV1Interface { - return &fakestoragev1.FakeStorageV1{Fake: &c.Fake} -} - -// StorageV1alpha1 retrieves the StorageV1alpha1Client -func (c *Clientset) StorageV1alpha1() storagev1alpha1.StorageV1alpha1Interface { - return &fakestoragev1alpha1.FakeStorageV1alpha1{Fake: &c.Fake} -} - -// StoragemigrationV1alpha1 retrieves the StoragemigrationV1alpha1Client -func (c *Clientset) StoragemigrationV1alpha1() storagemigrationv1alpha1.StoragemigrationV1alpha1Interface { - return &fakestoragemigrationv1alpha1.FakeStoragemigrationV1alpha1{Fake: &c.Fake} -} diff --git a/vendor/k8s.io/client-go/kubernetes/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/fake/doc.go deleted file mode 100644 index 9b99e7167..000000000 --- a/vendor/k8s.io/client-go/kubernetes/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// This package has the automatically generated fake clientset. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/fake/register.go b/vendor/k8s.io/client-go/kubernetes/fake/register.go deleted file mode 100644 index 157abae5f..000000000 --- a/vendor/k8s.io/client-go/kubernetes/fake/register.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - admissionregistrationv1 "k8s.io/api/admissionregistration/v1" - admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1" - admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" - internalv1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" - appsv1 "k8s.io/api/apps/v1" - appsv1beta1 "k8s.io/api/apps/v1beta1" - appsv1beta2 "k8s.io/api/apps/v1beta2" - authenticationv1 "k8s.io/api/authentication/v1" - authenticationv1alpha1 "k8s.io/api/authentication/v1alpha1" - authenticationv1beta1 "k8s.io/api/authentication/v1beta1" - authorizationv1 "k8s.io/api/authorization/v1" - authorizationv1beta1 "k8s.io/api/authorization/v1beta1" - autoscalingv1 "k8s.io/api/autoscaling/v1" - autoscalingv2 "k8s.io/api/autoscaling/v2" - autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1" - autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2" - batchv1 "k8s.io/api/batch/v1" - batchv1beta1 "k8s.io/api/batch/v1beta1" - certificatesv1 "k8s.io/api/certificates/v1" - certificatesv1alpha1 "k8s.io/api/certificates/v1alpha1" - certificatesv1beta1 "k8s.io/api/certificates/v1beta1" - coordinationv1 "k8s.io/api/coordination/v1" - coordinationv1alpha1 "k8s.io/api/coordination/v1alpha1" - coordinationv1beta1 "k8s.io/api/coordination/v1beta1" - corev1 "k8s.io/api/core/v1" - discoveryv1 "k8s.io/api/discovery/v1" - discoveryv1beta1 "k8s.io/api/discovery/v1beta1" - eventsv1 "k8s.io/api/events/v1" - eventsv1beta1 "k8s.io/api/events/v1beta1" - extensionsv1beta1 "k8s.io/api/extensions/v1beta1" - flowcontrolv1 "k8s.io/api/flowcontrol/v1" - flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" - flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" - flowcontrolv1beta3 "k8s.io/api/flowcontrol/v1beta3" - networkingv1 "k8s.io/api/networking/v1" - networkingv1alpha1 "k8s.io/api/networking/v1alpha1" - networkingv1beta1 "k8s.io/api/networking/v1beta1" - nodev1 "k8s.io/api/node/v1" - nodev1alpha1 "k8s.io/api/node/v1alpha1" - nodev1beta1 "k8s.io/api/node/v1beta1" - policyv1 "k8s.io/api/policy/v1" - policyv1beta1 "k8s.io/api/policy/v1beta1" - rbacv1 "k8s.io/api/rbac/v1" - rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" - rbacv1beta1 "k8s.io/api/rbac/v1beta1" - resourcev1alpha3 "k8s.io/api/resource/v1alpha3" - schedulingv1 "k8s.io/api/scheduling/v1" - schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" - schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" - storagev1 "k8s.io/api/storage/v1" - storagev1alpha1 "k8s.io/api/storage/v1alpha1" - storagev1beta1 "k8s.io/api/storage/v1beta1" - storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" -) - -var scheme = runtime.NewScheme() -var codecs = serializer.NewCodecFactory(scheme) - -var localSchemeBuilder = runtime.SchemeBuilder{ - admissionregistrationv1.AddToScheme, - admissionregistrationv1alpha1.AddToScheme, - admissionregistrationv1beta1.AddToScheme, - internalv1alpha1.AddToScheme, - appsv1.AddToScheme, - appsv1beta1.AddToScheme, - appsv1beta2.AddToScheme, - authenticationv1.AddToScheme, - authenticationv1alpha1.AddToScheme, - authenticationv1beta1.AddToScheme, - authorizationv1.AddToScheme, - authorizationv1beta1.AddToScheme, - autoscalingv1.AddToScheme, - autoscalingv2.AddToScheme, - autoscalingv2beta1.AddToScheme, - autoscalingv2beta2.AddToScheme, - batchv1.AddToScheme, - batchv1beta1.AddToScheme, - certificatesv1.AddToScheme, - certificatesv1beta1.AddToScheme, - certificatesv1alpha1.AddToScheme, - coordinationv1alpha1.AddToScheme, - coordinationv1beta1.AddToScheme, - coordinationv1.AddToScheme, - corev1.AddToScheme, - discoveryv1.AddToScheme, - discoveryv1beta1.AddToScheme, - eventsv1.AddToScheme, - eventsv1beta1.AddToScheme, - extensionsv1beta1.AddToScheme, - flowcontrolv1.AddToScheme, - flowcontrolv1beta1.AddToScheme, - flowcontrolv1beta2.AddToScheme, - flowcontrolv1beta3.AddToScheme, - networkingv1.AddToScheme, - networkingv1alpha1.AddToScheme, - networkingv1beta1.AddToScheme, - nodev1.AddToScheme, - nodev1alpha1.AddToScheme, - nodev1beta1.AddToScheme, - policyv1.AddToScheme, - policyv1beta1.AddToScheme, - rbacv1.AddToScheme, - rbacv1beta1.AddToScheme, - rbacv1alpha1.AddToScheme, - resourcev1alpha3.AddToScheme, - schedulingv1alpha1.AddToScheme, - schedulingv1beta1.AddToScheme, - schedulingv1.AddToScheme, - storagev1beta1.AddToScheme, - storagev1.AddToScheme, - storagev1alpha1.AddToScheme, - storagemigrationv1alpha1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(scheme)) -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_admissionregistration_client.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_admissionregistration_client.go deleted file mode 100644 index b7487c2fb..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_admissionregistration_client.go +++ /dev/null @@ -1,52 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeAdmissionregistrationV1 struct { - *testing.Fake -} - -func (c *FakeAdmissionregistrationV1) MutatingWebhookConfigurations() v1.MutatingWebhookConfigurationInterface { - return &FakeMutatingWebhookConfigurations{c} -} - -func (c *FakeAdmissionregistrationV1) ValidatingAdmissionPolicies() v1.ValidatingAdmissionPolicyInterface { - return &FakeValidatingAdmissionPolicies{c} -} - -func (c *FakeAdmissionregistrationV1) ValidatingAdmissionPolicyBindings() v1.ValidatingAdmissionPolicyBindingInterface { - return &FakeValidatingAdmissionPolicyBindings{c} -} - -func (c *FakeAdmissionregistrationV1) ValidatingWebhookConfigurations() v1.ValidatingWebhookConfigurationInterface { - return &FakeValidatingWebhookConfigurations{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeAdmissionregistrationV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_mutatingwebhookconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_mutatingwebhookconfiguration.go deleted file mode 100644 index 2d371e6fc..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_mutatingwebhookconfiguration.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/admissionregistration/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" - testing "k8s.io/client-go/testing" -) - -// FakeMutatingWebhookConfigurations implements MutatingWebhookConfigurationInterface -type FakeMutatingWebhookConfigurations struct { - Fake *FakeAdmissionregistrationV1 -} - -var mutatingwebhookconfigurationsResource = v1.SchemeGroupVersion.WithResource("mutatingwebhookconfigurations") - -var mutatingwebhookconfigurationsKind = v1.SchemeGroupVersion.WithKind("MutatingWebhookConfiguration") - -// Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any. -func (c *FakeMutatingWebhookConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.MutatingWebhookConfiguration, err error) { - emptyResult := &v1.MutatingWebhookConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(mutatingwebhookconfigurationsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.MutatingWebhookConfiguration), err -} - -// List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. -func (c *FakeMutatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) { - emptyResult := &v1.MutatingWebhookConfigurationList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.MutatingWebhookConfigurationList{ListMeta: obj.(*v1.MutatingWebhookConfigurationList).ListMeta} - for _, item := range obj.(*v1.MutatingWebhookConfigurationList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations. -func (c *FakeMutatingWebhookConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(mutatingwebhookconfigurationsResource, opts)) -} - -// Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. -func (c *FakeMutatingWebhookConfigurations) Create(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.CreateOptions) (result *v1.MutatingWebhookConfiguration, err error) { - emptyResult := &v1.MutatingWebhookConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.MutatingWebhookConfiguration), err -} - -// Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. -func (c *FakeMutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.UpdateOptions) (result *v1.MutatingWebhookConfiguration, err error) { - emptyResult := &v1.MutatingWebhookConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.MutatingWebhookConfiguration), err -} - -// Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs. -func (c *FakeMutatingWebhookConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(mutatingwebhookconfigurationsResource, name, opts), &v1.MutatingWebhookConfiguration{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeMutatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(mutatingwebhookconfigurationsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.MutatingWebhookConfigurationList{}) - return err -} - -// Patch applies the patch and returns the patched mutatingWebhookConfiguration. -func (c *FakeMutatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MutatingWebhookConfiguration, err error) { - emptyResult := &v1.MutatingWebhookConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(mutatingwebhookconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.MutatingWebhookConfiguration), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied mutatingWebhookConfiguration. -func (c *FakeMutatingWebhookConfigurations) Apply(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1.MutatingWebhookConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.MutatingWebhookConfiguration, err error) { - if mutatingWebhookConfiguration == nil { - return nil, fmt.Errorf("mutatingWebhookConfiguration provided to Apply must not be nil") - } - data, err := json.Marshal(mutatingWebhookConfiguration) - if err != nil { - return nil, err - } - name := mutatingWebhookConfiguration.Name - if name == nil { - return nil, fmt.Errorf("mutatingWebhookConfiguration.Name must be provided to Apply") - } - emptyResult := &v1.MutatingWebhookConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.MutatingWebhookConfiguration), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicy.go deleted file mode 100644 index d6c7bec89..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicy.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/admissionregistration/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" - testing "k8s.io/client-go/testing" -) - -// FakeValidatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface -type FakeValidatingAdmissionPolicies struct { - Fake *FakeAdmissionregistrationV1 -} - -var validatingadmissionpoliciesResource = v1.SchemeGroupVersion.WithResource("validatingadmissionpolicies") - -var validatingadmissionpoliciesKind = v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy") - -// Get takes name of the validatingAdmissionPolicy, and returns the corresponding validatingAdmissionPolicy object, and an error if there is any. -func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingAdmissionPolicy, err error) { - emptyResult := &v1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpoliciesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ValidatingAdmissionPolicy), err -} - -// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. -func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyList, err error) { - emptyResult := &v1.ValidatingAdmissionPolicyList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.ValidatingAdmissionPolicyList{ListMeta: obj.(*v1.ValidatingAdmissionPolicyList).ListMeta} - for _, item := range obj.(*v1.ValidatingAdmissionPolicyList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies. -func (c *FakeValidatingAdmissionPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpoliciesResource, opts)) -} - -// Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. -func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.CreateOptions) (result *v1.ValidatingAdmissionPolicy, err error) { - emptyResult := &v1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ValidatingAdmissionPolicy), err -} - -// Update takes the representation of a validatingAdmissionPolicy and updates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. -func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicy, err error) { - emptyResult := &v1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ValidatingAdmissionPolicy), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicy, err error) { - emptyResult := &v1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ValidatingAdmissionPolicy), err -} - -// Delete takes name of the validatingAdmissionPolicy and deletes it. Returns an error if one occurs. -func (c *FakeValidatingAdmissionPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpoliciesResource, name, opts), &v1.ValidatingAdmissionPolicy{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpoliciesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.ValidatingAdmissionPolicyList{}) - return err -} - -// Patch applies the patch and returns the patched validatingAdmissionPolicy. -func (c *FakeValidatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingAdmissionPolicy, err error) { - emptyResult := &v1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ValidatingAdmissionPolicy), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicy. -func (c *FakeValidatingAdmissionPolicies) Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingAdmissionPolicy, err error) { - if validatingAdmissionPolicy == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") - } - data, err := json.Marshal(validatingAdmissionPolicy) - if err != nil { - return nil, err - } - name := validatingAdmissionPolicy.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") - } - emptyResult := &v1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ValidatingAdmissionPolicy), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeValidatingAdmissionPolicies) ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingAdmissionPolicy, err error) { - if validatingAdmissionPolicy == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") - } - data, err := json.Marshal(validatingAdmissionPolicy) - if err != nil { - return nil, err - } - name := validatingAdmissionPolicy.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") - } - emptyResult := &v1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ValidatingAdmissionPolicy), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicybinding.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicybinding.go deleted file mode 100644 index 5b6719be0..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicybinding.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/admissionregistration/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" - testing "k8s.io/client-go/testing" -) - -// FakeValidatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface -type FakeValidatingAdmissionPolicyBindings struct { - Fake *FakeAdmissionregistrationV1 -} - -var validatingadmissionpolicybindingsResource = v1.SchemeGroupVersion.WithResource("validatingadmissionpolicybindings") - -var validatingadmissionpolicybindingsKind = v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding") - -// Get takes name of the validatingAdmissionPolicyBinding, and returns the corresponding validatingAdmissionPolicyBinding object, and an error if there is any. -func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) { - emptyResult := &v1.ValidatingAdmissionPolicyBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpolicybindingsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ValidatingAdmissionPolicyBinding), err -} - -// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. -func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyBindingList, err error) { - emptyResult := &v1.ValidatingAdmissionPolicyBindingList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.ValidatingAdmissionPolicyBindingList{ListMeta: obj.(*v1.ValidatingAdmissionPolicyBindingList).ListMeta} - for _, item := range obj.(*v1.ValidatingAdmissionPolicyBindingList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings. -func (c *FakeValidatingAdmissionPolicyBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpolicybindingsResource, opts)) -} - -// Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. -func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1.ValidatingAdmissionPolicyBinding, opts metav1.CreateOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) { - emptyResult := &v1.ValidatingAdmissionPolicyBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ValidatingAdmissionPolicyBinding), err -} - -// Update takes the representation of a validatingAdmissionPolicyBinding and updates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. -func (c *FakeValidatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1.ValidatingAdmissionPolicyBinding, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) { - emptyResult := &v1.ValidatingAdmissionPolicyBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ValidatingAdmissionPolicyBinding), err -} - -// Delete takes name of the validatingAdmissionPolicyBinding and deletes it. Returns an error if one occurs. -func (c *FakeValidatingAdmissionPolicyBindings) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpolicybindingsResource, name, opts), &v1.ValidatingAdmissionPolicyBinding{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpolicybindingsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.ValidatingAdmissionPolicyBindingList{}) - return err -} - -// Patch applies the patch and returns the patched validatingAdmissionPolicyBinding. -func (c *FakeValidatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingAdmissionPolicyBinding, err error) { - emptyResult := &v1.ValidatingAdmissionPolicyBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ValidatingAdmissionPolicyBinding), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicyBinding. -func (c *FakeValidatingAdmissionPolicyBindings) Apply(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) { - if validatingAdmissionPolicyBinding == nil { - return nil, fmt.Errorf("validatingAdmissionPolicyBinding provided to Apply must not be nil") - } - data, err := json.Marshal(validatingAdmissionPolicyBinding) - if err != nil { - return nil, err - } - name := validatingAdmissionPolicyBinding.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicyBinding.Name must be provided to Apply") - } - emptyResult := &v1.ValidatingAdmissionPolicyBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ValidatingAdmissionPolicyBinding), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_validatingwebhookconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_validatingwebhookconfiguration.go deleted file mode 100644 index ff7fc4301..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_validatingwebhookconfiguration.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/admissionregistration/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" - testing "k8s.io/client-go/testing" -) - -// FakeValidatingWebhookConfigurations implements ValidatingWebhookConfigurationInterface -type FakeValidatingWebhookConfigurations struct { - Fake *FakeAdmissionregistrationV1 -} - -var validatingwebhookconfigurationsResource = v1.SchemeGroupVersion.WithResource("validatingwebhookconfigurations") - -var validatingwebhookconfigurationsKind = v1.SchemeGroupVersion.WithKind("ValidatingWebhookConfiguration") - -// Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any. -func (c *FakeValidatingWebhookConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingWebhookConfiguration, err error) { - emptyResult := &v1.ValidatingWebhookConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(validatingwebhookconfigurationsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ValidatingWebhookConfiguration), err -} - -// List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. -func (c *FakeValidatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) { - emptyResult := &v1.ValidatingWebhookConfigurationList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.ValidatingWebhookConfigurationList{ListMeta: obj.(*v1.ValidatingWebhookConfigurationList).ListMeta} - for _, item := range obj.(*v1.ValidatingWebhookConfigurationList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations. -func (c *FakeValidatingWebhookConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(validatingwebhookconfigurationsResource, opts)) -} - -// Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. -func (c *FakeValidatingWebhookConfigurations) Create(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.CreateOptions) (result *v1.ValidatingWebhookConfiguration, err error) { - emptyResult := &v1.ValidatingWebhookConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(validatingwebhookconfigurationsResource, validatingWebhookConfiguration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ValidatingWebhookConfiguration), err -} - -// Update takes the representation of a validatingWebhookConfiguration and updates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. -func (c *FakeValidatingWebhookConfigurations) Update(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.UpdateOptions) (result *v1.ValidatingWebhookConfiguration, err error) { - emptyResult := &v1.ValidatingWebhookConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(validatingwebhookconfigurationsResource, validatingWebhookConfiguration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ValidatingWebhookConfiguration), err -} - -// Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs. -func (c *FakeValidatingWebhookConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(validatingwebhookconfigurationsResource, name, opts), &v1.ValidatingWebhookConfiguration{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeValidatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(validatingwebhookconfigurationsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.ValidatingWebhookConfigurationList{}) - return err -} - -// Patch applies the patch and returns the patched validatingWebhookConfiguration. -func (c *FakeValidatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingWebhookConfiguration, err error) { - emptyResult := &v1.ValidatingWebhookConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingwebhookconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ValidatingWebhookConfiguration), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied validatingWebhookConfiguration. -func (c *FakeValidatingWebhookConfigurations) Apply(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1.ValidatingWebhookConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingWebhookConfiguration, err error) { - if validatingWebhookConfiguration == nil { - return nil, fmt.Errorf("validatingWebhookConfiguration provided to Apply must not be nil") - } - data, err := json.Marshal(validatingWebhookConfiguration) - if err != nil { - return nil, err - } - name := validatingWebhookConfiguration.Name - if name == nil { - return nil, fmt.Errorf("validatingWebhookConfiguration.Name must be provided to Apply") - } - emptyResult := &v1.ValidatingWebhookConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ValidatingWebhookConfiguration), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go deleted file mode 100644 index dc0e30ca4..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go +++ /dev/null @@ -1,44 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeAdmissionregistrationV1alpha1 struct { - *testing.Fake -} - -func (c *FakeAdmissionregistrationV1alpha1) ValidatingAdmissionPolicies() v1alpha1.ValidatingAdmissionPolicyInterface { - return &FakeValidatingAdmissionPolicies{c} -} - -func (c *FakeAdmissionregistrationV1alpha1) ValidatingAdmissionPolicyBindings() v1alpha1.ValidatingAdmissionPolicyBindingInterface { - return &FakeValidatingAdmissionPolicyBindings{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeAdmissionregistrationV1alpha1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicy.go deleted file mode 100644 index ef4d843e0..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicy.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - admissionregistrationv1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakeValidatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface -type FakeValidatingAdmissionPolicies struct { - Fake *FakeAdmissionregistrationV1alpha1 -} - -var validatingadmissionpoliciesResource = v1alpha1.SchemeGroupVersion.WithResource("validatingadmissionpolicies") - -var validatingadmissionpoliciesKind = v1alpha1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy") - -// Get takes name of the validatingAdmissionPolicy, and returns the corresponding validatingAdmissionPolicy object, and an error if there is any. -func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { - emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpoliciesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ValidatingAdmissionPolicy), err -} - -// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. -func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyList, err error) { - emptyResult := &v1alpha1.ValidatingAdmissionPolicyList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ValidatingAdmissionPolicyList{ListMeta: obj.(*v1alpha1.ValidatingAdmissionPolicyList).ListMeta} - for _, item := range obj.(*v1alpha1.ValidatingAdmissionPolicyList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies. -func (c *FakeValidatingAdmissionPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpoliciesResource, opts)) -} - -// Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. -func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { - emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ValidatingAdmissionPolicy), err -} - -// Update takes the representation of a validatingAdmissionPolicy and updates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. -func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { - emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ValidatingAdmissionPolicy), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { - emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ValidatingAdmissionPolicy), err -} - -// Delete takes name of the validatingAdmissionPolicy and deletes it. Returns an error if one occurs. -func (c *FakeValidatingAdmissionPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpoliciesResource, name, opts), &v1alpha1.ValidatingAdmissionPolicy{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpoliciesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.ValidatingAdmissionPolicyList{}) - return err -} - -// Patch applies the patch and returns the patched validatingAdmissionPolicy. -func (c *FakeValidatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { - emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ValidatingAdmissionPolicy), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicy. -func (c *FakeValidatingAdmissionPolicies) Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { - if validatingAdmissionPolicy == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") - } - data, err := json.Marshal(validatingAdmissionPolicy) - if err != nil { - return nil, err - } - name := validatingAdmissionPolicy.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") - } - emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ValidatingAdmissionPolicy), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeValidatingAdmissionPolicies) ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { - if validatingAdmissionPolicy == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") - } - data, err := json.Marshal(validatingAdmissionPolicy) - if err != nil { - return nil, err - } - name := validatingAdmissionPolicy.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") - } - emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ValidatingAdmissionPolicy), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicybinding.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicybinding.go deleted file mode 100644 index f7cc966fb..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicybinding.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - admissionregistrationv1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakeValidatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface -type FakeValidatingAdmissionPolicyBindings struct { - Fake *FakeAdmissionregistrationV1alpha1 -} - -var validatingadmissionpolicybindingsResource = v1alpha1.SchemeGroupVersion.WithResource("validatingadmissionpolicybindings") - -var validatingadmissionpolicybindingsKind = v1alpha1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding") - -// Get takes name of the validatingAdmissionPolicyBinding, and returns the corresponding validatingAdmissionPolicyBinding object, and an error if there is any. -func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { - emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpolicybindingsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err -} - -// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. -func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyBindingList, err error) { - emptyResult := &v1alpha1.ValidatingAdmissionPolicyBindingList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ValidatingAdmissionPolicyBindingList{ListMeta: obj.(*v1alpha1.ValidatingAdmissionPolicyBindingList).ListMeta} - for _, item := range obj.(*v1alpha1.ValidatingAdmissionPolicyBindingList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings. -func (c *FakeValidatingAdmissionPolicyBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpolicybindingsResource, opts)) -} - -// Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. -func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1alpha1.ValidatingAdmissionPolicyBinding, opts v1.CreateOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { - emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err -} - -// Update takes the representation of a validatingAdmissionPolicyBinding and updates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. -func (c *FakeValidatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1alpha1.ValidatingAdmissionPolicyBinding, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { - emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err -} - -// Delete takes name of the validatingAdmissionPolicyBinding and deletes it. Returns an error if one occurs. -func (c *FakeValidatingAdmissionPolicyBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpolicybindingsResource, name, opts), &v1alpha1.ValidatingAdmissionPolicyBinding{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpolicybindingsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.ValidatingAdmissionPolicyBindingList{}) - return err -} - -// Patch applies the patch and returns the patched validatingAdmissionPolicyBinding. -func (c *FakeValidatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { - emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicyBinding. -func (c *FakeValidatingAdmissionPolicyBindings) Apply(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { - if validatingAdmissionPolicyBinding == nil { - return nil, fmt.Errorf("validatingAdmissionPolicyBinding provided to Apply must not be nil") - } - data, err := json.Marshal(validatingAdmissionPolicyBinding) - if err != nil { - return nil, err - } - name := validatingAdmissionPolicyBinding.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicyBinding.Name must be provided to Apply") - } - emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_admissionregistration_client.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_admissionregistration_client.go deleted file mode 100644 index badfbf034..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_admissionregistration_client.go +++ /dev/null @@ -1,52 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeAdmissionregistrationV1beta1 struct { - *testing.Fake -} - -func (c *FakeAdmissionregistrationV1beta1) MutatingWebhookConfigurations() v1beta1.MutatingWebhookConfigurationInterface { - return &FakeMutatingWebhookConfigurations{c} -} - -func (c *FakeAdmissionregistrationV1beta1) ValidatingAdmissionPolicies() v1beta1.ValidatingAdmissionPolicyInterface { - return &FakeValidatingAdmissionPolicies{c} -} - -func (c *FakeAdmissionregistrationV1beta1) ValidatingAdmissionPolicyBindings() v1beta1.ValidatingAdmissionPolicyBindingInterface { - return &FakeValidatingAdmissionPolicyBindings{c} -} - -func (c *FakeAdmissionregistrationV1beta1) ValidatingWebhookConfigurations() v1beta1.ValidatingWebhookConfigurationInterface { - return &FakeValidatingWebhookConfigurations{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeAdmissionregistrationV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go deleted file mode 100644 index 767154932..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/admissionregistration/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeMutatingWebhookConfigurations implements MutatingWebhookConfigurationInterface -type FakeMutatingWebhookConfigurations struct { - Fake *FakeAdmissionregistrationV1beta1 -} - -var mutatingwebhookconfigurationsResource = v1beta1.SchemeGroupVersion.WithResource("mutatingwebhookconfigurations") - -var mutatingwebhookconfigurationsKind = v1beta1.SchemeGroupVersion.WithKind("MutatingWebhookConfiguration") - -// Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any. -func (c *FakeMutatingWebhookConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { - emptyResult := &v1beta1.MutatingWebhookConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(mutatingwebhookconfigurationsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.MutatingWebhookConfiguration), err -} - -// List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. -func (c *FakeMutatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) { - emptyResult := &v1beta1.MutatingWebhookConfigurationList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.MutatingWebhookConfigurationList{ListMeta: obj.(*v1beta1.MutatingWebhookConfigurationList).ListMeta} - for _, item := range obj.(*v1beta1.MutatingWebhookConfigurationList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations. -func (c *FakeMutatingWebhookConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(mutatingwebhookconfigurationsResource, opts)) -} - -// Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. -func (c *FakeMutatingWebhookConfigurations) Create(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.CreateOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { - emptyResult := &v1beta1.MutatingWebhookConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.MutatingWebhookConfiguration), err -} - -// Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. -func (c *FakeMutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.UpdateOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { - emptyResult := &v1beta1.MutatingWebhookConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.MutatingWebhookConfiguration), err -} - -// Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs. -func (c *FakeMutatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(mutatingwebhookconfigurationsResource, name, opts), &v1beta1.MutatingWebhookConfiguration{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeMutatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(mutatingwebhookconfigurationsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.MutatingWebhookConfigurationList{}) - return err -} - -// Patch applies the patch and returns the patched mutatingWebhookConfiguration. -func (c *FakeMutatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MutatingWebhookConfiguration, err error) { - emptyResult := &v1beta1.MutatingWebhookConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(mutatingwebhookconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.MutatingWebhookConfiguration), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied mutatingWebhookConfiguration. -func (c *FakeMutatingWebhookConfigurations) Apply(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { - if mutatingWebhookConfiguration == nil { - return nil, fmt.Errorf("mutatingWebhookConfiguration provided to Apply must not be nil") - } - data, err := json.Marshal(mutatingWebhookConfiguration) - if err != nil { - return nil, err - } - name := mutatingWebhookConfiguration.Name - if name == nil { - return nil, fmt.Errorf("mutatingWebhookConfiguration.Name must be provided to Apply") - } - emptyResult := &v1beta1.MutatingWebhookConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.MutatingWebhookConfiguration), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicy.go deleted file mode 100644 index e30891c77..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicy.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/admissionregistration/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeValidatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface -type FakeValidatingAdmissionPolicies struct { - Fake *FakeAdmissionregistrationV1beta1 -} - -var validatingadmissionpoliciesResource = v1beta1.SchemeGroupVersion.WithResource("validatingadmissionpolicies") - -var validatingadmissionpoliciesKind = v1beta1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy") - -// Get takes name of the validatingAdmissionPolicy, and returns the corresponding validatingAdmissionPolicy object, and an error if there is any. -func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - emptyResult := &v1beta1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpoliciesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicy), err -} - -// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. -func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyList, err error) { - emptyResult := &v1beta1.ValidatingAdmissionPolicyList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.ValidatingAdmissionPolicyList{ListMeta: obj.(*v1beta1.ValidatingAdmissionPolicyList).ListMeta} - for _, item := range obj.(*v1beta1.ValidatingAdmissionPolicyList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies. -func (c *FakeValidatingAdmissionPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpoliciesResource, opts)) -} - -// Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. -func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - emptyResult := &v1beta1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicy), err -} - -// Update takes the representation of a validatingAdmissionPolicy and updates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. -func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - emptyResult := &v1beta1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicy), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - emptyResult := &v1beta1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicy), err -} - -// Delete takes name of the validatingAdmissionPolicy and deletes it. Returns an error if one occurs. -func (c *FakeValidatingAdmissionPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpoliciesResource, name, opts), &v1beta1.ValidatingAdmissionPolicy{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpoliciesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.ValidatingAdmissionPolicyList{}) - return err -} - -// Patch applies the patch and returns the patched validatingAdmissionPolicy. -func (c *FakeValidatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - emptyResult := &v1beta1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicy), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicy. -func (c *FakeValidatingAdmissionPolicies) Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - if validatingAdmissionPolicy == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") - } - data, err := json.Marshal(validatingAdmissionPolicy) - if err != nil { - return nil, err - } - name := validatingAdmissionPolicy.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") - } - emptyResult := &v1beta1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicy), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeValidatingAdmissionPolicies) ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - if validatingAdmissionPolicy == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") - } - data, err := json.Marshal(validatingAdmissionPolicy) - if err != nil { - return nil, err - } - name := validatingAdmissionPolicy.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") - } - emptyResult := &v1beta1.ValidatingAdmissionPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicy), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicybinding.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicybinding.go deleted file mode 100644 index 207db3752..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicybinding.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/admissionregistration/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeValidatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface -type FakeValidatingAdmissionPolicyBindings struct { - Fake *FakeAdmissionregistrationV1beta1 -} - -var validatingadmissionpolicybindingsResource = v1beta1.SchemeGroupVersion.WithResource("validatingadmissionpolicybindings") - -var validatingadmissionpolicybindingsKind = v1beta1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding") - -// Get takes name of the validatingAdmissionPolicyBinding, and returns the corresponding validatingAdmissionPolicyBinding object, and an error if there is any. -func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { - emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpolicybindingsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err -} - -// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. -func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyBindingList, err error) { - emptyResult := &v1beta1.ValidatingAdmissionPolicyBindingList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.ValidatingAdmissionPolicyBindingList{ListMeta: obj.(*v1beta1.ValidatingAdmissionPolicyBindingList).ListMeta} - for _, item := range obj.(*v1beta1.ValidatingAdmissionPolicyBindingList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings. -func (c *FakeValidatingAdmissionPolicyBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpolicybindingsResource, opts)) -} - -// Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. -func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.CreateOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { - emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err -} - -// Update takes the representation of a validatingAdmissionPolicyBinding and updates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. -func (c *FakeValidatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { - emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err -} - -// Delete takes name of the validatingAdmissionPolicyBinding and deletes it. Returns an error if one occurs. -func (c *FakeValidatingAdmissionPolicyBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpolicybindingsResource, name, opts), &v1beta1.ValidatingAdmissionPolicyBinding{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpolicybindingsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.ValidatingAdmissionPolicyBindingList{}) - return err -} - -// Patch applies the patch and returns the patched validatingAdmissionPolicyBinding. -func (c *FakeValidatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { - emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicyBinding. -func (c *FakeValidatingAdmissionPolicyBindings) Apply(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { - if validatingAdmissionPolicyBinding == nil { - return nil, fmt.Errorf("validatingAdmissionPolicyBinding provided to Apply must not be nil") - } - data, err := json.Marshal(validatingAdmissionPolicyBinding) - if err != nil { - return nil, err - } - name := validatingAdmissionPolicyBinding.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicyBinding.Name must be provided to Apply") - } - emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go deleted file mode 100644 index f78a31ee0..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/admissionregistration/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeValidatingWebhookConfigurations implements ValidatingWebhookConfigurationInterface -type FakeValidatingWebhookConfigurations struct { - Fake *FakeAdmissionregistrationV1beta1 -} - -var validatingwebhookconfigurationsResource = v1beta1.SchemeGroupVersion.WithResource("validatingwebhookconfigurations") - -var validatingwebhookconfigurationsKind = v1beta1.SchemeGroupVersion.WithKind("ValidatingWebhookConfiguration") - -// Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any. -func (c *FakeValidatingWebhookConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { - emptyResult := &v1beta1.ValidatingWebhookConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(validatingwebhookconfigurationsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ValidatingWebhookConfiguration), err -} - -// List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. -func (c *FakeValidatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) { - emptyResult := &v1beta1.ValidatingWebhookConfigurationList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.ValidatingWebhookConfigurationList{ListMeta: obj.(*v1beta1.ValidatingWebhookConfigurationList).ListMeta} - for _, item := range obj.(*v1beta1.ValidatingWebhookConfigurationList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations. -func (c *FakeValidatingWebhookConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(validatingwebhookconfigurationsResource, opts)) -} - -// Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. -func (c *FakeValidatingWebhookConfigurations) Create(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.CreateOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { - emptyResult := &v1beta1.ValidatingWebhookConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(validatingwebhookconfigurationsResource, validatingWebhookConfiguration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ValidatingWebhookConfiguration), err -} - -// Update takes the representation of a validatingWebhookConfiguration and updates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. -func (c *FakeValidatingWebhookConfigurations) Update(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.UpdateOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { - emptyResult := &v1beta1.ValidatingWebhookConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(validatingwebhookconfigurationsResource, validatingWebhookConfiguration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ValidatingWebhookConfiguration), err -} - -// Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs. -func (c *FakeValidatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(validatingwebhookconfigurationsResource, name, opts), &v1beta1.ValidatingWebhookConfiguration{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeValidatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(validatingwebhookconfigurationsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.ValidatingWebhookConfigurationList{}) - return err -} - -// Patch applies the patch and returns the patched validatingWebhookConfiguration. -func (c *FakeValidatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingWebhookConfiguration, err error) { - emptyResult := &v1beta1.ValidatingWebhookConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingwebhookconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ValidatingWebhookConfiguration), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied validatingWebhookConfiguration. -func (c *FakeValidatingWebhookConfigurations) Apply(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { - if validatingWebhookConfiguration == nil { - return nil, fmt.Errorf("validatingWebhookConfiguration provided to Apply must not be nil") - } - data, err := json.Marshal(validatingWebhookConfiguration) - if err != nil { - return nil, err - } - name := validatingWebhookConfiguration.Name - if name == nil { - return nil, fmt.Errorf("validatingWebhookConfiguration.Name must be provided to Apply") - } - emptyResult := &v1beta1.ValidatingWebhookConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ValidatingWebhookConfiguration), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/fake/fake_apiserverinternal_client.go b/vendor/k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/fake/fake_apiserverinternal_client.go deleted file mode 100644 index 0960a5e81..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/fake/fake_apiserverinternal_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha1 "k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeInternalV1alpha1 struct { - *testing.Fake -} - -func (c *FakeInternalV1alpha1) StorageVersions() v1alpha1.StorageVersionInterface { - return &FakeStorageVersions{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeInternalV1alpha1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/fake/fake_storageversion.go b/vendor/k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/fake/fake_storageversion.go deleted file mode 100644 index e9f0b78d4..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/fake/fake_storageversion.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - apiserverinternalv1alpha1 "k8s.io/client-go/applyconfigurations/apiserverinternal/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakeStorageVersions implements StorageVersionInterface -type FakeStorageVersions struct { - Fake *FakeInternalV1alpha1 -} - -var storageversionsResource = v1alpha1.SchemeGroupVersion.WithResource("storageversions") - -var storageversionsKind = v1alpha1.SchemeGroupVersion.WithKind("StorageVersion") - -// Get takes name of the storageVersion, and returns the corresponding storageVersion object, and an error if there is any. -func (c *FakeStorageVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.StorageVersion, err error) { - emptyResult := &v1alpha1.StorageVersion{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(storageversionsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.StorageVersion), err -} - -// List takes label and field selectors, and returns the list of StorageVersions that match those selectors. -func (c *FakeStorageVersions) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionList, err error) { - emptyResult := &v1alpha1.StorageVersionList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(storageversionsResource, storageversionsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.StorageVersionList{ListMeta: obj.(*v1alpha1.StorageVersionList).ListMeta} - for _, item := range obj.(*v1alpha1.StorageVersionList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested storageVersions. -func (c *FakeStorageVersions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(storageversionsResource, opts)) -} - -// Create takes the representation of a storageVersion and creates it. Returns the server's representation of the storageVersion, and an error, if there is any. -func (c *FakeStorageVersions) Create(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.CreateOptions) (result *v1alpha1.StorageVersion, err error) { - emptyResult := &v1alpha1.StorageVersion{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(storageversionsResource, storageVersion, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.StorageVersion), err -} - -// Update takes the representation of a storageVersion and updates it. Returns the server's representation of the storageVersion, and an error, if there is any. -func (c *FakeStorageVersions) Update(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (result *v1alpha1.StorageVersion, err error) { - emptyResult := &v1alpha1.StorageVersion{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(storageversionsResource, storageVersion, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.StorageVersion), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeStorageVersions) UpdateStatus(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (result *v1alpha1.StorageVersion, err error) { - emptyResult := &v1alpha1.StorageVersion{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(storageversionsResource, "status", storageVersion, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.StorageVersion), err -} - -// Delete takes name of the storageVersion and deletes it. Returns an error if one occurs. -func (c *FakeStorageVersions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(storageversionsResource, name, opts), &v1alpha1.StorageVersion{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeStorageVersions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(storageversionsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.StorageVersionList{}) - return err -} - -// Patch applies the patch and returns the patched storageVersion. -func (c *FakeStorageVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.StorageVersion, err error) { - emptyResult := &v1alpha1.StorageVersion{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.StorageVersion), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied storageVersion. -func (c *FakeStorageVersions) Apply(ctx context.Context, storageVersion *apiserverinternalv1alpha1.StorageVersionApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersion, err error) { - if storageVersion == nil { - return nil, fmt.Errorf("storageVersion provided to Apply must not be nil") - } - data, err := json.Marshal(storageVersion) - if err != nil { - return nil, err - } - name := storageVersion.Name - if name == nil { - return nil, fmt.Errorf("storageVersion.Name must be provided to Apply") - } - emptyResult := &v1alpha1.StorageVersion{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.StorageVersion), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeStorageVersions) ApplyStatus(ctx context.Context, storageVersion *apiserverinternalv1alpha1.StorageVersionApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersion, err error) { - if storageVersion == nil { - return nil, fmt.Errorf("storageVersion provided to Apply must not be nil") - } - data, err := json.Marshal(storageVersion) - if err != nil { - return nil, err - } - name := storageVersion.Name - if name == nil { - return nil, fmt.Errorf("storageVersion.Name must be provided to Apply") - } - emptyResult := &v1alpha1.StorageVersion{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.StorageVersion), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_apps_client.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_apps_client.go deleted file mode 100644 index 458df0fa3..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_apps_client.go +++ /dev/null @@ -1,56 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/client-go/kubernetes/typed/apps/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeAppsV1 struct { - *testing.Fake -} - -func (c *FakeAppsV1) ControllerRevisions(namespace string) v1.ControllerRevisionInterface { - return &FakeControllerRevisions{c, namespace} -} - -func (c *FakeAppsV1) DaemonSets(namespace string) v1.DaemonSetInterface { - return &FakeDaemonSets{c, namespace} -} - -func (c *FakeAppsV1) Deployments(namespace string) v1.DeploymentInterface { - return &FakeDeployments{c, namespace} -} - -func (c *FakeAppsV1) ReplicaSets(namespace string) v1.ReplicaSetInterface { - return &FakeReplicaSets{c, namespace} -} - -func (c *FakeAppsV1) StatefulSets(namespace string) v1.StatefulSetInterface { - return &FakeStatefulSets{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeAppsV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go deleted file mode 100644 index c609ef534..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/apps/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" - testing "k8s.io/client-go/testing" -) - -// FakeControllerRevisions implements ControllerRevisionInterface -type FakeControllerRevisions struct { - Fake *FakeAppsV1 - ns string -} - -var controllerrevisionsResource = v1.SchemeGroupVersion.WithResource("controllerrevisions") - -var controllerrevisionsKind = v1.SchemeGroupVersion.WithKind("ControllerRevision") - -// Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any. -func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ControllerRevision, err error) { - emptyResult := &v1.ControllerRevision{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(controllerrevisionsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ControllerRevision), err -} - -// List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. -func (c *FakeControllerRevisions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) { - emptyResult := &v1.ControllerRevisionList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.ControllerRevisionList{ListMeta: obj.(*v1.ControllerRevisionList).ListMeta} - for _, item := range obj.(*v1.ControllerRevisionList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested controllerRevisions. -func (c *FakeControllerRevisions) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(controllerrevisionsResource, c.ns, opts)) - -} - -// Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any. -func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.CreateOptions) (result *v1.ControllerRevision, err error) { - emptyResult := &v1.ControllerRevision{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ControllerRevision), err -} - -// Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any. -func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.UpdateOptions) (result *v1.ControllerRevision, err error) { - emptyResult := &v1.ControllerRevision{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ControllerRevision), err -} - -// Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. -func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(controllerrevisionsResource, c.ns, name, opts), &v1.ControllerRevision{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(controllerrevisionsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.ControllerRevisionList{}) - return err -} - -// Patch applies the patch and returns the patched controllerRevision. -func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ControllerRevision, err error) { - emptyResult := &v1.ControllerRevision{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ControllerRevision), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied controllerRevision. -func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision *appsv1.ControllerRevisionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ControllerRevision, err error) { - if controllerRevision == nil { - return nil, fmt.Errorf("controllerRevision provided to Apply must not be nil") - } - data, err := json.Marshal(controllerRevision) - if err != nil { - return nil, err - } - name := controllerRevision.Name - if name == nil { - return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply") - } - emptyResult := &v1.ControllerRevision{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ControllerRevision), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_daemonset.go deleted file mode 100644 index bac3fc122..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_daemonset.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/apps/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" - testing "k8s.io/client-go/testing" -) - -// FakeDaemonSets implements DaemonSetInterface -type FakeDaemonSets struct { - Fake *FakeAppsV1 - ns string -} - -var daemonsetsResource = v1.SchemeGroupVersion.WithResource("daemonsets") - -var daemonsetsKind = v1.SchemeGroupVersion.WithKind("DaemonSet") - -// Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any. -func (c *FakeDaemonSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DaemonSet, err error) { - emptyResult := &v1.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(daemonsetsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.DaemonSet), err -} - -// List takes label and field selectors, and returns the list of DaemonSets that match those selectors. -func (c *FakeDaemonSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DaemonSetList, err error) { - emptyResult := &v1.DaemonSetList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(daemonsetsResource, daemonsetsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.DaemonSetList{ListMeta: obj.(*v1.DaemonSetList).ListMeta} - for _, item := range obj.(*v1.DaemonSetList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested daemonSets. -func (c *FakeDaemonSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(daemonsetsResource, c.ns, opts)) - -} - -// Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any. -func (c *FakeDaemonSets) Create(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.CreateOptions) (result *v1.DaemonSet, err error) { - emptyResult := &v1.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.DaemonSet), err -} - -// Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any. -func (c *FakeDaemonSets) Update(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (result *v1.DaemonSet, err error) { - emptyResult := &v1.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.DaemonSet), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (result *v1.DaemonSet, err error) { - emptyResult := &v1.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(daemonsetsResource, "status", c.ns, daemonSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.DaemonSet), err -} - -// Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. -func (c *FakeDaemonSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(daemonsetsResource, c.ns, name, opts), &v1.DaemonSet{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(daemonsetsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.DaemonSetList{}) - return err -} - -// Patch applies the patch and returns the patched daemonSet. -func (c *FakeDaemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DaemonSet, err error) { - emptyResult := &v1.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.DaemonSet), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied daemonSet. -func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *appsv1.DaemonSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DaemonSet, err error) { - if daemonSet == nil { - return nil, fmt.Errorf("daemonSet provided to Apply must not be nil") - } - data, err := json.Marshal(daemonSet) - if err != nil { - return nil, err - } - name := daemonSet.Name - if name == nil { - return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") - } - emptyResult := &v1.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.DaemonSet), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *appsv1.DaemonSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DaemonSet, err error) { - if daemonSet == nil { - return nil, fmt.Errorf("daemonSet provided to Apply must not be nil") - } - data, err := json.Marshal(daemonSet) - if err != nil { - return nil, err - } - name := daemonSet.Name - if name == nil { - return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") - } - emptyResult := &v1.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.DaemonSet), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go deleted file mode 100644 index 8ed843288..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go +++ /dev/null @@ -1,243 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/apps/v1" - autoscalingv1 "k8s.io/api/autoscaling/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" - applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" - testing "k8s.io/client-go/testing" -) - -// FakeDeployments implements DeploymentInterface -type FakeDeployments struct { - Fake *FakeAppsV1 - ns string -} - -var deploymentsResource = v1.SchemeGroupVersion.WithResource("deployments") - -var deploymentsKind = v1.SchemeGroupVersion.WithKind("Deployment") - -// Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. -func (c *FakeDeployments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Deployment, err error) { - emptyResult := &v1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(deploymentsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Deployment), err -} - -// List takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *FakeDeployments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DeploymentList, err error) { - emptyResult := &v1.DeploymentList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.DeploymentList{ListMeta: obj.(*v1.DeploymentList).ListMeta} - for _, item := range obj.(*v1.DeploymentList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested deployments. -func (c *FakeDeployments) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(deploymentsResource, c.ns, opts)) - -} - -// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *FakeDeployments) Create(ctx context.Context, deployment *v1.Deployment, opts metav1.CreateOptions) (result *v1.Deployment, err error) { - emptyResult := &v1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Deployment), err -} - -// Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *FakeDeployments) Update(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (result *v1.Deployment, err error) { - emptyResult := &v1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Deployment), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (result *v1.Deployment, err error) { - emptyResult := &v1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "status", c.ns, deployment, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Deployment), err -} - -// Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *FakeDeployments) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(deploymentsResource, c.ns, name, opts), &v1.Deployment{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(deploymentsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.DeploymentList{}) - return err -} - -// Patch applies the patch and returns the patched deployment. -func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Deployment, err error) { - emptyResult := &v1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Deployment), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied deployment. -func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1.DeploymentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Deployment, err error) { - if deployment == nil { - return nil, fmt.Errorf("deployment provided to Apply must not be nil") - } - data, err := json.Marshal(deployment) - if err != nil { - return nil, err - } - name := deployment.Name - if name == nil { - return nil, fmt.Errorf("deployment.Name must be provided to Apply") - } - emptyResult := &v1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Deployment), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1.DeploymentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Deployment, err error) { - if deployment == nil { - return nil, fmt.Errorf("deployment provided to Apply must not be nil") - } - data, err := json.Marshal(deployment) - if err != nil { - return nil, err - } - name := deployment.Name - if name == nil { - return nil, fmt.Errorf("deployment.Name must be provided to Apply") - } - emptyResult := &v1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Deployment), err -} - -// GetScale takes name of the deployment, and returns the corresponding scale object, and an error if there is any. -func (c *FakeDeployments) GetScale(ctx context.Context, deploymentName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { - emptyResult := &autoscalingv1.Scale{} - obj, err := c.Fake. - Invokes(testing.NewGetSubresourceActionWithOptions(deploymentsResource, c.ns, "scale", deploymentName, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*autoscalingv1.Scale), err -} - -// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *FakeDeployments) UpdateScale(ctx context.Context, deploymentName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { - emptyResult := &autoscalingv1.Scale{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "scale", c.ns, scale, opts), &autoscalingv1.Scale{}) - - if obj == nil { - return emptyResult, err - } - return obj.(*autoscalingv1.Scale), err -} - -// ApplyScale takes top resource name and the apply declarative configuration for scale, -// applies it and returns the applied scale, and an error, if there is any. -func (c *FakeDeployments) ApplyScale(ctx context.Context, deploymentName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (result *autoscalingv1.Scale, err error) { - if scale == nil { - return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") - } - data, err := json.Marshal(scale) - if err != nil { - return nil, err - } - emptyResult := &autoscalingv1.Scale{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*autoscalingv1.Scale), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go deleted file mode 100644 index 942a4e64a..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go +++ /dev/null @@ -1,243 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/apps/v1" - autoscalingv1 "k8s.io/api/autoscaling/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" - applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" - testing "k8s.io/client-go/testing" -) - -// FakeReplicaSets implements ReplicaSetInterface -type FakeReplicaSets struct { - Fake *FakeAppsV1 - ns string -} - -var replicasetsResource = v1.SchemeGroupVersion.WithResource("replicasets") - -var replicasetsKind = v1.SchemeGroupVersion.WithKind("ReplicaSet") - -// Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. -func (c *FakeReplicaSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ReplicaSet, err error) { - emptyResult := &v1.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(replicasetsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ReplicaSet), err -} - -// List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. -func (c *FakeReplicaSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicaSetList, err error) { - emptyResult := &v1.ReplicaSetList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(replicasetsResource, replicasetsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.ReplicaSetList{ListMeta: obj.(*v1.ReplicaSetList).ListMeta} - for _, item := range obj.(*v1.ReplicaSetList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested replicaSets. -func (c *FakeReplicaSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(replicasetsResource, c.ns, opts)) - -} - -// Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.CreateOptions) (result *v1.ReplicaSet, err error) { - emptyResult := &v1.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ReplicaSet), err -} - -// Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (result *v1.ReplicaSet, err error) { - emptyResult := &v1.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ReplicaSet), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (result *v1.ReplicaSet, err error) { - emptyResult := &v1.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(replicasetsResource, "status", c.ns, replicaSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ReplicaSet), err -} - -// Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. -func (c *FakeReplicaSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(replicasetsResource, c.ns, name, opts), &v1.ReplicaSet{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(replicasetsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.ReplicaSetList{}) - return err -} - -// Patch applies the patch and returns the patched replicaSet. -func (c *FakeReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicaSet, err error) { - emptyResult := &v1.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ReplicaSet), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied replicaSet. -func (c *FakeReplicaSets) Apply(ctx context.Context, replicaSet *appsv1.ReplicaSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicaSet, err error) { - if replicaSet == nil { - return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") - } - data, err := json.Marshal(replicaSet) - if err != nil { - return nil, err - } - name := replicaSet.Name - if name == nil { - return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") - } - emptyResult := &v1.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ReplicaSet), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *appsv1.ReplicaSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicaSet, err error) { - if replicaSet == nil { - return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") - } - data, err := json.Marshal(replicaSet) - if err != nil { - return nil, err - } - name := replicaSet.Name - if name == nil { - return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") - } - emptyResult := &v1.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ReplicaSet), err -} - -// GetScale takes name of the replicaSet, and returns the corresponding scale object, and an error if there is any. -func (c *FakeReplicaSets) GetScale(ctx context.Context, replicaSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { - emptyResult := &autoscalingv1.Scale{} - obj, err := c.Fake. - Invokes(testing.NewGetSubresourceActionWithOptions(replicasetsResource, c.ns, "scale", replicaSetName, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*autoscalingv1.Scale), err -} - -// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *FakeReplicaSets) UpdateScale(ctx context.Context, replicaSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { - emptyResult := &autoscalingv1.Scale{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(replicasetsResource, "scale", c.ns, scale, opts), &autoscalingv1.Scale{}) - - if obj == nil { - return emptyResult, err - } - return obj.(*autoscalingv1.Scale), err -} - -// ApplyScale takes top resource name and the apply declarative configuration for scale, -// applies it and returns the applied scale, and an error, if there is any. -func (c *FakeReplicaSets) ApplyScale(ctx context.Context, replicaSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (result *autoscalingv1.Scale, err error) { - if scale == nil { - return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") - } - data, err := json.Marshal(scale) - if err != nil { - return nil, err - } - emptyResult := &autoscalingv1.Scale{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*autoscalingv1.Scale), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go deleted file mode 100644 index ae4e811fb..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go +++ /dev/null @@ -1,243 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/apps/v1" - autoscalingv1 "k8s.io/api/autoscaling/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" - applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" - testing "k8s.io/client-go/testing" -) - -// FakeStatefulSets implements StatefulSetInterface -type FakeStatefulSets struct { - Fake *FakeAppsV1 - ns string -} - -var statefulsetsResource = v1.SchemeGroupVersion.WithResource("statefulsets") - -var statefulsetsKind = v1.SchemeGroupVersion.WithKind("StatefulSet") - -// Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any. -func (c *FakeStatefulSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.StatefulSet, err error) { - emptyResult := &v1.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(statefulsetsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.StatefulSet), err -} - -// List takes label and field selectors, and returns the list of StatefulSets that match those selectors. -func (c *FakeStatefulSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.StatefulSetList, err error) { - emptyResult := &v1.StatefulSetList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.StatefulSetList{ListMeta: obj.(*v1.StatefulSetList).ListMeta} - for _, item := range obj.(*v1.StatefulSetList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested statefulSets. -func (c *FakeStatefulSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(statefulsetsResource, c.ns, opts)) - -} - -// Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any. -func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.CreateOptions) (result *v1.StatefulSet, err error) { - emptyResult := &v1.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.StatefulSet), err -} - -// Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any. -func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (result *v1.StatefulSet, err error) { - emptyResult := &v1.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.StatefulSet), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (result *v1.StatefulSet, err error) { - emptyResult := &v1.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(statefulsetsResource, "status", c.ns, statefulSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.StatefulSet), err -} - -// Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. -func (c *FakeStatefulSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(statefulsetsResource, c.ns, name, opts), &v1.StatefulSet{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(statefulsetsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.StatefulSetList{}) - return err -} - -// Patch applies the patch and returns the patched statefulSet. -func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StatefulSet, err error) { - emptyResult := &v1.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.StatefulSet), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied statefulSet. -func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1.StatefulSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StatefulSet, err error) { - if statefulSet == nil { - return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") - } - data, err := json.Marshal(statefulSet) - if err != nil { - return nil, err - } - name := statefulSet.Name - if name == nil { - return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") - } - emptyResult := &v1.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.StatefulSet), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1.StatefulSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StatefulSet, err error) { - if statefulSet == nil { - return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") - } - data, err := json.Marshal(statefulSet) - if err != nil { - return nil, err - } - name := statefulSet.Name - if name == nil { - return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") - } - emptyResult := &v1.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.StatefulSet), err -} - -// GetScale takes name of the statefulSet, and returns the corresponding scale object, and an error if there is any. -func (c *FakeStatefulSets) GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { - emptyResult := &autoscalingv1.Scale{} - obj, err := c.Fake. - Invokes(testing.NewGetSubresourceActionWithOptions(statefulsetsResource, c.ns, "scale", statefulSetName, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*autoscalingv1.Scale), err -} - -// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *FakeStatefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { - emptyResult := &autoscalingv1.Scale{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(statefulsetsResource, "scale", c.ns, scale, opts), &autoscalingv1.Scale{}) - - if obj == nil { - return emptyResult, err - } - return obj.(*autoscalingv1.Scale), err -} - -// ApplyScale takes top resource name and the apply declarative configuration for scale, -// applies it and returns the applied scale, and an error, if there is any. -func (c *FakeStatefulSets) ApplyScale(ctx context.Context, statefulSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (result *autoscalingv1.Scale, err error) { - if scale == nil { - return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") - } - data, err := json.Marshal(scale) - if err != nil { - return nil, err - } - emptyResult := &autoscalingv1.Scale{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*autoscalingv1.Scale), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_apps_client.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_apps_client.go deleted file mode 100644 index 8e65d78d2..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_apps_client.go +++ /dev/null @@ -1,48 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeAppsV1beta1 struct { - *testing.Fake -} - -func (c *FakeAppsV1beta1) ControllerRevisions(namespace string) v1beta1.ControllerRevisionInterface { - return &FakeControllerRevisions{c, namespace} -} - -func (c *FakeAppsV1beta1) Deployments(namespace string) v1beta1.DeploymentInterface { - return &FakeDeployments{c, namespace} -} - -func (c *FakeAppsV1beta1) StatefulSets(namespace string) v1beta1.StatefulSetInterface { - return &FakeStatefulSets{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeAppsV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go deleted file mode 100644 index 7ea2b2e11..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/apps/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeControllerRevisions implements ControllerRevisionInterface -type FakeControllerRevisions struct { - Fake *FakeAppsV1beta1 - ns string -} - -var controllerrevisionsResource = v1beta1.SchemeGroupVersion.WithResource("controllerrevisions") - -var controllerrevisionsKind = v1beta1.SchemeGroupVersion.WithKind("ControllerRevision") - -// Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any. -func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ControllerRevision, err error) { - emptyResult := &v1beta1.ControllerRevision{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(controllerrevisionsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ControllerRevision), err -} - -// List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. -func (c *FakeControllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) { - emptyResult := &v1beta1.ControllerRevisionList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.ControllerRevisionList{ListMeta: obj.(*v1beta1.ControllerRevisionList).ListMeta} - for _, item := range obj.(*v1beta1.ControllerRevisionList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested controllerRevisions. -func (c *FakeControllerRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(controllerrevisionsResource, c.ns, opts)) - -} - -// Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any. -func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.CreateOptions) (result *v1beta1.ControllerRevision, err error) { - emptyResult := &v1beta1.ControllerRevision{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ControllerRevision), err -} - -// Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any. -func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.UpdateOptions) (result *v1beta1.ControllerRevision, err error) { - emptyResult := &v1beta1.ControllerRevision{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ControllerRevision), err -} - -// Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. -func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(controllerrevisionsResource, c.ns, name, opts), &v1beta1.ControllerRevision{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(controllerrevisionsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.ControllerRevisionList{}) - return err -} - -// Patch applies the patch and returns the patched controllerRevision. -func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ControllerRevision, err error) { - emptyResult := &v1beta1.ControllerRevision{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ControllerRevision), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied controllerRevision. -func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision *appsv1beta1.ControllerRevisionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ControllerRevision, err error) { - if controllerRevision == nil { - return nil, fmt.Errorf("controllerRevision provided to Apply must not be nil") - } - data, err := json.Marshal(controllerRevision) - if err != nil { - return nil, err - } - name := controllerRevision.Name - if name == nil { - return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply") - } - emptyResult := &v1beta1.ControllerRevision{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ControllerRevision), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go deleted file mode 100644 index 05c557ecb..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/apps/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeDeployments implements DeploymentInterface -type FakeDeployments struct { - Fake *FakeAppsV1beta1 - ns string -} - -var deploymentsResource = v1beta1.SchemeGroupVersion.WithResource("deployments") - -var deploymentsKind = v1beta1.SchemeGroupVersion.WithKind("Deployment") - -// Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. -func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) { - emptyResult := &v1beta1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(deploymentsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Deployment), err -} - -// List takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { - emptyResult := &v1beta1.DeploymentList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.DeploymentList{ListMeta: obj.(*v1beta1.DeploymentList).ListMeta} - for _, item := range obj.(*v1beta1.DeploymentList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested deployments. -func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(deploymentsResource, c.ns, opts)) - -} - -// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (result *v1beta1.Deployment, err error) { - emptyResult := &v1beta1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Deployment), err -} - -// Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { - emptyResult := &v1beta1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Deployment), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { - emptyResult := &v1beta1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "status", c.ns, deployment, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Deployment), err -} - -// Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *FakeDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(deploymentsResource, c.ns, name, opts), &v1beta1.Deployment{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(deploymentsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.DeploymentList{}) - return err -} - -// Patch applies the patch and returns the patched deployment. -func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Deployment, err error) { - emptyResult := &v1beta1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Deployment), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied deployment. -func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) { - if deployment == nil { - return nil, fmt.Errorf("deployment provided to Apply must not be nil") - } - data, err := json.Marshal(deployment) - if err != nil { - return nil, err - } - name := deployment.Name - if name == nil { - return nil, fmt.Errorf("deployment.Name must be provided to Apply") - } - emptyResult := &v1beta1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Deployment), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) { - if deployment == nil { - return nil, fmt.Errorf("deployment provided to Apply must not be nil") - } - data, err := json.Marshal(deployment) - if err != nil { - return nil, err - } - name := deployment.Name - if name == nil { - return nil, fmt.Errorf("deployment.Name must be provided to Apply") - } - emptyResult := &v1beta1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Deployment), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go deleted file mode 100644 index c38690554..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/apps/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeStatefulSets implements StatefulSetInterface -type FakeStatefulSets struct { - Fake *FakeAppsV1beta1 - ns string -} - -var statefulsetsResource = v1beta1.SchemeGroupVersion.WithResource("statefulsets") - -var statefulsetsKind = v1beta1.SchemeGroupVersion.WithKind("StatefulSet") - -// Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any. -func (c *FakeStatefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.StatefulSet, err error) { - emptyResult := &v1beta1.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(statefulsetsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.StatefulSet), err -} - -// List takes label and field selectors, and returns the list of StatefulSets that match those selectors. -func (c *FakeStatefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) { - emptyResult := &v1beta1.StatefulSetList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.StatefulSetList{ListMeta: obj.(*v1beta1.StatefulSetList).ListMeta} - for _, item := range obj.(*v1beta1.StatefulSetList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested statefulSets. -func (c *FakeStatefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(statefulsetsResource, c.ns, opts)) - -} - -// Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any. -func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.CreateOptions) (result *v1beta1.StatefulSet, err error) { - emptyResult := &v1beta1.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.StatefulSet), err -} - -// Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any. -func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (result *v1beta1.StatefulSet, err error) { - emptyResult := &v1beta1.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.StatefulSet), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (result *v1beta1.StatefulSet, err error) { - emptyResult := &v1beta1.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(statefulsetsResource, "status", c.ns, statefulSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.StatefulSet), err -} - -// Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. -func (c *FakeStatefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(statefulsetsResource, c.ns, name, opts), &v1beta1.StatefulSet{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(statefulsetsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.StatefulSetList{}) - return err -} - -// Patch applies the patch and returns the patched statefulSet. -func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StatefulSet, err error) { - emptyResult := &v1beta1.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.StatefulSet), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied statefulSet. -func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1beta1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StatefulSet, err error) { - if statefulSet == nil { - return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") - } - data, err := json.Marshal(statefulSet) - if err != nil { - return nil, err - } - name := statefulSet.Name - if name == nil { - return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") - } - emptyResult := &v1beta1.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.StatefulSet), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1beta1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StatefulSet, err error) { - if statefulSet == nil { - return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") - } - data, err := json.Marshal(statefulSet) - if err != nil { - return nil, err - } - name := statefulSet.Name - if name == nil { - return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") - } - emptyResult := &v1beta1.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.StatefulSet), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_apps_client.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_apps_client.go deleted file mode 100644 index 0ec34a2cd..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_apps_client.go +++ /dev/null @@ -1,56 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeAppsV1beta2 struct { - *testing.Fake -} - -func (c *FakeAppsV1beta2) ControllerRevisions(namespace string) v1beta2.ControllerRevisionInterface { - return &FakeControllerRevisions{c, namespace} -} - -func (c *FakeAppsV1beta2) DaemonSets(namespace string) v1beta2.DaemonSetInterface { - return &FakeDaemonSets{c, namespace} -} - -func (c *FakeAppsV1beta2) Deployments(namespace string) v1beta2.DeploymentInterface { - return &FakeDeployments{c, namespace} -} - -func (c *FakeAppsV1beta2) ReplicaSets(namespace string) v1beta2.ReplicaSetInterface { - return &FakeReplicaSets{c, namespace} -} - -func (c *FakeAppsV1beta2) StatefulSets(namespace string) v1beta2.StatefulSetInterface { - return &FakeStatefulSets{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeAppsV1beta2) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go deleted file mode 100644 index 45b205070..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta2 "k8s.io/api/apps/v1beta2" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" - testing "k8s.io/client-go/testing" -) - -// FakeControllerRevisions implements ControllerRevisionInterface -type FakeControllerRevisions struct { - Fake *FakeAppsV1beta2 - ns string -} - -var controllerrevisionsResource = v1beta2.SchemeGroupVersion.WithResource("controllerrevisions") - -var controllerrevisionsKind = v1beta2.SchemeGroupVersion.WithKind("ControllerRevision") - -// Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any. -func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ControllerRevision, err error) { - emptyResult := &v1beta2.ControllerRevision{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(controllerrevisionsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.ControllerRevision), err -} - -// List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. -func (c *FakeControllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) { - emptyResult := &v1beta2.ControllerRevisionList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta2.ControllerRevisionList{ListMeta: obj.(*v1beta2.ControllerRevisionList).ListMeta} - for _, item := range obj.(*v1beta2.ControllerRevisionList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested controllerRevisions. -func (c *FakeControllerRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(controllerrevisionsResource, c.ns, opts)) - -} - -// Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any. -func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.CreateOptions) (result *v1beta2.ControllerRevision, err error) { - emptyResult := &v1beta2.ControllerRevision{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.ControllerRevision), err -} - -// Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any. -func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.UpdateOptions) (result *v1beta2.ControllerRevision, err error) { - emptyResult := &v1beta2.ControllerRevision{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.ControllerRevision), err -} - -// Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. -func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(controllerrevisionsResource, c.ns, name, opts), &v1beta2.ControllerRevision{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(controllerrevisionsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta2.ControllerRevisionList{}) - return err -} - -// Patch applies the patch and returns the patched controllerRevision. -func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ControllerRevision, err error) { - emptyResult := &v1beta2.ControllerRevision{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.ControllerRevision), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied controllerRevision. -func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision *appsv1beta2.ControllerRevisionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ControllerRevision, err error) { - if controllerRevision == nil { - return nil, fmt.Errorf("controllerRevision provided to Apply must not be nil") - } - data, err := json.Marshal(controllerRevision) - if err != nil { - return nil, err - } - name := controllerRevision.Name - if name == nil { - return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply") - } - emptyResult := &v1beta2.ControllerRevision{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.ControllerRevision), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go deleted file mode 100644 index 61ceeb141..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta2 "k8s.io/api/apps/v1beta2" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" - testing "k8s.io/client-go/testing" -) - -// FakeDaemonSets implements DaemonSetInterface -type FakeDaemonSets struct { - Fake *FakeAppsV1beta2 - ns string -} - -var daemonsetsResource = v1beta2.SchemeGroupVersion.WithResource("daemonsets") - -var daemonsetsKind = v1beta2.SchemeGroupVersion.WithKind("DaemonSet") - -// Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any. -func (c *FakeDaemonSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.DaemonSet, err error) { - emptyResult := &v1beta2.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(daemonsetsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.DaemonSet), err -} - -// List takes label and field selectors, and returns the list of DaemonSets that match those selectors. -func (c *FakeDaemonSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DaemonSetList, err error) { - emptyResult := &v1beta2.DaemonSetList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(daemonsetsResource, daemonsetsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta2.DaemonSetList{ListMeta: obj.(*v1beta2.DaemonSetList).ListMeta} - for _, item := range obj.(*v1beta2.DaemonSetList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested daemonSets. -func (c *FakeDaemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(daemonsetsResource, c.ns, opts)) - -} - -// Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any. -func (c *FakeDaemonSets) Create(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.CreateOptions) (result *v1beta2.DaemonSet, err error) { - emptyResult := &v1beta2.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.DaemonSet), err -} - -// Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any. -func (c *FakeDaemonSets) Update(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (result *v1beta2.DaemonSet, err error) { - emptyResult := &v1beta2.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.DaemonSet), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (result *v1beta2.DaemonSet, err error) { - emptyResult := &v1beta2.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(daemonsetsResource, "status", c.ns, daemonSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.DaemonSet), err -} - -// Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. -func (c *FakeDaemonSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(daemonsetsResource, c.ns, name, opts), &v1beta2.DaemonSet{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(daemonsetsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta2.DaemonSetList{}) - return err -} - -// Patch applies the patch and returns the patched daemonSet. -func (c *FakeDaemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.DaemonSet, err error) { - emptyResult := &v1beta2.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.DaemonSet), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied daemonSet. -func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *appsv1beta2.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.DaemonSet, err error) { - if daemonSet == nil { - return nil, fmt.Errorf("daemonSet provided to Apply must not be nil") - } - data, err := json.Marshal(daemonSet) - if err != nil { - return nil, err - } - name := daemonSet.Name - if name == nil { - return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") - } - emptyResult := &v1beta2.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.DaemonSet), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *appsv1beta2.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.DaemonSet, err error) { - if daemonSet == nil { - return nil, fmt.Errorf("daemonSet provided to Apply must not be nil") - } - data, err := json.Marshal(daemonSet) - if err != nil { - return nil, err - } - name := daemonSet.Name - if name == nil { - return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") - } - emptyResult := &v1beta2.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.DaemonSet), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go deleted file mode 100644 index d849856a4..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta2 "k8s.io/api/apps/v1beta2" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" - testing "k8s.io/client-go/testing" -) - -// FakeDeployments implements DeploymentInterface -type FakeDeployments struct { - Fake *FakeAppsV1beta2 - ns string -} - -var deploymentsResource = v1beta2.SchemeGroupVersion.WithResource("deployments") - -var deploymentsKind = v1beta2.SchemeGroupVersion.WithKind("Deployment") - -// Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. -func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.Deployment, err error) { - emptyResult := &v1beta2.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(deploymentsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.Deployment), err -} - -// List takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) { - emptyResult := &v1beta2.DeploymentList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta2.DeploymentList{ListMeta: obj.(*v1beta2.DeploymentList).ListMeta} - for _, item := range obj.(*v1beta2.DeploymentList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested deployments. -func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(deploymentsResource, c.ns, opts)) - -} - -// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta2.Deployment, opts v1.CreateOptions) (result *v1beta2.Deployment, err error) { - emptyResult := &v1beta2.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.Deployment), err -} - -// Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (result *v1beta2.Deployment, err error) { - emptyResult := &v1beta2.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.Deployment), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (result *v1beta2.Deployment, err error) { - emptyResult := &v1beta2.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "status", c.ns, deployment, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.Deployment), err -} - -// Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *FakeDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(deploymentsResource, c.ns, name, opts), &v1beta2.Deployment{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(deploymentsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta2.DeploymentList{}) - return err -} - -// Patch applies the patch and returns the patched deployment. -func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Deployment, err error) { - emptyResult := &v1beta2.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.Deployment), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied deployment. -func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1beta2.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Deployment, err error) { - if deployment == nil { - return nil, fmt.Errorf("deployment provided to Apply must not be nil") - } - data, err := json.Marshal(deployment) - if err != nil { - return nil, err - } - name := deployment.Name - if name == nil { - return nil, fmt.Errorf("deployment.Name must be provided to Apply") - } - emptyResult := &v1beta2.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.Deployment), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1beta2.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Deployment, err error) { - if deployment == nil { - return nil, fmt.Errorf("deployment provided to Apply must not be nil") - } - data, err := json.Marshal(deployment) - if err != nil { - return nil, err - } - name := deployment.Name - if name == nil { - return nil, fmt.Errorf("deployment.Name must be provided to Apply") - } - emptyResult := &v1beta2.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.Deployment), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go deleted file mode 100644 index 1f957f084..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta2 "k8s.io/api/apps/v1beta2" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" - testing "k8s.io/client-go/testing" -) - -// FakeReplicaSets implements ReplicaSetInterface -type FakeReplicaSets struct { - Fake *FakeAppsV1beta2 - ns string -} - -var replicasetsResource = v1beta2.SchemeGroupVersion.WithResource("replicasets") - -var replicasetsKind = v1beta2.SchemeGroupVersion.WithKind("ReplicaSet") - -// Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. -func (c *FakeReplicaSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ReplicaSet, err error) { - emptyResult := &v1beta2.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(replicasetsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.ReplicaSet), err -} - -// List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. -func (c *FakeReplicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) { - emptyResult := &v1beta2.ReplicaSetList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(replicasetsResource, replicasetsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta2.ReplicaSetList{ListMeta: obj.(*v1beta2.ReplicaSetList).ListMeta} - for _, item := range obj.(*v1beta2.ReplicaSetList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested replicaSets. -func (c *FakeReplicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(replicasetsResource, c.ns, opts)) - -} - -// Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.CreateOptions) (result *v1beta2.ReplicaSet, err error) { - emptyResult := &v1beta2.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.ReplicaSet), err -} - -// Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (result *v1beta2.ReplicaSet, err error) { - emptyResult := &v1beta2.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.ReplicaSet), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (result *v1beta2.ReplicaSet, err error) { - emptyResult := &v1beta2.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(replicasetsResource, "status", c.ns, replicaSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.ReplicaSet), err -} - -// Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. -func (c *FakeReplicaSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(replicasetsResource, c.ns, name, opts), &v1beta2.ReplicaSet{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(replicasetsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta2.ReplicaSetList{}) - return err -} - -// Patch applies the patch and returns the patched replicaSet. -func (c *FakeReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ReplicaSet, err error) { - emptyResult := &v1beta2.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.ReplicaSet), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied replicaSet. -func (c *FakeReplicaSets) Apply(ctx context.Context, replicaSet *appsv1beta2.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ReplicaSet, err error) { - if replicaSet == nil { - return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") - } - data, err := json.Marshal(replicaSet) - if err != nil { - return nil, err - } - name := replicaSet.Name - if name == nil { - return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") - } - emptyResult := &v1beta2.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.ReplicaSet), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *appsv1beta2.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ReplicaSet, err error) { - if replicaSet == nil { - return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") - } - data, err := json.Marshal(replicaSet) - if err != nil { - return nil, err - } - name := replicaSet.Name - if name == nil { - return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") - } - emptyResult := &v1beta2.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.ReplicaSet), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go deleted file mode 100644 index ac8945aa7..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go +++ /dev/null @@ -1,241 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta2 "k8s.io/api/apps/v1beta2" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" - testing "k8s.io/client-go/testing" -) - -// FakeStatefulSets implements StatefulSetInterface -type FakeStatefulSets struct { - Fake *FakeAppsV1beta2 - ns string -} - -var statefulsetsResource = v1beta2.SchemeGroupVersion.WithResource("statefulsets") - -var statefulsetsKind = v1beta2.SchemeGroupVersion.WithKind("StatefulSet") - -// Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any. -func (c *FakeStatefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.StatefulSet, err error) { - emptyResult := &v1beta2.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(statefulsetsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.StatefulSet), err -} - -// List takes label and field selectors, and returns the list of StatefulSets that match those selectors. -func (c *FakeStatefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) { - emptyResult := &v1beta2.StatefulSetList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta2.StatefulSetList{ListMeta: obj.(*v1beta2.StatefulSetList).ListMeta} - for _, item := range obj.(*v1beta2.StatefulSetList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested statefulSets. -func (c *FakeStatefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(statefulsetsResource, c.ns, opts)) - -} - -// Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any. -func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.CreateOptions) (result *v1beta2.StatefulSet, err error) { - emptyResult := &v1beta2.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.StatefulSet), err -} - -// Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any. -func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (result *v1beta2.StatefulSet, err error) { - emptyResult := &v1beta2.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.StatefulSet), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (result *v1beta2.StatefulSet, err error) { - emptyResult := &v1beta2.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(statefulsetsResource, "status", c.ns, statefulSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.StatefulSet), err -} - -// Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. -func (c *FakeStatefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(statefulsetsResource, c.ns, name, opts), &v1beta2.StatefulSet{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(statefulsetsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta2.StatefulSetList{}) - return err -} - -// Patch applies the patch and returns the patched statefulSet. -func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.StatefulSet, err error) { - emptyResult := &v1beta2.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.StatefulSet), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied statefulSet. -func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1beta2.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.StatefulSet, err error) { - if statefulSet == nil { - return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") - } - data, err := json.Marshal(statefulSet) - if err != nil { - return nil, err - } - name := statefulSet.Name - if name == nil { - return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") - } - emptyResult := &v1beta2.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.StatefulSet), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1beta2.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.StatefulSet, err error) { - if statefulSet == nil { - return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") - } - data, err := json.Marshal(statefulSet) - if err != nil { - return nil, err - } - name := statefulSet.Name - if name == nil { - return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") - } - emptyResult := &v1beta2.StatefulSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.StatefulSet), err -} - -// GetScale takes name of the statefulSet, and returns the corresponding scale object, and an error if there is any. -func (c *FakeStatefulSets) GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (result *v1beta2.Scale, err error) { - emptyResult := &v1beta2.Scale{} - obj, err := c.Fake. - Invokes(testing.NewGetSubresourceActionWithOptions(statefulsetsResource, c.ns, "scale", statefulSetName, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.Scale), err -} - -// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *FakeStatefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *v1beta2.Scale, opts v1.UpdateOptions) (result *v1beta2.Scale, err error) { - emptyResult := &v1beta2.Scale{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(statefulsetsResource, "scale", c.ns, scale, opts), &v1beta2.Scale{}) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.Scale), err -} - -// ApplyScale takes top resource name and the apply declarative configuration for scale, -// applies it and returns the applied scale, and an error, if there is any. -func (c *FakeStatefulSets) ApplyScale(ctx context.Context, statefulSetName string, scale *appsv1beta2.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Scale, err error) { - if scale == nil { - return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") - } - data, err := json.Marshal(scale) - if err != nil { - return nil, err - } - emptyResult := &v1beta2.Scale{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.Scale), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_authentication_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_authentication_client.go deleted file mode 100644 index 865239ff6..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_authentication_client.go +++ /dev/null @@ -1,44 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/client-go/kubernetes/typed/authentication/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeAuthenticationV1 struct { - *testing.Fake -} - -func (c *FakeAuthenticationV1) SelfSubjectReviews() v1.SelfSubjectReviewInterface { - return &FakeSelfSubjectReviews{c} -} - -func (c *FakeAuthenticationV1) TokenReviews() v1.TokenReviewInterface { - return &FakeTokenReviews{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeAuthenticationV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_selfsubjectreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_selfsubjectreview.go deleted file mode 100644 index 7e7c3138a..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_selfsubjectreview.go +++ /dev/null @@ -1,47 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1 "k8s.io/api/authentication/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" -) - -// FakeSelfSubjectReviews implements SelfSubjectReviewInterface -type FakeSelfSubjectReviews struct { - Fake *FakeAuthenticationV1 -} - -var selfsubjectreviewsResource = v1.SchemeGroupVersion.WithResource("selfsubjectreviews") - -var selfsubjectreviewsKind = v1.SchemeGroupVersion.WithKind("SelfSubjectReview") - -// Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any. -func (c *FakeSelfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1.SelfSubjectReview, opts metav1.CreateOptions) (result *v1.SelfSubjectReview, err error) { - emptyResult := &v1.SelfSubjectReview{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(selfsubjectreviewsResource, selfSubjectReview, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.SelfSubjectReview), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go deleted file mode 100644 index a22f33542..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go +++ /dev/null @@ -1,47 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1 "k8s.io/api/authentication/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" -) - -// FakeTokenReviews implements TokenReviewInterface -type FakeTokenReviews struct { - Fake *FakeAuthenticationV1 -} - -var tokenreviewsResource = v1.SchemeGroupVersion.WithResource("tokenreviews") - -var tokenreviewsKind = v1.SchemeGroupVersion.WithKind("TokenReview") - -// Create takes the representation of a tokenReview and creates it. Returns the server's representation of the tokenReview, and an error, if there is any. -func (c *FakeTokenReviews) Create(ctx context.Context, tokenReview *v1.TokenReview, opts metav1.CreateOptions) (result *v1.TokenReview, err error) { - emptyResult := &v1.TokenReview{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(tokenreviewsResource, tokenReview, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.TokenReview), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake/fake_authentication_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake/fake_authentication_client.go deleted file mode 100644 index 1a1a04f41..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake/fake_authentication_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha1 "k8s.io/client-go/kubernetes/typed/authentication/v1alpha1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeAuthenticationV1alpha1 struct { - *testing.Fake -} - -func (c *FakeAuthenticationV1alpha1) SelfSubjectReviews() v1alpha1.SelfSubjectReviewInterface { - return &FakeSelfSubjectReviews{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeAuthenticationV1alpha1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake/fake_selfsubjectreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake/fake_selfsubjectreview.go deleted file mode 100644 index 680460f45..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake/fake_selfsubjectreview.go +++ /dev/null @@ -1,47 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1alpha1 "k8s.io/api/authentication/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" -) - -// FakeSelfSubjectReviews implements SelfSubjectReviewInterface -type FakeSelfSubjectReviews struct { - Fake *FakeAuthenticationV1alpha1 -} - -var selfsubjectreviewsResource = v1alpha1.SchemeGroupVersion.WithResource("selfsubjectreviews") - -var selfsubjectreviewsKind = v1alpha1.SchemeGroupVersion.WithKind("SelfSubjectReview") - -// Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any. -func (c *FakeSelfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1alpha1.SelfSubjectReview, opts v1.CreateOptions) (result *v1alpha1.SelfSubjectReview, err error) { - emptyResult := &v1alpha1.SelfSubjectReview{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(selfsubjectreviewsResource, selfSubjectReview, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.SelfSubjectReview), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_authentication_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_authentication_client.go deleted file mode 100644 index 1d72cf22f..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_authentication_client.go +++ /dev/null @@ -1,44 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "k8s.io/client-go/kubernetes/typed/authentication/v1beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeAuthenticationV1beta1 struct { - *testing.Fake -} - -func (c *FakeAuthenticationV1beta1) SelfSubjectReviews() v1beta1.SelfSubjectReviewInterface { - return &FakeSelfSubjectReviews{c} -} - -func (c *FakeAuthenticationV1beta1) TokenReviews() v1beta1.TokenReviewInterface { - return &FakeTokenReviews{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeAuthenticationV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_selfsubjectreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_selfsubjectreview.go deleted file mode 100644 index 33e130e9c..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_selfsubjectreview.go +++ /dev/null @@ -1,47 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1beta1 "k8s.io/api/authentication/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" -) - -// FakeSelfSubjectReviews implements SelfSubjectReviewInterface -type FakeSelfSubjectReviews struct { - Fake *FakeAuthenticationV1beta1 -} - -var selfsubjectreviewsResource = v1beta1.SchemeGroupVersion.WithResource("selfsubjectreviews") - -var selfsubjectreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SelfSubjectReview") - -// Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any. -func (c *FakeSelfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1beta1.SelfSubjectReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectReview, err error) { - emptyResult := &v1beta1.SelfSubjectReview{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(selfsubjectreviewsResource, selfSubjectReview, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.SelfSubjectReview), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go deleted file mode 100644 index b512f5c14..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go +++ /dev/null @@ -1,47 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1beta1 "k8s.io/api/authentication/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" -) - -// FakeTokenReviews implements TokenReviewInterface -type FakeTokenReviews struct { - Fake *FakeAuthenticationV1beta1 -} - -var tokenreviewsResource = v1beta1.SchemeGroupVersion.WithResource("tokenreviews") - -var tokenreviewsKind = v1beta1.SchemeGroupVersion.WithKind("TokenReview") - -// Create takes the representation of a tokenReview and creates it. Returns the server's representation of the tokenReview, and an error, if there is any. -func (c *FakeTokenReviews) Create(ctx context.Context, tokenReview *v1beta1.TokenReview, opts v1.CreateOptions) (result *v1beta1.TokenReview, err error) { - emptyResult := &v1beta1.TokenReview{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(tokenreviewsResource, tokenReview, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.TokenReview), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_authorization_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_authorization_client.go deleted file mode 100644 index f7e823450..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_authorization_client.go +++ /dev/null @@ -1,52 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/client-go/kubernetes/typed/authorization/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeAuthorizationV1 struct { - *testing.Fake -} - -func (c *FakeAuthorizationV1) LocalSubjectAccessReviews(namespace string) v1.LocalSubjectAccessReviewInterface { - return &FakeLocalSubjectAccessReviews{c, namespace} -} - -func (c *FakeAuthorizationV1) SelfSubjectAccessReviews() v1.SelfSubjectAccessReviewInterface { - return &FakeSelfSubjectAccessReviews{c} -} - -func (c *FakeAuthorizationV1) SelfSubjectRulesReviews() v1.SelfSubjectRulesReviewInterface { - return &FakeSelfSubjectRulesReviews{c} -} - -func (c *FakeAuthorizationV1) SubjectAccessReviews() v1.SubjectAccessReviewInterface { - return &FakeSubjectAccessReviews{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeAuthorizationV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go deleted file mode 100644 index dd23481d3..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go +++ /dev/null @@ -1,49 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1 "k8s.io/api/authorization/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" -) - -// FakeLocalSubjectAccessReviews implements LocalSubjectAccessReviewInterface -type FakeLocalSubjectAccessReviews struct { - Fake *FakeAuthorizationV1 - ns string -} - -var localsubjectaccessreviewsResource = v1.SchemeGroupVersion.WithResource("localsubjectaccessreviews") - -var localsubjectaccessreviewsKind = v1.SchemeGroupVersion.WithKind("LocalSubjectAccessReview") - -// Create takes the representation of a localSubjectAccessReview and creates it. Returns the server's representation of the localSubjectAccessReview, and an error, if there is any. -func (c *FakeLocalSubjectAccessReviews) Create(ctx context.Context, localSubjectAccessReview *v1.LocalSubjectAccessReview, opts metav1.CreateOptions) (result *v1.LocalSubjectAccessReview, err error) { - emptyResult := &v1.LocalSubjectAccessReview{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(localsubjectaccessreviewsResource, c.ns, localSubjectAccessReview, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.LocalSubjectAccessReview), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go deleted file mode 100644 index d04b8502f..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go +++ /dev/null @@ -1,47 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1 "k8s.io/api/authorization/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" -) - -// FakeSelfSubjectAccessReviews implements SelfSubjectAccessReviewInterface -type FakeSelfSubjectAccessReviews struct { - Fake *FakeAuthorizationV1 -} - -var selfsubjectaccessreviewsResource = v1.SchemeGroupVersion.WithResource("selfsubjectaccessreviews") - -var selfsubjectaccessreviewsKind = v1.SchemeGroupVersion.WithKind("SelfSubjectAccessReview") - -// Create takes the representation of a selfSubjectAccessReview and creates it. Returns the server's representation of the selfSubjectAccessReview, and an error, if there is any. -func (c *FakeSelfSubjectAccessReviews) Create(ctx context.Context, selfSubjectAccessReview *v1.SelfSubjectAccessReview, opts metav1.CreateOptions) (result *v1.SelfSubjectAccessReview, err error) { - emptyResult := &v1.SelfSubjectAccessReview{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(selfsubjectaccessreviewsResource, selfSubjectAccessReview, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.SelfSubjectAccessReview), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go deleted file mode 100644 index 71ed326f8..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go +++ /dev/null @@ -1,47 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1 "k8s.io/api/authorization/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" -) - -// FakeSelfSubjectRulesReviews implements SelfSubjectRulesReviewInterface -type FakeSelfSubjectRulesReviews struct { - Fake *FakeAuthorizationV1 -} - -var selfsubjectrulesreviewsResource = v1.SchemeGroupVersion.WithResource("selfsubjectrulesreviews") - -var selfsubjectrulesreviewsKind = v1.SchemeGroupVersion.WithKind("SelfSubjectRulesReview") - -// Create takes the representation of a selfSubjectRulesReview and creates it. Returns the server's representation of the selfSubjectRulesReview, and an error, if there is any. -func (c *FakeSelfSubjectRulesReviews) Create(ctx context.Context, selfSubjectRulesReview *v1.SelfSubjectRulesReview, opts metav1.CreateOptions) (result *v1.SelfSubjectRulesReview, err error) { - emptyResult := &v1.SelfSubjectRulesReview{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(selfsubjectrulesreviewsResource, selfSubjectRulesReview, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.SelfSubjectRulesReview), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go deleted file mode 100644 index 358ba9aa7..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go +++ /dev/null @@ -1,47 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1 "k8s.io/api/authorization/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" -) - -// FakeSubjectAccessReviews implements SubjectAccessReviewInterface -type FakeSubjectAccessReviews struct { - Fake *FakeAuthorizationV1 -} - -var subjectaccessreviewsResource = v1.SchemeGroupVersion.WithResource("subjectaccessreviews") - -var subjectaccessreviewsKind = v1.SchemeGroupVersion.WithKind("SubjectAccessReview") - -// Create takes the representation of a subjectAccessReview and creates it. Returns the server's representation of the subjectAccessReview, and an error, if there is any. -func (c *FakeSubjectAccessReviews) Create(ctx context.Context, subjectAccessReview *v1.SubjectAccessReview, opts metav1.CreateOptions) (result *v1.SubjectAccessReview, err error) { - emptyResult := &v1.SubjectAccessReview{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(subjectaccessreviewsResource, subjectAccessReview, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.SubjectAccessReview), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_authorization_client.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_authorization_client.go deleted file mode 100644 index 8e328a57b..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_authorization_client.go +++ /dev/null @@ -1,52 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "k8s.io/client-go/kubernetes/typed/authorization/v1beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeAuthorizationV1beta1 struct { - *testing.Fake -} - -func (c *FakeAuthorizationV1beta1) LocalSubjectAccessReviews(namespace string) v1beta1.LocalSubjectAccessReviewInterface { - return &FakeLocalSubjectAccessReviews{c, namespace} -} - -func (c *FakeAuthorizationV1beta1) SelfSubjectAccessReviews() v1beta1.SelfSubjectAccessReviewInterface { - return &FakeSelfSubjectAccessReviews{c} -} - -func (c *FakeAuthorizationV1beta1) SelfSubjectRulesReviews() v1beta1.SelfSubjectRulesReviewInterface { - return &FakeSelfSubjectRulesReviews{c} -} - -func (c *FakeAuthorizationV1beta1) SubjectAccessReviews() v1beta1.SubjectAccessReviewInterface { - return &FakeSubjectAccessReviews{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeAuthorizationV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go deleted file mode 100644 index e2bf62773..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go +++ /dev/null @@ -1,49 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1beta1 "k8s.io/api/authorization/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" -) - -// FakeLocalSubjectAccessReviews implements LocalSubjectAccessReviewInterface -type FakeLocalSubjectAccessReviews struct { - Fake *FakeAuthorizationV1beta1 - ns string -} - -var localsubjectaccessreviewsResource = v1beta1.SchemeGroupVersion.WithResource("localsubjectaccessreviews") - -var localsubjectaccessreviewsKind = v1beta1.SchemeGroupVersion.WithKind("LocalSubjectAccessReview") - -// Create takes the representation of a localSubjectAccessReview and creates it. Returns the server's representation of the localSubjectAccessReview, and an error, if there is any. -func (c *FakeLocalSubjectAccessReviews) Create(ctx context.Context, localSubjectAccessReview *v1beta1.LocalSubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.LocalSubjectAccessReview, err error) { - emptyResult := &v1beta1.LocalSubjectAccessReview{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(localsubjectaccessreviewsResource, c.ns, localSubjectAccessReview, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.LocalSubjectAccessReview), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go deleted file mode 100644 index 996e4d410..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go +++ /dev/null @@ -1,47 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1beta1 "k8s.io/api/authorization/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" -) - -// FakeSelfSubjectAccessReviews implements SelfSubjectAccessReviewInterface -type FakeSelfSubjectAccessReviews struct { - Fake *FakeAuthorizationV1beta1 -} - -var selfsubjectaccessreviewsResource = v1beta1.SchemeGroupVersion.WithResource("selfsubjectaccessreviews") - -var selfsubjectaccessreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SelfSubjectAccessReview") - -// Create takes the representation of a selfSubjectAccessReview and creates it. Returns the server's representation of the selfSubjectAccessReview, and an error, if there is any. -func (c *FakeSelfSubjectAccessReviews) Create(ctx context.Context, selfSubjectAccessReview *v1beta1.SelfSubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectAccessReview, err error) { - emptyResult := &v1beta1.SelfSubjectAccessReview{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(selfsubjectaccessreviewsResource, selfSubjectAccessReview, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.SelfSubjectAccessReview), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go deleted file mode 100644 index 6e4c75890..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go +++ /dev/null @@ -1,47 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1beta1 "k8s.io/api/authorization/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" -) - -// FakeSelfSubjectRulesReviews implements SelfSubjectRulesReviewInterface -type FakeSelfSubjectRulesReviews struct { - Fake *FakeAuthorizationV1beta1 -} - -var selfsubjectrulesreviewsResource = v1beta1.SchemeGroupVersion.WithResource("selfsubjectrulesreviews") - -var selfsubjectrulesreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SelfSubjectRulesReview") - -// Create takes the representation of a selfSubjectRulesReview and creates it. Returns the server's representation of the selfSubjectRulesReview, and an error, if there is any. -func (c *FakeSelfSubjectRulesReviews) Create(ctx context.Context, selfSubjectRulesReview *v1beta1.SelfSubjectRulesReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectRulesReview, err error) { - emptyResult := &v1beta1.SelfSubjectRulesReview{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(selfsubjectrulesreviewsResource, selfSubjectRulesReview, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.SelfSubjectRulesReview), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go deleted file mode 100644 index aab6e08dc..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go +++ /dev/null @@ -1,47 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1beta1 "k8s.io/api/authorization/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" -) - -// FakeSubjectAccessReviews implements SubjectAccessReviewInterface -type FakeSubjectAccessReviews struct { - Fake *FakeAuthorizationV1beta1 -} - -var subjectaccessreviewsResource = v1beta1.SchemeGroupVersion.WithResource("subjectaccessreviews") - -var subjectaccessreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SubjectAccessReview") - -// Create takes the representation of a subjectAccessReview and creates it. Returns the server's representation of the subjectAccessReview, and an error, if there is any. -func (c *FakeSubjectAccessReviews) Create(ctx context.Context, subjectAccessReview *v1beta1.SubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.SubjectAccessReview, err error) { - emptyResult := &v1beta1.SubjectAccessReview{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(subjectaccessreviewsResource, subjectAccessReview, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.SubjectAccessReview), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_autoscaling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_autoscaling_client.go deleted file mode 100644 index 99e26fcf3..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_autoscaling_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/client-go/kubernetes/typed/autoscaling/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeAutoscalingV1 struct { - *testing.Fake -} - -func (c *FakeAutoscalingV1) HorizontalPodAutoscalers(namespace string) v1.HorizontalPodAutoscalerInterface { - return &FakeHorizontalPodAutoscalers{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeAutoscalingV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go deleted file mode 100644 index 23e2c391d..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/autoscaling/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - autoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" - testing "k8s.io/client-go/testing" -) - -// FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface -type FakeHorizontalPodAutoscalers struct { - Fake *FakeAutoscalingV1 - ns string -} - -var horizontalpodautoscalersResource = v1.SchemeGroupVersion.WithResource("horizontalpodautoscalers") - -var horizontalpodautoscalersKind = v1.SchemeGroupVersion.WithKind("HorizontalPodAutoscaler") - -// Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. -func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HorizontalPodAutoscaler, err error) { - emptyResult := &v1.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(horizontalpodautoscalersResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.HorizontalPodAutoscaler), err -} - -// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) { - emptyResult := &v1.HorizontalPodAutoscalerList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.HorizontalPodAutoscalerList{ListMeta: obj.(*v1.HorizontalPodAutoscalerList).ListMeta} - for _, item := range obj.(*v1.HorizontalPodAutoscalerList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. -func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(horizontalpodautoscalersResource, c.ns, opts)) - -} - -// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.CreateOptions) (result *v1.HorizontalPodAutoscaler, err error) { - emptyResult := &v1.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.HorizontalPodAutoscaler), err -} - -// Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (result *v1.HorizontalPodAutoscaler, err error) { - emptyResult := &v1.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.HorizontalPodAutoscaler), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (result *v1.HorizontalPodAutoscaler, err error) { - emptyResult := &v1.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.HorizontalPodAutoscaler), err -} - -// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. -func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(horizontalpodautoscalersResource, c.ns, name, opts), &v1.HorizontalPodAutoscaler{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(horizontalpodautoscalersResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.HorizontalPodAutoscalerList{}) - return err -} - -// Patch applies the patch and returns the patched horizontalPodAutoscaler. -func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) { - emptyResult := &v1.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.HorizontalPodAutoscaler), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied horizontalPodAutoscaler. -func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscalerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HorizontalPodAutoscaler, err error) { - if horizontalPodAutoscaler == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") - } - data, err := json.Marshal(horizontalPodAutoscaler) - if err != nil { - return nil, err - } - name := horizontalPodAutoscaler.Name - if name == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") - } - emptyResult := &v1.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.HorizontalPodAutoscaler), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscalerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HorizontalPodAutoscaler, err error) { - if horizontalPodAutoscaler == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") - } - data, err := json.Marshal(horizontalPodAutoscaler) - if err != nil { - return nil, err - } - name := horizontalPodAutoscaler.Name - if name == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") - } - emptyResult := &v1.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.HorizontalPodAutoscaler), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2/fake/fake_autoscaling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2/fake/fake_autoscaling_client.go deleted file mode 100644 index d4b907f4b..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2/fake/fake_autoscaling_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeAutoscalingV2 struct { - *testing.Fake -} - -func (c *FakeAutoscalingV2) HorizontalPodAutoscalers(namespace string) v2.HorizontalPodAutoscalerInterface { - return &FakeHorizontalPodAutoscalers{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeAutoscalingV2) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2/fake/fake_horizontalpodautoscaler.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2/fake/fake_horizontalpodautoscaler.go deleted file mode 100644 index 2ca3d27c9..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2/fake/fake_horizontalpodautoscaler.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v2 "k8s.io/api/autoscaling/v2" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - autoscalingv2 "k8s.io/client-go/applyconfigurations/autoscaling/v2" - testing "k8s.io/client-go/testing" -) - -// FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface -type FakeHorizontalPodAutoscalers struct { - Fake *FakeAutoscalingV2 - ns string -} - -var horizontalpodautoscalersResource = v2.SchemeGroupVersion.WithResource("horizontalpodautoscalers") - -var horizontalpodautoscalersKind = v2.SchemeGroupVersion.WithKind("HorizontalPodAutoscaler") - -// Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. -func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.HorizontalPodAutoscaler, err error) { - emptyResult := &v2.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(horizontalpodautoscalersResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2.HorizontalPodAutoscaler), err -} - -// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2.HorizontalPodAutoscalerList, err error) { - emptyResult := &v2.HorizontalPodAutoscalerList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v2.HorizontalPodAutoscalerList{ListMeta: obj.(*v2.HorizontalPodAutoscalerList).ListMeta} - for _, item := range obj.(*v2.HorizontalPodAutoscalerList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. -func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(horizontalpodautoscalersResource, c.ns, opts)) - -} - -// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2.HorizontalPodAutoscaler, err error) { - emptyResult := &v2.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2.HorizontalPodAutoscaler), err -} - -// Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2.HorizontalPodAutoscaler, err error) { - emptyResult := &v2.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2.HorizontalPodAutoscaler), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2.HorizontalPodAutoscaler, err error) { - emptyResult := &v2.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2.HorizontalPodAutoscaler), err -} - -// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. -func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(horizontalpodautoscalersResource, c.ns, name, opts), &v2.HorizontalPodAutoscaler{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(horizontalpodautoscalersResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v2.HorizontalPodAutoscalerList{}) - return err -} - -// Patch applies the patch and returns the patched horizontalPodAutoscaler. -func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.HorizontalPodAutoscaler, err error) { - emptyResult := &v2.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2.HorizontalPodAutoscaler), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied horizontalPodAutoscaler. -func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2.HorizontalPodAutoscaler, err error) { - if horizontalPodAutoscaler == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") - } - data, err := json.Marshal(horizontalPodAutoscaler) - if err != nil { - return nil, err - } - name := horizontalPodAutoscaler.Name - if name == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") - } - emptyResult := &v2.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2.HorizontalPodAutoscaler), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2.HorizontalPodAutoscaler, err error) { - if horizontalPodAutoscaler == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") - } - data, err := json.Marshal(horizontalPodAutoscaler) - if err != nil { - return nil, err - } - name := horizontalPodAutoscaler.Name - if name == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") - } - emptyResult := &v2.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2.HorizontalPodAutoscaler), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_autoscaling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_autoscaling_client.go deleted file mode 100644 index be8e0f48e..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_autoscaling_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v2beta1 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeAutoscalingV2beta1 struct { - *testing.Fake -} - -func (c *FakeAutoscalingV2beta1) HorizontalPodAutoscalers(namespace string) v2beta1.HorizontalPodAutoscalerInterface { - return &FakeHorizontalPodAutoscalers{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeAutoscalingV2beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go deleted file mode 100644 index 7f99b5e8f..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v2beta1 "k8s.io/api/autoscaling/v2beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - autoscalingv2beta1 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta1" - testing "k8s.io/client-go/testing" -) - -// FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface -type FakeHorizontalPodAutoscalers struct { - Fake *FakeAutoscalingV2beta1 - ns string -} - -var horizontalpodautoscalersResource = v2beta1.SchemeGroupVersion.WithResource("horizontalpodautoscalers") - -var horizontalpodautoscalersKind = v2beta1.SchemeGroupVersion.WithKind("HorizontalPodAutoscaler") - -// Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. -func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { - emptyResult := &v2beta1.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(horizontalpodautoscalersResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2beta1.HorizontalPodAutoscaler), err -} - -// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta1.HorizontalPodAutoscalerList, err error) { - emptyResult := &v2beta1.HorizontalPodAutoscalerList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v2beta1.HorizontalPodAutoscalerList{ListMeta: obj.(*v2beta1.HorizontalPodAutoscalerList).ListMeta} - for _, item := range obj.(*v2beta1.HorizontalPodAutoscalerList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. -func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(horizontalpodautoscalersResource, c.ns, opts)) - -} - -// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { - emptyResult := &v2beta1.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2beta1.HorizontalPodAutoscaler), err -} - -// Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { - emptyResult := &v2beta1.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2beta1.HorizontalPodAutoscaler), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { - emptyResult := &v2beta1.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2beta1.HorizontalPodAutoscaler), err -} - -// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. -func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(horizontalpodautoscalersResource, c.ns, name, opts), &v2beta1.HorizontalPodAutoscaler{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(horizontalpodautoscalersResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v2beta1.HorizontalPodAutoscalerList{}) - return err -} - -// Patch applies the patch and returns the patched horizontalPodAutoscaler. -func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta1.HorizontalPodAutoscaler, err error) { - emptyResult := &v2beta1.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2beta1.HorizontalPodAutoscaler), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied horizontalPodAutoscaler. -func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { - if horizontalPodAutoscaler == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") - } - data, err := json.Marshal(horizontalPodAutoscaler) - if err != nil { - return nil, err - } - name := horizontalPodAutoscaler.Name - if name == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") - } - emptyResult := &v2beta1.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2beta1.HorizontalPodAutoscaler), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { - if horizontalPodAutoscaler == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") - } - data, err := json.Marshal(horizontalPodAutoscaler) - if err != nil { - return nil, err - } - name := horizontalPodAutoscaler.Name - if name == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") - } - emptyResult := &v2beta1.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2beta1.HorizontalPodAutoscaler), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/fake_autoscaling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/fake_autoscaling_client.go deleted file mode 100644 index 8c36e0e81..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/fake_autoscaling_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v2beta2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeAutoscalingV2beta2 struct { - *testing.Fake -} - -func (c *FakeAutoscalingV2beta2) HorizontalPodAutoscalers(namespace string) v2beta2.HorizontalPodAutoscalerInterface { - return &FakeHorizontalPodAutoscalers{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeAutoscalingV2beta2) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/fake_horizontalpodautoscaler.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/fake_horizontalpodautoscaler.go deleted file mode 100644 index e037e8ac4..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/fake_horizontalpodautoscaler.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v2beta2 "k8s.io/api/autoscaling/v2beta2" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - autoscalingv2beta2 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta2" - testing "k8s.io/client-go/testing" -) - -// FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface -type FakeHorizontalPodAutoscalers struct { - Fake *FakeAutoscalingV2beta2 - ns string -} - -var horizontalpodautoscalersResource = v2beta2.SchemeGroupVersion.WithResource("horizontalpodautoscalers") - -var horizontalpodautoscalersKind = v2beta2.SchemeGroupVersion.WithKind("HorizontalPodAutoscaler") - -// Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. -func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { - emptyResult := &v2beta2.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(horizontalpodautoscalersResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2beta2.HorizontalPodAutoscaler), err -} - -// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) { - emptyResult := &v2beta2.HorizontalPodAutoscalerList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v2beta2.HorizontalPodAutoscalerList{ListMeta: obj.(*v2beta2.HorizontalPodAutoscalerList).ListMeta} - for _, item := range obj.(*v2beta2.HorizontalPodAutoscalerList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. -func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(horizontalpodautoscalersResource, c.ns, opts)) - -} - -// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { - emptyResult := &v2beta2.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2beta2.HorizontalPodAutoscaler), err -} - -// Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { - emptyResult := &v2beta2.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2beta2.HorizontalPodAutoscaler), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { - emptyResult := &v2beta2.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2beta2.HorizontalPodAutoscaler), err -} - -// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. -func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(horizontalpodautoscalersResource, c.ns, name, opts), &v2beta2.HorizontalPodAutoscaler{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(horizontalpodautoscalersResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v2beta2.HorizontalPodAutoscalerList{}) - return err -} - -// Patch applies the patch and returns the patched horizontalPodAutoscaler. -func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.HorizontalPodAutoscaler, err error) { - emptyResult := &v2beta2.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2beta2.HorizontalPodAutoscaler), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied horizontalPodAutoscaler. -func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { - if horizontalPodAutoscaler == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") - } - data, err := json.Marshal(horizontalPodAutoscaler) - if err != nil { - return nil, err - } - name := horizontalPodAutoscaler.Name - if name == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") - } - emptyResult := &v2beta2.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2beta2.HorizontalPodAutoscaler), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { - if horizontalPodAutoscaler == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") - } - data, err := json.Marshal(horizontalPodAutoscaler) - if err != nil { - return nil, err - } - name := horizontalPodAutoscaler.Name - if name == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") - } - emptyResult := &v2beta2.HorizontalPodAutoscaler{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v2beta2.HorizontalPodAutoscaler), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_batch_client.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_batch_client.go deleted file mode 100644 index 43d5b0d30..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_batch_client.go +++ /dev/null @@ -1,44 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/client-go/kubernetes/typed/batch/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeBatchV1 struct { - *testing.Fake -} - -func (c *FakeBatchV1) CronJobs(namespace string) v1.CronJobInterface { - return &FakeCronJobs{c, namespace} -} - -func (c *FakeBatchV1) Jobs(namespace string) v1.JobInterface { - return &FakeJobs{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeBatchV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_cronjob.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_cronjob.go deleted file mode 100644 index 171bb8232..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_cronjob.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/batch/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - batchv1 "k8s.io/client-go/applyconfigurations/batch/v1" - testing "k8s.io/client-go/testing" -) - -// FakeCronJobs implements CronJobInterface -type FakeCronJobs struct { - Fake *FakeBatchV1 - ns string -} - -var cronjobsResource = v1.SchemeGroupVersion.WithResource("cronjobs") - -var cronjobsKind = v1.SchemeGroupVersion.WithKind("CronJob") - -// Get takes name of the cronJob, and returns the corresponding cronJob object, and an error if there is any. -func (c *FakeCronJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CronJob, err error) { - emptyResult := &v1.CronJob{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(cronjobsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CronJob), err -} - -// List takes label and field selectors, and returns the list of CronJobs that match those selectors. -func (c *FakeCronJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CronJobList, err error) { - emptyResult := &v1.CronJobList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(cronjobsResource, cronjobsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.CronJobList{ListMeta: obj.(*v1.CronJobList).ListMeta} - for _, item := range obj.(*v1.CronJobList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested cronJobs. -func (c *FakeCronJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(cronjobsResource, c.ns, opts)) - -} - -// Create takes the representation of a cronJob and creates it. Returns the server's representation of the cronJob, and an error, if there is any. -func (c *FakeCronJobs) Create(ctx context.Context, cronJob *v1.CronJob, opts metav1.CreateOptions) (result *v1.CronJob, err error) { - emptyResult := &v1.CronJob{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(cronjobsResource, c.ns, cronJob, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CronJob), err -} - -// Update takes the representation of a cronJob and updates it. Returns the server's representation of the cronJob, and an error, if there is any. -func (c *FakeCronJobs) Update(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (result *v1.CronJob, err error) { - emptyResult := &v1.CronJob{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(cronjobsResource, c.ns, cronJob, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CronJob), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeCronJobs) UpdateStatus(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (result *v1.CronJob, err error) { - emptyResult := &v1.CronJob{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(cronjobsResource, "status", c.ns, cronJob, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CronJob), err -} - -// Delete takes name of the cronJob and deletes it. Returns an error if one occurs. -func (c *FakeCronJobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(cronjobsResource, c.ns, name, opts), &v1.CronJob{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeCronJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(cronjobsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.CronJobList{}) - return err -} - -// Patch applies the patch and returns the patched cronJob. -func (c *FakeCronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CronJob, err error) { - emptyResult := &v1.CronJob{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(cronjobsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CronJob), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied cronJob. -func (c *FakeCronJobs) Apply(ctx context.Context, cronJob *batchv1.CronJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CronJob, err error) { - if cronJob == nil { - return nil, fmt.Errorf("cronJob provided to Apply must not be nil") - } - data, err := json.Marshal(cronJob) - if err != nil { - return nil, err - } - name := cronJob.Name - if name == nil { - return nil, fmt.Errorf("cronJob.Name must be provided to Apply") - } - emptyResult := &v1.CronJob{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CronJob), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeCronJobs) ApplyStatus(ctx context.Context, cronJob *batchv1.CronJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CronJob, err error) { - if cronJob == nil { - return nil, fmt.Errorf("cronJob provided to Apply must not be nil") - } - data, err := json.Marshal(cronJob) - if err != nil { - return nil, err - } - name := cronJob.Name - if name == nil { - return nil, fmt.Errorf("cronJob.Name must be provided to Apply") - } - emptyResult := &v1.CronJob{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CronJob), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go deleted file mode 100644 index 23e66953c..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/batch/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - batchv1 "k8s.io/client-go/applyconfigurations/batch/v1" - testing "k8s.io/client-go/testing" -) - -// FakeJobs implements JobInterface -type FakeJobs struct { - Fake *FakeBatchV1 - ns string -} - -var jobsResource = v1.SchemeGroupVersion.WithResource("jobs") - -var jobsKind = v1.SchemeGroupVersion.WithKind("Job") - -// Get takes name of the job, and returns the corresponding job object, and an error if there is any. -func (c *FakeJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Job, err error) { - emptyResult := &v1.Job{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(jobsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Job), err -} - -// List takes label and field selectors, and returns the list of Jobs that match those selectors. -func (c *FakeJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.JobList, err error) { - emptyResult := &v1.JobList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(jobsResource, jobsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.JobList{ListMeta: obj.(*v1.JobList).ListMeta} - for _, item := range obj.(*v1.JobList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested jobs. -func (c *FakeJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(jobsResource, c.ns, opts)) - -} - -// Create takes the representation of a job and creates it. Returns the server's representation of the job, and an error, if there is any. -func (c *FakeJobs) Create(ctx context.Context, job *v1.Job, opts metav1.CreateOptions) (result *v1.Job, err error) { - emptyResult := &v1.Job{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(jobsResource, c.ns, job, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Job), err -} - -// Update takes the representation of a job and updates it. Returns the server's representation of the job, and an error, if there is any. -func (c *FakeJobs) Update(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (result *v1.Job, err error) { - emptyResult := &v1.Job{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(jobsResource, c.ns, job, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Job), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeJobs) UpdateStatus(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (result *v1.Job, err error) { - emptyResult := &v1.Job{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(jobsResource, "status", c.ns, job, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Job), err -} - -// Delete takes name of the job and deletes it. Returns an error if one occurs. -func (c *FakeJobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(jobsResource, c.ns, name, opts), &v1.Job{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(jobsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.JobList{}) - return err -} - -// Patch applies the patch and returns the patched job. -func (c *FakeJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Job, err error) { - emptyResult := &v1.Job{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(jobsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Job), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied job. -func (c *FakeJobs) Apply(ctx context.Context, job *batchv1.JobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Job, err error) { - if job == nil { - return nil, fmt.Errorf("job provided to Apply must not be nil") - } - data, err := json.Marshal(job) - if err != nil { - return nil, err - } - name := job.Name - if name == nil { - return nil, fmt.Errorf("job.Name must be provided to Apply") - } - emptyResult := &v1.Job{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(jobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Job), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeJobs) ApplyStatus(ctx context.Context, job *batchv1.JobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Job, err error) { - if job == nil { - return nil, fmt.Errorf("job provided to Apply must not be nil") - } - data, err := json.Marshal(job) - if err != nil { - return nil, err - } - name := job.Name - if name == nil { - return nil, fmt.Errorf("job.Name must be provided to Apply") - } - emptyResult := &v1.Job{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(jobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Job), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_batch_client.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_batch_client.go deleted file mode 100644 index 6f350aed9..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_batch_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "k8s.io/client-go/kubernetes/typed/batch/v1beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeBatchV1beta1 struct { - *testing.Fake -} - -func (c *FakeBatchV1beta1) CronJobs(namespace string) v1beta1.CronJobInterface { - return &FakeCronJobs{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeBatchV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go deleted file mode 100644 index 71cd4f165..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/batch/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - batchv1beta1 "k8s.io/client-go/applyconfigurations/batch/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeCronJobs implements CronJobInterface -type FakeCronJobs struct { - Fake *FakeBatchV1beta1 - ns string -} - -var cronjobsResource = v1beta1.SchemeGroupVersion.WithResource("cronjobs") - -var cronjobsKind = v1beta1.SchemeGroupVersion.WithKind("CronJob") - -// Get takes name of the cronJob, and returns the corresponding cronJob object, and an error if there is any. -func (c *FakeCronJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CronJob, err error) { - emptyResult := &v1beta1.CronJob{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(cronjobsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CronJob), err -} - -// List takes label and field selectors, and returns the list of CronJobs that match those selectors. -func (c *FakeCronJobs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CronJobList, err error) { - emptyResult := &v1beta1.CronJobList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(cronjobsResource, cronjobsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.CronJobList{ListMeta: obj.(*v1beta1.CronJobList).ListMeta} - for _, item := range obj.(*v1beta1.CronJobList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested cronJobs. -func (c *FakeCronJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(cronjobsResource, c.ns, opts)) - -} - -// Create takes the representation of a cronJob and creates it. Returns the server's representation of the cronJob, and an error, if there is any. -func (c *FakeCronJobs) Create(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.CreateOptions) (result *v1beta1.CronJob, err error) { - emptyResult := &v1beta1.CronJob{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(cronjobsResource, c.ns, cronJob, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CronJob), err -} - -// Update takes the representation of a cronJob and updates it. Returns the server's representation of the cronJob, and an error, if there is any. -func (c *FakeCronJobs) Update(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (result *v1beta1.CronJob, err error) { - emptyResult := &v1beta1.CronJob{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(cronjobsResource, c.ns, cronJob, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CronJob), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeCronJobs) UpdateStatus(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (result *v1beta1.CronJob, err error) { - emptyResult := &v1beta1.CronJob{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(cronjobsResource, "status", c.ns, cronJob, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CronJob), err -} - -// Delete takes name of the cronJob and deletes it. Returns an error if one occurs. -func (c *FakeCronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(cronjobsResource, c.ns, name, opts), &v1beta1.CronJob{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeCronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(cronjobsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.CronJobList{}) - return err -} - -// Patch applies the patch and returns the patched cronJob. -func (c *FakeCronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CronJob, err error) { - emptyResult := &v1beta1.CronJob{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(cronjobsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CronJob), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied cronJob. -func (c *FakeCronJobs) Apply(ctx context.Context, cronJob *batchv1beta1.CronJobApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CronJob, err error) { - if cronJob == nil { - return nil, fmt.Errorf("cronJob provided to Apply must not be nil") - } - data, err := json.Marshal(cronJob) - if err != nil { - return nil, err - } - name := cronJob.Name - if name == nil { - return nil, fmt.Errorf("cronJob.Name must be provided to Apply") - } - emptyResult := &v1beta1.CronJob{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CronJob), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeCronJobs) ApplyStatus(ctx context.Context, cronJob *batchv1beta1.CronJobApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CronJob, err error) { - if cronJob == nil { - return nil, fmt.Errorf("cronJob provided to Apply must not be nil") - } - data, err := json.Marshal(cronJob) - if err != nil { - return nil, err - } - name := cronJob.Name - if name == nil { - return nil, fmt.Errorf("cronJob.Name must be provided to Apply") - } - emptyResult := &v1beta1.CronJob{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CronJob), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/fake/fake_certificates_client.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/fake/fake_certificates_client.go deleted file mode 100644 index 4779d6169..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/fake/fake_certificates_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/client-go/kubernetes/typed/certificates/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeCertificatesV1 struct { - *testing.Fake -} - -func (c *FakeCertificatesV1) CertificateSigningRequests() v1.CertificateSigningRequestInterface { - return &FakeCertificateSigningRequests{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeCertificatesV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/fake/fake_certificatesigningrequest.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/fake/fake_certificatesigningrequest.go deleted file mode 100644 index f3fc99f83..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/fake/fake_certificatesigningrequest.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/certificates/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - certificatesv1 "k8s.io/client-go/applyconfigurations/certificates/v1" - testing "k8s.io/client-go/testing" -) - -// FakeCertificateSigningRequests implements CertificateSigningRequestInterface -type FakeCertificateSigningRequests struct { - Fake *FakeCertificatesV1 -} - -var certificatesigningrequestsResource = v1.SchemeGroupVersion.WithResource("certificatesigningrequests") - -var certificatesigningrequestsKind = v1.SchemeGroupVersion.WithKind("CertificateSigningRequest") - -// Get takes name of the certificateSigningRequest, and returns the corresponding certificateSigningRequest object, and an error if there is any. -func (c *FakeCertificateSigningRequests) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CertificateSigningRequest, err error) { - emptyResult := &v1.CertificateSigningRequest{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(certificatesigningrequestsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CertificateSigningRequest), err -} - -// List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. -func (c *FakeCertificateSigningRequests) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateSigningRequestList, err error) { - emptyResult := &v1.CertificateSigningRequestList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(certificatesigningrequestsResource, certificatesigningrequestsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.CertificateSigningRequestList{ListMeta: obj.(*v1.CertificateSigningRequestList).ListMeta} - for _, item := range obj.(*v1.CertificateSigningRequestList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested certificateSigningRequests. -func (c *FakeCertificateSigningRequests) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(certificatesigningrequestsResource, opts)) -} - -// Create takes the representation of a certificateSigningRequest and creates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. -func (c *FakeCertificateSigningRequests) Create(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.CreateOptions) (result *v1.CertificateSigningRequest, err error) { - emptyResult := &v1.CertificateSigningRequest{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(certificatesigningrequestsResource, certificateSigningRequest, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CertificateSigningRequest), err -} - -// Update takes the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. -func (c *FakeCertificateSigningRequests) Update(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (result *v1.CertificateSigningRequest, err error) { - emptyResult := &v1.CertificateSigningRequest{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(certificatesigningrequestsResource, certificateSigningRequest, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CertificateSigningRequest), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeCertificateSigningRequests) UpdateStatus(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (result *v1.CertificateSigningRequest, err error) { - emptyResult := &v1.CertificateSigningRequest{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(certificatesigningrequestsResource, "status", certificateSigningRequest, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CertificateSigningRequest), err -} - -// Delete takes name of the certificateSigningRequest and deletes it. Returns an error if one occurs. -func (c *FakeCertificateSigningRequests) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(certificatesigningrequestsResource, name, opts), &v1.CertificateSigningRequest{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeCertificateSigningRequests) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(certificatesigningrequestsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.CertificateSigningRequestList{}) - return err -} - -// Patch applies the patch and returns the patched certificateSigningRequest. -func (c *FakeCertificateSigningRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CertificateSigningRequest, err error) { - emptyResult := &v1.CertificateSigningRequest{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(certificatesigningrequestsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CertificateSigningRequest), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied certificateSigningRequest. -func (c *FakeCertificateSigningRequests) Apply(ctx context.Context, certificateSigningRequest *certificatesv1.CertificateSigningRequestApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CertificateSigningRequest, err error) { - if certificateSigningRequest == nil { - return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil") - } - data, err := json.Marshal(certificateSigningRequest) - if err != nil { - return nil, err - } - name := certificateSigningRequest.Name - if name == nil { - return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply") - } - emptyResult := &v1.CertificateSigningRequest{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CertificateSigningRequest), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeCertificateSigningRequests) ApplyStatus(ctx context.Context, certificateSigningRequest *certificatesv1.CertificateSigningRequestApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CertificateSigningRequest, err error) { - if certificateSigningRequest == nil { - return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil") - } - data, err := json.Marshal(certificateSigningRequest) - if err != nil { - return nil, err - } - name := certificateSigningRequest.Name - if name == nil { - return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply") - } - emptyResult := &v1.CertificateSigningRequest{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CertificateSigningRequest), err -} - -// UpdateApproval takes the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. -func (c *FakeCertificateSigningRequests) UpdateApproval(ctx context.Context, certificateSigningRequestName string, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (result *v1.CertificateSigningRequest, err error) { - emptyResult := &v1.CertificateSigningRequest{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(certificatesigningrequestsResource, "approval", certificateSigningRequest, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CertificateSigningRequest), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificates_client.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificates_client.go deleted file mode 100644 index 8ff02cdbb..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificates_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha1 "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeCertificatesV1alpha1 struct { - *testing.Fake -} - -func (c *FakeCertificatesV1alpha1) ClusterTrustBundles() v1alpha1.ClusterTrustBundleInterface { - return &FakeClusterTrustBundles{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeCertificatesV1alpha1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_clustertrustbundle.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_clustertrustbundle.go deleted file mode 100644 index 1c4e97bd4..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_clustertrustbundle.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/certificates/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - certificatesv1alpha1 "k8s.io/client-go/applyconfigurations/certificates/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakeClusterTrustBundles implements ClusterTrustBundleInterface -type FakeClusterTrustBundles struct { - Fake *FakeCertificatesV1alpha1 -} - -var clustertrustbundlesResource = v1alpha1.SchemeGroupVersion.WithResource("clustertrustbundles") - -var clustertrustbundlesKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterTrustBundle") - -// Get takes name of the clusterTrustBundle, and returns the corresponding clusterTrustBundle object, and an error if there is any. -func (c *FakeClusterTrustBundles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterTrustBundle, err error) { - emptyResult := &v1alpha1.ClusterTrustBundle{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(clustertrustbundlesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterTrustBundle), err -} - -// List takes label and field selectors, and returns the list of ClusterTrustBundles that match those selectors. -func (c *FakeClusterTrustBundles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterTrustBundleList, err error) { - emptyResult := &v1alpha1.ClusterTrustBundleList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(clustertrustbundlesResource, clustertrustbundlesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ClusterTrustBundleList{ListMeta: obj.(*v1alpha1.ClusterTrustBundleList).ListMeta} - for _, item := range obj.(*v1alpha1.ClusterTrustBundleList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested clusterTrustBundles. -func (c *FakeClusterTrustBundles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(clustertrustbundlesResource, opts)) -} - -// Create takes the representation of a clusterTrustBundle and creates it. Returns the server's representation of the clusterTrustBundle, and an error, if there is any. -func (c *FakeClusterTrustBundles) Create(ctx context.Context, clusterTrustBundle *v1alpha1.ClusterTrustBundle, opts v1.CreateOptions) (result *v1alpha1.ClusterTrustBundle, err error) { - emptyResult := &v1alpha1.ClusterTrustBundle{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(clustertrustbundlesResource, clusterTrustBundle, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterTrustBundle), err -} - -// Update takes the representation of a clusterTrustBundle and updates it. Returns the server's representation of the clusterTrustBundle, and an error, if there is any. -func (c *FakeClusterTrustBundles) Update(ctx context.Context, clusterTrustBundle *v1alpha1.ClusterTrustBundle, opts v1.UpdateOptions) (result *v1alpha1.ClusterTrustBundle, err error) { - emptyResult := &v1alpha1.ClusterTrustBundle{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(clustertrustbundlesResource, clusterTrustBundle, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterTrustBundle), err -} - -// Delete takes name of the clusterTrustBundle and deletes it. Returns an error if one occurs. -func (c *FakeClusterTrustBundles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(clustertrustbundlesResource, name, opts), &v1alpha1.ClusterTrustBundle{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeClusterTrustBundles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(clustertrustbundlesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.ClusterTrustBundleList{}) - return err -} - -// Patch applies the patch and returns the patched clusterTrustBundle. -func (c *FakeClusterTrustBundles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterTrustBundle, err error) { - emptyResult := &v1alpha1.ClusterTrustBundle{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(clustertrustbundlesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterTrustBundle), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied clusterTrustBundle. -func (c *FakeClusterTrustBundles) Apply(ctx context.Context, clusterTrustBundle *certificatesv1alpha1.ClusterTrustBundleApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterTrustBundle, err error) { - if clusterTrustBundle == nil { - return nil, fmt.Errorf("clusterTrustBundle provided to Apply must not be nil") - } - data, err := json.Marshal(clusterTrustBundle) - if err != nil { - return nil, err - } - name := clusterTrustBundle.Name - if name == nil { - return nil, fmt.Errorf("clusterTrustBundle.Name must be provided to Apply") - } - emptyResult := &v1alpha1.ClusterTrustBundle{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(clustertrustbundlesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterTrustBundle), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificates_client.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificates_client.go deleted file mode 100644 index 29d8b088e..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificates_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeCertificatesV1beta1 struct { - *testing.Fake -} - -func (c *FakeCertificatesV1beta1) CertificateSigningRequests() v1beta1.CertificateSigningRequestInterface { - return &FakeCertificateSigningRequests{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeCertificatesV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go deleted file mode 100644 index ff5a9bd4c..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/certificates/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - certificatesv1beta1 "k8s.io/client-go/applyconfigurations/certificates/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeCertificateSigningRequests implements CertificateSigningRequestInterface -type FakeCertificateSigningRequests struct { - Fake *FakeCertificatesV1beta1 -} - -var certificatesigningrequestsResource = v1beta1.SchemeGroupVersion.WithResource("certificatesigningrequests") - -var certificatesigningrequestsKind = v1beta1.SchemeGroupVersion.WithKind("CertificateSigningRequest") - -// Get takes name of the certificateSigningRequest, and returns the corresponding certificateSigningRequest object, and an error if there is any. -func (c *FakeCertificateSigningRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CertificateSigningRequest, err error) { - emptyResult := &v1beta1.CertificateSigningRequest{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(certificatesigningrequestsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CertificateSigningRequest), err -} - -// List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. -func (c *FakeCertificateSigningRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestList, err error) { - emptyResult := &v1beta1.CertificateSigningRequestList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(certificatesigningrequestsResource, certificatesigningrequestsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.CertificateSigningRequestList{ListMeta: obj.(*v1beta1.CertificateSigningRequestList).ListMeta} - for _, item := range obj.(*v1beta1.CertificateSigningRequestList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested certificateSigningRequests. -func (c *FakeCertificateSigningRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(certificatesigningrequestsResource, opts)) -} - -// Create takes the representation of a certificateSigningRequest and creates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. -func (c *FakeCertificateSigningRequests) Create(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.CreateOptions) (result *v1beta1.CertificateSigningRequest, err error) { - emptyResult := &v1beta1.CertificateSigningRequest{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(certificatesigningrequestsResource, certificateSigningRequest, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CertificateSigningRequest), err -} - -// Update takes the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. -func (c *FakeCertificateSigningRequests) Update(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (result *v1beta1.CertificateSigningRequest, err error) { - emptyResult := &v1beta1.CertificateSigningRequest{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(certificatesigningrequestsResource, certificateSigningRequest, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CertificateSigningRequest), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeCertificateSigningRequests) UpdateStatus(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (result *v1beta1.CertificateSigningRequest, err error) { - emptyResult := &v1beta1.CertificateSigningRequest{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(certificatesigningrequestsResource, "status", certificateSigningRequest, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CertificateSigningRequest), err -} - -// Delete takes name of the certificateSigningRequest and deletes it. Returns an error if one occurs. -func (c *FakeCertificateSigningRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(certificatesigningrequestsResource, name, opts), &v1beta1.CertificateSigningRequest{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeCertificateSigningRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(certificatesigningrequestsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.CertificateSigningRequestList{}) - return err -} - -// Patch applies the patch and returns the patched certificateSigningRequest. -func (c *FakeCertificateSigningRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CertificateSigningRequest, err error) { - emptyResult := &v1beta1.CertificateSigningRequest{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(certificatesigningrequestsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CertificateSigningRequest), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied certificateSigningRequest. -func (c *FakeCertificateSigningRequests) Apply(ctx context.Context, certificateSigningRequest *certificatesv1beta1.CertificateSigningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequest, err error) { - if certificateSigningRequest == nil { - return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil") - } - data, err := json.Marshal(certificateSigningRequest) - if err != nil { - return nil, err - } - name := certificateSigningRequest.Name - if name == nil { - return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply") - } - emptyResult := &v1beta1.CertificateSigningRequest{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CertificateSigningRequest), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeCertificateSigningRequests) ApplyStatus(ctx context.Context, certificateSigningRequest *certificatesv1beta1.CertificateSigningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequest, err error) { - if certificateSigningRequest == nil { - return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil") - } - data, err := json.Marshal(certificateSigningRequest) - if err != nil { - return nil, err - } - name := certificateSigningRequest.Name - if name == nil { - return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply") - } - emptyResult := &v1beta1.CertificateSigningRequest{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CertificateSigningRequest), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest_expansion.go deleted file mode 100644 index 2c3eaf971..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest_expansion.go +++ /dev/null @@ -1,34 +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 fake - -import ( - "context" - - certificates "k8s.io/api/certificates/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - core "k8s.io/client-go/testing" -) - -func (c *FakeCertificateSigningRequests) UpdateApproval(ctx context.Context, certificateSigningRequest *certificates.CertificateSigningRequest, opts metav1.UpdateOptions) (result *certificates.CertificateSigningRequest, err error) { - obj, err := c.Fake. - Invokes(core.NewRootUpdateSubresourceAction(certificatesigningrequestsResource, "approval", certificateSigningRequest), &certificates.CertificateSigningRequest{}) - if obj == nil { - return nil, err - } - return obj.(*certificates.CertificateSigningRequest), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/fake/fake_coordination_client.go b/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/fake/fake_coordination_client.go deleted file mode 100644 index 6920275b2..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/fake/fake_coordination_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/client-go/kubernetes/typed/coordination/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeCoordinationV1 struct { - *testing.Fake -} - -func (c *FakeCoordinationV1) Leases(namespace string) v1.LeaseInterface { - return &FakeLeases{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeCoordinationV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/fake/fake_lease.go b/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/fake/fake_lease.go deleted file mode 100644 index 03f833f37..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/fake/fake_lease.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/coordination/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - coordinationv1 "k8s.io/client-go/applyconfigurations/coordination/v1" - testing "k8s.io/client-go/testing" -) - -// FakeLeases implements LeaseInterface -type FakeLeases struct { - Fake *FakeCoordinationV1 - ns string -} - -var leasesResource = v1.SchemeGroupVersion.WithResource("leases") - -var leasesKind = v1.SchemeGroupVersion.WithKind("Lease") - -// Get takes name of the lease, and returns the corresponding lease object, and an error if there is any. -func (c *FakeLeases) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Lease, err error) { - emptyResult := &v1.Lease{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(leasesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Lease), err -} - -// List takes label and field selectors, and returns the list of Leases that match those selectors. -func (c *FakeLeases) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LeaseList, err error) { - emptyResult := &v1.LeaseList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(leasesResource, leasesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.LeaseList{ListMeta: obj.(*v1.LeaseList).ListMeta} - for _, item := range obj.(*v1.LeaseList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested leases. -func (c *FakeLeases) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(leasesResource, c.ns, opts)) - -} - -// Create takes the representation of a lease and creates it. Returns the server's representation of the lease, and an error, if there is any. -func (c *FakeLeases) Create(ctx context.Context, lease *v1.Lease, opts metav1.CreateOptions) (result *v1.Lease, err error) { - emptyResult := &v1.Lease{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(leasesResource, c.ns, lease, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Lease), err -} - -// Update takes the representation of a lease and updates it. Returns the server's representation of the lease, and an error, if there is any. -func (c *FakeLeases) Update(ctx context.Context, lease *v1.Lease, opts metav1.UpdateOptions) (result *v1.Lease, err error) { - emptyResult := &v1.Lease{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(leasesResource, c.ns, lease, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Lease), err -} - -// Delete takes name of the lease and deletes it. Returns an error if one occurs. -func (c *FakeLeases) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(leasesResource, c.ns, name, opts), &v1.Lease{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeLeases) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(leasesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.LeaseList{}) - return err -} - -// Patch applies the patch and returns the patched lease. -func (c *FakeLeases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Lease, err error) { - emptyResult := &v1.Lease{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(leasesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Lease), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied lease. -func (c *FakeLeases) Apply(ctx context.Context, lease *coordinationv1.LeaseApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Lease, err error) { - if lease == nil { - return nil, fmt.Errorf("lease provided to Apply must not be nil") - } - data, err := json.Marshal(lease) - if err != nil { - return nil, err - } - name := lease.Name - if name == nil { - return nil, fmt.Errorf("lease.Name must be provided to Apply") - } - emptyResult := &v1.Lease{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(leasesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Lease), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha1/fake/fake_coordination_client.go b/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha1/fake/fake_coordination_client.go deleted file mode 100644 index 2e7d4be26..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha1/fake/fake_coordination_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha1 "k8s.io/client-go/kubernetes/typed/coordination/v1alpha1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeCoordinationV1alpha1 struct { - *testing.Fake -} - -func (c *FakeCoordinationV1alpha1) LeaseCandidates(namespace string) v1alpha1.LeaseCandidateInterface { - return &FakeLeaseCandidates{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeCoordinationV1alpha1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha1/fake/fake_leasecandidate.go b/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha1/fake/fake_leasecandidate.go deleted file mode 100644 index c3de2303c..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha1/fake/fake_leasecandidate.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/coordination/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - coordinationv1alpha1 "k8s.io/client-go/applyconfigurations/coordination/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakeLeaseCandidates implements LeaseCandidateInterface -type FakeLeaseCandidates struct { - Fake *FakeCoordinationV1alpha1 - ns string -} - -var leasecandidatesResource = v1alpha1.SchemeGroupVersion.WithResource("leasecandidates") - -var leasecandidatesKind = v1alpha1.SchemeGroupVersion.WithKind("LeaseCandidate") - -// Get takes name of the leaseCandidate, and returns the corresponding leaseCandidate object, and an error if there is any. -func (c *FakeLeaseCandidates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LeaseCandidate, err error) { - emptyResult := &v1alpha1.LeaseCandidate{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(leasecandidatesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.LeaseCandidate), err -} - -// List takes label and field selectors, and returns the list of LeaseCandidates that match those selectors. -func (c *FakeLeaseCandidates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.LeaseCandidateList, err error) { - emptyResult := &v1alpha1.LeaseCandidateList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(leasecandidatesResource, leasecandidatesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.LeaseCandidateList{ListMeta: obj.(*v1alpha1.LeaseCandidateList).ListMeta} - for _, item := range obj.(*v1alpha1.LeaseCandidateList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested leaseCandidates. -func (c *FakeLeaseCandidates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(leasecandidatesResource, c.ns, opts)) - -} - -// Create takes the representation of a leaseCandidate and creates it. Returns the server's representation of the leaseCandidate, and an error, if there is any. -func (c *FakeLeaseCandidates) Create(ctx context.Context, leaseCandidate *v1alpha1.LeaseCandidate, opts v1.CreateOptions) (result *v1alpha1.LeaseCandidate, err error) { - emptyResult := &v1alpha1.LeaseCandidate{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(leasecandidatesResource, c.ns, leaseCandidate, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.LeaseCandidate), err -} - -// Update takes the representation of a leaseCandidate and updates it. Returns the server's representation of the leaseCandidate, and an error, if there is any. -func (c *FakeLeaseCandidates) Update(ctx context.Context, leaseCandidate *v1alpha1.LeaseCandidate, opts v1.UpdateOptions) (result *v1alpha1.LeaseCandidate, err error) { - emptyResult := &v1alpha1.LeaseCandidate{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(leasecandidatesResource, c.ns, leaseCandidate, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.LeaseCandidate), err -} - -// Delete takes name of the leaseCandidate and deletes it. Returns an error if one occurs. -func (c *FakeLeaseCandidates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(leasecandidatesResource, c.ns, name, opts), &v1alpha1.LeaseCandidate{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeLeaseCandidates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(leasecandidatesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.LeaseCandidateList{}) - return err -} - -// Patch applies the patch and returns the patched leaseCandidate. -func (c *FakeLeaseCandidates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LeaseCandidate, err error) { - emptyResult := &v1alpha1.LeaseCandidate{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(leasecandidatesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.LeaseCandidate), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied leaseCandidate. -func (c *FakeLeaseCandidates) Apply(ctx context.Context, leaseCandidate *coordinationv1alpha1.LeaseCandidateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.LeaseCandidate, err error) { - if leaseCandidate == nil { - return nil, fmt.Errorf("leaseCandidate provided to Apply must not be nil") - } - data, err := json.Marshal(leaseCandidate) - if err != nil { - return nil, err - } - name := leaseCandidate.Name - if name == nil { - return nil, fmt.Errorf("leaseCandidate.Name must be provided to Apply") - } - emptyResult := &v1alpha1.LeaseCandidate{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(leasecandidatesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.LeaseCandidate), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_coordination_client.go b/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_coordination_client.go deleted file mode 100644 index f583b466e..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_coordination_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeCoordinationV1beta1 struct { - *testing.Fake -} - -func (c *FakeCoordinationV1beta1) Leases(namespace string) v1beta1.LeaseInterface { - return &FakeLeases{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeCoordinationV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_lease.go b/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_lease.go deleted file mode 100644 index 112784af9..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_lease.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/coordination/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - coordinationv1beta1 "k8s.io/client-go/applyconfigurations/coordination/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeLeases implements LeaseInterface -type FakeLeases struct { - Fake *FakeCoordinationV1beta1 - ns string -} - -var leasesResource = v1beta1.SchemeGroupVersion.WithResource("leases") - -var leasesKind = v1beta1.SchemeGroupVersion.WithKind("Lease") - -// Get takes name of the lease, and returns the corresponding lease object, and an error if there is any. -func (c *FakeLeases) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Lease, err error) { - emptyResult := &v1beta1.Lease{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(leasesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Lease), err -} - -// List takes label and field selectors, and returns the list of Leases that match those selectors. -func (c *FakeLeases) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.LeaseList, err error) { - emptyResult := &v1beta1.LeaseList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(leasesResource, leasesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.LeaseList{ListMeta: obj.(*v1beta1.LeaseList).ListMeta} - for _, item := range obj.(*v1beta1.LeaseList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested leases. -func (c *FakeLeases) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(leasesResource, c.ns, opts)) - -} - -// Create takes the representation of a lease and creates it. Returns the server's representation of the lease, and an error, if there is any. -func (c *FakeLeases) Create(ctx context.Context, lease *v1beta1.Lease, opts v1.CreateOptions) (result *v1beta1.Lease, err error) { - emptyResult := &v1beta1.Lease{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(leasesResource, c.ns, lease, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Lease), err -} - -// Update takes the representation of a lease and updates it. Returns the server's representation of the lease, and an error, if there is any. -func (c *FakeLeases) Update(ctx context.Context, lease *v1beta1.Lease, opts v1.UpdateOptions) (result *v1beta1.Lease, err error) { - emptyResult := &v1beta1.Lease{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(leasesResource, c.ns, lease, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Lease), err -} - -// Delete takes name of the lease and deletes it. Returns an error if one occurs. -func (c *FakeLeases) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(leasesResource, c.ns, name, opts), &v1beta1.Lease{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeLeases) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(leasesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.LeaseList{}) - return err -} - -// Patch applies the patch and returns the patched lease. -func (c *FakeLeases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Lease, err error) { - emptyResult := &v1beta1.Lease{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(leasesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Lease), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied lease. -func (c *FakeLeases) Apply(ctx context.Context, lease *coordinationv1beta1.LeaseApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Lease, err error) { - if lease == nil { - return nil, fmt.Errorf("lease provided to Apply must not be nil") - } - data, err := json.Marshal(lease) - if err != nil { - return nil, err - } - name := lease.Name - if name == nil { - return nil, fmt.Errorf("lease.Name must be provided to Apply") - } - emptyResult := &v1beta1.Lease{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(leasesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Lease), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go deleted file mode 100644 index dbd305280..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - corev1 "k8s.io/client-go/applyconfigurations/core/v1" - testing "k8s.io/client-go/testing" -) - -// FakeComponentStatuses implements ComponentStatusInterface -type FakeComponentStatuses struct { - Fake *FakeCoreV1 -} - -var componentstatusesResource = v1.SchemeGroupVersion.WithResource("componentstatuses") - -var componentstatusesKind = v1.SchemeGroupVersion.WithKind("ComponentStatus") - -// Get takes name of the componentStatus, and returns the corresponding componentStatus object, and an error if there is any. -func (c *FakeComponentStatuses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ComponentStatus, err error) { - emptyResult := &v1.ComponentStatus{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(componentstatusesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ComponentStatus), err -} - -// List takes label and field selectors, and returns the list of ComponentStatuses that match those selectors. -func (c *FakeComponentStatuses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ComponentStatusList, err error) { - emptyResult := &v1.ComponentStatusList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(componentstatusesResource, componentstatusesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.ComponentStatusList{ListMeta: obj.(*v1.ComponentStatusList).ListMeta} - for _, item := range obj.(*v1.ComponentStatusList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested componentStatuses. -func (c *FakeComponentStatuses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(componentstatusesResource, opts)) -} - -// Create takes the representation of a componentStatus and creates it. Returns the server's representation of the componentStatus, and an error, if there is any. -func (c *FakeComponentStatuses) Create(ctx context.Context, componentStatus *v1.ComponentStatus, opts metav1.CreateOptions) (result *v1.ComponentStatus, err error) { - emptyResult := &v1.ComponentStatus{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(componentstatusesResource, componentStatus, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ComponentStatus), err -} - -// Update takes the representation of a componentStatus and updates it. Returns the server's representation of the componentStatus, and an error, if there is any. -func (c *FakeComponentStatuses) Update(ctx context.Context, componentStatus *v1.ComponentStatus, opts metav1.UpdateOptions) (result *v1.ComponentStatus, err error) { - emptyResult := &v1.ComponentStatus{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(componentstatusesResource, componentStatus, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ComponentStatus), err -} - -// Delete takes name of the componentStatus and deletes it. Returns an error if one occurs. -func (c *FakeComponentStatuses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(componentstatusesResource, name, opts), &v1.ComponentStatus{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeComponentStatuses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(componentstatusesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.ComponentStatusList{}) - return err -} - -// Patch applies the patch and returns the patched componentStatus. -func (c *FakeComponentStatuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ComponentStatus, err error) { - emptyResult := &v1.ComponentStatus{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(componentstatusesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ComponentStatus), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied componentStatus. -func (c *FakeComponentStatuses) Apply(ctx context.Context, componentStatus *corev1.ComponentStatusApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ComponentStatus, err error) { - if componentStatus == nil { - return nil, fmt.Errorf("componentStatus provided to Apply must not be nil") - } - data, err := json.Marshal(componentStatus) - if err != nil { - return nil, err - } - name := componentStatus.Name - if name == nil { - return nil, fmt.Errorf("componentStatus.Name must be provided to Apply") - } - emptyResult := &v1.ComponentStatus{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(componentstatusesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ComponentStatus), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go deleted file mode 100644 index ae760add7..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - corev1 "k8s.io/client-go/applyconfigurations/core/v1" - testing "k8s.io/client-go/testing" -) - -// FakeConfigMaps implements ConfigMapInterface -type FakeConfigMaps struct { - Fake *FakeCoreV1 - ns string -} - -var configmapsResource = v1.SchemeGroupVersion.WithResource("configmaps") - -var configmapsKind = v1.SchemeGroupVersion.WithKind("ConfigMap") - -// Get takes name of the configMap, and returns the corresponding configMap object, and an error if there is any. -func (c *FakeConfigMaps) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ConfigMap, err error) { - emptyResult := &v1.ConfigMap{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(configmapsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ConfigMap), err -} - -// List takes label and field selectors, and returns the list of ConfigMaps that match those selectors. -func (c *FakeConfigMaps) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConfigMapList, err error) { - emptyResult := &v1.ConfigMapList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(configmapsResource, configmapsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.ConfigMapList{ListMeta: obj.(*v1.ConfigMapList).ListMeta} - for _, item := range obj.(*v1.ConfigMapList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested configMaps. -func (c *FakeConfigMaps) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(configmapsResource, c.ns, opts)) - -} - -// Create takes the representation of a configMap and creates it. Returns the server's representation of the configMap, and an error, if there is any. -func (c *FakeConfigMaps) Create(ctx context.Context, configMap *v1.ConfigMap, opts metav1.CreateOptions) (result *v1.ConfigMap, err error) { - emptyResult := &v1.ConfigMap{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(configmapsResource, c.ns, configMap, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ConfigMap), err -} - -// Update takes the representation of a configMap and updates it. Returns the server's representation of the configMap, and an error, if there is any. -func (c *FakeConfigMaps) Update(ctx context.Context, configMap *v1.ConfigMap, opts metav1.UpdateOptions) (result *v1.ConfigMap, err error) { - emptyResult := &v1.ConfigMap{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(configmapsResource, c.ns, configMap, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ConfigMap), err -} - -// Delete takes name of the configMap and deletes it. Returns an error if one occurs. -func (c *FakeConfigMaps) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(configmapsResource, c.ns, name, opts), &v1.ConfigMap{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeConfigMaps) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(configmapsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.ConfigMapList{}) - return err -} - -// Patch applies the patch and returns the patched configMap. -func (c *FakeConfigMaps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ConfigMap, err error) { - emptyResult := &v1.ConfigMap{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(configmapsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ConfigMap), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied configMap. -func (c *FakeConfigMaps) Apply(ctx context.Context, configMap *corev1.ConfigMapApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ConfigMap, err error) { - if configMap == nil { - return nil, fmt.Errorf("configMap provided to Apply must not be nil") - } - data, err := json.Marshal(configMap) - if err != nil { - return nil, err - } - name := configMap.Name - if name == nil { - return nil, fmt.Errorf("configMap.Name must be provided to Apply") - } - emptyResult := &v1.ConfigMap{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(configmapsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ConfigMap), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_core_client.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_core_client.go deleted file mode 100644 index 5ad90943c..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_core_client.go +++ /dev/null @@ -1,100 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/client-go/kubernetes/typed/core/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeCoreV1 struct { - *testing.Fake -} - -func (c *FakeCoreV1) ComponentStatuses() v1.ComponentStatusInterface { - return &FakeComponentStatuses{c} -} - -func (c *FakeCoreV1) ConfigMaps(namespace string) v1.ConfigMapInterface { - return &FakeConfigMaps{c, namespace} -} - -func (c *FakeCoreV1) Endpoints(namespace string) v1.EndpointsInterface { - return &FakeEndpoints{c, namespace} -} - -func (c *FakeCoreV1) Events(namespace string) v1.EventInterface { - return &FakeEvents{c, namespace} -} - -func (c *FakeCoreV1) LimitRanges(namespace string) v1.LimitRangeInterface { - return &FakeLimitRanges{c, namespace} -} - -func (c *FakeCoreV1) Namespaces() v1.NamespaceInterface { - return &FakeNamespaces{c} -} - -func (c *FakeCoreV1) Nodes() v1.NodeInterface { - return &FakeNodes{c} -} - -func (c *FakeCoreV1) PersistentVolumes() v1.PersistentVolumeInterface { - return &FakePersistentVolumes{c} -} - -func (c *FakeCoreV1) PersistentVolumeClaims(namespace string) v1.PersistentVolumeClaimInterface { - return &FakePersistentVolumeClaims{c, namespace} -} - -func (c *FakeCoreV1) Pods(namespace string) v1.PodInterface { - return &FakePods{c, namespace} -} - -func (c *FakeCoreV1) PodTemplates(namespace string) v1.PodTemplateInterface { - return &FakePodTemplates{c, namespace} -} - -func (c *FakeCoreV1) ReplicationControllers(namespace string) v1.ReplicationControllerInterface { - return &FakeReplicationControllers{c, namespace} -} - -func (c *FakeCoreV1) ResourceQuotas(namespace string) v1.ResourceQuotaInterface { - return &FakeResourceQuotas{c, namespace} -} - -func (c *FakeCoreV1) Secrets(namespace string) v1.SecretInterface { - return &FakeSecrets{c, namespace} -} - -func (c *FakeCoreV1) Services(namespace string) v1.ServiceInterface { - return &FakeServices{c, namespace} -} - -func (c *FakeCoreV1) ServiceAccounts(namespace string) v1.ServiceAccountInterface { - return &FakeServiceAccounts{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeCoreV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go deleted file mode 100644 index 7e2e91cfa..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - corev1 "k8s.io/client-go/applyconfigurations/core/v1" - testing "k8s.io/client-go/testing" -) - -// FakeEndpoints implements EndpointsInterface -type FakeEndpoints struct { - Fake *FakeCoreV1 - ns string -} - -var endpointsResource = v1.SchemeGroupVersion.WithResource("endpoints") - -var endpointsKind = v1.SchemeGroupVersion.WithKind("Endpoints") - -// Get takes name of the endpoints, and returns the corresponding endpoints object, and an error if there is any. -func (c *FakeEndpoints) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Endpoints, err error) { - emptyResult := &v1.Endpoints{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(endpointsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Endpoints), err -} - -// List takes label and field selectors, and returns the list of Endpoints that match those selectors. -func (c *FakeEndpoints) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointsList, err error) { - emptyResult := &v1.EndpointsList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(endpointsResource, endpointsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.EndpointsList{ListMeta: obj.(*v1.EndpointsList).ListMeta} - for _, item := range obj.(*v1.EndpointsList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested endpoints. -func (c *FakeEndpoints) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(endpointsResource, c.ns, opts)) - -} - -// Create takes the representation of a endpoints and creates it. Returns the server's representation of the endpoints, and an error, if there is any. -func (c *FakeEndpoints) Create(ctx context.Context, endpoints *v1.Endpoints, opts metav1.CreateOptions) (result *v1.Endpoints, err error) { - emptyResult := &v1.Endpoints{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(endpointsResource, c.ns, endpoints, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Endpoints), err -} - -// Update takes the representation of a endpoints and updates it. Returns the server's representation of the endpoints, and an error, if there is any. -func (c *FakeEndpoints) Update(ctx context.Context, endpoints *v1.Endpoints, opts metav1.UpdateOptions) (result *v1.Endpoints, err error) { - emptyResult := &v1.Endpoints{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(endpointsResource, c.ns, endpoints, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Endpoints), err -} - -// Delete takes name of the endpoints and deletes it. Returns an error if one occurs. -func (c *FakeEndpoints) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(endpointsResource, c.ns, name, opts), &v1.Endpoints{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeEndpoints) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(endpointsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.EndpointsList{}) - return err -} - -// Patch applies the patch and returns the patched endpoints. -func (c *FakeEndpoints) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Endpoints, err error) { - emptyResult := &v1.Endpoints{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(endpointsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Endpoints), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied endpoints. -func (c *FakeEndpoints) Apply(ctx context.Context, endpoints *corev1.EndpointsApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Endpoints, err error) { - if endpoints == nil { - return nil, fmt.Errorf("endpoints provided to Apply must not be nil") - } - data, err := json.Marshal(endpoints) - if err != nil { - return nil, err - } - name := endpoints.Name - if name == nil { - return nil, fmt.Errorf("endpoints.Name must be provided to Apply") - } - emptyResult := &v1.Endpoints{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(endpointsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Endpoints), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go deleted file mode 100644 index a438ba473..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - corev1 "k8s.io/client-go/applyconfigurations/core/v1" - testing "k8s.io/client-go/testing" -) - -// FakeEvents implements EventInterface -type FakeEvents struct { - Fake *FakeCoreV1 - ns string -} - -var eventsResource = v1.SchemeGroupVersion.WithResource("events") - -var eventsKind = v1.SchemeGroupVersion.WithKind("Event") - -// Get takes name of the event, and returns the corresponding event object, and an error if there is any. -func (c *FakeEvents) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Event, err error) { - emptyResult := &v1.Event{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(eventsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Event), err -} - -// List takes label and field selectors, and returns the list of Events that match those selectors. -func (c *FakeEvents) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { - emptyResult := &v1.EventList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(eventsResource, eventsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.EventList{ListMeta: obj.(*v1.EventList).ListMeta} - for _, item := range obj.(*v1.EventList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested events. -func (c *FakeEvents) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(eventsResource, c.ns, opts)) - -} - -// Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. -func (c *FakeEvents) Create(ctx context.Context, event *v1.Event, opts metav1.CreateOptions) (result *v1.Event, err error) { - emptyResult := &v1.Event{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(eventsResource, c.ns, event, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Event), err -} - -// Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. -func (c *FakeEvents) Update(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (result *v1.Event, err error) { - emptyResult := &v1.Event{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(eventsResource, c.ns, event, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Event), err -} - -// Delete takes name of the event and deletes it. Returns an error if one occurs. -func (c *FakeEvents) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(eventsResource, c.ns, name, opts), &v1.Event{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeEvents) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(eventsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.EventList{}) - return err -} - -// Patch applies the patch and returns the patched event. -func (c *FakeEvents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Event, err error) { - emptyResult := &v1.Event{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(eventsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Event), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied event. -func (c *FakeEvents) Apply(ctx context.Context, event *corev1.EventApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Event, err error) { - if event == nil { - return nil, fmt.Errorf("event provided to Apply must not be nil") - } - data, err := json.Marshal(event) - if err != nil { - return nil, err - } - name := event.Name - if name == nil { - return nil, fmt.Errorf("event.Name must be provided to Apply") - } - emptyResult := &v1.Event{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(eventsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Event), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event_expansion.go deleted file mode 100644 index 48282f86e..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event_expansion.go +++ /dev/null @@ -1,101 +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 fake - -import ( - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/runtime" - types "k8s.io/apimachinery/pkg/types" - core "k8s.io/client-go/testing" -) - -func (c *FakeEvents) CreateWithEventNamespace(event *v1.Event) (*v1.Event, error) { - var action core.CreateActionImpl - if c.ns != "" { - action = core.NewCreateAction(eventsResource, c.ns, event) - } else { - action = core.NewCreateAction(eventsResource, event.GetNamespace(), event) - } - obj, err := c.Fake.Invokes(action, event) - if obj == nil { - return nil, err - } - - return obj.(*v1.Event), err -} - -// Update replaces an existing event. Returns the copy of the event the server returns, or an error. -func (c *FakeEvents) UpdateWithEventNamespace(event *v1.Event) (*v1.Event, error) { - var action core.UpdateActionImpl - if c.ns != "" { - action = core.NewUpdateAction(eventsResource, c.ns, event) - } else { - action = core.NewUpdateAction(eventsResource, event.GetNamespace(), event) - } - obj, err := c.Fake.Invokes(action, event) - if obj == nil { - return nil, err - } - - return obj.(*v1.Event), err -} - -// 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. -func (c *FakeEvents) PatchWithEventNamespace(event *v1.Event, data []byte) (*v1.Event, error) { - // TODO: Should be configurable to support additional patch strategies. - pt := types.StrategicMergePatchType - var action core.PatchActionImpl - if c.ns != "" { - action = core.NewPatchAction(eventsResource, c.ns, event.Name, pt, data) - } else { - action = core.NewPatchAction(eventsResource, event.GetNamespace(), event.Name, pt, data) - } - obj, err := c.Fake.Invokes(action, event) - if obj == nil { - return nil, err - } - - return obj.(*v1.Event), err -} - -// Search returns a list of events matching the specified object. -func (c *FakeEvents) Search(scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.EventList, error) { - var action core.ListActionImpl - if c.ns != "" { - action = core.NewListAction(eventsResource, eventsKind, c.ns, metav1.ListOptions{}) - } else { - action = core.NewListAction(eventsResource, eventsKind, v1.NamespaceDefault, metav1.ListOptions{}) - } - obj, err := c.Fake.Invokes(action, &v1.EventList{}) - if obj == nil { - return nil, err - } - - return obj.(*v1.EventList), err -} - -func (c *FakeEvents) GetFieldSelector(involvedObjectName, involvedObjectNamespace, involvedObjectKind, involvedObjectUID *string) fields.Selector { - action := core.GenericActionImpl{} - action.Verb = "get-field-selector" - action.Resource = eventsResource - - c.Fake.Invokes(action, nil) - return fields.Everything() -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go deleted file mode 100644 index 4cc36131a..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - corev1 "k8s.io/client-go/applyconfigurations/core/v1" - testing "k8s.io/client-go/testing" -) - -// FakeLimitRanges implements LimitRangeInterface -type FakeLimitRanges struct { - Fake *FakeCoreV1 - ns string -} - -var limitrangesResource = v1.SchemeGroupVersion.WithResource("limitranges") - -var limitrangesKind = v1.SchemeGroupVersion.WithKind("LimitRange") - -// Get takes name of the limitRange, and returns the corresponding limitRange object, and an error if there is any. -func (c *FakeLimitRanges) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.LimitRange, err error) { - emptyResult := &v1.LimitRange{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(limitrangesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.LimitRange), err -} - -// List takes label and field selectors, and returns the list of LimitRanges that match those selectors. -func (c *FakeLimitRanges) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LimitRangeList, err error) { - emptyResult := &v1.LimitRangeList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(limitrangesResource, limitrangesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.LimitRangeList{ListMeta: obj.(*v1.LimitRangeList).ListMeta} - for _, item := range obj.(*v1.LimitRangeList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested limitRanges. -func (c *FakeLimitRanges) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(limitrangesResource, c.ns, opts)) - -} - -// Create takes the representation of a limitRange and creates it. Returns the server's representation of the limitRange, and an error, if there is any. -func (c *FakeLimitRanges) Create(ctx context.Context, limitRange *v1.LimitRange, opts metav1.CreateOptions) (result *v1.LimitRange, err error) { - emptyResult := &v1.LimitRange{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(limitrangesResource, c.ns, limitRange, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.LimitRange), err -} - -// Update takes the representation of a limitRange and updates it. Returns the server's representation of the limitRange, and an error, if there is any. -func (c *FakeLimitRanges) Update(ctx context.Context, limitRange *v1.LimitRange, opts metav1.UpdateOptions) (result *v1.LimitRange, err error) { - emptyResult := &v1.LimitRange{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(limitrangesResource, c.ns, limitRange, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.LimitRange), err -} - -// Delete takes name of the limitRange and deletes it. Returns an error if one occurs. -func (c *FakeLimitRanges) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(limitrangesResource, c.ns, name, opts), &v1.LimitRange{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeLimitRanges) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(limitrangesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.LimitRangeList{}) - return err -} - -// Patch applies the patch and returns the patched limitRange. -func (c *FakeLimitRanges) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LimitRange, err error) { - emptyResult := &v1.LimitRange{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(limitrangesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.LimitRange), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied limitRange. -func (c *FakeLimitRanges) Apply(ctx context.Context, limitRange *corev1.LimitRangeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.LimitRange, err error) { - if limitRange == nil { - return nil, fmt.Errorf("limitRange provided to Apply must not be nil") - } - data, err := json.Marshal(limitRange) - if err != nil { - return nil, err - } - name := limitRange.Name - if name == nil { - return nil, fmt.Errorf("limitRange.Name must be provided to Apply") - } - emptyResult := &v1.LimitRange{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(limitrangesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.LimitRange), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go deleted file mode 100644 index 093990571..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go +++ /dev/null @@ -1,178 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - corev1 "k8s.io/client-go/applyconfigurations/core/v1" - testing "k8s.io/client-go/testing" -) - -// FakeNamespaces implements NamespaceInterface -type FakeNamespaces struct { - Fake *FakeCoreV1 -} - -var namespacesResource = v1.SchemeGroupVersion.WithResource("namespaces") - -var namespacesKind = v1.SchemeGroupVersion.WithKind("Namespace") - -// Get takes name of the namespace, and returns the corresponding namespace object, and an error if there is any. -func (c *FakeNamespaces) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Namespace, err error) { - emptyResult := &v1.Namespace{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(namespacesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Namespace), err -} - -// List takes label and field selectors, and returns the list of Namespaces that match those selectors. -func (c *FakeNamespaces) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NamespaceList, err error) { - emptyResult := &v1.NamespaceList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(namespacesResource, namespacesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.NamespaceList{ListMeta: obj.(*v1.NamespaceList).ListMeta} - for _, item := range obj.(*v1.NamespaceList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested namespaces. -func (c *FakeNamespaces) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(namespacesResource, opts)) -} - -// Create takes the representation of a namespace and creates it. Returns the server's representation of the namespace, and an error, if there is any. -func (c *FakeNamespaces) Create(ctx context.Context, namespace *v1.Namespace, opts metav1.CreateOptions) (result *v1.Namespace, err error) { - emptyResult := &v1.Namespace{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(namespacesResource, namespace, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Namespace), err -} - -// Update takes the representation of a namespace and updates it. Returns the server's representation of the namespace, and an error, if there is any. -func (c *FakeNamespaces) Update(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (result *v1.Namespace, err error) { - emptyResult := &v1.Namespace{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(namespacesResource, namespace, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Namespace), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeNamespaces) UpdateStatus(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (result *v1.Namespace, err error) { - emptyResult := &v1.Namespace{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(namespacesResource, "status", namespace, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Namespace), err -} - -// Delete takes name of the namespace and deletes it. Returns an error if one occurs. -func (c *FakeNamespaces) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(namespacesResource, name, opts), &v1.Namespace{}) - return err -} - -// Patch applies the patch and returns the patched namespace. -func (c *FakeNamespaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Namespace, err error) { - emptyResult := &v1.Namespace{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(namespacesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Namespace), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied namespace. -func (c *FakeNamespaces) Apply(ctx context.Context, namespace *corev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Namespace, err error) { - if namespace == nil { - return nil, fmt.Errorf("namespace provided to Apply must not be nil") - } - data, err := json.Marshal(namespace) - if err != nil { - return nil, err - } - name := namespace.Name - if name == nil { - return nil, fmt.Errorf("namespace.Name must be provided to Apply") - } - emptyResult := &v1.Namespace{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(namespacesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Namespace), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeNamespaces) ApplyStatus(ctx context.Context, namespace *corev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Namespace, err error) { - if namespace == nil { - return nil, fmt.Errorf("namespace provided to Apply must not be nil") - } - data, err := json.Marshal(namespace) - if err != nil { - return nil, err - } - name := namespace.Name - if name == nil { - return nil, fmt.Errorf("namespace.Name must be provided to Apply") - } - emptyResult := &v1.Namespace{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(namespacesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Namespace), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace_expansion.go deleted file mode 100644 index d86b328a4..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace_expansion.go +++ /dev/null @@ -1,40 +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 fake - -import ( - "context" - - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - core "k8s.io/client-go/testing" -) - -func (c *FakeNamespaces) Finalize(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error) { - action := core.CreateActionImpl{} - action.Verb = "create" - action.Resource = namespacesResource - action.Subresource = "finalize" - action.Object = namespace - - obj, err := c.Fake.Invokes(action, namespace) - if obj == nil { - return nil, err - } - - return obj.(*v1.Namespace), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go deleted file mode 100644 index 451f992da..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - corev1 "k8s.io/client-go/applyconfigurations/core/v1" - testing "k8s.io/client-go/testing" -) - -// FakeNodes implements NodeInterface -type FakeNodes struct { - Fake *FakeCoreV1 -} - -var nodesResource = v1.SchemeGroupVersion.WithResource("nodes") - -var nodesKind = v1.SchemeGroupVersion.WithKind("Node") - -// Get takes name of the node, and returns the corresponding node object, and an error if there is any. -func (c *FakeNodes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Node, err error) { - emptyResult := &v1.Node{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(nodesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Node), err -} - -// List takes label and field selectors, and returns the list of Nodes that match those selectors. -func (c *FakeNodes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeList, err error) { - emptyResult := &v1.NodeList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(nodesResource, nodesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.NodeList{ListMeta: obj.(*v1.NodeList).ListMeta} - for _, item := range obj.(*v1.NodeList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested nodes. -func (c *FakeNodes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(nodesResource, opts)) -} - -// Create takes the representation of a node and creates it. Returns the server's representation of the node, and an error, if there is any. -func (c *FakeNodes) Create(ctx context.Context, node *v1.Node, opts metav1.CreateOptions) (result *v1.Node, err error) { - emptyResult := &v1.Node{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(nodesResource, node, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Node), err -} - -// Update takes the representation of a node and updates it. Returns the server's representation of the node, and an error, if there is any. -func (c *FakeNodes) Update(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (result *v1.Node, err error) { - emptyResult := &v1.Node{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(nodesResource, node, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Node), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeNodes) UpdateStatus(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (result *v1.Node, err error) { - emptyResult := &v1.Node{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(nodesResource, "status", node, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Node), err -} - -// Delete takes name of the node and deletes it. Returns an error if one occurs. -func (c *FakeNodes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(nodesResource, name, opts), &v1.Node{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeNodes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(nodesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.NodeList{}) - return err -} - -// Patch applies the patch and returns the patched node. -func (c *FakeNodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Node, err error) { - emptyResult := &v1.Node{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(nodesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Node), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied node. -func (c *FakeNodes) Apply(ctx context.Context, node *corev1.NodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Node, err error) { - if node == nil { - return nil, fmt.Errorf("node provided to Apply must not be nil") - } - data, err := json.Marshal(node) - if err != nil { - return nil, err - } - name := node.Name - if name == nil { - return nil, fmt.Errorf("node.Name must be provided to Apply") - } - emptyResult := &v1.Node{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(nodesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Node), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeNodes) ApplyStatus(ctx context.Context, node *corev1.NodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Node, err error) { - if node == nil { - return nil, fmt.Errorf("node provided to Apply must not be nil") - } - data, err := json.Marshal(node) - if err != nil { - return nil, err - } - name := node.Name - if name == nil { - return nil, fmt.Errorf("node.Name must be provided to Apply") - } - emptyResult := &v1.Node{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(nodesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Node), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node_expansion.go deleted file mode 100644 index eccf9fec6..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node_expansion.go +++ /dev/null @@ -1,38 +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 fake - -import ( - "context" - - v1 "k8s.io/api/core/v1" - types "k8s.io/apimachinery/pkg/types" - core "k8s.io/client-go/testing" -) - -// TODO: Should take a PatchType as an argument probably. -func (c *FakeNodes) PatchStatus(_ context.Context, nodeName string, data []byte) (*v1.Node, error) { - // TODO: Should be configurable to support additional patch strategies. - pt := types.StrategicMergePatchType - obj, err := c.Fake.Invokes( - core.NewRootPatchSubresourceAction(nodesResource, nodeName, pt, data, "status"), &v1.Node{}) - if obj == nil { - return nil, err - } - - return obj.(*v1.Node), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go deleted file mode 100644 index 16a1f2201..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - corev1 "k8s.io/client-go/applyconfigurations/core/v1" - testing "k8s.io/client-go/testing" -) - -// FakePersistentVolumes implements PersistentVolumeInterface -type FakePersistentVolumes struct { - Fake *FakeCoreV1 -} - -var persistentvolumesResource = v1.SchemeGroupVersion.WithResource("persistentvolumes") - -var persistentvolumesKind = v1.SchemeGroupVersion.WithKind("PersistentVolume") - -// Get takes name of the persistentVolume, and returns the corresponding persistentVolume object, and an error if there is any. -func (c *FakePersistentVolumes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PersistentVolume, err error) { - emptyResult := &v1.PersistentVolume{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(persistentvolumesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PersistentVolume), err -} - -// List takes label and field selectors, and returns the list of PersistentVolumes that match those selectors. -func (c *FakePersistentVolumes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeList, err error) { - emptyResult := &v1.PersistentVolumeList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(persistentvolumesResource, persistentvolumesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.PersistentVolumeList{ListMeta: obj.(*v1.PersistentVolumeList).ListMeta} - for _, item := range obj.(*v1.PersistentVolumeList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested persistentVolumes. -func (c *FakePersistentVolumes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(persistentvolumesResource, opts)) -} - -// Create takes the representation of a persistentVolume and creates it. Returns the server's representation of the persistentVolume, and an error, if there is any. -func (c *FakePersistentVolumes) Create(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.CreateOptions) (result *v1.PersistentVolume, err error) { - emptyResult := &v1.PersistentVolume{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(persistentvolumesResource, persistentVolume, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PersistentVolume), err -} - -// Update takes the representation of a persistentVolume and updates it. Returns the server's representation of the persistentVolume, and an error, if there is any. -func (c *FakePersistentVolumes) Update(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (result *v1.PersistentVolume, err error) { - emptyResult := &v1.PersistentVolume{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(persistentvolumesResource, persistentVolume, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PersistentVolume), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakePersistentVolumes) UpdateStatus(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (result *v1.PersistentVolume, err error) { - emptyResult := &v1.PersistentVolume{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(persistentvolumesResource, "status", persistentVolume, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PersistentVolume), err -} - -// Delete takes name of the persistentVolume and deletes it. Returns an error if one occurs. -func (c *FakePersistentVolumes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(persistentvolumesResource, name, opts), &v1.PersistentVolume{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakePersistentVolumes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(persistentvolumesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.PersistentVolumeList{}) - return err -} - -// Patch applies the patch and returns the patched persistentVolume. -func (c *FakePersistentVolumes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PersistentVolume, err error) { - emptyResult := &v1.PersistentVolume{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(persistentvolumesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PersistentVolume), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied persistentVolume. -func (c *FakePersistentVolumes) Apply(ctx context.Context, persistentVolume *corev1.PersistentVolumeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolume, err error) { - if persistentVolume == nil { - return nil, fmt.Errorf("persistentVolume provided to Apply must not be nil") - } - data, err := json.Marshal(persistentVolume) - if err != nil { - return nil, err - } - name := persistentVolume.Name - if name == nil { - return nil, fmt.Errorf("persistentVolume.Name must be provided to Apply") - } - emptyResult := &v1.PersistentVolume{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(persistentvolumesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PersistentVolume), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakePersistentVolumes) ApplyStatus(ctx context.Context, persistentVolume *corev1.PersistentVolumeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolume, err error) { - if persistentVolume == nil { - return nil, fmt.Errorf("persistentVolume provided to Apply must not be nil") - } - data, err := json.Marshal(persistentVolume) - if err != nil { - return nil, err - } - name := persistentVolume.Name - if name == nil { - return nil, fmt.Errorf("persistentVolume.Name must be provided to Apply") - } - emptyResult := &v1.PersistentVolume{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(persistentvolumesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PersistentVolume), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go deleted file mode 100644 index 12617c243..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - corev1 "k8s.io/client-go/applyconfigurations/core/v1" - testing "k8s.io/client-go/testing" -) - -// FakePersistentVolumeClaims implements PersistentVolumeClaimInterface -type FakePersistentVolumeClaims struct { - Fake *FakeCoreV1 - ns string -} - -var persistentvolumeclaimsResource = v1.SchemeGroupVersion.WithResource("persistentvolumeclaims") - -var persistentvolumeclaimsKind = v1.SchemeGroupVersion.WithKind("PersistentVolumeClaim") - -// Get takes name of the persistentVolumeClaim, and returns the corresponding persistentVolumeClaim object, and an error if there is any. -func (c *FakePersistentVolumeClaims) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PersistentVolumeClaim, err error) { - emptyResult := &v1.PersistentVolumeClaim{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(persistentvolumeclaimsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PersistentVolumeClaim), err -} - -// List takes label and field selectors, and returns the list of PersistentVolumeClaims that match those selectors. -func (c *FakePersistentVolumeClaims) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeClaimList, err error) { - emptyResult := &v1.PersistentVolumeClaimList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(persistentvolumeclaimsResource, persistentvolumeclaimsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.PersistentVolumeClaimList{ListMeta: obj.(*v1.PersistentVolumeClaimList).ListMeta} - for _, item := range obj.(*v1.PersistentVolumeClaimList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested persistentVolumeClaims. -func (c *FakePersistentVolumeClaims) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(persistentvolumeclaimsResource, c.ns, opts)) - -} - -// Create takes the representation of a persistentVolumeClaim and creates it. Returns the server's representation of the persistentVolumeClaim, and an error, if there is any. -func (c *FakePersistentVolumeClaims) Create(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.CreateOptions) (result *v1.PersistentVolumeClaim, err error) { - emptyResult := &v1.PersistentVolumeClaim{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(persistentvolumeclaimsResource, c.ns, persistentVolumeClaim, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PersistentVolumeClaim), err -} - -// Update takes the representation of a persistentVolumeClaim and updates it. Returns the server's representation of the persistentVolumeClaim, and an error, if there is any. -func (c *FakePersistentVolumeClaims) Update(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (result *v1.PersistentVolumeClaim, err error) { - emptyResult := &v1.PersistentVolumeClaim{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(persistentvolumeclaimsResource, c.ns, persistentVolumeClaim, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PersistentVolumeClaim), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakePersistentVolumeClaims) UpdateStatus(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (result *v1.PersistentVolumeClaim, err error) { - emptyResult := &v1.PersistentVolumeClaim{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(persistentvolumeclaimsResource, "status", c.ns, persistentVolumeClaim, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PersistentVolumeClaim), err -} - -// Delete takes name of the persistentVolumeClaim and deletes it. Returns an error if one occurs. -func (c *FakePersistentVolumeClaims) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(persistentvolumeclaimsResource, c.ns, name, opts), &v1.PersistentVolumeClaim{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakePersistentVolumeClaims) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(persistentvolumeclaimsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.PersistentVolumeClaimList{}) - return err -} - -// Patch applies the patch and returns the patched persistentVolumeClaim. -func (c *FakePersistentVolumeClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PersistentVolumeClaim, err error) { - emptyResult := &v1.PersistentVolumeClaim{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(persistentvolumeclaimsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PersistentVolumeClaim), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied persistentVolumeClaim. -func (c *FakePersistentVolumeClaims) Apply(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaimApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolumeClaim, err error) { - if persistentVolumeClaim == nil { - return nil, fmt.Errorf("persistentVolumeClaim provided to Apply must not be nil") - } - data, err := json.Marshal(persistentVolumeClaim) - if err != nil { - return nil, err - } - name := persistentVolumeClaim.Name - if name == nil { - return nil, fmt.Errorf("persistentVolumeClaim.Name must be provided to Apply") - } - emptyResult := &v1.PersistentVolumeClaim{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(persistentvolumeclaimsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PersistentVolumeClaim), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakePersistentVolumeClaims) ApplyStatus(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaimApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolumeClaim, err error) { - if persistentVolumeClaim == nil { - return nil, fmt.Errorf("persistentVolumeClaim provided to Apply must not be nil") - } - data, err := json.Marshal(persistentVolumeClaim) - if err != nil { - return nil, err - } - name := persistentVolumeClaim.Name - if name == nil { - return nil, fmt.Errorf("persistentVolumeClaim.Name must be provided to Apply") - } - emptyResult := &v1.PersistentVolumeClaim{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(persistentvolumeclaimsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PersistentVolumeClaim), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go deleted file mode 100644 index d2b46e8e3..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go +++ /dev/null @@ -1,209 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - corev1 "k8s.io/client-go/applyconfigurations/core/v1" - testing "k8s.io/client-go/testing" -) - -// FakePods implements PodInterface -type FakePods struct { - Fake *FakeCoreV1 - ns string -} - -var podsResource = v1.SchemeGroupVersion.WithResource("pods") - -var podsKind = v1.SchemeGroupVersion.WithKind("Pod") - -// Get takes name of the pod, and returns the corresponding pod object, and an error if there is any. -func (c *FakePods) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Pod, err error) { - emptyResult := &v1.Pod{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(podsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Pod), err -} - -// List takes label and field selectors, and returns the list of Pods that match those selectors. -func (c *FakePods) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodList, err error) { - emptyResult := &v1.PodList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(podsResource, podsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.PodList{ListMeta: obj.(*v1.PodList).ListMeta} - for _, item := range obj.(*v1.PodList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested pods. -func (c *FakePods) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(podsResource, c.ns, opts)) - -} - -// Create takes the representation of a pod and creates it. Returns the server's representation of the pod, and an error, if there is any. -func (c *FakePods) Create(ctx context.Context, pod *v1.Pod, opts metav1.CreateOptions) (result *v1.Pod, err error) { - emptyResult := &v1.Pod{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(podsResource, c.ns, pod, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Pod), err -} - -// Update takes the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any. -func (c *FakePods) Update(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) { - emptyResult := &v1.Pod{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(podsResource, c.ns, pod, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Pod), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakePods) UpdateStatus(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) { - emptyResult := &v1.Pod{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(podsResource, "status", c.ns, pod, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Pod), err -} - -// Delete takes name of the pod and deletes it. Returns an error if one occurs. -func (c *FakePods) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(podsResource, c.ns, name, opts), &v1.Pod{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakePods) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(podsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.PodList{}) - return err -} - -// Patch applies the patch and returns the patched pod. -func (c *FakePods) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Pod, err error) { - emptyResult := &v1.Pod{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(podsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Pod), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied pod. -func (c *FakePods) Apply(ctx context.Context, pod *corev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Pod, err error) { - if pod == nil { - return nil, fmt.Errorf("pod provided to Apply must not be nil") - } - data, err := json.Marshal(pod) - if err != nil { - return nil, err - } - name := pod.Name - if name == nil { - return nil, fmt.Errorf("pod.Name must be provided to Apply") - } - emptyResult := &v1.Pod{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(podsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Pod), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakePods) ApplyStatus(ctx context.Context, pod *corev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Pod, err error) { - if pod == nil { - return nil, fmt.Errorf("pod provided to Apply must not be nil") - } - data, err := json.Marshal(pod) - if err != nil { - return nil, err - } - name := pod.Name - if name == nil { - return nil, fmt.Errorf("pod.Name must be provided to Apply") - } - emptyResult := &v1.Pod{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(podsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Pod), err -} - -// UpdateEphemeralContainers takes the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any. -func (c *FakePods) UpdateEphemeralContainers(ctx context.Context, podName string, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) { - emptyResult := &v1.Pod{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(podsResource, "ephemeralcontainers", c.ns, pod, opts), &v1.Pod{}) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Pod), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod_expansion.go deleted file mode 100644 index c814cadb0..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod_expansion.go +++ /dev/null @@ -1,112 +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 fake - -import ( - "context" - "fmt" - "io" - "net/http" - "strings" - - v1 "k8s.io/api/core/v1" - policyv1 "k8s.io/api/policy/v1" - policyv1beta1 "k8s.io/api/policy/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes/scheme" - restclient "k8s.io/client-go/rest" - fakerest "k8s.io/client-go/rest/fake" - core "k8s.io/client-go/testing" -) - -func (c *FakePods) Bind(ctx context.Context, binding *v1.Binding, opts metav1.CreateOptions) error { - action := core.CreateActionImpl{} - action.Verb = "create" - action.Namespace = binding.Namespace - action.Resource = podsResource - action.Subresource = "binding" - action.Object = binding - - _, err := c.Fake.Invokes(action, binding) - return err -} - -func (c *FakePods) GetBinding(name string) (result *v1.Binding, err error) { - obj, err := c.Fake. - Invokes(core.NewGetSubresourceAction(podsResource, c.ns, "binding", name), &v1.Binding{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.Binding), err -} - -func (c *FakePods) GetLogs(name string, opts *v1.PodLogOptions) *restclient.Request { - action := core.GenericActionImpl{} - action.Verb = "get" - action.Namespace = c.ns - action.Resource = podsResource - action.Subresource = "log" - action.Value = opts - - _, _ = c.Fake.Invokes(action, &v1.Pod{}) - fakeClient := &fakerest.RESTClient{ - Client: fakerest.CreateHTTPClient(func(request *http.Request) (*http.Response, error) { - resp := &http.Response{ - StatusCode: http.StatusOK, - Body: io.NopCloser(strings.NewReader("fake logs")), - } - return resp, nil - }), - NegotiatedSerializer: scheme.Codecs.WithoutConversion(), - GroupVersion: podsKind.GroupVersion(), - VersionedAPIPath: fmt.Sprintf("/api/v1/namespaces/%s/pods/%s/log", c.ns, name), - } - return fakeClient.Request() -} - -func (c *FakePods) Evict(ctx context.Context, eviction *policyv1beta1.Eviction) error { - return c.EvictV1beta1(ctx, eviction) -} - -func (c *FakePods) EvictV1(ctx context.Context, eviction *policyv1.Eviction) error { - action := core.CreateActionImpl{} - action.Verb = "create" - action.Namespace = c.ns - action.Resource = podsResource - action.Subresource = "eviction" - action.Object = eviction - - _, err := c.Fake.Invokes(action, eviction) - return err -} - -func (c *FakePods) EvictV1beta1(ctx context.Context, eviction *policyv1beta1.Eviction) error { - action := core.CreateActionImpl{} - action.Verb = "create" - action.Namespace = c.ns - action.Resource = podsResource - action.Subresource = "eviction" - action.Object = eviction - - _, err := c.Fake.Invokes(action, eviction) - return err -} - -func (c *FakePods) ProxyGet(scheme, name, port, path string, params map[string]string) restclient.ResponseWrapper { - return c.Fake.InvokesProxy(core.NewProxyGetAction(podsResource, c.ns, scheme, name, port, path, params)) -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go deleted file mode 100644 index dc9affdd0..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - corev1 "k8s.io/client-go/applyconfigurations/core/v1" - testing "k8s.io/client-go/testing" -) - -// FakePodTemplates implements PodTemplateInterface -type FakePodTemplates struct { - Fake *FakeCoreV1 - ns string -} - -var podtemplatesResource = v1.SchemeGroupVersion.WithResource("podtemplates") - -var podtemplatesKind = v1.SchemeGroupVersion.WithKind("PodTemplate") - -// Get takes name of the podTemplate, and returns the corresponding podTemplate object, and an error if there is any. -func (c *FakePodTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PodTemplate, err error) { - emptyResult := &v1.PodTemplate{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(podtemplatesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PodTemplate), err -} - -// List takes label and field selectors, and returns the list of PodTemplates that match those selectors. -func (c *FakePodTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodTemplateList, err error) { - emptyResult := &v1.PodTemplateList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(podtemplatesResource, podtemplatesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.PodTemplateList{ListMeta: obj.(*v1.PodTemplateList).ListMeta} - for _, item := range obj.(*v1.PodTemplateList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested podTemplates. -func (c *FakePodTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(podtemplatesResource, c.ns, opts)) - -} - -// Create takes the representation of a podTemplate and creates it. Returns the server's representation of the podTemplate, and an error, if there is any. -func (c *FakePodTemplates) Create(ctx context.Context, podTemplate *v1.PodTemplate, opts metav1.CreateOptions) (result *v1.PodTemplate, err error) { - emptyResult := &v1.PodTemplate{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(podtemplatesResource, c.ns, podTemplate, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PodTemplate), err -} - -// Update takes the representation of a podTemplate and updates it. Returns the server's representation of the podTemplate, and an error, if there is any. -func (c *FakePodTemplates) Update(ctx context.Context, podTemplate *v1.PodTemplate, opts metav1.UpdateOptions) (result *v1.PodTemplate, err error) { - emptyResult := &v1.PodTemplate{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(podtemplatesResource, c.ns, podTemplate, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PodTemplate), err -} - -// Delete takes name of the podTemplate and deletes it. Returns an error if one occurs. -func (c *FakePodTemplates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(podtemplatesResource, c.ns, name, opts), &v1.PodTemplate{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakePodTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(podtemplatesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.PodTemplateList{}) - return err -} - -// Patch applies the patch and returns the patched podTemplate. -func (c *FakePodTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodTemplate, err error) { - emptyResult := &v1.PodTemplate{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(podtemplatesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PodTemplate), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied podTemplate. -func (c *FakePodTemplates) Apply(ctx context.Context, podTemplate *corev1.PodTemplateApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodTemplate, err error) { - if podTemplate == nil { - return nil, fmt.Errorf("podTemplate provided to Apply must not be nil") - } - data, err := json.Marshal(podTemplate) - if err != nil { - return nil, err - } - name := podTemplate.Name - if name == nil { - return nil, fmt.Errorf("podTemplate.Name must be provided to Apply") - } - emptyResult := &v1.PodTemplate{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(podtemplatesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PodTemplate), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go deleted file mode 100644 index 6b3497f08..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go +++ /dev/null @@ -1,222 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - autoscalingv1 "k8s.io/api/autoscaling/v1" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - corev1 "k8s.io/client-go/applyconfigurations/core/v1" - testing "k8s.io/client-go/testing" -) - -// FakeReplicationControllers implements ReplicationControllerInterface -type FakeReplicationControllers struct { - Fake *FakeCoreV1 - ns string -} - -var replicationcontrollersResource = v1.SchemeGroupVersion.WithResource("replicationcontrollers") - -var replicationcontrollersKind = v1.SchemeGroupVersion.WithKind("ReplicationController") - -// Get takes name of the replicationController, and returns the corresponding replicationController object, and an error if there is any. -func (c *FakeReplicationControllers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ReplicationController, err error) { - emptyResult := &v1.ReplicationController{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(replicationcontrollersResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ReplicationController), err -} - -// List takes label and field selectors, and returns the list of ReplicationControllers that match those selectors. -func (c *FakeReplicationControllers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicationControllerList, err error) { - emptyResult := &v1.ReplicationControllerList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(replicationcontrollersResource, replicationcontrollersKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.ReplicationControllerList{ListMeta: obj.(*v1.ReplicationControllerList).ListMeta} - for _, item := range obj.(*v1.ReplicationControllerList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested replicationControllers. -func (c *FakeReplicationControllers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(replicationcontrollersResource, c.ns, opts)) - -} - -// Create takes the representation of a replicationController and creates it. Returns the server's representation of the replicationController, and an error, if there is any. -func (c *FakeReplicationControllers) Create(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.CreateOptions) (result *v1.ReplicationController, err error) { - emptyResult := &v1.ReplicationController{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(replicationcontrollersResource, c.ns, replicationController, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ReplicationController), err -} - -// Update takes the representation of a replicationController and updates it. Returns the server's representation of the replicationController, and an error, if there is any. -func (c *FakeReplicationControllers) Update(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (result *v1.ReplicationController, err error) { - emptyResult := &v1.ReplicationController{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(replicationcontrollersResource, c.ns, replicationController, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ReplicationController), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeReplicationControllers) UpdateStatus(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (result *v1.ReplicationController, err error) { - emptyResult := &v1.ReplicationController{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(replicationcontrollersResource, "status", c.ns, replicationController, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ReplicationController), err -} - -// Delete takes name of the replicationController and deletes it. Returns an error if one occurs. -func (c *FakeReplicationControllers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(replicationcontrollersResource, c.ns, name, opts), &v1.ReplicationController{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeReplicationControllers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(replicationcontrollersResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.ReplicationControllerList{}) - return err -} - -// Patch applies the patch and returns the patched replicationController. -func (c *FakeReplicationControllers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicationController, err error) { - emptyResult := &v1.ReplicationController{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(replicationcontrollersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ReplicationController), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied replicationController. -func (c *FakeReplicationControllers) Apply(ctx context.Context, replicationController *corev1.ReplicationControllerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicationController, err error) { - if replicationController == nil { - return nil, fmt.Errorf("replicationController provided to Apply must not be nil") - } - data, err := json.Marshal(replicationController) - if err != nil { - return nil, err - } - name := replicationController.Name - if name == nil { - return nil, fmt.Errorf("replicationController.Name must be provided to Apply") - } - emptyResult := &v1.ReplicationController{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(replicationcontrollersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ReplicationController), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeReplicationControllers) ApplyStatus(ctx context.Context, replicationController *corev1.ReplicationControllerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicationController, err error) { - if replicationController == nil { - return nil, fmt.Errorf("replicationController provided to Apply must not be nil") - } - data, err := json.Marshal(replicationController) - if err != nil { - return nil, err - } - name := replicationController.Name - if name == nil { - return nil, fmt.Errorf("replicationController.Name must be provided to Apply") - } - emptyResult := &v1.ReplicationController{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(replicationcontrollersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ReplicationController), err -} - -// GetScale takes name of the replicationController, and returns the corresponding scale object, and an error if there is any. -func (c *FakeReplicationControllers) GetScale(ctx context.Context, replicationControllerName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { - emptyResult := &autoscalingv1.Scale{} - obj, err := c.Fake. - Invokes(testing.NewGetSubresourceActionWithOptions(replicationcontrollersResource, c.ns, "scale", replicationControllerName, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*autoscalingv1.Scale), err -} - -// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *FakeReplicationControllers) UpdateScale(ctx context.Context, replicationControllerName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { - emptyResult := &autoscalingv1.Scale{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(replicationcontrollersResource, "scale", c.ns, scale, opts), &autoscalingv1.Scale{}) - - if obj == nil { - return emptyResult, err - } - return obj.(*autoscalingv1.Scale), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go deleted file mode 100644 index 5e2e02afc..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - corev1 "k8s.io/client-go/applyconfigurations/core/v1" - testing "k8s.io/client-go/testing" -) - -// FakeResourceQuotas implements ResourceQuotaInterface -type FakeResourceQuotas struct { - Fake *FakeCoreV1 - ns string -} - -var resourcequotasResource = v1.SchemeGroupVersion.WithResource("resourcequotas") - -var resourcequotasKind = v1.SchemeGroupVersion.WithKind("ResourceQuota") - -// Get takes name of the resourceQuota, and returns the corresponding resourceQuota object, and an error if there is any. -func (c *FakeResourceQuotas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ResourceQuota, err error) { - emptyResult := &v1.ResourceQuota{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(resourcequotasResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ResourceQuota), err -} - -// List takes label and field selectors, and returns the list of ResourceQuotas that match those selectors. -func (c *FakeResourceQuotas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ResourceQuotaList, err error) { - emptyResult := &v1.ResourceQuotaList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(resourcequotasResource, resourcequotasKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.ResourceQuotaList{ListMeta: obj.(*v1.ResourceQuotaList).ListMeta} - for _, item := range obj.(*v1.ResourceQuotaList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested resourceQuotas. -func (c *FakeResourceQuotas) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(resourcequotasResource, c.ns, opts)) - -} - -// Create takes the representation of a resourceQuota and creates it. Returns the server's representation of the resourceQuota, and an error, if there is any. -func (c *FakeResourceQuotas) Create(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.CreateOptions) (result *v1.ResourceQuota, err error) { - emptyResult := &v1.ResourceQuota{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(resourcequotasResource, c.ns, resourceQuota, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ResourceQuota), err -} - -// Update takes the representation of a resourceQuota and updates it. Returns the server's representation of the resourceQuota, and an error, if there is any. -func (c *FakeResourceQuotas) Update(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (result *v1.ResourceQuota, err error) { - emptyResult := &v1.ResourceQuota{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(resourcequotasResource, c.ns, resourceQuota, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ResourceQuota), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeResourceQuotas) UpdateStatus(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (result *v1.ResourceQuota, err error) { - emptyResult := &v1.ResourceQuota{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(resourcequotasResource, "status", c.ns, resourceQuota, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ResourceQuota), err -} - -// Delete takes name of the resourceQuota and deletes it. Returns an error if one occurs. -func (c *FakeResourceQuotas) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(resourcequotasResource, c.ns, name, opts), &v1.ResourceQuota{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeResourceQuotas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(resourcequotasResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.ResourceQuotaList{}) - return err -} - -// Patch applies the patch and returns the patched resourceQuota. -func (c *FakeResourceQuotas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ResourceQuota, err error) { - emptyResult := &v1.ResourceQuota{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(resourcequotasResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ResourceQuota), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied resourceQuota. -func (c *FakeResourceQuotas) Apply(ctx context.Context, resourceQuota *corev1.ResourceQuotaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ResourceQuota, err error) { - if resourceQuota == nil { - return nil, fmt.Errorf("resourceQuota provided to Apply must not be nil") - } - data, err := json.Marshal(resourceQuota) - if err != nil { - return nil, err - } - name := resourceQuota.Name - if name == nil { - return nil, fmt.Errorf("resourceQuota.Name must be provided to Apply") - } - emptyResult := &v1.ResourceQuota{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(resourcequotasResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ResourceQuota), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeResourceQuotas) ApplyStatus(ctx context.Context, resourceQuota *corev1.ResourceQuotaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ResourceQuota, err error) { - if resourceQuota == nil { - return nil, fmt.Errorf("resourceQuota provided to Apply must not be nil") - } - data, err := json.Marshal(resourceQuota) - if err != nil { - return nil, err - } - name := resourceQuota.Name - if name == nil { - return nil, fmt.Errorf("resourceQuota.Name must be provided to Apply") - } - emptyResult := &v1.ResourceQuota{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(resourcequotasResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ResourceQuota), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go deleted file mode 100644 index ec0fc65b5..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - corev1 "k8s.io/client-go/applyconfigurations/core/v1" - testing "k8s.io/client-go/testing" -) - -// FakeSecrets implements SecretInterface -type FakeSecrets struct { - Fake *FakeCoreV1 - ns string -} - -var secretsResource = v1.SchemeGroupVersion.WithResource("secrets") - -var secretsKind = v1.SchemeGroupVersion.WithKind("Secret") - -// Get takes name of the secret, and returns the corresponding secret object, and an error if there is any. -func (c *FakeSecrets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Secret, err error) { - emptyResult := &v1.Secret{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(secretsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Secret), err -} - -// List takes label and field selectors, and returns the list of Secrets that match those selectors. -func (c *FakeSecrets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SecretList, err error) { - emptyResult := &v1.SecretList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(secretsResource, secretsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.SecretList{ListMeta: obj.(*v1.SecretList).ListMeta} - for _, item := range obj.(*v1.SecretList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested secrets. -func (c *FakeSecrets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(secretsResource, c.ns, opts)) - -} - -// Create takes the representation of a secret and creates it. Returns the server's representation of the secret, and an error, if there is any. -func (c *FakeSecrets) Create(ctx context.Context, secret *v1.Secret, opts metav1.CreateOptions) (result *v1.Secret, err error) { - emptyResult := &v1.Secret{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(secretsResource, c.ns, secret, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Secret), err -} - -// Update takes the representation of a secret and updates it. Returns the server's representation of the secret, and an error, if there is any. -func (c *FakeSecrets) Update(ctx context.Context, secret *v1.Secret, opts metav1.UpdateOptions) (result *v1.Secret, err error) { - emptyResult := &v1.Secret{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(secretsResource, c.ns, secret, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Secret), err -} - -// Delete takes name of the secret and deletes it. Returns an error if one occurs. -func (c *FakeSecrets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(secretsResource, c.ns, name, opts), &v1.Secret{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeSecrets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(secretsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.SecretList{}) - return err -} - -// Patch applies the patch and returns the patched secret. -func (c *FakeSecrets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Secret, err error) { - emptyResult := &v1.Secret{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(secretsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Secret), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied secret. -func (c *FakeSecrets) Apply(ctx context.Context, secret *corev1.SecretApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Secret, err error) { - if secret == nil { - return nil, fmt.Errorf("secret provided to Apply must not be nil") - } - data, err := json.Marshal(secret) - if err != nil { - return nil, err - } - name := secret.Name - if name == nil { - return nil, fmt.Errorf("secret.Name must be provided to Apply") - } - emptyResult := &v1.Secret{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(secretsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Secret), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go deleted file mode 100644 index 2a3cf45fb..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go +++ /dev/null @@ -1,189 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - corev1 "k8s.io/client-go/applyconfigurations/core/v1" - testing "k8s.io/client-go/testing" -) - -// FakeServices implements ServiceInterface -type FakeServices struct { - Fake *FakeCoreV1 - ns string -} - -var servicesResource = v1.SchemeGroupVersion.WithResource("services") - -var servicesKind = v1.SchemeGroupVersion.WithKind("Service") - -// Get takes name of the service, and returns the corresponding service object, and an error if there is any. -func (c *FakeServices) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Service, err error) { - emptyResult := &v1.Service{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(servicesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Service), err -} - -// List takes label and field selectors, and returns the list of Services that match those selectors. -func (c *FakeServices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceList, err error) { - emptyResult := &v1.ServiceList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(servicesResource, servicesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.ServiceList{ListMeta: obj.(*v1.ServiceList).ListMeta} - for _, item := range obj.(*v1.ServiceList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested services. -func (c *FakeServices) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(servicesResource, c.ns, opts)) - -} - -// Create takes the representation of a service and creates it. Returns the server's representation of the service, and an error, if there is any. -func (c *FakeServices) Create(ctx context.Context, service *v1.Service, opts metav1.CreateOptions) (result *v1.Service, err error) { - emptyResult := &v1.Service{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(servicesResource, c.ns, service, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Service), err -} - -// Update takes the representation of a service and updates it. Returns the server's representation of the service, and an error, if there is any. -func (c *FakeServices) Update(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (result *v1.Service, err error) { - emptyResult := &v1.Service{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(servicesResource, c.ns, service, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Service), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeServices) UpdateStatus(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (result *v1.Service, err error) { - emptyResult := &v1.Service{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(servicesResource, "status", c.ns, service, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Service), err -} - -// Delete takes name of the service and deletes it. Returns an error if one occurs. -func (c *FakeServices) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(servicesResource, c.ns, name, opts), &v1.Service{}) - - return err -} - -// Patch applies the patch and returns the patched service. -func (c *FakeServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Service, err error) { - emptyResult := &v1.Service{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(servicesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Service), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied service. -func (c *FakeServices) Apply(ctx context.Context, service *corev1.ServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Service, err error) { - if service == nil { - return nil, fmt.Errorf("service provided to Apply must not be nil") - } - data, err := json.Marshal(service) - if err != nil { - return nil, err - } - name := service.Name - if name == nil { - return nil, fmt.Errorf("service.Name must be provided to Apply") - } - emptyResult := &v1.Service{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(servicesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Service), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeServices) ApplyStatus(ctx context.Context, service *corev1.ServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Service, err error) { - if service == nil { - return nil, fmt.Errorf("service provided to Apply must not be nil") - } - data, err := json.Marshal(service) - if err != nil { - return nil, err - } - name := service.Name - if name == nil { - return nil, fmt.Errorf("service.Name must be provided to Apply") - } - emptyResult := &v1.Service{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(servicesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Service), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service_expansion.go deleted file mode 100644 index 92e4930d7..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service_expansion.go +++ /dev/null @@ -1,26 +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 fake - -import ( - restclient "k8s.io/client-go/rest" - core "k8s.io/client-go/testing" -) - -func (c *FakeServices) ProxyGet(scheme, name, port, path string, params map[string]string) restclient.ResponseWrapper { - return c.Fake.InvokesProxy(core.NewProxyGetAction(servicesResource, c.ns, scheme, name, port, path, params)) -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go deleted file mode 100644 index f3ad8d40f..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go +++ /dev/null @@ -1,173 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - authenticationv1 "k8s.io/api/authentication/v1" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - corev1 "k8s.io/client-go/applyconfigurations/core/v1" - testing "k8s.io/client-go/testing" -) - -// FakeServiceAccounts implements ServiceAccountInterface -type FakeServiceAccounts struct { - Fake *FakeCoreV1 - ns string -} - -var serviceaccountsResource = v1.SchemeGroupVersion.WithResource("serviceaccounts") - -var serviceaccountsKind = v1.SchemeGroupVersion.WithKind("ServiceAccount") - -// Get takes name of the serviceAccount, and returns the corresponding serviceAccount object, and an error if there is any. -func (c *FakeServiceAccounts) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceAccount, err error) { - emptyResult := &v1.ServiceAccount{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(serviceaccountsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ServiceAccount), err -} - -// List takes label and field selectors, and returns the list of ServiceAccounts that match those selectors. -func (c *FakeServiceAccounts) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceAccountList, err error) { - emptyResult := &v1.ServiceAccountList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(serviceaccountsResource, serviceaccountsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.ServiceAccountList{ListMeta: obj.(*v1.ServiceAccountList).ListMeta} - for _, item := range obj.(*v1.ServiceAccountList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested serviceAccounts. -func (c *FakeServiceAccounts) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(serviceaccountsResource, c.ns, opts)) - -} - -// Create takes the representation of a serviceAccount and creates it. Returns the server's representation of the serviceAccount, and an error, if there is any. -func (c *FakeServiceAccounts) Create(ctx context.Context, serviceAccount *v1.ServiceAccount, opts metav1.CreateOptions) (result *v1.ServiceAccount, err error) { - emptyResult := &v1.ServiceAccount{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(serviceaccountsResource, c.ns, serviceAccount, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ServiceAccount), err -} - -// Update takes the representation of a serviceAccount and updates it. Returns the server's representation of the serviceAccount, and an error, if there is any. -func (c *FakeServiceAccounts) Update(ctx context.Context, serviceAccount *v1.ServiceAccount, opts metav1.UpdateOptions) (result *v1.ServiceAccount, err error) { - emptyResult := &v1.ServiceAccount{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(serviceaccountsResource, c.ns, serviceAccount, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ServiceAccount), err -} - -// Delete takes name of the serviceAccount and deletes it. Returns an error if one occurs. -func (c *FakeServiceAccounts) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(serviceaccountsResource, c.ns, name, opts), &v1.ServiceAccount{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeServiceAccounts) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(serviceaccountsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.ServiceAccountList{}) - return err -} - -// Patch applies the patch and returns the patched serviceAccount. -func (c *FakeServiceAccounts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceAccount, err error) { - emptyResult := &v1.ServiceAccount{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(serviceaccountsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ServiceAccount), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied serviceAccount. -func (c *FakeServiceAccounts) Apply(ctx context.Context, serviceAccount *corev1.ServiceAccountApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ServiceAccount, err error) { - if serviceAccount == nil { - return nil, fmt.Errorf("serviceAccount provided to Apply must not be nil") - } - data, err := json.Marshal(serviceAccount) - if err != nil { - return nil, err - } - name := serviceAccount.Name - if name == nil { - return nil, fmt.Errorf("serviceAccount.Name must be provided to Apply") - } - emptyResult := &v1.ServiceAccount{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(serviceaccountsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ServiceAccount), err -} - -// CreateToken takes the representation of a tokenRequest and creates it. Returns the server's representation of the tokenRequest, and an error, if there is any. -func (c *FakeServiceAccounts) CreateToken(ctx context.Context, serviceAccountName string, tokenRequest *authenticationv1.TokenRequest, opts metav1.CreateOptions) (result *authenticationv1.TokenRequest, err error) { - emptyResult := &authenticationv1.TokenRequest{} - obj, err := c.Fake. - Invokes(testing.NewCreateSubresourceActionWithOptions(serviceaccountsResource, serviceAccountName, "token", c.ns, tokenRequest, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*authenticationv1.TokenRequest), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1/fake/fake_discovery_client.go b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1/fake/fake_discovery_client.go deleted file mode 100644 index 1ca9b23f5..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1/fake/fake_discovery_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/client-go/kubernetes/typed/discovery/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeDiscoveryV1 struct { - *testing.Fake -} - -func (c *FakeDiscoveryV1) EndpointSlices(namespace string) v1.EndpointSliceInterface { - return &FakeEndpointSlices{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeDiscoveryV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1/fake/fake_endpointslice.go b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1/fake/fake_endpointslice.go deleted file mode 100644 index 6bbbde82e..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1/fake/fake_endpointslice.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/discovery/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - discoveryv1 "k8s.io/client-go/applyconfigurations/discovery/v1" - testing "k8s.io/client-go/testing" -) - -// FakeEndpointSlices implements EndpointSliceInterface -type FakeEndpointSlices struct { - Fake *FakeDiscoveryV1 - ns string -} - -var endpointslicesResource = v1.SchemeGroupVersion.WithResource("endpointslices") - -var endpointslicesKind = v1.SchemeGroupVersion.WithKind("EndpointSlice") - -// Get takes name of the endpointSlice, and returns the corresponding endpointSlice object, and an error if there is any. -func (c *FakeEndpointSlices) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.EndpointSlice, err error) { - emptyResult := &v1.EndpointSlice{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(endpointslicesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.EndpointSlice), err -} - -// List takes label and field selectors, and returns the list of EndpointSlices that match those selectors. -func (c *FakeEndpointSlices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointSliceList, err error) { - emptyResult := &v1.EndpointSliceList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(endpointslicesResource, endpointslicesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.EndpointSliceList{ListMeta: obj.(*v1.EndpointSliceList).ListMeta} - for _, item := range obj.(*v1.EndpointSliceList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested endpointSlices. -func (c *FakeEndpointSlices) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(endpointslicesResource, c.ns, opts)) - -} - -// Create takes the representation of a endpointSlice and creates it. Returns the server's representation of the endpointSlice, and an error, if there is any. -func (c *FakeEndpointSlices) Create(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.CreateOptions) (result *v1.EndpointSlice, err error) { - emptyResult := &v1.EndpointSlice{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(endpointslicesResource, c.ns, endpointSlice, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.EndpointSlice), err -} - -// Update takes the representation of a endpointSlice and updates it. Returns the server's representation of the endpointSlice, and an error, if there is any. -func (c *FakeEndpointSlices) Update(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.UpdateOptions) (result *v1.EndpointSlice, err error) { - emptyResult := &v1.EndpointSlice{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(endpointslicesResource, c.ns, endpointSlice, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.EndpointSlice), err -} - -// Delete takes name of the endpointSlice and deletes it. Returns an error if one occurs. -func (c *FakeEndpointSlices) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(endpointslicesResource, c.ns, name, opts), &v1.EndpointSlice{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeEndpointSlices) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(endpointslicesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.EndpointSliceList{}) - return err -} - -// Patch applies the patch and returns the patched endpointSlice. -func (c *FakeEndpointSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.EndpointSlice, err error) { - emptyResult := &v1.EndpointSlice{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(endpointslicesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.EndpointSlice), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied endpointSlice. -func (c *FakeEndpointSlices) Apply(ctx context.Context, endpointSlice *discoveryv1.EndpointSliceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.EndpointSlice, err error) { - if endpointSlice == nil { - return nil, fmt.Errorf("endpointSlice provided to Apply must not be nil") - } - data, err := json.Marshal(endpointSlice) - if err != nil { - return nil, err - } - name := endpointSlice.Name - if name == nil { - return nil, fmt.Errorf("endpointSlice.Name must be provided to Apply") - } - emptyResult := &v1.EndpointSlice{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(endpointslicesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.EndpointSlice), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake/fake_discovery_client.go b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake/fake_discovery_client.go deleted file mode 100644 index e285de647..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake/fake_discovery_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "k8s.io/client-go/kubernetes/typed/discovery/v1beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeDiscoveryV1beta1 struct { - *testing.Fake -} - -func (c *FakeDiscoveryV1beta1) EndpointSlices(namespace string) v1beta1.EndpointSliceInterface { - return &FakeEndpointSlices{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeDiscoveryV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake/fake_endpointslice.go b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake/fake_endpointslice.go deleted file mode 100644 index 65cf69b9d..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake/fake_endpointslice.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/discovery/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - discoveryv1beta1 "k8s.io/client-go/applyconfigurations/discovery/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeEndpointSlices implements EndpointSliceInterface -type FakeEndpointSlices struct { - Fake *FakeDiscoveryV1beta1 - ns string -} - -var endpointslicesResource = v1beta1.SchemeGroupVersion.WithResource("endpointslices") - -var endpointslicesKind = v1beta1.SchemeGroupVersion.WithKind("EndpointSlice") - -// Get takes name of the endpointSlice, and returns the corresponding endpointSlice object, and an error if there is any. -func (c *FakeEndpointSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.EndpointSlice, err error) { - emptyResult := &v1beta1.EndpointSlice{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(endpointslicesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.EndpointSlice), err -} - -// List takes label and field selectors, and returns the list of EndpointSlices that match those selectors. -func (c *FakeEndpointSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EndpointSliceList, err error) { - emptyResult := &v1beta1.EndpointSliceList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(endpointslicesResource, endpointslicesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.EndpointSliceList{ListMeta: obj.(*v1beta1.EndpointSliceList).ListMeta} - for _, item := range obj.(*v1beta1.EndpointSliceList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested endpointSlices. -func (c *FakeEndpointSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(endpointslicesResource, c.ns, opts)) - -} - -// Create takes the representation of a endpointSlice and creates it. Returns the server's representation of the endpointSlice, and an error, if there is any. -func (c *FakeEndpointSlices) Create(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.CreateOptions) (result *v1beta1.EndpointSlice, err error) { - emptyResult := &v1beta1.EndpointSlice{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(endpointslicesResource, c.ns, endpointSlice, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.EndpointSlice), err -} - -// Update takes the representation of a endpointSlice and updates it. Returns the server's representation of the endpointSlice, and an error, if there is any. -func (c *FakeEndpointSlices) Update(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.UpdateOptions) (result *v1beta1.EndpointSlice, err error) { - emptyResult := &v1beta1.EndpointSlice{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(endpointslicesResource, c.ns, endpointSlice, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.EndpointSlice), err -} - -// Delete takes name of the endpointSlice and deletes it. Returns an error if one occurs. -func (c *FakeEndpointSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(endpointslicesResource, c.ns, name, opts), &v1beta1.EndpointSlice{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeEndpointSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(endpointslicesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.EndpointSliceList{}) - return err -} - -// Patch applies the patch and returns the patched endpointSlice. -func (c *FakeEndpointSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.EndpointSlice, err error) { - emptyResult := &v1beta1.EndpointSlice{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(endpointslicesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.EndpointSlice), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied endpointSlice. -func (c *FakeEndpointSlices) Apply(ctx context.Context, endpointSlice *discoveryv1beta1.EndpointSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.EndpointSlice, err error) { - if endpointSlice == nil { - return nil, fmt.Errorf("endpointSlice provided to Apply must not be nil") - } - data, err := json.Marshal(endpointSlice) - if err != nil { - return nil, err - } - name := endpointSlice.Name - if name == nil { - return nil, fmt.Errorf("endpointSlice.Name must be provided to Apply") - } - emptyResult := &v1beta1.EndpointSlice{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(endpointslicesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.EndpointSlice), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1/fake/fake_event.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1/fake/fake_event.go deleted file mode 100644 index 1e79eb984..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1/fake/fake_event.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/events/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - eventsv1 "k8s.io/client-go/applyconfigurations/events/v1" - testing "k8s.io/client-go/testing" -) - -// FakeEvents implements EventInterface -type FakeEvents struct { - Fake *FakeEventsV1 - ns string -} - -var eventsResource = v1.SchemeGroupVersion.WithResource("events") - -var eventsKind = v1.SchemeGroupVersion.WithKind("Event") - -// Get takes name of the event, and returns the corresponding event object, and an error if there is any. -func (c *FakeEvents) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Event, err error) { - emptyResult := &v1.Event{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(eventsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Event), err -} - -// List takes label and field selectors, and returns the list of Events that match those selectors. -func (c *FakeEvents) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { - emptyResult := &v1.EventList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(eventsResource, eventsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.EventList{ListMeta: obj.(*v1.EventList).ListMeta} - for _, item := range obj.(*v1.EventList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested events. -func (c *FakeEvents) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(eventsResource, c.ns, opts)) - -} - -// Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. -func (c *FakeEvents) Create(ctx context.Context, event *v1.Event, opts metav1.CreateOptions) (result *v1.Event, err error) { - emptyResult := &v1.Event{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(eventsResource, c.ns, event, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Event), err -} - -// Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. -func (c *FakeEvents) Update(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (result *v1.Event, err error) { - emptyResult := &v1.Event{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(eventsResource, c.ns, event, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Event), err -} - -// Delete takes name of the event and deletes it. Returns an error if one occurs. -func (c *FakeEvents) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(eventsResource, c.ns, name, opts), &v1.Event{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeEvents) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(eventsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.EventList{}) - return err -} - -// Patch applies the patch and returns the patched event. -func (c *FakeEvents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Event, err error) { - emptyResult := &v1.Event{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(eventsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Event), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied event. -func (c *FakeEvents) Apply(ctx context.Context, event *eventsv1.EventApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Event, err error) { - if event == nil { - return nil, fmt.Errorf("event provided to Apply must not be nil") - } - data, err := json.Marshal(event) - if err != nil { - return nil, err - } - name := event.Name - if name == nil { - return nil, fmt.Errorf("event.Name must be provided to Apply") - } - emptyResult := &v1.Event{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(eventsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Event), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1/fake/fake_events_client.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1/fake/fake_events_client.go deleted file mode 100644 index 95ef2b307..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1/fake/fake_events_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/client-go/kubernetes/typed/events/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeEventsV1 struct { - *testing.Fake -} - -func (c *FakeEventsV1) Events(namespace string) v1.EventInterface { - return &FakeEvents{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeEventsV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event.go deleted file mode 100644 index b00f2126a..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/events/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - eventsv1beta1 "k8s.io/client-go/applyconfigurations/events/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeEvents implements EventInterface -type FakeEvents struct { - Fake *FakeEventsV1beta1 - ns string -} - -var eventsResource = v1beta1.SchemeGroupVersion.WithResource("events") - -var eventsKind = v1beta1.SchemeGroupVersion.WithKind("Event") - -// Get takes name of the event, and returns the corresponding event object, and an error if there is any. -func (c *FakeEvents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Event, err error) { - emptyResult := &v1beta1.Event{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(eventsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Event), err -} - -// List takes label and field selectors, and returns the list of Events that match those selectors. -func (c *FakeEvents) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EventList, err error) { - emptyResult := &v1beta1.EventList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(eventsResource, eventsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.EventList{ListMeta: obj.(*v1beta1.EventList).ListMeta} - for _, item := range obj.(*v1beta1.EventList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested events. -func (c *FakeEvents) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(eventsResource, c.ns, opts)) - -} - -// Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. -func (c *FakeEvents) Create(ctx context.Context, event *v1beta1.Event, opts v1.CreateOptions) (result *v1beta1.Event, err error) { - emptyResult := &v1beta1.Event{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(eventsResource, c.ns, event, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Event), err -} - -// Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. -func (c *FakeEvents) Update(ctx context.Context, event *v1beta1.Event, opts v1.UpdateOptions) (result *v1beta1.Event, err error) { - emptyResult := &v1beta1.Event{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(eventsResource, c.ns, event, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Event), err -} - -// Delete takes name of the event and deletes it. Returns an error if one occurs. -func (c *FakeEvents) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(eventsResource, c.ns, name, opts), &v1beta1.Event{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeEvents) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(eventsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.EventList{}) - return err -} - -// Patch applies the patch and returns the patched event. -func (c *FakeEvents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Event, err error) { - emptyResult := &v1beta1.Event{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(eventsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Event), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied event. -func (c *FakeEvents) Apply(ctx context.Context, event *eventsv1beta1.EventApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Event, err error) { - if event == nil { - return nil, fmt.Errorf("event provided to Apply must not be nil") - } - data, err := json.Marshal(event) - if err != nil { - return nil, err - } - name := event.Name - if name == nil { - return nil, fmt.Errorf("event.Name must be provided to Apply") - } - emptyResult := &v1beta1.Event{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(eventsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Event), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event_expansion.go deleted file mode 100644 index 19c1b4415..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event_expansion.go +++ /dev/null @@ -1,66 +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 fake - -import ( - v1beta1 "k8s.io/api/events/v1beta1" - types "k8s.io/apimachinery/pkg/types" - core "k8s.io/client-go/testing" -) - -// CreateWithEventNamespace creats a new event. Returns the copy of the event the server returns, or an error. -func (c *FakeEvents) CreateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event, error) { - action := core.NewRootCreateAction(eventsResource, event) - if c.ns != "" { - action = core.NewCreateAction(eventsResource, c.ns, event) - } - obj, err := c.Fake.Invokes(action, event) - if obj == nil { - return nil, err - } - - return obj.(*v1beta1.Event), err -} - -// UpdateWithEventNamespace replaces an existing event. Returns the copy of the event the server returns, or an error. -func (c *FakeEvents) UpdateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event, error) { - action := core.NewRootUpdateAction(eventsResource, event) - if c.ns != "" { - action = core.NewUpdateAction(eventsResource, c.ns, event) - } - obj, err := c.Fake.Invokes(action, event) - if obj == nil { - return nil, err - } - - return obj.(*v1beta1.Event), err -} - -// PatchWithEventNamespace patches an existing event. Returns the copy of the event the server returns, or an error. -func (c *FakeEvents) PatchWithEventNamespace(event *v1beta1.Event, data []byte) (*v1beta1.Event, error) { - pt := types.StrategicMergePatchType - action := core.NewRootPatchAction(eventsResource, event.Name, pt, data) - if c.ns != "" { - action = core.NewPatchAction(eventsResource, c.ns, event.Name, pt, data) - } - obj, err := c.Fake.Invokes(action, event) - if obj == nil { - return nil, err - } - - return obj.(*v1beta1.Event), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_events_client.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_events_client.go deleted file mode 100644 index 875c774e3..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_events_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "k8s.io/client-go/kubernetes/typed/events/v1beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeEventsV1beta1 struct { - *testing.Fake -} - -func (c *FakeEventsV1beta1) Events(namespace string) v1beta1.EventInterface { - return &FakeEvents{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeEventsV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go deleted file mode 100644 index f14943082..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/extensions/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeDaemonSets implements DaemonSetInterface -type FakeDaemonSets struct { - Fake *FakeExtensionsV1beta1 - ns string -} - -var daemonsetsResource = v1beta1.SchemeGroupVersion.WithResource("daemonsets") - -var daemonsetsKind = v1beta1.SchemeGroupVersion.WithKind("DaemonSet") - -// Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any. -func (c *FakeDaemonSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.DaemonSet, err error) { - emptyResult := &v1beta1.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(daemonsetsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.DaemonSet), err -} - -// List takes label and field selectors, and returns the list of DaemonSets that match those selectors. -func (c *FakeDaemonSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DaemonSetList, err error) { - emptyResult := &v1beta1.DaemonSetList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(daemonsetsResource, daemonsetsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.DaemonSetList{ListMeta: obj.(*v1beta1.DaemonSetList).ListMeta} - for _, item := range obj.(*v1beta1.DaemonSetList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested daemonSets. -func (c *FakeDaemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(daemonsetsResource, c.ns, opts)) - -} - -// Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any. -func (c *FakeDaemonSets) Create(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.CreateOptions) (result *v1beta1.DaemonSet, err error) { - emptyResult := &v1beta1.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.DaemonSet), err -} - -// Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any. -func (c *FakeDaemonSets) Update(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (result *v1beta1.DaemonSet, err error) { - emptyResult := &v1beta1.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.DaemonSet), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (result *v1beta1.DaemonSet, err error) { - emptyResult := &v1beta1.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(daemonsetsResource, "status", c.ns, daemonSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.DaemonSet), err -} - -// Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. -func (c *FakeDaemonSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(daemonsetsResource, c.ns, name, opts), &v1beta1.DaemonSet{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(daemonsetsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.DaemonSetList{}) - return err -} - -// Patch applies the patch and returns the patched daemonSet. -func (c *FakeDaemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.DaemonSet, err error) { - emptyResult := &v1beta1.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.DaemonSet), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied daemonSet. -func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *extensionsv1beta1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.DaemonSet, err error) { - if daemonSet == nil { - return nil, fmt.Errorf("daemonSet provided to Apply must not be nil") - } - data, err := json.Marshal(daemonSet) - if err != nil { - return nil, err - } - name := daemonSet.Name - if name == nil { - return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") - } - emptyResult := &v1beta1.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.DaemonSet), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *extensionsv1beta1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.DaemonSet, err error) { - if daemonSet == nil { - return nil, fmt.Errorf("daemonSet provided to Apply must not be nil") - } - data, err := json.Marshal(daemonSet) - if err != nil { - return nil, err - } - name := daemonSet.Name - if name == nil { - return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") - } - emptyResult := &v1beta1.DaemonSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.DaemonSet), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go deleted file mode 100644 index b81d4a96c..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go +++ /dev/null @@ -1,241 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/extensions/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeDeployments implements DeploymentInterface -type FakeDeployments struct { - Fake *FakeExtensionsV1beta1 - ns string -} - -var deploymentsResource = v1beta1.SchemeGroupVersion.WithResource("deployments") - -var deploymentsKind = v1beta1.SchemeGroupVersion.WithKind("Deployment") - -// Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. -func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) { - emptyResult := &v1beta1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(deploymentsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Deployment), err -} - -// List takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { - emptyResult := &v1beta1.DeploymentList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.DeploymentList{ListMeta: obj.(*v1beta1.DeploymentList).ListMeta} - for _, item := range obj.(*v1beta1.DeploymentList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested deployments. -func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(deploymentsResource, c.ns, opts)) - -} - -// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (result *v1beta1.Deployment, err error) { - emptyResult := &v1beta1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Deployment), err -} - -// Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { - emptyResult := &v1beta1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Deployment), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { - emptyResult := &v1beta1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "status", c.ns, deployment, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Deployment), err -} - -// Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *FakeDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(deploymentsResource, c.ns, name, opts), &v1beta1.Deployment{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(deploymentsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.DeploymentList{}) - return err -} - -// Patch applies the patch and returns the patched deployment. -func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Deployment, err error) { - emptyResult := &v1beta1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Deployment), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied deployment. -func (c *FakeDeployments) Apply(ctx context.Context, deployment *extensionsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) { - if deployment == nil { - return nil, fmt.Errorf("deployment provided to Apply must not be nil") - } - data, err := json.Marshal(deployment) - if err != nil { - return nil, err - } - name := deployment.Name - if name == nil { - return nil, fmt.Errorf("deployment.Name must be provided to Apply") - } - emptyResult := &v1beta1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Deployment), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *extensionsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) { - if deployment == nil { - return nil, fmt.Errorf("deployment provided to Apply must not be nil") - } - data, err := json.Marshal(deployment) - if err != nil { - return nil, err - } - name := deployment.Name - if name == nil { - return nil, fmt.Errorf("deployment.Name must be provided to Apply") - } - emptyResult := &v1beta1.Deployment{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Deployment), err -} - -// GetScale takes name of the deployment, and returns the corresponding scale object, and an error if there is any. -func (c *FakeDeployments) GetScale(ctx context.Context, deploymentName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { - emptyResult := &v1beta1.Scale{} - obj, err := c.Fake. - Invokes(testing.NewGetSubresourceActionWithOptions(deploymentsResource, c.ns, "scale", deploymentName, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Scale), err -} - -// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *FakeDeployments) UpdateScale(ctx context.Context, deploymentName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (result *v1beta1.Scale, err error) { - emptyResult := &v1beta1.Scale{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "scale", c.ns, scale, opts), &v1beta1.Scale{}) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Scale), err -} - -// ApplyScale takes top resource name and the apply declarative configuration for scale, -// applies it and returns the applied scale, and an error, if there is any. -func (c *FakeDeployments) ApplyScale(ctx context.Context, deploymentName string, scale *extensionsv1beta1.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Scale, err error) { - if scale == nil { - return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") - } - data, err := json.Marshal(scale) - if err != nil { - return nil, err - } - emptyResult := &v1beta1.Scale{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Scale), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment_expansion.go deleted file mode 100644 index 6ea1acd85..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment_expansion.go +++ /dev/null @@ -1,36 +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 fake - -import ( - "context" - - "k8s.io/api/extensions/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - core "k8s.io/client-go/testing" -) - -func (c *FakeDeployments) Rollback(ctx context.Context, deploymentRollback *v1beta1.DeploymentRollback, opts metav1.CreateOptions) error { - action := core.CreateActionImpl{} - action.Verb = "create" - action.Resource = deploymentsResource - action.Subresource = "rollback" - action.Object = deploymentRollback - - _, err := c.Fake.Invokes(action, deploymentRollback) - return err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_extensions_client.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_extensions_client.go deleted file mode 100644 index a54c182ea..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_extensions_client.go +++ /dev/null @@ -1,56 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeExtensionsV1beta1 struct { - *testing.Fake -} - -func (c *FakeExtensionsV1beta1) DaemonSets(namespace string) v1beta1.DaemonSetInterface { - return &FakeDaemonSets{c, namespace} -} - -func (c *FakeExtensionsV1beta1) Deployments(namespace string) v1beta1.DeploymentInterface { - return &FakeDeployments{c, namespace} -} - -func (c *FakeExtensionsV1beta1) Ingresses(namespace string) v1beta1.IngressInterface { - return &FakeIngresses{c, namespace} -} - -func (c *FakeExtensionsV1beta1) NetworkPolicies(namespace string) v1beta1.NetworkPolicyInterface { - return &FakeNetworkPolicies{c, namespace} -} - -func (c *FakeExtensionsV1beta1) ReplicaSets(namespace string) v1beta1.ReplicaSetInterface { - return &FakeReplicaSets{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeExtensionsV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go deleted file mode 100644 index ae95682fc..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/extensions/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeIngresses implements IngressInterface -type FakeIngresses struct { - Fake *FakeExtensionsV1beta1 - ns string -} - -var ingressesResource = v1beta1.SchemeGroupVersion.WithResource("ingresses") - -var ingressesKind = v1beta1.SchemeGroupVersion.WithKind("Ingress") - -// Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. -func (c *FakeIngresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Ingress, err error) { - emptyResult := &v1beta1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(ingressesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Ingress), err -} - -// List takes label and field selectors, and returns the list of Ingresses that match those selectors. -func (c *FakeIngresses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { - emptyResult := &v1beta1.IngressList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(ingressesResource, ingressesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.IngressList{ListMeta: obj.(*v1beta1.IngressList).ListMeta} - for _, item := range obj.(*v1beta1.IngressList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested ingresses. -func (c *FakeIngresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(ingressesResource, c.ns, opts)) - -} - -// Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. -func (c *FakeIngresses) Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (result *v1beta1.Ingress, err error) { - emptyResult := &v1beta1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(ingressesResource, c.ns, ingress, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Ingress), err -} - -// Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. -func (c *FakeIngresses) Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { - emptyResult := &v1beta1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(ingressesResource, c.ns, ingress, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Ingress), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeIngresses) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { - emptyResult := &v1beta1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(ingressesResource, "status", c.ns, ingress, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Ingress), err -} - -// Delete takes name of the ingress and deletes it. Returns an error if one occurs. -func (c *FakeIngresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(ingressesResource, c.ns, name, opts), &v1beta1.Ingress{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(ingressesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.IngressList{}) - return err -} - -// Patch applies the patch and returns the patched ingress. -func (c *FakeIngresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Ingress, err error) { - emptyResult := &v1beta1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Ingress), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied ingress. -func (c *FakeIngresses) Apply(ctx context.Context, ingress *extensionsv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) { - if ingress == nil { - return nil, fmt.Errorf("ingress provided to Apply must not be nil") - } - data, err := json.Marshal(ingress) - if err != nil { - return nil, err - } - name := ingress.Name - if name == nil { - return nil, fmt.Errorf("ingress.Name must be provided to Apply") - } - emptyResult := &v1beta1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Ingress), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeIngresses) ApplyStatus(ctx context.Context, ingress *extensionsv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) { - if ingress == nil { - return nil, fmt.Errorf("ingress provided to Apply must not be nil") - } - data, err := json.Marshal(ingress) - if err != nil { - return nil, err - } - name := ingress.Name - if name == nil { - return nil, fmt.Errorf("ingress.Name must be provided to Apply") - } - emptyResult := &v1beta1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Ingress), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_networkpolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_networkpolicy.go deleted file mode 100644 index d829a0c63..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_networkpolicy.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/extensions/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeNetworkPolicies implements NetworkPolicyInterface -type FakeNetworkPolicies struct { - Fake *FakeExtensionsV1beta1 - ns string -} - -var networkpoliciesResource = v1beta1.SchemeGroupVersion.WithResource("networkpolicies") - -var networkpoliciesKind = v1beta1.SchemeGroupVersion.WithKind("NetworkPolicy") - -// Get takes name of the networkPolicy, and returns the corresponding networkPolicy object, and an error if there is any. -func (c *FakeNetworkPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.NetworkPolicy, err error) { - emptyResult := &v1beta1.NetworkPolicy{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(networkpoliciesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.NetworkPolicy), err -} - -// List takes label and field selectors, and returns the list of NetworkPolicies that match those selectors. -func (c *FakeNetworkPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.NetworkPolicyList, err error) { - emptyResult := &v1beta1.NetworkPolicyList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(networkpoliciesResource, networkpoliciesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.NetworkPolicyList{ListMeta: obj.(*v1beta1.NetworkPolicyList).ListMeta} - for _, item := range obj.(*v1beta1.NetworkPolicyList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested networkPolicies. -func (c *FakeNetworkPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(networkpoliciesResource, c.ns, opts)) - -} - -// Create takes the representation of a networkPolicy and creates it. Returns the server's representation of the networkPolicy, and an error, if there is any. -func (c *FakeNetworkPolicies) Create(ctx context.Context, networkPolicy *v1beta1.NetworkPolicy, opts v1.CreateOptions) (result *v1beta1.NetworkPolicy, err error) { - emptyResult := &v1beta1.NetworkPolicy{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(networkpoliciesResource, c.ns, networkPolicy, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.NetworkPolicy), err -} - -// Update takes the representation of a networkPolicy and updates it. Returns the server's representation of the networkPolicy, and an error, if there is any. -func (c *FakeNetworkPolicies) Update(ctx context.Context, networkPolicy *v1beta1.NetworkPolicy, opts v1.UpdateOptions) (result *v1beta1.NetworkPolicy, err error) { - emptyResult := &v1beta1.NetworkPolicy{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(networkpoliciesResource, c.ns, networkPolicy, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.NetworkPolicy), err -} - -// Delete takes name of the networkPolicy and deletes it. Returns an error if one occurs. -func (c *FakeNetworkPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(networkpoliciesResource, c.ns, name, opts), &v1beta1.NetworkPolicy{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeNetworkPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(networkpoliciesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.NetworkPolicyList{}) - return err -} - -// Patch applies the patch and returns the patched networkPolicy. -func (c *FakeNetworkPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.NetworkPolicy, err error) { - emptyResult := &v1beta1.NetworkPolicy{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(networkpoliciesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.NetworkPolicy), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied networkPolicy. -func (c *FakeNetworkPolicies) Apply(ctx context.Context, networkPolicy *extensionsv1beta1.NetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.NetworkPolicy, err error) { - if networkPolicy == nil { - return nil, fmt.Errorf("networkPolicy provided to Apply must not be nil") - } - data, err := json.Marshal(networkPolicy) - if err != nil { - return nil, err - } - name := networkPolicy.Name - if name == nil { - return nil, fmt.Errorf("networkPolicy.Name must be provided to Apply") - } - emptyResult := &v1beta1.NetworkPolicy{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(networkpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.NetworkPolicy), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go deleted file mode 100644 index 5d94ba73b..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go +++ /dev/null @@ -1,241 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/extensions/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeReplicaSets implements ReplicaSetInterface -type FakeReplicaSets struct { - Fake *FakeExtensionsV1beta1 - ns string -} - -var replicasetsResource = v1beta1.SchemeGroupVersion.WithResource("replicasets") - -var replicasetsKind = v1beta1.SchemeGroupVersion.WithKind("ReplicaSet") - -// Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. -func (c *FakeReplicaSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ReplicaSet, err error) { - emptyResult := &v1beta1.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(replicasetsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ReplicaSet), err -} - -// List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. -func (c *FakeReplicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ReplicaSetList, err error) { - emptyResult := &v1beta1.ReplicaSetList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(replicasetsResource, replicasetsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.ReplicaSetList{ListMeta: obj.(*v1beta1.ReplicaSetList).ListMeta} - for _, item := range obj.(*v1beta1.ReplicaSetList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested replicaSets. -func (c *FakeReplicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(replicasetsResource, c.ns, opts)) - -} - -// Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.CreateOptions) (result *v1beta1.ReplicaSet, err error) { - emptyResult := &v1beta1.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ReplicaSet), err -} - -// Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (result *v1beta1.ReplicaSet, err error) { - emptyResult := &v1beta1.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ReplicaSet), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (result *v1beta1.ReplicaSet, err error) { - emptyResult := &v1beta1.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(replicasetsResource, "status", c.ns, replicaSet, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ReplicaSet), err -} - -// Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. -func (c *FakeReplicaSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(replicasetsResource, c.ns, name, opts), &v1beta1.ReplicaSet{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(replicasetsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.ReplicaSetList{}) - return err -} - -// Patch applies the patch and returns the patched replicaSet. -func (c *FakeReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ReplicaSet, err error) { - emptyResult := &v1beta1.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ReplicaSet), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied replicaSet. -func (c *FakeReplicaSets) Apply(ctx context.Context, replicaSet *extensionsv1beta1.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ReplicaSet, err error) { - if replicaSet == nil { - return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") - } - data, err := json.Marshal(replicaSet) - if err != nil { - return nil, err - } - name := replicaSet.Name - if name == nil { - return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") - } - emptyResult := &v1beta1.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ReplicaSet), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *extensionsv1beta1.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ReplicaSet, err error) { - if replicaSet == nil { - return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") - } - data, err := json.Marshal(replicaSet) - if err != nil { - return nil, err - } - name := replicaSet.Name - if name == nil { - return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") - } - emptyResult := &v1beta1.ReplicaSet{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ReplicaSet), err -} - -// GetScale takes name of the replicaSet, and returns the corresponding scale object, and an error if there is any. -func (c *FakeReplicaSets) GetScale(ctx context.Context, replicaSetName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { - emptyResult := &v1beta1.Scale{} - obj, err := c.Fake. - Invokes(testing.NewGetSubresourceActionWithOptions(replicasetsResource, c.ns, "scale", replicaSetName, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Scale), err -} - -// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *FakeReplicaSets) UpdateScale(ctx context.Context, replicaSetName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (result *v1beta1.Scale, err error) { - emptyResult := &v1beta1.Scale{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(replicasetsResource, "scale", c.ns, scale, opts), &v1beta1.Scale{}) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Scale), err -} - -// ApplyScale takes top resource name and the apply declarative configuration for scale, -// applies it and returns the applied scale, and an error, if there is any. -func (c *FakeReplicaSets) ApplyScale(ctx context.Context, replicaSetName string, scale *extensionsv1beta1.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Scale, err error) { - if scale == nil { - return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") - } - data, err := json.Marshal(scale) - if err != nil { - return nil, err - } - emptyResult := &v1beta1.Scale{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Scale), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowcontrol_client.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowcontrol_client.go deleted file mode 100644 index d15f4b242..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowcontrol_client.go +++ /dev/null @@ -1,44 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeFlowcontrolV1 struct { - *testing.Fake -} - -func (c *FakeFlowcontrolV1) FlowSchemas() v1.FlowSchemaInterface { - return &FakeFlowSchemas{c} -} - -func (c *FakeFlowcontrolV1) PriorityLevelConfigurations() v1.PriorityLevelConfigurationInterface { - return &FakePriorityLevelConfigurations{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeFlowcontrolV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowschema.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowschema.go deleted file mode 100644 index bf2b63fb2..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowschema.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/flowcontrol/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - flowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" - testing "k8s.io/client-go/testing" -) - -// FakeFlowSchemas implements FlowSchemaInterface -type FakeFlowSchemas struct { - Fake *FakeFlowcontrolV1 -} - -var flowschemasResource = v1.SchemeGroupVersion.WithResource("flowschemas") - -var flowschemasKind = v1.SchemeGroupVersion.WithKind("FlowSchema") - -// Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. -func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.FlowSchema, err error) { - emptyResult := &v1.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(flowschemasResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.FlowSchema), err -} - -// List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *FakeFlowSchemas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FlowSchemaList, err error) { - emptyResult := &v1.FlowSchemaList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(flowschemasResource, flowschemasKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.FlowSchemaList{ListMeta: obj.(*v1.FlowSchemaList).ListMeta} - for _, item := range obj.(*v1.FlowSchemaList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested flowSchemas. -func (c *FakeFlowSchemas) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(flowschemasResource, opts)) -} - -// Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.CreateOptions) (result *v1.FlowSchema, err error) { - emptyResult := &v1.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.FlowSchema), err -} - -// Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (result *v1.FlowSchema, err error) { - emptyResult := &v1.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.FlowSchema), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (result *v1.FlowSchema, err error) { - emptyResult := &v1.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(flowschemasResource, "status", flowSchema, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.FlowSchema), err -} - -// Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. -func (c *FakeFlowSchemas) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(flowschemasResource, name, opts), &v1.FlowSchema{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(flowschemasResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.FlowSchemaList{}) - return err -} - -// Patch applies the patch and returns the patched flowSchema. -func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FlowSchema, err error) { - emptyResult := &v1.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.FlowSchema), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied flowSchema. -func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) { - if flowSchema == nil { - return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") - } - data, err := json.Marshal(flowSchema) - if err != nil { - return nil, err - } - name := flowSchema.Name - if name == nil { - return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") - } - emptyResult := &v1.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.FlowSchema), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) { - if flowSchema == nil { - return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") - } - data, err := json.Marshal(flowSchema) - if err != nil { - return nil, err - } - name := flowSchema.Name - if name == nil { - return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") - } - emptyResult := &v1.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.FlowSchema), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go deleted file mode 100644 index 053de56ed..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/flowcontrol/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - flowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" - testing "k8s.io/client-go/testing" -) - -// FakePriorityLevelConfigurations implements PriorityLevelConfigurationInterface -type FakePriorityLevelConfigurations struct { - Fake *FakeFlowcontrolV1 -} - -var prioritylevelconfigurationsResource = v1.SchemeGroupVersion.WithResource("prioritylevelconfigurations") - -var prioritylevelconfigurationsKind = v1.SchemeGroupVersion.WithKind("PriorityLevelConfiguration") - -// Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. -func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PriorityLevelConfiguration, err error) { - emptyResult := &v1.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(prioritylevelconfigurationsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PriorityLevelConfiguration), err -} - -// List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityLevelConfigurationList, err error) { - emptyResult := &v1.PriorityLevelConfigurationList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.PriorityLevelConfigurationList{ListMeta: obj.(*v1.PriorityLevelConfigurationList).ListMeta} - for _, item := range obj.(*v1.PriorityLevelConfigurationList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. -func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(prioritylevelconfigurationsResource, opts)) -} - -// Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.CreateOptions) (result *v1.PriorityLevelConfiguration, err error) { - emptyResult := &v1.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PriorityLevelConfiguration), err -} - -// Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (result *v1.PriorityLevelConfiguration, err error) { - emptyResult := &v1.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PriorityLevelConfiguration), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (result *v1.PriorityLevelConfiguration, err error) { - emptyResult := &v1.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PriorityLevelConfiguration), err -} - -// Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. -func (c *FakePriorityLevelConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(prioritylevelconfigurationsResource, name, opts), &v1.PriorityLevelConfiguration{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(prioritylevelconfigurationsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.PriorityLevelConfigurationList{}) - return err -} - -// Patch applies the patch and returns the patched priorityLevelConfiguration. -func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityLevelConfiguration, err error) { - emptyResult := &v1.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PriorityLevelConfiguration), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied priorityLevelConfiguration. -func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) { - if priorityLevelConfiguration == nil { - return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") - } - data, err := json.Marshal(priorityLevelConfiguration) - if err != nil { - return nil, err - } - name := priorityLevelConfiguration.Name - if name == nil { - return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") - } - emptyResult := &v1.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PriorityLevelConfiguration), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) { - if priorityLevelConfiguration == nil { - return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") - } - data, err := json.Marshal(priorityLevelConfiguration) - if err != nil { - return nil, err - } - name := priorityLevelConfiguration.Name - if name == nil { - return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") - } - emptyResult := &v1.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PriorityLevelConfiguration), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake/fake_flowcontrol_client.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake/fake_flowcontrol_client.go deleted file mode 100644 index 1bd58d088..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake/fake_flowcontrol_client.go +++ /dev/null @@ -1,44 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeFlowcontrolV1beta1 struct { - *testing.Fake -} - -func (c *FakeFlowcontrolV1beta1) FlowSchemas() v1beta1.FlowSchemaInterface { - return &FakeFlowSchemas{c} -} - -func (c *FakeFlowcontrolV1beta1) PriorityLevelConfigurations() v1beta1.PriorityLevelConfigurationInterface { - return &FakePriorityLevelConfigurations{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeFlowcontrolV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake/fake_flowschema.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake/fake_flowschema.go deleted file mode 100644 index 8b4435a8a..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake/fake_flowschema.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/flowcontrol/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - flowcontrolv1beta1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeFlowSchemas implements FlowSchemaInterface -type FakeFlowSchemas struct { - Fake *FakeFlowcontrolV1beta1 -} - -var flowschemasResource = v1beta1.SchemeGroupVersion.WithResource("flowschemas") - -var flowschemasKind = v1beta1.SchemeGroupVersion.WithKind("FlowSchema") - -// Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. -func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.FlowSchema, err error) { - emptyResult := &v1beta1.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(flowschemasResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.FlowSchema), err -} - -// List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *FakeFlowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.FlowSchemaList, err error) { - emptyResult := &v1beta1.FlowSchemaList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(flowschemasResource, flowschemasKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.FlowSchemaList{ListMeta: obj.(*v1beta1.FlowSchemaList).ListMeta} - for _, item := range obj.(*v1beta1.FlowSchemaList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested flowSchemas. -func (c *FakeFlowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(flowschemasResource, opts)) -} - -// Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.CreateOptions) (result *v1beta1.FlowSchema, err error) { - emptyResult := &v1beta1.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.FlowSchema), err -} - -// Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.UpdateOptions) (result *v1beta1.FlowSchema, err error) { - emptyResult := &v1beta1.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.FlowSchema), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.UpdateOptions) (result *v1beta1.FlowSchema, err error) { - emptyResult := &v1beta1.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(flowschemasResource, "status", flowSchema, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.FlowSchema), err -} - -// Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. -func (c *FakeFlowSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(flowschemasResource, name, opts), &v1beta1.FlowSchema{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(flowschemasResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.FlowSchemaList{}) - return err -} - -// Patch applies the patch and returns the patched flowSchema. -func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.FlowSchema, err error) { - emptyResult := &v1beta1.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.FlowSchema), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied flowSchema. -func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1beta1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.FlowSchema, err error) { - if flowSchema == nil { - return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") - } - data, err := json.Marshal(flowSchema) - if err != nil { - return nil, err - } - name := flowSchema.Name - if name == nil { - return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") - } - emptyResult := &v1beta1.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.FlowSchema), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1beta1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.FlowSchema, err error) { - if flowSchema == nil { - return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") - } - data, err := json.Marshal(flowSchema) - if err != nil { - return nil, err - } - name := flowSchema.Name - if name == nil { - return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") - } - emptyResult := &v1beta1.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.FlowSchema), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake/fake_prioritylevelconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake/fake_prioritylevelconfiguration.go deleted file mode 100644 index e139e4dce..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake/fake_prioritylevelconfiguration.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/flowcontrol/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - flowcontrolv1beta1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakePriorityLevelConfigurations implements PriorityLevelConfigurationInterface -type FakePriorityLevelConfigurations struct { - Fake *FakeFlowcontrolV1beta1 -} - -var prioritylevelconfigurationsResource = v1beta1.SchemeGroupVersion.WithResource("prioritylevelconfigurations") - -var prioritylevelconfigurationsKind = v1beta1.SchemeGroupVersion.WithKind("PriorityLevelConfiguration") - -// Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. -func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { - emptyResult := &v1beta1.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(prioritylevelconfigurationsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.PriorityLevelConfiguration), err -} - -// List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityLevelConfigurationList, err error) { - emptyResult := &v1beta1.PriorityLevelConfigurationList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.PriorityLevelConfigurationList{ListMeta: obj.(*v1beta1.PriorityLevelConfigurationList).ListMeta} - for _, item := range obj.(*v1beta1.PriorityLevelConfigurationList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. -func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(prioritylevelconfigurationsResource, opts)) -} - -// Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { - emptyResult := &v1beta1.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.PriorityLevelConfiguration), err -} - -// Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { - emptyResult := &v1beta1.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.PriorityLevelConfiguration), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { - emptyResult := &v1beta1.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.PriorityLevelConfiguration), err -} - -// Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. -func (c *FakePriorityLevelConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(prioritylevelconfigurationsResource, name, opts), &v1beta1.PriorityLevelConfiguration{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(prioritylevelconfigurationsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.PriorityLevelConfigurationList{}) - return err -} - -// Patch applies the patch and returns the patched priorityLevelConfiguration. -func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PriorityLevelConfiguration, err error) { - emptyResult := &v1beta1.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.PriorityLevelConfiguration), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied priorityLevelConfiguration. -func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { - if priorityLevelConfiguration == nil { - return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") - } - data, err := json.Marshal(priorityLevelConfiguration) - if err != nil { - return nil, err - } - name := priorityLevelConfiguration.Name - if name == nil { - return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") - } - emptyResult := &v1beta1.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.PriorityLevelConfiguration), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { - if priorityLevelConfiguration == nil { - return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") - } - data, err := json.Marshal(priorityLevelConfiguration) - if err != nil { - return nil, err - } - name := priorityLevelConfiguration.Name - if name == nil { - return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") - } - emptyResult := &v1beta1.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.PriorityLevelConfiguration), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake/fake_flowcontrol_client.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake/fake_flowcontrol_client.go deleted file mode 100644 index 9f36b3b7a..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake/fake_flowcontrol_client.go +++ /dev/null @@ -1,44 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta2 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeFlowcontrolV1beta2 struct { - *testing.Fake -} - -func (c *FakeFlowcontrolV1beta2) FlowSchemas() v1beta2.FlowSchemaInterface { - return &FakeFlowSchemas{c} -} - -func (c *FakeFlowcontrolV1beta2) PriorityLevelConfigurations() v1beta2.PriorityLevelConfigurationInterface { - return &FakePriorityLevelConfigurations{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeFlowcontrolV1beta2) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake/fake_flowschema.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake/fake_flowschema.go deleted file mode 100644 index 41cad9b7a..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake/fake_flowschema.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta2 "k8s.io/api/flowcontrol/v1beta2" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - flowcontrolv1beta2 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2" - testing "k8s.io/client-go/testing" -) - -// FakeFlowSchemas implements FlowSchemaInterface -type FakeFlowSchemas struct { - Fake *FakeFlowcontrolV1beta2 -} - -var flowschemasResource = v1beta2.SchemeGroupVersion.WithResource("flowschemas") - -var flowschemasKind = v1beta2.SchemeGroupVersion.WithKind("FlowSchema") - -// Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. -func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.FlowSchema, err error) { - emptyResult := &v1beta2.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(flowschemasResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.FlowSchema), err -} - -// List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *FakeFlowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.FlowSchemaList, err error) { - emptyResult := &v1beta2.FlowSchemaList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(flowschemasResource, flowschemasKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta2.FlowSchemaList{ListMeta: obj.(*v1beta2.FlowSchemaList).ListMeta} - for _, item := range obj.(*v1beta2.FlowSchemaList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested flowSchemas. -func (c *FakeFlowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(flowschemasResource, opts)) -} - -// Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.CreateOptions) (result *v1beta2.FlowSchema, err error) { - emptyResult := &v1beta2.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.FlowSchema), err -} - -// Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (result *v1beta2.FlowSchema, err error) { - emptyResult := &v1beta2.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.FlowSchema), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (result *v1beta2.FlowSchema, err error) { - emptyResult := &v1beta2.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(flowschemasResource, "status", flowSchema, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.FlowSchema), err -} - -// Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. -func (c *FakeFlowSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(flowschemasResource, name, opts), &v1beta2.FlowSchema{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(flowschemasResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta2.FlowSchemaList{}) - return err -} - -// Patch applies the patch and returns the patched flowSchema. -func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.FlowSchema, err error) { - emptyResult := &v1beta2.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.FlowSchema), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied flowSchema. -func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1beta2.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.FlowSchema, err error) { - if flowSchema == nil { - return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") - } - data, err := json.Marshal(flowSchema) - if err != nil { - return nil, err - } - name := flowSchema.Name - if name == nil { - return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") - } - emptyResult := &v1beta2.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.FlowSchema), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1beta2.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.FlowSchema, err error) { - if flowSchema == nil { - return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") - } - data, err := json.Marshal(flowSchema) - if err != nil { - return nil, err - } - name := flowSchema.Name - if name == nil { - return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") - } - emptyResult := &v1beta2.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.FlowSchema), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake/fake_prioritylevelconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake/fake_prioritylevelconfiguration.go deleted file mode 100644 index f9eac85d5..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake/fake_prioritylevelconfiguration.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta2 "k8s.io/api/flowcontrol/v1beta2" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - flowcontrolv1beta2 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2" - testing "k8s.io/client-go/testing" -) - -// FakePriorityLevelConfigurations implements PriorityLevelConfigurationInterface -type FakePriorityLevelConfigurations struct { - Fake *FakeFlowcontrolV1beta2 -} - -var prioritylevelconfigurationsResource = v1beta2.SchemeGroupVersion.WithResource("prioritylevelconfigurations") - -var prioritylevelconfigurationsKind = v1beta2.SchemeGroupVersion.WithKind("PriorityLevelConfiguration") - -// Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. -func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { - emptyResult := &v1beta2.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(prioritylevelconfigurationsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.PriorityLevelConfiguration), err -} - -// List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.PriorityLevelConfigurationList, err error) { - emptyResult := &v1beta2.PriorityLevelConfigurationList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta2.PriorityLevelConfigurationList{ListMeta: obj.(*v1beta2.PriorityLevelConfigurationList).ListMeta} - for _, item := range obj.(*v1beta2.PriorityLevelConfigurationList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. -func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(prioritylevelconfigurationsResource, opts)) -} - -// Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { - emptyResult := &v1beta2.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.PriorityLevelConfiguration), err -} - -// Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { - emptyResult := &v1beta2.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.PriorityLevelConfiguration), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { - emptyResult := &v1beta2.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.PriorityLevelConfiguration), err -} - -// Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. -func (c *FakePriorityLevelConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(prioritylevelconfigurationsResource, name, opts), &v1beta2.PriorityLevelConfiguration{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(prioritylevelconfigurationsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta2.PriorityLevelConfigurationList{}) - return err -} - -// Patch applies the patch and returns the patched priorityLevelConfiguration. -func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.PriorityLevelConfiguration, err error) { - emptyResult := &v1beta2.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.PriorityLevelConfiguration), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied priorityLevelConfiguration. -func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { - if priorityLevelConfiguration == nil { - return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") - } - data, err := json.Marshal(priorityLevelConfiguration) - if err != nil { - return nil, err - } - name := priorityLevelConfiguration.Name - if name == nil { - return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") - } - emptyResult := &v1beta2.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.PriorityLevelConfiguration), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { - if priorityLevelConfiguration == nil { - return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") - } - data, err := json.Marshal(priorityLevelConfiguration) - if err != nil { - return nil, err - } - name := priorityLevelConfiguration.Name - if name == nil { - return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") - } - emptyResult := &v1beta2.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta2.PriorityLevelConfiguration), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowcontrol_client.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowcontrol_client.go deleted file mode 100644 index 1cb0198d0..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowcontrol_client.go +++ /dev/null @@ -1,44 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta3 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeFlowcontrolV1beta3 struct { - *testing.Fake -} - -func (c *FakeFlowcontrolV1beta3) FlowSchemas() v1beta3.FlowSchemaInterface { - return &FakeFlowSchemas{c} -} - -func (c *FakeFlowcontrolV1beta3) PriorityLevelConfigurations() v1beta3.PriorityLevelConfigurationInterface { - return &FakePriorityLevelConfigurations{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeFlowcontrolV1beta3) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowschema.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowschema.go deleted file mode 100644 index 70dca796a..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowschema.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta3 "k8s.io/api/flowcontrol/v1beta3" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - flowcontrolv1beta3 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3" - testing "k8s.io/client-go/testing" -) - -// FakeFlowSchemas implements FlowSchemaInterface -type FakeFlowSchemas struct { - Fake *FakeFlowcontrolV1beta3 -} - -var flowschemasResource = v1beta3.SchemeGroupVersion.WithResource("flowschemas") - -var flowschemasKind = v1beta3.SchemeGroupVersion.WithKind("FlowSchema") - -// Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. -func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta3.FlowSchema, err error) { - emptyResult := &v1beta3.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(flowschemasResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta3.FlowSchema), err -} - -// List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *FakeFlowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta3.FlowSchemaList, err error) { - emptyResult := &v1beta3.FlowSchemaList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(flowschemasResource, flowschemasKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta3.FlowSchemaList{ListMeta: obj.(*v1beta3.FlowSchemaList).ListMeta} - for _, item := range obj.(*v1beta3.FlowSchemaList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested flowSchemas. -func (c *FakeFlowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(flowschemasResource, opts)) -} - -// Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.CreateOptions) (result *v1beta3.FlowSchema, err error) { - emptyResult := &v1beta3.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta3.FlowSchema), err -} - -// Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.UpdateOptions) (result *v1beta3.FlowSchema, err error) { - emptyResult := &v1beta3.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta3.FlowSchema), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.UpdateOptions) (result *v1beta3.FlowSchema, err error) { - emptyResult := &v1beta3.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(flowschemasResource, "status", flowSchema, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta3.FlowSchema), err -} - -// Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. -func (c *FakeFlowSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(flowschemasResource, name, opts), &v1beta3.FlowSchema{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(flowschemasResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta3.FlowSchemaList{}) - return err -} - -// Patch applies the patch and returns the patched flowSchema. -func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta3.FlowSchema, err error) { - emptyResult := &v1beta3.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta3.FlowSchema), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied flowSchema. -func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1beta3.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta3.FlowSchema, err error) { - if flowSchema == nil { - return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") - } - data, err := json.Marshal(flowSchema) - if err != nil { - return nil, err - } - name := flowSchema.Name - if name == nil { - return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") - } - emptyResult := &v1beta3.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta3.FlowSchema), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1beta3.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta3.FlowSchema, err error) { - if flowSchema == nil { - return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") - } - data, err := json.Marshal(flowSchema) - if err != nil { - return nil, err - } - name := flowSchema.Name - if name == nil { - return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") - } - emptyResult := &v1beta3.FlowSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta3.FlowSchema), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/fake_prioritylevelconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/fake_prioritylevelconfiguration.go deleted file mode 100644 index 45836a645..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/fake_prioritylevelconfiguration.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta3 "k8s.io/api/flowcontrol/v1beta3" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - flowcontrolv1beta3 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3" - testing "k8s.io/client-go/testing" -) - -// FakePriorityLevelConfigurations implements PriorityLevelConfigurationInterface -type FakePriorityLevelConfigurations struct { - Fake *FakeFlowcontrolV1beta3 -} - -var prioritylevelconfigurationsResource = v1beta3.SchemeGroupVersion.WithResource("prioritylevelconfigurations") - -var prioritylevelconfigurationsKind = v1beta3.SchemeGroupVersion.WithKind("PriorityLevelConfiguration") - -// Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. -func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { - emptyResult := &v1beta3.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(prioritylevelconfigurationsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta3.PriorityLevelConfiguration), err -} - -// List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta3.PriorityLevelConfigurationList, err error) { - emptyResult := &v1beta3.PriorityLevelConfigurationList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta3.PriorityLevelConfigurationList{ListMeta: obj.(*v1beta3.PriorityLevelConfigurationList).ListMeta} - for _, item := range obj.(*v1beta3.PriorityLevelConfigurationList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. -func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(prioritylevelconfigurationsResource, opts)) -} - -// Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { - emptyResult := &v1beta3.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta3.PriorityLevelConfiguration), err -} - -// Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { - emptyResult := &v1beta3.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta3.PriorityLevelConfiguration), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { - emptyResult := &v1beta3.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta3.PriorityLevelConfiguration), err -} - -// Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. -func (c *FakePriorityLevelConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(prioritylevelconfigurationsResource, name, opts), &v1beta3.PriorityLevelConfiguration{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(prioritylevelconfigurationsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta3.PriorityLevelConfigurationList{}) - return err -} - -// Patch applies the patch and returns the patched priorityLevelConfiguration. -func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta3.PriorityLevelConfiguration, err error) { - emptyResult := &v1beta3.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta3.PriorityLevelConfiguration), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied priorityLevelConfiguration. -func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta3.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { - if priorityLevelConfiguration == nil { - return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") - } - data, err := json.Marshal(priorityLevelConfiguration) - if err != nil { - return nil, err - } - name := priorityLevelConfiguration.Name - if name == nil { - return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") - } - emptyResult := &v1beta3.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta3.PriorityLevelConfiguration), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta3.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { - if priorityLevelConfiguration == nil { - return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") - } - data, err := json.Marshal(priorityLevelConfiguration) - if err != nil { - return nil, err - } - name := priorityLevelConfiguration.Name - if name == nil { - return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") - } - emptyResult := &v1beta3.PriorityLevelConfiguration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta3.PriorityLevelConfiguration), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_ingress.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_ingress.go deleted file mode 100644 index a9693338b..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_ingress.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/networking/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - networkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" - testing "k8s.io/client-go/testing" -) - -// FakeIngresses implements IngressInterface -type FakeIngresses struct { - Fake *FakeNetworkingV1 - ns string -} - -var ingressesResource = v1.SchemeGroupVersion.WithResource("ingresses") - -var ingressesKind = v1.SchemeGroupVersion.WithKind("Ingress") - -// Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. -func (c *FakeIngresses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Ingress, err error) { - emptyResult := &v1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(ingressesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Ingress), err -} - -// List takes label and field selectors, and returns the list of Ingresses that match those selectors. -func (c *FakeIngresses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressList, err error) { - emptyResult := &v1.IngressList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(ingressesResource, ingressesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.IngressList{ListMeta: obj.(*v1.IngressList).ListMeta} - for _, item := range obj.(*v1.IngressList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested ingresses. -func (c *FakeIngresses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(ingressesResource, c.ns, opts)) - -} - -// Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. -func (c *FakeIngresses) Create(ctx context.Context, ingress *v1.Ingress, opts metav1.CreateOptions) (result *v1.Ingress, err error) { - emptyResult := &v1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(ingressesResource, c.ns, ingress, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Ingress), err -} - -// Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. -func (c *FakeIngresses) Update(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (result *v1.Ingress, err error) { - emptyResult := &v1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(ingressesResource, c.ns, ingress, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Ingress), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeIngresses) UpdateStatus(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (result *v1.Ingress, err error) { - emptyResult := &v1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(ingressesResource, "status", c.ns, ingress, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Ingress), err -} - -// Delete takes name of the ingress and deletes it. Returns an error if one occurs. -func (c *FakeIngresses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(ingressesResource, c.ns, name, opts), &v1.Ingress{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(ingressesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.IngressList{}) - return err -} - -// Patch applies the patch and returns the patched ingress. -func (c *FakeIngresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Ingress, err error) { - emptyResult := &v1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Ingress), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied ingress. -func (c *FakeIngresses) Apply(ctx context.Context, ingress *networkingv1.IngressApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Ingress, err error) { - if ingress == nil { - return nil, fmt.Errorf("ingress provided to Apply must not be nil") - } - data, err := json.Marshal(ingress) - if err != nil { - return nil, err - } - name := ingress.Name - if name == nil { - return nil, fmt.Errorf("ingress.Name must be provided to Apply") - } - emptyResult := &v1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Ingress), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeIngresses) ApplyStatus(ctx context.Context, ingress *networkingv1.IngressApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Ingress, err error) { - if ingress == nil { - return nil, fmt.Errorf("ingress provided to Apply must not be nil") - } - data, err := json.Marshal(ingress) - if err != nil { - return nil, err - } - name := ingress.Name - if name == nil { - return nil, fmt.Errorf("ingress.Name must be provided to Apply") - } - emptyResult := &v1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Ingress), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_ingressclass.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_ingressclass.go deleted file mode 100644 index cdbd59445..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_ingressclass.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/networking/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - networkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" - testing "k8s.io/client-go/testing" -) - -// FakeIngressClasses implements IngressClassInterface -type FakeIngressClasses struct { - Fake *FakeNetworkingV1 -} - -var ingressclassesResource = v1.SchemeGroupVersion.WithResource("ingressclasses") - -var ingressclassesKind = v1.SchemeGroupVersion.WithKind("IngressClass") - -// Get takes name of the ingressClass, and returns the corresponding ingressClass object, and an error if there is any. -func (c *FakeIngressClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.IngressClass, err error) { - emptyResult := &v1.IngressClass{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(ingressclassesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.IngressClass), err -} - -// List takes label and field selectors, and returns the list of IngressClasses that match those selectors. -func (c *FakeIngressClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressClassList, err error) { - emptyResult := &v1.IngressClassList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(ingressclassesResource, ingressclassesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.IngressClassList{ListMeta: obj.(*v1.IngressClassList).ListMeta} - for _, item := range obj.(*v1.IngressClassList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested ingressClasses. -func (c *FakeIngressClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(ingressclassesResource, opts)) -} - -// Create takes the representation of a ingressClass and creates it. Returns the server's representation of the ingressClass, and an error, if there is any. -func (c *FakeIngressClasses) Create(ctx context.Context, ingressClass *v1.IngressClass, opts metav1.CreateOptions) (result *v1.IngressClass, err error) { - emptyResult := &v1.IngressClass{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(ingressclassesResource, ingressClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.IngressClass), err -} - -// Update takes the representation of a ingressClass and updates it. Returns the server's representation of the ingressClass, and an error, if there is any. -func (c *FakeIngressClasses) Update(ctx context.Context, ingressClass *v1.IngressClass, opts metav1.UpdateOptions) (result *v1.IngressClass, err error) { - emptyResult := &v1.IngressClass{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(ingressclassesResource, ingressClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.IngressClass), err -} - -// Delete takes name of the ingressClass and deletes it. Returns an error if one occurs. -func (c *FakeIngressClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(ingressclassesResource, name, opts), &v1.IngressClass{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeIngressClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(ingressclassesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.IngressClassList{}) - return err -} - -// Patch applies the patch and returns the patched ingressClass. -func (c *FakeIngressClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.IngressClass, err error) { - emptyResult := &v1.IngressClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(ingressclassesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.IngressClass), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied ingressClass. -func (c *FakeIngressClasses) Apply(ctx context.Context, ingressClass *networkingv1.IngressClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.IngressClass, err error) { - if ingressClass == nil { - return nil, fmt.Errorf("ingressClass provided to Apply must not be nil") - } - data, err := json.Marshal(ingressClass) - if err != nil { - return nil, err - } - name := ingressClass.Name - if name == nil { - return nil, fmt.Errorf("ingressClass.Name must be provided to Apply") - } - emptyResult := &v1.IngressClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(ingressclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.IngressClass), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networking_client.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networking_client.go deleted file mode 100644 index ed1639e2f..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networking_client.go +++ /dev/null @@ -1,48 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/client-go/kubernetes/typed/networking/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeNetworkingV1 struct { - *testing.Fake -} - -func (c *FakeNetworkingV1) Ingresses(namespace string) v1.IngressInterface { - return &FakeIngresses{c, namespace} -} - -func (c *FakeNetworkingV1) IngressClasses() v1.IngressClassInterface { - return &FakeIngressClasses{c} -} - -func (c *FakeNetworkingV1) NetworkPolicies(namespace string) v1.NetworkPolicyInterface { - return &FakeNetworkPolicies{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeNetworkingV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go deleted file mode 100644 index 9098bf42e..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/networking/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - networkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" - testing "k8s.io/client-go/testing" -) - -// FakeNetworkPolicies implements NetworkPolicyInterface -type FakeNetworkPolicies struct { - Fake *FakeNetworkingV1 - ns string -} - -var networkpoliciesResource = v1.SchemeGroupVersion.WithResource("networkpolicies") - -var networkpoliciesKind = v1.SchemeGroupVersion.WithKind("NetworkPolicy") - -// Get takes name of the networkPolicy, and returns the corresponding networkPolicy object, and an error if there is any. -func (c *FakeNetworkPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.NetworkPolicy, err error) { - emptyResult := &v1.NetworkPolicy{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(networkpoliciesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.NetworkPolicy), err -} - -// List takes label and field selectors, and returns the list of NetworkPolicies that match those selectors. -func (c *FakeNetworkPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkPolicyList, err error) { - emptyResult := &v1.NetworkPolicyList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(networkpoliciesResource, networkpoliciesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.NetworkPolicyList{ListMeta: obj.(*v1.NetworkPolicyList).ListMeta} - for _, item := range obj.(*v1.NetworkPolicyList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested networkPolicies. -func (c *FakeNetworkPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(networkpoliciesResource, c.ns, opts)) - -} - -// Create takes the representation of a networkPolicy and creates it. Returns the server's representation of the networkPolicy, and an error, if there is any. -func (c *FakeNetworkPolicies) Create(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.CreateOptions) (result *v1.NetworkPolicy, err error) { - emptyResult := &v1.NetworkPolicy{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(networkpoliciesResource, c.ns, networkPolicy, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.NetworkPolicy), err -} - -// Update takes the representation of a networkPolicy and updates it. Returns the server's representation of the networkPolicy, and an error, if there is any. -func (c *FakeNetworkPolicies) Update(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.UpdateOptions) (result *v1.NetworkPolicy, err error) { - emptyResult := &v1.NetworkPolicy{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(networkpoliciesResource, c.ns, networkPolicy, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.NetworkPolicy), err -} - -// Delete takes name of the networkPolicy and deletes it. Returns an error if one occurs. -func (c *FakeNetworkPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(networkpoliciesResource, c.ns, name, opts), &v1.NetworkPolicy{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeNetworkPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(networkpoliciesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.NetworkPolicyList{}) - return err -} - -// Patch applies the patch and returns the patched networkPolicy. -func (c *FakeNetworkPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NetworkPolicy, err error) { - emptyResult := &v1.NetworkPolicy{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(networkpoliciesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.NetworkPolicy), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied networkPolicy. -func (c *FakeNetworkPolicies) Apply(ctx context.Context, networkPolicy *networkingv1.NetworkPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.NetworkPolicy, err error) { - if networkPolicy == nil { - return nil, fmt.Errorf("networkPolicy provided to Apply must not be nil") - } - data, err := json.Marshal(networkPolicy) - if err != nil { - return nil, err - } - name := networkPolicy.Name - if name == nil { - return nil, fmt.Errorf("networkPolicy.Name must be provided to Apply") - } - emptyResult := &v1.NetworkPolicy{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(networkpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.NetworkPolicy), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_ipaddress.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_ipaddress.go deleted file mode 100644 index 6ce62b331..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_ipaddress.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/networking/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - networkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakeIPAddresses implements IPAddressInterface -type FakeIPAddresses struct { - Fake *FakeNetworkingV1alpha1 -} - -var ipaddressesResource = v1alpha1.SchemeGroupVersion.WithResource("ipaddresses") - -var ipaddressesKind = v1alpha1.SchemeGroupVersion.WithKind("IPAddress") - -// Get takes name of the iPAddress, and returns the corresponding iPAddress object, and an error if there is any. -func (c *FakeIPAddresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.IPAddress, err error) { - emptyResult := &v1alpha1.IPAddress{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(ipaddressesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.IPAddress), err -} - -// List takes label and field selectors, and returns the list of IPAddresses that match those selectors. -func (c *FakeIPAddresses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.IPAddressList, err error) { - emptyResult := &v1alpha1.IPAddressList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(ipaddressesResource, ipaddressesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.IPAddressList{ListMeta: obj.(*v1alpha1.IPAddressList).ListMeta} - for _, item := range obj.(*v1alpha1.IPAddressList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested iPAddresses. -func (c *FakeIPAddresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(ipaddressesResource, opts)) -} - -// Create takes the representation of a iPAddress and creates it. Returns the server's representation of the iPAddress, and an error, if there is any. -func (c *FakeIPAddresses) Create(ctx context.Context, iPAddress *v1alpha1.IPAddress, opts v1.CreateOptions) (result *v1alpha1.IPAddress, err error) { - emptyResult := &v1alpha1.IPAddress{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(ipaddressesResource, iPAddress, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.IPAddress), err -} - -// Update takes the representation of a iPAddress and updates it. Returns the server's representation of the iPAddress, and an error, if there is any. -func (c *FakeIPAddresses) Update(ctx context.Context, iPAddress *v1alpha1.IPAddress, opts v1.UpdateOptions) (result *v1alpha1.IPAddress, err error) { - emptyResult := &v1alpha1.IPAddress{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(ipaddressesResource, iPAddress, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.IPAddress), err -} - -// Delete takes name of the iPAddress and deletes it. Returns an error if one occurs. -func (c *FakeIPAddresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(ipaddressesResource, name, opts), &v1alpha1.IPAddress{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeIPAddresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(ipaddressesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.IPAddressList{}) - return err -} - -// Patch applies the patch and returns the patched iPAddress. -func (c *FakeIPAddresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.IPAddress, err error) { - emptyResult := &v1alpha1.IPAddress{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(ipaddressesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.IPAddress), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied iPAddress. -func (c *FakeIPAddresses) Apply(ctx context.Context, iPAddress *networkingv1alpha1.IPAddressApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.IPAddress, err error) { - if iPAddress == nil { - return nil, fmt.Errorf("iPAddress provided to Apply must not be nil") - } - data, err := json.Marshal(iPAddress) - if err != nil { - return nil, err - } - name := iPAddress.Name - if name == nil { - return nil, fmt.Errorf("iPAddress.Name must be provided to Apply") - } - emptyResult := &v1alpha1.IPAddress{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(ipaddressesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.IPAddress), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_networking_client.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_networking_client.go deleted file mode 100644 index 80ad184bb..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_networking_client.go +++ /dev/null @@ -1,44 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha1 "k8s.io/client-go/kubernetes/typed/networking/v1alpha1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeNetworkingV1alpha1 struct { - *testing.Fake -} - -func (c *FakeNetworkingV1alpha1) IPAddresses() v1alpha1.IPAddressInterface { - return &FakeIPAddresses{c} -} - -func (c *FakeNetworkingV1alpha1) ServiceCIDRs() v1alpha1.ServiceCIDRInterface { - return &FakeServiceCIDRs{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeNetworkingV1alpha1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_servicecidr.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_servicecidr.go deleted file mode 100644 index 27a78e1ba..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_servicecidr.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/networking/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - networkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakeServiceCIDRs implements ServiceCIDRInterface -type FakeServiceCIDRs struct { - Fake *FakeNetworkingV1alpha1 -} - -var servicecidrsResource = v1alpha1.SchemeGroupVersion.WithResource("servicecidrs") - -var servicecidrsKind = v1alpha1.SchemeGroupVersion.WithKind("ServiceCIDR") - -// Get takes name of the serviceCIDR, and returns the corresponding serviceCIDR object, and an error if there is any. -func (c *FakeServiceCIDRs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ServiceCIDR, err error) { - emptyResult := &v1alpha1.ServiceCIDR{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(servicecidrsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ServiceCIDR), err -} - -// List takes label and field selectors, and returns the list of ServiceCIDRs that match those selectors. -func (c *FakeServiceCIDRs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ServiceCIDRList, err error) { - emptyResult := &v1alpha1.ServiceCIDRList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(servicecidrsResource, servicecidrsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ServiceCIDRList{ListMeta: obj.(*v1alpha1.ServiceCIDRList).ListMeta} - for _, item := range obj.(*v1alpha1.ServiceCIDRList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested serviceCIDRs. -func (c *FakeServiceCIDRs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(servicecidrsResource, opts)) -} - -// Create takes the representation of a serviceCIDR and creates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. -func (c *FakeServiceCIDRs) Create(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.CreateOptions) (result *v1alpha1.ServiceCIDR, err error) { - emptyResult := &v1alpha1.ServiceCIDR{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(servicecidrsResource, serviceCIDR, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ServiceCIDR), err -} - -// Update takes the representation of a serviceCIDR and updates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. -func (c *FakeServiceCIDRs) Update(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (result *v1alpha1.ServiceCIDR, err error) { - emptyResult := &v1alpha1.ServiceCIDR{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(servicecidrsResource, serviceCIDR, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ServiceCIDR), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeServiceCIDRs) UpdateStatus(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (result *v1alpha1.ServiceCIDR, err error) { - emptyResult := &v1alpha1.ServiceCIDR{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(servicecidrsResource, "status", serviceCIDR, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ServiceCIDR), err -} - -// Delete takes name of the serviceCIDR and deletes it. Returns an error if one occurs. -func (c *FakeServiceCIDRs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(servicecidrsResource, name, opts), &v1alpha1.ServiceCIDR{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeServiceCIDRs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(servicecidrsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.ServiceCIDRList{}) - return err -} - -// Patch applies the patch and returns the patched serviceCIDR. -func (c *FakeServiceCIDRs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ServiceCIDR, err error) { - emptyResult := &v1alpha1.ServiceCIDR{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(servicecidrsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ServiceCIDR), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied serviceCIDR. -func (c *FakeServiceCIDRs) Apply(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) { - if serviceCIDR == nil { - return nil, fmt.Errorf("serviceCIDR provided to Apply must not be nil") - } - data, err := json.Marshal(serviceCIDR) - if err != nil { - return nil, err - } - name := serviceCIDR.Name - if name == nil { - return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") - } - emptyResult := &v1alpha1.ServiceCIDR{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(servicecidrsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ServiceCIDR), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeServiceCIDRs) ApplyStatus(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) { - if serviceCIDR == nil { - return nil, fmt.Errorf("serviceCIDR provided to Apply must not be nil") - } - data, err := json.Marshal(serviceCIDR) - if err != nil { - return nil, err - } - name := serviceCIDR.Name - if name == nil { - return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") - } - emptyResult := &v1alpha1.ServiceCIDR{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(servicecidrsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ServiceCIDR), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ingress.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ingress.go deleted file mode 100644 index 59bf762a0..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ingress.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/networking/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeIngresses implements IngressInterface -type FakeIngresses struct { - Fake *FakeNetworkingV1beta1 - ns string -} - -var ingressesResource = v1beta1.SchemeGroupVersion.WithResource("ingresses") - -var ingressesKind = v1beta1.SchemeGroupVersion.WithKind("Ingress") - -// Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. -func (c *FakeIngresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Ingress, err error) { - emptyResult := &v1beta1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(ingressesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Ingress), err -} - -// List takes label and field selectors, and returns the list of Ingresses that match those selectors. -func (c *FakeIngresses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { - emptyResult := &v1beta1.IngressList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(ingressesResource, ingressesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.IngressList{ListMeta: obj.(*v1beta1.IngressList).ListMeta} - for _, item := range obj.(*v1beta1.IngressList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested ingresses. -func (c *FakeIngresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(ingressesResource, c.ns, opts)) - -} - -// Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. -func (c *FakeIngresses) Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (result *v1beta1.Ingress, err error) { - emptyResult := &v1beta1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(ingressesResource, c.ns, ingress, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Ingress), err -} - -// Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. -func (c *FakeIngresses) Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { - emptyResult := &v1beta1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(ingressesResource, c.ns, ingress, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Ingress), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeIngresses) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { - emptyResult := &v1beta1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(ingressesResource, "status", c.ns, ingress, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Ingress), err -} - -// Delete takes name of the ingress and deletes it. Returns an error if one occurs. -func (c *FakeIngresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(ingressesResource, c.ns, name, opts), &v1beta1.Ingress{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(ingressesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.IngressList{}) - return err -} - -// Patch applies the patch and returns the patched ingress. -func (c *FakeIngresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Ingress, err error) { - emptyResult := &v1beta1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Ingress), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied ingress. -func (c *FakeIngresses) Apply(ctx context.Context, ingress *networkingv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) { - if ingress == nil { - return nil, fmt.Errorf("ingress provided to Apply must not be nil") - } - data, err := json.Marshal(ingress) - if err != nil { - return nil, err - } - name := ingress.Name - if name == nil { - return nil, fmt.Errorf("ingress.Name must be provided to Apply") - } - emptyResult := &v1beta1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Ingress), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeIngresses) ApplyStatus(ctx context.Context, ingress *networkingv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) { - if ingress == nil { - return nil, fmt.Errorf("ingress provided to Apply must not be nil") - } - data, err := json.Marshal(ingress) - if err != nil { - return nil, err - } - name := ingress.Name - if name == nil { - return nil, fmt.Errorf("ingress.Name must be provided to Apply") - } - emptyResult := &v1beta1.Ingress{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Ingress), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ingressclass.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ingressclass.go deleted file mode 100644 index 3001de8e4..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ingressclass.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/networking/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeIngressClasses implements IngressClassInterface -type FakeIngressClasses struct { - Fake *FakeNetworkingV1beta1 -} - -var ingressclassesResource = v1beta1.SchemeGroupVersion.WithResource("ingressclasses") - -var ingressclassesKind = v1beta1.SchemeGroupVersion.WithKind("IngressClass") - -// Get takes name of the ingressClass, and returns the corresponding ingressClass object, and an error if there is any. -func (c *FakeIngressClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.IngressClass, err error) { - emptyResult := &v1beta1.IngressClass{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(ingressclassesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.IngressClass), err -} - -// List takes label and field selectors, and returns the list of IngressClasses that match those selectors. -func (c *FakeIngressClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressClassList, err error) { - emptyResult := &v1beta1.IngressClassList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(ingressclassesResource, ingressclassesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.IngressClassList{ListMeta: obj.(*v1beta1.IngressClassList).ListMeta} - for _, item := range obj.(*v1beta1.IngressClassList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested ingressClasses. -func (c *FakeIngressClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(ingressclassesResource, opts)) -} - -// Create takes the representation of a ingressClass and creates it. Returns the server's representation of the ingressClass, and an error, if there is any. -func (c *FakeIngressClasses) Create(ctx context.Context, ingressClass *v1beta1.IngressClass, opts v1.CreateOptions) (result *v1beta1.IngressClass, err error) { - emptyResult := &v1beta1.IngressClass{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(ingressclassesResource, ingressClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.IngressClass), err -} - -// Update takes the representation of a ingressClass and updates it. Returns the server's representation of the ingressClass, and an error, if there is any. -func (c *FakeIngressClasses) Update(ctx context.Context, ingressClass *v1beta1.IngressClass, opts v1.UpdateOptions) (result *v1beta1.IngressClass, err error) { - emptyResult := &v1beta1.IngressClass{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(ingressclassesResource, ingressClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.IngressClass), err -} - -// Delete takes name of the ingressClass and deletes it. Returns an error if one occurs. -func (c *FakeIngressClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(ingressclassesResource, name, opts), &v1beta1.IngressClass{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeIngressClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(ingressclassesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.IngressClassList{}) - return err -} - -// Patch applies the patch and returns the patched ingressClass. -func (c *FakeIngressClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.IngressClass, err error) { - emptyResult := &v1beta1.IngressClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(ingressclassesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.IngressClass), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied ingressClass. -func (c *FakeIngressClasses) Apply(ctx context.Context, ingressClass *networkingv1beta1.IngressClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.IngressClass, err error) { - if ingressClass == nil { - return nil, fmt.Errorf("ingressClass provided to Apply must not be nil") - } - data, err := json.Marshal(ingressClass) - if err != nil { - return nil, err - } - name := ingressClass.Name - if name == nil { - return nil, fmt.Errorf("ingressClass.Name must be provided to Apply") - } - emptyResult := &v1beta1.IngressClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(ingressclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.IngressClass), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ipaddress.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ipaddress.go deleted file mode 100644 index d8352bb79..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ipaddress.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/networking/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeIPAddresses implements IPAddressInterface -type FakeIPAddresses struct { - Fake *FakeNetworkingV1beta1 -} - -var ipaddressesResource = v1beta1.SchemeGroupVersion.WithResource("ipaddresses") - -var ipaddressesKind = v1beta1.SchemeGroupVersion.WithKind("IPAddress") - -// Get takes name of the iPAddress, and returns the corresponding iPAddress object, and an error if there is any. -func (c *FakeIPAddresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.IPAddress, err error) { - emptyResult := &v1beta1.IPAddress{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(ipaddressesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.IPAddress), err -} - -// List takes label and field selectors, and returns the list of IPAddresses that match those selectors. -func (c *FakeIPAddresses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IPAddressList, err error) { - emptyResult := &v1beta1.IPAddressList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(ipaddressesResource, ipaddressesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.IPAddressList{ListMeta: obj.(*v1beta1.IPAddressList).ListMeta} - for _, item := range obj.(*v1beta1.IPAddressList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested iPAddresses. -func (c *FakeIPAddresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(ipaddressesResource, opts)) -} - -// Create takes the representation of a iPAddress and creates it. Returns the server's representation of the iPAddress, and an error, if there is any. -func (c *FakeIPAddresses) Create(ctx context.Context, iPAddress *v1beta1.IPAddress, opts v1.CreateOptions) (result *v1beta1.IPAddress, err error) { - emptyResult := &v1beta1.IPAddress{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(ipaddressesResource, iPAddress, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.IPAddress), err -} - -// Update takes the representation of a iPAddress and updates it. Returns the server's representation of the iPAddress, and an error, if there is any. -func (c *FakeIPAddresses) Update(ctx context.Context, iPAddress *v1beta1.IPAddress, opts v1.UpdateOptions) (result *v1beta1.IPAddress, err error) { - emptyResult := &v1beta1.IPAddress{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(ipaddressesResource, iPAddress, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.IPAddress), err -} - -// Delete takes name of the iPAddress and deletes it. Returns an error if one occurs. -func (c *FakeIPAddresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(ipaddressesResource, name, opts), &v1beta1.IPAddress{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeIPAddresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(ipaddressesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.IPAddressList{}) - return err -} - -// Patch applies the patch and returns the patched iPAddress. -func (c *FakeIPAddresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.IPAddress, err error) { - emptyResult := &v1beta1.IPAddress{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(ipaddressesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.IPAddress), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied iPAddress. -func (c *FakeIPAddresses) Apply(ctx context.Context, iPAddress *networkingv1beta1.IPAddressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.IPAddress, err error) { - if iPAddress == nil { - return nil, fmt.Errorf("iPAddress provided to Apply must not be nil") - } - data, err := json.Marshal(iPAddress) - if err != nil { - return nil, err - } - name := iPAddress.Name - if name == nil { - return nil, fmt.Errorf("iPAddress.Name must be provided to Apply") - } - emptyResult := &v1beta1.IPAddress{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(ipaddressesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.IPAddress), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_networking_client.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_networking_client.go deleted file mode 100644 index bd72d5929..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_networking_client.go +++ /dev/null @@ -1,52 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeNetworkingV1beta1 struct { - *testing.Fake -} - -func (c *FakeNetworkingV1beta1) IPAddresses() v1beta1.IPAddressInterface { - return &FakeIPAddresses{c} -} - -func (c *FakeNetworkingV1beta1) Ingresses(namespace string) v1beta1.IngressInterface { - return &FakeIngresses{c, namespace} -} - -func (c *FakeNetworkingV1beta1) IngressClasses() v1beta1.IngressClassInterface { - return &FakeIngressClasses{c} -} - -func (c *FakeNetworkingV1beta1) ServiceCIDRs() v1beta1.ServiceCIDRInterface { - return &FakeServiceCIDRs{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeNetworkingV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_servicecidr.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_servicecidr.go deleted file mode 100644 index 0eb5b2f2b..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_servicecidr.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/networking/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeServiceCIDRs implements ServiceCIDRInterface -type FakeServiceCIDRs struct { - Fake *FakeNetworkingV1beta1 -} - -var servicecidrsResource = v1beta1.SchemeGroupVersion.WithResource("servicecidrs") - -var servicecidrsKind = v1beta1.SchemeGroupVersion.WithKind("ServiceCIDR") - -// Get takes name of the serviceCIDR, and returns the corresponding serviceCIDR object, and an error if there is any. -func (c *FakeServiceCIDRs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ServiceCIDR, err error) { - emptyResult := &v1beta1.ServiceCIDR{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(servicecidrsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ServiceCIDR), err -} - -// List takes label and field selectors, and returns the list of ServiceCIDRs that match those selectors. -func (c *FakeServiceCIDRs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ServiceCIDRList, err error) { - emptyResult := &v1beta1.ServiceCIDRList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(servicecidrsResource, servicecidrsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.ServiceCIDRList{ListMeta: obj.(*v1beta1.ServiceCIDRList).ListMeta} - for _, item := range obj.(*v1beta1.ServiceCIDRList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested serviceCIDRs. -func (c *FakeServiceCIDRs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(servicecidrsResource, opts)) -} - -// Create takes the representation of a serviceCIDR and creates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. -func (c *FakeServiceCIDRs) Create(ctx context.Context, serviceCIDR *v1beta1.ServiceCIDR, opts v1.CreateOptions) (result *v1beta1.ServiceCIDR, err error) { - emptyResult := &v1beta1.ServiceCIDR{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(servicecidrsResource, serviceCIDR, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ServiceCIDR), err -} - -// Update takes the representation of a serviceCIDR and updates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. -func (c *FakeServiceCIDRs) Update(ctx context.Context, serviceCIDR *v1beta1.ServiceCIDR, opts v1.UpdateOptions) (result *v1beta1.ServiceCIDR, err error) { - emptyResult := &v1beta1.ServiceCIDR{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(servicecidrsResource, serviceCIDR, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ServiceCIDR), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeServiceCIDRs) UpdateStatus(ctx context.Context, serviceCIDR *v1beta1.ServiceCIDR, opts v1.UpdateOptions) (result *v1beta1.ServiceCIDR, err error) { - emptyResult := &v1beta1.ServiceCIDR{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(servicecidrsResource, "status", serviceCIDR, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ServiceCIDR), err -} - -// Delete takes name of the serviceCIDR and deletes it. Returns an error if one occurs. -func (c *FakeServiceCIDRs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(servicecidrsResource, name, opts), &v1beta1.ServiceCIDR{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeServiceCIDRs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(servicecidrsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.ServiceCIDRList{}) - return err -} - -// Patch applies the patch and returns the patched serviceCIDR. -func (c *FakeServiceCIDRs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ServiceCIDR, err error) { - emptyResult := &v1beta1.ServiceCIDR{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(servicecidrsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ServiceCIDR), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied serviceCIDR. -func (c *FakeServiceCIDRs) Apply(ctx context.Context, serviceCIDR *networkingv1beta1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ServiceCIDR, err error) { - if serviceCIDR == nil { - return nil, fmt.Errorf("serviceCIDR provided to Apply must not be nil") - } - data, err := json.Marshal(serviceCIDR) - if err != nil { - return nil, err - } - name := serviceCIDR.Name - if name == nil { - return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") - } - emptyResult := &v1beta1.ServiceCIDR{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(servicecidrsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ServiceCIDR), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeServiceCIDRs) ApplyStatus(ctx context.Context, serviceCIDR *networkingv1beta1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ServiceCIDR, err error) { - if serviceCIDR == nil { - return nil, fmt.Errorf("serviceCIDR provided to Apply must not be nil") - } - data, err := json.Marshal(serviceCIDR) - if err != nil { - return nil, err - } - name := serviceCIDR.Name - if name == nil { - return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") - } - emptyResult := &v1beta1.ServiceCIDR{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(servicecidrsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ServiceCIDR), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/node/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/node/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/node/v1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/node/v1/fake/fake_node_client.go b/vendor/k8s.io/client-go/kubernetes/typed/node/v1/fake/fake_node_client.go deleted file mode 100644 index dea10cbad..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/node/v1/fake/fake_node_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/client-go/kubernetes/typed/node/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeNodeV1 struct { - *testing.Fake -} - -func (c *FakeNodeV1) RuntimeClasses() v1.RuntimeClassInterface { - return &FakeRuntimeClasses{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeNodeV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/node/v1/fake/fake_runtimeclass.go b/vendor/k8s.io/client-go/kubernetes/typed/node/v1/fake/fake_runtimeclass.go deleted file mode 100644 index 0a5270628..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/node/v1/fake/fake_runtimeclass.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/node/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - nodev1 "k8s.io/client-go/applyconfigurations/node/v1" - testing "k8s.io/client-go/testing" -) - -// FakeRuntimeClasses implements RuntimeClassInterface -type FakeRuntimeClasses struct { - Fake *FakeNodeV1 -} - -var runtimeclassesResource = v1.SchemeGroupVersion.WithResource("runtimeclasses") - -var runtimeclassesKind = v1.SchemeGroupVersion.WithKind("RuntimeClass") - -// Get takes name of the runtimeClass, and returns the corresponding runtimeClass object, and an error if there is any. -func (c *FakeRuntimeClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RuntimeClass, err error) { - emptyResult := &v1.RuntimeClass{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(runtimeclassesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.RuntimeClass), err -} - -// List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. -func (c *FakeRuntimeClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RuntimeClassList, err error) { - emptyResult := &v1.RuntimeClassList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(runtimeclassesResource, runtimeclassesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.RuntimeClassList{ListMeta: obj.(*v1.RuntimeClassList).ListMeta} - for _, item := range obj.(*v1.RuntimeClassList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested runtimeClasses. -func (c *FakeRuntimeClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(runtimeclassesResource, opts)) -} - -// Create takes the representation of a runtimeClass and creates it. Returns the server's representation of the runtimeClass, and an error, if there is any. -func (c *FakeRuntimeClasses) Create(ctx context.Context, runtimeClass *v1.RuntimeClass, opts metav1.CreateOptions) (result *v1.RuntimeClass, err error) { - emptyResult := &v1.RuntimeClass{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(runtimeclassesResource, runtimeClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.RuntimeClass), err -} - -// Update takes the representation of a runtimeClass and updates it. Returns the server's representation of the runtimeClass, and an error, if there is any. -func (c *FakeRuntimeClasses) Update(ctx context.Context, runtimeClass *v1.RuntimeClass, opts metav1.UpdateOptions) (result *v1.RuntimeClass, err error) { - emptyResult := &v1.RuntimeClass{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(runtimeclassesResource, runtimeClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.RuntimeClass), err -} - -// Delete takes name of the runtimeClass and deletes it. Returns an error if one occurs. -func (c *FakeRuntimeClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(runtimeclassesResource, name, opts), &v1.RuntimeClass{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeRuntimeClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(runtimeclassesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.RuntimeClassList{}) - return err -} - -// Patch applies the patch and returns the patched runtimeClass. -func (c *FakeRuntimeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RuntimeClass, err error) { - emptyResult := &v1.RuntimeClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(runtimeclassesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.RuntimeClass), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied runtimeClass. -func (c *FakeRuntimeClasses) Apply(ctx context.Context, runtimeClass *nodev1.RuntimeClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.RuntimeClass, err error) { - if runtimeClass == nil { - return nil, fmt.Errorf("runtimeClass provided to Apply must not be nil") - } - data, err := json.Marshal(runtimeClass) - if err != nil { - return nil, err - } - name := runtimeClass.Name - if name == nil { - return nil, fmt.Errorf("runtimeClass.Name must be provided to Apply") - } - emptyResult := &v1.RuntimeClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(runtimeclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.RuntimeClass), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake/fake_node_client.go b/vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake/fake_node_client.go deleted file mode 100644 index 21ab9de33..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake/fake_node_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeNodeV1alpha1 struct { - *testing.Fake -} - -func (c *FakeNodeV1alpha1) RuntimeClasses() v1alpha1.RuntimeClassInterface { - return &FakeRuntimeClasses{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeNodeV1alpha1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake/fake_runtimeclass.go b/vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake/fake_runtimeclass.go deleted file mode 100644 index bcd261d00..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake/fake_runtimeclass.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/node/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - nodev1alpha1 "k8s.io/client-go/applyconfigurations/node/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakeRuntimeClasses implements RuntimeClassInterface -type FakeRuntimeClasses struct { - Fake *FakeNodeV1alpha1 -} - -var runtimeclassesResource = v1alpha1.SchemeGroupVersion.WithResource("runtimeclasses") - -var runtimeclassesKind = v1alpha1.SchemeGroupVersion.WithKind("RuntimeClass") - -// Get takes name of the runtimeClass, and returns the corresponding runtimeClass object, and an error if there is any. -func (c *FakeRuntimeClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RuntimeClass, err error) { - emptyResult := &v1alpha1.RuntimeClass{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(runtimeclassesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.RuntimeClass), err -} - -// List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. -func (c *FakeRuntimeClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RuntimeClassList, err error) { - emptyResult := &v1alpha1.RuntimeClassList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(runtimeclassesResource, runtimeclassesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.RuntimeClassList{ListMeta: obj.(*v1alpha1.RuntimeClassList).ListMeta} - for _, item := range obj.(*v1alpha1.RuntimeClassList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested runtimeClasses. -func (c *FakeRuntimeClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(runtimeclassesResource, opts)) -} - -// Create takes the representation of a runtimeClass and creates it. Returns the server's representation of the runtimeClass, and an error, if there is any. -func (c *FakeRuntimeClasses) Create(ctx context.Context, runtimeClass *v1alpha1.RuntimeClass, opts v1.CreateOptions) (result *v1alpha1.RuntimeClass, err error) { - emptyResult := &v1alpha1.RuntimeClass{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(runtimeclassesResource, runtimeClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.RuntimeClass), err -} - -// Update takes the representation of a runtimeClass and updates it. Returns the server's representation of the runtimeClass, and an error, if there is any. -func (c *FakeRuntimeClasses) Update(ctx context.Context, runtimeClass *v1alpha1.RuntimeClass, opts v1.UpdateOptions) (result *v1alpha1.RuntimeClass, err error) { - emptyResult := &v1alpha1.RuntimeClass{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(runtimeclassesResource, runtimeClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.RuntimeClass), err -} - -// Delete takes name of the runtimeClass and deletes it. Returns an error if one occurs. -func (c *FakeRuntimeClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(runtimeclassesResource, name, opts), &v1alpha1.RuntimeClass{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeRuntimeClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(runtimeclassesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.RuntimeClassList{}) - return err -} - -// Patch applies the patch and returns the patched runtimeClass. -func (c *FakeRuntimeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RuntimeClass, err error) { - emptyResult := &v1alpha1.RuntimeClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(runtimeclassesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.RuntimeClass), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied runtimeClass. -func (c *FakeRuntimeClasses) Apply(ctx context.Context, runtimeClass *nodev1alpha1.RuntimeClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.RuntimeClass, err error) { - if runtimeClass == nil { - return nil, fmt.Errorf("runtimeClass provided to Apply must not be nil") - } - data, err := json.Marshal(runtimeClass) - if err != nil { - return nil, err - } - name := runtimeClass.Name - if name == nil { - return nil, fmt.Errorf("runtimeClass.Name must be provided to Apply") - } - emptyResult := &v1alpha1.RuntimeClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(runtimeclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.RuntimeClass), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/fake/fake_node_client.go b/vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/fake/fake_node_client.go deleted file mode 100644 index 36976ce54..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/fake/fake_node_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "k8s.io/client-go/kubernetes/typed/node/v1beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeNodeV1beta1 struct { - *testing.Fake -} - -func (c *FakeNodeV1beta1) RuntimeClasses() v1beta1.RuntimeClassInterface { - return &FakeRuntimeClasses{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeNodeV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/fake/fake_runtimeclass.go b/vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/fake/fake_runtimeclass.go deleted file mode 100644 index a3c8c018c..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/fake/fake_runtimeclass.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/node/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - nodev1beta1 "k8s.io/client-go/applyconfigurations/node/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeRuntimeClasses implements RuntimeClassInterface -type FakeRuntimeClasses struct { - Fake *FakeNodeV1beta1 -} - -var runtimeclassesResource = v1beta1.SchemeGroupVersion.WithResource("runtimeclasses") - -var runtimeclassesKind = v1beta1.SchemeGroupVersion.WithKind("RuntimeClass") - -// Get takes name of the runtimeClass, and returns the corresponding runtimeClass object, and an error if there is any. -func (c *FakeRuntimeClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.RuntimeClass, err error) { - emptyResult := &v1beta1.RuntimeClass{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(runtimeclassesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.RuntimeClass), err -} - -// List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. -func (c *FakeRuntimeClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RuntimeClassList, err error) { - emptyResult := &v1beta1.RuntimeClassList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(runtimeclassesResource, runtimeclassesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.RuntimeClassList{ListMeta: obj.(*v1beta1.RuntimeClassList).ListMeta} - for _, item := range obj.(*v1beta1.RuntimeClassList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested runtimeClasses. -func (c *FakeRuntimeClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(runtimeclassesResource, opts)) -} - -// Create takes the representation of a runtimeClass and creates it. Returns the server's representation of the runtimeClass, and an error, if there is any. -func (c *FakeRuntimeClasses) Create(ctx context.Context, runtimeClass *v1beta1.RuntimeClass, opts v1.CreateOptions) (result *v1beta1.RuntimeClass, err error) { - emptyResult := &v1beta1.RuntimeClass{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(runtimeclassesResource, runtimeClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.RuntimeClass), err -} - -// Update takes the representation of a runtimeClass and updates it. Returns the server's representation of the runtimeClass, and an error, if there is any. -func (c *FakeRuntimeClasses) Update(ctx context.Context, runtimeClass *v1beta1.RuntimeClass, opts v1.UpdateOptions) (result *v1beta1.RuntimeClass, err error) { - emptyResult := &v1beta1.RuntimeClass{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(runtimeclassesResource, runtimeClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.RuntimeClass), err -} - -// Delete takes name of the runtimeClass and deletes it. Returns an error if one occurs. -func (c *FakeRuntimeClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(runtimeclassesResource, name, opts), &v1beta1.RuntimeClass{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeRuntimeClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(runtimeclassesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.RuntimeClassList{}) - return err -} - -// Patch applies the patch and returns the patched runtimeClass. -func (c *FakeRuntimeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RuntimeClass, err error) { - emptyResult := &v1beta1.RuntimeClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(runtimeclassesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.RuntimeClass), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied runtimeClass. -func (c *FakeRuntimeClasses) Apply(ctx context.Context, runtimeClass *nodev1beta1.RuntimeClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.RuntimeClass, err error) { - if runtimeClass == nil { - return nil, fmt.Errorf("runtimeClass provided to Apply must not be nil") - } - data, err := json.Marshal(runtimeClass) - if err != nil { - return nil, err - } - name := runtimeClass.Name - if name == nil { - return nil, fmt.Errorf("runtimeClass.Name must be provided to Apply") - } - emptyResult := &v1beta1.RuntimeClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(runtimeclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.RuntimeClass), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_eviction.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_eviction.go deleted file mode 100644 index a579067ce..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_eviction.go +++ /dev/null @@ -1,25 +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 client-gen. DO NOT EDIT. - -package fake - -// FakeEvictions implements EvictionInterface -type FakeEvictions struct { - Fake *FakePolicyV1 - ns string -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_eviction_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_eviction_expansion.go deleted file mode 100644 index 1b6b4ade1..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_eviction_expansion.go +++ /dev/null @@ -1,37 +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 fake - -import ( - "context" - - policy "k8s.io/api/policy/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - core "k8s.io/client-go/testing" -) - -func (c *FakeEvictions) Evict(ctx context.Context, eviction *policy.Eviction) error { - action := core.CreateActionImpl{} - action.Verb = "create" - action.Namespace = c.ns - action.Resource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"} - action.Subresource = "eviction" - action.Object = eviction - - _, err := c.Fake.Invokes(action, eviction) - return err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_poddisruptionbudget.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_poddisruptionbudget.go deleted file mode 100644 index de2bcc1b0..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_poddisruptionbudget.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/policy/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - policyv1 "k8s.io/client-go/applyconfigurations/policy/v1" - testing "k8s.io/client-go/testing" -) - -// FakePodDisruptionBudgets implements PodDisruptionBudgetInterface -type FakePodDisruptionBudgets struct { - Fake *FakePolicyV1 - ns string -} - -var poddisruptionbudgetsResource = v1.SchemeGroupVersion.WithResource("poddisruptionbudgets") - -var poddisruptionbudgetsKind = v1.SchemeGroupVersion.WithKind("PodDisruptionBudget") - -// Get takes name of the podDisruptionBudget, and returns the corresponding podDisruptionBudget object, and an error if there is any. -func (c *FakePodDisruptionBudgets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PodDisruptionBudget, err error) { - emptyResult := &v1.PodDisruptionBudget{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(poddisruptionbudgetsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PodDisruptionBudget), err -} - -// List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. -func (c *FakePodDisruptionBudgets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodDisruptionBudgetList, err error) { - emptyResult := &v1.PodDisruptionBudgetList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(poddisruptionbudgetsResource, poddisruptionbudgetsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.PodDisruptionBudgetList{ListMeta: obj.(*v1.PodDisruptionBudgetList).ListMeta} - for _, item := range obj.(*v1.PodDisruptionBudgetList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested podDisruptionBudgets. -func (c *FakePodDisruptionBudgets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(poddisruptionbudgetsResource, c.ns, opts)) - -} - -// Create takes the representation of a podDisruptionBudget and creates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. -func (c *FakePodDisruptionBudgets) Create(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.CreateOptions) (result *v1.PodDisruptionBudget, err error) { - emptyResult := &v1.PodDisruptionBudget{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(poddisruptionbudgetsResource, c.ns, podDisruptionBudget, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PodDisruptionBudget), err -} - -// Update takes the representation of a podDisruptionBudget and updates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. -func (c *FakePodDisruptionBudgets) Update(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (result *v1.PodDisruptionBudget, err error) { - emptyResult := &v1.PodDisruptionBudget{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(poddisruptionbudgetsResource, c.ns, podDisruptionBudget, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PodDisruptionBudget), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakePodDisruptionBudgets) UpdateStatus(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (result *v1.PodDisruptionBudget, err error) { - emptyResult := &v1.PodDisruptionBudget{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(poddisruptionbudgetsResource, "status", c.ns, podDisruptionBudget, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PodDisruptionBudget), err -} - -// Delete takes name of the podDisruptionBudget and deletes it. Returns an error if one occurs. -func (c *FakePodDisruptionBudgets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(poddisruptionbudgetsResource, c.ns, name, opts), &v1.PodDisruptionBudget{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakePodDisruptionBudgets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(poddisruptionbudgetsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.PodDisruptionBudgetList{}) - return err -} - -// Patch applies the patch and returns the patched podDisruptionBudget. -func (c *FakePodDisruptionBudgets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodDisruptionBudget, err error) { - emptyResult := &v1.PodDisruptionBudget{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(poddisruptionbudgetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PodDisruptionBudget), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied podDisruptionBudget. -func (c *FakePodDisruptionBudgets) Apply(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudgetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodDisruptionBudget, err error) { - if podDisruptionBudget == nil { - return nil, fmt.Errorf("podDisruptionBudget provided to Apply must not be nil") - } - data, err := json.Marshal(podDisruptionBudget) - if err != nil { - return nil, err - } - name := podDisruptionBudget.Name - if name == nil { - return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply") - } - emptyResult := &v1.PodDisruptionBudget{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PodDisruptionBudget), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakePodDisruptionBudgets) ApplyStatus(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudgetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodDisruptionBudget, err error) { - if podDisruptionBudget == nil { - return nil, fmt.Errorf("podDisruptionBudget provided to Apply must not be nil") - } - data, err := json.Marshal(podDisruptionBudget) - if err != nil { - return nil, err - } - name := podDisruptionBudget.Name - if name == nil { - return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply") - } - emptyResult := &v1.PodDisruptionBudget{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PodDisruptionBudget), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_policy_client.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_policy_client.go deleted file mode 100644 index d5bb3d549..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_policy_client.go +++ /dev/null @@ -1,44 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/client-go/kubernetes/typed/policy/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakePolicyV1 struct { - *testing.Fake -} - -func (c *FakePolicyV1) Evictions(namespace string) v1.EvictionInterface { - return &FakeEvictions{c, namespace} -} - -func (c *FakePolicyV1) PodDisruptionBudgets(namespace string) v1.PodDisruptionBudgetInterface { - return &FakePodDisruptionBudgets{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakePolicyV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_eviction.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_eviction.go deleted file mode 100644 index b8f6f3eae..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_eviction.go +++ /dev/null @@ -1,25 +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 client-gen. DO NOT EDIT. - -package fake - -// FakeEvictions implements EvictionInterface -type FakeEvictions struct { - Fake *FakePolicyV1beta1 - ns string -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_eviction_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_eviction_expansion.go deleted file mode 100644 index f97522bb3..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_eviction_expansion.go +++ /dev/null @@ -1,37 +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 fake - -import ( - "context" - - policy "k8s.io/api/policy/v1beta1" - "k8s.io/apimachinery/pkg/runtime/schema" - core "k8s.io/client-go/testing" -) - -func (c *FakeEvictions) Evict(ctx context.Context, eviction *policy.Eviction) error { - action := core.CreateActionImpl{} - action.Verb = "create" - action.Namespace = c.ns - action.Resource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"} - action.Subresource = "eviction" - action.Object = eviction - - _, err := c.Fake.Invokes(action, eviction) - return err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go deleted file mode 100644 index fbd9d01e0..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/policy/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - policyv1beta1 "k8s.io/client-go/applyconfigurations/policy/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakePodDisruptionBudgets implements PodDisruptionBudgetInterface -type FakePodDisruptionBudgets struct { - Fake *FakePolicyV1beta1 - ns string -} - -var poddisruptionbudgetsResource = v1beta1.SchemeGroupVersion.WithResource("poddisruptionbudgets") - -var poddisruptionbudgetsKind = v1beta1.SchemeGroupVersion.WithKind("PodDisruptionBudget") - -// Get takes name of the podDisruptionBudget, and returns the corresponding podDisruptionBudget object, and an error if there is any. -func (c *FakePodDisruptionBudgets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PodDisruptionBudget, err error) { - emptyResult := &v1beta1.PodDisruptionBudget{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(poddisruptionbudgetsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.PodDisruptionBudget), err -} - -// List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. -func (c *FakePodDisruptionBudgets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PodDisruptionBudgetList, err error) { - emptyResult := &v1beta1.PodDisruptionBudgetList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(poddisruptionbudgetsResource, poddisruptionbudgetsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.PodDisruptionBudgetList{ListMeta: obj.(*v1beta1.PodDisruptionBudgetList).ListMeta} - for _, item := range obj.(*v1beta1.PodDisruptionBudgetList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested podDisruptionBudgets. -func (c *FakePodDisruptionBudgets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(poddisruptionbudgetsResource, c.ns, opts)) - -} - -// Create takes the representation of a podDisruptionBudget and creates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. -func (c *FakePodDisruptionBudgets) Create(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.CreateOptions) (result *v1beta1.PodDisruptionBudget, err error) { - emptyResult := &v1beta1.PodDisruptionBudget{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(poddisruptionbudgetsResource, c.ns, podDisruptionBudget, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.PodDisruptionBudget), err -} - -// Update takes the representation of a podDisruptionBudget and updates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. -func (c *FakePodDisruptionBudgets) Update(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (result *v1beta1.PodDisruptionBudget, err error) { - emptyResult := &v1beta1.PodDisruptionBudget{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(poddisruptionbudgetsResource, c.ns, podDisruptionBudget, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.PodDisruptionBudget), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakePodDisruptionBudgets) UpdateStatus(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (result *v1beta1.PodDisruptionBudget, err error) { - emptyResult := &v1beta1.PodDisruptionBudget{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(poddisruptionbudgetsResource, "status", c.ns, podDisruptionBudget, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.PodDisruptionBudget), err -} - -// Delete takes name of the podDisruptionBudget and deletes it. Returns an error if one occurs. -func (c *FakePodDisruptionBudgets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(poddisruptionbudgetsResource, c.ns, name, opts), &v1beta1.PodDisruptionBudget{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakePodDisruptionBudgets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(poddisruptionbudgetsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.PodDisruptionBudgetList{}) - return err -} - -// Patch applies the patch and returns the patched podDisruptionBudget. -func (c *FakePodDisruptionBudgets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PodDisruptionBudget, err error) { - emptyResult := &v1beta1.PodDisruptionBudget{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(poddisruptionbudgetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.PodDisruptionBudget), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied podDisruptionBudget. -func (c *FakePodDisruptionBudgets) Apply(ctx context.Context, podDisruptionBudget *policyv1beta1.PodDisruptionBudgetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodDisruptionBudget, err error) { - if podDisruptionBudget == nil { - return nil, fmt.Errorf("podDisruptionBudget provided to Apply must not be nil") - } - data, err := json.Marshal(podDisruptionBudget) - if err != nil { - return nil, err - } - name := podDisruptionBudget.Name - if name == nil { - return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply") - } - emptyResult := &v1beta1.PodDisruptionBudget{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.PodDisruptionBudget), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakePodDisruptionBudgets) ApplyStatus(ctx context.Context, podDisruptionBudget *policyv1beta1.PodDisruptionBudgetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodDisruptionBudget, err error) { - if podDisruptionBudget == nil { - return nil, fmt.Errorf("podDisruptionBudget provided to Apply must not be nil") - } - data, err := json.Marshal(podDisruptionBudget) - if err != nil { - return nil, err - } - name := podDisruptionBudget.Name - if name == nil { - return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply") - } - emptyResult := &v1beta1.PodDisruptionBudget{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.PodDisruptionBudget), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go deleted file mode 100644 index 90670b113..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go +++ /dev/null @@ -1,44 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakePolicyV1beta1 struct { - *testing.Fake -} - -func (c *FakePolicyV1beta1) Evictions(namespace string) v1beta1.EvictionInterface { - return &FakeEvictions{c, namespace} -} - -func (c *FakePolicyV1beta1) PodDisruptionBudgets(namespace string) v1beta1.PodDisruptionBudgetInterface { - return &FakePodDisruptionBudgets{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakePolicyV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go deleted file mode 100644 index 6df91b1a8..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/rbac/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" - testing "k8s.io/client-go/testing" -) - -// FakeClusterRoles implements ClusterRoleInterface -type FakeClusterRoles struct { - Fake *FakeRbacV1 -} - -var clusterrolesResource = v1.SchemeGroupVersion.WithResource("clusterroles") - -var clusterrolesKind = v1.SchemeGroupVersion.WithKind("ClusterRole") - -// Get takes name of the clusterRole, and returns the corresponding clusterRole object, and an error if there is any. -func (c *FakeClusterRoles) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterRole, err error) { - emptyResult := &v1.ClusterRole{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(clusterrolesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ClusterRole), err -} - -// List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. -func (c *FakeClusterRoles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleList, err error) { - emptyResult := &v1.ClusterRoleList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(clusterrolesResource, clusterrolesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.ClusterRoleList{ListMeta: obj.(*v1.ClusterRoleList).ListMeta} - for _, item := range obj.(*v1.ClusterRoleList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested clusterRoles. -func (c *FakeClusterRoles) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(clusterrolesResource, opts)) -} - -// Create takes the representation of a clusterRole and creates it. Returns the server's representation of the clusterRole, and an error, if there is any. -func (c *FakeClusterRoles) Create(ctx context.Context, clusterRole *v1.ClusterRole, opts metav1.CreateOptions) (result *v1.ClusterRole, err error) { - emptyResult := &v1.ClusterRole{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(clusterrolesResource, clusterRole, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ClusterRole), err -} - -// Update takes the representation of a clusterRole and updates it. Returns the server's representation of the clusterRole, and an error, if there is any. -func (c *FakeClusterRoles) Update(ctx context.Context, clusterRole *v1.ClusterRole, opts metav1.UpdateOptions) (result *v1.ClusterRole, err error) { - emptyResult := &v1.ClusterRole{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(clusterrolesResource, clusterRole, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ClusterRole), err -} - -// Delete takes name of the clusterRole and deletes it. Returns an error if one occurs. -func (c *FakeClusterRoles) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(clusterrolesResource, name, opts), &v1.ClusterRole{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(clusterrolesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.ClusterRoleList{}) - return err -} - -// Patch applies the patch and returns the patched clusterRole. -func (c *FakeClusterRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRole, err error) { - emptyResult := &v1.ClusterRole{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ClusterRole), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied clusterRole. -func (c *FakeClusterRoles) Apply(ctx context.Context, clusterRole *rbacv1.ClusterRoleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ClusterRole, err error) { - if clusterRole == nil { - return nil, fmt.Errorf("clusterRole provided to Apply must not be nil") - } - data, err := json.Marshal(clusterRole) - if err != nil { - return nil, err - } - name := clusterRole.Name - if name == nil { - return nil, fmt.Errorf("clusterRole.Name must be provided to Apply") - } - emptyResult := &v1.ClusterRole{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ClusterRole), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go deleted file mode 100644 index 6f3251408..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/rbac/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" - testing "k8s.io/client-go/testing" -) - -// FakeClusterRoleBindings implements ClusterRoleBindingInterface -type FakeClusterRoleBindings struct { - Fake *FakeRbacV1 -} - -var clusterrolebindingsResource = v1.SchemeGroupVersion.WithResource("clusterrolebindings") - -var clusterrolebindingsKind = v1.SchemeGroupVersion.WithKind("ClusterRoleBinding") - -// Get takes name of the clusterRoleBinding, and returns the corresponding clusterRoleBinding object, and an error if there is any. -func (c *FakeClusterRoleBindings) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterRoleBinding, err error) { - emptyResult := &v1.ClusterRoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(clusterrolebindingsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ClusterRoleBinding), err -} - -// List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. -func (c *FakeClusterRoleBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleBindingList, err error) { - emptyResult := &v1.ClusterRoleBindingList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(clusterrolebindingsResource, clusterrolebindingsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.ClusterRoleBindingList{ListMeta: obj.(*v1.ClusterRoleBindingList).ListMeta} - for _, item := range obj.(*v1.ClusterRoleBindingList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested clusterRoleBindings. -func (c *FakeClusterRoleBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(clusterrolebindingsResource, opts)) -} - -// Create takes the representation of a clusterRoleBinding and creates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. -func (c *FakeClusterRoleBindings) Create(ctx context.Context, clusterRoleBinding *v1.ClusterRoleBinding, opts metav1.CreateOptions) (result *v1.ClusterRoleBinding, err error) { - emptyResult := &v1.ClusterRoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(clusterrolebindingsResource, clusterRoleBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ClusterRoleBinding), err -} - -// Update takes the representation of a clusterRoleBinding and updates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. -func (c *FakeClusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1.ClusterRoleBinding, opts metav1.UpdateOptions) (result *v1.ClusterRoleBinding, err error) { - emptyResult := &v1.ClusterRoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(clusterrolebindingsResource, clusterRoleBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ClusterRoleBinding), err -} - -// Delete takes name of the clusterRoleBinding and deletes it. Returns an error if one occurs. -func (c *FakeClusterRoleBindings) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(clusterrolebindingsResource, name, opts), &v1.ClusterRoleBinding{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(clusterrolebindingsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.ClusterRoleBindingList{}) - return err -} - -// Patch applies the patch and returns the patched clusterRoleBinding. -func (c *FakeClusterRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRoleBinding, err error) { - emptyResult := &v1.ClusterRoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolebindingsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ClusterRoleBinding), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied clusterRoleBinding. -func (c *FakeClusterRoleBindings) Apply(ctx context.Context, clusterRoleBinding *rbacv1.ClusterRoleBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ClusterRoleBinding, err error) { - if clusterRoleBinding == nil { - return nil, fmt.Errorf("clusterRoleBinding provided to Apply must not be nil") - } - data, err := json.Marshal(clusterRoleBinding) - if err != nil { - return nil, err - } - name := clusterRoleBinding.Name - if name == nil { - return nil, fmt.Errorf("clusterRoleBinding.Name must be provided to Apply") - } - emptyResult := &v1.ClusterRoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolebindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ClusterRoleBinding), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rbac_client.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rbac_client.go deleted file mode 100644 index 426fd70d6..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rbac_client.go +++ /dev/null @@ -1,52 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/client-go/kubernetes/typed/rbac/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeRbacV1 struct { - *testing.Fake -} - -func (c *FakeRbacV1) ClusterRoles() v1.ClusterRoleInterface { - return &FakeClusterRoles{c} -} - -func (c *FakeRbacV1) ClusterRoleBindings() v1.ClusterRoleBindingInterface { - return &FakeClusterRoleBindings{c} -} - -func (c *FakeRbacV1) Roles(namespace string) v1.RoleInterface { - return &FakeRoles{c, namespace} -} - -func (c *FakeRbacV1) RoleBindings(namespace string) v1.RoleBindingInterface { - return &FakeRoleBindings{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeRbacV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_role.go deleted file mode 100644 index ba9161940..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_role.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/rbac/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" - testing "k8s.io/client-go/testing" -) - -// FakeRoles implements RoleInterface -type FakeRoles struct { - Fake *FakeRbacV1 - ns string -} - -var rolesResource = v1.SchemeGroupVersion.WithResource("roles") - -var rolesKind = v1.SchemeGroupVersion.WithKind("Role") - -// Get takes name of the role, and returns the corresponding role object, and an error if there is any. -func (c *FakeRoles) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Role, err error) { - emptyResult := &v1.Role{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(rolesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Role), err -} - -// List takes label and field selectors, and returns the list of Roles that match those selectors. -func (c *FakeRoles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleList, err error) { - emptyResult := &v1.RoleList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(rolesResource, rolesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.RoleList{ListMeta: obj.(*v1.RoleList).ListMeta} - for _, item := range obj.(*v1.RoleList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested roles. -func (c *FakeRoles) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(rolesResource, c.ns, opts)) - -} - -// Create takes the representation of a role and creates it. Returns the server's representation of the role, and an error, if there is any. -func (c *FakeRoles) Create(ctx context.Context, role *v1.Role, opts metav1.CreateOptions) (result *v1.Role, err error) { - emptyResult := &v1.Role{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(rolesResource, c.ns, role, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Role), err -} - -// Update takes the representation of a role and updates it. Returns the server's representation of the role, and an error, if there is any. -func (c *FakeRoles) Update(ctx context.Context, role *v1.Role, opts metav1.UpdateOptions) (result *v1.Role, err error) { - emptyResult := &v1.Role{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(rolesResource, c.ns, role, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Role), err -} - -// Delete takes name of the role and deletes it. Returns an error if one occurs. -func (c *FakeRoles) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(rolesResource, c.ns, name, opts), &v1.Role{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeRoles) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(rolesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.RoleList{}) - return err -} - -// Patch applies the patch and returns the patched role. -func (c *FakeRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Role, err error) { - emptyResult := &v1.Role{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(rolesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Role), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied role. -func (c *FakeRoles) Apply(ctx context.Context, role *rbacv1.RoleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Role, err error) { - if role == nil { - return nil, fmt.Errorf("role provided to Apply must not be nil") - } - data, err := json.Marshal(role) - if err != nil { - return nil, err - } - name := role.Name - if name == nil { - return nil, fmt.Errorf("role.Name must be provided to Apply") - } - emptyResult := &v1.Role{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(rolesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.Role), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go deleted file mode 100644 index 6d7d7d193..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/rbac/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" - testing "k8s.io/client-go/testing" -) - -// FakeRoleBindings implements RoleBindingInterface -type FakeRoleBindings struct { - Fake *FakeRbacV1 - ns string -} - -var rolebindingsResource = v1.SchemeGroupVersion.WithResource("rolebindings") - -var rolebindingsKind = v1.SchemeGroupVersion.WithKind("RoleBinding") - -// Get takes name of the roleBinding, and returns the corresponding roleBinding object, and an error if there is any. -func (c *FakeRoleBindings) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RoleBinding, err error) { - emptyResult := &v1.RoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(rolebindingsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.RoleBinding), err -} - -// List takes label and field selectors, and returns the list of RoleBindings that match those selectors. -func (c *FakeRoleBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleBindingList, err error) { - emptyResult := &v1.RoleBindingList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(rolebindingsResource, rolebindingsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.RoleBindingList{ListMeta: obj.(*v1.RoleBindingList).ListMeta} - for _, item := range obj.(*v1.RoleBindingList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested roleBindings. -func (c *FakeRoleBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(rolebindingsResource, c.ns, opts)) - -} - -// Create takes the representation of a roleBinding and creates it. Returns the server's representation of the roleBinding, and an error, if there is any. -func (c *FakeRoleBindings) Create(ctx context.Context, roleBinding *v1.RoleBinding, opts metav1.CreateOptions) (result *v1.RoleBinding, err error) { - emptyResult := &v1.RoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(rolebindingsResource, c.ns, roleBinding, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.RoleBinding), err -} - -// Update takes the representation of a roleBinding and updates it. Returns the server's representation of the roleBinding, and an error, if there is any. -func (c *FakeRoleBindings) Update(ctx context.Context, roleBinding *v1.RoleBinding, opts metav1.UpdateOptions) (result *v1.RoleBinding, err error) { - emptyResult := &v1.RoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(rolebindingsResource, c.ns, roleBinding, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.RoleBinding), err -} - -// Delete takes name of the roleBinding and deletes it. Returns an error if one occurs. -func (c *FakeRoleBindings) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(rolebindingsResource, c.ns, name, opts), &v1.RoleBinding{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(rolebindingsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.RoleBindingList{}) - return err -} - -// Patch applies the patch and returns the patched roleBinding. -func (c *FakeRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RoleBinding, err error) { - emptyResult := &v1.RoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(rolebindingsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.RoleBinding), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied roleBinding. -func (c *FakeRoleBindings) Apply(ctx context.Context, roleBinding *rbacv1.RoleBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.RoleBinding, err error) { - if roleBinding == nil { - return nil, fmt.Errorf("roleBinding provided to Apply must not be nil") - } - data, err := json.Marshal(roleBinding) - if err != nil { - return nil, err - } - name := roleBinding.Name - if name == nil { - return nil, fmt.Errorf("roleBinding.Name must be provided to Apply") - } - emptyResult := &v1.RoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(rolebindingsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.RoleBinding), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go deleted file mode 100644 index 34c9a853e..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/rbac/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakeClusterRoles implements ClusterRoleInterface -type FakeClusterRoles struct { - Fake *FakeRbacV1alpha1 -} - -var clusterrolesResource = v1alpha1.SchemeGroupVersion.WithResource("clusterroles") - -var clusterrolesKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterRole") - -// Get takes name of the clusterRole, and returns the corresponding clusterRole object, and an error if there is any. -func (c *FakeClusterRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterRole, err error) { - emptyResult := &v1alpha1.ClusterRole{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(clusterrolesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterRole), err -} - -// List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. -func (c *FakeClusterRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleList, err error) { - emptyResult := &v1alpha1.ClusterRoleList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(clusterrolesResource, clusterrolesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ClusterRoleList{ListMeta: obj.(*v1alpha1.ClusterRoleList).ListMeta} - for _, item := range obj.(*v1alpha1.ClusterRoleList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested clusterRoles. -func (c *FakeClusterRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(clusterrolesResource, opts)) -} - -// Create takes the representation of a clusterRole and creates it. Returns the server's representation of the clusterRole, and an error, if there is any. -func (c *FakeClusterRoles) Create(ctx context.Context, clusterRole *v1alpha1.ClusterRole, opts v1.CreateOptions) (result *v1alpha1.ClusterRole, err error) { - emptyResult := &v1alpha1.ClusterRole{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(clusterrolesResource, clusterRole, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterRole), err -} - -// Update takes the representation of a clusterRole and updates it. Returns the server's representation of the clusterRole, and an error, if there is any. -func (c *FakeClusterRoles) Update(ctx context.Context, clusterRole *v1alpha1.ClusterRole, opts v1.UpdateOptions) (result *v1alpha1.ClusterRole, err error) { - emptyResult := &v1alpha1.ClusterRole{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(clusterrolesResource, clusterRole, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterRole), err -} - -// Delete takes name of the clusterRole and deletes it. Returns an error if one occurs. -func (c *FakeClusterRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(clusterrolesResource, name, opts), &v1alpha1.ClusterRole{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(clusterrolesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.ClusterRoleList{}) - return err -} - -// Patch applies the patch and returns the patched clusterRole. -func (c *FakeClusterRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRole, err error) { - emptyResult := &v1alpha1.ClusterRole{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterRole), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied clusterRole. -func (c *FakeClusterRoles) Apply(ctx context.Context, clusterRole *rbacv1alpha1.ClusterRoleApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterRole, err error) { - if clusterRole == nil { - return nil, fmt.Errorf("clusterRole provided to Apply must not be nil") - } - data, err := json.Marshal(clusterRole) - if err != nil { - return nil, err - } - name := clusterRole.Name - if name == nil { - return nil, fmt.Errorf("clusterRole.Name must be provided to Apply") - } - emptyResult := &v1alpha1.ClusterRole{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterRole), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go deleted file mode 100644 index d42f76342..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/rbac/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakeClusterRoleBindings implements ClusterRoleBindingInterface -type FakeClusterRoleBindings struct { - Fake *FakeRbacV1alpha1 -} - -var clusterrolebindingsResource = v1alpha1.SchemeGroupVersion.WithResource("clusterrolebindings") - -var clusterrolebindingsKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterRoleBinding") - -// Get takes name of the clusterRoleBinding, and returns the corresponding clusterRoleBinding object, and an error if there is any. -func (c *FakeClusterRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterRoleBinding, err error) { - emptyResult := &v1alpha1.ClusterRoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(clusterrolebindingsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterRoleBinding), err -} - -// List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. -func (c *FakeClusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleBindingList, err error) { - emptyResult := &v1alpha1.ClusterRoleBindingList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(clusterrolebindingsResource, clusterrolebindingsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ClusterRoleBindingList{ListMeta: obj.(*v1alpha1.ClusterRoleBindingList).ListMeta} - for _, item := range obj.(*v1alpha1.ClusterRoleBindingList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested clusterRoleBindings. -func (c *FakeClusterRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(clusterrolebindingsResource, opts)) -} - -// Create takes the representation of a clusterRoleBinding and creates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. -func (c *FakeClusterRoleBindings) Create(ctx context.Context, clusterRoleBinding *v1alpha1.ClusterRoleBinding, opts v1.CreateOptions) (result *v1alpha1.ClusterRoleBinding, err error) { - emptyResult := &v1alpha1.ClusterRoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(clusterrolebindingsResource, clusterRoleBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterRoleBinding), err -} - -// Update takes the representation of a clusterRoleBinding and updates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. -func (c *FakeClusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1alpha1.ClusterRoleBinding, opts v1.UpdateOptions) (result *v1alpha1.ClusterRoleBinding, err error) { - emptyResult := &v1alpha1.ClusterRoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(clusterrolebindingsResource, clusterRoleBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterRoleBinding), err -} - -// Delete takes name of the clusterRoleBinding and deletes it. Returns an error if one occurs. -func (c *FakeClusterRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(clusterrolebindingsResource, name, opts), &v1alpha1.ClusterRoleBinding{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(clusterrolebindingsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.ClusterRoleBindingList{}) - return err -} - -// Patch applies the patch and returns the patched clusterRoleBinding. -func (c *FakeClusterRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRoleBinding, err error) { - emptyResult := &v1alpha1.ClusterRoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolebindingsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterRoleBinding), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied clusterRoleBinding. -func (c *FakeClusterRoleBindings) Apply(ctx context.Context, clusterRoleBinding *rbacv1alpha1.ClusterRoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterRoleBinding, err error) { - if clusterRoleBinding == nil { - return nil, fmt.Errorf("clusterRoleBinding provided to Apply must not be nil") - } - data, err := json.Marshal(clusterRoleBinding) - if err != nil { - return nil, err - } - name := clusterRoleBinding.Name - if name == nil { - return nil, fmt.Errorf("clusterRoleBinding.Name must be provided to Apply") - } - emptyResult := &v1alpha1.ClusterRoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolebindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterRoleBinding), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rbac_client.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rbac_client.go deleted file mode 100644 index 3447e9be8..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rbac_client.go +++ /dev/null @@ -1,52 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeRbacV1alpha1 struct { - *testing.Fake -} - -func (c *FakeRbacV1alpha1) ClusterRoles() v1alpha1.ClusterRoleInterface { - return &FakeClusterRoles{c} -} - -func (c *FakeRbacV1alpha1) ClusterRoleBindings() v1alpha1.ClusterRoleBindingInterface { - return &FakeClusterRoleBindings{c} -} - -func (c *FakeRbacV1alpha1) Roles(namespace string) v1alpha1.RoleInterface { - return &FakeRoles{c, namespace} -} - -func (c *FakeRbacV1alpha1) RoleBindings(namespace string) v1alpha1.RoleBindingInterface { - return &FakeRoleBindings{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeRbacV1alpha1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go deleted file mode 100644 index 9b0ba7cac..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/rbac/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakeRoles implements RoleInterface -type FakeRoles struct { - Fake *FakeRbacV1alpha1 - ns string -} - -var rolesResource = v1alpha1.SchemeGroupVersion.WithResource("roles") - -var rolesKind = v1alpha1.SchemeGroupVersion.WithKind("Role") - -// Get takes name of the role, and returns the corresponding role object, and an error if there is any. -func (c *FakeRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Role, err error) { - emptyResult := &v1alpha1.Role{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(rolesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.Role), err -} - -// List takes label and field selectors, and returns the list of Roles that match those selectors. -func (c *FakeRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleList, err error) { - emptyResult := &v1alpha1.RoleList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(rolesResource, rolesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.RoleList{ListMeta: obj.(*v1alpha1.RoleList).ListMeta} - for _, item := range obj.(*v1alpha1.RoleList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested roles. -func (c *FakeRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(rolesResource, c.ns, opts)) - -} - -// Create takes the representation of a role and creates it. Returns the server's representation of the role, and an error, if there is any. -func (c *FakeRoles) Create(ctx context.Context, role *v1alpha1.Role, opts v1.CreateOptions) (result *v1alpha1.Role, err error) { - emptyResult := &v1alpha1.Role{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(rolesResource, c.ns, role, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.Role), err -} - -// Update takes the representation of a role and updates it. Returns the server's representation of the role, and an error, if there is any. -func (c *FakeRoles) Update(ctx context.Context, role *v1alpha1.Role, opts v1.UpdateOptions) (result *v1alpha1.Role, err error) { - emptyResult := &v1alpha1.Role{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(rolesResource, c.ns, role, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.Role), err -} - -// Delete takes name of the role and deletes it. Returns an error if one occurs. -func (c *FakeRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(rolesResource, c.ns, name, opts), &v1alpha1.Role{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(rolesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.RoleList{}) - return err -} - -// Patch applies the patch and returns the patched role. -func (c *FakeRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Role, err error) { - emptyResult := &v1alpha1.Role{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(rolesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.Role), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied role. -func (c *FakeRoles) Apply(ctx context.Context, role *rbacv1alpha1.RoleApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Role, err error) { - if role == nil { - return nil, fmt.Errorf("role provided to Apply must not be nil") - } - data, err := json.Marshal(role) - if err != nil { - return nil, err - } - name := role.Name - if name == nil { - return nil, fmt.Errorf("role.Name must be provided to Apply") - } - emptyResult := &v1alpha1.Role{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(rolesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.Role), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go deleted file mode 100644 index f572945ac..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/rbac/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakeRoleBindings implements RoleBindingInterface -type FakeRoleBindings struct { - Fake *FakeRbacV1alpha1 - ns string -} - -var rolebindingsResource = v1alpha1.SchemeGroupVersion.WithResource("rolebindings") - -var rolebindingsKind = v1alpha1.SchemeGroupVersion.WithKind("RoleBinding") - -// Get takes name of the roleBinding, and returns the corresponding roleBinding object, and an error if there is any. -func (c *FakeRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RoleBinding, err error) { - emptyResult := &v1alpha1.RoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(rolebindingsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.RoleBinding), err -} - -// List takes label and field selectors, and returns the list of RoleBindings that match those selectors. -func (c *FakeRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleBindingList, err error) { - emptyResult := &v1alpha1.RoleBindingList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(rolebindingsResource, rolebindingsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.RoleBindingList{ListMeta: obj.(*v1alpha1.RoleBindingList).ListMeta} - for _, item := range obj.(*v1alpha1.RoleBindingList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested roleBindings. -func (c *FakeRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(rolebindingsResource, c.ns, opts)) - -} - -// Create takes the representation of a roleBinding and creates it. Returns the server's representation of the roleBinding, and an error, if there is any. -func (c *FakeRoleBindings) Create(ctx context.Context, roleBinding *v1alpha1.RoleBinding, opts v1.CreateOptions) (result *v1alpha1.RoleBinding, err error) { - emptyResult := &v1alpha1.RoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(rolebindingsResource, c.ns, roleBinding, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.RoleBinding), err -} - -// Update takes the representation of a roleBinding and updates it. Returns the server's representation of the roleBinding, and an error, if there is any. -func (c *FakeRoleBindings) Update(ctx context.Context, roleBinding *v1alpha1.RoleBinding, opts v1.UpdateOptions) (result *v1alpha1.RoleBinding, err error) { - emptyResult := &v1alpha1.RoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(rolebindingsResource, c.ns, roleBinding, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.RoleBinding), err -} - -// Delete takes name of the roleBinding and deletes it. Returns an error if one occurs. -func (c *FakeRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(rolebindingsResource, c.ns, name, opts), &v1alpha1.RoleBinding{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(rolebindingsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.RoleBindingList{}) - return err -} - -// Patch applies the patch and returns the patched roleBinding. -func (c *FakeRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RoleBinding, err error) { - emptyResult := &v1alpha1.RoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(rolebindingsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.RoleBinding), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied roleBinding. -func (c *FakeRoleBindings) Apply(ctx context.Context, roleBinding *rbacv1alpha1.RoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.RoleBinding, err error) { - if roleBinding == nil { - return nil, fmt.Errorf("roleBinding provided to Apply must not be nil") - } - data, err := json.Marshal(roleBinding) - if err != nil { - return nil, err - } - name := roleBinding.Name - if name == nil { - return nil, fmt.Errorf("roleBinding.Name must be provided to Apply") - } - emptyResult := &v1alpha1.RoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(rolebindingsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.RoleBinding), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go deleted file mode 100644 index b7996c106..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/rbac/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeClusterRoles implements ClusterRoleInterface -type FakeClusterRoles struct { - Fake *FakeRbacV1beta1 -} - -var clusterrolesResource = v1beta1.SchemeGroupVersion.WithResource("clusterroles") - -var clusterrolesKind = v1beta1.SchemeGroupVersion.WithKind("ClusterRole") - -// Get takes name of the clusterRole, and returns the corresponding clusterRole object, and an error if there is any. -func (c *FakeClusterRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterRole, err error) { - emptyResult := &v1beta1.ClusterRole{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(clusterrolesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ClusterRole), err -} - -// List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. -func (c *FakeClusterRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleList, err error) { - emptyResult := &v1beta1.ClusterRoleList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(clusterrolesResource, clusterrolesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.ClusterRoleList{ListMeta: obj.(*v1beta1.ClusterRoleList).ListMeta} - for _, item := range obj.(*v1beta1.ClusterRoleList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested clusterRoles. -func (c *FakeClusterRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(clusterrolesResource, opts)) -} - -// Create takes the representation of a clusterRole and creates it. Returns the server's representation of the clusterRole, and an error, if there is any. -func (c *FakeClusterRoles) Create(ctx context.Context, clusterRole *v1beta1.ClusterRole, opts v1.CreateOptions) (result *v1beta1.ClusterRole, err error) { - emptyResult := &v1beta1.ClusterRole{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(clusterrolesResource, clusterRole, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ClusterRole), err -} - -// Update takes the representation of a clusterRole and updates it. Returns the server's representation of the clusterRole, and an error, if there is any. -func (c *FakeClusterRoles) Update(ctx context.Context, clusterRole *v1beta1.ClusterRole, opts v1.UpdateOptions) (result *v1beta1.ClusterRole, err error) { - emptyResult := &v1beta1.ClusterRole{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(clusterrolesResource, clusterRole, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ClusterRole), err -} - -// Delete takes name of the clusterRole and deletes it. Returns an error if one occurs. -func (c *FakeClusterRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(clusterrolesResource, name, opts), &v1beta1.ClusterRole{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(clusterrolesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.ClusterRoleList{}) - return err -} - -// Patch applies the patch and returns the patched clusterRole. -func (c *FakeClusterRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterRole, err error) { - emptyResult := &v1beta1.ClusterRole{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ClusterRole), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied clusterRole. -func (c *FakeClusterRoles) Apply(ctx context.Context, clusterRole *rbacv1beta1.ClusterRoleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ClusterRole, err error) { - if clusterRole == nil { - return nil, fmt.Errorf("clusterRole provided to Apply must not be nil") - } - data, err := json.Marshal(clusterRole) - if err != nil { - return nil, err - } - name := clusterRole.Name - if name == nil { - return nil, fmt.Errorf("clusterRole.Name must be provided to Apply") - } - emptyResult := &v1beta1.ClusterRole{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ClusterRole), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go deleted file mode 100644 index 8843757ac..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/rbac/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeClusterRoleBindings implements ClusterRoleBindingInterface -type FakeClusterRoleBindings struct { - Fake *FakeRbacV1beta1 -} - -var clusterrolebindingsResource = v1beta1.SchemeGroupVersion.WithResource("clusterrolebindings") - -var clusterrolebindingsKind = v1beta1.SchemeGroupVersion.WithKind("ClusterRoleBinding") - -// Get takes name of the clusterRoleBinding, and returns the corresponding clusterRoleBinding object, and an error if there is any. -func (c *FakeClusterRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterRoleBinding, err error) { - emptyResult := &v1beta1.ClusterRoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(clusterrolebindingsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ClusterRoleBinding), err -} - -// List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. -func (c *FakeClusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleBindingList, err error) { - emptyResult := &v1beta1.ClusterRoleBindingList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(clusterrolebindingsResource, clusterrolebindingsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.ClusterRoleBindingList{ListMeta: obj.(*v1beta1.ClusterRoleBindingList).ListMeta} - for _, item := range obj.(*v1beta1.ClusterRoleBindingList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested clusterRoleBindings. -func (c *FakeClusterRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(clusterrolebindingsResource, opts)) -} - -// Create takes the representation of a clusterRoleBinding and creates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. -func (c *FakeClusterRoleBindings) Create(ctx context.Context, clusterRoleBinding *v1beta1.ClusterRoleBinding, opts v1.CreateOptions) (result *v1beta1.ClusterRoleBinding, err error) { - emptyResult := &v1beta1.ClusterRoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(clusterrolebindingsResource, clusterRoleBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ClusterRoleBinding), err -} - -// Update takes the representation of a clusterRoleBinding and updates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. -func (c *FakeClusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1beta1.ClusterRoleBinding, opts v1.UpdateOptions) (result *v1beta1.ClusterRoleBinding, err error) { - emptyResult := &v1beta1.ClusterRoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(clusterrolebindingsResource, clusterRoleBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ClusterRoleBinding), err -} - -// Delete takes name of the clusterRoleBinding and deletes it. Returns an error if one occurs. -func (c *FakeClusterRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(clusterrolebindingsResource, name, opts), &v1beta1.ClusterRoleBinding{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(clusterrolebindingsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.ClusterRoleBindingList{}) - return err -} - -// Patch applies the patch and returns the patched clusterRoleBinding. -func (c *FakeClusterRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterRoleBinding, err error) { - emptyResult := &v1beta1.ClusterRoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolebindingsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ClusterRoleBinding), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied clusterRoleBinding. -func (c *FakeClusterRoleBindings) Apply(ctx context.Context, clusterRoleBinding *rbacv1beta1.ClusterRoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ClusterRoleBinding, err error) { - if clusterRoleBinding == nil { - return nil, fmt.Errorf("clusterRoleBinding provided to Apply must not be nil") - } - data, err := json.Marshal(clusterRoleBinding) - if err != nil { - return nil, err - } - name := clusterRoleBinding.Name - if name == nil { - return nil, fmt.Errorf("clusterRoleBinding.Name must be provided to Apply") - } - emptyResult := &v1beta1.ClusterRoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolebindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.ClusterRoleBinding), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rbac_client.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rbac_client.go deleted file mode 100644 index bdbc246b7..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rbac_client.go +++ /dev/null @@ -1,52 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeRbacV1beta1 struct { - *testing.Fake -} - -func (c *FakeRbacV1beta1) ClusterRoles() v1beta1.ClusterRoleInterface { - return &FakeClusterRoles{c} -} - -func (c *FakeRbacV1beta1) ClusterRoleBindings() v1beta1.ClusterRoleBindingInterface { - return &FakeClusterRoleBindings{c} -} - -func (c *FakeRbacV1beta1) Roles(namespace string) v1beta1.RoleInterface { - return &FakeRoles{c, namespace} -} - -func (c *FakeRbacV1beta1) RoleBindings(namespace string) v1beta1.RoleBindingInterface { - return &FakeRoleBindings{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeRbacV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_role.go deleted file mode 100644 index aa0fe28a1..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_role.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/rbac/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeRoles implements RoleInterface -type FakeRoles struct { - Fake *FakeRbacV1beta1 - ns string -} - -var rolesResource = v1beta1.SchemeGroupVersion.WithResource("roles") - -var rolesKind = v1beta1.SchemeGroupVersion.WithKind("Role") - -// Get takes name of the role, and returns the corresponding role object, and an error if there is any. -func (c *FakeRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Role, err error) { - emptyResult := &v1beta1.Role{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(rolesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Role), err -} - -// List takes label and field selectors, and returns the list of Roles that match those selectors. -func (c *FakeRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleList, err error) { - emptyResult := &v1beta1.RoleList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(rolesResource, rolesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.RoleList{ListMeta: obj.(*v1beta1.RoleList).ListMeta} - for _, item := range obj.(*v1beta1.RoleList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested roles. -func (c *FakeRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(rolesResource, c.ns, opts)) - -} - -// Create takes the representation of a role and creates it. Returns the server's representation of the role, and an error, if there is any. -func (c *FakeRoles) Create(ctx context.Context, role *v1beta1.Role, opts v1.CreateOptions) (result *v1beta1.Role, err error) { - emptyResult := &v1beta1.Role{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(rolesResource, c.ns, role, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Role), err -} - -// Update takes the representation of a role and updates it. Returns the server's representation of the role, and an error, if there is any. -func (c *FakeRoles) Update(ctx context.Context, role *v1beta1.Role, opts v1.UpdateOptions) (result *v1beta1.Role, err error) { - emptyResult := &v1beta1.Role{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(rolesResource, c.ns, role, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Role), err -} - -// Delete takes name of the role and deletes it. Returns an error if one occurs. -func (c *FakeRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(rolesResource, c.ns, name, opts), &v1beta1.Role{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(rolesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.RoleList{}) - return err -} - -// Patch applies the patch and returns the patched role. -func (c *FakeRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Role, err error) { - emptyResult := &v1beta1.Role{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(rolesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Role), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied role. -func (c *FakeRoles) Apply(ctx context.Context, role *rbacv1beta1.RoleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Role, err error) { - if role == nil { - return nil, fmt.Errorf("role provided to Apply must not be nil") - } - data, err := json.Marshal(role) - if err != nil { - return nil, err - } - name := role.Name - if name == nil { - return nil, fmt.Errorf("role.Name must be provided to Apply") - } - emptyResult := &v1beta1.Role{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(rolesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.Role), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go deleted file mode 100644 index 26c3c8045..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/rbac/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeRoleBindings implements RoleBindingInterface -type FakeRoleBindings struct { - Fake *FakeRbacV1beta1 - ns string -} - -var rolebindingsResource = v1beta1.SchemeGroupVersion.WithResource("rolebindings") - -var rolebindingsKind = v1beta1.SchemeGroupVersion.WithKind("RoleBinding") - -// Get takes name of the roleBinding, and returns the corresponding roleBinding object, and an error if there is any. -func (c *FakeRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.RoleBinding, err error) { - emptyResult := &v1beta1.RoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(rolebindingsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.RoleBinding), err -} - -// List takes label and field selectors, and returns the list of RoleBindings that match those selectors. -func (c *FakeRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleBindingList, err error) { - emptyResult := &v1beta1.RoleBindingList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(rolebindingsResource, rolebindingsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.RoleBindingList{ListMeta: obj.(*v1beta1.RoleBindingList).ListMeta} - for _, item := range obj.(*v1beta1.RoleBindingList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested roleBindings. -func (c *FakeRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(rolebindingsResource, c.ns, opts)) - -} - -// Create takes the representation of a roleBinding and creates it. Returns the server's representation of the roleBinding, and an error, if there is any. -func (c *FakeRoleBindings) Create(ctx context.Context, roleBinding *v1beta1.RoleBinding, opts v1.CreateOptions) (result *v1beta1.RoleBinding, err error) { - emptyResult := &v1beta1.RoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(rolebindingsResource, c.ns, roleBinding, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.RoleBinding), err -} - -// Update takes the representation of a roleBinding and updates it. Returns the server's representation of the roleBinding, and an error, if there is any. -func (c *FakeRoleBindings) Update(ctx context.Context, roleBinding *v1beta1.RoleBinding, opts v1.UpdateOptions) (result *v1beta1.RoleBinding, err error) { - emptyResult := &v1beta1.RoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(rolebindingsResource, c.ns, roleBinding, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.RoleBinding), err -} - -// Delete takes name of the roleBinding and deletes it. Returns an error if one occurs. -func (c *FakeRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(rolebindingsResource, c.ns, name, opts), &v1beta1.RoleBinding{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(rolebindingsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.RoleBindingList{}) - return err -} - -// Patch applies the patch and returns the patched roleBinding. -func (c *FakeRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RoleBinding, err error) { - emptyResult := &v1beta1.RoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(rolebindingsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.RoleBinding), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied roleBinding. -func (c *FakeRoleBindings) Apply(ctx context.Context, roleBinding *rbacv1beta1.RoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.RoleBinding, err error) { - if roleBinding == nil { - return nil, fmt.Errorf("roleBinding provided to Apply must not be nil") - } - data, err := json.Marshal(roleBinding) - if err != nil { - return nil, err - } - name := roleBinding.Name - if name == nil { - return nil, fmt.Errorf("roleBinding.Name must be provided to Apply") - } - emptyResult := &v1beta1.RoleBinding{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(rolebindingsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.RoleBinding), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_deviceclass.go b/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_deviceclass.go deleted file mode 100644 index d96cbd221..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_deviceclass.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha3 "k8s.io/api/resource/v1alpha3" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" - testing "k8s.io/client-go/testing" -) - -// FakeDeviceClasses implements DeviceClassInterface -type FakeDeviceClasses struct { - Fake *FakeResourceV1alpha3 -} - -var deviceclassesResource = v1alpha3.SchemeGroupVersion.WithResource("deviceclasses") - -var deviceclassesKind = v1alpha3.SchemeGroupVersion.WithKind("DeviceClass") - -// Get takes name of the deviceClass, and returns the corresponding deviceClass object, and an error if there is any. -func (c *FakeDeviceClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.DeviceClass, err error) { - emptyResult := &v1alpha3.DeviceClass{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(deviceclassesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.DeviceClass), err -} - -// List takes label and field selectors, and returns the list of DeviceClasses that match those selectors. -func (c *FakeDeviceClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.DeviceClassList, err error) { - emptyResult := &v1alpha3.DeviceClassList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(deviceclassesResource, deviceclassesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha3.DeviceClassList{ListMeta: obj.(*v1alpha3.DeviceClassList).ListMeta} - for _, item := range obj.(*v1alpha3.DeviceClassList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested deviceClasses. -func (c *FakeDeviceClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(deviceclassesResource, opts)) -} - -// Create takes the representation of a deviceClass and creates it. Returns the server's representation of the deviceClass, and an error, if there is any. -func (c *FakeDeviceClasses) Create(ctx context.Context, deviceClass *v1alpha3.DeviceClass, opts v1.CreateOptions) (result *v1alpha3.DeviceClass, err error) { - emptyResult := &v1alpha3.DeviceClass{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(deviceclassesResource, deviceClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.DeviceClass), err -} - -// Update takes the representation of a deviceClass and updates it. Returns the server's representation of the deviceClass, and an error, if there is any. -func (c *FakeDeviceClasses) Update(ctx context.Context, deviceClass *v1alpha3.DeviceClass, opts v1.UpdateOptions) (result *v1alpha3.DeviceClass, err error) { - emptyResult := &v1alpha3.DeviceClass{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(deviceclassesResource, deviceClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.DeviceClass), err -} - -// Delete takes name of the deviceClass and deletes it. Returns an error if one occurs. -func (c *FakeDeviceClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(deviceclassesResource, name, opts), &v1alpha3.DeviceClass{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeDeviceClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(deviceclassesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha3.DeviceClassList{}) - return err -} - -// Patch applies the patch and returns the patched deviceClass. -func (c *FakeDeviceClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.DeviceClass, err error) { - emptyResult := &v1alpha3.DeviceClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(deviceclassesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.DeviceClass), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied deviceClass. -func (c *FakeDeviceClasses) Apply(ctx context.Context, deviceClass *resourcev1alpha3.DeviceClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.DeviceClass, err error) { - if deviceClass == nil { - return nil, fmt.Errorf("deviceClass provided to Apply must not be nil") - } - data, err := json.Marshal(deviceClass) - if err != nil { - return nil, err - } - name := deviceClass.Name - if name == nil { - return nil, fmt.Errorf("deviceClass.Name must be provided to Apply") - } - emptyResult := &v1alpha3.DeviceClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(deviceclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.DeviceClass), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_podschedulingcontext.go b/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_podschedulingcontext.go deleted file mode 100644 index 54898993e..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_podschedulingcontext.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha3 "k8s.io/api/resource/v1alpha3" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" - testing "k8s.io/client-go/testing" -) - -// FakePodSchedulingContexts implements PodSchedulingContextInterface -type FakePodSchedulingContexts struct { - Fake *FakeResourceV1alpha3 - ns string -} - -var podschedulingcontextsResource = v1alpha3.SchemeGroupVersion.WithResource("podschedulingcontexts") - -var podschedulingcontextsKind = v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContext") - -// Get takes name of the podSchedulingContext, and returns the corresponding podSchedulingContext object, and an error if there is any. -func (c *FakePodSchedulingContexts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.PodSchedulingContext, err error) { - emptyResult := &v1alpha3.PodSchedulingContext{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(podschedulingcontextsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.PodSchedulingContext), err -} - -// List takes label and field selectors, and returns the list of PodSchedulingContexts that match those selectors. -func (c *FakePodSchedulingContexts) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.PodSchedulingContextList, err error) { - emptyResult := &v1alpha3.PodSchedulingContextList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(podschedulingcontextsResource, podschedulingcontextsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha3.PodSchedulingContextList{ListMeta: obj.(*v1alpha3.PodSchedulingContextList).ListMeta} - for _, item := range obj.(*v1alpha3.PodSchedulingContextList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested podSchedulingContexts. -func (c *FakePodSchedulingContexts) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(podschedulingcontextsResource, c.ns, opts)) - -} - -// Create takes the representation of a podSchedulingContext and creates it. Returns the server's representation of the podSchedulingContext, and an error, if there is any. -func (c *FakePodSchedulingContexts) Create(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.CreateOptions) (result *v1alpha3.PodSchedulingContext, err error) { - emptyResult := &v1alpha3.PodSchedulingContext{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(podschedulingcontextsResource, c.ns, podSchedulingContext, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.PodSchedulingContext), err -} - -// Update takes the representation of a podSchedulingContext and updates it. Returns the server's representation of the podSchedulingContext, and an error, if there is any. -func (c *FakePodSchedulingContexts) Update(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.UpdateOptions) (result *v1alpha3.PodSchedulingContext, err error) { - emptyResult := &v1alpha3.PodSchedulingContext{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(podschedulingcontextsResource, c.ns, podSchedulingContext, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.PodSchedulingContext), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakePodSchedulingContexts) UpdateStatus(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.UpdateOptions) (result *v1alpha3.PodSchedulingContext, err error) { - emptyResult := &v1alpha3.PodSchedulingContext{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(podschedulingcontextsResource, "status", c.ns, podSchedulingContext, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.PodSchedulingContext), err -} - -// Delete takes name of the podSchedulingContext and deletes it. Returns an error if one occurs. -func (c *FakePodSchedulingContexts) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(podschedulingcontextsResource, c.ns, name, opts), &v1alpha3.PodSchedulingContext{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakePodSchedulingContexts) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(podschedulingcontextsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha3.PodSchedulingContextList{}) - return err -} - -// Patch applies the patch and returns the patched podSchedulingContext. -func (c *FakePodSchedulingContexts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.PodSchedulingContext, err error) { - emptyResult := &v1alpha3.PodSchedulingContext{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(podschedulingcontextsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.PodSchedulingContext), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied podSchedulingContext. -func (c *FakePodSchedulingContexts) Apply(ctx context.Context, podSchedulingContext *resourcev1alpha3.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.PodSchedulingContext, err error) { - if podSchedulingContext == nil { - return nil, fmt.Errorf("podSchedulingContext provided to Apply must not be nil") - } - data, err := json.Marshal(podSchedulingContext) - if err != nil { - return nil, err - } - name := podSchedulingContext.Name - if name == nil { - return nil, fmt.Errorf("podSchedulingContext.Name must be provided to Apply") - } - emptyResult := &v1alpha3.PodSchedulingContext{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(podschedulingcontextsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.PodSchedulingContext), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakePodSchedulingContexts) ApplyStatus(ctx context.Context, podSchedulingContext *resourcev1alpha3.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.PodSchedulingContext, err error) { - if podSchedulingContext == nil { - return nil, fmt.Errorf("podSchedulingContext provided to Apply must not be nil") - } - data, err := json.Marshal(podSchedulingContext) - if err != nil { - return nil, err - } - name := podSchedulingContext.Name - if name == nil { - return nil, fmt.Errorf("podSchedulingContext.Name must be provided to Apply") - } - emptyResult := &v1alpha3.PodSchedulingContext{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(podschedulingcontextsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.PodSchedulingContext), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resource_client.go b/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resource_client.go deleted file mode 100644 index 4523d9f09..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resource_client.go +++ /dev/null @@ -1,56 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeResourceV1alpha3 struct { - *testing.Fake -} - -func (c *FakeResourceV1alpha3) DeviceClasses() v1alpha3.DeviceClassInterface { - return &FakeDeviceClasses{c} -} - -func (c *FakeResourceV1alpha3) PodSchedulingContexts(namespace string) v1alpha3.PodSchedulingContextInterface { - return &FakePodSchedulingContexts{c, namespace} -} - -func (c *FakeResourceV1alpha3) ResourceClaims(namespace string) v1alpha3.ResourceClaimInterface { - return &FakeResourceClaims{c, namespace} -} - -func (c *FakeResourceV1alpha3) ResourceClaimTemplates(namespace string) v1alpha3.ResourceClaimTemplateInterface { - return &FakeResourceClaimTemplates{c, namespace} -} - -func (c *FakeResourceV1alpha3) ResourceSlices() v1alpha3.ResourceSliceInterface { - return &FakeResourceSlices{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeResourceV1alpha3) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaim.go b/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaim.go deleted file mode 100644 index db38b3d60..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaim.go +++ /dev/null @@ -1,197 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha3 "k8s.io/api/resource/v1alpha3" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" - testing "k8s.io/client-go/testing" -) - -// FakeResourceClaims implements ResourceClaimInterface -type FakeResourceClaims struct { - Fake *FakeResourceV1alpha3 - ns string -} - -var resourceclaimsResource = v1alpha3.SchemeGroupVersion.WithResource("resourceclaims") - -var resourceclaimsKind = v1alpha3.SchemeGroupVersion.WithKind("ResourceClaim") - -// Get takes name of the resourceClaim, and returns the corresponding resourceClaim object, and an error if there is any. -func (c *FakeResourceClaims) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ResourceClaim, err error) { - emptyResult := &v1alpha3.ResourceClaim{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(resourceclaimsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClaim), err -} - -// List takes label and field selectors, and returns the list of ResourceClaims that match those selectors. -func (c *FakeResourceClaims) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.ResourceClaimList, err error) { - emptyResult := &v1alpha3.ResourceClaimList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(resourceclaimsResource, resourceclaimsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha3.ResourceClaimList{ListMeta: obj.(*v1alpha3.ResourceClaimList).ListMeta} - for _, item := range obj.(*v1alpha3.ResourceClaimList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested resourceClaims. -func (c *FakeResourceClaims) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(resourceclaimsResource, c.ns, opts)) - -} - -// Create takes the representation of a resourceClaim and creates it. Returns the server's representation of the resourceClaim, and an error, if there is any. -func (c *FakeResourceClaims) Create(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.CreateOptions) (result *v1alpha3.ResourceClaim, err error) { - emptyResult := &v1alpha3.ResourceClaim{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(resourceclaimsResource, c.ns, resourceClaim, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClaim), err -} - -// Update takes the representation of a resourceClaim and updates it. Returns the server's representation of the resourceClaim, and an error, if there is any. -func (c *FakeResourceClaims) Update(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.UpdateOptions) (result *v1alpha3.ResourceClaim, err error) { - emptyResult := &v1alpha3.ResourceClaim{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(resourceclaimsResource, c.ns, resourceClaim, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClaim), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeResourceClaims) UpdateStatus(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.UpdateOptions) (result *v1alpha3.ResourceClaim, err error) { - emptyResult := &v1alpha3.ResourceClaim{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(resourceclaimsResource, "status", c.ns, resourceClaim, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClaim), err -} - -// Delete takes name of the resourceClaim and deletes it. Returns an error if one occurs. -func (c *FakeResourceClaims) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(resourceclaimsResource, c.ns, name, opts), &v1alpha3.ResourceClaim{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeResourceClaims) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(resourceclaimsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha3.ResourceClaimList{}) - return err -} - -// Patch applies the patch and returns the patched resourceClaim. -func (c *FakeResourceClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClaim, err error) { - emptyResult := &v1alpha3.ResourceClaim{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClaim), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied resourceClaim. -func (c *FakeResourceClaims) Apply(ctx context.Context, resourceClaim *resourcev1alpha3.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaim, err error) { - if resourceClaim == nil { - return nil, fmt.Errorf("resourceClaim provided to Apply must not be nil") - } - data, err := json.Marshal(resourceClaim) - if err != nil { - return nil, err - } - name := resourceClaim.Name - if name == nil { - return nil, fmt.Errorf("resourceClaim.Name must be provided to Apply") - } - emptyResult := &v1alpha3.ResourceClaim{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClaim), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeResourceClaims) ApplyStatus(ctx context.Context, resourceClaim *resourcev1alpha3.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaim, err error) { - if resourceClaim == nil { - return nil, fmt.Errorf("resourceClaim provided to Apply must not be nil") - } - data, err := json.Marshal(resourceClaim) - if err != nil { - return nil, err - } - name := resourceClaim.Name - if name == nil { - return nil, fmt.Errorf("resourceClaim.Name must be provided to Apply") - } - emptyResult := &v1alpha3.ResourceClaim{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClaim), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaimtemplate.go b/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaimtemplate.go deleted file mode 100644 index 28db7261f..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaimtemplate.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha3 "k8s.io/api/resource/v1alpha3" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" - testing "k8s.io/client-go/testing" -) - -// FakeResourceClaimTemplates implements ResourceClaimTemplateInterface -type FakeResourceClaimTemplates struct { - Fake *FakeResourceV1alpha3 - ns string -} - -var resourceclaimtemplatesResource = v1alpha3.SchemeGroupVersion.WithResource("resourceclaimtemplates") - -var resourceclaimtemplatesKind = v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimTemplate") - -// Get takes name of the resourceClaimTemplate, and returns the corresponding resourceClaimTemplate object, and an error if there is any. -func (c *FakeResourceClaimTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ResourceClaimTemplate, err error) { - emptyResult := &v1alpha3.ResourceClaimTemplate{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(resourceclaimtemplatesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClaimTemplate), err -} - -// List takes label and field selectors, and returns the list of ResourceClaimTemplates that match those selectors. -func (c *FakeResourceClaimTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.ResourceClaimTemplateList, err error) { - emptyResult := &v1alpha3.ResourceClaimTemplateList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(resourceclaimtemplatesResource, resourceclaimtemplatesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha3.ResourceClaimTemplateList{ListMeta: obj.(*v1alpha3.ResourceClaimTemplateList).ListMeta} - for _, item := range obj.(*v1alpha3.ResourceClaimTemplateList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested resourceClaimTemplates. -func (c *FakeResourceClaimTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(resourceclaimtemplatesResource, c.ns, opts)) - -} - -// Create takes the representation of a resourceClaimTemplate and creates it. Returns the server's representation of the resourceClaimTemplate, and an error, if there is any. -func (c *FakeResourceClaimTemplates) Create(ctx context.Context, resourceClaimTemplate *v1alpha3.ResourceClaimTemplate, opts v1.CreateOptions) (result *v1alpha3.ResourceClaimTemplate, err error) { - emptyResult := &v1alpha3.ResourceClaimTemplate{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(resourceclaimtemplatesResource, c.ns, resourceClaimTemplate, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClaimTemplate), err -} - -// Update takes the representation of a resourceClaimTemplate and updates it. Returns the server's representation of the resourceClaimTemplate, and an error, if there is any. -func (c *FakeResourceClaimTemplates) Update(ctx context.Context, resourceClaimTemplate *v1alpha3.ResourceClaimTemplate, opts v1.UpdateOptions) (result *v1alpha3.ResourceClaimTemplate, err error) { - emptyResult := &v1alpha3.ResourceClaimTemplate{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(resourceclaimtemplatesResource, c.ns, resourceClaimTemplate, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClaimTemplate), err -} - -// Delete takes name of the resourceClaimTemplate and deletes it. Returns an error if one occurs. -func (c *FakeResourceClaimTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(resourceclaimtemplatesResource, c.ns, name, opts), &v1alpha3.ResourceClaimTemplate{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeResourceClaimTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(resourceclaimtemplatesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha3.ResourceClaimTemplateList{}) - return err -} - -// Patch applies the patch and returns the patched resourceClaimTemplate. -func (c *FakeResourceClaimTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClaimTemplate, err error) { - emptyResult := &v1alpha3.ResourceClaimTemplate{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimtemplatesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClaimTemplate), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied resourceClaimTemplate. -func (c *FakeResourceClaimTemplates) Apply(ctx context.Context, resourceClaimTemplate *resourcev1alpha3.ResourceClaimTemplateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaimTemplate, err error) { - if resourceClaimTemplate == nil { - return nil, fmt.Errorf("resourceClaimTemplate provided to Apply must not be nil") - } - data, err := json.Marshal(resourceClaimTemplate) - if err != nil { - return nil, err - } - name := resourceClaimTemplate.Name - if name == nil { - return nil, fmt.Errorf("resourceClaimTemplate.Name must be provided to Apply") - } - emptyResult := &v1alpha3.ResourceClaimTemplate{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimtemplatesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClaimTemplate), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceslice.go b/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceslice.go deleted file mode 100644 index c355fc454..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resourceslice.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha3 "k8s.io/api/resource/v1alpha3" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" - testing "k8s.io/client-go/testing" -) - -// FakeResourceSlices implements ResourceSliceInterface -type FakeResourceSlices struct { - Fake *FakeResourceV1alpha3 -} - -var resourceslicesResource = v1alpha3.SchemeGroupVersion.WithResource("resourceslices") - -var resourceslicesKind = v1alpha3.SchemeGroupVersion.WithKind("ResourceSlice") - -// Get takes name of the resourceSlice, and returns the corresponding resourceSlice object, and an error if there is any. -func (c *FakeResourceSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ResourceSlice, err error) { - emptyResult := &v1alpha3.ResourceSlice{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(resourceslicesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceSlice), err -} - -// List takes label and field selectors, and returns the list of ResourceSlices that match those selectors. -func (c *FakeResourceSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.ResourceSliceList, err error) { - emptyResult := &v1alpha3.ResourceSliceList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(resourceslicesResource, resourceslicesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha3.ResourceSliceList{ListMeta: obj.(*v1alpha3.ResourceSliceList).ListMeta} - for _, item := range obj.(*v1alpha3.ResourceSliceList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested resourceSlices. -func (c *FakeResourceSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(resourceslicesResource, opts)) -} - -// Create takes the representation of a resourceSlice and creates it. Returns the server's representation of the resourceSlice, and an error, if there is any. -func (c *FakeResourceSlices) Create(ctx context.Context, resourceSlice *v1alpha3.ResourceSlice, opts v1.CreateOptions) (result *v1alpha3.ResourceSlice, err error) { - emptyResult := &v1alpha3.ResourceSlice{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(resourceslicesResource, resourceSlice, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceSlice), err -} - -// Update takes the representation of a resourceSlice and updates it. Returns the server's representation of the resourceSlice, and an error, if there is any. -func (c *FakeResourceSlices) Update(ctx context.Context, resourceSlice *v1alpha3.ResourceSlice, opts v1.UpdateOptions) (result *v1alpha3.ResourceSlice, err error) { - emptyResult := &v1alpha3.ResourceSlice{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(resourceslicesResource, resourceSlice, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceSlice), err -} - -// Delete takes name of the resourceSlice and deletes it. Returns an error if one occurs. -func (c *FakeResourceSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(resourceslicesResource, name, opts), &v1alpha3.ResourceSlice{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeResourceSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(resourceslicesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha3.ResourceSliceList{}) - return err -} - -// Patch applies the patch and returns the patched resourceSlice. -func (c *FakeResourceSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceSlice, err error) { - emptyResult := &v1alpha3.ResourceSlice{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(resourceslicesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceSlice), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied resourceSlice. -func (c *FakeResourceSlices) Apply(ctx context.Context, resourceSlice *resourcev1alpha3.ResourceSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceSlice, err error) { - if resourceSlice == nil { - return nil, fmt.Errorf("resourceSlice provided to Apply must not be nil") - } - data, err := json.Marshal(resourceSlice) - if err != nil { - return nil, err - } - name := resourceSlice.Name - if name == nil { - return nil, fmt.Errorf("resourceSlice.Name must be provided to Apply") - } - emptyResult := &v1alpha3.ResourceSlice{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(resourceslicesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceSlice), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/fake/fake_priorityclass.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/fake/fake_priorityclass.go deleted file mode 100644 index 92847184b..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/fake/fake_priorityclass.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/scheduling/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - schedulingv1 "k8s.io/client-go/applyconfigurations/scheduling/v1" - testing "k8s.io/client-go/testing" -) - -// FakePriorityClasses implements PriorityClassInterface -type FakePriorityClasses struct { - Fake *FakeSchedulingV1 -} - -var priorityclassesResource = v1.SchemeGroupVersion.WithResource("priorityclasses") - -var priorityclassesKind = v1.SchemeGroupVersion.WithKind("PriorityClass") - -// Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any. -func (c *FakePriorityClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PriorityClass, err error) { - emptyResult := &v1.PriorityClass{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(priorityclassesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PriorityClass), err -} - -// List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. -func (c *FakePriorityClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityClassList, err error) { - emptyResult := &v1.PriorityClassList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(priorityclassesResource, priorityclassesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.PriorityClassList{ListMeta: obj.(*v1.PriorityClassList).ListMeta} - for _, item := range obj.(*v1.PriorityClassList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested priorityClasses. -func (c *FakePriorityClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(priorityclassesResource, opts)) -} - -// Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any. -func (c *FakePriorityClasses) Create(ctx context.Context, priorityClass *v1.PriorityClass, opts metav1.CreateOptions) (result *v1.PriorityClass, err error) { - emptyResult := &v1.PriorityClass{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(priorityclassesResource, priorityClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PriorityClass), err -} - -// Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any. -func (c *FakePriorityClasses) Update(ctx context.Context, priorityClass *v1.PriorityClass, opts metav1.UpdateOptions) (result *v1.PriorityClass, err error) { - emptyResult := &v1.PriorityClass{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(priorityclassesResource, priorityClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PriorityClass), err -} - -// Delete takes name of the priorityClass and deletes it. Returns an error if one occurs. -func (c *FakePriorityClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(priorityclassesResource, name, opts), &v1.PriorityClass{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(priorityclassesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.PriorityClassList{}) - return err -} - -// Patch applies the patch and returns the patched priorityClass. -func (c *FakePriorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityClass, err error) { - emptyResult := &v1.PriorityClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(priorityclassesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PriorityClass), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied priorityClass. -func (c *FakePriorityClasses) Apply(ctx context.Context, priorityClass *schedulingv1.PriorityClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityClass, err error) { - if priorityClass == nil { - return nil, fmt.Errorf("priorityClass provided to Apply must not be nil") - } - data, err := json.Marshal(priorityClass) - if err != nil { - return nil, err - } - name := priorityClass.Name - if name == nil { - return nil, fmt.Errorf("priorityClass.Name must be provided to Apply") - } - emptyResult := &v1.PriorityClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(priorityclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.PriorityClass), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/fake/fake_scheduling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/fake/fake_scheduling_client.go deleted file mode 100644 index a64ac945b..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/fake/fake_scheduling_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/client-go/kubernetes/typed/scheduling/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeSchedulingV1 struct { - *testing.Fake -} - -func (c *FakeSchedulingV1) PriorityClasses() v1.PriorityClassInterface { - return &FakePriorityClasses{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeSchedulingV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go deleted file mode 100644 index 055d458a3..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/scheduling/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - schedulingv1alpha1 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakePriorityClasses implements PriorityClassInterface -type FakePriorityClasses struct { - Fake *FakeSchedulingV1alpha1 -} - -var priorityclassesResource = v1alpha1.SchemeGroupVersion.WithResource("priorityclasses") - -var priorityclassesKind = v1alpha1.SchemeGroupVersion.WithKind("PriorityClass") - -// Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any. -func (c *FakePriorityClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PriorityClass, err error) { - emptyResult := &v1alpha1.PriorityClass{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(priorityclassesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.PriorityClass), err -} - -// List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. -func (c *FakePriorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PriorityClassList, err error) { - emptyResult := &v1alpha1.PriorityClassList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(priorityclassesResource, priorityclassesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.PriorityClassList{ListMeta: obj.(*v1alpha1.PriorityClassList).ListMeta} - for _, item := range obj.(*v1alpha1.PriorityClassList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested priorityClasses. -func (c *FakePriorityClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(priorityclassesResource, opts)) -} - -// Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any. -func (c *FakePriorityClasses) Create(ctx context.Context, priorityClass *v1alpha1.PriorityClass, opts v1.CreateOptions) (result *v1alpha1.PriorityClass, err error) { - emptyResult := &v1alpha1.PriorityClass{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(priorityclassesResource, priorityClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.PriorityClass), err -} - -// Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any. -func (c *FakePriorityClasses) Update(ctx context.Context, priorityClass *v1alpha1.PriorityClass, opts v1.UpdateOptions) (result *v1alpha1.PriorityClass, err error) { - emptyResult := &v1alpha1.PriorityClass{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(priorityclassesResource, priorityClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.PriorityClass), err -} - -// Delete takes name of the priorityClass and deletes it. Returns an error if one occurs. -func (c *FakePriorityClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(priorityclassesResource, name, opts), &v1alpha1.PriorityClass{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(priorityclassesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.PriorityClassList{}) - return err -} - -// Patch applies the patch and returns the patched priorityClass. -func (c *FakePriorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PriorityClass, err error) { - emptyResult := &v1alpha1.PriorityClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(priorityclassesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.PriorityClass), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied priorityClass. -func (c *FakePriorityClasses) Apply(ctx context.Context, priorityClass *schedulingv1alpha1.PriorityClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PriorityClass, err error) { - if priorityClass == nil { - return nil, fmt.Errorf("priorityClass provided to Apply must not be nil") - } - data, err := json.Marshal(priorityClass) - if err != nil { - return nil, err - } - name := priorityClass.Name - if name == nil { - return nil, fmt.Errorf("priorityClass.Name must be provided to Apply") - } - emptyResult := &v1alpha1.PriorityClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(priorityclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.PriorityClass), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_scheduling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_scheduling_client.go deleted file mode 100644 index 974ba193f..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_scheduling_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeSchedulingV1alpha1 struct { - *testing.Fake -} - -func (c *FakeSchedulingV1alpha1) PriorityClasses() v1alpha1.PriorityClassInterface { - return &FakePriorityClasses{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeSchedulingV1alpha1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake/fake_priorityclass.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake/fake_priorityclass.go deleted file mode 100644 index 49d82a7ed..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake/fake_priorityclass.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/scheduling/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - schedulingv1beta1 "k8s.io/client-go/applyconfigurations/scheduling/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakePriorityClasses implements PriorityClassInterface -type FakePriorityClasses struct { - Fake *FakeSchedulingV1beta1 -} - -var priorityclassesResource = v1beta1.SchemeGroupVersion.WithResource("priorityclasses") - -var priorityclassesKind = v1beta1.SchemeGroupVersion.WithKind("PriorityClass") - -// Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any. -func (c *FakePriorityClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PriorityClass, err error) { - emptyResult := &v1beta1.PriorityClass{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(priorityclassesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.PriorityClass), err -} - -// List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. -func (c *FakePriorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityClassList, err error) { - emptyResult := &v1beta1.PriorityClassList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(priorityclassesResource, priorityclassesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.PriorityClassList{ListMeta: obj.(*v1beta1.PriorityClassList).ListMeta} - for _, item := range obj.(*v1beta1.PriorityClassList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested priorityClasses. -func (c *FakePriorityClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(priorityclassesResource, opts)) -} - -// Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any. -func (c *FakePriorityClasses) Create(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.CreateOptions) (result *v1beta1.PriorityClass, err error) { - emptyResult := &v1beta1.PriorityClass{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(priorityclassesResource, priorityClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.PriorityClass), err -} - -// Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any. -func (c *FakePriorityClasses) Update(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.UpdateOptions) (result *v1beta1.PriorityClass, err error) { - emptyResult := &v1beta1.PriorityClass{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(priorityclassesResource, priorityClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.PriorityClass), err -} - -// Delete takes name of the priorityClass and deletes it. Returns an error if one occurs. -func (c *FakePriorityClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(priorityclassesResource, name, opts), &v1beta1.PriorityClass{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(priorityclassesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.PriorityClassList{}) - return err -} - -// Patch applies the patch and returns the patched priorityClass. -func (c *FakePriorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PriorityClass, err error) { - emptyResult := &v1beta1.PriorityClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(priorityclassesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.PriorityClass), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied priorityClass. -func (c *FakePriorityClasses) Apply(ctx context.Context, priorityClass *schedulingv1beta1.PriorityClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PriorityClass, err error) { - if priorityClass == nil { - return nil, fmt.Errorf("priorityClass provided to Apply must not be nil") - } - data, err := json.Marshal(priorityClass) - if err != nil { - return nil, err - } - name := priorityClass.Name - if name == nil { - return nil, fmt.Errorf("priorityClass.Name must be provided to Apply") - } - emptyResult := &v1beta1.PriorityClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(priorityclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.PriorityClass), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake/fake_scheduling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake/fake_scheduling_client.go deleted file mode 100644 index 4a6878a45..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake/fake_scheduling_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeSchedulingV1beta1 struct { - *testing.Fake -} - -func (c *FakeSchedulingV1beta1) PriorityClasses() v1beta1.PriorityClassInterface { - return &FakePriorityClasses{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeSchedulingV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_csidriver.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_csidriver.go deleted file mode 100644 index 1df7c034b..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_csidriver.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/storage/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" - testing "k8s.io/client-go/testing" -) - -// FakeCSIDrivers implements CSIDriverInterface -type FakeCSIDrivers struct { - Fake *FakeStorageV1 -} - -var csidriversResource = v1.SchemeGroupVersion.WithResource("csidrivers") - -var csidriversKind = v1.SchemeGroupVersion.WithKind("CSIDriver") - -// Get takes name of the cSIDriver, and returns the corresponding cSIDriver object, and an error if there is any. -func (c *FakeCSIDrivers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CSIDriver, err error) { - emptyResult := &v1.CSIDriver{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(csidriversResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CSIDriver), err -} - -// List takes label and field selectors, and returns the list of CSIDrivers that match those selectors. -func (c *FakeCSIDrivers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIDriverList, err error) { - emptyResult := &v1.CSIDriverList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(csidriversResource, csidriversKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.CSIDriverList{ListMeta: obj.(*v1.CSIDriverList).ListMeta} - for _, item := range obj.(*v1.CSIDriverList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested cSIDrivers. -func (c *FakeCSIDrivers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(csidriversResource, opts)) -} - -// Create takes the representation of a cSIDriver and creates it. Returns the server's representation of the cSIDriver, and an error, if there is any. -func (c *FakeCSIDrivers) Create(ctx context.Context, cSIDriver *v1.CSIDriver, opts metav1.CreateOptions) (result *v1.CSIDriver, err error) { - emptyResult := &v1.CSIDriver{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(csidriversResource, cSIDriver, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CSIDriver), err -} - -// Update takes the representation of a cSIDriver and updates it. Returns the server's representation of the cSIDriver, and an error, if there is any. -func (c *FakeCSIDrivers) Update(ctx context.Context, cSIDriver *v1.CSIDriver, opts metav1.UpdateOptions) (result *v1.CSIDriver, err error) { - emptyResult := &v1.CSIDriver{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(csidriversResource, cSIDriver, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CSIDriver), err -} - -// Delete takes name of the cSIDriver and deletes it. Returns an error if one occurs. -func (c *FakeCSIDrivers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(csidriversResource, name, opts), &v1.CSIDriver{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeCSIDrivers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(csidriversResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.CSIDriverList{}) - return err -} - -// Patch applies the patch and returns the patched cSIDriver. -func (c *FakeCSIDrivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSIDriver, err error) { - emptyResult := &v1.CSIDriver{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(csidriversResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CSIDriver), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied cSIDriver. -func (c *FakeCSIDrivers) Apply(ctx context.Context, cSIDriver *storagev1.CSIDriverApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CSIDriver, err error) { - if cSIDriver == nil { - return nil, fmt.Errorf("cSIDriver provided to Apply must not be nil") - } - data, err := json.Marshal(cSIDriver) - if err != nil { - return nil, err - } - name := cSIDriver.Name - if name == nil { - return nil, fmt.Errorf("cSIDriver.Name must be provided to Apply") - } - emptyResult := &v1.CSIDriver{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(csidriversResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CSIDriver), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_csinode.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_csinode.go deleted file mode 100644 index e2b8e8cc8..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_csinode.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/storage/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" - testing "k8s.io/client-go/testing" -) - -// FakeCSINodes implements CSINodeInterface -type FakeCSINodes struct { - Fake *FakeStorageV1 -} - -var csinodesResource = v1.SchemeGroupVersion.WithResource("csinodes") - -var csinodesKind = v1.SchemeGroupVersion.WithKind("CSINode") - -// Get takes name of the cSINode, and returns the corresponding cSINode object, and an error if there is any. -func (c *FakeCSINodes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CSINode, err error) { - emptyResult := &v1.CSINode{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(csinodesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CSINode), err -} - -// List takes label and field selectors, and returns the list of CSINodes that match those selectors. -func (c *FakeCSINodes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSINodeList, err error) { - emptyResult := &v1.CSINodeList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(csinodesResource, csinodesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.CSINodeList{ListMeta: obj.(*v1.CSINodeList).ListMeta} - for _, item := range obj.(*v1.CSINodeList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested cSINodes. -func (c *FakeCSINodes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(csinodesResource, opts)) -} - -// Create takes the representation of a cSINode and creates it. Returns the server's representation of the cSINode, and an error, if there is any. -func (c *FakeCSINodes) Create(ctx context.Context, cSINode *v1.CSINode, opts metav1.CreateOptions) (result *v1.CSINode, err error) { - emptyResult := &v1.CSINode{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(csinodesResource, cSINode, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CSINode), err -} - -// Update takes the representation of a cSINode and updates it. Returns the server's representation of the cSINode, and an error, if there is any. -func (c *FakeCSINodes) Update(ctx context.Context, cSINode *v1.CSINode, opts metav1.UpdateOptions) (result *v1.CSINode, err error) { - emptyResult := &v1.CSINode{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(csinodesResource, cSINode, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CSINode), err -} - -// Delete takes name of the cSINode and deletes it. Returns an error if one occurs. -func (c *FakeCSINodes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(csinodesResource, name, opts), &v1.CSINode{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeCSINodes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(csinodesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.CSINodeList{}) - return err -} - -// Patch applies the patch and returns the patched cSINode. -func (c *FakeCSINodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSINode, err error) { - emptyResult := &v1.CSINode{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(csinodesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CSINode), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied cSINode. -func (c *FakeCSINodes) Apply(ctx context.Context, cSINode *storagev1.CSINodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CSINode, err error) { - if cSINode == nil { - return nil, fmt.Errorf("cSINode provided to Apply must not be nil") - } - data, err := json.Marshal(cSINode) - if err != nil { - return nil, err - } - name := cSINode.Name - if name == nil { - return nil, fmt.Errorf("cSINode.Name must be provided to Apply") - } - emptyResult := &v1.CSINode{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(csinodesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CSINode), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_csistoragecapacity.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_csistoragecapacity.go deleted file mode 100644 index a86014855..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_csistoragecapacity.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/storage/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" - testing "k8s.io/client-go/testing" -) - -// FakeCSIStorageCapacities implements CSIStorageCapacityInterface -type FakeCSIStorageCapacities struct { - Fake *FakeStorageV1 - ns string -} - -var csistoragecapacitiesResource = v1.SchemeGroupVersion.WithResource("csistoragecapacities") - -var csistoragecapacitiesKind = v1.SchemeGroupVersion.WithKind("CSIStorageCapacity") - -// Get takes name of the cSIStorageCapacity, and returns the corresponding cSIStorageCapacity object, and an error if there is any. -func (c *FakeCSIStorageCapacities) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CSIStorageCapacity, err error) { - emptyResult := &v1.CSIStorageCapacity{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(csistoragecapacitiesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CSIStorageCapacity), err -} - -// List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. -func (c *FakeCSIStorageCapacities) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIStorageCapacityList, err error) { - emptyResult := &v1.CSIStorageCapacityList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(csistoragecapacitiesResource, csistoragecapacitiesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.CSIStorageCapacityList{ListMeta: obj.(*v1.CSIStorageCapacityList).ListMeta} - for _, item := range obj.(*v1.CSIStorageCapacityList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested cSIStorageCapacities. -func (c *FakeCSIStorageCapacities) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(csistoragecapacitiesResource, c.ns, opts)) - -} - -// Create takes the representation of a cSIStorageCapacity and creates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. -func (c *FakeCSIStorageCapacities) Create(ctx context.Context, cSIStorageCapacity *v1.CSIStorageCapacity, opts metav1.CreateOptions) (result *v1.CSIStorageCapacity, err error) { - emptyResult := &v1.CSIStorageCapacity{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(csistoragecapacitiesResource, c.ns, cSIStorageCapacity, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CSIStorageCapacity), err -} - -// Update takes the representation of a cSIStorageCapacity and updates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. -func (c *FakeCSIStorageCapacities) Update(ctx context.Context, cSIStorageCapacity *v1.CSIStorageCapacity, opts metav1.UpdateOptions) (result *v1.CSIStorageCapacity, err error) { - emptyResult := &v1.CSIStorageCapacity{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(csistoragecapacitiesResource, c.ns, cSIStorageCapacity, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CSIStorageCapacity), err -} - -// Delete takes name of the cSIStorageCapacity and deletes it. Returns an error if one occurs. -func (c *FakeCSIStorageCapacities) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(csistoragecapacitiesResource, c.ns, name, opts), &v1.CSIStorageCapacity{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeCSIStorageCapacities) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(csistoragecapacitiesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.CSIStorageCapacityList{}) - return err -} - -// Patch applies the patch and returns the patched cSIStorageCapacity. -func (c *FakeCSIStorageCapacities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSIStorageCapacity, err error) { - emptyResult := &v1.CSIStorageCapacity{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(csistoragecapacitiesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CSIStorageCapacity), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied cSIStorageCapacity. -func (c *FakeCSIStorageCapacities) Apply(ctx context.Context, cSIStorageCapacity *storagev1.CSIStorageCapacityApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CSIStorageCapacity, err error) { - if cSIStorageCapacity == nil { - return nil, fmt.Errorf("cSIStorageCapacity provided to Apply must not be nil") - } - data, err := json.Marshal(cSIStorageCapacity) - if err != nil { - return nil, err - } - name := cSIStorageCapacity.Name - if name == nil { - return nil, fmt.Errorf("cSIStorageCapacity.Name must be provided to Apply") - } - emptyResult := &v1.CSIStorageCapacity{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(csistoragecapacitiesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1.CSIStorageCapacity), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go deleted file mode 100644 index 5cb91b516..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go +++ /dev/null @@ -1,56 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/client-go/kubernetes/typed/storage/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeStorageV1 struct { - *testing.Fake -} - -func (c *FakeStorageV1) CSIDrivers() v1.CSIDriverInterface { - return &FakeCSIDrivers{c} -} - -func (c *FakeStorageV1) CSINodes() v1.CSINodeInterface { - return &FakeCSINodes{c} -} - -func (c *FakeStorageV1) CSIStorageCapacities(namespace string) v1.CSIStorageCapacityInterface { - return &FakeCSIStorageCapacities{c, namespace} -} - -func (c *FakeStorageV1) StorageClasses() v1.StorageClassInterface { - return &FakeStorageClasses{c} -} - -func (c *FakeStorageV1) VolumeAttachments() v1.VolumeAttachmentInterface { - return &FakeVolumeAttachments{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeStorageV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go deleted file mode 100644 index 8910be1db..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/storage/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" - testing "k8s.io/client-go/testing" -) - -// FakeStorageClasses implements StorageClassInterface -type FakeStorageClasses struct { - Fake *FakeStorageV1 -} - -var storageclassesResource = v1.SchemeGroupVersion.WithResource("storageclasses") - -var storageclassesKind = v1.SchemeGroupVersion.WithKind("StorageClass") - -// Get takes name of the storageClass, and returns the corresponding storageClass object, and an error if there is any. -func (c *FakeStorageClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.StorageClass, err error) { - emptyResult := &v1.StorageClass{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(storageclassesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.StorageClass), err -} - -// List takes label and field selectors, and returns the list of StorageClasses that match those selectors. -func (c *FakeStorageClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.StorageClassList, err error) { - emptyResult := &v1.StorageClassList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(storageclassesResource, storageclassesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.StorageClassList{ListMeta: obj.(*v1.StorageClassList).ListMeta} - for _, item := range obj.(*v1.StorageClassList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested storageClasses. -func (c *FakeStorageClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(storageclassesResource, opts)) -} - -// Create takes the representation of a storageClass and creates it. Returns the server's representation of the storageClass, and an error, if there is any. -func (c *FakeStorageClasses) Create(ctx context.Context, storageClass *v1.StorageClass, opts metav1.CreateOptions) (result *v1.StorageClass, err error) { - emptyResult := &v1.StorageClass{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(storageclassesResource, storageClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.StorageClass), err -} - -// Update takes the representation of a storageClass and updates it. Returns the server's representation of the storageClass, and an error, if there is any. -func (c *FakeStorageClasses) Update(ctx context.Context, storageClass *v1.StorageClass, opts metav1.UpdateOptions) (result *v1.StorageClass, err error) { - emptyResult := &v1.StorageClass{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(storageclassesResource, storageClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.StorageClass), err -} - -// Delete takes name of the storageClass and deletes it. Returns an error if one occurs. -func (c *FakeStorageClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(storageclassesResource, name, opts), &v1.StorageClass{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeStorageClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(storageclassesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.StorageClassList{}) - return err -} - -// Patch applies the patch and returns the patched storageClass. -func (c *FakeStorageClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StorageClass, err error) { - emptyResult := &v1.StorageClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageclassesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.StorageClass), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied storageClass. -func (c *FakeStorageClasses) Apply(ctx context.Context, storageClass *storagev1.StorageClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StorageClass, err error) { - if storageClass == nil { - return nil, fmt.Errorf("storageClass provided to Apply must not be nil") - } - data, err := json.Marshal(storageClass) - if err != nil { - return nil, err - } - name := storageClass.Name - if name == nil { - return nil, fmt.Errorf("storageClass.Name must be provided to Apply") - } - emptyResult := &v1.StorageClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.StorageClass), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go deleted file mode 100644 index 3d3d71ec5..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_volumeattachment.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/storage/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" - testing "k8s.io/client-go/testing" -) - -// FakeVolumeAttachments implements VolumeAttachmentInterface -type FakeVolumeAttachments struct { - Fake *FakeStorageV1 -} - -var volumeattachmentsResource = v1.SchemeGroupVersion.WithResource("volumeattachments") - -var volumeattachmentsKind = v1.SchemeGroupVersion.WithKind("VolumeAttachment") - -// Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. -func (c *FakeVolumeAttachments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VolumeAttachment, err error) { - emptyResult := &v1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(volumeattachmentsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.VolumeAttachment), err -} - -// List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. -func (c *FakeVolumeAttachments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VolumeAttachmentList, err error) { - emptyResult := &v1.VolumeAttachmentList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(volumeattachmentsResource, volumeattachmentsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.VolumeAttachmentList{ListMeta: obj.(*v1.VolumeAttachmentList).ListMeta} - for _, item := range obj.(*v1.VolumeAttachmentList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested volumeAttachments. -func (c *FakeVolumeAttachments) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(volumeattachmentsResource, opts)) -} - -// Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. -func (c *FakeVolumeAttachments) Create(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.CreateOptions) (result *v1.VolumeAttachment, err error) { - emptyResult := &v1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(volumeattachmentsResource, volumeAttachment, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.VolumeAttachment), err -} - -// Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. -func (c *FakeVolumeAttachments) Update(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (result *v1.VolumeAttachment, err error) { - emptyResult := &v1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(volumeattachmentsResource, volumeAttachment, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.VolumeAttachment), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeVolumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (result *v1.VolumeAttachment, err error) { - emptyResult := &v1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(volumeattachmentsResource, "status", volumeAttachment, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.VolumeAttachment), err -} - -// Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. -func (c *FakeVolumeAttachments) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(volumeattachmentsResource, name, opts), &v1.VolumeAttachment{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(volumeattachmentsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.VolumeAttachmentList{}) - return err -} - -// Patch applies the patch and returns the patched volumeAttachment. -func (c *FakeVolumeAttachments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VolumeAttachment, err error) { - emptyResult := &v1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.VolumeAttachment), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied volumeAttachment. -func (c *FakeVolumeAttachments) Apply(ctx context.Context, volumeAttachment *storagev1.VolumeAttachmentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.VolumeAttachment, err error) { - if volumeAttachment == nil { - return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil") - } - data, err := json.Marshal(volumeAttachment) - if err != nil { - return nil, err - } - name := volumeAttachment.Name - if name == nil { - return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") - } - emptyResult := &v1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.VolumeAttachment), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeVolumeAttachments) ApplyStatus(ctx context.Context, volumeAttachment *storagev1.VolumeAttachmentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.VolumeAttachment, err error) { - if volumeAttachment == nil { - return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil") - } - data, err := json.Marshal(volumeAttachment) - if err != nil { - return nil, err - } - name := volumeAttachment.Name - if name == nil { - return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") - } - emptyResult := &v1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.VolumeAttachment), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_csistoragecapacity.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_csistoragecapacity.go deleted file mode 100644 index 0bcaccd20..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_csistoragecapacity.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/storage/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakeCSIStorageCapacities implements CSIStorageCapacityInterface -type FakeCSIStorageCapacities struct { - Fake *FakeStorageV1alpha1 - ns string -} - -var csistoragecapacitiesResource = v1alpha1.SchemeGroupVersion.WithResource("csistoragecapacities") - -var csistoragecapacitiesKind = v1alpha1.SchemeGroupVersion.WithKind("CSIStorageCapacity") - -// Get takes name of the cSIStorageCapacity, and returns the corresponding cSIStorageCapacity object, and an error if there is any. -func (c *FakeCSIStorageCapacities) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.CSIStorageCapacity, err error) { - emptyResult := &v1alpha1.CSIStorageCapacity{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(csistoragecapacitiesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.CSIStorageCapacity), err -} - -// List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. -func (c *FakeCSIStorageCapacities) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.CSIStorageCapacityList, err error) { - emptyResult := &v1alpha1.CSIStorageCapacityList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(csistoragecapacitiesResource, csistoragecapacitiesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.CSIStorageCapacityList{ListMeta: obj.(*v1alpha1.CSIStorageCapacityList).ListMeta} - for _, item := range obj.(*v1alpha1.CSIStorageCapacityList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested cSIStorageCapacities. -func (c *FakeCSIStorageCapacities) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(csistoragecapacitiesResource, c.ns, opts)) - -} - -// Create takes the representation of a cSIStorageCapacity and creates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. -func (c *FakeCSIStorageCapacities) Create(ctx context.Context, cSIStorageCapacity *v1alpha1.CSIStorageCapacity, opts v1.CreateOptions) (result *v1alpha1.CSIStorageCapacity, err error) { - emptyResult := &v1alpha1.CSIStorageCapacity{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(csistoragecapacitiesResource, c.ns, cSIStorageCapacity, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.CSIStorageCapacity), err -} - -// Update takes the representation of a cSIStorageCapacity and updates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. -func (c *FakeCSIStorageCapacities) Update(ctx context.Context, cSIStorageCapacity *v1alpha1.CSIStorageCapacity, opts v1.UpdateOptions) (result *v1alpha1.CSIStorageCapacity, err error) { - emptyResult := &v1alpha1.CSIStorageCapacity{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(csistoragecapacitiesResource, c.ns, cSIStorageCapacity, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.CSIStorageCapacity), err -} - -// Delete takes name of the cSIStorageCapacity and deletes it. Returns an error if one occurs. -func (c *FakeCSIStorageCapacities) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(csistoragecapacitiesResource, c.ns, name, opts), &v1alpha1.CSIStorageCapacity{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeCSIStorageCapacities) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(csistoragecapacitiesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.CSIStorageCapacityList{}) - return err -} - -// Patch applies the patch and returns the patched cSIStorageCapacity. -func (c *FakeCSIStorageCapacities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.CSIStorageCapacity, err error) { - emptyResult := &v1alpha1.CSIStorageCapacity{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(csistoragecapacitiesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.CSIStorageCapacity), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied cSIStorageCapacity. -func (c *FakeCSIStorageCapacities) Apply(ctx context.Context, cSIStorageCapacity *storagev1alpha1.CSIStorageCapacityApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.CSIStorageCapacity, err error) { - if cSIStorageCapacity == nil { - return nil, fmt.Errorf("cSIStorageCapacity provided to Apply must not be nil") - } - data, err := json.Marshal(cSIStorageCapacity) - if err != nil { - return nil, err - } - name := cSIStorageCapacity.Name - if name == nil { - return nil, fmt.Errorf("cSIStorageCapacity.Name must be provided to Apply") - } - emptyResult := &v1alpha1.CSIStorageCapacity{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(csistoragecapacitiesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.CSIStorageCapacity), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_storage_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_storage_client.go deleted file mode 100644 index 0e078f348..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_storage_client.go +++ /dev/null @@ -1,48 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha1 "k8s.io/client-go/kubernetes/typed/storage/v1alpha1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeStorageV1alpha1 struct { - *testing.Fake -} - -func (c *FakeStorageV1alpha1) CSIStorageCapacities(namespace string) v1alpha1.CSIStorageCapacityInterface { - return &FakeCSIStorageCapacities{c, namespace} -} - -func (c *FakeStorageV1alpha1) VolumeAttachments() v1alpha1.VolumeAttachmentInterface { - return &FakeVolumeAttachments{c} -} - -func (c *FakeStorageV1alpha1) VolumeAttributesClasses() v1alpha1.VolumeAttributesClassInterface { - return &FakeVolumeAttributesClasses{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeStorageV1alpha1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go deleted file mode 100644 index a07247f8f..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/storage/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakeVolumeAttachments implements VolumeAttachmentInterface -type FakeVolumeAttachments struct { - Fake *FakeStorageV1alpha1 -} - -var volumeattachmentsResource = v1alpha1.SchemeGroupVersion.WithResource("volumeattachments") - -var volumeattachmentsKind = v1alpha1.SchemeGroupVersion.WithKind("VolumeAttachment") - -// Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. -func (c *FakeVolumeAttachments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeAttachment, err error) { - emptyResult := &v1alpha1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(volumeattachmentsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.VolumeAttachment), err -} - -// List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. -func (c *FakeVolumeAttachments) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttachmentList, err error) { - emptyResult := &v1alpha1.VolumeAttachmentList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(volumeattachmentsResource, volumeattachmentsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.VolumeAttachmentList{ListMeta: obj.(*v1alpha1.VolumeAttachmentList).ListMeta} - for _, item := range obj.(*v1alpha1.VolumeAttachmentList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested volumeAttachments. -func (c *FakeVolumeAttachments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(volumeattachmentsResource, opts)) -} - -// Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. -func (c *FakeVolumeAttachments) Create(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.CreateOptions) (result *v1alpha1.VolumeAttachment, err error) { - emptyResult := &v1alpha1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(volumeattachmentsResource, volumeAttachment, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.VolumeAttachment), err -} - -// Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. -func (c *FakeVolumeAttachments) Update(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttachment, err error) { - emptyResult := &v1alpha1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(volumeattachmentsResource, volumeAttachment, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.VolumeAttachment), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeVolumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttachment, err error) { - emptyResult := &v1alpha1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(volumeattachmentsResource, "status", volumeAttachment, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.VolumeAttachment), err -} - -// Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. -func (c *FakeVolumeAttachments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(volumeattachmentsResource, name, opts), &v1alpha1.VolumeAttachment{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(volumeattachmentsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.VolumeAttachmentList{}) - return err -} - -// Patch applies the patch and returns the patched volumeAttachment. -func (c *FakeVolumeAttachments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttachment, err error) { - emptyResult := &v1alpha1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.VolumeAttachment), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied volumeAttachment. -func (c *FakeVolumeAttachments) Apply(ctx context.Context, volumeAttachment *storagev1alpha1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttachment, err error) { - if volumeAttachment == nil { - return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil") - } - data, err := json.Marshal(volumeAttachment) - if err != nil { - return nil, err - } - name := volumeAttachment.Name - if name == nil { - return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") - } - emptyResult := &v1alpha1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.VolumeAttachment), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeVolumeAttachments) ApplyStatus(ctx context.Context, volumeAttachment *storagev1alpha1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttachment, err error) { - if volumeAttachment == nil { - return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil") - } - data, err := json.Marshal(volumeAttachment) - if err != nil { - return nil, err - } - name := volumeAttachment.Name - if name == nil { - return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") - } - emptyResult := &v1alpha1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.VolumeAttachment), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattributesclass.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattributesclass.go deleted file mode 100644 index 0d7fe9aa8..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattributesclass.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/storage/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakeVolumeAttributesClasses implements VolumeAttributesClassInterface -type FakeVolumeAttributesClasses struct { - Fake *FakeStorageV1alpha1 -} - -var volumeattributesclassesResource = v1alpha1.SchemeGroupVersion.WithResource("volumeattributesclasses") - -var volumeattributesclassesKind = v1alpha1.SchemeGroupVersion.WithKind("VolumeAttributesClass") - -// Get takes name of the volumeAttributesClass, and returns the corresponding volumeAttributesClass object, and an error if there is any. -func (c *FakeVolumeAttributesClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - emptyResult := &v1alpha1.VolumeAttributesClass{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(volumeattributesclassesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.VolumeAttributesClass), err -} - -// List takes label and field selectors, and returns the list of VolumeAttributesClasses that match those selectors. -func (c *FakeVolumeAttributesClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttributesClassList, err error) { - emptyResult := &v1alpha1.VolumeAttributesClassList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(volumeattributesclassesResource, volumeattributesclassesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.VolumeAttributesClassList{ListMeta: obj.(*v1alpha1.VolumeAttributesClassList).ListMeta} - for _, item := range obj.(*v1alpha1.VolumeAttributesClassList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested volumeAttributesClasses. -func (c *FakeVolumeAttributesClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(volumeattributesclassesResource, opts)) -} - -// Create takes the representation of a volumeAttributesClass and creates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. -func (c *FakeVolumeAttributesClasses) Create(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.CreateOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - emptyResult := &v1alpha1.VolumeAttributesClass{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(volumeattributesclassesResource, volumeAttributesClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.VolumeAttributesClass), err -} - -// Update takes the representation of a volumeAttributesClass and updates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. -func (c *FakeVolumeAttributesClasses) Update(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - emptyResult := &v1alpha1.VolumeAttributesClass{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(volumeattributesclassesResource, volumeAttributesClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.VolumeAttributesClass), err -} - -// Delete takes name of the volumeAttributesClass and deletes it. Returns an error if one occurs. -func (c *FakeVolumeAttributesClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(volumeattributesclassesResource, name, opts), &v1alpha1.VolumeAttributesClass{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeVolumeAttributesClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(volumeattributesclassesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.VolumeAttributesClassList{}) - return err -} - -// Patch applies the patch and returns the patched volumeAttributesClass. -func (c *FakeVolumeAttributesClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttributesClass, err error) { - emptyResult := &v1alpha1.VolumeAttributesClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattributesclassesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.VolumeAttributesClass), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied volumeAttributesClass. -func (c *FakeVolumeAttributesClasses) Apply(ctx context.Context, volumeAttributesClass *storagev1alpha1.VolumeAttributesClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - if volumeAttributesClass == nil { - return nil, fmt.Errorf("volumeAttributesClass provided to Apply must not be nil") - } - data, err := json.Marshal(volumeAttributesClass) - if err != nil { - return nil, err - } - name := volumeAttributesClass.Name - if name == nil { - return nil, fmt.Errorf("volumeAttributesClass.Name must be provided to Apply") - } - emptyResult := &v1alpha1.VolumeAttributesClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattributesclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.VolumeAttributesClass), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csidriver.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csidriver.go deleted file mode 100644 index 2b230707f..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csidriver.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/storage/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeCSIDrivers implements CSIDriverInterface -type FakeCSIDrivers struct { - Fake *FakeStorageV1beta1 -} - -var csidriversResource = v1beta1.SchemeGroupVersion.WithResource("csidrivers") - -var csidriversKind = v1beta1.SchemeGroupVersion.WithKind("CSIDriver") - -// Get takes name of the cSIDriver, and returns the corresponding cSIDriver object, and an error if there is any. -func (c *FakeCSIDrivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CSIDriver, err error) { - emptyResult := &v1beta1.CSIDriver{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(csidriversResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CSIDriver), err -} - -// List takes label and field selectors, and returns the list of CSIDrivers that match those selectors. -func (c *FakeCSIDrivers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIDriverList, err error) { - emptyResult := &v1beta1.CSIDriverList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(csidriversResource, csidriversKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.CSIDriverList{ListMeta: obj.(*v1beta1.CSIDriverList).ListMeta} - for _, item := range obj.(*v1beta1.CSIDriverList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested cSIDrivers. -func (c *FakeCSIDrivers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(csidriversResource, opts)) -} - -// Create takes the representation of a cSIDriver and creates it. Returns the server's representation of the cSIDriver, and an error, if there is any. -func (c *FakeCSIDrivers) Create(ctx context.Context, cSIDriver *v1beta1.CSIDriver, opts v1.CreateOptions) (result *v1beta1.CSIDriver, err error) { - emptyResult := &v1beta1.CSIDriver{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(csidriversResource, cSIDriver, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CSIDriver), err -} - -// Update takes the representation of a cSIDriver and updates it. Returns the server's representation of the cSIDriver, and an error, if there is any. -func (c *FakeCSIDrivers) Update(ctx context.Context, cSIDriver *v1beta1.CSIDriver, opts v1.UpdateOptions) (result *v1beta1.CSIDriver, err error) { - emptyResult := &v1beta1.CSIDriver{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(csidriversResource, cSIDriver, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CSIDriver), err -} - -// Delete takes name of the cSIDriver and deletes it. Returns an error if one occurs. -func (c *FakeCSIDrivers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(csidriversResource, name, opts), &v1beta1.CSIDriver{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeCSIDrivers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(csidriversResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.CSIDriverList{}) - return err -} - -// Patch applies the patch and returns the patched cSIDriver. -func (c *FakeCSIDrivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSIDriver, err error) { - emptyResult := &v1beta1.CSIDriver{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(csidriversResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CSIDriver), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied cSIDriver. -func (c *FakeCSIDrivers) Apply(ctx context.Context, cSIDriver *storagev1beta1.CSIDriverApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CSIDriver, err error) { - if cSIDriver == nil { - return nil, fmt.Errorf("cSIDriver provided to Apply must not be nil") - } - data, err := json.Marshal(cSIDriver) - if err != nil { - return nil, err - } - name := cSIDriver.Name - if name == nil { - return nil, fmt.Errorf("cSIDriver.Name must be provided to Apply") - } - emptyResult := &v1beta1.CSIDriver{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(csidriversResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CSIDriver), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csinode.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csinode.go deleted file mode 100644 index c5c2b5825..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csinode.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/storage/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeCSINodes implements CSINodeInterface -type FakeCSINodes struct { - Fake *FakeStorageV1beta1 -} - -var csinodesResource = v1beta1.SchemeGroupVersion.WithResource("csinodes") - -var csinodesKind = v1beta1.SchemeGroupVersion.WithKind("CSINode") - -// Get takes name of the cSINode, and returns the corresponding cSINode object, and an error if there is any. -func (c *FakeCSINodes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CSINode, err error) { - emptyResult := &v1beta1.CSINode{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(csinodesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CSINode), err -} - -// List takes label and field selectors, and returns the list of CSINodes that match those selectors. -func (c *FakeCSINodes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSINodeList, err error) { - emptyResult := &v1beta1.CSINodeList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(csinodesResource, csinodesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.CSINodeList{ListMeta: obj.(*v1beta1.CSINodeList).ListMeta} - for _, item := range obj.(*v1beta1.CSINodeList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested cSINodes. -func (c *FakeCSINodes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(csinodesResource, opts)) -} - -// Create takes the representation of a cSINode and creates it. Returns the server's representation of the cSINode, and an error, if there is any. -func (c *FakeCSINodes) Create(ctx context.Context, cSINode *v1beta1.CSINode, opts v1.CreateOptions) (result *v1beta1.CSINode, err error) { - emptyResult := &v1beta1.CSINode{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(csinodesResource, cSINode, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CSINode), err -} - -// Update takes the representation of a cSINode and updates it. Returns the server's representation of the cSINode, and an error, if there is any. -func (c *FakeCSINodes) Update(ctx context.Context, cSINode *v1beta1.CSINode, opts v1.UpdateOptions) (result *v1beta1.CSINode, err error) { - emptyResult := &v1beta1.CSINode{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(csinodesResource, cSINode, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CSINode), err -} - -// Delete takes name of the cSINode and deletes it. Returns an error if one occurs. -func (c *FakeCSINodes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(csinodesResource, name, opts), &v1beta1.CSINode{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeCSINodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(csinodesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.CSINodeList{}) - return err -} - -// Patch applies the patch and returns the patched cSINode. -func (c *FakeCSINodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSINode, err error) { - emptyResult := &v1beta1.CSINode{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(csinodesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CSINode), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied cSINode. -func (c *FakeCSINodes) Apply(ctx context.Context, cSINode *storagev1beta1.CSINodeApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CSINode, err error) { - if cSINode == nil { - return nil, fmt.Errorf("cSINode provided to Apply must not be nil") - } - data, err := json.Marshal(cSINode) - if err != nil { - return nil, err - } - name := cSINode.Name - if name == nil { - return nil, fmt.Errorf("cSINode.Name must be provided to Apply") - } - emptyResult := &v1beta1.CSINode{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(csinodesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CSINode), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csistoragecapacity.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csistoragecapacity.go deleted file mode 100644 index 59a9aaf9d..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csistoragecapacity.go +++ /dev/null @@ -1,160 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/storage/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeCSIStorageCapacities implements CSIStorageCapacityInterface -type FakeCSIStorageCapacities struct { - Fake *FakeStorageV1beta1 - ns string -} - -var csistoragecapacitiesResource = v1beta1.SchemeGroupVersion.WithResource("csistoragecapacities") - -var csistoragecapacitiesKind = v1beta1.SchemeGroupVersion.WithKind("CSIStorageCapacity") - -// Get takes name of the cSIStorageCapacity, and returns the corresponding cSIStorageCapacity object, and an error if there is any. -func (c *FakeCSIStorageCapacities) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CSIStorageCapacity, err error) { - emptyResult := &v1beta1.CSIStorageCapacity{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(csistoragecapacitiesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CSIStorageCapacity), err -} - -// List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. -func (c *FakeCSIStorageCapacities) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIStorageCapacityList, err error) { - emptyResult := &v1beta1.CSIStorageCapacityList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(csistoragecapacitiesResource, csistoragecapacitiesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.CSIStorageCapacityList{ListMeta: obj.(*v1beta1.CSIStorageCapacityList).ListMeta} - for _, item := range obj.(*v1beta1.CSIStorageCapacityList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested cSIStorageCapacities. -func (c *FakeCSIStorageCapacities) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(csistoragecapacitiesResource, c.ns, opts)) - -} - -// Create takes the representation of a cSIStorageCapacity and creates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. -func (c *FakeCSIStorageCapacities) Create(ctx context.Context, cSIStorageCapacity *v1beta1.CSIStorageCapacity, opts v1.CreateOptions) (result *v1beta1.CSIStorageCapacity, err error) { - emptyResult := &v1beta1.CSIStorageCapacity{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(csistoragecapacitiesResource, c.ns, cSIStorageCapacity, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CSIStorageCapacity), err -} - -// Update takes the representation of a cSIStorageCapacity and updates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. -func (c *FakeCSIStorageCapacities) Update(ctx context.Context, cSIStorageCapacity *v1beta1.CSIStorageCapacity, opts v1.UpdateOptions) (result *v1beta1.CSIStorageCapacity, err error) { - emptyResult := &v1beta1.CSIStorageCapacity{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(csistoragecapacitiesResource, c.ns, cSIStorageCapacity, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CSIStorageCapacity), err -} - -// Delete takes name of the cSIStorageCapacity and deletes it. Returns an error if one occurs. -func (c *FakeCSIStorageCapacities) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(csistoragecapacitiesResource, c.ns, name, opts), &v1beta1.CSIStorageCapacity{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeCSIStorageCapacities) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(csistoragecapacitiesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.CSIStorageCapacityList{}) - return err -} - -// Patch applies the patch and returns the patched cSIStorageCapacity. -func (c *FakeCSIStorageCapacities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSIStorageCapacity, err error) { - emptyResult := &v1beta1.CSIStorageCapacity{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(csistoragecapacitiesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CSIStorageCapacity), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied cSIStorageCapacity. -func (c *FakeCSIStorageCapacities) Apply(ctx context.Context, cSIStorageCapacity *storagev1beta1.CSIStorageCapacityApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CSIStorageCapacity, err error) { - if cSIStorageCapacity == nil { - return nil, fmt.Errorf("cSIStorageCapacity provided to Apply must not be nil") - } - data, err := json.Marshal(cSIStorageCapacity) - if err != nil { - return nil, err - } - name := cSIStorageCapacity.Name - if name == nil { - return nil, fmt.Errorf("cSIStorageCapacity.Name must be provided to Apply") - } - emptyResult := &v1beta1.CSIStorageCapacity{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(csistoragecapacitiesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.CSIStorageCapacity), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go deleted file mode 100644 index 470281607..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go +++ /dev/null @@ -1,60 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "k8s.io/client-go/kubernetes/typed/storage/v1beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeStorageV1beta1 struct { - *testing.Fake -} - -func (c *FakeStorageV1beta1) CSIDrivers() v1beta1.CSIDriverInterface { - return &FakeCSIDrivers{c} -} - -func (c *FakeStorageV1beta1) CSINodes() v1beta1.CSINodeInterface { - return &FakeCSINodes{c} -} - -func (c *FakeStorageV1beta1) CSIStorageCapacities(namespace string) v1beta1.CSIStorageCapacityInterface { - return &FakeCSIStorageCapacities{c, namespace} -} - -func (c *FakeStorageV1beta1) StorageClasses() v1beta1.StorageClassInterface { - return &FakeStorageClasses{c} -} - -func (c *FakeStorageV1beta1) VolumeAttachments() v1beta1.VolumeAttachmentInterface { - return &FakeVolumeAttachments{c} -} - -func (c *FakeStorageV1beta1) VolumeAttributesClasses() v1beta1.VolumeAttributesClassInterface { - return &FakeVolumeAttributesClasses{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeStorageV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go deleted file mode 100644 index 954a34608..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/storage/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeStorageClasses implements StorageClassInterface -type FakeStorageClasses struct { - Fake *FakeStorageV1beta1 -} - -var storageclassesResource = v1beta1.SchemeGroupVersion.WithResource("storageclasses") - -var storageclassesKind = v1beta1.SchemeGroupVersion.WithKind("StorageClass") - -// Get takes name of the storageClass, and returns the corresponding storageClass object, and an error if there is any. -func (c *FakeStorageClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.StorageClass, err error) { - emptyResult := &v1beta1.StorageClass{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(storageclassesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.StorageClass), err -} - -// List takes label and field selectors, and returns the list of StorageClasses that match those selectors. -func (c *FakeStorageClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StorageClassList, err error) { - emptyResult := &v1beta1.StorageClassList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(storageclassesResource, storageclassesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.StorageClassList{ListMeta: obj.(*v1beta1.StorageClassList).ListMeta} - for _, item := range obj.(*v1beta1.StorageClassList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested storageClasses. -func (c *FakeStorageClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(storageclassesResource, opts)) -} - -// Create takes the representation of a storageClass and creates it. Returns the server's representation of the storageClass, and an error, if there is any. -func (c *FakeStorageClasses) Create(ctx context.Context, storageClass *v1beta1.StorageClass, opts v1.CreateOptions) (result *v1beta1.StorageClass, err error) { - emptyResult := &v1beta1.StorageClass{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(storageclassesResource, storageClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.StorageClass), err -} - -// Update takes the representation of a storageClass and updates it. Returns the server's representation of the storageClass, and an error, if there is any. -func (c *FakeStorageClasses) Update(ctx context.Context, storageClass *v1beta1.StorageClass, opts v1.UpdateOptions) (result *v1beta1.StorageClass, err error) { - emptyResult := &v1beta1.StorageClass{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(storageclassesResource, storageClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.StorageClass), err -} - -// Delete takes name of the storageClass and deletes it. Returns an error if one occurs. -func (c *FakeStorageClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(storageclassesResource, name, opts), &v1beta1.StorageClass{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeStorageClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(storageclassesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.StorageClassList{}) - return err -} - -// Patch applies the patch and returns the patched storageClass. -func (c *FakeStorageClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StorageClass, err error) { - emptyResult := &v1beta1.StorageClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageclassesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.StorageClass), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied storageClass. -func (c *FakeStorageClasses) Apply(ctx context.Context, storageClass *storagev1beta1.StorageClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StorageClass, err error) { - if storageClass == nil { - return nil, fmt.Errorf("storageClass provided to Apply must not be nil") - } - data, err := json.Marshal(storageClass) - if err != nil { - return nil, err - } - name := storageClass.Name - if name == nil { - return nil, fmt.Errorf("storageClass.Name must be provided to Apply") - } - emptyResult := &v1beta1.StorageClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.StorageClass), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go deleted file mode 100644 index 247f7ca62..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/storage/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeVolumeAttachments implements VolumeAttachmentInterface -type FakeVolumeAttachments struct { - Fake *FakeStorageV1beta1 -} - -var volumeattachmentsResource = v1beta1.SchemeGroupVersion.WithResource("volumeattachments") - -var volumeattachmentsKind = v1beta1.SchemeGroupVersion.WithKind("VolumeAttachment") - -// Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. -func (c *FakeVolumeAttachments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeAttachment, err error) { - emptyResult := &v1beta1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(volumeattachmentsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.VolumeAttachment), err -} - -// List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. -func (c *FakeVolumeAttachments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeAttachmentList, err error) { - emptyResult := &v1beta1.VolumeAttachmentList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(volumeattachmentsResource, volumeattachmentsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.VolumeAttachmentList{ListMeta: obj.(*v1beta1.VolumeAttachmentList).ListMeta} - for _, item := range obj.(*v1beta1.VolumeAttachmentList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested volumeAttachments. -func (c *FakeVolumeAttachments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(volumeattachmentsResource, opts)) -} - -// Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. -func (c *FakeVolumeAttachments) Create(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.CreateOptions) (result *v1beta1.VolumeAttachment, err error) { - emptyResult := &v1beta1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(volumeattachmentsResource, volumeAttachment, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.VolumeAttachment), err -} - -// Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. -func (c *FakeVolumeAttachments) Update(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (result *v1beta1.VolumeAttachment, err error) { - emptyResult := &v1beta1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(volumeattachmentsResource, volumeAttachment, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.VolumeAttachment), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeVolumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (result *v1beta1.VolumeAttachment, err error) { - emptyResult := &v1beta1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(volumeattachmentsResource, "status", volumeAttachment, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.VolumeAttachment), err -} - -// Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. -func (c *FakeVolumeAttachments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(volumeattachmentsResource, name, opts), &v1beta1.VolumeAttachment{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(volumeattachmentsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.VolumeAttachmentList{}) - return err -} - -// Patch applies the patch and returns the patched volumeAttachment. -func (c *FakeVolumeAttachments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeAttachment, err error) { - emptyResult := &v1beta1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.VolumeAttachment), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied volumeAttachment. -func (c *FakeVolumeAttachments) Apply(ctx context.Context, volumeAttachment *storagev1beta1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.VolumeAttachment, err error) { - if volumeAttachment == nil { - return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil") - } - data, err := json.Marshal(volumeAttachment) - if err != nil { - return nil, err - } - name := volumeAttachment.Name - if name == nil { - return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") - } - emptyResult := &v1beta1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.VolumeAttachment), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeVolumeAttachments) ApplyStatus(ctx context.Context, volumeAttachment *storagev1beta1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.VolumeAttachment, err error) { - if volumeAttachment == nil { - return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil") - } - data, err := json.Marshal(volumeAttachment) - if err != nil { - return nil, err - } - name := volumeAttachment.Name - if name == nil { - return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") - } - emptyResult := &v1beta1.VolumeAttachment{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.VolumeAttachment), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_volumeattributesclass.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_volumeattributesclass.go deleted file mode 100644 index 3cef7291a..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_volumeattributesclass.go +++ /dev/null @@ -1,151 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/storage/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeVolumeAttributesClasses implements VolumeAttributesClassInterface -type FakeVolumeAttributesClasses struct { - Fake *FakeStorageV1beta1 -} - -var volumeattributesclassesResource = v1beta1.SchemeGroupVersion.WithResource("volumeattributesclasses") - -var volumeattributesclassesKind = v1beta1.SchemeGroupVersion.WithKind("VolumeAttributesClass") - -// Get takes name of the volumeAttributesClass, and returns the corresponding volumeAttributesClass object, and an error if there is any. -func (c *FakeVolumeAttributesClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeAttributesClass, err error) { - emptyResult := &v1beta1.VolumeAttributesClass{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(volumeattributesclassesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.VolumeAttributesClass), err -} - -// List takes label and field selectors, and returns the list of VolumeAttributesClasses that match those selectors. -func (c *FakeVolumeAttributesClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeAttributesClassList, err error) { - emptyResult := &v1beta1.VolumeAttributesClassList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(volumeattributesclassesResource, volumeattributesclassesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.VolumeAttributesClassList{ListMeta: obj.(*v1beta1.VolumeAttributesClassList).ListMeta} - for _, item := range obj.(*v1beta1.VolumeAttributesClassList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested volumeAttributesClasses. -func (c *FakeVolumeAttributesClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(volumeattributesclassesResource, opts)) -} - -// Create takes the representation of a volumeAttributesClass and creates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. -func (c *FakeVolumeAttributesClasses) Create(ctx context.Context, volumeAttributesClass *v1beta1.VolumeAttributesClass, opts v1.CreateOptions) (result *v1beta1.VolumeAttributesClass, err error) { - emptyResult := &v1beta1.VolumeAttributesClass{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(volumeattributesclassesResource, volumeAttributesClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.VolumeAttributesClass), err -} - -// Update takes the representation of a volumeAttributesClass and updates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. -func (c *FakeVolumeAttributesClasses) Update(ctx context.Context, volumeAttributesClass *v1beta1.VolumeAttributesClass, opts v1.UpdateOptions) (result *v1beta1.VolumeAttributesClass, err error) { - emptyResult := &v1beta1.VolumeAttributesClass{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(volumeattributesclassesResource, volumeAttributesClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.VolumeAttributesClass), err -} - -// Delete takes name of the volumeAttributesClass and deletes it. Returns an error if one occurs. -func (c *FakeVolumeAttributesClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(volumeattributesclassesResource, name, opts), &v1beta1.VolumeAttributesClass{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeVolumeAttributesClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(volumeattributesclassesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.VolumeAttributesClassList{}) - return err -} - -// Patch applies the patch and returns the patched volumeAttributesClass. -func (c *FakeVolumeAttributesClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeAttributesClass, err error) { - emptyResult := &v1beta1.VolumeAttributesClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattributesclassesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.VolumeAttributesClass), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied volumeAttributesClass. -func (c *FakeVolumeAttributesClasses) Apply(ctx context.Context, volumeAttributesClass *storagev1beta1.VolumeAttributesClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.VolumeAttributesClass, err error) { - if volumeAttributesClass == nil { - return nil, fmt.Errorf("volumeAttributesClass provided to Apply must not be nil") - } - data, err := json.Marshal(volumeAttributesClass) - if err != nil { - return nil, err - } - name := volumeAttributesClass.Name - if name == nil { - return nil, fmt.Errorf("volumeAttributesClass.Name must be provided to Apply") - } - emptyResult := &v1beta1.VolumeAttributesClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattributesclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1beta1.VolumeAttributesClass), err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/fake/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/fake/doc.go deleted file mode 100644 index 16f443990..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/fake/doc.go +++ /dev/null @@ -1,20 +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 client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storagemigration_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storagemigration_client.go deleted file mode 100644 index 3ae8f4ae5..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storagemigration_client.go +++ /dev/null @@ -1,40 +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 client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha1 "k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeStoragemigrationV1alpha1 struct { - *testing.Fake -} - -func (c *FakeStoragemigrationV1alpha1) StorageVersionMigrations() v1alpha1.StorageVersionMigrationInterface { - return &FakeStorageVersionMigrations{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeStoragemigrationV1alpha1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storageversionmigration.go b/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storageversionmigration.go deleted file mode 100644 index c3ff23591..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storageversionmigration.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 client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/storagemigration/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - storagemigrationv1alpha1 "k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakeStorageVersionMigrations implements StorageVersionMigrationInterface -type FakeStorageVersionMigrations struct { - Fake *FakeStoragemigrationV1alpha1 -} - -var storageversionmigrationsResource = v1alpha1.SchemeGroupVersion.WithResource("storageversionmigrations") - -var storageversionmigrationsKind = v1alpha1.SchemeGroupVersion.WithKind("StorageVersionMigration") - -// Get takes name of the storageVersionMigration, and returns the corresponding storageVersionMigration object, and an error if there is any. -func (c *FakeStorageVersionMigrations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.StorageVersionMigration, err error) { - emptyResult := &v1alpha1.StorageVersionMigration{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(storageversionmigrationsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.StorageVersionMigration), err -} - -// List takes label and field selectors, and returns the list of StorageVersionMigrations that match those selectors. -func (c *FakeStorageVersionMigrations) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionMigrationList, err error) { - emptyResult := &v1alpha1.StorageVersionMigrationList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(storageversionmigrationsResource, storageversionmigrationsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.StorageVersionMigrationList{ListMeta: obj.(*v1alpha1.StorageVersionMigrationList).ListMeta} - for _, item := range obj.(*v1alpha1.StorageVersionMigrationList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested storageVersionMigrations. -func (c *FakeStorageVersionMigrations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(storageversionmigrationsResource, opts)) -} - -// Create takes the representation of a storageVersionMigration and creates it. Returns the server's representation of the storageVersionMigration, and an error, if there is any. -func (c *FakeStorageVersionMigrations) Create(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.CreateOptions) (result *v1alpha1.StorageVersionMigration, err error) { - emptyResult := &v1alpha1.StorageVersionMigration{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(storageversionmigrationsResource, storageVersionMigration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.StorageVersionMigration), err -} - -// Update takes the representation of a storageVersionMigration and updates it. Returns the server's representation of the storageVersionMigration, and an error, if there is any. -func (c *FakeStorageVersionMigrations) Update(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.UpdateOptions) (result *v1alpha1.StorageVersionMigration, err error) { - emptyResult := &v1alpha1.StorageVersionMigration{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(storageversionmigrationsResource, storageVersionMigration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.StorageVersionMigration), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeStorageVersionMigrations) UpdateStatus(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.UpdateOptions) (result *v1alpha1.StorageVersionMigration, err error) { - emptyResult := &v1alpha1.StorageVersionMigration{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(storageversionmigrationsResource, "status", storageVersionMigration, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.StorageVersionMigration), err -} - -// Delete takes name of the storageVersionMigration and deletes it. Returns an error if one occurs. -func (c *FakeStorageVersionMigrations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(storageversionmigrationsResource, name, opts), &v1alpha1.StorageVersionMigration{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeStorageVersionMigrations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(storageversionmigrationsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.StorageVersionMigrationList{}) - return err -} - -// Patch applies the patch and returns the patched storageVersionMigration. -func (c *FakeStorageVersionMigrations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.StorageVersionMigration, err error) { - emptyResult := &v1alpha1.StorageVersionMigration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionmigrationsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.StorageVersionMigration), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied storageVersionMigration. -func (c *FakeStorageVersionMigrations) Apply(ctx context.Context, storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigrationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersionMigration, err error) { - if storageVersionMigration == nil { - return nil, fmt.Errorf("storageVersionMigration provided to Apply must not be nil") - } - data, err := json.Marshal(storageVersionMigration) - if err != nil { - return nil, err - } - name := storageVersionMigration.Name - if name == nil { - return nil, fmt.Errorf("storageVersionMigration.Name must be provided to Apply") - } - emptyResult := &v1alpha1.StorageVersionMigration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionmigrationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.StorageVersionMigration), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeStorageVersionMigrations) ApplyStatus(ctx context.Context, storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigrationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersionMigration, err error) { - if storageVersionMigration == nil { - return nil, fmt.Errorf("storageVersionMigration provided to Apply must not be nil") - } - data, err := json.Marshal(storageVersionMigration) - if err != nil { - return nil, err - } - name := storageVersionMigration.Name - if name == nil { - return nil, fmt.Errorf("storageVersionMigration.Name must be provided to Apply") - } - emptyResult := &v1alpha1.StorageVersionMigration{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionmigrationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.StorageVersionMigration), err -} diff --git a/vendor/k8s.io/client-go/rest/fake/fake.go b/vendor/k8s.io/client-go/rest/fake/fake.go deleted file mode 100644 index 293e09694..000000000 --- a/vendor/k8s.io/client-go/rest/fake/fake.go +++ /dev/null @@ -1,118 +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. -*/ - -// This is made a separate package and should only be imported by tests, because -// it imports testapi -package fake - -import ( - "net/http" - "net/url" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/util/flowcontrol" -) - -// CreateHTTPClient creates an http.Client that will invoke the provided roundTripper func -// when a request is made. -func CreateHTTPClient(roundTripper func(*http.Request) (*http.Response, error)) *http.Client { - return &http.Client{ - Transport: roundTripperFunc(roundTripper), - } -} - -type roundTripperFunc func(*http.Request) (*http.Response, error) - -func (f roundTripperFunc) RoundTrip(req *http.Request) (*http.Response, error) { - return f(req) -} - -// RESTClient provides a fake RESTClient interface. It is used to mock network -// interactions via a rest.Request, or to make them via the provided Client to -// a specific server. -type RESTClient struct { - NegotiatedSerializer runtime.NegotiatedSerializer - GroupVersion schema.GroupVersion - VersionedAPIPath string - - // Err is returned when any request would be made to the server. If Err is set, - // Req will not be recorded, Resp will not be returned, and Client will not be - // invoked. - Err error - // Req is set to the last request that was executed (had the methods Do/DoRaw) invoked. - Req *http.Request - // If Client is specified, the client will be invoked instead of returning Resp if - // Err is not set. - Client *http.Client - // Resp is returned to the caller after Req is recorded, unless Err or Client are set. - Resp *http.Response -} - -func (c *RESTClient) Get() *restclient.Request { - return c.Verb("GET") -} - -func (c *RESTClient) Put() *restclient.Request { - return c.Verb("PUT") -} - -func (c *RESTClient) Patch(pt types.PatchType) *restclient.Request { - return c.Verb("PATCH").SetHeader("Content-Type", string(pt)) -} - -func (c *RESTClient) Post() *restclient.Request { - return c.Verb("POST") -} - -func (c *RESTClient) Delete() *restclient.Request { - return c.Verb("DELETE") -} - -func (c *RESTClient) Verb(verb string) *restclient.Request { - return c.Request().Verb(verb) -} - -func (c *RESTClient) APIVersion() schema.GroupVersion { - return c.GroupVersion -} - -func (c *RESTClient) GetRateLimiter() flowcontrol.RateLimiter { - return nil -} - -func (c *RESTClient) Request() *restclient.Request { - config := restclient.ClientContentConfig{ - ContentType: runtime.ContentTypeJSON, - GroupVersion: c.GroupVersion, - Negotiator: runtime.NewClientNegotiator(c.NegotiatedSerializer, c.GroupVersion), - } - return restclient.NewRequestWithClient(&url.URL{Scheme: "https", Host: "localhost"}, c.VersionedAPIPath, config, CreateHTTPClient(c.do)) -} - -// do is invoked when a Request() created by this client is executed. -func (c *RESTClient) do(req *http.Request) (*http.Response, error) { - if c.Err != nil { - return nil, c.Err - } - c.Req = req - if c.Client != nil { - return c.Client.Do(req) - } - return c.Resp, nil -} diff --git a/vendor/k8s.io/client-go/testing/actions.go b/vendor/k8s.io/client-go/testing/actions.go deleted file mode 100644 index 270cc4ddb..000000000 --- a/vendor/k8s.io/client-go/testing/actions.go +++ /dev/null @@ -1,897 +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 testing - -import ( - "fmt" - "path" - "strings" - - 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/types" -) - -func NewRootGetAction(resource schema.GroupVersionResource, name string) GetActionImpl { - return NewRootGetActionWithOptions(resource, name, metav1.GetOptions{}) -} - -func NewRootGetActionWithOptions(resource schema.GroupVersionResource, name string, opts metav1.GetOptions) GetActionImpl { - action := GetActionImpl{} - action.Verb = "get" - action.Resource = resource - action.Name = name - action.GetOptions = opts - - return action -} - -func NewGetAction(resource schema.GroupVersionResource, namespace, name string) GetActionImpl { - return NewGetActionWithOptions(resource, namespace, name, metav1.GetOptions{}) -} - -func NewGetActionWithOptions(resource schema.GroupVersionResource, namespace, name string, opts metav1.GetOptions) GetActionImpl { - action := GetActionImpl{} - action.Verb = "get" - action.Resource = resource - action.Namespace = namespace - action.Name = name - action.GetOptions = opts - - return action -} - -func NewGetSubresourceAction(resource schema.GroupVersionResource, namespace, subresource, name string) GetActionImpl { - return NewGetSubresourceActionWithOptions(resource, namespace, subresource, name, metav1.GetOptions{}) -} - -func NewGetSubresourceActionWithOptions(resource schema.GroupVersionResource, namespace, subresource, name string, opts metav1.GetOptions) GetActionImpl { - action := GetActionImpl{} - action.Verb = "get" - action.Resource = resource - action.Subresource = subresource - action.Namespace = namespace - action.Name = name - action.GetOptions = opts - - return action -} - -func NewRootGetSubresourceAction(resource schema.GroupVersionResource, subresource, name string) GetActionImpl { - return NewRootGetSubresourceActionWithOptions(resource, subresource, name, metav1.GetOptions{}) -} - -func NewRootGetSubresourceActionWithOptions(resource schema.GroupVersionResource, subresource, name string, opts metav1.GetOptions) GetActionImpl { - action := GetActionImpl{} - action.Verb = "get" - action.Resource = resource - action.Subresource = subresource - action.Name = name - action.GetOptions = opts - - return action -} - -func NewRootListAction(resource schema.GroupVersionResource, kind schema.GroupVersionKind, opts interface{}) ListActionImpl { - action := ListActionImpl{} - action.Verb = "list" - action.Resource = resource - action.Kind = kind - labelSelector, fieldSelector, _ := ExtractFromListOptions(opts) - action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} - action.ListOptions = metav1.ListOptions{LabelSelector: labelSelector.String(), FieldSelector: fieldSelector.String()} - - return action -} - -func NewRootListActionWithOptions(resource schema.GroupVersionResource, kind schema.GroupVersionKind, opts metav1.ListOptions) ListActionImpl { - action := ListActionImpl{} - action.Verb = "list" - action.Resource = resource - action.Kind = kind - action.ListOptions = opts - - labelSelector, fieldSelector, _ := ExtractFromListOptions(opts) - action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} - action.ListOptions = metav1.ListOptions{LabelSelector: labelSelector.String(), FieldSelector: fieldSelector.String()} - - return action -} - -func NewListAction(resource schema.GroupVersionResource, kind schema.GroupVersionKind, namespace string, opts interface{}) ListActionImpl { - action := ListActionImpl{} - action.Verb = "list" - action.Resource = resource - action.Kind = kind - action.Namespace = namespace - labelSelector, fieldSelector, _ := ExtractFromListOptions(opts) - action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} - action.ListOptions = metav1.ListOptions{LabelSelector: labelSelector.String(), FieldSelector: fieldSelector.String()} - - return action -} - -func NewListActionWithOptions(resource schema.GroupVersionResource, kind schema.GroupVersionKind, namespace string, opts metav1.ListOptions) ListActionImpl { - action := ListActionImpl{} - action.Verb = "list" - action.Resource = resource - action.Kind = kind - action.Namespace = namespace - action.ListOptions = opts - - labelSelector, fieldSelector, _ := ExtractFromListOptions(opts) - action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} - - return action -} - -func NewRootCreateAction(resource schema.GroupVersionResource, object runtime.Object) CreateActionImpl { - return NewRootCreateActionWithOptions(resource, object, metav1.CreateOptions{}) -} - -func NewRootCreateActionWithOptions(resource schema.GroupVersionResource, object runtime.Object, opts metav1.CreateOptions) CreateActionImpl { - action := CreateActionImpl{} - action.Verb = "create" - action.Resource = resource - action.Object = object - action.CreateOptions = opts - - return action -} - -func NewCreateAction(resource schema.GroupVersionResource, namespace string, object runtime.Object) CreateActionImpl { - return NewCreateActionWithOptions(resource, namespace, object, metav1.CreateOptions{}) -} - -func NewCreateActionWithOptions(resource schema.GroupVersionResource, namespace string, object runtime.Object, opts metav1.CreateOptions) CreateActionImpl { - action := CreateActionImpl{} - action.Verb = "create" - action.Resource = resource - action.Namespace = namespace - action.Object = object - action.CreateOptions = opts - - return action -} - -func NewRootCreateSubresourceAction(resource schema.GroupVersionResource, name, subresource string, object runtime.Object) CreateActionImpl { - return NewRootCreateSubresourceActionWithOptions(resource, name, subresource, object, metav1.CreateOptions{}) -} - -func NewRootCreateSubresourceActionWithOptions(resource schema.GroupVersionResource, name, subresource string, object runtime.Object, opts metav1.CreateOptions) CreateActionImpl { - action := CreateActionImpl{} - action.Verb = "create" - action.Resource = resource - action.Subresource = subresource - action.Name = name - action.Object = object - action.CreateOptions = opts - - return action -} - -func NewCreateSubresourceAction(resource schema.GroupVersionResource, name, subresource, namespace string, object runtime.Object) CreateActionImpl { - return NewCreateSubresourceActionWithOptions(resource, name, subresource, namespace, object, metav1.CreateOptions{}) -} - -func NewCreateSubresourceActionWithOptions(resource schema.GroupVersionResource, name, subresource, namespace string, object runtime.Object, opts metav1.CreateOptions) CreateActionImpl { - action := CreateActionImpl{} - action.Verb = "create" - action.Resource = resource - action.Namespace = namespace - action.Subresource = subresource - action.Name = name - action.Object = object - action.CreateOptions = opts - - return action -} - -func NewRootUpdateAction(resource schema.GroupVersionResource, object runtime.Object) UpdateActionImpl { - return NewRootUpdateActionWithOptions(resource, object, metav1.UpdateOptions{}) -} - -func NewRootUpdateActionWithOptions(resource schema.GroupVersionResource, object runtime.Object, opts metav1.UpdateOptions) UpdateActionImpl { - action := UpdateActionImpl{} - action.Verb = "update" - action.Resource = resource - action.Object = object - action.UpdateOptions = opts - - return action -} - -func NewUpdateAction(resource schema.GroupVersionResource, namespace string, object runtime.Object) UpdateActionImpl { - return NewUpdateActionWithOptions(resource, namespace, object, metav1.UpdateOptions{}) -} - -func NewUpdateActionWithOptions(resource schema.GroupVersionResource, namespace string, object runtime.Object, opts metav1.UpdateOptions) UpdateActionImpl { - action := UpdateActionImpl{} - action.Verb = "update" - action.Resource = resource - action.Namespace = namespace - action.Object = object - action.UpdateOptions = opts - - return action -} - -func NewRootPatchAction(resource schema.GroupVersionResource, name string, pt types.PatchType, patch []byte) PatchActionImpl { - return NewRootPatchActionWithOptions(resource, name, pt, patch, metav1.PatchOptions{}) -} - -func NewRootPatchActionWithOptions(resource schema.GroupVersionResource, name string, pt types.PatchType, patch []byte, opts metav1.PatchOptions) PatchActionImpl { - action := PatchActionImpl{} - action.Verb = "patch" - action.Resource = resource - action.Name = name - action.PatchType = pt - action.Patch = patch - action.PatchOptions = opts - - return action -} - -func NewPatchAction(resource schema.GroupVersionResource, namespace string, name string, pt types.PatchType, patch []byte) PatchActionImpl { - return NewPatchActionWithOptions(resource, namespace, name, pt, patch, metav1.PatchOptions{}) -} - -func NewPatchActionWithOptions(resource schema.GroupVersionResource, namespace string, name string, pt types.PatchType, patch []byte, opts metav1.PatchOptions) PatchActionImpl { - action := PatchActionImpl{} - action.Verb = "patch" - action.Resource = resource - action.Namespace = namespace - action.Name = name - action.PatchType = pt - action.Patch = patch - action.PatchOptions = opts - - return action -} - -func NewRootPatchSubresourceAction(resource schema.GroupVersionResource, name string, pt types.PatchType, patch []byte, subresources ...string) PatchActionImpl { - return NewRootPatchSubresourceActionWithOptions(resource, name, pt, patch, metav1.PatchOptions{}, subresources...) -} - -func NewRootPatchSubresourceActionWithOptions(resource schema.GroupVersionResource, name string, pt types.PatchType, patch []byte, opts metav1.PatchOptions, subresources ...string) PatchActionImpl { - action := PatchActionImpl{} - action.Verb = "patch" - action.Resource = resource - action.Subresource = path.Join(subresources...) - action.Name = name - action.PatchType = pt - action.Patch = patch - action.PatchOptions = opts - - return action -} - -func NewPatchSubresourceAction(resource schema.GroupVersionResource, namespace, name string, pt types.PatchType, patch []byte, subresources ...string) PatchActionImpl { - return NewPatchSubresourceActionWithOptions(resource, namespace, name, pt, patch, metav1.PatchOptions{}, subresources...) -} - -func NewPatchSubresourceActionWithOptions(resource schema.GroupVersionResource, namespace, name string, pt types.PatchType, patch []byte, opts metav1.PatchOptions, subresources ...string) PatchActionImpl { - action := PatchActionImpl{} - action.Verb = "patch" - action.Resource = resource - action.Subresource = path.Join(subresources...) - action.Namespace = namespace - action.Name = name - action.PatchType = pt - action.Patch = patch - action.PatchOptions = opts - - return action -} - -func NewRootUpdateSubresourceAction(resource schema.GroupVersionResource, subresource string, object runtime.Object) UpdateActionImpl { - return NewRootUpdateSubresourceActionWithOptions(resource, subresource, object, metav1.UpdateOptions{}) -} - -func NewRootUpdateSubresourceActionWithOptions(resource schema.GroupVersionResource, subresource string, object runtime.Object, opts metav1.UpdateOptions) UpdateActionImpl { - action := UpdateActionImpl{} - action.Verb = "update" - action.Resource = resource - action.Subresource = subresource - action.Object = object - action.UpdateOptions = opts - - return action -} - -func NewUpdateSubresourceAction(resource schema.GroupVersionResource, subresource string, namespace string, object runtime.Object) UpdateActionImpl { - return NewUpdateSubresourceActionWithOptions(resource, subresource, namespace, object, metav1.UpdateOptions{}) -} - -func NewUpdateSubresourceActionWithOptions(resource schema.GroupVersionResource, subresource string, namespace string, object runtime.Object, opts metav1.UpdateOptions) UpdateActionImpl { - action := UpdateActionImpl{} - action.Verb = "update" - action.Resource = resource - action.Subresource = subresource - action.Namespace = namespace - action.Object = object - action.UpdateOptions = opts - - return action -} - -func NewRootDeleteAction(resource schema.GroupVersionResource, name string) DeleteActionImpl { - return NewRootDeleteActionWithOptions(resource, name, metav1.DeleteOptions{}) -} - -func NewRootDeleteActionWithOptions(resource schema.GroupVersionResource, name string, opts metav1.DeleteOptions) DeleteActionImpl { - action := DeleteActionImpl{} - action.Verb = "delete" - action.Resource = resource - action.Name = name - action.DeleteOptions = opts - - return action -} - -func NewRootDeleteSubresourceAction(resource schema.GroupVersionResource, subresource string, name string) DeleteActionImpl { - return NewRootDeleteSubresourceActionWithOptions(resource, subresource, name, metav1.DeleteOptions{}) -} - -func NewRootDeleteSubresourceActionWithOptions(resource schema.GroupVersionResource, subresource string, name string, opts metav1.DeleteOptions) DeleteActionImpl { - action := DeleteActionImpl{} - action.Verb = "delete" - action.Resource = resource - action.Subresource = subresource - action.Name = name - action.DeleteOptions = opts - - return action -} - -func NewDeleteAction(resource schema.GroupVersionResource, namespace, name string) DeleteActionImpl { - return NewDeleteActionWithOptions(resource, namespace, name, metav1.DeleteOptions{}) -} - -func NewDeleteActionWithOptions(resource schema.GroupVersionResource, namespace, name string, opts metav1.DeleteOptions) DeleteActionImpl { - action := DeleteActionImpl{} - action.Verb = "delete" - action.Resource = resource - action.Namespace = namespace - action.Name = name - action.DeleteOptions = opts - - return action -} - -func NewDeleteSubresourceAction(resource schema.GroupVersionResource, subresource, namespace, name string) DeleteActionImpl { - return NewDeleteSubresourceActionWithOptions(resource, subresource, namespace, name, metav1.DeleteOptions{}) -} - -func NewDeleteSubresourceActionWithOptions(resource schema.GroupVersionResource, subresource, namespace, name string, opts metav1.DeleteOptions) DeleteActionImpl { - action := DeleteActionImpl{} - action.Verb = "delete" - action.Resource = resource - action.Subresource = subresource - action.Namespace = namespace - action.Name = name - action.DeleteOptions = opts - - return action -} - -func NewRootDeleteCollectionAction(resource schema.GroupVersionResource, opts interface{}) DeleteCollectionActionImpl { - listOpts, _ := opts.(metav1.ListOptions) - return NewRootDeleteCollectionActionWithOptions(resource, metav1.DeleteOptions{}, listOpts) -} - -func NewRootDeleteCollectionActionWithOptions(resource schema.GroupVersionResource, deleteOpts metav1.DeleteOptions, listOpts metav1.ListOptions) DeleteCollectionActionImpl { - action := DeleteCollectionActionImpl{} - action.Verb = "delete-collection" - action.Resource = resource - action.DeleteOptions = deleteOpts - action.ListOptions = listOpts - - labelSelector, fieldSelector, _ := ExtractFromListOptions(listOpts) - action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} - - return action -} - -func NewDeleteCollectionAction(resource schema.GroupVersionResource, namespace string, opts interface{}) DeleteCollectionActionImpl { - listOpts, _ := opts.(metav1.ListOptions) - return NewDeleteCollectionActionWithOptions(resource, namespace, metav1.DeleteOptions{}, listOpts) -} - -func NewDeleteCollectionActionWithOptions(resource schema.GroupVersionResource, namespace string, deleteOpts metav1.DeleteOptions, listOpts metav1.ListOptions) DeleteCollectionActionImpl { - action := DeleteCollectionActionImpl{} - action.Verb = "delete-collection" - action.Resource = resource - action.Namespace = namespace - action.DeleteOptions = deleteOpts - action.ListOptions = listOpts - - labelSelector, fieldSelector, _ := ExtractFromListOptions(listOpts) - action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} - - return action -} - -func NewRootWatchAction(resource schema.GroupVersionResource, opts interface{}) WatchActionImpl { - listOpts, _ := opts.(metav1.ListOptions) - return NewRootWatchActionWithOptions(resource, listOpts) -} - -func NewRootWatchActionWithOptions(resource schema.GroupVersionResource, opts metav1.ListOptions) WatchActionImpl { - action := WatchActionImpl{} - action.Verb = "watch" - action.Resource = resource - action.ListOptions = opts - - labelSelector, fieldSelector, resourceVersion := ExtractFromListOptions(opts) - action.WatchRestrictions = WatchRestrictions{labelSelector, fieldSelector, resourceVersion} - - return action -} - -func ExtractFromListOptions(opts interface{}) (labelSelector labels.Selector, fieldSelector fields.Selector, resourceVersion string) { - var err error - switch t := opts.(type) { - case metav1.ListOptions: - labelSelector, err = labels.Parse(t.LabelSelector) - if err != nil { - panic(fmt.Errorf("invalid selector %q: %v", t.LabelSelector, err)) - } - fieldSelector, err = fields.ParseSelector(t.FieldSelector) - if err != nil { - panic(fmt.Errorf("invalid selector %q: %v", t.FieldSelector, err)) - } - resourceVersion = t.ResourceVersion - default: - panic(fmt.Errorf("expect a ListOptions %T", opts)) - } - if labelSelector == nil { - labelSelector = labels.Everything() - } - if fieldSelector == nil { - fieldSelector = fields.Everything() - } - return labelSelector, fieldSelector, resourceVersion -} - -func NewWatchAction(resource schema.GroupVersionResource, namespace string, opts interface{}) WatchActionImpl { - listOpts, _ := opts.(metav1.ListOptions) - return NewWatchActionWithOptions(resource, namespace, listOpts) -} - -func NewWatchActionWithOptions(resource schema.GroupVersionResource, namespace string, opts metav1.ListOptions) WatchActionImpl { - action := WatchActionImpl{} - action.Verb = "watch" - action.Resource = resource - action.Namespace = namespace - action.ListOptions = opts - - labelSelector, fieldSelector, resourceVersion := ExtractFromListOptions(opts) - action.WatchRestrictions = WatchRestrictions{labelSelector, fieldSelector, resourceVersion} - - return action -} - -func NewProxyGetAction(resource schema.GroupVersionResource, namespace, scheme, name, port, path string, params map[string]string) ProxyGetActionImpl { - action := ProxyGetActionImpl{} - action.Verb = "get" - action.Resource = resource - action.Namespace = namespace - action.Scheme = scheme - action.Name = name - action.Port = port - action.Path = path - action.Params = params - return action -} - -type ListRestrictions struct { - Labels labels.Selector - Fields fields.Selector -} -type WatchRestrictions struct { - Labels labels.Selector - Fields fields.Selector - ResourceVersion string -} - -type Action interface { - GetNamespace() string - GetVerb() string - GetResource() schema.GroupVersionResource - GetSubresource() string - Matches(verb, resource string) bool - - // DeepCopy is used to copy an action to avoid any risk of accidental mutation. Most people never need to call this - // because the invocation logic deep copies before calls to storage and reactors. - DeepCopy() Action -} - -type GenericAction interface { - Action - GetValue() interface{} -} - -type GetAction interface { - Action - GetName() string -} - -type ListAction interface { - Action - GetListRestrictions() ListRestrictions -} - -type CreateAction interface { - Action - GetObject() runtime.Object -} - -type UpdateAction interface { - Action - GetObject() runtime.Object -} - -type DeleteAction interface { - Action - GetName() string - GetDeleteOptions() metav1.DeleteOptions -} - -type DeleteCollectionAction interface { - Action - GetListRestrictions() ListRestrictions -} - -type PatchAction interface { - Action - GetName() string - GetPatchType() types.PatchType - GetPatch() []byte -} - -type WatchAction interface { - Action - GetWatchRestrictions() WatchRestrictions -} - -type ProxyGetAction interface { - Action - GetScheme() string - GetName() string - GetPort() string - GetPath() string - GetParams() map[string]string -} - -type ActionImpl struct { - Namespace string - Verb string - Resource schema.GroupVersionResource - Subresource string -} - -func (a ActionImpl) GetNamespace() string { - return a.Namespace -} -func (a ActionImpl) GetVerb() string { - return a.Verb -} -func (a ActionImpl) GetResource() schema.GroupVersionResource { - return a.Resource -} -func (a ActionImpl) GetSubresource() string { - return a.Subresource -} -func (a ActionImpl) Matches(verb, resource string) bool { - // Stay backwards compatible. - if !strings.Contains(resource, "/") { - return strings.EqualFold(verb, a.Verb) && - strings.EqualFold(resource, a.Resource.Resource) - } - - parts := strings.SplitN(resource, "/", 2) - topresource, subresource := parts[0], parts[1] - - return strings.EqualFold(verb, a.Verb) && - strings.EqualFold(topresource, a.Resource.Resource) && - strings.EqualFold(subresource, a.Subresource) -} -func (a ActionImpl) DeepCopy() Action { - ret := a - return ret -} - -type GenericActionImpl struct { - ActionImpl - Value interface{} -} - -func (a GenericActionImpl) GetValue() interface{} { - return a.Value -} - -func (a GenericActionImpl) DeepCopy() Action { - return GenericActionImpl{ - ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), - // TODO this is wrong, but no worse than before - Value: a.Value, - } -} - -type GetActionImpl struct { - ActionImpl - Name string - GetOptions metav1.GetOptions -} - -func (a GetActionImpl) GetName() string { - return a.Name -} - -func (a GetActionImpl) GetGetOptions() metav1.GetOptions { - return a.GetOptions -} - -func (a GetActionImpl) DeepCopy() Action { - return GetActionImpl{ - ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), - Name: a.Name, - GetOptions: *a.GetOptions.DeepCopy(), - } -} - -type ListActionImpl struct { - ActionImpl - Kind schema.GroupVersionKind - Name string - ListRestrictions ListRestrictions - ListOptions metav1.ListOptions -} - -func (a ListActionImpl) GetKind() schema.GroupVersionKind { - return a.Kind -} - -func (a ListActionImpl) GetListRestrictions() ListRestrictions { - return a.ListRestrictions -} - -func (a ListActionImpl) GetListOptions() metav1.ListOptions { - return a.ListOptions -} - -func (a ListActionImpl) DeepCopy() Action { - return ListActionImpl{ - ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), - Kind: a.Kind, - Name: a.Name, - ListRestrictions: ListRestrictions{ - Labels: a.ListRestrictions.Labels.DeepCopySelector(), - Fields: a.ListRestrictions.Fields.DeepCopySelector(), - }, - ListOptions: *a.ListOptions.DeepCopy(), - } -} - -type CreateActionImpl struct { - ActionImpl - Name string - Object runtime.Object - CreateOptions metav1.CreateOptions -} - -func (a CreateActionImpl) GetObject() runtime.Object { - return a.Object -} - -func (a CreateActionImpl) GetCreateOptions() metav1.CreateOptions { - return a.CreateOptions -} - -func (a CreateActionImpl) DeepCopy() Action { - return CreateActionImpl{ - ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), - Name: a.Name, - Object: a.Object.DeepCopyObject(), - CreateOptions: *a.CreateOptions.DeepCopy(), - } -} - -type UpdateActionImpl struct { - ActionImpl - Object runtime.Object - UpdateOptions metav1.UpdateOptions -} - -func (a UpdateActionImpl) GetObject() runtime.Object { - return a.Object -} - -func (a UpdateActionImpl) GetUpdateOptions() metav1.UpdateOptions { - return a.UpdateOptions -} - -func (a UpdateActionImpl) DeepCopy() Action { - return UpdateActionImpl{ - ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), - Object: a.Object.DeepCopyObject(), - UpdateOptions: *a.UpdateOptions.DeepCopy(), - } -} - -type PatchActionImpl struct { - ActionImpl - Name string - PatchType types.PatchType - Patch []byte - PatchOptions metav1.PatchOptions -} - -func (a PatchActionImpl) GetName() string { - return a.Name -} - -func (a PatchActionImpl) GetPatch() []byte { - return a.Patch -} - -func (a PatchActionImpl) GetPatchType() types.PatchType { - return a.PatchType -} - -func (a PatchActionImpl) GetPatchOptions() metav1.PatchOptions { - return a.PatchOptions -} - -func (a PatchActionImpl) DeepCopy() Action { - patch := make([]byte, len(a.Patch)) - copy(patch, a.Patch) - return PatchActionImpl{ - ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), - Name: a.Name, - PatchType: a.PatchType, - Patch: patch, - PatchOptions: *a.PatchOptions.DeepCopy(), - } -} - -type DeleteActionImpl struct { - ActionImpl - Name string - DeleteOptions metav1.DeleteOptions -} - -func (a DeleteActionImpl) GetName() string { - return a.Name -} - -func (a DeleteActionImpl) GetDeleteOptions() metav1.DeleteOptions { - return a.DeleteOptions -} - -func (a DeleteActionImpl) DeepCopy() Action { - return DeleteActionImpl{ - ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), - Name: a.Name, - DeleteOptions: *a.DeleteOptions.DeepCopy(), - } -} - -type DeleteCollectionActionImpl struct { - ActionImpl - ListRestrictions ListRestrictions - DeleteOptions metav1.DeleteOptions - ListOptions metav1.ListOptions -} - -func (a DeleteCollectionActionImpl) GetListRestrictions() ListRestrictions { - return a.ListRestrictions -} - -func (a DeleteCollectionActionImpl) GetDeleteOptions() metav1.DeleteOptions { - return a.DeleteOptions -} - -func (a DeleteCollectionActionImpl) GetListOptions() metav1.ListOptions { - return a.ListOptions -} - -func (a DeleteCollectionActionImpl) DeepCopy() Action { - return DeleteCollectionActionImpl{ - ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), - ListRestrictions: ListRestrictions{ - Labels: a.ListRestrictions.Labels.DeepCopySelector(), - Fields: a.ListRestrictions.Fields.DeepCopySelector(), - }, - DeleteOptions: *a.DeleteOptions.DeepCopy(), - ListOptions: *a.ListOptions.DeepCopy(), - } -} - -type WatchActionImpl struct { - ActionImpl - WatchRestrictions WatchRestrictions - ListOptions metav1.ListOptions -} - -func (a WatchActionImpl) GetWatchRestrictions() WatchRestrictions { - return a.WatchRestrictions -} - -func (a WatchActionImpl) GetListOptions() metav1.ListOptions { - return a.ListOptions -} - -func (a WatchActionImpl) DeepCopy() Action { - return WatchActionImpl{ - ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), - WatchRestrictions: WatchRestrictions{ - Labels: a.WatchRestrictions.Labels.DeepCopySelector(), - Fields: a.WatchRestrictions.Fields.DeepCopySelector(), - ResourceVersion: a.WatchRestrictions.ResourceVersion, - }, - ListOptions: *a.ListOptions.DeepCopy(), - } -} - -type ProxyGetActionImpl struct { - ActionImpl - Scheme string - Name string - Port string - Path string - Params map[string]string -} - -func (a ProxyGetActionImpl) GetScheme() string { - return a.Scheme -} - -func (a ProxyGetActionImpl) GetName() string { - return a.Name -} - -func (a ProxyGetActionImpl) GetPort() string { - return a.Port -} - -func (a ProxyGetActionImpl) GetPath() string { - return a.Path -} - -func (a ProxyGetActionImpl) GetParams() map[string]string { - return a.Params -} - -func (a ProxyGetActionImpl) DeepCopy() Action { - params := map[string]string{} - for k, v := range a.Params { - params[k] = v - } - return ProxyGetActionImpl{ - ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), - Scheme: a.Scheme, - Name: a.Name, - Port: a.Port, - Path: a.Path, - Params: params, - } -} diff --git a/vendor/k8s.io/client-go/testing/fake.go b/vendor/k8s.io/client-go/testing/fake.go deleted file mode 100644 index 3ab9c1b07..000000000 --- a/vendor/k8s.io/client-go/testing/fake.go +++ /dev/null @@ -1,220 +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 testing - -import ( - "fmt" - "sync" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - restclient "k8s.io/client-go/rest" -) - -// Fake implements client.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 Fake struct { - sync.RWMutex - actions []Action // these may be castable to other types, but "Action" is the minimum - - // ReactionChain is the list of reactors that will be attempted for every - // request in the order they are tried. - ReactionChain []Reactor - // WatchReactionChain is the list of watch reactors that will be attempted - // for every request in the order they are tried. - WatchReactionChain []WatchReactor - // ProxyReactionChain is the list of proxy reactors that will be attempted - // for every request in the order they are tried. - ProxyReactionChain []ProxyReactor - - Resources []*metav1.APIResourceList -} - -// Reactor is an interface to allow the composition of reaction functions. -type Reactor interface { - // Handles indicates whether or not this Reactor deals with a given - // action. - Handles(action Action) bool - // React handles the action and returns results. It may choose to - // delegate by indicated handled=false. - React(action Action) (handled bool, ret runtime.Object, err error) -} - -// WatchReactor is an interface to allow the composition of watch functions. -type WatchReactor interface { - // Handles indicates whether or not this Reactor deals with a given - // action. - Handles(action Action) bool - // React handles a watch action and returns results. It may choose to - // delegate by indicating handled=false. - React(action Action) (handled bool, ret watch.Interface, err error) -} - -// ProxyReactor is an interface to allow the composition of proxy get -// functions. -type ProxyReactor interface { - // Handles indicates whether or not this Reactor deals with a given - // action. - Handles(action Action) bool - // React handles a watch action and returns results. It may choose to - // delegate by indicating handled=false. - React(action Action) (handled bool, ret restclient.ResponseWrapper, err error) -} - -// ReactionFunc is a function that returns an object or error for a given -// Action. If "handled" is false, then the test client will ignore the -// results and continue to the next ReactionFunc. A ReactionFunc can describe -// reactions on subresources by testing the result of the action's -// GetSubresource() method. -type ReactionFunc func(action Action) (handled bool, ret runtime.Object, err error) - -// WatchReactionFunc is a function that returns a watch interface. If -// "handled" is false, then the test client will ignore the results and -// continue to the next ReactionFunc. -type WatchReactionFunc func(action Action) (handled bool, ret watch.Interface, err error) - -// ProxyReactionFunc is a function that returns a ResponseWrapper interface -// for a given Action. If "handled" is false, then the test client will -// ignore the results and continue to the next ProxyReactionFunc. -type ProxyReactionFunc func(action Action) (handled bool, ret restclient.ResponseWrapper, err error) - -// AddReactor appends a reactor to the end of the chain. -func (c *Fake) AddReactor(verb, resource string, reaction ReactionFunc) { - c.ReactionChain = append(c.ReactionChain, &SimpleReactor{verb, resource, reaction}) -} - -// PrependReactor adds a reactor to the beginning of the chain. -func (c *Fake) PrependReactor(verb, resource string, reaction ReactionFunc) { - c.ReactionChain = append([]Reactor{&SimpleReactor{verb, resource, reaction}}, c.ReactionChain...) -} - -// AddWatchReactor appends a reactor to the end of the chain. -func (c *Fake) AddWatchReactor(resource string, reaction WatchReactionFunc) { - c.Lock() - defer c.Unlock() - c.WatchReactionChain = append(c.WatchReactionChain, &SimpleWatchReactor{resource, reaction}) -} - -// PrependWatchReactor adds a reactor to the beginning of the chain. -func (c *Fake) PrependWatchReactor(resource string, reaction WatchReactionFunc) { - c.Lock() - defer c.Unlock() - c.WatchReactionChain = append([]WatchReactor{&SimpleWatchReactor{resource, reaction}}, c.WatchReactionChain...) -} - -// AddProxyReactor appends a reactor to the end of the chain. -func (c *Fake) AddProxyReactor(resource string, reaction ProxyReactionFunc) { - c.ProxyReactionChain = append(c.ProxyReactionChain, &SimpleProxyReactor{resource, reaction}) -} - -// PrependProxyReactor adds a reactor to the beginning of the chain. -func (c *Fake) PrependProxyReactor(resource string, reaction ProxyReactionFunc) { - c.ProxyReactionChain = append([]ProxyReactor{&SimpleProxyReactor{resource, reaction}}, c.ProxyReactionChain...) -} - -// Invokes records the provided Action and then invokes the ReactionFunc that -// handles the action if one exists. defaultReturnObj is expected to be of the -// same type a normal call would return. -func (c *Fake) Invokes(action Action, defaultReturnObj runtime.Object) (runtime.Object, error) { - c.Lock() - defer c.Unlock() - - actionCopy := action.DeepCopy() - c.actions = append(c.actions, action.DeepCopy()) - for _, reactor := range c.ReactionChain { - if !reactor.Handles(actionCopy) { - continue - } - - handled, ret, err := reactor.React(actionCopy) - if !handled { - continue - } - - return ret, err - } - - return defaultReturnObj, nil -} - -// InvokesWatch records the provided Action and then invokes the ReactionFunc -// that handles the action if one exists. -func (c *Fake) InvokesWatch(action Action) (watch.Interface, error) { - c.Lock() - defer c.Unlock() - - actionCopy := action.DeepCopy() - c.actions = append(c.actions, action.DeepCopy()) - for _, reactor := range c.WatchReactionChain { - if !reactor.Handles(actionCopy) { - continue - } - - handled, ret, err := reactor.React(actionCopy) - if !handled { - continue - } - - return ret, err - } - - return nil, fmt.Errorf("unhandled watch: %#v", action) -} - -// InvokesProxy records the provided Action and then invokes the ReactionFunc -// that handles the action if one exists. -func (c *Fake) InvokesProxy(action Action) restclient.ResponseWrapper { - c.Lock() - defer c.Unlock() - - actionCopy := action.DeepCopy() - c.actions = append(c.actions, action.DeepCopy()) - for _, reactor := range c.ProxyReactionChain { - if !reactor.Handles(actionCopy) { - continue - } - - handled, ret, err := reactor.React(actionCopy) - if !handled || err != nil { - continue - } - - return ret - } - - return nil -} - -// ClearActions clears the history of actions called on the fake client. -func (c *Fake) ClearActions() { - c.Lock() - defer c.Unlock() - - c.actions = make([]Action, 0) -} - -// Actions returns a chronologically ordered slice fake actions called on the -// fake client. -func (c *Fake) Actions() []Action { - c.RLock() - defer c.RUnlock() - fa := make([]Action, len(c.actions)) - copy(fa, c.actions) - return fa -} diff --git a/vendor/k8s.io/client-go/testing/fixture.go b/vendor/k8s.io/client-go/testing/fixture.go deleted file mode 100644 index d288a3aa4..000000000 --- a/vendor/k8s.io/client-go/testing/fixture.go +++ /dev/null @@ -1,1005 +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 testing - -import ( - "fmt" - "reflect" - "sigs.k8s.io/structured-merge-diff/v4/typed" - "sigs.k8s.io/yaml" - "sort" - "strings" - "sync" - - jsonpatch "gopkg.in/evanphx/json-patch.v4" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/meta" - "k8s.io/apimachinery/pkg/api/meta/testrestmapper" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/json" - "k8s.io/apimachinery/pkg/util/managedfields" - "k8s.io/apimachinery/pkg/util/strategicpatch" - "k8s.io/apimachinery/pkg/watch" - restclient "k8s.io/client-go/rest" -) - -// ObjectTracker keeps track of objects. It is intended to be used to -// fake calls to a server by returning objects based on their kind, -// namespace and name. -type ObjectTracker interface { - // Add adds an object to the tracker. If object being added - // is a list, its items are added separately. - Add(obj runtime.Object) error - - // Get retrieves the object by its kind, namespace and name. - Get(gvr schema.GroupVersionResource, ns, name string, opts ...metav1.GetOptions) (runtime.Object, error) - - // Create adds an object to the tracker in the specified namespace. - Create(gvr schema.GroupVersionResource, obj runtime.Object, ns string, opts ...metav1.CreateOptions) error - - // Update updates an existing object in the tracker in the specified namespace. - Update(gvr schema.GroupVersionResource, obj runtime.Object, ns string, opts ...metav1.UpdateOptions) error - - // Patch patches an existing object in the tracker in the specified namespace. - Patch(gvr schema.GroupVersionResource, obj runtime.Object, ns string, opts ...metav1.PatchOptions) error - - // Apply applies an object in the tracker in the specified namespace. - Apply(gvr schema.GroupVersionResource, applyConfiguration runtime.Object, ns string, opts ...metav1.PatchOptions) error - - // List retrieves all objects of a given kind in the given - // namespace. Only non-List kinds are accepted. - List(gvr schema.GroupVersionResource, gvk schema.GroupVersionKind, ns string, opts ...metav1.ListOptions) (runtime.Object, error) - - // Delete deletes an existing object from the tracker. If object - // didn't exist in the tracker prior to deletion, Delete returns - // no error. - Delete(gvr schema.GroupVersionResource, ns, name string, opts ...metav1.DeleteOptions) error - - // Watch watches objects from the tracker. Watch returns a channel - // which will push added / modified / deleted object. - Watch(gvr schema.GroupVersionResource, ns string, opts ...metav1.ListOptions) (watch.Interface, error) -} - -// ObjectScheme abstracts the implementation of common operations on objects. -type ObjectScheme interface { - runtime.ObjectCreater - runtime.ObjectTyper -} - -// ObjectReaction returns a ReactionFunc that applies core.Action to -// the given tracker. -// -// If tracker also implements ManagedFieldObjectTracker, then managed fields -// will be handled by the tracker and apply patch actions will be evaluated -// using the field manager and will take field ownership into consideration. -// Without a ManagedFieldObjectTracker, apply patch actions do not consider -// field ownership. -// -// WARNING: There is no server side defaulting, validation, or conversion handled -// by the fake client and subresources are not handled accurately (fields in the -// root resource are not automatically updated when a scale resource is updated, for example). -func ObjectReaction(tracker ObjectTracker) ReactionFunc { - reactor := objectTrackerReact{tracker: tracker} - return func(action Action) (bool, runtime.Object, error) { - // Here and below we need to switch on implementation types, - // not on interfaces, as some interfaces are identical - // (e.g. UpdateAction and CreateAction), so if we use them, - // updates and creates end up matching the same case branch. - switch action := action.(type) { - case ListActionImpl: - obj, err := reactor.List(action) - return true, obj, err - case GetActionImpl: - obj, err := reactor.Get(action) - return true, obj, err - case CreateActionImpl: - obj, err := reactor.Create(action) - return true, obj, err - case UpdateActionImpl: - obj, err := reactor.Update(action) - return true, obj, err - case DeleteActionImpl: - obj, err := reactor.Delete(action) - return true, obj, err - case PatchActionImpl: - if action.GetPatchType() == types.ApplyPatchType { - obj, err := reactor.Apply(action) - return true, obj, err - } - obj, err := reactor.Patch(action) - return true, obj, err - default: - return false, nil, fmt.Errorf("no reaction implemented for %s", action) - } - } -} - -type objectTrackerReact struct { - tracker ObjectTracker -} - -func (o objectTrackerReact) List(action ListActionImpl) (runtime.Object, error) { - return o.tracker.List(action.GetResource(), action.GetKind(), action.GetNamespace(), action.ListOptions) -} - -func (o objectTrackerReact) Get(action GetActionImpl) (runtime.Object, error) { - return o.tracker.Get(action.GetResource(), action.GetNamespace(), action.GetName(), action.GetOptions) -} - -func (o objectTrackerReact) Create(action CreateActionImpl) (runtime.Object, error) { - ns := action.GetNamespace() - gvr := action.GetResource() - objMeta, err := meta.Accessor(action.GetObject()) - if err != nil { - return nil, err - } - if action.GetSubresource() == "" { - err = o.tracker.Create(gvr, action.GetObject(), ns, action.CreateOptions) - if err != nil { - return nil, err - } - } else { - oldObj, getOldObjErr := o.tracker.Get(gvr, ns, objMeta.GetName(), metav1.GetOptions{}) - if getOldObjErr != nil { - return nil, getOldObjErr - } - // Check whether the existing historical object type is the same as the current operation object type that needs to be updated, and if it is the same, perform the update operation. - if reflect.TypeOf(oldObj) == reflect.TypeOf(action.GetObject()) { - // TODO: Currently we're handling subresource creation as an update - // on the enclosing resource. This works for some subresources but - // might not be generic enough. - err = o.tracker.Update(gvr, action.GetObject(), ns, metav1.UpdateOptions{ - DryRun: action.CreateOptions.DryRun, - FieldManager: action.CreateOptions.FieldManager, - FieldValidation: action.CreateOptions.FieldValidation, - }) - } else { - // If the historical object type is different from the current object type, need to make sure we return the object submitted,don't persist the submitted object in the tracker. - return action.GetObject(), nil - } - } - if err != nil { - return nil, err - } - obj, err := o.tracker.Get(gvr, ns, objMeta.GetName(), metav1.GetOptions{}) - return obj, err -} - -func (o objectTrackerReact) Update(action UpdateActionImpl) (runtime.Object, error) { - ns := action.GetNamespace() - gvr := action.GetResource() - objMeta, err := meta.Accessor(action.GetObject()) - if err != nil { - return nil, err - } - - err = o.tracker.Update(gvr, action.GetObject(), ns, action.UpdateOptions) - if err != nil { - return nil, err - } - - obj, err := o.tracker.Get(gvr, ns, objMeta.GetName(), metav1.GetOptions{}) - return obj, err -} - -func (o objectTrackerReact) Delete(action DeleteActionImpl) (runtime.Object, error) { - err := o.tracker.Delete(action.GetResource(), action.GetNamespace(), action.GetName(), action.DeleteOptions) - return nil, err -} - -func (o objectTrackerReact) Apply(action PatchActionImpl) (runtime.Object, error) { - ns := action.GetNamespace() - gvr := action.GetResource() - - patchObj := &unstructured.Unstructured{Object: map[string]interface{}{}} - if err := yaml.Unmarshal(action.GetPatch(), &patchObj.Object); err != nil { - return nil, err - } - err := o.tracker.Apply(gvr, patchObj, ns, action.PatchOptions) - if err != nil { - return nil, err - } - obj, err := o.tracker.Get(gvr, ns, action.GetName(), metav1.GetOptions{}) - return obj, err -} - -func (o objectTrackerReact) Patch(action PatchActionImpl) (runtime.Object, error) { - ns := action.GetNamespace() - gvr := action.GetResource() - - obj, err := o.tracker.Get(gvr, ns, action.GetName(), metav1.GetOptions{}) - if err != nil { - return nil, err - } - - old, err := json.Marshal(obj) - if err != nil { - return nil, err - } - - // reset the object in preparation to unmarshal, since unmarshal does not guarantee that fields - // in obj that are removed by patch are cleared - value := reflect.ValueOf(obj) - value.Elem().Set(reflect.New(value.Type().Elem()).Elem()) - - switch action.GetPatchType() { - case types.JSONPatchType: - patch, err := jsonpatch.DecodePatch(action.GetPatch()) - if err != nil { - return nil, err - } - modified, err := patch.Apply(old) - if err != nil { - return nil, err - } - - if err = json.Unmarshal(modified, obj); err != nil { - return nil, err - } - case types.MergePatchType: - modified, err := jsonpatch.MergePatch(old, action.GetPatch()) - if err != nil { - return nil, err - } - - if err := json.Unmarshal(modified, obj); err != nil { - return nil, err - } - case types.StrategicMergePatchType: - mergedByte, err := strategicpatch.StrategicMergePatch(old, action.GetPatch(), obj) - if err != nil { - return nil, err - } - if err = json.Unmarshal(mergedByte, obj); err != nil { - return nil, err - } - default: - return nil, fmt.Errorf("PatchType %s is not supported", action.GetPatchType()) - } - - if err = o.tracker.Patch(gvr, obj, ns, action.PatchOptions); err != nil { - return nil, err - } - - return obj, nil -} - -type tracker struct { - scheme ObjectScheme - decoder runtime.Decoder - lock sync.RWMutex - objects map[schema.GroupVersionResource]map[types.NamespacedName]runtime.Object - // The value type of watchers is a map of which the key is either a namespace or - // all/non namespace aka "" and its value is list of fake watchers. - // Manipulations on resources will broadcast the notification events into the - // watchers' channel. Note that too many unhandled events (currently 100, - // see apimachinery/pkg/watch.DefaultChanSize) will cause a panic. - watchers map[schema.GroupVersionResource]map[string][]*watch.RaceFreeFakeWatcher -} - -var _ ObjectTracker = &tracker{} - -// NewObjectTracker returns an ObjectTracker that can be used to keep track -// of objects for the fake clientset. Mostly useful for unit tests. -func NewObjectTracker(scheme ObjectScheme, decoder runtime.Decoder) ObjectTracker { - return &tracker{ - scheme: scheme, - decoder: decoder, - objects: make(map[schema.GroupVersionResource]map[types.NamespacedName]runtime.Object), - watchers: make(map[schema.GroupVersionResource]map[string][]*watch.RaceFreeFakeWatcher), - } -} - -func (t *tracker) List(gvr schema.GroupVersionResource, gvk schema.GroupVersionKind, ns string, opts ...metav1.ListOptions) (runtime.Object, error) { - _, err := assertOptionalSingleArgument(opts) - if err != nil { - return nil, err - } - // Heuristic for list kind: original kind + List suffix. Might - // not always be true but this tracker has a pretty limited - // understanding of the actual API model. - listGVK := gvk - listGVK.Kind = listGVK.Kind + "List" - // GVK does have the concept of "internal version". The scheme recognizes - // the runtime.APIVersionInternal, but not the empty string. - if listGVK.Version == "" { - listGVK.Version = runtime.APIVersionInternal - } - - list, err := t.scheme.New(listGVK) - if err != nil { - return nil, err - } - - if !meta.IsListType(list) { - return nil, fmt.Errorf("%q is not a list type", listGVK.Kind) - } - - t.lock.RLock() - defer t.lock.RUnlock() - - objs, ok := t.objects[gvr] - if !ok { - return list, nil - } - - matchingObjs, err := filterByNamespace(objs, ns) - if err != nil { - return nil, err - } - if err := meta.SetList(list, matchingObjs); err != nil { - return nil, err - } - return list.DeepCopyObject(), nil -} - -func (t *tracker) Watch(gvr schema.GroupVersionResource, ns string, opts ...metav1.ListOptions) (watch.Interface, error) { - _, err := assertOptionalSingleArgument(opts) - if err != nil { - return nil, err - } - - t.lock.Lock() - defer t.lock.Unlock() - - fakewatcher := watch.NewRaceFreeFake() - - if _, exists := t.watchers[gvr]; !exists { - t.watchers[gvr] = make(map[string][]*watch.RaceFreeFakeWatcher) - } - t.watchers[gvr][ns] = append(t.watchers[gvr][ns], fakewatcher) - return fakewatcher, nil -} - -func (t *tracker) Get(gvr schema.GroupVersionResource, ns, name string, opts ...metav1.GetOptions) (runtime.Object, error) { - _, err := assertOptionalSingleArgument(opts) - if err != nil { - return nil, err - } - errNotFound := apierrors.NewNotFound(gvr.GroupResource(), name) - - t.lock.RLock() - defer t.lock.RUnlock() - - objs, ok := t.objects[gvr] - if !ok { - return nil, errNotFound - } - - matchingObj, ok := objs[types.NamespacedName{Namespace: ns, Name: name}] - if !ok { - return nil, errNotFound - } - - // Only one object should match in the tracker if it works - // correctly, as Add/Update methods enforce kind/namespace/name - // uniqueness. - obj := matchingObj.DeepCopyObject() - if status, ok := obj.(*metav1.Status); ok { - if status.Status != metav1.StatusSuccess { - return nil, &apierrors.StatusError{ErrStatus: *status} - } - } - - return obj, nil -} - -func (t *tracker) Add(obj runtime.Object) error { - if meta.IsListType(obj) { - return t.addList(obj, false) - } - objMeta, err := meta.Accessor(obj) - if err != nil { - return err - } - gvks, _, err := t.scheme.ObjectKinds(obj) - if err != nil { - return err - } - - if partial, ok := obj.(*metav1.PartialObjectMetadata); ok && len(partial.TypeMeta.APIVersion) > 0 { - gvks = []schema.GroupVersionKind{partial.TypeMeta.GroupVersionKind()} - } - - if len(gvks) == 0 { - return fmt.Errorf("no registered kinds for %v", obj) - } - for _, gvk := range gvks { - // NOTE: UnsafeGuessKindToResource is a heuristic and default match. The - // actual registration in apiserver can specify arbitrary route for a - // gvk. If a test uses such objects, it cannot preset the tracker with - // objects via Add(). Instead, it should trigger the Create() function - // of the tracker, where an arbitrary gvr can be specified. - gvr, _ := meta.UnsafeGuessKindToResource(gvk) - // Resource doesn't have the concept of "__internal" version, just set it to "". - if gvr.Version == runtime.APIVersionInternal { - gvr.Version = "" - } - - err := t.add(gvr, obj, objMeta.GetNamespace(), false) - if err != nil { - return err - } - } - return nil -} - -func (t *tracker) Create(gvr schema.GroupVersionResource, obj runtime.Object, ns string, opts ...metav1.CreateOptions) error { - _, err := assertOptionalSingleArgument(opts) - if err != nil { - return err - } - return t.add(gvr, obj, ns, false) -} - -func (t *tracker) Update(gvr schema.GroupVersionResource, obj runtime.Object, ns string, opts ...metav1.UpdateOptions) error { - _, err := assertOptionalSingleArgument(opts) - if err != nil { - return err - } - return t.add(gvr, obj, ns, true) -} - -func (t *tracker) Patch(gvr schema.GroupVersionResource, patchedObject runtime.Object, ns string, opts ...metav1.PatchOptions) error { - _, err := assertOptionalSingleArgument(opts) - if err != nil { - return err - } - return t.add(gvr, patchedObject, ns, true) -} - -func (t *tracker) Apply(gvr schema.GroupVersionResource, applyConfiguration runtime.Object, ns string, opts ...metav1.PatchOptions) error { - _, err := assertOptionalSingleArgument(opts) - if err != nil { - return err - } - applyConfigurationMeta, err := meta.Accessor(applyConfiguration) - if err != nil { - return err - } - - obj, err := t.Get(gvr, ns, applyConfigurationMeta.GetName(), metav1.GetOptions{}) - if err != nil { - return err - } - - old, err := json.Marshal(obj) - if err != nil { - return err - } - - // reset the object in preparation to unmarshal, since unmarshal does not guarantee that fields - // in obj that are removed by patch are cleared - value := reflect.ValueOf(obj) - value.Elem().Set(reflect.New(value.Type().Elem()).Elem()) - - // For backward compatibility with behavior 1.30 and earlier, continue to handle apply - // via strategic merge patch (clients may use fake.NewClientset and ManagedFieldObjectTracker - // for full field manager support). - patch, err := json.Marshal(applyConfiguration) - if err != nil { - return err - } - mergedByte, err := strategicpatch.StrategicMergePatch(old, patch, obj) - if err != nil { - return err - } - if err = json.Unmarshal(mergedByte, obj); err != nil { - return err - } - - return t.add(gvr, obj, ns, true) -} - -func (t *tracker) getWatches(gvr schema.GroupVersionResource, ns string) []*watch.RaceFreeFakeWatcher { - watches := []*watch.RaceFreeFakeWatcher{} - if t.watchers[gvr] != nil { - if w := t.watchers[gvr][ns]; w != nil { - watches = append(watches, w...) - } - if ns != metav1.NamespaceAll { - if w := t.watchers[gvr][metav1.NamespaceAll]; w != nil { - watches = append(watches, w...) - } - } - } - return watches -} - -func (t *tracker) add(gvr schema.GroupVersionResource, obj runtime.Object, ns string, replaceExisting bool) error { - t.lock.Lock() - defer t.lock.Unlock() - - gr := gvr.GroupResource() - - // To avoid the object from being accidentally modified by caller - // after it's been added to the tracker, we always store the deep - // copy. - obj = obj.DeepCopyObject() - - newMeta, err := meta.Accessor(obj) - if err != nil { - return err - } - - // Propagate namespace to the new object if hasn't already been set. - if len(newMeta.GetNamespace()) == 0 { - newMeta.SetNamespace(ns) - } - - if ns != newMeta.GetNamespace() { - msg := fmt.Sprintf("request namespace does not match object namespace, request: %q object: %q", ns, newMeta.GetNamespace()) - return apierrors.NewBadRequest(msg) - } - - _, ok := t.objects[gvr] - if !ok { - t.objects[gvr] = make(map[types.NamespacedName]runtime.Object) - } - - namespacedName := types.NamespacedName{Namespace: newMeta.GetNamespace(), Name: newMeta.GetName()} - if _, ok = t.objects[gvr][namespacedName]; ok { - if replaceExisting { - for _, w := range t.getWatches(gvr, ns) { - // To avoid the object from being accidentally modified by watcher - w.Modify(obj.DeepCopyObject()) - } - t.objects[gvr][namespacedName] = obj - return nil - } - return apierrors.NewAlreadyExists(gr, newMeta.GetName()) - } - - if replaceExisting { - // Tried to update but no matching object was found. - return apierrors.NewNotFound(gr, newMeta.GetName()) - } - - t.objects[gvr][namespacedName] = obj - - for _, w := range t.getWatches(gvr, ns) { - // To avoid the object from being accidentally modified by watcher - w.Add(obj.DeepCopyObject()) - } - - return nil -} - -func (t *tracker) addList(obj runtime.Object, replaceExisting bool) error { - list, err := meta.ExtractList(obj) - if err != nil { - return err - } - errs := runtime.DecodeList(list, t.decoder) - if len(errs) > 0 { - return errs[0] - } - for _, obj := range list { - if err := t.Add(obj); err != nil { - return err - } - } - return nil -} - -func (t *tracker) Delete(gvr schema.GroupVersionResource, ns, name string, opts ...metav1.DeleteOptions) error { - _, err := assertOptionalSingleArgument(opts) - if err != nil { - return err - } - t.lock.Lock() - defer t.lock.Unlock() - - objs, ok := t.objects[gvr] - if !ok { - return apierrors.NewNotFound(gvr.GroupResource(), name) - } - - namespacedName := types.NamespacedName{Namespace: ns, Name: name} - obj, ok := objs[namespacedName] - if !ok { - return apierrors.NewNotFound(gvr.GroupResource(), name) - } - - delete(objs, namespacedName) - for _, w := range t.getWatches(gvr, ns) { - w.Delete(obj.DeepCopyObject()) - } - return nil -} - -type managedFieldObjectTracker struct { - ObjectTracker - scheme ObjectScheme - objectConverter runtime.ObjectConvertor - mapper meta.RESTMapper - typeConverter managedfields.TypeConverter -} - -var _ ObjectTracker = &managedFieldObjectTracker{} - -// NewFieldManagedObjectTracker returns an ObjectTracker that can be used to keep track -// of objects and managed fields for the fake clientset. Mostly useful for unit tests. -func NewFieldManagedObjectTracker(scheme *runtime.Scheme, decoder runtime.Decoder, typeConverter managedfields.TypeConverter) ObjectTracker { - return &managedFieldObjectTracker{ - ObjectTracker: NewObjectTracker(scheme, decoder), - scheme: scheme, - objectConverter: scheme, - mapper: testrestmapper.TestOnlyStaticRESTMapper(scheme), - typeConverter: typeConverter, - } -} - -func (t *managedFieldObjectTracker) Create(gvr schema.GroupVersionResource, obj runtime.Object, ns string, vopts ...metav1.CreateOptions) error { - opts, err := assertOptionalSingleArgument(vopts) - if err != nil { - return err - } - gvk, err := t.mapper.KindFor(gvr) - if err != nil { - return err - } - mgr, err := t.fieldManagerFor(gvk) - if err != nil { - return err - } - - objType, err := meta.TypeAccessor(obj) - if err != nil { - return err - } - // Stamp GVK - apiVersion, kind := gvk.ToAPIVersionAndKind() - objType.SetAPIVersion(apiVersion) - objType.SetKind(kind) - - objMeta, err := meta.Accessor(obj) - if err != nil { - return err - } - liveObject, err := t.ObjectTracker.Get(gvr, ns, objMeta.GetName(), metav1.GetOptions{}) - if apierrors.IsNotFound(err) { - liveObject, err = t.scheme.New(gvk) - if err != nil { - return err - } - liveObject.GetObjectKind().SetGroupVersionKind(gvk) - } else if err != nil { - return err - } - objWithManagedFields, err := mgr.Update(liveObject, obj, opts.FieldManager) - if err != nil { - return err - } - return t.ObjectTracker.Create(gvr, objWithManagedFields, ns, opts) -} - -func (t *managedFieldObjectTracker) Update(gvr schema.GroupVersionResource, obj runtime.Object, ns string, vopts ...metav1.UpdateOptions) error { - opts, err := assertOptionalSingleArgument(vopts) - if err != nil { - return err - } - gvk, err := t.mapper.KindFor(gvr) - if err != nil { - return err - } - mgr, err := t.fieldManagerFor(gvk) - if err != nil { - return err - } - - objMeta, err := meta.Accessor(obj) - if err != nil { - return err - } - oldObj, err := t.ObjectTracker.Get(gvr, ns, objMeta.GetName(), metav1.GetOptions{}) - if err != nil { - return err - } - objWithManagedFields, err := mgr.Update(oldObj, obj, opts.FieldManager) - if err != nil { - return err - } - - return t.ObjectTracker.Update(gvr, objWithManagedFields, ns, opts) -} - -func (t *managedFieldObjectTracker) Patch(gvr schema.GroupVersionResource, patchedObject runtime.Object, ns string, vopts ...metav1.PatchOptions) error { - opts, err := assertOptionalSingleArgument(vopts) - if err != nil { - return err - } - gvk, err := t.mapper.KindFor(gvr) - if err != nil { - return err - } - mgr, err := t.fieldManagerFor(gvk) - if err != nil { - return err - } - - objMeta, err := meta.Accessor(patchedObject) - if err != nil { - return err - } - oldObj, err := t.ObjectTracker.Get(gvr, ns, objMeta.GetName(), metav1.GetOptions{}) - if err != nil { - return err - } - objWithManagedFields, err := mgr.Update(oldObj, patchedObject, opts.FieldManager) - if err != nil { - return err - } - return t.ObjectTracker.Patch(gvr, objWithManagedFields, ns, vopts...) -} - -func (t *managedFieldObjectTracker) Apply(gvr schema.GroupVersionResource, applyConfiguration runtime.Object, ns string, vopts ...metav1.PatchOptions) error { - opts, err := assertOptionalSingleArgument(vopts) - if err != nil { - return err - } - gvk, err := t.mapper.KindFor(gvr) - if err != nil { - return err - } - applyConfigurationMeta, err := meta.Accessor(applyConfiguration) - if err != nil { - return err - } - - exists := true - liveObject, err := t.ObjectTracker.Get(gvr, ns, applyConfigurationMeta.GetName(), metav1.GetOptions{}) - if apierrors.IsNotFound(err) { - exists = false - liveObject, err = t.scheme.New(gvk) - if err != nil { - return err - } - liveObject.GetObjectKind().SetGroupVersionKind(gvk) - } else if err != nil { - return err - } - mgr, err := t.fieldManagerFor(gvk) - if err != nil { - return err - } - force := false - if opts.Force != nil { - force = *opts.Force - } - objWithManagedFields, err := mgr.Apply(liveObject, applyConfiguration, opts.FieldManager, force) - if err != nil { - return err - } - - if !exists { - return t.ObjectTracker.Create(gvr, objWithManagedFields, ns, metav1.CreateOptions{ - DryRun: opts.DryRun, - FieldManager: opts.FieldManager, - FieldValidation: opts.FieldValidation, - }) - } else { - return t.ObjectTracker.Update(gvr, objWithManagedFields, ns, metav1.UpdateOptions{ - DryRun: opts.DryRun, - FieldManager: opts.FieldManager, - FieldValidation: opts.FieldValidation, - }) - } -} - -func (t *managedFieldObjectTracker) fieldManagerFor(gvk schema.GroupVersionKind) (*managedfields.FieldManager, error) { - return managedfields.NewDefaultFieldManager( - t.typeConverter, - t.objectConverter, - &objectDefaulter{}, - t.scheme, - gvk, - gvk.GroupVersion(), - "", - nil) -} - -// objectDefaulter implements runtime.Defaulter, but it actually -// does nothing. -type objectDefaulter struct{} - -func (d *objectDefaulter) Default(_ runtime.Object) {} - -// filterByNamespace returns all objects in the collection that -// match provided namespace. Empty namespace matches -// non-namespaced objects. -func filterByNamespace(objs map[types.NamespacedName]runtime.Object, ns string) ([]runtime.Object, error) { - var res []runtime.Object - - for _, obj := range objs { - acc, err := meta.Accessor(obj) - if err != nil { - return nil, err - } - if ns != "" && acc.GetNamespace() != ns { - continue - } - res = append(res, obj) - } - - // Sort res to get deterministic order. - sort.Slice(res, func(i, j int) bool { - acc1, _ := meta.Accessor(res[i]) - acc2, _ := meta.Accessor(res[j]) - if acc1.GetNamespace() != acc2.GetNamespace() { - return acc1.GetNamespace() < acc2.GetNamespace() - } - return acc1.GetName() < acc2.GetName() - }) - return res, nil -} - -func DefaultWatchReactor(watchInterface watch.Interface, err error) WatchReactionFunc { - return func(action Action) (bool, watch.Interface, error) { - return true, watchInterface, err - } -} - -// SimpleReactor is a Reactor. Each reaction function is attached to a given verb,resource tuple. "*" in either field matches everything for that value. -// For instance, *,pods matches all verbs on pods. This allows for easier composition of reaction functions -type SimpleReactor struct { - Verb string - Resource string - - Reaction ReactionFunc -} - -func (r *SimpleReactor) Handles(action Action) bool { - verbCovers := r.Verb == "*" || r.Verb == action.GetVerb() - if !verbCovers { - return false - } - - return resourceCovers(r.Resource, action) -} - -func (r *SimpleReactor) React(action Action) (bool, runtime.Object, error) { - return r.Reaction(action) -} - -// SimpleWatchReactor is a WatchReactor. Each reaction function is attached to a given resource. "*" matches everything for that value. -// For instance, *,pods matches all verbs on pods. This allows for easier composition of reaction functions -type SimpleWatchReactor struct { - Resource string - - Reaction WatchReactionFunc -} - -func (r *SimpleWatchReactor) Handles(action Action) bool { - return resourceCovers(r.Resource, action) -} - -func (r *SimpleWatchReactor) React(action Action) (bool, watch.Interface, error) { - return r.Reaction(action) -} - -// SimpleProxyReactor is a ProxyReactor. Each reaction function is attached to a given resource. "*" matches everything for that value. -// For instance, *,pods matches all verbs on pods. This allows for easier composition of reaction functions. -type SimpleProxyReactor struct { - Resource string - - Reaction ProxyReactionFunc -} - -func (r *SimpleProxyReactor) Handles(action Action) bool { - return resourceCovers(r.Resource, action) -} - -func (r *SimpleProxyReactor) React(action Action) (bool, restclient.ResponseWrapper, error) { - return r.Reaction(action) -} - -func resourceCovers(resource string, action Action) bool { - if resource == "*" { - return true - } - - if resource == action.GetResource().Resource { - return true - } - - if index := strings.Index(resource, "/"); index != -1 && - resource[:index] == action.GetResource().Resource && - resource[index+1:] == action.GetSubresource() { - return true - } - - return false -} - -// assertOptionalSingleArgument returns an error if there is more than one variadic argument. -// Otherwise, it returns the first variadic argument, or zero value if there are no arguments. -func assertOptionalSingleArgument[T any](arguments []T) (T, error) { - var a T - switch len(arguments) { - case 0: - return a, nil - case 1: - return arguments[0], nil - default: - return a, fmt.Errorf("expected only one option argument but got %d", len(arguments)) - } -} - -type TypeResolver interface { - Type(openAPIName string) typed.ParseableType -} - -type TypeConverter struct { - Scheme *runtime.Scheme - TypeResolver TypeResolver -} - -func (tc TypeConverter) ObjectToTyped(obj runtime.Object, opts ...typed.ValidationOptions) (*typed.TypedValue, error) { - gvk := obj.GetObjectKind().GroupVersionKind() - name, err := tc.openAPIName(gvk) - if err != nil { - return nil, err - } - t := tc.TypeResolver.Type(name) - switch o := obj.(type) { - case *unstructured.Unstructured: - return t.FromUnstructured(o.UnstructuredContent(), opts...) - default: - return t.FromStructured(obj, opts...) - } -} - -func (tc TypeConverter) TypedToObject(value *typed.TypedValue) (runtime.Object, error) { - vu := value.AsValue().Unstructured() - switch o := vu.(type) { - case map[string]interface{}: - return &unstructured.Unstructured{Object: o}, nil - default: - return nil, fmt.Errorf("failed to convert value to unstructured for type %T", vu) - } -} - -func (tc TypeConverter) openAPIName(kind schema.GroupVersionKind) (string, error) { - example, err := tc.Scheme.New(kind) - if err != nil { - return "", err - } - rtype := reflect.TypeOf(example).Elem() - name := friendlyName(rtype.PkgPath() + "." + rtype.Name()) - return name, nil -} - -// This is a copy of openapi.friendlyName. -// TODO: consider introducing a shared version of this function in apimachinery. -func friendlyName(name string) string { - nameParts := strings.Split(name, "/") - // Reverse first part. e.g., io.k8s... instead of k8s.io... - if len(nameParts) > 0 && strings.Contains(nameParts[0], ".") { - parts := strings.Split(nameParts[0], ".") - for i, j := 0, len(parts)-1; i < j; i, j = i+1, j-1 { - parts[i], parts[j] = parts[j], parts[i] - } - nameParts[0] = strings.Join(parts, ".") - } - return strings.Join(nameParts, ".") -} diff --git a/vendor/k8s.io/client-go/testing/interface.go b/vendor/k8s.io/client-go/testing/interface.go deleted file mode 100644 index 266c6ba3f..000000000 --- a/vendor/k8s.io/client-go/testing/interface.go +++ /dev/null @@ -1,66 +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 ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - restclient "k8s.io/client-go/rest" -) - -type FakeClient interface { - // Tracker gives access to the ObjectTracker internal to the fake client. - Tracker() ObjectTracker - - // AddReactor appends a reactor to the end of the chain. - AddReactor(verb, resource string, reaction ReactionFunc) - - // PrependReactor adds a reactor to the beginning of the chain. - PrependReactor(verb, resource string, reaction ReactionFunc) - - // AddWatchReactor appends a reactor to the end of the chain. - AddWatchReactor(resource string, reaction WatchReactionFunc) - - // PrependWatchReactor adds a reactor to the beginning of the chain. - PrependWatchReactor(resource string, reaction WatchReactionFunc) - - // AddProxyReactor appends a reactor to the end of the chain. - AddProxyReactor(resource string, reaction ProxyReactionFunc) - - // PrependProxyReactor adds a reactor to the beginning of the chain. - PrependProxyReactor(resource string, reaction ProxyReactionFunc) - - // Invokes records the provided Action and then invokes the ReactionFunc that - // handles the action if one exists. defaultReturnObj is expected to be of the - // same type a normal call would return. - Invokes(action Action, defaultReturnObj runtime.Object) (runtime.Object, error) - - // InvokesWatch records the provided Action and then invokes the ReactionFunc - // that handles the action if one exists. - InvokesWatch(action Action) (watch.Interface, error) - - // InvokesProxy records the provided Action and then invokes the ReactionFunc - // that handles the action if one exists. - InvokesProxy(action Action) restclient.ResponseWrapper - - // ClearActions clears the history of actions called on the fake client. - ClearActions() - - // Actions returns a chronologically ordered slice fake actions called on the - // fake client. - Actions() []Action -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 65101dd60..adbb5c80e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -247,6 +247,11 @@ github.com/gorilla/mux # github.com/gorilla/websocket v1.5.0 ## explicit; go 1.12 github.com/gorilla/websocket +# github.com/grafana/beyla-k8s-cache v0.0.0-20241016170428-8b4efb83c725 +## explicit; go 1.23.2 +github.com/grafana/beyla-k8s-cache/pkg/informer +github.com/grafana/beyla-k8s-cache/pkg/meta +github.com/grafana/beyla-k8s-cache/pkg/meta/cni # github.com/grafana/go-offsets-tracker v0.1.7 ## explicit; go 1.20 github.com/grafana/go-offsets-tracker/pkg/offsets @@ -855,9 +860,6 @@ google.golang.org/protobuf/types/known/fieldmaskpb google.golang.org/protobuf/types/known/structpb google.golang.org/protobuf/types/known/timestamppb google.golang.org/protobuf/types/known/wrapperspb -# gopkg.in/evanphx/json-patch.v4 v4.12.0 -## explicit -gopkg.in/evanphx/json-patch.v4 # gopkg.in/inf.v0 v0.9.1 ## explicit gopkg.in/inf.v0 @@ -905,7 +907,6 @@ k8s.io/api/flowcontrol/v1 k8s.io/api/flowcontrol/v1beta1 k8s.io/api/flowcontrol/v1beta2 k8s.io/api/flowcontrol/v1beta3 -k8s.io/api/imagepolicy/v1alpha1 k8s.io/api/networking/v1 k8s.io/api/networking/v1alpha1 k8s.io/api/networking/v1beta1 @@ -930,7 +931,6 @@ k8s.io/api/storagemigration/v1alpha1 k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors k8s.io/apimachinery/pkg/api/meta -k8s.io/apimachinery/pkg/api/meta/testrestmapper k8s.io/apimachinery/pkg/api/resource k8s.io/apimachinery/pkg/api/validation k8s.io/apimachinery/pkg/apis/meta/internalversion @@ -989,7 +989,6 @@ k8s.io/apimachinery/third_party/forked/golang/netutil k8s.io/apimachinery/third_party/forked/golang/reflect # k8s.io/client-go v0.31.1 ## explicit; go 1.22.0 -k8s.io/client-go/applyconfigurations k8s.io/client-go/applyconfigurations/admissionregistration/v1 k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1 k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1 @@ -1019,7 +1018,6 @@ k8s.io/client-go/applyconfigurations/flowcontrol/v1 k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1 k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2 k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3 -k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1 k8s.io/client-go/applyconfigurations/internal k8s.io/client-go/applyconfigurations/meta/v1 k8s.io/client-go/applyconfigurations/networking/v1 @@ -1042,7 +1040,6 @@ k8s.io/client-go/applyconfigurations/storage/v1alpha1 k8s.io/client-go/applyconfigurations/storage/v1beta1 k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1 k8s.io/client-go/discovery -k8s.io/client-go/discovery/fake k8s.io/client-go/dynamic k8s.io/client-go/features k8s.io/client-go/gentype @@ -1117,114 +1114,60 @@ k8s.io/client-go/informers/storage/v1beta1 k8s.io/client-go/informers/storagemigration k8s.io/client-go/informers/storagemigration/v1alpha1 k8s.io/client-go/kubernetes -k8s.io/client-go/kubernetes/fake k8s.io/client-go/kubernetes/scheme k8s.io/client-go/kubernetes/typed/admissionregistration/v1 -k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1 -k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1 -k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1 -k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/fake k8s.io/client-go/kubernetes/typed/apps/v1 -k8s.io/client-go/kubernetes/typed/apps/v1/fake k8s.io/client-go/kubernetes/typed/apps/v1beta1 -k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake k8s.io/client-go/kubernetes/typed/apps/v1beta2 -k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake k8s.io/client-go/kubernetes/typed/authentication/v1 -k8s.io/client-go/kubernetes/typed/authentication/v1/fake k8s.io/client-go/kubernetes/typed/authentication/v1alpha1 -k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake k8s.io/client-go/kubernetes/typed/authentication/v1beta1 -k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake k8s.io/client-go/kubernetes/typed/authorization/v1 -k8s.io/client-go/kubernetes/typed/authorization/v1/fake k8s.io/client-go/kubernetes/typed/authorization/v1beta1 -k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake k8s.io/client-go/kubernetes/typed/autoscaling/v1 -k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake k8s.io/client-go/kubernetes/typed/autoscaling/v2 -k8s.io/client-go/kubernetes/typed/autoscaling/v2/fake k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1 -k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2 -k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake k8s.io/client-go/kubernetes/typed/batch/v1 -k8s.io/client-go/kubernetes/typed/batch/v1/fake k8s.io/client-go/kubernetes/typed/batch/v1beta1 -k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake k8s.io/client-go/kubernetes/typed/certificates/v1 -k8s.io/client-go/kubernetes/typed/certificates/v1/fake k8s.io/client-go/kubernetes/typed/certificates/v1alpha1 -k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake k8s.io/client-go/kubernetes/typed/certificates/v1beta1 -k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake k8s.io/client-go/kubernetes/typed/coordination/v1 -k8s.io/client-go/kubernetes/typed/coordination/v1/fake k8s.io/client-go/kubernetes/typed/coordination/v1alpha1 -k8s.io/client-go/kubernetes/typed/coordination/v1alpha1/fake k8s.io/client-go/kubernetes/typed/coordination/v1beta1 -k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake k8s.io/client-go/kubernetes/typed/core/v1 -k8s.io/client-go/kubernetes/typed/core/v1/fake k8s.io/client-go/kubernetes/typed/discovery/v1 -k8s.io/client-go/kubernetes/typed/discovery/v1/fake k8s.io/client-go/kubernetes/typed/discovery/v1beta1 -k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake k8s.io/client-go/kubernetes/typed/events/v1 -k8s.io/client-go/kubernetes/typed/events/v1/fake k8s.io/client-go/kubernetes/typed/events/v1beta1 -k8s.io/client-go/kubernetes/typed/events/v1beta1/fake k8s.io/client-go/kubernetes/typed/extensions/v1beta1 -k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake k8s.io/client-go/kubernetes/typed/flowcontrol/v1 -k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1 -k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2 -k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3 -k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake k8s.io/client-go/kubernetes/typed/networking/v1 -k8s.io/client-go/kubernetes/typed/networking/v1/fake k8s.io/client-go/kubernetes/typed/networking/v1alpha1 -k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake k8s.io/client-go/kubernetes/typed/networking/v1beta1 -k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake k8s.io/client-go/kubernetes/typed/node/v1 -k8s.io/client-go/kubernetes/typed/node/v1/fake k8s.io/client-go/kubernetes/typed/node/v1alpha1 -k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake k8s.io/client-go/kubernetes/typed/node/v1beta1 -k8s.io/client-go/kubernetes/typed/node/v1beta1/fake k8s.io/client-go/kubernetes/typed/policy/v1 -k8s.io/client-go/kubernetes/typed/policy/v1/fake k8s.io/client-go/kubernetes/typed/policy/v1beta1 -k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake k8s.io/client-go/kubernetes/typed/rbac/v1 -k8s.io/client-go/kubernetes/typed/rbac/v1/fake k8s.io/client-go/kubernetes/typed/rbac/v1alpha1 -k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake k8s.io/client-go/kubernetes/typed/rbac/v1beta1 -k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake k8s.io/client-go/kubernetes/typed/resource/v1alpha3 -k8s.io/client-go/kubernetes/typed/resource/v1alpha3/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 -k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake k8s.io/client-go/kubernetes/typed/scheduling/v1beta1 -k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake k8s.io/client-go/kubernetes/typed/storage/v1 -k8s.io/client-go/kubernetes/typed/storage/v1/fake k8s.io/client-go/kubernetes/typed/storage/v1alpha1 -k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake k8s.io/client-go/kubernetes/typed/storage/v1beta1 -k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1 -k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/fake k8s.io/client-go/listers k8s.io/client-go/listers/admissionregistration/v1 k8s.io/client-go/listers/admissionregistration/v1alpha1 @@ -1283,10 +1226,8 @@ k8s.io/client-go/pkg/apis/clientauthentication/v1beta1 k8s.io/client-go/pkg/version k8s.io/client-go/plugin/pkg/client/auth/exec k8s.io/client-go/rest -k8s.io/client-go/rest/fake k8s.io/client-go/rest/watch k8s.io/client-go/restmapper -k8s.io/client-go/testing k8s.io/client-go/tools/auth k8s.io/client-go/tools/cache k8s.io/client-go/tools/cache/synctrack From 038dd78c7d5d235aa448a22f09ce3bcb8b09658f Mon Sep 17 00:00:00 2001 From: Nikola Grcevski Date: Thu, 17 Oct 2024 11:16:53 -0400 Subject: [PATCH 5/7] Add test --- pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.o | 4 +- .../ebpf/gotracer/bpf_debug_arm64_bpfel.o | 4 +- .../ebpf/gotracer/bpf_debug_x86_bpfel.o | 4 +- .../ebpf/gotracer/bpf_tp_arm64_bpfel.o | 4 +- .../ebpf/gotracer/bpf_tp_debug_arm64_bpfel.o | 4 +- .../ebpf/gotracer/bpf_tp_debug_x86_bpfel.o | 4 +- pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.o | 4 +- pkg/internal/ebpf/gotracer/bpf_x86_bpfel.o | 4 +- test/integration/components/gosql/Dockerfile | 4 +- test/integration/components/gosql/gosql.go | 4 +- .../configs/instrumenter-config-traces.yml | 1 + ...ker-compose-beyla-gosqlclient-postgres.yml | 47 +++++++++++++++++++ test/oats/sql/yaml/oats_sql_go_postgres.yaml | 26 ++++++++++ 13 files changed, 94 insertions(+), 20 deletions(-) create mode 100644 test/oats/sql/docker-compose-beyla-gosqlclient-postgres.yml create mode 100644 test/oats/sql/yaml/oats_sql_go_postgres.yaml diff --git a/pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.o index 47430d683..78f9d625b 100644 --- a/pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:eff29edf6c7d97295378a49172e306b0a9f269f8d03b062bbebe7ea7e001b365 -size 398120 +oid sha256:1358e99d203c4c4aa9886a161361dde7dbdf355b76960b72a8539f7b2f604606 +size 398152 diff --git a/pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.o index beb05750d..a6aea0ba7 100644 --- a/pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9dbfb1ba005c60f0b29fe9cbf8544d6e8146c26907865f0225c33f872d8c7881 -size 885760 +oid sha256:43589ca7d873ee3abc37be0d3d7c220627cfd7091b0efd2818a45a1f5ad6063d +size 885800 diff --git a/pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.o index d3067e3f3..7d435b1ea 100644 --- a/pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d9e9be61b2385d2b03d899fcc7c3d5c9e61fa1cfb424592c2411abbcd21b4afc -size 887592 +oid sha256:c164a35de946205af35b9f6d5599a48db465b03e0fedc348cebf7291dfb36a7a +size 887632 diff --git a/pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.o index 6b5657fe1..b021a5663 100644 --- a/pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9c4fbfd08163575e0f9d525b725e8ba5b1c8c39b01b2af549ae3098873b4736c -size 444720 +oid sha256:2543a019d502c861c3ce529b554baf46a7595ea190e929909a11015376887f4e +size 444752 diff --git a/pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.o index c91bdab8a..89956f590 100644 --- a/pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1ff2e0f5ee2a31b1afbc37497fc0eebc1c995847df7dc11a0c889b21f292cdc7 -size 983680 +oid sha256:ee4f3eb559557ffb64db5a4b46b6e77c7b69a00b2380f46aed4b034c53709374 +size 983720 diff --git a/pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.o index b026e5109..906207e08 100644 --- a/pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:991c59999e1b34fad4fb85daf91a0bec4c04ef7f3cd9f35d1249f80b117327ce -size 985504 +oid sha256:9296d193c89b481b33dba6fc63d499af79e975e1503d2a1c92d2b0f3a0d21b02 +size 985544 diff --git a/pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.o index cd6a3026f..28810fad1 100644 --- a/pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:795a1d9533f2f3b0671d253f7a7cdcaa035f247952e0515ec2eea9a7e88d8d29 -size 446480 +oid sha256:ffdb54ed1c07a843e403f0c00ec14790826b97e06bcfc2480b750112c8b8f7e4 +size 446520 diff --git a/pkg/internal/ebpf/gotracer/bpf_x86_bpfel.o b/pkg/internal/ebpf/gotracer/bpf_x86_bpfel.o index f994bf962..ed860a228 100644 --- a/pkg/internal/ebpf/gotracer/bpf_x86_bpfel.o +++ b/pkg/internal/ebpf/gotracer/bpf_x86_bpfel.o @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6e68460db9ca75b69d56d154c3d8564ba6ef359432a002f9b51524379cddcfee -size 399952 +oid sha256:f861f67fa64705edc6a50b94d369d639520db91799eadc2af0a6a96c499d90e7 +size 399984 diff --git a/test/integration/components/gosql/Dockerfile b/test/integration/components/gosql/Dockerfile index 63042048b..d75aff32b 100644 --- a/test/integration/components/gosql/Dockerfile +++ b/test/integration/components/gosql/Dockerfile @@ -15,7 +15,7 @@ COPY gosql.go gosql.go # Build RUN go mod download -RUN go build -o qosql gosql.go +RUN go build -o gosql gosql.go # Create final image from minimal + built binary FROM debian:bookworm-slim @@ -24,4 +24,4 @@ WORKDIR / COPY --from=builder /src/gosql . USER 0:0 -CMD [ "/qosql" ] \ No newline at end of file +CMD [ "/gosql" ] \ No newline at end of file diff --git a/test/integration/components/gosql/gosql.go b/test/integration/components/gosql/gosql.go index cf58c7d2a..8e98895e6 100644 --- a/test/integration/components/gosql/gosql.go +++ b/test/integration/components/gosql/gosql.go @@ -16,7 +16,7 @@ func main() { http.HandleFunc("/psqltest", func(w http.ResponseWriter, r *http.Request) { if !psqlInit { - db, err = sql.Open("postgres", "user=postgres dbname=sqltest sslmode=disable password=postgres host=localhost port=5432") + db, err = sql.Open("postgres", "user=postgres dbname=sqltest sslmode=disable password=postgres host=sqlserver port=5432") if err != nil { log.Fatal(err) } @@ -51,7 +51,7 @@ func main() { } fmt.Println("name: ", name, " id: ", id) } else { - log.Printf("no data", err) + log.Println("no data", err) w.WriteHeader(500) return } diff --git a/test/oats/sql/configs/instrumenter-config-traces.yml b/test/oats/sql/configs/instrumenter-config-traces.yml index cadd47c90..676cec2ac 100644 --- a/test/oats/sql/configs/instrumenter-config-traces.yml +++ b/test/oats/sql/configs/instrumenter-config-traces.yml @@ -4,4 +4,5 @@ routes: - /smoke - /greeting - /sqltest + - /psqltest unmatched: path \ No newline at end of file diff --git a/test/oats/sql/docker-compose-beyla-gosqlclient-postgres.yml b/test/oats/sql/docker-compose-beyla-gosqlclient-postgres.yml new file mode 100644 index 000000000..36f588bda --- /dev/null +++ b/test/oats/sql/docker-compose-beyla-gosqlclient-postgres.yml @@ -0,0 +1,47 @@ +version: "3.9" +services: + sqlserver: + build: + context: ../../integration/components/postgresql + dockerfile: Dockerfile + image: postgres + environment: + POSTGRES_PASSWORD: "postgres" # Supplied so we can load the test schema + ports: + - "5432:5432" + testserver: + build: + context: ../../integration/components/gosql + dockerfile: Dockerfile + image: gosqlclient + ports: + - "8080:8080" + # eBPF auto instrumenter + autoinstrumenter: + build: + context: ../../.. + dockerfile: ./test/integration/components/beyla/Dockerfile + command: + - --config=/configs/instrumenter-config-traces.yml + volumes: + - {{ .ConfigDir }}:/configs + - ./testoutput/run:/var/run/beyla + - ../../../testoutput:/coverage + cap_add: + - SYS_ADMIN + privileged: true # in some environments (not GH Pull Requests) you can set it to false and then cap_add: [ SYS_ADMIN ] + network_mode: "service:testserver" + pid: "service:testserver" + environment: + GOCOVERDIR: "/coverage" + BEYLA_TRACE_PRINTER: "text" + BEYLA_OPEN_PORT: {{ .ApplicationPort }} + BEYLA_SERVICE_NAMESPACE: "integration-test" + BEYLA_METRICS_INTERVAL: "10ms" + BEYLA_BPF_BATCH_TIMEOUT: "10ms" + BEYLA_LOG_LEVEL: "DEBUG" + BEYLA_BPF_DEBUG: "true" + OTEL_EXPORTER_OTLP_ENDPOINT: "http://collector:4318" + depends_on: + testserver: + condition: service_started diff --git a/test/oats/sql/yaml/oats_sql_go_postgres.yaml b/test/oats/sql/yaml/oats_sql_go_postgres.yaml new file mode 100644 index 000000000..7b295c65a --- /dev/null +++ b/test/oats/sql/yaml/oats_sql_go_postgres.yaml @@ -0,0 +1,26 @@ +docker-compose: + generator: generic + files: + - ../docker-compose-beyla-gosqlclient-postgres.yml +input: + - path: /psqltest + +interval: 500ms +expected: + traces: + - traceql: '{ .db.operation.name = "SELECT" && .db.system = "other_sql"}' + spans: + - name: 'SELECT accounting.contacts' + attributes: + db.operation.name: SELECT + db.collection.name: accounting.contacts + db.system: other_sql + metrics: + - promql: 'db_client_operation_duration_sum{db_operation_name="SELECT", db_system="other_sql"}' + value: "> 0" + - promql: 'db_client_operation_duration_bucket{le="0",db_operation_name="SELECT", db_system="other_sql"}' + value: "== 0" + - promql: 'db_client_operation_duration_bucket{le="10",db_operation_name="SELECT", db_system="other_sql"}' + value: "> 0" + - promql: 'db_client_operation_duration_count{db_operation_name="SELECT", db_system="other_sql"}' + value: "> 0" From da548409ba02a2979e033dfb9d95cf17c2bccf41 Mon Sep 17 00:00:00 2001 From: Nikola Grcevski Date: Thu, 17 Oct 2024 11:30:22 -0400 Subject: [PATCH 6/7] mod tidy --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index caef4369e..20d6372f2 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/grafana/beyla -go 1.23 +go 1.23.2 require ( github.com/AlessandroPomponio/go-gibberish v0.0.0-20191004143433-a2d4156f0396 From 36ec19ca1ed2b6520344a81bf5246a51279dbc50 Mon Sep 17 00:00:00 2001 From: Mario Macias Date: Thu, 17 Oct 2024 17:32:01 +0200 Subject: [PATCH 7/7] Restoring disabled informers in beyla-k8s-cache (#1264) * Restoring disabled informers in new library * deduplicate Enable property * fix dependency --- go.mod | 4 +- go.sum | 4 +- pkg/internal/kube/informer_provider.go | 53 +++++---- .../beyla-k8s-cache/pkg/meta/informers.go | 38 ++++--- .../pkg/meta/informers_init.go | 102 ++++++++++++------ .../grafana/beyla-k8s-cache/pkg/meta/types.go | 2 +- vendor/modules.txt | 4 +- 7 files changed, 132 insertions(+), 75 deletions(-) diff --git a/go.mod b/go.mod index caef4369e..923f7b60f 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/grafana/beyla -go 1.23 +go 1.23.0 require ( github.com/AlessandroPomponio/go-gibberish v0.0.0-20191004143433-a2d4156f0396 @@ -13,7 +13,7 @@ require ( github.com/goccy/go-json v0.10.2 github.com/google/uuid v1.6.0 github.com/gorilla/mux v1.8.1 - github.com/grafana/beyla-k8s-cache v0.0.0-20241016170428-8b4efb83c725 + github.com/grafana/beyla-k8s-cache v0.0.0-20241017152938-23a6d2229caf github.com/grafana/go-offsets-tracker v0.1.7 github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/mariomac/guara v0.0.0-20230621100729-42bd7716e524 diff --git a/go.sum b/go.sum index ba2dd8d8f..c97b118bf 100644 --- a/go.sum +++ b/go.sum @@ -103,8 +103,8 @@ github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grafana/beyla-k8s-cache v0.0.0-20241016170428-8b4efb83c725 h1:auLp/060bWP2uWVKH3MIAzL61ttGujsNXry6NI8Un/M= -github.com/grafana/beyla-k8s-cache v0.0.0-20241016170428-8b4efb83c725/go.mod h1:+Y9gUSD7rptXXZ0OL0aRcBLAgzBm+nE4OH1QB9LqHYc= +github.com/grafana/beyla-k8s-cache v0.0.0-20241017152938-23a6d2229caf h1:OQnoOTdx+7aCdNZqYGRZMNNdmyToL6U3DG3IoZJOeX8= +github.com/grafana/beyla-k8s-cache v0.0.0-20241017152938-23a6d2229caf/go.mod h1:SMZM7CaUstB0UGj+Wf4PWHPRCJ6cO/ax9ebUyb0Dt1o= github.com/grafana/go-offsets-tracker v0.1.7 h1:2zBQ7iiGzvyXY7LA8kaaSiEqH/Yx82UcfRabbY5aOG4= github.com/grafana/go-offsets-tracker v0.1.7/go.mod h1:qcQdu7zlUKIFNUdBJlLyNHuJGW0SKWKjkrN6jtt+jds= github.com/grafana/opentelemetry-go v1.28.0-grafana.3 h1:vExZiZKDZTdDi7fP1GG3GOGuoZ0GNu76408tNXfsnD0= diff --git a/pkg/internal/kube/informer_provider.go b/pkg/internal/kube/informer_provider.go index 42b04d354..5ddaceb58 100644 --- a/pkg/internal/kube/informer_provider.go +++ b/pkg/internal/kube/informer_provider.go @@ -44,11 +44,7 @@ type MetadataProvider struct { metadata *Store informer *meta.Informers - kubeConfigPath string - syncTimeout time.Duration - resyncPeriod time.Duration - - enable kubeflags.EnableFlag + cfg *MetadataConfig } func NewMetadataProvider(config MetadataConfig) *MetadataProvider { @@ -58,38 +54,33 @@ func NewMetadataProvider(config MetadataConfig) *MetadataProvider { if config.ResyncPeriod == 0 { config.ResyncPeriod = defaultResyncTime } - mp := &MetadataProvider{ - kubeConfigPath: config.KubeConfigPath, - syncTimeout: config.SyncTimeout, - resyncPeriod: config.ResyncPeriod, - enable: config.Enable, - } + mp := &MetadataProvider{cfg: &config} return mp } func (mp *MetadataProvider) IsKubeEnabled() bool { - if mp == nil { + if mp == nil || mp.cfg == nil { return false } mp.mt.Lock() defer mp.mt.Unlock() - switch strings.ToLower(string(mp.enable)) { + switch strings.ToLower(string(mp.cfg.Enable)) { case string(kubeflags.EnabledTrue): return true case string(kubeflags.EnabledFalse), "": // empty value is disabled return false case string(kubeflags.EnabledAutodetect): // We autodetect that we are in a kubernetes if we can properly load a K8s configuration file - _, err := loadKubeConfig(mp.kubeConfigPath) + _, err := loadKubeConfig(mp.cfg.KubeConfigPath) if err != nil { klog().Debug("kubeconfig can't be detected. Assuming we are not in Kubernetes", "error", err) - mp.enable = kubeflags.EnabledFalse + mp.cfg.Enable = kubeflags.EnabledFalse return false } - mp.enable = kubeflags.EnabledTrue + mp.cfg.Enable = kubeflags.EnabledTrue return true default: - klog().Warn("invalid value for Enable value. Ignoring stage", "value", mp.enable) + klog().Warn("invalid value for Enable value. Ignoring stage", "value", mp.cfg.Enable) return false } } @@ -97,11 +88,11 @@ func (mp *MetadataProvider) IsKubeEnabled() bool { func (mp *MetadataProvider) ForceDisable() { mp.mt.Lock() defer mp.mt.Unlock() - mp.enable = kubeflags.EnabledFalse + mp.cfg.Enable = kubeflags.EnabledFalse } func (mp *MetadataProvider) KubeClient() (kubernetes.Interface, error) { - restCfg, err := loadKubeConfig(mp.kubeConfigPath) + restCfg, err := loadKubeConfig(mp.cfg.KubeConfigPath) if err != nil { return nil, fmt.Errorf("kubeconfig can't be detected: %w", err) } @@ -172,16 +163,19 @@ func (mp *MetadataProvider) initInformers(ctx context.Context) (*meta.Informers, var informers *meta.Informers go func() { var err error - if informers, err = meta.InitInformers(ctx, mp.kubeConfigPath, defaultResyncTime); err != nil { + opts := append(disabledInformerOpts(mp.cfg.DisabledInformers), + meta.WithResyncPeriod(mp.cfg.ResyncPeriod), + meta.WithKubeConfigPath(mp.cfg.KubeConfigPath)) + if informers, err = meta.InitInformers(ctx, opts...); err != nil { done <- err } close(done) }() select { - case <-time.After(mp.syncTimeout): + case <-time.After(mp.cfg.SyncTimeout): klog().Warn("kubernetes cache has not been synced after timeout. The kubernetes attributes might be incomplete."+ - " Consider increasing the BEYLA_KUBE_INFORMERS_SYNC_TIMEOUT value", "timeout", mp.syncTimeout) + " Consider increasing the BEYLA_KUBE_INFORMERS_SYNC_TIMEOUT value", "timeout", mp.cfg.SyncTimeout) case err, ok := <-done: if ok { return nil, fmt.Errorf("failed to initialize Kubernetes informers: %w", err) @@ -216,3 +210,18 @@ func loadKubeConfig(kubeConfigPath string) (*rest.Config, error) { } return config, nil } + +func disabledInformerOpts(disabledInformers []string) []meta.InformerOption { + var opts []meta.InformerOption + for _, di := range disabledInformers { + switch strings.ToLower(di) { + case "node", "nodes": + opts = append(opts, meta.WithoutNodes()) + case "service", "services": + opts = append(opts, meta.WithoutServices()) + default: + klog().Warn("invalid value for DisableInformers. Ignoring", "value", di) + } + } + return opts +} diff --git a/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/informers.go b/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/informers.go index 4690d7ffd..c977a126e 100644 --- a/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/informers.go +++ b/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/informers.go @@ -9,35 +9,41 @@ import ( ) type Informers struct { - log *slog.Logger + BaseNotifier + + log *slog.Logger + config *informersConfig + // pods and replicaSets cache the different K8s types to custom, smaller object types pods cache.SharedIndexInformer nodes cache.SharedIndexInformer services cache.SharedIndexInformer - - BaseNotifier } -func (i *Informers) Subscribe(observer Observer) { - i.BaseNotifier.Subscribe(observer) +func (inf *Informers) Subscribe(observer Observer) { + inf.BaseNotifier.Subscribe(observer) // as a "welcome" message, we send the whole kube metadata to the new observer - for _, pod := range i.pods.GetStore().List() { + for _, pod := range inf.pods.GetStore().List() { observer.On(&informer.Event{ Type: informer.EventType_CREATED, Resource: pod.(*indexableEntity).EncodedMeta, }) } - for _, node := range i.nodes.GetStore().List() { - observer.On(&informer.Event{ - Type: informer.EventType_CREATED, - Resource: node.(*indexableEntity).EncodedMeta, - }) + if !inf.config.disableNodes { + for _, node := range inf.nodes.GetStore().List() { + observer.On(&informer.Event{ + Type: informer.EventType_CREATED, + Resource: node.(*indexableEntity).EncodedMeta, + }) + } } - for _, service := range i.services.GetStore().List() { - observer.On(&informer.Event{ - Type: informer.EventType_CREATED, - Resource: service.(*indexableEntity).EncodedMeta, - }) + if !inf.config.disableServices { + for _, service := range inf.services.GetStore().List() { + observer.On(&informer.Event{ + Type: informer.EventType_CREATED, + Resource: service.(*indexableEntity).EncodedMeta, + }) + } } } diff --git a/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/informers_init.go b/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/informers_init.go index b621b4d13..fe9193139 100644 --- a/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/informers_init.go +++ b/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/informers_init.go @@ -26,13 +26,51 @@ const ( typeNode = "Node" typePod = "Pod" typeService = "Service" + defaultResyncTime = 30 * time.Minute ) -func InitInformers(ctx context.Context, kubeconfigPath string, resyncPeriod time.Duration) (*Informers, error) { +type informersConfig struct { + kubeConfigPath string + resyncPeriod time.Duration + disableNodes bool + disableServices bool +} + +type InformerOption func(*informersConfig) + +func WithKubeConfigPath(path string) InformerOption { + return func(c *informersConfig) { + c.kubeConfigPath = path + } +} + +func WithResyncPeriod(period time.Duration) InformerOption { + return func(c *informersConfig) { + c.resyncPeriod = period + } +} + +func WithoutNodes() InformerOption { + return func(c *informersConfig) { + c.disableNodes = true + } +} + +func WithoutServices() InformerOption { + return func(c *informersConfig) { + c.disableServices = true + } +} + +func InitInformers(ctx context.Context, opts ...InformerOption) (*Informers, error) { + config := &informersConfig{resyncPeriod: 30 * time.Minute} + for _, opt := range opts { + opt(config) + } log := slog.With("component", "kube.Informers") - k := &Informers{log: log, BaseNotifier: NewBaseNotifier()} + k := &Informers{log: log, config: config, BaseNotifier: NewBaseNotifier()} - kubeCfg, err := loadKubeconfig(kubeconfigPath) + kubeCfg, err := loadKubeconfig(config.kubeConfigPath) if err != nil { return nil, fmt.Errorf("kubeconfig can't be loaded: %w", err) } @@ -41,16 +79,20 @@ func InitInformers(ctx context.Context, kubeconfigPath string, resyncPeriod time return nil, fmt.Errorf("kubernetes client can't be initialized: %w", err) } - informerFactory := informers.NewSharedInformerFactory(kubeClient, resyncPeriod) + informerFactory := informers.NewSharedInformerFactory(kubeClient, config.resyncPeriod) if err := k.initPodInformer(informerFactory); err != nil { return nil, err } - if err := k.initNodeIPInformer(informerFactory); err != nil { - return nil, err + if !config.disableNodes { + if err := k.initNodeIPInformer(informerFactory); err != nil { + return nil, err + } } - if err := k.initServiceIPInformer(informerFactory); err != nil { - return nil, err + if !config.disableServices { + if err := k.initServiceIPInformer(informerFactory); err != nil { + return nil, err + } } k.log.Debug("starting kubernetes informers, waiting for syncronization") @@ -87,7 +129,7 @@ func loadKubeconfig(kubeConfigPath string) (*rest.Config, error) { return config, nil } -func (k *Informers) initPodInformer(informerFactory informers.SharedInformerFactory) error { +func (inf *Informers) initPodInformer(informerFactory informers.SharedInformerFactory) error { pods := informerFactory.Core().V1().Pods().Informer() // Transform any *v1.Pod instance into a *PodInfo instance to save space @@ -129,8 +171,8 @@ func (k *Informers) initPodInformer(informerFactory informers.SharedInformerFact } startTime := pod.GetCreationTimestamp().String() - if k.log.Enabled(context.TODO(), slog.LevelDebug) { - k.log.Debug("inserting pod", "name", pod.Name, "namespace", pod.Namespace, "uid", pod.UID, + if inf.log.Enabled(context.TODO(), slog.LevelDebug) { + inf.log.Debug("inserting pod", "name", pod.Name, "namespace", pod.Namespace, "uid", pod.UID, "node", pod.Spec.NodeName, "startTime", startTime, "containerIDs", containerIDs) } @@ -141,7 +183,7 @@ func (k *Informers) initPodInformer(informerFactory informers.SharedInformerFact Namespace: pod.Namespace, Labels: pod.Labels, Ips: ips, - Kind: "Pod", + Kind: typePod, Pod: &informer.PodInfo{ Uid: string(pod.UID), NodeName: pod.Spec.NodeName, @@ -158,19 +200,19 @@ func (k *Informers) initPodInformer(informerFactory informers.SharedInformerFact _, err := pods.AddEventHandler(cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { - k.Notify(&informer.Event{ + inf.Notify(&informer.Event{ Type: informer.EventType_CREATED, Resource: obj.(*indexableEntity).EncodedMeta, }) }, UpdateFunc: func(_, newObj interface{}) { - k.Notify(&informer.Event{ + inf.Notify(&informer.Event{ Type: informer.EventType_UPDATED, Resource: newObj.(*indexableEntity).EncodedMeta, }) }, DeleteFunc: func(obj interface{}) { - k.Notify(&informer.Event{ + inf.Notify(&informer.Event{ Type: informer.EventType_DELETED, Resource: obj.(*indexableEntity).EncodedMeta, }) @@ -180,9 +222,9 @@ func (k *Informers) initPodInformer(informerFactory informers.SharedInformerFact return fmt.Errorf("can't register Pod event handler in the K8s informer: %w", err) } - k.log.Debug("registered Pod event handler in the K8s informer") + inf.log.Debug("registered Pod event handler in the K8s informer") - k.pods = pods + inf.pods = pods return nil } @@ -195,7 +237,7 @@ func rmContainerIDSchema(containerID string) string { return containerID } -func (k *Informers) initNodeIPInformer(informerFactory informers.SharedInformerFactory) error { +func (inf *Informers) initNodeIPInformer(informerFactory informers.SharedInformerFactory) error { nodes := informerFactory.Core().V1().Nodes().Informer() // Transform any *v1.Node instance into an *indexableEntity instance to save space // in the informer's cache @@ -233,16 +275,16 @@ func (k *Informers) initNodeIPInformer(informerFactory informers.SharedInformerF return fmt.Errorf("can't set nodes transform: %w", err) } - if _, err := nodes.AddEventHandler(k.ipInfoEventHandler()); err != nil { + if _, err := nodes.AddEventHandler(inf.ipInfoEventHandler()); err != nil { return fmt.Errorf("can't register Node event handler in the K8s informer: %w", err) } - k.log.Debug("registered Node event handler in the K8s informer") + inf.log.Debug("registered Node event handler in the K8s informer") - k.nodes = nodes + inf.nodes = nodes return nil } -func (k *Informers) initServiceIPInformer(informerFactory informers.SharedInformerFactory) error { +func (inf *Informers) initServiceIPInformer(informerFactory informers.SharedInformerFactory) error { services := informerFactory.Core().V1().Services().Informer() // Transform any *v1.Service instance into a *indexableEntity instance to save space // in the informer's cache @@ -258,7 +300,7 @@ func (k *Informers) initServiceIPInformer(informerFactory informers.SharedInform } if svc.Spec.ClusterIP == v1.ClusterIPNone { // this will be normal for headless services - k.log.Debug("Service doesn't have any ClusterIP. Beyla won't decorate their flows", + inf.log.Debug("Service doesn't have any ClusterIP. Beyla won't decorate their flows", "namespace", svc.Namespace, "name", svc.Name) } return &indexableEntity{ @@ -275,31 +317,31 @@ func (k *Informers) initServiceIPInformer(informerFactory informers.SharedInform return fmt.Errorf("can't set services transform: %w", err) } - if _, err := services.AddEventHandler(k.ipInfoEventHandler()); err != nil { + if _, err := services.AddEventHandler(inf.ipInfoEventHandler()); err != nil { return fmt.Errorf("can't register Service event handler in the K8s informer: %w", err) } - k.log.Debug("registered Service event handler in the K8s informer") + inf.log.Debug("registered Service event handler in the K8s informer") - k.services = services + inf.services = services return nil } -func (k *Informers) ipInfoEventHandler() *cache.ResourceEventHandlerFuncs { +func (inf *Informers) ipInfoEventHandler() *cache.ResourceEventHandlerFuncs { return &cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { - k.Notify(&informer.Event{ + inf.Notify(&informer.Event{ Type: informer.EventType_CREATED, Resource: obj.(*indexableEntity).EncodedMeta, }) }, UpdateFunc: func(_, newObj interface{}) { - k.Notify(&informer.Event{ + inf.Notify(&informer.Event{ Type: informer.EventType_UPDATED, Resource: newObj.(*indexableEntity).EncodedMeta, }) }, DeleteFunc: func(obj interface{}) { - k.Notify(&informer.Event{ + inf.Notify(&informer.Event{ Type: informer.EventType_DELETED, Resource: obj.(*indexableEntity).EncodedMeta, }) diff --git a/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/types.go b/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/types.go index 8742e44b6..6cc94e3e8 100644 --- a/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/types.go +++ b/vendor/github.com/grafana/beyla-k8s-cache/pkg/meta/types.go @@ -20,7 +20,7 @@ type indexableEntity struct { func ownersFrom(meta *metav1.ObjectMeta) []*informer.Owner { if len(meta.OwnerReferences) == 0 { // If no owner references' found, return itself as owner - return []*informer.Owner{{Kind: "Pod", Name: meta.Name}} + return []*informer.Owner{{Kind: typePod, Name: meta.Name}} } owners := make([]*informer.Owner, 0, len(meta.OwnerReferences)) for i := range meta.OwnerReferences { diff --git a/vendor/modules.txt b/vendor/modules.txt index adbb5c80e..dc63db1c9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -247,8 +247,8 @@ github.com/gorilla/mux # github.com/gorilla/websocket v1.5.0 ## explicit; go 1.12 github.com/gorilla/websocket -# github.com/grafana/beyla-k8s-cache v0.0.0-20241016170428-8b4efb83c725 -## explicit; go 1.23.2 +# github.com/grafana/beyla-k8s-cache v0.0.0-20241017152938-23a6d2229caf +## explicit; go 1.23.0 github.com/grafana/beyla-k8s-cache/pkg/informer github.com/grafana/beyla-k8s-cache/pkg/meta github.com/grafana/beyla-k8s-cache/pkg/meta/cni