diff --git a/build/codegen.sh b/build/codegen.sh index c857d5bbc..07e1c9f47 100755 --- a/build/codegen.sh +++ b/build/codegen.sh @@ -70,7 +70,13 @@ openapi-gen \ "${PACKAGE_NAME}/pkg/lib/numorstring" 2>&1 | tee /tmp/openapi-gen.log grep "API rule violation" /tmp/openapi-gen.log | grep "projectcalico" > /tmp/openapi-violations.log || true if [ -s /tmp/openapi-violations.log ]; then - grep -v -F -f "${REPO_ROOT}/hack/openapi-violations-known.list" /tmp/openapi-violations.log > /tmp/openapi-new-violations.log || true + # Strip comments and blank lines before using the known list as a pattern + # file. A blank line makes grep -F match everything, which silently disables + # the gate. + KNOWN_VIOLATIONS=$(mktemp) + grep -v -e '^#' -e '^[[:space:]]*$' "${REPO_ROOT}/hack/openapi-violations-known.list" > "${KNOWN_VIOLATIONS}" || true + grep -v -x -F -f "${KNOWN_VIOLATIONS}" /tmp/openapi-violations.log > /tmp/openapi-new-violations.log || true + rm -f "${KNOWN_VIOLATIONS}" if [ -s /tmp/openapi-new-violations.log ]; then echo "ERROR: openapi-gen reported new API rule violations in Calico types:" cat /tmp/openapi-new-violations.log diff --git a/config/crd/embed.go b/config/crd/embed.go new file mode 100644 index 000000000..c8057fcb4 --- /dev/null +++ b/config/crd/embed.go @@ -0,0 +1,30 @@ +// Copyright (c) 2026 Tigera, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package crd serves the generated projectcalico.org v3 CRDs to the components +// that install them, so nothing has to keep a copy of its own. +package crd + +import ( + "embed" + "io/fs" +) + +//go:embed *.yaml +var crds embed.FS + +// FS returns the CRD YAML generated into this directory. +func FS() fs.FS { + return crds +} diff --git a/config/crd/projectcalico.org_bgpconfigurations.yaml b/config/crd/projectcalico.org_bgpconfigurations.yaml index 5a6063c10..015db9c66 100644 --- a/config/crd/projectcalico.org_bgpconfigurations.yaml +++ b/config/crd/projectcalico.org_bgpconfigurations.yaml @@ -206,13 +206,33 @@ spec: x-kubernetes-list-type: atomic programClusterRoutes: description: |- - ProgramClusterRoutes controls how a cluster node gets a route to a workload on another node, - when that workload's IP comes from an IP Pool with vxlanMode: Never. When ProgramClusterRoutes is Enabled, - confd and BIRD program that route. When ProgramClusterRoutes is Disabled, it is expected that Felix will program that route. - Felix always programs such routes for IP Pools with vxlanMode: Always or vxlanMode: CrossSubnet. [Default: Enabled] + ProgramClusterRoutes controls which "cluster routes" are programmed by Calico's BGP + stack, i.e. the routes that a node needs in order to reach workloads on other nodes. It + only applies to IP Pools with vxlanMode: Never; the cluster routes for IP Pools with + vxlanMode: Always or vxlanMode: CrossSubnet are always programmed by Felix. The routes + that BIRD does not program here are expected to be programmed by Felix instead. Below, + an IPIP IP Pool is one with ipipMode: Always or CrossSubnet, and an unencapsulated one + has ipipMode and vxlanMode both Never. + + - Disabled: BIRD programs no cluster routes. + - EnabledNoEncapOnly: BIRD programs them for unencapsulated IP Pools. + - EnabledIPIPOnly: BIRD programs them for IPIP IP Pools. + - Enabled: BIRD programs them for both. + + This field must be kept consistent with FelixConfiguration.ProgramClusterRoutes, which + makes the same choice from Felix's side. If both Felix and BIRD are enabled for the same + kind of IP Pool they will fight over the routes; if neither is, there will be no cluster + routes at all. + + Note: asking BIRD to program IPIP cluster routes, which the Enabled and EnabledIPIPOnly + values do, is deprecated as of v3.33 and will be removed in v3.35. + + [Default: EnabledNoEncapOnly] enum: - Enabled - Disabled + - EnabledIPIPOnly + - EnabledNoEncapOnly type: string serviceClusterIPs: description: |- diff --git a/config/crd/projectcalico.org_bgpfilters.yaml b/config/crd/projectcalico.org_bgpfilters.yaml index d57f10aeb..dfcb65029 100644 --- a/config/crd/projectcalico.org_bgpfilters.yaml +++ b/config/crd/projectcalico.org_bgpfilters.yaml @@ -282,7 +282,7 @@ spec: MatchOperator and PrefixLength. CIDR should be in conventional CIDR notation, /. format: cidr - maxLength: 43 + maxLength: 49 type: string communities: description: |- @@ -708,7 +708,7 @@ spec: MatchOperator and PrefixLength. CIDR should be in conventional CIDR notation, /. format: cidr - maxLength: 43 + maxLength: 49 type: string communities: description: |- diff --git a/config/crd/projectcalico.org_bgppeers.yaml b/config/crd/projectcalico.org_bgppeers.yaml index 114123678..eb0a9f550 100644 --- a/config/crd/projectcalico.org_bgppeers.yaml +++ b/config/crd/projectcalico.org_bgppeers.yaml @@ -183,6 +183,19 @@ spec: with ListenPort set in BGPConfiguration, then we use that port to peer. maxLength: 64 type: string + x-kubernetes-validations: + - message: + peerIP must be an IP address, optionally with a port as + : or []: + reason: FieldValueInvalid + rule: + self == '' || isIP(self) || (self.startsWith('[') && self.contains(']:') + && isIP(self.substring(1, self.lastIndexOf(']:'))) && self.substring(self.lastIndexOf(']:') + + 2).matches('^[0-9]{1,5}$') && int(self.substring(self.lastIndexOf(']:') + + 2)) >= 1 && int(self.substring(self.lastIndexOf(']:') + 2)) + <= 65535) || (self.matches('^[0-9.]+:[0-9]{1,5}$') && isIP(self.split(':')[0]) + && int(self.split(':')[1]) >= 1 && int(self.split(':')[1]) <= + 65535) peerSelector: description: |- Selector for the remote nodes to peer with. When this is set, the PeerIP and diff --git a/config/crd/projectcalico.org_caliconodestatuses.yaml b/config/crd/projectcalico.org_caliconodestatuses.yaml index 929ec8a9e..746f0701b 100644 --- a/config/crd/projectcalico.org_caliconodestatuses.yaml +++ b/config/crd/projectcalico.org_caliconodestatuses.yaml @@ -70,6 +70,8 @@ spec: UpdatePeriodSeconds is the period at which CalicoNodeStatus should be updated. Set to 0 to disable CalicoNodeStatus refresh. Maximum update period is one day. format: int32 + maximum: 86400 + minimum: 0 type: integer type: object status: diff --git a/config/crd/projectcalico.org_felixconfigurations.yaml b/config/crd/projectcalico.org_felixconfigurations.yaml index fb577c133..dc937d378 100644 --- a/config/crd/projectcalico.org_felixconfigurations.yaml +++ b/config/crd/projectcalico.org_felixconfigurations.yaml @@ -61,12 +61,18 @@ spec: bpfAttachType: description: |- BPFAttachType controls how are the BPF programs at the network interfaces attached. - By default `TCX` is used where available to enable easier coexistence with 3rd party programs. - `TC` can force the legacy method of attaching via a qdisc. `TCX` falls back to `TC` if `TCX` is not available. - [Default: TCX] + By default `Netkit` is used, which attaches via the netkit API on workload interfaces that are + netkit devices and via `TCX` on every other interface. `TCX` is used where available to enable + easier coexistence with 3rd party programs. `TC` can force the legacy method of attaching via a + qdisc. `TCX` falls back to `TC` if `TCX` is not available. + Setting this to `TCX` or `TC` also makes Felix drive existing netkit devices with that mechanism + instead of the netkit API, which is required before downgrading to a release without netkit + support. + [Default: Netkit] enum: - TC - TCX + - Netkit type: string bpfCTLBLogFilter: description: |- @@ -76,6 +82,7 @@ spec: [Default: unset - means logs are emitted when BPFLogLevel id debug and BPFLogFilters not set.] type: string bpfConnectTimeLoadBalancing: + default: TCP description: |- BPFConnectTimeLoadBalancing when in BPF mode, controls whether Felix installs the connect-time load balancer. The connect-time load balancer is required for the host to be able to reach Kubernetes services @@ -249,6 +256,8 @@ spec: BPFExtToServiceConnmark in BPF mode, controls a 32bit mark that is set on connections from an external client to a local service. This mark allows us to control how packets of that connection are routed within the host and how is routing interpreted by RPF check. [Default: 0] + maximum: 4294967295 + minimum: 0 type: integer bpfExternalServiceMode: description: |- @@ -275,6 +284,7 @@ spec: workloads and services. [Default: true - bypass Linux conntrack] type: boolean bpfHostNetworkedNATWithoutCTLB: + default: Enabled description: |- BPFHostNetworkedNATWithoutCTLB when in BPF mode, controls whether Felix does a NAT without CTLB. This along with BPFConnectTimeLoadBalancing determines the CTLB behavior. [Default: Enabled] @@ -301,23 +311,21 @@ spec: packets from external sources are dropped. [Default: true] type: boolean bpfJITHardening: - allOf: - - enum: - - Auto - - Strict - - enum: - - Auto - - Strict description: |- BPFJITHardening controls BPF JIT hardening. When set to "Auto", Felix will set JIT hardening to 1 if it detects the current value is 2 (strict mode that hurts performance). When set to "Strict", Felix will not modify the JIT hardening setting. [Default: Auto] + enum: + - Auto + - Strict type: string bpfKubeProxyHealthzPort: description: |- BPFKubeProxyHealthzPort, in BPF mode, controls the port that Felix's embedded kube-proxy health check server binds to. The health check server is used by external load balancers to determine if this node should receive traffic. Set to 0 to disable the health check server. [Default: 10256] + maximum: 65535 + minimum: 0 type: integer bpfKubeProxyIptablesCleanupEnabled: description: |- @@ -366,6 +374,8 @@ spec: and thus the amount of memory reserved. [Default: 100] + maximum: 3000 + minimum: 1 type: integer bpfMaglevMaxServices: description: |- @@ -373,6 +383,8 @@ spec: services that Felix will allocate lookup-tables for. [Default: 100] + maximum: 3000 + minimum: 1 type: integer bpfMapSizeConntrack: description: |- @@ -434,6 +446,18 @@ spec: to hold one entry per workload and a handful of entries per host (enough to cover its own IPs and tunnel IPs). type: integer + bpfOverlayHostSourceIP: + description: |- + BPFOverlayHostSourceIP controls the source IP that Felix uses in BPF mode for host-networked + (node-originated) traffic egressing over an IPIP/VXLAN overlay tunnel. "TunnelAddress" (the default) + assigns an IP address to the overlay tunnel device and uses it as the source, preserving the behaviour + of clusters upgraded from earlier releases. "HostAddress" uses the node's own IP directly and does not + assign a tunnel device IP. This option has no effect on WireGuard tunnels, which always use a tunnel + device IP. [Default: TunnelAddress] + enum: + - TunnelAddress + - HostAddress + type: string bpfPSNATPorts: anyOf: - type: integer @@ -514,6 +538,8 @@ spec: description: |- DebugPort if set, enables Felix's debug HTTP port, which allows memory and CPU profiles to be retrieved. The debug port is not secure, it should not be exposed to the internet. + maximum: 65535 + minimum: 0 type: integer debugSimulateCalcGraphHangAfter: description: |- @@ -656,6 +682,7 @@ spec: pattern: ^([a-zA-Z0-9-_]+=([^=]+),)*([a-zA-Z0-9-_]+=([^=]+))?$ type: string floatingIPs: + default: Disabled description: |- FloatingIPs configures whether or not Felix will program non-OpenStack floating IP addresses. (OpenStack-derived floating IPs are always programmed, regardless of this setting.) @@ -897,11 +924,15 @@ spec: values mean lower priority. Elevated priority is used during VM live migration, and for optimal behaviour IPv4ElevatedRoutePriority must be less than IPv4NormalRoutePriority [Default: 512] + maximum: 2147483646 + minimum: 1 type: integer ipv4NormalRoutePriority: description: |- Route Priority value for a normal priority Calico-programmed IPv4 route. Note, higher values mean lower priority. [Default: 1024] + maximum: 2147483646 + minimum: 1 type: integer ipv6ElevatedRoutePriority: description: |- @@ -909,11 +940,15 @@ spec: values mean lower priority. Elevated priority is used during VM live migration, and for optimal behaviour IPv6ElevatedRoutePriority must be less than IPv6NormalRoutePriority [Default: 512] + maximum: 2147483646 + minimum: 1 type: integer ipv6NormalRoutePriority: description: |- Route Priority value for a normal priority Calico-programmed IPv6 route. Note, higher values mean lower priority. [Default: 1024] + maximum: 2147483646 + minimum: 1 type: integer ipv6Support: description: @@ -981,6 +1016,8 @@ spec: description: |- LogActionRateLimit sets the rate of hitting a Log action. The value must be in the format "N/unit", where N is a number and unit is one of: second, minute, hour, or day. For example: "10/second" or "100/hour". + When LogConnectionTransitions is enabled, this also bounds the follow-up logs: a connection whose + initial log was suppressed by this rate limit gets no follow-up log either. pattern: ^[1-9]\d{0,3}/(?:second|minute|hour|day)$ type: string logActionRateLimitBurst: @@ -990,6 +1027,35 @@ spec: maximum: 9999 minimum: 0 type: integer + logConnectionTransitions: + description: |- + LogConnectionTransitions controls whether Felix emits an additional kernel log recording the + first observed response for each connection that matched a policy rule with a Log action. + When set to FirstResponseAfterLog, each connection whose initial log was emitted gets one + follow-up log, prefixed with LogConnectionTransitionsPrefix plus a suffix identifying the + transition: "-est" when the first reply packet is seen, "-rst" when the response is a TCP + RST (connection refused), or "-icmp-err" when the response is a related ICMP error (e.g. + port unreachable). The log body is the standard kernel packet log of the response packet. + For "-est" and "-rst" its 5-tuple is the original policy Log line's with source and + destination swapped; for "-icmp-err" the bracketed inner header carries the original + 5-tuple unswapped. A logged connection with no follow-up log never received a response. + Connections whose initial log was suppressed by LogActionRateLimit get no follow-up log + either, so every follow-up log pairs with an initial one. Enabling this consumes one bit + from the Iptables/NftablesMarkMask space. Not supported in eBPF mode. + [Default: Disabled] + enum: + - Disabled + - FirstResponseAfterLog + type: string + logConnectionTransitionsPrefix: + description: |- + LogConnectionTransitionsPrefix is the log prefix used for the logs emitted when + LogConnectionTransitions is enabled; the transition suffix ("-est", "-rst" or "-icmp-err") + is appended to it. Unlike LogPrefix, it does not support %-specifiers (such as %p): the + rules that emit these logs are shared by all policies, so per-policy values cannot be + substituted and any %-specifiers are rendered literally. [Default: calico-response] + pattern: "^([a-zA-Z0-9%: /_-])*$" + type: string logDebugFilenameRegex: description: |- LogDebugFilenameRegex controls which source code files have their Debug log output included in the logs. @@ -1102,6 +1168,25 @@ spec: blocks traffic with a "drop" action. If you want to use a "reject" action instead you can configure it here. pattern: ^(?i)(Drop|Reject)?$ type: string + nftablesFlowTableDataIfacePattern: + description: |- + NFTablesFlowTableDataIfacePattern is a regular expression that controls which host + interfaces are added to the nftables flowtable, so that traffic forwarded between those + interfaces and local workloads is offloaded to the flowtable fast path. Leave empty to + offload only workload-to-workload traffic. Only takes effect when NFTablesFlowTableOffload + is not Disabled. [Default: ""] + type: string + nftablesFlowTableOffload: + default: Disabled + description: |- + NFTablesFlowTableOffload controls which traffic nftables flowtable offload is enabled for, + for improved forwarding performance. When set to "All", established connections accepted by + Calico policy are offloaded to the kernel's flowtable fast path. Only applies when + nftables mode is active. [Default: Disabled] + enum: + - All + - Disabled + type: string nftablesMangleAllowAction: description: |- NftablesMangleAllowAction controls the nftables action that Felix uses to represent the "allow" policy verdict @@ -1120,9 +1205,10 @@ spec: type: integer nftablesMode: default: Auto - description: - "NFTablesMode configures nftables support in Felix. [Default: - Auto]" + description: |- + NFTablesMode configures nftables support in Felix. In Auto mode, Felix uses the + nftables dataplane if kube-proxy is detected to be running in nftables mode. + [Default: Auto] enum: - Disabled - Enabled @@ -1163,13 +1249,33 @@ spec: type: string programClusterRoutes: description: |- - ProgramClusterRoutes controls how a cluster node gets a route to a workload on another node, - when that workload's IP comes from an IP Pool with vxlanMode: Never. When ProgramClusterRoutes is Disabled, - it is expected that confd and BIRD will program that route. When ProgramClusterRoutes is Enabled, Felix program that route. - Felix always programs such routes for IP Pools with vxlanMode: Always or vxlanMode: CrossSubnet. [Default: Disabled] + ProgramClusterRoutes controls which "cluster routes" Felix programs, i.e. the routes that + a node needs in order to reach workloads on other nodes. It only applies to IP Pools + with vxlanMode: Never; Felix always programs the cluster routes for IP Pools with + vxlanMode: Always or vxlanMode: CrossSubnet. The routes that Felix does not program here + are expected to be programmed by Calico's BGP stack instead. Below, an IPIP IP Pool is + one with ipipMode: Always or CrossSubnet, and an unencapsulated one has ipipMode and + vxlanMode both Never. + + - Disabled: Felix programs no cluster routes. + - EnabledIPIPOnly: Felix programs them for IPIP IP Pools. + - EnabledNoEncapOnly: Felix programs them for unencapsulated IP Pools. + - Enabled: Felix programs them for both. + + This field must be kept consistent with BGPConfiguration.ProgramClusterRoutes, which + makes the same choice from BIRD's side. If both Felix and BIRD are enabled for the same + kind of IP Pool they will fight over the routes; if neither is, there will be no cluster + routes at all. + + Note: leaving the IPIP cluster routes to BGP, which the Disabled and EnabledNoEncapOnly + values do, is deprecated as of v3.33 and will be removed in v3.35. + + [Default: EnabledIPIPOnly] enum: - Enabled - Disabled + - EnabledIPIPOnly + - EnabledNoEncapOnly type: string prometheusGoMetricsEnabled: description: |- @@ -1189,7 +1295,12 @@ spec: prometheusMetricsClientAuth: description: |- PrometheusMetricsClientAuth specifies the client authentication type for the /metrics endpoint. - This determines how the server validates client certificates. Default is "RequireAndVerifyClientCert". + This determines how the server validates client certificates. Default is "NoClientCert". + enum: + - RequireAndVerifyClientCert + - RequireAnyClientCert + - VerifyClientCertIfGiven + - NoClientCert type: string prometheusMetricsEnabled: description: @@ -1410,11 +1521,15 @@ spec: description: "WireguardListeningPort controls the listening port used by IPv4 Wireguard. [Default: 51820]" + maximum: 65535 + minimum: 1 type: integer wireguardListeningPortV6: description: "WireguardListeningPortV6 controls the listening port used by IPv6 Wireguard. [Default: 51821]" + maximum: 65535 + minimum: 1 type: integer wireguardMTU: description: @@ -1430,6 +1545,8 @@ spec: description: "WireguardRoutingRulePriority controls the priority value to use for the Wireguard routing rule. [Default: 99]" + maximum: 32765 + minimum: 1 type: integer wireguardThreadingEnabled: description: |- diff --git a/config/crd/projectcalico.org_globalnetworkpolicies.yaml b/config/crd/projectcalico.org_globalnetworkpolicies.yaml index 6db6a1c66..3b6563750 100644 --- a/config/crd/projectcalico.org_globalnetworkpolicies.yaml +++ b/config/crd/projectcalico.org_globalnetworkpolicies.yaml @@ -614,6 +614,22 @@ spec: (!has(self.notProtocol) || (self.notProtocol != 'ICMPv6' && self.notProtocol != 58)) || !has(self.ipVersion) || self.ipVersion == 6 + - message: + protocol must be a name (TCP, UDP, ICMP, ICMPv6, SCTP, + UDPLite) or a number in 1-255 + reason: FieldValueInvalid + rule: + "!has(self.protocol) || (type(self.protocol) == int ? self.protocol + >= 1 && self.protocol <= 255 : self.protocol in ['TCP', 'UDP', + 'ICMP', 'ICMPv6', 'SCTP', 'UDPLite'])" + - message: + protocol must be a name (TCP, UDP, ICMP, ICMPv6, SCTP, + UDPLite) or a number in 1-255 + reason: FieldValueInvalid + rule: + "!has(self.notProtocol) || (type(self.notProtocol) == int + ? self.notProtocol >= 1 && self.notProtocol <= 255 : self.notProtocol + in ['TCP', 'UDP', 'ICMP', 'ICMPv6', 'SCTP', 'UDPLite'])" maxItems: 1024 type: array x-kubernetes-list-type: atomic @@ -1170,6 +1186,22 @@ spec: (!has(self.notProtocol) || (self.notProtocol != 'ICMPv6' && self.notProtocol != 58)) || !has(self.ipVersion) || self.ipVersion == 6 + - message: + protocol must be a name (TCP, UDP, ICMP, ICMPv6, SCTP, + UDPLite) or a number in 1-255 + reason: FieldValueInvalid + rule: + "!has(self.protocol) || (type(self.protocol) == int ? self.protocol + >= 1 && self.protocol <= 255 : self.protocol in ['TCP', 'UDP', + 'ICMP', 'ICMPv6', 'SCTP', 'UDPLite'])" + - message: + protocol must be a name (TCP, UDP, ICMP, ICMPv6, SCTP, + UDPLite) or a number in 1-255 + reason: FieldValueInvalid + rule: + "!has(self.notProtocol) || (type(self.notProtocol) == int + ? self.notProtocol >= 1 && self.notProtocol <= 255 : self.notProtocol + in ['TCP', 'UDP', 'ICMP', 'ICMPv6', 'SCTP', 'UDPLite'])" maxItems: 1024 type: array x-kubernetes-list-type: atomic diff --git a/config/crd/projectcalico.org_globalnetworksets.yaml b/config/crd/projectcalico.org_globalnetworksets.yaml index 17717dc9b..c831236af 100644 --- a/config/crd/projectcalico.org_globalnetworksets.yaml +++ b/config/crd/projectcalico.org_globalnetworksets.yaml @@ -50,9 +50,15 @@ spec: The list of IP networks that belong to this set. Each entry must be in CIDR notation, e.g. "192.168.1.0/24". To include a single IP address, use a /32 (IPv4) or /128 (IPv6) mask. items: + maxLength: 49 type: string + maxItems: 100000 type: array x-kubernetes-list-type: set + x-kubernetes-validations: + - message: nets entries must be IP addresses or CIDRs + reason: FieldValueInvalid + rule: self.all(n, isCIDR(n) || isIP(n)) type: object required: - metadata diff --git a/config/crd/projectcalico.org_hostendpoints.yaml b/config/crd/projectcalico.org_hostendpoints.yaml index 176a83770..777da2200 100644 --- a/config/crd/projectcalico.org_hostendpoints.yaml +++ b/config/crd/projectcalico.org_hostendpoints.yaml @@ -112,6 +112,14 @@ spec: - port - protocol type: object + x-kubernetes-validations: + - message: + protocol must be one of TCP, UDP, SCTP, or their numbers + 6, 17, 132 + reason: FieldValueInvalid + rule: + "type(self.protocol) == int ? self.protocol in [6, 17, 132] + : self.protocol in ['TCP', 'UDP', 'SCTP']" type: array x-kubernetes-list-type: atomic profiles: diff --git a/config/crd/projectcalico.org_ippools.yaml b/config/crd/projectcalico.org_ippools.yaml index c08272845..57b78b609 100644 --- a/config/crd/projectcalico.org_ippools.yaml +++ b/config/crd/projectcalico.org_ippools.yaml @@ -93,8 +93,8 @@ spec: blockSize: description: |- The block size to use for IP address assignments from this pool. Defaults to 26 for IPv4 and 122 for IPv6. - The block size must be between 0 and 32 for IPv4 and between 0 and 128 for IPv6. It must also be smaller than - or equal to the size of the pool CIDR. + The block size must be between 20 and 32 for IPv4 and between 116 and 128 for IPv6. It must also be smaller + than or equal to the size of the pool CIDR. maximum: 128 minimum: 0 type: integer @@ -107,7 +107,7 @@ spec: cidr: description: The pool CIDR. format: cidr - maxLength: 48 + maxLength: 49 type: string x-kubernetes-validations: - message: @@ -126,6 +126,7 @@ spec: from this pool. type: boolean ipipMode: + default: Never description: |- Contains configuration for IPIP tunneling for this pool. For IPv6 pools, IPIP tunneling must be disabled. @@ -153,6 +154,7 @@ spec: maxLength: 1024 type: string vxlanMode: + default: Never description: Contains configuration for VXLAN tunneling for this pool. enum: - Never @@ -212,6 +214,33 @@ spec: - message: global() selector is not valid for IPPool namespaceSelector reason: FieldValueInvalid rule: "!has(self.namespaceSelector) || !self.namespaceSelector.contains('global(')" + - message: IPPool CIDR must be strictly masked + reason: FieldValueInvalid + rule: cidr(self.cidr) == cidr(self.cidr).masked() + - message: IPPool CIDR overlaps with IPv4 link local range 169.254.0.0/16 + reason: FieldValueInvalid + rule: + "!cidr('169.254.0.0/16').containsIP(cidr(self.cidr).ip()) && + !cidr(self.cidr).containsIP('169.254.0.0')" + - message: IPPool CIDR overlaps with IPv6 link local range fe80::/10 + reason: FieldValueInvalid + rule: "!cidr('fe80::/10').containsIP(cidr(self.cidr).ip()) && !cidr(self.cidr).containsIP('fe80::')" + - message: + blockSize must be between 20 and 32 for IPv4 pools, and between + 116 and 128 for IPv6 pools + reason: FieldValueInvalid + rule: + "!has(self.blockSize) || self.blockSize == 0 || (cidr(self.cidr).ip().family() + == 4 ? self.blockSize >= 20 && self.blockSize <= 32 : self.blockSize + >= 116 && self.blockSize <= 128)" + - message: + IP pool size is too small for use with Calico IPAM. It must + be equal to or greater than the block size. + reason: FieldValueInvalid + rule: + "(has(self.disabled) && self.disabled) || cidr(self.cidr).prefixLength() + <= (has(self.blockSize) && self.blockSize != 0 ? self.blockSize : + (cidr(self.cidr).ip().family() == 4 ? 26 : 122))" status: properties: conditions: diff --git a/config/crd/projectcalico.org_ipreservations.yaml b/config/crd/projectcalico.org_ipreservations.yaml index e4d2af0a7..42e4494bf 100644 --- a/config/crd/projectcalico.org_ipreservations.yaml +++ b/config/crd/projectcalico.org_ipreservations.yaml @@ -49,8 +49,8 @@ spec: description: |- ReservedCIDRs is a list of CIDRs that Calico IPAM will exclude from new allocations. Each entry must be in CIDR notation (e.g., "10.0.0.0/24" or "10.0.0.1/32" for a single IP). - format: cidr items: + format: cidr type: string type: array x-kubernetes-list-type: set diff --git a/config/crd/projectcalico.org_kubecontrollersconfigurations.yaml b/config/crd/projectcalico.org_kubecontrollersconfigurations.yaml index 3e8fd4a0b..8ae64ddd4 100644 --- a/config/crd/projectcalico.org_kubecontrollersconfigurations.yaml +++ b/config/crd/projectcalico.org_kubecontrollersconfigurations.yaml @@ -115,6 +115,13 @@ spec: AutoHostEndpoints items: properties: + annotations: + additionalProperties: + type: string + description: + Annotations adds the specified annotations + to the generated AutoHostEndpoint. + type: object generateName: description: GenerateName is appended to the end @@ -206,6 +213,17 @@ spec: type: string type: object type: object + debugProfileHost: + description: |- + DebugProfileHost is the host IP or hostname to bind the profiling port to. Set to "0.0.0.0" + for all interfaces to make profiles reachable from off-host. The profiling endpoints are + unauthenticated and expose heap dumps, goroutine stacks and CPU profiles, so prefer the + default and use kubectl port-forward for remote access. Only used if DebugProfilePort is set. + [Default: localhost] + maxLength: 64 + minLength: 1 + pattern: ^[a-zA-Z0-9:._+-]+$ + type: string debugProfilePort: description: |- DebugProfilePort configures the port to serve memory and cpu profiles on. If not specified, profiling @@ -243,6 +261,7 @@ spec: - Panic type: string prometheusMetricsPort: + default: 9094 description: |- PrometheusMetricsPort is the TCP port that the Prometheus metrics server should bind to. Set to 0 to disable. [Default: 9094] Valid values are: 0-65535. @@ -344,6 +363,13 @@ spec: AutoHostEndpoints items: properties: + annotations: + additionalProperties: + type: string + description: + Annotations adds the specified + annotations to the generated AutoHostEndpoint. + type: object generateName: description: GenerateName is appended to the @@ -439,6 +465,17 @@ spec: type: string type: object type: object + debugProfileHost: + description: |- + DebugProfileHost is the host IP or hostname to bind the profiling port to. Set to "0.0.0.0" + for all interfaces to make profiles reachable from off-host. The profiling endpoints are + unauthenticated and expose heap dumps, goroutine stacks and CPU profiles, so prefer the + default and use kubectl port-forward for remote access. Only used if DebugProfilePort is set. + [Default: localhost] + maxLength: 64 + minLength: 1 + pattern: ^[a-zA-Z0-9:._+-]+$ + type: string debugProfilePort: description: |- DebugProfilePort configures the port to serve memory and cpu profiles on. If not specified, profiling @@ -476,6 +513,7 @@ spec: - Panic type: string prometheusMetricsPort: + default: 9094 description: |- PrometheusMetricsPort is the TCP port that the Prometheus metrics server should bind to. Set to 0 to disable. [Default: 9094] Valid values are: 0-65535. diff --git a/config/crd/projectcalico.org_networkpolicies.yaml b/config/crd/projectcalico.org_networkpolicies.yaml index 0ab66e503..de9c19f91 100644 --- a/config/crd/projectcalico.org_networkpolicies.yaml +++ b/config/crd/projectcalico.org_networkpolicies.yaml @@ -599,6 +599,22 @@ spec: (!has(self.notProtocol) || (self.notProtocol != 'ICMPv6' && self.notProtocol != 58)) || !has(self.ipVersion) || self.ipVersion == 6 + - message: + protocol must be a name (TCP, UDP, ICMP, ICMPv6, SCTP, + UDPLite) or a number in 1-255 + reason: FieldValueInvalid + rule: + "!has(self.protocol) || (type(self.protocol) == int ? self.protocol + >= 1 && self.protocol <= 255 : self.protocol in ['TCP', 'UDP', + 'ICMP', 'ICMPv6', 'SCTP', 'UDPLite'])" + - message: + protocol must be a name (TCP, UDP, ICMP, ICMPv6, SCTP, + UDPLite) or a number in 1-255 + reason: FieldValueInvalid + rule: + "!has(self.notProtocol) || (type(self.notProtocol) == int + ? self.notProtocol >= 1 && self.notProtocol <= 255 : self.notProtocol + in ['TCP', 'UDP', 'ICMP', 'ICMPv6', 'SCTP', 'UDPLite'])" maxItems: 1024 type: array x-kubernetes-list-type: atomic @@ -1155,6 +1171,22 @@ spec: (!has(self.notProtocol) || (self.notProtocol != 'ICMPv6' && self.notProtocol != 58)) || !has(self.ipVersion) || self.ipVersion == 6 + - message: + protocol must be a name (TCP, UDP, ICMP, ICMPv6, SCTP, + UDPLite) or a number in 1-255 + reason: FieldValueInvalid + rule: + "!has(self.protocol) || (type(self.protocol) == int ? self.protocol + >= 1 && self.protocol <= 255 : self.protocol in ['TCP', 'UDP', + 'ICMP', 'ICMPv6', 'SCTP', 'UDPLite'])" + - message: + protocol must be a name (TCP, UDP, ICMP, ICMPv6, SCTP, + UDPLite) or a number in 1-255 + reason: FieldValueInvalid + rule: + "!has(self.notProtocol) || (type(self.notProtocol) == int + ? self.notProtocol >= 1 && self.notProtocol <= 255 : self.notProtocol + in ['TCP', 'UDP', 'ICMP', 'ICMPv6', 'SCTP', 'UDPLite'])" maxItems: 1024 type: array x-kubernetes-list-type: atomic diff --git a/config/crd/projectcalico.org_networksets.yaml b/config/crd/projectcalico.org_networksets.yaml index 5e561184a..fab326ae4 100644 --- a/config/crd/projectcalico.org_networksets.yaml +++ b/config/crd/projectcalico.org_networksets.yaml @@ -44,9 +44,15 @@ spec: The list of IP networks that belong to this set. Each entry must be in CIDR notation, e.g. "192.168.1.0/24". To include a single IP address, use a /32 (IPv4) or /128 (IPv6) mask. items: + maxLength: 49 type: string + maxItems: 100000 type: array x-kubernetes-list-type: set + x-kubernetes-validations: + - message: nets entries must be IP addresses or CIDRs + reason: FieldValueInvalid + rule: self.all(n, isCIDR(n) || isIP(n)) type: object required: - metadata diff --git a/config/crd/projectcalico.org_stagedglobalnetworkpolicies.yaml b/config/crd/projectcalico.org_stagedglobalnetworkpolicies.yaml index 0744bde5f..194a058fa 100644 --- a/config/crd/projectcalico.org_stagedglobalnetworkpolicies.yaml +++ b/config/crd/projectcalico.org_stagedglobalnetworkpolicies.yaml @@ -611,6 +611,22 @@ spec: (!has(self.notProtocol) || (self.notProtocol != 'ICMPv6' && self.notProtocol != 58)) || !has(self.ipVersion) || self.ipVersion == 6 + - message: + protocol must be a name (TCP, UDP, ICMP, ICMPv6, SCTP, + UDPLite) or a number in 1-255 + reason: FieldValueInvalid + rule: + "!has(self.protocol) || (type(self.protocol) == int ? self.protocol + >= 1 && self.protocol <= 255 : self.protocol in ['TCP', 'UDP', + 'ICMP', 'ICMPv6', 'SCTP', 'UDPLite'])" + - message: + protocol must be a name (TCP, UDP, ICMP, ICMPv6, SCTP, + UDPLite) or a number in 1-255 + reason: FieldValueInvalid + rule: + "!has(self.notProtocol) || (type(self.notProtocol) == int + ? self.notProtocol >= 1 && self.notProtocol <= 255 : self.notProtocol + in ['TCP', 'UDP', 'ICMP', 'ICMPv6', 'SCTP', 'UDPLite'])" maxItems: 1024 type: array x-kubernetes-list-type: atomic @@ -1167,6 +1183,22 @@ spec: (!has(self.notProtocol) || (self.notProtocol != 'ICMPv6' && self.notProtocol != 58)) || !has(self.ipVersion) || self.ipVersion == 6 + - message: + protocol must be a name (TCP, UDP, ICMP, ICMPv6, SCTP, + UDPLite) or a number in 1-255 + reason: FieldValueInvalid + rule: + "!has(self.protocol) || (type(self.protocol) == int ? self.protocol + >= 1 && self.protocol <= 255 : self.protocol in ['TCP', 'UDP', + 'ICMP', 'ICMPv6', 'SCTP', 'UDPLite'])" + - message: + protocol must be a name (TCP, UDP, ICMP, ICMPv6, SCTP, + UDPLite) or a number in 1-255 + reason: FieldValueInvalid + rule: + "!has(self.notProtocol) || (type(self.notProtocol) == int + ? self.notProtocol >= 1 && self.notProtocol <= 255 : self.notProtocol + in ['TCP', 'UDP', 'ICMP', 'ICMPv6', 'SCTP', 'UDPLite'])" maxItems: 1024 type: array x-kubernetes-list-type: atomic diff --git a/config/crd/projectcalico.org_stagednetworkpolicies.yaml b/config/crd/projectcalico.org_stagednetworkpolicies.yaml index 11eba2f2e..aa66ce68c 100644 --- a/config/crd/projectcalico.org_stagednetworkpolicies.yaml +++ b/config/crd/projectcalico.org_stagednetworkpolicies.yaml @@ -602,6 +602,22 @@ spec: (!has(self.notProtocol) || (self.notProtocol != 'ICMPv6' && self.notProtocol != 58)) || !has(self.ipVersion) || self.ipVersion == 6 + - message: + protocol must be a name (TCP, UDP, ICMP, ICMPv6, SCTP, + UDPLite) or a number in 1-255 + reason: FieldValueInvalid + rule: + "!has(self.protocol) || (type(self.protocol) == int ? self.protocol + >= 1 && self.protocol <= 255 : self.protocol in ['TCP', 'UDP', + 'ICMP', 'ICMPv6', 'SCTP', 'UDPLite'])" + - message: + protocol must be a name (TCP, UDP, ICMP, ICMPv6, SCTP, + UDPLite) or a number in 1-255 + reason: FieldValueInvalid + rule: + "!has(self.notProtocol) || (type(self.notProtocol) == int + ? self.notProtocol >= 1 && self.notProtocol <= 255 : self.notProtocol + in ['TCP', 'UDP', 'ICMP', 'ICMPv6', 'SCTP', 'UDPLite'])" maxItems: 1024 type: array x-kubernetes-list-type: atomic @@ -1158,6 +1174,22 @@ spec: (!has(self.notProtocol) || (self.notProtocol != 'ICMPv6' && self.notProtocol != 58)) || !has(self.ipVersion) || self.ipVersion == 6 + - message: + protocol must be a name (TCP, UDP, ICMP, ICMPv6, SCTP, + UDPLite) or a number in 1-255 + reason: FieldValueInvalid + rule: + "!has(self.protocol) || (type(self.protocol) == int ? self.protocol + >= 1 && self.protocol <= 255 : self.protocol in ['TCP', 'UDP', + 'ICMP', 'ICMPv6', 'SCTP', 'UDPLite'])" + - message: + protocol must be a name (TCP, UDP, ICMP, ICMPv6, SCTP, + UDPLite) or a number in 1-255 + reason: FieldValueInvalid + rule: + "!has(self.notProtocol) || (type(self.notProtocol) == int + ? self.notProtocol >= 1 && self.notProtocol <= 255 : self.notProtocol + in ['TCP', 'UDP', 'ICMP', 'ICMPv6', 'SCTP', 'UDPLite'])" maxItems: 1024 type: array x-kubernetes-list-type: atomic diff --git a/deps.txt b/deps.txt index 89a9e1756..564c037bb 100644 --- a/deps.txt +++ b/deps.txt @@ -1,21 +1,30 @@ !!! GENERATED FILE, DO NOT EDIT !!! Run 'make gen-deps-files' to regenerate. -go 1.26.4 +go 1.27.1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/emicklei/go-restful v2.15.0+incompatible github.com/emicklei/go-restful/v3 v3.13.0 -github.com/fxamacker/cbor/v2 v2.9.0 -github.com/go-logr/logr v1.4.3 -github.com/go-openapi/jsonpointer v0.22.4 -github.com/go-openapi/jsonreference v0.21.4 -github.com/go-openapi/swag v0.23.1 -github.com/google/gnostic-models v0.7.0 +github.com/fxamacker/cbor/v2 v2.9.2 +github.com/go-logr/logr v1.4.4 +github.com/go-openapi/jsonpointer v1.0.0 +github.com/go-openapi/jsonreference v1.0.0 +github.com/go-openapi/swag v0.27.1 +github.com/go-openapi/swag/cmdutils v0.27.1 +github.com/go-openapi/swag/conv v0.27.3 +github.com/go-openapi/swag/fileutils v0.27.3 +github.com/go-openapi/swag/jsonutils v0.27.3 +github.com/go-openapi/swag/loading v0.27.3 +github.com/go-openapi/swag/mangling v0.27.3 +github.com/go-openapi/swag/netutils v0.27.1 +github.com/go-openapi/swag/pools v0.27.3 +github.com/go-openapi/swag/stringutils v0.27.3 +github.com/go-openapi/swag/typeutils v0.27.3 +github.com/go-openapi/swag/yamlutils v0.27.3 +github.com/google/gnostic-models v0.7.1 github.com/google/uuid v1.6.0 github.com/jinzhu/copier v0.4.0 -github.com/josharian/intern v1.0.0 github.com/json-iterator/go v1.1.12 -github.com/mailru/easyjson v0.9.1 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 @@ -25,27 +34,26 @@ github.com/spf13/pflag v1.0.10 github.com/x448/float16 v0.8.4 go.yaml.in/yaml/v2 v2.4.4 go.yaml.in/yaml/v3 v3.0.4 -golang.org/x/net v0.56.0 +golang.org/x/net v0.58.0 golang.org/x/oauth2 v0.36.0 -golang.org/x/sys v0.46.0 -golang.org/x/term v0.44.0 -golang.org/x/text v0.38.0 +golang.org/x/sys v0.47.0 +golang.org/x/term v0.45.0 +golang.org/x/text v0.41.0 golang.org/x/time v0.15.0 google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af gopkg.in/evanphx/json-patch.v4 v4.13.0 gopkg.in/inf.v0 v0.9.1 -gopkg.in/yaml.v3 v3.0.1 -k8s.io/api v0.36.2 -k8s.io/apiextensions-apiserver v0.36.2 -k8s.io/apimachinery v0.36.2 -k8s.io/client-go v0.36.2 +k8s.io/api v0.37.0 +k8s.io/apiextensions-apiserver v0.37.0 +k8s.io/apimachinery v0.37.0 +k8s.io/client-go v0.37.0 k8s.io/klog v0.2.0 k8s.io/klog/v2 v2.140.0 -k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a -k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2 +k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad +k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3 sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 sigs.k8s.io/randfill v1.0.0 -sigs.k8s.io/structured-merge-diff/v6 v6.4.0 +sigs.k8s.io/structured-merge-diff/v6 v6.4.2 sigs.k8s.io/yaml v1.6.0 local:api/examples/list-gnp diff --git a/go.mod b/go.mod index 0f356c510..6c28db90d 100644 --- a/go.mod +++ b/go.mod @@ -1,17 +1,17 @@ module github.com/projectcalico/api -go 1.26.4 +go 1.27.1 require ( github.com/jinzhu/copier v0.4.0 - github.com/onsi/ginkgo/v2 v2.31.0 - github.com/onsi/gomega v1.42.0 - k8s.io/api v0.36.2 - k8s.io/apiextensions-apiserver v0.36.2 - k8s.io/apimachinery v0.36.2 - k8s.io/client-go v0.36.2 - k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a - sigs.k8s.io/structured-merge-diff/v6 v6.4.0 + github.com/onsi/ginkgo/v2 v2.32.1 + github.com/onsi/gomega v1.42.1 + k8s.io/api v0.37.0 + k8s.io/apiextensions-apiserver v0.37.0 + k8s.io/apimachinery v0.37.0 + k8s.io/client-go v0.37.0 + k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad + sigs.k8s.io/structured-merge-diff/v6 v6.4.2 sigs.k8s.io/yaml v1.6.0 ) @@ -19,69 +19,77 @@ require ( github.com/Masterminds/semver/v3 v3.4.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/go-restful/v3 v3.13.0 // indirect - github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/fxamacker/cbor/v2 v2.9.1 // indirect github.com/go-logr/logr v1.4.3 // indirect - github.com/go-openapi/jsonpointer v0.21.0 // indirect - github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/swag v0.23.0 // indirect + github.com/go-openapi/jsonpointer v1.0.0 // indirect + github.com/go-openapi/jsonreference v1.0.0 // indirect + github.com/go-openapi/swag v0.27.1 // indirect + github.com/go-openapi/swag/cmdutils v0.27.1 // indirect + github.com/go-openapi/swag/conv v0.27.1 // indirect + github.com/go-openapi/swag/fileutils v0.27.1 // indirect + github.com/go-openapi/swag/jsonutils v0.27.1 // indirect + github.com/go-openapi/swag/loading v0.27.1 // indirect + github.com/go-openapi/swag/mangling v0.27.1 // indirect + github.com/go-openapi/swag/netutils v0.27.1 // indirect + github.com/go-openapi/swag/pools v0.27.1 // indirect + github.com/go-openapi/swag/stringutils v0.27.1 // indirect + github.com/go-openapi/swag/typeutils v0.27.1 // indirect + github.com/go-openapi/swag/yamlutils v0.27.1 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/google/gnostic-models v0.7.0 // indirect github.com/google/go-cmp v0.7.0 // indirect github.com/google/pprof v0.0.0-20260402051712-545e8a4df936 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/mailru/easyjson v0.7.7 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/spf13/pflag v1.0.9 // indirect + github.com/spf13/pflag v1.0.10 // indirect github.com/x448/float16 v0.8.4 // indirect - go.yaml.in/yaml/v2 v2.4.3 // indirect + go.yaml.in/yaml/v2 v2.4.4 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/mod v0.37.0 // indirect - golang.org/x/net v0.56.0 // indirect + golang.org/x/mod v0.40.0 // indirect + golang.org/x/net v0.58.0 // indirect golang.org/x/oauth2 v0.36.0 // indirect - golang.org/x/sync v0.21.0 // indirect - golang.org/x/sys v0.46.0 // indirect - golang.org/x/term v0.44.0 // indirect - golang.org/x/text v0.38.0 // indirect + golang.org/x/sync v0.22.0 // indirect + golang.org/x/sys v0.47.0 // indirect + golang.org/x/term v0.45.0 // indirect + golang.org/x/text v0.41.0 // indirect golang.org/x/time v0.15.0 // indirect - golang.org/x/tools v0.47.0 // indirect + golang.org/x/tools v0.49.0 // indirect google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/klog/v2 v2.140.0 // indirect - k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2 // indirect + k8s.io/utils v0.0.0-20260626114624-be93311217bd // indirect sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect sigs.k8s.io/randfill v1.0.0 // indirect ) replace ( - k8s.io/api => k8s.io/api v0.36.2 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.36.2 - k8s.io/apimachinery => k8s.io/apimachinery v0.36.2 - k8s.io/apiserver => k8s.io/apiserver v0.36.2 - k8s.io/cli-runtime => k8s.io/cli-runtime v0.36.2 - k8s.io/client-go => k8s.io/client-go v0.36.2 - k8s.io/cloud-provider => k8s.io/cloud-provider v0.36.2 - k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.36.2 - k8s.io/code-generator => k8s.io/code-generator v0.36.2 - k8s.io/component-base => k8s.io/component-base v0.36.2 - k8s.io/component-helpers => k8s.io/component-helpers v0.36.2 - k8s.io/controller-manager => k8s.io/controller-manager v0.36.2 - k8s.io/cri-api => k8s.io/cri-api v0.36.2 - k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.36.2 - k8s.io/externaljwt => k8s.io/externaljwt v0.36.2 - k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.36.2 - k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.36.2 - k8s.io/kube-proxy => k8s.io/kube-proxy v0.36.2 - k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.36.2 - k8s.io/kubectl => k8s.io/kubectl v0.36.2 - k8s.io/kubelet => k8s.io/kubelet v0.36.2 - k8s.io/metrics => k8s.io/metrics v0.36.2 - k8s.io/mount-utils => k8s.io/mount-utils v0.36.2 - k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.36.2 + k8s.io/api => k8s.io/api v0.37.0 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.37.0 + k8s.io/apimachinery => k8s.io/apimachinery v0.37.0 + k8s.io/apiserver => k8s.io/apiserver v0.37.0 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.37.0 + k8s.io/client-go => k8s.io/client-go v0.37.0 + k8s.io/cloud-provider => k8s.io/cloud-provider v0.37.0 + k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.37.0 + k8s.io/code-generator => k8s.io/code-generator v0.37.0 + k8s.io/component-base => k8s.io/component-base v0.37.0 + k8s.io/component-helpers => k8s.io/component-helpers v0.37.0 + k8s.io/controller-manager => k8s.io/controller-manager v0.37.0 + k8s.io/cri-api => k8s.io/cri-api v0.37.0 + k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.37.0 + k8s.io/externaljwt => k8s.io/externaljwt v0.37.0 + k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.37.0 + k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.37.0 + k8s.io/kube-proxy => k8s.io/kube-proxy v0.37.0 + k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.37.0 + k8s.io/kubectl => k8s.io/kubectl v0.37.0 + k8s.io/kubelet => k8s.io/kubelet v0.37.0 + k8s.io/metrics => k8s.io/metrics v0.37.0 + k8s.io/mount-utils => k8s.io/mount-utils v0.37.0 + k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.37.0 ) diff --git a/go.sum b/go.sum index 15c44919b..694425b01 100644 --- a/go.sum +++ b/go.sum @@ -1,14 +1,13 @@ github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= -github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/fxamacker/cbor/v2 v2.9.1 h1:2rWm8B193Ll4VdjsJY28jxs70IdDsHRWgQYAI80+rMQ= +github.com/fxamacker/cbor/v2 v2.9.1/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= github.com/gkampitakis/ciinfo v0.3.2 h1:JcuOPk8ZU7nZQjdUhctuhQofk7BGHuIy0c9Ez8BNhXs= github.com/gkampitakis/ciinfo v0.3.2/go.mod h1:1NIwaOcFChN4fa/B0hEBdAb6npDlFL8Bwx4dfRLRqAo= github.com/gkampitakis/go-diff v1.3.2 h1:Qyn0J9XJSDTgnsgHRdz9Zp24RaJeKMUHg2+PDZZdC4M= @@ -17,14 +16,40 @@ github.com/gkampitakis/go-snaps v0.5.15 h1:amyJrvM1D33cPHwVrjo9jQxX8g/7E2wYdZ+01 github.com/gkampitakis/go-snaps v0.5.15/go.mod h1:HNpx/9GoKisdhw9AFOBT1N7DBs9DiHo/hGheFGBZ+mc= github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= -github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= -github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= -github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= -github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-openapi/jsonpointer v1.0.0 h1:kR9tHqY0CtZaOPVFm622dPVNhrvYpwr4uCxgL3h1H8s= +github.com/go-openapi/jsonpointer v1.0.0/go.mod h1:Z3rw7dWu1p9IgitXCFamSlA5lmDiklEB6vkaxcNZW5Y= +github.com/go-openapi/jsonreference v1.0.0 h1:jlmTr6torcd1YgDQvSfNmRtKzYDO4FGBkrAdlAVWnpY= +github.com/go-openapi/jsonreference v1.0.0/go.mod h1:jtwdyGbJk0Xhe5Y+rwtglQP6Sb1WZST4rT32LWB+sv0= +github.com/go-openapi/swag v0.27.1 h1:VotvOLWW8q/EAxB0YdsBBGC8XYyeL1YwBj2ungAGPNg= +github.com/go-openapi/swag v0.27.1/go.mod h1:GTkJPwHfhJp6MWr4/rCh64HVI3Ofu+tcsbfjfHmTxpE= +github.com/go-openapi/swag/cmdutils v0.27.1 h1:I7sYqaWVl5mq0NEmNQkAmFDyNin9ufvMX/p2zwtQaOE= +github.com/go-openapi/swag/cmdutils v0.27.1/go.mod h1:Sm1MVFMkF6guJJ+pQqHnQA3N0j9qALV3NxzDSv6bETM= +github.com/go-openapi/swag/conv v0.27.1 h1:8wi9ZG+olmY1wXphl93EWniPtbSPkXM/feH7FgjsvrU= +github.com/go-openapi/swag/conv v0.27.1/go.mod h1:QbqMivkpKhC3g1B1GGGOJ6ANewI3S62dbzYu3Duowqs= +github.com/go-openapi/swag/fileutils v0.27.1 h1:QQqBSoi5mW4XpU85nS0mLcA+zAE6vLzrb0QkmLKf9oM= +github.com/go-openapi/swag/fileutils v0.27.1/go.mod h1:VvJFZLTZS0AI854gEQz5tk7dBESdLjiNUMSZ/th2ry8= +github.com/go-openapi/swag/jsonutils v0.27.1 h1:SVgK3i4USzCU5mibOOS/l4ea2h9UQXy7J7RNLTjuXjU= +github.com/go-openapi/swag/jsonutils v0.27.1/go.mod h1:tdlEpZqdcQ17uj6J4YdK9vd8It5qWMwjWXOs0tjpRlk= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.27.1 h1:mJu3COL9WEaZVp/Kf2PRMi7tPszPEJfSr/OO75ynCs8= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.27.1/go.mod h1:mofwUWx70wvskwESqRJ//k/9kURmCgyJl5m5Ppoh5kY= +github.com/go-openapi/swag/loading v0.27.1 h1:/DxUgDXKbBX4bcn7r9uEXfJyzN5XpiJmZplzQTjrRCY= +github.com/go-openapi/swag/loading v0.27.1/go.mod h1:jvGh3iA2+zyUUycB5fgJWzeHnhrpvGnJJM0RVE9ZShE= +github.com/go-openapi/swag/mangling v0.27.1 h1:yC9D0HyUE8gbP+BfmGx9+AA89ikwZTMjESK3OnnoaqA= +github.com/go-openapi/swag/mangling v0.27.1/go.mod h1:jtBE2+V+3pILxOR7Vgce+Cwp6A2PgZbvVqfNntbVs0w= +github.com/go-openapi/swag/netutils v0.27.1 h1:mICMFoS82F5TZ4Zy3cqmcQk+BFeCp3Uyq3Np7GI0/qU= +github.com/go-openapi/swag/netutils v0.27.1/go.mod h1:J+WYyFMLtvtCGqa6jLv+YNUmIKI3ZRQRrvfNDMoQoEQ= +github.com/go-openapi/swag/pools v0.27.1 h1:9LeadcMyb2GJCbXX5hVQDbZ2Lq9TL4dCs/nx1j5DO0E= +github.com/go-openapi/swag/pools v0.27.1/go.mod h1:kVQefhSK5RWuRe7BXsL8htgBPAMpN7HDGpGEknqugeE= +github.com/go-openapi/swag/stringutils v0.27.1 h1:ZXePZ0r2p1qSjo8tD3Un4vFj8+FqlCkczxDrJIhYUp8= +github.com/go-openapi/swag/stringutils v0.27.1/go.mod h1:lzRN95CxXmA03XcDWHLOb6nOMcxCqR5rGY0lOgsfRoM= +github.com/go-openapi/swag/typeutils v0.27.1 h1:KSTdFlfnse4r6dP9IrEnwMldjE+zs71UeEB3//PtVXc= +github.com/go-openapi/swag/typeutils v0.27.1/go.mod h1:Srm0xFNRZ1Y+vCxJclo5qzx8aj+1pAKda/YfFPrG0dQ= +github.com/go-openapi/swag/yamlutils v0.27.1 h1:ftxv6xvXb1E3zohUc+okZ9nSqNb9StQX/FXnKZ98sQA= +github.com/go-openapi/swag/yamlutils v0.27.1/go.mod h1:bnxFIB1qewGRiZHypXGZ3fNgf13/0HfRgnS/iZBDrOo= +github.com/go-openapi/testify/enable/yaml/v2 v2.6.0 h1:gGHwAJ0R/5jU8BEGDbfRNR3hL68dAVi84WuOApp29B0= +github.com/go-openapi/testify/enable/yaml/v2 v2.6.0/go.mod h1:tY+St1SGq4NFl0QIqdTY4aEdbChAHxhyB77XQi9iJCo= +github.com/go-openapi/testify/v2 v2.6.0 h1:5PKH2HE7YJ/LuRPQGvSxBRlFXNQhSetBLlGAgUEu3ug= +github.com/go-openapi/testify/v2 v2.6.0/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw= @@ -40,21 +65,14 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8= github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/joshdk/go-junit v1.0.0 h1:S86cUKIdwBHWwA6xCmFlf3RTLfVXYQfvanM5Uh+K6GE= github.com/joshdk/go-junit v1.0.0/go.mod h1:TiiV0PqkaNfFXjEiyjWM3XXrhVyCa1K4Zfga6W52ung= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo= github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg= github.com/mfridman/tparse v0.18.0 h1:wh6dzOKaIwkUGyKgOntDW4liXSo37qg5AXbIhkMV3vE= @@ -67,26 +85,21 @@ github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFd github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/onsi/ginkgo/v2 v2.31.0 h1:GtuJos5DFUV9EerYJo8RhYxosYNGvOdDE5haKq6Grfs= -github.com/onsi/ginkgo/v2 v2.31.0/go.mod h1:+aXOY+vzZ5mu2iI2HpTZUPmM//oQfsNFX6gU9kNcA44= -github.com/onsi/gomega v1.42.0 h1:CJby8u36xb7v34W78F8WKvqTQP7PCMIPB78IVDB73l4= -github.com/onsi/gomega v1.42.0/go.mod h1:M/Uqpu/8qTjtzCLUA2zJHX9Iilrau25x1PdoSRbWh5A= +github.com/onsi/ginkgo/v2 v2.32.1 h1:6tlvcDm/3sE8lGJbZ4+d4mO3RLy24/tQWOFzVSQNIfw= +github.com/onsi/ginkgo/v2 v2.32.1/go.mod h1:+aXOY+vzZ5mu2iI2HpTZUPmM//oQfsNFX6gU9kNcA44= +github.com/onsi/gomega v1.42.1 h1:iN1rCUX+44NZ1Dc97MPoeFYbFR0vh8zxoxMFwKdyZ6I= +github.com/onsi/gomega v1.42.1/go.mod h1:REff/hsDsodHoKlWsP2mAPhu1+5/6hVYNf9rIEBpeSg= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= -github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY= -github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= +github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4= +github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= @@ -101,28 +114,28 @@ github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= -go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= +go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ= +go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= -golang.org/x/mod v0.37.0 h1:vF1DjpVEshcIqoEaauuHebaLk1O1forxjxBaVn884JQ= -golang.org/x/mod v0.37.0/go.mod h1:m8S8VeM9r4dzDwjrKO0a1sZP3YjeMamRRlD+fmR2Q/0= -golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o= -golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec= +golang.org/x/mod v0.40.0 h1:hUv+3cXcdRHz08UmSiOob7sadHig73uo5bkXxQ/tvUs= +golang.org/x/mod v0.40.0/go.mod h1:0/weTWkPWGBikyTWAX3dkjVztMmBA5hM0DH6BElSupE= +golang.org/x/net v0.58.0 h1:ynWG7rqYi4ccpTEuPZ2QGWHktVEM9DMCj9yzDE0Q7To= +golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= -golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM= -golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= -golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= -golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/term v0.44.0 h1:0rLvDRCtNj0gZkyIXhCyOb2OAzEhLVqc4B+hrsBhrmc= -golang.org/x/term v0.44.0/go.mod h1:7ze4MdzUzLXpSAoFP1H0bOI9aXDqveSvatT5vKcFh2Y= -golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE= -golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4= +golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= +golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= +golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0= +golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w= +golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8= +golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M= golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= -golang.org/x/tools v0.47.0 h1:7Kn5x/d1svx/PzryTsqeoZN4TZwqeH5pGWjefhLi/1Q= -golang.org/x/tools v0.47.0/go.mod h1:dFHnyTvFWY212G+h7ZY4Vsp/K3U4/7W9TyVaAul8uCA= +golang.org/x/tools v0.49.0 h1:3NI7VXzL9+1WZD52Dx2ttoPwD5DWrFGpl9mFZDlmisI= +golang.org/x/tools v0.49.0/go.mod h1:SJNXV9DBKT0UbdttsQjbfJlAE/q+y36++zo3uL3N0Oo= google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af h1:+5/Sw3GsDNlEmu7TfklWKPdQ0Ykja5VEmq2i817+jbI= google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -132,28 +145,27 @@ gopkg.in/evanphx/json-patch.v4 v4.13.0 h1:czT3CmqEaQ1aanPc5SdlgQrrEIb8w/wwCvWWnf gopkg.in/evanphx/json-patch.v4 v4.13.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.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.36.2 h1:TF6YDLIzKfccK7cq9YpTcGX8TJmEkHVRv78DM51fRYY= -k8s.io/api v0.36.2/go.mod h1:F4LbMO4brjZYh7yFkXWhynSvtB7YauxV4c+HHkNRGNg= -k8s.io/apiextensions-apiserver v0.36.2 h1:3O5gqOj/dt2XWWbpMe+TXWpE9yU6pjM/tXxtHHJT/K4= -k8s.io/apiextensions-apiserver v0.36.2/go.mod h1:cL1tBWe8XSaP1H30iWKGo7hf6iAUUUJPEU70dskmAnA= -k8s.io/apimachinery v0.36.2 h1:0PE/W/WNy1UX61NLbXY5TMbJ6UwLL6E6lAPkYrKFxbQ= -k8s.io/apimachinery v0.36.2/go.mod h1:fvf/HOLXq9RId0rnDIbN1OEBvHXdQbLMM8nu0LcBUf4= -k8s.io/client-go v0.36.2 h1:bfgxmFKc9CgqsgX4xKLAAdmTQlWee7Ob/HlDOrJ5TBI= -k8s.io/client-go v0.36.2/go.mod h1:1vgO4OAlfPnoLcb+Rze2GF5rAr14w8qjrYMoyXJzQj0= +k8s.io/api v0.37.0 h1:Z//Vj9N7RA/yS2sDmxyeo7h+RR4zbUrd2vrd3Z0TbB4= +k8s.io/api v0.37.0/go.mod h1:LKXgcJWMc+f4OLbP5SFR8rulEg07zZhpi/zMULiBImk= +k8s.io/apiextensions-apiserver v0.37.0 h1:zRMQ3+/LIE5oZ0tVvXwYHC+dIkSP5cjNWju7AZU1LOI= +k8s.io/apiextensions-apiserver v0.37.0/go.mod h1:HU0PfSBwchHL5iDau6jjt9zU6ryWkDDlaVUiq91NK80= +k8s.io/apimachinery v0.37.0 h1:Np2AbDtf8x6RDHiD8T9LbKJ9gaegeVNa8yNm5FuGKm0= +k8s.io/apimachinery v0.37.0/go.mod h1:RN3nhprFSCxOi5Selxd7oMTXOe/c+ZbcE7Im+TS2zkE= +k8s.io/client-go v0.37.0 h1:nsN31fy8wBySuZ+QRnKmrjRSQLOG2rvoGN0tKd12zhQ= +k8s.io/client-go v0.37.0/go.mod h1:FcGqw+Ll/gNQiq+nPGY1Oyt9y7SgDh1d3MW3RFDEbn0= k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc= k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0= -k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a h1:xCeOEAOoGYl2jnJoHkC3hkbPJgdATINPMAxaynU2Ovg= -k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a/go.mod h1:uGBT7iTA6c6MvqUvSXIaYZo9ukscABYi2btjhvgKGZ0= -k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2 h1:AZYQSJemyQB5eRxqcPky+/7EdBj0xi3g0ZcxxJ7vbWU= -k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= +k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad h1:oXImqH8mQNk7PmvzKhmN3ddJoY6OnyM225MXwGHPm0A= +k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad/go.mod h1:0/mqHCVhlumdJ3BhCfnjSZQE037nAhNodh1/hK0T8/I= +k8s.io/utils v0.0.0-20260626114624-be93311217bd h1:Ea7fgQ5we8Y9T0OX5o0dAHzQOBRI07D/dEYRaB9ZZEs= +k8s.io/utils v0.0.0-20260626114624-be93311217bd/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= -sigs.k8s.io/structured-merge-diff/v6 v6.4.0 h1:qmp2e3ZfFi1/jJbDGpD4mt3wyp6PE1NfKHCYLqgNQJo= -sigs.k8s.io/structured-merge-diff/v6 v6.4.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= +sigs.k8s.io/structured-merge-diff/v6 v6.4.2 h1:qdOxHwrl2Kaag1aQEarlYcOA9vSyGCp3CIki3aW8c4Q= +sigs.k8s.io/structured-merge-diff/v6 v6.4.2/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/hack/openapi-violations-known.list b/hack/openapi-violations-known.list index 259361c74..871df99d6 100644 --- a/hack/openapi-violations-known.list +++ b/hack/openapi-violations-known.list @@ -14,6 +14,8 @@ API rule violation: names_match,github.com/projectcalico/api/pkg/apis/projectcal API rule violation: names_match,github.com/projectcalico/api/pkg/apis/projectcalico/v3,FelixConfigurationSpec,IPv6ElevatedRoutePriority API rule violation: names_match,github.com/projectcalico/api/pkg/apis/projectcalico/v3,FelixConfigurationSpec,IPv6NormalRoutePriority API rule violation: names_match,github.com/projectcalico/api/pkg/apis/projectcalico/v3,FelixConfigurationSpec,IPv6Support +API rule violation: names_match,github.com/projectcalico/api/pkg/apis/projectcalico/v3,FelixConfigurationSpec,NFTablesFlowTableDataIfacePattern +API rule violation: names_match,github.com/projectcalico/api/pkg/apis/projectcalico/v3,FelixConfigurationSpec,NFTablesFlowTableOffload API rule violation: names_match,github.com/projectcalico/api/pkg/apis/projectcalico/v3,FelixConfigurationSpec,NFTablesMode API rule violation: names_match,github.com/projectcalico/api/pkg/apis/projectcalico/v3,FelixConfigurationSpec,WireguardPersistentKeepAlive API rule violation: names_match,github.com/projectcalico/api/pkg/apis/projectcalico/v3,IPAMBlockSpec,DeprecatedStrictAffinity diff --git a/lib.Makefile b/lib.Makefile index 14e68c4cf..577fe5668 100644 --- a/lib.Makefile +++ b/lib.Makefile @@ -262,6 +262,11 @@ BUILD_ID:=$(shell git rev-parse HEAD || uuidgen | sed 's/-//g') GIT_DESCRIPTION=$(shell git describe --tags --dirty --always --abbrev=12 || echo '') endif +# cd-common publishes every image at BRANCH_NAME, so that is the tag a build which names +# no version of its own can pull. CI exports it; fall back to the checked-out branch, or +# for a PR to its base, which is what SEMAPHORE_GIT_BRANCH holds. +BRANCH_IMAGE_TAG ?= $(if $(BRANCH_NAME),$(BRANCH_NAME),$(if $(SEMAPHORE_GIT_BRANCH),$(SEMAPHORE_GIT_BRANCH),$(shell git rev-parse --abbrev-ref HEAD 2>/dev/null))) + # Calculate a timestamp for any build artifacts. ifneq ($(OS),Windows_NT) DATE:=$(shell date -u +'%FT%T%z') @@ -319,6 +324,13 @@ EXTRA_DOCKER_ARGS += -v $(GOMOD_CACHE):/go/pkg/mod:rw # DOCKER_CPUSET_CPUS=0-3 Pin container to specific cores (true affinity). # GOMAXPROCS=N Cap goroutine parallelism inside each go invocation # (linker, vet, etc.); complements -p=N from GOFLAGS. +# DOCKER_MEMORY=8g Hard cap on container memory. The kernel OOM-kills +# the container at this limit, so a runaway compile or +# link fails the build ("signal: killed") rather than +# driving the whole host into swap thrash. +# DOCKER_MEMORY_SWAP=8g Cap on memory+swap combined (requires DOCKER_MEMORY). +# Must be >= DOCKER_MEMORY or -1; defaults to DOCKER_MEMORY +# (denies container swap entirely, keeps it off host swap). ifneq ($(DOCKER_CPUS),) EXTRA_DOCKER_ARGS += --cpus=$(DOCKER_CPUS) endif @@ -328,6 +340,9 @@ endif ifneq ($(GOMAXPROCS),) EXTRA_DOCKER_ARGS += -e GOMAXPROCS=$(GOMAXPROCS) endif +ifneq ($(DOCKER_MEMORY),) +EXTRA_DOCKER_ARGS += --memory=$(DOCKER_MEMORY) --memory-swap=$(if $(DOCKER_MEMORY_SWAP),$(DOCKER_MEMORY_SWAP),$(DOCKER_MEMORY)) +endif # Define go architecture flags GOARCH_FLAGS :=-e GOARCH=$(ARCH) @@ -398,13 +413,36 @@ DOCKER_BUILD=docker buildx build --load --platform=linux/$(ARCH) $(DOCKER_PULL) --build-arg GIT_VERSION=$(GIT_VERSION) \ --build-arg UBI_IMAGE=$(UBI_IMAGE) -DOCKER_RUN_PRIV_NET := mkdir -p $(REPO_ROOT)/.go-pkg-cache bin $(GOMOD_CACHE) && \ +# Fail a clone that needs credentials instead of blocking on git's terminal +# prompt, which hangs a CI job until the pipeline timeout. +export GIT_TERMINAL_PROMPT ?= 0 + +fetch_file = $(REPO_ROOT)/hack/fetch-file $(1) $(2) +fetch_repo = $(REPO_ROOT)/hack/fetch-repo $(1) $(2) $(3) + +DEFAULT_GO_CACHE_PATH := $(REPO_ROOT)/.go-pkg-cache +GOENV_GOCACHE := $(strip $(shell go env GOCACHE 2>/dev/null)) + +# Mount source for the Go build cache, first match wins: +# 1. LOCAL_GO_PKG_CACHE from the environment +# 2. GOCACHE, when the Go tools resolve it to an absolute path (it is either +# that or the literal "off"; a relative path would make docker -v fail) +# 3. the repo-local .go-pkg-cache +# +# override, not ?=: `LOCAL_GO_PKG_CACHE= make ...` to opt out leaves the +# variable defined-but-empty, which ?= keeps, yielding `docker run -v :/go-cache`. +ifeq ($(strip $(LOCAL_GO_PKG_CACHE)),) +override LOCAL_GO_PKG_CACHE := $(or $(filter /%,$(GOENV_GOCACHE)),$(DEFAULT_GO_CACHE_PATH)) +endif + +DOCKER_RUN_PRIV_NET := mkdir -p $(LOCAL_GO_PKG_CACHE) bin $(GOMOD_CACHE) && \ docker run --rm \ --init \ $(EXTRA_DOCKER_ARGS) \ $(DOCKER_GIT_WORKTREE_ARGS) \ -e LOCAL_USER_ID=$(LOCAL_USER_ID) \ -e GOCACHE=/go-cache \ + -e GIT_TERMINAL_PROMPT=$(GIT_TERMINAL_PROMPT) \ $(GOARCH_FLAGS) \ -e GOPATH=/go \ -e OS=$(BUILDOS) \ @@ -412,7 +450,7 @@ DOCKER_RUN_PRIV_NET := mkdir -p $(REPO_ROOT)/.go-pkg-cache bin $(GOMOD_CACHE) && -e CALICO_API_GROUP=$(CALICO_API_GROUP) \ -e "GOFLAGS=$(GOFLAGS)" \ -v $(REPO_ROOT):/go/src/github.com/projectcalico/calico:rw \ - -v $(REPO_ROOT)/.go-pkg-cache:/go-cache:rw \ + -v $(LOCAL_GO_PKG_CACHE):/go-cache:rw \ -w /go/src/$(PACKAGE_NAME) DOCKER_RUN := $(DOCKER_RUN_PRIV_NET) --net=host @@ -454,30 +492,41 @@ endif CONTROLLER_TOOLS_VERSION := $(shell sed -n 's/^VERSION="\(v[0-9][0-9.]*\)".*/\1/p' $(REPO_ROOT)/hack/cmd/calico-controller-gen/build.sh | head -1) CONTROLLER_TOOLS_VERSION := $(or $(CONTROLLER_TOOLS_VERSION),v0.18.0) -# The binary is built into the shared .go-pkg-cache (mounted as /go-cache in +# The binary is built into the shared Go build cache (mounted as /go-cache in # every component container, including api/'s isolated mount). It is stamped # with the go-build image version, the controller-tools version, and a hash of -# all patches: bumping the image (which may carry a new controller-gen), the -# pinned version, or a patch yields a new path and triggers a rebuild — and a -# rebuild re-runs the image-vs-pin check in build.sh. -CALICO_CONTROLLER_GEN_HASH := $(shell cat $(REPO_ROOT)/hack/cmd/calico-controller-gen/*.patch 2>/dev/null | sha256sum | cut -c1-12) +# build.sh and the patches: bumping the image (which may carry a new +# controller-gen), the pinned version, or editing either file yields a new path +# and triggers a rebuild — and a rebuild re-runs the image-vs-pin check in +# build.sh. build.sh is hashed because checkouts sharing the cache share the +# output file, which defeats Make's prerequisite check. +CALICO_CONTROLLER_GEN_HASH := $(shell cat $(REPO_ROOT)/hack/cmd/calico-controller-gen/build.sh $(REPO_ROOT)/hack/cmd/calico-controller-gen/*.patch 2>/dev/null | sha256sum | cut -c1-12) CALICO_CONTROLLER_GEN_STAMP := $(GO_BUILD_VER)-$(CONTROLLER_TOOLS_VERSION)-$(CALICO_CONTROLLER_GEN_HASH) # Two views of the same file: the host path Make uses as a build target, and -# the in-container path (/go-cache is the bind-mount of .go-pkg-cache) used to +# the in-container path (/go-cache is the bind-mount of LOCAL_GO_PKG_CACHE) used to # invoke it from inside the build containers. -CALICO_CONTROLLER_GEN_BIN := $(REPO_ROOT)/.go-pkg-cache/bin/calico-controller-gen-$(CALICO_CONTROLLER_GEN_STAMP) +CALICO_CONTROLLER_GEN_BIN := $(LOCAL_GO_PKG_CACHE)/bin/calico-controller-gen-$(CALICO_CONTROLLER_GEN_STAMP) CALICO_CONTROLLER_GEN := /go-cache/bin/calico-controller-gen-$(CALICO_CONTROLLER_GEN_STAMP) # Real file target (not .PHONY): Make skips it entirely — no container spin-up — -# when the binary already exists and build.sh is unchanged. Patch edits and -# version-pin bumps both land in the filename above (via the hash and the -# pinned version), so they yield a new target and trigger a rebuild. The recipe +# when the binary already exists. Patch edits and version-pin bumps both land in +# the filename above (via the hash and the pinned version), so they yield a new +# target and trigger a rebuild. build.sh is an order-only prerequisite for that +# reason: its contents are already in the stamp, and comparing mtimes instead +# would rebuild whenever a fresh checkout gave build.sh a timestamp newer than a +# valid binary another checkout left in the shared cache. The recipe # needs the repo root mounted (for build.sh and the patches), so components in # their own module (api/) reach it via: # $(MAKE) -C $(REPO_ROOT) $(CALICO_CONTROLLER_GEN_BIN) -$(CALICO_CONTROLLER_GEN_BIN): hack/cmd/calico-controller-gen/build.sh +$(CALICO_CONTROLLER_GEN_BIN): | hack/cmd/calico-controller-gen/build.sh $(DOCKER_GO_BUILD) sh -c \ './hack/cmd/calico-controller-gen/build.sh $(CALICO_CONTROLLER_GEN)' + @# `go clean -cache` only empties the cache's hex subdirectories, so stamps + @# from superseded image/version/patch combinations would accumulate here + @# forever. Drop the ones untouched for a month; a checkout still pinned to + @# such a stamp just rebuilds it. + @find $(dir $(CALICO_CONTROLLER_GEN_BIN)) -maxdepth 1 -type f \ + -name 'calico-controller-gen-*' -mtime +30 -delete 2>/dev/null || true DOCKER_RUST_BUILD := mkdir -p bin && \ docker run --rm \ @@ -572,47 +621,6 @@ define update_replace_pin fi' endef -# Get the latest release tag from projectcalico/go-build. -GO_BUILD_REPO=https://github.com/projectcalico/go-build.git -define get_go_build_version - $(shell git ls-remote --tags --refs --sort=-version:refname $(GO_BUILD_REPO) | head -n 1 | awk -F '/' '{print $$NF}') -endef - -# update_go_build_pin updates the GO_BUILD_VER in metadata.mk or Makefile. -# for annotated git tags, we need to remove the trailing `^{}`. -# for the obsoleted vx.y go-build version, we need to remove the leading `v` for bash string comparison to work properly. -define update_go_build_pin - $(eval new_ver := $(subst ^{},,$(call get_go_build_version))) - $(eval old_ver := $(shell grep -E "^GO_BUILD_VER" $(1) | cut -d'=' -f2 | xargs | sed 's/^v//')) - - @echo "current GO_BUILD_VER=$(old_ver)" - @echo "latest GO_BUILD_VER=$(new_ver)" - - bash -c '\ - if [[ "$(new_ver)" > "$(old_ver)" ]]; then \ - sed -i "s/^GO_BUILD_VER[[:space:]]*=.*/GO_BUILD_VER=$(new_ver)/" $(1); \ - echo "GO_BUILD_VER is updated to $(new_ver)"; \ - else \ - echo "no need to update GO_BUILD_VER"; \ - fi' -endef - -# update_calico_base_pin updates the CALICO_BASE_VER in metadata.mk. -define update_calico_base_pin - $(eval new_ver := $(shell curl -s "https://hub.docker.com/v2/repositories/calico/base/tags/?page_size=100" | jq -r '.results[].name' | grep -E "^ubi9-[0-9]+$$" | sort -r | head -n 1)) - $(eval old_ver := $(shell grep -E "^CALICO_BASE_VER" $(1) | cut -d'=' -f2 | xargs)) - - @echo "current CALICO_BASE_VER=$(old_ver)" - @echo "latest CALICO_BASE_VER=$(new_ver)" - - bash -c '\ - if [[ "$(new_ver)" > "$(old_ver)" ]]; then \ - sed -i "s/^CALICO_BASE_VER[[:space:]]*=.*/CALICO_BASE_VER=$(new_ver)/" $(1); \ - echo "CALICO_BASE_VER is updated to $(new_ver)"; \ - else \ - echo "no need to update CALICO_BASE_VER"; \ - fi' -endef API_BRANCH?=$(PIN_BRANCH) API_REPO?=github.com/projectcalico/calico/api @@ -669,11 +677,6 @@ update-cni-plugin-pin: replace-cni-pin: $(call update_replace_pin,github.com/projectcalico/calico/cni-plugin,$(CNI_REPO),$(CNI_BRANCH)) -update-go-build-pin: - $(call update_go_build_pin,$(GIT_GO_BUILD_UPDATE_COMMIT_FILE)) - -update-calico-base-pin: - $(call update_calico_base_pin,$(GIT_GO_BUILD_UPDATE_COMMIT_FILE)) git-status: git status --porcelain @@ -748,7 +751,6 @@ GIT_PR_BRANCH_BASE?=$(SEMAPHORE_GIT_BRANCH) PIN_UPDATE_BRANCH?=semaphore-auto-pin-updates-$(GIT_PR_BRANCH_BASE) GIT_PR_BRANCH_HEAD?=$(PIN_UPDATE_BRANCH) GIT_PIN_UPDATE_COMMIT_FILES?=go.mod go.sum -GIT_GO_BUILD_UPDATE_COMMIT_FILE?=metadata.mk GIT_PIN_UPDATE_COMMIT_EXTRA_FILES?=$(GIT_COMMIT_EXTRA_FILES) GIT_COMMIT_FILES?=$(GIT_PIN_UPDATE_COMMIT_FILES) $(GIT_PIN_UPDATE_COMMIT_EXTRA_FILES) @@ -1325,6 +1327,11 @@ var-require-one-of-%: build-images: var-require-all-BUILD_IMAGES @echo $(sort $(BUILD_IMAGES) $(WINDOWS_IMAGE)) +# image-tag-prefix echoes the prefix this component's published tags carry, which +# a variant selects through its own environment. Empty for an unprefixed build. +image-tag-prefix: + @echo $(IMAGETAG_PREFIX) + # sem-cut-release triggers the cut-release pipeline (or test-cut-release if CONFIRM is not specified) in semaphore to # cut the release. The pipeline is triggered for the current commit, and the branch it's triggered on is calculated # from the RELEASE_VERSION, CNX, and OS variables given. @@ -1503,11 +1510,11 @@ check-dirty: bin/yq: mkdir -p bin $(eval TMP := $(shell mktemp -d)) - curl -sSf -L --retry 5 -o $(TMP)/yq4.tar.gz https://github.com/mikefarah/yq/releases/download/v4.34.2/yq_linux_$(BUILDARCH).tar.gz + $(call fetch_file,https://github.com/mikefarah/yq/releases/download/v4.34.2/yq_linux_$(BUILDARCH).tar.gz,$(TMP)/yq4.tar.gz) tar -zxvf $(TMP)/yq4.tar.gz -C $(TMP) mv $(TMP)/yq_linux_$(BUILDARCH) bin/yq -# This setup is used to download and install the `crane` binary into $(REPOROOT)/bin/crane. +# This setup is used to download and install the `crane` binary into $(REPO_ROOT)/bin/crane. # Normalize architecture for go-containerregistry filenames CRANE_ARCH = $(subst amd64,x86_64,$(BUILDARCH)) ifeq ($(OS),Windows_NT) @@ -1519,10 +1526,15 @@ CRANE_URL = https://github.com/google/go-containerregistry/releases/download/$(C .PHONY: bin/crane bin/crane: $(REPO_ROOT)/bin/crane +# Moved into place last: a half-extracted binary looks complete to make. $(REPO_ROOT)/bin/crane: $(info ::: Downloading crane from $(CRANE_URL)) @mkdir -p $(REPO_ROOT)/bin - @curl -sSfL --retry 5 $(CRANE_URL) | tar xz -C $(REPO_ROOT)/bin crane + @tmp=$$(mktemp -d $(REPO_ROOT)/bin/.crane.XXXXXX) && trap 'rm -rf "$$tmp"' EXIT && \ + $(call fetch_file,$(CRANE_URL),"$$tmp/crane.tar.gz") && \ + tar xz -C "$$tmp" -f "$$tmp/crane.tar.gz" crane && \ + chmod +x "$$tmp/crane" && \ + mv "$$tmp/crane" "$@" ############################################################################### # Common functions for launching a local Kubernetes control plane. @@ -1607,6 +1619,11 @@ stop-k8s-controller-manager: # Common functions for create a local kind cluster. ############################################################################### KIND_DIR := $(REPO_ROOT)/hack/test/kind + +# The operator CRDs a Calico install ships, named by the list the operator and the +# manifest generator both read. +CALICO_OPERATOR_CRDS = $(addprefix -f $(REPO_ROOT)/operator/pkg/crds/operator/,\ + $(shell grep -v '^\#' $(REPO_ROOT)/operator/pkg/crds/calico_operator_crds.txt 2>/dev/null)) KIND ?= $(KIND_DIR)/kind KUBECTL ?= $(KIND_DIR)/kubectl @@ -1647,7 +1664,7 @@ $(REPO_ROOT)/.$(KIND_NAME).created: $(KUBECTL) $(KIND) kind-registry-up # Wait for controller manager to be running and healthy, then create Calico CRDs. while ! KUBECONFIG=$(KIND_KUBECONFIG) $(KUBECTL) get serviceaccount default; do echo "Waiting for default serviceaccount to be created..."; sleep 2; done - while ! KUBECONFIG=$(KIND_KUBECONFIG) $(KUBECTL) create -f $(REPO_ROOT)/charts/crd.projectcalico.org.v1/templates/; do echo "Waiting for operator CRDs to be created"; sleep 2; done + while ! KUBECONFIG=$(KIND_KUBECONFIG) $(KUBECTL) create $(CALICO_OPERATOR_CRDS); do echo "Waiting for operator CRDs to be created"; sleep 2; done while ! KUBECONFIG=$(KIND_KUBECONFIG) $(KUBECTL) create -f $(REPO_ROOT)/$(CALICO_CRD_PATH); do echo "Waiting for calico CRDs to be created"; sleep 2; done # These may have already been created, depending on where we're getting our CRDs from. So use apply. @@ -1661,6 +1678,9 @@ endif touch $@ kind-cluster-destroy kind-down: $(KIND) $(KUBECTL) + # Tear down the e2e external node (if any) alongside the cluster. Idempotent + # and a no-op when no external node was created (e.g. non-BPF jobs). + -$(KIND_DIR)/external-node.sh down # We need to drain the cluster gracefully when shutting down to avoid a netdev unregister error from the kernel. # This requires we execute CNI del on pods with pod networking. -$(KIND) delete cluster --name $(KIND_NAME) @@ -1717,6 +1737,21 @@ helm: bin/helm @echo "helm: $^" bin/helm: bin/.helm-updated-$(HELM_VERSION) +############################################################################### +# Dev image build variables. Used by the root Makefile's image and push +# targets, and by the operator image marker below. +############################################################################### +DEV_IMAGE_PATH ?= calico +DEV_IMAGE_TAG ?= $(GIT_VERSION) +DEV_IMAGE_REGISTRY ?= docker.io +DEV_STAMP_DIR := $(REPO_ROOT)/.dev-stamps + +# Map calico/:test-build → $(DEV_IMAGE_REGISTRY)/$(DEV_IMAGE_PATH)/:$(DEV_IMAGE_TAG) +# filter-registry strips "docker.io/" since Docker Hub doesn't use it in image refs. +DEV_IMAGE_PREFIX = $(if $(filter docker.io,$(DEV_IMAGE_REGISTRY)),$(DEV_IMAGE_PATH),$(DEV_IMAGE_REGISTRY)/$(DEV_IMAGE_PATH)) +DEV_CALICO_IMAGES = $(foreach img,$(KIND_CALICO_IMAGES),$(DEV_IMAGE_PREFIX)/$(subst calico/,,$(firstword $(subst :, ,$(img)))):$(DEV_IMAGE_TAG)) +DEV_OPERATOR_IMAGE = $(DEV_IMAGE_PREFIX)/operator:$(DEV_IMAGE_TAG) + ############################################################################### # Common functions for setting up a kind cluster with Calico for testing. ############################################################################### @@ -1745,7 +1780,7 @@ KIND_IMAGE_MARKERS = \ $(REPO_ROOT)/node/.image.created-$(ARCH) \ $(REPO_ROOT)/whisker/.image.created-$(ARCH) \ $(REPO_ROOT)/cmd/calico/.image.created-$(ARCH) \ - $(REPO_ROOT)/key-cert-provisioner/.image.created-$(ARCH) \ + $(REPO_ROOT)/operator/.image.created-$(ARCH) \ $(REPO_ROOT)/third_party/envoy-gateway/.envoy-gateway.created-$(ARCH) \ $(REPO_ROOT)/third_party/envoy-proxy/.envoy-proxy.created-$(ARCH) \ $(REPO_ROOT)/third_party/envoy-ratelimit/.envoy-ratelimit.created-$(ARCH) \ @@ -1760,6 +1795,10 @@ KIND_IMAGE_MARKERS = \ # paths). Point both image markers at the compiled libbpf.a so Make # builds it exactly once, serially, before the parallel image builds # start. +# +# Order-only, because a libbpf.a compiled during this job is newer than a +# marker restored from the CI image cache, and a normal prereq would rebuild +# the image the cache just supplied. LIBBPF_MARKER = $(REPO_ROOT)/felix/bpf-gpl/libbpf/src/$(ARCH)/libbpf.a $(LIBBPF_MARKER): @@ -1776,7 +1815,8 @@ MISSING-IMAGE: $(REPO_ROOT)/node/.image.created-$(ARCH): \ $(shell $(REPO_ROOT)/hack/image-exists $(REPO_ROOT)/node/.image.created-$(ARCH)) \ - $(LIBBPF_MARKER) $(call local-deps-go-files,node) $(call local-deps-go-files,cmd) + $(call local-deps-go-files,node) $(call local-deps-go-files,cmd) \ + | $(LIBBPF_MARKER) rm -f $@ $(MAKE) -C $(REPO_ROOT)/node image echo "node:latest-$(ARCH)" > $@ @@ -1789,17 +1829,24 @@ $(REPO_ROOT)/whisker/.image.created-$(ARCH): \ $(REPO_ROOT)/cmd/calico/.image.created-$(ARCH): \ $(shell $(REPO_ROOT)/hack/image-exists $(REPO_ROOT)/cmd/calico/.image.created-$(ARCH)) \ - $(LIBBPF_MARKER) $(call local-deps-go-files,cmd) + $(call local-deps-go-files,cmd) \ + | $(LIBBPF_MARKER) rm -f $@ $(MAKE) -C $(REPO_ROOT)/cmd/calico image echo "calico:latest-$(ARCH)" > $@ -$(REPO_ROOT)/key-cert-provisioner/.image.created-$(ARCH): \ - $(shell $(REPO_ROOT)/hack/image-exists $(REPO_ROOT)/key-cert-provisioner/.image.created-$(ARCH)) \ - $(call local-deps-go-files,key-cert-provisioner) +# The operator bakes the component refs it installs into the image, so +# image-exists gets the expected ref: a changed DEV_IMAGE_* triple must +# rebuild even though the recorded image still exists. +$(REPO_ROOT)/operator/.image.created-$(ARCH): \ + $(shell $(REPO_ROOT)/hack/image-exists $(REPO_ROOT)/operator/.image.created-$(ARCH) $(DEV_OPERATOR_IMAGE)) \ + $(call local-deps-go-files,operator) rm -f $@ - $(MAKE) -C $(REPO_ROOT)/key-cert-provisioner image - echo "test-signer:latest-$(ARCH)" > $@ + DEV_IMAGE_TAG=$(DEV_IMAGE_TAG) \ + DEV_IMAGE_REGISTRY=$(DEV_IMAGE_REGISTRY) \ + DEV_IMAGE_PATH=$(DEV_IMAGE_PATH) \ + $(KIND_INFRA_DIR)/build-operator.sh + echo "$(DEV_OPERATOR_IMAGE)" > $@ # Envoy components: the third_party/envoy-* sub-makes use their own marker # names (.envoy-.created-$(ARCH)). The sub-make handles fetching @@ -1818,6 +1865,16 @@ $(REPO_ROOT)/third_party/envoy-ratelimit/.envoy-ratelimit.created-$(ARCH): $(REPO_ROOT)/third_party/cni-plugins/.cni-plugins.created-$(ARCH): $(MAKE) -C $(REPO_ROOT)/third_party/cni-plugins image +# The registry/path/tag every kind lane bakes into its images. +# hack/test/kind/infra/values.yaml pins the same triple, and the operator FV +# stamps it into the test binary. +KIND_IMAGE_REGISTRY = localhost:5000 +KIND_IMAGE_PATH = calico +KIND_DEV_IMAGE_ARGS = \ + DEV_IMAGE_REGISTRY=$(KIND_IMAGE_REGISTRY) \ + DEV_IMAGE_PATH=$(KIND_IMAGE_PATH) \ + DEV_IMAGE_TAG=$(KIND_TEST_BUILD_TAG) + ## Build all component images and push them to the local kind registry. # This invokes the same `make push` pipeline used by the release flow, with # kind-flavored DEV_IMAGE_REGISTRY/PATH/TAG so images land at @@ -1827,10 +1884,14 @@ $(REPO_ROOT)/third_party/cni-plugins/.cni-plugins.created-$(ARCH): # inside the kind nodes mirrors localhost:5000 to http://kind-registry:5000. .PHONY: kind-build-images kind-build-images: kind-registry-up - $(MAKE) -C $(REPO_ROOT) push \ - DEV_IMAGE_REGISTRY=localhost:5000 \ - DEV_IMAGE_PATH=calico \ - DEV_IMAGE_TAG=$(KIND_TEST_BUILD_TAG) + $(MAKE) -C $(REPO_ROOT) push $(KIND_DEV_IMAGE_ARGS) + +## Build only the operator image, with the kind component references baked in. +# CI's "Build: operator image" block runs this and caches the result so the +# kind lanes load it instead of compiling the operator per job. +.PHONY: kind-operator-image +kind-operator-image: + $(MAKE) -C $(REPO_ROOT) operator-image $(KIND_DEV_IMAGE_ARGS) # Create a kind cluster and deploy Calico on it via Helm. Assumes images are # already built and tagged as test-build in the local Docker daemon. If a @@ -1878,22 +1939,56 @@ ENVTEST_CONTAINER_DIR := /go/src/github.com/projectcalico/calico/hack/test/envte ifneq ($(OS),Windows_NT) ENVTEST_K8S_VERSION ?= $(shell echo $(K8S_VERSION) | sed 's/^v//' | cut -d. -f1,2).x endif -ENVTEST_ASSETS_MARKER := $(ENVTEST_DIR)/.envtest-$(ENVTEST_K8S_VERSION) +# Key the marker off the full K8S_VERSION rather than the minor wildcard. The +# fallback below stores its assets under k8s/--, so a +# bump inside one minor (rc to GA, say) has to force a fresh setup. +ENVTEST_ASSETS_MARKER := $(ENVTEST_DIR)/.envtest-$(K8S_VERSION:v%=%) -## Download envtest binaries (kube-apiserver, etcd) for use by tests that use controller-runtime envtest. +## Download envtest binaries (kube-apiserver, etcd, kubectl) for use by tests that use controller-runtime envtest. .PHONY: setup-envtest setup-envtest: $(ENVTEST_ASSETS_MARKER) $(ENVTEST_ASSETS_MARKER): @echo "Setting up envtest binaries for Kubernetes $(ENVTEST_K8S_VERSION)..." mkdir -p $(ENVTEST_DIR) rm -f $(ENVTEST_DIR)/.envtest-* - $(DOCKER_GO_BUILD) sh -c \ - 'go run sigs.k8s.io/controller-runtime/tools/setup-envtest@latest \ - use --bin-dir $(ENVTEST_CONTAINER_DIR) -p path $(ENVTEST_K8S_VERSION)' + # Prefer the bundle controller-tools publishes. It only exists for minors it + # has already cut an envtest release for, which trails the Kubernetes release + # by anywhere from hours to a fortnight, and it never covers most + # pre-releases. Assemble the same layout from the release binaries when it is + # missing, so a Kubernetes bump is never blocked waiting on that release; the + # published bundle takes over again on the next clean setup once it lands. + # -alpha is excluded either way: too unstable to pin, so it fails loudly. + $(DOCKER_GO_BUILD) sh -c 'set -e; \ + case "$(K8S_VERSION)" in \ + *-alpha*) echo "K8S_VERSION $(K8S_VERSION) is an alpha; envtest does not pin to alphas." >&2; exit 1;; \ + esac; \ + if go run sigs.k8s.io/controller-runtime/tools/setup-envtest@latest \ + use --bin-dir $(ENVTEST_CONTAINER_DIR) -p path $(ENVTEST_K8S_VERSION); then \ + exit 0; \ + fi; \ + echo "No published envtest bundle for $(ENVTEST_K8S_VERSION); assembling one from the $(K8S_VERSION) release binaries."; \ + base=https://dl.k8s.io/release/$(K8S_VERSION)/bin/$(BUILDOS)/$(BUILDARCH); \ + d=$(ENVTEST_CONTAINER_DIR)/k8s/$(K8S_VERSION:v%=%)-$(BUILDOS)-$(BUILDARCH); \ + mkdir -p $$d; \ + for b in kube-apiserver kubectl; do \ + curl -fsSL --retry 5 -o $$d/$$b $$base/$$b; \ + curl -fsSL --retry 5 -o $$d/$$b.sha256 $$base/$$b.sha256; \ + echo "$$(cat $$d/$$b.sha256) $$d/$$b" | sha256sum -c -; \ + rm -f $$d/$$b.sha256; \ + done; \ + etcd_tgz=etcd-$(ETCD_VERSION)-$(BUILDOS)-$(BUILDARCH).tar.gz; \ + etcd_url=https://github.com/etcd-io/etcd/releases/download/$(ETCD_VERSION); \ + curl -fsSL --retry 5 -o /tmp/$$etcd_tgz $$etcd_url/$$etcd_tgz; \ + curl -fsSL --retry 5 -o /tmp/etcd.SHA256SUMS $$etcd_url/SHA256SUMS; \ + echo "$$(grep -F "$$etcd_tgz" /tmp/etcd.SHA256SUMS | cut -d" " -f1) /tmp/$$etcd_tgz" | sha256sum -c -; \ + tar -xzf /tmp/$$etcd_tgz -C /tmp; \ + mv /tmp/etcd-$(ETCD_VERSION)-$(BUILDOS)-$(BUILDARCH)/etcd $$d/etcd; \ + chmod +x $$d/kube-apiserver $$d/kubectl $$d/etcd' touch $@ -# Minimum supported Kubernetes version for CEL IP/CIDR library (available in 1.31+). -MIN_K8S_VERSION ?= v1.31.0 +# Minimum supported Kubernetes version. 1.32 is the first release that estimates +# the cost of the CEL IP/CIDR library well enough for our CRD rules to install. +MIN_K8S_VERSION ?= v1.32.0 ifneq ($(OS),Windows_NT) ENVTEST_MIN_K8S_VERSION ?= $(shell echo $(MIN_K8S_VERSION) | sed 's/^v//' | cut -d. -f1,2).x # Major.minor prefix for globbing the downloaded envtest directory (e.g. "1.29"). @@ -1912,20 +2007,6 @@ $(ENVTEST_MIN_ASSETS_MARKER): use --bin-dir $(ENVTEST_CONTAINER_DIR) -p path $(ENVTEST_MIN_K8S_VERSION)' touch $@ -############################################################################### -# Dev image build variables. Targets that use these are in the root Makefile. -############################################################################### -DEV_IMAGE_PATH ?= calico -DEV_IMAGE_TAG ?= $(GIT_VERSION) -DEV_IMAGE_REGISTRY ?= docker.io -DEV_STAMP_DIR := $(REPO_ROOT)/.dev-stamps - -# Map calico/:test-build → $(DEV_IMAGE_REGISTRY)/$(DEV_IMAGE_PATH)/:$(DEV_IMAGE_TAG) -# filter-registry strips "docker.io/" since Docker Hub doesn't use it in image refs. -DEV_IMAGE_PREFIX = $(if $(filter docker.io,$(DEV_IMAGE_REGISTRY)),$(DEV_IMAGE_PATH),$(DEV_IMAGE_REGISTRY)/$(DEV_IMAGE_PATH)) -DEV_CALICO_IMAGES = $(foreach img,$(KIND_CALICO_IMAGES),$(DEV_IMAGE_PREFIX)/$(subst calico/,,$(firstword $(subst :, ,$(img)))):$(DEV_IMAGE_TAG)) -DEV_OPERATOR_IMAGE = $(DEV_IMAGE_PREFIX)/operator:$(DEV_IMAGE_TAG) - ############################################################################### # Common functions for launching a local etcd instance. ############################################################################### @@ -1988,15 +2069,20 @@ else DOCKER_MANIFEST = echo [DRY RUN] $(DOCKER_MANIFEST_CMD) endif +# Named per component so two components' Windows builds do not remove each other's. +WINDOWS_BUILDER = calico-windows-builder-$(notdir $(CURDIR)) + # Clean up the docker builder used to create Windows image tarballs. .PHONY: clean-windows-builder clean-windows-builder: + -docker buildx rm $(WINDOWS_BUILDER) + # Drain the shared builder earlier releases left selected on the host with --use. -docker buildx rm calico-windows-builder # Set up the docker builder used to create Windows image tarballs. .PHONY: setup-windows-builder setup-windows-builder: clean-windows-builder - docker buildx create --name=calico-windows-builder --use --platform windows/amd64 + docker buildx create --name=$(WINDOWS_BUILDER) --platform windows/amd64 # FIXME: Use WINDOWS_HPC_VERSION and image instead of nanoserver and WINDOWS_VERSIONS when containerd v1.6 is EOL'd # .PHONY: image-windows release-windows @@ -2059,6 +2145,7 @@ windows-sub-image-%: var-require-all-GIT_VERSION-WINDOWS_IMAGE-WINDOWS_DIST-WIND # ensure dir for windows image tars exits -mkdir -p $(WINDOWS_DIST) docker buildx build \ + --builder $(WINDOWS_BUILDER) \ --platform windows/amd64 \ --output=type=docker,dest=$(CURDIR)/$(WINDOWS_DIST)/$(WINDOWS_IMAGE)-$(GIT_VERSION)-$*.tar \ $(DOCKER_PULL) \ @@ -2067,7 +2154,7 @@ windows-sub-image-%: var-require-all-GIT_VERSION-WINDOWS_IMAGE-WINDOWS_DIST-WIND --build-arg=WINDOWS_VERSION=$* \ -f Dockerfile.windows . -.PHONY: image-windows release-windows release-windows-with-tag +.PHONY: image-windows release-windows release-windows-with-tag retag-windows-image-with-registries image-windows: setup-windows-builder var-require-all-WINDOWS_VERSIONS for version in $(WINDOWS_VERSIONS); do \ $(MAKE) windows-sub-image-$${version}; \ @@ -2096,6 +2183,14 @@ release-windows-with-tag: var-require-one-of-CONFIRM-DRYRUN var-require-all-IMAG $(RELEASE_PY3) $(QUAY_SET_EXPIRY_SCRIPT) add --expiry-days=$(QUAY_EXPIRE_DAYS) $${manifest_image} $${all_images} || true; \ done; +# retag-windows-image-with-registries copies the Windows image from DEV_TAG to +# IMAGETAG in each registry. Windows images are single-arch manifests built by +# buildx, so they have no local per-arch images to retag. +retag-windows-image-with-registries: var-require-one-of-CONFIRM-DRYRUN var-require-all-DEV_REGISTRIES-WINDOWS_IMAGE-DEV_TAG-IMAGETAG bin/crane + for registry in $(DEV_REGISTRIES); do \ + $(CRANE) cp $${registry}/$(WINDOWS_IMAGE):$(DEV_TAG) $${registry}/$(WINDOWS_IMAGE):$(IMAGETAG); \ + done; + release-windows: var-require-one-of-CONFIRM-DRYRUN var-require-all-DEV_REGISTRIES-WINDOWS_IMAGE var-require-one-of-VERSION-BRANCH_NAME bin/crane describe_tag=$(if $(IMAGETAG_PREFIX),$(IMAGETAG_PREFIX)-)$(shell git describe --tags --dirty --long --always --abbrev=12); \ release_tag=$(if $(VERSION),$(VERSION),$(if $(IMAGETAG_PREFIX),$(IMAGETAG_PREFIX)-)$(BRANCH_NAME)); \ diff --git a/metadata.mk b/metadata.mk index 227e0997b..26d724418 100644 --- a/metadata.mk +++ b/metadata.mk @@ -2,16 +2,20 @@ # This file contains Makefile configuration parameters and metadata for this branch. ################################################################################################# # The project Go version -GO_VERSION=1.26.4 +GO_VERSION=1.27.1 # Version of Kubernetes to use for dependencies, tests, registry.k8s.io/kubectl, and kubectl binary release. -K8S_VERSION=v1.36.2 +K8S_VERSION=v1.37.0 # The version of LLVM to use for go-build and calico/base images. LLVM_VERSION=21.1.8 # Calico toolchain versions and the calico/base image to use. -GO_BUILD_VER=$(GO_VERSION)-llvm$(LLVM_VERSION)-k8s$(K8S_VERSION:v%=%) +# Set when go-build is rebuilt for the same Go/LLVM/Kubernetes versions, which is +# published as -1, -2 and so on. Empty for a normal tag; clear it whenever any of +# those three versions moves. +GO_BUILD_VER_SUFFIX= +GO_BUILD_VER=$(GO_VERSION)-llvm$(LLVM_VERSION)-k8s$(K8S_VERSION:v%=%)$(GO_BUILD_VER_SUFFIX) RUST_BUILD_VER=1.96.0 -CALICO_BASE_VER=ubi9-1781722225 +CALICO_BASE_VER=ubi9-1789183536 # Version of various tools used in the build and tests. COREDNS_VERSION=1.5.2 @@ -70,6 +74,8 @@ WINDOWS_VERSIONS ?= ltsc2019 ltsc2022 # bump it to pick up upstream changes. CNI_VERSION=9ffe547cb3b66f80dd32a00fc69a6d0082b55321 FLANNEL_VERSION=v1.2.0-flannel2-go1.22.7 +CONTAINERNETWORKING_PLUGINS_REPO=https://github.com/projectcalico/containernetworking-plugins.git +FLANNEL_CNI_PLUGIN_REPO=https://github.com/projectcalico/flannel-cni-plugin.git # The libbpf version to use LIBBPF_VERSION=v1.6.2 @@ -85,10 +91,6 @@ NFTABLES_SHA256=6358830f3a64f31e39b0ad421d7dadcd240b72343ded48d8ef13b8faf204865a LIBNFTNL_VER=1.2.8 LIBNFTNL_SHA256=37fea5d6b5c9b08de7920d298de3cdc942e7ae64b1a3e8b880b2d390ae67ad95 -# The operator branch corresponding to this branch. -OPERATOR_BRANCH ?= master -OPERATOR_ORGANIZATION ?= tigera -OPERATOR_GIT_REPO ?= operator - # quay.io expiry time for hashrelease/dev images QUAY_EXPIRE_DAYS=90 + diff --git a/pkg/apis/projectcalico/v3/bgpconfig.go b/pkg/apis/projectcalico/v3/bgpconfig.go index 8d199f7b8..97a6eb520 100644 --- a/pkg/apis/projectcalico/v3/bgpconfig.go +++ b/pkg/apis/projectcalico/v3/bgpconfig.go @@ -152,11 +152,29 @@ type BGPConfigurationSpec struct { // +optional LocalWorkloadPeeringIPV6 string `json:"localWorkloadPeeringIPV6,omitempty" validate:"omitempty,ipv6"` - // ProgramClusterRoutes controls how a cluster node gets a route to a workload on another node, - // when that workload's IP comes from an IP Pool with vxlanMode: Never. When ProgramClusterRoutes is Enabled, - // confd and BIRD program that route. When ProgramClusterRoutes is Disabled, it is expected that Felix will program that route. - // Felix always programs such routes for IP Pools with vxlanMode: Always or vxlanMode: CrossSubnet. [Default: Enabled] - // +kubebuilder:validation:Enum=Enabled;Disabled + // ProgramClusterRoutes controls which "cluster routes" are programmed by Calico's BGP + // stack, i.e. the routes that a node needs in order to reach workloads on other nodes. It + // only applies to IP Pools with vxlanMode: Never; the cluster routes for IP Pools with + // vxlanMode: Always or vxlanMode: CrossSubnet are always programmed by Felix. The routes + // that BIRD does not program here are expected to be programmed by Felix instead. Below, + // an IPIP IP Pool is one with ipipMode: Always or CrossSubnet, and an unencapsulated one + // has ipipMode and vxlanMode both Never. + // + // - Disabled: BIRD programs no cluster routes. + // - EnabledNoEncapOnly: BIRD programs them for unencapsulated IP Pools. + // - EnabledIPIPOnly: BIRD programs them for IPIP IP Pools. + // - Enabled: BIRD programs them for both. + // + // This field must be kept consistent with FelixConfiguration.ProgramClusterRoutes, which + // makes the same choice from Felix's side. If both Felix and BIRD are enabled for the same + // kind of IP Pool they will fight over the routes; if neither is, there will be no cluster + // routes at all. + // + // Note: asking BIRD to program IPIP cluster routes, which the Enabled and EnabledIPIPOnly + // values do, is deprecated as of v3.33 and will be removed in v3.35. + // + // [Default: EnabledNoEncapOnly] + // +kubebuilder:validation:Enum=Enabled;Disabled;EnabledIPIPOnly;EnabledNoEncapOnly // +optional ProgramClusterRoutes *string `json:"programClusterRoutes,omitempty"` diff --git a/pkg/apis/projectcalico/v3/bgpfilter.go b/pkg/apis/projectcalico/v3/bgpfilter.go index be7ae9aac..98304f821 100644 --- a/pkg/apis/projectcalico/v3/bgpfilter.go +++ b/pkg/apis/projectcalico/v3/bgpfilter.go @@ -156,7 +156,7 @@ type BGPFilterRuleV6 struct { // MatchOperator and PrefixLength. CIDR should be in conventional CIDR notation, // /. // +kubebuilder:validation:Format=cidr - // +kubebuilder:validation:MaxLength=43 + // +kubebuilder:validation:MaxLength=49 CIDR string `json:"cidr,omitempty" validate:"omitempty,netv6"` // PrefixLength further constrains the CIDR match by restricting the range of allowed diff --git a/pkg/apis/projectcalico/v3/bgppeer.go b/pkg/apis/projectcalico/v3/bgppeer.go index 43f6adff4..23f1d1c04 100644 --- a/pkg/apis/projectcalico/v3/bgppeer.go +++ b/pkg/apis/projectcalico/v3/bgppeer.go @@ -82,6 +82,7 @@ type BGPPeerSpec struct { // with ListenPort set in BGPConfiguration, then we use that port to peer. // +optional // +kubebuilder:validation:MaxLength=64 + // +kubebuilder:validation:XValidation:rule="self == '' || isIP(self) || (self.startsWith('[') && self.contains(']:') && isIP(self.substring(1, self.lastIndexOf(']:'))) && self.substring(self.lastIndexOf(']:') + 2).matches('^[0-9]{1,5}$') && int(self.substring(self.lastIndexOf(']:') + 2)) >= 1 && int(self.substring(self.lastIndexOf(']:') + 2)) <= 65535) || (self.matches('^[0-9.]+:[0-9]{1,5}$') && isIP(self.split(':')[0]) && int(self.split(':')[1]) >= 1 && int(self.split(':')[1]) <= 65535)",message="peerIP must be an IP address, optionally with a port as : or []:",reason=FieldValueInvalid PeerIP string `json:"peerIP,omitempty" validate:"omitempty,IP:port"` // The AS Number of the peer. diff --git a/pkg/apis/projectcalico/v3/constants.go b/pkg/apis/projectcalico/v3/constants.go index d3f6b99af..8223a83bd 100644 --- a/pkg/apis/projectcalico/v3/constants.go +++ b/pkg/apis/projectcalico/v3/constants.go @@ -58,8 +58,10 @@ const ( LabelIPVersion = "projectcalico.org/ip-version" // Enum options for enable/disable fields - Enabled = "Enabled" - Disabled = "Disabled" + Enabled = "Enabled" + Disabled = "Disabled" + EnabledIPIPOnly = "EnabledIPIPOnly" + EnabledNoEncapOnly = "EnabledNoEncapOnly" // Host name used for Service LoadBalancer VirtualLoadBalancer = "load-balancer" diff --git a/pkg/apis/projectcalico/v3/felixconfig.go b/pkg/apis/projectcalico/v3/felixconfig.go index 437a5ac8c..19475c3cf 100644 --- a/pkg/apis/projectcalico/v3/felixconfig.go +++ b/pkg/apis/projectcalico/v3/felixconfig.go @@ -70,6 +70,18 @@ const ( NFTablesModeAuto NFTablesMode = "Auto" ) +// NFTablesFlowTableOffload controls which traffic nftables flowtable offload is enabled for. When +// set to "All", established connections that have been accepted by Calico policy are offloaded to +// the kernel's flowtable fast path, bypassing most of the networking stack for improved throughput. +// +enum +// +kubebuilder:validation:Enum=All;Disabled +type NFTablesFlowTableOffload string + +const ( + NFTablesFlowTableOffloadAll NFTablesFlowTableOffload = "All" + NFTablesFlowTableOffloadDisabled NFTablesFlowTableOffload = "Disabled" +) + // +kubebuilder:validation:Enum=DoNothing;Enable;Disable type AWSSrcDstCheckOption string @@ -79,12 +91,13 @@ const ( AWSSrcDstCheckOptionDisable AWSSrcDstCheckOption = "Disable" ) -// +kubebuilder:validation:Enum=TC;TCX +// +kubebuilder:validation:Enum=TC;TCX;Netkit type BPFAttachOption string const ( - BPFAttachOptionTC BPFAttachOption = "TC" - BPFAttachOptionTCX BPFAttachOption = "TCX" + BPFAttachOptionTC BPFAttachOption = "TC" + BPFAttachOptionTCX BPFAttachOption = "TCX" + BPFAttachOptionNetkit BPFAttachOption = "Netkit" ) // +kubebuilder:validation:Enum=Enabled;Disabled @@ -120,6 +133,14 @@ const ( BPFConnectTimeLBDisabled BPFConnectTimeLBType = "Disabled" ) +// +kubebuilder:validation:Enum=TunnelAddress;HostAddress +type BPFOverlayHostSourceIPType string + +const ( + BPFOverlayHostSourceIPTunnelAddress BPFOverlayHostSourceIPType = "TunnelAddress" + BPFOverlayHostSourceIPHostAddress BPFOverlayHostSourceIPType = "HostAddress" +) + // +kubebuilder:validation:Enum=Auto;Userspace;BPFProgram type BPFConntrackMode string @@ -161,7 +182,15 @@ const ( NATOutgoingExclusionsIPPoolsAndHostIPs NATOutgoingExclusionsType = "IPPoolsAndHostIPs" ) -// +kubebuilder:validation:enum=RequireAndVerifyClientCert;RequireAnyClientCert;VerifyClientCertIfGiven;NoClientCert +// +kubebuilder:validation:Enum=Disabled;FirstResponseAfterLog +type LogConnectionTransitionsMode string + +const ( + LogConnectionTransitionsDisabled LogConnectionTransitionsMode = "Disabled" + LogConnectionTransitionsFirstResponseAfterLog LogConnectionTransitionsMode = "FirstResponseAfterLog" +) + +// +kubebuilder:validation:Enum=RequireAndVerifyClientCert;RequireAnyClientCert;VerifyClientCertIfGiven;NoClientCert type PrometheusMetricsClientAuthType string const ( @@ -369,6 +398,8 @@ type FelixConfigurationSpec struct { // LogActionRateLimit sets the rate of hitting a Log action. The value must be in the format "N/unit", // where N is a number and unit is one of: second, minute, hour, or day. For example: "10/second" or "100/hour". + // When LogConnectionTransitions is enabled, this also bounds the follow-up logs: a connection whose + // initial log was suppressed by this rate limit gets no follow-up log either. // +optional // +kubebuilder:validation:Pattern=`^[1-9]\d{0,3}/(?:second|minute|hour|day)$` LogActionRateLimit *string `json:"logActionRateLimit,omitempty"` @@ -379,6 +410,32 @@ type FelixConfigurationSpec struct { // +kubebuilder:validation:Maximum=9999 LogActionRateLimitBurst *int `json:"logActionRateLimitBurst,omitempty"` + // LogConnectionTransitions controls whether Felix emits an additional kernel log recording the + // first observed response for each connection that matched a policy rule with a Log action. + // When set to FirstResponseAfterLog, each connection whose initial log was emitted gets one + // follow-up log, prefixed with LogConnectionTransitionsPrefix plus a suffix identifying the + // transition: "-est" when the first reply packet is seen, "-rst" when the response is a TCP + // RST (connection refused), or "-icmp-err" when the response is a related ICMP error (e.g. + // port unreachable). The log body is the standard kernel packet log of the response packet. + // For "-est" and "-rst" its 5-tuple is the original policy Log line's with source and + // destination swapped; for "-icmp-err" the bracketed inner header carries the original + // 5-tuple unswapped. A logged connection with no follow-up log never received a response. + // Connections whose initial log was suppressed by LogActionRateLimit get no follow-up log + // either, so every follow-up log pairs with an initial one. Enabling this consumes one bit + // from the Iptables/NftablesMarkMask space. Not supported in eBPF mode. + // [Default: Disabled] + // +optional + LogConnectionTransitions *LogConnectionTransitionsMode `json:"logConnectionTransitions,omitempty" validate:"omitempty,oneof=Disabled FirstResponseAfterLog"` + + // LogConnectionTransitionsPrefix is the log prefix used for the logs emitted when + // LogConnectionTransitions is enabled; the transition suffix ("-est", "-rst" or "-icmp-err") + // is appended to it. Unlike LogPrefix, it does not support %-specifiers (such as %p): the + // rules that emit these logs are shared by all policies, so per-policy values cannot be + // substituted and any %-specifiers are rendered literally. [Default: calico-response] + // +optional + // +kubebuilder:validation:Pattern=`^([a-zA-Z0-9%: /_-])*$` + LogConnectionTransitionsPrefix string `json:"logConnectionTransitionsPrefix,omitempty"` + // LogFilePath is the full path to the Felix log. Set to none to disable file logging. [Default: /var/log/calico/felix.log] LogFilePath string `json:"logFilePath,omitempty"` @@ -525,7 +582,7 @@ type FelixConfigurationSpec struct { PrometheusMetricsKeyFile *string `json:"prometheusMetricsKeyFile,omitempty"` // PrometheusMetricsClientAuth specifies the client authentication type for the /metrics endpoint. - // This determines how the server validates client certificates. Default is "RequireAndVerifyClientCert". + // This determines how the server validates client certificates. Default is "NoClientCert". PrometheusMetricsClientAuth *PrometheusMetricsClientAuthType `json:"prometheusMetricsClientAuth,omitempty" validate:"omitempty,oneof=RequireAndVerifyClientCert RequireAnyClientCert VerifyClientCertIfGiven NoClientCert"` // FailsafeInboundHostPorts is a list of ProtoPort struct objects including UDP/TCP/SCTP ports and CIDRs that Felix will @@ -604,11 +661,29 @@ type FelixConfigurationSpec struct { // use a distinct protocol (in addition to setting this field to false). RemoveExternalRoutes *bool `json:"removeExternalRoutes,omitempty"` - // ProgramClusterRoutes controls how a cluster node gets a route to a workload on another node, - // when that workload's IP comes from an IP Pool with vxlanMode: Never. When ProgramClusterRoutes is Disabled, - // it is expected that confd and BIRD will program that route. When ProgramClusterRoutes is Enabled, Felix program that route. - // Felix always programs such routes for IP Pools with vxlanMode: Always or vxlanMode: CrossSubnet. [Default: Disabled] - // +kubebuilder:validation:Enum=Enabled;Disabled + // ProgramClusterRoutes controls which "cluster routes" Felix programs, i.e. the routes that + // a node needs in order to reach workloads on other nodes. It only applies to IP Pools + // with vxlanMode: Never; Felix always programs the cluster routes for IP Pools with + // vxlanMode: Always or vxlanMode: CrossSubnet. The routes that Felix does not program here + // are expected to be programmed by Calico's BGP stack instead. Below, an IPIP IP Pool is + // one with ipipMode: Always or CrossSubnet, and an unencapsulated one has ipipMode and + // vxlanMode both Never. + // + // - Disabled: Felix programs no cluster routes. + // - EnabledIPIPOnly: Felix programs them for IPIP IP Pools. + // - EnabledNoEncapOnly: Felix programs them for unencapsulated IP Pools. + // - Enabled: Felix programs them for both. + // + // This field must be kept consistent with BGPConfiguration.ProgramClusterRoutes, which + // makes the same choice from BIRD's side. If both Felix and BIRD are enabled for the same + // kind of IP Pool they will fight over the routes; if neither is, there will be no cluster + // routes at all. + // + // Note: leaving the IPIP cluster routes to BGP, which the Disabled and EnabledNoEncapOnly + // values do, is deprecated as of v3.33 and will be removed in v3.35. + // + // [Default: EnabledIPIPOnly] + // +kubebuilder:validation:Enum=Enabled;Disabled;EnabledIPIPOnly;EnabledNoEncapOnly ProgramClusterRoutes *string `json:"programClusterRoutes,omitempty"` // IPForwarding controls whether Felix sets the host sysctls to enable IP forwarding. IP forwarding is required @@ -653,6 +728,8 @@ type FelixConfigurationSpec struct { // DebugPort if set, enables Felix's debug HTTP port, which allows memory and CPU profiles // to be retrieved. The debug port is not secure, it should not be exposed to the internet. + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=65535 DebugPort *int `json:"debugPort,omitempty" validate:"omitempty,gte=0,lte=65535"` // This parameter can be used to limit the host interfaces on which Calico will apply SNAT to traffic leaving a @@ -674,10 +751,26 @@ type FelixConfigurationSpec struct { // iptables. [Default: false] GenericXDPEnabled *bool `json:"genericXDPEnabled,omitempty" confignamev1:"GenericXDPEnabled"` - // NFTablesMode configures nftables support in Felix. [Default: Auto] + // NFTablesMode configures nftables support in Felix. In Auto mode, Felix uses the + // nftables dataplane if kube-proxy is detected to be running in nftables mode. + // [Default: Auto] // +kubebuilder:default=Auto NFTablesMode *NFTablesMode `json:"nftablesMode,omitempty"` + // NFTablesFlowTableOffload controls which traffic nftables flowtable offload is enabled for, + // for improved forwarding performance. When set to "All", established connections accepted by + // Calico policy are offloaded to the kernel's flowtable fast path. Only applies when + // nftables mode is active. [Default: Disabled] + // +kubebuilder:default=Disabled + NFTablesFlowTableOffload *NFTablesFlowTableOffload `json:"nftablesFlowTableOffload,omitempty"` + + // NFTablesFlowTableDataIfacePattern is a regular expression that controls which host + // interfaces are added to the nftables flowtable, so that traffic forwarded between those + // interfaces and local workloads is offloaded to the flowtable fast path. Leave empty to + // offload only workload-to-workload traffic. Only takes effect when NFTablesFlowTableOffload + // is not Disabled. [Default: ""] + NFTablesFlowTableDataIfacePattern string `json:"nftablesFlowTableDataIfacePattern,omitempty" validate:"omitempty,regexp"` + // NftablesRefreshInterval controls the interval at which Felix periodically refreshes the nftables rules. [Default: 90s] NftablesRefreshInterval *metav1.Duration `json:"nftablesRefreshInterval,omitempty" configv1timescale:"seconds"` @@ -708,6 +801,14 @@ type FelixConfigurationSpec struct { // BPFEnabled, if enabled Felix will use the BPF dataplane. [Default: false] BPFEnabled *bool `json:"bpfEnabled,omitempty" validate:"omitempty"` + // BPFOverlayHostSourceIP controls the source IP that Felix uses in BPF mode for host-networked + // (node-originated) traffic egressing over an IPIP/VXLAN overlay tunnel. "TunnelAddress" (the default) + // assigns an IP address to the overlay tunnel device and uses it as the source, preserving the behaviour + // of clusters upgraded from earlier releases. "HostAddress" uses the node's own IP directly and does not + // assign a tunnel device IP. This option has no effect on WireGuard tunnels, which always use a tunnel + // device IP. [Default: TunnelAddress] + BPFOverlayHostSourceIP *BPFOverlayHostSourceIPType `json:"bpfOverlayHostSourceIP,omitempty" validate:"omitempty,oneof=TunnelAddress HostAddress"` + // BPFDisableUnprivileged, if enabled, Felix sets the kernel.unprivileged_bpf_disabled sysctl to disable // unprivileged use of BPF. This ensures that unprivileged users cannot access Calico's BPF maps and // cannot insert their own BPF programs to interfere with Calico's. [Default: true] @@ -716,7 +817,6 @@ type FelixConfigurationSpec struct { // BPFJITHardening controls BPF JIT hardening. When set to "Auto", Felix will set JIT hardening to 1 // if it detects the current value is 2 (strict mode that hurts performance). When set to "Strict", // Felix will not modify the JIT hardening setting. [Default: Auto] - // +kubebuilder:validation:Enum=Auto;Strict BPFJITHardening *BPFJITHardeningType `json:"bpfJITHardening,omitempty" validate:"omitempty,oneof=Auto Strict"` // BPFLogLevel controls the log level of the BPF programs when in BPF dataplane mode. One of "Off", "Info", or @@ -724,7 +824,7 @@ type FelixConfigurationSpec struct { // [Default: Off]. // +optional // +kubebuilder:validation:Pattern=`^(?i)(Off|Info|Debug)?$` - BPFLogLevel string `json:"bpfLogLevel"` + BPFLogLevel string `json:"bpfLogLevel,omitempty"` // BPFConntrackLogLevel controls the log level of the BPF conntrack cleanup program, which runs periodically // to clean up expired BPF conntrack entries. @@ -807,10 +907,12 @@ type FelixConfigurationSpec struct { // balancer. The connect-time load balancer is required for the host to be able to reach Kubernetes services // and it improves the performance of pod-to-service connections.When set to TCP, connect time load balancing // is available only for services with TCP ports. [Default: TCP] + // +kubebuilder:default=TCP BPFConnectTimeLoadBalancing *BPFConnectTimeLBType `json:"bpfConnectTimeLoadBalancing,omitempty" validate:"omitempty,oneof=TCP Enabled Disabled"` // BPFHostNetworkedNATWithoutCTLB when in BPF mode, controls whether Felix does a NAT without CTLB. This along with BPFConnectTimeLoadBalancing // determines the CTLB behavior. [Default: Enabled] + // +kubebuilder:default=Enabled BPFHostNetworkedNATWithoutCTLB *BPFHostNetworkedNATType `json:"bpfHostNetworkedNATWithoutCTLB,omitempty" validate:"omitempty,oneof=Enabled Disabled"` // BPFExternalServiceMode in BPF mode, controls how connections from outside the cluster to services (node ports @@ -829,6 +931,8 @@ type FelixConfigurationSpec struct { // BPFExtToServiceConnmark in BPF mode, controls a 32bit mark that is set on connections from an // external client to a local service. This mark allows us to control how packets of that // connection are routed within the host and how is routing interpreted by RPF check. [Default: 0] + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=4294967295 BPFExtToServiceConnmark *int `json:"bpfExtToServiceConnmark,omitempty" validate:"omitempty,gte=0,lte=4294967295"` // BPFKubeProxyIptablesCleanupEnabled, if enabled in BPF mode, Felix will proactively clean up the upstream @@ -845,6 +949,8 @@ type FelixConfigurationSpec struct { // BPFKubeProxyHealthzPort, in BPF mode, controls the port that Felix's embedded kube-proxy health check server binds to. // The health check server is used by external load balancers to determine if this node should receive traffic. // Set to 0 to disable the health check server. [Default: 10256] + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=65535 BPFKubeProxyHealthzPort *int `json:"bpfKubeProxyHealthzPort,omitempty" validate:"omitempty,gte=0,lte=65535" confignamev1:"BPFKubeProxyHealthzPort"` // BPFPSNATPorts sets the range from which we randomly pick a port if there is a source port @@ -976,10 +1082,15 @@ type FelixConfigurationSpec struct { BPFRedirectToPeer string `json:"bpfRedirectToPeer,omitempty"` // BPFAttachType controls how are the BPF programs at the network interfaces attached. - // By default `TCX` is used where available to enable easier coexistence with 3rd party programs. - // `TC` can force the legacy method of attaching via a qdisc. `TCX` falls back to `TC` if `TCX` is not available. - // [Default: TCX] - BPFAttachType *BPFAttachOption `json:"bpfAttachType,omitempty" validate:"omitempty,oneof=TC TCX"` + // By default `Netkit` is used, which attaches via the netkit API on workload interfaces that are + // netkit devices and via `TCX` on every other interface. `TCX` is used where available to enable + // easier coexistence with 3rd party programs. `TC` can force the legacy method of attaching via a + // qdisc. `TCX` falls back to `TC` if `TCX` is not available. + // Setting this to `TCX` or `TC` also makes Felix drive existing netkit devices with that mechanism + // instead of the netkit API, which is required before downgrading to a release without netkit + // support. + // [Default: Netkit] + BPFAttachType *BPFAttachOption `json:"bpfAttachType,omitempty" validate:"omitempty,oneof=TC TCX Netkit"` // FlowLogsFlushInterval configures the interval at which Felix exports flow logs. // +kubebuilder:validation:Type=string @@ -1024,19 +1135,27 @@ type FelixConfigurationSpec struct { // Route Priority value for a normal priority Calico-programmed IPv4 route. Note, higher // values mean lower priority. [Default: 1024] + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=2147483646 IPv4NormalRoutePriority *int `json:"ipv4NormalRoutePriority,omitempty" validate:"omitempty,gte=1,lte=2147483646"` // Route Priority value for an elevated priority Calico-programmed IPv4 route. Note, higher // values mean lower priority. Elevated priority is used during VM live migration, and for // optimal behaviour IPv4ElevatedRoutePriority must be less than IPv4NormalRoutePriority // [Default: 512] + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=2147483646 IPv4ElevatedRoutePriority *int `json:"ipv4ElevatedRoutePriority,omitempty" validate:"omitempty,gte=1,lte=2147483646"` // Route Priority value for a normal priority Calico-programmed IPv6 route. Note, higher // values mean lower priority. [Default: 1024] + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=2147483646 IPv6NormalRoutePriority *int `json:"ipv6NormalRoutePriority,omitempty" validate:"omitempty,gte=1,lte=2147483646"` // Route Priority value for an elevated priority Calico-programmed IPv6 route. Note, higher // values mean lower priority. Elevated priority is used during VM live migration, and for // optimal behaviour IPv6ElevatedRoutePriority must be less than IPv6NormalRoutePriority // [Default: 512] + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=2147483646 IPv6ElevatedRoutePriority *int `json:"ipv6ElevatedRoutePriority,omitempty" validate:"omitempty,gte=1,lte=2147483646"` // LiveMigrationRouteConvergenceTime is the time to keep elevated route priority after a // VM live migration completes. This allows routes to converge across the cluster before @@ -1058,12 +1177,18 @@ type FelixConfigurationSpec struct { // Workaround: Make sure your Linux kernel [includes this patch](https://github.com/torvalds/linux/commit/56364c910691f6d10ba88c964c9041b9ab777bd6) to unwedge NAPI. WireguardThreadingEnabled *bool `json:"wireguardThreadingEnabled,omitempty"` // WireguardListeningPort controls the listening port used by IPv4 Wireguard. [Default: 51820] + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=65535 WireguardListeningPort *int `json:"wireguardListeningPort,omitempty" validate:"omitempty,gt=0,lte=65535"` // WireguardListeningPortV6 controls the listening port used by IPv6 Wireguard. [Default: 51821] + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=65535 WireguardListeningPortV6 *int `json:"wireguardListeningPortV6,omitempty" validate:"omitempty,gt=0,lte=65535"` // WireguardRoutingRulePriority controls the priority value to use for the Wireguard routing rule. [Default: 99] + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=32765 WireguardRoutingRulePriority *int `json:"wireguardRoutingRulePriority,omitempty" validate:"omitempty,gt=0,lt=32766"` // WireguardInterfaceName specifies the name to use for the IPv4 Wireguard interface. [Default: wireguard.cali] @@ -1114,6 +1239,7 @@ type FelixConfigurationSpec struct { // floating IPs are always programmed, regardless of this setting.) // // +optional + // +kubebuilder:default=Disabled FloatingIPs *FloatingIPType `json:"floatingIPs,omitempty" validate:"omitempty"` // LocalSubnetL2Reachability controls whether Felix automatically responds to @@ -1182,6 +1308,8 @@ type FelixConfigurationSpec struct { // // [Default: 100] // +optional + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=3000 BPFMaglevMaxEndpointsPerService *int `json:"bpfMaglevMaxEndpointsPerService,omitempty" validate:"omitempty,gt=0,lte=3000"` // BPFMaglevMaxServices is the maximum number of expected Maglev-enabled @@ -1189,6 +1317,8 @@ type FelixConfigurationSpec struct { // // [Default: 100] // +optional + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=3000 BPFMaglevMaxServices *int `json:"bpfMaglevMaxServices,omitempty" validate:"omitempty,gt=0,lte=3000"` } diff --git a/pkg/apis/projectcalico/v3/globalnetworkset.go b/pkg/apis/projectcalico/v3/globalnetworkset.go index ab771f8a6..151ca40f6 100644 --- a/pkg/apis/projectcalico/v3/globalnetworkset.go +++ b/pkg/apis/projectcalico/v3/globalnetworkset.go @@ -52,6 +52,9 @@ type GlobalNetworkSetSpec struct { // The list of IP networks that belong to this set. Each entry must be in CIDR notation, // e.g. "192.168.1.0/24". To include a single IP address, use a /32 (IPv4) or /128 (IPv6) mask. // +listType=set + // +kubebuilder:validation:items:MaxLength=49 + // +kubebuilder:validation:MaxItems=100000 + // +kubebuilder:validation:XValidation:rule="self.all(n, isCIDR(n) || isIP(n))",message="nets entries must be IP addresses or CIDRs",reason=FieldValueInvalid Nets []string `json:"nets,omitempty" validate:"omitempty,dive,cidr"` } diff --git a/pkg/apis/projectcalico/v3/hostendpoint.go b/pkg/apis/projectcalico/v3/hostendpoint.go index b7df9c242..ff2a4c089 100644 --- a/pkg/apis/projectcalico/v3/hostendpoint.go +++ b/pkg/apis/projectcalico/v3/hostendpoint.go @@ -97,6 +97,7 @@ type HostEndpointSpec struct { Ports []EndpointPort `json:"ports,omitempty" validate:"dive"` } +// +kubebuilder:validation:XValidation:rule="type(self.protocol) == int ? self.protocol in [6, 17, 132] : self.protocol in ['TCP', 'UDP', 'SCTP']",message="protocol must be one of TCP, UDP, SCTP, or their numbers 6, 17, 132",reason=FieldValueInvalid type EndpointPort struct { Name string `json:"name" validate:"portName"` Protocol numorstring.Protocol `json:"protocol"` diff --git a/pkg/apis/projectcalico/v3/ippool.go b/pkg/apis/projectcalico/v3/ippool.go index 49eb14ab2..f13871a1f 100644 --- a/pkg/apis/projectcalico/v3/ippool.go +++ b/pkg/apis/projectcalico/v3/ippool.go @@ -92,19 +92,26 @@ type IPPoolStatus struct { // +kubebuilder:validation:XValidation:rule="!has(self.allowedUses) || !self.allowedUses.exists(u, u == 'Tunnel') || !has(self.namespaceSelector) || size(self.namespaceSelector) == 0",message="IP Pool with AllowedUse Tunnel cannot have namespaceSelector",reason=FieldValueForbidden // +kubebuilder:validation:XValidation:rule="!has(self.nodeSelector) || !self.nodeSelector.contains('global(')",message="global() selector is not valid for IPPool nodeSelector",reason=FieldValueInvalid // +kubebuilder:validation:XValidation:rule="!has(self.namespaceSelector) || !self.namespaceSelector.contains('global(')",message="global() selector is not valid for IPPool namespaceSelector",reason=FieldValueInvalid +// +kubebuilder:validation:XValidation:rule="cidr(self.cidr) == cidr(self.cidr).masked()",message="IPPool CIDR must be strictly masked",reason=FieldValueInvalid +// +kubebuilder:validation:XValidation:rule="!cidr('169.254.0.0/16').containsIP(cidr(self.cidr).ip()) && !cidr(self.cidr).containsIP('169.254.0.0')",message="IPPool CIDR overlaps with IPv4 link local range 169.254.0.0/16",reason=FieldValueInvalid +// +kubebuilder:validation:XValidation:rule="!cidr('fe80::/10').containsIP(cidr(self.cidr).ip()) && !cidr(self.cidr).containsIP('fe80::')",message="IPPool CIDR overlaps with IPv6 link local range fe80::/10",reason=FieldValueInvalid +// +kubebuilder:validation:XValidation:rule="!has(self.blockSize) || self.blockSize == 0 || (cidr(self.cidr).ip().family() == 4 ? self.blockSize >= 20 && self.blockSize <= 32 : self.blockSize >= 116 && self.blockSize <= 128)",message="blockSize must be between 20 and 32 for IPv4 pools, and between 116 and 128 for IPv6 pools",reason=FieldValueInvalid +// +kubebuilder:validation:XValidation:rule="(has(self.disabled) && self.disabled) || cidr(self.cidr).prefixLength() <= (has(self.blockSize) && self.blockSize != 0 ? self.blockSize : (cidr(self.cidr).ip().family() == 4 ? 26 : 122))",message="IP pool size is too small for use with Calico IPAM. It must be equal to or greater than the block size.",reason=FieldValueInvalid type IPPoolSpec struct { // The pool CIDR. // +kubebuilder:validation:Required // +kubebuilder:validation:Format=cidr - // +kubebuilder:validation:MaxLength=48 + // +kubebuilder:validation:MaxLength=49 // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="CIDR cannot be changed; follow IP pool migration guide to avoid corruption.",reason=FieldValueInvalid CIDR string `json:"cidr" validate:"net"` // Contains configuration for VXLAN tunneling for this pool. + // +kubebuilder:default=Never VXLANMode VXLANMode `json:"vxlanMode,omitempty"` // Contains configuration for IPIP tunneling for this pool. // For IPv6 pools, IPIP tunneling must be disabled. + // +kubebuilder:default=Never IPIPMode IPIPMode `json:"ipipMode,omitempty"` // When natOutgoing is true, packets sent from Calico networked containers in @@ -118,8 +125,8 @@ type IPPoolSpec struct { DisableBGPExport bool `json:"disableBGPExport,omitempty" validate:"omitempty"` // The block size to use for IP address assignments from this pool. Defaults to 26 for IPv4 and 122 for IPv6. - // The block size must be between 0 and 32 for IPv4 and between 0 and 128 for IPv6. It must also be smaller than - // or equal to the size of the pool CIDR. + // The block size must be between 20 and 32 for IPv4 and between 116 and 128 for IPv6. It must also be smaller + // than or equal to the size of the pool CIDR. // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=128 // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Block size cannot be changed; follow IP pool migration guide to avoid corruption.",reason=FieldValueInvalid diff --git a/pkg/apis/projectcalico/v3/ipreservation.go b/pkg/apis/projectcalico/v3/ipreservation.go index 994911770..6a39a0a65 100644 --- a/pkg/apis/projectcalico/v3/ipreservation.go +++ b/pkg/apis/projectcalico/v3/ipreservation.go @@ -1,4 +1,4 @@ -// Copyright (c) 2017, 2021 Tigera, Inc. All rights reserved. +// Copyright (c) 2017-2026 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -57,7 +57,7 @@ type IPReservationSpec struct { // ReservedCIDRs is a list of CIDRs that Calico IPAM will exclude from new allocations. // Each entry must be in CIDR notation (e.g., "10.0.0.0/24" or "10.0.0.1/32" for a single IP). // +listType=set - // +kubebuilder:validation:Format=cidr + // +kubebuilder:validation:items:Format=cidr ReservedCIDRs []string `json:"reservedCIDRs,omitempty" validate:"cidrs,omitempty"` } diff --git a/pkg/apis/projectcalico/v3/kubecontrollersconfig.go b/pkg/apis/projectcalico/v3/kubecontrollersconfig.go index b4da9dfbc..5fef4ba36 100644 --- a/pkg/apis/projectcalico/v3/kubecontrollersconfig.go +++ b/pkg/apis/projectcalico/v3/kubecontrollersconfig.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2021 Tigera, Inc. All rights reserved. +// Copyright (c) 2020-2026 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -78,6 +78,7 @@ type KubeControllersConfigurationSpec struct { // PrometheusMetricsPort is the TCP port that the Prometheus metrics server should bind to. Set to 0 to disable. [Default: 9094] // Valid values are: 0-65535. + // +kubebuilder:default=9094 // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=65535 PrometheusMetricsPort *int `json:"prometheusMetricsPort,omitempty"` @@ -92,6 +93,17 @@ type KubeControllersConfigurationSpec struct { // +kubebuilder:validation:Maximum=65535 // +optional DebugProfilePort *int32 `json:"debugProfilePort,omitempty"` + + // DebugProfileHost is the host IP or hostname to bind the profiling port to. Set to "0.0.0.0" + // for all interfaces to make profiles reachable from off-host. The profiling endpoints are + // unauthenticated and expose heap dumps, goroutine stacks and CPU profiles, so prefer the + // default and use kubectl port-forward for remote access. Only used if DebugProfilePort is set. + // [Default: localhost] + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=64 + // +kubebuilder:validation:Pattern=`^[a-zA-Z0-9:._+-]+$` + // +optional + DebugProfileHost *string `json:"debugProfileHost,omitempty"` } // ControllersConfig enables and configures individual Kubernetes controllers @@ -155,7 +167,7 @@ type AutoHostEndpointConfig struct { // Templates contains definition for creating AutoHostEndpoints // +listType=atomic - Templates []Template `json:"templates,omitempty" validate:"omitempty"` + Templates []Template `json:"templates,omitempty" validate:"omitempty,dive"` } // DefaultHostEndpointMode controls whether a default host endpoint is created for each node. @@ -185,6 +197,9 @@ type Template struct { // Labels adds the specified labels to the generated AutoHostEndpoint, labels from node with the same name will be overwritten by values from the template label Labels map[string]string `json:"labels,omitempty" validate:"omitempty,labels"` + // Annotations adds the specified annotations to the generated AutoHostEndpoint. + Annotations map[string]string `json:"annotations,omitempty"` + // NodeSelector allows the AutoHostEndpoint to be created only for specific nodes NodeSelector string `json:"nodeSelector,omitempty" validate:"omitempty,selector"` } diff --git a/pkg/apis/projectcalico/v3/networkset.go b/pkg/apis/projectcalico/v3/networkset.go index f2dd35587..fdbfb5b44 100644 --- a/pkg/apis/projectcalico/v3/networkset.go +++ b/pkg/apis/projectcalico/v3/networkset.go @@ -49,6 +49,9 @@ type NetworkSetSpec struct { // The list of IP networks that belong to this set. Each entry must be in CIDR notation, // e.g. "192.168.1.0/24". To include a single IP address, use a /32 (IPv4) or /128 (IPv6) mask. // +listType=set + // +kubebuilder:validation:items:MaxLength=49 + // +kubebuilder:validation:MaxItems=100000 + // +kubebuilder:validation:XValidation:rule="self.all(n, isCIDR(n) || isIP(n))",message="nets entries must be IP addresses or CIDRs",reason=FieldValueInvalid Nets []string `json:"nets,omitempty" validate:"omitempty,dive,cidr"` } diff --git a/pkg/apis/projectcalico/v3/nodestatus.go b/pkg/apis/projectcalico/v3/nodestatus.go index 50ec643ad..c87b7c9d2 100644 --- a/pkg/apis/projectcalico/v3/nodestatus.go +++ b/pkg/apis/projectcalico/v3/nodestatus.go @@ -65,6 +65,8 @@ type CalicoNodeStatusSpec struct { // UpdatePeriodSeconds is the period at which CalicoNodeStatus should be updated. // Set to 0 to disable CalicoNodeStatus refresh. Maximum update period is one day. + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=86400 UpdatePeriodSeconds *uint32 `json:"updatePeriodSeconds,omitempty" validate:"required,gte=0,lte=86400"` } diff --git a/pkg/apis/projectcalico/v3/policy_common.go b/pkg/apis/projectcalico/v3/policy_common.go index 398aa18e7..748c97859 100644 --- a/pkg/apis/projectcalico/v3/policy_common.go +++ b/pkg/apis/projectcalico/v3/policy_common.go @@ -42,6 +42,8 @@ const ( // +kubebuilder:validation:XValidation:rule="(!has(self.protocol) || (self.protocol != 'ICMPv6' && self.protocol != 58)) || !has(self.ipVersion) || self.ipVersion == 6",message="protocol ICMPv6 requires ipVersion 6",reason=FieldValueInvalid // +kubebuilder:validation:XValidation:rule="(!has(self.notProtocol) || (self.notProtocol != 'ICMP' && self.notProtocol != 1)) || !has(self.ipVersion) || self.ipVersion == 4",message="protocol ICMP requires ipVersion 4",reason=FieldValueInvalid // +kubebuilder:validation:XValidation:rule="(!has(self.notProtocol) || (self.notProtocol != 'ICMPv6' && self.notProtocol != 58)) || !has(self.ipVersion) || self.ipVersion == 6",message="protocol ICMPv6 requires ipVersion 6",reason=FieldValueInvalid +// +kubebuilder:validation:XValidation:rule="!has(self.protocol) || (type(self.protocol) == int ? self.protocol >= 1 && self.protocol <= 255 : self.protocol in ['TCP', 'UDP', 'ICMP', 'ICMPv6', 'SCTP', 'UDPLite'])",message="protocol must be a name (TCP, UDP, ICMP, ICMPv6, SCTP, UDPLite) or a number in 1-255",reason=FieldValueInvalid +// +kubebuilder:validation:XValidation:rule="!has(self.notProtocol) || (type(self.notProtocol) == int ? self.notProtocol >= 1 && self.notProtocol <= 255 : self.notProtocol in ['TCP', 'UDP', 'ICMP', 'ICMPv6', 'SCTP', 'UDPLite'])",message="protocol must be a name (TCP, UDP, ICMP, ICMPv6, SCTP, UDPLite) or a number in 1-255",reason=FieldValueInvalid type Rule struct { Action Action `json:"action"` diff --git a/pkg/apis/projectcalico/v3/zz_generated.deepcopy.go b/pkg/apis/projectcalico/v3/zz_generated.deepcopy.go index bcfe9f256..3ce453b2f 100644 --- a/pkg/apis/projectcalico/v3/zz_generated.deepcopy.go +++ b/pkg/apis/projectcalico/v3/zz_generated.deepcopy.go @@ -1462,6 +1462,11 @@ func (in *FelixConfigurationSpec) DeepCopyInto(out *FelixConfigurationSpec) { *out = new(int) **out = **in } + if in.LogConnectionTransitions != nil { + in, out := &in.LogConnectionTransitions, &out.LogConnectionTransitions + *out = new(LogConnectionTransitionsMode) + **out = **in + } if in.IPIPEnabled != nil { in, out := &in.IPIPEnabled, &out.IPIPEnabled *out = new(bool) @@ -1728,6 +1733,11 @@ func (in *FelixConfigurationSpec) DeepCopyInto(out *FelixConfigurationSpec) { *out = new(NFTablesMode) **out = **in } + if in.NFTablesFlowTableOffload != nil { + in, out := &in.NFTablesFlowTableOffload, &out.NFTablesFlowTableOffload + *out = new(NFTablesFlowTableOffload) + **out = **in + } if in.NftablesRefreshInterval != nil { in, out := &in.NftablesRefreshInterval, &out.NftablesRefreshInterval *out = new(v1.Duration) @@ -1743,6 +1753,11 @@ func (in *FelixConfigurationSpec) DeepCopyInto(out *FelixConfigurationSpec) { *out = new(bool) **out = **in } + if in.BPFOverlayHostSourceIP != nil { + in, out := &in.BPFOverlayHostSourceIP, &out.BPFOverlayHostSourceIP + *out = new(BPFOverlayHostSourceIPType) + **out = **in + } if in.BPFDisableUnprivileged != nil { in, out := &in.BPFDisableUnprivileged, &out.BPFDisableUnprivileged *out = new(bool) @@ -3045,6 +3060,11 @@ func (in *KubeControllersConfigurationSpec) DeepCopyInto(out *KubeControllersCon *out = new(int32) **out = **in } + if in.DebugProfileHost != nil { + in, out := &in.DebugProfileHost, &out.DebugProfileHost + *out = new(string) + **out = **in + } return } @@ -4066,6 +4086,13 @@ func (in *Template) DeepCopyInto(out *Template) { (*out)[key] = val } } + 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 } diff --git a/pkg/client/applyconfiguration_generated/internal/internal.go b/pkg/client/applyconfiguration_generated/internal/internal.go index 90c78b289..2872739c7 100644 --- a/pkg/client/applyconfiguration_generated/internal/internal.go +++ b/pkg/client/applyconfiguration_generated/internal/internal.go @@ -926,7 +926,6 @@ var schemaYAML = typed.YAMLObject(`types: - name: bpfLogLevel type: scalar: string - default: "" - name: bpfMaglevMaxEndpointsPerService type: scalar: numeric @@ -963,6 +962,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: bpfMapSizeRoute type: scalar: numeric + - name: bpfOverlayHostSourceIP + type: + scalar: string - name: bpfPSNATPorts type: namedType: com.github.projectcalico.api.pkg.lib.numorstring.Port @@ -1191,6 +1193,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: logActionRateLimitBurst type: scalar: numeric + - name: logConnectionTransitions + type: + scalar: string + - name: logConnectionTransitionsPrefix + type: + scalar: string - name: logDebugFilenameRegex type: scalar: string @@ -1239,6 +1247,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: nftablesFilterDenyAction type: scalar: string + - name: nftablesFlowTableDataIfacePattern + type: + scalar: string + - name: nftablesFlowTableOffload + type: + scalar: string - name: nftablesMangleAllowAction type: scalar: string @@ -1845,6 +1859,9 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: com.github.projectcalico.api.pkg.apis.projectcalico.v3.ControllersConfig default: {} + - name: debugProfileHost + type: + scalar: string - name: debugProfilePort type: scalar: numeric @@ -2347,6 +2364,11 @@ var schemaYAML = typed.YAMLObject(`types: - name: com.github.projectcalico.api.pkg.apis.projectcalico.v3.Template map: fields: + - name: annotations + type: + map: + elementType: + scalar: string - name: generateName type: scalar: string diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/bgpconfiguration.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/bgpconfiguration.go index 1b4dc3834..fa977406b 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/bgpconfiguration.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/bgpconfiguration.go @@ -16,7 +16,7 @@ import ( // BGPConfigurationApplyConfiguration represents a declarative configuration of the BGPConfiguration type for use // with apply. type BGPConfigurationApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *BGPConfigurationSpecApplyConfiguration `json:"spec,omitempty"` } diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/bgpconfigurationspec.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/bgpconfigurationspec.go index 7075ad242..a70ffa206 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/bgpconfigurationspec.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/bgpconfigurationspec.go @@ -60,10 +60,28 @@ type BGPConfigurationSpecApplyConfiguration struct { // The virtual IPv6 address of the node with which its local workload is expected to peer. // It is recommended to use a link-local address. LocalWorkloadPeeringIPV6 *string `json:"localWorkloadPeeringIPV6,omitempty"` - // ProgramClusterRoutes controls how a cluster node gets a route to a workload on another node, - // when that workload's IP comes from an IP Pool with vxlanMode: Never. When ProgramClusterRoutes is Enabled, - // confd and BIRD program that route. When ProgramClusterRoutes is Disabled, it is expected that Felix will program that route. - // Felix always programs such routes for IP Pools with vxlanMode: Always or vxlanMode: CrossSubnet. [Default: Enabled] + // ProgramClusterRoutes controls which "cluster routes" are programmed by Calico's BGP + // stack, i.e. the routes that a node needs in order to reach workloads on other nodes. It + // only applies to IP Pools with vxlanMode: Never; the cluster routes for IP Pools with + // vxlanMode: Always or vxlanMode: CrossSubnet are always programmed by Felix. The routes + // that BIRD does not program here are expected to be programmed by Felix instead. Below, + // an IPIP IP Pool is one with ipipMode: Always or CrossSubnet, and an unencapsulated one + // has ipipMode and vxlanMode both Never. + // + // - Disabled: BIRD programs no cluster routes. + // - EnabledNoEncapOnly: BIRD programs them for unencapsulated IP Pools. + // - EnabledIPIPOnly: BIRD programs them for IPIP IP Pools. + // - Enabled: BIRD programs them for both. + // + // This field must be kept consistent with FelixConfiguration.ProgramClusterRoutes, which + // makes the same choice from Felix's side. If both Felix and BIRD are enabled for the same + // kind of IP Pool they will fight over the routes; if neither is, there will be no cluster + // routes at all. + // + // Note: asking BIRD to program IPIP cluster routes, which the Enabled and EnabledIPIPOnly + // values do, is deprecated as of v3.33 and will be removed in v3.35. + // + // [Default: EnabledNoEncapOnly] ProgramClusterRoutes *string `json:"programClusterRoutes,omitempty"` // IPv4NormalRoutePriority is the normal route priority (metric) that Felix uses for IPv4 // workload routes. This must match the value configured in FelixConfiguration. BIRD uses diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/bgpfilter.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/bgpfilter.go index 52c47d7bf..1a65ba64d 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/bgpfilter.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/bgpfilter.go @@ -16,7 +16,7 @@ import ( // BGPFilterApplyConfiguration represents a declarative configuration of the BGPFilter type for use // with apply. type BGPFilterApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *BGPFilterSpecApplyConfiguration `json:"spec,omitempty"` } diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/bgppeer.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/bgppeer.go index 8f8f5c13e..6d10de3de 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/bgppeer.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/bgppeer.go @@ -16,7 +16,7 @@ import ( // BGPPeerApplyConfiguration represents a declarative configuration of the BGPPeer type for use // with apply. type BGPPeerApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *BGPPeerSpecApplyConfiguration `json:"spec,omitempty"` } diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/blockaffinity.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/blockaffinity.go index cc03f8675..b0d7e7721 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/blockaffinity.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/blockaffinity.go @@ -18,7 +18,7 @@ import ( // // BlockAffinity maintains a block affinity's state type BlockAffinityApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *BlockAffinitySpecApplyConfiguration `json:"spec,omitempty"` } diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/caliconodestatus.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/caliconodestatus.go index f541eb118..13f8f9e7b 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/caliconodestatus.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/caliconodestatus.go @@ -16,7 +16,7 @@ import ( // CalicoNodeStatusApplyConfiguration represents a declarative configuration of the CalicoNodeStatus type for use // with apply. type CalicoNodeStatusApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *CalicoNodeStatusSpecApplyConfiguration `json:"spec,omitempty"` Status *CalicoNodeStatusStatusApplyConfiguration `json:"status,omitempty"` diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/clusterinformation.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/clusterinformation.go index 7cc1009fd..9cdec78a0 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/clusterinformation.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/clusterinformation.go @@ -16,7 +16,7 @@ import ( // ClusterInformationApplyConfiguration represents a declarative configuration of the ClusterInformation type for use // with apply. type ClusterInformationApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ClusterInformationSpecApplyConfiguration `json:"spec,omitempty"` } diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/felixconfiguration.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/felixconfiguration.go index a975323fc..bda5cd394 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/felixconfiguration.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/felixconfiguration.go @@ -16,7 +16,7 @@ import ( // FelixConfigurationApplyConfiguration represents a declarative configuration of the FelixConfiguration type for use // with apply. type FelixConfigurationApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *FelixConfigurationSpecApplyConfiguration `json:"spec,omitempty"` } diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/felixconfigurationspec.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/felixconfigurationspec.go index 133b570a8..38ce570d1 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/felixconfigurationspec.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/felixconfigurationspec.go @@ -151,9 +151,32 @@ type FelixConfigurationSpecApplyConfiguration struct { LogPrefix *string `json:"logPrefix,omitempty"` // LogActionRateLimit sets the rate of hitting a Log action. The value must be in the format "N/unit", // where N is a number and unit is one of: second, minute, hour, or day. For example: "10/second" or "100/hour". + // When LogConnectionTransitions is enabled, this also bounds the follow-up logs: a connection whose + // initial log was suppressed by this rate limit gets no follow-up log either. LogActionRateLimit *string `json:"logActionRateLimit,omitempty"` // LogActionRateLimitBurst sets the rate limit burst of hitting a Log action when LogActionRateLimit is enabled. LogActionRateLimitBurst *int `json:"logActionRateLimitBurst,omitempty"` + // LogConnectionTransitions controls whether Felix emits an additional kernel log recording the + // first observed response for each connection that matched a policy rule with a Log action. + // When set to FirstResponseAfterLog, each connection whose initial log was emitted gets one + // follow-up log, prefixed with LogConnectionTransitionsPrefix plus a suffix identifying the + // transition: "-est" when the first reply packet is seen, "-rst" when the response is a TCP + // RST (connection refused), or "-icmp-err" when the response is a related ICMP error (e.g. + // port unreachable). The log body is the standard kernel packet log of the response packet. + // For "-est" and "-rst" its 5-tuple is the original policy Log line's with source and + // destination swapped; for "-icmp-err" the bracketed inner header carries the original + // 5-tuple unswapped. A logged connection with no follow-up log never received a response. + // Connections whose initial log was suppressed by LogActionRateLimit get no follow-up log + // either, so every follow-up log pairs with an initial one. Enabling this consumes one bit + // from the Iptables/NftablesMarkMask space. Not supported in eBPF mode. + // [Default: Disabled] + LogConnectionTransitions *projectcalicov3.LogConnectionTransitionsMode `json:"logConnectionTransitions,omitempty"` + // LogConnectionTransitionsPrefix is the log prefix used for the logs emitted when + // LogConnectionTransitions is enabled; the transition suffix ("-est", "-rst" or "-icmp-err") + // is appended to it. Unlike LogPrefix, it does not support %-specifiers (such as %p): the + // rules that emit these logs are shared by all policies, so per-policy values cannot be + // substituted and any %-specifiers are rendered literally. [Default: calico-response] + LogConnectionTransitionsPrefix *string `json:"logConnectionTransitionsPrefix,omitempty"` // LogFilePath is the full path to the Felix log. Set to none to disable file logging. [Default: /var/log/calico/felix.log] LogFilePath *string `json:"logFilePath,omitempty"` // LogSeverityFile is the log severity above which logs are sent to the log file. [Default: Info] @@ -254,7 +277,7 @@ type FelixConfigurationSpecApplyConfiguration struct { // used for securing the /metrics endpoint. The private key must be valid and accessible by the calico-node process. PrometheusMetricsKeyFile *string `json:"prometheusMetricsKeyFile,omitempty"` // PrometheusMetricsClientAuth specifies the client authentication type for the /metrics endpoint. - // This determines how the server validates client certificates. Default is "RequireAndVerifyClientCert". + // This determines how the server validates client certificates. Default is "NoClientCert". PrometheusMetricsClientAuth *projectcalicov3.PrometheusMetricsClientAuthType `json:"prometheusMetricsClientAuth,omitempty"` // FailsafeInboundHostPorts is a list of ProtoPort struct objects including UDP/TCP/SCTP ports and CIDRs that Felix will // allow incoming traffic to host endpoints on irrespective of the security policy. This is useful to avoid accidentally @@ -310,10 +333,28 @@ type FelixConfigurationSpecApplyConfiguration struct { // always clean up expected routes that use the configured DeviceRouteProtocol. To add your own routes, you must // use a distinct protocol (in addition to setting this field to false). RemoveExternalRoutes *bool `json:"removeExternalRoutes,omitempty"` - // ProgramClusterRoutes controls how a cluster node gets a route to a workload on another node, - // when that workload's IP comes from an IP Pool with vxlanMode: Never. When ProgramClusterRoutes is Disabled, - // it is expected that confd and BIRD will program that route. When ProgramClusterRoutes is Enabled, Felix program that route. - // Felix always programs such routes for IP Pools with vxlanMode: Always or vxlanMode: CrossSubnet. [Default: Disabled] + // ProgramClusterRoutes controls which "cluster routes" Felix programs, i.e. the routes that + // a node needs in order to reach workloads on other nodes. It only applies to IP Pools + // with vxlanMode: Never; Felix always programs the cluster routes for IP Pools with + // vxlanMode: Always or vxlanMode: CrossSubnet. The routes that Felix does not program here + // are expected to be programmed by Calico's BGP stack instead. Below, an IPIP IP Pool is + // one with ipipMode: Always or CrossSubnet, and an unencapsulated one has ipipMode and + // vxlanMode both Never. + // + // - Disabled: Felix programs no cluster routes. + // - EnabledIPIPOnly: Felix programs them for IPIP IP Pools. + // - EnabledNoEncapOnly: Felix programs them for unencapsulated IP Pools. + // - Enabled: Felix programs them for both. + // + // This field must be kept consistent with BGPConfiguration.ProgramClusterRoutes, which + // makes the same choice from BIRD's side. If both Felix and BIRD are enabled for the same + // kind of IP Pool they will fight over the routes; if neither is, there will be no cluster + // routes at all. + // + // Note: leaving the IPIP cluster routes to BGP, which the Disabled and EnabledNoEncapOnly + // values do, is deprecated as of v3.33 and will be removed in v3.35. + // + // [Default: EnabledIPIPOnly] ProgramClusterRoutes *string `json:"programClusterRoutes,omitempty"` // IPForwarding controls whether Felix sets the host sysctls to enable IP forwarding. IP forwarding is required // when using Calico for workload networking. This should be disabled only on hosts where Calico is used solely for @@ -358,8 +399,21 @@ type FelixConfigurationSpecApplyConfiguration struct { // modes can use XDP. This is not recommended since it doesn't provide better performance than // iptables. [Default: false] GenericXDPEnabled *bool `json:"genericXDPEnabled,omitempty"` - // NFTablesMode configures nftables support in Felix. [Default: Auto] + // NFTablesMode configures nftables support in Felix. In Auto mode, Felix uses the + // nftables dataplane if kube-proxy is detected to be running in nftables mode. + // [Default: Auto] NFTablesMode *projectcalicov3.NFTablesMode `json:"nftablesMode,omitempty"` + // NFTablesFlowTableOffload controls which traffic nftables flowtable offload is enabled for, + // for improved forwarding performance. When set to "All", established connections accepted by + // Calico policy are offloaded to the kernel's flowtable fast path. Only applies when + // nftables mode is active. [Default: Disabled] + NFTablesFlowTableOffload *projectcalicov3.NFTablesFlowTableOffload `json:"nftablesFlowTableOffload,omitempty"` + // NFTablesFlowTableDataIfacePattern is a regular expression that controls which host + // interfaces are added to the nftables flowtable, so that traffic forwarded between those + // interfaces and local workloads is offloaded to the flowtable fast path. Leave empty to + // offload only workload-to-workload traffic. Only takes effect when NFTablesFlowTableOffload + // is not Disabled. [Default: ""] + NFTablesFlowTableDataIfacePattern *string `json:"nftablesFlowTableDataIfacePattern,omitempty"` // NftablesRefreshInterval controls the interval at which Felix periodically refreshes the nftables rules. [Default: 90s] NftablesRefreshInterval *v1.Duration `json:"nftablesRefreshInterval,omitempty"` // NftablesFilterAllowAction controls the nftables action that Felix uses to represent the "allow" policy verdict @@ -379,6 +433,13 @@ type FelixConfigurationSpecApplyConfiguration struct { NftablesMarkMask *int64 `json:"nftablesMarkMask,omitempty"` // BPFEnabled, if enabled Felix will use the BPF dataplane. [Default: false] BPFEnabled *bool `json:"bpfEnabled,omitempty"` + // BPFOverlayHostSourceIP controls the source IP that Felix uses in BPF mode for host-networked + // (node-originated) traffic egressing over an IPIP/VXLAN overlay tunnel. "TunnelAddress" (the default) + // assigns an IP address to the overlay tunnel device and uses it as the source, preserving the behaviour + // of clusters upgraded from earlier releases. "HostAddress" uses the node's own IP directly and does not + // assign a tunnel device IP. This option has no effect on WireGuard tunnels, which always use a tunnel + // device IP. [Default: TunnelAddress] + BPFOverlayHostSourceIP *projectcalicov3.BPFOverlayHostSourceIPType `json:"bpfOverlayHostSourceIP,omitempty"` // BPFDisableUnprivileged, if enabled, Felix sets the kernel.unprivileged_bpf_disabled sysctl to disable // unprivileged use of BPF. This ensures that unprivileged users cannot access Calico's BPF maps and // cannot insert their own BPF programs to interfere with Calico's. [Default: true] @@ -584,9 +645,14 @@ type FelixConfigurationSpecApplyConfiguration struct { // As a result, packet‑capture tools on the host side of the workload device (for example, tcpdump) will not see that traffic. [Default: Enabled] BPFRedirectToPeer *string `json:"bpfRedirectToPeer,omitempty"` // BPFAttachType controls how are the BPF programs at the network interfaces attached. - // By default `TCX` is used where available to enable easier coexistence with 3rd party programs. - // `TC` can force the legacy method of attaching via a qdisc. `TCX` falls back to `TC` if `TCX` is not available. - // [Default: TCX] + // By default `Netkit` is used, which attaches via the netkit API on workload interfaces that are + // netkit devices and via `TCX` on every other interface. `TCX` is used where available to enable + // easier coexistence with 3rd party programs. `TC` can force the legacy method of attaching via a + // qdisc. `TCX` falls back to `TC` if `TCX` is not available. + // Setting this to `TCX` or `TC` also makes Felix drive existing netkit devices with that mechanism + // instead of the netkit API, which is required before downgrading to a release without netkit + // support. + // [Default: Netkit] BPFAttachType *projectcalicov3.BPFAttachOption `json:"bpfAttachType,omitempty"` // FlowLogsFlushInterval configures the interval at which Felix exports flow logs. FlowLogsFlushInterval *v1.Duration `json:"flowLogsFlushInterval,omitempty"` @@ -683,6 +749,7 @@ type FelixConfigurationSpecApplyConfiguration struct { MTUIfacePattern *string `json:"mtuIfacePattern,omitempty"` // FloatingIPs configures whether or not Felix will program non-OpenStack floating IP addresses. (OpenStack-derived // floating IPs are always programmed, regardless of this setting.) + // FloatingIPs *projectcalicov3.FloatingIPType `json:"floatingIPs,omitempty"` // LocalSubnetL2Reachability controls whether Felix automatically responds to // ARP (IPv4) and NDP (IPv6) requests on host interfaces for local pod IPs and @@ -990,6 +1057,22 @@ func (b *FelixConfigurationSpecApplyConfiguration) WithLogActionRateLimitBurst(v return b } +// WithLogConnectionTransitions sets the LogConnectionTransitions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LogConnectionTransitions field is set to the value of the last call. +func (b *FelixConfigurationSpecApplyConfiguration) WithLogConnectionTransitions(value projectcalicov3.LogConnectionTransitionsMode) *FelixConfigurationSpecApplyConfiguration { + b.LogConnectionTransitions = &value + return b +} + +// WithLogConnectionTransitionsPrefix sets the LogConnectionTransitionsPrefix field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LogConnectionTransitionsPrefix field is set to the value of the last call. +func (b *FelixConfigurationSpecApplyConfiguration) WithLogConnectionTransitionsPrefix(value string) *FelixConfigurationSpecApplyConfiguration { + b.LogConnectionTransitionsPrefix = &value + return b +} + // WithLogFilePath sets the LogFilePath field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LogFilePath field is set to the value of the last call. @@ -1531,6 +1614,22 @@ func (b *FelixConfigurationSpecApplyConfiguration) WithNFTablesMode(value projec return b } +// WithNFTablesFlowTableOffload sets the NFTablesFlowTableOffload field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NFTablesFlowTableOffload field is set to the value of the last call. +func (b *FelixConfigurationSpecApplyConfiguration) WithNFTablesFlowTableOffload(value projectcalicov3.NFTablesFlowTableOffload) *FelixConfigurationSpecApplyConfiguration { + b.NFTablesFlowTableOffload = &value + return b +} + +// WithNFTablesFlowTableDataIfacePattern sets the NFTablesFlowTableDataIfacePattern field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NFTablesFlowTableDataIfacePattern field is set to the value of the last call. +func (b *FelixConfigurationSpecApplyConfiguration) WithNFTablesFlowTableDataIfacePattern(value string) *FelixConfigurationSpecApplyConfiguration { + b.NFTablesFlowTableDataIfacePattern = &value + return b +} + // WithNftablesRefreshInterval sets the NftablesRefreshInterval field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NftablesRefreshInterval field is set to the value of the last call. @@ -1579,6 +1678,14 @@ func (b *FelixConfigurationSpecApplyConfiguration) WithBPFEnabled(value bool) *F return b } +// WithBPFOverlayHostSourceIP sets the BPFOverlayHostSourceIP field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BPFOverlayHostSourceIP field is set to the value of the last call. +func (b *FelixConfigurationSpecApplyConfiguration) WithBPFOverlayHostSourceIP(value projectcalicov3.BPFOverlayHostSourceIPType) *FelixConfigurationSpecApplyConfiguration { + b.BPFOverlayHostSourceIP = &value + return b +} + // WithBPFDisableUnprivileged sets the BPFDisableUnprivileged field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the BPFDisableUnprivileged field is set to the value of the last call. diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/globalnetworkpolicy.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/globalnetworkpolicy.go index db546dfe8..1d7e243b8 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/globalnetworkpolicy.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/globalnetworkpolicy.go @@ -16,7 +16,7 @@ import ( // GlobalNetworkPolicyApplyConfiguration represents a declarative configuration of the GlobalNetworkPolicy type for use // with apply. type GlobalNetworkPolicyApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *GlobalNetworkPolicySpecApplyConfiguration `json:"spec,omitempty"` } diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/globalnetworkset.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/globalnetworkset.go index 1b04e4d13..c80b3b3ef 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/globalnetworkset.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/globalnetworkset.go @@ -16,7 +16,7 @@ import ( // GlobalNetworkSetApplyConfiguration represents a declarative configuration of the GlobalNetworkSet type for use // with apply. type GlobalNetworkSetApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *GlobalNetworkSetSpecApplyConfiguration `json:"spec,omitempty"` } diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/hostendpoint.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/hostendpoint.go index 6215ebf38..50b6beec1 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/hostendpoint.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/hostendpoint.go @@ -16,7 +16,7 @@ import ( // HostEndpointApplyConfiguration represents a declarative configuration of the HostEndpoint type for use // with apply. type HostEndpointApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *HostEndpointSpecApplyConfiguration `json:"spec,omitempty"` } diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/ipamblock.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/ipamblock.go index f2253b770..44039a0fa 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/ipamblock.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/ipamblock.go @@ -16,7 +16,7 @@ import ( // IPAMBlockApplyConfiguration represents a declarative configuration of the IPAMBlock type for use // with apply. type IPAMBlockApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *IPAMBlockSpecApplyConfiguration `json:"spec,omitempty"` } diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/ipamblockspec.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/ipamblockspec.go index 34a4b62ed..e86ab8744 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/ipamblockspec.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/ipamblockspec.go @@ -36,6 +36,7 @@ type IPAMBlockSpecApplyConfiguration struct { // When releasing an IP, passing the sequence number associated with the allocation allows us // to protect against a race condition and ensure the IP hasn't been released and re-allocated // since the release request. + // SequenceNumber *uint64 `json:"sequenceNumber,omitempty"` // Map of allocated ordinal within the block to sequence number of the block at // the time of allocation. Kubernetes does not allow numerical keys for maps, so diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/ipamconfiguration.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/ipamconfiguration.go index 7359b02d5..070701bda 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/ipamconfiguration.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/ipamconfiguration.go @@ -18,7 +18,7 @@ import ( // // IPAMConfiguration contains information about a block for IP address assignment. type IPAMConfigurationApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *IPAMConfigurationSpecApplyConfiguration `json:"spec,omitempty"` } diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/ipamconfigurationspec.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/ipamconfigurationspec.go index 185123a04..a13f99106 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/ipamconfigurationspec.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/ipamconfigurationspec.go @@ -17,6 +17,7 @@ type IPAMConfigurationSpecApplyConfiguration struct { StrictAffinity *bool `json:"strictAffinity,omitempty"` // MaxBlocksPerHost, if non-zero, is the max number of blocks that can be // affine to each host. + // MaxBlocksPerHost *int32 `json:"maxBlocksPerHost,omitempty"` // Whether or not to auto allocate blocks to hosts. AutoAllocateBlocks *bool `json:"autoAllocateBlocks,omitempty"` diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/ipamhandle.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/ipamhandle.go index f68de4476..0c0fc2bce 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/ipamhandle.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/ipamhandle.go @@ -16,7 +16,7 @@ import ( // IPAMHandleApplyConfiguration represents a declarative configuration of the IPAMHandle type for use // with apply. type IPAMHandleApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *IPAMHandleSpecApplyConfiguration `json:"spec,omitempty"` } diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/ippool.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/ippool.go index 5355f5ef6..3c4b86055 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/ippool.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/ippool.go @@ -16,7 +16,7 @@ import ( // IPPoolApplyConfiguration represents a declarative configuration of the IPPool type for use // with apply. type IPPoolApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *IPPoolSpecApplyConfiguration `json:"spec,omitempty"` Status *IPPoolStatusApplyConfiguration `json:"status,omitempty"` diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/ippoolspec.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/ippoolspec.go index 9788bb0ca..4784a1fe1 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/ippoolspec.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/ippoolspec.go @@ -28,8 +28,8 @@ type IPPoolSpecApplyConfiguration struct { // Disable exporting routes from this IP Pool's CIDR over BGP. [Default: false] DisableBGPExport *bool `json:"disableBGPExport,omitempty"` // The block size to use for IP address assignments from this pool. Defaults to 26 for IPv4 and 122 for IPv6. - // The block size must be between 0 and 32 for IPv4 and between 0 and 128 for IPv6. It must also be smaller than - // or equal to the size of the pool CIDR. + // The block size must be between 20 and 32 for IPv4 and between 116 and 128 for IPv6. It must also be smaller + // than or equal to the size of the pool CIDR. BlockSize *int `json:"blockSize,omitempty"` // Allows IPPool to allocate for a specific node by label selector. NodeSelector *string `json:"nodeSelector,omitempty"` diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/ipreservation.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/ipreservation.go index 4a5cc8a6f..bfee162ff 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/ipreservation.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/ipreservation.go @@ -22,7 +22,7 @@ import ( // size of the IP pool. If large portions of an IP pool are reserved, Calico IPAM may hunt for a long time // to find a non-reserved IP. type IPReservationApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *IPReservationSpecApplyConfiguration `json:"spec,omitempty"` } diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/kubecontrollersconfiguration.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/kubecontrollersconfiguration.go index f29f63de9..608483642 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/kubecontrollersconfiguration.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/kubecontrollersconfiguration.go @@ -16,7 +16,7 @@ import ( // KubeControllersConfigurationApplyConfiguration represents a declarative configuration of the KubeControllersConfiguration type for use // with apply. type KubeControllersConfigurationApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *KubeControllersConfigurationSpecApplyConfiguration `json:"spec,omitempty"` Status *KubeControllersConfigurationStatusApplyConfiguration `json:"status,omitempty"` diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/kubecontrollersconfigurationspec.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/kubecontrollersconfigurationspec.go index 60651439b..35f901b64 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/kubecontrollersconfigurationspec.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/kubecontrollersconfigurationspec.go @@ -30,6 +30,12 @@ type KubeControllersConfigurationSpecApplyConfiguration struct { // is disabled. // Valid values are: 0-65535. DebugProfilePort *int32 `json:"debugProfilePort,omitempty"` + // DebugProfileHost is the host IP or hostname to bind the profiling port to. Set to "0.0.0.0" + // for all interfaces to make profiles reachable from off-host. The profiling endpoints are + // unauthenticated and expose heap dumps, goroutine stacks and CPU profiles, so prefer the + // default and use kubectl port-forward for remote access. Only used if DebugProfilePort is set. + // [Default: localhost] + DebugProfileHost *string `json:"debugProfileHost,omitempty"` } // KubeControllersConfigurationSpecApplyConfiguration constructs a declarative configuration of the KubeControllersConfigurationSpec type for use with @@ -85,3 +91,11 @@ func (b *KubeControllersConfigurationSpecApplyConfiguration) WithDebugProfilePor b.DebugProfilePort = &value return b } + +// WithDebugProfileHost sets the DebugProfileHost field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DebugProfileHost field is set to the value of the last call. +func (b *KubeControllersConfigurationSpecApplyConfiguration) WithDebugProfileHost(value string) *KubeControllersConfigurationSpecApplyConfiguration { + b.DebugProfileHost = &value + return b +} diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/networkpolicy.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/networkpolicy.go index 5372f4de4..e3e3f1421 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/networkpolicy.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/networkpolicy.go @@ -16,7 +16,7 @@ import ( // NetworkPolicyApplyConfiguration represents a declarative configuration of the NetworkPolicy type for use // with apply. type NetworkPolicyApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *NetworkPolicySpecApplyConfiguration `json:"spec,omitempty"` } diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/networkset.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/networkset.go index 667bd48c1..59842dfc3 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/networkset.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/networkset.go @@ -16,7 +16,7 @@ import ( // NetworkSetApplyConfiguration represents a declarative configuration of the NetworkSet type for use // with apply. type NetworkSetApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *NetworkSetSpecApplyConfiguration `json:"spec,omitempty"` } diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/profile.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/profile.go index 19b0f5a8a..a64ebebdb 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/profile.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/profile.go @@ -16,7 +16,7 @@ import ( // ProfileApplyConfiguration represents a declarative configuration of the Profile type for use // with apply. type ProfileApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ProfileSpecApplyConfiguration `json:"spec,omitempty"` } diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/stagedglobalnetworkpolicy.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/stagedglobalnetworkpolicy.go index ae0d886c1..a5384f227 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/stagedglobalnetworkpolicy.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/stagedglobalnetworkpolicy.go @@ -18,7 +18,7 @@ import ( // // StagedGlobalNetworkPolicy is a staged GlobalNetworkPolicy. type StagedGlobalNetworkPolicyApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *StagedGlobalNetworkPolicySpecApplyConfiguration `json:"spec,omitempty"` } diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/stagedkubernetesnetworkpolicy.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/stagedkubernetesnetworkpolicy.go index 49f661977..d6f402edc 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/stagedkubernetesnetworkpolicy.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/stagedkubernetesnetworkpolicy.go @@ -18,7 +18,7 @@ import ( // // StagedKubernetesNetworkPolicy is a staged GlobalNetworkPolicy. type StagedKubernetesNetworkPolicyApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *StagedKubernetesNetworkPolicySpecApplyConfiguration `json:"spec,omitempty"` } diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/stagednetworkpolicy.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/stagednetworkpolicy.go index 9b6847e1f..eb7bc2cf6 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/stagednetworkpolicy.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/stagednetworkpolicy.go @@ -19,7 +19,7 @@ import ( // StagedNetworkPolicy is a staged NetworkPolicy. // StagedNetworkPolicy is the Namespaced-equivalent of the StagedGlobalNetworkPolicy. type StagedNetworkPolicyApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *StagedNetworkPolicySpecApplyConfiguration `json:"spec,omitempty"` } diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/template.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/template.go index 6d861a776..b4e6aa981 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/template.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/template.go @@ -18,6 +18,8 @@ type TemplateApplyConfiguration struct { InterfacePattern *string `json:"interfacePattern,omitempty"` // Labels adds the specified labels to the generated AutoHostEndpoint, labels from node with the same name will be overwritten by values from the template label Labels map[string]string `json:"labels,omitempty"` + // Annotations adds the specified annotations to the generated AutoHostEndpoint. + Annotations map[string]string `json:"annotations,omitempty"` // NodeSelector allows the AutoHostEndpoint to be created only for specific nodes NodeSelector *string `json:"nodeSelector,omitempty"` } @@ -68,6 +70,20 @@ func (b *TemplateApplyConfiguration) WithLabels(entries map[string]string) *Temp 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 *TemplateApplyConfiguration) WithAnnotations(entries map[string]string) *TemplateApplyConfiguration { + 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 +} + // WithNodeSelector sets the NodeSelector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the NodeSelector field is set to the value of the last call. diff --git a/pkg/client/applyconfiguration_generated/projectcalico/v3/tier.go b/pkg/client/applyconfiguration_generated/projectcalico/v3/tier.go index 3efe3433d..b8d485a71 100644 --- a/pkg/client/applyconfiguration_generated/projectcalico/v3/tier.go +++ b/pkg/client/applyconfiguration_generated/projectcalico/v3/tier.go @@ -20,7 +20,7 @@ import ( // be created and each tier is applied in the order specified in the tier specification. // Tier is globally-scoped (i.e. not Namespaced). type TierApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *TierSpecApplyConfiguration `json:"spec,omitempty"` Status *TierStatusApplyConfiguration `json:"status,omitempty"` diff --git a/pkg/client/clientset_generated/clientset/clientset.go b/pkg/client/clientset_generated/clientset/clientset.go index 1a83a788d..e23aa138b 100644 --- a/pkg/client/clientset_generated/clientset/clientset.go +++ b/pkg/client/clientset_generated/clientset/clientset.go @@ -15,7 +15,7 @@ import ( ) type Interface interface { - Discovery() discovery.DiscoveryInterface + Discovery() discovery.DiscoveryInterfaces ProjectcalicoV3() projectcalicov3.ProjectcalicoV3Interface } @@ -31,7 +31,7 @@ func (c *Clientset) ProjectcalicoV3() projectcalicov3.ProjectcalicoV3Interface { } // Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { +func (c *Clientset) Discovery() discovery.DiscoveryInterfaces { if c == nil { return nil } diff --git a/pkg/client/clientset_generated/clientset/fake/clientset_generated.go b/pkg/client/clientset_generated/clientset/fake/clientset_generated.go index 97a609cdb..7847b14ef 100644 --- a/pkg/client/clientset_generated/clientset/fake/clientset_generated.go +++ b/pkg/client/clientset_generated/clientset/fake/clientset_generated.go @@ -58,7 +58,7 @@ type Clientset struct { tracker testing.ObjectTracker } -func (c *Clientset) Discovery() discovery.DiscoveryInterface { +func (c *Clientset) Discovery() discovery.DiscoveryInterfaces { return c.discovery } diff --git a/pkg/client/informers_generated/externalversions/factory.go b/pkg/client/informers_generated/externalversions/factory.go index fb5989ddf..4f5d327a6 100644 --- a/pkg/client/informers_generated/externalversions/factory.go +++ b/pkg/client/informers_generated/externalversions/factory.go @@ -239,7 +239,7 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal // ctx, cancel := context.WithCancel(context.Background()) // defer cancel() // factory := NewSharedInformerFactory(client, resyncPeriod) -// defer factory.WaitForStop() // Returns immediately if nothing was started. +// defer factory.Shutdown() // Returns immediately if nothing was started. // genericInformer := factory.ForResource(resource) // typedInformer := factory.SomeAPIGroup().V1().SomeType() // handle, err := typeInformer.Informer().AddEventHandler(...) @@ -297,7 +297,7 @@ type SharedInformerFactory interface { // WaitForCacheSync blocks until all started informers' caches were synced // or the stop channel gets closed. // - // Contextual logging: WaitForCacheSync should be used instead of WaitForCacheSync in code which supports contextual logging. It also returns a more useful result. + // Contextual logging: WaitForCacheSyncWithContext should be used instead of WaitForCacheSync in code which supports contextual logging. It also returns a more useful result. WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool // WaitForCacheSyncWithContext blocks until all started informers' caches were synced diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/bgpconfiguration.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/bgpconfiguration.go index 7db33641a..7bb114bf1 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/bgpconfiguration.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/bgpconfiguration.go @@ -20,12 +20,40 @@ import ( ) // BGPConfigurationInformer provides access to a shared informer and lister for -// BGPConfigurations. +// BGPConfigurations. Prefer using the type-safe variant (see [TypedBGPConfigurationInformer]). type BGPConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.BGPConfigurationLister } +// TypedBGPConfigurationInformer provides access to a shared informer and lister for +// BGPConfigurations, including the type-safe TypedInformer variant. +// It is a superset of BGPConfigurationInformer. +type TypedBGPConfigurationInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() BGPConfigurationIndexInformer + Lister() projectcalicov3.BGPConfigurationLister +} + +// BGPConfigurationIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type BGPConfigurationIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.BGPConfiguration] + +// BGPConfigurationHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for BGPConfiguration. +type BGPConfigurationHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.BGPConfiguration] + +// BGPConfigurationDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for BGPConfiguration. +type BGPConfigurationDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.BGPConfiguration] + +// BGPConfigurationFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for BGPConfiguration. +type BGPConfigurationFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.BGPConfiguration] + +// BGPConfigurationIndexers is a specialization of [cache.TypedIndexers] for BGPConfiguration. +type BGPConfigurationIndexers = cache.TypedIndexers[*apisprojectcalicov3.BGPConfiguration] + +// DeletedBGPConfiguration is a specialization of [cache.DeletedObject] for BGPConfiguration. +type DeletedBGPConfiguration = cache.DeletedObject[*apisprojectcalicov3.BGPConfiguration] + type bGPConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -34,25 +62,49 @@ type bGPConfigurationInformer struct { // NewBGPConfigurationInformer constructs a new informer for BGPConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedBGPConfigurationInformer]). func NewBGPConfigurationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewBGPConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedBGPConfigurationInformer constructs a new informer for BGPConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedBGPConfigurationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers BGPConfigurationIndexers) BGPConfigurationIndexInformer { + return NewTypedBGPConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredBGPConfigurationInformer constructs a new informer for BGPConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredBGPConfigurationInformer]). func NewFilteredBGPConfigurationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewBGPConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedBGPConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredBGPConfigurationInformer constructs a new informer for BGPConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredBGPConfigurationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers BGPConfigurationIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) BGPConfigurationIndexInformer { + return NewTypedBGPConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewBGPConfigurationInformerWithOptions constructs a new informer for BGPConfiguration type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedBGPConfigurationInformerWithOptions]). func NewBGPConfigurationInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedBGPConfigurationInformerWithOptions(client, options) +} + +// NewTypedBGPConfigurationInformerWithOptions constructs a new informer for BGPConfiguration type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedBGPConfigurationInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) BGPConfigurationIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "bgpconfigurations"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.BGPConfiguration](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -85,17 +137,57 @@ func NewBGPConfigurationInformerWithOptions(client clientset.Interface, options Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *bGPConfigurationInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewBGPConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedBGPConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *bGPConfigurationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.BGPConfiguration{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *bGPConfigurationInformer) TypedInformer() BGPConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.BGPConfiguration](f.factory.InformerFor(&apisprojectcalicov3.BGPConfiguration{}, f.defaultInformer)) } func (f *bGPConfigurationInformer) Lister() projectcalicov3.BGPConfigurationLister { return projectcalicov3.NewBGPConfigurationLister(f.Informer().GetIndexer()) } + +// ToTypedBGPConfigurationInformer converts an untyped informer into a TypedBGPConfigurationInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *BGPConfiguration. If that is not the case, calling type-safe methods of the returned +// TypedBGPConfigurationInformer leads to runtime panics. A safer alternative is to pass +// around a TypedBGPConfigurationInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedBGPConfigurationInformer(informer BGPConfigurationInformer) TypedBGPConfigurationInformer { + if informer, ok := informer.(TypedBGPConfigurationInformer); ok { + return informer + } + return &bGPConfigurationTypedInformerAdapter{informer} +} + +type bGPConfigurationTypedInformerAdapter struct { + BGPConfigurationInformer +} + +func (a *bGPConfigurationTypedInformerAdapter) TypedInformer() BGPConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.BGPConfiguration](a.Informer()) +} + +// ToBGPConfigurationIndexInformer converts an untyped informer into a BGPConfigurationIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *BGPConfiguration. If that is not the case, calling type-safe methods of the returned +// BGPConfigurationIndexInformer leads to runtime panics. A safer alternative is to pass +// around a BGPConfigurationIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToBGPConfigurationIndexInformer(informer cache.SharedIndexInformer) BGPConfigurationIndexInformer { + if informer, ok := informer.(BGPConfigurationIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.BGPConfiguration](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/bgpfilter.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/bgpfilter.go index f9f141268..58b1b941d 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/bgpfilter.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/bgpfilter.go @@ -20,12 +20,40 @@ import ( ) // BGPFilterInformer provides access to a shared informer and lister for -// BGPFilters. +// BGPFilters. Prefer using the type-safe variant (see [TypedBGPFilterInformer]). type BGPFilterInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.BGPFilterLister } +// TypedBGPFilterInformer provides access to a shared informer and lister for +// BGPFilters, including the type-safe TypedInformer variant. +// It is a superset of BGPFilterInformer. +type TypedBGPFilterInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() BGPFilterIndexInformer + Lister() projectcalicov3.BGPFilterLister +} + +// BGPFilterIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type BGPFilterIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.BGPFilter] + +// BGPFilterHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for BGPFilter. +type BGPFilterHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.BGPFilter] + +// BGPFilterDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for BGPFilter. +type BGPFilterDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.BGPFilter] + +// BGPFilterFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for BGPFilter. +type BGPFilterFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.BGPFilter] + +// BGPFilterIndexers is a specialization of [cache.TypedIndexers] for BGPFilter. +type BGPFilterIndexers = cache.TypedIndexers[*apisprojectcalicov3.BGPFilter] + +// DeletedBGPFilter is a specialization of [cache.DeletedObject] for BGPFilter. +type DeletedBGPFilter = cache.DeletedObject[*apisprojectcalicov3.BGPFilter] + type bGPFilterInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -34,25 +62,49 @@ type bGPFilterInformer struct { // NewBGPFilterInformer constructs a new informer for BGPFilter type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedBGPFilterInformer]). func NewBGPFilterInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewBGPFilterInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedBGPFilterInformer constructs a new informer for BGPFilter type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedBGPFilterInformer(client clientset.Interface, resyncPeriod time.Duration, indexers BGPFilterIndexers) BGPFilterIndexInformer { + return NewTypedBGPFilterInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredBGPFilterInformer constructs a new informer for BGPFilter type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredBGPFilterInformer]). func NewFilteredBGPFilterInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewBGPFilterInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedBGPFilterInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredBGPFilterInformer constructs a new informer for BGPFilter type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredBGPFilterInformer(client clientset.Interface, resyncPeriod time.Duration, indexers BGPFilterIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) BGPFilterIndexInformer { + return NewTypedBGPFilterInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewBGPFilterInformerWithOptions constructs a new informer for BGPFilter type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedBGPFilterInformerWithOptions]). func NewBGPFilterInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedBGPFilterInformerWithOptions(client, options) +} + +// NewTypedBGPFilterInformerWithOptions constructs a new informer for BGPFilter type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedBGPFilterInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) BGPFilterIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "bgpfilters"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.BGPFilter](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -85,17 +137,57 @@ func NewBGPFilterInformerWithOptions(client clientset.Interface, options interna Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *bGPFilterInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewBGPFilterInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedBGPFilterInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *bGPFilterInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.BGPFilter{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *bGPFilterInformer) TypedInformer() BGPFilterIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.BGPFilter](f.factory.InformerFor(&apisprojectcalicov3.BGPFilter{}, f.defaultInformer)) } func (f *bGPFilterInformer) Lister() projectcalicov3.BGPFilterLister { return projectcalicov3.NewBGPFilterLister(f.Informer().GetIndexer()) } + +// ToTypedBGPFilterInformer converts an untyped informer into a TypedBGPFilterInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *BGPFilter. If that is not the case, calling type-safe methods of the returned +// TypedBGPFilterInformer leads to runtime panics. A safer alternative is to pass +// around a TypedBGPFilterInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedBGPFilterInformer(informer BGPFilterInformer) TypedBGPFilterInformer { + if informer, ok := informer.(TypedBGPFilterInformer); ok { + return informer + } + return &bGPFilterTypedInformerAdapter{informer} +} + +type bGPFilterTypedInformerAdapter struct { + BGPFilterInformer +} + +func (a *bGPFilterTypedInformerAdapter) TypedInformer() BGPFilterIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.BGPFilter](a.Informer()) +} + +// ToBGPFilterIndexInformer converts an untyped informer into a BGPFilterIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *BGPFilter. If that is not the case, calling type-safe methods of the returned +// BGPFilterIndexInformer leads to runtime panics. A safer alternative is to pass +// around a BGPFilterIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToBGPFilterIndexInformer(informer cache.SharedIndexInformer) BGPFilterIndexInformer { + if informer, ok := informer.(BGPFilterIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.BGPFilter](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/bgppeer.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/bgppeer.go index 1a96862ba..64be51078 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/bgppeer.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/bgppeer.go @@ -20,12 +20,40 @@ import ( ) // BGPPeerInformer provides access to a shared informer and lister for -// BGPPeers. +// BGPPeers. Prefer using the type-safe variant (see [TypedBGPPeerInformer]). type BGPPeerInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.BGPPeerLister } +// TypedBGPPeerInformer provides access to a shared informer and lister for +// BGPPeers, including the type-safe TypedInformer variant. +// It is a superset of BGPPeerInformer. +type TypedBGPPeerInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() BGPPeerIndexInformer + Lister() projectcalicov3.BGPPeerLister +} + +// BGPPeerIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type BGPPeerIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.BGPPeer] + +// BGPPeerHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for BGPPeer. +type BGPPeerHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.BGPPeer] + +// BGPPeerDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for BGPPeer. +type BGPPeerDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.BGPPeer] + +// BGPPeerFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for BGPPeer. +type BGPPeerFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.BGPPeer] + +// BGPPeerIndexers is a specialization of [cache.TypedIndexers] for BGPPeer. +type BGPPeerIndexers = cache.TypedIndexers[*apisprojectcalicov3.BGPPeer] + +// DeletedBGPPeer is a specialization of [cache.DeletedObject] for BGPPeer. +type DeletedBGPPeer = cache.DeletedObject[*apisprojectcalicov3.BGPPeer] + type bGPPeerInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -34,25 +62,49 @@ type bGPPeerInformer struct { // NewBGPPeerInformer constructs a new informer for BGPPeer type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedBGPPeerInformer]). func NewBGPPeerInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewBGPPeerInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedBGPPeerInformer constructs a new informer for BGPPeer type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedBGPPeerInformer(client clientset.Interface, resyncPeriod time.Duration, indexers BGPPeerIndexers) BGPPeerIndexInformer { + return NewTypedBGPPeerInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredBGPPeerInformer constructs a new informer for BGPPeer type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredBGPPeerInformer]). func NewFilteredBGPPeerInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewBGPPeerInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedBGPPeerInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredBGPPeerInformer constructs a new informer for BGPPeer type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredBGPPeerInformer(client clientset.Interface, resyncPeriod time.Duration, indexers BGPPeerIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) BGPPeerIndexInformer { + return NewTypedBGPPeerInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewBGPPeerInformerWithOptions constructs a new informer for BGPPeer type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedBGPPeerInformerWithOptions]). func NewBGPPeerInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedBGPPeerInformerWithOptions(client, options) +} + +// NewTypedBGPPeerInformerWithOptions constructs a new informer for BGPPeer type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedBGPPeerInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) BGPPeerIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "bgppeers"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.BGPPeer](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -85,17 +137,57 @@ func NewBGPPeerInformerWithOptions(client clientset.Interface, options internali Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *bGPPeerInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewBGPPeerInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedBGPPeerInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *bGPPeerInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.BGPPeer{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *bGPPeerInformer) TypedInformer() BGPPeerIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.BGPPeer](f.factory.InformerFor(&apisprojectcalicov3.BGPPeer{}, f.defaultInformer)) } func (f *bGPPeerInformer) Lister() projectcalicov3.BGPPeerLister { return projectcalicov3.NewBGPPeerLister(f.Informer().GetIndexer()) } + +// ToTypedBGPPeerInformer converts an untyped informer into a TypedBGPPeerInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *BGPPeer. If that is not the case, calling type-safe methods of the returned +// TypedBGPPeerInformer leads to runtime panics. A safer alternative is to pass +// around a TypedBGPPeerInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedBGPPeerInformer(informer BGPPeerInformer) TypedBGPPeerInformer { + if informer, ok := informer.(TypedBGPPeerInformer); ok { + return informer + } + return &bGPPeerTypedInformerAdapter{informer} +} + +type bGPPeerTypedInformerAdapter struct { + BGPPeerInformer +} + +func (a *bGPPeerTypedInformerAdapter) TypedInformer() BGPPeerIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.BGPPeer](a.Informer()) +} + +// ToBGPPeerIndexInformer converts an untyped informer into a BGPPeerIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *BGPPeer. If that is not the case, calling type-safe methods of the returned +// BGPPeerIndexInformer leads to runtime panics. A safer alternative is to pass +// around a BGPPeerIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToBGPPeerIndexInformer(informer cache.SharedIndexInformer) BGPPeerIndexInformer { + if informer, ok := informer.(BGPPeerIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.BGPPeer](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/blockaffinity.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/blockaffinity.go index 82d3f4505..3d7e8419c 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/blockaffinity.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/blockaffinity.go @@ -20,12 +20,40 @@ import ( ) // BlockAffinityInformer provides access to a shared informer and lister for -// BlockAffinities. +// BlockAffinities. Prefer using the type-safe variant (see [TypedBlockAffinityInformer]). type BlockAffinityInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.BlockAffinityLister } +// TypedBlockAffinityInformer provides access to a shared informer and lister for +// BlockAffinities, including the type-safe TypedInformer variant. +// It is a superset of BlockAffinityInformer. +type TypedBlockAffinityInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() BlockAffinityIndexInformer + Lister() projectcalicov3.BlockAffinityLister +} + +// BlockAffinityIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type BlockAffinityIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.BlockAffinity] + +// BlockAffinityHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for BlockAffinity. +type BlockAffinityHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.BlockAffinity] + +// BlockAffinityDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for BlockAffinity. +type BlockAffinityDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.BlockAffinity] + +// BlockAffinityFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for BlockAffinity. +type BlockAffinityFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.BlockAffinity] + +// BlockAffinityIndexers is a specialization of [cache.TypedIndexers] for BlockAffinity. +type BlockAffinityIndexers = cache.TypedIndexers[*apisprojectcalicov3.BlockAffinity] + +// DeletedBlockAffinity is a specialization of [cache.DeletedObject] for BlockAffinity. +type DeletedBlockAffinity = cache.DeletedObject[*apisprojectcalicov3.BlockAffinity] + type blockAffinityInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -34,25 +62,49 @@ type blockAffinityInformer struct { // NewBlockAffinityInformer constructs a new informer for BlockAffinity type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedBlockAffinityInformer]). func NewBlockAffinityInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewBlockAffinityInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedBlockAffinityInformer constructs a new informer for BlockAffinity type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedBlockAffinityInformer(client clientset.Interface, resyncPeriod time.Duration, indexers BlockAffinityIndexers) BlockAffinityIndexInformer { + return NewTypedBlockAffinityInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredBlockAffinityInformer constructs a new informer for BlockAffinity type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredBlockAffinityInformer]). func NewFilteredBlockAffinityInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewBlockAffinityInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedBlockAffinityInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredBlockAffinityInformer constructs a new informer for BlockAffinity type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredBlockAffinityInformer(client clientset.Interface, resyncPeriod time.Duration, indexers BlockAffinityIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) BlockAffinityIndexInformer { + return NewTypedBlockAffinityInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewBlockAffinityInformerWithOptions constructs a new informer for BlockAffinity type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedBlockAffinityInformerWithOptions]). func NewBlockAffinityInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedBlockAffinityInformerWithOptions(client, options) +} + +// NewTypedBlockAffinityInformerWithOptions constructs a new informer for BlockAffinity type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedBlockAffinityInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) BlockAffinityIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "blockaffinities"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.BlockAffinity](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -85,17 +137,57 @@ func NewBlockAffinityInformerWithOptions(client clientset.Interface, options int Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *blockAffinityInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewBlockAffinityInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedBlockAffinityInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *blockAffinityInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.BlockAffinity{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *blockAffinityInformer) TypedInformer() BlockAffinityIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.BlockAffinity](f.factory.InformerFor(&apisprojectcalicov3.BlockAffinity{}, f.defaultInformer)) } func (f *blockAffinityInformer) Lister() projectcalicov3.BlockAffinityLister { return projectcalicov3.NewBlockAffinityLister(f.Informer().GetIndexer()) } + +// ToTypedBlockAffinityInformer converts an untyped informer into a TypedBlockAffinityInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *BlockAffinity. If that is not the case, calling type-safe methods of the returned +// TypedBlockAffinityInformer leads to runtime panics. A safer alternative is to pass +// around a TypedBlockAffinityInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedBlockAffinityInformer(informer BlockAffinityInformer) TypedBlockAffinityInformer { + if informer, ok := informer.(TypedBlockAffinityInformer); ok { + return informer + } + return &blockAffinityTypedInformerAdapter{informer} +} + +type blockAffinityTypedInformerAdapter struct { + BlockAffinityInformer +} + +func (a *blockAffinityTypedInformerAdapter) TypedInformer() BlockAffinityIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.BlockAffinity](a.Informer()) +} + +// ToBlockAffinityIndexInformer converts an untyped informer into a BlockAffinityIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *BlockAffinity. If that is not the case, calling type-safe methods of the returned +// BlockAffinityIndexInformer leads to runtime panics. A safer alternative is to pass +// around a BlockAffinityIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToBlockAffinityIndexInformer(informer cache.SharedIndexInformer) BlockAffinityIndexInformer { + if informer, ok := informer.(BlockAffinityIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.BlockAffinity](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/caliconodestatus.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/caliconodestatus.go index 4a247a67b..fa1fb0208 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/caliconodestatus.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/caliconodestatus.go @@ -20,12 +20,40 @@ import ( ) // CalicoNodeStatusInformer provides access to a shared informer and lister for -// CalicoNodeStatuses. +// CalicoNodeStatuses. Prefer using the type-safe variant (see [TypedCalicoNodeStatusInformer]). type CalicoNodeStatusInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.CalicoNodeStatusLister } +// TypedCalicoNodeStatusInformer provides access to a shared informer and lister for +// CalicoNodeStatuses, including the type-safe TypedInformer variant. +// It is a superset of CalicoNodeStatusInformer. +type TypedCalicoNodeStatusInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CalicoNodeStatusIndexInformer + Lister() projectcalicov3.CalicoNodeStatusLister +} + +// CalicoNodeStatusIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CalicoNodeStatusIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.CalicoNodeStatus] + +// CalicoNodeStatusHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CalicoNodeStatus. +type CalicoNodeStatusHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.CalicoNodeStatus] + +// CalicoNodeStatusDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CalicoNodeStatus. +type CalicoNodeStatusDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.CalicoNodeStatus] + +// CalicoNodeStatusFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CalicoNodeStatus. +type CalicoNodeStatusFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.CalicoNodeStatus] + +// CalicoNodeStatusIndexers is a specialization of [cache.TypedIndexers] for CalicoNodeStatus. +type CalicoNodeStatusIndexers = cache.TypedIndexers[*apisprojectcalicov3.CalicoNodeStatus] + +// DeletedCalicoNodeStatus is a specialization of [cache.DeletedObject] for CalicoNodeStatus. +type DeletedCalicoNodeStatus = cache.DeletedObject[*apisprojectcalicov3.CalicoNodeStatus] + type calicoNodeStatusInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -34,25 +62,49 @@ type calicoNodeStatusInformer struct { // NewCalicoNodeStatusInformer constructs a new informer for CalicoNodeStatus type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCalicoNodeStatusInformer]). func NewCalicoNodeStatusInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewCalicoNodeStatusInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedCalicoNodeStatusInformer constructs a new informer for CalicoNodeStatus type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCalicoNodeStatusInformer(client clientset.Interface, resyncPeriod time.Duration, indexers CalicoNodeStatusIndexers) CalicoNodeStatusIndexInformer { + return NewTypedCalicoNodeStatusInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredCalicoNodeStatusInformer constructs a new informer for CalicoNodeStatus type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCalicoNodeStatusInformer]). func NewFilteredCalicoNodeStatusInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewCalicoNodeStatusInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedCalicoNodeStatusInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCalicoNodeStatusInformer constructs a new informer for CalicoNodeStatus type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredCalicoNodeStatusInformer(client clientset.Interface, resyncPeriod time.Duration, indexers CalicoNodeStatusIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CalicoNodeStatusIndexInformer { + return NewTypedCalicoNodeStatusInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewCalicoNodeStatusInformerWithOptions constructs a new informer for CalicoNodeStatus type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCalicoNodeStatusInformerWithOptions]). func NewCalicoNodeStatusInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCalicoNodeStatusInformerWithOptions(client, options) +} + +// NewTypedCalicoNodeStatusInformerWithOptions constructs a new informer for CalicoNodeStatus type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCalicoNodeStatusInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) CalicoNodeStatusIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "caliconodestatuses"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.CalicoNodeStatus](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -85,17 +137,57 @@ func NewCalicoNodeStatusInformerWithOptions(client clientset.Interface, options Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *calicoNodeStatusInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewCalicoNodeStatusInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedCalicoNodeStatusInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *calicoNodeStatusInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.CalicoNodeStatus{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *calicoNodeStatusInformer) TypedInformer() CalicoNodeStatusIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.CalicoNodeStatus](f.factory.InformerFor(&apisprojectcalicov3.CalicoNodeStatus{}, f.defaultInformer)) } func (f *calicoNodeStatusInformer) Lister() projectcalicov3.CalicoNodeStatusLister { return projectcalicov3.NewCalicoNodeStatusLister(f.Informer().GetIndexer()) } + +// ToTypedCalicoNodeStatusInformer converts an untyped informer into a TypedCalicoNodeStatusInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CalicoNodeStatus. If that is not the case, calling type-safe methods of the returned +// TypedCalicoNodeStatusInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCalicoNodeStatusInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCalicoNodeStatusInformer(informer CalicoNodeStatusInformer) TypedCalicoNodeStatusInformer { + if informer, ok := informer.(TypedCalicoNodeStatusInformer); ok { + return informer + } + return &calicoNodeStatusTypedInformerAdapter{informer} +} + +type calicoNodeStatusTypedInformerAdapter struct { + CalicoNodeStatusInformer +} + +func (a *calicoNodeStatusTypedInformerAdapter) TypedInformer() CalicoNodeStatusIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.CalicoNodeStatus](a.Informer()) +} + +// ToCalicoNodeStatusIndexInformer converts an untyped informer into a CalicoNodeStatusIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CalicoNodeStatus. If that is not the case, calling type-safe methods of the returned +// CalicoNodeStatusIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CalicoNodeStatusIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCalicoNodeStatusIndexInformer(informer cache.SharedIndexInformer) CalicoNodeStatusIndexInformer { + if informer, ok := informer.(CalicoNodeStatusIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.CalicoNodeStatus](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/clusterinformation.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/clusterinformation.go index 806daceef..bc51ae9fc 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/clusterinformation.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/clusterinformation.go @@ -20,12 +20,40 @@ import ( ) // ClusterInformationInformer provides access to a shared informer and lister for -// ClusterInformations. +// ClusterInformations. Prefer using the type-safe variant (see [TypedClusterInformationInformer]). type ClusterInformationInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.ClusterInformationLister } +// TypedClusterInformationInformer provides access to a shared informer and lister for +// ClusterInformations, including the type-safe TypedInformer variant. +// It is a superset of ClusterInformationInformer. +type TypedClusterInformationInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ClusterInformationIndexInformer + Lister() projectcalicov3.ClusterInformationLister +} + +// ClusterInformationIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ClusterInformationIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.ClusterInformation] + +// ClusterInformationHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ClusterInformation. +type ClusterInformationHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.ClusterInformation] + +// ClusterInformationDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ClusterInformation. +type ClusterInformationDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.ClusterInformation] + +// ClusterInformationFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ClusterInformation. +type ClusterInformationFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.ClusterInformation] + +// ClusterInformationIndexers is a specialization of [cache.TypedIndexers] for ClusterInformation. +type ClusterInformationIndexers = cache.TypedIndexers[*apisprojectcalicov3.ClusterInformation] + +// DeletedClusterInformation is a specialization of [cache.DeletedObject] for ClusterInformation. +type DeletedClusterInformation = cache.DeletedObject[*apisprojectcalicov3.ClusterInformation] + type clusterInformationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -34,25 +62,49 @@ type clusterInformationInformer struct { // NewClusterInformationInformer constructs a new informer for ClusterInformation type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterInformationInformer]). func NewClusterInformationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewClusterInformationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedClusterInformationInformer constructs a new informer for ClusterInformation type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterInformationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers ClusterInformationIndexers) ClusterInformationIndexInformer { + return NewTypedClusterInformationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredClusterInformationInformer constructs a new informer for ClusterInformation type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredClusterInformationInformer]). func NewFilteredClusterInformationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewClusterInformationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedClusterInformationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredClusterInformationInformer constructs a new informer for ClusterInformation type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredClusterInformationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers ClusterInformationIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ClusterInformationIndexInformer { + return NewTypedClusterInformationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewClusterInformationInformerWithOptions constructs a new informer for ClusterInformation type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterInformationInformerWithOptions]). func NewClusterInformationInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedClusterInformationInformerWithOptions(client, options) +} + +// NewTypedClusterInformationInformerWithOptions constructs a new informer for ClusterInformation type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterInformationInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) ClusterInformationIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "clusterinformations"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.ClusterInformation](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -85,17 +137,57 @@ func NewClusterInformationInformerWithOptions(client clientset.Interface, option Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *clusterInformationInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewClusterInformationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedClusterInformationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *clusterInformationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.ClusterInformation{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *clusterInformationInformer) TypedInformer() ClusterInformationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.ClusterInformation](f.factory.InformerFor(&apisprojectcalicov3.ClusterInformation{}, f.defaultInformer)) } func (f *clusterInformationInformer) Lister() projectcalicov3.ClusterInformationLister { return projectcalicov3.NewClusterInformationLister(f.Informer().GetIndexer()) } + +// ToTypedClusterInformationInformer converts an untyped informer into a TypedClusterInformationInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterInformation. If that is not the case, calling type-safe methods of the returned +// TypedClusterInformationInformer leads to runtime panics. A safer alternative is to pass +// around a TypedClusterInformationInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedClusterInformationInformer(informer ClusterInformationInformer) TypedClusterInformationInformer { + if informer, ok := informer.(TypedClusterInformationInformer); ok { + return informer + } + return &clusterInformationTypedInformerAdapter{informer} +} + +type clusterInformationTypedInformerAdapter struct { + ClusterInformationInformer +} + +func (a *clusterInformationTypedInformerAdapter) TypedInformer() ClusterInformationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.ClusterInformation](a.Informer()) +} + +// ToClusterInformationIndexInformer converts an untyped informer into a ClusterInformationIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterInformation. If that is not the case, calling type-safe methods of the returned +// ClusterInformationIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ClusterInformationIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToClusterInformationIndexInformer(informer cache.SharedIndexInformer) ClusterInformationIndexInformer { + if informer, ok := informer.(ClusterInformationIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.ClusterInformation](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/felixconfiguration.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/felixconfiguration.go index bca9494f7..9800c94f7 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/felixconfiguration.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/felixconfiguration.go @@ -20,12 +20,40 @@ import ( ) // FelixConfigurationInformer provides access to a shared informer and lister for -// FelixConfigurations. +// FelixConfigurations. Prefer using the type-safe variant (see [TypedFelixConfigurationInformer]). type FelixConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.FelixConfigurationLister } +// TypedFelixConfigurationInformer provides access to a shared informer and lister for +// FelixConfigurations, including the type-safe TypedInformer variant. +// It is a superset of FelixConfigurationInformer. +type TypedFelixConfigurationInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() FelixConfigurationIndexInformer + Lister() projectcalicov3.FelixConfigurationLister +} + +// FelixConfigurationIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type FelixConfigurationIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.FelixConfiguration] + +// FelixConfigurationHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for FelixConfiguration. +type FelixConfigurationHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.FelixConfiguration] + +// FelixConfigurationDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for FelixConfiguration. +type FelixConfigurationDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.FelixConfiguration] + +// FelixConfigurationFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for FelixConfiguration. +type FelixConfigurationFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.FelixConfiguration] + +// FelixConfigurationIndexers is a specialization of [cache.TypedIndexers] for FelixConfiguration. +type FelixConfigurationIndexers = cache.TypedIndexers[*apisprojectcalicov3.FelixConfiguration] + +// DeletedFelixConfiguration is a specialization of [cache.DeletedObject] for FelixConfiguration. +type DeletedFelixConfiguration = cache.DeletedObject[*apisprojectcalicov3.FelixConfiguration] + type felixConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -34,25 +62,49 @@ type felixConfigurationInformer struct { // NewFelixConfigurationInformer constructs a new informer for FelixConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFelixConfigurationInformer]). func NewFelixConfigurationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFelixConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedFelixConfigurationInformer constructs a new informer for FelixConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFelixConfigurationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers FelixConfigurationIndexers) FelixConfigurationIndexInformer { + return NewTypedFelixConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredFelixConfigurationInformer constructs a new informer for FelixConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredFelixConfigurationInformer]). func NewFilteredFelixConfigurationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewFelixConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedFelixConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredFelixConfigurationInformer constructs a new informer for FelixConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredFelixConfigurationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers FelixConfigurationIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) FelixConfigurationIndexInformer { + return NewTypedFelixConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewFelixConfigurationInformerWithOptions constructs a new informer for FelixConfiguration type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFelixConfigurationInformerWithOptions]). func NewFelixConfigurationInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedFelixConfigurationInformerWithOptions(client, options) +} + +// NewTypedFelixConfigurationInformerWithOptions constructs a new informer for FelixConfiguration type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFelixConfigurationInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) FelixConfigurationIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "felixconfigurations"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.FelixConfiguration](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -85,17 +137,57 @@ func NewFelixConfigurationInformerWithOptions(client clientset.Interface, option Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *felixConfigurationInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFelixConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedFelixConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *felixConfigurationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.FelixConfiguration{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *felixConfigurationInformer) TypedInformer() FelixConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.FelixConfiguration](f.factory.InformerFor(&apisprojectcalicov3.FelixConfiguration{}, f.defaultInformer)) } func (f *felixConfigurationInformer) Lister() projectcalicov3.FelixConfigurationLister { return projectcalicov3.NewFelixConfigurationLister(f.Informer().GetIndexer()) } + +// ToTypedFelixConfigurationInformer converts an untyped informer into a TypedFelixConfigurationInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *FelixConfiguration. If that is not the case, calling type-safe methods of the returned +// TypedFelixConfigurationInformer leads to runtime panics. A safer alternative is to pass +// around a TypedFelixConfigurationInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedFelixConfigurationInformer(informer FelixConfigurationInformer) TypedFelixConfigurationInformer { + if informer, ok := informer.(TypedFelixConfigurationInformer); ok { + return informer + } + return &felixConfigurationTypedInformerAdapter{informer} +} + +type felixConfigurationTypedInformerAdapter struct { + FelixConfigurationInformer +} + +func (a *felixConfigurationTypedInformerAdapter) TypedInformer() FelixConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.FelixConfiguration](a.Informer()) +} + +// ToFelixConfigurationIndexInformer converts an untyped informer into a FelixConfigurationIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *FelixConfiguration. If that is not the case, calling type-safe methods of the returned +// FelixConfigurationIndexInformer leads to runtime panics. A safer alternative is to pass +// around a FelixConfigurationIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToFelixConfigurationIndexInformer(informer cache.SharedIndexInformer) FelixConfigurationIndexInformer { + if informer, ok := informer.(FelixConfigurationIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.FelixConfiguration](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/globalnetworkpolicy.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/globalnetworkpolicy.go index 1b6026757..10af932cb 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/globalnetworkpolicy.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/globalnetworkpolicy.go @@ -20,12 +20,40 @@ import ( ) // GlobalNetworkPolicyInformer provides access to a shared informer and lister for -// GlobalNetworkPolicies. +// GlobalNetworkPolicies. Prefer using the type-safe variant (see [TypedGlobalNetworkPolicyInformer]). type GlobalNetworkPolicyInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.GlobalNetworkPolicyLister } +// TypedGlobalNetworkPolicyInformer provides access to a shared informer and lister for +// GlobalNetworkPolicies, including the type-safe TypedInformer variant. +// It is a superset of GlobalNetworkPolicyInformer. +type TypedGlobalNetworkPolicyInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() GlobalNetworkPolicyIndexInformer + Lister() projectcalicov3.GlobalNetworkPolicyLister +} + +// GlobalNetworkPolicyIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type GlobalNetworkPolicyIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.GlobalNetworkPolicy] + +// GlobalNetworkPolicyHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for GlobalNetworkPolicy. +type GlobalNetworkPolicyHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.GlobalNetworkPolicy] + +// GlobalNetworkPolicyDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for GlobalNetworkPolicy. +type GlobalNetworkPolicyDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.GlobalNetworkPolicy] + +// GlobalNetworkPolicyFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for GlobalNetworkPolicy. +type GlobalNetworkPolicyFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.GlobalNetworkPolicy] + +// GlobalNetworkPolicyIndexers is a specialization of [cache.TypedIndexers] for GlobalNetworkPolicy. +type GlobalNetworkPolicyIndexers = cache.TypedIndexers[*apisprojectcalicov3.GlobalNetworkPolicy] + +// DeletedGlobalNetworkPolicy is a specialization of [cache.DeletedObject] for GlobalNetworkPolicy. +type DeletedGlobalNetworkPolicy = cache.DeletedObject[*apisprojectcalicov3.GlobalNetworkPolicy] + type globalNetworkPolicyInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -34,25 +62,49 @@ type globalNetworkPolicyInformer struct { // NewGlobalNetworkPolicyInformer constructs a new informer for GlobalNetworkPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedGlobalNetworkPolicyInformer]). func NewGlobalNetworkPolicyInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewGlobalNetworkPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedGlobalNetworkPolicyInformer constructs a new informer for GlobalNetworkPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedGlobalNetworkPolicyInformer(client clientset.Interface, resyncPeriod time.Duration, indexers GlobalNetworkPolicyIndexers) GlobalNetworkPolicyIndexInformer { + return NewTypedGlobalNetworkPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredGlobalNetworkPolicyInformer constructs a new informer for GlobalNetworkPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredGlobalNetworkPolicyInformer]). func NewFilteredGlobalNetworkPolicyInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewGlobalNetworkPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedGlobalNetworkPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredGlobalNetworkPolicyInformer constructs a new informer for GlobalNetworkPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredGlobalNetworkPolicyInformer(client clientset.Interface, resyncPeriod time.Duration, indexers GlobalNetworkPolicyIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) GlobalNetworkPolicyIndexInformer { + return NewTypedGlobalNetworkPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewGlobalNetworkPolicyInformerWithOptions constructs a new informer for GlobalNetworkPolicy type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedGlobalNetworkPolicyInformerWithOptions]). func NewGlobalNetworkPolicyInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedGlobalNetworkPolicyInformerWithOptions(client, options) +} + +// NewTypedGlobalNetworkPolicyInformerWithOptions constructs a new informer for GlobalNetworkPolicy type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedGlobalNetworkPolicyInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) GlobalNetworkPolicyIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "globalnetworkpolicies"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.GlobalNetworkPolicy](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -85,17 +137,57 @@ func NewGlobalNetworkPolicyInformerWithOptions(client clientset.Interface, optio Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *globalNetworkPolicyInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewGlobalNetworkPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedGlobalNetworkPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *globalNetworkPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.GlobalNetworkPolicy{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *globalNetworkPolicyInformer) TypedInformer() GlobalNetworkPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.GlobalNetworkPolicy](f.factory.InformerFor(&apisprojectcalicov3.GlobalNetworkPolicy{}, f.defaultInformer)) } func (f *globalNetworkPolicyInformer) Lister() projectcalicov3.GlobalNetworkPolicyLister { return projectcalicov3.NewGlobalNetworkPolicyLister(f.Informer().GetIndexer()) } + +// ToTypedGlobalNetworkPolicyInformer converts an untyped informer into a TypedGlobalNetworkPolicyInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *GlobalNetworkPolicy. If that is not the case, calling type-safe methods of the returned +// TypedGlobalNetworkPolicyInformer leads to runtime panics. A safer alternative is to pass +// around a TypedGlobalNetworkPolicyInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedGlobalNetworkPolicyInformer(informer GlobalNetworkPolicyInformer) TypedGlobalNetworkPolicyInformer { + if informer, ok := informer.(TypedGlobalNetworkPolicyInformer); ok { + return informer + } + return &globalNetworkPolicyTypedInformerAdapter{informer} +} + +type globalNetworkPolicyTypedInformerAdapter struct { + GlobalNetworkPolicyInformer +} + +func (a *globalNetworkPolicyTypedInformerAdapter) TypedInformer() GlobalNetworkPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.GlobalNetworkPolicy](a.Informer()) +} + +// ToGlobalNetworkPolicyIndexInformer converts an untyped informer into a GlobalNetworkPolicyIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *GlobalNetworkPolicy. If that is not the case, calling type-safe methods of the returned +// GlobalNetworkPolicyIndexInformer leads to runtime panics. A safer alternative is to pass +// around a GlobalNetworkPolicyIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToGlobalNetworkPolicyIndexInformer(informer cache.SharedIndexInformer) GlobalNetworkPolicyIndexInformer { + if informer, ok := informer.(GlobalNetworkPolicyIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.GlobalNetworkPolicy](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/globalnetworkset.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/globalnetworkset.go index 8f6e5dead..025d624f7 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/globalnetworkset.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/globalnetworkset.go @@ -20,12 +20,40 @@ import ( ) // GlobalNetworkSetInformer provides access to a shared informer and lister for -// GlobalNetworkSets. +// GlobalNetworkSets. Prefer using the type-safe variant (see [TypedGlobalNetworkSetInformer]). type GlobalNetworkSetInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.GlobalNetworkSetLister } +// TypedGlobalNetworkSetInformer provides access to a shared informer and lister for +// GlobalNetworkSets, including the type-safe TypedInformer variant. +// It is a superset of GlobalNetworkSetInformer. +type TypedGlobalNetworkSetInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() GlobalNetworkSetIndexInformer + Lister() projectcalicov3.GlobalNetworkSetLister +} + +// GlobalNetworkSetIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type GlobalNetworkSetIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.GlobalNetworkSet] + +// GlobalNetworkSetHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for GlobalNetworkSet. +type GlobalNetworkSetHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.GlobalNetworkSet] + +// GlobalNetworkSetDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for GlobalNetworkSet. +type GlobalNetworkSetDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.GlobalNetworkSet] + +// GlobalNetworkSetFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for GlobalNetworkSet. +type GlobalNetworkSetFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.GlobalNetworkSet] + +// GlobalNetworkSetIndexers is a specialization of [cache.TypedIndexers] for GlobalNetworkSet. +type GlobalNetworkSetIndexers = cache.TypedIndexers[*apisprojectcalicov3.GlobalNetworkSet] + +// DeletedGlobalNetworkSet is a specialization of [cache.DeletedObject] for GlobalNetworkSet. +type DeletedGlobalNetworkSet = cache.DeletedObject[*apisprojectcalicov3.GlobalNetworkSet] + type globalNetworkSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -34,25 +62,49 @@ type globalNetworkSetInformer struct { // NewGlobalNetworkSetInformer constructs a new informer for GlobalNetworkSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedGlobalNetworkSetInformer]). func NewGlobalNetworkSetInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewGlobalNetworkSetInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedGlobalNetworkSetInformer constructs a new informer for GlobalNetworkSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedGlobalNetworkSetInformer(client clientset.Interface, resyncPeriod time.Duration, indexers GlobalNetworkSetIndexers) GlobalNetworkSetIndexInformer { + return NewTypedGlobalNetworkSetInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredGlobalNetworkSetInformer constructs a new informer for GlobalNetworkSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredGlobalNetworkSetInformer]). func NewFilteredGlobalNetworkSetInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewGlobalNetworkSetInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedGlobalNetworkSetInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredGlobalNetworkSetInformer constructs a new informer for GlobalNetworkSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredGlobalNetworkSetInformer(client clientset.Interface, resyncPeriod time.Duration, indexers GlobalNetworkSetIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) GlobalNetworkSetIndexInformer { + return NewTypedGlobalNetworkSetInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewGlobalNetworkSetInformerWithOptions constructs a new informer for GlobalNetworkSet type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedGlobalNetworkSetInformerWithOptions]). func NewGlobalNetworkSetInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedGlobalNetworkSetInformerWithOptions(client, options) +} + +// NewTypedGlobalNetworkSetInformerWithOptions constructs a new informer for GlobalNetworkSet type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedGlobalNetworkSetInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) GlobalNetworkSetIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "globalnetworksets"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.GlobalNetworkSet](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -85,17 +137,57 @@ func NewGlobalNetworkSetInformerWithOptions(client clientset.Interface, options Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *globalNetworkSetInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewGlobalNetworkSetInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedGlobalNetworkSetInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *globalNetworkSetInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.GlobalNetworkSet{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *globalNetworkSetInformer) TypedInformer() GlobalNetworkSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.GlobalNetworkSet](f.factory.InformerFor(&apisprojectcalicov3.GlobalNetworkSet{}, f.defaultInformer)) } func (f *globalNetworkSetInformer) Lister() projectcalicov3.GlobalNetworkSetLister { return projectcalicov3.NewGlobalNetworkSetLister(f.Informer().GetIndexer()) } + +// ToTypedGlobalNetworkSetInformer converts an untyped informer into a TypedGlobalNetworkSetInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *GlobalNetworkSet. If that is not the case, calling type-safe methods of the returned +// TypedGlobalNetworkSetInformer leads to runtime panics. A safer alternative is to pass +// around a TypedGlobalNetworkSetInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedGlobalNetworkSetInformer(informer GlobalNetworkSetInformer) TypedGlobalNetworkSetInformer { + if informer, ok := informer.(TypedGlobalNetworkSetInformer); ok { + return informer + } + return &globalNetworkSetTypedInformerAdapter{informer} +} + +type globalNetworkSetTypedInformerAdapter struct { + GlobalNetworkSetInformer +} + +func (a *globalNetworkSetTypedInformerAdapter) TypedInformer() GlobalNetworkSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.GlobalNetworkSet](a.Informer()) +} + +// ToGlobalNetworkSetIndexInformer converts an untyped informer into a GlobalNetworkSetIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *GlobalNetworkSet. If that is not the case, calling type-safe methods of the returned +// GlobalNetworkSetIndexInformer leads to runtime panics. A safer alternative is to pass +// around a GlobalNetworkSetIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToGlobalNetworkSetIndexInformer(informer cache.SharedIndexInformer) GlobalNetworkSetIndexInformer { + if informer, ok := informer.(GlobalNetworkSetIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.GlobalNetworkSet](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/hostendpoint.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/hostendpoint.go index 183500892..d787caea6 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/hostendpoint.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/hostendpoint.go @@ -20,12 +20,40 @@ import ( ) // HostEndpointInformer provides access to a shared informer and lister for -// HostEndpoints. +// HostEndpoints. Prefer using the type-safe variant (see [TypedHostEndpointInformer]). type HostEndpointInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.HostEndpointLister } +// TypedHostEndpointInformer provides access to a shared informer and lister for +// HostEndpoints, including the type-safe TypedInformer variant. +// It is a superset of HostEndpointInformer. +type TypedHostEndpointInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() HostEndpointIndexInformer + Lister() projectcalicov3.HostEndpointLister +} + +// HostEndpointIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type HostEndpointIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.HostEndpoint] + +// HostEndpointHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for HostEndpoint. +type HostEndpointHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.HostEndpoint] + +// HostEndpointDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for HostEndpoint. +type HostEndpointDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.HostEndpoint] + +// HostEndpointFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for HostEndpoint. +type HostEndpointFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.HostEndpoint] + +// HostEndpointIndexers is a specialization of [cache.TypedIndexers] for HostEndpoint. +type HostEndpointIndexers = cache.TypedIndexers[*apisprojectcalicov3.HostEndpoint] + +// DeletedHostEndpoint is a specialization of [cache.DeletedObject] for HostEndpoint. +type DeletedHostEndpoint = cache.DeletedObject[*apisprojectcalicov3.HostEndpoint] + type hostEndpointInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -34,25 +62,49 @@ type hostEndpointInformer struct { // NewHostEndpointInformer constructs a new informer for HostEndpoint type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedHostEndpointInformer]). func NewHostEndpointInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewHostEndpointInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedHostEndpointInformer constructs a new informer for HostEndpoint type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedHostEndpointInformer(client clientset.Interface, resyncPeriod time.Duration, indexers HostEndpointIndexers) HostEndpointIndexInformer { + return NewTypedHostEndpointInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredHostEndpointInformer constructs a new informer for HostEndpoint type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredHostEndpointInformer]). func NewFilteredHostEndpointInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewHostEndpointInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedHostEndpointInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredHostEndpointInformer constructs a new informer for HostEndpoint type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredHostEndpointInformer(client clientset.Interface, resyncPeriod time.Duration, indexers HostEndpointIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) HostEndpointIndexInformer { + return NewTypedHostEndpointInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewHostEndpointInformerWithOptions constructs a new informer for HostEndpoint type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedHostEndpointInformerWithOptions]). func NewHostEndpointInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedHostEndpointInformerWithOptions(client, options) +} + +// NewTypedHostEndpointInformerWithOptions constructs a new informer for HostEndpoint type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedHostEndpointInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) HostEndpointIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "hostendpoints"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.HostEndpoint](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -85,17 +137,57 @@ func NewHostEndpointInformerWithOptions(client clientset.Interface, options inte Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *hostEndpointInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewHostEndpointInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedHostEndpointInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *hostEndpointInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.HostEndpoint{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *hostEndpointInformer) TypedInformer() HostEndpointIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.HostEndpoint](f.factory.InformerFor(&apisprojectcalicov3.HostEndpoint{}, f.defaultInformer)) } func (f *hostEndpointInformer) Lister() projectcalicov3.HostEndpointLister { return projectcalicov3.NewHostEndpointLister(f.Informer().GetIndexer()) } + +// ToTypedHostEndpointInformer converts an untyped informer into a TypedHostEndpointInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *HostEndpoint. If that is not the case, calling type-safe methods of the returned +// TypedHostEndpointInformer leads to runtime panics. A safer alternative is to pass +// around a TypedHostEndpointInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedHostEndpointInformer(informer HostEndpointInformer) TypedHostEndpointInformer { + if informer, ok := informer.(TypedHostEndpointInformer); ok { + return informer + } + return &hostEndpointTypedInformerAdapter{informer} +} + +type hostEndpointTypedInformerAdapter struct { + HostEndpointInformer +} + +func (a *hostEndpointTypedInformerAdapter) TypedInformer() HostEndpointIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.HostEndpoint](a.Informer()) +} + +// ToHostEndpointIndexInformer converts an untyped informer into a HostEndpointIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *HostEndpoint. If that is not the case, calling type-safe methods of the returned +// HostEndpointIndexInformer leads to runtime panics. A safer alternative is to pass +// around a HostEndpointIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToHostEndpointIndexInformer(informer cache.SharedIndexInformer) HostEndpointIndexInformer { + if informer, ok := informer.(HostEndpointIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.HostEndpoint](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/interface.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/interface.go index 65dc9fd79..d508cd048 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/interface.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/interface.go @@ -11,51 +11,51 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // BGPConfigurations returns a BGPConfigurationInformer. - BGPConfigurations() BGPConfigurationInformer + BGPConfigurations() TypedBGPConfigurationInformer // BGPFilters returns a BGPFilterInformer. - BGPFilters() BGPFilterInformer + BGPFilters() TypedBGPFilterInformer // BGPPeers returns a BGPPeerInformer. - BGPPeers() BGPPeerInformer + BGPPeers() TypedBGPPeerInformer // BlockAffinities returns a BlockAffinityInformer. - BlockAffinities() BlockAffinityInformer + BlockAffinities() TypedBlockAffinityInformer // CalicoNodeStatuses returns a CalicoNodeStatusInformer. - CalicoNodeStatuses() CalicoNodeStatusInformer + CalicoNodeStatuses() TypedCalicoNodeStatusInformer // ClusterInformations returns a ClusterInformationInformer. - ClusterInformations() ClusterInformationInformer + ClusterInformations() TypedClusterInformationInformer // FelixConfigurations returns a FelixConfigurationInformer. - FelixConfigurations() FelixConfigurationInformer + FelixConfigurations() TypedFelixConfigurationInformer // GlobalNetworkPolicies returns a GlobalNetworkPolicyInformer. - GlobalNetworkPolicies() GlobalNetworkPolicyInformer + GlobalNetworkPolicies() TypedGlobalNetworkPolicyInformer // GlobalNetworkSets returns a GlobalNetworkSetInformer. - GlobalNetworkSets() GlobalNetworkSetInformer + GlobalNetworkSets() TypedGlobalNetworkSetInformer // HostEndpoints returns a HostEndpointInformer. - HostEndpoints() HostEndpointInformer + HostEndpoints() TypedHostEndpointInformer // IPAMBlocks returns a IPAMBlockInformer. - IPAMBlocks() IPAMBlockInformer + IPAMBlocks() TypedIPAMBlockInformer // IPAMConfigurations returns a IPAMConfigurationInformer. - IPAMConfigurations() IPAMConfigurationInformer + IPAMConfigurations() TypedIPAMConfigurationInformer // IPAMHandles returns a IPAMHandleInformer. - IPAMHandles() IPAMHandleInformer + IPAMHandles() TypedIPAMHandleInformer // IPPools returns a IPPoolInformer. - IPPools() IPPoolInformer + IPPools() TypedIPPoolInformer // IPReservations returns a IPReservationInformer. - IPReservations() IPReservationInformer + IPReservations() TypedIPReservationInformer // KubeControllersConfigurations returns a KubeControllersConfigurationInformer. - KubeControllersConfigurations() KubeControllersConfigurationInformer + KubeControllersConfigurations() TypedKubeControllersConfigurationInformer // NetworkPolicies returns a NetworkPolicyInformer. - NetworkPolicies() NetworkPolicyInformer + NetworkPolicies() TypedNetworkPolicyInformer // NetworkSets returns a NetworkSetInformer. - NetworkSets() NetworkSetInformer + NetworkSets() TypedNetworkSetInformer // Profiles returns a ProfileInformer. - Profiles() ProfileInformer + Profiles() TypedProfileInformer // StagedGlobalNetworkPolicies returns a StagedGlobalNetworkPolicyInformer. - StagedGlobalNetworkPolicies() StagedGlobalNetworkPolicyInformer + StagedGlobalNetworkPolicies() TypedStagedGlobalNetworkPolicyInformer // StagedKubernetesNetworkPolicies returns a StagedKubernetesNetworkPolicyInformer. - StagedKubernetesNetworkPolicies() StagedKubernetesNetworkPolicyInformer + StagedKubernetesNetworkPolicies() TypedStagedKubernetesNetworkPolicyInformer // StagedNetworkPolicies returns a StagedNetworkPolicyInformer. - StagedNetworkPolicies() StagedNetworkPolicyInformer + StagedNetworkPolicies() TypedStagedNetworkPolicyInformer // Tiers returns a TierInformer. - Tiers() TierInformer + Tiers() TypedTierInformer } type version struct { @@ -69,117 +69,117 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// BGPConfigurations returns a BGPConfigurationInformer. -func (v *version) BGPConfigurations() BGPConfigurationInformer { +// BGPConfigurations returns a TypedBGPConfigurationInformer. +func (v *version) BGPConfigurations() TypedBGPConfigurationInformer { return &bGPConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// BGPFilters returns a BGPFilterInformer. -func (v *version) BGPFilters() BGPFilterInformer { +// BGPFilters returns a TypedBGPFilterInformer. +func (v *version) BGPFilters() TypedBGPFilterInformer { return &bGPFilterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// BGPPeers returns a BGPPeerInformer. -func (v *version) BGPPeers() BGPPeerInformer { +// BGPPeers returns a TypedBGPPeerInformer. +func (v *version) BGPPeers() TypedBGPPeerInformer { return &bGPPeerInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// BlockAffinities returns a BlockAffinityInformer. -func (v *version) BlockAffinities() BlockAffinityInformer { +// BlockAffinities returns a TypedBlockAffinityInformer. +func (v *version) BlockAffinities() TypedBlockAffinityInformer { return &blockAffinityInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// CalicoNodeStatuses returns a CalicoNodeStatusInformer. -func (v *version) CalicoNodeStatuses() CalicoNodeStatusInformer { +// CalicoNodeStatuses returns a TypedCalicoNodeStatusInformer. +func (v *version) CalicoNodeStatuses() TypedCalicoNodeStatusInformer { return &calicoNodeStatusInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// ClusterInformations returns a ClusterInformationInformer. -func (v *version) ClusterInformations() ClusterInformationInformer { +// ClusterInformations returns a TypedClusterInformationInformer. +func (v *version) ClusterInformations() TypedClusterInformationInformer { return &clusterInformationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// FelixConfigurations returns a FelixConfigurationInformer. -func (v *version) FelixConfigurations() FelixConfigurationInformer { +// FelixConfigurations returns a TypedFelixConfigurationInformer. +func (v *version) FelixConfigurations() TypedFelixConfigurationInformer { return &felixConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// GlobalNetworkPolicies returns a GlobalNetworkPolicyInformer. -func (v *version) GlobalNetworkPolicies() GlobalNetworkPolicyInformer { +// GlobalNetworkPolicies returns a TypedGlobalNetworkPolicyInformer. +func (v *version) GlobalNetworkPolicies() TypedGlobalNetworkPolicyInformer { return &globalNetworkPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// GlobalNetworkSets returns a GlobalNetworkSetInformer. -func (v *version) GlobalNetworkSets() GlobalNetworkSetInformer { +// GlobalNetworkSets returns a TypedGlobalNetworkSetInformer. +func (v *version) GlobalNetworkSets() TypedGlobalNetworkSetInformer { return &globalNetworkSetInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// HostEndpoints returns a HostEndpointInformer. -func (v *version) HostEndpoints() HostEndpointInformer { +// HostEndpoints returns a TypedHostEndpointInformer. +func (v *version) HostEndpoints() TypedHostEndpointInformer { return &hostEndpointInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// IPAMBlocks returns a IPAMBlockInformer. -func (v *version) IPAMBlocks() IPAMBlockInformer { +// IPAMBlocks returns a TypedIPAMBlockInformer. +func (v *version) IPAMBlocks() TypedIPAMBlockInformer { return &iPAMBlockInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// IPAMConfigurations returns a IPAMConfigurationInformer. -func (v *version) IPAMConfigurations() IPAMConfigurationInformer { +// IPAMConfigurations returns a TypedIPAMConfigurationInformer. +func (v *version) IPAMConfigurations() TypedIPAMConfigurationInformer { return &iPAMConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// IPAMHandles returns a IPAMHandleInformer. -func (v *version) IPAMHandles() IPAMHandleInformer { +// IPAMHandles returns a TypedIPAMHandleInformer. +func (v *version) IPAMHandles() TypedIPAMHandleInformer { return &iPAMHandleInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// IPPools returns a IPPoolInformer. -func (v *version) IPPools() IPPoolInformer { +// IPPools returns a TypedIPPoolInformer. +func (v *version) IPPools() TypedIPPoolInformer { return &iPPoolInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// IPReservations returns a IPReservationInformer. -func (v *version) IPReservations() IPReservationInformer { +// IPReservations returns a TypedIPReservationInformer. +func (v *version) IPReservations() TypedIPReservationInformer { return &iPReservationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// KubeControllersConfigurations returns a KubeControllersConfigurationInformer. -func (v *version) KubeControllersConfigurations() KubeControllersConfigurationInformer { +// KubeControllersConfigurations returns a TypedKubeControllersConfigurationInformer. +func (v *version) KubeControllersConfigurations() TypedKubeControllersConfigurationInformer { return &kubeControllersConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// NetworkPolicies returns a NetworkPolicyInformer. -func (v *version) NetworkPolicies() NetworkPolicyInformer { +// NetworkPolicies returns a TypedNetworkPolicyInformer. +func (v *version) NetworkPolicies() TypedNetworkPolicyInformer { return &networkPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// NetworkSets returns a NetworkSetInformer. -func (v *version) NetworkSets() NetworkSetInformer { +// NetworkSets returns a TypedNetworkSetInformer. +func (v *version) NetworkSets() TypedNetworkSetInformer { return &networkSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Profiles returns a ProfileInformer. -func (v *version) Profiles() ProfileInformer { +// Profiles returns a TypedProfileInformer. +func (v *version) Profiles() TypedProfileInformer { return &profileInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// StagedGlobalNetworkPolicies returns a StagedGlobalNetworkPolicyInformer. -func (v *version) StagedGlobalNetworkPolicies() StagedGlobalNetworkPolicyInformer { +// StagedGlobalNetworkPolicies returns a TypedStagedGlobalNetworkPolicyInformer. +func (v *version) StagedGlobalNetworkPolicies() TypedStagedGlobalNetworkPolicyInformer { return &stagedGlobalNetworkPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// StagedKubernetesNetworkPolicies returns a StagedKubernetesNetworkPolicyInformer. -func (v *version) StagedKubernetesNetworkPolicies() StagedKubernetesNetworkPolicyInformer { +// StagedKubernetesNetworkPolicies returns a TypedStagedKubernetesNetworkPolicyInformer. +func (v *version) StagedKubernetesNetworkPolicies() TypedStagedKubernetesNetworkPolicyInformer { return &stagedKubernetesNetworkPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// StagedNetworkPolicies returns a StagedNetworkPolicyInformer. -func (v *version) StagedNetworkPolicies() StagedNetworkPolicyInformer { +// StagedNetworkPolicies returns a TypedStagedNetworkPolicyInformer. +func (v *version) StagedNetworkPolicies() TypedStagedNetworkPolicyInformer { return &stagedNetworkPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Tiers returns a TierInformer. -func (v *version) Tiers() TierInformer { +// Tiers returns a TypedTierInformer. +func (v *version) Tiers() TypedTierInformer { return &tierInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/ipamblock.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/ipamblock.go index 6513bf8cb..413d1741e 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/ipamblock.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/ipamblock.go @@ -20,12 +20,40 @@ import ( ) // IPAMBlockInformer provides access to a shared informer and lister for -// IPAMBlocks. +// IPAMBlocks. Prefer using the type-safe variant (see [TypedIPAMBlockInformer]). type IPAMBlockInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.IPAMBlockLister } +// TypedIPAMBlockInformer provides access to a shared informer and lister for +// IPAMBlocks, including the type-safe TypedInformer variant. +// It is a superset of IPAMBlockInformer. +type TypedIPAMBlockInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() IPAMBlockIndexInformer + Lister() projectcalicov3.IPAMBlockLister +} + +// IPAMBlockIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type IPAMBlockIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.IPAMBlock] + +// IPAMBlockHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for IPAMBlock. +type IPAMBlockHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.IPAMBlock] + +// IPAMBlockDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for IPAMBlock. +type IPAMBlockDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.IPAMBlock] + +// IPAMBlockFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for IPAMBlock. +type IPAMBlockFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.IPAMBlock] + +// IPAMBlockIndexers is a specialization of [cache.TypedIndexers] for IPAMBlock. +type IPAMBlockIndexers = cache.TypedIndexers[*apisprojectcalicov3.IPAMBlock] + +// DeletedIPAMBlock is a specialization of [cache.DeletedObject] for IPAMBlock. +type DeletedIPAMBlock = cache.DeletedObject[*apisprojectcalicov3.IPAMBlock] + type iPAMBlockInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -34,25 +62,49 @@ type iPAMBlockInformer struct { // NewIPAMBlockInformer constructs a new informer for IPAMBlock type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIPAMBlockInformer]). func NewIPAMBlockInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewIPAMBlockInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedIPAMBlockInformer constructs a new informer for IPAMBlock type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIPAMBlockInformer(client clientset.Interface, resyncPeriod time.Duration, indexers IPAMBlockIndexers) IPAMBlockIndexInformer { + return NewTypedIPAMBlockInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredIPAMBlockInformer constructs a new informer for IPAMBlock type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredIPAMBlockInformer]). func NewFilteredIPAMBlockInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewIPAMBlockInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedIPAMBlockInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredIPAMBlockInformer constructs a new informer for IPAMBlock type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredIPAMBlockInformer(client clientset.Interface, resyncPeriod time.Duration, indexers IPAMBlockIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) IPAMBlockIndexInformer { + return NewTypedIPAMBlockInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewIPAMBlockInformerWithOptions constructs a new informer for IPAMBlock type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIPAMBlockInformerWithOptions]). func NewIPAMBlockInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedIPAMBlockInformerWithOptions(client, options) +} + +// NewTypedIPAMBlockInformerWithOptions constructs a new informer for IPAMBlock type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIPAMBlockInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) IPAMBlockIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "ipamblocks"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.IPAMBlock](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -85,17 +137,57 @@ func NewIPAMBlockInformerWithOptions(client clientset.Interface, options interna Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *iPAMBlockInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewIPAMBlockInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedIPAMBlockInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *iPAMBlockInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.IPAMBlock{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *iPAMBlockInformer) TypedInformer() IPAMBlockIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.IPAMBlock](f.factory.InformerFor(&apisprojectcalicov3.IPAMBlock{}, f.defaultInformer)) } func (f *iPAMBlockInformer) Lister() projectcalicov3.IPAMBlockLister { return projectcalicov3.NewIPAMBlockLister(f.Informer().GetIndexer()) } + +// ToTypedIPAMBlockInformer converts an untyped informer into a TypedIPAMBlockInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *IPAMBlock. If that is not the case, calling type-safe methods of the returned +// TypedIPAMBlockInformer leads to runtime panics. A safer alternative is to pass +// around a TypedIPAMBlockInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedIPAMBlockInformer(informer IPAMBlockInformer) TypedIPAMBlockInformer { + if informer, ok := informer.(TypedIPAMBlockInformer); ok { + return informer + } + return &iPAMBlockTypedInformerAdapter{informer} +} + +type iPAMBlockTypedInformerAdapter struct { + IPAMBlockInformer +} + +func (a *iPAMBlockTypedInformerAdapter) TypedInformer() IPAMBlockIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.IPAMBlock](a.Informer()) +} + +// ToIPAMBlockIndexInformer converts an untyped informer into a IPAMBlockIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *IPAMBlock. If that is not the case, calling type-safe methods of the returned +// IPAMBlockIndexInformer leads to runtime panics. A safer alternative is to pass +// around a IPAMBlockIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToIPAMBlockIndexInformer(informer cache.SharedIndexInformer) IPAMBlockIndexInformer { + if informer, ok := informer.(IPAMBlockIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.IPAMBlock](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/ipamconfiguration.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/ipamconfiguration.go index 7f1e8849f..eab671fd1 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/ipamconfiguration.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/ipamconfiguration.go @@ -20,12 +20,40 @@ import ( ) // IPAMConfigurationInformer provides access to a shared informer and lister for -// IPAMConfigurations. +// IPAMConfigurations. Prefer using the type-safe variant (see [TypedIPAMConfigurationInformer]). type IPAMConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.IPAMConfigurationLister } +// TypedIPAMConfigurationInformer provides access to a shared informer and lister for +// IPAMConfigurations, including the type-safe TypedInformer variant. +// It is a superset of IPAMConfigurationInformer. +type TypedIPAMConfigurationInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() IPAMConfigurationIndexInformer + Lister() projectcalicov3.IPAMConfigurationLister +} + +// IPAMConfigurationIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type IPAMConfigurationIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.IPAMConfiguration] + +// IPAMConfigurationHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for IPAMConfiguration. +type IPAMConfigurationHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.IPAMConfiguration] + +// IPAMConfigurationDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for IPAMConfiguration. +type IPAMConfigurationDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.IPAMConfiguration] + +// IPAMConfigurationFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for IPAMConfiguration. +type IPAMConfigurationFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.IPAMConfiguration] + +// IPAMConfigurationIndexers is a specialization of [cache.TypedIndexers] for IPAMConfiguration. +type IPAMConfigurationIndexers = cache.TypedIndexers[*apisprojectcalicov3.IPAMConfiguration] + +// DeletedIPAMConfiguration is a specialization of [cache.DeletedObject] for IPAMConfiguration. +type DeletedIPAMConfiguration = cache.DeletedObject[*apisprojectcalicov3.IPAMConfiguration] + type iPAMConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -34,25 +62,49 @@ type iPAMConfigurationInformer struct { // NewIPAMConfigurationInformer constructs a new informer for IPAMConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIPAMConfigurationInformer]). func NewIPAMConfigurationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewIPAMConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedIPAMConfigurationInformer constructs a new informer for IPAMConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIPAMConfigurationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers IPAMConfigurationIndexers) IPAMConfigurationIndexInformer { + return NewTypedIPAMConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredIPAMConfigurationInformer constructs a new informer for IPAMConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredIPAMConfigurationInformer]). func NewFilteredIPAMConfigurationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewIPAMConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedIPAMConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredIPAMConfigurationInformer constructs a new informer for IPAMConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredIPAMConfigurationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers IPAMConfigurationIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) IPAMConfigurationIndexInformer { + return NewTypedIPAMConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewIPAMConfigurationInformerWithOptions constructs a new informer for IPAMConfiguration type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIPAMConfigurationInformerWithOptions]). func NewIPAMConfigurationInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedIPAMConfigurationInformerWithOptions(client, options) +} + +// NewTypedIPAMConfigurationInformerWithOptions constructs a new informer for IPAMConfiguration type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIPAMConfigurationInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) IPAMConfigurationIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "ipamconfigurations"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.IPAMConfiguration](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -85,17 +137,57 @@ func NewIPAMConfigurationInformerWithOptions(client clientset.Interface, options Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *iPAMConfigurationInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewIPAMConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedIPAMConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *iPAMConfigurationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.IPAMConfiguration{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *iPAMConfigurationInformer) TypedInformer() IPAMConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.IPAMConfiguration](f.factory.InformerFor(&apisprojectcalicov3.IPAMConfiguration{}, f.defaultInformer)) } func (f *iPAMConfigurationInformer) Lister() projectcalicov3.IPAMConfigurationLister { return projectcalicov3.NewIPAMConfigurationLister(f.Informer().GetIndexer()) } + +// ToTypedIPAMConfigurationInformer converts an untyped informer into a TypedIPAMConfigurationInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *IPAMConfiguration. If that is not the case, calling type-safe methods of the returned +// TypedIPAMConfigurationInformer leads to runtime panics. A safer alternative is to pass +// around a TypedIPAMConfigurationInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedIPAMConfigurationInformer(informer IPAMConfigurationInformer) TypedIPAMConfigurationInformer { + if informer, ok := informer.(TypedIPAMConfigurationInformer); ok { + return informer + } + return &iPAMConfigurationTypedInformerAdapter{informer} +} + +type iPAMConfigurationTypedInformerAdapter struct { + IPAMConfigurationInformer +} + +func (a *iPAMConfigurationTypedInformerAdapter) TypedInformer() IPAMConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.IPAMConfiguration](a.Informer()) +} + +// ToIPAMConfigurationIndexInformer converts an untyped informer into a IPAMConfigurationIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *IPAMConfiguration. If that is not the case, calling type-safe methods of the returned +// IPAMConfigurationIndexInformer leads to runtime panics. A safer alternative is to pass +// around a IPAMConfigurationIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToIPAMConfigurationIndexInformer(informer cache.SharedIndexInformer) IPAMConfigurationIndexInformer { + if informer, ok := informer.(IPAMConfigurationIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.IPAMConfiguration](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/ipamhandle.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/ipamhandle.go index a953a75f7..ad43e282d 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/ipamhandle.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/ipamhandle.go @@ -20,12 +20,40 @@ import ( ) // IPAMHandleInformer provides access to a shared informer and lister for -// IPAMHandles. +// IPAMHandles. Prefer using the type-safe variant (see [TypedIPAMHandleInformer]). type IPAMHandleInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.IPAMHandleLister } +// TypedIPAMHandleInformer provides access to a shared informer and lister for +// IPAMHandles, including the type-safe TypedInformer variant. +// It is a superset of IPAMHandleInformer. +type TypedIPAMHandleInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() IPAMHandleIndexInformer + Lister() projectcalicov3.IPAMHandleLister +} + +// IPAMHandleIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type IPAMHandleIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.IPAMHandle] + +// IPAMHandleHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for IPAMHandle. +type IPAMHandleHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.IPAMHandle] + +// IPAMHandleDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for IPAMHandle. +type IPAMHandleDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.IPAMHandle] + +// IPAMHandleFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for IPAMHandle. +type IPAMHandleFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.IPAMHandle] + +// IPAMHandleIndexers is a specialization of [cache.TypedIndexers] for IPAMHandle. +type IPAMHandleIndexers = cache.TypedIndexers[*apisprojectcalicov3.IPAMHandle] + +// DeletedIPAMHandle is a specialization of [cache.DeletedObject] for IPAMHandle. +type DeletedIPAMHandle = cache.DeletedObject[*apisprojectcalicov3.IPAMHandle] + type iPAMHandleInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -35,25 +63,49 @@ type iPAMHandleInformer struct { // NewIPAMHandleInformer constructs a new informer for IPAMHandle type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIPAMHandleInformer]). func NewIPAMHandleInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewIPAMHandleInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedIPAMHandleInformer constructs a new informer for IPAMHandle type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIPAMHandleInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers IPAMHandleIndexers) IPAMHandleIndexInformer { + return NewTypedIPAMHandleInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredIPAMHandleInformer constructs a new informer for IPAMHandle type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredIPAMHandleInformer]). func NewFilteredIPAMHandleInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewIPAMHandleInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedIPAMHandleInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredIPAMHandleInformer constructs a new informer for IPAMHandle type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredIPAMHandleInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers IPAMHandleIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) IPAMHandleIndexInformer { + return NewTypedIPAMHandleInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewIPAMHandleInformerWithOptions constructs a new informer for IPAMHandle type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIPAMHandleInformerWithOptions]). func NewIPAMHandleInformerWithOptions(client clientset.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedIPAMHandleInformerWithOptions(client, namespace, options) +} + +// NewTypedIPAMHandleInformerWithOptions constructs a new informer for IPAMHandle type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIPAMHandleInformerWithOptions(client clientset.Interface, namespace string, options internalinterfaces.InformerOptions) IPAMHandleIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "ipamhandles"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.IPAMHandle](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -86,17 +138,57 @@ func NewIPAMHandleInformerWithOptions(client clientset.Interface, namespace stri Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *iPAMHandleInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewIPAMHandleInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedIPAMHandleInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *iPAMHandleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.IPAMHandle{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *iPAMHandleInformer) TypedInformer() IPAMHandleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.IPAMHandle](f.factory.InformerFor(&apisprojectcalicov3.IPAMHandle{}, f.defaultInformer)) } func (f *iPAMHandleInformer) Lister() projectcalicov3.IPAMHandleLister { return projectcalicov3.NewIPAMHandleLister(f.Informer().GetIndexer()) } + +// ToTypedIPAMHandleInformer converts an untyped informer into a TypedIPAMHandleInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *IPAMHandle. If that is not the case, calling type-safe methods of the returned +// TypedIPAMHandleInformer leads to runtime panics. A safer alternative is to pass +// around a TypedIPAMHandleInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedIPAMHandleInformer(informer IPAMHandleInformer) TypedIPAMHandleInformer { + if informer, ok := informer.(TypedIPAMHandleInformer); ok { + return informer + } + return &iPAMHandleTypedInformerAdapter{informer} +} + +type iPAMHandleTypedInformerAdapter struct { + IPAMHandleInformer +} + +func (a *iPAMHandleTypedInformerAdapter) TypedInformer() IPAMHandleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.IPAMHandle](a.Informer()) +} + +// ToIPAMHandleIndexInformer converts an untyped informer into a IPAMHandleIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *IPAMHandle. If that is not the case, calling type-safe methods of the returned +// IPAMHandleIndexInformer leads to runtime panics. A safer alternative is to pass +// around a IPAMHandleIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToIPAMHandleIndexInformer(informer cache.SharedIndexInformer) IPAMHandleIndexInformer { + if informer, ok := informer.(IPAMHandleIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.IPAMHandle](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/ippool.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/ippool.go index 887c57d10..2f6a914f4 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/ippool.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/ippool.go @@ -20,12 +20,40 @@ import ( ) // IPPoolInformer provides access to a shared informer and lister for -// IPPools. +// IPPools. Prefer using the type-safe variant (see [TypedIPPoolInformer]). type IPPoolInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.IPPoolLister } +// TypedIPPoolInformer provides access to a shared informer and lister for +// IPPools, including the type-safe TypedInformer variant. +// It is a superset of IPPoolInformer. +type TypedIPPoolInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() IPPoolIndexInformer + Lister() projectcalicov3.IPPoolLister +} + +// IPPoolIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type IPPoolIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.IPPool] + +// IPPoolHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for IPPool. +type IPPoolHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.IPPool] + +// IPPoolDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for IPPool. +type IPPoolDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.IPPool] + +// IPPoolFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for IPPool. +type IPPoolFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.IPPool] + +// IPPoolIndexers is a specialization of [cache.TypedIndexers] for IPPool. +type IPPoolIndexers = cache.TypedIndexers[*apisprojectcalicov3.IPPool] + +// DeletedIPPool is a specialization of [cache.DeletedObject] for IPPool. +type DeletedIPPool = cache.DeletedObject[*apisprojectcalicov3.IPPool] + type iPPoolInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -34,25 +62,49 @@ type iPPoolInformer struct { // NewIPPoolInformer constructs a new informer for IPPool type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIPPoolInformer]). func NewIPPoolInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewIPPoolInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedIPPoolInformer constructs a new informer for IPPool type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIPPoolInformer(client clientset.Interface, resyncPeriod time.Duration, indexers IPPoolIndexers) IPPoolIndexInformer { + return NewTypedIPPoolInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredIPPoolInformer constructs a new informer for IPPool type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredIPPoolInformer]). func NewFilteredIPPoolInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewIPPoolInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedIPPoolInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredIPPoolInformer constructs a new informer for IPPool type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredIPPoolInformer(client clientset.Interface, resyncPeriod time.Duration, indexers IPPoolIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) IPPoolIndexInformer { + return NewTypedIPPoolInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewIPPoolInformerWithOptions constructs a new informer for IPPool type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIPPoolInformerWithOptions]). func NewIPPoolInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedIPPoolInformerWithOptions(client, options) +} + +// NewTypedIPPoolInformerWithOptions constructs a new informer for IPPool type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIPPoolInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) IPPoolIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "ippools"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.IPPool](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -85,17 +137,57 @@ func NewIPPoolInformerWithOptions(client clientset.Interface, options internalin Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *iPPoolInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewIPPoolInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedIPPoolInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *iPPoolInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.IPPool{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *iPPoolInformer) TypedInformer() IPPoolIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.IPPool](f.factory.InformerFor(&apisprojectcalicov3.IPPool{}, f.defaultInformer)) } func (f *iPPoolInformer) Lister() projectcalicov3.IPPoolLister { return projectcalicov3.NewIPPoolLister(f.Informer().GetIndexer()) } + +// ToTypedIPPoolInformer converts an untyped informer into a TypedIPPoolInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *IPPool. If that is not the case, calling type-safe methods of the returned +// TypedIPPoolInformer leads to runtime panics. A safer alternative is to pass +// around a TypedIPPoolInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedIPPoolInformer(informer IPPoolInformer) TypedIPPoolInformer { + if informer, ok := informer.(TypedIPPoolInformer); ok { + return informer + } + return &iPPoolTypedInformerAdapter{informer} +} + +type iPPoolTypedInformerAdapter struct { + IPPoolInformer +} + +func (a *iPPoolTypedInformerAdapter) TypedInformer() IPPoolIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.IPPool](a.Informer()) +} + +// ToIPPoolIndexInformer converts an untyped informer into a IPPoolIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *IPPool. If that is not the case, calling type-safe methods of the returned +// IPPoolIndexInformer leads to runtime panics. A safer alternative is to pass +// around a IPPoolIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToIPPoolIndexInformer(informer cache.SharedIndexInformer) IPPoolIndexInformer { + if informer, ok := informer.(IPPoolIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.IPPool](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/ipreservation.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/ipreservation.go index 15cd49e4f..698a3f2bb 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/ipreservation.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/ipreservation.go @@ -20,12 +20,40 @@ import ( ) // IPReservationInformer provides access to a shared informer and lister for -// IPReservations. +// IPReservations. Prefer using the type-safe variant (see [TypedIPReservationInformer]). type IPReservationInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.IPReservationLister } +// TypedIPReservationInformer provides access to a shared informer and lister for +// IPReservations, including the type-safe TypedInformer variant. +// It is a superset of IPReservationInformer. +type TypedIPReservationInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() IPReservationIndexInformer + Lister() projectcalicov3.IPReservationLister +} + +// IPReservationIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type IPReservationIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.IPReservation] + +// IPReservationHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for IPReservation. +type IPReservationHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.IPReservation] + +// IPReservationDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for IPReservation. +type IPReservationDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.IPReservation] + +// IPReservationFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for IPReservation. +type IPReservationFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.IPReservation] + +// IPReservationIndexers is a specialization of [cache.TypedIndexers] for IPReservation. +type IPReservationIndexers = cache.TypedIndexers[*apisprojectcalicov3.IPReservation] + +// DeletedIPReservation is a specialization of [cache.DeletedObject] for IPReservation. +type DeletedIPReservation = cache.DeletedObject[*apisprojectcalicov3.IPReservation] + type iPReservationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -34,25 +62,49 @@ type iPReservationInformer struct { // NewIPReservationInformer constructs a new informer for IPReservation type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIPReservationInformer]). func NewIPReservationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewIPReservationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedIPReservationInformer constructs a new informer for IPReservation type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIPReservationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers IPReservationIndexers) IPReservationIndexInformer { + return NewTypedIPReservationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredIPReservationInformer constructs a new informer for IPReservation type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredIPReservationInformer]). func NewFilteredIPReservationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewIPReservationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedIPReservationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredIPReservationInformer constructs a new informer for IPReservation type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredIPReservationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers IPReservationIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) IPReservationIndexInformer { + return NewTypedIPReservationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewIPReservationInformerWithOptions constructs a new informer for IPReservation type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIPReservationInformerWithOptions]). func NewIPReservationInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedIPReservationInformerWithOptions(client, options) +} + +// NewTypedIPReservationInformerWithOptions constructs a new informer for IPReservation type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIPReservationInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) IPReservationIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "ipreservations"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.IPReservation](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -85,17 +137,57 @@ func NewIPReservationInformerWithOptions(client clientset.Interface, options int Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *iPReservationInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewIPReservationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedIPReservationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *iPReservationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.IPReservation{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *iPReservationInformer) TypedInformer() IPReservationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.IPReservation](f.factory.InformerFor(&apisprojectcalicov3.IPReservation{}, f.defaultInformer)) } func (f *iPReservationInformer) Lister() projectcalicov3.IPReservationLister { return projectcalicov3.NewIPReservationLister(f.Informer().GetIndexer()) } + +// ToTypedIPReservationInformer converts an untyped informer into a TypedIPReservationInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *IPReservation. If that is not the case, calling type-safe methods of the returned +// TypedIPReservationInformer leads to runtime panics. A safer alternative is to pass +// around a TypedIPReservationInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedIPReservationInformer(informer IPReservationInformer) TypedIPReservationInformer { + if informer, ok := informer.(TypedIPReservationInformer); ok { + return informer + } + return &iPReservationTypedInformerAdapter{informer} +} + +type iPReservationTypedInformerAdapter struct { + IPReservationInformer +} + +func (a *iPReservationTypedInformerAdapter) TypedInformer() IPReservationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.IPReservation](a.Informer()) +} + +// ToIPReservationIndexInformer converts an untyped informer into a IPReservationIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *IPReservation. If that is not the case, calling type-safe methods of the returned +// IPReservationIndexInformer leads to runtime panics. A safer alternative is to pass +// around a IPReservationIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToIPReservationIndexInformer(informer cache.SharedIndexInformer) IPReservationIndexInformer { + if informer, ok := informer.(IPReservationIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.IPReservation](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/kubecontrollersconfiguration.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/kubecontrollersconfiguration.go index 7fd612eeb..4f590c849 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/kubecontrollersconfiguration.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/kubecontrollersconfiguration.go @@ -20,12 +20,40 @@ import ( ) // KubeControllersConfigurationInformer provides access to a shared informer and lister for -// KubeControllersConfigurations. +// KubeControllersConfigurations. Prefer using the type-safe variant (see [TypedKubeControllersConfigurationInformer]). type KubeControllersConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.KubeControllersConfigurationLister } +// TypedKubeControllersConfigurationInformer provides access to a shared informer and lister for +// KubeControllersConfigurations, including the type-safe TypedInformer variant. +// It is a superset of KubeControllersConfigurationInformer. +type TypedKubeControllersConfigurationInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() KubeControllersConfigurationIndexInformer + Lister() projectcalicov3.KubeControllersConfigurationLister +} + +// KubeControllersConfigurationIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type KubeControllersConfigurationIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.KubeControllersConfiguration] + +// KubeControllersConfigurationHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for KubeControllersConfiguration. +type KubeControllersConfigurationHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.KubeControllersConfiguration] + +// KubeControllersConfigurationDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for KubeControllersConfiguration. +type KubeControllersConfigurationDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.KubeControllersConfiguration] + +// KubeControllersConfigurationFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for KubeControllersConfiguration. +type KubeControllersConfigurationFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.KubeControllersConfiguration] + +// KubeControllersConfigurationIndexers is a specialization of [cache.TypedIndexers] for KubeControllersConfiguration. +type KubeControllersConfigurationIndexers = cache.TypedIndexers[*apisprojectcalicov3.KubeControllersConfiguration] + +// DeletedKubeControllersConfiguration is a specialization of [cache.DeletedObject] for KubeControllersConfiguration. +type DeletedKubeControllersConfiguration = cache.DeletedObject[*apisprojectcalicov3.KubeControllersConfiguration] + type kubeControllersConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -34,25 +62,49 @@ type kubeControllersConfigurationInformer struct { // NewKubeControllersConfigurationInformer constructs a new informer for KubeControllersConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedKubeControllersConfigurationInformer]). func NewKubeControllersConfigurationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewKubeControllersConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedKubeControllersConfigurationInformer constructs a new informer for KubeControllersConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedKubeControllersConfigurationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers KubeControllersConfigurationIndexers) KubeControllersConfigurationIndexInformer { + return NewTypedKubeControllersConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredKubeControllersConfigurationInformer constructs a new informer for KubeControllersConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredKubeControllersConfigurationInformer]). func NewFilteredKubeControllersConfigurationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewKubeControllersConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedKubeControllersConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredKubeControllersConfigurationInformer constructs a new informer for KubeControllersConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredKubeControllersConfigurationInformer(client clientset.Interface, resyncPeriod time.Duration, indexers KubeControllersConfigurationIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) KubeControllersConfigurationIndexInformer { + return NewTypedKubeControllersConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewKubeControllersConfigurationInformerWithOptions constructs a new informer for KubeControllersConfiguration type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedKubeControllersConfigurationInformerWithOptions]). func NewKubeControllersConfigurationInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedKubeControllersConfigurationInformerWithOptions(client, options) +} + +// NewTypedKubeControllersConfigurationInformerWithOptions constructs a new informer for KubeControllersConfiguration type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedKubeControllersConfigurationInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) KubeControllersConfigurationIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "kubecontrollersconfigurations"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.KubeControllersConfiguration](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -85,17 +137,57 @@ func NewKubeControllersConfigurationInformerWithOptions(client clientset.Interfa Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *kubeControllersConfigurationInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewKubeControllersConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedKubeControllersConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *kubeControllersConfigurationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.KubeControllersConfiguration{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *kubeControllersConfigurationInformer) TypedInformer() KubeControllersConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.KubeControllersConfiguration](f.factory.InformerFor(&apisprojectcalicov3.KubeControllersConfiguration{}, f.defaultInformer)) } func (f *kubeControllersConfigurationInformer) Lister() projectcalicov3.KubeControllersConfigurationLister { return projectcalicov3.NewKubeControllersConfigurationLister(f.Informer().GetIndexer()) } + +// ToTypedKubeControllersConfigurationInformer converts an untyped informer into a TypedKubeControllersConfigurationInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *KubeControllersConfiguration. If that is not the case, calling type-safe methods of the returned +// TypedKubeControllersConfigurationInformer leads to runtime panics. A safer alternative is to pass +// around a TypedKubeControllersConfigurationInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedKubeControllersConfigurationInformer(informer KubeControllersConfigurationInformer) TypedKubeControllersConfigurationInformer { + if informer, ok := informer.(TypedKubeControllersConfigurationInformer); ok { + return informer + } + return &kubeControllersConfigurationTypedInformerAdapter{informer} +} + +type kubeControllersConfigurationTypedInformerAdapter struct { + KubeControllersConfigurationInformer +} + +func (a *kubeControllersConfigurationTypedInformerAdapter) TypedInformer() KubeControllersConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.KubeControllersConfiguration](a.Informer()) +} + +// ToKubeControllersConfigurationIndexInformer converts an untyped informer into a KubeControllersConfigurationIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *KubeControllersConfiguration. If that is not the case, calling type-safe methods of the returned +// KubeControllersConfigurationIndexInformer leads to runtime panics. A safer alternative is to pass +// around a KubeControllersConfigurationIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToKubeControllersConfigurationIndexInformer(informer cache.SharedIndexInformer) KubeControllersConfigurationIndexInformer { + if informer, ok := informer.(KubeControllersConfigurationIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.KubeControllersConfiguration](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/networkpolicy.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/networkpolicy.go index 6754cce6e..af460cde5 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/networkpolicy.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/networkpolicy.go @@ -20,12 +20,40 @@ import ( ) // NetworkPolicyInformer provides access to a shared informer and lister for -// NetworkPolicies. +// NetworkPolicies. Prefer using the type-safe variant (see [TypedNetworkPolicyInformer]). type NetworkPolicyInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.NetworkPolicyLister } +// TypedNetworkPolicyInformer provides access to a shared informer and lister for +// NetworkPolicies, including the type-safe TypedInformer variant. +// It is a superset of NetworkPolicyInformer. +type TypedNetworkPolicyInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() NetworkPolicyIndexInformer + Lister() projectcalicov3.NetworkPolicyLister +} + +// NetworkPolicyIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type NetworkPolicyIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.NetworkPolicy] + +// NetworkPolicyHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for NetworkPolicy. +type NetworkPolicyHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.NetworkPolicy] + +// NetworkPolicyDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for NetworkPolicy. +type NetworkPolicyDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.NetworkPolicy] + +// NetworkPolicyFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for NetworkPolicy. +type NetworkPolicyFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.NetworkPolicy] + +// NetworkPolicyIndexers is a specialization of [cache.TypedIndexers] for NetworkPolicy. +type NetworkPolicyIndexers = cache.TypedIndexers[*apisprojectcalicov3.NetworkPolicy] + +// DeletedNetworkPolicy is a specialization of [cache.DeletedObject] for NetworkPolicy. +type DeletedNetworkPolicy = cache.DeletedObject[*apisprojectcalicov3.NetworkPolicy] + type networkPolicyInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -35,25 +63,49 @@ type networkPolicyInformer struct { // NewNetworkPolicyInformer constructs a new informer for NetworkPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedNetworkPolicyInformer]). func NewNetworkPolicyInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedNetworkPolicyInformer constructs a new informer for NetworkPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedNetworkPolicyInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers NetworkPolicyIndexers) NetworkPolicyIndexInformer { + return NewTypedNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredNetworkPolicyInformer constructs a new informer for NetworkPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredNetworkPolicyInformer]). func NewFilteredNetworkPolicyInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredNetworkPolicyInformer constructs a new informer for NetworkPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredNetworkPolicyInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers NetworkPolicyIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) NetworkPolicyIndexInformer { + return NewTypedNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewNetworkPolicyInformerWithOptions constructs a new informer for NetworkPolicy type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedNetworkPolicyInformerWithOptions]). func NewNetworkPolicyInformerWithOptions(client clientset.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedNetworkPolicyInformerWithOptions(client, namespace, options) +} + +// NewTypedNetworkPolicyInformerWithOptions constructs a new informer for NetworkPolicy type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedNetworkPolicyInformerWithOptions(client clientset.Interface, namespace string, options internalinterfaces.InformerOptions) NetworkPolicyIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "networkpolicies"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.NetworkPolicy](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -86,17 +138,57 @@ func NewNetworkPolicyInformerWithOptions(client clientset.Interface, namespace s Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *networkPolicyInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewNetworkPolicyInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedNetworkPolicyInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *networkPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.NetworkPolicy{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *networkPolicyInformer) TypedInformer() NetworkPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.NetworkPolicy](f.factory.InformerFor(&apisprojectcalicov3.NetworkPolicy{}, f.defaultInformer)) } func (f *networkPolicyInformer) Lister() projectcalicov3.NetworkPolicyLister { return projectcalicov3.NewNetworkPolicyLister(f.Informer().GetIndexer()) } + +// ToTypedNetworkPolicyInformer converts an untyped informer into a TypedNetworkPolicyInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *NetworkPolicy. If that is not the case, calling type-safe methods of the returned +// TypedNetworkPolicyInformer leads to runtime panics. A safer alternative is to pass +// around a TypedNetworkPolicyInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedNetworkPolicyInformer(informer NetworkPolicyInformer) TypedNetworkPolicyInformer { + if informer, ok := informer.(TypedNetworkPolicyInformer); ok { + return informer + } + return &networkPolicyTypedInformerAdapter{informer} +} + +type networkPolicyTypedInformerAdapter struct { + NetworkPolicyInformer +} + +func (a *networkPolicyTypedInformerAdapter) TypedInformer() NetworkPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.NetworkPolicy](a.Informer()) +} + +// ToNetworkPolicyIndexInformer converts an untyped informer into a NetworkPolicyIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *NetworkPolicy. If that is not the case, calling type-safe methods of the returned +// NetworkPolicyIndexInformer leads to runtime panics. A safer alternative is to pass +// around a NetworkPolicyIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToNetworkPolicyIndexInformer(informer cache.SharedIndexInformer) NetworkPolicyIndexInformer { + if informer, ok := informer.(NetworkPolicyIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.NetworkPolicy](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/networkset.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/networkset.go index 5de8f0bec..b56f31c97 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/networkset.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/networkset.go @@ -20,12 +20,40 @@ import ( ) // NetworkSetInformer provides access to a shared informer and lister for -// NetworkSets. +// NetworkSets. Prefer using the type-safe variant (see [TypedNetworkSetInformer]). type NetworkSetInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.NetworkSetLister } +// TypedNetworkSetInformer provides access to a shared informer and lister for +// NetworkSets, including the type-safe TypedInformer variant. +// It is a superset of NetworkSetInformer. +type TypedNetworkSetInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() NetworkSetIndexInformer + Lister() projectcalicov3.NetworkSetLister +} + +// NetworkSetIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type NetworkSetIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.NetworkSet] + +// NetworkSetHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for NetworkSet. +type NetworkSetHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.NetworkSet] + +// NetworkSetDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for NetworkSet. +type NetworkSetDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.NetworkSet] + +// NetworkSetFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for NetworkSet. +type NetworkSetFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.NetworkSet] + +// NetworkSetIndexers is a specialization of [cache.TypedIndexers] for NetworkSet. +type NetworkSetIndexers = cache.TypedIndexers[*apisprojectcalicov3.NetworkSet] + +// DeletedNetworkSet is a specialization of [cache.DeletedObject] for NetworkSet. +type DeletedNetworkSet = cache.DeletedObject[*apisprojectcalicov3.NetworkSet] + type networkSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -35,25 +63,49 @@ type networkSetInformer struct { // NewNetworkSetInformer constructs a new informer for NetworkSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedNetworkSetInformer]). func NewNetworkSetInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewNetworkSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedNetworkSetInformer constructs a new informer for NetworkSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedNetworkSetInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers NetworkSetIndexers) NetworkSetIndexInformer { + return NewTypedNetworkSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredNetworkSetInformer constructs a new informer for NetworkSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredNetworkSetInformer]). func NewFilteredNetworkSetInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewNetworkSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedNetworkSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredNetworkSetInformer constructs a new informer for NetworkSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredNetworkSetInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers NetworkSetIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) NetworkSetIndexInformer { + return NewTypedNetworkSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewNetworkSetInformerWithOptions constructs a new informer for NetworkSet type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedNetworkSetInformerWithOptions]). func NewNetworkSetInformerWithOptions(client clientset.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedNetworkSetInformerWithOptions(client, namespace, options) +} + +// NewTypedNetworkSetInformerWithOptions constructs a new informer for NetworkSet type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedNetworkSetInformerWithOptions(client clientset.Interface, namespace string, options internalinterfaces.InformerOptions) NetworkSetIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "networksets"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.NetworkSet](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -86,17 +138,57 @@ func NewNetworkSetInformerWithOptions(client clientset.Interface, namespace stri Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *networkSetInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewNetworkSetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedNetworkSetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *networkSetInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.NetworkSet{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *networkSetInformer) TypedInformer() NetworkSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.NetworkSet](f.factory.InformerFor(&apisprojectcalicov3.NetworkSet{}, f.defaultInformer)) } func (f *networkSetInformer) Lister() projectcalicov3.NetworkSetLister { return projectcalicov3.NewNetworkSetLister(f.Informer().GetIndexer()) } + +// ToTypedNetworkSetInformer converts an untyped informer into a TypedNetworkSetInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *NetworkSet. If that is not the case, calling type-safe methods of the returned +// TypedNetworkSetInformer leads to runtime panics. A safer alternative is to pass +// around a TypedNetworkSetInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedNetworkSetInformer(informer NetworkSetInformer) TypedNetworkSetInformer { + if informer, ok := informer.(TypedNetworkSetInformer); ok { + return informer + } + return &networkSetTypedInformerAdapter{informer} +} + +type networkSetTypedInformerAdapter struct { + NetworkSetInformer +} + +func (a *networkSetTypedInformerAdapter) TypedInformer() NetworkSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.NetworkSet](a.Informer()) +} + +// ToNetworkSetIndexInformer converts an untyped informer into a NetworkSetIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *NetworkSet. If that is not the case, calling type-safe methods of the returned +// NetworkSetIndexInformer leads to runtime panics. A safer alternative is to pass +// around a NetworkSetIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToNetworkSetIndexInformer(informer cache.SharedIndexInformer) NetworkSetIndexInformer { + if informer, ok := informer.(NetworkSetIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.NetworkSet](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/profile.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/profile.go index 5d32b094e..e8c1f1d75 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/profile.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/profile.go @@ -20,12 +20,40 @@ import ( ) // ProfileInformer provides access to a shared informer and lister for -// Profiles. +// Profiles. Prefer using the type-safe variant (see [TypedProfileInformer]). type ProfileInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.ProfileLister } +// TypedProfileInformer provides access to a shared informer and lister for +// Profiles, including the type-safe TypedInformer variant. +// It is a superset of ProfileInformer. +type TypedProfileInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ProfileIndexInformer + Lister() projectcalicov3.ProfileLister +} + +// ProfileIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ProfileIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.Profile] + +// ProfileHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Profile. +type ProfileHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.Profile] + +// ProfileDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Profile. +type ProfileDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.Profile] + +// ProfileFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Profile. +type ProfileFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.Profile] + +// ProfileIndexers is a specialization of [cache.TypedIndexers] for Profile. +type ProfileIndexers = cache.TypedIndexers[*apisprojectcalicov3.Profile] + +// DeletedProfile is a specialization of [cache.DeletedObject] for Profile. +type DeletedProfile = cache.DeletedObject[*apisprojectcalicov3.Profile] + type profileInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -34,25 +62,49 @@ type profileInformer struct { // NewProfileInformer constructs a new informer for Profile type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedProfileInformer]). func NewProfileInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewProfileInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedProfileInformer constructs a new informer for Profile type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedProfileInformer(client clientset.Interface, resyncPeriod time.Duration, indexers ProfileIndexers) ProfileIndexInformer { + return NewTypedProfileInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredProfileInformer constructs a new informer for Profile type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredProfileInformer]). func NewFilteredProfileInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewProfileInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedProfileInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredProfileInformer constructs a new informer for Profile type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredProfileInformer(client clientset.Interface, resyncPeriod time.Duration, indexers ProfileIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ProfileIndexInformer { + return NewTypedProfileInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewProfileInformerWithOptions constructs a new informer for Profile type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedProfileInformerWithOptions]). func NewProfileInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedProfileInformerWithOptions(client, options) +} + +// NewTypedProfileInformerWithOptions constructs a new informer for Profile type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedProfileInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) ProfileIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "profiles"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.Profile](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -85,17 +137,57 @@ func NewProfileInformerWithOptions(client clientset.Interface, options internali Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *profileInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewProfileInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedProfileInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *profileInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.Profile{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *profileInformer) TypedInformer() ProfileIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.Profile](f.factory.InformerFor(&apisprojectcalicov3.Profile{}, f.defaultInformer)) } func (f *profileInformer) Lister() projectcalicov3.ProfileLister { return projectcalicov3.NewProfileLister(f.Informer().GetIndexer()) } + +// ToTypedProfileInformer converts an untyped informer into a TypedProfileInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Profile. If that is not the case, calling type-safe methods of the returned +// TypedProfileInformer leads to runtime panics. A safer alternative is to pass +// around a TypedProfileInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedProfileInformer(informer ProfileInformer) TypedProfileInformer { + if informer, ok := informer.(TypedProfileInformer); ok { + return informer + } + return &profileTypedInformerAdapter{informer} +} + +type profileTypedInformerAdapter struct { + ProfileInformer +} + +func (a *profileTypedInformerAdapter) TypedInformer() ProfileIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.Profile](a.Informer()) +} + +// ToProfileIndexInformer converts an untyped informer into a ProfileIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Profile. If that is not the case, calling type-safe methods of the returned +// ProfileIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ProfileIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToProfileIndexInformer(informer cache.SharedIndexInformer) ProfileIndexInformer { + if informer, ok := informer.(ProfileIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.Profile](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/stagedglobalnetworkpolicy.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/stagedglobalnetworkpolicy.go index 2bacd696e..53ceb80dd 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/stagedglobalnetworkpolicy.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/stagedglobalnetworkpolicy.go @@ -20,12 +20,40 @@ import ( ) // StagedGlobalNetworkPolicyInformer provides access to a shared informer and lister for -// StagedGlobalNetworkPolicies. +// StagedGlobalNetworkPolicies. Prefer using the type-safe variant (see [TypedStagedGlobalNetworkPolicyInformer]). type StagedGlobalNetworkPolicyInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.StagedGlobalNetworkPolicyLister } +// TypedStagedGlobalNetworkPolicyInformer provides access to a shared informer and lister for +// StagedGlobalNetworkPolicies, including the type-safe TypedInformer variant. +// It is a superset of StagedGlobalNetworkPolicyInformer. +type TypedStagedGlobalNetworkPolicyInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() StagedGlobalNetworkPolicyIndexInformer + Lister() projectcalicov3.StagedGlobalNetworkPolicyLister +} + +// StagedGlobalNetworkPolicyIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type StagedGlobalNetworkPolicyIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.StagedGlobalNetworkPolicy] + +// StagedGlobalNetworkPolicyHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for StagedGlobalNetworkPolicy. +type StagedGlobalNetworkPolicyHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.StagedGlobalNetworkPolicy] + +// StagedGlobalNetworkPolicyDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for StagedGlobalNetworkPolicy. +type StagedGlobalNetworkPolicyDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.StagedGlobalNetworkPolicy] + +// StagedGlobalNetworkPolicyFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for StagedGlobalNetworkPolicy. +type StagedGlobalNetworkPolicyFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.StagedGlobalNetworkPolicy] + +// StagedGlobalNetworkPolicyIndexers is a specialization of [cache.TypedIndexers] for StagedGlobalNetworkPolicy. +type StagedGlobalNetworkPolicyIndexers = cache.TypedIndexers[*apisprojectcalicov3.StagedGlobalNetworkPolicy] + +// DeletedStagedGlobalNetworkPolicy is a specialization of [cache.DeletedObject] for StagedGlobalNetworkPolicy. +type DeletedStagedGlobalNetworkPolicy = cache.DeletedObject[*apisprojectcalicov3.StagedGlobalNetworkPolicy] + type stagedGlobalNetworkPolicyInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -34,25 +62,49 @@ type stagedGlobalNetworkPolicyInformer struct { // NewStagedGlobalNetworkPolicyInformer constructs a new informer for StagedGlobalNetworkPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStagedGlobalNetworkPolicyInformer]). func NewStagedGlobalNetworkPolicyInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewStagedGlobalNetworkPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedStagedGlobalNetworkPolicyInformer constructs a new informer for StagedGlobalNetworkPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStagedGlobalNetworkPolicyInformer(client clientset.Interface, resyncPeriod time.Duration, indexers StagedGlobalNetworkPolicyIndexers) StagedGlobalNetworkPolicyIndexInformer { + return NewTypedStagedGlobalNetworkPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredStagedGlobalNetworkPolicyInformer constructs a new informer for StagedGlobalNetworkPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredStagedGlobalNetworkPolicyInformer]). func NewFilteredStagedGlobalNetworkPolicyInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewStagedGlobalNetworkPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedStagedGlobalNetworkPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredStagedGlobalNetworkPolicyInformer constructs a new informer for StagedGlobalNetworkPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredStagedGlobalNetworkPolicyInformer(client clientset.Interface, resyncPeriod time.Duration, indexers StagedGlobalNetworkPolicyIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) StagedGlobalNetworkPolicyIndexInformer { + return NewTypedStagedGlobalNetworkPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewStagedGlobalNetworkPolicyInformerWithOptions constructs a new informer for StagedGlobalNetworkPolicy type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStagedGlobalNetworkPolicyInformerWithOptions]). func NewStagedGlobalNetworkPolicyInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedStagedGlobalNetworkPolicyInformerWithOptions(client, options) +} + +// NewTypedStagedGlobalNetworkPolicyInformerWithOptions constructs a new informer for StagedGlobalNetworkPolicy type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStagedGlobalNetworkPolicyInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) StagedGlobalNetworkPolicyIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "stagedglobalnetworkpolicies"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.StagedGlobalNetworkPolicy](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -85,17 +137,57 @@ func NewStagedGlobalNetworkPolicyInformerWithOptions(client clientset.Interface, Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *stagedGlobalNetworkPolicyInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewStagedGlobalNetworkPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedStagedGlobalNetworkPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *stagedGlobalNetworkPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.StagedGlobalNetworkPolicy{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *stagedGlobalNetworkPolicyInformer) TypedInformer() StagedGlobalNetworkPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.StagedGlobalNetworkPolicy](f.factory.InformerFor(&apisprojectcalicov3.StagedGlobalNetworkPolicy{}, f.defaultInformer)) } func (f *stagedGlobalNetworkPolicyInformer) Lister() projectcalicov3.StagedGlobalNetworkPolicyLister { return projectcalicov3.NewStagedGlobalNetworkPolicyLister(f.Informer().GetIndexer()) } + +// ToTypedStagedGlobalNetworkPolicyInformer converts an untyped informer into a TypedStagedGlobalNetworkPolicyInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StagedGlobalNetworkPolicy. If that is not the case, calling type-safe methods of the returned +// TypedStagedGlobalNetworkPolicyInformer leads to runtime panics. A safer alternative is to pass +// around a TypedStagedGlobalNetworkPolicyInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedStagedGlobalNetworkPolicyInformer(informer StagedGlobalNetworkPolicyInformer) TypedStagedGlobalNetworkPolicyInformer { + if informer, ok := informer.(TypedStagedGlobalNetworkPolicyInformer); ok { + return informer + } + return &stagedGlobalNetworkPolicyTypedInformerAdapter{informer} +} + +type stagedGlobalNetworkPolicyTypedInformerAdapter struct { + StagedGlobalNetworkPolicyInformer +} + +func (a *stagedGlobalNetworkPolicyTypedInformerAdapter) TypedInformer() StagedGlobalNetworkPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.StagedGlobalNetworkPolicy](a.Informer()) +} + +// ToStagedGlobalNetworkPolicyIndexInformer converts an untyped informer into a StagedGlobalNetworkPolicyIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StagedGlobalNetworkPolicy. If that is not the case, calling type-safe methods of the returned +// StagedGlobalNetworkPolicyIndexInformer leads to runtime panics. A safer alternative is to pass +// around a StagedGlobalNetworkPolicyIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToStagedGlobalNetworkPolicyIndexInformer(informer cache.SharedIndexInformer) StagedGlobalNetworkPolicyIndexInformer { + if informer, ok := informer.(StagedGlobalNetworkPolicyIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.StagedGlobalNetworkPolicy](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/stagedkubernetesnetworkpolicy.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/stagedkubernetesnetworkpolicy.go index 0b589b180..8791ff45e 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/stagedkubernetesnetworkpolicy.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/stagedkubernetesnetworkpolicy.go @@ -20,12 +20,40 @@ import ( ) // StagedKubernetesNetworkPolicyInformer provides access to a shared informer and lister for -// StagedKubernetesNetworkPolicies. +// StagedKubernetesNetworkPolicies. Prefer using the type-safe variant (see [TypedStagedKubernetesNetworkPolicyInformer]). type StagedKubernetesNetworkPolicyInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.StagedKubernetesNetworkPolicyLister } +// TypedStagedKubernetesNetworkPolicyInformer provides access to a shared informer and lister for +// StagedKubernetesNetworkPolicies, including the type-safe TypedInformer variant. +// It is a superset of StagedKubernetesNetworkPolicyInformer. +type TypedStagedKubernetesNetworkPolicyInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() StagedKubernetesNetworkPolicyIndexInformer + Lister() projectcalicov3.StagedKubernetesNetworkPolicyLister +} + +// StagedKubernetesNetworkPolicyIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type StagedKubernetesNetworkPolicyIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.StagedKubernetesNetworkPolicy] + +// StagedKubernetesNetworkPolicyHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for StagedKubernetesNetworkPolicy. +type StagedKubernetesNetworkPolicyHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.StagedKubernetesNetworkPolicy] + +// StagedKubernetesNetworkPolicyDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for StagedKubernetesNetworkPolicy. +type StagedKubernetesNetworkPolicyDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.StagedKubernetesNetworkPolicy] + +// StagedKubernetesNetworkPolicyFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for StagedKubernetesNetworkPolicy. +type StagedKubernetesNetworkPolicyFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.StagedKubernetesNetworkPolicy] + +// StagedKubernetesNetworkPolicyIndexers is a specialization of [cache.TypedIndexers] for StagedKubernetesNetworkPolicy. +type StagedKubernetesNetworkPolicyIndexers = cache.TypedIndexers[*apisprojectcalicov3.StagedKubernetesNetworkPolicy] + +// DeletedStagedKubernetesNetworkPolicy is a specialization of [cache.DeletedObject] for StagedKubernetesNetworkPolicy. +type DeletedStagedKubernetesNetworkPolicy = cache.DeletedObject[*apisprojectcalicov3.StagedKubernetesNetworkPolicy] + type stagedKubernetesNetworkPolicyInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -35,25 +63,49 @@ type stagedKubernetesNetworkPolicyInformer struct { // NewStagedKubernetesNetworkPolicyInformer constructs a new informer for StagedKubernetesNetworkPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStagedKubernetesNetworkPolicyInformer]). func NewStagedKubernetesNetworkPolicyInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewStagedKubernetesNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedStagedKubernetesNetworkPolicyInformer constructs a new informer for StagedKubernetesNetworkPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStagedKubernetesNetworkPolicyInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers StagedKubernetesNetworkPolicyIndexers) StagedKubernetesNetworkPolicyIndexInformer { + return NewTypedStagedKubernetesNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredStagedKubernetesNetworkPolicyInformer constructs a new informer for StagedKubernetesNetworkPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredStagedKubernetesNetworkPolicyInformer]). func NewFilteredStagedKubernetesNetworkPolicyInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewStagedKubernetesNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedStagedKubernetesNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredStagedKubernetesNetworkPolicyInformer constructs a new informer for StagedKubernetesNetworkPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredStagedKubernetesNetworkPolicyInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers StagedKubernetesNetworkPolicyIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) StagedKubernetesNetworkPolicyIndexInformer { + return NewTypedStagedKubernetesNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewStagedKubernetesNetworkPolicyInformerWithOptions constructs a new informer for StagedKubernetesNetworkPolicy type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStagedKubernetesNetworkPolicyInformerWithOptions]). func NewStagedKubernetesNetworkPolicyInformerWithOptions(client clientset.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedStagedKubernetesNetworkPolicyInformerWithOptions(client, namespace, options) +} + +// NewTypedStagedKubernetesNetworkPolicyInformerWithOptions constructs a new informer for StagedKubernetesNetworkPolicy type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStagedKubernetesNetworkPolicyInformerWithOptions(client clientset.Interface, namespace string, options internalinterfaces.InformerOptions) StagedKubernetesNetworkPolicyIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "stagedkubernetesnetworkpolicies"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.StagedKubernetesNetworkPolicy](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -86,17 +138,57 @@ func NewStagedKubernetesNetworkPolicyInformerWithOptions(client clientset.Interf Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *stagedKubernetesNetworkPolicyInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewStagedKubernetesNetworkPolicyInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedStagedKubernetesNetworkPolicyInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *stagedKubernetesNetworkPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.StagedKubernetesNetworkPolicy{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *stagedKubernetesNetworkPolicyInformer) TypedInformer() StagedKubernetesNetworkPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.StagedKubernetesNetworkPolicy](f.factory.InformerFor(&apisprojectcalicov3.StagedKubernetesNetworkPolicy{}, f.defaultInformer)) } func (f *stagedKubernetesNetworkPolicyInformer) Lister() projectcalicov3.StagedKubernetesNetworkPolicyLister { return projectcalicov3.NewStagedKubernetesNetworkPolicyLister(f.Informer().GetIndexer()) } + +// ToTypedStagedKubernetesNetworkPolicyInformer converts an untyped informer into a TypedStagedKubernetesNetworkPolicyInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StagedKubernetesNetworkPolicy. If that is not the case, calling type-safe methods of the returned +// TypedStagedKubernetesNetworkPolicyInformer leads to runtime panics. A safer alternative is to pass +// around a TypedStagedKubernetesNetworkPolicyInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedStagedKubernetesNetworkPolicyInformer(informer StagedKubernetesNetworkPolicyInformer) TypedStagedKubernetesNetworkPolicyInformer { + if informer, ok := informer.(TypedStagedKubernetesNetworkPolicyInformer); ok { + return informer + } + return &stagedKubernetesNetworkPolicyTypedInformerAdapter{informer} +} + +type stagedKubernetesNetworkPolicyTypedInformerAdapter struct { + StagedKubernetesNetworkPolicyInformer +} + +func (a *stagedKubernetesNetworkPolicyTypedInformerAdapter) TypedInformer() StagedKubernetesNetworkPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.StagedKubernetesNetworkPolicy](a.Informer()) +} + +// ToStagedKubernetesNetworkPolicyIndexInformer converts an untyped informer into a StagedKubernetesNetworkPolicyIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StagedKubernetesNetworkPolicy. If that is not the case, calling type-safe methods of the returned +// StagedKubernetesNetworkPolicyIndexInformer leads to runtime panics. A safer alternative is to pass +// around a StagedKubernetesNetworkPolicyIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToStagedKubernetesNetworkPolicyIndexInformer(informer cache.SharedIndexInformer) StagedKubernetesNetworkPolicyIndexInformer { + if informer, ok := informer.(StagedKubernetesNetworkPolicyIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.StagedKubernetesNetworkPolicy](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/stagednetworkpolicy.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/stagednetworkpolicy.go index a7a339229..9296477a7 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/stagednetworkpolicy.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/stagednetworkpolicy.go @@ -20,12 +20,40 @@ import ( ) // StagedNetworkPolicyInformer provides access to a shared informer and lister for -// StagedNetworkPolicies. +// StagedNetworkPolicies. Prefer using the type-safe variant (see [TypedStagedNetworkPolicyInformer]). type StagedNetworkPolicyInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.StagedNetworkPolicyLister } +// TypedStagedNetworkPolicyInformer provides access to a shared informer and lister for +// StagedNetworkPolicies, including the type-safe TypedInformer variant. +// It is a superset of StagedNetworkPolicyInformer. +type TypedStagedNetworkPolicyInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() StagedNetworkPolicyIndexInformer + Lister() projectcalicov3.StagedNetworkPolicyLister +} + +// StagedNetworkPolicyIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type StagedNetworkPolicyIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.StagedNetworkPolicy] + +// StagedNetworkPolicyHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for StagedNetworkPolicy. +type StagedNetworkPolicyHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.StagedNetworkPolicy] + +// StagedNetworkPolicyDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for StagedNetworkPolicy. +type StagedNetworkPolicyDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.StagedNetworkPolicy] + +// StagedNetworkPolicyFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for StagedNetworkPolicy. +type StagedNetworkPolicyFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.StagedNetworkPolicy] + +// StagedNetworkPolicyIndexers is a specialization of [cache.TypedIndexers] for StagedNetworkPolicy. +type StagedNetworkPolicyIndexers = cache.TypedIndexers[*apisprojectcalicov3.StagedNetworkPolicy] + +// DeletedStagedNetworkPolicy is a specialization of [cache.DeletedObject] for StagedNetworkPolicy. +type DeletedStagedNetworkPolicy = cache.DeletedObject[*apisprojectcalicov3.StagedNetworkPolicy] + type stagedNetworkPolicyInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -35,25 +63,49 @@ type stagedNetworkPolicyInformer struct { // NewStagedNetworkPolicyInformer constructs a new informer for StagedNetworkPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStagedNetworkPolicyInformer]). func NewStagedNetworkPolicyInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewStagedNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedStagedNetworkPolicyInformer constructs a new informer for StagedNetworkPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStagedNetworkPolicyInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers StagedNetworkPolicyIndexers) StagedNetworkPolicyIndexInformer { + return NewTypedStagedNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredStagedNetworkPolicyInformer constructs a new informer for StagedNetworkPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredStagedNetworkPolicyInformer]). func NewFilteredStagedNetworkPolicyInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewStagedNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedStagedNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredStagedNetworkPolicyInformer constructs a new informer for StagedNetworkPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredStagedNetworkPolicyInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers StagedNetworkPolicyIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) StagedNetworkPolicyIndexInformer { + return NewTypedStagedNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewStagedNetworkPolicyInformerWithOptions constructs a new informer for StagedNetworkPolicy type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStagedNetworkPolicyInformerWithOptions]). func NewStagedNetworkPolicyInformerWithOptions(client clientset.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedStagedNetworkPolicyInformerWithOptions(client, namespace, options) +} + +// NewTypedStagedNetworkPolicyInformerWithOptions constructs a new informer for StagedNetworkPolicy type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStagedNetworkPolicyInformerWithOptions(client clientset.Interface, namespace string, options internalinterfaces.InformerOptions) StagedNetworkPolicyIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "stagednetworkpolicies"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.StagedNetworkPolicy](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -86,17 +138,57 @@ func NewStagedNetworkPolicyInformerWithOptions(client clientset.Interface, names Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *stagedNetworkPolicyInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewStagedNetworkPolicyInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedStagedNetworkPolicyInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *stagedNetworkPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.StagedNetworkPolicy{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *stagedNetworkPolicyInformer) TypedInformer() StagedNetworkPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.StagedNetworkPolicy](f.factory.InformerFor(&apisprojectcalicov3.StagedNetworkPolicy{}, f.defaultInformer)) } func (f *stagedNetworkPolicyInformer) Lister() projectcalicov3.StagedNetworkPolicyLister { return projectcalicov3.NewStagedNetworkPolicyLister(f.Informer().GetIndexer()) } + +// ToTypedStagedNetworkPolicyInformer converts an untyped informer into a TypedStagedNetworkPolicyInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StagedNetworkPolicy. If that is not the case, calling type-safe methods of the returned +// TypedStagedNetworkPolicyInformer leads to runtime panics. A safer alternative is to pass +// around a TypedStagedNetworkPolicyInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedStagedNetworkPolicyInformer(informer StagedNetworkPolicyInformer) TypedStagedNetworkPolicyInformer { + if informer, ok := informer.(TypedStagedNetworkPolicyInformer); ok { + return informer + } + return &stagedNetworkPolicyTypedInformerAdapter{informer} +} + +type stagedNetworkPolicyTypedInformerAdapter struct { + StagedNetworkPolicyInformer +} + +func (a *stagedNetworkPolicyTypedInformerAdapter) TypedInformer() StagedNetworkPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.StagedNetworkPolicy](a.Informer()) +} + +// ToStagedNetworkPolicyIndexInformer converts an untyped informer into a StagedNetworkPolicyIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StagedNetworkPolicy. If that is not the case, calling type-safe methods of the returned +// StagedNetworkPolicyIndexInformer leads to runtime panics. A safer alternative is to pass +// around a StagedNetworkPolicyIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToStagedNetworkPolicyIndexInformer(informer cache.SharedIndexInformer) StagedNetworkPolicyIndexInformer { + if informer, ok := informer.(StagedNetworkPolicyIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.StagedNetworkPolicy](informer) +} diff --git a/pkg/client/informers_generated/externalversions/projectcalico/v3/tier.go b/pkg/client/informers_generated/externalversions/projectcalico/v3/tier.go index 222b4654d..d4109fe73 100644 --- a/pkg/client/informers_generated/externalversions/projectcalico/v3/tier.go +++ b/pkg/client/informers_generated/externalversions/projectcalico/v3/tier.go @@ -20,12 +20,40 @@ import ( ) // TierInformer provides access to a shared informer and lister for -// Tiers. +// Tiers. Prefer using the type-safe variant (see [TypedTierInformer]). type TierInformer interface { Informer() cache.SharedIndexInformer Lister() projectcalicov3.TierLister } +// TypedTierInformer provides access to a shared informer and lister for +// Tiers, including the type-safe TypedInformer variant. +// It is a superset of TierInformer. +type TypedTierInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() TierIndexInformer + Lister() projectcalicov3.TierLister +} + +// TierIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type TierIndexInformer cache.TypedSharedIndexInformer[*apisprojectcalicov3.Tier] + +// TierHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Tier. +type TierHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apisprojectcalicov3.Tier] + +// TierDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Tier. +type TierDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apisprojectcalicov3.Tier] + +// TierFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Tier. +type TierFilteringHandler = cache.TypedFilteringResourceEventHandler[*apisprojectcalicov3.Tier] + +// TierIndexers is a specialization of [cache.TypedIndexers] for Tier. +type TierIndexers = cache.TypedIndexers[*apisprojectcalicov3.Tier] + +// DeletedTier is a specialization of [cache.DeletedObject] for Tier. +type DeletedTier = cache.DeletedObject[*apisprojectcalicov3.Tier] + type tierInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -34,25 +62,49 @@ type tierInformer struct { // NewTierInformer constructs a new informer for Tier type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedTierInformer]). func NewTierInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewTierInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedTierInformer constructs a new informer for Tier type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedTierInformer(client clientset.Interface, resyncPeriod time.Duration, indexers TierIndexers) TierIndexInformer { + return NewTypedTierInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredTierInformer constructs a new informer for Tier type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredTierInformer]). func NewFilteredTierInformer(client clientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewTierInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedTierInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredTierInformer constructs a new informer for Tier type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredTierInformer(client clientset.Interface, resyncPeriod time.Duration, indexers TierIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) TierIndexInformer { + return NewTypedTierInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewTierInformerWithOptions constructs a new informer for Tier type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedTierInformerWithOptions]). func NewTierInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedTierInformerWithOptions(client, options) +} + +// NewTypedTierInformerWithOptions constructs a new informer for Tier type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedTierInformerWithOptions(client clientset.Interface, options internalinterfaces.InformerOptions) TierIndexInformer { gvr := schema.GroupVersionResource{Group: "projectcalico.org", Version: "v3", Resource: "tiers"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.Tier](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -85,17 +137,57 @@ func NewTierInformerWithOptions(client clientset.Interface, options internalinte Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *tierInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewTierInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedTierInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *tierInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisprojectcalicov3.Tier{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *tierInformer) TypedInformer() TierIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.Tier](f.factory.InformerFor(&apisprojectcalicov3.Tier{}, f.defaultInformer)) } func (f *tierInformer) Lister() projectcalicov3.TierLister { return projectcalicov3.NewTierLister(f.Informer().GetIndexer()) } + +// ToTypedTierInformer converts an untyped informer into a TypedTierInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Tier. If that is not the case, calling type-safe methods of the returned +// TypedTierInformer leads to runtime panics. A safer alternative is to pass +// around a TypedTierInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedTierInformer(informer TierInformer) TypedTierInformer { + if informer, ok := informer.(TypedTierInformer); ok { + return informer + } + return &tierTypedInformerAdapter{informer} +} + +type tierTypedInformerAdapter struct { + TierInformer +} + +func (a *tierTypedInformerAdapter) TypedInformer() TierIndexInformer { + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.Tier](a.Informer()) +} + +// ToTierIndexInformer converts an untyped informer into a TierIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Tier. If that is not the case, calling type-safe methods of the returned +// TierIndexInformer leads to runtime panics. A safer alternative is to pass +// around a TierIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToTierIndexInformer(informer cache.SharedIndexInformer) TierIndexInformer { + if informer, ok := informer.(TierIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apisprojectcalicov3.Tier](informer) +} diff --git a/pkg/openapi/generated.openapi.go b/pkg/openapi/generated.openapi.go index 9492954be..c84fef380 100644 --- a/pkg/openapi/generated.openapi.go +++ b/pkg/openapi/generated.openapi.go @@ -208,6 +208,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA v1.EventList{}.OpenAPIModelName(): schema_k8sio_api_core_v1_EventList(ref), v1.EventSeries{}.OpenAPIModelName(): schema_k8sio_api_core_v1_EventSeries(ref), v1.EventSource{}.OpenAPIModelName(): schema_k8sio_api_core_v1_EventSource(ref), + v1.EvictionResponder{}.OpenAPIModelName(): schema_k8sio_api_core_v1_EvictionResponder(ref), v1.ExecAction{}.OpenAPIModelName(): schema_k8sio_api_core_v1_ExecAction(ref), v1.FCVolumeSource{}.OpenAPIModelName(): schema_k8sio_api_core_v1_FCVolumeSource(ref), v1.FileKeySelector{}.OpenAPIModelName(): schema_k8sio_api_core_v1_FileKeySelector(ref), @@ -251,6 +252,8 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA v1.Node{}.OpenAPIModelName(): schema_k8sio_api_core_v1_Node(ref), v1.NodeAddress{}.OpenAPIModelName(): schema_k8sio_api_core_v1_NodeAddress(ref), v1.NodeAffinity{}.OpenAPIModelName(): schema_k8sio_api_core_v1_NodeAffinity(ref), + v1.NodeAllocatableMappedResources{}.OpenAPIModelName(): schema_k8sio_api_core_v1_NodeAllocatableMappedResources(ref), + v1.NodeAllocatableOverheadResources{}.OpenAPIModelName(): schema_k8sio_api_core_v1_NodeAllocatableOverheadResources(ref), v1.NodeAllocatableResourceClaimStatus{}.OpenAPIModelName(): schema_k8sio_api_core_v1_NodeAllocatableResourceClaimStatus(ref), v1.NodeCondition{}.OpenAPIModelName(): schema_k8sio_api_core_v1_NodeCondition(ref), v1.NodeConfigSource{}.OpenAPIModelName(): schema_k8sio_api_core_v1_NodeConfigSource(ref), @@ -258,6 +261,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA v1.NodeDaemonEndpoints{}.OpenAPIModelName(): schema_k8sio_api_core_v1_NodeDaemonEndpoints(ref), v1.NodeFeatures{}.OpenAPIModelName(): schema_k8sio_api_core_v1_NodeFeatures(ref), v1.NodeList{}.OpenAPIModelName(): schema_k8sio_api_core_v1_NodeList(ref), + v1.NodePodPreemptionPolicy{}.OpenAPIModelName(): schema_k8sio_api_core_v1_NodePodPreemptionPolicy(ref), v1.NodeProxyOptions{}.OpenAPIModelName(): schema_k8sio_api_core_v1_NodeProxyOptions(ref), v1.NodeRuntimeHandler{}.OpenAPIModelName(): schema_k8sio_api_core_v1_NodeRuntimeHandler(ref), v1.NodeRuntimeHandlerFeatures{}.OpenAPIModelName(): schema_k8sio_api_core_v1_NodeRuntimeHandlerFeatures(ref), @@ -309,10 +313,10 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA v1.PodSignature{}.OpenAPIModelName(): schema_k8sio_api_core_v1_PodSignature(ref), v1.PodSpec{}.OpenAPIModelName(): schema_k8sio_api_core_v1_PodSpec(ref), v1.PodStatus{}.OpenAPIModelName(): schema_k8sio_api_core_v1_PodStatus(ref), - v1.PodStatusResult{}.OpenAPIModelName(): schema_k8sio_api_core_v1_PodStatusResult(ref), v1.PodTemplate{}.OpenAPIModelName(): schema_k8sio_api_core_v1_PodTemplate(ref), v1.PodTemplateList{}.OpenAPIModelName(): schema_k8sio_api_core_v1_PodTemplateList(ref), v1.PodTemplateSpec{}.OpenAPIModelName(): schema_k8sio_api_core_v1_PodTemplateSpec(ref), + v1.PodVolumeHealth{}.OpenAPIModelName(): schema_k8sio_api_core_v1_PodVolumeHealth(ref), v1.PortStatus{}.OpenAPIModelName(): schema_k8sio_api_core_v1_PortStatus(ref), v1.PortworxVolumeSource{}.OpenAPIModelName(): schema_k8sio_api_core_v1_PortworxVolumeSource(ref), v1.PreferAvoidPodsEntry{}.OpenAPIModelName(): schema_k8sio_api_core_v1_PreferAvoidPodsEntry(ref), @@ -377,6 +381,8 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA v1.TypedObjectReference{}.OpenAPIModelName(): schema_k8sio_api_core_v1_TypedObjectReference(ref), v1.Volume{}.OpenAPIModelName(): schema_k8sio_api_core_v1_Volume(ref), v1.VolumeDevice{}.OpenAPIModelName(): schema_k8sio_api_core_v1_VolumeDevice(ref), + v1.VolumeHealthCondition{}.OpenAPIModelName(): schema_k8sio_api_core_v1_VolumeHealthCondition(ref), + v1.VolumeHealthStatus{}.OpenAPIModelName(): schema_k8sio_api_core_v1_VolumeHealthStatus(ref), v1.VolumeMount{}.OpenAPIModelName(): schema_k8sio_api_core_v1_VolumeMount(ref), v1.VolumeMountStatus{}.OpenAPIModelName(): schema_k8sio_api_core_v1_VolumeMountStatus(ref), v1.VolumeNodeAffinity{}.OpenAPIModelName(): schema_k8sio_api_core_v1_VolumeNodeAffinity(ref), @@ -502,9 +508,8 @@ func schema_pkg_apis_projectcalico_v3_AllocationAttribute(ref common.ReferenceCa Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -518,9 +523,8 @@ func schema_pkg_apis_projectcalico_v3_AllocationAttribute(ref common.ReferenceCa Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -571,8 +575,7 @@ func schema_pkg_apis_projectcalico_v3_AutoHostEndpointConfig(ref common.Referenc Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.Template{}.OpenAPIModelName()), + Ref: ref(v3.Template{}.OpenAPIModelName()), }, }, }, @@ -660,8 +663,7 @@ func schema_pkg_apis_projectcalico_v3_BGPConfigurationList(ref common.ReferenceC Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.BGPConfiguration{}.OpenAPIModelName()), + Ref: ref(v3.BGPConfiguration{}.OpenAPIModelName()), }, }, }, @@ -716,8 +718,7 @@ func schema_pkg_apis_projectcalico_v3_BGPConfigurationSpec(ref common.ReferenceC Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.ServiceLoadBalancerIPBlock{}.OpenAPIModelName()), + Ref: ref(v3.ServiceLoadBalancerIPBlock{}.OpenAPIModelName()), }, }, }, @@ -735,8 +736,7 @@ func schema_pkg_apis_projectcalico_v3_BGPConfigurationSpec(ref common.ReferenceC Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.ServiceExternalIPBlock{}.OpenAPIModelName()), + Ref: ref(v3.ServiceExternalIPBlock{}.OpenAPIModelName()), }, }, }, @@ -754,8 +754,7 @@ func schema_pkg_apis_projectcalico_v3_BGPConfigurationSpec(ref common.ReferenceC Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.ServiceClusterIPBlock{}.OpenAPIModelName()), + Ref: ref(v3.ServiceClusterIPBlock{}.OpenAPIModelName()), }, }, }, @@ -780,8 +779,7 @@ func schema_pkg_apis_projectcalico_v3_BGPConfigurationSpec(ref common.ReferenceC Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.Community{}.OpenAPIModelName()), + Ref: ref(v3.Community{}.OpenAPIModelName()), }, }, }, @@ -799,8 +797,7 @@ func schema_pkg_apis_projectcalico_v3_BGPConfigurationSpec(ref common.ReferenceC Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.PrefixAdvertisement{}.OpenAPIModelName()), + Ref: ref(v3.PrefixAdvertisement{}.OpenAPIModelName()), }, }, }, @@ -844,9 +841,8 @@ func schema_pkg_apis_projectcalico_v3_BGPConfigurationSpec(ref common.ReferenceC Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -868,7 +864,7 @@ func schema_pkg_apis_projectcalico_v3_BGPConfigurationSpec(ref common.ReferenceC }, "programClusterRoutes": { SchemaProps: spec.SchemaProps{ - Description: "ProgramClusterRoutes controls how a cluster node gets a route to a workload on another node, when that workload's IP comes from an IP Pool with vxlanMode: Never. When ProgramClusterRoutes is Enabled, confd and BIRD program that route. When ProgramClusterRoutes is Disabled, it is expected that Felix will program that route. Felix always programs such routes for IP Pools with vxlanMode: Always or vxlanMode: CrossSubnet. [Default: Enabled]", + Description: "ProgramClusterRoutes controls which \"cluster routes\" are programmed by Calico's BGP stack, i.e. the routes that a node needs in order to reach workloads on other nodes. It only applies to IP Pools with vxlanMode: Never; the cluster routes for IP Pools with vxlanMode: Always or vxlanMode: CrossSubnet are always programmed by Felix. The routes that BIRD does not program here are expected to be programmed by Felix instead. Below, an IPIP IP Pool is one with ipipMode: Always or CrossSubnet, and an unencapsulated one has ipipMode and vxlanMode both Never.\n\n- Disabled: BIRD programs no cluster routes. - EnabledNoEncapOnly: BIRD programs them for unencapsulated IP Pools. - EnabledIPIPOnly: BIRD programs them for IPIP IP Pools. - Enabled: BIRD programs them for both.\n\nThis field must be kept consistent with FelixConfiguration.ProgramClusterRoutes, which makes the same choice from Felix's side. If both Felix and BIRD are enabled for the same kind of IP Pool they will fight over the routes; if neither is, there will be no cluster routes at all.\n\nNote: asking BIRD to program IPIP cluster routes, which the Enabled and EnabledIPIPOnly values do, is deprecated as of v3.33 and will be removed in v3.35.\n\n[Default: EnabledNoEncapOnly]", Type: []string{"string"}, Format: "", }, @@ -1029,9 +1025,8 @@ func schema_pkg_apis_projectcalico_v3_BGPFilterCommunityMatch(ref common.Referen Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -1082,8 +1077,7 @@ func schema_pkg_apis_projectcalico_v3_BGPFilterList(ref common.ReferenceCallback Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.BGPFilter{}.OpenAPIModelName()), + Ref: ref(v3.BGPFilter{}.OpenAPIModelName()), }, }, }, @@ -1213,9 +1207,8 @@ func schema_pkg_apis_projectcalico_v3_BGPFilterPrependASPath(ref common.Referenc Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int64", + Type: []string{"integer"}, + Format: "int64", }, }, }, @@ -1299,9 +1292,8 @@ func schema_pkg_apis_projectcalico_v3_BGPFilterRuleV4(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int64", + Type: []string{"integer"}, + Format: "int64", }, }, }, @@ -1333,8 +1325,7 @@ func schema_pkg_apis_projectcalico_v3_BGPFilterRuleV4(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.BGPFilterOperation{}.OpenAPIModelName()), + Ref: ref(v3.BGPFilterOperation{}.OpenAPIModelName()), }, }, }, @@ -1420,9 +1411,8 @@ func schema_pkg_apis_projectcalico_v3_BGPFilterRuleV6(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int64", + Type: []string{"integer"}, + Format: "int64", }, }, }, @@ -1454,8 +1444,7 @@ func schema_pkg_apis_projectcalico_v3_BGPFilterRuleV6(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.BGPFilterOperation{}.OpenAPIModelName()), + Ref: ref(v3.BGPFilterOperation{}.OpenAPIModelName()), }, }, }, @@ -1520,8 +1509,7 @@ func schema_pkg_apis_projectcalico_v3_BGPFilterSpec(ref common.ReferenceCallback Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.BGPFilterRuleV4{}.OpenAPIModelName()), + Ref: ref(v3.BGPFilterRuleV4{}.OpenAPIModelName()), }, }, }, @@ -1539,8 +1527,7 @@ func schema_pkg_apis_projectcalico_v3_BGPFilterSpec(ref common.ReferenceCallback Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.BGPFilterRuleV4{}.OpenAPIModelName()), + Ref: ref(v3.BGPFilterRuleV4{}.OpenAPIModelName()), }, }, }, @@ -1558,8 +1545,7 @@ func schema_pkg_apis_projectcalico_v3_BGPFilterSpec(ref common.ReferenceCallback Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.BGPFilterRuleV6{}.OpenAPIModelName()), + Ref: ref(v3.BGPFilterRuleV6{}.OpenAPIModelName()), }, }, }, @@ -1577,8 +1563,7 @@ func schema_pkg_apis_projectcalico_v3_BGPFilterSpec(ref common.ReferenceCallback Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.BGPFilterRuleV6{}.OpenAPIModelName()), + Ref: ref(v3.BGPFilterRuleV6{}.OpenAPIModelName()), }, }, }, @@ -1687,8 +1672,7 @@ func schema_pkg_apis_projectcalico_v3_BGPPeerList(ref common.ReferenceCallback) Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.BGPPeer{}.OpenAPIModelName()), + Ref: ref(v3.BGPPeer{}.OpenAPIModelName()), }, }, }, @@ -1824,9 +1808,8 @@ func schema_pkg_apis_projectcalico_v3_BGPPeerSpec(ref common.ReferenceCallback) Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -1997,8 +1980,7 @@ func schema_pkg_apis_projectcalico_v3_BlockAffinityList(ref common.ReferenceCall Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.BlockAffinity{}.OpenAPIModelName()), + Ref: ref(v3.BlockAffinity{}.OpenAPIModelName()), }, }, }, @@ -2114,8 +2096,7 @@ func schema_pkg_apis_projectcalico_v3_CalicoNodeBGPRouteStatus(ref common.Refere Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.CalicoNodeRoute{}.OpenAPIModelName()), + Ref: ref(v3.CalicoNodeRoute{}.OpenAPIModelName()), }, }, }, @@ -2133,8 +2114,7 @@ func schema_pkg_apis_projectcalico_v3_CalicoNodeBGPRouteStatus(ref common.Refere Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.CalicoNodeRoute{}.OpenAPIModelName()), + Ref: ref(v3.CalicoNodeRoute{}.OpenAPIModelName()), }, }, }, @@ -2199,8 +2179,7 @@ func schema_pkg_apis_projectcalico_v3_CalicoNodeBGPStatus(ref common.ReferenceCa Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.CalicoNodePeer{}.OpenAPIModelName()), + Ref: ref(v3.CalicoNodePeer{}.OpenAPIModelName()), }, }, }, @@ -2218,8 +2197,7 @@ func schema_pkg_apis_projectcalico_v3_CalicoNodeBGPStatus(ref common.ReferenceCa Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.CalicoNodePeer{}.OpenAPIModelName()), + Ref: ref(v3.CalicoNodePeer{}.OpenAPIModelName()), }, }, }, @@ -2432,8 +2410,7 @@ func schema_pkg_apis_projectcalico_v3_CalicoNodeStatusList(ref common.ReferenceC Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.CalicoNodeStatus{}.OpenAPIModelName()), + Ref: ref(v3.CalicoNodeStatus{}.OpenAPIModelName()), }, }, }, @@ -2474,9 +2451,8 @@ func schema_pkg_apis_projectcalico_v3_CalicoNodeStatusSpec(ref common.ReferenceC Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -2611,8 +2587,7 @@ func schema_pkg_apis_projectcalico_v3_ClusterInformationList(ref common.Referenc Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.ClusterInformation{}.OpenAPIModelName()), + Ref: ref(v3.ClusterInformation{}.OpenAPIModelName()), }, }, }, @@ -2817,9 +2792,8 @@ func schema_pkg_apis_projectcalico_v3_EntityRule(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -2875,9 +2849,8 @@ func schema_pkg_apis_projectcalico_v3_EntityRule(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -2996,8 +2969,7 @@ func schema_pkg_apis_projectcalico_v3_FelixConfigurationList(ref common.Referenc Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.FelixConfiguration{}.OpenAPIModelName()), + Ref: ref(v3.FelixConfiguration{}.OpenAPIModelName()), }, }, }, @@ -3208,7 +3180,7 @@ func schema_pkg_apis_projectcalico_v3_FelixConfigurationSpec(ref common.Referenc }, "logActionRateLimit": { SchemaProps: spec.SchemaProps{ - Description: "LogActionRateLimit sets the rate of hitting a Log action. The value must be in the format \"N/unit\", where N is a number and unit is one of: second, minute, hour, or day. For example: \"10/second\" or \"100/hour\".", + Description: "LogActionRateLimit sets the rate of hitting a Log action. The value must be in the format \"N/unit\", where N is a number and unit is one of: second, minute, hour, or day. For example: \"10/second\" or \"100/hour\". When LogConnectionTransitions is enabled, this also bounds the follow-up logs: a connection whose initial log was suppressed by this rate limit gets no follow-up log either.", Type: []string{"string"}, Format: "", }, @@ -3220,6 +3192,20 @@ func schema_pkg_apis_projectcalico_v3_FelixConfigurationSpec(ref common.Referenc Format: "int32", }, }, + "logConnectionTransitions": { + SchemaProps: spec.SchemaProps{ + Description: "LogConnectionTransitions controls whether Felix emits an additional kernel log recording the first observed response for each connection that matched a policy rule with a Log action. When set to FirstResponseAfterLog, each connection whose initial log was emitted gets one follow-up log, prefixed with LogConnectionTransitionsPrefix plus a suffix identifying the transition: \"-est\" when the first reply packet is seen, \"-rst\" when the response is a TCP RST (connection refused), or \"-icmp-err\" when the response is a related ICMP error (e.g. port unreachable). The log body is the standard kernel packet log of the response packet. For \"-est\" and \"-rst\" its 5-tuple is the original policy Log line's with source and destination swapped; for \"-icmp-err\" the bracketed inner header carries the original 5-tuple unswapped. A logged connection with no follow-up log never received a response. Connections whose initial log was suppressed by LogActionRateLimit get no follow-up log either, so every follow-up log pairs with an initial one. Enabling this consumes one bit from the Iptables/NftablesMarkMask space. Not supported in eBPF mode. [Default: Disabled]", + Type: []string{"string"}, + Format: "", + }, + }, + "logConnectionTransitionsPrefix": { + SchemaProps: spec.SchemaProps{ + Description: "LogConnectionTransitionsPrefix is the log prefix used for the logs emitted when LogConnectionTransitions is enabled; the transition suffix (\"-est\", \"-rst\" or \"-icmp-err\") is appended to it. Unlike LogPrefix, it does not support %-specifiers (such as %p): the rules that emit these logs are shared by all policies, so per-policy values cannot be substituted and any %-specifiers are rendered literally. [Default: calico-response]", + Type: []string{"string"}, + Format: "", + }, + }, "logFilePath": { SchemaProps: spec.SchemaProps{ Description: "LogFilePath is the full path to the Felix log. Set to none to disable file logging. [Default: /var/log/calico/felix.log]", @@ -3397,8 +3383,7 @@ func schema_pkg_apis_projectcalico_v3_FelixConfigurationSpec(ref common.Referenc Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.HealthTimeoutOverride{}.OpenAPIModelName()), + Ref: ref(v3.HealthTimeoutOverride{}.OpenAPIModelName()), }, }, }, @@ -3469,7 +3454,7 @@ func schema_pkg_apis_projectcalico_v3_FelixConfigurationSpec(ref common.Referenc }, "prometheusMetricsClientAuth": { SchemaProps: spec.SchemaProps{ - Description: "PrometheusMetricsClientAuth specifies the client authentication type for the /metrics endpoint. This determines how the server validates client certificates. Default is \"RequireAndVerifyClientCert\".", + Description: "PrometheusMetricsClientAuth specifies the client authentication type for the /metrics endpoint. This determines how the server validates client certificates. Default is \"NoClientCert\".", Type: []string{"string"}, Format: "", }, @@ -3481,8 +3466,7 @@ func schema_pkg_apis_projectcalico_v3_FelixConfigurationSpec(ref common.Referenc Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.ProtoPort{}.OpenAPIModelName()), + Ref: ref(v3.ProtoPort{}.OpenAPIModelName()), }, }, }, @@ -3495,8 +3479,7 @@ func schema_pkg_apis_projectcalico_v3_FelixConfigurationSpec(ref common.Referenc Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.ProtoPort{}.OpenAPIModelName()), + Ref: ref(v3.ProtoPort{}.OpenAPIModelName()), }, }, }, @@ -3591,7 +3574,7 @@ func schema_pkg_apis_projectcalico_v3_FelixConfigurationSpec(ref common.Referenc }, "programClusterRoutes": { SchemaProps: spec.SchemaProps{ - Description: "ProgramClusterRoutes controls how a cluster node gets a route to a workload on another node, when that workload's IP comes from an IP Pool with vxlanMode: Never. When ProgramClusterRoutes is Disabled, it is expected that confd and BIRD will program that route. When ProgramClusterRoutes is Enabled, Felix program that route. Felix always programs such routes for IP Pools with vxlanMode: Always or vxlanMode: CrossSubnet. [Default: Disabled]", + Description: "ProgramClusterRoutes controls which \"cluster routes\" Felix programs, i.e. the routes that a node needs in order to reach workloads on other nodes. It only applies to IP Pools with vxlanMode: Never; Felix always programs the cluster routes for IP Pools with vxlanMode: Always or vxlanMode: CrossSubnet. The routes that Felix does not program here are expected to be programmed by Calico's BGP stack instead. Below, an IPIP IP Pool is one with ipipMode: Always or CrossSubnet, and an unencapsulated one has ipipMode and vxlanMode both Never.\n\n- Disabled: Felix programs no cluster routes. - EnabledIPIPOnly: Felix programs them for IPIP IP Pools. - EnabledNoEncapOnly: Felix programs them for unencapsulated IP Pools. - Enabled: Felix programs them for both.\n\nThis field must be kept consistent with BGPConfiguration.ProgramClusterRoutes, which makes the same choice from BIRD's side. If both Felix and BIRD are enabled for the same kind of IP Pool they will fight over the routes; if neither is, there will be no cluster routes at all.\n\nNote: leaving the IPIP cluster routes to BGP, which the Disabled and EnabledNoEncapOnly values do, is deprecated as of v3.33 and will be removed in v3.35.\n\n[Default: EnabledIPIPOnly]", Type: []string{"string"}, Format: "", }, @@ -3610,9 +3593,8 @@ func schema_pkg_apis_projectcalico_v3_FelixConfigurationSpec(ref common.Referenc Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -3694,12 +3676,27 @@ func schema_pkg_apis_projectcalico_v3_FelixConfigurationSpec(ref common.Referenc }, "nftablesMode": { SchemaProps: spec.SchemaProps{ - Description: "NFTablesMode configures nftables support in Felix. [Default: Auto]\n\nPossible enum values:\n - `\"Auto\"`\n - `\"Disabled\"`\n - `\"Enabled\"`", + Description: "NFTablesMode configures nftables support in Felix. In Auto mode, Felix uses the nftables dataplane if kube-proxy is detected to be running in nftables mode. [Default: Auto]\n\nPossible enum values:\n - `\"Auto\"`\n - `\"Disabled\"`\n - `\"Enabled\"`", Type: []string{"string"}, Format: "", Enum: []interface{}{"Auto", "Disabled", "Enabled"}, }, }, + "nftablesFlowTableOffload": { + SchemaProps: spec.SchemaProps{ + Description: "NFTablesFlowTableOffload controls which traffic nftables flowtable offload is enabled for, for improved forwarding performance. When set to \"All\", established connections accepted by Calico policy are offloaded to the kernel's flowtable fast path. Only applies when nftables mode is active. [Default: Disabled]\n\nPossible enum values:\n - `\"All\"`\n - `\"Disabled\"`", + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"All", "Disabled"}, + }, + }, + "nftablesFlowTableDataIfacePattern": { + SchemaProps: spec.SchemaProps{ + Description: "NFTablesFlowTableDataIfacePattern is a regular expression that controls which host interfaces are added to the nftables flowtable, so that traffic forwarded between those interfaces and local workloads is offloaded to the flowtable fast path. Leave empty to offload only workload-to-workload traffic. Only takes effect when NFTablesFlowTableOffload is not Disabled. [Default: \"\"]", + Type: []string{"string"}, + Format: "", + }, + }, "nftablesRefreshInterval": { SchemaProps: spec.SchemaProps{ Description: "NftablesRefreshInterval controls the interval at which Felix periodically refreshes the nftables rules. [Default: 90s]", @@ -3741,6 +3738,13 @@ func schema_pkg_apis_projectcalico_v3_FelixConfigurationSpec(ref common.Referenc Format: "", }, }, + "bpfOverlayHostSourceIP": { + SchemaProps: spec.SchemaProps{ + Description: "BPFOverlayHostSourceIP controls the source IP that Felix uses in BPF mode for host-networked (node-originated) traffic egressing over an IPIP/VXLAN overlay tunnel. \"TunnelAddress\" (the default) assigns an IP address to the overlay tunnel device and uses it as the source, preserving the behaviour of clusters upgraded from earlier releases. \"HostAddress\" uses the node's own IP directly and does not assign a tunnel device IP. This option has no effect on WireGuard tunnels, which always use a tunnel device IP. [Default: TunnelAddress]", + Type: []string{"string"}, + Format: "", + }, + }, "bpfDisableUnprivileged": { SchemaProps: spec.SchemaProps{ Description: "BPFDisableUnprivileged, if enabled, Felix sets the kernel.unprivileged_bpf_disabled sysctl to disable unprivileged use of BPF. This ensures that unprivileged users cannot access Calico's BPF maps and cannot insert their own BPF programs to interfere with Calico's. [Default: true]", @@ -3758,7 +3762,6 @@ func schema_pkg_apis_projectcalico_v3_FelixConfigurationSpec(ref common.Referenc "bpfLogLevel": { SchemaProps: spec.SchemaProps{ Description: "BPFLogLevel controls the log level of the BPF programs when in BPF dataplane mode. One of \"Off\", \"Info\", or \"Debug\". The logs are emitted to the BPF trace pipe, accessible with the command `tc exec bpf debug`. [Default: Off].", - Default: "", Type: []string{"string"}, Format: "", }, @@ -3797,9 +3800,8 @@ func schema_pkg_apis_projectcalico_v3_FelixConfigurationSpec(ref common.Referenc Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -3861,9 +3863,8 @@ func schema_pkg_apis_projectcalico_v3_FelixConfigurationSpec(ref common.Referenc Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -4007,9 +4008,8 @@ func schema_pkg_apis_projectcalico_v3_FelixConfigurationSpec(ref common.Referenc Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -4029,9 +4029,8 @@ func schema_pkg_apis_projectcalico_v3_FelixConfigurationSpec(ref common.Referenc Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -4080,7 +4079,7 @@ func schema_pkg_apis_projectcalico_v3_FelixConfigurationSpec(ref common.Referenc }, "bpfAttachType": { SchemaProps: spec.SchemaProps{ - Description: "BPFAttachType controls how are the BPF programs at the network interfaces attached. By default `TCX` is used where available to enable easier coexistence with 3rd party programs. `TC` can force the legacy method of attaching via a qdisc. `TCX` falls back to `TC` if `TCX` is not available. [Default: TCX]", + Description: "BPFAttachType controls how are the BPF programs at the network interfaces attached. By default `Netkit` is used, which attaches via the netkit API on workload interfaces that are netkit devices and via `TCX` on every other interface. `TCX` is used where available to enable easier coexistence with 3rd party programs. `TC` can force the legacy method of attaching via a qdisc. `TCX` falls back to `TC` if `TCX` is not available. Setting this to `TCX` or `TC` also makes Felix drive existing netkit devices with that mechanism instead of the netkit API, which is required before downgrading to a release without netkit support. [Default: Netkit]", Type: []string{"string"}, Format: "", }, @@ -4133,8 +4132,7 @@ func schema_pkg_apis_projectcalico_v3_FelixConfigurationSpec(ref common.Referenc Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.RouteTableIDRange{}.OpenAPIModelName()), + Ref: ref(v3.RouteTableIDRange{}.OpenAPIModelName()), }, }, }, @@ -4449,8 +4447,7 @@ func schema_pkg_apis_projectcalico_v3_GlobalNetworkPolicyList(ref common.Referen Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.GlobalNetworkPolicy{}.OpenAPIModelName()), + Ref: ref(v3.GlobalNetworkPolicy{}.OpenAPIModelName()), }, }, }, @@ -4497,8 +4494,7 @@ func schema_pkg_apis_projectcalico_v3_GlobalNetworkPolicySpec(ref common.Referen Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.Rule{}.OpenAPIModelName()), + Ref: ref(v3.Rule{}.OpenAPIModelName()), }, }, }, @@ -4516,8 +4512,7 @@ func schema_pkg_apis_projectcalico_v3_GlobalNetworkPolicySpec(ref common.Referen Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.Rule{}.OpenAPIModelName()), + Ref: ref(v3.Rule{}.OpenAPIModelName()), }, }, }, @@ -4542,9 +4537,8 @@ func schema_pkg_apis_projectcalico_v3_GlobalNetworkPolicySpec(ref common.Referen Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -4597,9 +4591,8 @@ func schema_pkg_apis_projectcalico_v3_GlobalNetworkPolicySpec(ref common.Referen Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -4687,8 +4680,7 @@ func schema_pkg_apis_projectcalico_v3_GlobalNetworkSetList(ref common.ReferenceC Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.GlobalNetworkSet{}.OpenAPIModelName()), + Ref: ref(v3.GlobalNetworkSet{}.OpenAPIModelName()), }, }, }, @@ -4722,9 +4714,8 @@ func schema_pkg_apis_projectcalico_v3_GlobalNetworkSetSpec(ref common.ReferenceC Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -4755,9 +4746,8 @@ func schema_pkg_apis_projectcalico_v3_HTTPMatch(ref common.ReferenceCallback) co Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -4775,8 +4765,7 @@ func schema_pkg_apis_projectcalico_v3_HTTPMatch(ref common.ReferenceCallback) co Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.HTTPPath{}.OpenAPIModelName()), + Ref: ref(v3.HTTPPath{}.OpenAPIModelName()), }, }, }, @@ -4916,8 +4905,7 @@ func schema_pkg_apis_projectcalico_v3_HostEndpointList(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.HostEndpoint{}.OpenAPIModelName()), + Ref: ref(v3.HostEndpoint{}.OpenAPIModelName()), }, }, }, @@ -4965,9 +4953,8 @@ func schema_pkg_apis_projectcalico_v3_HostEndpointSpec(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -4985,9 +4972,8 @@ func schema_pkg_apis_projectcalico_v3_HostEndpointSpec(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -5005,8 +4991,7 @@ func schema_pkg_apis_projectcalico_v3_HostEndpointSpec(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.EndpointPort{}.OpenAPIModelName()), + Ref: ref(v3.EndpointPort{}.OpenAPIModelName()), }, }, }, @@ -5121,8 +5106,7 @@ func schema_pkg_apis_projectcalico_v3_IPAMBlockList(ref common.ReferenceCallback Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.IPAMBlock{}.OpenAPIModelName()), + Ref: ref(v3.IPAMBlock{}.OpenAPIModelName()), }, }, }, @@ -5196,9 +5180,8 @@ func schema_pkg_apis_projectcalico_v3_IPAMBlockSpec(ref common.ReferenceCallback Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int32", + Type: []string{"integer"}, + Format: "int32", }, }, }, @@ -5216,8 +5199,7 @@ func schema_pkg_apis_projectcalico_v3_IPAMBlockSpec(ref common.ReferenceCallback Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.AllocationAttribute{}.OpenAPIModelName()), + Ref: ref(v3.AllocationAttribute{}.OpenAPIModelName()), }, }, }, @@ -5239,9 +5221,8 @@ func schema_pkg_apis_projectcalico_v3_IPAMBlockSpec(ref common.ReferenceCallback Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int64", + Type: []string{"integer"}, + Format: "int64", }, }, }, @@ -5347,8 +5328,7 @@ func schema_pkg_apis_projectcalico_v3_IPAMConfigurationList(ref common.Reference Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.IPAMConfiguration{}.OpenAPIModelName()), + Ref: ref(v3.IPAMConfiguration{}.OpenAPIModelName()), }, }, }, @@ -5488,8 +5468,7 @@ func schema_pkg_apis_projectcalico_v3_IPAMHandleList(ref common.ReferenceCallbac Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.IPAMHandle{}.OpenAPIModelName()), + Ref: ref(v3.IPAMHandle{}.OpenAPIModelName()), }, }, }, @@ -5527,9 +5506,8 @@ func schema_pkg_apis_projectcalico_v3_IPAMHandleSpec(ref common.ReferenceCallbac Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int32", + Type: []string{"integer"}, + Format: "int32", }, }, }, @@ -5655,8 +5633,7 @@ func schema_pkg_apis_projectcalico_v3_IPPoolList(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.IPPool{}.OpenAPIModelName()), + Ref: ref(v3.IPPool{}.OpenAPIModelName()), }, }, }, @@ -5723,7 +5700,7 @@ func schema_pkg_apis_projectcalico_v3_IPPoolSpec(ref common.ReferenceCallback) c }, "blockSize": { SchemaProps: spec.SchemaProps{ - Description: "The block size to use for IP address assignments from this pool. Defaults to 26 for IPv4 and 122 for IPv6. The block size must be between 0 and 32 for IPv4 and between 0 and 128 for IPv6. It must also be smaller than or equal to the size of the pool CIDR.", + Description: "The block size to use for IP address assignments from this pool. Defaults to 26 for IPv4 and 122 for IPv6. The block size must be between 20 and 32 for IPv4 and between 116 and 128 for IPv6. It must also be smaller than or equal to the size of the pool CIDR.", Type: []string{"integer"}, Format: "int32", }, @@ -5754,9 +5731,8 @@ func schema_pkg_apis_projectcalico_v3_IPPoolSpec(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -5796,8 +5772,7 @@ func schema_pkg_apis_projectcalico_v3_IPPoolStatus(ref common.ReferenceCallback) Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.Condition{}.OpenAPIModelName()), + Ref: ref(metav1.Condition{}.OpenAPIModelName()), }, }, }, @@ -5886,8 +5861,7 @@ func schema_pkg_apis_projectcalico_v3_IPReservationList(ref common.ReferenceCall Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.IPReservation{}.OpenAPIModelName()), + Ref: ref(v3.IPReservation{}.OpenAPIModelName()), }, }, }, @@ -5921,9 +5895,8 @@ func schema_pkg_apis_projectcalico_v3_IPReservationSpec(ref common.ReferenceCall Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -6015,8 +5988,7 @@ func schema_pkg_apis_projectcalico_v3_KubeControllersConfigurationList(ref commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.KubeControllersConfiguration{}.OpenAPIModelName()), + Ref: ref(v3.KubeControllersConfiguration{}.OpenAPIModelName()), }, }, }, @@ -6079,6 +6051,13 @@ func schema_pkg_apis_projectcalico_v3_KubeControllersConfigurationSpec(ref commo Format: "int32", }, }, + "debugProfileHost": { + SchemaProps: spec.SchemaProps{ + Description: "DebugProfileHost is the host IP or hostname to bind the profiling port to. Set to \"0.0.0.0\" for all interfaces to make profiles reachable from off-host. The profiling endpoints are unauthenticated and expose heap dumps, goroutine stacks and CPU profiles, so prefer the default and use kubectl port-forward for remote access. Only used if DebugProfilePort is set. [Default: localhost]", + Type: []string{"string"}, + Format: "", + }, + }, }, Required: []string{"controllers"}, }, @@ -6109,9 +6088,8 @@ func schema_pkg_apis_projectcalico_v3_KubeControllersConfigurationStatus(ref com Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -6258,8 +6236,7 @@ func schema_pkg_apis_projectcalico_v3_NetworkPolicyList(ref common.ReferenceCall Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.NetworkPolicy{}.OpenAPIModelName()), + Ref: ref(v3.NetworkPolicy{}.OpenAPIModelName()), }, }, }, @@ -6306,8 +6283,7 @@ func schema_pkg_apis_projectcalico_v3_NetworkPolicySpec(ref common.ReferenceCall Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.Rule{}.OpenAPIModelName()), + Ref: ref(v3.Rule{}.OpenAPIModelName()), }, }, }, @@ -6325,8 +6301,7 @@ func schema_pkg_apis_projectcalico_v3_NetworkPolicySpec(ref common.ReferenceCall Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.Rule{}.OpenAPIModelName()), + Ref: ref(v3.Rule{}.OpenAPIModelName()), }, }, }, @@ -6351,9 +6326,8 @@ func schema_pkg_apis_projectcalico_v3_NetworkPolicySpec(ref common.ReferenceCall Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -6378,9 +6352,8 @@ func schema_pkg_apis_projectcalico_v3_NetworkPolicySpec(ref common.ReferenceCall Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -6468,8 +6441,7 @@ func schema_pkg_apis_projectcalico_v3_NetworkSetList(ref common.ReferenceCallbac Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.NetworkSet{}.OpenAPIModelName()), + Ref: ref(v3.NetworkSet{}.OpenAPIModelName()), }, }, }, @@ -6503,9 +6475,8 @@ func schema_pkg_apis_projectcalico_v3_NetworkSetSpec(ref common.ReferenceCallbac Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -6604,9 +6575,8 @@ func schema_pkg_apis_projectcalico_v3_PrefixAdvertisement(ref common.ReferenceCa Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -6697,8 +6667,7 @@ func schema_pkg_apis_projectcalico_v3_ProfileList(ref common.ReferenceCallback) Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.Profile{}.OpenAPIModelName()), + Ref: ref(v3.Profile{}.OpenAPIModelName()), }, }, }, @@ -6732,8 +6701,7 @@ func schema_pkg_apis_projectcalico_v3_ProfileSpec(ref common.ReferenceCallback) Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.Rule{}.OpenAPIModelName()), + Ref: ref(v3.Rule{}.OpenAPIModelName()), }, }, }, @@ -6751,8 +6719,7 @@ func schema_pkg_apis_projectcalico_v3_ProfileSpec(ref common.ReferenceCallback) Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.Rule{}.OpenAPIModelName()), + Ref: ref(v3.Rule{}.OpenAPIModelName()), }, }, }, @@ -6766,9 +6733,8 @@ func schema_pkg_apis_projectcalico_v3_ProfileSpec(ref common.ReferenceCallback) Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -6963,9 +6929,8 @@ func schema_pkg_apis_projectcalico_v3_RuleMetadata(ref common.ReferenceCallback) Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -7016,9 +6981,8 @@ func schema_pkg_apis_projectcalico_v3_ServiceAccountMatch(ref common.ReferenceCa Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -7210,8 +7174,7 @@ func schema_pkg_apis_projectcalico_v3_StagedGlobalNetworkPolicyList(ref common.R Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.StagedGlobalNetworkPolicy{}.OpenAPIModelName()), + Ref: ref(v3.StagedGlobalNetworkPolicy{}.OpenAPIModelName()), }, }, }, @@ -7265,8 +7228,7 @@ func schema_pkg_apis_projectcalico_v3_StagedGlobalNetworkPolicySpec(ref common.R Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.Rule{}.OpenAPIModelName()), + Ref: ref(v3.Rule{}.OpenAPIModelName()), }, }, }, @@ -7284,8 +7246,7 @@ func schema_pkg_apis_projectcalico_v3_StagedGlobalNetworkPolicySpec(ref common.R Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.Rule{}.OpenAPIModelName()), + Ref: ref(v3.Rule{}.OpenAPIModelName()), }, }, }, @@ -7310,9 +7271,8 @@ func schema_pkg_apis_projectcalico_v3_StagedGlobalNetworkPolicySpec(ref common.R Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -7365,9 +7325,8 @@ func schema_pkg_apis_projectcalico_v3_StagedGlobalNetworkPolicySpec(ref common.R Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -7456,8 +7415,7 @@ func schema_pkg_apis_projectcalico_v3_StagedKubernetesNetworkPolicyList(ref comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.StagedKubernetesNetworkPolicy{}.OpenAPIModelName()), + Ref: ref(v3.StagedKubernetesNetworkPolicy{}.OpenAPIModelName()), }, }, }, @@ -7504,8 +7462,7 @@ func schema_pkg_apis_projectcalico_v3_StagedKubernetesNetworkPolicySpec(ref comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(networkingv1.NetworkPolicyIngressRule{}.OpenAPIModelName()), + Ref: ref(networkingv1.NetworkPolicyIngressRule{}.OpenAPIModelName()), }, }, }, @@ -7523,8 +7480,7 @@ func schema_pkg_apis_projectcalico_v3_StagedKubernetesNetworkPolicySpec(ref comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(networkingv1.NetworkPolicyEgressRule{}.OpenAPIModelName()), + Ref: ref(networkingv1.NetworkPolicyEgressRule{}.OpenAPIModelName()), }, }, }, @@ -7542,10 +7498,9 @@ func schema_pkg_apis_projectcalico_v3_StagedKubernetesNetworkPolicySpec(ref comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - Enum: []interface{}{"Egress", "Ingress"}, + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"Egress", "Ingress"}, }, }, }, @@ -7634,8 +7589,7 @@ func schema_pkg_apis_projectcalico_v3_StagedNetworkPolicyList(ref common.Referen Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.StagedNetworkPolicy{}.OpenAPIModelName()), + Ref: ref(v3.StagedNetworkPolicy{}.OpenAPIModelName()), }, }, }, @@ -7689,8 +7643,7 @@ func schema_pkg_apis_projectcalico_v3_StagedNetworkPolicySpec(ref common.Referen Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.Rule{}.OpenAPIModelName()), + Ref: ref(v3.Rule{}.OpenAPIModelName()), }, }, }, @@ -7708,8 +7661,7 @@ func schema_pkg_apis_projectcalico_v3_StagedNetworkPolicySpec(ref common.Referen Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.Rule{}.OpenAPIModelName()), + Ref: ref(v3.Rule{}.OpenAPIModelName()), }, }, }, @@ -7734,9 +7686,8 @@ func schema_pkg_apis_projectcalico_v3_StagedNetworkPolicySpec(ref common.Referen Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -7761,9 +7712,8 @@ func schema_pkg_apis_projectcalico_v3_StagedNetworkPolicySpec(ref common.Referen Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -7802,9 +7752,8 @@ func schema_pkg_apis_projectcalico_v3_Template(ref common.ReferenceCallback) com Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -7825,9 +7774,23 @@ func schema_pkg_apis_projectcalico_v3_Template(ref common.ReferenceCallback) com Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "annotations": { + SchemaProps: spec.SchemaProps{ + Description: "Annotations adds the specified annotations to the generated AutoHostEndpoint.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", }, }, }, @@ -7927,8 +7890,7 @@ func schema_pkg_apis_projectcalico_v3_TierList(ref common.ReferenceCallback) com Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v3.Tier{}.OpenAPIModelName()), + Ref: ref(v3.Tier{}.OpenAPIModelName()), }, }, }, @@ -7992,8 +7954,7 @@ func schema_pkg_apis_projectcalico_v3_TierStatus(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.Condition{}.OpenAPIModelName()), + Ref: ref(metav1.Condition{}.OpenAPIModelName()), }, }, }, @@ -8241,8 +8202,7 @@ func schema_k8sio_api_core_v1_AvoidPods(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.PreferAvoidPodsEntry{}.OpenAPIModelName()), + Ref: ref(v1.PreferAvoidPodsEntry{}.OpenAPIModelName()), }, }, }, @@ -8490,9 +8450,8 @@ func schema_k8sio_api_core_v1_CSIPersistentVolumeSource(ref common.ReferenceCall Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -8574,9 +8533,8 @@ func schema_k8sio_api_core_v1_CSIVolumeSource(ref common.ReferenceCallback) comm Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -8616,9 +8574,8 @@ func schema_k8sio_api_core_v1_Capabilities(ref common.ReferenceCallback) common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -8636,9 +8593,8 @@ func schema_k8sio_api_core_v1_Capabilities(ref common.ReferenceCallback) common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -8669,9 +8625,8 @@ func schema_k8sio_api_core_v1_CephFSPersistentVolumeSource(ref common.ReferenceC Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -8739,9 +8694,8 @@ func schema_k8sio_api_core_v1_CephFSVolumeSource(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -8940,6 +8894,13 @@ func schema_k8sio_api_core_v1_ClusterTrustBundleProjection(ref common.ReferenceC Format: "", }, }, + "user": { + SchemaProps: spec.SchemaProps{ + Description: "user is Optional: The owner UID of the created file. If specified, the item-level user field takes precedence over defaultUser. (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled.", + Type: []string{"integer"}, + Format: "int64", + }, + }, }, Required: []string{"path"}, }, @@ -9038,8 +8999,7 @@ func schema_k8sio_api_core_v1_ComponentStatus(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ComponentCondition{}.OpenAPIModelName()), + Ref: ref(v1.ComponentCondition{}.OpenAPIModelName()), }, }, }, @@ -9088,8 +9048,7 @@ func schema_k8sio_api_core_v1_ComponentStatusList(ref common.ReferenceCallback) Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ComponentStatus{}.OpenAPIModelName()), + Ref: ref(v1.ComponentStatus{}.OpenAPIModelName()), }, }, }, @@ -9147,9 +9106,8 @@ func schema_k8sio_api_core_v1_ConfigMap(ref common.ReferenceCallback) common.Ope Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -9157,7 +9115,7 @@ func schema_k8sio_api_core_v1_ConfigMap(ref common.ReferenceCallback) common.Ope }, "binaryData": { SchemaProps: spec.SchemaProps{ - Description: "BinaryData contains the binary data. Each key must consist of alphanumeric characters, '-', '_' or '.'. BinaryData can contain byte sequences that are not in the UTF-8 range. The keys stored in BinaryData must not overlap with the ones in the Data field, this is enforced during validation process. Using this field will require 1.10+ apiserver and kubelet.", + Description: "BinaryData contains the binary data. Each key must consist of alphanumeric characters, '-', '_' or '.'. BinaryData can contain byte sequences that are not in the UTF-8 range. The keys stored in BinaryData must not overlap with the ones in the Data field, this is enforced during validation process. Using this field will require 1.10+ apiserver and kubelet. Note: BinaryData keys are not currently propagated to container env vars via ConfigMapKeyRef or ConfigMapRef env sources; only Data keys are used.", Type: []string{"object"}, AdditionalProperties: &spec.SchemaOrBool{ Allows: true, @@ -9182,7 +9140,7 @@ func schema_k8sio_api_core_v1_ConfigMapEnvSource(ref common.ReferenceCallback) c return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.", + Description: "ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables. Keys in the BinaryData field are not currently propagated to container env vars.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "name": { @@ -9223,7 +9181,7 @@ func schema_k8sio_api_core_v1_ConfigMapKeySelector(ref common.ReferenceCallback) }, "key": { SchemaProps: spec.SchemaProps{ - Description: "The key to select.", + Description: "The key to select from the ConfigMap's Data field. Keys in the BinaryData field are not currently propagated to container env vars.", Default: "", Type: []string{"string"}, Format: "", @@ -9283,8 +9241,7 @@ func schema_k8sio_api_core_v1_ConfigMapList(ref common.ReferenceCallback) common Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ConfigMap{}.OpenAPIModelName()), + Ref: ref(v1.ConfigMap{}.OpenAPIModelName()), }, }, }, @@ -9378,8 +9335,7 @@ func schema_k8sio_api_core_v1_ConfigMapProjection(ref common.ReferenceCallback) Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.KeyToPath{}.OpenAPIModelName()), + Ref: ref(v1.KeyToPath{}.OpenAPIModelName()), }, }, }, @@ -9427,8 +9383,7 @@ func schema_k8sio_api_core_v1_ConfigMapVolumeSource(ref common.ReferenceCallback Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.KeyToPath{}.OpenAPIModelName()), + Ref: ref(v1.KeyToPath{}.OpenAPIModelName()), }, }, }, @@ -9448,6 +9403,13 @@ func schema_k8sio_api_core_v1_ConfigMapVolumeSource(ref common.ReferenceCallback Format: "", }, }, + "defaultUser": { + SchemaProps: spec.SchemaProps{ + Description: "defaultUser is Optional: The owner UID of the created files by default. The defaultUser field is only used as a fallback when the item-level user field is unset. (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled.", + Type: []string{"integer"}, + Format: "int64", + }, + }, }, }, }, @@ -9490,9 +9452,8 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -9510,9 +9471,8 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -9543,8 +9503,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ContainerPort{}.OpenAPIModelName()), + Ref: ref(v1.ContainerPort{}.OpenAPIModelName()), }, }, }, @@ -9562,8 +9521,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.EnvFromSource{}.OpenAPIModelName()), + Ref: ref(v1.EnvFromSource{}.OpenAPIModelName()), }, }, }, @@ -9586,8 +9544,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.EnvVar{}.OpenAPIModelName()), + Ref: ref(v1.EnvVar{}.OpenAPIModelName()), }, }, }, @@ -9612,8 +9569,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ContainerResizePolicy{}.OpenAPIModelName()), + Ref: ref(v1.ContainerResizePolicy{}.OpenAPIModelName()), }, }, }, @@ -9638,8 +9594,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ContainerRestartRule{}.OpenAPIModelName()), + Ref: ref(v1.ContainerRestartRule{}.OpenAPIModelName()), }, }, }, @@ -9662,8 +9617,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.VolumeMount{}.OpenAPIModelName()), + Ref: ref(v1.VolumeMount{}.OpenAPIModelName()), }, }, }, @@ -9686,8 +9640,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.VolumeDevice{}.OpenAPIModelName()), + Ref: ref(v1.VolumeDevice{}.OpenAPIModelName()), }, }, }, @@ -9833,9 +9786,8 @@ func schema_k8sio_api_core_v1_ContainerImage(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -9991,9 +9943,8 @@ func schema_k8sio_api_core_v1_ContainerRestartRuleOnExitCodes(ref common.Referen Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int32", + Type: []string{"integer"}, + Format: "int32", }, }, }, @@ -10263,8 +10214,7 @@ func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.VolumeMountStatus{}.OpenAPIModelName()), + Ref: ref(v1.VolumeMountStatus{}.OpenAPIModelName()), }, }, }, @@ -10293,8 +10243,7 @@ func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ResourceStatus{}.OpenAPIModelName()), + Ref: ref(v1.ResourceStatus{}.OpenAPIModelName()), }, }, }, @@ -10379,8 +10328,7 @@ func schema_k8sio_api_core_v1_DownwardAPIProjection(ref common.ReferenceCallback Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.DownwardAPIVolumeFile{}.OpenAPIModelName()), + Ref: ref(v1.DownwardAPIVolumeFile{}.OpenAPIModelName()), }, }, }, @@ -10428,6 +10376,13 @@ func schema_k8sio_api_core_v1_DownwardAPIVolumeFile(ref common.ReferenceCallback Format: "int32", }, }, + "user": { + SchemaProps: spec.SchemaProps{ + Description: "user is Optional: The owner UID of the created file. If specified, the item-level user field takes precedence over defaultUser. (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled.", + Type: []string{"integer"}, + Format: "int64", + }, + }, }, Required: []string{"path"}, }, @@ -10456,8 +10411,7 @@ func schema_k8sio_api_core_v1_DownwardAPIVolumeSource(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.DownwardAPIVolumeFile{}.OpenAPIModelName()), + Ref: ref(v1.DownwardAPIVolumeFile{}.OpenAPIModelName()), }, }, }, @@ -10470,6 +10424,13 @@ func schema_k8sio_api_core_v1_DownwardAPIVolumeSource(ref common.ReferenceCallba Format: "int32", }, }, + "defaultUser": { + SchemaProps: spec.SchemaProps{ + Description: "defaultUser is Optional: The owner UID of the created files by default. The defaultUser field is only used as a fallback when the item-level user field is unset. (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled.", + Type: []string{"integer"}, + Format: "int64", + }, + }, }, }, }, @@ -10498,6 +10459,13 @@ func schema_k8sio_api_core_v1_EmptyDirVolumeSource(ref common.ReferenceCallback) Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, + "mode": { + SchemaProps: spec.SchemaProps{ + Description: "mode specifies the permission bits for the emptyDir directory, in numeric notation (e.g., 0755, 01777). Must be a value between 0000 and 01777. If not specified, defaults to 0777. This might be in conflict with other options that affect the file mode, like fsGroup. If fsGroup is specified, the fsGroup permissions will override the mode specified here. This field has no effect on Windows. This field is alpha and requires EmptyDirVolumeMode featuregate to be enabled.", + Type: []string{"integer"}, + Format: "int32", + }, + }, }, }, }, @@ -10623,8 +10591,7 @@ func schema_k8sio_api_core_v1_EndpointSubset(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.EndpointAddress{}.OpenAPIModelName()), + Ref: ref(v1.EndpointAddress{}.OpenAPIModelName()), }, }, }, @@ -10642,8 +10609,7 @@ func schema_k8sio_api_core_v1_EndpointSubset(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.EndpointAddress{}.OpenAPIModelName()), + Ref: ref(v1.EndpointAddress{}.OpenAPIModelName()), }, }, }, @@ -10661,8 +10627,7 @@ func schema_k8sio_api_core_v1_EndpointSubset(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.EndpointPort{}.OpenAPIModelName()), + Ref: ref(v1.EndpointPort{}.OpenAPIModelName()), }, }, }, @@ -10716,8 +10681,7 @@ func schema_k8sio_api_core_v1_Endpoints(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.EndpointSubset{}.OpenAPIModelName()), + Ref: ref(v1.EndpointSubset{}.OpenAPIModelName()), }, }, }, @@ -10766,8 +10730,7 @@ func schema_k8sio_api_core_v1_EndpointsList(ref common.ReferenceCallback) common Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.Endpoints{}.OpenAPIModelName()), + Ref: ref(v1.Endpoints{}.OpenAPIModelName()), }, }, }, @@ -10932,9 +10895,8 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -10952,9 +10914,8 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -10985,8 +10946,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ContainerPort{}.OpenAPIModelName()), + Ref: ref(v1.ContainerPort{}.OpenAPIModelName()), }, }, }, @@ -11004,8 +10964,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.EnvFromSource{}.OpenAPIModelName()), + Ref: ref(v1.EnvFromSource{}.OpenAPIModelName()), }, }, }, @@ -11028,8 +10987,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.EnvVar{}.OpenAPIModelName()), + Ref: ref(v1.EnvVar{}.OpenAPIModelName()), }, }, }, @@ -11054,8 +11012,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ContainerResizePolicy{}.OpenAPIModelName()), + Ref: ref(v1.ContainerResizePolicy{}.OpenAPIModelName()), }, }, }, @@ -11080,8 +11037,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ContainerRestartRule{}.OpenAPIModelName()), + Ref: ref(v1.ContainerRestartRule{}.OpenAPIModelName()), }, }, }, @@ -11104,8 +11060,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.VolumeMount{}.OpenAPIModelName()), + Ref: ref(v1.VolumeMount{}.OpenAPIModelName()), }, }, }, @@ -11128,8 +11083,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.VolumeDevice{}.OpenAPIModelName()), + Ref: ref(v1.VolumeDevice{}.OpenAPIModelName()), }, }, }, @@ -11259,9 +11213,8 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -11279,9 +11232,8 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -11312,8 +11264,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ContainerPort{}.OpenAPIModelName()), + Ref: ref(v1.ContainerPort{}.OpenAPIModelName()), }, }, }, @@ -11331,8 +11282,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.EnvFromSource{}.OpenAPIModelName()), + Ref: ref(v1.EnvFromSource{}.OpenAPIModelName()), }, }, }, @@ -11355,8 +11305,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.EnvVar{}.OpenAPIModelName()), + Ref: ref(v1.EnvVar{}.OpenAPIModelName()), }, }, }, @@ -11381,8 +11330,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ContainerResizePolicy{}.OpenAPIModelName()), + Ref: ref(v1.ContainerResizePolicy{}.OpenAPIModelName()), }, }, }, @@ -11407,8 +11355,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ContainerRestartRule{}.OpenAPIModelName()), + Ref: ref(v1.ContainerRestartRule{}.OpenAPIModelName()), }, }, }, @@ -11431,8 +11378,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.VolumeMount{}.OpenAPIModelName()), + Ref: ref(v1.VolumeMount{}.OpenAPIModelName()), }, }, }, @@ -11455,8 +11401,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.VolumeDevice{}.OpenAPIModelName()), + Ref: ref(v1.VolumeDevice{}.OpenAPIModelName()), }, }, }, @@ -11733,8 +11678,7 @@ func schema_k8sio_api_core_v1_EventList(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.Event{}.OpenAPIModelName()), + Ref: ref(v1.Event{}.OpenAPIModelName()), }, }, }, @@ -11804,6 +11748,40 @@ func schema_k8sio_api_core_v1_EventSource(ref common.ReferenceCallback) common.O } } +func schema_k8sio_api_core_v1_EvictionResponder(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EvictionResponder allows you to specify the responder reacting to an Eviction. Responders should observe and communicate through the Eviction Resource API to help with the graceful eviction of a target (e.g. termination of a pod).", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name allows you to identify the responder responding to the Eviction.\n\nIt must be a valid domain-prefixed key (such as \"acme.io/foo\"). Domain names *.k8s.io and *.kubernetes.io are reserved. This field must be unique for each responder. This field is required.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "priority": { + SchemaProps: spec.SchemaProps{ + Description: "priority for this responder. Higher priorities are selected first by the evictionrequest-controller. If there are responders with the same priority, the responder whose domain name comes first in the alphabetical higher domain order, will be picked. This means that the top domain labels are compared alphabetically first, followed by the lower domain labels. The key is compared last.\n\nThe responder that is the managing controller of the pod should set the value of this field to 10000 to allow both for preemption or fallback registration by other responders.\n\nThe minimum value is 0 and the maximum value is 100000. The interval 0-999 is reserved for responders with *.k8s.io suffix. This field is required.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + Required: []string{"name", "priority"}, + }, + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-map-type": "atomic", + }, + }, + }, + } +} + func schema_k8sio_api_core_v1_ExecAction(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -11823,9 +11801,8 @@ func schema_k8sio_api_core_v1_ExecAction(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -11856,9 +11833,8 @@ func schema_k8sio_api_core_v1_FCVolumeSource(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -11897,9 +11873,8 @@ func schema_k8sio_api_core_v1_FCVolumeSource(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -12005,9 +11980,8 @@ func schema_k8sio_api_core_v1_FlexPersistentVolumeSource(ref common.ReferenceCal Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -12065,9 +12039,8 @@ func schema_k8sio_api_core_v1_FlexVolumeSource(ref common.ReferenceCallback) com Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -12175,6 +12148,14 @@ func schema_k8sio_api_core_v1_GRPCAction(ref common.ReferenceCallback) common.Op Format: "", }, }, + "mode": { + SchemaProps: spec.SchemaProps{ + Description: "mode specifies the connection mode for the gRPC health probe. Set to \"TLS\" to use TLS without certificate verification. Set to \"Plaintext\" to use a plaintext (insecure) connection explicitly. If not specified, the probe uses a plaintext (insecure) connection.\n\nPossible enum values:\n - `\"Plaintext\"` indicates that the probe should use a plaintext (insecure) gRPC connection.\n - `\"TLS\"` indicates that the probe should connect using TLS without certificate verification.", + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"Plaintext", "TLS"}, + }, + }, }, Required: []string{"port"}, }, @@ -12346,13 +12327,20 @@ func schema_k8sio_api_core_v1_HTTPGetAction(ref common.ReferenceCallback) common Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.HTTPHeader{}.OpenAPIModelName()), + Ref: ref(v1.HTTPHeader{}.OpenAPIModelName()), }, }, }, }, }, + "protocol": { + SchemaProps: spec.SchemaProps{ + Description: "Protocol selects the wire protocol for the probe connection. Nil defaults to HTTP/1.1.\n\nPossible enum values:\n - `\"HTTP1\"` uses HTTP/1.1 (the existing default).\n - `\"HTTP2\"` uses HTTP/2. Currently, only cleartext with prior knowledge (h2c) is supported, and must be used with scheme HTTP.", + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"HTTP1", "HTTP2"}, + }, + }, }, Required: []string{"port"}, }, @@ -12419,9 +12407,8 @@ func schema_k8sio_api_core_v1_HostAlias(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -12551,9 +12538,8 @@ func schema_k8sio_api_core_v1_ISCSIPersistentVolumeSource(ref common.ReferenceCa Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -12660,9 +12646,8 @@ func schema_k8sio_api_core_v1_ISCSIVolumeSource(ref common.ReferenceCallback) co Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -12783,6 +12768,13 @@ func schema_k8sio_api_core_v1_KeyToPath(ref common.ReferenceCallback) common.Ope Format: "int32", }, }, + "user": { + SchemaProps: spec.SchemaProps{ + Description: "user is Optional: The owner UID of the created file. If specified, the item-level user field takes precedence over defaultUser. (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled.", + Type: []string{"integer"}, + Format: "int64", + }, + }, }, Required: []string{"key", "path"}, }, @@ -13036,8 +13028,7 @@ func schema_k8sio_api_core_v1_LimitRangeList(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.LimitRange{}.OpenAPIModelName()), + Ref: ref(v1.LimitRange{}.OpenAPIModelName()), }, }, }, @@ -13071,8 +13062,7 @@ func schema_k8sio_api_core_v1_LimitRangeSpec(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.LimitRangeItem{}.OpenAPIModelName()), + Ref: ref(v1.LimitRangeItem{}.OpenAPIModelName()), }, }, }, @@ -13122,9 +13112,8 @@ func schema_k8sio_api_core_v1_LinuxContainerUser(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int64", + Type: []string{"integer"}, + Format: "int64", }, }, }, @@ -13227,8 +13216,7 @@ func schema_k8sio_api_core_v1_LoadBalancerIngress(ref common.ReferenceCallback) Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.PortStatus{}.OpenAPIModelName()), + Ref: ref(v1.PortStatus{}.OpenAPIModelName()), }, }, }, @@ -13261,8 +13249,7 @@ func schema_k8sio_api_core_v1_LoadBalancerStatus(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.LoadBalancerIngress{}.OpenAPIModelName()), + Ref: ref(v1.LoadBalancerIngress{}.OpenAPIModelName()), }, }, }, @@ -13535,8 +13522,7 @@ func schema_k8sio_api_core_v1_NamespaceList(ref common.ReferenceCallback) common Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.Namespace{}.OpenAPIModelName()), + Ref: ref(v1.Namespace{}.OpenAPIModelName()), }, }, }, @@ -13570,9 +13556,8 @@ func schema_k8sio_api_core_v1_NamespaceSpec(ref common.ReferenceCallback) common Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -13616,8 +13601,7 @@ func schema_k8sio_api_core_v1_NamespaceStatus(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.NamespaceCondition{}.OpenAPIModelName()), + Ref: ref(v1.NamespaceCondition{}.OpenAPIModelName()), }, }, }, @@ -13736,8 +13720,7 @@ func schema_k8sio_api_core_v1_NodeAffinity(ref common.ReferenceCallback) common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.PreferredSchedulingTerm{}.OpenAPIModelName()), + Ref: ref(v1.PreferredSchedulingTerm{}.OpenAPIModelName()), }, }, }, @@ -13751,23 +13734,89 @@ func schema_k8sio_api_core_v1_NodeAffinity(ref common.ReferenceCallback) common. } } -func schema_k8sio_api_core_v1_NodeAllocatableResourceClaimStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_core_v1_NodeAllocatableMappedResources(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "NodeAllocatableResourceClaimStatus describes the status of node allocatable resources allocated via DRA.", + Description: "NodeAllocatableMappedResources describes mapped node allocatable resource allocations.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "resourceClaimName": { + "name": { SchemaProps: spec.SchemaProps{ - Description: "ResourceClaimName is the resource claim referenced by the pod that resulted in this node allocatable resource allocation.", + Description: "Name is the name of the resource (e.g., cpu, memory).", Default: "", Type: []string{"string"}, Format: "", }, }, - "containers": { - VendorExtensible: spec.VendorExtensible{ + "quantity": { + SchemaProps: spec.SchemaProps{ + Description: "Quantity is the total node allocatable resource capacity allocated for the claim. This claim's allocated devices is shared by all the containers referencing the claim. Kubelet adds this value to both requests and limits at the pod-level cgroup, and to limits at the container-level cgroup for each container referencing the claim.", + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + }, + }, + }, + Required: []string{"name", "quantity"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/api/resource.Quantity"}, + } +} + +func schema_k8sio_api_core_v1_NodeAllocatableOverheadResources(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeAllocatableOverheadResources describes auxiliary overhead resource allocations.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name is the name of the resource (e.g., cpu, memory).", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "perPod": { + SchemaProps: spec.SchemaProps{ + Description: "PerPod is the flat overhead quantity allocated per pod. Adding to each container limit allows individual containers to utilize the overhead, while the parent pod-level cgroup limit caps the total usage at the pod boundary where the overhead is accounted for exactly once. At least one of PerPod or PerContainer must be specified. Specifying neither is an invalid configuration.", + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + }, + }, + "perContainer": { + SchemaProps: spec.SchemaProps{ + Description: "PerContainer is the variable overhead quantity applied for each container referencing the claim. The container references are recorded in `nodeAllocatableResourceClaimStatuses.containers`. The total overhead quantity allocated for the claim is computed as: Quantity = PerPod + (PerContainer * NumReferences) Kubelet accounts for this overhead in cgroups: - Pod-level cgroup (requests and limits): Kubelet adds PerPod + (PerContainer * NumReferences). - Container-level cgroup (limits only): Kubelet adds PerPod + PerContainer for each referencing container. This allows any single container to access the pod-level overhead, while the parent cgroup caps the total usage to account for PerPod exactly once. At least one of PerPod or PerContainer must be specified. Specifying neither is an invalid configuration.", + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + }, + }, + }, + Required: []string{"name"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/api/resource.Quantity"}, + } +} + +func schema_k8sio_api_core_v1_NodeAllocatableResourceClaimStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeAllocatableResourceClaimStatus describes the status of node allocatable resources allocated via DRA.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "resourceClaimName": { + SchemaProps: spec.SchemaProps{ + Description: "ResourceClaimName is the resource claim referenced by the pod that resulted in this node allocatable resource allocation.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "containers": { + VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ "x-kubernetes-list-type": "set", }, @@ -13778,34 +13827,65 @@ func schema_k8sio_api_core_v1_NodeAllocatableResourceClaimStatus(ref common.Refe Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "mapping": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Mapping contains allocations through devices mapped in the device spec's `nodeAllocatableResources[...].mapping` field. This is used by kubelet for pod level and container-level cgroup enforcement.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref(v1.NodeAllocatableMappedResources{}.OpenAPIModelName()), }, }, }, }, }, - "resources": { + "overhead": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge", + }, + }, SchemaProps: spec.SchemaProps{ - Description: "Resources is a map of the node-allocatable resource name to the aggregate quantity allocated to the claim.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, + Description: "Overhead contains allocations through devices mapped in the device spec's `nodeAllocatableResources[...].overhead` field. This is used by kubelet for pod level and container-level cgroup enforcement.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref(v1.NodeAllocatableOverheadResources{}.OpenAPIModelName()), }, }, }, }, }, }, - Required: []string{"resourceClaimName", "resources"}, + Required: []string{"resourceClaimName"}, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity"}, + v1.NodeAllocatableMappedResources{}.OpenAPIModelName(), v1.NodeAllocatableOverheadResources{}.OpenAPIModelName()}, } } @@ -14005,8 +14085,7 @@ func schema_k8sio_api_core_v1_NodeList(ref common.ReferenceCallback) common.Open Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.Node{}.OpenAPIModelName()), + Ref: ref(v1.Node{}.OpenAPIModelName()), }, }, }, @@ -14021,6 +14100,38 @@ func schema_k8sio_api_core_v1_NodeList(ref common.ReferenceCallback) common.Open } } +func schema_k8sio_api_core_v1_NodePodPreemptionPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodePodPreemptionPolicy defines the node-level policies governing preemption for pods on this node.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "disableResizePreemption": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "set", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "DisableResizePreemption lists the owners (e.g., autoscalers, operators, administrators) that have requested to disable scheduler and Kubelet preemption for in-place pod resize on this node. If this list is non-empty, resize-induced preemption is disabled on this node. This is an alpha field and requires enabling the InPlacePodVerticalScalingSchedulerPreemption feature gate.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + func schema_k8sio_api_core_v1_NodeProxyOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -14130,8 +14241,7 @@ func schema_k8sio_api_core_v1_NodeSelector(ref common.ReferenceCallback) common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.NodeSelectorTerm{}.OpenAPIModelName()), + Ref: ref(v1.NodeSelectorTerm{}.OpenAPIModelName()), }, }, }, @@ -14187,9 +14297,8 @@ func schema_k8sio_api_core_v1_NodeSelectorRequirement(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -14221,8 +14330,7 @@ func schema_k8sio_api_core_v1_NodeSelectorTerm(ref common.ReferenceCallback) com Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.NodeSelectorRequirement{}.OpenAPIModelName()), + Ref: ref(v1.NodeSelectorRequirement{}.OpenAPIModelName()), }, }, }, @@ -14240,8 +14348,7 @@ func schema_k8sio_api_core_v1_NodeSelectorTerm(ref common.ReferenceCallback) com Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.NodeSelectorRequirement{}.OpenAPIModelName()), + Ref: ref(v1.NodeSelectorRequirement{}.OpenAPIModelName()), }, }, }, @@ -14287,9 +14394,8 @@ func schema_k8sio_api_core_v1_NodeSpec(ref common.ReferenceCallback) common.Open Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -14321,8 +14427,7 @@ func schema_k8sio_api_core_v1_NodeSpec(ref common.ReferenceCallback) common.Open Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.Taint{}.OpenAPIModelName()), + Ref: ref(v1.Taint{}.OpenAPIModelName()), }, }, }, @@ -14341,11 +14446,17 @@ func schema_k8sio_api_core_v1_NodeSpec(ref common.ReferenceCallback) common.Open Format: "", }, }, + "podPreemptionPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "PodPreemptionPolicy controls the node-level preemption behaviors for pods on this node. This is an alpha field and requires enabling the InPlacePodVerticalScalingSchedulerPreemption feature gate.", + Ref: ref(v1.NodePodPreemptionPolicy{}.OpenAPIModelName()), + }, + }, }, }, }, Dependencies: []string{ - v1.NodeConfigSource{}.OpenAPIModelName(), v1.Taint{}.OpenAPIModelName()}, + v1.NodeConfigSource{}.OpenAPIModelName(), v1.NodePodPreemptionPolicy{}.OpenAPIModelName(), v1.Taint{}.OpenAPIModelName()}, } } @@ -14409,8 +14520,7 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.NodeCondition{}.OpenAPIModelName()), + Ref: ref(v1.NodeCondition{}.OpenAPIModelName()), }, }, }, @@ -14433,8 +14543,7 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.NodeAddress{}.OpenAPIModelName()), + Ref: ref(v1.NodeAddress{}.OpenAPIModelName()), }, }, }, @@ -14466,8 +14575,7 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ContainerImage{}.OpenAPIModelName()), + Ref: ref(v1.ContainerImage{}.OpenAPIModelName()), }, }, }, @@ -14485,9 +14593,8 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -14505,8 +14612,7 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.AttachedVolume{}.OpenAPIModelName()), + Ref: ref(v1.AttachedVolume{}.OpenAPIModelName()), }, }, }, @@ -14530,8 +14636,7 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.NodeRuntimeHandler{}.OpenAPIModelName()), + Ref: ref(v1.NodeRuntimeHandler{}.OpenAPIModelName()), }, }, }, @@ -14555,9 +14660,8 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -14684,6 +14788,13 @@ func schema_k8sio_api_core_v1_NodeSystemInfo(ref common.ReferenceCallback) commo Ref: ref(v1.NodeSwapStatus{}.OpenAPIModelName()), }, }, + "runningInUserNamespace": { + SchemaProps: spec.SchemaProps{ + Description: "Whether the node is running in a user namespace.", + Type: []string{"boolean"}, + Format: "", + }, + }, }, Required: []string{"machineID", "systemUUID", "bootID", "kernelVersion", "osImage", "containerRuntimeVersion", "kubeletVersion", "kubeProxyVersion", "operatingSystem", "architecture"}, }, @@ -14987,8 +15098,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimList(ref common.ReferenceCall Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.PersistentVolumeClaim{}.OpenAPIModelName()), + Ref: ref(v1.PersistentVolumeClaim{}.OpenAPIModelName()), }, }, }, @@ -15022,10 +15132,9 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -15068,13 +15177,13 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall }, "dataSource": { SchemaProps: spec.SchemaProps{ - Description: "dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.", + Description: "dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.", Ref: ref(v1.TypedLocalObjectReference{}.OpenAPIModelName()), }, }, "dataSourceRef": { SchemaProps: spec.SchemaProps{ - Description: "dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn't specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn't set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef\n allows any non-core object, as well as PersistentVolumeClaim objects.\n* While dataSource ignores disallowed values (dropping them), dataSourceRef\n preserves all values, and generates an error if a disallowed value is\n specified.\n* While dataSource only allows local objects, dataSourceRef allows objects\n in any namespaces.\n(Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.", + Description: "dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn't specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn't set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef\n allows any non-core object, as well as PersistentVolumeClaim objects.\n* While dataSource ignores disallowed values (dropping them), dataSourceRef\n preserves all values, and generates an error if a disallowed value is\n specified.\n* While dataSource only allows local objects, dataSourceRef allows objects\n in any namespaces.\n(Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.", Ref: ref(v1.TypedObjectReference{}.OpenAPIModelName()), }, }, @@ -15120,10 +15229,9 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -15160,8 +15268,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.PersistentVolumeClaimCondition{}.OpenAPIModelName()), + Ref: ref(v1.PersistentVolumeClaimCondition{}.OpenAPIModelName()), }, }, }, @@ -15194,10 +15301,9 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - Enum: []interface{}{"ControllerResizeInProgress", "ControllerResizeInfeasible", "NodeResizeInProgress", "NodeResizeInfeasible", "NodeResizePending"}, + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"ControllerResizeInProgress", "ControllerResizeInfeasible", "NodeResizeInProgress", "NodeResizeInfeasible", "NodeResizePending"}, }, }, }, @@ -15216,11 +15322,17 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Ref: ref(v1.ModifyVolumeStatus{}.OpenAPIModelName()), }, }, + "healthStatus": { + SchemaProps: spec.SchemaProps{ + Description: "healthStatus contains the latest controller-reported health information for the volume bound to this claim.", + Ref: ref(v1.VolumeHealthStatus{}.OpenAPIModelName()), + }, + }, }, }, }, Dependencies: []string{ - v1.ModifyVolumeStatus{}.OpenAPIModelName(), v1.PersistentVolumeClaimCondition{}.OpenAPIModelName(), "k8s.io/apimachinery/pkg/api/resource.Quantity"}, + v1.ModifyVolumeStatus{}.OpenAPIModelName(), v1.PersistentVolumeClaimCondition{}.OpenAPIModelName(), v1.VolumeHealthStatus{}.OpenAPIModelName(), "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -15318,8 +15430,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeList(ref common.ReferenceCallback) Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.PersistentVolume{}.OpenAPIModelName()), + Ref: ref(v1.PersistentVolume{}.OpenAPIModelName()), }, }, }, @@ -15646,10 +15757,9 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -15693,9 +15803,8 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -15871,8 +15980,7 @@ func schema_k8sio_api_core_v1_PodAffinity(ref common.ReferenceCallback) common.O Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.PodAffinityTerm{}.OpenAPIModelName()), + Ref: ref(v1.PodAffinityTerm{}.OpenAPIModelName()), }, }, }, @@ -15890,8 +15998,7 @@ func schema_k8sio_api_core_v1_PodAffinity(ref common.ReferenceCallback) common.O Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.WeightedPodAffinityTerm{}.OpenAPIModelName()), + Ref: ref(v1.WeightedPodAffinityTerm{}.OpenAPIModelName()), }, }, }, @@ -15930,9 +16037,8 @@ func schema_k8sio_api_core_v1_PodAffinityTerm(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -15964,9 +16070,8 @@ func schema_k8sio_api_core_v1_PodAffinityTerm(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -15984,9 +16089,8 @@ func schema_k8sio_api_core_v1_PodAffinityTerm(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -16020,8 +16124,7 @@ func schema_k8sio_api_core_v1_PodAntiAffinity(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.PodAffinityTerm{}.OpenAPIModelName()), + Ref: ref(v1.PodAffinityTerm{}.OpenAPIModelName()), }, }, }, @@ -16039,8 +16142,7 @@ func schema_k8sio_api_core_v1_PodAntiAffinity(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.WeightedPodAffinityTerm{}.OpenAPIModelName()), + Ref: ref(v1.WeightedPodAffinityTerm{}.OpenAPIModelName()), }, }, }, @@ -16173,14 +16275,20 @@ func schema_k8sio_api_core_v1_PodCertificateProjection(ref common.ReferenceCallb Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, }, }, + "user": { + SchemaProps: spec.SchemaProps{ + Description: "user is Optional: The owner UID of the created file. If specified, the item-level user field takes precedence over defaultUser. (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled.", + Type: []string{"integer"}, + Format: "int64", + }, + }, }, Required: []string{"signerName", "keyType"}, }, @@ -16272,9 +16380,8 @@ func schema_k8sio_api_core_v1_PodDNSConfig(ref common.ReferenceCallback) common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -16292,9 +16399,8 @@ func schema_k8sio_api_core_v1_PodDNSConfig(ref common.ReferenceCallback) common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -16312,8 +16418,7 @@ func schema_k8sio_api_core_v1_PodDNSConfig(ref common.ReferenceCallback) common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.PodDNSConfigOption{}.OpenAPIModelName()), + Ref: ref(v1.PodDNSConfigOption{}.OpenAPIModelName()), }, }, }, @@ -16422,9 +16527,8 @@ func schema_k8sio_api_core_v1_PodExecOptions(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -16456,8 +16560,7 @@ func schema_k8sio_api_core_v1_PodExtendedResourceClaimStatus(ref common.Referenc Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ContainerExtendedResourceRequest{}.OpenAPIModelName()), + Ref: ref(v1.ContainerExtendedResourceRequest{}.OpenAPIModelName()), }, }, }, @@ -16537,8 +16640,7 @@ func schema_k8sio_api_core_v1_PodList(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.Pod{}.OpenAPIModelName()), + Ref: ref(v1.Pod{}.OpenAPIModelName()), }, }, }, @@ -16706,9 +16808,8 @@ func schema_k8sio_api_core_v1_PodPortForwardOptions(ref common.ReferenceCallback Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int32", + Type: []string{"integer"}, + Format: "int32", }, }, }, @@ -16946,9 +17047,8 @@ func schema_k8sio_api_core_v1_PodSecurityContext(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int64", + Type: []string{"integer"}, + Format: "int64", }, }, }, @@ -16981,8 +17081,7 @@ func schema_k8sio_api_core_v1_PodSecurityContext(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.Sysctl{}.OpenAPIModelName()), + Ref: ref(v1.Sysctl{}.OpenAPIModelName()), }, }, }, @@ -17010,7 +17109,7 @@ func schema_k8sio_api_core_v1_PodSecurityContext(ref common.ReferenceCallback) c }, "seLinuxChangePolicy": { SchemaProps: spec.SchemaProps{ - Description: "seLinuxChangePolicy defines how the container's SELinux label is applied to all volumes used by the Pod. It has no effect on nodes that do not support SELinux or to volumes does not support SELinux. Valid values are \"MountOption\" and \"Recursive\".\n\n\"Recursive\" means relabeling of all files on all Pod volumes by the container runtime. This may be slow for large volumes, but allows mixing privileged and unprivileged Pods sharing the same volume on the same node.\n\n\"MountOption\" mounts all eligible Pod volumes with `-o context` mount option. This requires all Pods that share the same volume to use the same SELinux label. It is not possible to share the same volume among privileged and unprivileged Pods. Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their CSIDriver instance. Other volumes are always re-labelled recursively. \"MountOption\" value is allowed only when SELinuxMount feature gate is enabled.\n\nIf not specified and SELinuxMount feature gate is enabled, \"MountOption\" is used. If not specified and SELinuxMount feature gate is disabled, \"MountOption\" is used for ReadWriteOncePod volumes and \"Recursive\" for all other volumes.\n\nThis field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers.\n\nAll Pods that use the same volume should use the same seLinuxChangePolicy, otherwise some pods can get stuck in ContainerCreating state. Note that this field cannot be set when spec.os.name is windows.", + Description: "seLinuxChangePolicy defines how the container's SELinux label is applied to all volumes used by the Pod. It has no effect on nodes that do not support SELinux or to volumes does not support SELinux. Valid values are \"MountOption\" and \"Recursive\".\n\n\"Recursive\" means relabeling of all files on all Pod volumes by the container runtime. This may be slow for large volumes, but allows mixing privileged and unprivileged Pods sharing the same volume on the same node.\n\n\"MountOption\" mounts all eligible Pod volumes with `-o context` mount option. This requires all Pods that share the same volume to use the same SELinux label. It is not possible to share the same volume among privileged and unprivileged Pods. Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their CSIDriver instance. Other volumes are always re-labelled recursively.\n\nIf not specified, \"MountOption\" is used.\n\nThis field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers.\n\nAll Pods that use the same volume should use the same seLinuxChangePolicy, otherwise some pods can get stuck in ContainerCreating state. Note that this field cannot be set when spec.os.name is windows.", Type: []string{"string"}, Format: "", }, @@ -17068,8 +17167,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.Volume{}.OpenAPIModelName()), + Ref: ref(v1.Volume{}.OpenAPIModelName()), }, }, }, @@ -17092,8 +17190,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.Container{}.OpenAPIModelName()), + Ref: ref(v1.Container{}.OpenAPIModelName()), }, }, }, @@ -17116,8 +17213,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.Container{}.OpenAPIModelName()), + Ref: ref(v1.Container{}.OpenAPIModelName()), }, }, }, @@ -17140,8 +17236,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.EphemeralContainer{}.OpenAPIModelName()), + Ref: ref(v1.EphemeralContainer{}.OpenAPIModelName()), }, }, }, @@ -17190,9 +17285,8 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -17277,8 +17371,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.LocalObjectReference{}.OpenAPIModelName()), + Ref: ref(v1.LocalObjectReference{}.OpenAPIModelName()), }, }, }, @@ -17323,8 +17416,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.Toleration{}.OpenAPIModelName()), + Ref: ref(v1.Toleration{}.OpenAPIModelName()), }, }, }, @@ -17347,8 +17439,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.HostAlias{}.OpenAPIModelName()), + Ref: ref(v1.HostAlias{}.OpenAPIModelName()), }, }, }, @@ -17386,8 +17477,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.PodReadinessGate{}.OpenAPIModelName()), + Ref: ref(v1.PodReadinessGate{}.OpenAPIModelName()), }, }, }, @@ -17409,7 +17499,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "preemptionPolicy": { SchemaProps: spec.SchemaProps{ - Description: "PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.\n\nPossible enum values:\n - `\"Never\"` means that pod never preempts other pods with lower priority.\n - `\"PreemptLowerPriority\"` means that pod can preempt other pods with lower priority.", + Description: "PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. Defaults to PreemptLowerPriority if unset.\n\nPossible enum values:\n - `\"Never\"` means that pod never preempts other pods with lower priority.\n - `\"PreemptLowerPriority\"` means that pod can preempt other pods with lower priority.", Type: []string{"string"}, Format: "", Enum: []interface{}{"Never", "PreemptLowerPriority"}, @@ -17447,8 +17537,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.TopologySpreadConstraint{}.OpenAPIModelName()), + Ref: ref(v1.TopologySpreadConstraint{}.OpenAPIModelName()), }, }, }, @@ -17491,8 +17580,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.PodSchedulingGate{}.OpenAPIModelName()), + Ref: ref(v1.PodSchedulingGate{}.OpenAPIModelName()), }, }, }, @@ -17515,8 +17603,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.PodResourceClaim{}.OpenAPIModelName()), + Ref: ref(v1.PodResourceClaim{}.OpenAPIModelName()), }, }, }, @@ -17530,7 +17617,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "hostnameOverride": { SchemaProps: spec.SchemaProps{ - Description: "HostnameOverride specifies an explicit override for the pod's hostname as perceived by the pod. This field only specifies the pod's hostname and does not affect its DNS records. When this field is set to a non-empty string: - It takes precedence over the values set in `hostname` and `subdomain`. - The Pod's hostname will be set to this value. - `setHostnameAsFQDN` must be nil or set to false. - `hostNetwork` must be set to false.\n\nThis field must be a valid DNS subdomain as defined in RFC 1123 and contain at most 64 characters. Requires the HostnameOverride feature gate to be enabled.", + Description: "HostnameOverride specifies an explicit override for the pod's hostname as perceived by the pod. This field only specifies the pod's hostname and does not affect its DNS records. When this field is set to a non-empty string: - It takes precedence over the values set in `hostname` and `subdomain`. - The Pod's hostname will be set to this value. - `setHostnameAsFQDN` must be nil or set to false. - `hostNetwork` must be set to false.\n\nThis field must be a valid DNS subdomain as defined in RFC 1123 and contain at most 64 characters.", Type: []string{"string"}, Format: "", }, @@ -17541,12 +17628,35 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Ref: ref(v1.PodSchedulingGroup{}.OpenAPIModelName()), }, }, + "evictionResponders": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "evictionResponders reference responders that react to Evictions based on EvictionRequests. Responders should observe and communicate through the Eviction Resource API to help with the graceful termination of a pod. The responders are selected sequentially, according to their specified priority.\n\nResponders should periodically report on an eviction progress by updating the .status.responders[].heartbeatTime field of the Eviction object. If this field is not updated within the heartbeat deadline defined by the Eviction API (currently 20 minutes), the eviction is passed over to the next responder with a lower priority. If there is no other responder, the last default imperative-eviction.k8s.io/evictor responder with a priority of 100 will evict the pod using the imperative Eviction API (pods//eviction subresource).\n\nThe maximum length of the responders list is 10. Responders are not supported when the pod is part of a PodGroup (.spec.schedulingGroup is set). This field can only be set on creation and is immutable afterwards.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref(v1.EvictionResponder{}.OpenAPIModelName()), + }, + }, + }, + }, + }, }, Required: []string{"containers"}, }, }, Dependencies: []string{ - v1.Affinity{}.OpenAPIModelName(), v1.Container{}.OpenAPIModelName(), v1.EphemeralContainer{}.OpenAPIModelName(), v1.HostAlias{}.OpenAPIModelName(), v1.LocalObjectReference{}.OpenAPIModelName(), v1.PodDNSConfig{}.OpenAPIModelName(), v1.PodOS{}.OpenAPIModelName(), v1.PodReadinessGate{}.OpenAPIModelName(), v1.PodResourceClaim{}.OpenAPIModelName(), v1.PodSchedulingGate{}.OpenAPIModelName(), v1.PodSchedulingGroup{}.OpenAPIModelName(), v1.PodSecurityContext{}.OpenAPIModelName(), v1.ResourceRequirements{}.OpenAPIModelName(), v1.Toleration{}.OpenAPIModelName(), v1.TopologySpreadConstraint{}.OpenAPIModelName(), v1.Volume{}.OpenAPIModelName(), "k8s.io/apimachinery/pkg/api/resource.Quantity"}, + v1.Affinity{}.OpenAPIModelName(), v1.Container{}.OpenAPIModelName(), v1.EphemeralContainer{}.OpenAPIModelName(), v1.EvictionResponder{}.OpenAPIModelName(), v1.HostAlias{}.OpenAPIModelName(), v1.LocalObjectReference{}.OpenAPIModelName(), v1.PodDNSConfig{}.OpenAPIModelName(), v1.PodOS{}.OpenAPIModelName(), v1.PodReadinessGate{}.OpenAPIModelName(), v1.PodResourceClaim{}.OpenAPIModelName(), v1.PodSchedulingGate{}.OpenAPIModelName(), v1.PodSchedulingGroup{}.OpenAPIModelName(), v1.PodSecurityContext{}.OpenAPIModelName(), v1.ResourceRequirements{}.OpenAPIModelName(), v1.Toleration{}.OpenAPIModelName(), v1.TopologySpreadConstraint{}.OpenAPIModelName(), v1.Volume{}.OpenAPIModelName(), "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -17589,8 +17699,7 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.PodCondition{}.OpenAPIModelName()), + Ref: ref(v1.PodCondition{}.OpenAPIModelName()), }, }, }, @@ -17638,8 +17747,7 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.HostIP{}.OpenAPIModelName()), + Ref: ref(v1.HostIP{}.OpenAPIModelName()), }, }, }, @@ -17669,8 +17777,7 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.PodIP{}.OpenAPIModelName()), + Ref: ref(v1.PodIP{}.OpenAPIModelName()), }, }, }, @@ -17694,8 +17801,7 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ContainerStatus{}.OpenAPIModelName()), + Ref: ref(v1.ContainerStatus{}.OpenAPIModelName()), }, }, }, @@ -17713,8 +17819,7 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ContainerStatus{}.OpenAPIModelName()), + Ref: ref(v1.ContainerStatus{}.OpenAPIModelName()), }, }, }, @@ -17740,8 +17845,7 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ContainerStatus{}.OpenAPIModelName()), + Ref: ref(v1.ContainerStatus{}.OpenAPIModelName()), }, }, }, @@ -17771,8 +17875,7 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.PodResourceClaimStatus{}.OpenAPIModelName()), + Ref: ref(v1.PodResourceClaimStatus{}.OpenAPIModelName()), }, }, }, @@ -17807,7 +17910,12 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope "nodeAllocatableResourceClaimStatuses": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", + "x-kubernetes-list-map-keys": []interface{}{ + "resourceClaimName", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "resourceClaimName", + "x-kubernetes-patch-strategy": "merge", }, }, SchemaProps: spec.SchemaProps{ @@ -17816,61 +17924,38 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.NodeAllocatableResourceClaimStatus{}.OpenAPIModelName()), + Ref: ref(v1.NodeAllocatableResourceClaimStatus{}.OpenAPIModelName()), }, }, }, }, }, - }, - }, - }, - Dependencies: []string{ - v1.ContainerStatus{}.OpenAPIModelName(), v1.HostIP{}.OpenAPIModelName(), v1.NodeAllocatableResourceClaimStatus{}.OpenAPIModelName(), v1.PodCondition{}.OpenAPIModelName(), v1.PodExtendedResourceClaimStatus{}.OpenAPIModelName(), v1.PodIP{}.OpenAPIModelName(), v1.PodResourceClaimStatus{}.OpenAPIModelName(), v1.ResourceRequirements{}.OpenAPIModelName(), "k8s.io/apimachinery/pkg/api/resource.Quantity", metav1.Time{}.OpenAPIModelName()}, - } -} - -func schema_k8sio_api_core_v1_PodStatusResult(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]interface{}{}, - Ref: ref(metav1.ObjectMeta{}.OpenAPIModelName()), + "volumeHealth": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + }, }, - }, - "status": { SchemaProps: spec.SchemaProps{ - Description: "Most recently observed status of the pod. This data may not be up to date. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Default: map[string]interface{}{}, - Ref: ref(v1.PodStatus{}.OpenAPIModelName()), + Description: "volumeHealth contains node-reported health for each volume the pod is using. Populated by the kubelet on the pod's node.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref(v1.PodVolumeHealth{}.OpenAPIModelName()), + }, + }, + }, }, }, }, }, }, Dependencies: []string{ - v1.PodStatus{}.OpenAPIModelName(), metav1.ObjectMeta{}.OpenAPIModelName()}, + v1.ContainerStatus{}.OpenAPIModelName(), v1.HostIP{}.OpenAPIModelName(), v1.NodeAllocatableResourceClaimStatus{}.OpenAPIModelName(), v1.PodCondition{}.OpenAPIModelName(), v1.PodExtendedResourceClaimStatus{}.OpenAPIModelName(), v1.PodIP{}.OpenAPIModelName(), v1.PodResourceClaimStatus{}.OpenAPIModelName(), v1.PodVolumeHealth{}.OpenAPIModelName(), v1.ResourceRequirements{}.OpenAPIModelName(), "k8s.io/apimachinery/pkg/api/resource.Quantity", metav1.Time{}.OpenAPIModelName()}, } } @@ -17952,8 +18037,7 @@ func schema_k8sio_api_core_v1_PodTemplateList(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.PodTemplate{}.OpenAPIModelName()), + Ref: ref(v1.PodTemplate{}.OpenAPIModelName()), }, }, }, @@ -17997,6 +18081,60 @@ func schema_k8sio_api_core_v1_PodTemplateSpec(ref common.ReferenceCallback) comm } } +func schema_k8sio_api_core_v1_PodVolumeHealth(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PodVolumeHealth contains health information for a volume used by a pod, reported by the CSI node plugin via the kubelet.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name matches an entry in pod.spec.volumes.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "healthConditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "status", + "reason", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "status", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions is the set of adverse conditions reported by the CSI node plugin for this volume on this node. At most 16 conditions may be reported.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref(v1.VolumeHealthCondition{}.OpenAPIModelName()), + }, + }, + }, + }, + }, + "lastTransitionTime": { + SchemaProps: spec.SchemaProps{ + Description: "lastTransitionTime is when the current set of conditions first appeared.", + Ref: ref(metav1.Time{}.OpenAPIModelName()), + }, + }, + }, + Required: []string{"name"}, + }, + }, + Dependencies: []string{ + v1.VolumeHealthCondition{}.OpenAPIModelName(), metav1.Time{}.OpenAPIModelName()}, + } +} + func schema_k8sio_api_core_v1_PortStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -18284,8 +18422,7 @@ func schema_k8sio_api_core_v1_ProjectedVolumeSource(ref common.ReferenceCallback Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.VolumeProjection{}.OpenAPIModelName()), + Ref: ref(v1.VolumeProjection{}.OpenAPIModelName()), }, }, }, @@ -18298,6 +18435,13 @@ func schema_k8sio_api_core_v1_ProjectedVolumeSource(ref common.ReferenceCallback Format: "int32", }, }, + "defaultUser": { + SchemaProps: spec.SchemaProps{ + Description: "defaultUser is Optional: The owner UID of the created files by default. The defaultUser field is only used as a fallback when the item-level user field is unset. (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled.", + Type: []string{"integer"}, + Format: "int64", + }, + }, }, }, }, @@ -18383,9 +18527,8 @@ func schema_k8sio_api_core_v1_RBDPersistentVolumeSource(ref common.ReferenceCall Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -18471,9 +18614,8 @@ func schema_k8sio_api_core_v1_RBDVolumeSource(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -18729,8 +18871,7 @@ func schema_k8sio_api_core_v1_ReplicationControllerList(ref common.ReferenceCall Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ReplicationController{}.OpenAPIModelName()), + Ref: ref(v1.ReplicationController{}.OpenAPIModelName()), }, }, }, @@ -18781,9 +18922,8 @@ func schema_k8sio_api_core_v1_ReplicationControllerSpec(ref common.ReferenceCall Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -18863,8 +19003,7 @@ func schema_k8sio_api_core_v1_ReplicationControllerStatus(ref common.ReferenceCa Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ReplicationControllerCondition{}.OpenAPIModelName()), + Ref: ref(v1.ReplicationControllerCondition{}.OpenAPIModelName()), }, }, }, @@ -19071,8 +19210,7 @@ func schema_k8sio_api_core_v1_ResourceQuotaList(ref common.ReferenceCallback) co Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ResourceQuota{}.OpenAPIModelName()), + Ref: ref(v1.ResourceQuota{}.OpenAPIModelName()), }, }, }, @@ -19120,10 +19258,9 @@ func schema_k8sio_api_core_v1_ResourceQuotaSpec(ref common.ReferenceCallback) co Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - Enum: []interface{}{"BestEffort", "CrossNamespacePodAffinity", "NotBestEffort", "NotTerminating", "PriorityClass", "Terminating", "VolumeAttributesClass"}, + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"BestEffort", "CrossNamespacePodAffinity", "NotBestEffort", "NotTerminating", "PriorityClass", "Terminating", "VolumeAttributesClass"}, }, }, }, @@ -19236,8 +19373,7 @@ func schema_k8sio_api_core_v1_ResourceRequirements(ref common.ReferenceCallback) Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ResourceClaim{}.OpenAPIModelName()), + Ref: ref(v1.ResourceClaim{}.OpenAPIModelName()), }, }, }, @@ -19260,7 +19396,7 @@ func schema_k8sio_api_core_v1_ResourceStatus(ref common.ReferenceCallback) commo Properties: map[string]spec.Schema{ "name": { SchemaProps: spec.SchemaProps{ - Description: "Name of the resource. Must be unique within the pod and in case of non-DRA resource, match one of the resources from the pod spec. For DRA resources, the value must be \"claim:/\". When this status is reported about a container, the \"claim_name\" and \"request\" must match one of the claims of this container.", + Description: "Name of the resource. Must be unique within the pod and in case of non-DRA resource, match one of the resources from the pod spec. For DRA resources, the value must be \"claim:/\" when container.resources.claims[*].request is set or \"claim:\" when container.resources.claims[*].request is empty. For DRA-backed extended resources, \"claim:/\" is used when the claim name and request name are recorded in pod.status.extendedResourceClaimStatus. When this status is reported about a container, the \"claim_name\" and \"request\" must match one of the claims of this container.", Default: "", Type: []string{"string"}, Format: "", @@ -19281,8 +19417,7 @@ func schema_k8sio_api_core_v1_ResourceStatus(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ResourceHealth{}.OpenAPIModelName()), + Ref: ref(v1.ResourceHealth{}.OpenAPIModelName()), }, }, }, @@ -19535,8 +19670,7 @@ func schema_k8sio_api_core_v1_ScopeSelector(ref common.ReferenceCallback) common Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ScopedResourceSelectorRequirement{}.OpenAPIModelName()), + Ref: ref(v1.ScopedResourceSelectorRequirement{}.OpenAPIModelName()), }, }, }, @@ -19592,9 +19726,8 @@ func schema_k8sio_api_core_v1_ScopedResourceSelectorRequirement(ref common.Refer Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -19707,9 +19840,8 @@ func schema_k8sio_api_core_v1_Secret(ref common.ReferenceCallback) common.OpenAP Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -19835,8 +19967,7 @@ func schema_k8sio_api_core_v1_SecretList(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.Secret{}.OpenAPIModelName()), + Ref: ref(v1.Secret{}.OpenAPIModelName()), }, }, }, @@ -19878,8 +20009,7 @@ func schema_k8sio_api_core_v1_SecretProjection(ref common.ReferenceCallback) com Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.KeyToPath{}.OpenAPIModelName()), + Ref: ref(v1.KeyToPath{}.OpenAPIModelName()), }, }, }, @@ -19958,8 +20088,7 @@ func schema_k8sio_api_core_v1_SecretVolumeSource(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.KeyToPath{}.OpenAPIModelName()), + Ref: ref(v1.KeyToPath{}.OpenAPIModelName()), }, }, }, @@ -19979,6 +20108,13 @@ func schema_k8sio_api_core_v1_SecretVolumeSource(ref common.ReferenceCallback) c Format: "", }, }, + "defaultUser": { + SchemaProps: spec.SchemaProps{ + Description: "defaultUser is Optional: The owner UID of the created files by default. The defaultUser field is only used as a fallback when the item-level user field is unset. (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled.", + Type: []string{"integer"}, + Format: "int64", + }, + }, }, }, }, @@ -20213,8 +20349,7 @@ func schema_k8sio_api_core_v1_ServiceAccount(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ObjectReference{}.OpenAPIModelName()), + Ref: ref(v1.ObjectReference{}.OpenAPIModelName()), }, }, }, @@ -20232,8 +20367,7 @@ func schema_k8sio_api_core_v1_ServiceAccount(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.LocalObjectReference{}.OpenAPIModelName()), + Ref: ref(v1.LocalObjectReference{}.OpenAPIModelName()), }, }, }, @@ -20289,8 +20423,7 @@ func schema_k8sio_api_core_v1_ServiceAccountList(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ServiceAccount{}.OpenAPIModelName()), + Ref: ref(v1.ServiceAccount{}.OpenAPIModelName()), }, }, }, @@ -20334,6 +20467,13 @@ func schema_k8sio_api_core_v1_ServiceAccountTokenProjection(ref common.Reference Format: "", }, }, + "user": { + SchemaProps: spec.SchemaProps{ + Description: "user is Optional: The owner UID of the created file. If specified, the item-level user field takes precedence over defaultUser. (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled.", + Type: []string{"integer"}, + Format: "int64", + }, + }, }, Required: []string{"path"}, }, @@ -20376,8 +20516,7 @@ func schema_k8sio_api_core_v1_ServiceList(ref common.ReferenceCallback) common.O Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.Service{}.OpenAPIModelName()), + Ref: ref(v1.Service{}.OpenAPIModelName()), }, }, }, @@ -20511,8 +20650,7 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ServicePort{}.OpenAPIModelName()), + Ref: ref(v1.ServicePort{}.OpenAPIModelName()), }, }, }, @@ -20531,9 +20669,8 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -20558,9 +20695,8 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -20586,9 +20722,8 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -20621,9 +20756,8 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -20676,10 +20810,9 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - Enum: []interface{}{"", "IPv4", "IPv6"}, + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"", "IPv4", "IPv6"}, }, }, }, @@ -20761,8 +20894,7 @@ func schema_k8sio_api_core_v1_ServiceStatus(ref common.ReferenceCallback) common Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.Condition{}.OpenAPIModelName()), + Ref: ref(metav1.Condition{}.OpenAPIModelName()), }, }, }, @@ -21099,9 +21231,8 @@ func schema_k8sio_api_core_v1_TopologySelectorLabelRequirement(ref common.Refere Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -21133,8 +21264,7 @@ func schema_k8sio_api_core_v1_TopologySelectorTerm(ref common.ReferenceCallback) Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.TopologySelectorLabelRequirement{}.OpenAPIModelName()), + Ref: ref(v1.TopologySelectorLabelRequirement{}.OpenAPIModelName()), }, }, }, @@ -21226,9 +21356,8 @@ func schema_k8sio_api_core_v1_TopologySpreadConstraint(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -21563,6 +21692,89 @@ func schema_k8sio_api_core_v1_VolumeDevice(ref common.ReferenceCallback) common. } } +func schema_k8sio_api_core_v1_VolumeHealthCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VolumeHealthCondition represents an adverse health condition reported for a volume.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status is the machine-parseable health category. Possible values: - \"Inaccessible\": the volume cannot be accessed. - \"DataLoss\": data loss has been detected on the volume. - \"Degraded\": the volume is functioning with reduced capability.\n\nPossible enum values:\n - `\"DataLoss\"` indicates data loss has been detected on the volume.\n - `\"Degraded\"` indicates the volume is functioning but with reduced capability.\n - `\"Inaccessible\"` indicates the volume cannot be accessed.", + Default: "", + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"DataLoss", "Degraded", "Inaccessible"}, + }, + }, + "reason": { + SchemaProps: spec.SchemaProps{ + Description: "reason is a brief CamelCase machine-parseable reason. Together with status it forms the unique identity of a condition entry. Maximum permitted length of a reason is 256 bytes.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "message": { + SchemaProps: spec.SchemaProps{ + Description: "message is a human-readable description. Maximum permitted length of a message is 1024 bytes.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"status", "reason"}, + }, + }, + } +} + +func schema_k8sio_api_core_v1_VolumeHealthStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VolumeHealthStatus contains health information for a volume reported by the CSI controller plugin.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "healthConditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "status", + "reason", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "status", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions is the set of adverse conditions reported by the CSI controller plugin. An empty list means no adverse condition. At most 16 conditions may be reported.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref(v1.VolumeHealthCondition{}.OpenAPIModelName()), + }, + }, + }, + }, + }, + "lastTransitionTime": { + SchemaProps: spec.SchemaProps{ + Description: "lastTransitionTime is when the current set of conditions first appeared.", + Ref: ref(metav1.Time{}.OpenAPIModelName()), + }, + }, + }, + }, + }, + Dependencies: []string{ + v1.VolumeHealthCondition{}.OpenAPIModelName(), metav1.Time{}.OpenAPIModelName()}, + } +} + func schema_k8sio_api_core_v1_VolumeMount(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -21594,7 +21806,7 @@ func schema_k8sio_api_core_v1_VolumeMount(ref common.ReferenceCallback) common.O }, "mountPath": { SchemaProps: spec.SchemaProps{ - Description: "Path within the container at which the volume should be mounted. Must not contain ':'.", + Description: "Path within the container at which the volume should be mounted.", Default: "", Type: []string{"string"}, Format: "", @@ -21622,6 +21834,25 @@ func schema_k8sio_api_core_v1_VolumeMount(ref common.ReferenceCallback) common.O Format: "", }, }, + "bindMountOptions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "set", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "bindMountOptions is the list of additional bind mount options to apply when mounting this volume into the container. Allowed values are noexec, nodev, and nosuid. These are Linux mount options and have no effect on Windows nodes. This field is not supported with image volumes. This is an alpha field and requires enabling the VolumeBindMountOptions feature gate.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, }, Required: []string{"name", "mountPath"}, }, @@ -22184,8 +22415,7 @@ func schema_k8sio_api_networking_v1_HTTPIngressRuleValue(ref common.ReferenceCal Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(networkingv1.HTTPIngressPath{}.OpenAPIModelName()), + Ref: ref(networkingv1.HTTPIngressPath{}.OpenAPIModelName()), }, }, }, @@ -22223,7 +22453,7 @@ func schema_k8sio_api_networking_v1_IPAddress(ref common.ReferenceCallback) comm }, "metadata": { SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Description: "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", Default: map[string]interface{}{}, Ref: ref(metav1.ObjectMeta{}.OpenAPIModelName()), }, @@ -22279,8 +22509,7 @@ func schema_k8sio_api_networking_v1_IPAddressList(ref common.ReferenceCallback) Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(networkingv1.IPAddress{}.OpenAPIModelName()), + Ref: ref(networkingv1.IPAddress{}.OpenAPIModelName()), }, }, }, @@ -22304,7 +22533,7 @@ func schema_k8sio_api_networking_v1_IPAddressSpec(ref common.ReferenceCallback) Properties: map[string]spec.Schema{ "parentRef": { SchemaProps: spec.SchemaProps{ - Description: "ParentRef references the resource that an IPAddress is attached to. An IPAddress must reference a parent object.", + Description: "parentRef references the resource that an IPAddress is attached to. An IPAddress must reference a parent object.", Ref: ref(networkingv1.ParentReference{}.OpenAPIModelName()), }, }, @@ -22344,9 +22573,8 @@ func schema_k8sio_api_networking_v1_IPBlock(ref common.ReferenceCallback) common Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -22382,7 +22610,7 @@ func schema_k8sio_api_networking_v1_Ingress(ref common.ReferenceCallback) common }, "metadata": { SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Description: "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", Default: map[string]interface{}{}, Ref: ref(metav1.ObjectMeta{}.OpenAPIModelName()), }, @@ -22459,7 +22687,7 @@ func schema_k8sio_api_networking_v1_IngressClass(ref common.ReferenceCallback) c }, "metadata": { SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Description: "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", Default: map[string]interface{}{}, Ref: ref(metav1.ObjectMeta{}.OpenAPIModelName()), }, @@ -22514,8 +22742,7 @@ func schema_k8sio_api_networking_v1_IngressClassList(ref common.ReferenceCallbac Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(networkingv1.IngressClass{}.OpenAPIModelName()), + Ref: ref(networkingv1.IngressClass{}.OpenAPIModelName()), }, }, }, @@ -22644,8 +22871,7 @@ func schema_k8sio_api_networking_v1_IngressList(ref common.ReferenceCallback) co Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(networkingv1.Ingress{}.OpenAPIModelName()), + Ref: ref(networkingv1.Ingress{}.OpenAPIModelName()), }, }, }, @@ -22693,8 +22919,7 @@ func schema_k8sio_api_networking_v1_IngressLoadBalancerIngress(ref common.Refere Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(networkingv1.IngressPortStatus{}.OpenAPIModelName()), + Ref: ref(networkingv1.IngressPortStatus{}.OpenAPIModelName()), }, }, }, @@ -22727,8 +22952,7 @@ func schema_k8sio_api_networking_v1_IngressLoadBalancerStatus(ref common.Referen Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(networkingv1.IngressLoadBalancerIngress{}.OpenAPIModelName()), + Ref: ref(networkingv1.IngressLoadBalancerIngress{}.OpenAPIModelName()), }, }, }, @@ -22796,7 +23020,8 @@ func schema_k8sio_api_networking_v1_IngressRule(ref common.ReferenceCallback) co }, "http": { SchemaProps: spec.SchemaProps{ - Ref: ref(networkingv1.HTTPIngressRuleValue{}.OpenAPIModelName()), + Description: "http is a HTTP IngressRuleValue, which contains a list of http selectors", + Ref: ref(networkingv1.HTTPIngressRuleValue{}.OpenAPIModelName()), }, }, }, @@ -22816,7 +23041,8 @@ func schema_k8sio_api_networking_v1_IngressRuleValue(ref common.ReferenceCallbac Properties: map[string]spec.Schema{ "http": { SchemaProps: spec.SchemaProps{ - Ref: ref(networkingv1.HTTPIngressRuleValue{}.OpenAPIModelName()), + Description: "http is a HTTP IngressRuleValue, which contains a list of http selectors", + Ref: ref(networkingv1.HTTPIngressRuleValue{}.OpenAPIModelName()), }, }, }, @@ -22890,8 +23116,7 @@ func schema_k8sio_api_networking_v1_IngressSpec(ref common.ReferenceCallback) co Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(networkingv1.IngressTLS{}.OpenAPIModelName()), + Ref: ref(networkingv1.IngressTLS{}.OpenAPIModelName()), }, }, }, @@ -22909,8 +23134,7 @@ func schema_k8sio_api_networking_v1_IngressSpec(ref common.ReferenceCallback) co Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(networkingv1.IngressRule{}.OpenAPIModelName()), + Ref: ref(networkingv1.IngressRule{}.OpenAPIModelName()), }, }, }, @@ -22965,9 +23189,8 @@ func schema_k8sio_api_networking_v1_IngressTLS(ref common.ReferenceCallback) com Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -23009,7 +23232,7 @@ func schema_k8sio_api_networking_v1_NetworkPolicy(ref common.ReferenceCallback) }, "metadata": { SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Description: "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", Default: map[string]interface{}{}, Ref: ref(metav1.ObjectMeta{}.OpenAPIModelName()), }, @@ -23048,8 +23271,7 @@ func schema_k8sio_api_networking_v1_NetworkPolicyEgressRule(ref common.Reference Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(networkingv1.NetworkPolicyPort{}.OpenAPIModelName()), + Ref: ref(networkingv1.NetworkPolicyPort{}.OpenAPIModelName()), }, }, }, @@ -23067,8 +23289,7 @@ func schema_k8sio_api_networking_v1_NetworkPolicyEgressRule(ref common.Reference Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(networkingv1.NetworkPolicyPeer{}.OpenAPIModelName()), + Ref: ref(networkingv1.NetworkPolicyPeer{}.OpenAPIModelName()), }, }, }, @@ -23101,8 +23322,7 @@ func schema_k8sio_api_networking_v1_NetworkPolicyIngressRule(ref common.Referenc Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(networkingv1.NetworkPolicyPort{}.OpenAPIModelName()), + Ref: ref(networkingv1.NetworkPolicyPort{}.OpenAPIModelName()), }, }, }, @@ -23120,8 +23340,7 @@ func schema_k8sio_api_networking_v1_NetworkPolicyIngressRule(ref common.Referenc Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(networkingv1.NetworkPolicyPeer{}.OpenAPIModelName()), + Ref: ref(networkingv1.NetworkPolicyPeer{}.OpenAPIModelName()), }, }, }, @@ -23170,8 +23389,7 @@ func schema_k8sio_api_networking_v1_NetworkPolicyList(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(networkingv1.NetworkPolicy{}.OpenAPIModelName()), + Ref: ref(networkingv1.NetworkPolicy{}.OpenAPIModelName()), }, }, }, @@ -23281,8 +23499,7 @@ func schema_k8sio_api_networking_v1_NetworkPolicySpec(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(networkingv1.NetworkPolicyIngressRule{}.OpenAPIModelName()), + Ref: ref(networkingv1.NetworkPolicyIngressRule{}.OpenAPIModelName()), }, }, }, @@ -23300,8 +23517,7 @@ func schema_k8sio_api_networking_v1_NetworkPolicySpec(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(networkingv1.NetworkPolicyEgressRule{}.OpenAPIModelName()), + Ref: ref(networkingv1.NetworkPolicyEgressRule{}.OpenAPIModelName()), }, }, }, @@ -23319,10 +23535,9 @@ func schema_k8sio_api_networking_v1_NetworkPolicySpec(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - Enum: []interface{}{"Egress", "Ingress"}, + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"Egress", "Ingress"}, }, }, }, @@ -23345,28 +23560,28 @@ func schema_k8sio_api_networking_v1_ParentReference(ref common.ReferenceCallback Properties: map[string]spec.Schema{ "group": { SchemaProps: spec.SchemaProps{ - Description: "Group is the group of the object being referenced.", + Description: "group is the group of the object being referenced.", Type: []string{"string"}, Format: "", }, }, "resource": { SchemaProps: spec.SchemaProps{ - Description: "Resource is the resource of the object being referenced.", + Description: "resource is the resource of the object being referenced.", Type: []string{"string"}, Format: "", }, }, "namespace": { SchemaProps: spec.SchemaProps{ - Description: "Namespace is the namespace of the object being referenced.", + Description: "namespace is the namespace of the object being referenced.", Type: []string{"string"}, Format: "", }, }, "name": { SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the object being referenced.", + Description: "name is the name of the object being referenced.", Type: []string{"string"}, Format: "", }, @@ -23433,7 +23648,7 @@ func schema_k8sio_api_networking_v1_ServiceCIDR(ref common.ReferenceCallback) co }, "metadata": { SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Description: "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", Default: map[string]interface{}{}, Ref: ref(metav1.ObjectMeta{}.OpenAPIModelName()), }, @@ -23495,8 +23710,7 @@ func schema_k8sio_api_networking_v1_ServiceCIDRList(ref common.ReferenceCallback Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(networkingv1.ServiceCIDR{}.OpenAPIModelName()), + Ref: ref(networkingv1.ServiceCIDR{}.OpenAPIModelName()), }, }, }, @@ -23525,14 +23739,13 @@ func schema_k8sio_api_networking_v1_ServiceCIDRSpec(ref common.ReferenceCallback }, }, SchemaProps: spec.SchemaProps{ - Description: "CIDRs defines the IP blocks in CIDR notation (e.g. \"192.168.0.0/24\" or \"2001:db8::/64\") from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. This field is immutable.", + Description: "cidrs defines the IP blocks in CIDR notation (e.g. \"192.168.0.0/24\" or \"2001:db8::/64\") from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. This field is immutable.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -23568,8 +23781,7 @@ func schema_k8sio_api_networking_v1_ServiceCIDRStatus(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.Condition{}.OpenAPIModelName()), + Ref: ref(metav1.Condition{}.OpenAPIModelName()), }, }, }, @@ -23624,8 +23836,7 @@ func schema_pkg_apis_meta_v1_APIGroup(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.GroupVersionForDiscovery{}.OpenAPIModelName()), + Ref: ref(metav1.GroupVersionForDiscovery{}.OpenAPIModelName()), }, }, }, @@ -23650,8 +23861,7 @@ func schema_pkg_apis_meta_v1_APIGroup(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.ServerAddressByClientCIDR{}.OpenAPIModelName()), + Ref: ref(metav1.ServerAddressByClientCIDR{}.OpenAPIModelName()), }, }, }, @@ -23699,8 +23909,7 @@ func schema_pkg_apis_meta_v1_APIGroupList(ref common.ReferenceCallback) common.O Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.APIGroup{}.OpenAPIModelName()), + Ref: ref(metav1.APIGroup{}.OpenAPIModelName()), }, }, }, @@ -23775,9 +23984,8 @@ func schema_pkg_apis_meta_v1_APIResource(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -23795,9 +24003,8 @@ func schema_pkg_apis_meta_v1_APIResource(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -23815,9 +24022,8 @@ func schema_pkg_apis_meta_v1_APIResource(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -23878,8 +24084,7 @@ func schema_pkg_apis_meta_v1_APIResourceList(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.APIResource{}.OpenAPIModelName()), + Ref: ref(metav1.APIResource{}.OpenAPIModelName()), }, }, }, @@ -23927,9 +24132,8 @@ func schema_pkg_apis_meta_v1_APIVersions(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -23947,8 +24151,7 @@ func schema_pkg_apis_meta_v1_APIVersions(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.ServerAddressByClientCIDR{}.OpenAPIModelName()), + Ref: ref(metav1.ServerAddressByClientCIDR{}.OpenAPIModelName()), }, }, }, @@ -23996,9 +24199,8 @@ func schema_pkg_apis_meta_v1_ApplyOptions(ref common.ReferenceCallback) common.O Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -24121,9 +24323,8 @@ func schema_pkg_apis_meta_v1_CreateOptions(ref common.ReferenceCallback) common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -24209,9 +24410,8 @@ func schema_pkg_apis_meta_v1_DeleteOptions(ref common.ReferenceCallback) common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -24279,9 +24479,8 @@ func schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -24564,9 +24763,8 @@ func schema_pkg_apis_meta_v1_LabelSelector(ref common.ReferenceCallback) common. Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -24584,8 +24782,7 @@ func schema_pkg_apis_meta_v1_LabelSelector(ref common.ReferenceCallback) common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.LabelSelectorRequirement{}.OpenAPIModelName()), + Ref: ref(metav1.LabelSelectorRequirement{}.OpenAPIModelName()), }, }, }, @@ -24639,9 +24836,8 @@ func schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -25014,9 +25210,8 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -25030,9 +25225,8 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -25055,8 +25249,7 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.OwnerReference{}.OpenAPIModelName()), + Ref: ref(metav1.OwnerReference{}.OpenAPIModelName()), }, }, }, @@ -25075,9 +25268,8 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -25095,8 +25287,7 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.ManagedFieldsEntry{}.OpenAPIModelName()), + Ref: ref(metav1.ManagedFieldsEntry{}.OpenAPIModelName()), }, }, }, @@ -25246,8 +25437,7 @@ func schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.PartialObjectMetadata{}.OpenAPIModelName()), + Ref: ref(metav1.PartialObjectMetadata{}.OpenAPIModelName()), }, }, }, @@ -25306,9 +25496,8 @@ func schema_pkg_apis_meta_v1_PatchOptions(ref common.ReferenceCallback) common.O Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -25387,9 +25576,8 @@ func schema_pkg_apis_meta_v1_RootPaths(ref common.ReferenceCallback) common.Open Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -25605,8 +25793,7 @@ func schema_pkg_apis_meta_v1_StatusDetails(ref common.ReferenceCallback) common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.StatusCause{}.OpenAPIModelName()), + Ref: ref(metav1.StatusCause{}.OpenAPIModelName()), }, }, }, @@ -25667,8 +25854,7 @@ func schema_pkg_apis_meta_v1_Table(ref common.ReferenceCallback) common.OpenAPID Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.TableColumnDefinition{}.OpenAPIModelName()), + Ref: ref(metav1.TableColumnDefinition{}.OpenAPIModelName()), }, }, }, @@ -25686,8 +25872,7 @@ func schema_pkg_apis_meta_v1_Table(ref common.ReferenceCallback) common.OpenAPID Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.TableRow{}.OpenAPIModelName()), + Ref: ref(metav1.TableRow{}.OpenAPIModelName()), }, }, }, @@ -25828,8 +26013,7 @@ func schema_pkg_apis_meta_v1_TableRow(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.TableRowCondition{}.OpenAPIModelName()), + Ref: ref(metav1.TableRowCondition{}.OpenAPIModelName()), }, }, }, @@ -25996,9 +26180,8 @@ func schema_pkg_apis_meta_v1_UpdateOptions(ref common.ReferenceCallback) common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -26057,7 +26240,7 @@ func schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref common.ReferenceCall return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.Object `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// External package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// On the wire, the JSON will look something like this:\n\n\t{\n\t\t\"kind\":\"MyAPIObject\",\n\t\t\"apiVersion\":\"v1\",\n\t\t\"myPlugin\": {\n\t\t\t\"kind\":\"PluginA\",\n\t\t\t\"aOption\":\"foo\",\n\t\t},\n\t}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)", + Description: "RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\"\"`\n\t\tMyPlugin runtime.Object `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// External package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\"\"`\n\t\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// On the wire, the JSON will look something like this:\n\n\t{\n\t\t\"kind\":\"MyAPIObject\",\n\t\t\"apiVersion\":\"v1\",\n\t\t\"myPlugin\": {\n\t\t\t\"kind\":\"PluginA\",\n\t\t\t\"aOption\":\"foo\",\n\t\t},\n\t}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)", Type: []string{"object"}, }, }, @@ -26068,7 +26251,7 @@ func schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref common.ReferenceCallback return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "TypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type, like this:\n\n\ttype MyAwesomeAPIObject struct {\n\t runtime.TypeMeta `json:\",inline\"`\n\t ... // other fields\n\t}\n\nfunc (obj *MyAwesomeAPIObject) SetGroupVersionKind(gvk *metav1.GroupVersionKind) { metav1.UpdateTypeMeta(obj,gvk) }; GroupVersionKind() *GroupVersionKind\n\nTypeMeta is provided here for convenience. You may use it directly from this package or define your own with the same fields.", + Description: "TypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type, like this:\n\n\ttype MyAwesomeAPIObject struct {\n\t runtime.TypeMeta `json:\"\"`\n\t ... // other fields\n\t}\n\nfunc (obj *MyAwesomeAPIObject) SetGroupVersionKind(gvk *metav1.GroupVersionKind) { metav1.UpdateTypeMeta(obj,gvk) }; GroupVersionKind() *GroupVersionKind\n\nTypeMeta is provided here for convenience. You may use it directly from this package or define your own with the same fields.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "apiVersion": {