update ocm packages to latest (#953)

Signed-off-by: Qing Hao <qhao@redhat.com>
This commit is contained in:
Qing Hao
2025-04-16 22:58:06 +08:00
committed by GitHub
parent 583f806c20
commit 983bb566b8
217 changed files with 4305 additions and 6459 deletions

View File

@@ -12,6 +12,5 @@ import (
_ "open-cluster-management.io/api/cluster/v1"
_ "open-cluster-management.io/api/cluster/v1alpha1"
_ "open-cluster-management.io/api/cluster/v1beta1"
_ "open-cluster-management.io/api/crdsv1beta1"
_ "open-cluster-management.io/api/work/v1"
)

View File

@@ -269,8 +269,8 @@ spec:
- csr
- awsirsa
type: string
awsisra:
description: AwsIrsa represents the configuration for awsisra
awsirsa:
description: AwsIrsa represents the configuration for awsirsa
driver.
properties:
autoApprovedIdentities:
@@ -303,6 +303,8 @@ spec:
type: string
type: array
type: object
required:
- authType
type: object
type: array
x-kubernetes-list-map-keys:
@@ -328,11 +330,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
@@ -343,6 +343,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
request:
description: |-
Request is the name chosen for a request in the referenced claim.
If empty, everything from the claim is made available, otherwise
only the result of this request.
type: string
required:
- name
type: object
@@ -429,7 +435,6 @@ spec:
config.yaml: |
<driver-config-in-yaml>
For detailed driver configuration, please refer to the sdk-go documentation: https://github.com/open-cluster-management-io/sdk-go/blob/main/pkg/cloudevents/README.md#supported-protocols-and-drivers
enum:
- kube
@@ -457,16 +462,8 @@ spec:
Degraded: Components in hub do not match the desired configuration and only provide
degraded service.
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -507,12 +504,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -556,6 +548,12 @@ spec:
description: version is the version of the resource that you're
tracking
type: string
required:
- group
- lastGeneration
- name
- resource
- version
type: object
type: array
observedGeneration:
@@ -587,6 +585,11 @@ spec:
version:
description: version is the version of the thing you're tracking
type: string
required:
- group
- name
- resource
- version
type: object
type: array
type: object

View File

@@ -269,8 +269,8 @@ spec:
- csr
- awsirsa
type: string
awsisra:
description: AwsIrsa represents the configuration for awsisra
awsirsa:
description: AwsIrsa represents the configuration for awsirsa
driver.
properties:
autoApprovedIdentities:
@@ -303,6 +303,8 @@ spec:
type: string
type: array
type: object
required:
- authType
type: object
type: array
x-kubernetes-list-map-keys:
@@ -328,11 +330,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
@@ -343,6 +343,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
request:
description: |-
Request is the name chosen for a request in the referenced claim.
If empty, everything from the claim is made available, otherwise
only the result of this request.
type: string
required:
- name
type: object
@@ -429,7 +435,6 @@ spec:
config.yaml: |
<driver-config-in-yaml>
For detailed driver configuration, please refer to the sdk-go documentation: https://github.com/open-cluster-management-io/sdk-go/blob/main/pkg/cloudevents/README.md#supported-protocols-and-drivers
enum:
- kube
@@ -457,16 +462,8 @@ spec:
Degraded: Components in hub do not match the desired configuration and only provide
degraded service.
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -507,12 +504,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -556,6 +548,12 @@ spec:
description: version is the version of the resource that you're
tracking
type: string
required:
- group
- lastGeneration
- name
- resource
- version
type: object
type: array
observedGeneration:
@@ -587,6 +585,11 @@ spec:
version:
description: version is the version of the thing you're tracking
type: string
required:
- group
- name
- resource
- version
type: object
type: array
type: object

View File

@@ -59,7 +59,7 @@ metadata:
categories: Integration & Delivery,OpenShift Optional
certified: "false"
containerImage: quay.io/open-cluster-management/registration-operator:latest
createdAt: "2025-03-05T16:39:23Z"
createdAt: "2025-04-16T09:20:17Z"
description: Manages the installation and upgrade of the ClusterManager.
operators.operatorframework.io/builder: operator-sdk-v1.32.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3

View File

@@ -269,8 +269,8 @@ spec:
- csr
- awsirsa
type: string
awsisra:
description: AwsIrsa represents the configuration for awsisra
awsirsa:
description: AwsIrsa represents the configuration for awsirsa
driver.
properties:
autoApprovedIdentities:
@@ -303,6 +303,8 @@ spec:
type: string
type: array
type: object
required:
- authType
type: object
type: array
x-kubernetes-list-map-keys:
@@ -328,11 +330,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
@@ -343,6 +343,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
request:
description: |-
Request is the name chosen for a request in the referenced claim.
If empty, everything from the claim is made available, otherwise
only the result of this request.
type: string
required:
- name
type: object
@@ -429,7 +435,6 @@ spec:
config.yaml: |
<driver-config-in-yaml>
For detailed driver configuration, please refer to the sdk-go documentation: https://github.com/open-cluster-management-io/sdk-go/blob/main/pkg/cloudevents/README.md#supported-protocols-and-drivers
enum:
- kube
@@ -457,16 +462,8 @@ spec:
Degraded: Components in hub do not match the desired configuration and only provide
degraded service.
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -507,12 +504,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -556,6 +548,12 @@ spec:
description: version is the version of the resource that you're
tracking
type: string
required:
- group
- lastGeneration
- name
- resource
- version
type: object
type: array
observedGeneration:
@@ -587,6 +585,11 @@ spec:
version:
description: version is the version of the thing you're tracking
type: string
required:
- group
- name
- resource
- version
type: object
type: array
type: object

View File

@@ -83,6 +83,8 @@ spec:
description: URL is the url of apiserver endpoint of the managed
cluster.
type: string
required:
- url
type: object
type: array
hubApiServerHostAlias:
@@ -187,11 +189,9 @@ spec:
description: |-
BootstrapKubeConfigs defines the ordered list of bootstrap kubeconfigs. The order decides which bootstrap kubeconfig to use first when rebootstrap.
When the agent loses the connection to the current hub over HubConnectionTimeoutSeconds, or the managedcluster CR
is set `hubAcceptsClient=false` on the hub, the controller marks the related bootstrap kubeconfig as "failed".
A failed bootstrapkubeconfig won't be used for the duration specified by SkipFailedBootstrapKubeConfigSeconds.
But if the user updates the content of a failed bootstrapkubeconfig, the "failed" mark will be cleared.
properties:
@@ -218,8 +218,12 @@ spec:
name:
description: Name is the name of the secret.
type: string
required:
- name
type: object
type: array
required:
- kubeConfigSecrets
type: object
type:
default: None
@@ -230,6 +234,8 @@ spec:
- None
- LocalSecrets
type: string
required:
- type
type: object
clientCertExpirationSeconds:
description: |-
@@ -322,7 +328,12 @@ spec:
minLength: 1
pattern: ^arn:aws:eks:([a-zA-Z0-9-]+):(\d{12}):cluster/([a-zA-Z0-9-]+)$
type: string
required:
- hubClusterArn
- managedClusterArn
type: object
required:
- authType
type: object
type: object
registrationImagePullSpec:
@@ -344,11 +355,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
@@ -359,6 +368,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
request:
description: |-
Request is the name chosen for a request in the referenced claim.
If empty, everything from the claim is made available, otherwise
only the result of this request.
type: string
required:
- name
type: object
@@ -473,16 +488,8 @@ spec:
Degraded: Components in the managed cluster do not match the desired configuration and only provide
degraded service.
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -523,12 +530,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -572,6 +574,12 @@ spec:
description: version is the version of the resource that you're
tracking
type: string
required:
- group
- lastGeneration
- name
- resource
- version
type: object
type: array
observedGeneration:
@@ -603,6 +611,11 @@ spec:
version:
description: version is the version of the thing you're tracking
type: string
required:
- group
- name
- resource
- version
type: object
type: array
type: object

View File

@@ -83,6 +83,8 @@ spec:
description: URL is the url of apiserver endpoint of the managed
cluster.
type: string
required:
- url
type: object
type: array
hubApiServerHostAlias:
@@ -187,11 +189,9 @@ spec:
description: |-
BootstrapKubeConfigs defines the ordered list of bootstrap kubeconfigs. The order decides which bootstrap kubeconfig to use first when rebootstrap.
When the agent loses the connection to the current hub over HubConnectionTimeoutSeconds, or the managedcluster CR
is set `hubAcceptsClient=false` on the hub, the controller marks the related bootstrap kubeconfig as "failed".
A failed bootstrapkubeconfig won't be used for the duration specified by SkipFailedBootstrapKubeConfigSeconds.
But if the user updates the content of a failed bootstrapkubeconfig, the "failed" mark will be cleared.
properties:
@@ -218,8 +218,12 @@ spec:
name:
description: Name is the name of the secret.
type: string
required:
- name
type: object
type: array
required:
- kubeConfigSecrets
type: object
type:
default: None
@@ -230,6 +234,8 @@ spec:
- None
- LocalSecrets
type: string
required:
- type
type: object
clientCertExpirationSeconds:
description: |-
@@ -322,7 +328,12 @@ spec:
minLength: 1
pattern: ^arn:aws:eks:([a-zA-Z0-9-]+):(\d{12}):cluster/([a-zA-Z0-9-]+)$
type: string
required:
- hubClusterArn
- managedClusterArn
type: object
required:
- authType
type: object
type: object
registrationImagePullSpec:
@@ -344,11 +355,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
@@ -359,6 +368,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
request:
description: |-
Request is the name chosen for a request in the referenced claim.
If empty, everything from the claim is made available, otherwise
only the result of this request.
type: string
required:
- name
type: object
@@ -473,16 +488,8 @@ spec:
Degraded: Components in the managed cluster do not match the desired configuration and only provide
degraded service.
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -523,12 +530,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -572,6 +574,12 @@ spec:
description: version is the version of the resource that you're
tracking
type: string
required:
- group
- lastGeneration
- name
- resource
- version
type: object
type: array
observedGeneration:
@@ -603,6 +611,11 @@ spec:
version:
description: version is the version of the thing you're tracking
type: string
required:
- group
- name
- resource
- version
type: object
type: array
type: object

View File

@@ -31,7 +31,7 @@ metadata:
categories: Integration & Delivery,OpenShift Optional
certified: "false"
containerImage: quay.io/open-cluster-management/registration-operator:latest
createdAt: "2025-03-05T16:39:23Z"
createdAt: "2025-04-16T09:20:17Z"
description: Manages the installation and upgrade of the Klusterlet.
operators.operatorframework.io/builder: operator-sdk-v1.32.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3

View File

@@ -83,6 +83,8 @@ spec:
description: URL is the url of apiserver endpoint of the managed
cluster.
type: string
required:
- url
type: object
type: array
hubApiServerHostAlias:
@@ -187,11 +189,9 @@ spec:
description: |-
BootstrapKubeConfigs defines the ordered list of bootstrap kubeconfigs. The order decides which bootstrap kubeconfig to use first when rebootstrap.
When the agent loses the connection to the current hub over HubConnectionTimeoutSeconds, or the managedcluster CR
is set `hubAcceptsClient=false` on the hub, the controller marks the related bootstrap kubeconfig as "failed".
A failed bootstrapkubeconfig won't be used for the duration specified by SkipFailedBootstrapKubeConfigSeconds.
But if the user updates the content of a failed bootstrapkubeconfig, the "failed" mark will be cleared.
properties:
@@ -218,8 +218,12 @@ spec:
name:
description: Name is the name of the secret.
type: string
required:
- name
type: object
type: array
required:
- kubeConfigSecrets
type: object
type:
default: None
@@ -230,6 +234,8 @@ spec:
- None
- LocalSecrets
type: string
required:
- type
type: object
clientCertExpirationSeconds:
description: |-
@@ -322,7 +328,12 @@ spec:
minLength: 1
pattern: ^arn:aws:eks:([a-zA-Z0-9-]+):(\d{12}):cluster/([a-zA-Z0-9-]+)$
type: string
required:
- hubClusterArn
- managedClusterArn
type: object
required:
- authType
type: object
type: object
registrationImagePullSpec:
@@ -344,11 +355,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
@@ -359,6 +368,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
request:
description: |-
Request is the name chosen for a request in the referenced claim.
If empty, everything from the claim is made available, otherwise
only the result of this request.
type: string
required:
- name
type: object
@@ -473,16 +488,8 @@ spec:
Degraded: Components in the managed cluster do not match the desired configuration and only provide
degraded service.
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -523,12 +530,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -572,6 +574,12 @@ spec:
description: version is the version of the resource that you're
tracking
type: string
required:
- group
- lastGeneration
- name
- resource
- version
type: object
type: array
observedGeneration:
@@ -603,6 +611,11 @@ spec:
version:
description: version is the version of the thing you're tracking
type: string
required:
- group
- name
- resource
- version
type: object
type: array
type: object

14
go.mod
View File

@@ -35,17 +35,17 @@ require (
k8s.io/klog/v2 v2.130.1
k8s.io/kube-aggregator v0.32.1
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738
open-cluster-management.io/addon-framework v0.12.1-0.20250401143304-75b65b5f45e0
open-cluster-management.io/api v0.16.1
open-cluster-management.io/sdk-go v0.16.1-0.20250327091909-6bd6228a47ad
open-cluster-management.io/addon-framework v0.12.1-0.20250407131028-9d436ffc2da7
open-cluster-management.io/api v0.16.2-0.20250416130057-11622a5f2170
open-cluster-management.io/sdk-go v0.16.1-0.20250411154302-3a424961ead4
sigs.k8s.io/cluster-inventory-api v0.0.0-20240730014211-ef0154379848
sigs.k8s.io/controller-runtime v0.19.3
sigs.k8s.io/controller-runtime v0.20.2
sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96
sigs.k8s.io/yaml v1.4.0
)
require (
cel.dev/expr v0.18.0 // indirect
cel.dev/expr v0.19.1 // indirect
cloud.google.com/go/compute/metadata v0.5.0 // indirect
dario.cat/mergo v1.0.1 // indirect
github.com/BurntSushi/toml v1.4.0 // indirect
@@ -81,7 +81,7 @@ require (
github.com/docker/docker v27.1.2+incompatible // indirect
github.com/eclipse/paho.golang v0.21.0 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/felixge/fgprof v0.9.4 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
@@ -97,7 +97,7 @@ require (
github.com/gobwas/glob v0.2.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/cel-go v0.22.0 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect

32
go.sum
View File

@@ -1,5 +1,5 @@
cel.dev/expr v0.18.0 h1:CJ6drgk+Hf96lkLikr4rFf19WrU0BOWEihyZnI2TAzo=
cel.dev/expr v0.18.0/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw=
cel.dev/expr v0.19.1 h1:NciYrtDRIR0lNCnH1LFJegdjspNx9fI59O7TWcua/W4=
cel.dev/expr v0.19.1/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw=
cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY=
cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY=
dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
@@ -117,8 +117,8 @@ github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxER
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/evanphx/json-patch v5.9.11+incompatible h1:ixHHqfcGvxhWkniF1tWxBHA0yb4Z+d1UQi45df52xW8=
github.com/evanphx/json-patch v5.9.11+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg=
github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ=
github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU=
github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM=
github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw=
@@ -163,8 +163,8 @@ github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOW
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA=
github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg=
github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
github.com/google/cel-go v0.22.0 h1:b3FJZxpiv1vTMo2/5RDUqAHPxkT8mmMfJIrq1llbf7g=
github.com/google/cel-go v0.22.0/go.mod h1:BuznPXXfQDpXKWQ9sPW3TzlAJN5zzFe+i9tIs0yC4s8=
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
@@ -435,8 +435,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ=
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro=
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y=
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s=
google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7 h1:YcyjlL1PRr2Q17/I0dPk2JmYS5CDXfcdb2Z3YRioEbw=
google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7/go.mod h1:OCdP9MfskevB/rbYvHTsXTtKC+3bHWajPdoKgjcYkfo=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ=
@@ -485,18 +485,18 @@ k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJ
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4=
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro=
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
open-cluster-management.io/addon-framework v0.12.1-0.20250401143304-75b65b5f45e0 h1:1gK9/3EkjYlXwrGLlF8i/wOAJfU6gzg4b9Zje+umIJY=
open-cluster-management.io/addon-framework v0.12.1-0.20250401143304-75b65b5f45e0/go.mod h1:eReMWXrEHqtilwz5wzEpUrWw9Vfz0HJCH9pi3gOTZns=
open-cluster-management.io/api v0.16.1 h1:mS+4UGxHLPQd7CRM0gdFQdVaz139Lo2bkLfqSE0CDNU=
open-cluster-management.io/api v0.16.1/go.mod h1:9erZEWEn4bEqh0nIX2wA7f/s3KCuFycQdBrPrRzi0QM=
open-cluster-management.io/sdk-go v0.16.1-0.20250327091909-6bd6228a47ad h1:37f9TEwX/U8esBjSJvPleDM3rcFpk9NY5e2ItjO6PcQ=
open-cluster-management.io/sdk-go v0.16.1-0.20250327091909-6bd6228a47ad/go.mod h1:TyOjZC5YxyM5BRNgwTmLuTbHXX6xXqzYBXllrfoVp9w=
open-cluster-management.io/addon-framework v0.12.1-0.20250407131028-9d436ffc2da7 h1:oLu9ag44Msf56Hb19b/b+UTNq0J2l9rhlBQ1gh7izCU=
open-cluster-management.io/addon-framework v0.12.1-0.20250407131028-9d436ffc2da7/go.mod h1:7AEw1Sq9UEWpQGTU8zV1XPNkFRBYPbyBh8tfhISV++s=
open-cluster-management.io/api v0.16.2-0.20250416130057-11622a5f2170 h1:SFtPxSCIPwDEv4iXNb4CiwjkT1gLdk6bPJGeFaKv6Ho=
open-cluster-management.io/api v0.16.2-0.20250416130057-11622a5f2170/go.mod h1:/OeqXycNBZQoe3WG6ghuWsMgsKGuMZrK8ZpsU6gWL0Y=
open-cluster-management.io/sdk-go v0.16.1-0.20250411154302-3a424961ead4 h1:PT6kDaKjDi0EaQyNzIWzYAYeK4QpBHbm+/7VPrpJEkY=
open-cluster-management.io/sdk-go v0.16.1-0.20250411154302-3a424961ead4/go.mod h1:FtOYjn5dL8e9S1gzNb8cBNsFzHJ1F3cpmCo+qrltido=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 h1:CPT0ExVicCzcpeN4baWEV2ko2Z/AsiZgEdwgcfwLgMo=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
sigs.k8s.io/cluster-inventory-api v0.0.0-20240730014211-ef0154379848 h1:WYPi2PdQyZwZkHG648v2jQl6deyCgyjJ0fkLYgUJ618=
sigs.k8s.io/cluster-inventory-api v0.0.0-20240730014211-ef0154379848/go.mod h1:/aN4e7RWOMHgT4xAjCNkV4YFcpKfpZCeumMIL7S+KNM=
sigs.k8s.io/controller-runtime v0.19.3 h1:XO2GvC9OPftRst6xWCpTgBZO04S2cbp0Qqkj8bX1sPw=
sigs.k8s.io/controller-runtime v0.19.3/go.mod h1:j4j87DqtsThvwTv5/Tc5NFRyyF/RF0ip4+62tbTSIUM=
sigs.k8s.io/controller-runtime v0.20.2 h1:/439OZVxoEc02psi1h4QO3bHzTgu49bb347Xp4gW1pc=
sigs.k8s.io/controller-runtime v0.20.2/go.mod h1:xg2XB0K5ShQzAgsoujxuKN4LNXR2LfwwHsPj7Iaw+XY=
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8=
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo=
sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96 h1:PFWFSkpArPNJxFX4ZKWAk9NSeRoZaXschn+ULa4xVek=

View File

@@ -468,18 +468,8 @@ spec:
description: conditions describe the state of the managed and
monitored components for the operator.
items:
description: "Condition contains details for one aspect of
the current state of this API Resource.\n---\nThis struct
is intended for direct use as an array at the field path
.status.conditions. For example,\n\n\n\ttype FooStatus
struct{\n\t // Represents the observations of a foo's
current state.\n\t // Known .status.conditions.type are:
\"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t //
+listType=map\n\t // +listMapKey=type\n\t Conditions
[]metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\"
patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of
the current state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -521,12 +511,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -634,6 +619,8 @@ spec:
type: object
type: array
type: object
required:
- spec
type: object
served: true
storage: true

View File

@@ -39,17 +39,14 @@ spec:
of a managed cluster. ManagedCluster is a cluster-scoped resource. The name
is the cluster UID.
The cluster join process is a double opt-in process. See the following join process steps:
1. The agent on the managed cluster creates a CSR on the hub with the cluster UID and agent name.
2. The agent on the managed cluster creates a ManagedCluster on the hub.
3. The cluster admin on the hub cluster approves the CSR for the UID and agent name of the ManagedCluster.
4. The cluster admin sets the spec.acceptClient of the ManagedCluster to true.
5. The cluster admin on the managed cluster creates a credential of the kubeconfig for the hub cluster.
After the hub cluster creates the cluster namespace, the klusterlet agent on the ManagedCluster pushes
the credential to the hub cluster to use against the kube-apiserver of the ManagedCluster.
properties:
@@ -98,9 +95,8 @@ spec:
ManagedClusterClientConfigs represents a list of the apiserver address of the managed cluster.
If it is empty, the managed cluster has no accessible address for the hub to connect with it.
items:
description: |-
ClientConfig represents the apiserver address of the managed cluster.
TODO include credential to connect to managed cluster kube-apiserver
description: ClientConfig represents the apiserver address of the
managed cluster.
properties:
caBundle:
description: |-
@@ -112,6 +108,8 @@ spec:
description: URL is the URL of apiserver endpoint of the managed
cluster.
type: string
required:
- url
type: object
type: array
taints:
@@ -156,6 +154,8 @@ spec:
- key
type: object
type: array
required:
- hubAcceptsClient
type: object
status:
description: Status represents the current status of joined managed cluster
@@ -210,16 +210,8 @@ spec:
description: Conditions contains the different condition statuses
for this managed cluster.
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -260,12 +252,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string

View File

@@ -32,7 +32,6 @@ spec:
- The workload cannot run on any ManagedCluster outside the ManagedClusterSet
- The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet
To assign a ManagedCluster to a certain ManagedClusterSet, add a label with the name cluster.open-cluster-management.io/clusterset
on the ManagedCluster to refer to the ManagedClusterSet. You are not
allowed to add or remove this label on a ManagedCluster unless you have an
@@ -125,6 +124,8 @@ spec:
- ExclusiveClusterSetLabel
- LabelSelector
type: string
required:
- selectorType
type: object
type: object
status:
@@ -134,16 +135,8 @@ spec:
description: Conditions contains the different condition statuses
for this ManagedClusterSet.
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -184,12 +177,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string

View File

@@ -594,16 +594,8 @@ spec:
1. AppliedManifestWorks represents ManifestWorks have been distributed as per placement All, Partial, None, Problem
2. PlacementRefValid
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -644,12 +636,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -688,12 +675,8 @@ spec:
condition Available: true'
type: integer
degraded:
description: 'TODO: Degraded is the number of ManifestWorks
with condition Degraded: true'
type: integer
progressing:
description: 'TODO: Progressing is the number of ManifestWorks
with condition Progressing: true'
type: integer
total:
description: Total number of ManifestWorks managed by the
@@ -714,12 +697,8 @@ spec:
Available: true'
type: integer
degraded:
description: 'TODO: Degraded is the number of ManifestWorks with
condition Degraded: true'
type: integer
progressing:
description: 'TODO: Progressing is the number of ManifestWorks
with condition Progressing: true'
type: integer
total:
description: Total number of ManifestWorks managed by the ManifestWorkReplicaSet

View File

@@ -336,16 +336,8 @@ spec:
4. Degraded represents the current state of workload does not match the desired
state for a certain period.
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -386,12 +378,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -426,18 +413,8 @@ spec:
description: Conditions represents the conditions of this
resource on a managed cluster.
items:
description: "Condition contains details for one aspect
of the current state of this API Resource.\n---\nThis
struct is intended for direct use as an array at the
field path .status.conditions. For example,\n\n\n\ttype
FooStatus struct{\n\t // Represents the observations
of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t
\ // +patchMergeKey=type\n\t // +patchStrategy=merge\n\t
\ // +listType=map\n\t // +listMapKey=type\n\t
\ Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect
of the current state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -479,12 +456,8 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in
foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -527,6 +500,8 @@ spec:
description: Version is the version of the Kubernetes
resource.
type: string
required:
- ordinal
type: object
statusFeedback:
description: StatusFeedback represents the values of the
@@ -586,6 +561,9 @@ spec:
- name
x-kubernetes-list-type: map
type: object
required:
- conditions
- resourceMeta
type: object
type: array
type: object

View File

@@ -137,16 +137,8 @@ spec:
description: conditions describe the state of the managed and monitored
components for the operator.
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -187,12 +179,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -344,6 +331,8 @@ spec:
description: user is the user name of the addon agent.
type: string
type: object
required:
- signerName
type: object
type: array
relatedObjects:

View File

@@ -61,16 +61,8 @@ spec:
description: Conditions contains the different condition statuses
for this ManagedClusterSetBinding.
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -111,12 +103,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string

View File

@@ -160,7 +160,6 @@ spec:
the following example will override image "quay.io/open-cluster-management/addon-agent" to
"quay.io/ocm/addon-agent" when deploying the addon agent
registries:
- source: quay.io/open-cluster-management/addon-agent
mirror: quay.io/ocm/addon-agent
@@ -207,11 +206,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
@@ -222,6 +219,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
request:
description: |-
Request is the name chosen for a request in the referenced claim.
If empty, everything from the claim is made available, otherwise
only the result of this request.
type: string
required:
- name
type: object
@@ -263,6 +266,8 @@ spec:
- containerID
x-kubernetes-list-type: map
type: object
required:
- spec
type: object
served: true
storage: true

View File

@@ -29,7 +29,6 @@ spec:
Placement defines a rule to select a set of ManagedClusters from the ManagedClusterSets bound
to the placement namespace.
Here is how the placement policy combines with other selection methods to determine a matching
list of ManagedClusters:
1. Kubernetes clusters are registered with hub as cluster-scoped ManagedClusters;
@@ -39,17 +38,14 @@ spec:
of potential ManagedClusters;
5. Then Placements subselect from that working set using label/claim selection.
A ManagedCluster will not be selected if no ManagedClusterSet is bound to the placement
namespace. A user is able to bind a ManagedClusterSet to a namespace by creating a
ManagedClusterSetBinding in that namespace if they have an RBAC rule to CREATE on the virtual
subresource of `managedclustersets/bind`.
A slice of PlacementDecisions with the label cluster.open-cluster-management.io/placement={placement name}
will be created to represent the ManagedClusters selected by this placement.
If a ManagedCluster is selected and added into the PlacementDecisions, other components may
apply workload on it; once it is removed from the PlacementDecisions, the workload applied on
this ManagedCluster should be evicted accordingly.
@@ -106,7 +102,6 @@ spec:
to 5 groups each group should have 20 clusters.
Default is having all clusters in a single group.
The predefined decisionGroups is expected to be a subset of the selected clusters and the number of items in each
group SHOULD be less than ClustersPerDecisionGroup. Once the number of items exceeds the ClustersPerDecisionGroup,
the decisionGroups will also be be divided into multiple decisionGroups with same GroupName but different GroupIndex.
@@ -126,6 +121,16 @@ spec:
description: LabelSelector to select clusters subset
by label.
properties:
celSelector:
description: CelSelector represents a selector of
ManagedClusters by CEL expressions on ManagedCluster
fields
properties:
celExpressions:
items:
type: string
type: array
type: object
claimSelector:
description: ClaimSelector represents a selector
of ManagedClusters by clusterClaims in status
@@ -256,6 +261,15 @@ spec:
3) If a ManagedCluster (not selected previously) starts to match the selector, it will either
be selected or at least has a chance to be selected (when NumberOfClusters is specified);
properties:
celSelector:
description: CelSelector represents a selector of ManagedClusters
by CEL expressions on ManagedCluster fields
properties:
celExpressions:
items:
type: string
type: array
type: object
claimSelector:
description: ClaimSelector represents a selector of ManagedClusters
by clusterClaims in status
@@ -543,16 +557,8 @@ spec:
description: Conditions contains the different condition status for
this Placement.
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -593,12 +599,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string

View File

@@ -24,7 +24,6 @@ spec:
AddOnTemplate is the Custom Resource object, it is used to describe
how to deploy the addon agent and how to register the addon.
AddOnTemplate is a cluster-scoped resource, and will only be used
on the hub cluster.
properties:
@@ -414,6 +413,7 @@ spec:
type: string
type: object
required:
- signerName
- signingCA
type: object
kubeClient:

View File

@@ -19,13 +19,11 @@ spec:
PlacementDecision indicates a decision from a placement.
PlacementDecision must have a cluster.open-cluster-management.io/placement={placement name} label to reference a certain placement.
If a placement has spec.numberOfClusters specified, the total number of decisions contained in
the status.decisions of PlacementDecisions must be the same as NumberOfClusters. Otherwise, the
total number of decisions must equal the number of ManagedClusters that
match the placement requirements.
Some of the decisions might be empty when there are not enough ManagedClusters to meet the placement requirements.
properties:
apiVersion:

View File

@@ -43,16 +43,8 @@ spec:
description: Conditions contain the different condition statuses for
this AddOnPlacementScore.
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -93,12 +85,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string

View File

@@ -57,6 +57,9 @@ spec:
description: ManifestWorkName represents the name of the related manifestwork
on the hub.
type: string
required:
- hubHash
- manifestWorkName
type: object
status:
description: Status represents the current status of AppliedManifestWork.

View File

@@ -22,7 +22,6 @@ spec:
2. clusterset.k8s.io, it contains an identifier that relates the cluster
to the ClusterSet in which it belongs.
ClusterClaims created on a managed cluster will be collected and saved into
the status of the corresponding ManagedCluster on hub.
properties:

View File

@@ -44,7 +44,7 @@ var _ = Describe("Deploy Klusterlet with Multiplehubs enabled", func() {
},
BootstrapKubeConfigs: operatorapiv1.BootstrapKubeConfigs{
Type: operatorapiv1.LocalSecrets,
LocalSecrets: operatorapiv1.LocalSecretsConfig{
LocalSecrets: &operatorapiv1.LocalSecretsConfig{
KubeConfigSecrets: []operatorapiv1.KubeConfigSecret{
{
Name: boostrapKubeConfigSecretHub1,

View File

@@ -103,8 +103,8 @@ func pruneAryNulls(ary *partialArray, options *ApplyOptions) *partialArray {
return ary
}
var errBadJSONDoc = fmt.Errorf("Invalid JSON Document")
var errBadJSONPatch = fmt.Errorf("Invalid JSON Patch")
var ErrBadJSONDoc = fmt.Errorf("Invalid JSON Document")
var ErrBadJSONPatch = fmt.Errorf("Invalid JSON Patch")
var errBadMergeTypes = fmt.Errorf("Mismatched JSON Documents")
// MergeMergePatches merges two merge patches together, such that
@@ -121,11 +121,11 @@ func MergePatch(docData, patchData []byte) ([]byte, error) {
func doMergePatch(docData, patchData []byte, mergeMerge bool) ([]byte, error) {
if !json.Valid(docData) {
return nil, errBadJSONDoc
return nil, ErrBadJSONDoc
}
if !json.Valid(patchData) {
return nil, errBadJSONPatch
return nil, ErrBadJSONPatch
}
options := NewApplyOptions()
@@ -143,7 +143,7 @@ func doMergePatch(docData, patchData []byte, mergeMerge bool) ([]byte, error) {
patchErr := patch.UnmarshalJSON(patchData)
if isSyntaxError(docErr) {
return nil, errBadJSONDoc
return nil, ErrBadJSONDoc
}
if isSyntaxError(patchErr) {
@@ -151,7 +151,7 @@ func doMergePatch(docData, patchData []byte, mergeMerge bool) ([]byte, error) {
}
if docErr == nil && doc.obj == nil {
return nil, errBadJSONDoc
return nil, ErrBadJSONDoc
}
if patchErr == nil && patch.obj == nil {
@@ -175,7 +175,7 @@ func doMergePatch(docData, patchData []byte, mergeMerge bool) ([]byte, error) {
if json.Valid(patchData) {
return patchData, nil
}
return nil, errBadJSONPatch
return nil, ErrBadJSONPatch
}
pruneAryNulls(patchAry, options)
@@ -183,7 +183,7 @@ func doMergePatch(docData, patchData []byte, mergeMerge bool) ([]byte, error) {
out, patchErr := json.Marshal(patchAry.nodes)
if patchErr != nil {
return nil, errBadJSONPatch
return nil, ErrBadJSONPatch
}
return out, nil
@@ -256,12 +256,12 @@ func createObjectMergePatch(originalJSON, modifiedJSON []byte) ([]byte, error) {
err := unmarshal(originalJSON, &originalDoc)
if err != nil {
return nil, errBadJSONDoc
return nil, ErrBadJSONDoc
}
err = unmarshal(modifiedJSON, &modifiedDoc)
if err != nil {
return nil, errBadJSONDoc
return nil, ErrBadJSONDoc
}
dest, err := getDiff(originalDoc, modifiedDoc)
@@ -286,17 +286,17 @@ func createArrayMergePatch(originalJSON, modifiedJSON []byte) ([]byte, error) {
err := unmarshal(originalJSON, &originalDocs)
if err != nil {
return nil, errBadJSONDoc
return nil, ErrBadJSONDoc
}
err = unmarshal(modifiedJSON, &modifiedDocs)
if err != nil {
return nil, errBadJSONDoc
return nil, ErrBadJSONDoc
}
total := len(originalDocs)
if len(modifiedDocs) != total {
return nil, errBadJSONDoc
return nil, ErrBadJSONDoc
}
result := []json.RawMessage{}

View File

@@ -2,13 +2,13 @@ package jsonpatch
import (
"bytes"
"errors"
"fmt"
"strconv"
"strings"
"unicode"
"github.com/evanphx/json-patch/v5/internal/json"
"github.com/pkg/errors"
)
const (
@@ -461,7 +461,7 @@ func (o Operation) Path() (string, error) {
return op, nil
}
return "unknown", errors.Wrapf(ErrMissing, "operation missing path field")
return "unknown", fmt.Errorf("operation missing path field: %w", ErrMissing)
}
// From reads the "from" field of the Operation.
@@ -478,7 +478,7 @@ func (o Operation) From() (string, error) {
return op, nil
}
return "unknown", errors.Wrapf(ErrMissing, "operation, missing from field")
return "unknown", fmt.Errorf("operation, missing from field: %w", ErrMissing)
}
func (o Operation) value() *lazyNode {
@@ -511,7 +511,7 @@ func (o Operation) ValueInterface() (interface{}, error) {
return v, nil
}
return nil, errors.Wrapf(ErrMissing, "operation, missing value field")
return nil, fmt.Errorf("operation, missing value field: %w", ErrMissing)
}
func isArray(buf []byte) bool {
@@ -610,7 +610,7 @@ func (d *partialDoc) get(key string, options *ApplyOptions) (*lazyNode, error) {
v, ok := d.obj[key]
if !ok {
return v, errors.Wrapf(ErrMissing, "unable to get nonexistent key: %s", key)
return v, fmt.Errorf("unable to get nonexistent key: %s: %w", key, ErrMissing)
}
return v, nil
}
@@ -625,7 +625,7 @@ func (d *partialDoc) remove(key string, options *ApplyOptions) error {
if options.AllowMissingPathOnRemove {
return nil
}
return errors.Wrapf(ErrMissing, "unable to remove nonexistent key: %s", key)
return fmt.Errorf("unable to remove nonexistent key: %s: %w", key, ErrMissing)
}
idx := -1
for i, k := range d.keys {
@@ -649,10 +649,10 @@ func (d *partialArray) set(key string, val *lazyNode, options *ApplyOptions) err
if idx < 0 {
if !options.SupportNegativeIndices {
return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
return fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
if idx < -len(d.nodes) {
return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
return fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
idx += len(d.nodes)
}
@@ -669,7 +669,7 @@ func (d *partialArray) add(key string, val *lazyNode, options *ApplyOptions) err
idx, err := strconv.Atoi(key)
if err != nil {
return errors.Wrapf(err, "value was not a proper array index: '%s'", key)
return fmt.Errorf("value was not a proper array index: '%s': %w", key, err)
}
sz := len(d.nodes) + 1
@@ -679,15 +679,15 @@ func (d *partialArray) add(key string, val *lazyNode, options *ApplyOptions) err
cur := d
if idx >= len(ary) {
return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
return fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
if idx < 0 {
if !options.SupportNegativeIndices {
return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
return fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
if idx < -len(ary) {
return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
return fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
idx += len(ary)
}
@@ -713,16 +713,16 @@ func (d *partialArray) get(key string, options *ApplyOptions) (*lazyNode, error)
if idx < 0 {
if !options.SupportNegativeIndices {
return nil, errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
return nil, fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
if idx < -len(d.nodes) {
return nil, errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
return nil, fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
idx += len(d.nodes)
}
if idx >= len(d.nodes) {
return nil, errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
return nil, fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
return d.nodes[idx], nil
@@ -740,18 +740,18 @@ func (d *partialArray) remove(key string, options *ApplyOptions) error {
if options.AllowMissingPathOnRemove {
return nil
}
return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
return fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
if idx < 0 {
if !options.SupportNegativeIndices {
return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
return fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
if idx < -len(cur.nodes) {
if options.AllowMissingPathOnRemove {
return nil
}
return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
return fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
idx += len(cur.nodes)
}
@@ -768,7 +768,7 @@ func (d *partialArray) remove(key string, options *ApplyOptions) error {
func (p Patch) add(doc *container, op Operation, options *ApplyOptions) error {
path, err := op.Path()
if err != nil {
return errors.Wrapf(ErrMissing, "add operation failed to decode path")
return fmt.Errorf("add operation failed to decode path: %w", ErrMissing)
}
// special case, adding to empty means replacing the container with the value given
@@ -809,12 +809,12 @@ func (p Patch) add(doc *container, op Operation, options *ApplyOptions) error {
con, key := findObject(doc, path, options)
if con == nil {
return errors.Wrapf(ErrMissing, "add operation does not apply: doc is missing path: \"%s\"", path)
return fmt.Errorf("add operation does not apply: doc is missing path: \"%s\": %w", path, ErrMissing)
}
err = con.add(key, op.value(), options)
if err != nil {
return errors.Wrapf(err, "error in add for path: '%s'", path)
return fmt.Errorf("error in add for path: '%s': %w", path, err)
}
return nil
@@ -867,11 +867,11 @@ func ensurePathExists(pd *container, path string, options *ApplyOptions) error {
if arrIndex < 0 {
if !options.SupportNegativeIndices {
return errors.Wrapf(ErrInvalidIndex, "Unable to ensure path for invalid index: %d", arrIndex)
return fmt.Errorf("Unable to ensure path for invalid index: %d: %w", arrIndex, ErrInvalidIndex)
}
if arrIndex < -1 {
return errors.Wrapf(ErrInvalidIndex, "Unable to ensure path for negative index other than -1: %d", arrIndex)
return fmt.Errorf("Unable to ensure path for negative index other than -1: %d: %w", arrIndex, ErrInvalidIndex)
}
arrIndex = 0
@@ -918,11 +918,11 @@ func validateOperation(op Operation) error {
switch op.Kind() {
case "add", "replace":
if _, err := op.ValueInterface(); err != nil {
return errors.Wrapf(err, "failed to decode 'value'")
return fmt.Errorf("failed to decode 'value': %w", err)
}
case "move", "copy":
if _, err := op.From(); err != nil {
return errors.Wrapf(err, "failed to decode 'from'")
return fmt.Errorf("failed to decode 'from': %w", err)
}
case "remove", "test":
default:
@@ -930,7 +930,7 @@ func validateOperation(op Operation) error {
}
if _, err := op.Path(); err != nil {
return errors.Wrapf(err, "failed to decode 'path'")
return fmt.Errorf("failed to decode 'path': %w", err)
}
return nil
@@ -941,10 +941,10 @@ func validatePatch(p Patch) error {
if err := validateOperation(op); err != nil {
opData, infoErr := json.Marshal(op)
if infoErr != nil {
return errors.Wrapf(err, "invalid operation")
return fmt.Errorf("invalid operation: %w", err)
}
return errors.Wrapf(err, "invalid operation %s", opData)
return fmt.Errorf("invalid operation %s: %w", opData, err)
}
}
@@ -954,7 +954,7 @@ func validatePatch(p Patch) error {
func (p Patch) remove(doc *container, op Operation, options *ApplyOptions) error {
path, err := op.Path()
if err != nil {
return errors.Wrapf(ErrMissing, "remove operation failed to decode path")
return fmt.Errorf("remove operation failed to decode path: %w", ErrMissing)
}
con, key := findObject(doc, path, options)
@@ -963,12 +963,12 @@ func (p Patch) remove(doc *container, op Operation, options *ApplyOptions) error
if options.AllowMissingPathOnRemove {
return nil
}
return errors.Wrapf(ErrMissing, "remove operation does not apply: doc is missing path: \"%s\"", path)
return fmt.Errorf("remove operation does not apply: doc is missing path: \"%s\": %w", path, ErrMissing)
}
err = con.remove(key, options)
if err != nil {
return errors.Wrapf(err, "error in remove for path: '%s'", path)
return fmt.Errorf("error in remove for path: '%s': %w", path, err)
}
return nil
@@ -977,7 +977,7 @@ func (p Patch) remove(doc *container, op Operation, options *ApplyOptions) error
func (p Patch) replace(doc *container, op Operation, options *ApplyOptions) error {
path, err := op.Path()
if err != nil {
return errors.Wrapf(err, "replace operation failed to decode path")
return fmt.Errorf("replace operation failed to decode path: %w", err)
}
if path == "" {
@@ -986,7 +986,7 @@ func (p Patch) replace(doc *container, op Operation, options *ApplyOptions) erro
if val.which == eRaw {
if !val.tryDoc() {
if !val.tryAry() {
return errors.Wrapf(err, "replace operation value must be object or array")
return fmt.Errorf("replace operation value must be object or array: %w", err)
}
} else {
val.doc.opts = options
@@ -999,7 +999,7 @@ func (p Patch) replace(doc *container, op Operation, options *ApplyOptions) erro
case eDoc:
*doc = val.doc
case eRaw:
return errors.Wrapf(err, "replace operation hit impossible case")
return fmt.Errorf("replace operation hit impossible case: %w", err)
}
return nil
@@ -1008,17 +1008,17 @@ func (p Patch) replace(doc *container, op Operation, options *ApplyOptions) erro
con, key := findObject(doc, path, options)
if con == nil {
return errors.Wrapf(ErrMissing, "replace operation does not apply: doc is missing path: %s", path)
return fmt.Errorf("replace operation does not apply: doc is missing path: %s: %w", path, ErrMissing)
}
_, ok := con.get(key, options)
if ok != nil {
return errors.Wrapf(ErrMissing, "replace operation does not apply: doc is missing key: %s", path)
return fmt.Errorf("replace operation does not apply: doc is missing key: %s: %w", path, ErrMissing)
}
err = con.set(key, op.value(), options)
if err != nil {
return errors.Wrapf(err, "error in remove for path: '%s'", path)
return fmt.Errorf("error in remove for path: '%s': %w", path, err)
}
return nil
@@ -1027,43 +1027,43 @@ func (p Patch) replace(doc *container, op Operation, options *ApplyOptions) erro
func (p Patch) move(doc *container, op Operation, options *ApplyOptions) error {
from, err := op.From()
if err != nil {
return errors.Wrapf(err, "move operation failed to decode from")
return fmt.Errorf("move operation failed to decode from: %w", err)
}
if from == "" {
return errors.Wrapf(ErrInvalid, "unable to move entire document to another path")
return fmt.Errorf("unable to move entire document to another path: %w", ErrInvalid)
}
con, key := findObject(doc, from, options)
if con == nil {
return errors.Wrapf(ErrMissing, "move operation does not apply: doc is missing from path: %s", from)
return fmt.Errorf("move operation does not apply: doc is missing from path: %s: %w", from, ErrMissing)
}
val, err := con.get(key, options)
if err != nil {
return errors.Wrapf(err, "error in move for path: '%s'", key)
return fmt.Errorf("error in move for path: '%s': %w", key, err)
}
err = con.remove(key, options)
if err != nil {
return errors.Wrapf(err, "error in move for path: '%s'", key)
return fmt.Errorf("error in move for path: '%s': %w", key, err)
}
path, err := op.Path()
if err != nil {
return errors.Wrapf(err, "move operation failed to decode path")
return fmt.Errorf("move operation failed to decode path: %w", err)
}
con, key = findObject(doc, path, options)
if con == nil {
return errors.Wrapf(ErrMissing, "move operation does not apply: doc is missing destination path: %s", path)
return fmt.Errorf("move operation does not apply: doc is missing destination path: %s: %w", path, ErrMissing)
}
err = con.add(key, val, options)
if err != nil {
return errors.Wrapf(err, "error in move for path: '%s'", path)
return fmt.Errorf("error in move for path: '%s': %w", path, err)
}
return nil
@@ -1072,7 +1072,7 @@ func (p Patch) move(doc *container, op Operation, options *ApplyOptions) error {
func (p Patch) test(doc *container, op Operation, options *ApplyOptions) error {
path, err := op.Path()
if err != nil {
return errors.Wrapf(err, "test operation failed to decode path")
return fmt.Errorf("test operation failed to decode path: %w", err)
}
if path == "" {
@@ -1091,18 +1091,18 @@ func (p Patch) test(doc *container, op Operation, options *ApplyOptions) error {
return nil
}
return errors.Wrapf(ErrTestFailed, "testing value %s failed", path)
return fmt.Errorf("testing value %s failed: %w", path, ErrTestFailed)
}
con, key := findObject(doc, path, options)
if con == nil {
return errors.Wrapf(ErrMissing, "test operation does not apply: is missing path: %s", path)
return fmt.Errorf("test operation does not apply: is missing path: %s: %w", path, ErrMissing)
}
val, err := con.get(key, options)
if err != nil && errors.Cause(err) != ErrMissing {
return errors.Wrapf(err, "error in test for path: '%s'", path)
if err != nil && errors.Unwrap(err) != ErrMissing {
return fmt.Errorf("error in test for path: '%s': %w", path, err)
}
ov := op.value()
@@ -1111,49 +1111,49 @@ func (p Patch) test(doc *container, op Operation, options *ApplyOptions) error {
if ov.isNull() {
return nil
}
return errors.Wrapf(ErrTestFailed, "testing value %s failed", path)
return fmt.Errorf("testing value %s failed: %w", path, ErrTestFailed)
} else if ov.isNull() {
return errors.Wrapf(ErrTestFailed, "testing value %s failed", path)
return fmt.Errorf("testing value %s failed: %w", path, ErrTestFailed)
}
if val.equal(op.value()) {
return nil
}
return errors.Wrapf(ErrTestFailed, "testing value %s failed", path)
return fmt.Errorf("testing value %s failed: %w", path, ErrTestFailed)
}
func (p Patch) copy(doc *container, op Operation, accumulatedCopySize *int64, options *ApplyOptions) error {
from, err := op.From()
if err != nil {
return errors.Wrapf(err, "copy operation failed to decode from")
return fmt.Errorf("copy operation failed to decode from: %w", err)
}
con, key := findObject(doc, from, options)
if con == nil {
return errors.Wrapf(ErrMissing, "copy operation does not apply: doc is missing from path: \"%s\"", from)
return fmt.Errorf("copy operation does not apply: doc is missing from path: \"%s\": %w", from, ErrMissing)
}
val, err := con.get(key, options)
if err != nil {
return errors.Wrapf(err, "error in copy for from: '%s'", from)
return fmt.Errorf("error in copy for from: '%s': %w", from, err)
}
path, err := op.Path()
if err != nil {
return errors.Wrapf(ErrMissing, "copy operation failed to decode path")
return fmt.Errorf("copy operation failed to decode path: %w", ErrMissing)
}
con, key = findObject(doc, path, options)
if con == nil {
return errors.Wrapf(ErrMissing, "copy operation does not apply: doc is missing destination path: %s", path)
return fmt.Errorf("copy operation does not apply: doc is missing destination path: %s: %w", path, ErrMissing)
}
valCopy, sz, err := deepCopy(val, options)
if err != nil {
return errors.Wrapf(err, "error while performing deep copy")
return fmt.Errorf("error while performing deep copy: %w", err)
}
(*accumulatedCopySize) += int64(sz)
@@ -1163,7 +1163,7 @@ func (p Patch) copy(doc *container, op Operation, accumulatedCopySize *int64, op
err = con.add(key, valCopy, options)
if err != nil {
return errors.Wrapf(err, "error while adding value during copy")
return fmt.Errorf("error while adding value during copy: %w", err)
}
return nil

View File

@@ -1 +0,0 @@
language: go

View File

@@ -1,7 +1,5 @@
# BTree implementation for Go
![Travis CI Build Status](https://api.travis-ci.org/google/btree.svg?branch=master)
This package provides an in-memory B-Tree implementation for Go, useful as
an ordered, mutable data structure.

View File

@@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !go1.18
// +build !go1.18
// Package btree implements in-memory B-Trees of arbitrary degree.
//
// btree implements an in-memory B-Tree for use as an ordered data structure.
@@ -476,7 +479,7 @@ func (n *node) growChildAndRemove(i int, item Item, minItems int, typ toRemove)
child := n.mutableChild(i)
// merge with right child
mergeItem := n.items.removeAt(i)
mergeChild := n.children.removeAt(i + 1)
mergeChild := n.children.removeAt(i + 1).mutableFor(n.cow)
child.items = append(child.items, mergeItem)
child.items = append(child.items, mergeChild.items...)
child.children = append(child.children, mergeChild.children...)

1083
vendor/github.com/google/btree/btree_generic.go generated vendored Normal file

File diff suppressed because it is too large Load Diff

76
vendor/golang.org/x/exp/maps/maps.go generated vendored
View File

@@ -1,76 +0,0 @@
// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package maps defines various functions useful with maps of any type.
package maps
import "maps"
// TODO(adonovan): when https://go.dev/issue/32816 is accepted, all of
// these functions except Keys and Values should be annotated
// (provisionally with "//go:fix inline") so that tools can safely and
// automatically replace calls to exp/maps with calls to std maps by
// inlining them.
// Keys returns the keys of the map m.
// The keys will be in an indeterminate order.
func Keys[M ~map[K]V, K comparable, V any](m M) []K {
// The simplest true equivalent using std is:
// return slices.AppendSeq(make([]K, 0, len(m)), maps.Keys(m)).
r := make([]K, 0, len(m))
for k := range m {
r = append(r, k)
}
return r
}
// Values returns the values of the map m.
// The values will be in an indeterminate order.
func Values[M ~map[K]V, K comparable, V any](m M) []V {
// The simplest true equivalent using std is:
// return slices.AppendSeq(make([]V, 0, len(m)), maps.Values(m)).
r := make([]V, 0, len(m))
for _, v := range m {
r = append(r, v)
}
return r
}
// Equal reports whether two maps contain the same key/value pairs.
// Values are compared using ==.
func Equal[M1, M2 ~map[K]V, K, V comparable](m1 M1, m2 M2) bool {
return maps.Equal(m1, m2)
}
// EqualFunc is like Equal, but compares values using eq.
// Keys are still compared with ==.
func EqualFunc[M1 ~map[K]V1, M2 ~map[K]V2, K comparable, V1, V2 any](m1 M1, m2 M2, eq func(V1, V2) bool) bool {
return maps.EqualFunc(m1, m2, eq)
}
// Clear removes all entries from m, leaving it empty.
func Clear[M ~map[K]V, K comparable, V any](m M) {
clear(m)
}
// Clone returns a copy of m. This is a shallow clone:
// the new keys and values are set using ordinary assignment.
func Clone[M ~map[K]V, K comparable, V any](m M) M {
return maps.Clone(m)
}
// Copy copies all key/value pairs in src adding them to dst.
// When a key in src is already present in dst,
// the value in dst will be overwritten by the value associated
// with the key in src.
func Copy[M1 ~map[K]V, M2 ~map[K]V, K comparable, V any](dst M1, src M2) {
maps.Copy(dst, src)
}
// DeleteFunc deletes any key/value pairs from m for which del returns true.
func DeleteFunc[M ~map[K]V, K comparable, V any](m M, del func(K, V) bool) {
maps.DeleteFunc(m, del)
}

136
vendor/golang.org/x/sync/errgroup/errgroup.go generated vendored Normal file
View File

@@ -0,0 +1,136 @@
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package errgroup provides synchronization, error propagation, and Context
// cancelation for groups of goroutines working on subtasks of a common task.
//
// [errgroup.Group] is related to [sync.WaitGroup] but adds handling of tasks
// returning errors.
package errgroup
import (
"context"
"fmt"
"sync"
)
type token struct{}
// A Group is a collection of goroutines working on subtasks that are part of
// the same overall task.
//
// A zero Group is valid, has no limit on the number of active goroutines,
// and does not cancel on error.
type Group struct {
cancel func(error)
wg sync.WaitGroup
sem chan token
errOnce sync.Once
err error
}
func (g *Group) done() {
if g.sem != nil {
<-g.sem
}
g.wg.Done()
}
// WithContext returns a new Group and an associated Context derived from ctx.
//
// The derived Context is canceled the first time a function passed to Go
// returns a non-nil error or the first time Wait returns, whichever occurs
// first.
func WithContext(ctx context.Context) (*Group, context.Context) {
ctx, cancel := context.WithCancelCause(ctx)
return &Group{cancel: cancel}, ctx
}
// Wait blocks until all function calls from the Go method have returned, then
// returns the first non-nil error (if any) from them.
func (g *Group) Wait() error {
g.wg.Wait()
if g.cancel != nil {
g.cancel(g.err)
}
return g.err
}
// Go calls the given function in a new goroutine.
// It blocks until the new goroutine can be added without the number of
// active goroutines in the group exceeding the configured limit.
//
// The first call to return a non-nil error cancels the group's context, if the
// group was created by calling WithContext. The error will be returned by Wait.
func (g *Group) Go(f func() error) {
if g.sem != nil {
g.sem <- token{}
}
g.wg.Add(1)
go func() {
defer g.done()
if err := f(); err != nil {
g.errOnce.Do(func() {
g.err = err
if g.cancel != nil {
g.cancel(g.err)
}
})
}
}()
}
// TryGo calls the given function in a new goroutine only if the number of
// active goroutines in the group is currently below the configured limit.
//
// The return value reports whether the goroutine was started.
func (g *Group) TryGo(f func() error) bool {
if g.sem != nil {
select {
case g.sem <- token{}:
// Note: this allows barging iff channels in general allow barging.
default:
return false
}
}
g.wg.Add(1)
go func() {
defer g.done()
if err := f(); err != nil {
g.errOnce.Do(func() {
g.err = err
if g.cancel != nil {
g.cancel(g.err)
}
})
}
}()
return true
}
// SetLimit limits the number of active goroutines in this group to at most n.
// A negative value indicates no limit.
// A limit of zero will prevent any new goroutines from being added.
//
// Any subsequent call to the Go method will block until it can add an active
// goroutine without exceeding the configured limit.
//
// The limit must not be modified while any goroutines in the group are active.
func (g *Group) SetLimit(n int) {
if n < 0 {
g.sem = nil
return
}
if len(g.sem) != 0 {
panic(fmt.Errorf("errgroup: modify limit while %v goroutines in the group are still active", len(g.sem)))
}
g.sem = make(chan token, n)
}

29
vendor/modules.txt vendored
View File

@@ -1,4 +1,4 @@
# cel.dev/expr v0.18.0
# cel.dev/expr v0.19.1
## explicit; go 1.21.1
cel.dev/expr
# cloud.google.com/go/compute/metadata v0.5.0
@@ -210,7 +210,7 @@ github.com/emicklei/go-restful/v3/log
# github.com/evanphx/json-patch v5.9.11+incompatible
## explicit
github.com/evanphx/json-patch
# github.com/evanphx/json-patch/v5 v5.9.0
# github.com/evanphx/json-patch/v5 v5.9.11
## explicit; go 1.18
github.com/evanphx/json-patch/v5
github.com/evanphx/json-patch/v5/internal/json
@@ -280,8 +280,8 @@ github.com/golang/protobuf/ptypes/any
github.com/golang/protobuf/ptypes/duration
github.com/golang/protobuf/ptypes/empty
github.com/golang/protobuf/ptypes/timestamp
# github.com/google/btree v1.0.1
## explicit; go 1.12
# github.com/google/btree v1.1.3
## explicit; go 1.18
github.com/google/btree
# github.com/google/cel-go v0.22.0
## explicit; go 1.21.1
@@ -741,7 +741,6 @@ golang.org/x/crypto/salsa20/salsa
golang.org/x/crypto/scrypt
# golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67
## explicit; go 1.22.0
golang.org/x/exp/maps
golang.org/x/exp/slices
# golang.org/x/net v0.37.0
## explicit; go 1.23.0
@@ -773,6 +772,7 @@ golang.org/x/oauth2/jws
golang.org/x/oauth2/jwt
# golang.org/x/sync v0.12.0
## explicit; go 1.23.0
golang.org/x/sync/errgroup
golang.org/x/sync/singleflight
# golang.org/x/sys v0.32.0
## explicit; go 1.23.0
@@ -1698,8 +1698,8 @@ k8s.io/utils/path
k8s.io/utils/pointer
k8s.io/utils/ptr
k8s.io/utils/trace
# open-cluster-management.io/addon-framework v0.12.1-0.20250401143304-75b65b5f45e0
## explicit; go 1.22.0
# open-cluster-management.io/addon-framework v0.12.1-0.20250407131028-9d436ffc2da7
## explicit; go 1.23.6
open-cluster-management.io/addon-framework/pkg/addonfactory
open-cluster-management.io/addon-framework/pkg/addonmanager
open-cluster-management.io/addon-framework/pkg/addonmanager/addontesting
@@ -1714,8 +1714,8 @@ open-cluster-management.io/addon-framework/pkg/agent
open-cluster-management.io/addon-framework/pkg/assets
open-cluster-management.io/addon-framework/pkg/index
open-cluster-management.io/addon-framework/pkg/utils
# open-cluster-management.io/api v0.16.1
## explicit; go 1.22.0
# open-cluster-management.io/api v0.16.2-0.20250416130057-11622a5f2170
## explicit; go 1.23.6
open-cluster-management.io/api/addon/v1alpha1
open-cluster-management.io/api/client/addon/clientset/versioned
open-cluster-management.io/api/client/addon/clientset/versioned/fake
@@ -1777,14 +1777,13 @@ open-cluster-management.io/api/cluster/v1
open-cluster-management.io/api/cluster/v1alpha1
open-cluster-management.io/api/cluster/v1beta1
open-cluster-management.io/api/cluster/v1beta2
open-cluster-management.io/api/crdsv1beta1
open-cluster-management.io/api/feature
open-cluster-management.io/api/operator/v1
open-cluster-management.io/api/utils/work/v1/workapplier
open-cluster-management.io/api/work/v1
open-cluster-management.io/api/work/v1alpha1
# open-cluster-management.io/sdk-go v0.16.1-0.20250327091909-6bd6228a47ad
## explicit; go 1.22.0
# open-cluster-management.io/sdk-go v0.16.1-0.20250411154302-3a424961ead4
## explicit; go 1.23.6
open-cluster-management.io/sdk-go/pkg/apis/cluster/v1alpha1
open-cluster-management.io/sdk-go/pkg/apis/cluster/v1beta1
open-cluster-management.io/sdk-go/pkg/apis/cluster/v1beta2
@@ -1840,8 +1839,8 @@ sigs.k8s.io/cluster-inventory-api/client/informers/externalversions/apis
sigs.k8s.io/cluster-inventory-api/client/informers/externalversions/apis/v1alpha1
sigs.k8s.io/cluster-inventory-api/client/informers/externalversions/internalinterfaces
sigs.k8s.io/cluster-inventory-api/client/listers/apis/v1alpha1
# sigs.k8s.io/controller-runtime v0.19.3
## explicit; go 1.22.0
# sigs.k8s.io/controller-runtime v0.20.2
## explicit; go 1.23.0
sigs.k8s.io/controller-runtime
sigs.k8s.io/controller-runtime/pkg/builder
sigs.k8s.io/controller-runtime/pkg/cache
@@ -1855,6 +1854,7 @@ sigs.k8s.io/controller-runtime/pkg/cluster
sigs.k8s.io/controller-runtime/pkg/config
sigs.k8s.io/controller-runtime/pkg/controller
sigs.k8s.io/controller-runtime/pkg/controller/controllerutil
sigs.k8s.io/controller-runtime/pkg/controller/priorityqueue
sigs.k8s.io/controller-runtime/pkg/conversion
sigs.k8s.io/controller-runtime/pkg/envtest
sigs.k8s.io/controller-runtime/pkg/event
@@ -1866,6 +1866,7 @@ sigs.k8s.io/controller-runtime/pkg/internal/field/selector
sigs.k8s.io/controller-runtime/pkg/internal/flock
sigs.k8s.io/controller-runtime/pkg/internal/httpserver
sigs.k8s.io/controller-runtime/pkg/internal/log
sigs.k8s.io/controller-runtime/pkg/internal/metrics
sigs.k8s.io/controller-runtime/pkg/internal/recorder
sigs.k8s.io/controller-runtime/pkg/internal/source
sigs.k8s.io/controller-runtime/pkg/internal/syncs

View File

@@ -283,7 +283,7 @@ func (a *HelmAgentAddon) getDefaultValues(
if len(hostingClusterName) > 0 {
hostingCluster, err := a.clusterClient.ClusterV1().ManagedClusters().
Get(context.TODO(), hostingClusterName, metav1.GetOptions{})
if err == nil {
if err == nil { //nolint:gocritic
defaultValues.HostingClusterCapabilities = *a.capabilities(hostingCluster, addon)
} else if errors.IsNotFound(err) {
klog.Infof("hostingCluster %s not found, skip providing default value hostingClusterCapabilities",

View File

@@ -23,7 +23,7 @@ var templateFuncs = map[string]interface{}{
func indent(indention int, v []byte) string {
newline := "\n" + strings.Repeat(" ", indention)
return strings.Replace(string(v), "\n", newline, -1)
return strings.Replace(string(v), "\n", newline, -1) //nolint:gocritic
}
func base64encode(v []byte) string {

View File

@@ -468,18 +468,8 @@ spec:
description: conditions describe the state of the managed and
monitored components for the operator.
items:
description: "Condition contains details for one aspect of
the current state of this API Resource.\n---\nThis struct
is intended for direct use as an array at the field path
.status.conditions. For example,\n\n\n\ttype FooStatus
struct{\n\t // Represents the observations of a foo's
current state.\n\t // Known .status.conditions.type are:
\"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t //
+listType=map\n\t // +listMapKey=type\n\t Conditions
[]metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\"
patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of
the current state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -521,12 +511,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -634,6 +619,8 @@ spec:
type: object
type: array
type: object
required:
- spec
type: object
served: true
storage: true

View File

@@ -137,16 +137,8 @@ spec:
description: conditions describe the state of the managed and monitored
components for the operator.
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
@@ -187,12 +179,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -344,6 +331,8 @@ spec:
description: user is the user name of the addon agent.
type: string
type: object
required:
- signerName
type: object
type: array
relatedObjects:

View File

@@ -160,7 +160,6 @@ spec:
the following example will override image "quay.io/open-cluster-management/addon-agent" to
"quay.io/ocm/addon-agent" when deploying the addon agent
registries:
- source: quay.io/open-cluster-management/addon-agent
mirror: quay.io/ocm/addon-agent
@@ -207,11 +206,9 @@ spec:
Claims lists the names of resources, defined in spec.resourceClaims,
that are used by this container.
This is an alpha field and requires enabling the
DynamicResourceAllocation feature gate.
This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
@@ -222,6 +219,12 @@ spec:
the Pod where this field is used. It makes that resource available
inside a container.
type: string
request:
description: |-
Request is the name chosen for a request in the referenced claim.
If empty, everything from the claim is made available, otherwise
only the result of this request.
type: string
required:
- name
type: object
@@ -263,6 +266,8 @@ spec:
- containerID
x-kubernetes-list-type: map
type: object
required:
- spec
type: object
served: true
storage: true

View File

@@ -24,7 +24,6 @@ spec:
AddOnTemplate is the Custom Resource object, it is used to describe
how to deploy the addon agent and how to register the addon.
AddOnTemplate is a cluster-scoped resource, and will only be used
on the hub cluster.
properties:
@@ -414,6 +413,7 @@ spec:
type: string
type: object
required:
- signerName
- signingCA
type: object
kubeClient:

View File

@@ -3,8 +3,8 @@
package versioned
import (
"fmt"
"net/http"
fmt "fmt"
http "net/http"
discovery "k8s.io/client-go/discovery"
rest "k8s.io/client-go/rest"

View File

@@ -15,8 +15,12 @@ import (
// NewSimpleClientset returns a clientset that will respond with the provided objects.
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
// without applying any validations and/or defaults. It shouldn't be considered a replacement
// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
//
// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves
// server side apply testing. NewClientset is only available when apply configurations are generated (e.g.
// via --with-applyconfig).
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder())
for _, obj := range objects {

View File

@@ -3,11 +3,11 @@
package v1alpha1
import (
"net/http"
http "net/http"
rest "k8s.io/client-go/rest"
v1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
"open-cluster-management.io/api/client/addon/clientset/versioned/scheme"
addonv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
scheme "open-cluster-management.io/api/client/addon/clientset/versioned/scheme"
)
type AddonV1alpha1Interface interface {
@@ -84,10 +84,10 @@ func New(c rest.Interface) *AddonV1alpha1Client {
}
func setConfigDefaults(config *rest.Config) error {
gv := v1alpha1.SchemeGroupVersion
gv := addonv1alpha1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()

View File

@@ -3,14 +3,13 @@
package v1alpha1
import (
"context"
"time"
context "context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
v1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
gentype "k8s.io/client-go/gentype"
addonv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
scheme "open-cluster-management.io/api/client/addon/clientset/versioned/scheme"
)
@@ -22,141 +21,32 @@ type AddOnDeploymentConfigsGetter interface {
// AddOnDeploymentConfigInterface has methods to work with AddOnDeploymentConfig resources.
type AddOnDeploymentConfigInterface interface {
Create(ctx context.Context, addOnDeploymentConfig *v1alpha1.AddOnDeploymentConfig, opts v1.CreateOptions) (*v1alpha1.AddOnDeploymentConfig, error)
Update(ctx context.Context, addOnDeploymentConfig *v1alpha1.AddOnDeploymentConfig, opts v1.UpdateOptions) (*v1alpha1.AddOnDeploymentConfig, error)
Create(ctx context.Context, addOnDeploymentConfig *addonv1alpha1.AddOnDeploymentConfig, opts v1.CreateOptions) (*addonv1alpha1.AddOnDeploymentConfig, error)
Update(ctx context.Context, addOnDeploymentConfig *addonv1alpha1.AddOnDeploymentConfig, opts v1.UpdateOptions) (*addonv1alpha1.AddOnDeploymentConfig, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.AddOnDeploymentConfig, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.AddOnDeploymentConfigList, error)
Get(ctx context.Context, name string, opts v1.GetOptions) (*addonv1alpha1.AddOnDeploymentConfig, error)
List(ctx context.Context, opts v1.ListOptions) (*addonv1alpha1.AddOnDeploymentConfigList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AddOnDeploymentConfig, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *addonv1alpha1.AddOnDeploymentConfig, err error)
AddOnDeploymentConfigExpansion
}
// addOnDeploymentConfigs implements AddOnDeploymentConfigInterface
type addOnDeploymentConfigs struct {
client rest.Interface
ns string
*gentype.ClientWithList[*addonv1alpha1.AddOnDeploymentConfig, *addonv1alpha1.AddOnDeploymentConfigList]
}
// newAddOnDeploymentConfigs returns a AddOnDeploymentConfigs
func newAddOnDeploymentConfigs(c *AddonV1alpha1Client, namespace string) *addOnDeploymentConfigs {
return &addOnDeploymentConfigs{
client: c.RESTClient(),
ns: namespace,
gentype.NewClientWithList[*addonv1alpha1.AddOnDeploymentConfig, *addonv1alpha1.AddOnDeploymentConfigList](
"addondeploymentconfigs",
c.RESTClient(),
scheme.ParameterCodec,
namespace,
func() *addonv1alpha1.AddOnDeploymentConfig { return &addonv1alpha1.AddOnDeploymentConfig{} },
func() *addonv1alpha1.AddOnDeploymentConfigList { return &addonv1alpha1.AddOnDeploymentConfigList{} },
),
}
}
// Get takes name of the addOnDeploymentConfig, and returns the corresponding addOnDeploymentConfig object, and an error if there is any.
func (c *addOnDeploymentConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AddOnDeploymentConfig, err error) {
result = &v1alpha1.AddOnDeploymentConfig{}
err = c.client.Get().
Namespace(c.ns).
Resource("addondeploymentconfigs").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of AddOnDeploymentConfigs that match those selectors.
func (c *addOnDeploymentConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.AddOnDeploymentConfigList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.AddOnDeploymentConfigList{}
err = c.client.Get().
Namespace(c.ns).
Resource("addondeploymentconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested addOnDeploymentConfigs.
func (c *addOnDeploymentConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("addondeploymentconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a addOnDeploymentConfig and creates it. Returns the server's representation of the addOnDeploymentConfig, and an error, if there is any.
func (c *addOnDeploymentConfigs) Create(ctx context.Context, addOnDeploymentConfig *v1alpha1.AddOnDeploymentConfig, opts v1.CreateOptions) (result *v1alpha1.AddOnDeploymentConfig, err error) {
result = &v1alpha1.AddOnDeploymentConfig{}
err = c.client.Post().
Namespace(c.ns).
Resource("addondeploymentconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Body(addOnDeploymentConfig).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a addOnDeploymentConfig and updates it. Returns the server's representation of the addOnDeploymentConfig, and an error, if there is any.
func (c *addOnDeploymentConfigs) Update(ctx context.Context, addOnDeploymentConfig *v1alpha1.AddOnDeploymentConfig, opts v1.UpdateOptions) (result *v1alpha1.AddOnDeploymentConfig, err error) {
result = &v1alpha1.AddOnDeploymentConfig{}
err = c.client.Put().
Namespace(c.ns).
Resource("addondeploymentconfigs").
Name(addOnDeploymentConfig.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(addOnDeploymentConfig).
Do(ctx).
Into(result)
return
}
// Delete takes name of the addOnDeploymentConfig and deletes it. Returns an error if one occurs.
func (c *addOnDeploymentConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("addondeploymentconfigs").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *addOnDeploymentConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("addondeploymentconfigs").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched addOnDeploymentConfig.
func (c *addOnDeploymentConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AddOnDeploymentConfig, err error) {
result = &v1alpha1.AddOnDeploymentConfig{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("addondeploymentconfigs").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -3,14 +3,13 @@
package v1alpha1
import (
"context"
"time"
context "context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
v1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
gentype "k8s.io/client-go/gentype"
addonv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
scheme "open-cluster-management.io/api/client/addon/clientset/versioned/scheme"
)
@@ -22,131 +21,32 @@ type AddOnTemplatesGetter interface {
// AddOnTemplateInterface has methods to work with AddOnTemplate resources.
type AddOnTemplateInterface interface {
Create(ctx context.Context, addOnTemplate *v1alpha1.AddOnTemplate, opts v1.CreateOptions) (*v1alpha1.AddOnTemplate, error)
Update(ctx context.Context, addOnTemplate *v1alpha1.AddOnTemplate, opts v1.UpdateOptions) (*v1alpha1.AddOnTemplate, error)
Create(ctx context.Context, addOnTemplate *addonv1alpha1.AddOnTemplate, opts v1.CreateOptions) (*addonv1alpha1.AddOnTemplate, error)
Update(ctx context.Context, addOnTemplate *addonv1alpha1.AddOnTemplate, opts v1.UpdateOptions) (*addonv1alpha1.AddOnTemplate, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.AddOnTemplate, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.AddOnTemplateList, error)
Get(ctx context.Context, name string, opts v1.GetOptions) (*addonv1alpha1.AddOnTemplate, error)
List(ctx context.Context, opts v1.ListOptions) (*addonv1alpha1.AddOnTemplateList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AddOnTemplate, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *addonv1alpha1.AddOnTemplate, err error)
AddOnTemplateExpansion
}
// addOnTemplates implements AddOnTemplateInterface
type addOnTemplates struct {
client rest.Interface
*gentype.ClientWithList[*addonv1alpha1.AddOnTemplate, *addonv1alpha1.AddOnTemplateList]
}
// newAddOnTemplates returns a AddOnTemplates
func newAddOnTemplates(c *AddonV1alpha1Client) *addOnTemplates {
return &addOnTemplates{
client: c.RESTClient(),
gentype.NewClientWithList[*addonv1alpha1.AddOnTemplate, *addonv1alpha1.AddOnTemplateList](
"addontemplates",
c.RESTClient(),
scheme.ParameterCodec,
"",
func() *addonv1alpha1.AddOnTemplate { return &addonv1alpha1.AddOnTemplate{} },
func() *addonv1alpha1.AddOnTemplateList { return &addonv1alpha1.AddOnTemplateList{} },
),
}
}
// Get takes name of the addOnTemplate, and returns the corresponding addOnTemplate object, and an error if there is any.
func (c *addOnTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AddOnTemplate, err error) {
result = &v1alpha1.AddOnTemplate{}
err = c.client.Get().
Resource("addontemplates").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of AddOnTemplates that match those selectors.
func (c *addOnTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.AddOnTemplateList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.AddOnTemplateList{}
err = c.client.Get().
Resource("addontemplates").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested addOnTemplates.
func (c *addOnTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Resource("addontemplates").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a addOnTemplate and creates it. Returns the server's representation of the addOnTemplate, and an error, if there is any.
func (c *addOnTemplates) Create(ctx context.Context, addOnTemplate *v1alpha1.AddOnTemplate, opts v1.CreateOptions) (result *v1alpha1.AddOnTemplate, err error) {
result = &v1alpha1.AddOnTemplate{}
err = c.client.Post().
Resource("addontemplates").
VersionedParams(&opts, scheme.ParameterCodec).
Body(addOnTemplate).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a addOnTemplate and updates it. Returns the server's representation of the addOnTemplate, and an error, if there is any.
func (c *addOnTemplates) Update(ctx context.Context, addOnTemplate *v1alpha1.AddOnTemplate, opts v1.UpdateOptions) (result *v1alpha1.AddOnTemplate, err error) {
result = &v1alpha1.AddOnTemplate{}
err = c.client.Put().
Resource("addontemplates").
Name(addOnTemplate.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(addOnTemplate).
Do(ctx).
Into(result)
return
}
// Delete takes name of the addOnTemplate and deletes it. Returns an error if one occurs.
func (c *addOnTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Resource("addontemplates").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *addOnTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("addontemplates").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched addOnTemplate.
func (c *addOnTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AddOnTemplate, err error) {
result = &v1alpha1.AddOnTemplate{}
err = c.client.Patch(pt).
Resource("addontemplates").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -3,14 +3,13 @@
package v1alpha1
import (
"context"
"time"
context "context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
v1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
gentype "k8s.io/client-go/gentype"
addonv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
scheme "open-cluster-management.io/api/client/addon/clientset/versioned/scheme"
)
@@ -22,147 +21,34 @@ type ClusterManagementAddOnsGetter interface {
// ClusterManagementAddOnInterface has methods to work with ClusterManagementAddOn resources.
type ClusterManagementAddOnInterface interface {
Create(ctx context.Context, clusterManagementAddOn *v1alpha1.ClusterManagementAddOn, opts v1.CreateOptions) (*v1alpha1.ClusterManagementAddOn, error)
Update(ctx context.Context, clusterManagementAddOn *v1alpha1.ClusterManagementAddOn, opts v1.UpdateOptions) (*v1alpha1.ClusterManagementAddOn, error)
UpdateStatus(ctx context.Context, clusterManagementAddOn *v1alpha1.ClusterManagementAddOn, opts v1.UpdateOptions) (*v1alpha1.ClusterManagementAddOn, error)
Create(ctx context.Context, clusterManagementAddOn *addonv1alpha1.ClusterManagementAddOn, opts v1.CreateOptions) (*addonv1alpha1.ClusterManagementAddOn, error)
Update(ctx context.Context, clusterManagementAddOn *addonv1alpha1.ClusterManagementAddOn, opts v1.UpdateOptions) (*addonv1alpha1.ClusterManagementAddOn, error)
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, clusterManagementAddOn *addonv1alpha1.ClusterManagementAddOn, opts v1.UpdateOptions) (*addonv1alpha1.ClusterManagementAddOn, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterManagementAddOn, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterManagementAddOnList, error)
Get(ctx context.Context, name string, opts v1.GetOptions) (*addonv1alpha1.ClusterManagementAddOn, error)
List(ctx context.Context, opts v1.ListOptions) (*addonv1alpha1.ClusterManagementAddOnList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterManagementAddOn, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *addonv1alpha1.ClusterManagementAddOn, err error)
ClusterManagementAddOnExpansion
}
// clusterManagementAddOns implements ClusterManagementAddOnInterface
type clusterManagementAddOns struct {
client rest.Interface
*gentype.ClientWithList[*addonv1alpha1.ClusterManagementAddOn, *addonv1alpha1.ClusterManagementAddOnList]
}
// newClusterManagementAddOns returns a ClusterManagementAddOns
func newClusterManagementAddOns(c *AddonV1alpha1Client) *clusterManagementAddOns {
return &clusterManagementAddOns{
client: c.RESTClient(),
gentype.NewClientWithList[*addonv1alpha1.ClusterManagementAddOn, *addonv1alpha1.ClusterManagementAddOnList](
"clustermanagementaddons",
c.RESTClient(),
scheme.ParameterCodec,
"",
func() *addonv1alpha1.ClusterManagementAddOn { return &addonv1alpha1.ClusterManagementAddOn{} },
func() *addonv1alpha1.ClusterManagementAddOnList { return &addonv1alpha1.ClusterManagementAddOnList{} },
),
}
}
// Get takes name of the clusterManagementAddOn, and returns the corresponding clusterManagementAddOn object, and an error if there is any.
func (c *clusterManagementAddOns) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterManagementAddOn, err error) {
result = &v1alpha1.ClusterManagementAddOn{}
err = c.client.Get().
Resource("clustermanagementaddons").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of ClusterManagementAddOns that match those selectors.
func (c *clusterManagementAddOns) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterManagementAddOnList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ClusterManagementAddOnList{}
err = c.client.Get().
Resource("clustermanagementaddons").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested clusterManagementAddOns.
func (c *clusterManagementAddOns) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Resource("clustermanagementaddons").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a clusterManagementAddOn and creates it. Returns the server's representation of the clusterManagementAddOn, and an error, if there is any.
func (c *clusterManagementAddOns) Create(ctx context.Context, clusterManagementAddOn *v1alpha1.ClusterManagementAddOn, opts v1.CreateOptions) (result *v1alpha1.ClusterManagementAddOn, err error) {
result = &v1alpha1.ClusterManagementAddOn{}
err = c.client.Post().
Resource("clustermanagementaddons").
VersionedParams(&opts, scheme.ParameterCodec).
Body(clusterManagementAddOn).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a clusterManagementAddOn and updates it. Returns the server's representation of the clusterManagementAddOn, and an error, if there is any.
func (c *clusterManagementAddOns) Update(ctx context.Context, clusterManagementAddOn *v1alpha1.ClusterManagementAddOn, opts v1.UpdateOptions) (result *v1alpha1.ClusterManagementAddOn, err error) {
result = &v1alpha1.ClusterManagementAddOn{}
err = c.client.Put().
Resource("clustermanagementaddons").
Name(clusterManagementAddOn.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(clusterManagementAddOn).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *clusterManagementAddOns) UpdateStatus(ctx context.Context, clusterManagementAddOn *v1alpha1.ClusterManagementAddOn, opts v1.UpdateOptions) (result *v1alpha1.ClusterManagementAddOn, err error) {
result = &v1alpha1.ClusterManagementAddOn{}
err = c.client.Put().
Resource("clustermanagementaddons").
Name(clusterManagementAddOn.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(clusterManagementAddOn).
Do(ctx).
Into(result)
return
}
// Delete takes name of the clusterManagementAddOn and deletes it. Returns an error if one occurs.
func (c *clusterManagementAddOns) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Resource("clustermanagementaddons").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *clusterManagementAddOns) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("clustermanagementaddons").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched clusterManagementAddOn.
func (c *clusterManagementAddOns) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterManagementAddOn, err error) {
result = &v1alpha1.ClusterManagementAddOn{}
err = c.client.Patch(pt).
Resource("clustermanagementaddons").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -13,19 +13,19 @@ type FakeAddonV1alpha1 struct {
}
func (c *FakeAddonV1alpha1) AddOnDeploymentConfigs(namespace string) v1alpha1.AddOnDeploymentConfigInterface {
return &FakeAddOnDeploymentConfigs{c, namespace}
return newFakeAddOnDeploymentConfigs(c, namespace)
}
func (c *FakeAddonV1alpha1) AddOnTemplates() v1alpha1.AddOnTemplateInterface {
return &FakeAddOnTemplates{c}
return newFakeAddOnTemplates(c)
}
func (c *FakeAddonV1alpha1) ClusterManagementAddOns() v1alpha1.ClusterManagementAddOnInterface {
return &FakeClusterManagementAddOns{c}
return newFakeClusterManagementAddOns(c)
}
func (c *FakeAddonV1alpha1) ManagedClusterAddOns(namespace string) v1alpha1.ManagedClusterAddOnInterface {
return &FakeManagedClusterAddOns{c, namespace}
return newFakeManagedClusterAddOns(c, namespace)
}
// RESTClient returns a RESTClient that is used to communicate

View File

@@ -3,111 +3,34 @@
package fake
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
gentype "k8s.io/client-go/gentype"
v1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
addonv1alpha1 "open-cluster-management.io/api/client/addon/clientset/versioned/typed/addon/v1alpha1"
)
// FakeAddOnDeploymentConfigs implements AddOnDeploymentConfigInterface
type FakeAddOnDeploymentConfigs struct {
// fakeAddOnDeploymentConfigs implements AddOnDeploymentConfigInterface
type fakeAddOnDeploymentConfigs struct {
*gentype.FakeClientWithList[*v1alpha1.AddOnDeploymentConfig, *v1alpha1.AddOnDeploymentConfigList]
Fake *FakeAddonV1alpha1
ns string
}
var addondeploymentconfigsResource = v1alpha1.SchemeGroupVersion.WithResource("addondeploymentconfigs")
var addondeploymentconfigsKind = v1alpha1.SchemeGroupVersion.WithKind("AddOnDeploymentConfig")
// Get takes name of the addOnDeploymentConfig, and returns the corresponding addOnDeploymentConfig object, and an error if there is any.
func (c *FakeAddOnDeploymentConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AddOnDeploymentConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(addondeploymentconfigsResource, c.ns, name), &v1alpha1.AddOnDeploymentConfig{})
if obj == nil {
return nil, err
func newFakeAddOnDeploymentConfigs(fake *FakeAddonV1alpha1, namespace string) addonv1alpha1.AddOnDeploymentConfigInterface {
return &fakeAddOnDeploymentConfigs{
gentype.NewFakeClientWithList[*v1alpha1.AddOnDeploymentConfig, *v1alpha1.AddOnDeploymentConfigList](
fake.Fake,
namespace,
v1alpha1.SchemeGroupVersion.WithResource("addondeploymentconfigs"),
v1alpha1.SchemeGroupVersion.WithKind("AddOnDeploymentConfig"),
func() *v1alpha1.AddOnDeploymentConfig { return &v1alpha1.AddOnDeploymentConfig{} },
func() *v1alpha1.AddOnDeploymentConfigList { return &v1alpha1.AddOnDeploymentConfigList{} },
func(dst, src *v1alpha1.AddOnDeploymentConfigList) { dst.ListMeta = src.ListMeta },
func(list *v1alpha1.AddOnDeploymentConfigList) []*v1alpha1.AddOnDeploymentConfig {
return gentype.ToPointerSlice(list.Items)
},
func(list *v1alpha1.AddOnDeploymentConfigList, items []*v1alpha1.AddOnDeploymentConfig) {
list.Items = gentype.FromPointerSlice(items)
},
),
fake,
}
return obj.(*v1alpha1.AddOnDeploymentConfig), err
}
// List takes label and field selectors, and returns the list of AddOnDeploymentConfigs that match those selectors.
func (c *FakeAddOnDeploymentConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.AddOnDeploymentConfigList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(addondeploymentconfigsResource, addondeploymentconfigsKind, c.ns, opts), &v1alpha1.AddOnDeploymentConfigList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.AddOnDeploymentConfigList{ListMeta: obj.(*v1alpha1.AddOnDeploymentConfigList).ListMeta}
for _, item := range obj.(*v1alpha1.AddOnDeploymentConfigList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested addOnDeploymentConfigs.
func (c *FakeAddOnDeploymentConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(addondeploymentconfigsResource, c.ns, opts))
}
// Create takes the representation of a addOnDeploymentConfig and creates it. Returns the server's representation of the addOnDeploymentConfig, and an error, if there is any.
func (c *FakeAddOnDeploymentConfigs) Create(ctx context.Context, addOnDeploymentConfig *v1alpha1.AddOnDeploymentConfig, opts v1.CreateOptions) (result *v1alpha1.AddOnDeploymentConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(addondeploymentconfigsResource, c.ns, addOnDeploymentConfig), &v1alpha1.AddOnDeploymentConfig{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.AddOnDeploymentConfig), err
}
// Update takes the representation of a addOnDeploymentConfig and updates it. Returns the server's representation of the addOnDeploymentConfig, and an error, if there is any.
func (c *FakeAddOnDeploymentConfigs) Update(ctx context.Context, addOnDeploymentConfig *v1alpha1.AddOnDeploymentConfig, opts v1.UpdateOptions) (result *v1alpha1.AddOnDeploymentConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(addondeploymentconfigsResource, c.ns, addOnDeploymentConfig), &v1alpha1.AddOnDeploymentConfig{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.AddOnDeploymentConfig), err
}
// Delete takes name of the addOnDeploymentConfig and deletes it. Returns an error if one occurs.
func (c *FakeAddOnDeploymentConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteActionWithOptions(addondeploymentconfigsResource, c.ns, name, opts), &v1alpha1.AddOnDeploymentConfig{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeAddOnDeploymentConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(addondeploymentconfigsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.AddOnDeploymentConfigList{})
return err
}
// Patch applies the patch and returns the patched addOnDeploymentConfig.
func (c *FakeAddOnDeploymentConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AddOnDeploymentConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(addondeploymentconfigsResource, c.ns, name, pt, data, subresources...), &v1alpha1.AddOnDeploymentConfig{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.AddOnDeploymentConfig), err
}

View File

@@ -3,103 +3,34 @@
package fake
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
gentype "k8s.io/client-go/gentype"
v1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
addonv1alpha1 "open-cluster-management.io/api/client/addon/clientset/versioned/typed/addon/v1alpha1"
)
// FakeAddOnTemplates implements AddOnTemplateInterface
type FakeAddOnTemplates struct {
// fakeAddOnTemplates implements AddOnTemplateInterface
type fakeAddOnTemplates struct {
*gentype.FakeClientWithList[*v1alpha1.AddOnTemplate, *v1alpha1.AddOnTemplateList]
Fake *FakeAddonV1alpha1
}
var addontemplatesResource = v1alpha1.SchemeGroupVersion.WithResource("addontemplates")
var addontemplatesKind = v1alpha1.SchemeGroupVersion.WithKind("AddOnTemplate")
// Get takes name of the addOnTemplate, and returns the corresponding addOnTemplate object, and an error if there is any.
func (c *FakeAddOnTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AddOnTemplate, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(addontemplatesResource, name), &v1alpha1.AddOnTemplate{})
if obj == nil {
return nil, err
func newFakeAddOnTemplates(fake *FakeAddonV1alpha1) addonv1alpha1.AddOnTemplateInterface {
return &fakeAddOnTemplates{
gentype.NewFakeClientWithList[*v1alpha1.AddOnTemplate, *v1alpha1.AddOnTemplateList](
fake.Fake,
"",
v1alpha1.SchemeGroupVersion.WithResource("addontemplates"),
v1alpha1.SchemeGroupVersion.WithKind("AddOnTemplate"),
func() *v1alpha1.AddOnTemplate { return &v1alpha1.AddOnTemplate{} },
func() *v1alpha1.AddOnTemplateList { return &v1alpha1.AddOnTemplateList{} },
func(dst, src *v1alpha1.AddOnTemplateList) { dst.ListMeta = src.ListMeta },
func(list *v1alpha1.AddOnTemplateList) []*v1alpha1.AddOnTemplate {
return gentype.ToPointerSlice(list.Items)
},
func(list *v1alpha1.AddOnTemplateList, items []*v1alpha1.AddOnTemplate) {
list.Items = gentype.FromPointerSlice(items)
},
),
fake,
}
return obj.(*v1alpha1.AddOnTemplate), err
}
// List takes label and field selectors, and returns the list of AddOnTemplates that match those selectors.
func (c *FakeAddOnTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.AddOnTemplateList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(addontemplatesResource, addontemplatesKind, opts), &v1alpha1.AddOnTemplateList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.AddOnTemplateList{ListMeta: obj.(*v1alpha1.AddOnTemplateList).ListMeta}
for _, item := range obj.(*v1alpha1.AddOnTemplateList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested addOnTemplates.
func (c *FakeAddOnTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(addontemplatesResource, opts))
}
// Create takes the representation of a addOnTemplate and creates it. Returns the server's representation of the addOnTemplate, and an error, if there is any.
func (c *FakeAddOnTemplates) Create(ctx context.Context, addOnTemplate *v1alpha1.AddOnTemplate, opts v1.CreateOptions) (result *v1alpha1.AddOnTemplate, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(addontemplatesResource, addOnTemplate), &v1alpha1.AddOnTemplate{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.AddOnTemplate), err
}
// Update takes the representation of a addOnTemplate and updates it. Returns the server's representation of the addOnTemplate, and an error, if there is any.
func (c *FakeAddOnTemplates) Update(ctx context.Context, addOnTemplate *v1alpha1.AddOnTemplate, opts v1.UpdateOptions) (result *v1alpha1.AddOnTemplate, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(addontemplatesResource, addOnTemplate), &v1alpha1.AddOnTemplate{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.AddOnTemplate), err
}
// Delete takes name of the addOnTemplate and deletes it. Returns an error if one occurs.
func (c *FakeAddOnTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteActionWithOptions(addontemplatesResource, name, opts), &v1alpha1.AddOnTemplate{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeAddOnTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(addontemplatesResource, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.AddOnTemplateList{})
return err
}
// Patch applies the patch and returns the patched addOnTemplate.
func (c *FakeAddOnTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AddOnTemplate, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(addontemplatesResource, name, pt, data, subresources...), &v1alpha1.AddOnTemplate{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.AddOnTemplate), err
}

View File

@@ -3,114 +3,34 @@
package fake
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
gentype "k8s.io/client-go/gentype"
v1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
addonv1alpha1 "open-cluster-management.io/api/client/addon/clientset/versioned/typed/addon/v1alpha1"
)
// FakeClusterManagementAddOns implements ClusterManagementAddOnInterface
type FakeClusterManagementAddOns struct {
// fakeClusterManagementAddOns implements ClusterManagementAddOnInterface
type fakeClusterManagementAddOns struct {
*gentype.FakeClientWithList[*v1alpha1.ClusterManagementAddOn, *v1alpha1.ClusterManagementAddOnList]
Fake *FakeAddonV1alpha1
}
var clustermanagementaddonsResource = v1alpha1.SchemeGroupVersion.WithResource("clustermanagementaddons")
var clustermanagementaddonsKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterManagementAddOn")
// Get takes name of the clusterManagementAddOn, and returns the corresponding clusterManagementAddOn object, and an error if there is any.
func (c *FakeClusterManagementAddOns) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterManagementAddOn, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(clustermanagementaddonsResource, name), &v1alpha1.ClusterManagementAddOn{})
if obj == nil {
return nil, err
func newFakeClusterManagementAddOns(fake *FakeAddonV1alpha1) addonv1alpha1.ClusterManagementAddOnInterface {
return &fakeClusterManagementAddOns{
gentype.NewFakeClientWithList[*v1alpha1.ClusterManagementAddOn, *v1alpha1.ClusterManagementAddOnList](
fake.Fake,
"",
v1alpha1.SchemeGroupVersion.WithResource("clustermanagementaddons"),
v1alpha1.SchemeGroupVersion.WithKind("ClusterManagementAddOn"),
func() *v1alpha1.ClusterManagementAddOn { return &v1alpha1.ClusterManagementAddOn{} },
func() *v1alpha1.ClusterManagementAddOnList { return &v1alpha1.ClusterManagementAddOnList{} },
func(dst, src *v1alpha1.ClusterManagementAddOnList) { dst.ListMeta = src.ListMeta },
func(list *v1alpha1.ClusterManagementAddOnList) []*v1alpha1.ClusterManagementAddOn {
return gentype.ToPointerSlice(list.Items)
},
func(list *v1alpha1.ClusterManagementAddOnList, items []*v1alpha1.ClusterManagementAddOn) {
list.Items = gentype.FromPointerSlice(items)
},
),
fake,
}
return obj.(*v1alpha1.ClusterManagementAddOn), err
}
// List takes label and field selectors, and returns the list of ClusterManagementAddOns that match those selectors.
func (c *FakeClusterManagementAddOns) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterManagementAddOnList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(clustermanagementaddonsResource, clustermanagementaddonsKind, opts), &v1alpha1.ClusterManagementAddOnList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.ClusterManagementAddOnList{ListMeta: obj.(*v1alpha1.ClusterManagementAddOnList).ListMeta}
for _, item := range obj.(*v1alpha1.ClusterManagementAddOnList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested clusterManagementAddOns.
func (c *FakeClusterManagementAddOns) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(clustermanagementaddonsResource, opts))
}
// Create takes the representation of a clusterManagementAddOn and creates it. Returns the server's representation of the clusterManagementAddOn, and an error, if there is any.
func (c *FakeClusterManagementAddOns) Create(ctx context.Context, clusterManagementAddOn *v1alpha1.ClusterManagementAddOn, opts v1.CreateOptions) (result *v1alpha1.ClusterManagementAddOn, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(clustermanagementaddonsResource, clusterManagementAddOn), &v1alpha1.ClusterManagementAddOn{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterManagementAddOn), err
}
// Update takes the representation of a clusterManagementAddOn and updates it. Returns the server's representation of the clusterManagementAddOn, and an error, if there is any.
func (c *FakeClusterManagementAddOns) Update(ctx context.Context, clusterManagementAddOn *v1alpha1.ClusterManagementAddOn, opts v1.UpdateOptions) (result *v1alpha1.ClusterManagementAddOn, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(clustermanagementaddonsResource, clusterManagementAddOn), &v1alpha1.ClusterManagementAddOn{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterManagementAddOn), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeClusterManagementAddOns) UpdateStatus(ctx context.Context, clusterManagementAddOn *v1alpha1.ClusterManagementAddOn, opts v1.UpdateOptions) (*v1alpha1.ClusterManagementAddOn, error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(clustermanagementaddonsResource, "status", clusterManagementAddOn), &v1alpha1.ClusterManagementAddOn{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterManagementAddOn), err
}
// Delete takes name of the clusterManagementAddOn and deletes it. Returns an error if one occurs.
func (c *FakeClusterManagementAddOns) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteActionWithOptions(clustermanagementaddonsResource, name, opts), &v1alpha1.ClusterManagementAddOn{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeClusterManagementAddOns) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(clustermanagementaddonsResource, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.ClusterManagementAddOnList{})
return err
}
// Patch applies the patch and returns the patched clusterManagementAddOn.
func (c *FakeClusterManagementAddOns) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterManagementAddOn, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(clustermanagementaddonsResource, name, pt, data, subresources...), &v1alpha1.ClusterManagementAddOn{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterManagementAddOn), err
}

View File

@@ -3,123 +3,34 @@
package fake
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
gentype "k8s.io/client-go/gentype"
v1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
addonv1alpha1 "open-cluster-management.io/api/client/addon/clientset/versioned/typed/addon/v1alpha1"
)
// FakeManagedClusterAddOns implements ManagedClusterAddOnInterface
type FakeManagedClusterAddOns struct {
// fakeManagedClusterAddOns implements ManagedClusterAddOnInterface
type fakeManagedClusterAddOns struct {
*gentype.FakeClientWithList[*v1alpha1.ManagedClusterAddOn, *v1alpha1.ManagedClusterAddOnList]
Fake *FakeAddonV1alpha1
ns string
}
var managedclusteraddonsResource = v1alpha1.SchemeGroupVersion.WithResource("managedclusteraddons")
var managedclusteraddonsKind = v1alpha1.SchemeGroupVersion.WithKind("ManagedClusterAddOn")
// Get takes name of the managedClusterAddOn, and returns the corresponding managedClusterAddOn object, and an error if there is any.
func (c *FakeManagedClusterAddOns) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ManagedClusterAddOn, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(managedclusteraddonsResource, c.ns, name), &v1alpha1.ManagedClusterAddOn{})
if obj == nil {
return nil, err
func newFakeManagedClusterAddOns(fake *FakeAddonV1alpha1, namespace string) addonv1alpha1.ManagedClusterAddOnInterface {
return &fakeManagedClusterAddOns{
gentype.NewFakeClientWithList[*v1alpha1.ManagedClusterAddOn, *v1alpha1.ManagedClusterAddOnList](
fake.Fake,
namespace,
v1alpha1.SchemeGroupVersion.WithResource("managedclusteraddons"),
v1alpha1.SchemeGroupVersion.WithKind("ManagedClusterAddOn"),
func() *v1alpha1.ManagedClusterAddOn { return &v1alpha1.ManagedClusterAddOn{} },
func() *v1alpha1.ManagedClusterAddOnList { return &v1alpha1.ManagedClusterAddOnList{} },
func(dst, src *v1alpha1.ManagedClusterAddOnList) { dst.ListMeta = src.ListMeta },
func(list *v1alpha1.ManagedClusterAddOnList) []*v1alpha1.ManagedClusterAddOn {
return gentype.ToPointerSlice(list.Items)
},
func(list *v1alpha1.ManagedClusterAddOnList, items []*v1alpha1.ManagedClusterAddOn) {
list.Items = gentype.FromPointerSlice(items)
},
),
fake,
}
return obj.(*v1alpha1.ManagedClusterAddOn), err
}
// List takes label and field selectors, and returns the list of ManagedClusterAddOns that match those selectors.
func (c *FakeManagedClusterAddOns) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ManagedClusterAddOnList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(managedclusteraddonsResource, managedclusteraddonsKind, c.ns, opts), &v1alpha1.ManagedClusterAddOnList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.ManagedClusterAddOnList{ListMeta: obj.(*v1alpha1.ManagedClusterAddOnList).ListMeta}
for _, item := range obj.(*v1alpha1.ManagedClusterAddOnList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested managedClusterAddOns.
func (c *FakeManagedClusterAddOns) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(managedclusteraddonsResource, c.ns, opts))
}
// Create takes the representation of a managedClusterAddOn and creates it. Returns the server's representation of the managedClusterAddOn, and an error, if there is any.
func (c *FakeManagedClusterAddOns) Create(ctx context.Context, managedClusterAddOn *v1alpha1.ManagedClusterAddOn, opts v1.CreateOptions) (result *v1alpha1.ManagedClusterAddOn, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(managedclusteraddonsResource, c.ns, managedClusterAddOn), &v1alpha1.ManagedClusterAddOn{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ManagedClusterAddOn), err
}
// Update takes the representation of a managedClusterAddOn and updates it. Returns the server's representation of the managedClusterAddOn, and an error, if there is any.
func (c *FakeManagedClusterAddOns) Update(ctx context.Context, managedClusterAddOn *v1alpha1.ManagedClusterAddOn, opts v1.UpdateOptions) (result *v1alpha1.ManagedClusterAddOn, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(managedclusteraddonsResource, c.ns, managedClusterAddOn), &v1alpha1.ManagedClusterAddOn{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ManagedClusterAddOn), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeManagedClusterAddOns) UpdateStatus(ctx context.Context, managedClusterAddOn *v1alpha1.ManagedClusterAddOn, opts v1.UpdateOptions) (*v1alpha1.ManagedClusterAddOn, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(managedclusteraddonsResource, "status", c.ns, managedClusterAddOn), &v1alpha1.ManagedClusterAddOn{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ManagedClusterAddOn), err
}
// Delete takes name of the managedClusterAddOn and deletes it. Returns an error if one occurs.
func (c *FakeManagedClusterAddOns) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteActionWithOptions(managedclusteraddonsResource, c.ns, name, opts), &v1alpha1.ManagedClusterAddOn{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeManagedClusterAddOns) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(managedclusteraddonsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.ManagedClusterAddOnList{})
return err
}
// Patch applies the patch and returns the patched managedClusterAddOn.
func (c *FakeManagedClusterAddOns) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ManagedClusterAddOn, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(managedclusteraddonsResource, c.ns, name, pt, data, subresources...), &v1alpha1.ManagedClusterAddOn{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ManagedClusterAddOn), err
}

View File

@@ -3,14 +3,13 @@
package v1alpha1
import (
"context"
"time"
context "context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
v1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
gentype "k8s.io/client-go/gentype"
addonv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
scheme "open-cluster-management.io/api/client/addon/clientset/versioned/scheme"
)
@@ -22,158 +21,34 @@ type ManagedClusterAddOnsGetter interface {
// ManagedClusterAddOnInterface has methods to work with ManagedClusterAddOn resources.
type ManagedClusterAddOnInterface interface {
Create(ctx context.Context, managedClusterAddOn *v1alpha1.ManagedClusterAddOn, opts v1.CreateOptions) (*v1alpha1.ManagedClusterAddOn, error)
Update(ctx context.Context, managedClusterAddOn *v1alpha1.ManagedClusterAddOn, opts v1.UpdateOptions) (*v1alpha1.ManagedClusterAddOn, error)
UpdateStatus(ctx context.Context, managedClusterAddOn *v1alpha1.ManagedClusterAddOn, opts v1.UpdateOptions) (*v1alpha1.ManagedClusterAddOn, error)
Create(ctx context.Context, managedClusterAddOn *addonv1alpha1.ManagedClusterAddOn, opts v1.CreateOptions) (*addonv1alpha1.ManagedClusterAddOn, error)
Update(ctx context.Context, managedClusterAddOn *addonv1alpha1.ManagedClusterAddOn, opts v1.UpdateOptions) (*addonv1alpha1.ManagedClusterAddOn, error)
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, managedClusterAddOn *addonv1alpha1.ManagedClusterAddOn, opts v1.UpdateOptions) (*addonv1alpha1.ManagedClusterAddOn, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ManagedClusterAddOn, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ManagedClusterAddOnList, error)
Get(ctx context.Context, name string, opts v1.GetOptions) (*addonv1alpha1.ManagedClusterAddOn, error)
List(ctx context.Context, opts v1.ListOptions) (*addonv1alpha1.ManagedClusterAddOnList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ManagedClusterAddOn, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *addonv1alpha1.ManagedClusterAddOn, err error)
ManagedClusterAddOnExpansion
}
// managedClusterAddOns implements ManagedClusterAddOnInterface
type managedClusterAddOns struct {
client rest.Interface
ns string
*gentype.ClientWithList[*addonv1alpha1.ManagedClusterAddOn, *addonv1alpha1.ManagedClusterAddOnList]
}
// newManagedClusterAddOns returns a ManagedClusterAddOns
func newManagedClusterAddOns(c *AddonV1alpha1Client, namespace string) *managedClusterAddOns {
return &managedClusterAddOns{
client: c.RESTClient(),
ns: namespace,
gentype.NewClientWithList[*addonv1alpha1.ManagedClusterAddOn, *addonv1alpha1.ManagedClusterAddOnList](
"managedclusteraddons",
c.RESTClient(),
scheme.ParameterCodec,
namespace,
func() *addonv1alpha1.ManagedClusterAddOn { return &addonv1alpha1.ManagedClusterAddOn{} },
func() *addonv1alpha1.ManagedClusterAddOnList { return &addonv1alpha1.ManagedClusterAddOnList{} },
),
}
}
// Get takes name of the managedClusterAddOn, and returns the corresponding managedClusterAddOn object, and an error if there is any.
func (c *managedClusterAddOns) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ManagedClusterAddOn, err error) {
result = &v1alpha1.ManagedClusterAddOn{}
err = c.client.Get().
Namespace(c.ns).
Resource("managedclusteraddons").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of ManagedClusterAddOns that match those selectors.
func (c *managedClusterAddOns) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ManagedClusterAddOnList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ManagedClusterAddOnList{}
err = c.client.Get().
Namespace(c.ns).
Resource("managedclusteraddons").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested managedClusterAddOns.
func (c *managedClusterAddOns) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("managedclusteraddons").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a managedClusterAddOn and creates it. Returns the server's representation of the managedClusterAddOn, and an error, if there is any.
func (c *managedClusterAddOns) Create(ctx context.Context, managedClusterAddOn *v1alpha1.ManagedClusterAddOn, opts v1.CreateOptions) (result *v1alpha1.ManagedClusterAddOn, err error) {
result = &v1alpha1.ManagedClusterAddOn{}
err = c.client.Post().
Namespace(c.ns).
Resource("managedclusteraddons").
VersionedParams(&opts, scheme.ParameterCodec).
Body(managedClusterAddOn).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a managedClusterAddOn and updates it. Returns the server's representation of the managedClusterAddOn, and an error, if there is any.
func (c *managedClusterAddOns) Update(ctx context.Context, managedClusterAddOn *v1alpha1.ManagedClusterAddOn, opts v1.UpdateOptions) (result *v1alpha1.ManagedClusterAddOn, err error) {
result = &v1alpha1.ManagedClusterAddOn{}
err = c.client.Put().
Namespace(c.ns).
Resource("managedclusteraddons").
Name(managedClusterAddOn.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(managedClusterAddOn).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *managedClusterAddOns) UpdateStatus(ctx context.Context, managedClusterAddOn *v1alpha1.ManagedClusterAddOn, opts v1.UpdateOptions) (result *v1alpha1.ManagedClusterAddOn, err error) {
result = &v1alpha1.ManagedClusterAddOn{}
err = c.client.Put().
Namespace(c.ns).
Resource("managedclusteraddons").
Name(managedClusterAddOn.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(managedClusterAddOn).
Do(ctx).
Into(result)
return
}
// Delete takes name of the managedClusterAddOn and deletes it. Returns an error if one occurs.
func (c *managedClusterAddOns) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("managedclusteraddons").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *managedClusterAddOns) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("managedclusteraddons").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched managedClusterAddOn.
func (c *managedClusterAddOns) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ManagedClusterAddOn, err error) {
result = &v1alpha1.ManagedClusterAddOn{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("managedclusteraddons").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -3,24 +3,24 @@
package v1alpha1
import (
"context"
context "context"
time "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
addonv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
apiaddonv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
versioned "open-cluster-management.io/api/client/addon/clientset/versioned"
internalinterfaces "open-cluster-management.io/api/client/addon/informers/externalversions/internalinterfaces"
v1alpha1 "open-cluster-management.io/api/client/addon/listers/addon/v1alpha1"
addonv1alpha1 "open-cluster-management.io/api/client/addon/listers/addon/v1alpha1"
)
// AddOnDeploymentConfigInformer provides access to a shared informer and lister for
// AddOnDeploymentConfigs.
type AddOnDeploymentConfigInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.AddOnDeploymentConfigLister
Lister() addonv1alpha1.AddOnDeploymentConfigLister
}
type addOnDeploymentConfigInformer struct {
@@ -55,7 +55,7 @@ func NewFilteredAddOnDeploymentConfigInformer(client versioned.Interface, namesp
return client.AddonV1alpha1().AddOnDeploymentConfigs(namespace).Watch(context.TODO(), options)
},
},
&addonv1alpha1.AddOnDeploymentConfig{},
&apiaddonv1alpha1.AddOnDeploymentConfig{},
resyncPeriod,
indexers,
)
@@ -66,9 +66,9 @@ func (f *addOnDeploymentConfigInformer) defaultInformer(client versioned.Interfa
}
func (f *addOnDeploymentConfigInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&addonv1alpha1.AddOnDeploymentConfig{}, f.defaultInformer)
return f.factory.InformerFor(&apiaddonv1alpha1.AddOnDeploymentConfig{}, f.defaultInformer)
}
func (f *addOnDeploymentConfigInformer) Lister() v1alpha1.AddOnDeploymentConfigLister {
return v1alpha1.NewAddOnDeploymentConfigLister(f.Informer().GetIndexer())
func (f *addOnDeploymentConfigInformer) Lister() addonv1alpha1.AddOnDeploymentConfigLister {
return addonv1alpha1.NewAddOnDeploymentConfigLister(f.Informer().GetIndexer())
}

View File

@@ -3,24 +3,24 @@
package v1alpha1
import (
"context"
context "context"
time "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
addonv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
apiaddonv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
versioned "open-cluster-management.io/api/client/addon/clientset/versioned"
internalinterfaces "open-cluster-management.io/api/client/addon/informers/externalversions/internalinterfaces"
v1alpha1 "open-cluster-management.io/api/client/addon/listers/addon/v1alpha1"
addonv1alpha1 "open-cluster-management.io/api/client/addon/listers/addon/v1alpha1"
)
// AddOnTemplateInformer provides access to a shared informer and lister for
// AddOnTemplates.
type AddOnTemplateInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.AddOnTemplateLister
Lister() addonv1alpha1.AddOnTemplateLister
}
type addOnTemplateInformer struct {
@@ -54,7 +54,7 @@ func NewFilteredAddOnTemplateInformer(client versioned.Interface, resyncPeriod t
return client.AddonV1alpha1().AddOnTemplates().Watch(context.TODO(), options)
},
},
&addonv1alpha1.AddOnTemplate{},
&apiaddonv1alpha1.AddOnTemplate{},
resyncPeriod,
indexers,
)
@@ -65,9 +65,9 @@ func (f *addOnTemplateInformer) defaultInformer(client versioned.Interface, resy
}
func (f *addOnTemplateInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&addonv1alpha1.AddOnTemplate{}, f.defaultInformer)
return f.factory.InformerFor(&apiaddonv1alpha1.AddOnTemplate{}, f.defaultInformer)
}
func (f *addOnTemplateInformer) Lister() v1alpha1.AddOnTemplateLister {
return v1alpha1.NewAddOnTemplateLister(f.Informer().GetIndexer())
func (f *addOnTemplateInformer) Lister() addonv1alpha1.AddOnTemplateLister {
return addonv1alpha1.NewAddOnTemplateLister(f.Informer().GetIndexer())
}

View File

@@ -3,24 +3,24 @@
package v1alpha1
import (
"context"
context "context"
time "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
addonv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
apiaddonv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
versioned "open-cluster-management.io/api/client/addon/clientset/versioned"
internalinterfaces "open-cluster-management.io/api/client/addon/informers/externalversions/internalinterfaces"
v1alpha1 "open-cluster-management.io/api/client/addon/listers/addon/v1alpha1"
addonv1alpha1 "open-cluster-management.io/api/client/addon/listers/addon/v1alpha1"
)
// ClusterManagementAddOnInformer provides access to a shared informer and lister for
// ClusterManagementAddOns.
type ClusterManagementAddOnInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.ClusterManagementAddOnLister
Lister() addonv1alpha1.ClusterManagementAddOnLister
}
type clusterManagementAddOnInformer struct {
@@ -54,7 +54,7 @@ func NewFilteredClusterManagementAddOnInformer(client versioned.Interface, resyn
return client.AddonV1alpha1().ClusterManagementAddOns().Watch(context.TODO(), options)
},
},
&addonv1alpha1.ClusterManagementAddOn{},
&apiaddonv1alpha1.ClusterManagementAddOn{},
resyncPeriod,
indexers,
)
@@ -65,9 +65,9 @@ func (f *clusterManagementAddOnInformer) defaultInformer(client versioned.Interf
}
func (f *clusterManagementAddOnInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&addonv1alpha1.ClusterManagementAddOn{}, f.defaultInformer)
return f.factory.InformerFor(&apiaddonv1alpha1.ClusterManagementAddOn{}, f.defaultInformer)
}
func (f *clusterManagementAddOnInformer) Lister() v1alpha1.ClusterManagementAddOnLister {
return v1alpha1.NewClusterManagementAddOnLister(f.Informer().GetIndexer())
func (f *clusterManagementAddOnInformer) Lister() addonv1alpha1.ClusterManagementAddOnLister {
return addonv1alpha1.NewClusterManagementAddOnLister(f.Informer().GetIndexer())
}

View File

@@ -3,24 +3,24 @@
package v1alpha1
import (
"context"
context "context"
time "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
addonv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
apiaddonv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
versioned "open-cluster-management.io/api/client/addon/clientset/versioned"
internalinterfaces "open-cluster-management.io/api/client/addon/informers/externalversions/internalinterfaces"
v1alpha1 "open-cluster-management.io/api/client/addon/listers/addon/v1alpha1"
addonv1alpha1 "open-cluster-management.io/api/client/addon/listers/addon/v1alpha1"
)
// ManagedClusterAddOnInformer provides access to a shared informer and lister for
// ManagedClusterAddOns.
type ManagedClusterAddOnInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.ManagedClusterAddOnLister
Lister() addonv1alpha1.ManagedClusterAddOnLister
}
type managedClusterAddOnInformer struct {
@@ -55,7 +55,7 @@ func NewFilteredManagedClusterAddOnInformer(client versioned.Interface, namespac
return client.AddonV1alpha1().ManagedClusterAddOns(namespace).Watch(context.TODO(), options)
},
},
&addonv1alpha1.ManagedClusterAddOn{},
&apiaddonv1alpha1.ManagedClusterAddOn{},
resyncPeriod,
indexers,
)
@@ -66,9 +66,9 @@ func (f *managedClusterAddOnInformer) defaultInformer(client versioned.Interface
}
func (f *managedClusterAddOnInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&addonv1alpha1.ManagedClusterAddOn{}, f.defaultInformer)
return f.factory.InformerFor(&apiaddonv1alpha1.ManagedClusterAddOn{}, f.defaultInformer)
}
func (f *managedClusterAddOnInformer) Lister() v1alpha1.ManagedClusterAddOnLister {
return v1alpha1.NewManagedClusterAddOnLister(f.Informer().GetIndexer())
func (f *managedClusterAddOnInformer) Lister() addonv1alpha1.ManagedClusterAddOnLister {
return addonv1alpha1.NewManagedClusterAddOnLister(f.Informer().GetIndexer())
}

View File

@@ -212,6 +212,7 @@ type SharedInformerFactory interface {
// Start initializes all requested informers. They are handled in goroutines
// which run until the stop channel gets closed.
// Warning: Start does not block. When run in a go-routine, it will race with a later WaitForCacheSync.
Start(stopCh <-chan struct{})
// Shutdown marks a factory as shutting down. At that point no new

View File

@@ -3,7 +3,7 @@
package externalversions
import (
"fmt"
fmt "fmt"
schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache"

View File

@@ -3,10 +3,10 @@
package v1alpha1
import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
v1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
labels "k8s.io/apimachinery/pkg/labels"
listers "k8s.io/client-go/listers"
cache "k8s.io/client-go/tools/cache"
addonv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
)
// AddOnDeploymentConfigLister helps list AddOnDeploymentConfigs.
@@ -14,7 +14,7 @@ import (
type AddOnDeploymentConfigLister interface {
// List lists all AddOnDeploymentConfigs in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.AddOnDeploymentConfig, err error)
List(selector labels.Selector) (ret []*addonv1alpha1.AddOnDeploymentConfig, err error)
// AddOnDeploymentConfigs returns an object that can list and get AddOnDeploymentConfigs.
AddOnDeploymentConfigs(namespace string) AddOnDeploymentConfigNamespaceLister
AddOnDeploymentConfigListerExpansion
@@ -22,25 +22,17 @@ type AddOnDeploymentConfigLister interface {
// addOnDeploymentConfigLister implements the AddOnDeploymentConfigLister interface.
type addOnDeploymentConfigLister struct {
indexer cache.Indexer
listers.ResourceIndexer[*addonv1alpha1.AddOnDeploymentConfig]
}
// NewAddOnDeploymentConfigLister returns a new AddOnDeploymentConfigLister.
func NewAddOnDeploymentConfigLister(indexer cache.Indexer) AddOnDeploymentConfigLister {
return &addOnDeploymentConfigLister{indexer: indexer}
}
// List lists all AddOnDeploymentConfigs in the indexer.
func (s *addOnDeploymentConfigLister) List(selector labels.Selector) (ret []*v1alpha1.AddOnDeploymentConfig, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.AddOnDeploymentConfig))
})
return ret, err
return &addOnDeploymentConfigLister{listers.New[*addonv1alpha1.AddOnDeploymentConfig](indexer, addonv1alpha1.Resource("addondeploymentconfig"))}
}
// AddOnDeploymentConfigs returns an object that can list and get AddOnDeploymentConfigs.
func (s *addOnDeploymentConfigLister) AddOnDeploymentConfigs(namespace string) AddOnDeploymentConfigNamespaceLister {
return addOnDeploymentConfigNamespaceLister{indexer: s.indexer, namespace: namespace}
return addOnDeploymentConfigNamespaceLister{listers.NewNamespaced[*addonv1alpha1.AddOnDeploymentConfig](s.ResourceIndexer, namespace)}
}
// AddOnDeploymentConfigNamespaceLister helps list and get AddOnDeploymentConfigs.
@@ -48,36 +40,15 @@ func (s *addOnDeploymentConfigLister) AddOnDeploymentConfigs(namespace string) A
type AddOnDeploymentConfigNamespaceLister interface {
// List lists all AddOnDeploymentConfigs in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.AddOnDeploymentConfig, err error)
List(selector labels.Selector) (ret []*addonv1alpha1.AddOnDeploymentConfig, err error)
// Get retrieves the AddOnDeploymentConfig from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha1.AddOnDeploymentConfig, error)
Get(name string) (*addonv1alpha1.AddOnDeploymentConfig, error)
AddOnDeploymentConfigNamespaceListerExpansion
}
// addOnDeploymentConfigNamespaceLister implements the AddOnDeploymentConfigNamespaceLister
// interface.
type addOnDeploymentConfigNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all AddOnDeploymentConfigs in the indexer for a given namespace.
func (s addOnDeploymentConfigNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.AddOnDeploymentConfig, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.AddOnDeploymentConfig))
})
return ret, err
}
// Get retrieves the AddOnDeploymentConfig from the indexer for a given namespace and name.
func (s addOnDeploymentConfigNamespaceLister) Get(name string) (*v1alpha1.AddOnDeploymentConfig, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("addondeploymentconfig"), name)
}
return obj.(*v1alpha1.AddOnDeploymentConfig), nil
listers.ResourceIndexer[*addonv1alpha1.AddOnDeploymentConfig]
}

View File

@@ -3,10 +3,10 @@
package v1alpha1
import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
v1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
labels "k8s.io/apimachinery/pkg/labels"
listers "k8s.io/client-go/listers"
cache "k8s.io/client-go/tools/cache"
addonv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
)
// AddOnTemplateLister helps list AddOnTemplates.
@@ -14,39 +14,19 @@ import (
type AddOnTemplateLister interface {
// List lists all AddOnTemplates in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.AddOnTemplate, err error)
List(selector labels.Selector) (ret []*addonv1alpha1.AddOnTemplate, err error)
// Get retrieves the AddOnTemplate from the index for a given name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha1.AddOnTemplate, error)
Get(name string) (*addonv1alpha1.AddOnTemplate, error)
AddOnTemplateListerExpansion
}
// addOnTemplateLister implements the AddOnTemplateLister interface.
type addOnTemplateLister struct {
indexer cache.Indexer
listers.ResourceIndexer[*addonv1alpha1.AddOnTemplate]
}
// NewAddOnTemplateLister returns a new AddOnTemplateLister.
func NewAddOnTemplateLister(indexer cache.Indexer) AddOnTemplateLister {
return &addOnTemplateLister{indexer: indexer}
}
// List lists all AddOnTemplates in the indexer.
func (s *addOnTemplateLister) List(selector labels.Selector) (ret []*v1alpha1.AddOnTemplate, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.AddOnTemplate))
})
return ret, err
}
// Get retrieves the AddOnTemplate from the index for a given name.
func (s *addOnTemplateLister) Get(name string) (*v1alpha1.AddOnTemplate, error) {
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("addontemplate"), name)
}
return obj.(*v1alpha1.AddOnTemplate), nil
return &addOnTemplateLister{listers.New[*addonv1alpha1.AddOnTemplate](indexer, addonv1alpha1.Resource("addontemplate"))}
}

View File

@@ -3,10 +3,10 @@
package v1alpha1
import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
v1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
labels "k8s.io/apimachinery/pkg/labels"
listers "k8s.io/client-go/listers"
cache "k8s.io/client-go/tools/cache"
addonv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
)
// ClusterManagementAddOnLister helps list ClusterManagementAddOns.
@@ -14,39 +14,19 @@ import (
type ClusterManagementAddOnLister interface {
// List lists all ClusterManagementAddOns in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.ClusterManagementAddOn, err error)
List(selector labels.Selector) (ret []*addonv1alpha1.ClusterManagementAddOn, err error)
// Get retrieves the ClusterManagementAddOn from the index for a given name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha1.ClusterManagementAddOn, error)
Get(name string) (*addonv1alpha1.ClusterManagementAddOn, error)
ClusterManagementAddOnListerExpansion
}
// clusterManagementAddOnLister implements the ClusterManagementAddOnLister interface.
type clusterManagementAddOnLister struct {
indexer cache.Indexer
listers.ResourceIndexer[*addonv1alpha1.ClusterManagementAddOn]
}
// NewClusterManagementAddOnLister returns a new ClusterManagementAddOnLister.
func NewClusterManagementAddOnLister(indexer cache.Indexer) ClusterManagementAddOnLister {
return &clusterManagementAddOnLister{indexer: indexer}
}
// List lists all ClusterManagementAddOns in the indexer.
func (s *clusterManagementAddOnLister) List(selector labels.Selector) (ret []*v1alpha1.ClusterManagementAddOn, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.ClusterManagementAddOn))
})
return ret, err
}
// Get retrieves the ClusterManagementAddOn from the index for a given name.
func (s *clusterManagementAddOnLister) Get(name string) (*v1alpha1.ClusterManagementAddOn, error) {
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("clustermanagementaddon"), name)
}
return obj.(*v1alpha1.ClusterManagementAddOn), nil
return &clusterManagementAddOnLister{listers.New[*addonv1alpha1.ClusterManagementAddOn](indexer, addonv1alpha1.Resource("clustermanagementaddon"))}
}

View File

@@ -3,10 +3,10 @@
package v1alpha1
import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
v1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
labels "k8s.io/apimachinery/pkg/labels"
listers "k8s.io/client-go/listers"
cache "k8s.io/client-go/tools/cache"
addonv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
)
// ManagedClusterAddOnLister helps list ManagedClusterAddOns.
@@ -14,7 +14,7 @@ import (
type ManagedClusterAddOnLister interface {
// List lists all ManagedClusterAddOns in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.ManagedClusterAddOn, err error)
List(selector labels.Selector) (ret []*addonv1alpha1.ManagedClusterAddOn, err error)
// ManagedClusterAddOns returns an object that can list and get ManagedClusterAddOns.
ManagedClusterAddOns(namespace string) ManagedClusterAddOnNamespaceLister
ManagedClusterAddOnListerExpansion
@@ -22,25 +22,17 @@ type ManagedClusterAddOnLister interface {
// managedClusterAddOnLister implements the ManagedClusterAddOnLister interface.
type managedClusterAddOnLister struct {
indexer cache.Indexer
listers.ResourceIndexer[*addonv1alpha1.ManagedClusterAddOn]
}
// NewManagedClusterAddOnLister returns a new ManagedClusterAddOnLister.
func NewManagedClusterAddOnLister(indexer cache.Indexer) ManagedClusterAddOnLister {
return &managedClusterAddOnLister{indexer: indexer}
}
// List lists all ManagedClusterAddOns in the indexer.
func (s *managedClusterAddOnLister) List(selector labels.Selector) (ret []*v1alpha1.ManagedClusterAddOn, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.ManagedClusterAddOn))
})
return ret, err
return &managedClusterAddOnLister{listers.New[*addonv1alpha1.ManagedClusterAddOn](indexer, addonv1alpha1.Resource("managedclusteraddon"))}
}
// ManagedClusterAddOns returns an object that can list and get ManagedClusterAddOns.
func (s *managedClusterAddOnLister) ManagedClusterAddOns(namespace string) ManagedClusterAddOnNamespaceLister {
return managedClusterAddOnNamespaceLister{indexer: s.indexer, namespace: namespace}
return managedClusterAddOnNamespaceLister{listers.NewNamespaced[*addonv1alpha1.ManagedClusterAddOn](s.ResourceIndexer, namespace)}
}
// ManagedClusterAddOnNamespaceLister helps list and get ManagedClusterAddOns.
@@ -48,36 +40,15 @@ func (s *managedClusterAddOnLister) ManagedClusterAddOns(namespace string) Manag
type ManagedClusterAddOnNamespaceLister interface {
// List lists all ManagedClusterAddOns in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.ManagedClusterAddOn, err error)
List(selector labels.Selector) (ret []*addonv1alpha1.ManagedClusterAddOn, err error)
// Get retrieves the ManagedClusterAddOn from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha1.ManagedClusterAddOn, error)
Get(name string) (*addonv1alpha1.ManagedClusterAddOn, error)
ManagedClusterAddOnNamespaceListerExpansion
}
// managedClusterAddOnNamespaceLister implements the ManagedClusterAddOnNamespaceLister
// interface.
type managedClusterAddOnNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all ManagedClusterAddOns in the indexer for a given namespace.
func (s managedClusterAddOnNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ManagedClusterAddOn, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.ManagedClusterAddOn))
})
return ret, err
}
// Get retrieves the ManagedClusterAddOn from the indexer for a given namespace and name.
func (s managedClusterAddOnNamespaceLister) Get(name string) (*v1alpha1.ManagedClusterAddOn, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("managedclusteraddon"), name)
}
return obj.(*v1alpha1.ManagedClusterAddOn), nil
listers.ResourceIndexer[*addonv1alpha1.ManagedClusterAddOn]
}

View File

@@ -3,8 +3,8 @@
package versioned
import (
"fmt"
"net/http"
fmt "fmt"
http "net/http"
discovery "k8s.io/client-go/discovery"
rest "k8s.io/client-go/rest"

View File

@@ -21,8 +21,12 @@ import (
// NewSimpleClientset returns a clientset that will respond with the provided objects.
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
// without applying any validations and/or defaults. It shouldn't be considered a replacement
// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
//
// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves
// server side apply testing. NewClientset is only available when apply configurations are generated (e.g.
// via --with-applyconfig).
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder())
for _, obj := range objects {

View File

@@ -3,11 +3,11 @@
package v1
import (
"net/http"
http "net/http"
rest "k8s.io/client-go/rest"
"open-cluster-management.io/api/client/cluster/clientset/versioned/scheme"
v1 "open-cluster-management.io/api/cluster/v1"
scheme "open-cluster-management.io/api/client/cluster/clientset/versioned/scheme"
clusterv1 "open-cluster-management.io/api/cluster/v1"
)
type ClusterV1Interface interface {
@@ -69,10 +69,10 @@ func New(c rest.Interface) *ClusterV1Client {
}
func setConfigDefaults(config *rest.Config) error {
gv := v1.SchemeGroupVersion
gv := clusterv1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()

View File

@@ -13,7 +13,7 @@ type FakeClusterV1 struct {
}
func (c *FakeClusterV1) ManagedClusters() v1.ManagedClusterInterface {
return &FakeManagedClusters{c}
return newFakeManagedClusters(c)
}
// RESTClient returns a RESTClient that is used to communicate

View File

@@ -3,114 +3,32 @@
package fake
import (
"context"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
gentype "k8s.io/client-go/gentype"
clusterv1 "open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1"
v1 "open-cluster-management.io/api/cluster/v1"
)
// FakeManagedClusters implements ManagedClusterInterface
type FakeManagedClusters struct {
// fakeManagedClusters implements ManagedClusterInterface
type fakeManagedClusters struct {
*gentype.FakeClientWithList[*v1.ManagedCluster, *v1.ManagedClusterList]
Fake *FakeClusterV1
}
var managedclustersResource = v1.SchemeGroupVersion.WithResource("managedclusters")
var managedclustersKind = v1.SchemeGroupVersion.WithKind("ManagedCluster")
// Get takes name of the managedCluster, and returns the corresponding managedCluster object, and an error if there is any.
func (c *FakeManagedClusters) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ManagedCluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(managedclustersResource, name), &v1.ManagedCluster{})
if obj == nil {
return nil, err
func newFakeManagedClusters(fake *FakeClusterV1) clusterv1.ManagedClusterInterface {
return &fakeManagedClusters{
gentype.NewFakeClientWithList[*v1.ManagedCluster, *v1.ManagedClusterList](
fake.Fake,
"",
v1.SchemeGroupVersion.WithResource("managedclusters"),
v1.SchemeGroupVersion.WithKind("ManagedCluster"),
func() *v1.ManagedCluster { return &v1.ManagedCluster{} },
func() *v1.ManagedClusterList { return &v1.ManagedClusterList{} },
func(dst, src *v1.ManagedClusterList) { dst.ListMeta = src.ListMeta },
func(list *v1.ManagedClusterList) []*v1.ManagedCluster { return gentype.ToPointerSlice(list.Items) },
func(list *v1.ManagedClusterList, items []*v1.ManagedCluster) {
list.Items = gentype.FromPointerSlice(items)
},
),
fake,
}
return obj.(*v1.ManagedCluster), err
}
// List takes label and field selectors, and returns the list of ManagedClusters that match those selectors.
func (c *FakeManagedClusters) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ManagedClusterList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(managedclustersResource, managedclustersKind, opts), &v1.ManagedClusterList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1.ManagedClusterList{ListMeta: obj.(*v1.ManagedClusterList).ListMeta}
for _, item := range obj.(*v1.ManagedClusterList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested managedClusters.
func (c *FakeManagedClusters) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(managedclustersResource, opts))
}
// Create takes the representation of a managedCluster and creates it. Returns the server's representation of the managedCluster, and an error, if there is any.
func (c *FakeManagedClusters) Create(ctx context.Context, managedCluster *v1.ManagedCluster, opts metav1.CreateOptions) (result *v1.ManagedCluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(managedclustersResource, managedCluster), &v1.ManagedCluster{})
if obj == nil {
return nil, err
}
return obj.(*v1.ManagedCluster), err
}
// Update takes the representation of a managedCluster and updates it. Returns the server's representation of the managedCluster, and an error, if there is any.
func (c *FakeManagedClusters) Update(ctx context.Context, managedCluster *v1.ManagedCluster, opts metav1.UpdateOptions) (result *v1.ManagedCluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(managedclustersResource, managedCluster), &v1.ManagedCluster{})
if obj == nil {
return nil, err
}
return obj.(*v1.ManagedCluster), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeManagedClusters) UpdateStatus(ctx context.Context, managedCluster *v1.ManagedCluster, opts metav1.UpdateOptions) (*v1.ManagedCluster, error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(managedclustersResource, "status", managedCluster), &v1.ManagedCluster{})
if obj == nil {
return nil, err
}
return obj.(*v1.ManagedCluster), err
}
// Delete takes name of the managedCluster and deletes it. Returns an error if one occurs.
func (c *FakeManagedClusters) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteActionWithOptions(managedclustersResource, name, opts), &v1.ManagedCluster{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeManagedClusters) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(managedclustersResource, listOpts)
_, err := c.Fake.Invokes(action, &v1.ManagedClusterList{})
return err
}
// Patch applies the patch and returns the patched managedCluster.
func (c *FakeManagedClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ManagedCluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(managedclustersResource, name, pt, data, subresources...), &v1.ManagedCluster{})
if obj == nil {
return nil, err
}
return obj.(*v1.ManagedCluster), err
}

View File

@@ -3,15 +3,14 @@
package v1
import (
"context"
"time"
context "context"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
gentype "k8s.io/client-go/gentype"
scheme "open-cluster-management.io/api/client/cluster/clientset/versioned/scheme"
v1 "open-cluster-management.io/api/cluster/v1"
clusterv1 "open-cluster-management.io/api/cluster/v1"
)
// ManagedClustersGetter has a method to return a ManagedClusterInterface.
@@ -22,147 +21,34 @@ type ManagedClustersGetter interface {
// ManagedClusterInterface has methods to work with ManagedCluster resources.
type ManagedClusterInterface interface {
Create(ctx context.Context, managedCluster *v1.ManagedCluster, opts metav1.CreateOptions) (*v1.ManagedCluster, error)
Update(ctx context.Context, managedCluster *v1.ManagedCluster, opts metav1.UpdateOptions) (*v1.ManagedCluster, error)
UpdateStatus(ctx context.Context, managedCluster *v1.ManagedCluster, opts metav1.UpdateOptions) (*v1.ManagedCluster, error)
Create(ctx context.Context, managedCluster *clusterv1.ManagedCluster, opts metav1.CreateOptions) (*clusterv1.ManagedCluster, error)
Update(ctx context.Context, managedCluster *clusterv1.ManagedCluster, opts metav1.UpdateOptions) (*clusterv1.ManagedCluster, error)
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, managedCluster *clusterv1.ManagedCluster, opts metav1.UpdateOptions) (*clusterv1.ManagedCluster, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ManagedCluster, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.ManagedClusterList, error)
Get(ctx context.Context, name string, opts metav1.GetOptions) (*clusterv1.ManagedCluster, error)
List(ctx context.Context, opts metav1.ListOptions) (*clusterv1.ManagedClusterList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ManagedCluster, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *clusterv1.ManagedCluster, err error)
ManagedClusterExpansion
}
// managedClusters implements ManagedClusterInterface
type managedClusters struct {
client rest.Interface
*gentype.ClientWithList[*clusterv1.ManagedCluster, *clusterv1.ManagedClusterList]
}
// newManagedClusters returns a ManagedClusters
func newManagedClusters(c *ClusterV1Client) *managedClusters {
return &managedClusters{
client: c.RESTClient(),
gentype.NewClientWithList[*clusterv1.ManagedCluster, *clusterv1.ManagedClusterList](
"managedclusters",
c.RESTClient(),
scheme.ParameterCodec,
"",
func() *clusterv1.ManagedCluster { return &clusterv1.ManagedCluster{} },
func() *clusterv1.ManagedClusterList { return &clusterv1.ManagedClusterList{} },
),
}
}
// Get takes name of the managedCluster, and returns the corresponding managedCluster object, and an error if there is any.
func (c *managedClusters) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ManagedCluster, err error) {
result = &v1.ManagedCluster{}
err = c.client.Get().
Resource("managedclusters").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of ManagedClusters that match those selectors.
func (c *managedClusters) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ManagedClusterList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ManagedClusterList{}
err = c.client.Get().
Resource("managedclusters").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested managedClusters.
func (c *managedClusters) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Resource("managedclusters").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a managedCluster and creates it. Returns the server's representation of the managedCluster, and an error, if there is any.
func (c *managedClusters) Create(ctx context.Context, managedCluster *v1.ManagedCluster, opts metav1.CreateOptions) (result *v1.ManagedCluster, err error) {
result = &v1.ManagedCluster{}
err = c.client.Post().
Resource("managedclusters").
VersionedParams(&opts, scheme.ParameterCodec).
Body(managedCluster).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a managedCluster and updates it. Returns the server's representation of the managedCluster, and an error, if there is any.
func (c *managedClusters) Update(ctx context.Context, managedCluster *v1.ManagedCluster, opts metav1.UpdateOptions) (result *v1.ManagedCluster, err error) {
result = &v1.ManagedCluster{}
err = c.client.Put().
Resource("managedclusters").
Name(managedCluster.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(managedCluster).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *managedClusters) UpdateStatus(ctx context.Context, managedCluster *v1.ManagedCluster, opts metav1.UpdateOptions) (result *v1.ManagedCluster, err error) {
result = &v1.ManagedCluster{}
err = c.client.Put().
Resource("managedclusters").
Name(managedCluster.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(managedCluster).
Do(ctx).
Into(result)
return
}
// Delete takes name of the managedCluster and deletes it. Returns an error if one occurs.
func (c *managedClusters) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Resource("managedclusters").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *managedClusters) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("managedclusters").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched managedCluster.
func (c *managedClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ManagedCluster, err error) {
result = &v1.ManagedCluster{}
err = c.client.Patch(pt).
Resource("managedclusters").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -3,15 +3,14 @@
package v1alpha1
import (
"context"
"time"
context "context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
gentype "k8s.io/client-go/gentype"
scheme "open-cluster-management.io/api/client/cluster/clientset/versioned/scheme"
v1alpha1 "open-cluster-management.io/api/cluster/v1alpha1"
clusterv1alpha1 "open-cluster-management.io/api/cluster/v1alpha1"
)
// AddOnPlacementScoresGetter has a method to return a AddOnPlacementScoreInterface.
@@ -22,158 +21,34 @@ type AddOnPlacementScoresGetter interface {
// AddOnPlacementScoreInterface has methods to work with AddOnPlacementScore resources.
type AddOnPlacementScoreInterface interface {
Create(ctx context.Context, addOnPlacementScore *v1alpha1.AddOnPlacementScore, opts v1.CreateOptions) (*v1alpha1.AddOnPlacementScore, error)
Update(ctx context.Context, addOnPlacementScore *v1alpha1.AddOnPlacementScore, opts v1.UpdateOptions) (*v1alpha1.AddOnPlacementScore, error)
UpdateStatus(ctx context.Context, addOnPlacementScore *v1alpha1.AddOnPlacementScore, opts v1.UpdateOptions) (*v1alpha1.AddOnPlacementScore, error)
Create(ctx context.Context, addOnPlacementScore *clusterv1alpha1.AddOnPlacementScore, opts v1.CreateOptions) (*clusterv1alpha1.AddOnPlacementScore, error)
Update(ctx context.Context, addOnPlacementScore *clusterv1alpha1.AddOnPlacementScore, opts v1.UpdateOptions) (*clusterv1alpha1.AddOnPlacementScore, error)
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, addOnPlacementScore *clusterv1alpha1.AddOnPlacementScore, opts v1.UpdateOptions) (*clusterv1alpha1.AddOnPlacementScore, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.AddOnPlacementScore, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.AddOnPlacementScoreList, error)
Get(ctx context.Context, name string, opts v1.GetOptions) (*clusterv1alpha1.AddOnPlacementScore, error)
List(ctx context.Context, opts v1.ListOptions) (*clusterv1alpha1.AddOnPlacementScoreList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AddOnPlacementScore, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *clusterv1alpha1.AddOnPlacementScore, err error)
AddOnPlacementScoreExpansion
}
// addOnPlacementScores implements AddOnPlacementScoreInterface
type addOnPlacementScores struct {
client rest.Interface
ns string
*gentype.ClientWithList[*clusterv1alpha1.AddOnPlacementScore, *clusterv1alpha1.AddOnPlacementScoreList]
}
// newAddOnPlacementScores returns a AddOnPlacementScores
func newAddOnPlacementScores(c *ClusterV1alpha1Client, namespace string) *addOnPlacementScores {
return &addOnPlacementScores{
client: c.RESTClient(),
ns: namespace,
gentype.NewClientWithList[*clusterv1alpha1.AddOnPlacementScore, *clusterv1alpha1.AddOnPlacementScoreList](
"addonplacementscores",
c.RESTClient(),
scheme.ParameterCodec,
namespace,
func() *clusterv1alpha1.AddOnPlacementScore { return &clusterv1alpha1.AddOnPlacementScore{} },
func() *clusterv1alpha1.AddOnPlacementScoreList { return &clusterv1alpha1.AddOnPlacementScoreList{} },
),
}
}
// Get takes name of the addOnPlacementScore, and returns the corresponding addOnPlacementScore object, and an error if there is any.
func (c *addOnPlacementScores) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AddOnPlacementScore, err error) {
result = &v1alpha1.AddOnPlacementScore{}
err = c.client.Get().
Namespace(c.ns).
Resource("addonplacementscores").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of AddOnPlacementScores that match those selectors.
func (c *addOnPlacementScores) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.AddOnPlacementScoreList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.AddOnPlacementScoreList{}
err = c.client.Get().
Namespace(c.ns).
Resource("addonplacementscores").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested addOnPlacementScores.
func (c *addOnPlacementScores) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("addonplacementscores").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a addOnPlacementScore and creates it. Returns the server's representation of the addOnPlacementScore, and an error, if there is any.
func (c *addOnPlacementScores) Create(ctx context.Context, addOnPlacementScore *v1alpha1.AddOnPlacementScore, opts v1.CreateOptions) (result *v1alpha1.AddOnPlacementScore, err error) {
result = &v1alpha1.AddOnPlacementScore{}
err = c.client.Post().
Namespace(c.ns).
Resource("addonplacementscores").
VersionedParams(&opts, scheme.ParameterCodec).
Body(addOnPlacementScore).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a addOnPlacementScore and updates it. Returns the server's representation of the addOnPlacementScore, and an error, if there is any.
func (c *addOnPlacementScores) Update(ctx context.Context, addOnPlacementScore *v1alpha1.AddOnPlacementScore, opts v1.UpdateOptions) (result *v1alpha1.AddOnPlacementScore, err error) {
result = &v1alpha1.AddOnPlacementScore{}
err = c.client.Put().
Namespace(c.ns).
Resource("addonplacementscores").
Name(addOnPlacementScore.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(addOnPlacementScore).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *addOnPlacementScores) UpdateStatus(ctx context.Context, addOnPlacementScore *v1alpha1.AddOnPlacementScore, opts v1.UpdateOptions) (result *v1alpha1.AddOnPlacementScore, err error) {
result = &v1alpha1.AddOnPlacementScore{}
err = c.client.Put().
Namespace(c.ns).
Resource("addonplacementscores").
Name(addOnPlacementScore.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(addOnPlacementScore).
Do(ctx).
Into(result)
return
}
// Delete takes name of the addOnPlacementScore and deletes it. Returns an error if one occurs.
func (c *addOnPlacementScores) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("addonplacementscores").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *addOnPlacementScores) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("addonplacementscores").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched addOnPlacementScore.
func (c *addOnPlacementScores) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AddOnPlacementScore, err error) {
result = &v1alpha1.AddOnPlacementScore{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("addonplacementscores").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -3,11 +3,11 @@
package v1alpha1
import (
"net/http"
http "net/http"
rest "k8s.io/client-go/rest"
"open-cluster-management.io/api/client/cluster/clientset/versioned/scheme"
v1alpha1 "open-cluster-management.io/api/cluster/v1alpha1"
scheme "open-cluster-management.io/api/client/cluster/clientset/versioned/scheme"
clusterv1alpha1 "open-cluster-management.io/api/cluster/v1alpha1"
)
type ClusterV1alpha1Interface interface {
@@ -74,10 +74,10 @@ func New(c rest.Interface) *ClusterV1alpha1Client {
}
func setConfigDefaults(config *rest.Config) error {
gv := v1alpha1.SchemeGroupVersion
gv := clusterv1alpha1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()

View File

@@ -3,15 +3,14 @@
package v1alpha1
import (
"context"
"time"
context "context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
gentype "k8s.io/client-go/gentype"
scheme "open-cluster-management.io/api/client/cluster/clientset/versioned/scheme"
v1alpha1 "open-cluster-management.io/api/cluster/v1alpha1"
clusterv1alpha1 "open-cluster-management.io/api/cluster/v1alpha1"
)
// ClusterClaimsGetter has a method to return a ClusterClaimInterface.
@@ -22,131 +21,32 @@ type ClusterClaimsGetter interface {
// ClusterClaimInterface has methods to work with ClusterClaim resources.
type ClusterClaimInterface interface {
Create(ctx context.Context, clusterClaim *v1alpha1.ClusterClaim, opts v1.CreateOptions) (*v1alpha1.ClusterClaim, error)
Update(ctx context.Context, clusterClaim *v1alpha1.ClusterClaim, opts v1.UpdateOptions) (*v1alpha1.ClusterClaim, error)
Create(ctx context.Context, clusterClaim *clusterv1alpha1.ClusterClaim, opts v1.CreateOptions) (*clusterv1alpha1.ClusterClaim, error)
Update(ctx context.Context, clusterClaim *clusterv1alpha1.ClusterClaim, opts v1.UpdateOptions) (*clusterv1alpha1.ClusterClaim, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterClaim, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterClaimList, error)
Get(ctx context.Context, name string, opts v1.GetOptions) (*clusterv1alpha1.ClusterClaim, error)
List(ctx context.Context, opts v1.ListOptions) (*clusterv1alpha1.ClusterClaimList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterClaim, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *clusterv1alpha1.ClusterClaim, err error)
ClusterClaimExpansion
}
// clusterClaims implements ClusterClaimInterface
type clusterClaims struct {
client rest.Interface
*gentype.ClientWithList[*clusterv1alpha1.ClusterClaim, *clusterv1alpha1.ClusterClaimList]
}
// newClusterClaims returns a ClusterClaims
func newClusterClaims(c *ClusterV1alpha1Client) *clusterClaims {
return &clusterClaims{
client: c.RESTClient(),
gentype.NewClientWithList[*clusterv1alpha1.ClusterClaim, *clusterv1alpha1.ClusterClaimList](
"clusterclaims",
c.RESTClient(),
scheme.ParameterCodec,
"",
func() *clusterv1alpha1.ClusterClaim { return &clusterv1alpha1.ClusterClaim{} },
func() *clusterv1alpha1.ClusterClaimList { return &clusterv1alpha1.ClusterClaimList{} },
),
}
}
// Get takes name of the clusterClaim, and returns the corresponding clusterClaim object, and an error if there is any.
func (c *clusterClaims) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterClaim, err error) {
result = &v1alpha1.ClusterClaim{}
err = c.client.Get().
Resource("clusterclaims").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of ClusterClaims that match those selectors.
func (c *clusterClaims) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterClaimList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ClusterClaimList{}
err = c.client.Get().
Resource("clusterclaims").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested clusterClaims.
func (c *clusterClaims) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Resource("clusterclaims").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a clusterClaim and creates it. Returns the server's representation of the clusterClaim, and an error, if there is any.
func (c *clusterClaims) Create(ctx context.Context, clusterClaim *v1alpha1.ClusterClaim, opts v1.CreateOptions) (result *v1alpha1.ClusterClaim, err error) {
result = &v1alpha1.ClusterClaim{}
err = c.client.Post().
Resource("clusterclaims").
VersionedParams(&opts, scheme.ParameterCodec).
Body(clusterClaim).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a clusterClaim and updates it. Returns the server's representation of the clusterClaim, and an error, if there is any.
func (c *clusterClaims) Update(ctx context.Context, clusterClaim *v1alpha1.ClusterClaim, opts v1.UpdateOptions) (result *v1alpha1.ClusterClaim, err error) {
result = &v1alpha1.ClusterClaim{}
err = c.client.Put().
Resource("clusterclaims").
Name(clusterClaim.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(clusterClaim).
Do(ctx).
Into(result)
return
}
// Delete takes name of the clusterClaim and deletes it. Returns an error if one occurs.
func (c *clusterClaims) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Resource("clusterclaims").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *clusterClaims) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("clusterclaims").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched clusterClaim.
func (c *clusterClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterClaim, err error) {
result = &v1alpha1.ClusterClaim{}
err = c.client.Patch(pt).
Resource("clusterclaims").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -3,123 +3,34 @@
package fake
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
gentype "k8s.io/client-go/gentype"
clusterv1alpha1 "open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1"
v1alpha1 "open-cluster-management.io/api/cluster/v1alpha1"
)
// FakeAddOnPlacementScores implements AddOnPlacementScoreInterface
type FakeAddOnPlacementScores struct {
// fakeAddOnPlacementScores implements AddOnPlacementScoreInterface
type fakeAddOnPlacementScores struct {
*gentype.FakeClientWithList[*v1alpha1.AddOnPlacementScore, *v1alpha1.AddOnPlacementScoreList]
Fake *FakeClusterV1alpha1
ns string
}
var addonplacementscoresResource = v1alpha1.SchemeGroupVersion.WithResource("addonplacementscores")
var addonplacementscoresKind = v1alpha1.SchemeGroupVersion.WithKind("AddOnPlacementScore")
// Get takes name of the addOnPlacementScore, and returns the corresponding addOnPlacementScore object, and an error if there is any.
func (c *FakeAddOnPlacementScores) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AddOnPlacementScore, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(addonplacementscoresResource, c.ns, name), &v1alpha1.AddOnPlacementScore{})
if obj == nil {
return nil, err
func newFakeAddOnPlacementScores(fake *FakeClusterV1alpha1, namespace string) clusterv1alpha1.AddOnPlacementScoreInterface {
return &fakeAddOnPlacementScores{
gentype.NewFakeClientWithList[*v1alpha1.AddOnPlacementScore, *v1alpha1.AddOnPlacementScoreList](
fake.Fake,
namespace,
v1alpha1.SchemeGroupVersion.WithResource("addonplacementscores"),
v1alpha1.SchemeGroupVersion.WithKind("AddOnPlacementScore"),
func() *v1alpha1.AddOnPlacementScore { return &v1alpha1.AddOnPlacementScore{} },
func() *v1alpha1.AddOnPlacementScoreList { return &v1alpha1.AddOnPlacementScoreList{} },
func(dst, src *v1alpha1.AddOnPlacementScoreList) { dst.ListMeta = src.ListMeta },
func(list *v1alpha1.AddOnPlacementScoreList) []*v1alpha1.AddOnPlacementScore {
return gentype.ToPointerSlice(list.Items)
},
func(list *v1alpha1.AddOnPlacementScoreList, items []*v1alpha1.AddOnPlacementScore) {
list.Items = gentype.FromPointerSlice(items)
},
),
fake,
}
return obj.(*v1alpha1.AddOnPlacementScore), err
}
// List takes label and field selectors, and returns the list of AddOnPlacementScores that match those selectors.
func (c *FakeAddOnPlacementScores) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.AddOnPlacementScoreList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(addonplacementscoresResource, addonplacementscoresKind, c.ns, opts), &v1alpha1.AddOnPlacementScoreList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.AddOnPlacementScoreList{ListMeta: obj.(*v1alpha1.AddOnPlacementScoreList).ListMeta}
for _, item := range obj.(*v1alpha1.AddOnPlacementScoreList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested addOnPlacementScores.
func (c *FakeAddOnPlacementScores) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(addonplacementscoresResource, c.ns, opts))
}
// Create takes the representation of a addOnPlacementScore and creates it. Returns the server's representation of the addOnPlacementScore, and an error, if there is any.
func (c *FakeAddOnPlacementScores) Create(ctx context.Context, addOnPlacementScore *v1alpha1.AddOnPlacementScore, opts v1.CreateOptions) (result *v1alpha1.AddOnPlacementScore, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(addonplacementscoresResource, c.ns, addOnPlacementScore), &v1alpha1.AddOnPlacementScore{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.AddOnPlacementScore), err
}
// Update takes the representation of a addOnPlacementScore and updates it. Returns the server's representation of the addOnPlacementScore, and an error, if there is any.
func (c *FakeAddOnPlacementScores) Update(ctx context.Context, addOnPlacementScore *v1alpha1.AddOnPlacementScore, opts v1.UpdateOptions) (result *v1alpha1.AddOnPlacementScore, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(addonplacementscoresResource, c.ns, addOnPlacementScore), &v1alpha1.AddOnPlacementScore{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.AddOnPlacementScore), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeAddOnPlacementScores) UpdateStatus(ctx context.Context, addOnPlacementScore *v1alpha1.AddOnPlacementScore, opts v1.UpdateOptions) (*v1alpha1.AddOnPlacementScore, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(addonplacementscoresResource, "status", c.ns, addOnPlacementScore), &v1alpha1.AddOnPlacementScore{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.AddOnPlacementScore), err
}
// Delete takes name of the addOnPlacementScore and deletes it. Returns an error if one occurs.
func (c *FakeAddOnPlacementScores) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteActionWithOptions(addonplacementscoresResource, c.ns, name, opts), &v1alpha1.AddOnPlacementScore{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeAddOnPlacementScores) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(addonplacementscoresResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.AddOnPlacementScoreList{})
return err
}
// Patch applies the patch and returns the patched addOnPlacementScore.
func (c *FakeAddOnPlacementScores) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AddOnPlacementScore, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(addonplacementscoresResource, c.ns, name, pt, data, subresources...), &v1alpha1.AddOnPlacementScore{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.AddOnPlacementScore), err
}

View File

@@ -13,11 +13,11 @@ type FakeClusterV1alpha1 struct {
}
func (c *FakeClusterV1alpha1) AddOnPlacementScores(namespace string) v1alpha1.AddOnPlacementScoreInterface {
return &FakeAddOnPlacementScores{c, namespace}
return newFakeAddOnPlacementScores(c, namespace)
}
func (c *FakeClusterV1alpha1) ClusterClaims() v1alpha1.ClusterClaimInterface {
return &FakeClusterClaims{c}
return newFakeClusterClaims(c)
}
// RESTClient returns a RESTClient that is used to communicate

View File

@@ -3,103 +3,34 @@
package fake
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
gentype "k8s.io/client-go/gentype"
clusterv1alpha1 "open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1alpha1"
v1alpha1 "open-cluster-management.io/api/cluster/v1alpha1"
)
// FakeClusterClaims implements ClusterClaimInterface
type FakeClusterClaims struct {
// fakeClusterClaims implements ClusterClaimInterface
type fakeClusterClaims struct {
*gentype.FakeClientWithList[*v1alpha1.ClusterClaim, *v1alpha1.ClusterClaimList]
Fake *FakeClusterV1alpha1
}
var clusterclaimsResource = v1alpha1.SchemeGroupVersion.WithResource("clusterclaims")
var clusterclaimsKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterClaim")
// Get takes name of the clusterClaim, and returns the corresponding clusterClaim object, and an error if there is any.
func (c *FakeClusterClaims) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterClaim, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(clusterclaimsResource, name), &v1alpha1.ClusterClaim{})
if obj == nil {
return nil, err
func newFakeClusterClaims(fake *FakeClusterV1alpha1) clusterv1alpha1.ClusterClaimInterface {
return &fakeClusterClaims{
gentype.NewFakeClientWithList[*v1alpha1.ClusterClaim, *v1alpha1.ClusterClaimList](
fake.Fake,
"",
v1alpha1.SchemeGroupVersion.WithResource("clusterclaims"),
v1alpha1.SchemeGroupVersion.WithKind("ClusterClaim"),
func() *v1alpha1.ClusterClaim { return &v1alpha1.ClusterClaim{} },
func() *v1alpha1.ClusterClaimList { return &v1alpha1.ClusterClaimList{} },
func(dst, src *v1alpha1.ClusterClaimList) { dst.ListMeta = src.ListMeta },
func(list *v1alpha1.ClusterClaimList) []*v1alpha1.ClusterClaim {
return gentype.ToPointerSlice(list.Items)
},
func(list *v1alpha1.ClusterClaimList, items []*v1alpha1.ClusterClaim) {
list.Items = gentype.FromPointerSlice(items)
},
),
fake,
}
return obj.(*v1alpha1.ClusterClaim), err
}
// List takes label and field selectors, and returns the list of ClusterClaims that match those selectors.
func (c *FakeClusterClaims) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterClaimList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(clusterclaimsResource, clusterclaimsKind, opts), &v1alpha1.ClusterClaimList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.ClusterClaimList{ListMeta: obj.(*v1alpha1.ClusterClaimList).ListMeta}
for _, item := range obj.(*v1alpha1.ClusterClaimList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested clusterClaims.
func (c *FakeClusterClaims) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(clusterclaimsResource, opts))
}
// Create takes the representation of a clusterClaim and creates it. Returns the server's representation of the clusterClaim, and an error, if there is any.
func (c *FakeClusterClaims) Create(ctx context.Context, clusterClaim *v1alpha1.ClusterClaim, opts v1.CreateOptions) (result *v1alpha1.ClusterClaim, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(clusterclaimsResource, clusterClaim), &v1alpha1.ClusterClaim{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterClaim), err
}
// Update takes the representation of a clusterClaim and updates it. Returns the server's representation of the clusterClaim, and an error, if there is any.
func (c *FakeClusterClaims) Update(ctx context.Context, clusterClaim *v1alpha1.ClusterClaim, opts v1.UpdateOptions) (result *v1alpha1.ClusterClaim, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(clusterclaimsResource, clusterClaim), &v1alpha1.ClusterClaim{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterClaim), err
}
// Delete takes name of the clusterClaim and deletes it. Returns an error if one occurs.
func (c *FakeClusterClaims) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteActionWithOptions(clusterclaimsResource, name, opts), &v1alpha1.ClusterClaim{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeClusterClaims) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(clusterclaimsResource, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.ClusterClaimList{})
return err
}
// Patch applies the patch and returns the patched clusterClaim.
func (c *FakeClusterClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterClaim, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(clusterclaimsResource, name, pt, data, subresources...), &v1alpha1.ClusterClaim{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterClaim), err
}

View File

@@ -3,11 +3,11 @@
package v1beta1
import (
"net/http"
http "net/http"
rest "k8s.io/client-go/rest"
"open-cluster-management.io/api/client/cluster/clientset/versioned/scheme"
v1beta1 "open-cluster-management.io/api/cluster/v1beta1"
scheme "open-cluster-management.io/api/client/cluster/clientset/versioned/scheme"
clusterv1beta1 "open-cluster-management.io/api/cluster/v1beta1"
)
type ClusterV1beta1Interface interface {
@@ -74,10 +74,10 @@ func New(c rest.Interface) *ClusterV1beta1Client {
}
func setConfigDefaults(config *rest.Config) error {
gv := v1beta1.SchemeGroupVersion
gv := clusterv1beta1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()

View File

@@ -13,11 +13,11 @@ type FakeClusterV1beta1 struct {
}
func (c *FakeClusterV1beta1) Placements(namespace string) v1beta1.PlacementInterface {
return &FakePlacements{c, namespace}
return newFakePlacements(c, namespace)
}
func (c *FakeClusterV1beta1) PlacementDecisions(namespace string) v1beta1.PlacementDecisionInterface {
return &FakePlacementDecisions{c, namespace}
return newFakePlacementDecisions(c, namespace)
}
// RESTClient returns a RESTClient that is used to communicate

View File

@@ -3,123 +3,32 @@
package fake
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
gentype "k8s.io/client-go/gentype"
clusterv1beta1 "open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta1"
v1beta1 "open-cluster-management.io/api/cluster/v1beta1"
)
// FakePlacements implements PlacementInterface
type FakePlacements struct {
// fakePlacements implements PlacementInterface
type fakePlacements struct {
*gentype.FakeClientWithList[*v1beta1.Placement, *v1beta1.PlacementList]
Fake *FakeClusterV1beta1
ns string
}
var placementsResource = v1beta1.SchemeGroupVersion.WithResource("placements")
var placementsKind = v1beta1.SchemeGroupVersion.WithKind("Placement")
// Get takes name of the placement, and returns the corresponding placement object, and an error if there is any.
func (c *FakePlacements) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Placement, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(placementsResource, c.ns, name), &v1beta1.Placement{})
if obj == nil {
return nil, err
func newFakePlacements(fake *FakeClusterV1beta1, namespace string) clusterv1beta1.PlacementInterface {
return &fakePlacements{
gentype.NewFakeClientWithList[*v1beta1.Placement, *v1beta1.PlacementList](
fake.Fake,
namespace,
v1beta1.SchemeGroupVersion.WithResource("placements"),
v1beta1.SchemeGroupVersion.WithKind("Placement"),
func() *v1beta1.Placement { return &v1beta1.Placement{} },
func() *v1beta1.PlacementList { return &v1beta1.PlacementList{} },
func(dst, src *v1beta1.PlacementList) { dst.ListMeta = src.ListMeta },
func(list *v1beta1.PlacementList) []*v1beta1.Placement { return gentype.ToPointerSlice(list.Items) },
func(list *v1beta1.PlacementList, items []*v1beta1.Placement) {
list.Items = gentype.FromPointerSlice(items)
},
),
fake,
}
return obj.(*v1beta1.Placement), err
}
// List takes label and field selectors, and returns the list of Placements that match those selectors.
func (c *FakePlacements) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PlacementList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(placementsResource, placementsKind, c.ns, opts), &v1beta1.PlacementList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1beta1.PlacementList{ListMeta: obj.(*v1beta1.PlacementList).ListMeta}
for _, item := range obj.(*v1beta1.PlacementList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested placements.
func (c *FakePlacements) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(placementsResource, c.ns, opts))
}
// Create takes the representation of a placement and creates it. Returns the server's representation of the placement, and an error, if there is any.
func (c *FakePlacements) Create(ctx context.Context, placement *v1beta1.Placement, opts v1.CreateOptions) (result *v1beta1.Placement, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(placementsResource, c.ns, placement), &v1beta1.Placement{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Placement), err
}
// Update takes the representation of a placement and updates it. Returns the server's representation of the placement, and an error, if there is any.
func (c *FakePlacements) Update(ctx context.Context, placement *v1beta1.Placement, opts v1.UpdateOptions) (result *v1beta1.Placement, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(placementsResource, c.ns, placement), &v1beta1.Placement{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Placement), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakePlacements) UpdateStatus(ctx context.Context, placement *v1beta1.Placement, opts v1.UpdateOptions) (*v1beta1.Placement, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(placementsResource, "status", c.ns, placement), &v1beta1.Placement{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Placement), err
}
// Delete takes name of the placement and deletes it. Returns an error if one occurs.
func (c *FakePlacements) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteActionWithOptions(placementsResource, c.ns, name, opts), &v1beta1.Placement{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakePlacements) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(placementsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.PlacementList{})
return err
}
// Patch applies the patch and returns the patched placement.
func (c *FakePlacements) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Placement, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(placementsResource, c.ns, name, pt, data, subresources...), &v1beta1.Placement{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Placement), err
}

View File

@@ -3,123 +3,34 @@
package fake
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
gentype "k8s.io/client-go/gentype"
clusterv1beta1 "open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta1"
v1beta1 "open-cluster-management.io/api/cluster/v1beta1"
)
// FakePlacementDecisions implements PlacementDecisionInterface
type FakePlacementDecisions struct {
// fakePlacementDecisions implements PlacementDecisionInterface
type fakePlacementDecisions struct {
*gentype.FakeClientWithList[*v1beta1.PlacementDecision, *v1beta1.PlacementDecisionList]
Fake *FakeClusterV1beta1
ns string
}
var placementdecisionsResource = v1beta1.SchemeGroupVersion.WithResource("placementdecisions")
var placementdecisionsKind = v1beta1.SchemeGroupVersion.WithKind("PlacementDecision")
// Get takes name of the placementDecision, and returns the corresponding placementDecision object, and an error if there is any.
func (c *FakePlacementDecisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PlacementDecision, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(placementdecisionsResource, c.ns, name), &v1beta1.PlacementDecision{})
if obj == nil {
return nil, err
func newFakePlacementDecisions(fake *FakeClusterV1beta1, namespace string) clusterv1beta1.PlacementDecisionInterface {
return &fakePlacementDecisions{
gentype.NewFakeClientWithList[*v1beta1.PlacementDecision, *v1beta1.PlacementDecisionList](
fake.Fake,
namespace,
v1beta1.SchemeGroupVersion.WithResource("placementdecisions"),
v1beta1.SchemeGroupVersion.WithKind("PlacementDecision"),
func() *v1beta1.PlacementDecision { return &v1beta1.PlacementDecision{} },
func() *v1beta1.PlacementDecisionList { return &v1beta1.PlacementDecisionList{} },
func(dst, src *v1beta1.PlacementDecisionList) { dst.ListMeta = src.ListMeta },
func(list *v1beta1.PlacementDecisionList) []*v1beta1.PlacementDecision {
return gentype.ToPointerSlice(list.Items)
},
func(list *v1beta1.PlacementDecisionList, items []*v1beta1.PlacementDecision) {
list.Items = gentype.FromPointerSlice(items)
},
),
fake,
}
return obj.(*v1beta1.PlacementDecision), err
}
// List takes label and field selectors, and returns the list of PlacementDecisions that match those selectors.
func (c *FakePlacementDecisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PlacementDecisionList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(placementdecisionsResource, placementdecisionsKind, c.ns, opts), &v1beta1.PlacementDecisionList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1beta1.PlacementDecisionList{ListMeta: obj.(*v1beta1.PlacementDecisionList).ListMeta}
for _, item := range obj.(*v1beta1.PlacementDecisionList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested placementDecisions.
func (c *FakePlacementDecisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(placementdecisionsResource, c.ns, opts))
}
// Create takes the representation of a placementDecision and creates it. Returns the server's representation of the placementDecision, and an error, if there is any.
func (c *FakePlacementDecisions) Create(ctx context.Context, placementDecision *v1beta1.PlacementDecision, opts v1.CreateOptions) (result *v1beta1.PlacementDecision, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(placementdecisionsResource, c.ns, placementDecision), &v1beta1.PlacementDecision{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.PlacementDecision), err
}
// Update takes the representation of a placementDecision and updates it. Returns the server's representation of the placementDecision, and an error, if there is any.
func (c *FakePlacementDecisions) Update(ctx context.Context, placementDecision *v1beta1.PlacementDecision, opts v1.UpdateOptions) (result *v1beta1.PlacementDecision, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(placementdecisionsResource, c.ns, placementDecision), &v1beta1.PlacementDecision{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.PlacementDecision), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakePlacementDecisions) UpdateStatus(ctx context.Context, placementDecision *v1beta1.PlacementDecision, opts v1.UpdateOptions) (*v1beta1.PlacementDecision, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(placementdecisionsResource, "status", c.ns, placementDecision), &v1beta1.PlacementDecision{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.PlacementDecision), err
}
// Delete takes name of the placementDecision and deletes it. Returns an error if one occurs.
func (c *FakePlacementDecisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteActionWithOptions(placementdecisionsResource, c.ns, name, opts), &v1beta1.PlacementDecision{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakePlacementDecisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(placementdecisionsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.PlacementDecisionList{})
return err
}
// Patch applies the patch and returns the patched placementDecision.
func (c *FakePlacementDecisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PlacementDecision, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(placementdecisionsResource, c.ns, name, pt, data, subresources...), &v1beta1.PlacementDecision{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.PlacementDecision), err
}

View File

@@ -3,15 +3,14 @@
package v1beta1
import (
"context"
"time"
context "context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
gentype "k8s.io/client-go/gentype"
scheme "open-cluster-management.io/api/client/cluster/clientset/versioned/scheme"
v1beta1 "open-cluster-management.io/api/cluster/v1beta1"
clusterv1beta1 "open-cluster-management.io/api/cluster/v1beta1"
)
// PlacementsGetter has a method to return a PlacementInterface.
@@ -22,158 +21,34 @@ type PlacementsGetter interface {
// PlacementInterface has methods to work with Placement resources.
type PlacementInterface interface {
Create(ctx context.Context, placement *v1beta1.Placement, opts v1.CreateOptions) (*v1beta1.Placement, error)
Update(ctx context.Context, placement *v1beta1.Placement, opts v1.UpdateOptions) (*v1beta1.Placement, error)
UpdateStatus(ctx context.Context, placement *v1beta1.Placement, opts v1.UpdateOptions) (*v1beta1.Placement, error)
Create(ctx context.Context, placement *clusterv1beta1.Placement, opts v1.CreateOptions) (*clusterv1beta1.Placement, error)
Update(ctx context.Context, placement *clusterv1beta1.Placement, opts v1.UpdateOptions) (*clusterv1beta1.Placement, error)
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, placement *clusterv1beta1.Placement, opts v1.UpdateOptions) (*clusterv1beta1.Placement, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Placement, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PlacementList, error)
Get(ctx context.Context, name string, opts v1.GetOptions) (*clusterv1beta1.Placement, error)
List(ctx context.Context, opts v1.ListOptions) (*clusterv1beta1.PlacementList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Placement, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *clusterv1beta1.Placement, err error)
PlacementExpansion
}
// placements implements PlacementInterface
type placements struct {
client rest.Interface
ns string
*gentype.ClientWithList[*clusterv1beta1.Placement, *clusterv1beta1.PlacementList]
}
// newPlacements returns a Placements
func newPlacements(c *ClusterV1beta1Client, namespace string) *placements {
return &placements{
client: c.RESTClient(),
ns: namespace,
gentype.NewClientWithList[*clusterv1beta1.Placement, *clusterv1beta1.PlacementList](
"placements",
c.RESTClient(),
scheme.ParameterCodec,
namespace,
func() *clusterv1beta1.Placement { return &clusterv1beta1.Placement{} },
func() *clusterv1beta1.PlacementList { return &clusterv1beta1.PlacementList{} },
),
}
}
// Get takes name of the placement, and returns the corresponding placement object, and an error if there is any.
func (c *placements) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Placement, err error) {
result = &v1beta1.Placement{}
err = c.client.Get().
Namespace(c.ns).
Resource("placements").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Placements that match those selectors.
func (c *placements) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PlacementList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.PlacementList{}
err = c.client.Get().
Namespace(c.ns).
Resource("placements").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested placements.
func (c *placements) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("placements").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a placement and creates it. Returns the server's representation of the placement, and an error, if there is any.
func (c *placements) Create(ctx context.Context, placement *v1beta1.Placement, opts v1.CreateOptions) (result *v1beta1.Placement, err error) {
result = &v1beta1.Placement{}
err = c.client.Post().
Namespace(c.ns).
Resource("placements").
VersionedParams(&opts, scheme.ParameterCodec).
Body(placement).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a placement and updates it. Returns the server's representation of the placement, and an error, if there is any.
func (c *placements) Update(ctx context.Context, placement *v1beta1.Placement, opts v1.UpdateOptions) (result *v1beta1.Placement, err error) {
result = &v1beta1.Placement{}
err = c.client.Put().
Namespace(c.ns).
Resource("placements").
Name(placement.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(placement).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *placements) UpdateStatus(ctx context.Context, placement *v1beta1.Placement, opts v1.UpdateOptions) (result *v1beta1.Placement, err error) {
result = &v1beta1.Placement{}
err = c.client.Put().
Namespace(c.ns).
Resource("placements").
Name(placement.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(placement).
Do(ctx).
Into(result)
return
}
// Delete takes name of the placement and deletes it. Returns an error if one occurs.
func (c *placements) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("placements").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *placements) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("placements").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched placement.
func (c *placements) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Placement, err error) {
result = &v1beta1.Placement{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("placements").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -3,15 +3,14 @@
package v1beta1
import (
"context"
"time"
context "context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
gentype "k8s.io/client-go/gentype"
scheme "open-cluster-management.io/api/client/cluster/clientset/versioned/scheme"
v1beta1 "open-cluster-management.io/api/cluster/v1beta1"
clusterv1beta1 "open-cluster-management.io/api/cluster/v1beta1"
)
// PlacementDecisionsGetter has a method to return a PlacementDecisionInterface.
@@ -22,158 +21,34 @@ type PlacementDecisionsGetter interface {
// PlacementDecisionInterface has methods to work with PlacementDecision resources.
type PlacementDecisionInterface interface {
Create(ctx context.Context, placementDecision *v1beta1.PlacementDecision, opts v1.CreateOptions) (*v1beta1.PlacementDecision, error)
Update(ctx context.Context, placementDecision *v1beta1.PlacementDecision, opts v1.UpdateOptions) (*v1beta1.PlacementDecision, error)
UpdateStatus(ctx context.Context, placementDecision *v1beta1.PlacementDecision, opts v1.UpdateOptions) (*v1beta1.PlacementDecision, error)
Create(ctx context.Context, placementDecision *clusterv1beta1.PlacementDecision, opts v1.CreateOptions) (*clusterv1beta1.PlacementDecision, error)
Update(ctx context.Context, placementDecision *clusterv1beta1.PlacementDecision, opts v1.UpdateOptions) (*clusterv1beta1.PlacementDecision, error)
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, placementDecision *clusterv1beta1.PlacementDecision, opts v1.UpdateOptions) (*clusterv1beta1.PlacementDecision, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.PlacementDecision, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PlacementDecisionList, error)
Get(ctx context.Context, name string, opts v1.GetOptions) (*clusterv1beta1.PlacementDecision, error)
List(ctx context.Context, opts v1.ListOptions) (*clusterv1beta1.PlacementDecisionList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PlacementDecision, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *clusterv1beta1.PlacementDecision, err error)
PlacementDecisionExpansion
}
// placementDecisions implements PlacementDecisionInterface
type placementDecisions struct {
client rest.Interface
ns string
*gentype.ClientWithList[*clusterv1beta1.PlacementDecision, *clusterv1beta1.PlacementDecisionList]
}
// newPlacementDecisions returns a PlacementDecisions
func newPlacementDecisions(c *ClusterV1beta1Client, namespace string) *placementDecisions {
return &placementDecisions{
client: c.RESTClient(),
ns: namespace,
gentype.NewClientWithList[*clusterv1beta1.PlacementDecision, *clusterv1beta1.PlacementDecisionList](
"placementdecisions",
c.RESTClient(),
scheme.ParameterCodec,
namespace,
func() *clusterv1beta1.PlacementDecision { return &clusterv1beta1.PlacementDecision{} },
func() *clusterv1beta1.PlacementDecisionList { return &clusterv1beta1.PlacementDecisionList{} },
),
}
}
// Get takes name of the placementDecision, and returns the corresponding placementDecision object, and an error if there is any.
func (c *placementDecisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PlacementDecision, err error) {
result = &v1beta1.PlacementDecision{}
err = c.client.Get().
Namespace(c.ns).
Resource("placementdecisions").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of PlacementDecisions that match those selectors.
func (c *placementDecisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PlacementDecisionList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.PlacementDecisionList{}
err = c.client.Get().
Namespace(c.ns).
Resource("placementdecisions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested placementDecisions.
func (c *placementDecisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("placementdecisions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a placementDecision and creates it. Returns the server's representation of the placementDecision, and an error, if there is any.
func (c *placementDecisions) Create(ctx context.Context, placementDecision *v1beta1.PlacementDecision, opts v1.CreateOptions) (result *v1beta1.PlacementDecision, err error) {
result = &v1beta1.PlacementDecision{}
err = c.client.Post().
Namespace(c.ns).
Resource("placementdecisions").
VersionedParams(&opts, scheme.ParameterCodec).
Body(placementDecision).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a placementDecision and updates it. Returns the server's representation of the placementDecision, and an error, if there is any.
func (c *placementDecisions) Update(ctx context.Context, placementDecision *v1beta1.PlacementDecision, opts v1.UpdateOptions) (result *v1beta1.PlacementDecision, err error) {
result = &v1beta1.PlacementDecision{}
err = c.client.Put().
Namespace(c.ns).
Resource("placementdecisions").
Name(placementDecision.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(placementDecision).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *placementDecisions) UpdateStatus(ctx context.Context, placementDecision *v1beta1.PlacementDecision, opts v1.UpdateOptions) (result *v1beta1.PlacementDecision, err error) {
result = &v1beta1.PlacementDecision{}
err = c.client.Put().
Namespace(c.ns).
Resource("placementdecisions").
Name(placementDecision.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(placementDecision).
Do(ctx).
Into(result)
return
}
// Delete takes name of the placementDecision and deletes it. Returns an error if one occurs.
func (c *placementDecisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("placementdecisions").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *placementDecisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("placementdecisions").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched placementDecision.
func (c *placementDecisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PlacementDecision, err error) {
result = &v1beta1.PlacementDecision{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("placementdecisions").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -3,11 +3,11 @@
package v1beta2
import (
"net/http"
http "net/http"
rest "k8s.io/client-go/rest"
"open-cluster-management.io/api/client/cluster/clientset/versioned/scheme"
v1beta2 "open-cluster-management.io/api/cluster/v1beta2"
scheme "open-cluster-management.io/api/client/cluster/clientset/versioned/scheme"
clusterv1beta2 "open-cluster-management.io/api/cluster/v1beta2"
)
type ClusterV1beta2Interface interface {
@@ -74,10 +74,10 @@ func New(c rest.Interface) *ClusterV1beta2Client {
}
func setConfigDefaults(config *rest.Config) error {
gv := v1beta2.SchemeGroupVersion
gv := clusterv1beta2.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()

View File

@@ -13,11 +13,11 @@ type FakeClusterV1beta2 struct {
}
func (c *FakeClusterV1beta2) ManagedClusterSets() v1beta2.ManagedClusterSetInterface {
return &FakeManagedClusterSets{c}
return newFakeManagedClusterSets(c)
}
func (c *FakeClusterV1beta2) ManagedClusterSetBindings(namespace string) v1beta2.ManagedClusterSetBindingInterface {
return &FakeManagedClusterSetBindings{c, namespace}
return newFakeManagedClusterSetBindings(c, namespace)
}
// RESTClient returns a RESTClient that is used to communicate

View File

@@ -3,114 +3,34 @@
package fake
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
gentype "k8s.io/client-go/gentype"
clusterv1beta2 "open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2"
v1beta2 "open-cluster-management.io/api/cluster/v1beta2"
)
// FakeManagedClusterSets implements ManagedClusterSetInterface
type FakeManagedClusterSets struct {
// fakeManagedClusterSets implements ManagedClusterSetInterface
type fakeManagedClusterSets struct {
*gentype.FakeClientWithList[*v1beta2.ManagedClusterSet, *v1beta2.ManagedClusterSetList]
Fake *FakeClusterV1beta2
}
var managedclustersetsResource = v1beta2.SchemeGroupVersion.WithResource("managedclustersets")
var managedclustersetsKind = v1beta2.SchemeGroupVersion.WithKind("ManagedClusterSet")
// Get takes name of the managedClusterSet, and returns the corresponding managedClusterSet object, and an error if there is any.
func (c *FakeManagedClusterSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ManagedClusterSet, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(managedclustersetsResource, name), &v1beta2.ManagedClusterSet{})
if obj == nil {
return nil, err
func newFakeManagedClusterSets(fake *FakeClusterV1beta2) clusterv1beta2.ManagedClusterSetInterface {
return &fakeManagedClusterSets{
gentype.NewFakeClientWithList[*v1beta2.ManagedClusterSet, *v1beta2.ManagedClusterSetList](
fake.Fake,
"",
v1beta2.SchemeGroupVersion.WithResource("managedclustersets"),
v1beta2.SchemeGroupVersion.WithKind("ManagedClusterSet"),
func() *v1beta2.ManagedClusterSet { return &v1beta2.ManagedClusterSet{} },
func() *v1beta2.ManagedClusterSetList { return &v1beta2.ManagedClusterSetList{} },
func(dst, src *v1beta2.ManagedClusterSetList) { dst.ListMeta = src.ListMeta },
func(list *v1beta2.ManagedClusterSetList) []*v1beta2.ManagedClusterSet {
return gentype.ToPointerSlice(list.Items)
},
func(list *v1beta2.ManagedClusterSetList, items []*v1beta2.ManagedClusterSet) {
list.Items = gentype.FromPointerSlice(items)
},
),
fake,
}
return obj.(*v1beta2.ManagedClusterSet), err
}
// List takes label and field selectors, and returns the list of ManagedClusterSets that match those selectors.
func (c *FakeManagedClusterSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ManagedClusterSetList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(managedclustersetsResource, managedclustersetsKind, opts), &v1beta2.ManagedClusterSetList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1beta2.ManagedClusterSetList{ListMeta: obj.(*v1beta2.ManagedClusterSetList).ListMeta}
for _, item := range obj.(*v1beta2.ManagedClusterSetList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested managedClusterSets.
func (c *FakeManagedClusterSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(managedclustersetsResource, opts))
}
// Create takes the representation of a managedClusterSet and creates it. Returns the server's representation of the managedClusterSet, and an error, if there is any.
func (c *FakeManagedClusterSets) Create(ctx context.Context, managedClusterSet *v1beta2.ManagedClusterSet, opts v1.CreateOptions) (result *v1beta2.ManagedClusterSet, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(managedclustersetsResource, managedClusterSet), &v1beta2.ManagedClusterSet{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.ManagedClusterSet), err
}
// Update takes the representation of a managedClusterSet and updates it. Returns the server's representation of the managedClusterSet, and an error, if there is any.
func (c *FakeManagedClusterSets) Update(ctx context.Context, managedClusterSet *v1beta2.ManagedClusterSet, opts v1.UpdateOptions) (result *v1beta2.ManagedClusterSet, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(managedclustersetsResource, managedClusterSet), &v1beta2.ManagedClusterSet{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.ManagedClusterSet), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeManagedClusterSets) UpdateStatus(ctx context.Context, managedClusterSet *v1beta2.ManagedClusterSet, opts v1.UpdateOptions) (*v1beta2.ManagedClusterSet, error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(managedclustersetsResource, "status", managedClusterSet), &v1beta2.ManagedClusterSet{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.ManagedClusterSet), err
}
// Delete takes name of the managedClusterSet and deletes it. Returns an error if one occurs.
func (c *FakeManagedClusterSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteActionWithOptions(managedclustersetsResource, name, opts), &v1beta2.ManagedClusterSet{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeManagedClusterSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(managedclustersetsResource, listOpts)
_, err := c.Fake.Invokes(action, &v1beta2.ManagedClusterSetList{})
return err
}
// Patch applies the patch and returns the patched managedClusterSet.
func (c *FakeManagedClusterSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ManagedClusterSet, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(managedclustersetsResource, name, pt, data, subresources...), &v1beta2.ManagedClusterSet{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.ManagedClusterSet), err
}

View File

@@ -3,123 +3,34 @@
package fake
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
gentype "k8s.io/client-go/gentype"
clusterv1beta2 "open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta2"
v1beta2 "open-cluster-management.io/api/cluster/v1beta2"
)
// FakeManagedClusterSetBindings implements ManagedClusterSetBindingInterface
type FakeManagedClusterSetBindings struct {
// fakeManagedClusterSetBindings implements ManagedClusterSetBindingInterface
type fakeManagedClusterSetBindings struct {
*gentype.FakeClientWithList[*v1beta2.ManagedClusterSetBinding, *v1beta2.ManagedClusterSetBindingList]
Fake *FakeClusterV1beta2
ns string
}
var managedclustersetbindingsResource = v1beta2.SchemeGroupVersion.WithResource("managedclustersetbindings")
var managedclustersetbindingsKind = v1beta2.SchemeGroupVersion.WithKind("ManagedClusterSetBinding")
// Get takes name of the managedClusterSetBinding, and returns the corresponding managedClusterSetBinding object, and an error if there is any.
func (c *FakeManagedClusterSetBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ManagedClusterSetBinding, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(managedclustersetbindingsResource, c.ns, name), &v1beta2.ManagedClusterSetBinding{})
if obj == nil {
return nil, err
func newFakeManagedClusterSetBindings(fake *FakeClusterV1beta2, namespace string) clusterv1beta2.ManagedClusterSetBindingInterface {
return &fakeManagedClusterSetBindings{
gentype.NewFakeClientWithList[*v1beta2.ManagedClusterSetBinding, *v1beta2.ManagedClusterSetBindingList](
fake.Fake,
namespace,
v1beta2.SchemeGroupVersion.WithResource("managedclustersetbindings"),
v1beta2.SchemeGroupVersion.WithKind("ManagedClusterSetBinding"),
func() *v1beta2.ManagedClusterSetBinding { return &v1beta2.ManagedClusterSetBinding{} },
func() *v1beta2.ManagedClusterSetBindingList { return &v1beta2.ManagedClusterSetBindingList{} },
func(dst, src *v1beta2.ManagedClusterSetBindingList) { dst.ListMeta = src.ListMeta },
func(list *v1beta2.ManagedClusterSetBindingList) []*v1beta2.ManagedClusterSetBinding {
return gentype.ToPointerSlice(list.Items)
},
func(list *v1beta2.ManagedClusterSetBindingList, items []*v1beta2.ManagedClusterSetBinding) {
list.Items = gentype.FromPointerSlice(items)
},
),
fake,
}
return obj.(*v1beta2.ManagedClusterSetBinding), err
}
// List takes label and field selectors, and returns the list of ManagedClusterSetBindings that match those selectors.
func (c *FakeManagedClusterSetBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ManagedClusterSetBindingList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(managedclustersetbindingsResource, managedclustersetbindingsKind, c.ns, opts), &v1beta2.ManagedClusterSetBindingList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1beta2.ManagedClusterSetBindingList{ListMeta: obj.(*v1beta2.ManagedClusterSetBindingList).ListMeta}
for _, item := range obj.(*v1beta2.ManagedClusterSetBindingList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested managedClusterSetBindings.
func (c *FakeManagedClusterSetBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(managedclustersetbindingsResource, c.ns, opts))
}
// Create takes the representation of a managedClusterSetBinding and creates it. Returns the server's representation of the managedClusterSetBinding, and an error, if there is any.
func (c *FakeManagedClusterSetBindings) Create(ctx context.Context, managedClusterSetBinding *v1beta2.ManagedClusterSetBinding, opts v1.CreateOptions) (result *v1beta2.ManagedClusterSetBinding, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(managedclustersetbindingsResource, c.ns, managedClusterSetBinding), &v1beta2.ManagedClusterSetBinding{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.ManagedClusterSetBinding), err
}
// Update takes the representation of a managedClusterSetBinding and updates it. Returns the server's representation of the managedClusterSetBinding, and an error, if there is any.
func (c *FakeManagedClusterSetBindings) Update(ctx context.Context, managedClusterSetBinding *v1beta2.ManagedClusterSetBinding, opts v1.UpdateOptions) (result *v1beta2.ManagedClusterSetBinding, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(managedclustersetbindingsResource, c.ns, managedClusterSetBinding), &v1beta2.ManagedClusterSetBinding{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.ManagedClusterSetBinding), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeManagedClusterSetBindings) UpdateStatus(ctx context.Context, managedClusterSetBinding *v1beta2.ManagedClusterSetBinding, opts v1.UpdateOptions) (*v1beta2.ManagedClusterSetBinding, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(managedclustersetbindingsResource, "status", c.ns, managedClusterSetBinding), &v1beta2.ManagedClusterSetBinding{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.ManagedClusterSetBinding), err
}
// Delete takes name of the managedClusterSetBinding and deletes it. Returns an error if one occurs.
func (c *FakeManagedClusterSetBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteActionWithOptions(managedclustersetbindingsResource, c.ns, name, opts), &v1beta2.ManagedClusterSetBinding{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeManagedClusterSetBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(managedclustersetbindingsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta2.ManagedClusterSetBindingList{})
return err
}
// Patch applies the patch and returns the patched managedClusterSetBinding.
func (c *FakeManagedClusterSetBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ManagedClusterSetBinding, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(managedclustersetbindingsResource, c.ns, name, pt, data, subresources...), &v1beta2.ManagedClusterSetBinding{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.ManagedClusterSetBinding), err
}

View File

@@ -3,15 +3,14 @@
package v1beta2
import (
"context"
"time"
context "context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
gentype "k8s.io/client-go/gentype"
scheme "open-cluster-management.io/api/client/cluster/clientset/versioned/scheme"
v1beta2 "open-cluster-management.io/api/cluster/v1beta2"
clusterv1beta2 "open-cluster-management.io/api/cluster/v1beta2"
)
// ManagedClusterSetsGetter has a method to return a ManagedClusterSetInterface.
@@ -22,147 +21,34 @@ type ManagedClusterSetsGetter interface {
// ManagedClusterSetInterface has methods to work with ManagedClusterSet resources.
type ManagedClusterSetInterface interface {
Create(ctx context.Context, managedClusterSet *v1beta2.ManagedClusterSet, opts v1.CreateOptions) (*v1beta2.ManagedClusterSet, error)
Update(ctx context.Context, managedClusterSet *v1beta2.ManagedClusterSet, opts v1.UpdateOptions) (*v1beta2.ManagedClusterSet, error)
UpdateStatus(ctx context.Context, managedClusterSet *v1beta2.ManagedClusterSet, opts v1.UpdateOptions) (*v1beta2.ManagedClusterSet, error)
Create(ctx context.Context, managedClusterSet *clusterv1beta2.ManagedClusterSet, opts v1.CreateOptions) (*clusterv1beta2.ManagedClusterSet, error)
Update(ctx context.Context, managedClusterSet *clusterv1beta2.ManagedClusterSet, opts v1.UpdateOptions) (*clusterv1beta2.ManagedClusterSet, error)
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, managedClusterSet *clusterv1beta2.ManagedClusterSet, opts v1.UpdateOptions) (*clusterv1beta2.ManagedClusterSet, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.ManagedClusterSet, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ManagedClusterSetList, error)
Get(ctx context.Context, name string, opts v1.GetOptions) (*clusterv1beta2.ManagedClusterSet, error)
List(ctx context.Context, opts v1.ListOptions) (*clusterv1beta2.ManagedClusterSetList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ManagedClusterSet, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *clusterv1beta2.ManagedClusterSet, err error)
ManagedClusterSetExpansion
}
// managedClusterSets implements ManagedClusterSetInterface
type managedClusterSets struct {
client rest.Interface
*gentype.ClientWithList[*clusterv1beta2.ManagedClusterSet, *clusterv1beta2.ManagedClusterSetList]
}
// newManagedClusterSets returns a ManagedClusterSets
func newManagedClusterSets(c *ClusterV1beta2Client) *managedClusterSets {
return &managedClusterSets{
client: c.RESTClient(),
gentype.NewClientWithList[*clusterv1beta2.ManagedClusterSet, *clusterv1beta2.ManagedClusterSetList](
"managedclustersets",
c.RESTClient(),
scheme.ParameterCodec,
"",
func() *clusterv1beta2.ManagedClusterSet { return &clusterv1beta2.ManagedClusterSet{} },
func() *clusterv1beta2.ManagedClusterSetList { return &clusterv1beta2.ManagedClusterSetList{} },
),
}
}
// Get takes name of the managedClusterSet, and returns the corresponding managedClusterSet object, and an error if there is any.
func (c *managedClusterSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ManagedClusterSet, err error) {
result = &v1beta2.ManagedClusterSet{}
err = c.client.Get().
Resource("managedclustersets").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of ManagedClusterSets that match those selectors.
func (c *managedClusterSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ManagedClusterSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.ManagedClusterSetList{}
err = c.client.Get().
Resource("managedclustersets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested managedClusterSets.
func (c *managedClusterSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Resource("managedclustersets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a managedClusterSet and creates it. Returns the server's representation of the managedClusterSet, and an error, if there is any.
func (c *managedClusterSets) Create(ctx context.Context, managedClusterSet *v1beta2.ManagedClusterSet, opts v1.CreateOptions) (result *v1beta2.ManagedClusterSet, err error) {
result = &v1beta2.ManagedClusterSet{}
err = c.client.Post().
Resource("managedclustersets").
VersionedParams(&opts, scheme.ParameterCodec).
Body(managedClusterSet).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a managedClusterSet and updates it. Returns the server's representation of the managedClusterSet, and an error, if there is any.
func (c *managedClusterSets) Update(ctx context.Context, managedClusterSet *v1beta2.ManagedClusterSet, opts v1.UpdateOptions) (result *v1beta2.ManagedClusterSet, err error) {
result = &v1beta2.ManagedClusterSet{}
err = c.client.Put().
Resource("managedclustersets").
Name(managedClusterSet.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(managedClusterSet).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *managedClusterSets) UpdateStatus(ctx context.Context, managedClusterSet *v1beta2.ManagedClusterSet, opts v1.UpdateOptions) (result *v1beta2.ManagedClusterSet, err error) {
result = &v1beta2.ManagedClusterSet{}
err = c.client.Put().
Resource("managedclustersets").
Name(managedClusterSet.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(managedClusterSet).
Do(ctx).
Into(result)
return
}
// Delete takes name of the managedClusterSet and deletes it. Returns an error if one occurs.
func (c *managedClusterSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Resource("managedclustersets").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *managedClusterSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("managedclustersets").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched managedClusterSet.
func (c *managedClusterSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ManagedClusterSet, err error) {
result = &v1beta2.ManagedClusterSet{}
err = c.client.Patch(pt).
Resource("managedclustersets").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -3,15 +3,14 @@
package v1beta2
import (
"context"
"time"
context "context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
gentype "k8s.io/client-go/gentype"
scheme "open-cluster-management.io/api/client/cluster/clientset/versioned/scheme"
v1beta2 "open-cluster-management.io/api/cluster/v1beta2"
clusterv1beta2 "open-cluster-management.io/api/cluster/v1beta2"
)
// ManagedClusterSetBindingsGetter has a method to return a ManagedClusterSetBindingInterface.
@@ -22,158 +21,36 @@ type ManagedClusterSetBindingsGetter interface {
// ManagedClusterSetBindingInterface has methods to work with ManagedClusterSetBinding resources.
type ManagedClusterSetBindingInterface interface {
Create(ctx context.Context, managedClusterSetBinding *v1beta2.ManagedClusterSetBinding, opts v1.CreateOptions) (*v1beta2.ManagedClusterSetBinding, error)
Update(ctx context.Context, managedClusterSetBinding *v1beta2.ManagedClusterSetBinding, opts v1.UpdateOptions) (*v1beta2.ManagedClusterSetBinding, error)
UpdateStatus(ctx context.Context, managedClusterSetBinding *v1beta2.ManagedClusterSetBinding, opts v1.UpdateOptions) (*v1beta2.ManagedClusterSetBinding, error)
Create(ctx context.Context, managedClusterSetBinding *clusterv1beta2.ManagedClusterSetBinding, opts v1.CreateOptions) (*clusterv1beta2.ManagedClusterSetBinding, error)
Update(ctx context.Context, managedClusterSetBinding *clusterv1beta2.ManagedClusterSetBinding, opts v1.UpdateOptions) (*clusterv1beta2.ManagedClusterSetBinding, error)
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, managedClusterSetBinding *clusterv1beta2.ManagedClusterSetBinding, opts v1.UpdateOptions) (*clusterv1beta2.ManagedClusterSetBinding, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.ManagedClusterSetBinding, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ManagedClusterSetBindingList, error)
Get(ctx context.Context, name string, opts v1.GetOptions) (*clusterv1beta2.ManagedClusterSetBinding, error)
List(ctx context.Context, opts v1.ListOptions) (*clusterv1beta2.ManagedClusterSetBindingList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ManagedClusterSetBinding, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *clusterv1beta2.ManagedClusterSetBinding, err error)
ManagedClusterSetBindingExpansion
}
// managedClusterSetBindings implements ManagedClusterSetBindingInterface
type managedClusterSetBindings struct {
client rest.Interface
ns string
*gentype.ClientWithList[*clusterv1beta2.ManagedClusterSetBinding, *clusterv1beta2.ManagedClusterSetBindingList]
}
// newManagedClusterSetBindings returns a ManagedClusterSetBindings
func newManagedClusterSetBindings(c *ClusterV1beta2Client, namespace string) *managedClusterSetBindings {
return &managedClusterSetBindings{
client: c.RESTClient(),
ns: namespace,
gentype.NewClientWithList[*clusterv1beta2.ManagedClusterSetBinding, *clusterv1beta2.ManagedClusterSetBindingList](
"managedclustersetbindings",
c.RESTClient(),
scheme.ParameterCodec,
namespace,
func() *clusterv1beta2.ManagedClusterSetBinding { return &clusterv1beta2.ManagedClusterSetBinding{} },
func() *clusterv1beta2.ManagedClusterSetBindingList {
return &clusterv1beta2.ManagedClusterSetBindingList{}
},
),
}
}
// Get takes name of the managedClusterSetBinding, and returns the corresponding managedClusterSetBinding object, and an error if there is any.
func (c *managedClusterSetBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ManagedClusterSetBinding, err error) {
result = &v1beta2.ManagedClusterSetBinding{}
err = c.client.Get().
Namespace(c.ns).
Resource("managedclustersetbindings").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of ManagedClusterSetBindings that match those selectors.
func (c *managedClusterSetBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ManagedClusterSetBindingList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.ManagedClusterSetBindingList{}
err = c.client.Get().
Namespace(c.ns).
Resource("managedclustersetbindings").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested managedClusterSetBindings.
func (c *managedClusterSetBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("managedclustersetbindings").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a managedClusterSetBinding and creates it. Returns the server's representation of the managedClusterSetBinding, and an error, if there is any.
func (c *managedClusterSetBindings) Create(ctx context.Context, managedClusterSetBinding *v1beta2.ManagedClusterSetBinding, opts v1.CreateOptions) (result *v1beta2.ManagedClusterSetBinding, err error) {
result = &v1beta2.ManagedClusterSetBinding{}
err = c.client.Post().
Namespace(c.ns).
Resource("managedclustersetbindings").
VersionedParams(&opts, scheme.ParameterCodec).
Body(managedClusterSetBinding).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a managedClusterSetBinding and updates it. Returns the server's representation of the managedClusterSetBinding, and an error, if there is any.
func (c *managedClusterSetBindings) Update(ctx context.Context, managedClusterSetBinding *v1beta2.ManagedClusterSetBinding, opts v1.UpdateOptions) (result *v1beta2.ManagedClusterSetBinding, err error) {
result = &v1beta2.ManagedClusterSetBinding{}
err = c.client.Put().
Namespace(c.ns).
Resource("managedclustersetbindings").
Name(managedClusterSetBinding.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(managedClusterSetBinding).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *managedClusterSetBindings) UpdateStatus(ctx context.Context, managedClusterSetBinding *v1beta2.ManagedClusterSetBinding, opts v1.UpdateOptions) (result *v1beta2.ManagedClusterSetBinding, err error) {
result = &v1beta2.ManagedClusterSetBinding{}
err = c.client.Put().
Namespace(c.ns).
Resource("managedclustersetbindings").
Name(managedClusterSetBinding.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(managedClusterSetBinding).
Do(ctx).
Into(result)
return
}
// Delete takes name of the managedClusterSetBinding and deletes it. Returns an error if one occurs.
func (c *managedClusterSetBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("managedclustersetbindings").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *managedClusterSetBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("managedclustersetbindings").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched managedClusterSetBinding.
func (c *managedClusterSetBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ManagedClusterSetBinding, err error) {
result = &v1beta2.ManagedClusterSetBinding{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("managedclustersetbindings").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -3,7 +3,7 @@
package v1
import (
"context"
context "context"
time "time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -12,15 +12,15 @@ import (
cache "k8s.io/client-go/tools/cache"
versioned "open-cluster-management.io/api/client/cluster/clientset/versioned"
internalinterfaces "open-cluster-management.io/api/client/cluster/informers/externalversions/internalinterfaces"
v1 "open-cluster-management.io/api/client/cluster/listers/cluster/v1"
clusterv1 "open-cluster-management.io/api/cluster/v1"
clusterv1 "open-cluster-management.io/api/client/cluster/listers/cluster/v1"
apiclusterv1 "open-cluster-management.io/api/cluster/v1"
)
// ManagedClusterInformer provides access to a shared informer and lister for
// ManagedClusters.
type ManagedClusterInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1.ManagedClusterLister
Lister() clusterv1.ManagedClusterLister
}
type managedClusterInformer struct {
@@ -54,7 +54,7 @@ func NewFilteredManagedClusterInformer(client versioned.Interface, resyncPeriod
return client.ClusterV1().ManagedClusters().Watch(context.TODO(), options)
},
},
&clusterv1.ManagedCluster{},
&apiclusterv1.ManagedCluster{},
resyncPeriod,
indexers,
)
@@ -65,9 +65,9 @@ func (f *managedClusterInformer) defaultInformer(client versioned.Interface, res
}
func (f *managedClusterInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&clusterv1.ManagedCluster{}, f.defaultInformer)
return f.factory.InformerFor(&apiclusterv1.ManagedCluster{}, f.defaultInformer)
}
func (f *managedClusterInformer) Lister() v1.ManagedClusterLister {
return v1.NewManagedClusterLister(f.Informer().GetIndexer())
func (f *managedClusterInformer) Lister() clusterv1.ManagedClusterLister {
return clusterv1.NewManagedClusterLister(f.Informer().GetIndexer())
}

View File

@@ -3,7 +3,7 @@
package v1alpha1
import (
"context"
context "context"
time "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -12,15 +12,15 @@ import (
cache "k8s.io/client-go/tools/cache"
versioned "open-cluster-management.io/api/client/cluster/clientset/versioned"
internalinterfaces "open-cluster-management.io/api/client/cluster/informers/externalversions/internalinterfaces"
v1alpha1 "open-cluster-management.io/api/client/cluster/listers/cluster/v1alpha1"
clusterv1alpha1 "open-cluster-management.io/api/cluster/v1alpha1"
clusterv1alpha1 "open-cluster-management.io/api/client/cluster/listers/cluster/v1alpha1"
apiclusterv1alpha1 "open-cluster-management.io/api/cluster/v1alpha1"
)
// AddOnPlacementScoreInformer provides access to a shared informer and lister for
// AddOnPlacementScores.
type AddOnPlacementScoreInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.AddOnPlacementScoreLister
Lister() clusterv1alpha1.AddOnPlacementScoreLister
}
type addOnPlacementScoreInformer struct {
@@ -55,7 +55,7 @@ func NewFilteredAddOnPlacementScoreInformer(client versioned.Interface, namespac
return client.ClusterV1alpha1().AddOnPlacementScores(namespace).Watch(context.TODO(), options)
},
},
&clusterv1alpha1.AddOnPlacementScore{},
&apiclusterv1alpha1.AddOnPlacementScore{},
resyncPeriod,
indexers,
)
@@ -66,9 +66,9 @@ func (f *addOnPlacementScoreInformer) defaultInformer(client versioned.Interface
}
func (f *addOnPlacementScoreInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&clusterv1alpha1.AddOnPlacementScore{}, f.defaultInformer)
return f.factory.InformerFor(&apiclusterv1alpha1.AddOnPlacementScore{}, f.defaultInformer)
}
func (f *addOnPlacementScoreInformer) Lister() v1alpha1.AddOnPlacementScoreLister {
return v1alpha1.NewAddOnPlacementScoreLister(f.Informer().GetIndexer())
func (f *addOnPlacementScoreInformer) Lister() clusterv1alpha1.AddOnPlacementScoreLister {
return clusterv1alpha1.NewAddOnPlacementScoreLister(f.Informer().GetIndexer())
}

View File

@@ -3,7 +3,7 @@
package v1alpha1
import (
"context"
context "context"
time "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -12,15 +12,15 @@ import (
cache "k8s.io/client-go/tools/cache"
versioned "open-cluster-management.io/api/client/cluster/clientset/versioned"
internalinterfaces "open-cluster-management.io/api/client/cluster/informers/externalversions/internalinterfaces"
v1alpha1 "open-cluster-management.io/api/client/cluster/listers/cluster/v1alpha1"
clusterv1alpha1 "open-cluster-management.io/api/cluster/v1alpha1"
clusterv1alpha1 "open-cluster-management.io/api/client/cluster/listers/cluster/v1alpha1"
apiclusterv1alpha1 "open-cluster-management.io/api/cluster/v1alpha1"
)
// ClusterClaimInformer provides access to a shared informer and lister for
// ClusterClaims.
type ClusterClaimInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.ClusterClaimLister
Lister() clusterv1alpha1.ClusterClaimLister
}
type clusterClaimInformer struct {
@@ -54,7 +54,7 @@ func NewFilteredClusterClaimInformer(client versioned.Interface, resyncPeriod ti
return client.ClusterV1alpha1().ClusterClaims().Watch(context.TODO(), options)
},
},
&clusterv1alpha1.ClusterClaim{},
&apiclusterv1alpha1.ClusterClaim{},
resyncPeriod,
indexers,
)
@@ -65,9 +65,9 @@ func (f *clusterClaimInformer) defaultInformer(client versioned.Interface, resyn
}
func (f *clusterClaimInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&clusterv1alpha1.ClusterClaim{}, f.defaultInformer)
return f.factory.InformerFor(&apiclusterv1alpha1.ClusterClaim{}, f.defaultInformer)
}
func (f *clusterClaimInformer) Lister() v1alpha1.ClusterClaimLister {
return v1alpha1.NewClusterClaimLister(f.Informer().GetIndexer())
func (f *clusterClaimInformer) Lister() clusterv1alpha1.ClusterClaimLister {
return clusterv1alpha1.NewClusterClaimLister(f.Informer().GetIndexer())
}

View File

@@ -3,7 +3,7 @@
package v1beta1
import (
"context"
context "context"
time "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -12,15 +12,15 @@ import (
cache "k8s.io/client-go/tools/cache"
versioned "open-cluster-management.io/api/client/cluster/clientset/versioned"
internalinterfaces "open-cluster-management.io/api/client/cluster/informers/externalversions/internalinterfaces"
v1beta1 "open-cluster-management.io/api/client/cluster/listers/cluster/v1beta1"
clusterv1beta1 "open-cluster-management.io/api/cluster/v1beta1"
clusterv1beta1 "open-cluster-management.io/api/client/cluster/listers/cluster/v1beta1"
apiclusterv1beta1 "open-cluster-management.io/api/cluster/v1beta1"
)
// PlacementInformer provides access to a shared informer and lister for
// Placements.
type PlacementInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1beta1.PlacementLister
Lister() clusterv1beta1.PlacementLister
}
type placementInformer struct {
@@ -55,7 +55,7 @@ func NewFilteredPlacementInformer(client versioned.Interface, namespace string,
return client.ClusterV1beta1().Placements(namespace).Watch(context.TODO(), options)
},
},
&clusterv1beta1.Placement{},
&apiclusterv1beta1.Placement{},
resyncPeriod,
indexers,
)
@@ -66,9 +66,9 @@ func (f *placementInformer) defaultInformer(client versioned.Interface, resyncPe
}
func (f *placementInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&clusterv1beta1.Placement{}, f.defaultInformer)
return f.factory.InformerFor(&apiclusterv1beta1.Placement{}, f.defaultInformer)
}
func (f *placementInformer) Lister() v1beta1.PlacementLister {
return v1beta1.NewPlacementLister(f.Informer().GetIndexer())
func (f *placementInformer) Lister() clusterv1beta1.PlacementLister {
return clusterv1beta1.NewPlacementLister(f.Informer().GetIndexer())
}

View File

@@ -3,7 +3,7 @@
package v1beta1
import (
"context"
context "context"
time "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -12,15 +12,15 @@ import (
cache "k8s.io/client-go/tools/cache"
versioned "open-cluster-management.io/api/client/cluster/clientset/versioned"
internalinterfaces "open-cluster-management.io/api/client/cluster/informers/externalversions/internalinterfaces"
v1beta1 "open-cluster-management.io/api/client/cluster/listers/cluster/v1beta1"
clusterv1beta1 "open-cluster-management.io/api/cluster/v1beta1"
clusterv1beta1 "open-cluster-management.io/api/client/cluster/listers/cluster/v1beta1"
apiclusterv1beta1 "open-cluster-management.io/api/cluster/v1beta1"
)
// PlacementDecisionInformer provides access to a shared informer and lister for
// PlacementDecisions.
type PlacementDecisionInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1beta1.PlacementDecisionLister
Lister() clusterv1beta1.PlacementDecisionLister
}
type placementDecisionInformer struct {
@@ -55,7 +55,7 @@ func NewFilteredPlacementDecisionInformer(client versioned.Interface, namespace
return client.ClusterV1beta1().PlacementDecisions(namespace).Watch(context.TODO(), options)
},
},
&clusterv1beta1.PlacementDecision{},
&apiclusterv1beta1.PlacementDecision{},
resyncPeriod,
indexers,
)
@@ -66,9 +66,9 @@ func (f *placementDecisionInformer) defaultInformer(client versioned.Interface,
}
func (f *placementDecisionInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&clusterv1beta1.PlacementDecision{}, f.defaultInformer)
return f.factory.InformerFor(&apiclusterv1beta1.PlacementDecision{}, f.defaultInformer)
}
func (f *placementDecisionInformer) Lister() v1beta1.PlacementDecisionLister {
return v1beta1.NewPlacementDecisionLister(f.Informer().GetIndexer())
func (f *placementDecisionInformer) Lister() clusterv1beta1.PlacementDecisionLister {
return clusterv1beta1.NewPlacementDecisionLister(f.Informer().GetIndexer())
}

View File

@@ -3,7 +3,7 @@
package v1beta2
import (
"context"
context "context"
time "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -12,15 +12,15 @@ import (
cache "k8s.io/client-go/tools/cache"
versioned "open-cluster-management.io/api/client/cluster/clientset/versioned"
internalinterfaces "open-cluster-management.io/api/client/cluster/informers/externalversions/internalinterfaces"
v1beta2 "open-cluster-management.io/api/client/cluster/listers/cluster/v1beta2"
clusterv1beta2 "open-cluster-management.io/api/cluster/v1beta2"
clusterv1beta2 "open-cluster-management.io/api/client/cluster/listers/cluster/v1beta2"
apiclusterv1beta2 "open-cluster-management.io/api/cluster/v1beta2"
)
// ManagedClusterSetInformer provides access to a shared informer and lister for
// ManagedClusterSets.
type ManagedClusterSetInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1beta2.ManagedClusterSetLister
Lister() clusterv1beta2.ManagedClusterSetLister
}
type managedClusterSetInformer struct {
@@ -54,7 +54,7 @@ func NewFilteredManagedClusterSetInformer(client versioned.Interface, resyncPeri
return client.ClusterV1beta2().ManagedClusterSets().Watch(context.TODO(), options)
},
},
&clusterv1beta2.ManagedClusterSet{},
&apiclusterv1beta2.ManagedClusterSet{},
resyncPeriod,
indexers,
)
@@ -65,9 +65,9 @@ func (f *managedClusterSetInformer) defaultInformer(client versioned.Interface,
}
func (f *managedClusterSetInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&clusterv1beta2.ManagedClusterSet{}, f.defaultInformer)
return f.factory.InformerFor(&apiclusterv1beta2.ManagedClusterSet{}, f.defaultInformer)
}
func (f *managedClusterSetInformer) Lister() v1beta2.ManagedClusterSetLister {
return v1beta2.NewManagedClusterSetLister(f.Informer().GetIndexer())
func (f *managedClusterSetInformer) Lister() clusterv1beta2.ManagedClusterSetLister {
return clusterv1beta2.NewManagedClusterSetLister(f.Informer().GetIndexer())
}

View File

@@ -3,7 +3,7 @@
package v1beta2
import (
"context"
context "context"
time "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -12,15 +12,15 @@ import (
cache "k8s.io/client-go/tools/cache"
versioned "open-cluster-management.io/api/client/cluster/clientset/versioned"
internalinterfaces "open-cluster-management.io/api/client/cluster/informers/externalversions/internalinterfaces"
v1beta2 "open-cluster-management.io/api/client/cluster/listers/cluster/v1beta2"
clusterv1beta2 "open-cluster-management.io/api/cluster/v1beta2"
clusterv1beta2 "open-cluster-management.io/api/client/cluster/listers/cluster/v1beta2"
apiclusterv1beta2 "open-cluster-management.io/api/cluster/v1beta2"
)
// ManagedClusterSetBindingInformer provides access to a shared informer and lister for
// ManagedClusterSetBindings.
type ManagedClusterSetBindingInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1beta2.ManagedClusterSetBindingLister
Lister() clusterv1beta2.ManagedClusterSetBindingLister
}
type managedClusterSetBindingInformer struct {
@@ -55,7 +55,7 @@ func NewFilteredManagedClusterSetBindingInformer(client versioned.Interface, nam
return client.ClusterV1beta2().ManagedClusterSetBindings(namespace).Watch(context.TODO(), options)
},
},
&clusterv1beta2.ManagedClusterSetBinding{},
&apiclusterv1beta2.ManagedClusterSetBinding{},
resyncPeriod,
indexers,
)
@@ -66,9 +66,9 @@ func (f *managedClusterSetBindingInformer) defaultInformer(client versioned.Inte
}
func (f *managedClusterSetBindingInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&clusterv1beta2.ManagedClusterSetBinding{}, f.defaultInformer)
return f.factory.InformerFor(&apiclusterv1beta2.ManagedClusterSetBinding{}, f.defaultInformer)
}
func (f *managedClusterSetBindingInformer) Lister() v1beta2.ManagedClusterSetBindingLister {
return v1beta2.NewManagedClusterSetBindingLister(f.Informer().GetIndexer())
func (f *managedClusterSetBindingInformer) Lister() clusterv1beta2.ManagedClusterSetBindingLister {
return clusterv1beta2.NewManagedClusterSetBindingLister(f.Informer().GetIndexer())
}

View File

@@ -212,6 +212,7 @@ type SharedInformerFactory interface {
// Start initializes all requested informers. They are handled in goroutines
// which run until the stop channel gets closed.
// Warning: Start does not block. When run in a go-routine, it will race with a later WaitForCacheSync.
Start(stopCh <-chan struct{})
// Shutdown marks a factory as shutting down. At that point no new

View File

@@ -3,7 +3,7 @@
package externalversions
import (
"fmt"
fmt "fmt"
schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache"

View File

@@ -3,10 +3,10 @@
package v1
import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
v1 "open-cluster-management.io/api/cluster/v1"
labels "k8s.io/apimachinery/pkg/labels"
listers "k8s.io/client-go/listers"
cache "k8s.io/client-go/tools/cache"
clusterv1 "open-cluster-management.io/api/cluster/v1"
)
// ManagedClusterLister helps list ManagedClusters.
@@ -14,39 +14,19 @@ import (
type ManagedClusterLister interface {
// List lists all ManagedClusters in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.ManagedCluster, err error)
List(selector labels.Selector) (ret []*clusterv1.ManagedCluster, err error)
// Get retrieves the ManagedCluster from the index for a given name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.ManagedCluster, error)
Get(name string) (*clusterv1.ManagedCluster, error)
ManagedClusterListerExpansion
}
// managedClusterLister implements the ManagedClusterLister interface.
type managedClusterLister struct {
indexer cache.Indexer
listers.ResourceIndexer[*clusterv1.ManagedCluster]
}
// NewManagedClusterLister returns a new ManagedClusterLister.
func NewManagedClusterLister(indexer cache.Indexer) ManagedClusterLister {
return &managedClusterLister{indexer: indexer}
}
// List lists all ManagedClusters in the indexer.
func (s *managedClusterLister) List(selector labels.Selector) (ret []*v1.ManagedCluster, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1.ManagedCluster))
})
return ret, err
}
// Get retrieves the ManagedCluster from the index for a given name.
func (s *managedClusterLister) Get(name string) (*v1.ManagedCluster, error) {
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1.Resource("managedcluster"), name)
}
return obj.(*v1.ManagedCluster), nil
return &managedClusterLister{listers.New[*clusterv1.ManagedCluster](indexer, clusterv1.Resource("managedcluster"))}
}

View File

@@ -3,10 +3,10 @@
package v1alpha1
import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
v1alpha1 "open-cluster-management.io/api/cluster/v1alpha1"
labels "k8s.io/apimachinery/pkg/labels"
listers "k8s.io/client-go/listers"
cache "k8s.io/client-go/tools/cache"
clusterv1alpha1 "open-cluster-management.io/api/cluster/v1alpha1"
)
// AddOnPlacementScoreLister helps list AddOnPlacementScores.
@@ -14,7 +14,7 @@ import (
type AddOnPlacementScoreLister interface {
// List lists all AddOnPlacementScores in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.AddOnPlacementScore, err error)
List(selector labels.Selector) (ret []*clusterv1alpha1.AddOnPlacementScore, err error)
// AddOnPlacementScores returns an object that can list and get AddOnPlacementScores.
AddOnPlacementScores(namespace string) AddOnPlacementScoreNamespaceLister
AddOnPlacementScoreListerExpansion
@@ -22,25 +22,17 @@ type AddOnPlacementScoreLister interface {
// addOnPlacementScoreLister implements the AddOnPlacementScoreLister interface.
type addOnPlacementScoreLister struct {
indexer cache.Indexer
listers.ResourceIndexer[*clusterv1alpha1.AddOnPlacementScore]
}
// NewAddOnPlacementScoreLister returns a new AddOnPlacementScoreLister.
func NewAddOnPlacementScoreLister(indexer cache.Indexer) AddOnPlacementScoreLister {
return &addOnPlacementScoreLister{indexer: indexer}
}
// List lists all AddOnPlacementScores in the indexer.
func (s *addOnPlacementScoreLister) List(selector labels.Selector) (ret []*v1alpha1.AddOnPlacementScore, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.AddOnPlacementScore))
})
return ret, err
return &addOnPlacementScoreLister{listers.New[*clusterv1alpha1.AddOnPlacementScore](indexer, clusterv1alpha1.Resource("addonplacementscore"))}
}
// AddOnPlacementScores returns an object that can list and get AddOnPlacementScores.
func (s *addOnPlacementScoreLister) AddOnPlacementScores(namespace string) AddOnPlacementScoreNamespaceLister {
return addOnPlacementScoreNamespaceLister{indexer: s.indexer, namespace: namespace}
return addOnPlacementScoreNamespaceLister{listers.NewNamespaced[*clusterv1alpha1.AddOnPlacementScore](s.ResourceIndexer, namespace)}
}
// AddOnPlacementScoreNamespaceLister helps list and get AddOnPlacementScores.
@@ -48,36 +40,15 @@ func (s *addOnPlacementScoreLister) AddOnPlacementScores(namespace string) AddOn
type AddOnPlacementScoreNamespaceLister interface {
// List lists all AddOnPlacementScores in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.AddOnPlacementScore, err error)
List(selector labels.Selector) (ret []*clusterv1alpha1.AddOnPlacementScore, err error)
// Get retrieves the AddOnPlacementScore from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha1.AddOnPlacementScore, error)
Get(name string) (*clusterv1alpha1.AddOnPlacementScore, error)
AddOnPlacementScoreNamespaceListerExpansion
}
// addOnPlacementScoreNamespaceLister implements the AddOnPlacementScoreNamespaceLister
// interface.
type addOnPlacementScoreNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all AddOnPlacementScores in the indexer for a given namespace.
func (s addOnPlacementScoreNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.AddOnPlacementScore, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.AddOnPlacementScore))
})
return ret, err
}
// Get retrieves the AddOnPlacementScore from the indexer for a given namespace and name.
func (s addOnPlacementScoreNamespaceLister) Get(name string) (*v1alpha1.AddOnPlacementScore, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("addonplacementscore"), name)
}
return obj.(*v1alpha1.AddOnPlacementScore), nil
listers.ResourceIndexer[*clusterv1alpha1.AddOnPlacementScore]
}

View File

@@ -3,10 +3,10 @@
package v1alpha1
import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
v1alpha1 "open-cluster-management.io/api/cluster/v1alpha1"
labels "k8s.io/apimachinery/pkg/labels"
listers "k8s.io/client-go/listers"
cache "k8s.io/client-go/tools/cache"
clusterv1alpha1 "open-cluster-management.io/api/cluster/v1alpha1"
)
// ClusterClaimLister helps list ClusterClaims.
@@ -14,39 +14,19 @@ import (
type ClusterClaimLister interface {
// List lists all ClusterClaims in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.ClusterClaim, err error)
List(selector labels.Selector) (ret []*clusterv1alpha1.ClusterClaim, err error)
// Get retrieves the ClusterClaim from the index for a given name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha1.ClusterClaim, error)
Get(name string) (*clusterv1alpha1.ClusterClaim, error)
ClusterClaimListerExpansion
}
// clusterClaimLister implements the ClusterClaimLister interface.
type clusterClaimLister struct {
indexer cache.Indexer
listers.ResourceIndexer[*clusterv1alpha1.ClusterClaim]
}
// NewClusterClaimLister returns a new ClusterClaimLister.
func NewClusterClaimLister(indexer cache.Indexer) ClusterClaimLister {
return &clusterClaimLister{indexer: indexer}
}
// List lists all ClusterClaims in the indexer.
func (s *clusterClaimLister) List(selector labels.Selector) (ret []*v1alpha1.ClusterClaim, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.ClusterClaim))
})
return ret, err
}
// Get retrieves the ClusterClaim from the index for a given name.
func (s *clusterClaimLister) Get(name string) (*v1alpha1.ClusterClaim, error) {
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("clusterclaim"), name)
}
return obj.(*v1alpha1.ClusterClaim), nil
return &clusterClaimLister{listers.New[*clusterv1alpha1.ClusterClaim](indexer, clusterv1alpha1.Resource("clusterclaim"))}
}

View File

@@ -3,10 +3,10 @@
package v1beta1
import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
v1beta1 "open-cluster-management.io/api/cluster/v1beta1"
labels "k8s.io/apimachinery/pkg/labels"
listers "k8s.io/client-go/listers"
cache "k8s.io/client-go/tools/cache"
clusterv1beta1 "open-cluster-management.io/api/cluster/v1beta1"
)
// PlacementLister helps list Placements.
@@ -14,7 +14,7 @@ import (
type PlacementLister interface {
// List lists all Placements in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1beta1.Placement, err error)
List(selector labels.Selector) (ret []*clusterv1beta1.Placement, err error)
// Placements returns an object that can list and get Placements.
Placements(namespace string) PlacementNamespaceLister
PlacementListerExpansion
@@ -22,25 +22,17 @@ type PlacementLister interface {
// placementLister implements the PlacementLister interface.
type placementLister struct {
indexer cache.Indexer
listers.ResourceIndexer[*clusterv1beta1.Placement]
}
// NewPlacementLister returns a new PlacementLister.
func NewPlacementLister(indexer cache.Indexer) PlacementLister {
return &placementLister{indexer: indexer}
}
// List lists all Placements in the indexer.
func (s *placementLister) List(selector labels.Selector) (ret []*v1beta1.Placement, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1beta1.Placement))
})
return ret, err
return &placementLister{listers.New[*clusterv1beta1.Placement](indexer, clusterv1beta1.Resource("placement"))}
}
// Placements returns an object that can list and get Placements.
func (s *placementLister) Placements(namespace string) PlacementNamespaceLister {
return placementNamespaceLister{indexer: s.indexer, namespace: namespace}
return placementNamespaceLister{listers.NewNamespaced[*clusterv1beta1.Placement](s.ResourceIndexer, namespace)}
}
// PlacementNamespaceLister helps list and get Placements.
@@ -48,36 +40,15 @@ func (s *placementLister) Placements(namespace string) PlacementNamespaceLister
type PlacementNamespaceLister interface {
// List lists all Placements in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1beta1.Placement, err error)
List(selector labels.Selector) (ret []*clusterv1beta1.Placement, err error)
// Get retrieves the Placement from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1beta1.Placement, error)
Get(name string) (*clusterv1beta1.Placement, error)
PlacementNamespaceListerExpansion
}
// placementNamespaceLister implements the PlacementNamespaceLister
// interface.
type placementNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all Placements in the indexer for a given namespace.
func (s placementNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Placement, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1beta1.Placement))
})
return ret, err
}
// Get retrieves the Placement from the indexer for a given namespace and name.
func (s placementNamespaceLister) Get(name string) (*v1beta1.Placement, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1beta1.Resource("placement"), name)
}
return obj.(*v1beta1.Placement), nil
listers.ResourceIndexer[*clusterv1beta1.Placement]
}

Some files were not shown because too many files have changed in this diff Show More